aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra
diff options
context:
space:
mode:
authorJacek Antonelli2008-08-15 23:44:50 -0500
committerJacek Antonelli2008-08-15 23:44:50 -0500
commit89fe5dab825a62a0e3fd8d248cbc91c65eb2a426 (patch)
treebcff14b7888d04a2fec799c59369f6095224bd08 /linden/indra
parentSecond Life viewer sources 1.13.3.2 (diff)
downloadmeta-impy-89fe5dab825a62a0e3fd8d248cbc91c65eb2a426.zip
meta-impy-89fe5dab825a62a0e3fd8d248cbc91c65eb2a426.tar.gz
meta-impy-89fe5dab825a62a0e3fd8d248cbc91c65eb2a426.tar.bz2
meta-impy-89fe5dab825a62a0e3fd8d248cbc91c65eb2a426.tar.xz
Second Life viewer sources 1.14.0.0
Diffstat (limited to 'linden/indra')
-rw-r--r--linden/indra/SConstruct109
-rw-r--r--linden/indra/indra_complete/indra_complete_vc8.sln587
-rw-r--r--linden/indra/lib/python/indra/llmanifest.py562
-rw-r--r--linden/indra/llaudio/audioengine_fmod.cpp11
-rw-r--r--linden/indra/llaudio/llaudio_vc8.vcproj321
-rw-r--r--linden/indra/llaudio/llaudiodecodemgr.cpp378
-rw-r--r--linden/indra/llaudio/llaudiodecodemgr.h12
-rw-r--r--linden/indra/llcharacter/llbvhloader.cpp38
-rw-r--r--linden/indra/llcharacter/llcharacter.cpp28
-rw-r--r--linden/indra/llcharacter/llcharacter.h5
-rw-r--r--linden/indra/llcharacter/llcharacter_vc8.vcproj416
-rw-r--r--linden/indra/llcharacter/lljoint.cpp87
-rw-r--r--linden/indra/llcharacter/lljoint.h3
-rw-r--r--linden/indra/llcharacter/llkeyframemotion.cpp34
-rw-r--r--linden/indra/llcharacter/llkeyframemotionparam.cpp8
-rw-r--r--linden/indra/llcommon/files.lst6
-rw-r--r--linden/indra/llcommon/imageids.h2
-rw-r--r--linden/indra/llcommon/indra_constants.h12
-rw-r--r--linden/indra/llcommon/linden_common.h1
-rw-r--r--linden/indra/llcommon/llapp.cpp8
-rw-r--r--linden/indra/llcommon/llapr.cpp174
-rw-r--r--linden/indra/llcommon/llapr.h18
-rw-r--r--linden/indra/llcommon/llassettype.cpp14
-rw-r--r--linden/indra/llcommon/llassettype.h1
-rw-r--r--linden/indra/llcommon/llavatarconstants.h12
-rw-r--r--linden/indra/llcommon/llbase32.cpp214
-rw-r--r--linden/indra/llcommon/llbase32.h38
-rw-r--r--linden/indra/llcommon/llbase64.cpp62
-rw-r--r--linden/indra/llcommon/llbase64.h38
-rw-r--r--linden/indra/llcommon/llcommon.cpp1
-rw-r--r--linden/indra/llcommon/llcommon.h1
-rw-r--r--linden/indra/llcommon/llcommon.vcproj38
-rw-r--r--linden/indra/llcommon/llcommon_vc8.vcproj759
-rw-r--r--linden/indra/llcommon/llerror.cpp1043
-rw-r--r--linden/indra/llcommon/llerror.h404
-rw-r--r--linden/indra/llcommon/llerrorbuffer.cpp279
-rw-r--r--linden/indra/llcommon/llerrorbuffer.h117
-rw-r--r--linden/indra/llcommon/llerrorcontrol.h142
-rw-r--r--linden/indra/llcommon/llerrorlegacy.h117
-rw-r--r--linden/indra/llcommon/llerrorstream.cpp188
-rw-r--r--linden/indra/llcommon/llerrorstream.h126
-rw-r--r--linden/indra/llcommon/llevent.cpp10
-rw-r--r--linden/indra/llcommon/llevent.h2
-rw-r--r--linden/indra/llcommon/llfasttimer.h27
-rw-r--r--linden/indra/llcommon/llfile.cpp28
-rw-r--r--linden/indra/llcommon/llfile.h11
-rw-r--r--linden/indra/llcommon/llformat.cpp47
-rw-r--r--linden/indra/llcommon/llformat.h42
-rw-r--r--linden/indra/llcommon/llliveappconfig.cpp65
-rw-r--r--linden/indra/llcommon/llliveappconfig.h (renamed from linden/indra/newview/lldrawpooltreenew.h)37
-rw-r--r--linden/indra/llcommon/lllivefile.cpp88
-rw-r--r--linden/indra/llcommon/lllivefile.h21
-rw-r--r--linden/indra/llcommon/lllslconstants.h4
-rw-r--r--linden/indra/llcommon/llmemory.cpp43
-rw-r--r--linden/indra/llcommon/llmemory.h200
-rw-r--r--linden/indra/llcommon/llmemtype.h1
-rw-r--r--linden/indra/llcommon/llpreprocessor.h7
-rw-r--r--linden/indra/llcommon/llprocessor.cpp10
-rw-r--r--linden/indra/llcommon/llqueuedthread.cpp195
-rw-r--r--linden/indra/llcommon/llqueuedthread.h56
-rw-r--r--linden/indra/llcommon/llsd.cpp6
-rw-r--r--linden/indra/llcommon/llsdserialize.cpp4
-rw-r--r--linden/indra/llcommon/llsdserialize_xml.cpp1
-rw-r--r--linden/indra/llcommon/llsecondlifeurls.cpp4
-rw-r--r--linden/indra/llcommon/llsecondlifeurls.h12
-rw-r--r--linden/indra/llcommon/llstreamtools.cpp2
-rw-r--r--linden/indra/llcommon/llstrider.h1
-rw-r--r--linden/indra/llcommon/llstring.cpp1
-rw-r--r--linden/indra/llcommon/llstring.h13
-rw-r--r--linden/indra/llcommon/llstringtable.h5
-rw-r--r--linden/indra/llcommon/llsys.cpp12
-rw-r--r--linden/indra/llcommon/llthread.cpp63
-rw-r--r--linden/indra/llcommon/llthread.h75
-rw-r--r--linden/indra/llcommon/lluri.cpp482
-rw-r--r--linden/indra/llcommon/lluri.h90
-rw-r--r--linden/indra/llcommon/llversion.h6
-rw-r--r--linden/indra/llcommon/llworkerthread.cpp325
-rw-r--r--linden/indra/llcommon/llworkerthread.h85
-rw-r--r--linden/indra/llcommon/metaproperty.cpp2
-rw-r--r--linden/indra/llcommon/u64.cpp14
-rw-r--r--linden/indra/llimage/files.lst3
-rw-r--r--linden/indra/llimage/llimage.cpp283
-rw-r--r--linden/indra/llimage/llimage.h41
-rw-r--r--linden/indra/llimage/llimage.vcproj6
-rw-r--r--linden/indra/llimage/llimage_vc8.vcproj306
-rw-r--r--linden/indra/llimage/llimagebmp.cpp20
-rw-r--r--linden/indra/llimage/llimagedxt.cpp24
-rw-r--r--linden/indra/llimage/llimagedxt.h5
-rw-r--r--linden/indra/llimage/llimagej2c.cpp28
-rw-r--r--linden/indra/llimage/llimagej2c.h12
-rw-r--r--linden/indra/llimage/llimagejpeg.cpp11
-rw-r--r--linden/indra/llimage/llimagetga.cpp15
-rw-r--r--linden/indra/llimage/llimageworker.cpp184
-rw-r--r--linden/indra/llimage/llimageworker.h76
-rw-r--r--linden/indra/llimagej2coj/llimagej2coj.cpp80
-rw-r--r--linden/indra/llimagej2coj/llimagej2coj.h5
-rw-r--r--linden/indra/llinventory/llinventory.cpp194
-rw-r--r--linden/indra/llinventory/llinventory.h7
-rw-r--r--linden/indra/llinventory/llinventory_vc8.vcproj336
-rw-r--r--linden/indra/llinventory/lllandmark.cpp7
-rw-r--r--linden/indra/llinventory/llnotecard.cpp7
-rw-r--r--linden/indra/llinventory/llnotecard.h15
-rw-r--r--linden/indra/llinventory/llparcel.cpp4
-rw-r--r--linden/indra/llinventory/llpermissions.cpp67
-rw-r--r--linden/indra/llinventory/llsaleinfo.cpp22
-rw-r--r--linden/indra/llmath/llcamera.cpp16
-rw-r--r--linden/indra/llmath/llcoordframe.cpp16
-rw-r--r--linden/indra/llmath/llcrc.cpp25
-rw-r--r--linden/indra/llmath/llmath.vcproj9
-rw-r--r--linden/indra/llmath/llmath_vc8.vcproj453
-rw-r--r--linden/indra/llmath/llmd5.cpp71
-rw-r--r--linden/indra/llmath/llmd5.h2
-rw-r--r--linden/indra/llmath/lloctree.h94
-rw-r--r--linden/indra/llmath/llrand.cpp18
-rw-r--r--linden/indra/llmath/llrand.h6
-rw-r--r--linden/indra/llmath/lltreenode.h5
-rw-r--r--linden/indra/llmath/lluuid.cpp32
-rw-r--r--linden/indra/llmath/lluuid.h7
-rw-r--r--linden/indra/llmath/llvolume.cpp220
-rw-r--r--linden/indra/llmath/llvolume.h3
-rw-r--r--linden/indra/llmath/llvolumemgr.cpp4
-rw-r--r--linden/indra/llmath/m3math.cpp95
-rw-r--r--linden/indra/llmath/m3math.h9
-rw-r--r--linden/indra/llmath/m4math.h9
-rw-r--r--linden/indra/llmath/v2math.h15
-rw-r--r--linden/indra/llmath/v3color.h6
-rw-r--r--linden/indra/llmath/v3math.cpp31
-rw-r--r--linden/indra/llmath/v3math.h43
-rw-r--r--linden/indra/llmath/v4math.h11
-rw-r--r--linden/indra/llmedia/llmedia_vc8.vcproj297
-rw-r--r--linden/indra/llmedia/llmediaengine.cpp2
-rw-r--r--linden/indra/llmedia/llmediaengine.h2
-rw-r--r--linden/indra/llmedia/llmediaimplquicktime.cpp2
-rw-r--r--linden/indra/llmessage/files.lst2
-rw-r--r--linden/indra/llmessage/llassetstorage.cpp318
-rw-r--r--linden/indra/llmessage/llassetstorage.h72
-rw-r--r--linden/indra/llmessage/llblowfishcipher.cpp154
-rw-r--r--linden/indra/llmessage/llblowfishcipher.h (renamed from linden/indra/newview/lltexturebar.h)71
-rw-r--r--linden/indra/llmessage/llbuffer.cpp6
-rw-r--r--linden/indra/llmessage/llcachename.cpp55
-rw-r--r--linden/indra/llmessage/llcachename.h2
-rw-r--r--linden/indra/llmessage/llcipher.h57
-rw-r--r--linden/indra/llmessage/llcurl.cpp343
-rw-r--r--linden/indra/llmessage/llcurl.h118
-rw-r--r--linden/indra/llmessage/lldatapacker.cpp16
-rw-r--r--linden/indra/llmessage/lldispatcher.cpp1
-rw-r--r--linden/indra/llmessage/llfiltersd2xmlrpc.cpp1
-rw-r--r--linden/indra/llmessage/llhost.cpp2
-rw-r--r--linden/indra/llmessage/llhttpassetstorage.cpp428
-rw-r--r--linden/indra/llmessage/llhttpassetstorage.h32
-rw-r--r--linden/indra/llmessage/llhttpclient.cpp107
-rw-r--r--linden/indra/llmessage/llhttpclient.h4
-rw-r--r--linden/indra/llmessage/llinstantmessage.cpp8
-rw-r--r--linden/indra/llmessage/llmail.cpp64
-rw-r--r--linden/indra/llmessage/llmail.h119
-rw-r--r--linden/indra/llmessage/llmessage.vcproj20
-rw-r--r--linden/indra/llmessage/llmessage_vc8.vcproj843
-rw-r--r--linden/indra/llmessage/llnamevalue.cpp28
-rw-r--r--linden/indra/llmessage/llnullcipher.cpp16
-rw-r--r--linden/indra/llmessage/llnullcipher.h49
-rw-r--r--linden/indra/llmessage/llpacketack.h2
-rw-r--r--linden/indra/llmessage/llpacketbuffer.cpp2
-rw-r--r--linden/indra/llmessage/llpacketring.cpp2
-rw-r--r--linden/indra/llmessage/llpartdata.cpp14
-rw-r--r--linden/indra/llmessage/llpartdata.h3
-rw-r--r--linden/indra/llmessage/llpumpio.cpp2
-rw-r--r--linden/indra/llmessage/llsdappservices.cpp2
-rw-r--r--linden/indra/llmessage/llsdmessagesystem.cpp3
-rw-r--r--linden/indra/llmessage/lltransfermanager.cpp20
-rw-r--r--linden/indra/llmessage/lltransfertargetvfile.cpp58
-rw-r--r--linden/indra/llmessage/lltransfertargetvfile.h2
-rw-r--r--linden/indra/llmessage/llxfer.cpp6
-rw-r--r--linden/indra/llmessage/llxfer_file.cpp4
-rw-r--r--linden/indra/llmessage/llxorcipher.cpp16
-rw-r--r--linden/indra/llmessage/llxorcipher.h (renamed from linden/indra/llmessage/llcrypto.h)61
-rw-r--r--linden/indra/llmessage/message.cpp130
-rw-r--r--linden/indra/llmessage/message.h4
-rw-r--r--linden/indra/llmessage/message_prehash.cpp4
-rw-r--r--linden/indra/llmessage/message_prehash.h2
-rw-r--r--linden/indra/llmessage/message_string_table.cpp2
-rw-r--r--linden/indra/llmessage/net.cpp2
-rw-r--r--linden/indra/llmessage/partsyspacket.cpp2
-rw-r--r--linden/indra/llprimitive/llmaterialtable.h2
-rw-r--r--linden/indra/llprimitive/llprimitive.cpp100
-rw-r--r--linden/indra/llprimitive/llprimitive.h1
-rw-r--r--linden/indra/llprimitive/llprimitive_vc8.vcproj316
-rw-r--r--linden/indra/llprimitive/llvolumemessage.cpp51
-rw-r--r--linden/indra/llrender/files.lst4
-rw-r--r--linden/indra/llrender/llagpmempool.cpp194
-rw-r--r--linden/indra/llrender/llagpmempool.h121
-rw-r--r--linden/indra/llrender/llagpmempoolapple.cpp314
-rw-r--r--linden/indra/llrender/llagpmempoolapple.h95
-rw-r--r--linden/indra/llrender/llagpmempoolarb.cpp230
-rw-r--r--linden/indra/llrender/llagpmempoolarb.h103
-rw-r--r--linden/indra/llrender/llagpmempoolati.cpp160
-rw-r--r--linden/indra/llrender/llagpmempoolati.h92
-rw-r--r--linden/indra/llrender/llagpmempoolnv.cpp320
-rw-r--r--linden/indra/llrender/llagpmempoolnv.h95
-rw-r--r--linden/indra/llrender/llfont.h1
-rw-r--r--linden/indra/llrender/llfontgl.cpp12
-rw-r--r--linden/indra/llrender/llgldbg.cpp8
-rw-r--r--linden/indra/llrender/llimagegl.cpp34
-rw-r--r--linden/indra/llrender/llimagegl.h3
-rw-r--r--linden/indra/llrender/llrender.vcproj18
-rw-r--r--linden/indra/llrender/llrender_vc8.vcproj302
-rw-r--r--linden/indra/llrender/llvertexbuffer.cpp922
-rw-r--r--linden/indra/llrender/llvertexbuffer.h179
-rw-r--r--linden/indra/llrender/llvertexprogramgl.cpp6
-rw-r--r--linden/indra/llrender/text_out.cpp4
-rw-r--r--linden/indra/llui/llalertdialog.cpp2
-rw-r--r--linden/indra/llui/llbutton.cpp2
-rw-r--r--linden/indra/llui/llcombobox.cpp10
-rw-r--r--linden/indra/llui/llcombobox.h3
-rw-r--r--linden/indra/llui/llctrlselectioninterface.cpp88
-rw-r--r--linden/indra/llui/llctrlselectioninterface.h168
-rw-r--r--linden/indra/llui/llfloater.cpp265
-rw-r--r--linden/indra/llui/llfloater.h16
-rw-r--r--linden/indra/llui/llkeywords.cpp24
-rw-r--r--linden/indra/llui/llmenugl.cpp206
-rw-r--r--linden/indra/llui/llmenugl.h79
-rw-r--r--linden/indra/llui/llpanel.cpp34
-rw-r--r--linden/indra/llui/llpanel.h2
-rw-r--r--linden/indra/llui/llresmgr.cpp4
-rw-r--r--linden/indra/llui/llrootview.cpp50
-rw-r--r--linden/indra/llui/llrootview.h46
-rw-r--r--linden/indra/llui/llscrollbar.cpp32
-rw-r--r--linden/indra/llui/llscrolllistctrl.cpp123
-rw-r--r--linden/indra/llui/llscrolllistctrl.h48
-rw-r--r--linden/indra/llui/llsliderctrl.cpp2
-rw-r--r--linden/indra/llui/llspinctrl.cpp2
-rw-r--r--linden/indra/llui/lltexteditor.cpp13
-rw-r--r--linden/indra/llui/llui.cpp6
-rw-r--r--linden/indra/llui/llui_vc8.vcproj588
-rw-r--r--linden/indra/llui/lluictrl.h1
-rw-r--r--linden/indra/llui/lluictrlfactory.cpp14
-rw-r--r--linden/indra/llui/lluictrlfactory.h2
-rw-r--r--linden/indra/llui/llview.cpp29
-rw-r--r--linden/indra/llui/llview.h6
-rw-r--r--linden/indra/llui/llviewquery.cpp252
-rw-r--r--linden/indra/llui/llviewquery.h178
-rw-r--r--linden/indra/llvfs/lldir.cpp78
-rw-r--r--linden/indra/llvfs/lldir.h4
-rw-r--r--linden/indra/llvfs/lldir_linux.cpp14
-rw-r--r--linden/indra/llvfs/lldir_mac.cpp2
-rw-r--r--linden/indra/llvfs/lldir_win32.cpp6
-rw-r--r--linden/indra/llvfs/lllfsthread.cpp235
-rw-r--r--linden/indra/llvfs/lllfsthread.h56
-rw-r--r--linden/indra/llvfs/llvfile.cpp16
-rw-r--r--linden/indra/llvfs/llvfile.h2
-rw-r--r--linden/indra/llvfs/llvfs.cpp177
-rw-r--r--linden/indra/llvfs/llvfs_vc8.vcproj292
-rw-r--r--linden/indra/llvfs/llvfsthread.cpp64
-rw-r--r--linden/indra/llvfs/llvfsthread.h25
-rw-r--r--linden/indra/llwindow/lldxhardware.cpp8
-rw-r--r--linden/indra/llwindow/llgl.cpp155
-rw-r--r--linden/indra/llwindow/llgl.h6
-rw-r--r--linden/indra/llwindow/llglheaders.h10
-rw-r--r--linden/indra/llwindow/llgltypes.h42
-rw-r--r--linden/indra/llwindow/llkeyboard.cpp2
-rw-r--r--linden/indra/llwindow/llkeyboardwin32.cpp16
-rw-r--r--linden/indra/llwindow/llmousehandler.h4
-rw-r--r--linden/indra/llwindow/llwindow.h1
-rw-r--r--linden/indra/llwindow/llwindow_vc8.vcproj392
-rw-r--r--linden/indra/llwindow/llwindowmacosx.cpp31
-rw-r--r--linden/indra/llwindow/llwindowsdl.cpp376
-rw-r--r--linden/indra/llwindow/llwindowsdl.h26
-rw-r--r--linden/indra/llwindow/llwindowwin32.cpp117
-rw-r--r--linden/indra/llwindow/llwindowwin32.h1
-rw-r--r--linden/indra/llxml/llcontrol.cpp75
-rw-r--r--linden/indra/llxml/llcontrol.h6
-rw-r--r--linden/indra/llxml/llxml_vc8.vcproj276
-rw-r--r--linden/indra/llxml/llxmlnode.cpp34
-rw-r--r--linden/indra/llxml/llxmlnode.h1
-rw-r--r--linden/indra/llxml/llxmlparser.cpp12
-rw-r--r--linden/indra/llxml/llxmlparser.h2
-rw-r--r--linden/indra/lscript/lscript_byteformat.h6
-rw-r--r--linden/indra/lscript/lscript_compile/indra.l6
-rw-r--r--linden/indra/lscript/lscript_compile/lscript_bytecode.cpp24
-rw-r--r--linden/indra/lscript/lscript_compile/lscript_compile_fb_vc8.vcproj106
-rw-r--r--linden/indra/lscript/lscript_compile/lscript_compile_ly.vcproj110
-rw-r--r--linden/indra/lscript/lscript_compile/lscript_compile_ly_vc8.vcproj131
-rw-r--r--linden/indra/lscript/lscript_compile/lscript_compile_vc8.vcproj329
-rw-r--r--linden/indra/lscript/lscript_compile/lscript_error.cpp4
-rw-r--r--linden/indra/lscript/lscript_compile/lscript_heap.cpp4
-rw-r--r--linden/indra/lscript/lscript_compile/lscript_scope.h32
-rw-r--r--linden/indra/lscript/lscript_compile/lscript_tree.cpp244
-rw-r--r--linden/indra/lscript/lscript_compile/lscript_tree.h2
-rw-r--r--linden/indra/lscript/lscript_execute/lscript_execute.cpp111
-rw-r--r--linden/indra/lscript/lscript_execute/lscript_execute_vc8.vcproj276
-rw-r--r--linden/indra/lscript/lscript_execute/lscript_readlso.cpp8
-rw-r--r--linden/indra/lscript/lscript_library.h89
-rw-r--r--linden/indra/lscript/lscript_library/lscript_alloc.cpp87
-rw-r--r--linden/indra/lscript/lscript_library/lscript_library.cpp44
-rw-r--r--linden/indra/lscript/lscript_library/lscript_library_vc8.vcproj268
-rw-r--r--linden/indra/mac_crash_logger/mac_crash_logger.cpp27
-rw-r--r--linden/indra/mac_updater/FSCopyObject.c8
-rw-r--r--linden/indra/mac_updater/MoreFilesX.c2
-rw-r--r--linden/indra/mac_updater/mac_updater.cpp76
-rw-r--r--linden/indra/newview/English.lproj/InfoPlist.strings4
-rw-r--r--linden/indra/newview/Info-SecondLife.plist2
-rw-r--r--linden/indra/newview/app_settings/keywords.ini4
-rw-r--r--linden/indra/newview/app_settings/shaders/class1/lighting/lightF.glsl2
-rw-r--r--linden/indra/newview/app_settings/shaders/class1/objects/shinyF.glsl13
-rw-r--r--linden/indra/newview/app_settings/shaders/class1/objects/shinyV.glsl27
-rw-r--r--linden/indra/newview/app_settings/shaders/class2/environment/waterV.glsl2
-rw-r--r--linden/indra/newview/app_settings/shaders/class2/lighting/lightF.glsl2
-rw-r--r--linden/indra/newview/app_settings/shaders/class3/environment/groundF.glsl12
-rw-r--r--linden/indra/newview/app_settings/shaders/class3/environment/groundV.glsl11
-rw-r--r--linden/indra/newview/app_settings/shaders/class3/environment/scatterF.glsl25
-rw-r--r--linden/indra/newview/app_settings/shaders/class3/environment/scatterV.glsl16
-rw-r--r--linden/indra/newview/app_settings/shaders/class3/environment/waterF.glsl145
-rw-r--r--linden/indra/newview/app_settings/viewerart.ini503
-rw-r--r--linden/indra/newview/app_settings/viewerart.xml388
-rw-r--r--linden/indra/newview/character/avatar_lad.xml4
-rw-r--r--linden/indra/newview/featuretable.txt23
-rw-r--r--linden/indra/newview/featuretable_mac.txt16
-rw-r--r--linden/indra/newview/files.lst12
-rw-r--r--linden/indra/newview/gpu_table.txt16
-rw-r--r--linden/indra/newview/help/Advanced/Advanced_Second_Life_Skills.html46
-rw-r--r--linden/indra/newview/help/Advanced/Building_the_Lamp_Base.html68
-rw-r--r--linden/indra/newview/help/Advanced/Building_the_Lamp_Bulb.html43
-rw-r--r--linden/indra/newview/help/Advanced/Building_the_Lamp_Pole.html43
-rw-r--r--linden/indra/newview/help/Advanced/Clothing_Makes_the_Avatar.html73
-rw-r--r--linden/indra/newview/help/Advanced/Creation_101.html53
-rw-r--r--linden/indra/newview/help/Advanced/Dangerous_Time.html37
-rw-r--r--linden/indra/newview/help/Advanced/Getting_Around.html29
-rw-r--r--linden/indra/newview/help/Advanced/Graduation.html29
-rw-r--r--linden/indra/newview/help/Advanced/Home_Time.html29
-rw-r--r--linden/indra/newview/help/Advanced/Installing_a_Script.html73
-rw-r--r--linden/indra/newview/help/Advanced/Modifying_a_Script.html74
-rw-r--r--linden/indra/newview/help/Advanced/More_Ways_to_Communicate.html55
-rw-r--r--linden/indra/newview/help/Advanced/Nesting.html74
-rw-r--r--linden/indra/newview/help/Advanced/Party_Time.html23
-rw-r--r--linden/indra/newview/help/Advanced/People.html40
-rw-r--r--linden/indra/newview/help/Advanced/Personalize_Your_Home.html56
-rw-r--r--linden/indra/newview/help/Advanced/Positioning_with_Numbers.html28
-rw-r--r--linden/indra/newview/help/Advanced/Shopping_201.html47
-rw-r--r--linden/indra/newview/help/Advanced/Simple_on_off.html30
-rw-r--r--linden/indra/newview/help/Advanced/The_Lay_of_the_Land.html44
-rw-r--r--linden/indra/newview/help/Advanced/The_Second_Life_Economy.html18
-rw-r--r--linden/indra/newview/help/Concepts/3D_Terminology.html30
-rw-r--r--linden/indra/newview/help/Concepts/Building_Tools.html22
-rw-r--r--linden/indra/newview/help/Concepts/Building_in_3D.html15
-rw-r--r--linden/indra/newview/help/Concepts/Different_Views.html16
-rw-r--r--linden/indra/newview/help/Concepts/Getting_Around.html15
-rw-r--r--linden/indra/newview/help/Concepts/Hours.html13
-rw-r--r--linden/indra/newview/help/Concepts/Inventory.html17
-rw-r--r--linden/indra/newview/help/Concepts/Many_Ways_to_Get_Help.html20
-rw-r--r--linden/indra/newview/help/Concepts/Money.html19
-rw-r--r--linden/indra/newview/help/Concepts/Other_People.html18
-rw-r--r--linden/indra/newview/help/Concepts/Ownership_and_Permissions.html17
-rw-r--r--linden/indra/newview/help/Concepts/Reporting_Errors.html27
-rw-r--r--linden/indra/newview/help/Concepts/Scripting.html15
-rw-r--r--linden/indra/newview/help/Concepts/Second_Life_Concepts.html33
-rw-r--r--linden/indra/newview/help/Concepts/Strengths.html17
-rw-r--r--linden/indra/newview/help/Concepts/Things_to_do.html26
-rw-r--r--linden/indra/newview/help/Concepts/Tips_For_Newbies.html30
-rw-r--r--linden/indra/newview/help/Concepts/Updates.html17
-rw-r--r--linden/indra/newview/help/Concepts/World.html20
-rw-r--r--linden/indra/newview/help/Concepts/Your_Avatar.html20
-rw-r--r--linden/indra/newview/help/LL_logo.jpgbin890 -> 0 bytes
-rw-r--r--linden/indra/newview/help/MAIN.css553
-rw-r--r--linden/indra/newview/help/basics/basic_skills.html23
-rw-r--r--linden/indra/newview/help/basics/camera.html50
-rw-r--r--linden/indra/newview/help/basics/chat.html20
-rw-r--r--linden/indra/newview/help/basics/congratulations.html16
-rw-r--r--linden/indra/newview/help/basics/customization.html59
-rw-r--r--linden/indra/newview/help/basics/economy.html17
-rw-r--r--linden/indra/newview/help/basics/im.html47
-rw-r--r--linden/indra/newview/help/basics/inventory.html49
-rw-r--r--linden/indra/newview/help/basics/keyboard.html58
-rw-r--r--linden/indra/newview/help/basics/landmarks.html43
-rw-r--r--linden/indra/newview/help/basics/leading.html26
-rw-r--r--linden/indra/newview/help/basics/mouse.html36
-rw-r--r--linden/indra/newview/help/basics/movement.html17
-rw-r--r--linden/indra/newview/help/basics/profile.html28
-rw-r--r--linden/indra/newview/help/basics/shopping.html53
-rw-r--r--linden/indra/newview/help/bg_dots_grey.gifbin44 -> 0 bytes
-rw-r--r--linden/indra/newview/help/community_standards.html52
-rw-r--r--linden/indra/newview/help/graphics_driver_update.html12
-rw-r--r--linden/indra/newview/help/grey_corner_bl.gifbin98 -> 0 bytes
-rw-r--r--linden/indra/newview/help/grey_corner_br.gifbin99 -> 0 bytes
-rw-r--r--linden/indra/newview/help/grey_corner_tl.gifbin99 -> 0 bytes
-rw-r--r--linden/indra/newview/help/grey_corner_tr.gifbin98 -> 0 bytes
-rw-r--r--linden/indra/newview/help/grey_pixel.gifbin43 -> 0 bytes
-rw-r--r--linden/indra/newview/help/header_banner.jpgbin12489 -> 0 bytes
-rw-r--r--linden/indra/newview/help/index.html18
-rw-r--r--linden/indra/newview/help/sl_logo.gifbin2288 -> 0 bytes
-rw-r--r--linden/indra/newview/help/spacer.gifbin43 -> 0 bytes
-rw-r--r--linden/indra/newview/help/unable_to_connect.html149
-rw-r--r--linden/indra/newview/help/unsupported_card.html58
-rw-r--r--linden/indra/newview/help/welcome/avatar.html20
-rw-r--r--linden/indra/newview/help/welcome/buttons.html33
-rw-r--r--linden/indra/newview/help/welcome/chat.html20
-rw-r--r--linden/indra/newview/help/welcome/graduation.html14
-rw-r--r--linden/indra/newview/help/welcome/map.html25
-rw-r--r--linden/indra/newview/help/welcome/menus.html21
-rw-r--r--linden/indra/newview/help/welcome/screen.html19
-rw-r--r--linden/indra/newview/help/welcome/welcome.html31
-rw-r--r--linden/indra/newview/help/welcome/welcomeback.html32
-rw-r--r--linden/indra/newview/help/window_creation_error.html73
-rw-r--r--linden/indra/newview/installer.vcproj184
-rw-r--r--linden/indra/newview/installers/darwin/mac_image_DS_Storebin0 -> 12292 bytes
-rw-r--r--linden/indra/newview/installers/darwin/mac_image_background.tgabin0 -> 589868 bytes
-rw-r--r--linden/indra/newview/installers/darwin/mac_image_hidden1
-rw-r--r--linden/indra/newview/installers/windows/installer_template.nsi862
-rw-r--r--linden/indra/newview/licenses-linux.txt65
-rw-r--r--linden/indra/newview/licenses-mac.txt32
-rw-r--r--linden/indra/newview/licenses-win32.txt32
-rw-r--r--linden/indra/newview/linux_tools/client-manifest-i68648
-rw-r--r--linden/indra/newview/linux_tools/client-readme.txt30
-rwxr-xr-xlinden/indra/newview/linux_tools/package-client.sh133
-rwxr-xr-xlinden/indra/newview/linux_tools/wrapper.sh7
-rw-r--r--linden/indra/newview/llagent.cpp127
-rw-r--r--linden/indra/newview/llagent.h5
-rw-r--r--linden/indra/newview/llagentpilot.cpp9
-rw-r--r--linden/indra/newview/llagparray.h215
-rw-r--r--linden/indra/newview/llagparray.inl519
-rw-r--r--linden/indra/newview/llassetuploadresponders.cpp537
-rw-r--r--linden/indra/newview/llassetuploadresponders.h90
-rw-r--r--linden/indra/newview/llasynchostbyname.h2
-rw-r--r--linden/indra/newview/llcallingcard.cpp12
-rw-r--r--linden/indra/newview/llcallingcard.h12
-rw-r--r--linden/indra/newview/llcameraview.cpp10
-rw-r--r--linden/indra/newview/llchatbar.cpp2
-rw-r--r--linden/indra/newview/llcloud.cpp27
-rw-r--r--linden/indra/newview/llcloud.h4
-rw-r--r--linden/indra/newview/llcolorswatch.h1
-rw-r--r--linden/indra/newview/llcompilequeue.cpp58
-rw-r--r--linden/indra/newview/llconsole.cpp73
-rw-r--r--linden/indra/newview/llconsole.h18
-rw-r--r--linden/indra/newview/llcontroldef.cpp59
-rw-r--r--linden/indra/newview/llcubemap.cpp20
-rw-r--r--linden/indra/newview/llcubemap.h2
-rw-r--r--linden/indra/newview/llcurrencyuimanager.cpp16
-rw-r--r--linden/indra/newview/llcylinder.cpp108
-rw-r--r--linden/indra/newview/llcylinder.h23
-rw-r--r--linden/indra/newview/lldebugmessagebox.cpp10
-rw-r--r--linden/indra/newview/lldirpicker.cpp2
-rw-r--r--linden/indra/newview/lldirpicker.h2
-rw-r--r--linden/indra/newview/lldrawable.cpp633
-rw-r--r--linden/indra/newview/lldrawable.h36
-rw-r--r--linden/indra/newview/lldrawpool.cpp1261
-rw-r--r--linden/indra/newview/lldrawpool.h336
-rw-r--r--linden/indra/newview/lldrawpoolalpha.cpp661
-rw-r--r--linden/indra/newview/lldrawpoolalpha.h58
-rw-r--r--linden/indra/newview/lldrawpoolavatar.cpp631
-rw-r--r--linden/indra/newview/lldrawpoolavatar.h33
-rw-r--r--linden/indra/newview/lldrawpoolbump.cpp662
-rw-r--r--linden/indra/newview/lldrawpoolbump.h62
-rw-r--r--linden/indra/newview/lldrawpoolclouds.cpp21
-rw-r--r--linden/indra/newview/lldrawpoolclouds.h10
-rw-r--r--linden/indra/newview/lldrawpoolground.cpp35
-rw-r--r--linden/indra/newview/lldrawpoolground.h10
-rw-r--r--linden/indra/newview/lldrawpoolhud.cpp565
-rw-r--r--linden/indra/newview/lldrawpoolhud.h75
-rw-r--r--linden/indra/newview/lldrawpoolsimple.cpp234
-rw-r--r--linden/indra/newview/lldrawpoolsimple.h56
-rw-r--r--linden/indra/newview/lldrawpoolsky.cpp32
-rw-r--r--linden/indra/newview/lldrawpoolsky.h14
-rw-r--r--linden/indra/newview/lldrawpoolstars.cpp31
-rw-r--r--linden/indra/newview/lldrawpoolstars.h10
-rw-r--r--linden/indra/newview/lldrawpoolterrain.cpp98
-rw-r--r--linden/indra/newview/lldrawpoolterrain.h16
-rw-r--r--linden/indra/newview/lldrawpooltree.cpp125
-rw-r--r--linden/indra/newview/lldrawpooltree.h12
-rw-r--r--linden/indra/newview/lldrawpooltreenew.cpp200
-rw-r--r--linden/indra/newview/lldrawpoolwater.cpp114
-rw-r--r--linden/indra/newview/lldrawpoolwater.h14
-rw-r--r--linden/indra/newview/lldynamictexture.cpp45
-rw-r--r--linden/indra/newview/lldynamictexture.h1
-rw-r--r--linden/indra/newview/lleventinfo.cpp4
-rw-r--r--linden/indra/newview/llface.cpp1460
-rw-r--r--linden/indra/newview/llface.h194
-rw-r--r--linden/indra/newview/llfasttimerview.cpp78
-rw-r--r--linden/indra/newview/llfasttimerview.h4
-rw-r--r--linden/indra/newview/llfeaturemanager.cpp343
-rw-r--r--linden/indra/newview/llfeaturemanager.h3
-rw-r--r--linden/indra/newview/llfilepicker.cpp84
-rw-r--r--linden/indra/newview/llfilepicker.h5
-rw-r--r--linden/indra/newview/llflexibleobject.cpp314
-rw-r--r--linden/indra/newview/llflexibleobject.h36
-rw-r--r--linden/indra/newview/llfloaterabout.cpp9
-rw-r--r--linden/indra/newview/llfloateraccounthistory.cpp224
-rw-r--r--linden/indra/newview/llfloateraccounthistory.h83
-rw-r--r--linden/indra/newview/llfloateranimpreview.cpp22
-rw-r--r--linden/indra/newview/llfloaterauction.cpp13
-rw-r--r--linden/indra/newview/llfloaterauction.h2
-rw-r--r--linden/indra/newview/llfloateravatarinfo.cpp26
-rw-r--r--linden/indra/newview/llfloateravatarinfo.h2
-rw-r--r--linden/indra/newview/llfloateravatarpicker.cpp8
-rw-r--r--linden/indra/newview/llfloateravatartextures.cpp10
-rw-r--r--linden/indra/newview/llfloaterbuildoptions.cpp4
-rw-r--r--linden/indra/newview/llfloaterbump.cpp2
-rw-r--r--linden/indra/newview/llfloaterbuy.cpp13
-rw-r--r--linden/indra/newview/llfloaterbuy.h2
-rw-r--r--linden/indra/newview/llfloaterbuycontents.cpp15
-rw-r--r--linden/indra/newview/llfloaterbuycontents.h2
-rw-r--r--linden/indra/newview/llfloaterbuycurrency.cpp2
-rw-r--r--linden/indra/newview/llfloaterbuyland.cpp96
-rw-r--r--linden/indra/newview/llfloaterbuyland.h4
-rw-r--r--linden/indra/newview/llfloaterchat.cpp2
-rw-r--r--linden/indra/newview/llfloatercolorpicker.cpp6
-rw-r--r--linden/indra/newview/llfloatercustomize.cpp2
-rw-r--r--linden/indra/newview/llfloaterdirectory.cpp6
-rw-r--r--linden/indra/newview/llfloatereditui.cpp2
-rw-r--r--linden/indra/newview/llfloaterfriends.cpp23
-rw-r--r--linden/indra/newview/llfloatergesture.cpp4
-rw-r--r--linden/indra/newview/llfloatergodtools.cpp12
-rw-r--r--linden/indra/newview/llfloatergroupinfo.cpp2
-rw-r--r--linden/indra/newview/llfloatergroupinvite.cpp2
-rw-r--r--linden/indra/newview/llfloatergroups.cpp4
-rw-r--r--linden/indra/newview/llfloaterimagepreview.cpp17
-rw-r--r--linden/indra/newview/llfloaterimport.cpp23
-rw-r--r--linden/indra/newview/llfloaterinspect.cpp442
-rw-r--r--linden/indra/newview/llfloaterinspect.h97
-rw-r--r--linden/indra/newview/llfloaterland.cpp360
-rw-r--r--linden/indra/newview/llfloaterland.h40
-rw-r--r--linden/indra/newview/llfloaterlandholdings.cpp30
-rw-r--r--linden/indra/newview/llfloatermap.cpp2
-rw-r--r--linden/indra/newview/llfloatermute.cpp2
-rw-r--r--linden/indra/newview/llfloaternamedesc.cpp2
-rw-r--r--linden/indra/newview/llfloaternewim.cpp5
-rw-r--r--linden/indra/newview/llfloateropenobject.cpp19
-rw-r--r--linden/indra/newview/llfloateropenobject.h7
-rw-r--r--linden/indra/newview/llfloaterpermissionsmgr.cpp4
-rw-r--r--linden/indra/newview/llfloaterpostcard.cpp48
-rw-r--r--linden/indra/newview/llfloaterpreference.cpp2
-rw-r--r--linden/indra/newview/llfloaterproperties.cpp30
-rw-r--r--linden/indra/newview/llfloaterrate.cpp14
-rw-r--r--linden/indra/newview/llfloaterrate.h2
-rw-r--r--linden/indra/newview/llfloaterregioninfo.cpp141
-rw-r--r--linden/indra/newview/llfloaterreporter.cpp438
-rw-r--r--linden/indra/newview/llfloaterreporter.h12
-rw-r--r--linden/indra/newview/llfloatersaveavatar.cpp2
-rw-r--r--linden/indra/newview/llfloaterscriptdebug.cpp4
-rwxr-xr-xlinden/indra/newview/llfloatersellland.cpp104
-rwxr-xr-xlinden/indra/newview/llfloatersellland.h4
-rw-r--r--linden/indra/newview/llfloatersnapshot.cpp27
-rw-r--r--linden/indra/newview/llfloatertelehub.cpp16
-rw-r--r--linden/indra/newview/llfloatertelehub.h3
-rw-r--r--linden/indra/newview/llfloatertest.cpp2
-rw-r--r--linden/indra/newview/llfloatertools.cpp30
-rw-r--r--linden/indra/newview/llfloatertools.h11
-rw-r--r--linden/indra/newview/llfloatertopobjects.cpp6
-rw-r--r--linden/indra/newview/llfloatertos.cpp38
-rw-r--r--linden/indra/newview/llfloaterworldmap.cpp10
-rw-r--r--linden/indra/newview/llfloaterworldmap.h12
-rw-r--r--linden/indra/newview/llfolderview.cpp92
-rw-r--r--linden/indra/newview/llfolderview.h19
-rw-r--r--linden/indra/newview/llframestats.cpp16
-rw-r--r--linden/indra/newview/llframestatview.cpp8
-rw-r--r--linden/indra/newview/llframestatview.h2
-rw-r--r--linden/indra/newview/llgenepool.cpp6
-rw-r--r--linden/indra/newview/llgesturemgr.cpp8
-rw-r--r--linden/indra/newview/llgivemoney.cpp27
-rw-r--r--linden/indra/newview/llgivemoney.h4
-rw-r--r--linden/indra/newview/llglsandbox.cpp142
-rw-r--r--linden/indra/newview/llgroupmgr.cpp24
-rw-r--r--linden/indra/newview/llgroupnotify.cpp7
-rw-r--r--linden/indra/newview/llhoverview.cpp20
-rw-r--r--linden/indra/newview/llhoverview.h1
-rw-r--r--linden/indra/newview/llhudeffecttrail.cpp20
-rw-r--r--linden/indra/newview/llhudicon.cpp1
-rw-r--r--linden/indra/newview/llhudobject.cpp2
-rw-r--r--linden/indra/newview/llimpanel.cpp9
-rw-r--r--linden/indra/newview/llimpanel.h2
-rw-r--r--linden/indra/newview/llimview.cpp6
-rw-r--r--linden/indra/newview/llimview.h2
-rw-r--r--linden/indra/newview/llinventoryactions.cpp36
-rw-r--r--linden/indra/newview/llinventorybridge.cpp34
-rw-r--r--linden/indra/newview/llinventorymodel.cpp68
-rw-r--r--linden/indra/newview/llinventoryview.cpp57
-rw-r--r--linden/indra/newview/llinventoryview.h29
-rw-r--r--linden/indra/newview/lljoystickbutton.h1
-rw-r--r--linden/indra/newview/lllandmarklist.cpp2
-rw-r--r--linden/indra/newview/lllogchat.cpp19
-rw-r--r--linden/indra/newview/llmanip.cpp71
-rw-r--r--linden/indra/newview/llmanip.h12
-rw-r--r--linden/indra/newview/llmaniprotate.cpp128
-rw-r--r--linden/indra/newview/llmanipscale.cpp112
-rw-r--r--linden/indra/newview/llmanipscale.h2
-rw-r--r--linden/indra/newview/llmaniptranslate.cpp240
-rw-r--r--linden/indra/newview/llmaniptranslate.h4
-rw-r--r--linden/indra/newview/llmapresponders.cpp161
-rw-r--r--linden/indra/newview/llmemoryview.cpp2
-rw-r--r--linden/indra/newview/llmorphview.cpp2
-rw-r--r--linden/indra/newview/llmoveview.cpp4
-rw-r--r--linden/indra/newview/llmutelist.cpp47
-rw-r--r--linden/indra/newview/llnamebox.cpp6
-rw-r--r--linden/indra/newview/llnameeditor.cpp6
-rw-r--r--linden/indra/newview/llnamelistctrl.cpp16
-rw-r--r--linden/indra/newview/llnetmap.cpp4
-rw-r--r--linden/indra/newview/llnotify.cpp16
-rw-r--r--linden/indra/newview/llpanelavatar.cpp352
-rw-r--r--linden/indra/newview/llpanelavatar.h101
-rw-r--r--linden/indra/newview/llpanelclassified.cpp23
-rw-r--r--linden/indra/newview/llpanelcontents.cpp14
-rw-r--r--linden/indra/newview/llpaneldirbrowser.cpp40
-rw-r--r--linden/indra/newview/llpaneldirevents.cpp4
-rw-r--r--linden/indra/newview/llpaneldisplay.cpp51
-rw-r--r--linden/indra/newview/llpaneldisplay.h10
-rw-r--r--linden/indra/newview/llpanelevent.cpp12
-rw-r--r--linden/indra/newview/llpanelface.cpp21
-rw-r--r--linden/indra/newview/llpanelgroup.cpp2
-rw-r--r--linden/indra/newview/llpanelgroupgeneral.cpp6
-rw-r--r--linden/indra/newview/llpanelgrouplandmoney.cpp84
-rw-r--r--linden/indra/newview/llpanelgroupnotices.cpp15
-rw-r--r--linden/indra/newview/llpanelgrouproles.cpp14
-rw-r--r--linden/indra/newview/llpanelgroupvoting.cpp48
-rw-r--r--linden/indra/newview/llpanelinventory.cpp14
-rw-r--r--linden/indra/newview/llpanelland.cpp8
-rw-r--r--linden/indra/newview/llpanellogin.cpp7
-rw-r--r--linden/indra/newview/llpanellogin.h4
-rw-r--r--linden/indra/newview/llpanelmoney.cpp483
-rw-r--r--linden/indra/newview/llpanelmoney.h106
-rw-r--r--linden/indra/newview/llpanelnetwork.cpp93
-rw-r--r--linden/indra/newview/llpanelnetwork.h9
-rw-r--r--linden/indra/newview/llpanelobject.cpp12
-rw-r--r--linden/indra/newview/llpanelpermissions.cpp57
-rw-r--r--linden/indra/newview/llpanelpick.cpp19
-rw-r--r--linden/indra/newview/llpanelplace.cpp20
-rw-r--r--linden/indra/newview/llpanelvolume.cpp6
-rw-r--r--linden/indra/newview/llpolymesh.cpp43
-rw-r--r--linden/indra/newview/llpolymesh.h1
-rw-r--r--linden/indra/newview/llpolymorph.cpp4
-rw-r--r--linden/indra/newview/llpreview.cpp36
-rw-r--r--linden/indra/newview/llpreview.h13
-rw-r--r--linden/indra/newview/llpreviewgesture.cpp42
-rw-r--r--linden/indra/newview/llpreviewnotecard.cpp81
-rw-r--r--linden/indra/newview/llpreviewnotecard.h8
-rw-r--r--linden/indra/newview/llpreviewscript.cpp539
-rw-r--r--linden/indra/newview/llpreviewscript.h34
-rw-r--r--linden/indra/newview/llpreviewsound.cpp1
-rw-r--r--linden/indra/newview/llpreviewtexture.cpp166
-rw-r--r--linden/indra/newview/llprogressview.cpp8
-rw-r--r--linden/indra/newview/llselectmgr.cpp1715
-rw-r--r--linden/indra/newview/llselectmgr.h261
-rw-r--r--linden/indra/newview/llsky.cpp10
-rw-r--r--linden/indra/newview/llspatialpartition.cpp1887
-rw-r--r--linden/indra/newview/llspatialpartition.h327
-rw-r--r--linden/indra/newview/llsphere.cpp4
-rw-r--r--linden/indra/newview/llsprite.cpp42
-rw-r--r--linden/indra/newview/llstartup.cpp165
-rw-r--r--linden/indra/newview/llstartup.h4
-rw-r--r--linden/indra/newview/llstatbar.cpp18
-rw-r--r--linden/indra/newview/llstatgraph.cpp8
-rw-r--r--linden/indra/newview/llstatusbar.cpp19
-rw-r--r--linden/indra/newview/llstatview.cpp4
-rw-r--r--linden/indra/newview/llsurface.cpp46
-rw-r--r--linden/indra/newview/llsurface.h5
-rw-r--r--linden/indra/newview/llsurfacepatch.cpp2
-rw-r--r--linden/indra/newview/lltexlayer.cpp263
-rw-r--r--linden/indra/newview/lltexlayer.h6
-rw-r--r--linden/indra/newview/lltexturebar.cpp412
-rw-r--r--linden/indra/newview/lltexturecache.cpp1409
-rw-r--r--linden/indra/newview/lltexturecache.h175
-rw-r--r--linden/indra/newview/lltexturectrl.cpp127
-rw-r--r--linden/indra/newview/lltexturefetch.cpp2049
-rw-r--r--linden/indra/newview/lltexturefetch.h73
-rw-r--r--linden/indra/newview/lltextureview.cpp636
-rw-r--r--linden/indra/newview/lltextureview.h13
-rw-r--r--linden/indra/newview/lltool.cpp9
-rw-r--r--linden/indra/newview/lltool.h2
-rw-r--r--linden/indra/newview/lltoolbrush.cpp8
-rw-r--r--linden/indra/newview/lltoolcomp.cpp57
-rw-r--r--linden/indra/newview/lltoolcomp.h7
-rw-r--r--linden/indra/newview/lltooldraganddrop.cpp37
-rw-r--r--linden/indra/newview/lltoolface.cpp4
-rw-r--r--linden/indra/newview/lltoolfocus.cpp18
-rw-r--r--linden/indra/newview/lltoolfocus.h2
-rw-r--r--linden/indra/newview/lltoolgrab.cpp2
-rw-r--r--linden/indra/newview/lltoolgrab.h2
-rw-r--r--linden/indra/newview/lltoolgun.cpp2
-rw-r--r--linden/indra/newview/lltoolgun.h1
-rw-r--r--linden/indra/newview/lltoolindividual.cpp6
-rw-r--r--linden/indra/newview/lltoolmgr.cpp208
-rw-r--r--linden/indra/newview/lltoolmgr.h13
-rw-r--r--linden/indra/newview/lltoolmorph.cpp5
-rw-r--r--linden/indra/newview/lltoolpie.cpp41
-rw-r--r--linden/indra/newview/lltoolpie.h3
-rw-r--r--linden/indra/newview/lltoolplacer.cpp3
-rw-r--r--linden/indra/newview/lltoolplacer.h1
-rw-r--r--linden/indra/newview/lltoolselect.cpp9
-rw-r--r--linden/indra/newview/lltoolselect.h4
-rw-r--r--linden/indra/newview/lltoolselectland.cpp7
-rw-r--r--linden/indra/newview/lltoolselectland.h4
-rw-r--r--linden/indra/newview/lltoolview.cpp5
-rw-r--r--linden/indra/newview/lltracker.cpp6
-rw-r--r--linden/indra/newview/lluploaddialog.cpp7
-rw-r--r--linden/indra/newview/llurl.cpp75
-rw-r--r--linden/indra/newview/llurl.h14
-rw-r--r--linden/indra/newview/llurlwhitelist.cpp24
-rw-r--r--linden/indra/newview/llurlwhitelist.h7
-rw-r--r--linden/indra/newview/lluserauth.cpp18
-rw-r--r--linden/indra/newview/llvelocitybar.cpp4
-rw-r--r--linden/indra/newview/llviewerassetstorage.cpp9
-rw-r--r--linden/indra/newview/llviewercamera.cpp68
-rw-r--r--linden/indra/newview/llviewercamera.h2
-rw-r--r--linden/indra/newview/llviewercontrol.cpp20
-rw-r--r--linden/indra/newview/llviewercontrol.h2
-rw-r--r--linden/indra/newview/llviewerdisplay.cpp245
-rw-r--r--linden/indra/newview/llviewergesture.cpp12
-rw-r--r--linden/indra/newview/llviewerimage.cpp1581
-rw-r--r--linden/indra/newview/llviewerimage.h132
-rw-r--r--linden/indra/newview/llviewerimagelist.cpp1224
-rw-r--r--linden/indra/newview/llviewerimagelist.h41
-rw-r--r--linden/indra/newview/llviewerinventory.cpp22
-rw-r--r--linden/indra/newview/llviewerjoint.cpp150
-rw-r--r--linden/indra/newview/llviewerjoint.h12
-rw-r--r--linden/indra/newview/llviewerjointattachment.cpp39
-rw-r--r--linden/indra/newview/llviewerjointattachment.h4
-rw-r--r--linden/indra/newview/llviewerjointmesh.cpp824
-rw-r--r--linden/indra/newview/llviewerjointmesh.h5
-rw-r--r--linden/indra/newview/llviewerjointshape.cpp2
-rw-r--r--linden/indra/newview/llviewerjointshape.h2
-rw-r--r--linden/indra/newview/llviewerkeyboard.cpp25
-rw-r--r--linden/indra/newview/llviewermenu.cpp1078
-rw-r--r--linden/indra/newview/llviewermenu.h15
-rw-r--r--linden/indra/newview/llviewermessage.cpp233
-rw-r--r--linden/indra/newview/llviewernetwork.cpp8
-rw-r--r--linden/indra/newview/llviewernetwork.h5
-rw-r--r--linden/indra/newview/llviewerobject.cpp262
-rw-r--r--linden/indra/newview/llviewerobject.h51
-rw-r--r--linden/indra/newview/llviewerobjectlist.cpp77
-rw-r--r--linden/indra/newview/llviewerobjectlist.h1
-rw-r--r--linden/indra/newview/llviewerparcelmgr.cpp400
-rw-r--r--linden/indra/newview/llviewerparcelmgr.h147
-rw-r--r--linden/indra/newview/llviewerparceloverlay.cpp23
-rw-r--r--linden/indra/newview/llviewerpartsim.cpp305
-rw-r--r--linden/indra/newview/llviewerpartsim.h34
-rw-r--r--linden/indra/newview/llviewerpartsource.cpp180
-rw-r--r--linden/indra/newview/llviewerpartsource.h9
-rw-r--r--linden/indra/newview/llviewerprecompiledheaders.h3
-rw-r--r--linden/indra/newview/llviewerregion.cpp69
-rw-r--r--linden/indra/newview/llviewerregion.h5
-rw-r--r--linden/indra/newview/llviewerreputation.cpp2
-rw-r--r--linden/indra/newview/llviewerstats.cpp8
-rw-r--r--linden/indra/newview/llviewerstats.h2
-rw-r--r--linden/indra/newview/llviewertexteditor.cpp20
-rw-r--r--linden/indra/newview/llviewertexteditor.h9
-rw-r--r--linden/indra/newview/llviewertextureanim.cpp25
-rw-r--r--linden/indra/newview/llviewertextureanim.h7
-rw-r--r--linden/indra/newview/llviewerthrottle.h2
-rw-r--r--linden/indra/newview/llviewerwindow.cpp337
-rw-r--r--linden/indra/newview/llviewerwindow.h16
-rw-r--r--linden/indra/newview/llvoavatar.cpp760
-rw-r--r--linden/indra/newview/llvoavatar.h52
-rw-r--r--linden/indra/newview/llvoclouds.cpp177
-rw-r--r--linden/indra/newview/llvoclouds.h17
-rw-r--r--linden/indra/newview/llvograss.cpp211
-rw-r--r--linden/indra/newview/llvograss.h16
-rw-r--r--linden/indra/newview/llvoground.cpp84
-rw-r--r--linden/indra/newview/llvoground.h2
-rw-r--r--linden/indra/newview/llvopart.cpp1358
-rw-r--r--linden/indra/newview/llvopart.h281
-rw-r--r--linden/indra/newview/llvopartgroup.cpp404
-rw-r--r--linden/indra/newview/llvopartgroup.h28
-rw-r--r--linden/indra/newview/llvosky.cpp186
-rw-r--r--linden/indra/newview/llvosky.h9
-rw-r--r--linden/indra/newview/llvostars.cpp22
-rw-r--r--linden/indra/newview/llvostars.h2
-rw-r--r--linden/indra/newview/llvosurfacepatch.cpp280
-rw-r--r--linden/indra/newview/llvosurfacepatch.h38
-rw-r--r--linden/indra/newview/llvotextbubble.cpp80
-rw-r--r--linden/indra/newview/llvotextbubble.h12
-rw-r--r--linden/indra/newview/llvotree.cpp106
-rw-r--r--linden/indra/newview/llvotree.h13
-rw-r--r--linden/indra/newview/llvotreenew.cpp1470
-rw-r--r--linden/indra/newview/llvovolume.cpp1662
-rw-r--r--linden/indra/newview/llvovolume.h46
-rw-r--r--linden/indra/newview/llvowater.cpp830
-rw-r--r--linden/indra/newview/llvowater.h199
-rw-r--r--linden/indra/newview/llwearable.cpp86
-rw-r--r--linden/indra/newview/llwearablelist.cpp2
-rw-r--r--linden/indra/newview/llwebbrowserctrl.cpp172
-rw-r--r--linden/indra/newview/llwebbrowserctrl.h8
-rw-r--r--linden/indra/newview/llworld.cpp27
-rw-r--r--linden/indra/newview/llworld.h3
-rw-r--r--linden/indra/newview/llworldmap.cpp21
-rw-r--r--linden/indra/newview/llworldmapview.cpp57
-rw-r--r--linden/indra/newview/llworldmapview.h7
-rw-r--r--linden/indra/newview/llxmlrpctransaction.cpp16
-rw-r--r--linden/indra/newview/lsl_guide.html1417
-rw-r--r--linden/indra/newview/macview.xcodeproj/project.pbxproj222
-rw-r--r--linden/indra/newview/macview_Prefix.h4
-rw-r--r--linden/indra/newview/moviemaker.cpp9
-rw-r--r--linden/indra/newview/moviemaker.h2
-rw-r--r--linden/indra/newview/newview.vcproj56
-rw-r--r--linden/indra/newview/newview_vc8.vcproj3957
-rw-r--r--linden/indra/newview/pipeline.cpp3435
-rw-r--r--linden/indra/newview/pipeline.h241
-rw-r--r--linden/indra/newview/releasenotes.txt681
-rw-r--r--linden/indra/newview/res/newViewRes.rc10
-rw-r--r--linden/indra/newview/restore_login_page.bat22
-rw-r--r--linden/indra/newview/rsyncfiles.txt22
-rw-r--r--linden/indra/newview/secondlife setup build aditi.bat5
-rw-r--r--linden/indra/newview/secondlife setup build agni.bat9
-rw-r--r--linden/indra/newview/secondlife setup build dmz.bat5
-rw-r--r--linden/indra/newview/secondlife setup build durga.bat5
-rw-r--r--linden/indra/newview/secondlife setup build firstlook.bat9
-rw-r--r--linden/indra/newview/secondlife setup build ganga.bat5
-rw-r--r--linden/indra/newview/secondlife setup build museum.bat7
-rw-r--r--linden/indra/newview/secondlife setup build shakti.bat5
-rw-r--r--linden/indra/newview/secondlife setup build siva.bat5
-rw-r--r--linden/indra/newview/secondlife setup build soma.bat5
-rw-r--r--linden/indra/newview/secondlife setup build.bat58
-rw-r--r--linden/indra/newview/set_login_page.bat45
-rw-r--r--linden/indra/newview/skins/textures/textures.xml391
-rw-r--r--linden/indra/newview/skins/xui/de/floater_account_history.xml4
-rw-r--r--linden/indra/newview/skins/xui/de/panel_account_details.xml7
-rw-r--r--linden/indra/newview/skins/xui/de/panel_account_planning.xml2
-rw-r--r--linden/indra/newview/skins/xui/de/panel_account_transactions.xml7
-rw-r--r--linden/indra/newview/skins/xui/en-us/alerts.xml109
-rw-r--r--linden/indra/newview/skins/xui/en-us/floater_about.xml6
-rw-r--r--linden/indra/newview/skins/xui/en-us/floater_account_history.xml10
-rw-r--r--linden/indra/newview/skins/xui/en-us/floater_build_options.xml6
-rw-r--r--linden/indra/newview/skins/xui/en-us/floater_instant_message.xml6
-rw-r--r--linden/indra/newview/skins/xui/en-us/floater_preview_existing_landmark.xml9
-rw-r--r--linden/indra/newview/skins/xui/en-us/floater_preview_new_landmark.xml2
-rw-r--r--linden/indra/newview/skins/xui/en-us/floater_price_for_listing.xml4
-rw-r--r--linden/indra/newview/skins/xui/en-us/floater_settings_debug.xml5
-rwxr-xr-xlinden/indra/newview/skins/xui/en-us/menu_inventory.xml8
-rwxr-xr-xlinden/indra/newview/skins/xui/en-us/menu_viewer.xml13
-rw-r--r--linden/indra/newview/skins/xui/en-us/panel_account_details.xml17
-rw-r--r--linden/indra/newview/skins/xui/en-us/panel_account_planning.xml9
-rw-r--r--linden/indra/newview/skins/xui/en-us/panel_account_transactions.xml17
-rw-r--r--linden/indra/newview/skins/xui/en-us/panel_avatar.xml21
-rw-r--r--linden/indra/newview/skins/xui/en-us/panel_group.xml4
-rw-r--r--linden/indra/newview/skins/xui/en-us/panel_group_notices.xml14
-rw-r--r--linden/indra/newview/skins/xui/en-us/panel_group_roles.xml6
-rw-r--r--linden/indra/newview/skins/xui/en-us/panel_login.xml2
-rw-r--r--linden/indra/newview/skins/xui/en-us/panel_preferences_graphics3.xml14
-rw-r--r--linden/indra/newview/skins/xui/en-us/panel_preferences_network.xml68
-rw-r--r--linden/indra/newview/skins/xui/en-us/panel_status_bar.xml6
-rw-r--r--linden/indra/newview/skins/xui/en-us/role_actions.xml2
-rw-r--r--linden/indra/newview/skins/xui/es/floater_account_history.xml4
-rw-r--r--linden/indra/newview/skins/xui/es/panel_account_details.xml7
-rw-r--r--linden/indra/newview/skins/xui/es/panel_account_planning.xml2
-rw-r--r--linden/indra/newview/skins/xui/es/panel_account_transactions.xml7
-rw-r--r--linden/indra/newview/skins/xui/fr/floater_account_history.xml5
-rw-r--r--linden/indra/newview/skins/xui/fr/panel_account_details.xml7
-rw-r--r--linden/indra/newview/skins/xui/fr/panel_account_planning.xml2
-rw-r--r--linden/indra/newview/skins/xui/fr/panel_account_transactions.xml7
-rw-r--r--linden/indra/newview/skins/xui/ja/floater_account_history.xml5
-rw-r--r--linden/indra/newview/skins/xui/ja/panel_account_details.xml7
-rw-r--r--linden/indra/newview/skins/xui/ja/panel_account_planning.xml2
-rw-r--r--linden/indra/newview/skins/xui/ja/panel_account_transactions.xml7
-rw-r--r--linden/indra/newview/skins/xui/ko/floater_account_history.xml5
-rw-r--r--linden/indra/newview/skins/xui/ko/panel_account_details.xml7
-rw-r--r--linden/indra/newview/skins/xui/ko/panel_account_planning.xml2
-rw-r--r--linden/indra/newview/skins/xui/ko/panel_account_transactions.xml7
-rw-r--r--linden/indra/newview/skins/xui/pt/floater_account_history.xml4
-rw-r--r--linden/indra/newview/skins/xui/pt/panel_account_details.xml7
-rw-r--r--linden/indra/newview/skins/xui/pt/panel_account_planning.xml2
-rw-r--r--linden/indra/newview/skins/xui/pt/panel_account_transactions.xml7
-rw-r--r--linden/indra/newview/skins/xui/zh/floater_account_history.xml4
-rw-r--r--linden/indra/newview/skins/xui/zh/floater_god_tools.xml152
-rw-r--r--linden/indra/newview/skins/xui/zh/floater_inventory_view_finder.xml24
-rw-r--r--linden/indra/newview/skins/xui/zh/floater_preferences.xml7
-rw-r--r--linden/indra/newview/skins/xui/zh/floater_rate.xml44
-rw-r--r--linden/indra/newview/skins/xui/zh/floater_sell_land.xml68
-rw-r--r--linden/indra/newview/skins/xui/zh/floater_settings_debug.xml15
-rw-r--r--linden/indra/newview/skins/xui/zh/menu_pie_attachment.xml6
-rw-r--r--linden/indra/newview/skins/xui/zh/menu_pie_avatar.xml16
-rw-r--r--linden/indra/newview/skins/xui/zh/menu_pie_land.xml10
-rw-r--r--linden/indra/newview/skins/xui/zh/menu_pie_object.xml25
-rw-r--r--linden/indra/newview/skins/xui/zh/menu_pie_self.xml29
-rw-r--r--linden/indra/newview/skins/xui/zh/menu_viewer.xml234
-rw-r--r--linden/indra/newview/skins/xui/zh/panel_account_details.xml7
-rw-r--r--linden/indra/newview/skins/xui/zh/panel_account_planning.xml2
-rw-r--r--linden/indra/newview/skins/xui/zh/panel_account_transactions.xml7
-rw-r--r--linden/indra/newview/skins/xui/zh/panel_avatar.xml195
-rw-r--r--linden/indra/newview/skins/xui/zh/panel_group.xml14
-rw-r--r--linden/indra/newview/skins/xui/zh/panel_group_finder.xml9
-rw-r--r--linden/indra/newview/skins/xui/zh/panel_group_general.xml74
-rw-r--r--linden/indra/newview/skins/xui/zh/panel_group_invite.xml18
-rw-r--r--linden/indra/newview/skins/xui/zh/panel_group_land_money.xml82
-rw-r--r--linden/indra/newview/skins/xui/zh/panel_group_notices.xml68
-rw-r--r--linden/indra/newview/skins/xui/zh/panel_group_roles.xml153
-rw-r--r--linden/indra/newview/skins/xui/zh/panel_group_voting.xml79
-rw-r--r--linden/indra/newview/skins/xui/zh/panel_land_covenant.xml39
-rw-r--r--linden/indra/newview/skins/xui/zh/panel_preferences_audio.xml59
-rw-r--r--linden/indra/newview/skins/xui/zh/panel_preferences_chat.xml54
-rw-r--r--linden/indra/newview/skins/xui/zh/panel_preferences_im.xml19
-rw-r--r--linden/indra/newview/skins/xui/zh/panel_preferences_popups.xml14
-rw-r--r--linden/indra/newview/skins/xui/zh/panel_region_covenant.xml50
-rw-r--r--linden/indra/newview/skins/xui/zh/panel_scrolling_param.xml12
-rw-r--r--linden/indra/newview/skins/xui/zh/role_actions.xml187
-rw-r--r--linden/indra/newview/skins/xui/zh/xui_version.xml4
-rw-r--r--linden/indra/newview/viewer.cpp825
-rw-r--r--linden/indra/newview/viewer.h11
-rwxr-xr-xlinden/indra/newview/viewer_manifest.py450
-rw-r--r--linden/indra/test/MacTester.xcodeproj/project.pbxproj64
-rw-r--r--linden/indra/test/blowfish.1.bin1
-rw-r--r--linden/indra/test/blowfish.2.binbin0 -> 40 bytes
-rw-r--r--linden/indra/test/blowfish.digits.txt1
-rwxr-xr-xlinden/indra/test/blowfish.pl74
-rw-r--r--linden/indra/test/common.cpp8
-rw-r--r--linden/indra/test/files.lst3
-rw-r--r--linden/indra/test/io.cpp30
-rw-r--r--linden/indra/test/llapp_tut.cpp13
-rw-r--r--linden/indra/test/llbase64_tut.cpp77
-rw-r--r--linden/indra/test/llblowfish_tut.cpp144
-rw-r--r--linden/indra/test/llerror_tut.cpp767
-rw-r--r--linden/indra/test/llhttpclient_tut.cpp22
-rw-r--r--linden/indra/test/llpipeutil.cpp8
-rwxr-xr-xlinden/indra/test/llrandom_tut.cpp160
-rw-r--r--linden/indra/test/llsd_message_system_tut.cpp248
-rw-r--r--linden/indra/test/llsd_new_tut.cpp2
-rw-r--r--linden/indra/test/lltut.cpp29
-rw-r--r--linden/indra/test/lltut.h6
-rw-r--r--linden/indra/test/lluri_tut.cpp173
-rw-r--r--linden/indra/test/math.cpp2
-rw-r--r--linden/indra/test/test.cpp13
-rw-r--r--linden/indra/test/test.vcproj15
-rw-r--r--linden/indra/test/test_llmanifest.py128
-rw-r--r--linden/indra/test/test_vc8.vcproj385
-rw-r--r--linden/indra/win_crash_logger/win_crash_logger.cpp36
-rw-r--r--linden/indra/win_crash_logger/win_crash_logger_vc8.vcproj319
-rw-r--r--linden/indra/win_updater/updater.cpp27
-rw-r--r--linden/indra/win_updater/win_updater_vc8.vcproj295
922 files changed, 50501 insertions, 42121 deletions
diff --git a/linden/indra/SConstruct b/linden/indra/SConstruct
index f94f661..2aeee01 100644
--- a/linden/indra/SConstruct
+++ b/linden/indra/SConstruct
@@ -11,7 +11,7 @@
11# 11#
12# scons -h 12# scons -h
13# 13#
14# Written by Tom Yedwab, 6/2006. 14# Originally written by Tom Yedwab, 6/2006.
15# 15#
16################################################# 16#################################################
17 17
@@ -54,6 +54,8 @@ opts.Add(EnumOption('BTARGET', 'Set build target', 'server',
54 allowed_values=('client', 'server', 'all'))) 54 allowed_values=('client', 'server', 'all')))
55opts.Add(EnumOption('DISTCC', 'Enabled distcc', 'yes', 55opts.Add(EnumOption('DISTCC', 'Enabled distcc', 'yes',
56 allowed_values=('yes', 'no'))) 56 allowed_values=('yes', 'no')))
57opts.Add(EnumOption('MOZLIB', 'Enabled llmozlib/mozilla support', 'yes',
58 allowed_values=('yes', 'no')))
57opts.Add(EnumOption('COLORGCC', 'Enabled colorgcc', 'yes', 59opts.Add(EnumOption('COLORGCC', 'Enabled colorgcc', 'yes',
58 allowed_values=('yes', 'no'))) 60 allowed_values=('yes', 'no')))
59opts.Add(EnumOption('GRID', 'Client package\'s default grid', 'default', 61opts.Add(EnumOption('GRID', 'Client package\'s default grid', 'default',
@@ -68,6 +70,7 @@ build_param = ARGUMENTS.get('BUILD', 'releasefordownload')
68arch = ARGUMENTS.get('ARCH', 'i686') 70arch = ARGUMENTS.get('ARCH', 'i686')
69target_param = ARGUMENTS.get('BTARGET', 'server') 71target_param = ARGUMENTS.get('BTARGET', 'server')
70enable_distcc = ARGUMENTS.get('DISTCC', 'yes') 72enable_distcc = ARGUMENTS.get('DISTCC', 'yes')
73enable_mozlib = ARGUMENTS.get('MOZLIB', 'yes')
71enable_colorgcc = ARGUMENTS.get('COLORGCC', 'yes') 74enable_colorgcc = ARGUMENTS.get('COLORGCC', 'yes')
72grid = ARGUMENTS.get('GRID', 'default') 75grid = ARGUMENTS.get('GRID', 'default')
73# OPENSOURCE: do not edit the following line: 76# OPENSOURCE: do not edit the following line:
@@ -123,7 +126,7 @@ for build_target in targets:
123 client_external_libs = [] 126 client_external_libs = []
124 system_link_flags = '' 127 system_link_flags = ''
125 128
126 if platform != 'linux' and build_target == 'client': 129 if platform != 'linux' and build_target == 'client' and enable_mozlib == 'yes':
127 130
128 ### Mozilla include directories ### 131 ### Mozilla include directories ###
129 132
@@ -189,6 +192,14 @@ for build_target in targets:
189 include_dirs += [ '../libraries/' + system_str + '/include/atk-1.0' ] 192 include_dirs += [ '../libraries/' + system_str + '/include/atk-1.0' ]
190 include_dirs += [ '../libraries/' + system_str + '/include/ELFIO' ] 193 include_dirs += [ '../libraries/' + system_str + '/include/ELFIO' ]
191 include_dirs += [ '../libraries/' + system_str + '/include/llfreetype2' ] 194 include_dirs += [ '../libraries/' + system_str + '/include/llfreetype2' ]
195
196 # llmozlib stuff
197 if enable_mozlib == 'yes':
198 flags += '-DLL_LIBXUL_ENABLED=1 '
199 client_external_libs += [ 'llmozlib' ]
200 client_external_libs += [ 'mozjs', 'nspr4', 'plc4', 'plds4', 'profdirserviceprovider_s', 'xpcom', 'xul' ]
201 else:
202 flags += '-DLL_LIBXUL_ENABLED=0 '
192 else: 203 else:
193 # Mac-only flags 204 # Mac-only flags
194 flags += '-x c++ -arch ppc -pipe -Wno-trigraphs -fpascal-strings -faltivec -fasm-blocks -g -O2 -fmessage-length=0 -mtune=G4 -Wno-deprecated-declarations -Wno-invalid-offsetof -mmacosx-version-min=10.3 -DLL_DARWIN=1 -Wmost -Wno-sign-compare -Wno-switch -fpch-preprocess -F./newview/build/Deployment -fconstant-cfstrings -ffor-scope -Wno-reorder -isysroot /Developer/SDKs/MacOSX10.3.9.sdk ' 205 flags += '-x c++ -arch ppc -pipe -Wno-trigraphs -fpascal-strings -faltivec -fasm-blocks -g -O2 -fmessage-length=0 -mtune=G4 -Wno-deprecated-declarations -Wno-invalid-offsetof -mmacosx-version-min=10.3 -DLL_DARWIN=1 -Wmost -Wno-sign-compare -Wno-switch -fpch-preprocess -F./newview/build/Deployment -fconstant-cfstrings -ffor-scope -Wno-reorder -isysroot /Developer/SDKs/MacOSX10.3.9.sdk '
@@ -287,10 +298,10 @@ for build_target in targets:
287 298
288 ### Load a files.lst and files.PLATFORM.lst for each module ### 299 ### Load a files.lst and files.PLATFORM.lst for each module ###
289 300
290 def load_files(module): 301 def load_files(module, source_fname):
291 new_list = [] 302 new_list = []
292 try: 303 try:
293 list_file = open('./' + module + '/files.lst', 'r') 304 list_file = open('./' + module + '/' + source_fname, 'r')
294 list = Split(list_file.read()) 305 list = Split(list_file.read())
295 for x in list: 306 for x in list:
296 file = os.path.join(build_dir, x) 307 file = os.path.join(build_dir, x)
@@ -301,8 +312,9 @@ for build_target in targets:
301 else: 312 else:
302 new_list.append(file) 313 new_list.append(file)
303 list_file.close() 314 list_file.close()
304 except IOError: 315 except IOError, val:
305 print 'Error: no files.lst exists for module ' + module 316 print 'Error: unable to open file list',source_fname,
317 print 'for module', module + ":", val
306 return [] 318 return []
307 319
308 try: 320 try:
@@ -319,8 +331,13 @@ for build_target in targets:
319 331
320 ### Create a static library from the module ### 332 ### Create a static library from the module ###
321 333
322 def create_static_module_from_dir(input_dir, mod_name, local_flags="", extra_depends=None): 334 def create_static_module_from_dir(
323 files_list = load_files(input_dir) 335 input_dir,
336 mod_name,
337 local_flags="",
338 source_files = 'files.lst',
339 extra_depends=None):
340 files_list = load_files(input_dir, source_files)
324 BuildDir(build_dir + '/' + input_dir, input_dir) 341 BuildDir(build_dir + '/' + input_dir, input_dir)
325 local_env = env.Copy(CPPFLAGS = env['CPPFLAGS'] + ' ' + local_flags) 342 local_env = env.Copy(CPPFLAGS = env['CPPFLAGS'] + ' ' + local_flags)
326 if extra_depends: 343 if extra_depends:
@@ -329,11 +346,15 @@ for build_target in targets:
329 tgt = local_env.StaticLibrary(lib_dir + '/' + mod_name, files_list) 346 tgt = local_env.StaticLibrary(lib_dir + '/' + mod_name, files_list)
330 Default(tgt) 347 Default(tgt)
331 348
332 def create_static_module(module, local_flags="", extra_depends=None): 349 def create_static_module(module, local_flags="", source_files = 'files.lst', extra_depends=None):
333 create_static_module_from_dir(module, module, local_flags, extra_depends) 350 create_static_module_from_dir(module, module, local_flags, source_files, extra_depends)
334 351
335 def create_dynamic_module(module, local_flags="", module_libs = None): 352 def create_dynamic_module(
336 files_list = load_files(module) 353 module,
354 local_flags="",
355 module_libs = None,
356 source_files = 'files.lst'):
357 files_list = load_files(module, source_files)
337 BuildDir(build_dir + '/' + module, module) 358 BuildDir(build_dir + '/' + module, module)
338 local_env = env.Copy(CPPFLAGS = env['CPPFLAGS'] + ' ' + local_flags) 359 local_env = env.Copy(CPPFLAGS = env['CPPFLAGS'] + ' ' + local_flags)
339 tgt = local_env.SharedLibrary(lib_dir + '/' + module, files_list, LIBS = module_libs) 360 tgt = local_env.SharedLibrary(lib_dir + '/' + module, files_list, LIBS = module_libs)
@@ -341,8 +362,9 @@ for build_target in targets:
341 362
342 ### Create an executable from the module ### 363 ### Create an executable from the module ###
343 364
344 def create_executable(exec_file, module, module_libs): 365 def create_executable(
345 files_list = load_files(module) 366 exec_file, module, module_libs, source_files = 'files.lst'):
367 files_list = load_files(module, source_files)
346 BuildDir(build_dir + '/' + module, module) 368 BuildDir(build_dir + '/' + module, module)
347 tgt = env.Program(exec_file, files_list, LIBS = module_libs) 369 tgt = env.Program(exec_file, files_list, LIBS = module_libs)
348 Default(tgt) 370 Default(tgt)
@@ -365,7 +387,7 @@ for build_target in targets:
365 create_static_module('llxml') 387 create_static_module('llxml')
366 create_static_module('lscript', extra_depends=build_dir + '/lscript/lscript_compile/indra.y.h') 388 create_static_module('lscript', extra_depends=build_dir + '/lscript/lscript_compile/indra.y.h')
367 389
368 net_external_libs = [ 'curl', 'ssl', 'crypto', 'aprutil-1', 'apr-1' ] 390 net_external_libs = [ 'curl', 'cares', 'ssl', 'crypto', 'aprutil-1', 'apr-1' ]
369 common_external_libs = net_external_libs + [ 'xmlrpc', 'expat', 'z' ] 391 common_external_libs = net_external_libs + [ 'xmlrpc', 'expat', 'z' ]
370 392
371 if build_target == 'client': 393 if build_target == 'client':
@@ -375,6 +397,7 @@ for build_target in targets:
375 ############################# 397 #############################
376 output_crashlogger_bin = 'linux_crash_logger/linux-crash-logger-' + arch + '-bin' 398 output_crashlogger_bin = 'linux_crash_logger/linux-crash-logger-' + arch + '-bin'
377 external_libs = net_external_libs + [ 'db-4.2', 'gtk-x11-2.0' ] 399 external_libs = net_external_libs + [ 'db-4.2', 'gtk-x11-2.0' ]
400 external_libs.remove('cares')
378 internal_libs = [ 'llvfs', 'llmath', 'llcommon' ] 401 internal_libs = [ 'llvfs', 'llmath', 'llcommon' ]
379 create_executable(output_crashlogger_bin + '-globalsyms', 'linux_crash_logger', internal_libs + external_libs) 402 create_executable(output_crashlogger_bin + '-globalsyms', 'linux_crash_logger', internal_libs + external_libs)
380 env.Command(output_crashlogger_bin, output_crashlogger_bin + '-globalsyms', hidesyms_cmd) 403 env.Command(output_crashlogger_bin, output_crashlogger_bin + '-globalsyms', hidesyms_cmd)
@@ -393,6 +416,7 @@ for build_target in targets:
393 output_bin = 'newview/secondlife-' + arch + '-bin' 416 output_bin = 'newview/secondlife-' + arch + '-bin'
394 417
395 external_libs = client_external_libs + common_external_libs + [ 'freetype', 'jpeg', 'SDL', 'GL', 'GLU', 'ogg', 'vorbisenc', 'vorbisfile', 'vorbis', 'fmod-3.75', 'db-4.2', 'openjpeg' ] 418 external_libs = client_external_libs + common_external_libs + [ 'freetype', 'jpeg', 'SDL', 'GL', 'GLU', 'ogg', 'vorbisenc', 'vorbisfile', 'vorbis', 'fmod-3.75', 'db-4.2', 'openjpeg' ]
419 external_libs.remove('cares')
396 420
397 internal_libs = [ 'lscript', 'llwindow', 'llrender', 'llprimitive', 421 internal_libs = [ 'lscript', 'llwindow', 'llrender', 'llprimitive',
398 'llmedia', 'llinventory', 422 'llmedia', 'llinventory',
@@ -402,6 +426,7 @@ for build_target in targets:
402 426
403 create_executable(output_bin + '-globalsyms', 'newview', internal_libs + external_libs) 427 create_executable(output_bin + '-globalsyms', 'newview', internal_libs + external_libs)
404 env.Command(output_bin, output_bin + '-globalsyms', hidesyms_cmd) 428 env.Command(output_bin, output_bin + '-globalsyms', hidesyms_cmd)
429 Default(output_bin)
405 430
406 if buildtype == 'releasefordownload': 431 if buildtype == 'releasefordownload':
407 432
@@ -412,13 +437,15 @@ for build_target in targets:
412 if platform == 'linux': 437 if platform == 'linux':
413 env.Command(output_bin + '-stripped', output_bin, strip_cmd) 438 env.Command(output_bin + '-stripped', output_bin, strip_cmd)
414 env.Command(output_crashlogger_bin + '-stripped', output_crashlogger_bin, strip_cmd) 439 env.Command(output_crashlogger_bin + '-stripped', output_crashlogger_bin, strip_cmd)
415 manifest_file = 'linux_tools/client-manifest-' + arch
416 product_name = 'SecondLife_' + arch + '_' + version_major + "_" + version_minor + "_" + version_patch + "_" + version_build 440 product_name = 'SecondLife_' + arch + '_' + version_major + "_" + version_minor + "_" + version_patch + "_" + version_build
417 if grid != 'default': 441 if grid not in ['default', 'agni']:
418 product_name += "_" + grid.upper() 442 product_name += "_" + grid.upper()
419 package_name = product_name + '.tar.bz2' 443 package_name = product_name + '.tar.bz2'
420 cmd = 'rm -rf newview/' + product_name + '* && newview/linux_tools/package-client.sh ' + manifest_file + ' ' + product_name + ' ' + grid 444 cmd = 'rm -rf newview/%(pn)s* && newview/viewer_manifest.py --grid=%(grid)s --installer_name=%(pn)s --arch=%(arch)s' % {
421 env.Command('newview/' + package_name, 'newview/' + manifest_file, cmd) 445 'pn': product_name,
446 'grid':grid,
447 'arch':arch}
448 env.Command('newview/' + package_name, 'newview/viewer_manifest.py', cmd)
422 Depends('newview/' + package_name, output_bin + '-stripped') 449 Depends('newview/' + package_name, output_bin + '-stripped')
423 Depends('newview/' + package_name, output_crashlogger_bin + '-stripped') 450 Depends('newview/' + package_name, output_crashlogger_bin + '-stripped')
424 Default('newview/' + package_name) 451 Default('newview/' + package_name)
@@ -524,21 +551,51 @@ for build_target in targets:
524 create_executable('newsim/simulator' + file_suffix, 'newsim', 551 create_executable('newsim/simulator' + file_suffix, 'newsim',
525 internal_libs + external_libs) 552 internal_libs + external_libs)
526 553
554 # texture upload verifier
555 external_libs = common_external_libs + [ 'kdu', 'dl' ]
556 internal_libs = [
557 'llimage',
558 'llkdustatic',
559 'llinventory',
560 'llmessage',
561 'llvfs',
562 'llxml',
563 'llcommon',
564 'llmath' ]
565 create_executable(
566 'web/doc/asset-upload/plugins/verify-texture',
567 'web/doc/asset-upload/plugins',
568 internal_libs + external_libs,
569 'verify-texture.lst')
570
571 # notecard upload verifier
572 create_executable(
573 'web/doc/asset-upload/plugins/verify-notecard',
574 'web/doc/asset-upload/plugins',
575 internal_libs + external_libs,
576 'verify-notecard.lst')
577
578 # LSL compiler plugin for asset upload CGI.
579 external_libs = common_external_libs
580 internal_libs = ['lscript', 'llmath', 'llcommon']
581 create_executable('web/doc/asset-upload/plugins/lsl_compiler/lslc' + file_suffix, 'web/doc/asset-upload/plugins/lsl_compiler/', internal_libs + external_libs);
582
527 # Test 583 # Test
528 Depends('test/test', 'newsim/simulator' + file_suffix) 584 Depends('test/test', 'newsim/simulator' + file_suffix)
529 external_libs = common_external_libs + ['mysqlclient'] 585 external_libs = common_external_libs + ['mysqlclient']
530 internal_libs = [ 'lldatabase', 'llinventory', 'llmessage', 'llxml', 586 internal_libs = [ 'lldatabase', 'llinventory', 'llmessage', 'llxml',
531 'llvfs', 'llmath', 'llcommon' ] 587 'llvfs', 'llmath', 'llcommon' ]
532 create_executable('test/test' + file_suffix, 'test', 588 test_executable = 'test/test' + file_suffix
589 create_executable(test_executable, 'test',
533 internal_libs + external_libs) 590 internal_libs + external_libs)
534 591
535 # Run test. foo_target is never actually built, so this test always happens. 592 # Run tests
536 test_results_file = 'test/test_results' + file_suffix + '.txt' 593 test_results_file = 'test/test_results' + file_suffix + '.txt'
537 env.Command('foo_target', 'test/test' + file_suffix, "$SOURCE 1>" 594 env.Command(test_results_file,
538 + test_results_file + " 2>&1; " 595 test_executable,
539 + "sed -n '/^Total Tests/,$ p' " + test_results_file) 596 "$SOURCE 2>&1 | tee $TARGET")
540 Depends('foo_target', 'test/test' + file_suffix) 597 Depends(test_results_file, test_executable)
541 Default('foo_target') 598 Default(test_results_file)
542 599
543######### 600#########
544# DONE # 601# DONE #
diff --git a/linden/indra/indra_complete/indra_complete_vc8.sln b/linden/indra/indra_complete/indra_complete_vc8.sln
new file mode 100644
index 0000000..8d09d72
--- /dev/null
+++ b/linden/indra/indra_complete/indra_complete_vc8.sln
@@ -0,0 +1,587 @@
1Microsoft Visual Studio Solution File, Format Version 9.00
2# Visual Studio 2005
3Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "llcommon", "..\llcommon\llcommon_vc8.vcproj", "{7BCB4B2C-8378-4186-88EA-5742B5ABE17F}"
4EndProject
5Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "llmath", "..\llmath\llmath_vc8.vcproj", "{E87FD9BE-BE42-4EA3-BF4D-D992223046D9}"
6EndProject
7Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "llmessage", "..\llmessage\llmessage_vc8.vcproj", "{E5D94794-5671-4BD6-A16D-26EC18F3DB34}"
8EndProject
9Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "llvfs", "..\llvfs\llvfs_vc8.vcproj", "{D37774F4-253D-4760-BF64-372A943224A1}"
10EndProject
11Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "llxml", "..\llxml\llxml_vc8.vcproj", "{A5470DA6-0C3A-4602-B930-43DB25511A59}"
12EndProject
13Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "llui", "..\llui\llui_vc8.vcproj", "{DE55D666-6A3D-476C-937F-109269B83681}"
14EndProject
15Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "llimage", "..\llimage\llimage_vc8.vcproj", "{681FDD6C-2FAE-4CB9-AF6D-B952F2B151C5}"
16EndProject
17Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "llprimitive", "..\llprimitive\llprimitive_vc8.vcproj", "{FCC4483C-5B84-4944-B91F-4589A219BC0B}"
18EndProject
19Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "llcharacter", "..\llcharacter\llcharacter_vc8.vcproj", "{5EA5DDF0-C7E1-4F49-BEF5-9246A4656B2E}"
20EndProject
21Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "llaudio", "..\llaudio\llaudio_vc8.vcproj", "{93B2BA29-FBE9-4376-92C1-6108DCFE09D3}"
22EndProject
23Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "llrender", "..\llrender\llrender_vc8.vcproj", "{2ADE3C14-94C4-40BF-B033-70F3C954EE90}"
24EndProject
25Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "llinventory", "..\llinventory\llinventory_vc8.vcproj", "{328D1968-924F-4863-AAE8-5F9A95BA68E5}"
26EndProject
27Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "newview", "..\newview\newview_vc8.vcproj", "{E6F4CF1B-6109-4CA8-B58D-87FA936CDE08}"
28 ProjectSection(ProjectDependencies) = postProject
29 {9D0C7E02-6506-4EE7-BC5C-75671D28D594} = {9D0C7E02-6506-4EE7-BC5C-75671D28D594}
30 {2ADE3C14-94C4-40BF-B033-70F3C954EE90} = {2ADE3C14-94C4-40BF-B033-70F3C954EE90}
31 {B5B53617-416F-404A-BF10-22EBCCA0E4FB} = {B5B53617-416F-404A-BF10-22EBCCA0E4FB}
32 {93B2BA29-FBE9-4376-92C1-6108DCFE09D3} = {93B2BA29-FBE9-4376-92C1-6108DCFE09D3}
33 {7BCB4B2C-8378-4186-88EA-5742B5ABE17F} = {7BCB4B2C-8378-4186-88EA-5742B5ABE17F}
34 {E928F33B-E090-4FA8-818B-6B5D8B0F1F4B} = {E928F33B-E090-4FA8-818B-6B5D8B0F1F4B}
35 {FCC4483C-5B84-4944-B91F-4589A219BC0B} = {FCC4483C-5B84-4944-B91F-4589A219BC0B}
36 {F882263E-4F2A-43D9-A45A-FA4C8EC66552} = {F882263E-4F2A-43D9-A45A-FA4C8EC66552}
37 {076DD042-2E58-42EA-9401-53210B65C1FC} = {076DD042-2E58-42EA-9401-53210B65C1FC}
38 {DE55D666-6A3D-476C-937F-109269B83681} = {DE55D666-6A3D-476C-937F-109269B83681}
39 {328D1968-924F-4863-AAE8-5F9A95BA68E5} = {328D1968-924F-4863-AAE8-5F9A95BA68E5}
40 {681FDD6C-2FAE-4CB9-AF6D-B952F2B151C5} = {681FDD6C-2FAE-4CB9-AF6D-B952F2B151C5}
41 {B771CF1B-E253-47BD-8B0A-6B0440CC9228} = {B771CF1B-E253-47BD-8B0A-6B0440CC9228}
42 {44CE6D82-7320-4609-8FC3-5965C19F4808} = {44CE6D82-7320-4609-8FC3-5965C19F4808}
43 {E5D94794-5671-4BD6-A16D-26EC18F3DB34} = {E5D94794-5671-4BD6-A16D-26EC18F3DB34}
44 {A5470DA6-0C3A-4602-B930-43DB25511A59} = {A5470DA6-0C3A-4602-B930-43DB25511A59}
45 {BFA102B0-C891-4E13-B1CF-C2F28073DA8E} = {BFA102B0-C891-4E13-B1CF-C2F28073DA8E}
46 {E87FD9BE-BE42-4EA3-BF4D-D992223046D9} = {E87FD9BE-BE42-4EA3-BF4D-D992223046D9}
47 {4C8D64D5-649F-481E-96BE-EF1E82A77ACB} = {4C8D64D5-649F-481E-96BE-EF1E82A77ACB}
48 {5EA5DDF0-C7E1-4F49-BEF5-9246A4656B2E} = {5EA5DDF0-C7E1-4F49-BEF5-9246A4656B2E}
49 {648685F3-8760-4CC5-BB2B-CAF9DECC25A4} = {648685F3-8760-4CC5-BB2B-CAF9DECC25A4}
50 {D37774F4-253D-4760-BF64-372A943224A1} = {D37774F4-253D-4760-BF64-372A943224A1}
51 EndProjectSection
52EndProject
53EndProject
54Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "llwindow", "..\llwindow\llwindow_vc8.vcproj", "{B5B53617-416F-404A-BF10-22EBCCA0E4FB}"
55 ProjectSection(ProjectDependencies) = postProject
56 {A5470DA6-0C3A-4602-B930-43DB25511A59} = {A5470DA6-0C3A-4602-B930-43DB25511A59}
57 EndProjectSection
58EndProject
59Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lscript_library", "..\lscript\lscript_library\lscript_library_vc8.vcproj", "{BFA102B0-C891-4E13-B1CF-C2F28073DA8E}"
60EndProject
61Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lscript_execute", "..\lscript\lscript_execute\lscript_execute_vc8.vcproj", "{F882263E-4F2A-43D9-A45A-FA4C8EC66552}"
62 ProjectSection(ProjectDependencies) = postProject
63 {BFA102B0-C891-4E13-B1CF-C2F28073DA8E} = {BFA102B0-C891-4E13-B1CF-C2F28073DA8E}
64 EndProjectSection
65EndProject
66Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lscript_compile", "..\lscript\lscript_compile\lscript_compile_vc8.vcproj", "{44CE6D82-7320-4609-8FC3-5965C19F4808}"
67 ProjectSection(ProjectDependencies) = postProject
68 {B771CF1B-E253-47BD-8B0A-6B0440CC9228} = {B771CF1B-E253-47BD-8B0A-6B0440CC9228}
69 {BFA102B0-C891-4E13-B1CF-C2F28073DA8E} = {BFA102B0-C891-4E13-B1CF-C2F28073DA8E}
70 EndProjectSection
71EndProject
72 ProjectSection(ProjectDependencies) = postProject
73 {7BCB4B2C-8378-4186-88EA-5742B5ABE17F} = {7BCB4B2C-8378-4186-88EA-5742B5ABE17F}
74 {FCC4483C-5B84-4944-B91F-4589A219BC0B} = {FCC4483C-5B84-4944-B91F-4589A219BC0B}
75 {F882263E-4F2A-43D9-A45A-FA4C8EC66552} = {F882263E-4F2A-43D9-A45A-FA4C8EC66552}
76 {4B19F64E-AB97-4FB9-8E1D-74A8104DE0C4} = {4B19F64E-AB97-4FB9-8E1D-74A8104DE0C4}
77 {328D1968-924F-4863-AAE8-5F9A95BA68E5} = {328D1968-924F-4863-AAE8-5F9A95BA68E5}
78 {681FDD6C-2FAE-4CB9-AF6D-B952F2B151C5} = {681FDD6C-2FAE-4CB9-AF6D-B952F2B151C5}
79 {44CE6D82-7320-4609-8FC3-5965C19F4808} = {44CE6D82-7320-4609-8FC3-5965C19F4808}
80 {E5D94794-5671-4BD6-A16D-26EC18F3DB34} = {E5D94794-5671-4BD6-A16D-26EC18F3DB34}
81 {A5470DA6-0C3A-4602-B930-43DB25511A59} = {A5470DA6-0C3A-4602-B930-43DB25511A59}
82 {BFA102B0-C891-4E13-B1CF-C2F28073DA8E} = {BFA102B0-C891-4E13-B1CF-C2F28073DA8E}
83 {E87FD9BE-BE42-4EA3-BF4D-D992223046D9} = {E87FD9BE-BE42-4EA3-BF4D-D992223046D9}
84 {B4B838C7-2C72-428E-BBFD-25764E659A8B} = {B4B838C7-2C72-428E-BBFD-25764E659A8B}
85 {5EA5DDF0-C7E1-4F49-BEF5-9246A4656B2E} = {5EA5DDF0-C7E1-4F49-BEF5-9246A4656B2E}
86 {D37774F4-253D-4760-BF64-372A943224A1} = {D37774F4-253D-4760-BF64-372A943224A1}
87 {023011F7-3ADB-49D3-9EC5-6D392F6D15FE} = {023011F7-3ADB-49D3-9EC5-6D392F6D15FE}
88 EndProjectSection
89EndProject
90 ProjectSection(ProjectDependencies) = postProject
91 {7BCB4B2C-8378-4186-88EA-5742B5ABE17F} = {7BCB4B2C-8378-4186-88EA-5742B5ABE17F}
92 {4B19F64E-AB97-4FB9-8E1D-74A8104DE0C4} = {4B19F64E-AB97-4FB9-8E1D-74A8104DE0C4}
93 {E5D94794-5671-4BD6-A16D-26EC18F3DB34} = {E5D94794-5671-4BD6-A16D-26EC18F3DB34}
94 {E87FD9BE-BE42-4EA3-BF4D-D992223046D9} = {E87FD9BE-BE42-4EA3-BF4D-D992223046D9}
95 {D37774F4-253D-4760-BF64-372A943224A1} = {D37774F4-253D-4760-BF64-372A943224A1}
96 EndProjectSection
97EndProject
98 ProjectSection(ProjectDependencies) = postProject
99 {7BCB4B2C-8378-4186-88EA-5742B5ABE17F} = {7BCB4B2C-8378-4186-88EA-5742B5ABE17F}
100 {4B19F64E-AB97-4FB9-8E1D-74A8104DE0C4} = {4B19F64E-AB97-4FB9-8E1D-74A8104DE0C4}
101 {328D1968-924F-4863-AAE8-5F9A95BA68E5} = {328D1968-924F-4863-AAE8-5F9A95BA68E5}
102 {E5D94794-5671-4BD6-A16D-26EC18F3DB34} = {E5D94794-5671-4BD6-A16D-26EC18F3DB34}
103 {A5470DA6-0C3A-4602-B930-43DB25511A59} = {A5470DA6-0C3A-4602-B930-43DB25511A59}
104 {E87FD9BE-BE42-4EA3-BF4D-D992223046D9} = {E87FD9BE-BE42-4EA3-BF4D-D992223046D9}
105 {B4B838C7-2C72-428E-BBFD-25764E659A8B} = {B4B838C7-2C72-428E-BBFD-25764E659A8B}
106 {5EA5DDF0-C7E1-4F49-BEF5-9246A4656B2E} = {5EA5DDF0-C7E1-4F49-BEF5-9246A4656B2E}
107 {D37774F4-253D-4760-BF64-372A943224A1} = {D37774F4-253D-4760-BF64-372A943224A1}
108 EndProjectSection
109EndProject
110Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lscript_compile_fb", "..\lscript\lscript_compile\lscript_compile_fb_vc8.vcproj", "{B771CF1B-E253-47BD-8B0A-6B0440CC9228}"
111EndProject
112 ProjectSection(ProjectDependencies) = postProject
113 {44CE6D82-7320-4609-8FC3-5965C19F4808} = {44CE6D82-7320-4609-8FC3-5965C19F4808}
114 EndProjectSection
115EndProject
116 ProjectSection(ProjectDependencies) = postProject
117 {F882263E-4F2A-43D9-A45A-FA4C8EC66552} = {F882263E-4F2A-43D9-A45A-FA4C8EC66552}
118 EndProjectSection
119EndProject
120 ProjectSection(ProjectDependencies) = postProject
121 {A5504A1E-8BA4-45D2-8144-1B6937E37E98} = {A5504A1E-8BA4-45D2-8144-1B6937E37E98}
122 {7BCB4B2C-8378-4186-88EA-5742B5ABE17F} = {7BCB4B2C-8378-4186-88EA-5742B5ABE17F}
123 {E5D94794-5671-4BD6-A16D-26EC18F3DB34} = {E5D94794-5671-4BD6-A16D-26EC18F3DB34}
124 {E87FD9BE-BE42-4EA3-BF4D-D992223046D9} = {E87FD9BE-BE42-4EA3-BF4D-D992223046D9}
125 EndProjectSection
126EndProject
127Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "win_crash_logger", "..\win_crash_logger\win_crash_logger_vc8.vcproj", "{648685F3-8760-4CC5-BB2B-CAF9DECC25A4}"
128 ProjectSection(ProjectDependencies) = postProject
129 {B5B53617-416F-404A-BF10-22EBCCA0E4FB} = {B5B53617-416F-404A-BF10-22EBCCA0E4FB}
130 {7BCB4B2C-8378-4186-88EA-5742B5ABE17F} = {7BCB4B2C-8378-4186-88EA-5742B5ABE17F}
131 {E5D94794-5671-4BD6-A16D-26EC18F3DB34} = {E5D94794-5671-4BD6-A16D-26EC18F3DB34}
132 {E87FD9BE-BE42-4EA3-BF4D-D992223046D9} = {E87FD9BE-BE42-4EA3-BF4D-D992223046D9}
133 {D37774F4-253D-4760-BF64-372A943224A1} = {D37774F4-253D-4760-BF64-372A943224A1}
134 EndProjectSection
135EndProject
136Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "win_updater", "..\win_updater\win_updater_vc8.vcproj", "{E928F33B-E090-4FA8-818B-6B5D8B0F1F4B}"
137EndProject
138 ProjectSection(ProjectDependencies) = postProject
139 {7BCB4B2C-8378-4186-88EA-5742B5ABE17F} = {7BCB4B2C-8378-4186-88EA-5742B5ABE17F}
140 EndProjectSection
141EndProject
142 ProjectSection(ProjectDependencies) = postProject
143 {2ADE3C14-94C4-40BF-B033-70F3C954EE90} = {2ADE3C14-94C4-40BF-B033-70F3C954EE90}
144 {B5B53617-416F-404A-BF10-22EBCCA0E4FB} = {B5B53617-416F-404A-BF10-22EBCCA0E4FB}
145 {AF2D801E-EEE7-4B52-A025-F8E648ADC34B} = {AF2D801E-EEE7-4B52-A025-F8E648ADC34B}
146 {93B2BA29-FBE9-4376-92C1-6108DCFE09D3} = {93B2BA29-FBE9-4376-92C1-6108DCFE09D3}
147 {7BCB4B2C-8378-4186-88EA-5742B5ABE17F} = {7BCB4B2C-8378-4186-88EA-5742B5ABE17F}
148 {DE55D666-6A3D-476C-937F-109269B83681} = {DE55D666-6A3D-476C-937F-109269B83681}
149 {681FDD6C-2FAE-4CB9-AF6D-B952F2B151C5} = {681FDD6C-2FAE-4CB9-AF6D-B952F2B151C5}
150 {E5D94794-5671-4BD6-A16D-26EC18F3DB34} = {E5D94794-5671-4BD6-A16D-26EC18F3DB34}
151 {E87FD9BE-BE42-4EA3-BF4D-D992223046D9} = {E87FD9BE-BE42-4EA3-BF4D-D992223046D9}
152 {D37774F4-253D-4760-BF64-372A943224A1} = {D37774F4-253D-4760-BF64-372A943224A1}
153 EndProjectSection
154EndProject
155Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "llmedia", "..\llmedia\llmedia_vc8.vcproj", "{9D0C7E02-6506-4EE7-BC5C-75671D28D594}"
156EndProject
157EndProject
158Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test", "..\test\test_vc8.vcproj", "{BBAA6588-CA96-4A87-A988-B02270B8D02B}"
159 ProjectSection(ProjectDependencies) = postProject
160 {7BCB4B2C-8378-4186-88EA-5742B5ABE17F} = {7BCB4B2C-8378-4186-88EA-5742B5ABE17F}
161 {FCC4483C-5B84-4944-B91F-4589A219BC0B} = {FCC4483C-5B84-4944-B91F-4589A219BC0B}
162 {F882263E-4F2A-43D9-A45A-FA4C8EC66552} = {F882263E-4F2A-43D9-A45A-FA4C8EC66552}
163 {4B19F64E-AB97-4FB9-8E1D-74A8104DE0C4} = {4B19F64E-AB97-4FB9-8E1D-74A8104DE0C4}
164 {328D1968-924F-4863-AAE8-5F9A95BA68E5} = {328D1968-924F-4863-AAE8-5F9A95BA68E5}
165 {B771CF1B-E253-47BD-8B0A-6B0440CC9228} = {B771CF1B-E253-47BD-8B0A-6B0440CC9228}
166 {44CE6D82-7320-4609-8FC3-5965C19F4808} = {44CE6D82-7320-4609-8FC3-5965C19F4808}
167 {E5D94794-5671-4BD6-A16D-26EC18F3DB34} = {E5D94794-5671-4BD6-A16D-26EC18F3DB34}
168 {EC2A989E-3F8F-4B8B-9AE6-7C7EA37C84BC} = {EC2A989E-3F8F-4B8B-9AE6-7C7EA37C84BC}
169 {A5470DA6-0C3A-4602-B930-43DB25511A59} = {A5470DA6-0C3A-4602-B930-43DB25511A59}
170 {BFA102B0-C891-4E13-B1CF-C2F28073DA8E} = {BFA102B0-C891-4E13-B1CF-C2F28073DA8E}
171 {777F38BE-2DFE-4051-9AAD-2832ABC474CC} = {777F38BE-2DFE-4051-9AAD-2832ABC474CC}
172 {E87FD9BE-BE42-4EA3-BF4D-D992223046D9} = {E87FD9BE-BE42-4EA3-BF4D-D992223046D9}
173 {D37774F4-253D-4760-BF64-372A943224A1} = {D37774F4-253D-4760-BF64-372A943224A1}
174 EndProjectSection
175EndProject
176 ProjectSection(ProjectDependencies) = postProject
177 {2ADE3C14-94C4-40BF-B033-70F3C954EE90} = {2ADE3C14-94C4-40BF-B033-70F3C954EE90}
178 {B5B53617-416F-404A-BF10-22EBCCA0E4FB} = {B5B53617-416F-404A-BF10-22EBCCA0E4FB}
179 {AF2D801E-EEE7-4B52-A025-F8E648ADC34B} = {AF2D801E-EEE7-4B52-A025-F8E648ADC34B}
180 {7BCB4B2C-8378-4186-88EA-5742B5ABE17F} = {7BCB4B2C-8378-4186-88EA-5742B5ABE17F}
181 {FCC4483C-5B84-4944-B91F-4589A219BC0B} = {FCC4483C-5B84-4944-B91F-4589A219BC0B}
182 {4B19F64E-AB97-4FB9-8E1D-74A8104DE0C4} = {4B19F64E-AB97-4FB9-8E1D-74A8104DE0C4}
183 {E5D94794-5671-4BD6-A16D-26EC18F3DB34} = {E5D94794-5671-4BD6-A16D-26EC18F3DB34}
184 {E87FD9BE-BE42-4EA3-BF4D-D992223046D9} = {E87FD9BE-BE42-4EA3-BF4D-D992223046D9}
185 {D37774F4-253D-4760-BF64-372A943224A1} = {D37774F4-253D-4760-BF64-372A943224A1}
186 EndProjectSection
187EndProject
188EndProject
189EndProject
190 ProjectSection(ProjectDependencies) = postProject
191 {7BCB4B2C-8378-4186-88EA-5742B5ABE17F} = {7BCB4B2C-8378-4186-88EA-5742B5ABE17F}
192 {681FDD6C-2FAE-4CB9-AF6D-B952F2B151C5} = {681FDD6C-2FAE-4CB9-AF6D-B952F2B151C5}
193 {E87FD9BE-BE42-4EA3-BF4D-D992223046D9} = {E87FD9BE-BE42-4EA3-BF4D-D992223046D9}
194 {D37774F4-253D-4760-BF64-372A943224A1} = {D37774F4-253D-4760-BF64-372A943224A1}
195 EndProjectSection
196EndProject
197 ProjectSection(ProjectDependencies) = postProject
198 {7BCB4B2C-8378-4186-88EA-5742B5ABE17F} = {7BCB4B2C-8378-4186-88EA-5742B5ABE17F}
199 {681FDD6C-2FAE-4CB9-AF6D-B952F2B151C5} = {681FDD6C-2FAE-4CB9-AF6D-B952F2B151C5}
200 {E87FD9BE-BE42-4EA3-BF4D-D992223046D9} = {E87FD9BE-BE42-4EA3-BF4D-D992223046D9}
201 EndProjectSection
202EndProject
203Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "llimagej2coj", "..\llimagej2coj\llimagej2coj_vc8.vcproj", "{4C8D64D5-649F-481E-96BE-EF1E82A77ACB}"
204EndProject
205Global
206 GlobalSection(SolutionConfigurationPlatforms) = preSolution
207 Debug|Win32 = Debug|Win32
208 DebugMesaHeadless|Win32 = DebugMesaHeadless|Win32
209 Release|Win32 = Release|Win32
210 ReleaseForDownload|Win32 = ReleaseForDownload|Win32
211 ReleaseNoOpt|Win32 = ReleaseNoOpt|Win32
212 EndGlobalSection
213 GlobalSection(ProjectConfigurationPlatforms) = postSolution
214 {7BCB4B2C-8378-4186-88EA-5742B5ABE17F}.Debug|Win32.ActiveCfg = Debug|Win32
215 {7BCB4B2C-8378-4186-88EA-5742B5ABE17F}.Debug|Win32.Build.0 = Debug|Win32
216 {7BCB4B2C-8378-4186-88EA-5742B5ABE17F}.DebugMesaHeadless|Win32.ActiveCfg = Debug|Win32
217 {7BCB4B2C-8378-4186-88EA-5742B5ABE17F}.DebugMesaHeadless|Win32.Build.0 = Debug|Win32
218 {7BCB4B2C-8378-4186-88EA-5742B5ABE17F}.Release|Win32.ActiveCfg = Release|Win32
219 {7BCB4B2C-8378-4186-88EA-5742B5ABE17F}.Release|Win32.Build.0 = Release|Win32
220 {7BCB4B2C-8378-4186-88EA-5742B5ABE17F}.ReleaseForDownload|Win32.ActiveCfg = Release|Win32
221 {7BCB4B2C-8378-4186-88EA-5742B5ABE17F}.ReleaseForDownload|Win32.Build.0 = Release|Win32
222 {7BCB4B2C-8378-4186-88EA-5742B5ABE17F}.ReleaseNoOpt|Win32.ActiveCfg = ReleaseNoOpt|Win32
223 {7BCB4B2C-8378-4186-88EA-5742B5ABE17F}.ReleaseNoOpt|Win32.Build.0 = ReleaseNoOpt|Win32
224 {E87FD9BE-BE42-4EA3-BF4D-D992223046D9}.Debug|Win32.ActiveCfg = Debug|Win32
225 {E87FD9BE-BE42-4EA3-BF4D-D992223046D9}.Debug|Win32.Build.0 = Debug|Win32
226 {E87FD9BE-BE42-4EA3-BF4D-D992223046D9}.DebugMesaHeadless|Win32.ActiveCfg = Debug|Win32
227 {E87FD9BE-BE42-4EA3-BF4D-D992223046D9}.DebugMesaHeadless|Win32.Build.0 = Debug|Win32
228 {E87FD9BE-BE42-4EA3-BF4D-D992223046D9}.Release|Win32.ActiveCfg = Release|Win32
229 {E87FD9BE-BE42-4EA3-BF4D-D992223046D9}.Release|Win32.Build.0 = Release|Win32
230 {E87FD9BE-BE42-4EA3-BF4D-D992223046D9}.ReleaseForDownload|Win32.ActiveCfg = Release|Win32
231 {E87FD9BE-BE42-4EA3-BF4D-D992223046D9}.ReleaseForDownload|Win32.Build.0 = Release|Win32
232 {E87FD9BE-BE42-4EA3-BF4D-D992223046D9}.ReleaseNoOpt|Win32.ActiveCfg = ReleaseNoOpt|Win32
233 {E87FD9BE-BE42-4EA3-BF4D-D992223046D9}.ReleaseNoOpt|Win32.Build.0 = ReleaseNoOpt|Win32
234 {E5D94794-5671-4BD6-A16D-26EC18F3DB34}.Debug|Win32.ActiveCfg = Debug|Win32
235 {E5D94794-5671-4BD6-A16D-26EC18F3DB34}.Debug|Win32.Build.0 = Debug|Win32
236 {E5D94794-5671-4BD6-A16D-26EC18F3DB34}.DebugMesaHeadless|Win32.ActiveCfg = Debug|Win32
237 {E5D94794-5671-4BD6-A16D-26EC18F3DB34}.DebugMesaHeadless|Win32.Build.0 = Debug|Win32
238 {E5D94794-5671-4BD6-A16D-26EC18F3DB34}.Release|Win32.ActiveCfg = Release|Win32
239 {E5D94794-5671-4BD6-A16D-26EC18F3DB34}.Release|Win32.Build.0 = Release|Win32
240 {E5D94794-5671-4BD6-A16D-26EC18F3DB34}.ReleaseForDownload|Win32.ActiveCfg = Release|Win32
241 {E5D94794-5671-4BD6-A16D-26EC18F3DB34}.ReleaseForDownload|Win32.Build.0 = Release|Win32
242 {E5D94794-5671-4BD6-A16D-26EC18F3DB34}.ReleaseNoOpt|Win32.ActiveCfg = ReleaseNoOpt|Win32
243 {E5D94794-5671-4BD6-A16D-26EC18F3DB34}.ReleaseNoOpt|Win32.Build.0 = ReleaseNoOpt|Win32
244 {D37774F4-253D-4760-BF64-372A943224A1}.Debug|Win32.ActiveCfg = Debug|Win32
245 {D37774F4-253D-4760-BF64-372A943224A1}.Debug|Win32.Build.0 = Debug|Win32
246 {D37774F4-253D-4760-BF64-372A943224A1}.DebugMesaHeadless|Win32.ActiveCfg = Debug|Win32
247 {D37774F4-253D-4760-BF64-372A943224A1}.DebugMesaHeadless|Win32.Build.0 = Debug|Win32
248 {D37774F4-253D-4760-BF64-372A943224A1}.Release|Win32.ActiveCfg = Release|Win32
249 {D37774F4-253D-4760-BF64-372A943224A1}.Release|Win32.Build.0 = Release|Win32
250 {D37774F4-253D-4760-BF64-372A943224A1}.ReleaseForDownload|Win32.ActiveCfg = Release|Win32
251 {D37774F4-253D-4760-BF64-372A943224A1}.ReleaseForDownload|Win32.Build.0 = Release|Win32
252 {D37774F4-253D-4760-BF64-372A943224A1}.ReleaseNoOpt|Win32.ActiveCfg = ReleaseNoOpt|Win32
253 {D37774F4-253D-4760-BF64-372A943224A1}.ReleaseNoOpt|Win32.Build.0 = ReleaseNoOpt|Win32
254 {A5470DA6-0C3A-4602-B930-43DB25511A59}.Debug|Win32.ActiveCfg = Debug|Win32
255 {A5470DA6-0C3A-4602-B930-43DB25511A59}.Debug|Win32.Build.0 = Debug|Win32
256 {A5470DA6-0C3A-4602-B930-43DB25511A59}.DebugMesaHeadless|Win32.ActiveCfg = Debug|Win32
257 {A5470DA6-0C3A-4602-B930-43DB25511A59}.DebugMesaHeadless|Win32.Build.0 = Debug|Win32
258 {A5470DA6-0C3A-4602-B930-43DB25511A59}.Release|Win32.ActiveCfg = Release|Win32
259 {A5470DA6-0C3A-4602-B930-43DB25511A59}.Release|Win32.Build.0 = Release|Win32
260 {A5470DA6-0C3A-4602-B930-43DB25511A59}.ReleaseForDownload|Win32.ActiveCfg = Release|Win32
261 {A5470DA6-0C3A-4602-B930-43DB25511A59}.ReleaseForDownload|Win32.Build.0 = Release|Win32
262 {A5470DA6-0C3A-4602-B930-43DB25511A59}.ReleaseNoOpt|Win32.ActiveCfg = ReleaseNoOpt|Win32
263 {A5470DA6-0C3A-4602-B930-43DB25511A59}.ReleaseNoOpt|Win32.Build.0 = ReleaseNoOpt|Win32
264 {DE55D666-6A3D-476C-937F-109269B83681}.Debug|Win32.ActiveCfg = Debug|Win32
265 {DE55D666-6A3D-476C-937F-109269B83681}.Debug|Win32.Build.0 = Debug|Win32
266 {DE55D666-6A3D-476C-937F-109269B83681}.DebugMesaHeadless|Win32.ActiveCfg = Debug|Win32
267 {DE55D666-6A3D-476C-937F-109269B83681}.DebugMesaHeadless|Win32.Build.0 = Debug|Win32
268 {DE55D666-6A3D-476C-937F-109269B83681}.Release|Win32.ActiveCfg = Release|Win32
269 {DE55D666-6A3D-476C-937F-109269B83681}.Release|Win32.Build.0 = Release|Win32
270 {DE55D666-6A3D-476C-937F-109269B83681}.ReleaseForDownload|Win32.ActiveCfg = Release|Win32
271 {DE55D666-6A3D-476C-937F-109269B83681}.ReleaseForDownload|Win32.Build.0 = Release|Win32
272 {DE55D666-6A3D-476C-937F-109269B83681}.ReleaseNoOpt|Win32.ActiveCfg = ReleaseNoOpt|Win32
273 {DE55D666-6A3D-476C-937F-109269B83681}.ReleaseNoOpt|Win32.Build.0 = ReleaseNoOpt|Win32
274 {681FDD6C-2FAE-4CB9-AF6D-B952F2B151C5}.Debug|Win32.ActiveCfg = Debug|Win32
275 {681FDD6C-2FAE-4CB9-AF6D-B952F2B151C5}.Debug|Win32.Build.0 = Debug|Win32
276 {681FDD6C-2FAE-4CB9-AF6D-B952F2B151C5}.DebugMesaHeadless|Win32.ActiveCfg = Debug|Win32
277 {681FDD6C-2FAE-4CB9-AF6D-B952F2B151C5}.DebugMesaHeadless|Win32.Build.0 = Debug|Win32
278 {681FDD6C-2FAE-4CB9-AF6D-B952F2B151C5}.Release|Win32.ActiveCfg = Release|Win32
279 {681FDD6C-2FAE-4CB9-AF6D-B952F2B151C5}.Release|Win32.Build.0 = Release|Win32
280 {681FDD6C-2FAE-4CB9-AF6D-B952F2B151C5}.ReleaseForDownload|Win32.ActiveCfg = Release|Win32
281 {681FDD6C-2FAE-4CB9-AF6D-B952F2B151C5}.ReleaseForDownload|Win32.Build.0 = Release|Win32
282 {681FDD6C-2FAE-4CB9-AF6D-B952F2B151C5}.ReleaseNoOpt|Win32.ActiveCfg = ReleaseNoOpt|Win32
283 {681FDD6C-2FAE-4CB9-AF6D-B952F2B151C5}.ReleaseNoOpt|Win32.Build.0 = ReleaseNoOpt|Win32
284 {FCC4483C-5B84-4944-B91F-4589A219BC0B}.Debug|Win32.ActiveCfg = Debug|Win32
285 {FCC4483C-5B84-4944-B91F-4589A219BC0B}.Debug|Win32.Build.0 = Debug|Win32
286 {FCC4483C-5B84-4944-B91F-4589A219BC0B}.DebugMesaHeadless|Win32.ActiveCfg = Debug|Win32
287 {FCC4483C-5B84-4944-B91F-4589A219BC0B}.DebugMesaHeadless|Win32.Build.0 = Debug|Win32
288 {FCC4483C-5B84-4944-B91F-4589A219BC0B}.Release|Win32.ActiveCfg = Release|Win32
289 {FCC4483C-5B84-4944-B91F-4589A219BC0B}.Release|Win32.Build.0 = Release|Win32
290 {FCC4483C-5B84-4944-B91F-4589A219BC0B}.ReleaseForDownload|Win32.ActiveCfg = Release|Win32
291 {FCC4483C-5B84-4944-B91F-4589A219BC0B}.ReleaseForDownload|Win32.Build.0 = Release|Win32
292 {FCC4483C-5B84-4944-B91F-4589A219BC0B}.ReleaseNoOpt|Win32.ActiveCfg = ReleaseNoOpt|Win32
293 {FCC4483C-5B84-4944-B91F-4589A219BC0B}.ReleaseNoOpt|Win32.Build.0 = ReleaseNoOpt|Win32
294 {5EA5DDF0-C7E1-4F49-BEF5-9246A4656B2E}.Debug|Win32.ActiveCfg = Debug|Win32
295 {5EA5DDF0-C7E1-4F49-BEF5-9246A4656B2E}.Debug|Win32.Build.0 = Debug|Win32
296 {5EA5DDF0-C7E1-4F49-BEF5-9246A4656B2E}.DebugMesaHeadless|Win32.ActiveCfg = Debug|Win32
297 {5EA5DDF0-C7E1-4F49-BEF5-9246A4656B2E}.DebugMesaHeadless|Win32.Build.0 = Debug|Win32
298 {5EA5DDF0-C7E1-4F49-BEF5-9246A4656B2E}.Release|Win32.ActiveCfg = Release|Win32
299 {5EA5DDF0-C7E1-4F49-BEF5-9246A4656B2E}.Release|Win32.Build.0 = Release|Win32
300 {5EA5DDF0-C7E1-4F49-BEF5-9246A4656B2E}.ReleaseForDownload|Win32.ActiveCfg = Release|Win32
301 {5EA5DDF0-C7E1-4F49-BEF5-9246A4656B2E}.ReleaseForDownload|Win32.Build.0 = Release|Win32
302 {5EA5DDF0-C7E1-4F49-BEF5-9246A4656B2E}.ReleaseNoOpt|Win32.ActiveCfg = ReleaseNoOpt|Win32
303 {5EA5DDF0-C7E1-4F49-BEF5-9246A4656B2E}.ReleaseNoOpt|Win32.Build.0 = ReleaseNoOpt|Win32
304 {93B2BA29-FBE9-4376-92C1-6108DCFE09D3}.Debug|Win32.ActiveCfg = Debug|Win32
305 {93B2BA29-FBE9-4376-92C1-6108DCFE09D3}.Debug|Win32.Build.0 = Debug|Win32
306 {93B2BA29-FBE9-4376-92C1-6108DCFE09D3}.DebugMesaHeadless|Win32.ActiveCfg = Debug|Win32
307 {93B2BA29-FBE9-4376-92C1-6108DCFE09D3}.DebugMesaHeadless|Win32.Build.0 = Debug|Win32
308 {93B2BA29-FBE9-4376-92C1-6108DCFE09D3}.Release|Win32.ActiveCfg = Release|Win32
309 {93B2BA29-FBE9-4376-92C1-6108DCFE09D3}.Release|Win32.Build.0 = Release|Win32
310 {93B2BA29-FBE9-4376-92C1-6108DCFE09D3}.ReleaseForDownload|Win32.ActiveCfg = Release|Win32
311 {93B2BA29-FBE9-4376-92C1-6108DCFE09D3}.ReleaseForDownload|Win32.Build.0 = Release|Win32
312 {93B2BA29-FBE9-4376-92C1-6108DCFE09D3}.ReleaseNoOpt|Win32.ActiveCfg = ReleaseNoOpt|Win32
313 {93B2BA29-FBE9-4376-92C1-6108DCFE09D3}.ReleaseNoOpt|Win32.Build.0 = ReleaseNoOpt|Win32
314 {2ADE3C14-94C4-40BF-B033-70F3C954EE90}.Debug|Win32.ActiveCfg = Debug|Win32
315 {2ADE3C14-94C4-40BF-B033-70F3C954EE90}.Debug|Win32.Build.0 = Debug|Win32
316 {2ADE3C14-94C4-40BF-B033-70F3C954EE90}.DebugMesaHeadless|Win32.ActiveCfg = Debug|Win32
317 {2ADE3C14-94C4-40BF-B033-70F3C954EE90}.DebugMesaHeadless|Win32.Build.0 = Debug|Win32
318 {2ADE3C14-94C4-40BF-B033-70F3C954EE90}.Release|Win32.ActiveCfg = Release|Win32
319 {2ADE3C14-94C4-40BF-B033-70F3C954EE90}.Release|Win32.Build.0 = Release|Win32
320 {2ADE3C14-94C4-40BF-B033-70F3C954EE90}.ReleaseForDownload|Win32.ActiveCfg = Release|Win32
321 {2ADE3C14-94C4-40BF-B033-70F3C954EE90}.ReleaseForDownload|Win32.Build.0 = Release|Win32
322 {2ADE3C14-94C4-40BF-B033-70F3C954EE90}.ReleaseNoOpt|Win32.ActiveCfg = ReleaseNoOpt|Win32
323 {2ADE3C14-94C4-40BF-B033-70F3C954EE90}.ReleaseNoOpt|Win32.Build.0 = ReleaseNoOpt|Win32
324 {328D1968-924F-4863-AAE8-5F9A95BA68E5}.Debug|Win32.ActiveCfg = Debug|Win32
325 {328D1968-924F-4863-AAE8-5F9A95BA68E5}.Debug|Win32.Build.0 = Debug|Win32
326 {328D1968-924F-4863-AAE8-5F9A95BA68E5}.DebugMesaHeadless|Win32.ActiveCfg = Debug|Win32
327 {328D1968-924F-4863-AAE8-5F9A95BA68E5}.DebugMesaHeadless|Win32.Build.0 = Debug|Win32
328 {328D1968-924F-4863-AAE8-5F9A95BA68E5}.Release|Win32.ActiveCfg = Release|Win32
329 {328D1968-924F-4863-AAE8-5F9A95BA68E5}.Release|Win32.Build.0 = Release|Win32
330 {328D1968-924F-4863-AAE8-5F9A95BA68E5}.ReleaseForDownload|Win32.ActiveCfg = Release|Win32
331 {328D1968-924F-4863-AAE8-5F9A95BA68E5}.ReleaseForDownload|Win32.Build.0 = Release|Win32
332 {328D1968-924F-4863-AAE8-5F9A95BA68E5}.ReleaseNoOpt|Win32.ActiveCfg = ReleaseNoOpt|Win32
333 {328D1968-924F-4863-AAE8-5F9A95BA68E5}.ReleaseNoOpt|Win32.Build.0 = ReleaseNoOpt|Win32
334 {E6F4CF1B-6109-4CA8-B58D-87FA936CDE08}.Debug|Win32.ActiveCfg = Debug|Win32
335 {E6F4CF1B-6109-4CA8-B58D-87FA936CDE08}.Debug|Win32.Build.0 = Debug|Win32
336 {E6F4CF1B-6109-4CA8-B58D-87FA936CDE08}.DebugMesaHeadless|Win32.ActiveCfg = Debug|Win32
337 {E6F4CF1B-6109-4CA8-B58D-87FA936CDE08}.DebugMesaHeadless|Win32.Build.0 = Debug|Win32
338 {E6F4CF1B-6109-4CA8-B58D-87FA936CDE08}.Release|Win32.ActiveCfg = Release|Win32
339 {E6F4CF1B-6109-4CA8-B58D-87FA936CDE08}.Release|Win32.Build.0 = Release|Win32
340 {E6F4CF1B-6109-4CA8-B58D-87FA936CDE08}.ReleaseForDownload|Win32.ActiveCfg = ReleaseForDownload|Win32
341 {E6F4CF1B-6109-4CA8-B58D-87FA936CDE08}.ReleaseForDownload|Win32.Build.0 = ReleaseForDownload|Win32
342 {E6F4CF1B-6109-4CA8-B58D-87FA936CDE08}.ReleaseNoOpt|Win32.ActiveCfg = ReleaseNoOpt|Win32
343 {E6F4CF1B-6109-4CA8-B58D-87FA936CDE08}.ReleaseNoOpt|Win32.Build.0 = ReleaseNoOpt|Win32
344 {B4B838C7-2C72-428E-BBFD-25764E659A8B}.Debug|Win32.ActiveCfg = Debug|Win32
345 {B4B838C7-2C72-428E-BBFD-25764E659A8B}.Debug|Win32.Build.0 = Debug|Win32
346 {B4B838C7-2C72-428E-BBFD-25764E659A8B}.DebugMesaHeadless|Win32.ActiveCfg = Debug|Win32
347 {B4B838C7-2C72-428E-BBFD-25764E659A8B}.DebugMesaHeadless|Win32.Build.0 = Debug|Win32
348 {B4B838C7-2C72-428E-BBFD-25764E659A8B}.Release|Win32.ActiveCfg = Release|Win32
349 {B4B838C7-2C72-428E-BBFD-25764E659A8B}.Release|Win32.Build.0 = Release|Win32
350 {B4B838C7-2C72-428E-BBFD-25764E659A8B}.ReleaseForDownload|Win32.ActiveCfg = Release|Win32
351 {B4B838C7-2C72-428E-BBFD-25764E659A8B}.ReleaseForDownload|Win32.Build.0 = Release|Win32
352 {B4B838C7-2C72-428E-BBFD-25764E659A8B}.ReleaseNoOpt|Win32.ActiveCfg = ReleaseNoOpt|Win32
353 {B4B838C7-2C72-428E-BBFD-25764E659A8B}.ReleaseNoOpt|Win32.Build.0 = ReleaseNoOpt|Win32
354 {B5B53617-416F-404A-BF10-22EBCCA0E4FB}.Debug|Win32.ActiveCfg = Debug|Win32
355 {B5B53617-416F-404A-BF10-22EBCCA0E4FB}.Debug|Win32.Build.0 = Debug|Win32
356 {B5B53617-416F-404A-BF10-22EBCCA0E4FB}.DebugMesaHeadless|Win32.ActiveCfg = DebugMesaHeadless|Win32
357 {B5B53617-416F-404A-BF10-22EBCCA0E4FB}.DebugMesaHeadless|Win32.Build.0 = DebugMesaHeadless|Win32
358 {B5B53617-416F-404A-BF10-22EBCCA0E4FB}.Release|Win32.ActiveCfg = Release|Win32
359 {B5B53617-416F-404A-BF10-22EBCCA0E4FB}.Release|Win32.Build.0 = Release|Win32
360 {B5B53617-416F-404A-BF10-22EBCCA0E4FB}.ReleaseForDownload|Win32.ActiveCfg = Release|Win32
361 {B5B53617-416F-404A-BF10-22EBCCA0E4FB}.ReleaseForDownload|Win32.Build.0 = Release|Win32
362 {B5B53617-416F-404A-BF10-22EBCCA0E4FB}.ReleaseNoOpt|Win32.ActiveCfg = ReleaseNoOpt|Win32
363 {B5B53617-416F-404A-BF10-22EBCCA0E4FB}.ReleaseNoOpt|Win32.Build.0 = ReleaseNoOpt|Win32
364 {BFA102B0-C891-4E13-B1CF-C2F28073DA8E}.Debug|Win32.ActiveCfg = Debug|Win32
365 {BFA102B0-C891-4E13-B1CF-C2F28073DA8E}.Debug|Win32.Build.0 = Debug|Win32
366 {BFA102B0-C891-4E13-B1CF-C2F28073DA8E}.DebugMesaHeadless|Win32.ActiveCfg = Debug|Win32
367 {BFA102B0-C891-4E13-B1CF-C2F28073DA8E}.DebugMesaHeadless|Win32.Build.0 = Debug|Win32
368 {BFA102B0-C891-4E13-B1CF-C2F28073DA8E}.Release|Win32.ActiveCfg = Release|Win32
369 {BFA102B0-C891-4E13-B1CF-C2F28073DA8E}.Release|Win32.Build.0 = Release|Win32
370 {BFA102B0-C891-4E13-B1CF-C2F28073DA8E}.ReleaseForDownload|Win32.ActiveCfg = Release|Win32
371 {BFA102B0-C891-4E13-B1CF-C2F28073DA8E}.ReleaseForDownload|Win32.Build.0 = Release|Win32
372 {BFA102B0-C891-4E13-B1CF-C2F28073DA8E}.ReleaseNoOpt|Win32.ActiveCfg = ReleaseNoOpt|Win32
373 {BFA102B0-C891-4E13-B1CF-C2F28073DA8E}.ReleaseNoOpt|Win32.Build.0 = ReleaseNoOpt|Win32
374 {F882263E-4F2A-43D9-A45A-FA4C8EC66552}.Debug|Win32.ActiveCfg = Debug|Win32
375 {F882263E-4F2A-43D9-A45A-FA4C8EC66552}.Debug|Win32.Build.0 = Debug|Win32
376 {F882263E-4F2A-43D9-A45A-FA4C8EC66552}.DebugMesaHeadless|Win32.ActiveCfg = Debug|Win32
377 {F882263E-4F2A-43D9-A45A-FA4C8EC66552}.DebugMesaHeadless|Win32.Build.0 = Debug|Win32
378 {F882263E-4F2A-43D9-A45A-FA4C8EC66552}.Release|Win32.ActiveCfg = Release|Win32
379 {F882263E-4F2A-43D9-A45A-FA4C8EC66552}.Release|Win32.Build.0 = Release|Win32
380 {F882263E-4F2A-43D9-A45A-FA4C8EC66552}.ReleaseForDownload|Win32.ActiveCfg = Release|Win32
381 {F882263E-4F2A-43D9-A45A-FA4C8EC66552}.ReleaseForDownload|Win32.Build.0 = Release|Win32
382 {F882263E-4F2A-43D9-A45A-FA4C8EC66552}.ReleaseNoOpt|Win32.ActiveCfg = ReleaseNoOpt|Win32
383 {F882263E-4F2A-43D9-A45A-FA4C8EC66552}.ReleaseNoOpt|Win32.Build.0 = ReleaseNoOpt|Win32
384 {44CE6D82-7320-4609-8FC3-5965C19F4808}.Debug|Win32.ActiveCfg = Debug|Win32
385 {44CE6D82-7320-4609-8FC3-5965C19F4808}.Debug|Win32.Build.0 = Debug|Win32
386 {44CE6D82-7320-4609-8FC3-5965C19F4808}.DebugMesaHeadless|Win32.ActiveCfg = Debug|Win32
387 {44CE6D82-7320-4609-8FC3-5965C19F4808}.DebugMesaHeadless|Win32.Build.0 = Debug|Win32
388 {44CE6D82-7320-4609-8FC3-5965C19F4808}.Release|Win32.ActiveCfg = Release|Win32
389 {44CE6D82-7320-4609-8FC3-5965C19F4808}.Release|Win32.Build.0 = Release|Win32
390 {44CE6D82-7320-4609-8FC3-5965C19F4808}.ReleaseForDownload|Win32.ActiveCfg = Release|Win32
391 {44CE6D82-7320-4609-8FC3-5965C19F4808}.ReleaseForDownload|Win32.Build.0 = Release|Win32
392 {44CE6D82-7320-4609-8FC3-5965C19F4808}.ReleaseNoOpt|Win32.ActiveCfg = ReleaseNoOpt|Win32
393 {44CE6D82-7320-4609-8FC3-5965C19F4808}.ReleaseNoOpt|Win32.Build.0 = ReleaseNoOpt|Win32
394 {D0FDC1C3-A589-40F2-ABCA-A84FF3835624}.Debug|Win32.ActiveCfg = Debug|Win32
395 {D0FDC1C3-A589-40F2-ABCA-A84FF3835624}.Debug|Win32.Build.0 = Debug|Win32
396 {D0FDC1C3-A589-40F2-ABCA-A84FF3835624}.DebugMesaHeadless|Win32.ActiveCfg = Debug|Win32
397 {D0FDC1C3-A589-40F2-ABCA-A84FF3835624}.DebugMesaHeadless|Win32.Build.0 = Debug|Win32
398 {D0FDC1C3-A589-40F2-ABCA-A84FF3835624}.Release|Win32.ActiveCfg = Release|Win32
399 {D0FDC1C3-A589-40F2-ABCA-A84FF3835624}.Release|Win32.Build.0 = Release|Win32
400 {D0FDC1C3-A589-40F2-ABCA-A84FF3835624}.ReleaseForDownload|Win32.ActiveCfg = Release|Win32
401 {D0FDC1C3-A589-40F2-ABCA-A84FF3835624}.ReleaseForDownload|Win32.Build.0 = Release|Win32
402 {D0FDC1C3-A589-40F2-ABCA-A84FF3835624}.ReleaseNoOpt|Win32.ActiveCfg = ReleaseNoOpt|Win32
403 {D0FDC1C3-A589-40F2-ABCA-A84FF3835624}.ReleaseNoOpt|Win32.Build.0 = ReleaseNoOpt|Win32
404 {C6CA76F5-DCB4-4789-BBA7-43D11EE7C8E2}.Debug|Win32.ActiveCfg = Debug|Win32
405 {C6CA76F5-DCB4-4789-BBA7-43D11EE7C8E2}.Debug|Win32.Build.0 = Debug|Win32
406 {C6CA76F5-DCB4-4789-BBA7-43D11EE7C8E2}.DebugMesaHeadless|Win32.ActiveCfg = Debug|Win32
407 {C6CA76F5-DCB4-4789-BBA7-43D11EE7C8E2}.DebugMesaHeadless|Win32.Build.0 = Debug|Win32
408 {C6CA76F5-DCB4-4789-BBA7-43D11EE7C8E2}.Release|Win32.ActiveCfg = Release|Win32
409 {C6CA76F5-DCB4-4789-BBA7-43D11EE7C8E2}.Release|Win32.Build.0 = Release|Win32
410 {C6CA76F5-DCB4-4789-BBA7-43D11EE7C8E2}.ReleaseForDownload|Win32.ActiveCfg = Release|Win32
411 {C6CA76F5-DCB4-4789-BBA7-43D11EE7C8E2}.ReleaseForDownload|Win32.Build.0 = Release|Win32
412 {C6CA76F5-DCB4-4789-BBA7-43D11EE7C8E2}.ReleaseNoOpt|Win32.ActiveCfg = ReleaseNoOpt|Win32
413 {C6CA76F5-DCB4-4789-BBA7-43D11EE7C8E2}.ReleaseNoOpt|Win32.Build.0 = ReleaseNoOpt|Win32
414 {A5504A1E-8BA4-45D2-8144-1B6937E37E98}.Debug|Win32.ActiveCfg = Debug|Win32
415 {A5504A1E-8BA4-45D2-8144-1B6937E37E98}.Debug|Win32.Build.0 = Debug|Win32
416 {A5504A1E-8BA4-45D2-8144-1B6937E37E98}.DebugMesaHeadless|Win32.ActiveCfg = Debug|Win32
417 {A5504A1E-8BA4-45D2-8144-1B6937E37E98}.DebugMesaHeadless|Win32.Build.0 = Debug|Win32
418 {A5504A1E-8BA4-45D2-8144-1B6937E37E98}.Release|Win32.ActiveCfg = Release|Win32
419 {A5504A1E-8BA4-45D2-8144-1B6937E37E98}.Release|Win32.Build.0 = Release|Win32
420 {A5504A1E-8BA4-45D2-8144-1B6937E37E98}.ReleaseForDownload|Win32.ActiveCfg = Release|Win32
421 {A5504A1E-8BA4-45D2-8144-1B6937E37E98}.ReleaseForDownload|Win32.Build.0 = Release|Win32
422 {A5504A1E-8BA4-45D2-8144-1B6937E37E98}.ReleaseNoOpt|Win32.ActiveCfg = ReleaseNoOpt|Win32
423 {A5504A1E-8BA4-45D2-8144-1B6937E37E98}.ReleaseNoOpt|Win32.Build.0 = ReleaseNoOpt|Win32
424 {B771CF1B-E253-47BD-8B0A-6B0440CC9228}.Debug|Win32.ActiveCfg = Debug|Win32
425 {B771CF1B-E253-47BD-8B0A-6B0440CC9228}.Debug|Win32.Build.0 = Debug|Win32
426 {B771CF1B-E253-47BD-8B0A-6B0440CC9228}.DebugMesaHeadless|Win32.ActiveCfg = Debug|Win32
427 {B771CF1B-E253-47BD-8B0A-6B0440CC9228}.DebugMesaHeadless|Win32.Build.0 = Debug|Win32
428 {B771CF1B-E253-47BD-8B0A-6B0440CC9228}.Release|Win32.ActiveCfg = Release|Win32
429 {B771CF1B-E253-47BD-8B0A-6B0440CC9228}.Release|Win32.Build.0 = Release|Win32
430 {B771CF1B-E253-47BD-8B0A-6B0440CC9228}.ReleaseForDownload|Win32.ActiveCfg = Release|Win32
431 {B771CF1B-E253-47BD-8B0A-6B0440CC9228}.ReleaseForDownload|Win32.Build.0 = Release|Win32
432 {B771CF1B-E253-47BD-8B0A-6B0440CC9228}.ReleaseNoOpt|Win32.ActiveCfg = Release|Win32
433 {B771CF1B-E253-47BD-8B0A-6B0440CC9228}.ReleaseNoOpt|Win32.Build.0 = Release|Win32
434 {777F38BE-2DFE-4051-9AAD-2832ABC474CC}.Debug|Win32.ActiveCfg = Debug|Win32
435 {777F38BE-2DFE-4051-9AAD-2832ABC474CC}.Debug|Win32.Build.0 = Debug|Win32
436 {777F38BE-2DFE-4051-9AAD-2832ABC474CC}.DebugMesaHeadless|Win32.ActiveCfg = Debug|Win32
437 {777F38BE-2DFE-4051-9AAD-2832ABC474CC}.DebugMesaHeadless|Win32.Build.0 = Debug|Win32
438 {777F38BE-2DFE-4051-9AAD-2832ABC474CC}.Release|Win32.ActiveCfg = Release|Win32
439 {777F38BE-2DFE-4051-9AAD-2832ABC474CC}.Release|Win32.Build.0 = Release|Win32
440 {777F38BE-2DFE-4051-9AAD-2832ABC474CC}.ReleaseForDownload|Win32.ActiveCfg = Release|Win32
441 {777F38BE-2DFE-4051-9AAD-2832ABC474CC}.ReleaseNoOpt|Win32.ActiveCfg = Release|Win32
442 {EC2A989E-3F8F-4B8B-9AE6-7C7EA37C84BC}.Debug|Win32.ActiveCfg = Debug|Win32
443 {EC2A989E-3F8F-4B8B-9AE6-7C7EA37C84BC}.Debug|Win32.Build.0 = Debug|Win32
444 {EC2A989E-3F8F-4B8B-9AE6-7C7EA37C84BC}.DebugMesaHeadless|Win32.ActiveCfg = Debug|Win32
445 {EC2A989E-3F8F-4B8B-9AE6-7C7EA37C84BC}.DebugMesaHeadless|Win32.Build.0 = Debug|Win32
446 {EC2A989E-3F8F-4B8B-9AE6-7C7EA37C84BC}.Release|Win32.ActiveCfg = Release|Win32
447 {EC2A989E-3F8F-4B8B-9AE6-7C7EA37C84BC}.Release|Win32.Build.0 = Release|Win32
448 {EC2A989E-3F8F-4B8B-9AE6-7C7EA37C84BC}.ReleaseForDownload|Win32.ActiveCfg = Release|Win32
449 {EC2A989E-3F8F-4B8B-9AE6-7C7EA37C84BC}.ReleaseNoOpt|Win32.ActiveCfg = Release|Win32
450 {14B06489-F3DD-4DB0-9B0E-A337F5894EDE}.Debug|Win32.ActiveCfg = Debug|Win32
451 {14B06489-F3DD-4DB0-9B0E-A337F5894EDE}.Debug|Win32.Build.0 = Debug|Win32
452 {14B06489-F3DD-4DB0-9B0E-A337F5894EDE}.DebugMesaHeadless|Win32.ActiveCfg = Debug|Win32
453 {14B06489-F3DD-4DB0-9B0E-A337F5894EDE}.DebugMesaHeadless|Win32.Build.0 = Debug|Win32
454 {14B06489-F3DD-4DB0-9B0E-A337F5894EDE}.Release|Win32.ActiveCfg = Release|Win32
455 {14B06489-F3DD-4DB0-9B0E-A337F5894EDE}.Release|Win32.Build.0 = Release|Win32
456 {14B06489-F3DD-4DB0-9B0E-A337F5894EDE}.ReleaseForDownload|Win32.ActiveCfg = Release|Win32
457 {14B06489-F3DD-4DB0-9B0E-A337F5894EDE}.ReleaseForDownload|Win32.Build.0 = Release|Win32
458 {14B06489-F3DD-4DB0-9B0E-A337F5894EDE}.ReleaseNoOpt|Win32.ActiveCfg = ReleaseNoOpt|Win32
459 {14B06489-F3DD-4DB0-9B0E-A337F5894EDE}.ReleaseNoOpt|Win32.Build.0 = ReleaseNoOpt|Win32
460 {648685F3-8760-4CC5-BB2B-CAF9DECC25A4}.Debug|Win32.ActiveCfg = Debug|Win32
461 {648685F3-8760-4CC5-BB2B-CAF9DECC25A4}.Debug|Win32.Build.0 = Debug|Win32
462 {648685F3-8760-4CC5-BB2B-CAF9DECC25A4}.DebugMesaHeadless|Win32.ActiveCfg = Debug|Win32
463 {648685F3-8760-4CC5-BB2B-CAF9DECC25A4}.DebugMesaHeadless|Win32.Build.0 = Debug|Win32
464 {648685F3-8760-4CC5-BB2B-CAF9DECC25A4}.Release|Win32.ActiveCfg = Release|Win32
465 {648685F3-8760-4CC5-BB2B-CAF9DECC25A4}.Release|Win32.Build.0 = Release|Win32
466 {648685F3-8760-4CC5-BB2B-CAF9DECC25A4}.ReleaseForDownload|Win32.ActiveCfg = Release|Win32
467 {648685F3-8760-4CC5-BB2B-CAF9DECC25A4}.ReleaseForDownload|Win32.Build.0 = Release|Win32
468 {648685F3-8760-4CC5-BB2B-CAF9DECC25A4}.ReleaseNoOpt|Win32.ActiveCfg = ReleaseNoOpt|Win32
469 {648685F3-8760-4CC5-BB2B-CAF9DECC25A4}.ReleaseNoOpt|Win32.Build.0 = ReleaseNoOpt|Win32
470 {E928F33B-E090-4FA8-818B-6B5D8B0F1F4B}.Debug|Win32.ActiveCfg = Debug|Win32
471 {E928F33B-E090-4FA8-818B-6B5D8B0F1F4B}.Debug|Win32.Build.0 = Debug|Win32
472 {E928F33B-E090-4FA8-818B-6B5D8B0F1F4B}.DebugMesaHeadless|Win32.ActiveCfg = Debug|Win32
473 {E928F33B-E090-4FA8-818B-6B5D8B0F1F4B}.DebugMesaHeadless|Win32.Build.0 = Debug|Win32
474 {E928F33B-E090-4FA8-818B-6B5D8B0F1F4B}.Release|Win32.ActiveCfg = Release|Win32
475 {E928F33B-E090-4FA8-818B-6B5D8B0F1F4B}.Release|Win32.Build.0 = Release|Win32
476 {E928F33B-E090-4FA8-818B-6B5D8B0F1F4B}.ReleaseForDownload|Win32.ActiveCfg = Release|Win32
477 {E928F33B-E090-4FA8-818B-6B5D8B0F1F4B}.ReleaseForDownload|Win32.Build.0 = Release|Win32
478 {E928F33B-E090-4FA8-818B-6B5D8B0F1F4B}.ReleaseNoOpt|Win32.ActiveCfg = ReleaseNoOpt|Win32
479 {E928F33B-E090-4FA8-818B-6B5D8B0F1F4B}.ReleaseNoOpt|Win32.Build.0 = ReleaseNoOpt|Win32
480 {F56CA265-93E9-4068-8A67-8B104C876D70}.Debug|Win32.ActiveCfg = Debug|Win32
481 {F56CA265-93E9-4068-8A67-8B104C876D70}.DebugMesaHeadless|Win32.ActiveCfg = Debug|Win32
482 {F56CA265-93E9-4068-8A67-8B104C876D70}.DebugMesaHeadless|Win32.Build.0 = Debug|Win32
483 {F56CA265-93E9-4068-8A67-8B104C876D70}.Release|Win32.ActiveCfg = Release|Win32
484 {F56CA265-93E9-4068-8A67-8B104C876D70}.ReleaseForDownload|Win32.ActiveCfg = Release|Win32
485 {F56CA265-93E9-4068-8A67-8B104C876D70}.ReleaseNoOpt|Win32.ActiveCfg = ReleaseNoOpt|Win32
486 {BF69CC7B-5C5B-40C3-93CB-92AD6A5FBC45}.Debug|Win32.ActiveCfg = Debug|Win32
487 {BF69CC7B-5C5B-40C3-93CB-92AD6A5FBC45}.Debug|Win32.Build.0 = Debug|Win32
488 {BF69CC7B-5C5B-40C3-93CB-92AD6A5FBC45}.DebugMesaHeadless|Win32.ActiveCfg = Debug|Win32
489 {BF69CC7B-5C5B-40C3-93CB-92AD6A5FBC45}.DebugMesaHeadless|Win32.Build.0 = Debug|Win32
490 {BF69CC7B-5C5B-40C3-93CB-92AD6A5FBC45}.Release|Win32.ActiveCfg = Release|Win32
491 {BF69CC7B-5C5B-40C3-93CB-92AD6A5FBC45}.Release|Win32.Build.0 = Release|Win32
492 {BF69CC7B-5C5B-40C3-93CB-92AD6A5FBC45}.ReleaseForDownload|Win32.ActiveCfg = Release|Win32
493 {BF69CC7B-5C5B-40C3-93CB-92AD6A5FBC45}.ReleaseNoOpt|Win32.ActiveCfg = ReleaseNoOpt|Win32
494 {BF69CC7B-5C5B-40C3-93CB-92AD6A5FBC45}.ReleaseNoOpt|Win32.Build.0 = ReleaseNoOpt|Win32
495 {9D0C7E02-6506-4EE7-BC5C-75671D28D594}.Debug|Win32.ActiveCfg = Debug|Win32
496 {9D0C7E02-6506-4EE7-BC5C-75671D28D594}.Debug|Win32.Build.0 = Debug|Win32
497 {9D0C7E02-6506-4EE7-BC5C-75671D28D594}.DebugMesaHeadless|Win32.ActiveCfg = Debug|Win32
498 {9D0C7E02-6506-4EE7-BC5C-75671D28D594}.DebugMesaHeadless|Win32.Build.0 = Debug|Win32
499 {9D0C7E02-6506-4EE7-BC5C-75671D28D594}.Release|Win32.ActiveCfg = Release|Win32
500 {9D0C7E02-6506-4EE7-BC5C-75671D28D594}.Release|Win32.Build.0 = Release|Win32
501 {9D0C7E02-6506-4EE7-BC5C-75671D28D594}.ReleaseForDownload|Win32.ActiveCfg = Release|Win32
502 {9D0C7E02-6506-4EE7-BC5C-75671D28D594}.ReleaseForDownload|Win32.Build.0 = Release|Win32
503 {9D0C7E02-6506-4EE7-BC5C-75671D28D594}.ReleaseNoOpt|Win32.ActiveCfg = ReleaseNoOpt|Win32
504 {9D0C7E02-6506-4EE7-BC5C-75671D28D594}.ReleaseNoOpt|Win32.Build.0 = ReleaseNoOpt|Win32
505 {4B19F64E-AB97-4FB9-8E1D-74A8104DE0C4}.Debug|Win32.ActiveCfg = Debug|Win32
506 {4B19F64E-AB97-4FB9-8E1D-74A8104DE0C4}.Debug|Win32.Build.0 = Debug|Win32
507 {4B19F64E-AB97-4FB9-8E1D-74A8104DE0C4}.DebugMesaHeadless|Win32.ActiveCfg = Debug|Win32
508 {4B19F64E-AB97-4FB9-8E1D-74A8104DE0C4}.DebugMesaHeadless|Win32.Build.0 = Debug|Win32
509 {4B19F64E-AB97-4FB9-8E1D-74A8104DE0C4}.Release|Win32.ActiveCfg = Release|Win32
510 {4B19F64E-AB97-4FB9-8E1D-74A8104DE0C4}.Release|Win32.Build.0 = Release|Win32
511 {4B19F64E-AB97-4FB9-8E1D-74A8104DE0C4}.ReleaseForDownload|Win32.ActiveCfg = Release|Win32
512 {4B19F64E-AB97-4FB9-8E1D-74A8104DE0C4}.ReleaseForDownload|Win32.Build.0 = Release|Win32
513 {4B19F64E-AB97-4FB9-8E1D-74A8104DE0C4}.ReleaseNoOpt|Win32.ActiveCfg = ReleaseNoOpt|Win32
514 {4B19F64E-AB97-4FB9-8E1D-74A8104DE0C4}.ReleaseNoOpt|Win32.Build.0 = ReleaseNoOpt|Win32
515 {BBAA6588-CA96-4A87-A988-B02270B8D02B}.Debug|Win32.ActiveCfg = Debug|Win32
516 {BBAA6588-CA96-4A87-A988-B02270B8D02B}.Debug|Win32.Build.0 = Debug|Win32
517 {BBAA6588-CA96-4A87-A988-B02270B8D02B}.DebugMesaHeadless|Win32.ActiveCfg = Debug|Win32
518 {BBAA6588-CA96-4A87-A988-B02270B8D02B}.DebugMesaHeadless|Win32.Build.0 = Debug|Win32
519 {BBAA6588-CA96-4A87-A988-B02270B8D02B}.Release|Win32.ActiveCfg = Release|Win32
520 {BBAA6588-CA96-4A87-A988-B02270B8D02B}.Release|Win32.Build.0 = Release|Win32
521 {BBAA6588-CA96-4A87-A988-B02270B8D02B}.ReleaseForDownload|Win32.ActiveCfg = Release|Win32
522 {BBAA6588-CA96-4A87-A988-B02270B8D02B}.ReleaseNoOpt|Win32.ActiveCfg = ReleaseNoOpt|Win32
523 {BBAA6588-CA96-4A87-A988-B02270B8D02B}.ReleaseNoOpt|Win32.Build.0 = ReleaseNoOpt|Win32
524 {E9F5BD55-F8E8-4C61-B9B5-CCE7C1048241}.Debug|Win32.ActiveCfg = Debug|Win32
525 {E9F5BD55-F8E8-4C61-B9B5-CCE7C1048241}.Debug|Win32.Build.0 = Debug|Win32
526 {E9F5BD55-F8E8-4C61-B9B5-CCE7C1048241}.DebugMesaHeadless|Win32.ActiveCfg = Debug|Win32
527 {E9F5BD55-F8E8-4C61-B9B5-CCE7C1048241}.DebugMesaHeadless|Win32.Build.0 = Debug|Win32
528 {E9F5BD55-F8E8-4C61-B9B5-CCE7C1048241}.Release|Win32.ActiveCfg = Release|Win32
529 {E9F5BD55-F8E8-4C61-B9B5-CCE7C1048241}.Release|Win32.Build.0 = Release|Win32
530 {E9F5BD55-F8E8-4C61-B9B5-CCE7C1048241}.ReleaseForDownload|Win32.ActiveCfg = Release|Win32
531 {E9F5BD55-F8E8-4C61-B9B5-CCE7C1048241}.ReleaseForDownload|Win32.Build.0 = Release|Win32
532 {E9F5BD55-F8E8-4C61-B9B5-CCE7C1048241}.ReleaseNoOpt|Win32.ActiveCfg = ReleaseNoOpt|Win32
533 {023011F7-3ADB-49D3-9EC5-6D392F6D15FE}.Debug|Win32.ActiveCfg = Debug|Win32
534 {023011F7-3ADB-49D3-9EC5-6D392F6D15FE}.Debug|Win32.Build.0 = Debug|Win32
535 {023011F7-3ADB-49D3-9EC5-6D392F6D15FE}.DebugMesaHeadless|Win32.ActiveCfg = Debug|Win32
536 {023011F7-3ADB-49D3-9EC5-6D392F6D15FE}.DebugMesaHeadless|Win32.Build.0 = Debug|Win32
537 {023011F7-3ADB-49D3-9EC5-6D392F6D15FE}.Release|Win32.ActiveCfg = Release|Win32
538 {023011F7-3ADB-49D3-9EC5-6D392F6D15FE}.Release|Win32.Build.0 = Release|Win32
539 {023011F7-3ADB-49D3-9EC5-6D392F6D15FE}.ReleaseForDownload|Win32.ActiveCfg = Release|Win32
540 {023011F7-3ADB-49D3-9EC5-6D392F6D15FE}.ReleaseForDownload|Win32.Build.0 = Release|Win32
541 {023011F7-3ADB-49D3-9EC5-6D392F6D15FE}.ReleaseNoOpt|Win32.ActiveCfg = ReleaseNoOpt|Win32
542 {023011F7-3ADB-49D3-9EC5-6D392F6D15FE}.ReleaseNoOpt|Win32.Build.0 = ReleaseNoOpt|Win32
543 {6AEE004D-BFE8-4082-B4D3-E51163B01EEB}.Debug|Win32.ActiveCfg = Debug|Win32
544 {6AEE004D-BFE8-4082-B4D3-E51163B01EEB}.Debug|Win32.Build.0 = Debug|Win32
545 {6AEE004D-BFE8-4082-B4D3-E51163B01EEB}.DebugMesaHeadless|Win32.ActiveCfg = Debug|Win32
546 {6AEE004D-BFE8-4082-B4D3-E51163B01EEB}.DebugMesaHeadless|Win32.Build.0 = Debug|Win32
547 {6AEE004D-BFE8-4082-B4D3-E51163B01EEB}.Release|Win32.ActiveCfg = Release|Win32
548 {6AEE004D-BFE8-4082-B4D3-E51163B01EEB}.Release|Win32.Build.0 = Release|Win32
549 {6AEE004D-BFE8-4082-B4D3-E51163B01EEB}.ReleaseForDownload|Win32.ActiveCfg = Release|Win32
550 {6AEE004D-BFE8-4082-B4D3-E51163B01EEB}.ReleaseForDownload|Win32.Build.0 = Release|Win32
551 {6AEE004D-BFE8-4082-B4D3-E51163B01EEB}.ReleaseNoOpt|Win32.ActiveCfg = ReleaseNoOpt|Win32
552 {6AEE004D-BFE8-4082-B4D3-E51163B01EEB}.ReleaseNoOpt|Win32.Build.0 = ReleaseNoOpt|Win32
553 {076DD042-2E58-42EA-9401-53210B65C1FC}.Debug|Win32.ActiveCfg = Debug|Win32
554 {076DD042-2E58-42EA-9401-53210B65C1FC}.Debug|Win32.Build.0 = Debug|Win32
555 {076DD042-2E58-42EA-9401-53210B65C1FC}.DebugMesaHeadless|Win32.ActiveCfg = Debug|Win32
556 {076DD042-2E58-42EA-9401-53210B65C1FC}.DebugMesaHeadless|Win32.Build.0 = Debug|Win32
557 {076DD042-2E58-42EA-9401-53210B65C1FC}.Release|Win32.ActiveCfg = Release|Win32
558 {076DD042-2E58-42EA-9401-53210B65C1FC}.Release|Win32.Build.0 = Release|Win32
559 {076DD042-2E58-42EA-9401-53210B65C1FC}.ReleaseForDownload|Win32.ActiveCfg = Release|Win32
560 {076DD042-2E58-42EA-9401-53210B65C1FC}.ReleaseForDownload|Win32.Build.0 = Release|Win32
561 {076DD042-2E58-42EA-9401-53210B65C1FC}.ReleaseNoOpt|Win32.ActiveCfg = ReleaseNoOpt|Win32
562 {076DD042-2E58-42EA-9401-53210B65C1FC}.ReleaseNoOpt|Win32.Build.0 = ReleaseNoOpt|Win32
563 {AF2D801E-EEE7-4B52-A025-F8E648ADC34B}.Debug|Win32.ActiveCfg = Debug|Win32
564 {AF2D801E-EEE7-4B52-A025-F8E648ADC34B}.Debug|Win32.Build.0 = Debug|Win32
565 {AF2D801E-EEE7-4B52-A025-F8E648ADC34B}.DebugMesaHeadless|Win32.ActiveCfg = Debug|Win32
566 {AF2D801E-EEE7-4B52-A025-F8E648ADC34B}.DebugMesaHeadless|Win32.Build.0 = Debug|Win32
567 {AF2D801E-EEE7-4B52-A025-F8E648ADC34B}.Release|Win32.ActiveCfg = Release|Win32
568 {AF2D801E-EEE7-4B52-A025-F8E648ADC34B}.Release|Win32.Build.0 = Release|Win32
569 {AF2D801E-EEE7-4B52-A025-F8E648ADC34B}.ReleaseForDownload|Win32.ActiveCfg = Release|Win32
570 {AF2D801E-EEE7-4B52-A025-F8E648ADC34B}.ReleaseForDownload|Win32.Build.0 = Release|Win32
571 {AF2D801E-EEE7-4B52-A025-F8E648ADC34B}.ReleaseNoOpt|Win32.ActiveCfg = ReleaseNoOpt|Win32
572 {AF2D801E-EEE7-4B52-A025-F8E648ADC34B}.ReleaseNoOpt|Win32.Build.0 = ReleaseNoOpt|Win32
573 {4C8D64D5-649F-481E-96BE-EF1E82A77ACB}.Debug|Win32.ActiveCfg = Debug|Win32
574 {4C8D64D5-649F-481E-96BE-EF1E82A77ACB}.Debug|Win32.Build.0 = Debug|Win32
575 {4C8D64D5-649F-481E-96BE-EF1E82A77ACB}.DebugMesaHeadless|Win32.ActiveCfg = Debug|Win32
576 {4C8D64D5-649F-481E-96BE-EF1E82A77ACB}.DebugMesaHeadless|Win32.Build.0 = Debug|Win32
577 {4C8D64D5-649F-481E-96BE-EF1E82A77ACB}.Release|Win32.ActiveCfg = Release|Win32
578 {4C8D64D5-649F-481E-96BE-EF1E82A77ACB}.Release|Win32.Build.0 = Release|Win32
579 {4C8D64D5-649F-481E-96BE-EF1E82A77ACB}.ReleaseForDownload|Win32.ActiveCfg = Release|Win32
580 {4C8D64D5-649F-481E-96BE-EF1E82A77ACB}.ReleaseForDownload|Win32.Build.0 = Release|Win32
581 {4C8D64D5-649F-481E-96BE-EF1E82A77ACB}.ReleaseNoOpt|Win32.ActiveCfg = ReleaseNoOpt|Win32
582 {4C8D64D5-649F-481E-96BE-EF1E82A77ACB}.ReleaseNoOpt|Win32.Build.0 = ReleaseNoOpt|Win32
583 EndGlobalSection
584 GlobalSection(SolutionProperties) = preSolution
585 HideSolutionNode = FALSE
586 EndGlobalSection
587EndGlobal
diff --git a/linden/indra/lib/python/indra/llmanifest.py b/linden/indra/lib/python/indra/llmanifest.py
new file mode 100644
index 0000000..6697299
--- /dev/null
+++ b/linden/indra/lib/python/indra/llmanifest.py
@@ -0,0 +1,562 @@
1#!/usr/bin/python
2# @file llmanifest.py
3# @author Ryan Williams
4# @brief Library for specifying operations on a set of files.
5#
6# Copyright (c) 2006-2007, Linden Research, Inc.
7#
8# The source code in this file ("Source Code") is provided by Linden Lab
9# to you under the terms of the GNU General Public License, version 2.0
10# ("GPL"), unless you have obtained a separate licensing agreement
11# ("Other License"), formally executed by you and Linden Lab. Terms of
12# the GPL can be found in doc/GPL-license.txt in this distribution, or
13# online at http://secondlife.com/developers/opensource/gplv2
14#
15# There are special exceptions to the terms and conditions of the GPL as
16# it is applied to this Source Code. View the full text of the exception
17# in the file doc/FLOSS-exception.txt in this software distribution, or
18# online at http://secondlife.com/developers/opensource/flossexception
19#
20# By copying, modifying or distributing this software, you acknowledge
21# that you have read and understood your obligations described above,
22# and agree to abide by those obligations.
23#
24# ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
25# WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
26# COMPLETENESS OR PERFORMANCE.
27
28import commands
29import filecmp
30import fnmatch
31import getopt
32import glob
33import os
34import os.path
35import re
36import shutil
37import sys
38import tarfile
39
40def path_ancestors(path):
41 path = os.path.normpath(path)
42 result = []
43 while len(path) > 0:
44 result.append(path)
45 path, sub = os.path.split(path)
46 return result
47
48def proper_windows_path(path, current_platform = sys.platform):
49 """ This function takes an absolute Windows or Cygwin path and
50 returns a path appropriately formatted for the platform it's
51 running on (as determined by sys.platform)"""
52 path = path.strip()
53 drive_letter = None
54 rel = None
55 match = re.match("/cygdrive/([a-z])/(.*)", path)
56 if(not match):
57 match = re.match('([a-zA-Z]):\\\(.*)', path)
58 if(not match):
59 return None # not an absolute path
60 drive_letter = match.group(1)
61 rel = match.group(2)
62 if(current_platform == "cygwin"):
63 return "/cygdrive/" + drive_letter.lower() + '/' + rel.replace('\\', '/')
64 else:
65 return drive_letter.upper() + ':\\' + rel.replace('/', '\\')
66
67def get_default_platform(dummy):
68 return {'linux2':'linux',
69 'linux1':'linux',
70 'cygwin':'windows',
71 'win32':'windows',
72 'darwin':'darwin'
73 }[sys.platform]
74
75def get_default_version(srctree):
76 # look up llversion.h and parse out the version info
77 paths = [os.path.join(srctree, x, 'llversion.h') for x in ['llcommon', '../llcommon', '../../indra/llcommon.h']]
78 for p in paths:
79 if os.path.exists(p):
80 contents = open(p, 'r').read()
81 major = re.search("LL_VERSION_MAJOR\s=\s([0-9]+)", contents).group(1)
82 minor = re.search("LL_VERSION_MINOR\s=\s([0-9]+)", contents).group(1)
83 patch = re.search("LL_VERSION_PATCH\s=\s([0-9]+)", contents).group(1)
84 build = re.search("LL_VERSION_BUILD\s=\s([0-9]+)", contents).group(1)
85 return major, minor, patch, build
86
87
88ARGUMENTS=[
89 dict(name='actions',
90 description="""This argument specifies the actions that are to be taken when the
91 script is run. The meaningful actions are currently:
92 copy - copies the files specified by the manifest into the
93 destination directory.
94 package - bundles up the files in the destination directory into
95 an installer for the current platform
96 unpacked - bundles up the files in the destination directory into
97 a simple tarball
98 Example use: %(name)s --actions="copy unpacked" """,
99 default="copy package"),
100 dict(name='arch',
101 description="""This argument is appended to the platform string for
102 determining which manifest class to run.
103 Example use: %(name)s --arch=i686
104 On Linux this would try to use Linux_i686Manifest.""",
105 default=""),
106 dict(name='configuration',
107 description="""The build configuration used. Only used on OS X for
108 now, but it could be used for other platforms as well.""",
109 default="Universal"),
110 dict(name='grid',
111 description="""Which grid the client will try to connect to. Even
112 though it's not strictly a grid, 'firstlook' is also an acceptable
113 value for this parameter.""",
114 default=""),
115 dict(name='installer_name',
116 description=""" The name of the file that the installer should be
117 packaged up into. Only used on Linux at the moment.""",
118 default=None),
119 dict(name='login_url',
120 description="""The url that the login screen displays in the client.""",
121 default=None),
122 dict(name='platform',
123 description="""The current platform, to be used for looking up which
124 manifest class to run.""",
125 default=get_default_platform),
126 dict(name='version',
127 description="""This specifies the version of Second Life that is
128 being packaged up.""",
129 default=get_default_version)
130 ]
131
132def usage(srctree=""):
133 nd = {'name':sys.argv[0]}
134 print """Usage:
135 %(name)s [options] [destdir]
136 Options:
137 """ % nd
138 for arg in ARGUMENTS:
139 default = arg['default']
140 if hasattr(default, '__call__'):
141 default = "(computed value) \"" + str(default(srctree)) + '"'
142 elif default is not None:
143 default = '"' + default + '"'
144 print "\t--%s Default: %s\n\t%s\n" % (
145 arg['name'],
146 default,
147 arg['description'] % nd)
148
149def main(argv=None, srctree='.', dsttree='./dst'):
150 if(argv == None):
151 argv = sys.argv
152
153 print "Source tree:", srctree
154 print "Destination tree:", dsttree
155
156 option_names = [arg['name'] + '=' for arg in ARGUMENTS]
157 option_names.append('help')
158 options, remainder = getopt.getopt(argv[1:], "", option_names)
159 if len(remainder) >= 1:
160 dsttree = remainder[0]
161
162 # convert options to a hash
163 args = {}
164 for opt in options:
165 args[opt[0].replace("--", "")] = opt[1]
166
167 # early out for help
168 if args.has_key('help'):
169 # *TODO: it is a huge hack to pass around the srctree like this
170 usage(srctree)
171 return
172
173 # defaults
174 for arg in ARGUMENTS:
175 if not args.has_key(arg['name']):
176 default = arg['default']
177 if hasattr(default, '__call__'):
178 default = default(srctree)
179 if default is not None:
180 args[arg['name']] = default
181
182 # fix up version
183 if args.has_key('version') and type(args['version']) == str:
184 args['version'] = args['version'].split('.')
185
186 # default and agni are default
187 if args['grid'] in ['default', 'agni']:
188 args['grid'] = ''
189
190 if args.has_key('actions'):
191 args['actions'] = args['actions'].split()
192
193 # debugging
194 for opt in args:
195 print "Option:", opt, "=", args[opt]
196
197 wm = LLManifest.for_platform(args['platform'], args.get('arch'))(srctree, dsttree, args)
198 wm.do(*args['actions'])
199 return 0
200
201class LLManifestRegistry(type):
202 def __init__(cls, name, bases, dct):
203 super(LLManifestRegistry, cls).__init__(name, bases, dct)
204 match = re.match("(\w+)Manifest", name)
205 if(match):
206 cls.manifests[match.group(1).lower()] = cls
207
208class LLManifest(object):
209 __metaclass__ = LLManifestRegistry
210 manifests = {}
211 def for_platform(self, platform, arch = None):
212 if arch:
213 platform = platform + '_' + arch
214 return self.manifests[platform.lower()]
215 for_platform = classmethod(for_platform)
216
217 def __init__(self, srctree, dsttree, args):
218 super(LLManifest, self).__init__()
219 self.args = args
220 self.file_list = []
221 self.excludes = []
222 self.actions = []
223 self.src_prefix = [srctree]
224 self.dst_prefix = [dsttree]
225 self.created_paths = []
226
227 def construct(self):
228 """ Meant to be overriden by LLManifest implementors with code that
229 constructs the complete destination hierarchy."""
230 pass # override this method
231
232 def exclude(self, glob):
233 """ Excludes all files that match the glob from being included
234 in the file list by path()."""
235 self.excludes.append(glob)
236
237 def prefix(self, src='', dst=None):
238 """ Pushes a prefix onto the stack. Until end_prefix is
239 called, all relevant method calls (esp. to path()) will prefix
240 paths with the entire prefix stack. Source and destination
241 prefixes can be different, though if only one is provided they
242 are both equal. To specify a no-op, use an empty string, not
243 None."""
244 if(dst == None):
245 dst = src
246 self.src_prefix.append(src)
247 self.dst_prefix.append(dst)
248 return True # so that you can wrap it in an if to get indentation
249
250 def end_prefix(self, descr=None):
251 """Pops a prefix off the stack. If given an argument, checks
252 the argument against the top of the stack. If the argument
253 matches neither the source or destination prefixes at the top
254 of the stack, then misnesting must have occurred and an
255 exception is raised."""
256 # as an error-prevention mechanism, check the prefix and see if it matches the source or destination prefix. If not, improper nesting may have occurred.
257 src = self.src_prefix.pop()
258 dst = self.dst_prefix.pop()
259 if descr and not(src == descr or dst == descr):
260 raise ValueError, "End prefix '" + descr + "' didn't match '" +src+ "' or '" +dst + "'"
261
262 def get_src_prefix(self):
263 """ Returns the current source prefix."""
264 return os.path.join(*self.src_prefix)
265
266 def get_dst_prefix(self):
267 """ Returns the current destination prefix."""
268 return os.path.join(*self.dst_prefix)
269
270 def src_path_of(self, relpath):
271 """Returns the full path to a file or directory specified
272 relative to the source directory."""
273 return os.path.join(self.get_src_prefix(), relpath)
274
275 def dst_path_of(self, relpath):
276 """Returns the full path to a file or directory specified
277 relative to the destination directory."""
278 return os.path.join(self.get_dst_prefix(), relpath)
279
280 def ensure_src_dir(self, reldir):
281 """Construct the path for a directory relative to the
282 source path, and ensures that it exists. Returns the
283 full path."""
284 path = os.path.join(self.get_src_prefix(), reldir)
285 self.cmakedirs(path)
286 return path
287
288 def ensure_dst_dir(self, reldir):
289 """Construct the path for a directory relative to the
290 destination path, and ensures that it exists. Returns the
291 full path."""
292 path = os.path.join(self.get_dst_prefix(), reldir)
293 self.cmakedirs(path)
294 return path
295
296 def run_command(self, command):
297 """ Runs an external command, and returns the output. Raises
298 an exception if the command reurns a nonzero status code. For
299 debugging/informational purpoases, prints out the command's
300 output as it is received."""
301 print "Running command:", command
302 fd = os.popen(command, 'r')
303 lines = []
304 while True:
305 lines.append(fd.readline())
306 if(lines[-1] == ''):
307 break
308 else:
309 print lines[-1],
310 output = ''.join(lines)
311 status = fd.close()
312 if(status):
313 raise RuntimeError, "Command " + command + " returned non-zero status (" + str(status) + ")"
314 return output
315
316 def created_path(self, path):
317 """ Declare that you've created a path in order to
318 a) verify that you really have created it
319 b) schedule it for cleanup"""
320 if not os.path.exists(path):
321 raise RuntimeError, "Should be something at path " + path
322 self.created_paths.append(path)
323
324 def put_in_file(self, contents, dst):
325 # write contents as dst
326 f = open(self.dst_path_of(dst), "wbU")
327 f.write(contents)
328 f.close()
329
330 def replace_in(self, src, dst=None, searchdict={}):
331 if(dst == None):
332 dst = src
333 # read src
334 f = open(self.src_path_of(src), "rbU")
335 contents = f.read()
336 f.close()
337 # apply dict replacements
338 for old, new in searchdict.iteritems():
339 contents = contents.replace(old, new)
340 self.put_in_file(contents, dst)
341 self.created_paths.append(dst)
342
343 def copy_action(self, src, dst):
344 if(src and (os.path.exists(src) or os.path.islink(src))):
345 # ensure that destination path exists
346 self.cmakedirs(os.path.dirname(dst))
347 self.created_paths.append(dst)
348 if(not os.path.isdir(src)):
349 self.ccopy(src,dst)
350 else:
351 # src is a dir
352 self.ccopytree(src,dst)
353 else:
354 print "Doesn't exist:", src
355
356 def package_action(self, src, dst):
357 pass
358
359 def copy_finish(self):
360 pass
361
362 def package_finish(self):
363 pass
364
365 def unpacked_finish(self):
366 unpacked_file_name = "unpacked_%(plat)s_%(vers)s.tar" % {
367 'plat':self.args['platform'],
368 'vers':'_'.join(self.args['version'])}
369 print "Creating unpacked file:", unpacked_file_name
370 # could add a gz here but that doubles the time it takes to do this step
371 tf = tarfile.open(self.src_path_of(unpacked_file_name), 'w:')
372 # add the entire installation package, at the very top level
373 tf.add(self.get_dst_prefix(), "")
374 tf.close()
375
376 def cleanup_finish(self):
377 """ Delete paths that were specified to have been created by this script"""
378 for c in self.created_paths:
379 # *TODO is this gonna be useful?
380 print "Cleaning up " + c
381
382 def process_file(self, src, dst):
383 if(self.includes(src, dst)):
384# print src, "=>", dst
385 for action in self.actions:
386 methodname = action + "_action"
387 method = getattr(self, methodname, None)
388 if method is not None:
389 method(src, dst)
390 self.file_list.append([src, dst])
391 else:
392 print "Excluding: ", src, dst
393
394
395 def process_directory(self, src, dst):
396 if(not self.includes(src, dst)):
397 print "Excluding: ", src, dst
398 return
399 names = os.listdir(src)
400 self.cmakedirs(dst)
401 errors = []
402 for name in names:
403 srcname = os.path.join(src, name)
404 dstname = os.path.join(dst, name)
405 if os.path.isdir(srcname):
406 self.process_directory(srcname, dstname)
407 else:
408 self.process_file(srcname, dstname)
409
410
411
412 def includes(self, src, dst):
413 if src:
414 for excl in self.excludes:
415 if fnmatch.fnmatch(src, excl):
416 return False
417 return True
418
419 def remove(self, *paths):
420 for path in paths:
421 if(os.path.exists(path)):
422 print "Removing path", path
423 if(os.path.isdir(path)):
424 shutil.rmtree(path)
425 else:
426 os.remove(path)
427
428 def ccopy(self, src, dst):
429 """ Copy a single file or symlink. Uses filecmp to skip copying for existing files."""
430 if os.path.islink(src):
431 linkto = os.readlink(src)
432 if(os.path.islink(dst) or os.path.exists(dst)):
433 os.remove(dst) # because symlinking over an existing link fails
434 os.symlink(linkto, dst)
435 else:
436 # Don't recopy file if it's up-to-date.
437 # If we seem to be not not overwriting files that have been
438 # updated, set the last arg to False, but it will take longer.
439 if(os.path.exists(dst) and filecmp.cmp(src, dst, True)):
440 return
441 # only copy if it's not excluded
442 if(self.includes(src, dst)):
443 shutil.copy2(src, dst)
444
445 def ccopytree(self, src, dst):
446 """Direct copy of shutil.copytree with the additional
447 feature that the destination directory can exist. It
448 is so dumb that Python doesn't come with this. Also it
449 implements the excludes functionality."""
450 if(not self.includes(src, dst)):
451 return
452 names = os.listdir(src)
453 self.cmakedirs(dst)
454 errors = []
455 for name in names:
456 srcname = os.path.join(src, name)
457 dstname = os.path.join(dst, name)
458 try:
459 if os.path.isdir(srcname):
460 self.ccopytree(srcname, dstname)
461 else:
462 self.ccopy(srcname, dstname)
463 # XXX What about devices, sockets etc.?
464 except (IOError, os.error), why:
465 errors.append((srcname, dstname, why))
466 if errors:
467 raise RuntimeError, errors
468
469
470 def cmakedirs(self, path):
471 """Ensures that a directory exists, and doesn't throw an exception
472 if you call it on an existing directory."""
473# print "making path: ", path
474 path = os.path.normpath(path)
475 self.created_paths.append(path)
476 if not os.path.exists(path):
477 os.makedirs(path)
478
479 def find_existing_file(self, *list):
480 for f in list:
481 if(os.path.exists(f)):
482 return f
483
484 def contents_of_tar(self, src_tar, dst_dir):
485 """ Extracts the contents of the tarfile (specified
486 relative to the source prefix) into the directory
487 specified relative to the destination directory."""
488 self.check_file_exists(src_tar)
489 tf = tarfile.open(self.src_path_of(src_tar), 'r')
490 for member in tf.getmembers():
491 tf.extract(member, self.ensure_dst_dir(dst_dir))
492 # TODO get actions working on these dudes, perhaps we should extract to a temporary directory and then process_directory on it?
493 self.file_list.append([src_tar,
494 self.dst_path_of(os.path.join(dst_dir,member.name))])
495 tf.close()
496
497
498 def wildcard_regex(self, src_glob, dst_glob):
499 # print "regex_pair:", src_glob, dst_glob
500 src_re = re.escape(src_glob)
501 src_re = src_re.replace('\*', '([-a-zA-Z0-9._ ]+)')
502 dst_temp = dst_glob
503 i = 1
504 while(dst_temp.count("*") > 0):
505 dst_temp = dst_temp.replace('*', '\g<' + str(i) + '>', 1)
506 i = i+1
507 # print "regex_result:", src_re, dst_temp
508 return re.compile(src_re), dst_temp
509
510 def check_file_exists(self, path):
511 if(not os.path.exists(path) and not os.path.islink(path)):
512 raise RuntimeError, "Path " + path + " doesn't exist"
513
514
515 wildcard_pattern = re.compile('\*')
516 def expand_globs(self, src, dst):
517 def fw_slash(str):
518 return str.replace('\\', '/')
519 def os_slash(str):
520 return str.replace('/', os.path.sep)
521 dst = fw_slash(dst)
522 src = fw_slash(src)
523 src_list = glob.glob(src)
524 src_re, d_template = self.wildcard_regex(src, dst)
525 for s in src_list:
526 s = fw_slash(s)
527 d = src_re.sub(d_template, s)
528 #print "s:",s, "d_t", d_template, "dst", dst, "d", d
529 yield os_slash(s), os_slash(d)
530
531 def path(self, src, dst=None):
532 print "Processing", src, "=>", dst
533 if dst == None:
534 dst = src
535 dst = os.path.join(self.get_dst_prefix(), dst)
536 src = os.path.join(self.get_src_prefix(), src)
537
538 # expand globs
539 if(self.wildcard_pattern.search(src)):
540 for s,d in self.expand_globs(src, dst):
541 self.process_file(s, d)
542 else:
543 # if we're specifying a single path (not a glob),
544 # we should error out if it doesn't exist
545 self.check_file_exists(src)
546 # if it's a directory, recurse through it
547 if(os.path.isdir(src)):
548 self.process_directory(src, dst)
549 else:
550 self.process_file(src, dst)
551
552
553 def do(self, *actions):
554 self.actions = actions
555 self.construct()
556 # perform finish actions
557 for action in self.actions:
558 methodname = action + "_finish"
559 method = getattr(self, methodname, None)
560 if method is not None:
561 method()
562 return self.file_list
diff --git a/linden/indra/llaudio/audioengine_fmod.cpp b/linden/indra/llaudio/audioengine_fmod.cpp
index 0e8ea67..2e8f45f 100644
--- a/linden/indra/llaudio/audioengine_fmod.cpp
+++ b/linden/indra/llaudio/audioengine_fmod.cpp
@@ -491,16 +491,17 @@ BOOL LLAudioChannelFMOD::updateBuffer()
491 // If we have a source for the channel, we need to update its gain. 491 // If we have a source for the channel, we need to update its gain.
492 if (mCurrentSourcep) 492 if (mCurrentSourcep)
493 { 493 {
494 // SJB: warnings can spam and hurt framerate, disabling
494 if (!FSOUND_SetVolume(mChannelID, llround(mCurrentSourcep->getGain() * 255.0f))) 495 if (!FSOUND_SetVolume(mChannelID, llround(mCurrentSourcep->getGain() * 255.0f)))
495 { 496 {
496 llwarns << "LLAudioChannelFMOD::updateBuffer error: " << FMOD_ErrorString(FSOUND_GetError()) << llendl; 497// llwarns << "LLAudioChannelFMOD::updateBuffer error: " << FMOD_ErrorString(FSOUND_GetError()) << llendl;
497 } 498 }
498 499
499 if (!FSOUND_SetLoopMode(mChannelID, mCurrentSourcep->isLoop() ? FSOUND_LOOP_NORMAL : FSOUND_LOOP_OFF)) 500 if (!FSOUND_SetLoopMode(mChannelID, mCurrentSourcep->isLoop() ? FSOUND_LOOP_NORMAL : FSOUND_LOOP_OFF))
500 { 501 {
501 llwarns << "Channel " << mChannelID << llendl; 502// llwarns << "Channel " << mChannelID << "Source ID: " << mCurrentSourcep->getID()
502 llwarns << "Source ID: " << mCurrentSourcep->getID() << " at " << mCurrentSourcep->getPositionGlobal() << llendl; 503// << " at " << mCurrentSourcep->getPositionGlobal() << llendl;
503 llwarns << "LLAudioChannelFMOD::updateBuffer error: " << FMOD_ErrorString(FSOUND_GetError()) << llendl; 504// llwarns << "LLAudioChannelFMOD::updateBuffer error: " << FMOD_ErrorString(FSOUND_GetError()) << llendl;
504 } 505 }
505 } 506 }
506 507
@@ -686,7 +687,7 @@ BOOL LLAudioBufferFMOD::loadWAV(const char *filename)
686 // MikeS. - Loading the sound file manually and then handing it over to FMOD, 687 // MikeS. - Loading the sound file manually and then handing it over to FMOD,
687 // since FMOD uses posix IO internally, 688 // since FMOD uses posix IO internally,
688 // which doesn't work with unicode file paths. 689 // which doesn't work with unicode file paths.
689 FILE* sound_file = LLFile::fopen(filename,"rb"); 690 FILE* sound_file = LLFile::fopen(filename,"rb"); /* Flawfinder: ignore */
690 if (sound_file) 691 if (sound_file)
691 { 692 {
692 fseek(sound_file,0,SEEK_END); 693 fseek(sound_file,0,SEEK_END);
diff --git a/linden/indra/llaudio/llaudio_vc8.vcproj b/linden/indra/llaudio/llaudio_vc8.vcproj
new file mode 100644
index 0000000..d0b4bb4
--- /dev/null
+++ b/linden/indra/llaudio/llaudio_vc8.vcproj
@@ -0,0 +1,321 @@
1<?xml version="1.0" encoding="Windows-1252"?>
2<VisualStudioProject
3 ProjectType="Visual C++"
4 Version="8.00"
5 Name="llaudio"
6 ProjectGUID="{93B2BA29-FBE9-4376-92C1-6108DCFE09D3}"
7 RootNamespace="llaudio"
8 Keyword="Win32Proj"
9 >
10 <Platforms>
11 <Platform
12 Name="Win32"
13 />
14 </Platforms>
15 <ToolFiles>
16 </ToolFiles>
17 <Configurations>
18 <Configuration
19 Name="Debug|Win32"
20 OutputDirectory="../lib_$(ConfigurationName)/i686-win32"
21 IntermediateDirectory="Debug"
22 ConfigurationType="4"
23 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
24 CharacterSet="1"
25 >
26 <Tool
27 Name="VCPreBuildEventTool"
28 />
29 <Tool
30 Name="VCCustomBuildTool"
31 />
32 <Tool
33 Name="VCXMLDataGeneratorTool"
34 />
35 <Tool
36 Name="VCWebServiceProxyGeneratorTool"
37 />
38 <Tool
39 Name="VCMIDLTool"
40 />
41 <Tool
42 Name="VCCLCompilerTool"
43 Optimization="0"
44 AdditionalIncludeDirectories="..\llcommon;..\llmath;..\llvfs;..\llmessage;..\..\libraries\i686-win32\include;..\..\libraries\include\;"
45 PreprocessorDefinitions="WIN32;_DEBUG;_LIB;LL_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;LL_DEBUG"
46 MinimalRebuild="true"
47 BasicRuntimeChecks="3"
48 RuntimeLibrary="1"
49 StructMemberAlignment="4"
50 TreatWChar_tAsBuiltInType="false"
51 ForceConformanceInForLoopScope="true"
52 UsePrecompiledHeader="0"
53 WarningLevel="3"
54 WarnAsError="true"
55 Detect64BitPortabilityProblems="false"
56 DebugInformationFormat="4"
57 />
58 <Tool
59 Name="VCManagedResourceCompilerTool"
60 />
61 <Tool
62 Name="VCResourceCompilerTool"
63 />
64 <Tool
65 Name="VCPreLinkEventTool"
66 />
67 <Tool
68 Name="VCLibrarianTool"
69 OutputFile="$(OutDir)/llaudio.lib"
70 />
71 <Tool
72 Name="VCALinkTool"
73 />
74 <Tool
75 Name="VCXDCMakeTool"
76 />
77 <Tool
78 Name="VCBscMakeTool"
79 />
80 <Tool
81 Name="VCFxCopTool"
82 />
83 <Tool
84 Name="VCPostBuildEventTool"
85 />
86 </Configuration>
87 <Configuration
88 Name="Release|Win32"
89 OutputDirectory="../lib_$(ConfigurationName)/i686-win32"
90 IntermediateDirectory="Release"
91 ConfigurationType="4"
92 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
93 CharacterSet="1"
94 >
95 <Tool
96 Name="VCPreBuildEventTool"
97 />
98 <Tool
99 Name="VCCustomBuildTool"
100 />
101 <Tool
102 Name="VCXMLDataGeneratorTool"
103 />
104 <Tool
105 Name="VCWebServiceProxyGeneratorTool"
106 />
107 <Tool
108 Name="VCMIDLTool"
109 />
110 <Tool
111 Name="VCCLCompilerTool"
112 AdditionalIncludeDirectories="..\llcommon;..\llmath;..\llvfs;..\llmessage;..\..\libraries\i686-win32\include;..\..\libraries\include\"
113 PreprocessorDefinitions="WIN32;NDEBUG;_LIB;LL_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;LL_RELEASE"
114 RuntimeLibrary="0"
115 StructMemberAlignment="0"
116 TreatWChar_tAsBuiltInType="false"
117 ForceConformanceInForLoopScope="true"
118 UsePrecompiledHeader="0"
119 WarningLevel="3"
120 WarnAsError="true"
121 Detect64BitPortabilityProblems="false"
122 DebugInformationFormat="3"
123 />
124 <Tool
125 Name="VCManagedResourceCompilerTool"
126 />
127 <Tool
128 Name="VCResourceCompilerTool"
129 />
130 <Tool
131 Name="VCPreLinkEventTool"
132 />
133 <Tool
134 Name="VCLibrarianTool"
135 OutputFile="$(OutDir)/llaudio.lib"
136 />
137 <Tool
138 Name="VCALinkTool"
139 />
140 <Tool
141 Name="VCXDCMakeTool"
142 />
143 <Tool
144 Name="VCBscMakeTool"
145 />
146 <Tool
147 Name="VCFxCopTool"
148 />
149 <Tool
150 Name="VCPostBuildEventTool"
151 />
152 </Configuration>
153 <Configuration
154 Name="ReleaseNoOpt|Win32"
155 OutputDirectory="../lib_$(ConfigurationName)/i686-win32"
156 IntermediateDirectory="$(ConfigurationName)"
157 ConfigurationType="4"
158 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
159 CharacterSet="1"
160 >
161 <Tool
162 Name="VCPreBuildEventTool"
163 />
164 <Tool
165 Name="VCCustomBuildTool"
166 />
167 <Tool
168 Name="VCXMLDataGeneratorTool"
169 />
170 <Tool
171 Name="VCWebServiceProxyGeneratorTool"
172 />
173 <Tool
174 Name="VCMIDLTool"
175 />
176 <Tool
177 Name="VCCLCompilerTool"
178 Optimization="0"
179 AdditionalIncludeDirectories="..\llcommon;..\llmath;..\llvfs;..\llmessage;..\..\libraries\i686-win32\include;..\..\libraries\include\"
180 PreprocessorDefinitions="WIN32;NDEBUG;_LIB;LL_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;LL_RELEASE"
181 RuntimeLibrary="0"
182 StructMemberAlignment="0"
183 TreatWChar_tAsBuiltInType="false"
184 ForceConformanceInForLoopScope="true"
185 UsePrecompiledHeader="0"
186 WarningLevel="3"
187 WarnAsError="true"
188 Detect64BitPortabilityProblems="false"
189 DebugInformationFormat="3"
190 />
191 <Tool
192 Name="VCManagedResourceCompilerTool"
193 />
194 <Tool
195 Name="VCResourceCompilerTool"
196 />
197 <Tool
198 Name="VCPreLinkEventTool"
199 />
200 <Tool
201 Name="VCLibrarianTool"
202 OutputFile="$(OutDir)/llaudio.lib"
203 />
204 <Tool
205 Name="VCALinkTool"
206 />
207 <Tool
208 Name="VCXDCMakeTool"
209 />
210 <Tool
211 Name="VCBscMakeTool"
212 />
213 <Tool
214 Name="VCFxCopTool"
215 />
216 <Tool
217 Name="VCPostBuildEventTool"
218 />
219 </Configuration>
220 </Configurations>
221 <References>
222 </References>
223 <Files>
224 <Filter
225 Name="Source Files"
226 Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
227 UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
228 >
229 <File
230 RelativePath=".\audioengine.cpp"
231 >
232 </File>
233 <File
234 RelativePath=".\audioengine_fmod.cpp"
235 >
236 </File>
237 <File
238 RelativePath=".\listener.cpp"
239 >
240 </File>
241 <File
242 RelativePath=".\listener_fmod.cpp"
243 >
244 </File>
245 <File
246 RelativePath=".\llaudiodecodemgr.cpp"
247 >
248 </File>
249 <File
250 RelativePath=".\vorbisdecode.cpp"
251 >
252 </File>
253 <File
254 RelativePath=".\vorbisencode.cpp"
255 >
256 </File>
257 </Filter>
258 <Filter
259 Name="Header Files"
260 Filter="h;hpp;hxx;hm;inl;inc;xsd"
261 UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
262 >
263 <File
264 RelativePath=".\audioengine.h"
265 >
266 </File>
267 <File
268 RelativePath=".\audioengine_fmod.h"
269 >
270 </File>
271 <File
272 RelativePath=".\fmod.h"
273 >
274 </File>
275 <File
276 RelativePath=".\fmod_errors.h"
277 >
278 </File>
279 <File
280 RelativePath=".\listener.h"
281 >
282 </File>
283 <File
284 RelativePath=".\listener_ds3d.h"
285 >
286 </File>
287 <File
288 RelativePath=".\listener_fmod.h"
289 >
290 </File>
291 <File
292 RelativePath=".\listener_openal.h"
293 >
294 </File>
295 <File
296 RelativePath=".\llaudiodecodemgr.h"
297 >
298 </File>
299 <File
300 RelativePath=".\vorbisdecode.h"
301 >
302 </File>
303 <File
304 RelativePath=".\vorbisencode.h"
305 >
306 </File>
307 <File
308 RelativePath=".\wavefile.h"
309 >
310 </File>
311 </Filter>
312 <Filter
313 Name="Resource Files"
314 Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
315 UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
316 >
317 </Filter>
318 </Files>
319 <Globals>
320 </Globals>
321</VisualStudioProject>
diff --git a/linden/indra/llaudio/llaudiodecodemgr.cpp b/linden/indra/llaudio/llaudiodecodemgr.cpp
index d98ff5d..832c314 100644
--- a/linden/indra/llaudio/llaudiodecodemgr.cpp
+++ b/linden/indra/llaudio/llaudiodecodemgr.cpp
@@ -52,9 +52,25 @@ LLAudioDecodeMgr *gAudioDecodeMgrp = NULL;
52 52
53static const S32 WAV_HEADER_SIZE = 44; 53static const S32 WAV_HEADER_SIZE = 44;
54 54
55class LLVorbisDecodeState 55
56//////////////////////////////////////////////////////////////////////////////
57
58
59class LLVorbisDecodeState : public LLRefCount
56{ 60{
57public: 61public:
62 class WriteResponder : public LLLFSThread::Responder
63 {
64 public:
65 WriteResponder(LLVorbisDecodeState* decoder) : mDecoder(decoder) {}
66 ~WriteResponder() {}
67 void completed(S32 bytes)
68 {
69 mDecoder->ioComplete(bytes);
70 }
71 LLPointer<LLVorbisDecodeState> mDecoder;
72 };
73
58 LLVorbisDecodeState(const LLUUID &uuid, const LLString &out_filename); 74 LLVorbisDecodeState(const LLUUID &uuid, const LLString &out_filename);
59 virtual ~LLVorbisDecodeState(); 75 virtual ~LLVorbisDecodeState();
60 76
@@ -64,12 +80,14 @@ public:
64 80
65 void flushBadFile(); 81 void flushBadFile();
66 82
83 void ioComplete(S32 bytes) { mBytesRead = bytes; }
67 BOOL isValid() const { return mValid; } 84 BOOL isValid() const { return mValid; }
68 BOOL isDone() const { return mDone; } 85 BOOL isDone() const { return mDone; }
69 const LLUUID &getUUID() const { return mUUID; } 86 const LLUUID &getUUID() const { return mUUID; }
70protected: 87protected:
71 BOOL mValid; 88 BOOL mValid;
72 BOOL mDone; 89 BOOL mDone;
90 LLAtomicS32 mBytesRead;
73 LLUUID mUUID; 91 LLUUID mUUID;
74 92
75 std::vector<U8> mWAVBuffer; 93 std::vector<U8> mWAVBuffer;
@@ -83,172 +101,6 @@ protected:
83 S32 mCurrentSection; 101 S32 mCurrentSection;
84}; 102};
85 103
86void LLVorbisDecodeState::flushBadFile()
87{
88 if (mInFilep)
89 {
90 llwarns << "Flushing bad vorbis file from VFS for " << mUUID << llendl;
91 mInFilep->remove();
92 }
93}
94
95
96LLAudioDecodeMgr::LLAudioDecodeMgr()
97{
98 mCurrentDecodep = NULL;
99}
100
101LLAudioDecodeMgr::~LLAudioDecodeMgr()
102{
103 delete mCurrentDecodep;
104 mCurrentDecodep = NULL;
105}
106
107
108void LLAudioDecodeMgr::processQueue(const F32 num_secs)
109{
110 LLUUID uuid;
111
112 LLTimer decode_timer;
113
114 BOOL done = FALSE;
115 while (!done)
116 {
117 if (mCurrentDecodep)
118 {
119 BOOL res;
120
121 // Decode in a loop until we're done or have run out of time.
122 while(!(res = mCurrentDecodep->decodeSection()) && (decode_timer.getElapsedTimeF32() < num_secs))
123 {
124 // decodeSection does all of the work above
125 }
126
127 if (mCurrentDecodep->isDone() && !mCurrentDecodep->isValid())
128 {
129 // We had an error when decoding, abort.
130 llwarns << mCurrentDecodep->getUUID() << " has invalid vorbis data, aborting decode" << llendl;
131 mCurrentDecodep->flushBadFile();
132 LLAudioData *adp = gAudiop->getAudioData(mCurrentDecodep->getUUID());
133 adp->setHasValidData(FALSE);
134 delete mCurrentDecodep;
135 mCurrentDecodep = NULL;
136 done = TRUE;
137 }
138
139 if (!res)
140 {
141 // We've used up out time slice, bail...
142 done = TRUE;
143 }
144 else if (mCurrentDecodep)
145 {
146 if (mCurrentDecodep->finishDecode())
147 {
148 // We finished!
149 if (mCurrentDecodep->isValid() && mCurrentDecodep->isDone())
150 {
151 LLAudioData *adp = gAudiop->getAudioData(mCurrentDecodep->getUUID());
152 adp->setHasDecodedData(TRUE);
153 adp->setHasValidData(TRUE);
154
155 // At this point, we could see if anyone needs this sound immediately, but
156 // I'm not sure that there's a reason to - we need to poll all of the playing
157 // sounds anyway.
158 //llinfos << "Finished the vorbis decode, now what?" << llendl;
159 }
160 else
161 {
162 llinfos << "Vorbis decode failed!!!" << llendl;
163 }
164 delete mCurrentDecodep;
165 mCurrentDecodep = NULL;
166 }
167 done = TRUE; // done for now
168 }
169 }
170
171 if (!done)
172 {
173 if (!mDecodeQueue.getLength())
174 {
175 // Nothing else on the queue.
176 done = TRUE;
177 }
178 else
179 {
180 LLUUID uuid;
181 mDecodeQueue.pop(uuid);
182 if (gAudiop->hasDecodedFile(uuid))
183 {
184 // This file has already been decoded, don't decode it again.
185 continue;
186 }
187
188 lldebugs << "Decoding " << uuid << " from audio queue!" << llendl;
189
190 char uuid_str[64]; /*Flawfinder: ignore*/
191 char d_path[LL_MAX_PATH]; /*Flawfinder: ignore*/
192
193 LLTimer timer;
194 timer.reset();
195
196 uuid.toString(uuid_str);
197 snprintf(d_path, LL_MAX_PATH, "%s.dsf", gDirUtilp->getExpandedFilename(LL_PATH_CACHE,uuid_str).c_str()); /*Flawfinder: ignore*/
198
199 mCurrentDecodep = new LLVorbisDecodeState(uuid, d_path);
200 if (!mCurrentDecodep->initDecode())
201 {
202 delete mCurrentDecodep;
203 mCurrentDecodep = NULL;
204 }
205 }
206 }
207 }
208}
209
210
211BOOL LLAudioDecodeMgr::addDecodeRequest(const LLUUID &uuid)
212{
213 if (gAudiop->hasDecodedFile(uuid))
214 {
215 // Already have a decoded version, don't need to decode it.
216 return TRUE;
217 }
218
219 if (gAssetStorage->hasLocalAsset(uuid, LLAssetType::AT_SOUND))
220 {
221 // Just put it on the decode queue.
222 gAudioDecodeMgrp->mDecodeQueue.push(uuid);
223 return TRUE;
224 }
225
226 return FALSE;
227}
228
229
230S32 LLAudioDecodeMgr::getRequestCount()
231{
232 /*
233 S32 count = 0;
234 if (mCurrentTransfer.notNull())
235 {
236 count++;
237 }
238
239 count += mRequestQueue.getLength();
240 return count;
241 */
242 return 0;
243}
244
245
246
247
248
249
250
251
252size_t vfs_read(void *ptr, size_t size, size_t nmemb, void *datasource) 104size_t vfs_read(void *ptr, size_t size, size_t nmemb, void *datasource)
253{ 105{
254 LLVFile *file = (LLVFile *)datasource; 106 LLVFile *file = (LLVFile *)datasource;
@@ -303,26 +155,21 @@ int vfs_seek(void *datasource, ogg_int64_t offset, int whence)
303int vfs_close (void *datasource) 155int vfs_close (void *datasource)
304{ 156{
305 LLVFile *file = (LLVFile *)datasource; 157 LLVFile *file = (LLVFile *)datasource;
306
307 delete file; 158 delete file;
308
309 return 0; 159 return 0;
310} 160}
311 161
312long vfs_tell (void *datasource) 162long vfs_tell (void *datasource)
313{ 163{
314 LLVFile *file = (LLVFile *)datasource; 164 LLVFile *file = (LLVFile *)datasource;
315
316 return file->tell(); 165 return file->tell();
317} 166}
318 167
319
320
321
322LLVorbisDecodeState::LLVorbisDecodeState(const LLUUID &uuid, const LLString &out_filename) 168LLVorbisDecodeState::LLVorbisDecodeState(const LLUUID &uuid, const LLString &out_filename)
323{ 169{
324 mDone = FALSE; 170 mDone = FALSE;
325 mValid = FALSE; 171 mValid = FALSE;
172 mBytesRead = -1;
326 mUUID = uuid; 173 mUUID = uuid;
327 mInFilep = NULL; 174 mInFilep = NULL;
328 mCurrentSection = 0; 175 mCurrentSection = 0;
@@ -594,32 +441,27 @@ BOOL LLVorbisDecodeState::finishDecode()
594 return TRUE; // we've finished 441 return TRUE; // we've finished
595 } 442 }
596#if !defined(USE_WAV_VFILE) 443#if !defined(USE_WAV_VFILE)
597 mFileHandle = LLLFSThread::sLocal->write(mOutFilename, &mWAVBuffer[0], 0, data_length); 444 mBytesRead = -1;
445 mFileHandle = LLLFSThread::sLocal->write(mOutFilename, &mWAVBuffer[0], 0, data_length,
446 new WriteResponder(this));
598#endif 447#endif
599 } 448 }
600 449
601 if (mFileHandle != LLLFSThread::nullHandle()) 450 if (mFileHandle != LLLFSThread::nullHandle())
602 { 451 {
603 LLLFSThread::status_t s = LLLFSThread::sLocal->getRequestStatus(mFileHandle); 452 if (mBytesRead >= 0)
604 if (s != LLLFSThread::STATUS_COMPLETE)
605 {
606 if (s != LLLFSThread::STATUS_QUEUED && s != LLLFSThread::STATUS_INPROGRESS)
607 {
608 llerrs << "Bad file status in LLVorbisDecodeState::finishDecode: " << s << llendl;
609 }
610 return FALSE; // not finished
611 }
612 else
613 { 453 {
614 LLLFSThread::Request* req = (LLLFSThread::Request*)LLLFSThread::sLocal->getRequest(mFileHandle); 454 if (mBytesRead == 0)
615 if (req->getBytesRead() == 0) //!= req->getBytes() // should be safe, but needs testing
616 { 455 {
617 llwarns << "Unable to write file in LLVorbisDecodeState::finishDecode" << llendl; 456 llwarns << "Unable to write file in LLVorbisDecodeState::finishDecode" << llendl;
618 mValid = FALSE; 457 mValid = FALSE;
619 return TRUE; // we've finished 458 return TRUE; // we've finished
620 } 459 }
621 } 460 }
622 LLLFSThread::sLocal->completeRequest(mFileHandle); 461 else
462 {
463 return FALSE; // not done
464 }
623 } 465 }
624 466
625 mDone = TRUE; 467 mDone = TRUE;
@@ -633,3 +475,165 @@ BOOL LLVorbisDecodeState::finishDecode()
633 475
634 return TRUE; 476 return TRUE;
635} 477}
478
479void LLVorbisDecodeState::flushBadFile()
480{
481 if (mInFilep)
482 {
483 llwarns << "Flushing bad vorbis file from VFS for " << mUUID << llendl;
484 mInFilep->remove();
485 }
486}
487
488//////////////////////////////////////////////////////////////////////////////
489
490class LLAudioDecodeMgr::Impl
491{
492 friend class LLAudioDecodeMgr;
493public:
494 Impl() {};
495 ~Impl() {};
496
497 void processQueue(const F32 num_secs = 0.005);
498
499protected:
500 LLLinkedQueue<LLUUID> mDecodeQueue;
501 LLPointer<LLVorbisDecodeState> mCurrentDecodep;
502};
503
504
505void LLAudioDecodeMgr::Impl::processQueue(const F32 num_secs)
506{
507 LLUUID uuid;
508
509 LLTimer decode_timer;
510
511 BOOL done = FALSE;
512 while (!done)
513 {
514 if (mCurrentDecodep)
515 {
516 BOOL res;
517
518 // Decode in a loop until we're done or have run out of time.
519 while(!(res = mCurrentDecodep->decodeSection()) && (decode_timer.getElapsedTimeF32() < num_secs))
520 {
521 // decodeSection does all of the work above
522 }
523
524 if (mCurrentDecodep->isDone() && !mCurrentDecodep->isValid())
525 {
526 // We had an error when decoding, abort.
527 llwarns << mCurrentDecodep->getUUID() << " has invalid vorbis data, aborting decode" << llendl;
528 mCurrentDecodep->flushBadFile();
529 LLAudioData *adp = gAudiop->getAudioData(mCurrentDecodep->getUUID());
530 adp->setHasValidData(FALSE);
531 mCurrentDecodep = NULL;
532 done = TRUE;
533 }
534
535 if (!res)
536 {
537 // We've used up out time slice, bail...
538 done = TRUE;
539 }
540 else if (mCurrentDecodep)
541 {
542 if (mCurrentDecodep->finishDecode())
543 {
544 // We finished!
545 if (mCurrentDecodep->isValid() && mCurrentDecodep->isDone())
546 {
547 LLAudioData *adp = gAudiop->getAudioData(mCurrentDecodep->getUUID());
548 adp->setHasDecodedData(TRUE);
549 adp->setHasValidData(TRUE);
550
551 // At this point, we could see if anyone needs this sound immediately, but
552 // I'm not sure that there's a reason to - we need to poll all of the playing
553 // sounds anyway.
554 //llinfos << "Finished the vorbis decode, now what?" << llendl;
555 }
556 else
557 {
558 llinfos << "Vorbis decode failed!!!" << llendl;
559 }
560 mCurrentDecodep = NULL;
561 }
562 done = TRUE; // done for now
563 }
564 }
565
566 if (!done)
567 {
568 if (!mDecodeQueue.getLength())
569 {
570 // Nothing else on the queue.
571 done = TRUE;
572 }
573 else
574 {
575 LLUUID uuid;
576 mDecodeQueue.pop(uuid);
577 if (gAudiop->hasDecodedFile(uuid))
578 {
579 // This file has already been decoded, don't decode it again.
580 continue;
581 }
582
583 lldebugs << "Decoding " << uuid << " from audio queue!" << llendl;
584
585 char uuid_str[64]; /*Flawfinder: ignore*/
586 char d_path[LL_MAX_PATH]; /*Flawfinder: ignore*/
587
588 LLTimer timer;
589 timer.reset();
590
591 uuid.toString(uuid_str);
592 snprintf(d_path, LL_MAX_PATH, "%s.dsf", gDirUtilp->getExpandedFilename(LL_PATH_CACHE,uuid_str).c_str()); /*Flawfinder: ignore*/
593
594 mCurrentDecodep = new LLVorbisDecodeState(uuid, d_path);
595 if (!mCurrentDecodep->initDecode())
596 {
597 mCurrentDecodep = NULL;
598 }
599 }
600 }
601 }
602}
603
604//////////////////////////////////////////////////////////////////////////////
605
606LLAudioDecodeMgr::LLAudioDecodeMgr()
607{
608 mImpl = new Impl;
609}
610
611LLAudioDecodeMgr::~LLAudioDecodeMgr()
612{
613 delete mImpl;
614}
615
616void LLAudioDecodeMgr::processQueue(const F32 num_secs)
617{
618 mImpl->processQueue(num_secs);
619}
620
621BOOL LLAudioDecodeMgr::addDecodeRequest(const LLUUID &uuid)
622{
623 if (gAudiop->hasDecodedFile(uuid))
624 {
625 // Already have a decoded version, don't need to decode it.
626 return TRUE;
627 }
628
629 if (gAssetStorage->hasLocalAsset(uuid, LLAssetType::AT_SOUND))
630 {
631 // Just put it on the decode queue.
632 mImpl->mDecodeQueue.push(uuid);
633 return TRUE;
634 }
635
636 return FALSE;
637}
638
639
diff --git a/linden/indra/llaudio/llaudiodecodemgr.h b/linden/indra/llaudio/llaudiodecodemgr.h
index 3480004..aab7144 100644
--- a/linden/indra/llaudio/llaudiodecodemgr.h
+++ b/linden/indra/llaudio/llaudiodecodemgr.h
@@ -38,7 +38,6 @@
38class LLVFS; 38class LLVFS;
39class LLVorbisDecodeState; 39class LLVorbisDecodeState;
40 40
41
42class LLAudioDecodeMgr 41class LLAudioDecodeMgr
43{ 42{
44public: 43public:
@@ -46,19 +45,12 @@ public:
46 ~LLAudioDecodeMgr(); 45 ~LLAudioDecodeMgr();
47 46
48 void processQueue(const F32 num_secs = 0.005); 47 void processQueue(const F32 num_secs = 0.005);
49
50 LLLinkedQueue<LLUUID> mDecodeQueue;
51
52 LLVorbisDecodeState *mCurrentDecodep;
53
54 BOOL addDecodeRequest(const LLUUID &uuid); 48 BOOL addDecodeRequest(const LLUUID &uuid);
55 void addAudioRequest(const LLUUID &uuid); 49 void addAudioRequest(const LLUUID &uuid);
56
57 S32 getRequestCount();
58 50
59protected: 51protected:
60 LLLinkedQueue<LLUUID> mDownloadQueue; 52 class Impl;
61 LLFrameTimer mCurrentTransferAge; 53 Impl* mImpl;
62}; 54};
63 55
64extern LLAudioDecodeMgr *gAudioDecodeMgrp; 56extern LLAudioDecodeMgr *gAudioDecodeMgrp;
diff --git a/linden/indra/llcharacter/llbvhloader.cpp b/linden/indra/llcharacter/llbvhloader.cpp
index 6aa430f..48b5e7c 100644
--- a/linden/indra/llcharacter/llbvhloader.cpp
+++ b/linden/indra/llcharacter/llbvhloader.cpp
@@ -175,8 +175,8 @@ LLBVHLoader::Status LLBVHLoader::loadTranslationTable(const char *fileName)
175 //-------------------------------------------------------------------- 175 //--------------------------------------------------------------------
176 char path[LL_MAX_PATH]; /* Flawfinder: ignore */ 176 char path[LL_MAX_PATH]; /* Flawfinder: ignore */
177 177
178 snprintf( path, sizeof(path), "%s", 178 snprintf( path, sizeof(path), "%s",/* Flawfinder: ignore */
179 gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS,fileName).c_str()); /* Flawfinder: ignore */ 179 gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS,fileName).c_str());
180 180
181 181
182 apr_file_t *fp = ll_apr_file_open(path, LL_APR_R); 182 apr_file_t *fp = ll_apr_file_open(path, LL_APR_R);
@@ -209,7 +209,7 @@ LLBVHLoader::Status LLBVHLoader::loadTranslationTable(const char *fileName)
209 // check the 1st token on the line to determine if it's empty or a comment 209 // check the 1st token on the line to determine if it's empty or a comment
210 //---------------------------------------------------------------- 210 //----------------------------------------------------------------
211 char token[128]; /* Flawfinder: ignore */ 211 char token[128]; /* Flawfinder: ignore */
212 if ( sscanf(mLine, " %127s", token) != 1 ) 212 if ( sscanf(mLine, " %127s", token) != 1 ) /* Flawfinder: ignore */
213 continue; 213 continue;
214 214
215 if (token[0] == '#') 215 if (token[0] == '#')
@@ -244,7 +244,7 @@ LLBVHLoader::Status LLBVHLoader::loadTranslationTable(const char *fileName)
244 if (loadingGlobals && LLString::compareInsensitive(token, "emote")==0) 244 if (loadingGlobals && LLString::compareInsensitive(token, "emote")==0)
245 { 245 {
246 char emote_str[1024]; /* Flawfinder: ignore */ 246 char emote_str[1024]; /* Flawfinder: ignore */
247 if ( sscanf(mLine, " %*s = %1023s", emote_str) != 1 ) 247 if ( sscanf(mLine, " %*s = %1023s", emote_str) != 1 ) /* Flawfinder: ignore */
248 return ST_NO_XLT_EMOTE; 248 return ST_NO_XLT_EMOTE;
249 249
250 mEmoteName.assign( emote_str ); 250 mEmoteName.assign( emote_str );
@@ -282,7 +282,7 @@ LLBVHLoader::Status LLBVHLoader::loadTranslationTable(const char *fileName)
282 { 282 {
283 mLoop = TRUE; 283 mLoop = TRUE;
284 } 284 }
285 else if ( sscanf(mLine, " %*s = %127s", trueFalse) == 1 ) 285 else if ( sscanf(mLine, " %*s = %127s", trueFalse) == 1 ) /* Flawfinder: ignore */
286 { 286 {
287 mLoop = (LLString::compareInsensitive(trueFalse, "true")==0); 287 mLoop = (LLString::compareInsensitive(trueFalse, "true")==0);
288 } 288 }
@@ -304,7 +304,7 @@ LLBVHLoader::Status LLBVHLoader::loadTranslationTable(const char *fileName)
304 { 304 {
305 F32 duration; 305 F32 duration;
306 char type[128]; /* Flawfinder: ignore */ 306 char type[128]; /* Flawfinder: ignore */
307 if ( sscanf(mLine, " %*s = %f %127s", &duration, type) != 2 ) 307 if ( sscanf(mLine, " %*s = %f %127s", &duration, type) != 2 ) /* Flawfinder: ignore */
308 return ST_NO_XLT_EASEIN; 308 return ST_NO_XLT_EASEIN;
309 309
310 mEaseIn = duration; 310 mEaseIn = duration;
@@ -317,8 +317,8 @@ LLBVHLoader::Status LLBVHLoader::loadTranslationTable(const char *fileName)
317 if (loadingGlobals && LLString::compareInsensitive(token, "easeout")==0) 317 if (loadingGlobals && LLString::compareInsensitive(token, "easeout")==0)
318 { 318 {
319 F32 duration; 319 F32 duration;
320 char type[128]; 320 char type[128]; /* Flawfinder: ignore */
321 if ( sscanf(mLine, " %*s = %f %127s", &duration, type) != 2 ) 321 if ( sscanf(mLine, " %*s = %f %127s", &duration, type) != 2 ) /* Flawfinder: ignore */
322 return ST_NO_XLT_EASEOUT; 322 return ST_NO_XLT_EASEOUT;
323 323
324 mEaseOut = duration; 324 mEaseOut = duration;
@@ -343,7 +343,7 @@ LLBVHLoader::Status LLBVHLoader::loadTranslationTable(const char *fileName)
343 Constraint constraint; 343 Constraint constraint;
344 344
345 // try reading optional target direction 345 // try reading optional target direction
346 if(sscanf( 346 if(sscanf( /* Flawfinder: ignore */
347 mLine, 347 mLine,
348 " %*s = %d %f %f %f %f %15s %f %f %f %15s %f %f %f %f %f %f", 348 " %*s = %d %f %f %f %f %15s %f %f %f %15s %f %f %f %f %f %f",
349 &constraint.mChainLength, 349 &constraint.mChainLength,
@@ -363,7 +363,7 @@ LLBVHLoader::Status LLBVHLoader::loadTranslationTable(const char *fileName)
363 &constraint.mTargetDir.mV[VY], 363 &constraint.mTargetDir.mV[VY],
364 &constraint.mTargetDir.mV[VZ]) != 16) 364 &constraint.mTargetDir.mV[VZ]) != 16)
365 { 365 {
366 if(sscanf( 366 if(sscanf( /* Flawfinder: ignore */
367 mLine, 367 mLine,
368 " %*s = %d %f %f %f %f %15s %f %f %f %15s %f %f %f", 368 " %*s = %d %f %f %f %f %15s %f %f %f %15s %f %f %f",
369 &constraint.mChainLength, 369 &constraint.mChainLength,
@@ -403,7 +403,7 @@ LLBVHLoader::Status LLBVHLoader::loadTranslationTable(const char *fileName)
403 Constraint constraint; 403 Constraint constraint;
404 404
405 // try reading optional target direction 405 // try reading optional target direction
406 if(sscanf( 406 if(sscanf( /* Flawfinder: ignore */
407 mLine, 407 mLine,
408 " %*s = %d %f %f %f %f %15s %f %f %f %15s %f %f %f %f %f %f", 408 " %*s = %d %f %f %f %f %15s %f %f %f %15s %f %f %f %f %f %f",
409 &constraint.mChainLength, 409 &constraint.mChainLength,
@@ -423,7 +423,7 @@ LLBVHLoader::Status LLBVHLoader::loadTranslationTable(const char *fileName)
423 &constraint.mTargetDir.mV[VY], 423 &constraint.mTargetDir.mV[VY],
424 &constraint.mTargetDir.mV[VZ]) != 16) 424 &constraint.mTargetDir.mV[VZ]) != 16)
425 { 425 {
426 if(sscanf( 426 if(sscanf( /* Flawfinder: ignore */
427 mLine, 427 mLine,
428 " %*s = %d %f %f %f %f %15s %f %f %f %15s %f %f %f", 428 " %*s = %d %f %f %f %f %15s %f %f %f %15s %f %f %f",
429 &constraint.mChainLength, 429 &constraint.mChainLength,
@@ -471,7 +471,7 @@ LLBVHLoader::Status LLBVHLoader::loadTranslationTable(const char *fileName)
471 if ( LLString::compareInsensitive(token, "ignore")==0 ) 471 if ( LLString::compareInsensitive(token, "ignore")==0 )
472 { 472 {
473 char trueFalse[128]; /* Flawfinder: ignore */ 473 char trueFalse[128]; /* Flawfinder: ignore */
474 if ( sscanf(mLine, " %*s = %127s", trueFalse) != 1 ) 474 if ( sscanf(mLine, " %*s = %127s", trueFalse) != 1 ) /* Flawfinder: ignore */
475 return ST_NO_XLT_IGNORE; 475 return ST_NO_XLT_IGNORE;
476 476
477 trans->mIgnore = (LLString::compareInsensitive(trueFalse, "true")==0); 477 trans->mIgnore = (LLString::compareInsensitive(trueFalse, "true")==0);
@@ -489,7 +489,7 @@ LLBVHLoader::Status LLBVHLoader::loadTranslationTable(const char *fileName)
489 { 489 {
490 trans->mRelativePosition.setVec( x, y, z ); 490 trans->mRelativePosition.setVec( x, y, z );
491 } 491 }
492 else if ( sscanf(mLine, " %*s = %127s", relpos) == 1 ) 492 else if ( sscanf(mLine, " %*s = %127s", relpos) == 1 ) /* Flawfinder: ignore */
493 { 493 {
494 if ( LLString::compareInsensitive(relpos, "firstkey")==0 ) 494 if ( LLString::compareInsensitive(relpos, "firstkey")==0 )
495 { 495 {
@@ -515,7 +515,7 @@ LLBVHLoader::Status LLBVHLoader::loadTranslationTable(const char *fileName)
515 { 515 {
516 //F32 x, y, z; 516 //F32 x, y, z;
517 char relpos[128]; /* Flawfinder: ignore */ 517 char relpos[128]; /* Flawfinder: ignore */
518 if ( sscanf(mLine, " %*s = %127s", relpos) == 1 ) 518 if ( sscanf(mLine, " %*s = %127s", relpos) == 1 ) /* Flawfinder: ignore */
519 { 519 {
520 if ( LLString::compareInsensitive(relpos, "firstkey")==0 ) 520 if ( LLString::compareInsensitive(relpos, "firstkey")==0 )
521 { 521 {
@@ -540,7 +540,7 @@ LLBVHLoader::Status LLBVHLoader::loadTranslationTable(const char *fileName)
540 if ( LLString::compareInsensitive(token, "outname")==0 ) 540 if ( LLString::compareInsensitive(token, "outname")==0 )
541 { 541 {
542 char outName[128]; /* Flawfinder: ignore */ 542 char outName[128]; /* Flawfinder: ignore */
543 if ( sscanf(mLine, " %*s = %127s", outName) != 1 ) 543 if ( sscanf(mLine, " %*s = %127s", outName) != 1 ) /* Flawfinder: ignore */
544 return ST_NO_XLT_OUTNAME; 544 return ST_NO_XLT_OUTNAME;
545 545
546 trans->mOutName = outName; 546 trans->mOutName = outName;
@@ -585,7 +585,7 @@ LLBVHLoader::Status LLBVHLoader::loadTranslationTable(const char *fileName)
585 if ( LLString::compareInsensitive(token, "mergeparent")==0 ) 585 if ( LLString::compareInsensitive(token, "mergeparent")==0 )
586 { 586 {
587 char mergeParentName[128]; /* Flawfinder: ignore */ 587 char mergeParentName[128]; /* Flawfinder: ignore */
588 if ( sscanf(mLine, " %*s = %127s", mergeParentName) != 1 ) 588 if ( sscanf(mLine, " %*s = %127s", mergeParentName) != 1 ) /* Flawfinder: ignore */
589 return ST_NO_XLT_MERGEPARENT; 589 return ST_NO_XLT_MERGEPARENT;
590 590
591 trans->mMergeParentName = mergeParentName; 591 trans->mMergeParentName = mergeParentName;
@@ -598,7 +598,7 @@ LLBVHLoader::Status LLBVHLoader::loadTranslationTable(const char *fileName)
598 if ( LLString::compareInsensitive(token, "mergechild")==0 ) 598 if ( LLString::compareInsensitive(token, "mergechild")==0 )
599 { 599 {
600 char mergeChildName[128]; /* Flawfinder: ignore */ 600 char mergeChildName[128]; /* Flawfinder: ignore */
601 if ( sscanf(mLine, " %*s = %127s", mergeChildName) != 1 ) 601 if ( sscanf(mLine, " %*s = %127s", mergeChildName) != 1 ) /* Flawfinder: ignore */
602 return ST_NO_XLT_MERGECHILD; 602 return ST_NO_XLT_MERGECHILD;
603 603
604 trans->mMergeChildName = mergeChildName; 604 trans->mMergeChildName = mergeChildName;
@@ -724,7 +724,7 @@ LLBVHLoader::Status LLBVHLoader::loadBVHFile(const char *buffer, char* error_tex
724 // get the joint name 724 // get the joint name
725 //---------------------------------------------------------------- 725 //----------------------------------------------------------------
726 char jointName[80]; /* Flawfinder: ignore */ 726 char jointName[80]; /* Flawfinder: ignore */
727 if ( sscanf(line.c_str(), "%*s %79s", jointName) != 1 ) 727 if ( sscanf(line.c_str(), "%*s %79s", jointName) != 1 ) /* Flawfinder: ignore */
728 { 728 {
729 strncpy(error_text, line.c_str(), 127); /* Flawfinder: ignore */ 729 strncpy(error_text, line.c_str(), 127); /* Flawfinder: ignore */
730 return ST_NO_NAME; 730 return ST_NO_NAME;
diff --git a/linden/indra/llcharacter/llcharacter.cpp b/linden/indra/llcharacter/llcharacter.cpp
index 45f692c..6e9327f 100644
--- a/linden/indra/llcharacter/llcharacter.cpp
+++ b/linden/indra/llcharacter/llcharacter.cpp
@@ -38,13 +38,7 @@
38 38
39LLStringTable LLCharacter::sVisualParamNames(1024); 39LLStringTable LLCharacter::sVisualParamNames(1024);
40 40
41// helper functions 41std::vector< LLCharacter* > LLCharacter::sInstances;
42BOOL larger_screen_area( LLCharacter* data_new, LLCharacter* data_tested )
43{
44 return data_new->getPixelArea() > data_tested->getPixelArea();
45}
46
47LLLinkedList< LLCharacter > LLCharacter::sInstances( larger_screen_area );
48 42
49 43
50//----------------------------------------------------------------------------- 44//-----------------------------------------------------------------------------
@@ -59,7 +53,7 @@ LLCharacter::LLCharacter()
59 mSkeletonSerialNum( 0 ) 53 mSkeletonSerialNum( 0 )
60{ 54{
61 mMotionController.setCharacter( this ); 55 mMotionController.setCharacter( this );
62 sInstances.addData(this); 56 sInstances.push_back(this);
63 mPauseRequest = new LLPauseRequestHandle(); 57 mPauseRequest = new LLPauseRequestHandle();
64} 58}
65 59
@@ -76,7 +70,11 @@ LLCharacter::~LLCharacter()
76 { 70 {
77 delete param; 71 delete param;
78 } 72 }
79 sInstances.removeData(this); 73 std::vector<LLCharacter*>::iterator iter = std::find(sInstances.begin(), sInstances.end(), this);
74 if (iter != sInstances.end())
75 {
76 sInstances.erase(iter);
77 }
80} 78}
81 79
82 80
@@ -85,7 +83,7 @@ LLCharacter::~LLCharacter()
85//----------------------------------------------------------------------------- 83//-----------------------------------------------------------------------------
86LLJoint *LLCharacter::getJoint( const std::string &name ) 84LLJoint *LLCharacter::getJoint( const std::string &name )
87{ 85{
88 LLJoint *joint = NULL; 86 LLJoint* joint = NULL;
89 87
90 LLJoint *root = getRootJoint(); 88 LLJoint *root = getRootJoint();
91 if (root) 89 if (root)
@@ -202,7 +200,7 @@ void LLCharacter::flushAllMotions()
202//----------------------------------------------------------------------------- 200//-----------------------------------------------------------------------------
203// dumpCharacter() 201// dumpCharacter()
204//----------------------------------------------------------------------------- 202//-----------------------------------------------------------------------------
205void LLCharacter::dumpCharacter( LLJoint *joint ) 203void LLCharacter::dumpCharacter( LLJoint* joint )
206{ 204{
207 // handle top level entry into recursion 205 // handle top level entry into recursion
208 if (joint == NULL) 206 if (joint == NULL)
@@ -217,11 +215,11 @@ void LLCharacter::dumpCharacter( LLJoint *joint )
217 llinfos << "DEBUG: " << joint->getName() << " (" << (joint->getParent()?joint->getParent()->getName():std::string("ROOT")) << ")" << llendl; 215 llinfos << "DEBUG: " << joint->getName() << " (" << (joint->getParent()?joint->getParent()->getName():std::string("ROOT")) << ")" << llendl;
218 216
219 // recurse 217 // recurse
220 for ( LLJoint *j = joint->mChildren.getFirstData(); 218 for (LLJoint::child_list_t::iterator iter = joint->mChildren.begin();
221 j != NULL; 219 iter != joint->mChildren.end(); ++iter)
222 j = joint->mChildren.getNextData() )
223 { 220 {
224 dumpCharacter(j); 221 LLJoint* child_joint = *iter;
222 dumpCharacter(child_joint);
225 } 223 }
226} 224}
227 225
diff --git a/linden/indra/llcharacter/llcharacter.h b/linden/indra/llcharacter/llcharacter.h
index bfe3ffa..6f4fe17 100644
--- a/linden/indra/llcharacter/llcharacter.h
+++ b/linden/indra/llcharacter/llcharacter.h
@@ -40,6 +40,7 @@
40#include "linked_lists.h" 40#include "linked_lists.h"
41#include "string_table.h" 41#include "string_table.h"
42#include "llmemory.h" 42#include "llmemory.h"
43#include "llthread.h"
43 44
44class LLPolyMesh; 45class LLPolyMesh;
45 46
@@ -109,7 +110,7 @@ public:
109 virtual F32 getTimeDilation() = 0; 110 virtual F32 getTimeDilation() = 0;
110 111
111 // gets current pixel area of this character 112 // gets current pixel area of this character
112 virtual F32 getPixelArea() = 0; 113 virtual F32 getPixelArea() const = 0;
113 114
114 // gets the head mesh of the character 115 // gets the head mesh of the character
115 virtual LLPolyMesh* getHeadMesh() = 0; 116 virtual LLPolyMesh* getHeadMesh() = 0;
@@ -242,7 +243,7 @@ public:
242 U32 getSkeletonSerialNum() const { return mSkeletonSerialNum; } 243 U32 getSkeletonSerialNum() const { return mSkeletonSerialNum; }
243 void setSkeletonSerialNum( U32 num ) { mSkeletonSerialNum = num; } 244 void setSkeletonSerialNum( U32 num ) { mSkeletonSerialNum = num; }
244 245
245 static LLLinkedList< LLCharacter > sInstances; 246 static std::vector< LLCharacter* > sInstances;
246 247
247protected: 248protected:
248 LLMotionController mMotionController; 249 LLMotionController mMotionController;
diff --git a/linden/indra/llcharacter/llcharacter_vc8.vcproj b/linden/indra/llcharacter/llcharacter_vc8.vcproj
new file mode 100644
index 0000000..415b74f
--- /dev/null
+++ b/linden/indra/llcharacter/llcharacter_vc8.vcproj
@@ -0,0 +1,416 @@
1<?xml version="1.0" encoding="Windows-1252"?>
2<VisualStudioProject
3 ProjectType="Visual C++"
4 Version="8.00"
5 Name="llcharacter"
6 ProjectGUID="{5EA5DDF0-C7E1-4F49-BEF5-9246A4656B2E}"
7 Keyword="Win32Proj"
8 >
9 <Platforms>
10 <Platform
11 Name="Win32"
12 />
13 </Platforms>
14 <ToolFiles>
15 </ToolFiles>
16 <Configurations>
17 <Configuration
18 Name="Debug|Win32"
19 OutputDirectory="../lib_$(ConfigurationName)/i686-win32"
20 IntermediateDirectory="Debug"
21 ConfigurationType="4"
22 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
23 CharacterSet="1"
24 >
25 <Tool
26 Name="VCPreBuildEventTool"
27 />
28 <Tool
29 Name="VCCustomBuildTool"
30 />
31 <Tool
32 Name="VCXMLDataGeneratorTool"
33 />
34 <Tool
35 Name="VCWebServiceProxyGeneratorTool"
36 />
37 <Tool
38 Name="VCMIDLTool"
39 />
40 <Tool
41 Name="VCCLCompilerTool"
42 Optimization="0"
43 AdditionalIncludeDirectories="..\llcommon;..\llmath;..\llvfs;..\llmessage;..\llxml;..\..\libraries\i686-win32\include;..\..\libraries\include\"
44 PreprocessorDefinitions="WIN32;_DEBUG;_LIB;LL_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;LL_DEBUG"
45 MinimalRebuild="true"
46 BasicRuntimeChecks="3"
47 RuntimeLibrary="1"
48 StructMemberAlignment="4"
49 TreatWChar_tAsBuiltInType="false"
50 ForceConformanceInForLoopScope="true"
51 UsePrecompiledHeader="0"
52 WarningLevel="3"
53 WarnAsError="true"
54 Detect64BitPortabilityProblems="false"
55 DebugInformationFormat="4"
56 />
57 <Tool
58 Name="VCManagedResourceCompilerTool"
59 />
60 <Tool
61 Name="VCResourceCompilerTool"
62 />
63 <Tool
64 Name="VCPreLinkEventTool"
65 />
66 <Tool
67 Name="VCLibrarianTool"
68 OutputFile="$(OutDir)/llcharacter.lib"
69 />
70 <Tool
71 Name="VCALinkTool"
72 />
73 <Tool
74 Name="VCXDCMakeTool"
75 />
76 <Tool
77 Name="VCBscMakeTool"
78 />
79 <Tool
80 Name="VCFxCopTool"
81 />
82 <Tool
83 Name="VCPostBuildEventTool"
84 />
85 </Configuration>
86 <Configuration
87 Name="Release|Win32"
88 OutputDirectory="../lib_$(ConfigurationName)/i686-win32"
89 IntermediateDirectory="Release"
90 ConfigurationType="4"
91 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
92 CharacterSet="1"
93 >
94 <Tool
95 Name="VCPreBuildEventTool"
96 />
97 <Tool
98 Name="VCCustomBuildTool"
99 />
100 <Tool
101 Name="VCXMLDataGeneratorTool"
102 />
103 <Tool
104 Name="VCWebServiceProxyGeneratorTool"
105 />
106 <Tool
107 Name="VCMIDLTool"
108 />
109 <Tool
110 Name="VCCLCompilerTool"
111 AdditionalIncludeDirectories="..\llcommon;..\llmath;..\llvfs;..\llmessage;..\llxml;..\..\libraries\i686-win32\include;..\..\libraries\include\"
112 PreprocessorDefinitions="WIN32;NDEBUG;_LIB;LL_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;LL_RELEASE"
113 RuntimeLibrary="0"
114 StructMemberAlignment="0"
115 TreatWChar_tAsBuiltInType="false"
116 ForceConformanceInForLoopScope="true"
117 UsePrecompiledHeader="0"
118 WarningLevel="3"
119 WarnAsError="true"
120 Detect64BitPortabilityProblems="false"
121 DebugInformationFormat="3"
122 />
123 <Tool
124 Name="VCManagedResourceCompilerTool"
125 />
126 <Tool
127 Name="VCResourceCompilerTool"
128 />
129 <Tool
130 Name="VCPreLinkEventTool"
131 />
132 <Tool
133 Name="VCLibrarianTool"
134 OutputFile="$(OutDir)/llcharacter.lib"
135 />
136 <Tool
137 Name="VCALinkTool"
138 />
139 <Tool
140 Name="VCXDCMakeTool"
141 />
142 <Tool
143 Name="VCBscMakeTool"
144 />
145 <Tool
146 Name="VCFxCopTool"
147 />
148 <Tool
149 Name="VCPostBuildEventTool"
150 />
151 </Configuration>
152 <Configuration
153 Name="ReleaseNoOpt|Win32"
154 OutputDirectory="../lib_$(ConfigurationName)/i686-win32"
155 IntermediateDirectory="$(ConfigurationName)"
156 ConfigurationType="4"
157 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
158 CharacterSet="1"
159 >
160 <Tool
161 Name="VCPreBuildEventTool"
162 />
163 <Tool
164 Name="VCCustomBuildTool"
165 />
166 <Tool
167 Name="VCXMLDataGeneratorTool"
168 />
169 <Tool
170 Name="VCWebServiceProxyGeneratorTool"
171 />
172 <Tool
173 Name="VCMIDLTool"
174 />
175 <Tool
176 Name="VCCLCompilerTool"
177 Optimization="0"
178 AdditionalIncludeDirectories="..\llcommon;..\llmath;..\llvfs;..\llmessage;..\llxml;..\..\libraries\i686-win32\include;..\..\libraries\include\"
179 PreprocessorDefinitions="WIN32;NDEBUG;_LIB;LL_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;LL_RELEASE"
180 RuntimeLibrary="0"
181 StructMemberAlignment="0"
182 TreatWChar_tAsBuiltInType="false"
183 ForceConformanceInForLoopScope="true"
184 UsePrecompiledHeader="0"
185 WarningLevel="3"
186 WarnAsError="true"
187 Detect64BitPortabilityProblems="false"
188 DebugInformationFormat="3"
189 />
190 <Tool
191 Name="VCManagedResourceCompilerTool"
192 />
193 <Tool
194 Name="VCResourceCompilerTool"
195 />
196 <Tool
197 Name="VCPreLinkEventTool"
198 />
199 <Tool
200 Name="VCLibrarianTool"
201 OutputFile="$(OutDir)/llcharacter.lib"
202 />
203 <Tool
204 Name="VCALinkTool"
205 />
206 <Tool
207 Name="VCXDCMakeTool"
208 />
209 <Tool
210 Name="VCBscMakeTool"
211 />
212 <Tool
213 Name="VCFxCopTool"
214 />
215 <Tool
216 Name="VCPostBuildEventTool"
217 />
218 </Configuration>
219 </Configurations>
220 <References>
221 </References>
222 <Files>
223 <Filter
224 Name="Source Files"
225 Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
226 UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
227 >
228 <File
229 RelativePath=".\llanimationstates.cpp"
230 >
231 </File>
232 <File
233 RelativePath=".\llbvhloader.cpp"
234 >
235 </File>
236 <File
237 RelativePath=".\llcharacter.cpp"
238 >
239 </File>
240 <File
241 RelativePath=".\lleditingmotion.cpp"
242 >
243 </File>
244 <File
245 RelativePath=".\llgesture.cpp"
246 >
247 </File>
248 <File
249 RelativePath=".\llhandmotion.cpp"
250 >
251 </File>
252 <File
253 RelativePath=".\llheadrotmotion.cpp"
254 >
255 </File>
256 <File
257 RelativePath=".\lljoint.cpp"
258 >
259 </File>
260 <File
261 RelativePath=".\lljointsolverrp3.cpp"
262 >
263 </File>
264 <File
265 RelativePath=".\llkeyframefallmotion.cpp"
266 >
267 </File>
268 <File
269 RelativePath=".\llkeyframemotion.cpp"
270 >
271 </File>
272 <File
273 RelativePath=".\llkeyframemotionparam.cpp"
274 >
275 </File>
276 <File
277 RelativePath=".\llkeyframestandmotion.cpp"
278 >
279 </File>
280 <File
281 RelativePath=".\llkeyframewalkmotion.cpp"
282 >
283 </File>
284 <File
285 RelativePath=".\llmotion.cpp"
286 >
287 </File>
288 <File
289 RelativePath=".\llmotioncontroller.cpp"
290 >
291 </File>
292 <File
293 RelativePath=".\llmultigesture.cpp"
294 >
295 </File>
296 <File
297 RelativePath=".\llpose.cpp"
298 >
299 </File>
300 <File
301 RelativePath=".\llstatemachine.cpp"
302 >
303 </File>
304 <File
305 RelativePath=".\lltargetingmotion.cpp"
306 >
307 </File>
308 <File
309 RelativePath=".\llvisualparam.cpp"
310 >
311 </File>
312 </Filter>
313 <Filter
314 Name="Header Files"
315 Filter="h;hpp;hxx;hm;inl;inc;xsd"
316 UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
317 >
318 <File
319 RelativePath=".\llanimationstates.h"
320 >
321 </File>
322 <File
323 RelativePath=".\llbvhloader.h"
324 >
325 </File>
326 <File
327 RelativePath=".\llcharacter.h"
328 >
329 </File>
330 <File
331 RelativePath=".\lleditingmotion.h"
332 >
333 </File>
334 <File
335 RelativePath=".\llgesture.h"
336 >
337 </File>
338 <File
339 RelativePath=".\llhandmotion.h"
340 >
341 </File>
342 <File
343 RelativePath=".\llheadrotmotion.h"
344 >
345 </File>
346 <File
347 RelativePath=".\lljoint.h"
348 >
349 </File>
350 <File
351 RelativePath=".\lljointsolverrp3.h"
352 >
353 </File>
354 <File
355 RelativePath=".\lljointstate.h"
356 >
357 </File>
358 <File
359 RelativePath=".\llkeyframefallmotion.h"
360 >
361 </File>
362 <File
363 RelativePath=".\llkeyframemotion.h"
364 >
365 </File>
366 <File
367 RelativePath=".\llkeyframemotionparam.h"
368 >
369 </File>
370 <File
371 RelativePath=".\llkeyframestandmotion.h"
372 >
373 </File>
374 <File
375 RelativePath=".\llkeyframewalkmotion.h"
376 >
377 </File>
378 <File
379 RelativePath=".\llmotion.h"
380 >
381 </File>
382 <File
383 RelativePath=".\llmotioncontroller.h"
384 >
385 </File>
386 <File
387 RelativePath=".\llmultigesture.h"
388 >
389 </File>
390 <File
391 RelativePath=".\llpose.h"
392 >
393 </File>
394 <File
395 RelativePath=".\llstatemachine.h"
396 >
397 </File>
398 <File
399 RelativePath=".\lltargetingmotion.h"
400 >
401 </File>
402 <File
403 RelativePath=".\llvisualparam.h"
404 >
405 </File>
406 </Filter>
407 <Filter
408 Name="Resource Files"
409 Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
410 UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
411 >
412 </Filter>
413 </Files>
414 <Globals>
415 </Globals>
416</VisualStudioProject>
diff --git a/linden/indra/llcharacter/lljoint.cpp b/linden/indra/llcharacter/lljoint.cpp
index 4ef9835..4102612 100644
--- a/linden/indra/llcharacter/lljoint.cpp
+++ b/linden/indra/llcharacter/lljoint.cpp
@@ -69,8 +69,9 @@ LLJoint::LLJoint(const std::string &name, LLJoint *parent)
69 69
70 setName(name); 70 setName(name);
71 if (parent) 71 if (parent)
72 {
72 parent->addChild( this ); 73 parent->addChild( this );
73 74 }
74 touch(); 75 touch();
75} 76}
76 77
@@ -80,6 +81,10 @@ LLJoint::LLJoint(const std::string &name, LLJoint *parent)
80//----------------------------------------------------------------------------- 81//-----------------------------------------------------------------------------
81LLJoint::~LLJoint() 82LLJoint::~LLJoint()
82{ 83{
84 if (mParent)
85 {
86 mParent->removeChild( this );
87 }
83 removeAllChildren(); 88 removeAllChildren();
84} 89}
85 90
@@ -91,7 +96,9 @@ void LLJoint::setup(const std::string &name, LLJoint *parent)
91{ 96{
92 setName(name); 97 setName(name);
93 if (parent) 98 if (parent)
99 {
94 parent->addChild( this ); 100 parent->addChild( this );
101 }
95} 102}
96 103
97//----------------------------------------------------------------------------- 104//-----------------------------------------------------------------------------
@@ -109,11 +116,11 @@ void LLJoint::touch(U32 flags)
109 { 116 {
110 child_flags |= POSITION_DIRTY; 117 child_flags |= POSITION_DIRTY;
111 } 118 }
112 119
113 for ( LLJoint *joint = mChildren.getFirstData(); 120 for (child_list_t::iterator iter = mChildren.begin();
114 joint != NULL; 121 iter != mChildren.end(); ++iter)
115 joint = mChildren.getNextData() )
116 { 122 {
123 LLJoint* joint = *iter;
117 joint->touch(child_flags); 124 joint->touch(child_flags);
118 } 125 }
119 } 126 }
@@ -140,13 +147,15 @@ LLJoint *LLJoint::findJoint( const std::string &name )
140 if (name == getName()) 147 if (name == getName())
141 return this; 148 return this;
142 149
143 for ( LLJoint *j = mChildren.getFirstData(); 150 for (child_list_t::iterator iter = mChildren.begin();
144 j != NULL; 151 iter != mChildren.end(); ++iter)
145 j = mChildren.getNextData() )
146 { 152 {
147 LLJoint *found = j->findJoint(name); 153 LLJoint* joint = *iter;
154 LLJoint *found = joint->findJoint(name);
148 if (found) 155 if (found)
156 {
149 return found; 157 return found;
158 }
150 } 159 }
151 160
152 return NULL; 161 return NULL;
@@ -156,12 +165,12 @@ LLJoint *LLJoint::findJoint( const std::string &name )
156//-------------------------------------------------------------------- 165//--------------------------------------------------------------------
157// addChild() 166// addChild()
158//-------------------------------------------------------------------- 167//--------------------------------------------------------------------
159void LLJoint::addChild(LLJoint *joint) 168void LLJoint::addChild(LLJoint* joint)
160{ 169{
161 if (joint->mParent) 170 if (joint->mParent)
162 joint->mParent->removeChild(joint); 171 joint->mParent->removeChild(joint);
163 172
164 mChildren.addDataAtEnd(joint); 173 mChildren.push_back(joint);
165 joint->mXform.setParent(&mXform); 174 joint->mXform.setParent(&mXform);
166 joint->mParent = this; 175 joint->mParent = this;
167 joint->touch(); 176 joint->touch();
@@ -171,9 +180,13 @@ void LLJoint::addChild(LLJoint *joint)
171//-------------------------------------------------------------------- 180//--------------------------------------------------------------------
172// removeChild() 181// removeChild()
173//-------------------------------------------------------------------- 182//--------------------------------------------------------------------
174void LLJoint::removeChild(LLJoint *joint) 183void LLJoint::removeChild(LLJoint* joint)
175{ 184{
176 this->mChildren.removeData(joint); 185 child_list_t::iterator iter = std::find(mChildren.begin(), mChildren.end(), joint);
186 if (iter != mChildren.end())
187 {
188 this->mChildren.erase(iter);
189 }
177 joint->mXform.setParent(NULL); 190 joint->mXform.setParent(NULL);
178 joint->mParent = NULL; 191 joint->mParent = NULL;
179 joint->touch(); 192 joint->touch();
@@ -185,11 +198,15 @@ void LLJoint::removeChild(LLJoint *joint)
185//-------------------------------------------------------------------- 198//--------------------------------------------------------------------
186void LLJoint::removeAllChildren() 199void LLJoint::removeAllChildren()
187{ 200{
188 for ( LLJoint *joint = mChildren.getFirstData(); 201 for (child_list_t::iterator iter = mChildren.begin();
189 joint != NULL; 202 iter != mChildren.end();)
190 joint = mChildren.getNextData() )
191 { 203 {
192 removeChild(joint); 204 child_list_t::iterator curiter = iter++;
205 LLJoint* joint = *curiter;
206 mChildren.erase(curiter);
207 joint->mXform.setParent(NULL);
208 joint->mParent = NULL;
209 joint->touch();
193 } 210 }
194} 211}
195 212
@@ -208,8 +225,11 @@ const LLVector3& LLJoint::getPosition()
208//-------------------------------------------------------------------- 225//--------------------------------------------------------------------
209void LLJoint::setPosition( const LLVector3& pos ) 226void LLJoint::setPosition( const LLVector3& pos )
210{ 227{
211 mXform.setPosition(pos); 228// if (mXform.getPosition() != pos)
212 touch(MATRIX_DIRTY | POSITION_DIRTY); 229 {
230 mXform.setPosition(pos);
231 touch(MATRIX_DIRTY | POSITION_DIRTY);
232 }
213} 233}
214 234
215 235
@@ -276,8 +296,11 @@ void LLJoint::setRotation( const LLQuaternion& rot )
276{ 296{
277 if (rot.isFinite()) 297 if (rot.isFinite())
278 { 298 {
279 mXform.setRotation(rot); 299 // if (mXform.getRotation() != rot)
280 touch(MATRIX_DIRTY | ROTATION_DIRTY); 300 {
301 mXform.setRotation(rot);
302 touch(MATRIX_DIRTY | ROTATION_DIRTY);
303 }
281 } 304 }
282} 305}
283 306
@@ -339,8 +362,12 @@ const LLVector3& LLJoint::getScale()
339//-------------------------------------------------------------------- 362//--------------------------------------------------------------------
340void LLJoint::setScale( const LLVector3& scale ) 363void LLJoint::setScale( const LLVector3& scale )
341{ 364{
342 mXform.setScale(scale); 365// if (mXform.getScale() != scale)
343 touch(); 366 {
367 mXform.setScale(scale);
368 touch();
369 }
370
344} 371}
345 372
346 373
@@ -412,14 +439,18 @@ void LLJoint::updateWorldPRSParent()
412// updateWorldMatrixChildren() 439// updateWorldMatrixChildren()
413//----------------------------------------------------------------------------- 440//-----------------------------------------------------------------------------
414void LLJoint::updateWorldMatrixChildren() 441void LLJoint::updateWorldMatrixChildren()
415{ 442{
443 if (!this->mUpdateXform) return;
444
416 if (mDirtyFlags & MATRIX_DIRTY) 445 if (mDirtyFlags & MATRIX_DIRTY)
417 { 446 {
418 updateWorldMatrix(); 447 updateWorldMatrix();
419 } 448 }
420 for (LLJoint *child = mChildren.getFirstData(); child; child = mChildren.getNextData()) 449 for (child_list_t::iterator iter = mChildren.begin();
450 iter != mChildren.end(); ++iter)
421 { 451 {
422 child->updateWorldMatrixChildren(); 452 LLJoint* joint = *iter;
453 joint->updateWorldMatrixChildren();
423 } 454 }
424} 455}
425 456
@@ -494,8 +525,10 @@ void LLJoint::clampRotation(LLQuaternion old_rot, LLQuaternion new_rot)
494{ 525{
495 LLVector3 main_axis(1.f, 0.f, 0.f); 526 LLVector3 main_axis(1.f, 0.f, 0.f);
496 527
497 for (LLJoint* joint = mChildren.getFirstData(); joint; joint = mChildren.getNextData()) 528 for (child_list_t::iterator iter = mChildren.begin();
529 iter != mChildren.end(); ++iter)
498 { 530 {
531 LLJoint* joint = *iter;
499 if (joint->isAnimatable()) 532 if (joint->isAnimatable())
500 { 533 {
501 main_axis = joint->getPosition(); 534 main_axis = joint->getPosition();
diff --git a/linden/indra/llcharacter/lljoint.h b/linden/indra/llcharacter/lljoint.h
index 15b82c2..352d222 100644
--- a/linden/indra/llcharacter/lljoint.h
+++ b/linden/indra/llcharacter/lljoint.h
@@ -95,7 +95,8 @@ public:
95 LLDynamicArray<LLVector3> mConstraintSilhouette; 95 LLDynamicArray<LLVector3> mConstraintSilhouette;
96 96
97 // child joints 97 // child joints
98 LLLinkedList<LLJoint> mChildren; 98 typedef std::list<LLJoint*> child_list_t;
99 child_list_t mChildren;
99 100
100 // debug statics 101 // debug statics
101 static S32 sNumTouches; 102 static S32 sNumTouches;
diff --git a/linden/indra/llcharacter/llkeyframemotion.cpp b/linden/indra/llcharacter/llkeyframemotion.cpp
index e5b0d99..d09de0e 100644
--- a/linden/indra/llcharacter/llkeyframemotion.cpp
+++ b/linden/indra/llcharacter/llkeyframemotion.cpp
@@ -1720,9 +1720,9 @@ BOOL LLKeyframeMotion::serialize(LLDataPacker& dp) const
1720 { 1720 {
1721 success &= dp.packU8(shared_constraintp->mChainLength, "chain_length"); 1721 success &= dp.packU8(shared_constraintp->mChainLength, "chain_length");
1722 success &= dp.packU8(shared_constraintp->mConstraintType, "constraint_type"); 1722 success &= dp.packU8(shared_constraintp->mConstraintType, "constraint_type");
1723 char volume_name[16]; 1723 char volume_name[16]; /* Flawfinder: ignore */
1724 snprintf(volume_name, sizeof(volume_name), "%s", 1724 snprintf(volume_name, sizeof(volume_name), "%s", /* Flawfinder: ignore */
1725 mCharacter->findCollisionVolume(shared_constraintp->mSourceConstraintVolume)->getName().c_str()); /* Flawfinder: ignore */ 1725 mCharacter->findCollisionVolume(shared_constraintp->mSourceConstraintVolume)->getName().c_str());
1726 success &= dp.packBinaryDataFixed((U8*)volume_name, 16, "source_volume"); 1726 success &= dp.packBinaryDataFixed((U8*)volume_name, 16, "source_volume");
1727 success &= dp.packVector3(shared_constraintp->mSourceConstraintOffset, "source_offset"); 1727 success &= dp.packVector3(shared_constraintp->mSourceConstraintOffset, "source_offset");
1728 if (shared_constraintp->mConstraintTargetType == TYPE_GROUND) 1728 if (shared_constraintp->mConstraintTargetType == TYPE_GROUND)
@@ -1731,8 +1731,8 @@ BOOL LLKeyframeMotion::serialize(LLDataPacker& dp) const
1731 } 1731 }
1732 else 1732 else
1733 { 1733 {
1734 snprintf(volume_name, sizeof(volume_name),"%s", 1734 snprintf(volume_name, sizeof(volume_name),"%s", /* Flawfinder: ignore */
1735 mCharacter->findCollisionVolume(shared_constraintp->mTargetConstraintVolume)->getName().c_str()); /* Flawfinder: ignore */ 1735 mCharacter->findCollisionVolume(shared_constraintp->mTargetConstraintVolume)->getName().c_str());
1736 } 1736 }
1737 success &= dp.packBinaryDataFixed((U8*)volume_name, 16, "target_volume"); 1737 success &= dp.packBinaryDataFixed((U8*)volume_name, 16, "target_volume");
1738 success &= dp.packVector3(shared_constraintp->mTargetConstraintOffset, "target_offset"); 1738 success &= dp.packVector3(shared_constraintp->mTargetConstraintOffset, "target_offset");
@@ -1911,28 +1911,26 @@ void LLKeyframeMotion::onLoadComplete(LLVFS *vfs,
1911 void* user_data, S32 status) 1911 void* user_data, S32 status)
1912{ 1912{
1913 LLUUID* id = (LLUUID*)user_data; 1913 LLUUID* id = (LLUUID*)user_data;
1914
1915 std::vector<LLCharacter* >::iterator char_iter = LLCharacter::sInstances.begin();
1914 1916
1915 LLCharacter* character = NULL; 1917 while(char_iter != LLCharacter::sInstances.end() &&
1918 (*char_iter)->getID() != *id)
1919 {
1920 ++char_iter;
1921 }
1916 1922
1917 for(character = LLCharacter::sInstances.getFirstData();
1918 character;
1919 character = LLCharacter::sInstances.getNextData())
1920 {
1921 if (character->getID() == *id)
1922 {
1923 break;
1924 }
1925 }
1926
1927 delete id; 1923 delete id;
1928 1924
1929 if (!character) 1925 if (char_iter == LLCharacter::sInstances.end())
1930 { 1926 {
1931 return; 1927 return;
1932 } 1928 }
1933 1929
1930 LLCharacter* character = *char_iter;
1931
1934 // create an instance of this motion (it may or may not already exist) 1932 // create an instance of this motion (it may or may not already exist)
1935 LLKeyframeMotion* motionp = (LLKeyframeMotion*)character->createMotion(asset_uuid); 1933 LLKeyframeMotion* motionp = (LLKeyframeMotion*) character->createMotion(asset_uuid);
1936 1934
1937 if (0 == status && motionp) 1935 if (0 == status && motionp)
1938 { 1936 {
diff --git a/linden/indra/llcharacter/llkeyframemotionparam.cpp b/linden/indra/llcharacter/llkeyframemotionparam.cpp
index 0bdc723..93df410 100644
--- a/linden/indra/llcharacter/llkeyframemotionparam.cpp
+++ b/linden/indra/llcharacter/llkeyframemotionparam.cpp
@@ -348,9 +348,9 @@ BOOL LLKeyframeMotionParam::loadMotions()
348 // Load data into a buffer to be parsed. 348 // Load data into a buffer to be parsed.
349 //------------------------------------------------------------------------- 349 //-------------------------------------------------------------------------
350 char path[LL_MAX_PATH]; /* Flawfinder: ignore */ 350 char path[LL_MAX_PATH]; /* Flawfinder: ignore */
351 snprintf( path, sizeof(path), "%s_%s.llp", 351 snprintf( path,sizeof(path), "%s_%s.llp", /* Flawfinder: ignore */
352 gDirUtilp->getExpandedFilename(LL_PATH_MOTIONS,mCharacter->getAnimationPrefix()).c_str(), 352 gDirUtilp->getExpandedFilename(LL_PATH_MOTIONS,mCharacter->getAnimationPrefix()).c_str(),
353 getName().c_str() ); /* Flawfinder: ignore */ 353 getName().c_str() );
354 354
355 //------------------------------------------------------------------------- 355 //-------------------------------------------------------------------------
356 // open the file 356 // open the file
@@ -425,7 +425,7 @@ BOOL LLKeyframeMotionParam::loadMotions()
425 // get priority 425 // get priority
426 //------------------------------------------------------------------------- 426 //-------------------------------------------------------------------------
427 BOOL isFirstMotion = TRUE; 427 BOOL isFirstMotion = TRUE;
428 num = sscanf(p, "%79s %79s %f", strA, strB, &floatA); 428 num = sscanf(p, "%79s %79s %f", strA, strB, &floatA); /* Flawfinder: ignore */
429 429
430 while(1) 430 while(1)
431 { 431 {
@@ -451,7 +451,7 @@ BOOL LLKeyframeMotionParam::loadMotions()
451 } 451 }
452 452
453 p++; 453 p++;
454 num = sscanf(p, "%79s %79s %f", strA, strB, &floatA); 454 num = sscanf(p, "%79s %79s %f", strA, strB, &floatA); /* Flawfinder: ignore */
455 } 455 }
456 456
457 delete [] text; 457 delete [] text;
diff --git a/linden/indra/llcommon/files.lst b/linden/indra/llcommon/files.lst
index 2482eec..5fcb8c7 100644
--- a/linden/indra/llcommon/files.lst
+++ b/linden/indra/llcommon/files.lst
@@ -2,18 +2,20 @@ llcommon/bitpack.cpp
2llcommon/llapp.cpp 2llcommon/llapp.cpp
3llcommon/llapr.cpp 3llcommon/llapr.cpp
4llcommon/llassettype.cpp 4llcommon/llassettype.cpp
5llcommon/llbase32.cpp
6llcommon/llbase64.cpp
5llcommon/llcommon.cpp 7llcommon/llcommon.cpp
6llcommon/llcriticaldamp.cpp 8llcommon/llcriticaldamp.cpp
7llcommon/lldate.cpp 9llcommon/lldate.cpp
8llcommon/llerrorbuffer.cpp
9llcommon/llerror.cpp 10llcommon/llerror.cpp
10llcommon/llerrorstream.cpp
11llcommon/llerrorthread.cpp 11llcommon/llerrorthread.cpp
12llcommon/llevent.cpp 12llcommon/llevent.cpp
13llcommon/llfasttimer.cpp 13llcommon/llfasttimer.cpp
14llcommon/llfile.cpp 14llcommon/llfile.cpp
15llcommon/llfixedbuffer.cpp 15llcommon/llfixedbuffer.cpp
16llcommon/llformat.cpp
16llcommon/llframetimer.cpp 17llcommon/llframetimer.cpp
18llcommon/llliveappconfig.cpp
17llcommon/lllivefile.cpp 19llcommon/lllivefile.cpp
18llcommon/llmemory.cpp 20llcommon/llmemory.cpp
19llcommon/llmemorystream.cpp 21llcommon/llmemorystream.cpp
diff --git a/linden/indra/llcommon/imageids.h b/linden/indra/llcommon/imageids.h
index 150322e..d65b374 100644
--- a/linden/indra/llcommon/imageids.h
+++ b/linden/indra/llcommon/imageids.h
@@ -50,7 +50,7 @@
50const LLUUID IMG_CLEAR ("11ee27f5-43c0-414e-afd5-d7f5688c351f"); // VIEWER 50const LLUUID IMG_CLEAR ("11ee27f5-43c0-414e-afd5-d7f5688c351f"); // VIEWER
51const LLUUID IMG_SMOKE ("b4ba225c-373f-446d-9f7e-6cb7b5cf9b3d"); // VIEWER 51const LLUUID IMG_SMOKE ("b4ba225c-373f-446d-9f7e-6cb7b5cf9b3d"); // VIEWER
52 52
53const LLUUID IMG_DEFAULT ("b4ba225c-373f-446d-9f7e-6cb7b5cf9b3d"); // VIEWER 53const LLUUID IMG_DEFAULT ("d2114404-dd59-4a4d-8e6c-49359e91bbf0"); // VIEWER
54 54
55//const LLUUID IMG_SAND ("0ff70ead-4562-45f9-9e8a-52b1a3286868"); // VIEWER 1.5k 55//const LLUUID IMG_SAND ("0ff70ead-4562-45f9-9e8a-52b1a3286868"); // VIEWER 1.5k
56//const LLUUID IMG_GRASS ("5ab48dd5-05d0-4f1a-ace6-efd4e2fb3508"); // VIEWER 1.2k 56//const LLUUID IMG_GRASS ("5ab48dd5-05d0-4f1a-ace6-efd4e2fb3508"); // VIEWER 1.2k
diff --git a/linden/indra/llcommon/indra_constants.h b/linden/indra/llcommon/indra_constants.h
index 31c2559..deb9c9d 100644
--- a/linden/indra/llcommon/indra_constants.h
+++ b/linden/indra/llcommon/indra_constants.h
@@ -28,6 +28,7 @@
28#ifndef LL_INDRA_CONSTANTS_H 28#ifndef LL_INDRA_CONSTANTS_H
29#define LL_INDRA_CONSTANTS_H 29#define LL_INDRA_CONSTANTS_H
30 30
31#include "stdtypes.h"
31#include "lluuid.h" 32#include "lluuid.h"
32 33
33// Viewer object cache version, change if object update 34// Viewer object cache version, change if object update
@@ -105,8 +106,8 @@ const char* const DEFAULT_LOCAL_ASSET_SERVER = "http://localhost:12041/asset/tmp
105const char* const LOCAL_ASSET_URL_FORMAT = "http://%s:12041/asset"; 106const char* const LOCAL_ASSET_URL_FORMAT = "http://%s:12041/asset";
106 107
107const U32 DEFAULT_LAUNCHER_PORT = 12029; 108const U32 DEFAULT_LAUNCHER_PORT = 12029;
108const U32 DEFAULT_BIGBOARD_PORT = 12030; 109//const U32 DEFAULT_BIGBOARD_PORT = 12030; // Deprecated
109const U32 DEFAULT_QUERYSIM_PORT = 12031; 110//const U32 DEFAULT_QUERYSIM_PORT = 12031; // Deprecated
110const U32 DEFAULT_DATA_SERVER_PORT = 12032; 111const U32 DEFAULT_DATA_SERVER_PORT = 12032;
111const U32 DEFAULT_SPACE_SERVER_PORT = 12033; 112const U32 DEFAULT_SPACE_SERVER_PORT = 12033;
112const U32 DEFAULT_VIEWER_PORT = 12034; 113const U32 DEFAULT_VIEWER_PORT = 12034;
@@ -115,8 +116,11 @@ const U32 DEFAULT_USER_SERVER_PORT = 12036;
115const U32 DEFAULT_RPC_SERVER_PORT = 12037; 116const U32 DEFAULT_RPC_SERVER_PORT = 12037;
116const U32 DEFAULT_LOG_DATA_SERVER_PORT = 12039; 117const U32 DEFAULT_LOG_DATA_SERVER_PORT = 12039;
117const U32 DEFAULT_BACKBONE_PORT = 12040; 118const U32 DEFAULT_BACKBONE_PORT = 12040;
119const U32 DEFAULT_CGI_SERVICES_PORT = 12045;
118const U32 DEFAULT_LOCAL_ASSET_PORT = 12041; 120const U32 DEFAULT_LOCAL_ASSET_PORT = 12041;
119const U32 DEFAULT_BACKBONE_CAP_PORT = 12042; 121//const U32 DEFAULT_BACKBONE_CAP_PORT = 12042; // Deprecated
122const U32 DEFAULT_CAP_PROXY_PORT = 12043;
123const U32 DEFAULT_INV_DATA_SERVER_PORT = 12044;
120 124
121// For automatic port discovery when running multiple viewers on one host 125// For automatic port discovery when running multiple viewers on one host
122const U32 PORT_DISCOVERY_RANGE_MIN = 13000; 126const U32 PORT_DISCOVERY_RANGE_MIN = 13000;
@@ -322,7 +326,7 @@ const U32 MAP_ITEM_TELEHUB = 0x01;
322const U32 MAP_ITEM_PG_EVENT = 0x02; 326const U32 MAP_ITEM_PG_EVENT = 0x02;
323const U32 MAP_ITEM_MATURE_EVENT = 0x03; 327const U32 MAP_ITEM_MATURE_EVENT = 0x03;
324const U32 MAP_ITEM_POPULAR = 0x04; 328const U32 MAP_ITEM_POPULAR = 0x04;
325const U32 MAP_ITEM_AGENT_COUNT = 0x05; 329//const U32 MAP_ITEM_AGENT_COUNT = 0x05;
326const U32 MAP_ITEM_AGENT_LOCATIONS = 0x06; 330const U32 MAP_ITEM_AGENT_LOCATIONS = 0x06;
327const U32 MAP_ITEM_LAND_FOR_SALE = 0x07; 331const U32 MAP_ITEM_LAND_FOR_SALE = 0x07;
328const U32 MAP_ITEM_CLASSIFIED = 0x08; 332const U32 MAP_ITEM_CLASSIFIED = 0x08;
diff --git a/linden/indra/llcommon/linden_common.h b/linden/indra/llcommon/linden_common.h
index ff77b3d..b1c5f3b 100644
--- a/linden/indra/llcommon/linden_common.h
+++ b/linden/indra/llcommon/linden_common.h
@@ -49,6 +49,7 @@
49#include "stdtypes.h" 49#include "stdtypes.h"
50#include "lldefs.h" 50#include "lldefs.h"
51#include "llerror.h" 51#include "llerror.h"
52#include "llformat.h"
52#include "llstring.h" 53#include "llstring.h"
53#include "lltimer.h" 54#include "lltimer.h"
54#include "llfasttimer.h" 55#include "llfasttimer.h"
diff --git a/linden/indra/llcommon/llapp.cpp b/linden/indra/llcommon/llapp.cpp
index 42d9050..f48ff8f 100644
--- a/linden/indra/llcommon/llapp.cpp
+++ b/linden/indra/llcommon/llapp.cpp
@@ -30,9 +30,11 @@
30 30
31#include "llcommon.h" 31#include "llcommon.h"
32#include "llapr.h" 32#include "llapr.h"
33#include "llerrorcontrol.h"
33#include "llerrorthread.h" 34#include "llerrorthread.h"
34#include "llframetimer.h" 35#include "llframetimer.h"
35#include "llmemory.h" 36#include "llmemory.h"
37#include "lltimer.h"
36 38
37// 39//
38// Signal handling 40// Signal handling
@@ -193,10 +195,8 @@ LLSD LLApp::getOptionData(OptionPriority level)
193 195
194void LLApp::stepFrame() 196void LLApp::stepFrame()
195{ 197{
196 // Update the static frame timer.
197 LLFrameTimer::updateFrameTime(); 198 LLFrameTimer::updateFrameTime();
198 199 LLEventTimer::updateClass();
199 // Run ready runnables
200 mRunner.run(); 200 mRunner.run();
201} 201}
202 202
@@ -563,7 +563,7 @@ void default_unix_signal_handler(int signum, siginfo_t *info, void *)
563 else 563 else
564 { 564 {
565 // Don't log anything, even errors - this is because this signal could happen anywhere. 565 // Don't log anything, even errors - this is because this signal could happen anywhere.
566 gErrorStream.setLevel(LLErrorStream::NONE); 566 LLError::setDefaultLevel(LLError::LEVEL_NONE);
567 } 567 }
568 568
569 // Change the signal that we reraise to SIGABRT, so we generate a core dump. 569 // Change the signal that we reraise to SIGABRT, so we generate a core dump.
diff --git a/linden/indra/llcommon/llapr.cpp b/linden/indra/llcommon/llapr.cpp
index 665ee75..550a8d8 100644
--- a/linden/indra/llcommon/llapr.cpp
+++ b/linden/indra/llcommon/llapr.cpp
@@ -122,11 +122,13 @@ void ll_apr_assert_status(apr_status_t status)
122 llassert(ll_apr_warn_status(status) == false); 122 llassert(ll_apr_warn_status(status) == false);
123} 123}
124 124
125apr_file_t* ll_apr_file_open(const LLString& filename, apr_int32_t flags, S32* sizep) 125// File I/O
126apr_file_t* ll_apr_file_open(const LLString& filename, apr_int32_t flags, S32* sizep, apr_pool_t* pool)
126{ 127{
127 apr_file_t* apr_file; 128 apr_file_t* apr_file;
128 apr_status_t s; 129 apr_status_t s;
129 s = apr_file_open(&apr_file, filename.c_str(), flags, APR_OS_DEFAULT, gAPRPoolp); 130 if (pool == NULL) pool = gAPRPoolp;
131 s = apr_file_open(&apr_file, filename.c_str(), flags, APR_OS_DEFAULT, pool);
130 if (s != APR_SUCCESS) 132 if (s != APR_SUCCESS)
131 { 133 {
132 if (sizep) 134 if (sizep)
@@ -142,6 +144,7 @@ apr_file_t* ll_apr_file_open(const LLString& filename, apr_int32_t flags, S32* s
142 apr_off_t offset = 0; 144 apr_off_t offset = 0;
143 if (apr_file_seek(apr_file, APR_END, &offset) == APR_SUCCESS) 145 if (apr_file_seek(apr_file, APR_END, &offset) == APR_SUCCESS)
144 { 146 {
147 llassert_always(offset <= 0x7fffffff);
145 file_size = (S32)offset; 148 file_size = (S32)offset;
146 offset = 0; 149 offset = 0;
147 apr_file_seek(apr_file, APR_SET, &offset); 150 apr_file_seek(apr_file, APR_SET, &offset);
@@ -151,6 +154,18 @@ apr_file_t* ll_apr_file_open(const LLString& filename, apr_int32_t flags, S32* s
151 154
152 return apr_file; 155 return apr_file;
153} 156}
157apr_file_t* ll_apr_file_open(const LLString& filename, apr_int32_t flags, S32* sizep)
158{
159 return ll_apr_file_open(filename, flags, sizep, NULL);
160}
161apr_file_t* ll_apr_file_open(const LLString& filename, apr_int32_t flags, apr_pool_t* pool)
162{
163 return ll_apr_file_open(filename, flags, NULL, pool);
164}
165apr_file_t* ll_apr_file_open(const LLString& filename, apr_int32_t flags)
166{
167 return ll_apr_file_open(filename, flags, NULL, NULL);
168}
154 169
155S32 ll_apr_file_read(apr_file_t* apr_file, void *buf, S32 nbytes) 170S32 ll_apr_file_read(apr_file_t* apr_file, void *buf, S32 nbytes)
156{ 171{
@@ -162,10 +177,37 @@ S32 ll_apr_file_read(apr_file_t* apr_file, void *buf, S32 nbytes)
162 } 177 }
163 else 178 else
164 { 179 {
180 llassert_always(sz <= 0x7fffffff);
165 return (S32)sz; 181 return (S32)sz;
166 } 182 }
167} 183}
168 184
185S32 ll_apr_file_read_ex(const LLString& filename, apr_pool_t* pool, void *buf, S32 offset, S32 nbytes)
186{
187 if (pool == NULL) pool = gAPRPoolp;
188 apr_file_t* filep = ll_apr_file_open(filename, APR_READ|APR_BINARY, pool);
189 if (!filep)
190 {
191 return 0;
192 }
193 S32 off;
194 if (offset < 0)
195 off = ll_apr_file_seek(filep, APR_END, 0);
196 else
197 off = ll_apr_file_seek(filep, APR_SET, offset);
198 S32 bytes_read;
199 if (off < 0)
200 {
201 bytes_read = 0;
202 }
203 else
204 {
205 bytes_read = ll_apr_file_read(filep, buf, nbytes );
206 }
207 apr_file_close(filep);
208
209 return bytes_read;
210}
169 211
170S32 ll_apr_file_write(apr_file_t* apr_file, const void *buf, S32 nbytes) 212S32 ll_apr_file_write(apr_file_t* apr_file, const void *buf, S32 nbytes)
171{ 213{
@@ -177,28 +219,73 @@ S32 ll_apr_file_write(apr_file_t* apr_file, const void *buf, S32 nbytes)
177 } 219 }
178 else 220 else
179 { 221 {
222 llassert_always(sz <= 0x7fffffff);
180 return (S32)sz; 223 return (S32)sz;
181 } 224 }
182} 225}
183 226
227S32 ll_apr_file_write_ex(const LLString& filename, apr_pool_t* pool, void *buf, S32 offset, S32 nbytes)
228{
229 if (pool == NULL) pool = gAPRPoolp;
230 apr_int32_t flags = APR_CREATE|APR_WRITE|APR_BINARY;
231 if (offset < 0)
232 {
233 flags |= APR_APPEND;
234 offset = 0;
235 }
236 apr_file_t* filep = ll_apr_file_open(filename, flags, pool);
237 if (!filep)
238 {
239 return 0;
240 }
241 if (offset > 0)
242 {
243 offset = ll_apr_file_seek(filep, APR_SET, offset);
244 }
245 S32 bytes_written;
246 if (offset < 0)
247 {
248 bytes_written = 0;
249 }
250 else
251 {
252 bytes_written = ll_apr_file_write(filep, buf, nbytes );
253 }
254 apr_file_close(filep);
255
256 return bytes_written;
257}
258
184S32 ll_apr_file_seek(apr_file_t* apr_file, apr_seek_where_t where, S32 offset) 259S32 ll_apr_file_seek(apr_file_t* apr_file, apr_seek_where_t where, S32 offset)
185{ 260{
186 apr_off_t apr_offset = offset; 261 apr_status_t s;
187 apr_status_t s = apr_file_seek(apr_file, where, &apr_offset); 262 apr_off_t apr_offset;
263 if (offset >= 0)
264 {
265 apr_offset = (apr_off_t)offset;
266 s = apr_file_seek(apr_file, where, &apr_offset);
267 }
268 else
269 {
270 apr_offset = 0;
271 s = apr_file_seek(apr_file, APR_END, &apr_offset);
272 }
188 if (s != APR_SUCCESS) 273 if (s != APR_SUCCESS)
189 { 274 {
190 return -1; 275 return -1;
191 } 276 }
192 else 277 else
193 { 278 {
279 llassert_always(apr_offset <= 0x7fffffff);
194 return (S32)apr_offset; 280 return (S32)apr_offset;
195 } 281 }
196} 282}
197 283
198bool ll_apr_file_remove(const LLString& filename) 284bool ll_apr_file_remove(const LLString& filename, apr_pool_t* pool)
199{ 285{
200 apr_status_t s; 286 apr_status_t s;
201 s = apr_file_remove(filename.c_str(), gAPRPoolp); 287 if (pool == NULL) pool = gAPRPoolp;
288 s = apr_file_remove(filename.c_str(), pool);
202 if (s != APR_SUCCESS) 289 if (s != APR_SUCCESS)
203 { 290 {
204 llwarns << "ll_apr_file_remove failed on file: " << filename << llendl; 291 llwarns << "ll_apr_file_remove failed on file: " << filename << llendl;
@@ -207,10 +294,11 @@ bool ll_apr_file_remove(const LLString& filename)
207 return true; 294 return true;
208} 295}
209 296
210bool ll_apr_file_rename(const LLString& filename, const LLString& newname) 297bool ll_apr_file_rename(const LLString& filename, const LLString& newname, apr_pool_t* pool)
211{ 298{
212 apr_status_t s; 299 apr_status_t s;
213 s = apr_file_rename(filename.c_str(), newname.c_str(), gAPRPoolp); 300 if (pool == NULL) pool = gAPRPoolp;
301 s = apr_file_rename(filename.c_str(), newname.c_str(), pool);
214 if (s != APR_SUCCESS) 302 if (s != APR_SUCCESS)
215 { 303 {
216 llwarns << "ll_apr_file_rename failed on file: " << filename << llendl; 304 llwarns << "ll_apr_file_rename failed on file: " << filename << llendl;
@@ -218,3 +306,73 @@ bool ll_apr_file_rename(const LLString& filename, const LLString& newname)
218 } 306 }
219 return true; 307 return true;
220} 308}
309
310bool ll_apr_file_exists(const LLString& filename, apr_pool_t* pool)
311{
312 apr_file_t* apr_file;
313 apr_status_t s;
314 if (pool == NULL) pool = gAPRPoolp;
315 s = apr_file_open(&apr_file, filename.c_str(), APR_READ, APR_OS_DEFAULT, pool);
316 if (s != APR_SUCCESS || !apr_file)
317 {
318 return false;
319 }
320 else
321 {
322 apr_file_close(apr_file);
323 return true;
324 }
325}
326
327S32 ll_apr_file_size(const LLString& filename, apr_pool_t* pool)
328{
329 apr_file_t* apr_file;
330 apr_finfo_t info;
331 apr_status_t s;
332 if (pool == NULL) pool = gAPRPoolp;
333 s = apr_file_open(&apr_file, filename.c_str(), APR_READ, APR_OS_DEFAULT, pool);
334 if (s != APR_SUCCESS || !apr_file)
335 {
336 return 0;
337 }
338 else
339 {
340 apr_status_t s = apr_file_info_get(&info, APR_FINFO_SIZE, apr_file);
341 apr_file_close(apr_file);
342 if (s == APR_SUCCESS)
343 {
344 return (S32)info.size;
345 }
346 else
347 {
348 return 0;
349 }
350 }
351}
352
353bool ll_apr_dir_make(const LLString& dirname, apr_pool_t* pool)
354{
355 apr_status_t s;
356 if (pool == NULL) pool = gAPRPoolp;
357 s = apr_dir_make(dirname.c_str(), APR_FPROT_OS_DEFAULT, pool);
358 if (s != APR_SUCCESS)
359 {
360 llwarns << "ll_apr_file_remove failed on file: " << dirname << llendl;
361 return false;
362 }
363 return true;
364}
365
366bool ll_apr_dir_remove(const LLString& dirname, apr_pool_t* pool)
367{
368 apr_status_t s;
369 if (pool == NULL) pool = gAPRPoolp;
370 s = apr_file_remove(dirname.c_str(), pool);
371 if (s != APR_SUCCESS)
372 {
373 llwarns << "ll_apr_file_remove failed on file: " << dirname << llendl;
374 return false;
375 }
376 return true;
377}
378
diff --git a/linden/indra/llcommon/llapr.h b/linden/indra/llcommon/llapr.h
index a5c217c..be6fc6c 100644
--- a/linden/indra/llcommon/llapr.h
+++ b/linden/indra/llcommon/llapr.h
@@ -125,14 +125,24 @@ typedef LLAtomic32<S32> LLAtomicS32;
125#define LL_APR_WB (APR_CREATE|APR_TRUNCATE|APR_WRITE|APR_BINARY) // "wb" 125#define LL_APR_WB (APR_CREATE|APR_TRUNCATE|APR_WRITE|APR_BINARY) // "wb"
126#define LL_APR_RPB (APR_READ|APR_WRITE|APR_BINARY) // "r+b" 126#define LL_APR_RPB (APR_READ|APR_WRITE|APR_BINARY) // "r+b"
127#define LL_APR_WPB (APR_CREATE|APR_TRUNCATE|APR_READ|APR_WRITE|APR_BINARY) // "w+b" 127#define LL_APR_WPB (APR_CREATE|APR_TRUNCATE|APR_READ|APR_WRITE|APR_BINARY) // "w+b"
128apr_file_t* ll_apr_file_open(const LLString& filename, apr_int32_t flags, S32* sizep = NULL); 128apr_file_t* ll_apr_file_open(const LLString& filename, apr_int32_t flags, S32* sizep, apr_pool_t* pool);
129apr_file_t* ll_apr_file_open(const LLString& filename, apr_int32_t flags, S32* sizep);
130apr_file_t* ll_apr_file_open(const LLString& filename, apr_int32_t flags, apr_pool_t* pool);
131apr_file_t* ll_apr_file_open(const LLString& filename, apr_int32_t flags);
129// Returns actual offset, -1 if seek fails 132// Returns actual offset, -1 if seek fails
130S32 ll_apr_file_seek(apr_file_t* apr_file, apr_seek_where_t where, S32 offset); 133S32 ll_apr_file_seek(apr_file_t* apr_file, apr_seek_where_t where, S32 offset);
131// Returns bytes read/written, 0 if read/write fails 134// Returns bytes read/written, 0 if read/write fails:
132S32 ll_apr_file_read(apr_file_t* apr_file, void* buf, S32 nbytes); 135S32 ll_apr_file_read(apr_file_t* apr_file, void* buf, S32 nbytes);
136S32 ll_apr_file_read_ex(const LLString& filename, apr_pool_t* pool, void *buf, S32 offset, S32 nbytes);
133S32 ll_apr_file_write(apr_file_t* apr_file, const void* buf, S32 nbytes); 137S32 ll_apr_file_write(apr_file_t* apr_file, const void* buf, S32 nbytes);
134bool ll_apr_file_remove(const LLString& filename); 138S32 ll_apr_file_write_ex(const LLString& filename, apr_pool_t* pool, void *buf, S32 offset, S32 nbytes);
135bool ll_apr_file_rename(const LLString& filename, const LLString& newname); 139// returns false if failure:
140bool ll_apr_file_remove(const LLString& filename, apr_pool_t* pool = NULL);
141bool ll_apr_file_rename(const LLString& filename, const LLString& newname, apr_pool_t* pool = NULL);
142bool ll_apr_file_exists(const LLString& filename, apr_pool_t* pool = NULL);
143S32 ll_apr_file_size(const LLString& filename, apr_pool_t* pool = NULL);
144bool ll_apr_dir_make(const LLString& dirname, apr_pool_t* pool = NULL);
145bool ll_apr_dir_remove(const LLString& dirname, apr_pool_t* pool = NULL);
136 146
137/** 147/**
138 * @brief Function which approprately logs error or remains quiet on 148 * @brief Function which approprately logs error or remains quiet on
diff --git a/linden/indra/llcommon/llassettype.cpp b/linden/indra/llcommon/llassettype.cpp
index 051092e..df00af8 100644
--- a/linden/indra/llcommon/llassettype.cpp
+++ b/linden/indra/llcommon/llassettype.cpp
@@ -203,6 +203,20 @@ const char* LLAssetType::lookupHumanReadable(LLAssetType::EType type)
203 } 203 }
204} 204}
205 205
206// static
207LLAssetType::EType LLAssetType::lookupHumanReadable( const char* name )
208{
209 for( S32 i = 0; i < AT_COUNT; i++ )
210 {
211 if( 0 == strcmp(name, mAssetTypeHumanNames[i]) )
212 {
213 // match
214 return (EType)i;
215 }
216 }
217 return AT_NONE;
218}
219
206EDragAndDropType LLAssetType::lookupDragAndDropType( EType asset ) 220EDragAndDropType LLAssetType::lookupDragAndDropType( EType asset )
207{ 221{
208 switch( asset ) 222 switch( asset )
diff --git a/linden/indra/llcommon/llassettype.h b/linden/indra/llcommon/llassettype.h
index 67dc3ef..da4cf0b 100644
--- a/linden/indra/llcommon/llassettype.h
+++ b/linden/indra/llcommon/llassettype.h
@@ -145,6 +145,7 @@ public:
145 static const char* lookup(EType type); 145 static const char* lookup(EType type);
146 146
147 // translation from a type to a human readable form. 147 // translation from a type to a human readable form.
148 static EType lookupHumanReadable( const char* name );
148 static const char* lookupHumanReadable(EType type); 149 static const char* lookupHumanReadable(EType type);
149 150
150 static EDragAndDropType lookupDragAndDropType( EType ); 151 static EDragAndDropType lookupDragAndDropType( EType );
diff --git a/linden/indra/llcommon/llavatarconstants.h b/linden/indra/llcommon/llavatarconstants.h
index 3335949..1eb5b05 100644
--- a/linden/indra/llcommon/llavatarconstants.h
+++ b/linden/indra/llcommon/llavatarconstants.h
@@ -39,16 +39,16 @@ const char* const BLACKLIST_PROFILE_WEB_URL = "http://secondlife.com/app/webdisa
39// Maximum number of avatar picks 39// Maximum number of avatar picks
40const S32 MAX_AVATAR_PICKS = 10; 40const S32 MAX_AVATAR_PICKS = 10;
41 41
42// For Flags in AvatarPropertiesReply 42// For Flags in AvatarPropertiesReply
43const U32 AVATAR_ALLOW_PUBLISH = 0x1 << 0; // whether profile is externally visible or not 43const U32 AVATAR_ALLOW_PUBLISH = 0x1 << 0; // whether profile is externally visible or not
44const U32 AVATAR_MATURE_PUBLISH = 0x1 << 1; // profile is "mature" 44const U32 AVATAR_MATURE_PUBLISH = 0x1 << 1; // profile is "mature"
45const U32 AVATAR_IDENTIFIED = 0x1 << 2; // whether avatar has provided payment info 45const U32 AVATAR_IDENTIFIED = 0x1 << 2; // whether avatar has provided payment info
46const U32 AVATAR_TRANSACTED = 0x1 << 3; // whether avatar has actively used payment info 46const U32 AVATAR_TRANSACTED = 0x1 << 3; // whether avatar has actively used payment info
47const U32 AVATAR_ONLINE = 0x1 << 4; // the online status of this avatar, if known. 47const U32 AVATAR_ONLINE = 0x1 << 4; // the online status of this avatar, if known.
48 48
49static const std::string VISIBILITY_DEFAULT("default"); 49static const std::string VISIBILITY_DEFAULT("default");
50static const std::string VISIBILITY_HIDDEN("hidden"); 50static const std::string VISIBILITY_HIDDEN("hidden");
51static const std::string VISIBILITY_VISIBLE("visible"); 51static const std::string VISIBILITY_VISIBLE("visible");
52static const std::string VISIBILITY_INVISIBLE("invisible"); 52static const std::string VISIBILITY_INVISIBLE("invisible");
53 53
54#endif 54#endif
diff --git a/linden/indra/llcommon/llbase32.cpp b/linden/indra/llcommon/llbase32.cpp
new file mode 100644
index 0000000..711ba63
--- /dev/null
+++ b/linden/indra/llcommon/llbase32.cpp
@@ -0,0 +1,214 @@
1/**
2 * @file llbase32.cpp
3 * @brief base32 encoding that returns a std::string
4 * @author James Cook
5 *
6 * Based on code from bitter
7 * http://ghostwhitecrab.com/bitter/
8 *
9 * Copyright (c) 2006 Christian Biere <christianbiere@gmx.de>
10 * All rights reserved.
11 *
12 * Redistribution and use in source and binary forms, with or without
13 * modification, are permitted provided that the following conditions
14 * are met:
15 *
16 * 1. Redistributions of source code must retain the above copyright
17 * notice, this list of conditions and the following disclaimer.
18 * 2. Redistributions in binary form must reproduce the above copyright
19 * notice, this list of conditions and the following disclaimer in the
20 * documentation and/or other materials provided with the distribution.
21 * 3. Neither the name of the authors nor the names of its contributors
22 * may be used to endorse or promote products derived from this software
23 * without specific prior written permission.
24 *
25 * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
26 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
28 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
29 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
31 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
32 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
34 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35 * SUCH DAMAGE.
36 */
37
38#include "linden_common.h"
39
40#include "llbase32.h"
41
42#include <string>
43
44// bitter - base32.c starts here
45
46/*
47 * See RFC 3548 for details about Base 32 encoding:
48 * http://www.faqs.org/rfcs/rfc3548.html
49 */
50
51static const char base32_alphabet[32] = {
52 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H',
53 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P',
54 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X',
55 'Y', 'Z', '2', '3', '4', '5', '6', '7'
56};
57
58size_t
59base32_encode(char *dst, size_t size, const void *data, size_t len)
60{
61 size_t i = 0;
62 const U8 *p = (const U8*)data;
63 const char *end = &dst[size];
64 char *q = dst;
65
66 do {
67 size_t j, k;
68 U8 x[5];
69 char s[8];
70
71 switch (len - i) {
72 case 4: k = 7; break;
73 case 3: k = 5; break;
74 case 2: k = 3; break;
75 case 1: k = 2; break;
76 default:
77 k = 8;
78 }
79
80 for (j = 0; j < 5; j++)
81 x[j] = i < len ? p[i++] : 0;
82
83/*
84 +-------+-----------+--------+
85 | target| source | source |
86 | byte | bits | byte |
87 +-------+-----------+--------+
88 | 0 | 7 6 5 4 3 | 0 |
89 | 1 | 2 1 0 7 6 | 0-1 |
90 | 2 | 5 4 3 2 1 | 1 |
91 | 3 | 0 7 6 5 4 | 1-2 |
92 | 4 | 3 2 1 0 7 | 2-3 |
93 | 5 | 6 5 4 3 2 | 3 |
94 | 6 | 1 0 7 6 5 | 3-4 |
95 | 7 | 4 3 2 1 0 | 4 |
96 +-------+-----------+--------+
97
98*/
99
100 s[0] = (x[0] >> 3);
101 s[1] = ((x[0] & 0x07) << 2) | (x[1] >> 6);
102 s[2] = (x[1] >> 1) & 0x1f;
103 s[3] = ((x[1] & 0x01) << 4) | (x[2] >> 4);
104 s[4] = ((x[2] & 0x0f) << 1) | (x[3] >> 7);
105 s[5] = (x[3] >> 2) & 0x1f;
106 s[6] = ((x[3] & 0x03) << 3) | (x[4] >> 5);
107 s[7] = x[4] & 0x1f;
108
109 for (j = 0; j < k && q != end; j++)
110 *q++ = base32_alphabet[(U8) s[j]];
111
112 } while (i < len);
113
114 return q - dst;
115}
116
117/* *TODO: Implement base32 encode.
118
119#define ARRAY_LEN(a) (sizeof (a) / sizeof((a)[0]))
120
121static inline int
122ascii_toupper(int c)
123{
124 return c >= 97 && c <= 122 ? c - 32 : c;
125}
126
127static inline int
128ascii_tolower(int c)
129{
130 return c >= 65 && c <= 90 ? c + 32 : c;
131}
132
133
134static char base32_map[(unsigned char) -1];
135
136size_t
137base32_decode(char *dst, size_t size, const void *data, size_t len)
138{
139 const char *end = &dst[size];
140 const unsigned char *p = data;
141 char *q = dst;
142 size_t i;
143 unsigned max_pad = 3;
144
145 if (0 == base32_map[0]) {
146 for (i = 0; i < ARRAY_LEN(base32_map); i++) {
147 const char *x;
148
149 x = memchr(base32_alphabet, ascii_toupper(i), sizeof base32_alphabet);
150 base32_map[i] = x ? (x - base32_alphabet) : (unsigned char) -1;
151 }
152 }
153
154 for (i = 0; i < len && max_pad > 0; i++) {
155 unsigned char c;
156 char s[8];
157 size_t j;
158
159 c = p[i];
160 if ('=' == c) {
161 max_pad--;
162 c = 0;
163 } else {
164 c = base32_map[c];
165 if ((unsigned char) -1 == c) {
166 return -1;
167 }
168 }
169
170 j = i % ARRAY_LEN(s);
171 s[j] = c;
172
173 if (7 == j) {
174 char b[5];
175
176 b[0] = ((s[0] << 3) & 0xf8) | ((s[1] >> 2) & 0x07);
177 b[1] = ((s[1] & 0x03) << 6) | ((s[2] & 0x1f) << 1) | ((s[3] >> 4) & 1);
178 b[2] = ((s[3] & 0x0f) << 4) | ((s[4] >> 1) & 0x0f);
179 b[3] = ((s[4] & 1) << 7) | ((s[5] & 0x1f) << 2) | ((s[6] >> 3) & 0x03);
180 b[4] = ((s[6] & 0x07) << 5) | (s[7] & 0x1f);
181
182 for (j = 0; j < ARRAY_LEN(b); j++) {
183 if (q != end)
184 *q = b[j];
185 q++;
186 }
187 }
188 }
189
190 return q - dst;
191}
192*/
193
194
195// static
196std::string LLBase32::encode(const U8* input, size_t input_size)
197{
198 std::string output;
199 if (input)
200 {
201 // Each 5 byte chunk of input is represented by an
202 // 8 byte chunk of output.
203 size_t input_chunks = (input_size + 4) / 5;
204 size_t output_size = input_chunks * 8;
205
206 output.resize(output_size);
207
208 size_t encoded = base32_encode(&output[0], output_size, input, input_size);
209
210 llinfos << "encoded " << encoded << " into buffer of size " << output_size
211 << llendl;
212 }
213 return output;
214}
diff --git a/linden/indra/llcommon/llbase32.h b/linden/indra/llcommon/llbase32.h
new file mode 100644
index 0000000..eaf3efc
--- /dev/null
+++ b/linden/indra/llcommon/llbase32.h
@@ -0,0 +1,38 @@
1/**
2 * @file llbase32.h
3 * @brief base32 encoding that returns a std::string
4 * @author James Cook
5 *
6 * Copyright (c) 2007-2007, Linden Research, Inc.
7 *
8 * The source code in this file ("Source Code") is provided by Linden Lab
9 * to you under the terms of the GNU General Public License, version 2.0
10 * ("GPL"), unless you have obtained a separate licensing agreement
11 * ("Other License"), formally executed by you and Linden Lab. Terms of
12 * the GPL can be found in doc/GPL-license.txt in this distribution, or
13 * online at http://secondlife.com/developers/opensource/gplv2
14 *
15 * There are special exceptions to the terms and conditions of the GPL as
16 * it is applied to this Source Code. View the full text of the exception
17 * in the file doc/FLOSS-exception.txt in this software distribution, or
18 * online at http://secondlife.com/developers/opensource/flossexception
19 *
20 * By copying, modifying or distributing this software, you acknowledge
21 * that you have read and understood your obligations described above,
22 * and agree to abide by those obligations.
23 *
24 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
25 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
26 * COMPLETENESS OR PERFORMANCE.
27 */
28
29#ifndef LLBASE32_H
30#define LLBASE32_h
31
32class LLBase32
33{
34public:
35 static std::string encode(const U8* input, size_t input_size);
36};
37
38#endif
diff --git a/linden/indra/llcommon/llbase64.cpp b/linden/indra/llcommon/llbase64.cpp
new file mode 100644
index 0000000..0869d3f
--- /dev/null
+++ b/linden/indra/llcommon/llbase64.cpp
@@ -0,0 +1,62 @@
1/**
2 * @file llbase64.cpp
3 * @brief Wrapper for apr base64 encoding that returns a std::string
4 * @author James Cook
5 *
6 * Copyright (c) 2007-2007, Linden Research, Inc.
7 *
8 * The source code in this file ("Source Code") is provided by Linden Lab
9 * to you under the terms of the GNU General Public License, version 2.0
10 * ("GPL"), unless you have obtained a separate licensing agreement
11 * ("Other License"), formally executed by you and Linden Lab. Terms of
12 * the GPL can be found in doc/GPL-license.txt in this distribution, or
13 * online at http://secondlife.com/developers/opensource/gplv2
14 *
15 * There are special exceptions to the terms and conditions of the GPL as
16 * it is applied to this Source Code. View the full text of the exception
17 * in the file doc/FLOSS-exception.txt in this software distribution, or
18 * online at http://secondlife.com/developers/opensource/flossexception
19 *
20 * By copying, modifying or distributing this software, you acknowledge
21 * that you have read and understood your obligations described above,
22 * and agree to abide by those obligations.
23 *
24 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
25 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
26 * COMPLETENESS OR PERFORMANCE.
27 */
28
29#include "linden_common.h"
30
31#include "llbase64.h"
32
33#include <string>
34
35#include "apr-1/apr_base64.h"
36
37
38// static
39std::string LLBase64::encode(const U8* input, size_t input_size)
40{
41 std::string output;
42 if (input
43 && input_size > 0)
44 {
45 // Yes, it returns int.
46 int b64_buffer_length = apr_base64_encode_len(input_size);
47 char* b64_buffer = new char[b64_buffer_length];
48
49 // This is faster than apr_base64_encode() if you know
50 // you're not on an EBCDIC machine. Also, the output is
51 // null terminated, even though the documentation doesn't
52 // specify. See apr_base64.c for details. JC
53 b64_buffer_length = apr_base64_encode_binary(
54 b64_buffer,
55 input,
56 input_size);
57 output.assign(b64_buffer);
58 delete[] b64_buffer;
59 }
60 return output;
61}
62
diff --git a/linden/indra/llcommon/llbase64.h b/linden/indra/llcommon/llbase64.h
new file mode 100644
index 0000000..d8b4acc
--- /dev/null
+++ b/linden/indra/llcommon/llbase64.h
@@ -0,0 +1,38 @@
1/**
2 * @file llbase64.h
3 * @brief Wrapper for apr base64 encoding that returns a std::string
4 * @author James Cook
5 *
6 * Copyright (c) 2007-2007, Linden Research, Inc.
7 *
8 * The source code in this file ("Source Code") is provided by Linden Lab
9 * to you under the terms of the GNU General Public License, version 2.0
10 * ("GPL"), unless you have obtained a separate licensing agreement
11 * ("Other License"), formally executed by you and Linden Lab. Terms of
12 * the GPL can be found in doc/GPL-license.txt in this distribution, or
13 * online at http://secondlife.com/developers/opensource/gplv2
14 *
15 * There are special exceptions to the terms and conditions of the GPL as
16 * it is applied to this Source Code. View the full text of the exception
17 * in the file doc/FLOSS-exception.txt in this software distribution, or
18 * online at http://secondlife.com/developers/opensource/flossexception
19 *
20 * By copying, modifying or distributing this software, you acknowledge
21 * that you have read and understood your obligations described above,
22 * and agree to abide by those obligations.
23 *
24 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
25 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
26 * COMPLETENESS OR PERFORMANCE.
27 */
28
29#ifndef LLBASE64_H
30#define LLBASE64_h
31
32class LLBase64
33{
34public:
35 static std::string encode(const U8* input, size_t input_size);
36};
37
38#endif
diff --git a/linden/indra/llcommon/llcommon.cpp b/linden/indra/llcommon/llcommon.cpp
index 50b9849..49675e1 100644
--- a/linden/indra/llcommon/llcommon.cpp
+++ b/linden/indra/llcommon/llcommon.cpp
@@ -27,6 +27,7 @@
27#include "linden_common.h" 27#include "linden_common.h"
28 28
29#include "llcommon.h" 29#include "llcommon.h"
30#include "llthread.h"
30 31
31//static 32//static
32BOOL LLCommon::sAprInitialized = FALSE; 33BOOL LLCommon::sAprInitialized = FALSE;
diff --git a/linden/indra/llcommon/llcommon.h b/linden/indra/llcommon/llcommon.h
index 5d5264c..8b57579 100644
--- a/linden/indra/llcommon/llcommon.h
+++ b/linden/indra/llcommon/llcommon.h
@@ -31,7 +31,6 @@
31#include "llapr.h" 31#include "llapr.h"
32// #include "llframecallbackmanager.h" 32// #include "llframecallbackmanager.h"
33#include "lltimer.h" 33#include "lltimer.h"
34#include "llworkerthread.h"
35#include "llfile.h" 34#include "llfile.h"
36 35
37class LLCommon 36class LLCommon
diff --git a/linden/indra/llcommon/llcommon.vcproj b/linden/indra/llcommon/llcommon.vcproj
index 5cfbc64..403b8c5 100644
--- a/linden/indra/llcommon/llcommon.vcproj
+++ b/linden/indra/llcommon/llcommon.vcproj
@@ -167,22 +167,22 @@
167 RelativePath=".\llassettype.cpp"> 167 RelativePath=".\llassettype.cpp">
168 </File> 168 </File>
169 <File 169 <File
170 RelativePath=".\llcommon.cpp"> 170 RelativePath=".\llbase32.cpp">
171 </File> 171 </File>
172 <File 172 <File
173 RelativePath=".\llcriticaldamp.cpp"> 173 RelativePath=".\llbase64.cpp">
174 </File> 174 </File>
175 <File 175 <File
176 RelativePath=".\lldate.cpp"> 176 RelativePath=".\llcommon.cpp">
177 </File> 177 </File>
178 <File 178 <File
179 RelativePath=".\llerror.cpp"> 179 RelativePath=".\llcriticaldamp.cpp">
180 </File> 180 </File>
181 <File 181 <File
182 RelativePath=".\llerrorbuffer.cpp"> 182 RelativePath=".\lldate.cpp">
183 </File> 183 </File>
184 <File 184 <File
185 RelativePath=".\llerrorstream.cpp"> 185 RelativePath=".\llerror.cpp">
186 </File> 186 </File>
187 <File 187 <File
188 RelativePath=".\llerrorthread.cpp"> 188 RelativePath=".\llerrorthread.cpp">
@@ -200,9 +200,15 @@
200 RelativePath=".\llfixedbuffer.cpp"> 200 RelativePath=".\llfixedbuffer.cpp">
201 </File> 201 </File>
202 <File 202 <File
203 RelativePath=".\llformat.cpp">
204 </File>
205 <File
203 RelativePath=".\llframetimer.cpp"> 206 RelativePath=".\llframetimer.cpp">
204 </File> 207 </File>
205 <File 208 <File
209 RelativePath=".\llliveappconfig.cpp">
210 </File>
211 <File
206 RelativePath=".\lllivefile.cpp"> 212 RelativePath=".\lllivefile.cpp">
207 </File> 213 </File>
208 <File 214 <File
@@ -322,6 +328,12 @@
322 RelativePath=".\llavatarconstants.h"> 328 RelativePath=".\llavatarconstants.h">
323 </File> 329 </File>
324 <File 330 <File
331 RelativePath=".\llbase32.h">
332 </File>
333 <File
334 RelativePath=".\llbase64.h">
335 </File>
336 <File
325 RelativePath=".\llboost.h"> 337 RelativePath=".\llboost.h">
326 </File> 338 </File>
327 <File 339 <File
@@ -364,10 +376,7 @@
364 RelativePath=".\llerror.h"> 376 RelativePath=".\llerror.h">
365 </File> 377 </File>
366 <File 378 <File
367 RelativePath=".\llerrorbuffer.h"> 379 RelativePath=".\llerrorcontrol.h">
368 </File>
369 <File
370 RelativePath=".\llerrorstream.h">
371 </File> 380 </File>
372 <File 381 <File
373 RelativePath=".\llerrorthread.h"> 382 RelativePath=".\llerrorthread.h">
@@ -385,6 +394,9 @@
385 RelativePath=".\llfixedbuffer.h"> 394 RelativePath=".\llfixedbuffer.h">
386 </File> 395 </File>
387 <File 396 <File
397 RelativePath=".\llformat.h">
398 </File>
399 <File
388 RelativePath=".\llframecallbackmanager.h"> 400 RelativePath=".\llframecallbackmanager.h">
389 </File> 401 </File>
390 <File 402 <File
@@ -400,6 +412,9 @@
400 RelativePath=".\lllinkedqueue.h"> 412 RelativePath=".\lllinkedqueue.h">
401 </File> 413 </File>
402 <File 414 <File
415 RelativePath=".\llliveappconfig.h">
416 </File>
417 <File
403 RelativePath=".\lllivefile.h"> 418 RelativePath=".\lllivefile.h">
404 </File> 419 </File>
405 <File 420 <File
@@ -418,6 +433,9 @@
418 RelativePath=".\llmemorystream.h"> 433 RelativePath=".\llmemorystream.h">
419 </File> 434 </File>
420 <File 435 <File
436 RelativePath=".\llmemtype.h">
437 </File>
438 <File
421 RelativePath=".\llmortician.h"> 439 RelativePath=".\llmortician.h">
422 </File> 440 </File>
423 <File 441 <File
diff --git a/linden/indra/llcommon/llcommon_vc8.vcproj b/linden/indra/llcommon/llcommon_vc8.vcproj
new file mode 100644
index 0000000..4fee443
--- /dev/null
+++ b/linden/indra/llcommon/llcommon_vc8.vcproj
@@ -0,0 +1,759 @@
1<?xml version="1.0" encoding="Windows-1252"?>
2<VisualStudioProject
3 ProjectType="Visual C++"
4 Version="8.00"
5 Name="llcommon"
6 ProjectGUID="{7BCB4B2C-8378-4186-88EA-5742B5ABE17F}"
7 RootNamespace="llcommon"
8 Keyword="Win32Proj"
9 >
10 <Platforms>
11 <Platform
12 Name="Win32"
13 />
14 </Platforms>
15 <ToolFiles>
16 </ToolFiles>
17 <Configurations>
18 <Configuration
19 Name="Debug|Win32"
20 OutputDirectory="../lib_$(ConfigurationName)/i686-win32"
21 IntermediateDirectory="$(ConfigurationName)"
22 ConfigurationType="4"
23 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
24 CharacterSet="1"
25 >
26 <Tool
27 Name="VCPreBuildEventTool"
28 />
29 <Tool
30 Name="VCCustomBuildTool"
31 />
32 <Tool
33 Name="VCXMLDataGeneratorTool"
34 />
35 <Tool
36 Name="VCWebServiceProxyGeneratorTool"
37 />
38 <Tool
39 Name="VCMIDLTool"
40 />
41 <Tool
42 Name="VCCLCompilerTool"
43 Optimization="0"
44 AdditionalIncludeDirectories="..\..\libraries\i686-win32\include;..\..\libraries\include\"
45 PreprocessorDefinitions="WIN32;_DEBUG;_LIB;LL_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;LL_DEBUG;XML_STATIC;APR_DECLARE_STATIC"
46 MinimalRebuild="true"
47 BasicRuntimeChecks="3"
48 RuntimeLibrary="1"
49 StructMemberAlignment="4"
50 TreatWChar_tAsBuiltInType="false"
51 ForceConformanceInForLoopScope="true"
52 UsePrecompiledHeader="0"
53 WarningLevel="3"
54 WarnAsError="true"
55 Detect64BitPortabilityProblems="false"
56 DebugInformationFormat="4"
57 />
58 <Tool
59 Name="VCManagedResourceCompilerTool"
60 />
61 <Tool
62 Name="VCResourceCompilerTool"
63 />
64 <Tool
65 Name="VCPreLinkEventTool"
66 />
67 <Tool
68 Name="VCLibrarianTool"
69 OutputFile="$(OutDir)/llcommon.lib"
70 />
71 <Tool
72 Name="VCALinkTool"
73 />
74 <Tool
75 Name="VCXDCMakeTool"
76 />
77 <Tool
78 Name="VCBscMakeTool"
79 />
80 <Tool
81 Name="VCFxCopTool"
82 />
83 <Tool
84 Name="VCPostBuildEventTool"
85 />
86 </Configuration>
87 <Configuration
88 Name="Release|Win32"
89 OutputDirectory="../lib_$(ConfigurationName)/i686-win32"
90 IntermediateDirectory="$(ConfigurationName)"
91 ConfigurationType="4"
92 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
93 CharacterSet="1"
94 >
95 <Tool
96 Name="VCPreBuildEventTool"
97 />
98 <Tool
99 Name="VCCustomBuildTool"
100 />
101 <Tool
102 Name="VCXMLDataGeneratorTool"
103 />
104 <Tool
105 Name="VCWebServiceProxyGeneratorTool"
106 />
107 <Tool
108 Name="VCMIDLTool"
109 />
110 <Tool
111 Name="VCCLCompilerTool"
112 InlineFunctionExpansion="2"
113 EnableIntrinsicFunctions="true"
114 AdditionalIncludeDirectories="..\..\libraries\i686-win32\include;..\..\libraries\include\"
115 PreprocessorDefinitions="WIN32;NDEBUG;_LIB;LL_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;LL_RELEASE;XML_STATIC;APR_DECLARE_STATIC"
116 RuntimeLibrary="0"
117 StructMemberAlignment="0"
118 TreatWChar_tAsBuiltInType="false"
119 ForceConformanceInForLoopScope="true"
120 UsePrecompiledHeader="0"
121 WarningLevel="3"
122 WarnAsError="true"
123 Detect64BitPortabilityProblems="false"
124 DebugInformationFormat="3"
125 />
126 <Tool
127 Name="VCManagedResourceCompilerTool"
128 />
129 <Tool
130 Name="VCResourceCompilerTool"
131 />
132 <Tool
133 Name="VCPreLinkEventTool"
134 />
135 <Tool
136 Name="VCLibrarianTool"
137 OutputFile="$(OutDir)/llcommon.lib"
138 />
139 <Tool
140 Name="VCALinkTool"
141 />
142 <Tool
143 Name="VCXDCMakeTool"
144 />
145 <Tool
146 Name="VCBscMakeTool"
147 />
148 <Tool
149 Name="VCFxCopTool"
150 />
151 <Tool
152 Name="VCPostBuildEventTool"
153 />
154 </Configuration>
155 <Configuration
156 Name="ReleaseNoOpt|Win32"
157 OutputDirectory="../lib_$(ConfigurationName)/i686-win32"
158 IntermediateDirectory="$(ConfigurationName)"
159 ConfigurationType="4"
160 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
161 CharacterSet="1"
162 >
163 <Tool
164 Name="VCPreBuildEventTool"
165 />
166 <Tool
167 Name="VCCustomBuildTool"
168 />
169 <Tool
170 Name="VCXMLDataGeneratorTool"
171 />
172 <Tool
173 Name="VCWebServiceProxyGeneratorTool"
174 />
175 <Tool
176 Name="VCMIDLTool"
177 />
178 <Tool
179 Name="VCCLCompilerTool"
180 Optimization="0"
181 AdditionalIncludeDirectories="..\..\libraries\i686-win32\include;..\..\libraries\include\"
182 PreprocessorDefinitions="WIN32;NDEBUG;_LIB;LL_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;LL_RELEASE;XML_STATIC;APR_DECLARE_STATIC"
183 RuntimeLibrary="0"
184 StructMemberAlignment="0"
185 TreatWChar_tAsBuiltInType="false"
186 ForceConformanceInForLoopScope="true"
187 UsePrecompiledHeader="0"
188 WarningLevel="3"
189 WarnAsError="true"
190 Detect64BitPortabilityProblems="false"
191 DebugInformationFormat="3"
192 />
193 <Tool
194 Name="VCManagedResourceCompilerTool"
195 />
196 <Tool
197 Name="VCResourceCompilerTool"
198 />
199 <Tool
200 Name="VCPreLinkEventTool"
201 />
202 <Tool
203 Name="VCLibrarianTool"
204 OutputFile="$(OutDir)/llcommon.lib"
205 />
206 <Tool
207 Name="VCALinkTool"
208 />
209 <Tool
210 Name="VCXDCMakeTool"
211 />
212 <Tool
213 Name="VCBscMakeTool"
214 />
215 <Tool
216 Name="VCFxCopTool"
217 />
218 <Tool
219 Name="VCPostBuildEventTool"
220 />
221 </Configuration>
222 </Configurations>
223 <References>
224 </References>
225 <Files>
226 <Filter
227 Name="Source Files"
228 Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
229 UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
230 >
231 <File
232 RelativePath=".\bitpack.cpp"
233 >
234 </File>
235 <File
236 RelativePath=".\llapp.cpp"
237 >
238 </File>
239 <File
240 RelativePath=".\llapr.cpp"
241 >
242 </File>
243 <File
244 RelativePath=".\llassettype.cpp"
245 >
246 </File>
247 <File
248 RelativePath=".\llbase64.cpp"
249 >
250 </File>
251 <File
252 RelativePath=".\llcommon.cpp"
253 >
254 </File>
255 <File
256 RelativePath=".\llcriticaldamp.cpp"
257 >
258 </File>
259 <File
260 RelativePath=".\lldate.cpp"
261 >
262 </File>
263 <File
264 RelativePath=".\llerror.cpp"
265 >
266 </File>
267 <File
268 RelativePath=".\llerrorthread.cpp"
269 >
270 </File>
271 <File
272 RelativePath=".\llevent.cpp"
273 >
274 </File>
275 <File
276 RelativePath=".\llfasttimer.cpp"
277 >
278 </File>
279 <File
280 RelativePath=".\llfile.cpp"
281 >
282 </File>
283 <File
284 RelativePath=".\llfixedbuffer.cpp"
285 >
286 </File>
287 <File
288 RelativePath=".\llformat.cpp"
289 >
290 </File>
291 <File
292 RelativePath=".\llframetimer.cpp"
293 >
294 </File>
295 <File
296 RelativePath=".\lllivefile.cpp"
297 >
298 </File>
299 <File
300 RelativePath=".\llmemory.cpp"
301 >
302 </File>
303 <File
304 RelativePath=".\llmemorystream.cpp"
305 >
306 </File>
307 <File
308 RelativePath=".\llmortician.cpp"
309 >
310 </File>
311 <File
312 RelativePath=".\llprocessor.cpp"
313 >
314 </File>
315 <File
316 RelativePath=".\llqueuedthread.cpp"
317 >
318 </File>
319 <File
320 RelativePath=".\llrun.cpp"
321 >
322 </File>
323 <File
324 RelativePath=".\llsd.cpp"
325 >
326 </File>
327 <File
328 RelativePath=".\llsdserialize.cpp"
329 >
330 </File>
331 <File
332 RelativePath=".\llsdserialize_xml.cpp"
333 >
334 </File>
335 <File
336 RelativePath=".\llsdutil.cpp"
337 >
338 </File>
339 <File
340 RelativePath=".\llsecondlifeurls.cpp"
341 >
342 </File>
343 <File
344 RelativePath=".\llstat.cpp"
345 >
346 </File>
347 <File
348 RelativePath=".\llstreamtools.cpp"
349 >
350 </File>
351 <File
352 RelativePath=".\llstring.cpp"
353 >
354 </File>
355 <File
356 RelativePath=".\llstringtable.cpp"
357 >
358 </File>
359 <File
360 RelativePath=".\llsys.cpp"
361 >
362 </File>
363 <File
364 RelativePath=".\llthread.cpp"
365 >
366 </File>
367 <File
368 RelativePath=".\lltimer.cpp"
369 >
370 </File>
371 <File
372 RelativePath=".\lluri.cpp"
373 >
374 </File>
375 <File
376 RelativePath=".\llworkerthread.cpp"
377 >
378 </File>
379 <File
380 RelativePath=".\metaclass.cpp"
381 >
382 </File>
383 <File
384 RelativePath=".\metaproperty.cpp"
385 >
386 </File>
387 <File
388 RelativePath=".\reflective.cpp"
389 >
390 </File>
391 <File
392 RelativePath=".\timing.cpp"
393 >
394 </File>
395 <File
396 RelativePath=".\u64.cpp"
397 >
398 </File>
399 </Filter>
400 <Filter
401 Name="Header Files"
402 Filter="h;hpp;hxx;hm;inl;inc;xsd"
403 UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
404 >
405 <File
406 RelativePath=".\bitpack.h"
407 >
408 </File>
409 <File
410 RelativePath=".\doublelinkedlist.h"
411 >
412 </File>
413 <File
414 RelativePath=".\imageids.h"
415 >
416 </File>
417 <File
418 RelativePath=".\indra_constants.h"
419 >
420 </File>
421 <File
422 RelativePath=".\linden_common.h"
423 >
424 </File>
425 <File
426 RelativePath=".\linked_lists.h"
427 >
428 </File>
429 <File
430 RelativePath=".\llagentconstants.h"
431 >
432 </File>
433 <File
434 RelativePath=".\llapp.h"
435 >
436 </File>
437 <File
438 RelativePath=".\llapr.h"
439 >
440 </File>
441 <File
442 RelativePath=".\llassettype.h"
443 >
444 </File>
445 <File
446 RelativePath=".\llassoclist.h"
447 >
448 </File>
449 <File
450 RelativePath=".\llavatarconstants.h"
451 >
452 </File>
453 <File
454 RelativePath=".\llbase64.h"
455 >
456 </File>
457 <File
458 RelativePath=".\llboost.h"
459 >
460 </File>
461 <File
462 RelativePath=".\llchat.h"
463 >
464 </File>
465 <File
466 RelativePath=".\llclickaction.h"
467 >
468 </File>
469 <File
470 RelativePath=".\llcommon.h"
471 >
472 </File>
473 <File
474 RelativePath=".\llcriticaldamp.h"
475 >
476 </File>
477 <File
478 RelativePath=".\lldarray.h"
479 >
480 </File>
481 <File
482 RelativePath=".\lldarrayptr.h"
483 >
484 </File>
485 <File
486 RelativePath=".\lldate.h"
487 >
488 </File>
489 <File
490 RelativePath=".\lldefs.h"
491 >
492 </File>
493 <File
494 RelativePath=".\lldlinked.h"
495 >
496 </File>
497 <File
498 RelativePath=".\lldqueueptr.h"
499 >
500 </File>
501 <File
502 RelativePath=".\llendianswizzle.h"
503 >
504 </File>
505 <File
506 RelativePath=".\llenum.h"
507 >
508 </File>
509 <File
510 RelativePath=".\llerror.h"
511 >
512 </File>
513 <File
514 RelativePath=".\llerrorcontrol.h"
515 >
516 </File>
517 <File
518 RelativePath=".\llerrorthread.h"
519 >
520 </File>
521 <File
522 RelativePath=".\llevent.h"
523 >
524 </File>
525 <File
526 RelativePath=".\llfasttimer.h"
527 >
528 </File>
529 <File
530 RelativePath=".\llfile.h"
531 >
532 </File>
533 <File
534 RelativePath=".\llfixedbuffer.h"
535 >
536 </File>
537 <File
538 RelativePath=".\llformat.h"
539 >
540 </File>
541 <File
542 RelativePath=".\llframecallbackmanager.h"
543 >
544 </File>
545 <File
546 RelativePath=".\llframetimer.h"
547 >
548 </File>
549 <File
550 RelativePath=".\llhash.h"
551 >
552 </File>
553 <File
554 RelativePath=".\llindexedqueue.h"
555 >
556 </File>
557 <File
558 RelativePath=".\lllinkedqueue.h"
559 >
560 </File>
561 <File
562 RelativePath=".\lllivefile.h"
563 >
564 </File>
565 <File
566 RelativePath=".\lllocalidhashmap.h"
567 >
568 </File>
569 <File
570 RelativePath=".\lllslconstants.h"
571 >
572 </File>
573 <File
574 RelativePath=".\llmap.h"
575 >
576 </File>
577 <File
578 RelativePath=".\llmemory.h"
579 >
580 </File>
581 <File
582 RelativePath=".\llmemorystream.h"
583 >
584 </File>
585 <File
586 RelativePath=".\llmortician.h"
587 >
588 </File>
589 <File
590 RelativePath=".\llnametable.h"
591 >
592 </File>
593 <File
594 RelativePath=".\llpagemem.h"
595 >
596 </File>
597 <File
598 RelativePath=".\llpreprocessor.h"
599 >
600 </File>
601 <File
602 RelativePath=".\llpriqueuemap.h"
603 >
604 </File>
605 <File
606 RelativePath=".\llprocessor.h"
607 >
608 </File>
609 <File
610 RelativePath=".\llptrskiplist.h"
611 >
612 </File>
613 <File
614 RelativePath=".\llptrskipmap.h"
615 >
616 </File>
617 <File
618 RelativePath=".\llqueuedthread.h"
619 >
620 </File>
621 <File
622 RelativePath=".\llrun.h"
623 >
624 </File>
625 <File
626 RelativePath=".\llsd.h"
627 >
628 </File>
629 <File
630 RelativePath=".\llsdserialize.h"
631 >
632 </File>
633 <File
634 RelativePath=".\llsdserialize_xml.h"
635 >
636 </File>
637 <File
638 RelativePath=".\llsdutil.h"
639 >
640 </File>
641 <File
642 RelativePath=".\llsecondlifeurls.h"
643 >
644 </File>
645 <File
646 RelativePath=".\llskiplist.h"
647 >
648 </File>
649 <File
650 RelativePath=".\llskipmap.h"
651 >
652 </File>
653 <File
654 RelativePath=".\llstat.h"
655 >
656 </File>
657 <File
658 RelativePath=".\llstatenums.h"
659 >
660 </File>
661 <File
662 RelativePath=".\llstl.h"
663 >
664 </File>
665 <File
666 RelativePath=".\llstreamtools.h"
667 >
668 </File>
669 <File
670 RelativePath=".\llstrider.h"
671 >
672 </File>
673 <File
674 RelativePath=".\llstring.h"
675 >
676 </File>
677 <File
678 RelativePath=".\llstringtable.h"
679 >
680 </File>
681 <File
682 RelativePath=".\llsys.h"
683 >
684 </File>
685 <File
686 RelativePath=".\llthread.h"
687 >
688 </File>
689 <File
690 RelativePath=".\lltimer.h"
691 >
692 </File>
693 <File
694 RelativePath=".\lluri.h"
695 >
696 </File>
697 <File
698 RelativePath=".\lluuidhashmap.h"
699 >
700 </File>
701 <File
702 RelativePath=".\llversion.h"
703 >
704 </File>
705 <File
706 RelativePath=".\llworkerthread.h"
707 >
708 </File>
709 <File
710 RelativePath=".\new_mem_ops.h"
711 >
712 </File>
713 <File
714 RelativePath=".\priqueue.h"
715 >
716 </File>
717 <File
718 RelativePath=".\processor.h"
719 >
720 </File>
721 <File
722 RelativePath=".\roles_constants.h"
723 >
724 </File>
725 <File
726 RelativePath=".\stdenums.h"
727 >
728 </File>
729 <File
730 RelativePath=".\stdtypes.h"
731 >
732 </File>
733 <File
734 RelativePath=".\string_table.h"
735 >
736 </File>
737 <File
738 RelativePath=".\timer.h"
739 >
740 </File>
741 <File
742 RelativePath=".\timing.h"
743 >
744 </File>
745 <File
746 RelativePath=".\u64.h"
747 >
748 </File>
749 </Filter>
750 <Filter
751 Name="Resource Files"
752 Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
753 UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
754 >
755 </Filter>
756 </Files>
757 <Globals>
758 </Globals>
759</VisualStudioProject>
diff --git a/linden/indra/llcommon/llerror.cpp b/linden/indra/llcommon/llerror.cpp
index 29f4500..57e098e 100644
--- a/linden/indra/llcommon/llerror.cpp
+++ b/linden/indra/llcommon/llerror.cpp
@@ -1,8 +1,9 @@
1/** 1/**
2 * @file llerror.cpp 2 * @file llerror.cpp
3 * @brief Function to crash. 3 * @date December 2006
4 * @brief error message system
4 * 5 *
5 * Copyright (c) 2001-2007, Linden Research, Inc. 6 * Copyright (c) 2006-2007, Linden Research, Inc.
6 * 7 *
7 * The source code in this file ("Source Code") is provided by Linden Lab 8 * The source code in this file ("Source Code") is provided by Linden Lab
8 * to you under the terms of the GNU General Public License, version 2.0 9 * to you under the terms of the GNU General Public License, version 2.0
@@ -24,36 +25,1048 @@
24 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, 25 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
25 * COMPLETENESS OR PERFORMANCE. 26 * COMPLETENESS OR PERFORMANCE.
26 */ 27 */
28
27#include "linden_common.h" 29#include "linden_common.h"
28 30
29#include "llerror.h" 31#include "llerror.h"
32#include "llerrorcontrol.h"
33
34#include "llapp.h"
35#include "llapr.h"
36extern apr_thread_mutex_t *gLogMutexp;
37#include "llfile.h"
38#include "llfixedbuffer.h"
39#include "lllivefile.h"
40#include "llsd.h"
41#include "llsdserialize.h"
42
43#include <algorithm>
44#include <cctype>
45#include <map>
46#include <sstream>
47#if !LL_WINDOWS
48#include <stdio.h>
49#include <syslog.h>
50#endif
51#include <time.h>
52#if LL_WINDOWS
53#include <windows.h>
54#endif
55#include <vector>
56
57
58#ifdef __GNUC__
59#include <cxxabi.h>
60#endif
61
62namespace {
63#if !LL_WINDOWS
64 class RecordToSyslog : public LLError::Recorder
65 {
66 public:
67 RecordToSyslog(const std::string& identity)
68 : mIdentity(identity)
69 {
70 openlog(mIdentity.c_str(), LOG_CONS|LOG_PID, LOG_LOCAL0);
71 // we need to set the string from a local copy of the string
72 // since apparanetly openlog expects the const char* to remain
73 // valid even after it returns (presumably until closelog)
74 }
75
76 ~RecordToSyslog()
77 {
78 closelog();
79 }
80
81 virtual void recordMessage(LLError::ELevel level,
82 const std::string& message)
83 {
84 int syslogPriority = LOG_CRIT;
85 switch (level) {
86 case LLError::LEVEL_DEBUG: syslogPriority = LOG_DEBUG; break;
87 case LLError::LEVEL_INFO: syslogPriority = LOG_INFO; break;
88 case LLError::LEVEL_WARN: syslogPriority = LOG_WARNING; break;
89 case LLError::LEVEL_ERROR: syslogPriority = LOG_CRIT; break;
90 default: syslogPriority = LOG_CRIT;
91 }
92
93 syslog(syslogPriority, "%s", message.c_str());
94 }
95 private:
96 std::string mIdentity;
97 };
98#endif
99
100 class RecordToFile : public LLError::Recorder
101 {
102 public:
103 RecordToFile(const std::string& filename)
104 {
105 mFile.open(filename.c_str(), llofstream::out | llofstream::app);
106 if (!mFile)
107 {
108 llinfos << "Error setting log file to " << filename << llendl;
109 }
110 }
111
112 ~RecordToFile()
113 {
114 mFile.close();
115 }
116
117 bool okay() { return mFile; }
118
119 virtual bool wantsTime() { return true; }
120
121 virtual void recordMessage(LLError::ELevel level,
122 const std::string& message)
123 {
124 mFile << message << std::endl;
125 // mFile.flush();
126 // *FIX: should we do this?
127 }
128
129 private:
130 llofstream mFile;
131 };
132
133
134 class RecordToStderr : public LLError::Recorder
135 {
136 public:
137 RecordToStderr(bool timestamp) : mTimestamp(timestamp) { }
30 138
31LLErrorBuffer gErrorBuffer; 139 virtual bool wantsTime() { return mTimestamp; }
32LLErrorStream gErrorStream(&gErrorBuffer); 140
141 virtual void recordMessage(LLError::ELevel level,
142 const std::string& message)
143 {
144 fprintf(stderr, "%s\n", message.c_str());
145 }
146
147 private:
148 bool mTimestamp;
149 };
33 150
151 class RecordToFixedBuffer : public LLError::Recorder
152 {
153 public:
154 RecordToFixedBuffer(LLFixedBuffer& buffer) : mBuffer(buffer) { }
155
156 virtual void recordMessage(LLError::ELevel level,
157 const std::string& message)
158 {
159 mBuffer.addLine(message.c_str());
160 }
161
162 private:
163 LLFixedBuffer& mBuffer;
164 };
34 165
35void _llcrash_and_loop() 166#if LL_WINDOWS
167 class RecordToWinDebug: public LLError::Recorder
168 {
169 public:
170 virtual void recordMessage(LLError::ELevel level,
171 const std::string& message)
172 {
173 llutf16string utf16str =
174 wstring_to_utf16str(utf8str_to_wstring(message));
175 utf16str += '\n';
176 OutputDebugString(utf16str.c_str());
177 }
178 };
179#endif
180}
181
182
183namespace
36{ 184{
37 // Now, we go kaboom! 185 std::string className(const std::type_info& type)
38 U32* crash = NULL; 186 {
187#ifdef __GNUC__
188 // GCC: type_info::name() returns a mangled class name, must demangle
189
190 static size_t abi_name_len = 100;
191 static char* abi_name_buf = (char*)malloc(abi_name_len);
192 // warning: above is voodoo inferred from the GCC manual,
193 // do NOT change
194
195 int status;
196 // We don't use status, and shouldn't have to pass apointer to it
197 // but gcc 3.3 libstc++'s implementation of demangling is broken
198 // and fails without.
199
200 char* name = abi::__cxa_demangle(type.name(),
201 abi_name_buf, &abi_name_len, &status);
202 // this call can realloc the abi_name_buf pointer (!)
203
204 return name ? name : type.name();
39 205
40 *crash = 0; 206#elif LL_WINDOWS
207 // DevStudio: type_info::name() includes the text "class " at the start
41 208
42 while(TRUE) 209 static const std::string class_prefix = "class ";
210
211 std::string name = type.name();
212 std::string::size_type p = name.find(class_prefix);
213 if (p == std::string::npos)
214 {
215 return name;
216 }
217
218 return name.substr(p + class_prefix.size());
219
220#else
221 return type.name();
222#endif
223 }
224
225 std::string functionName(const std::string& preprocessor_name)
43 { 226 {
227#if LL_WINDOWS
228 // DevStudio: the __FUNCTION__ macro string includes
229 // the type and/or namespace prefixes
230
231 std::string::size_type p = preprocessor_name.rfind(':');
232 if (p == std::string::npos)
233 {
234 return preprocessor_name;
235 }
236 return preprocessor_name.substr(p + 1);
237
238#else
239 return preprocessor_name;
240#endif
241 }
242
243
244 class LogControlFile : public LLLiveFile
245 {
246 LOG_CLASS(LogControlFile);
247
248 public:
249 static LogControlFile& fromDirectory(const std::string& dir);
250
251 virtual void loadFile();
252
253 private:
254 LogControlFile(const std::string &filename)
255 : LLLiveFile(filename)
256 { }
257 };
258
259 LogControlFile& LogControlFile::fromDirectory(const std::string& dir)
260 {
261 std::string dirBase = dir + "/";
262 // NB: We have no abstraction in llcommon for the "proper"
263 // delimiter but it turns out that "/" works on all three platforms
264
265 std::string file = dirBase + "logcontrol-dev.xml";
266
267 llstat stat_info;
268 if (LLFile::stat(file.c_str(), &stat_info)) {
269 // NB: stat returns non-zero if it can't read the file, for example
270 // if it doesn't exist. LLFile has no better abstraction for
271 // testing for file existence.
272
273 file = dirBase + "logcontrol.xml";
274 }
275 return * new LogControlFile(file);
276 // NB: This instance is never freed
277 }
278
279 void LogControlFile::loadFile()
280 {
281 LLSD configuration;
282
283 {
284 llifstream file(filename().c_str());
285 if (file.is_open())
286 {
287 LLSDSerialize::fromXML(configuration, file);
288 }
289
290 if (configuration.isUndefined())
291 {
292 llwarns << filename() << " missing, ill-formed,"
293 " or simply undefined; not changing configuration"
294 << llendl;
295 return;
296 }
297 }
298
299 LLError::configure(configuration);
300 llinfos << "logging reconfigured from " << filename() << llendl;
301 }
302
303
304 typedef std::map<std::string, LLError::ELevel> LevelMap;
305 typedef std::vector<LLError::Recorder*> Recorders;
306 typedef std::vector<LLError::CallSite*> CallSiteVector;
307
308 class Globals
309 {
310 public:
311 std::ostringstream messageStream;
312 bool messageStreamInUse;
313
314 void addCallSite(LLError::CallSite&);
315 void invalidateCallSites();
316
317 static Globals& get();
318 // return the one instance of the globals
319
320 private:
321 CallSiteVector callSites;
322
323 Globals()
324 : messageStreamInUse(false)
325 { }
326
327 };
328
329 void Globals::addCallSite(LLError::CallSite& site)
330 {
331 callSites.push_back(&site);
332 }
44 333
45 // Loop forever, in case the crash didn't work? 334 void Globals::invalidateCallSites()
335 {
336 for (CallSiteVector::const_iterator i = callSites.begin();
337 i != callSites.end();
338 ++i)
339 {
340 (*i)->invalidate();
341 }
342
343 callSites.clear();
344 }
345
346 Globals& Globals::get()
347 {
348 /* This pattern, of returning a reference to a static function
349 variable, is to ensure that this global is constructed before
350 it is used, no matter what the global initializeation sequence
351 is.
352 See C++ FAQ Lite, sections 10.12 through 10.14
353 */
354 static Globals* globals = new Globals;
355 return *globals;
46 } 356 }
47} 357}
48 358
49LLScopedErrorLevel::LLScopedErrorLevel(LLErrorBuffer::ELevel error_level) 359namespace LLError
50{ 360{
51 mOrigErrorLevel = gErrorStream.getErrorLevel(); 361 class Settings
52 gErrorStream.setErrorLevel(error_level); 362 {
363 public:
364 bool printLocation;
365
366 LLError::ELevel defaultLevel;
367
368 LevelMap functionLevelMap;
369 LevelMap classLevelMap;
370 LevelMap fileLevelMap;
371
372 LLError::FatalFunction crashFunction;
373 LLError::TimeFunction timeFunction;
374
375 Recorders recorders;
376 Recorder* fileRecorder;
377 Recorder* fixedBufferRecorder;
378 std::string fileRecorderFileName;
379
380 int shouldLogCallCounter;
381
382 static Settings& get();
383
384 static void reset();
385 static Settings* saveAndReset();
386 static void restore(Settings*);
387
388 private:
389 Settings()
390 : printLocation(false),
391 defaultLevel(LLError::LEVEL_DEBUG),
392 crashFunction(NULL),
393 timeFunction(NULL),
394 fileRecorder(NULL),
395 fixedBufferRecorder(NULL),
396 shouldLogCallCounter(0)
397 { }
398
399 static Settings*& getPtr();
400 };
401
402 Settings& Settings::get()
403 {
404 Settings* p = getPtr();
405 if (!p)
406 {
407 reset();
408 p = getPtr();
409 }
410 return *p;
411 }
412
413 void Settings::reset()
414 {
415 Globals::get().invalidateCallSites();
416
417 Settings*& p = getPtr();
418 delete p;
419 p = new Settings();
420 }
421
422 Settings* Settings::saveAndReset()
423 {
424 Globals::get().invalidateCallSites();
425
426 Settings*& p = getPtr();
427 Settings* originalSettings = p;
428 p = new Settings();
429 return originalSettings;
430 }
431
432 void Settings::restore(Settings* originalSettings)
433 {
434 Globals::get().invalidateCallSites();
435
436 Settings*& p = getPtr();
437 delete p;
438 p = originalSettings;
439 }
440
441 Settings*& Settings::getPtr()
442 {
443 static Settings* currentSettings = NULL;
444 return currentSettings;
445 }
53} 446}
54 447
448namespace LLError
449{
450 CallSite::CallSite(ELevel level,
451 const char* file, int line,
452 const std::type_info& class_info, const char* function)
453 : mLevel(level), mFile(file), mLine(line),
454 mClassInfo(class_info), mFunction(function),
455 mCached(false), mShouldLog(false)
456 { }
457
458
459 void CallSite::invalidate()
460 { mCached = false; }
461}
462
463namespace
464{
465 bool shouldLogToStderr()
466 {
467#if LL_DARWIN
468 // On Mac OS X, stderr from apps launched from the Finder goes to the
469 // console log. It's generally considered bad form to spam too much
470 // there.
471
472 // If stdin is a tty, assume the user launched from the command line and
473 // therefore wants to see stderr. Otherwise, assume we've been launched
474 // from the finder and shouldn't spam stderr.
475 return isatty(0);
476#else
477 return true;
478#endif
479 }
480
481 bool stderrLogWantsTime()
482 {
483#if LL_WINDOWS
484 return false;
485#else
486 return true;
487#endif
488 }
489
490
491 void commonInit(const std::string& dir)
492 {
493 LLError::Settings::reset();
494
495 LLError::setDefaultLevel(LLError::LEVEL_INFO);
496 LLError::setFatalFunction(LLError::crashAndLoop);
497 LLError::setTimeFunction(LLError::utcTime);
498
499 if (shouldLogToStderr())
500 {
501 LLError::addRecorder(new RecordToStderr(stderrLogWantsTime()));
502 }
503
504#if LL_WINDOWS
505 LLError::addRecorder(new RecordToWinDebug);
506#endif
55 507
56LLScopedErrorLevel::~LLScopedErrorLevel() 508 LogControlFile& e = LogControlFile::fromDirectory(dir);
509 e.addToEventTimer();
510 }
511}
512
513namespace LLError
57{ 514{
58 gErrorStream.setErrorLevel(mOrigErrorLevel); 515 void initForServer(const std::string& identity)
516 {
517 std::string dir = LLApp::instance()->getOption("configdir");
518 commonInit(dir);
519#if !LL_WINDOWS
520 addRecorder(new RecordToSyslog(identity));
521#endif
522 }
523
524 void initForApplication(const std::string& dir)
525 {
526 commonInit(dir);
527 }
528
529 void setPrintLocation(bool print)
530 {
531 Settings& s = Settings::get();
532 s.printLocation = print;
533 }
534
535 void setFatalFunction(FatalFunction f)
536 {
537 Settings& s = Settings::get();
538 s.crashFunction = f;
539 }
540
541 void setTimeFunction(TimeFunction f)
542 {
543 Settings& s = Settings::get();
544 s.timeFunction = f;
545 }
546
547 void setDefaultLevel(ELevel level)
548 {
549 Globals& g = Globals::get();
550 Settings& s = Settings::get();
551 g.invalidateCallSites();
552 s.defaultLevel = level;
553 }
554
555 void setFunctionLevel(const std::string& function_name, ELevel level)
556 {
557 Globals& g = Globals::get();
558 Settings& s = Settings::get();
559 g.invalidateCallSites();
560 s.functionLevelMap[function_name] = level;
561 }
562
563 void setClassLevel(const std::string& class_name, ELevel level)
564 {
565 Globals& g = Globals::get();
566 Settings& s = Settings::get();
567 g.invalidateCallSites();
568 s.classLevelMap[class_name] = level;
569 }
570
571 void setFileLevel(const std::string& file_name, ELevel level)
572 {
573 Globals& g = Globals::get();
574 Settings& s = Settings::get();
575 g.invalidateCallSites();
576 s.fileLevelMap[file_name] = level;
577 }
59} 578}
579
580namespace {
581 LLError::ELevel decodeLevel(std::string name)
582 {
583 static LevelMap level_names;
584 if (level_names.empty())
585 {
586 level_names["ALL"] = LLError::LEVEL_ALL;
587 level_names["DEBUG"] = LLError::LEVEL_DEBUG;
588 level_names["INFO"] = LLError::LEVEL_INFO;
589 level_names["WARN"] = LLError::LEVEL_WARN;
590 level_names["ERROR"] = LLError::LEVEL_ERROR;
591 level_names["NONE"] = LLError::LEVEL_NONE;
592 }
593
594 std::transform(name.begin(), name.end(), name.begin(), toupper);
595
596 LevelMap::const_iterator i = level_names.find(name);
597 if (i == level_names.end())
598 {
599 llwarns << "unrecognized logging level: '" << name << "'" << llendl;
600 return LLError::LEVEL_INFO;
601 }
602
603 return i->second;
604 }
605
606 void setLevels(LevelMap& map, const LLSD& list, LLError::ELevel level)
607 {
608 LLSD::array_const_iterator i, end;
609 for (i = list.beginArray(), end = list.endArray(); i != end; ++i)
610 {
611 map[*i] = level;
612 }
613 }
614}
615
616namespace LLError
617{
618 void configure(const LLSD& config)
619 {
620 Globals& g = Globals::get();
621 Settings& s = Settings::get();
622
623 g.invalidateCallSites();
624 s.functionLevelMap.clear();
625 s.classLevelMap.clear();
626 s.fileLevelMap.clear();
627
628 setPrintLocation(config["print-location"]);
629 setDefaultLevel(decodeLevel(config["default-level"]));
630
631 LLSD sets = config["settings"];
632 LLSD::array_const_iterator a, end;
633 for (a = sets.beginArray(), end = sets.endArray(); a != end; ++a)
634 {
635 const LLSD& entry = *a;
636
637 ELevel level = decodeLevel(entry["level"]);
638
639 setLevels(s.functionLevelMap, entry["functions"], level);
640 setLevels(s.classLevelMap, entry["classes"], level);
641 setLevels(s.fileLevelMap, entry["files"], level);
642 }
643 }
644}
645
646
647namespace LLError
648{
649 Recorder::~Recorder()
650 { }
651
652 // virtual
653 bool Recorder::wantsTime()
654 { return false; }
655
656
657
658 void addRecorder(Recorder* recorder)
659 {
660 if (recorder == NULL)
661 {
662 return;
663 }
664 Settings& s = Settings::get();
665 s.recorders.push_back(recorder);
666 }
667
668 void removeRecorder(Recorder* recorder)
669 {
670 if (recorder == NULL)
671 {
672 return;
673 }
674 Settings& s = Settings::get();
675 s.recorders.erase(
676 std::remove(s.recorders.begin(), s.recorders.end(), recorder),
677 s.recorders.end());
678 }
679}
680
681namespace LLError
682{
683 void logToFile(const std::string& file_name)
684 {
685 LLError::Settings& s = LLError::Settings::get();
686
687 removeRecorder(s.fileRecorder);
688 delete s.fileRecorder;
689 s.fileRecorder = NULL;
690 s.fileRecorderFileName.clear();
691
692 if (file_name.empty())
693 {
694 return;
695 }
696
697 RecordToFile* f = new RecordToFile(file_name);
698 if (!f->okay())
699 {
700 delete f;
701 return;
702 }
703
704 s.fileRecorderFileName = file_name;
705 s.fileRecorder = f;
706 addRecorder(f);
707 }
708
709 void logToFixedBuffer(LLFixedBuffer* fixedBuffer)
710 {
711 LLError::Settings& s = LLError::Settings::get();
712
713 removeRecorder(s.fixedBufferRecorder);
714 delete s.fixedBufferRecorder;
715 s.fixedBufferRecorder = NULL;
716
717 if (!fixedBuffer)
718 {
719 return;
720 }
721
722 s.fixedBufferRecorder = new RecordToFixedBuffer(*fixedBuffer);
723 addRecorder(s.fixedBufferRecorder);
724 }
725
726 std::string logFileName()
727 {
728 LLError::Settings& s = LLError::Settings::get();
729 return s.fileRecorderFileName;
730 }
731}
732
733namespace
734{
735 void writeToRecorders(LLError::ELevel level, const std::string& message)
736 {
737 LLError::Settings& s = LLError::Settings::get();
738
739 std::string messageWithTime;
740
741 for (Recorders::const_iterator i = s.recorders.begin();
742 i != s.recorders.end();
743 ++i)
744 {
745 LLError::Recorder* r = *i;
746
747 if (r->wantsTime() && s.timeFunction != NULL)
748 {
749 if (messageWithTime.empty())
750 {
751 messageWithTime = s.timeFunction() + " " + message;
752 }
753
754 r->recordMessage(level, messageWithTime);
755 }
756 else
757 {
758 r->recordMessage(level, message);
759 }
760 }
761 }
762}
763
764
765/*
766Recorder formats:
767
768$type = "ERROR" | "WARNING" | "ALERT" | "INFO" | "DEBUG"
769$loc = "$file($line)"
770$msg = "$loc : " if FATAL or printing loc
771 "" otherwise
772$msg += "$type: "
773$msg += contents of stringstream
774
775$time = "%Y-%m-%dT%H:%M:%SZ" if UTC
776 or "%Y-%m-%dT%H:%M:%S %Z" if local
777
778syslog: "$msg"
779file: "$time $msg\n"
780stderr: "$time $msg\n" except on windows, "$msg\n"
781fixedbuf: "$msg"
782winddebug: "$msg\n"
783
784Note: if FATAL, an additional line gets logged first, with $msg set to
785 "$loc : error"
786
787You get:
788 llfoo.cpp(42) : error
789 llfoo.cpp(42) : ERROR: something
790
791*/
792
793namespace {
794 bool checkLevelMap(const LevelMap& map, const std::string& key,
795 LLError::ELevel& level)
796 {
797 LevelMap::const_iterator i = map.find(key);
798 if (i == map.end())
799 {
800 return false;
801 }
802
803 level = i->second;
804 return true;
805 }
806
807 class LogLock
808 {
809 public:
810 LogLock();
811 ~LogLock();
812 bool ok() const { return mOK; }
813 private:
814 bool mLocked;
815 bool mOK;
816 };
817
818 LogLock::LogLock()
819 : mLocked(false), mOK(false)
820 {
821 if (!gLogMutexp)
822 {
823 mOK = true;
824 return;
825 }
826
827 const int MAX_RETRIES = 5;
828 for (int attempts = 0; attempts < MAX_RETRIES; ++attempts)
829 {
830 apr_status_t s = apr_thread_mutex_trylock(gLogMutexp);
831 if (!APR_STATUS_IS_EBUSY(s))
832 {
833 mLocked = true;
834 mOK = true;
835 return;
836 }
837
838 ms_sleep(1);
839 //apr_thread_yield();
840 // Just yielding won't necessarily work, I had problems with
841 // this on Linux - doug 12/02/04
842 }
843
844 // We're hosed, we can't get the mutex. Blah.
845 std::cerr << "LogLock::LogLock: failed to get mutex for log"
846 << std::endl;
847 }
848
849 LogLock::~LogLock()
850 {
851 if (mLocked)
852 {
853 apr_thread_mutex_unlock(gLogMutexp);
854 }
855 }
856}
857
858namespace LLError
859{
860 bool Log::shouldLog(CallSite& site)
861 {
862 LogLock lock;
863 if (!lock.ok())
864 {
865 return false;
866 }
867
868 Globals& g = Globals::get();
869 Settings& s = Settings::get();
870
871 s.shouldLogCallCounter += 1;
872
873 std::string class_name = className(site.mClassInfo);
874 std::string function_name = functionName(site.mFunction);
875 if (site.mClassInfo != typeid(NoClassInfo))
876 {
877 function_name = class_name + "::" + function_name;
878 }
879
880 ELevel compareLevel = s.defaultLevel;
881
882 checkLevelMap(s.functionLevelMap, function_name, compareLevel)
883 || checkLevelMap(s.classLevelMap, class_name, compareLevel)
884 || checkLevelMap(s.fileLevelMap, abbreviateFile(site.mFile), compareLevel);
885
886 site.mCached = true;
887 g.addCallSite(site);
888 return site.mShouldLog = site.mLevel >= compareLevel;
889 }
890
891
892 std::ostringstream* Log::out()
893 {
894 LogLock lock;
895 if (lock.ok())
896 {
897 Globals& g = Globals::get();
898
899 if (!g.messageStreamInUse)
900 {
901 g.messageStreamInUse = true;
902 return &g.messageStream;
903 }
904 }
905
906 return new std::ostringstream;
907 }
908
909 void Log::flush(std::ostringstream* out, const CallSite& site)
910 {
911 LogLock lock;
912 if (!lock.ok())
913 {
914 return;
915 }
916
917 Globals& g = Globals::get();
918 Settings& s = Settings::get();
919
920 std::string message = out->str();
921 if (out == &g.messageStream)
922 {
923 g.messageStream.clear();
924 g.messageStream.str("");
925 g.messageStreamInUse = false;
926 }
927 else
928 {
929 delete out;
930 }
931
932 if (site.mLevel == LEVEL_ERROR)
933 {
934 std::ostringstream fatalMessage;
935 fatalMessage << abbreviateFile(site.mFile)
936 << "(" << site.mLine << ") : error";
937
938 writeToRecorders(site.mLevel, fatalMessage.str());
939 }
940
941
942 std::ostringstream prefix;
943
944 switch (site.mLevel)
945 {
946 case LEVEL_DEBUG: prefix << "DEBUG: "; break;
947 case LEVEL_INFO: prefix << "INFO: "; break;
948 case LEVEL_WARN: prefix << "WARNING: "; break;
949 case LEVEL_ERROR: prefix << "ERROR: "; break;
950 default: prefix << "XXX: "; break;
951 };
952
953 if (s.printLocation)
954 {
955 prefix << abbreviateFile(site.mFile)
956 << "(" << site.mLine << ") : ";
957 }
958
959 if (message.find(functionName(site.mFunction)) == std::string::npos)
960 {
961 #if LL_WINDOWS
962 // DevStudio: __FUNCTION__ already includes the full class name
963 #else
964 if (site.mClassInfo != typeid(NoClassInfo))
965 {
966 prefix << className(site.mClassInfo) << "::";
967 }
968 #endif
969 prefix << site.mFunction << ": ";
970 }
971
972 prefix << message;
973 message = prefix.str();
974
975 writeToRecorders(site.mLevel, message);
976
977 if (site.mLevel == LEVEL_ERROR && s.crashFunction)
978 {
979 s.crashFunction(message);
980 }
981 }
982}
983
984
985
986
987namespace LLError
988{
989 Settings* saveAndResetSettings()
990 {
991 return Settings::saveAndReset();
992 }
993
994 void restoreSettings(Settings* s)
995 {
996 return Settings::restore(s);
997 }
998
999 std::string removePrefix(std::string& s, const std::string& p)
1000 {
1001 std::string::size_type where = s.find(p);
1002 if (where == std::string::npos)
1003 {
1004 return s;
1005 }
1006
1007 return std::string(s, where + p.size());
1008 }
1009
1010 void replaceChar(std::string& s, char old, char replacement)
1011 {
1012 std::string::size_type i = 0;
1013 std::string::size_type len = s.length();
1014 for ( ; i < len; i++ )
1015 {
1016 if (s[i] == old)
1017 {
1018 s[i] = replacement;
1019 }
1020 }
1021 }
1022
1023 std::string abbreviateFile(const std::string& filePath)
1024 {
1025 std::string f = filePath;
1026#if LL_WINDOWS
1027 replaceChar(f, '\\', '/');
1028#endif
1029 static std::string indra_prefix = "indra/";
1030 f = removePrefix(f, indra_prefix);
1031
1032#if LL_DARWIN
1033 static std::string newview_prefix = "newview/../";
1034 f = removePrefix(f, newview_prefix);
1035#endif
1036
1037 return f;
1038 }
1039
1040 int shouldLogCallCount()
1041 {
1042 Settings& s = Settings::get();
1043 return s.shouldLogCallCounter;
1044 }
1045
1046 void crashAndLoop(const std::string& message)
1047 {
1048 // Now, we go kaboom!
1049 int* crash = NULL;
1050
1051 *crash = 0;
1052
1053 while(true)
1054 {
1055 // Loop forever, in case the crash didn't work?
1056 }
1057 }
1058
1059 std::string utcTime()
1060 {
1061 time_t now = time(NULL);
1062 const size_t BUF_SIZE = 64;
1063 char time_str[BUF_SIZE]; /* Flawfinder: ignore */
1064
1065 int chars = strftime(time_str, BUF_SIZE,
1066 "%Y-%m-%dT%H:%M:%SZ",
1067 gmtime(&now));
1068
1069 return chars ? time_str : "time error";
1070 }
1071}
1072
diff --git a/linden/indra/llcommon/llerror.h b/linden/indra/llcommon/llerror.h
index 04e8eee..1285491 100644
--- a/linden/indra/llcommon/llerror.h
+++ b/linden/indra/llcommon/llerror.h
@@ -1,8 +1,9 @@
1/** 1/**
2 * @file llerror.h 2 * @file llerror.h
3 * @brief Constants, functions, and macros for logging and runtime errors. 3 * @date December 2006
4 * @brief error message system
4 * 5 *
5 * Copyright (c) 2001-2007, Linden Research, Inc. 6 * Copyright (c) 2006-2007, Linden Research, Inc.
6 * 7 *
7 * The source code in this file ("Source Code") is provided by Linden Lab 8 * The source code in this file ("Source Code") is provided by Linden Lab
8 * to you under the terms of the GNU General Public License, version 2.0 9 * to you under the terms of the GNU General Public License, version 2.0
@@ -29,209 +30,208 @@
29#define LL_LLERROR_H 30#define LL_LLERROR_H
30 31
31#include <sstream> 32#include <sstream>
32#include <stdio.h> 33#include <typeinfo>
33#include <stdarg.h> 34
34 35#include "llerrorlegacy.h"
35#include "llerrorstream.h" 36
36#include "llerrorbuffer.h" 37
37 38/* Error Logging Facility
38// Specific error codes 39
39const S32 LL_ERR_NOERR = 0; 40 Information for most users:
40const S32 LL_ERR_ASSET_REQUEST_FAILED = -1; 41
41//const S32 LL_ERR_ASSET_REQUEST_INVALID = -2; 42 Code can log messages with constuctions like this:
42const S32 LL_ERR_ASSET_REQUEST_NONEXISTENT_FILE = -3; 43
43const S32 LL_ERR_ASSET_REQUEST_NOT_IN_DATABASE = -4; 44 llinfos << "request to fizzbip agent " << agent_id
44const S32 LL_ERR_INSUFFICIENT_PERMISSIONS = -5; 45 << " denied due to timeout" << llendl;
45const S32 LL_ERR_EOF = -39; 46
46const S32 LL_ERR_CANNOT_OPEN_FILE = -42; 47 Messages can be logged to one of four increasing levels of concern,
47const S32 LL_ERR_FILE_NOT_FOUND = -43; 48 using one of four "streams":
48const S32 LL_ERR_FILE_EMPTY = -44; 49
49const S32 LL_ERR_TCP_TIMEOUT = -23016; 50 lldebugs - debug messages that are normally supressed
50const S32 LL_ERR_CIRCUIT_GONE = -23017; 51 llinfos - informational messages that are normall shown
51 52 llwarns - warning messages that singal a problem
52// Error types 53 llerrs - error messages that are major, unrecoverable failures
53 54
54#define LLERR_IMAGE (1 << 1) // Image requests 55 The later (llerrs) automatically crashes the process after the message
55#define LLERR_MESSAGE (1 << 2) // Messaging 56 is logged.
56#define LLERR_PERF (1 << 3) // Performance 57
57#define LLERR_SQL (1 << 4) // SQL statements 58 Note that these "streams" are actually #define magic. Rules for use:
58#define LLERR_DOUG (1 << 5) // Doug's debugging 59 * they cannot be used as normal streams, only to start a message
59#define LLERR_USER_INPUT (1 << 6) // Keyboard and mouse 60 * messages written to them MUST be terminated with llendl
60#define LLERR_TIMING (1 << 7) // Verbose time info 61 * between the opening and closing, the << operator is indeed
61#define LLERR_TASK (1 << 8) // Tracking tasks 62 writing onto a std::ostream, so all conversions and stream
62#define LLERR_MSG_HANDLER (1 << 9) // 63 formating are available
63#define LLERR_CIRCUIT_INFO (1 << 10) // Message system circuit info 64
64#define LLERR_PHYSICS (1 << 11) // physics 65 These messages are automatically logged with function name, and (if enabled)
65#define LLERR_VFS (1 << 12) // VFS 66 file and line of the message. (Note: Existing messages that already include
66const U32 LLERR_ALL = 0xffff; 67 the function name don't get name printed twice.)
67const U32 LLERR_NONE = 0x0; 68
68 69 If you have a class, adding LOG_CLASS line to the declaration will cause
69// Define one of these for different error levels in release... 70 all messages emitted from member functions (normal and static) to be tagged
70// #define RELEASE_SHOW_DEBUG // Define this if you want your release builds to show lldebug output. 71 with the proper class name as well as the function name:
71#define RELEASE_SHOW_INFO // Define this if you want your release builds to show llinfo output 72
72#define RELEASE_SHOW_WARN // Define this if you want your release builds to show llwarn output. 73 class LLFoo
73 74 {
74 75 LOG_CLASS(LLFoo);
75////////////////////////////////////////// 76 public:
76// 77 ...
77// Implementation - ignore 78 };
78// 79
79// 80 void LLFoo::doSomething(int i)
80#ifdef _DEBUG 81 {
81#define SHOW_DEBUG 82 if (i > 100)
82#define SHOW_WARN 83 {
83#define SHOW_INFO 84 llwanrs << "called with a big value for i: " << i << llendl;
84#define SHOW_ASSERT 85 }
85#else // _DEBUG 86 ...
86 87 }
87#ifdef RELEASE_SHOW_DEBUG 88
88#define SHOW_DEBUG 89 will result in messages like:
89#endif 90
90 91 WARN: LLFoo::doSomething: called with a big value for i: 283
91#ifdef RELEASE_SHOW_WARN 92
92#define SHOW_WARN 93 Which messages are logged and which are supressed can be controled at run
93#endif 94 time from the live file logcontrol.xml based on function, class and/or
94 95 source file. See etc/logcontrol-dev.xml for details.
95#ifdef RELEASE_SHOW_INFO 96
96#define SHOW_INFO 97 Lastly, logging is now very efficient in both compiled code and execution
97#endif 98 when skipped. There is no need to wrap messages, even debugging ones, in
98 99 #ifdef _DEBUG constructs. lldebugs messages are compiled into all builds,
99#ifdef RELEASE_SHOW_ASSERT 100 even release. Which means you can use them to help debug even when deployed
100#define SHOW_ASSERT 101 to a real grid.
101#endif 102*/
102 103
103#endif // _DEBUG 104namespace LLError
104
105
106extern LLErrorStream gErrorStream;
107
108
109// LL Error macros
110//
111// Usage:
112//
113// llerrs << "An error, oh my!" << variable << endl;
114// llwarns << "Another error, fuck me!" << variable << endl;
115// llwarnst(LLERR_IMAGE) << "Debug, mother fucker" << endl;
116//
117// NOTE: The output format of filename(lineno): is so that MS DevStudio
118// can parse the output and automatically jump to that location
119
120inline std::string llerrno_string(int errnum)
121{ 105{
122 std::stringstream res; 106 enum ELevel
123 res << "error(" << errnum << "):" << strerror(errnum) << " "; 107 {
124 return res.str(); 108 LEVEL_ALL = 0,
109 // used to indicate that all messagess should be logged
110
111 LEVEL_DEBUG = 0,
112 LEVEL_INFO = 1,
113 LEVEL_WARN = 2,
114 LEVEL_ERROR = 3, // used to be called FATAL
115
116 LEVEL_NONE = 4
117 // not really a level
118 // used to indicate that no messages should be logged
119 };
120
121 /* Macro support
122 The classes CallSite and Log are used by the logging macros below.
123 They are not intended for general use.
124 */
125
126 class CallSite;
127
128 class Log
129 {
130 public:
131 static bool shouldLog(CallSite&);
132 static std::ostringstream* out();
133 static void flush(std::ostringstream*, const CallSite&);
134 };
135
136 class CallSite
137 {
138 // Represents a specific place in the code where a message is logged
139 // This is public because it is used by the macros below. It is not
140 // intended for public use.
141 public:
142 CallSite(ELevel, const char* file, int line,
143 const std::type_info& class_info, const char* function);
144
145 bool shouldLog()
146 { return mCached ? mShouldLog : Log::shouldLog(*this); }
147 // this member function needs to be in-line for efficiency
148
149 void invalidate();
150
151 private:
152 // these describe the call site and never change
153 const ELevel mLevel;
154 const char* const mFile;
155 const int mLine;
156 const std::type_info& mClassInfo;
157 const char* const mFunction;
158
159 // these implement a cache of the call to shouldLog()
160 bool mCached;
161 bool mShouldLog;
162
163 friend class Log;
164 };
165
166
167 class End { };
168 inline std::ostream& operator<<(std::ostream& s, const End&)
169 { return s; }
170 // used to indicate the end of a message
171
172 class NoClassInfo { };
173 // used to indicate no class info known for logging
125} 174}
126 175
127inline std::string llerror_file_line(const char* file, S32 line)
128{
129 std::stringstream res;
130 res << file << "(" <<line << ")";
131 return res.str();
132}
133 176
134// Used to throw an error which is always causes a system halt.
135#define llerrs if (gErrorStream.isEnabledFor(LLErrorBuffer::FATAL)) \
136 { std::ostringstream llerror_oss; LLErrorBuffer::ELevel llerror_level = LLErrorBuffer::FATAL; \
137 llerror_oss << llerror_file_line(__FILE__, __LINE__) << " : error\n"; \
138 llerror_oss << "ERROR: " << llerror_file_line(__FILE__, __LINE__) << " "
139
140// Used to show warnings
141#define llwarns if (gErrorStream.isEnabledFor(LLErrorBuffer::WARN)) \
142 { std::ostringstream llerror_oss; LLErrorBuffer::ELevel llerror_level = LLErrorBuffer::WARN; \
143 if (gErrorStream.getPrintLocation()) llerror_oss << llerror_file_line(__FILE__, __LINE__) << " : WARNING: "; \
144 else llerror_oss << "WARNING: "; \
145 llerror_oss
146
147// Alerts are for serious non-fatal situations that are not supposed to happen and need to alert someone
148#define llalerts if (gErrorStream.isEnabledFor(LLErrorBuffer::WARN)) \
149 { std::ostringstream llerror_oss; LLErrorBuffer::ELevel llerror_level = LLErrorBuffer::WARN; \
150 if (gErrorStream.getPrintLocation()) llerror_oss << llerror_file_line(__FILE__, __LINE__) << " : ALERT: "; \
151 else llerror_oss << "ALERT: "; \
152 llerror_oss
153
154// Used to show informational messages that don't get disabled
155#define llinfos if (gErrorStream.isEnabledFor(LLErrorBuffer::INFO)) \
156 { std::ostringstream llerror_oss; LLErrorBuffer::ELevel llerror_level = LLErrorBuffer::INFO; \
157 if (gErrorStream.getPrintLocation()) llerror_oss << llerror_file_line(__FILE__, __LINE__) << " : INFO: "; \
158 else llerror_oss << "INFO: "; \
159 llerror_oss
160
161#define llinfost(type) if (gErrorStream.isEnabledFor(LLErrorBuffer::INFO, type)) \
162 { std::ostringstream llerror_oss; LLErrorBuffer::ELevel llerror_level = LLErrorBuffer::INFO; \
163 if (gErrorStream.getPrintLocation()) llerror_oss << llerror_file_line(__FILE__, __LINE__) << " : INFO: "; \
164 else llerror_oss << "INFO: [" << #type << "] "; \
165 llerror_oss
166
167// Used for general debugging output
168#define lldebugs if (gErrorStream.isEnabledFor(LLErrorBuffer::DEBUG)) \
169 { std::ostringstream llerror_oss; LLErrorBuffer::ELevel llerror_level = LLErrorBuffer::DEBUG; \
170 if (gErrorStream.getPrintLocation()) llerror_oss << llerror_file_line(__FILE__, __LINE__) << " : DEBUG: "; \
171 else llerror_oss << "DEBUG: "; \
172 llerror_oss
173
174#define lldebugst(type) if (gErrorStream.isEnabledFor(LLErrorBuffer::DEBUG, type)) \
175 { std::ostringstream llerror_oss; LLErrorBuffer::ELevel llerror_level = LLErrorBuffer::DEBUG; \
176 if (gErrorStream.getPrintLocation()) llerror_oss << llerror_file_line(__FILE__, __LINE__) << " : DEBUG: "; \
177 else llerror_oss << "DEBUG: [" << #type << "] "; \
178 llerror_oss
179
180#define llendl std::endl; gErrorStream.crashOnError(llerror_oss, llerror_level); }
181#define llendflush std::endl << std::flush; gErrorStream.crashOnError(llerror_oss, llerror_level); }
182#define llcont llerror_oss
183
184#define llerror(msg, num) llerrs << "Error # " << num << ": " << msg << llendl;
185
186#define llwarning(msg, num) llwarns << "Warning # " << num << ": " << msg << llendl;
187
188#ifdef SHOW_ASSERT
189#define llassert(func) if (!(func)) llerrs << "ASSERT (" << #func << ")" << llendl;
190#else
191#define llassert(func)
192#endif
193#define llassert_always(func) if (!(func)) llerrs << "ASSERT (" << #func << ")" << llendl;
194
195#ifdef SHOW_ASSERT
196#define llverify(func) if (!(func)) llerrs << "ASSERT (" << #func << ")" << llendl;
197#else
198#define llverify(func) (func); // get rid of warning C4189
199#endif
200
201// handy compile-time assert - enforce those template parameters!
202#define cassert(expn) typedef char __C_ASSERT__[(expn)?1:-1]
203
204// Makes the app go down in flames, but on purpose!
205void _llcrash_and_loop();
206
207// Use as follows:
208// llinfos << llformat("Test:%d (%.2f %.2f)", idx, x, y) << llendl;
209//
210// *NOTE: buffer limited to 1024, (but vsnprintf prevents overrun)
211// should perhaps be replaced with boost::format.
212inline std::string llformat(const char *fmt, ...)
213{
214 char tstr[1024]; /* Flawfinder: ignore */
215 va_list va;
216 va_start(va, fmt);
217#if LL_WINDOWS
218 _vsnprintf(tstr, 1024, fmt, va);
219#else
220 vsnprintf(tstr, 1024, fmt, va); /* Flawfinder: ignore */
221#endif
222 va_end(va);
223 return std::string(tstr);
224}
225 177
226// Helper class to temporarily change error level for the current scope. 178/*
227class LLScopedErrorLevel 179 Class type information for logging
228{ 180 */
229public: 181
230 LLScopedErrorLevel(LLErrorBuffer::ELevel error_level); 182#define LOG_CLASS(s) typedef s _LL_CLASS_TO_LOG
231 ~LLScopedErrorLevel(); 183 // Declares class to tag logged messages with.
232 184 // See top of file for example of how to use this
233private: 185
234 LLErrorBuffer::ELevel mOrigErrorLevel; 186typedef LLError::NoClassInfo _LL_CLASS_TO_LOG;
235}; 187 // Outside a class declartion, or in class without LOG_CLASS(), this
236 188 // typedef causes the messages to not be associated with any class.
189
190
191
192
193
194/*
195 Error Logging Macros
196 See top of file for common usage.
197*/
198
199#define lllog(level) \
200 { \
201 static LLError::CallSite _site( \
202 level, __FILE__, __LINE__, typeid(_LL_CLASS_TO_LOG), __FUNCTION__);\
203 if (_site.shouldLog()) \
204 { \
205 std::ostringstream* _out = LLError::Log::out(); \
206 (*_out)
207
208#define llendl \
209 LLError::End(); \
210 LLError::Log::flush(_out, _site); \
211 } \
212 }
213
214#define llinfos lllog(LLError::LEVEL_INFO)
215#define lldebugs lllog(LLError::LEVEL_DEBUG)
216#define llwarns lllog(LLError::LEVEL_WARN)
217#define llerrs lllog(LLError::LEVEL_ERROR)
218
219#define llcont (*_out)
220 /*
221 Use this construct if you need to do computation in the middle of a
222 message:
223
224 llinfos << "the agent " << agend_id;
225 switch (f)
226 {
227 case FOP_SHRUGS: llcont << "shrugs"; break;
228 case FOP_TAPS: llcont << "points at " << who; break;
229 case FOP_SAYS: llcont << "says " << message; break;
230 }
231 llcont << " for " << t << " seconds" << llendl;
232
233 Such computation is done iff the message will be logged.
234 */
235
236
237#endif // LL_LLERROR_H 237#endif // LL_LLERROR_H
diff --git a/linden/indra/llcommon/llerrorbuffer.cpp b/linden/indra/llcommon/llerrorbuffer.cpp
deleted file mode 100644
index 9de4616..0000000
--- a/linden/indra/llcommon/llerrorbuffer.cpp
+++ /dev/null
@@ -1,279 +0,0 @@
1/**
2 * @file llerrorbuffer.cpp
3 *
4 * Copyright (c) 2002-2007, Linden Research, Inc.
5 *
6 * The source code in this file ("Source Code") is provided by Linden Lab
7 * to you under the terms of the GNU General Public License, version 2.0
8 * ("GPL"), unless you have obtained a separate licensing agreement
9 * ("Other License"), formally executed by you and Linden Lab. Terms of
10 * the GPL can be found in doc/GPL-license.txt in this distribution, or
11 * online at http://secondlife.com/developers/opensource/gplv2
12 *
13 * There are special exceptions to the terms and conditions of the GPL as
14 * it is applied to this Source Code. View the full text of the exception
15 * in the file doc/FLOSS-exception.txt in this software distribution, or
16 * online at http://secondlife.com/developers/opensource/flossexception
17 *
18 * By copying, modifying or distributing this software, you acknowledge
19 * that you have read and understood your obligations described above,
20 * and agree to abide by those obligations.
21 *
22 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
23 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
24 * COMPLETENESS OR PERFORMANCE.
25 */
26
27#include "linden_common.h"
28
29#include "llerrorbuffer.h"
30#include "llfixedbuffer.h"
31
32#include <fstream>
33#include <string.h>
34
35#if LL_WINDOWS
36# define WIN32_LEAN_AND_MEAN
37# include <winsock2.h>
38# include <windows.h> // for OutputDebugString
39#else
40# include <syslog.h>
41# include <stdio.h>
42#endif
43
44#include <time.h>
45
46// In order to compile in Visual C++ 6.0, you must use std:: in the header, and then
47// use the std namespace in the cpp. Otherwise, you'll break the (very) fragile C++ parser.
48using namespace std;
49
50LLErrorBuffer::LLErrorBuffer()
51: streambuf(),
52 mFile(NULL),
53 mBuf(),
54 mFixedBuf(NULL),
55 mErrorActive(TRUE),
56 mErrorTimestamp(TRUE),
57 mFileActive(FALSE),
58 mSyslogActive(TRUE),
59 mWinDebugActive(TRUE),
60 mElevatedRemote(FALSE),
61 mIsUTC(TRUE),
62 mLevel(DEBUG),
63 mPriority(DEBUG)
64{
65 mFilename[0] = '\0';
66#if LL_WINDOWS
67 // by default, turn off timestamps in the debug log on windows
68 mErrorTimestamp = FALSE;
69#endif
70}
71
72LLErrorBuffer::~LLErrorBuffer()
73{
74 delete mFile;
75 mFile = NULL;
76}
77
78#if !LL_WINDOWS
79int LLErrorBuffer::ELevelToSyslogPriority(const ELevel l)
80{
81 switch(l)
82 {
83 case DEBUG:
84 return LOG_DEBUG;
85 case INFO:
86 switch(mElevatedRemote)
87 {
88 case TRUE: return LOG_NOTICE;
89 default: return LOG_INFO;
90 }
91 case WARN:
92 return LOG_WARNING;
93 case FATAL:
94 return LOG_CRIT;
95 default:
96 return LOG_CRIT;
97 }
98 return LOG_CRIT;
99}
100#endif // LL_WINDOWS
101
102BOOL LLErrorBuffer::setFile(const char *filename)
103{
104 if (mFile == NULL)
105 {
106 mFile = new llofstream();
107 }
108 if (mFile->is_open())
109 {
110 mFile->close();
111 }
112 if (filename == NULL)
113 {
114 llwarns << "Input filename is NULL!!" << llendl;
115 return FALSE;
116 }
117 mFile->open(filename, llofstream::out | llofstream::app); /* Flawfinder: ignore */
118 if (mFile->is_open())
119 {
120 mFileActive = TRUE;
121 }
122 else
123 {
124 mFileActive = FALSE;
125 delete mFile;
126 mFile = NULL;
127 }
128 snprintf(mFilename, sizeof(mFilename), filename); /* Flawfinder: ignore */
129 return mFileActive;
130}
131
132void LLErrorBuffer::closeFile()
133{
134 if (mFile && mFile->is_open())
135 {
136 mFile->close();
137 mFileActive = FALSE;
138 delete mFile;
139 mFile = NULL;
140 }
141}
142
143const char * LLErrorBuffer::getFilename() const
144{
145 return mFilename;
146}
147
148void LLErrorBuffer::setUTCTimestamp(BOOL utc)
149{
150 mIsUTC = utc;
151}
152
153void LLErrorBuffer::enableError(BOOL active)
154{
155 mErrorActive = active;
156}
157
158void LLErrorBuffer::enableErrorTimestamp(BOOL active)
159{
160 mErrorTimestamp = active;
161}
162
163void LLErrorBuffer::enableFile(BOOL active)
164{
165 if (mFile != NULL)
166 {
167 if (mFile->is_open())
168 mFileActive = active;
169 }
170 else
171 mFileActive = FALSE;
172}
173
174#if !LL_WINDOWS
175void LLErrorBuffer::enableSyslog(BOOL active)
176{
177 mSyslogActive = active;
178}
179#endif // LL_WINDOWS
180
181#if LL_WINDOWS
182void LLErrorBuffer::enableWinDebug(BOOL active)
183{
184 mWinDebugActive = active;
185}
186#endif // LL_WINDOWS
187
188int LLErrorBuffer::overflow(int c)
189{
190 if (EOF != c)
191 {
192 if ('\n' == c)
193 {
194 // If we're not supposed to print anything, don't, but
195 // pretend that we did so taht the iostream doesn't think
196 // there's been a failure
197 if (mPriority < mLevel)
198 {
199 // Flush our message buffer
200 mBuf = "";
201 return 0;
202 }
203#if !LL_WINDOWS
204 if (mSyslogActive)
205 {
206 int pri = ELevelToSyslogPriority(mPriority);
207 syslog(pri, "%s", mBuf.c_str());
208 }
209#endif // LL_WINDOWS
210 const S32 BUF_SIZE = 64;
211 char time_str[BUF_SIZE]; /* Flawfinder: ignore */
212 if (mFileActive || mErrorActive)
213 {
214 time_t now;
215 time(&now);
216 S32 chars;
217 if(mIsUTC)
218 {
219 chars = (S32)strftime(time_str, BUF_SIZE,
220 "%Y-%m-%dT%H:%M:%SZ",
221 gmtime(&now));
222 }
223 else
224 {
225 chars = (S32)strftime(time_str, BUF_SIZE,
226 "%Y-%m-%dT%H:%M:%S %Z",
227 localtime(&now));
228 }
229 if (0 == chars)
230 {
231 strcpy(time_str, "time error"); /* Flawfinder: ignore */
232 }
233 }
234 if (mFileActive)
235 {
236 *mFile << time_str << " " << mBuf << std::endl;
237 }
238 if (mErrorActive)
239 {
240 if (mErrorTimestamp)
241 {
242 fprintf(stderr, "%s %s\n", time_str, mBuf.c_str());
243 }
244 else
245 {
246 fprintf(stderr, "%s\n", mBuf.c_str());
247 }
248
249 // std::cerr goes into the void on the viewer
250 //std::cerr << time_str << ' ' << mBuf << std::endl;
251 }
252 if (mFixedBuf)
253 {
254 mFixedBuf->addLine(mBuf.c_str());
255 }
256#if LL_WINDOWS
257 if (mWinDebugActive)
258 {
259 llutf16string utf16str = wstring_to_utf16str(utf8str_to_wstring(mBuf));
260 utf16str += '\n';
261 OutputDebugString(utf16str.c_str());
262 }
263#endif // LL_WINDOWS
264 // Is there a better way to truncate a string?
265 mBuf.erase(0, mBuf.length()); // Hack, Linux doesn't implement clear()!
266 }
267 else
268 {
269 mBuf += c;
270 }
271 }
272 return 0;
273}
274
275LLErrorBuffer::ELevel LLErrorBuffer::mergeLevel(const LLErrorBuffer::ELevel l)
276{
277 mLevel = llmin(mLevel, l);
278 return mLevel;
279}
diff --git a/linden/indra/llcommon/llerrorbuffer.h b/linden/indra/llcommon/llerrorbuffer.h
deleted file mode 100644
index b52de3a..0000000
--- a/linden/indra/llcommon/llerrorbuffer.h
+++ /dev/null
@@ -1,117 +0,0 @@
1/**
2 * @file llerrorbuffer.h
3 * @brief Buffer implementation for logging.
4 *
5 * Copyright (c) 2002-2007, Linden Research, Inc.
6 *
7 * The source code in this file ("Source Code") is provided by Linden Lab
8 * to you under the terms of the GNU General Public License, version 2.0
9 * ("GPL"), unless you have obtained a separate licensing agreement
10 * ("Other License"), formally executed by you and Linden Lab. Terms of
11 * the GPL can be found in doc/GPL-license.txt in this distribution, or
12 * online at http://secondlife.com/developers/opensource/gplv2
13 *
14 * There are special exceptions to the terms and conditions of the GPL as
15 * it is applied to this Source Code. View the full text of the exception
16 * in the file doc/FLOSS-exception.txt in this software distribution, or
17 * online at http://secondlife.com/developers/opensource/flossexception
18 *
19 * By copying, modifying or distributing this software, you acknowledge
20 * that you have read and understood your obligations described above,
21 * and agree to abide by those obligations.
22 *
23 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
24 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
25 * COMPLETENESS OR PERFORMANCE.
26 */
27
28#ifndef LL_LLERRORBUFFER_H
29#define LL_LLERRORBUFFER_H
30
31#include <fstream>
32#include <iostream>
33#include <string>
34
35#include "lldefs.h"
36#include "stdtypes.h"
37#include "llfile.h"
38
39// A streambuf that sends it's output into a file, stderr, or syslog.
40//
41// Each output can be enabled/disabled, and a priority can be set.
42
43class LLFixedBuffer;
44
45class LLErrorBuffer : public std::streambuf
46{
47 public:
48
49 // Specify error levels
50 enum ELevel
51 {
52 DEBUG = 0,
53 INFO = 1,
54 WARN = 2,
55 FATAL = 3,
56 NONE = 4 // Do NO error logging (for use in signal handlers)
57 };
58
59 LLErrorBuffer();
60 ~LLErrorBuffer();
61 BOOL setFile(const char *filename);
62 void closeFile();
63 const char *getFilename() const;
64 void setFixedBuffer(LLFixedBuffer *b) { mFixedBuf = b; };
65
66 // Sets the priority of the current message
67 void setPriority(const ELevel l) { mPriority = l; }
68
69 // Only display messages >= to this level
70 void setLevel(const ELevel l) { mLevel = l; }
71 ELevel getLevel() { return mLevel; }
72 // Display messages >= to level l, if l < current level
73 ELevel mergeLevel(const ELevel l);
74
75 // on linux, this sets syslog info to be a LOG_NOTICE which will
76 // be centrally logged. *NOTE: This is very
77 // linux/syslog/configuration dependent.
78 void setElevatedRemote(BOOL b) { mElevatedRemote = b; }
79
80 // logs are in utc rather than local
81 void setUTCTimestamp(BOOL utc);
82
83 // Turn on or off logging outputs
84 void enableError(BOOL active);
85 void enableErrorTimestamp(BOOL active);
86 void enableFile(BOOL active);
87 void enableSyslog(BOOL active);
88#if LL_WINDOWS
89 void enableWinDebug(BOOL active);
90#endif // LL_WINDOWS
91
92 protected:
93 int overflow(int c = EOF);
94
95 private:
96 char mFilename[LL_MAX_PATH]; /* Flawfinder: ignore */
97 int ELevelToSyslogPriority(const ELevel l);
98
99 llofstream *mFile;
100 std::string mBuf;
101 LLFixedBuffer *mFixedBuf;
102
103 BOOL mErrorActive;
104 BOOL mErrorTimestamp;
105 BOOL mFileActive;
106 BOOL mSyslogActive;
107 BOOL mWinDebugActive;
108 BOOL mElevatedRemote;
109 BOOL mIsUTC;
110
111 // If priority < level, output is thrown away
112 ELevel mLevel;
113 // Current message priority
114 ELevel mPriority;
115};
116
117#endif // LL_LLERRORBUFFER_H
diff --git a/linden/indra/llcommon/llerrorcontrol.h b/linden/indra/llcommon/llerrorcontrol.h
new file mode 100644
index 0000000..f2c8755
--- /dev/null
+++ b/linden/indra/llcommon/llerrorcontrol.h
@@ -0,0 +1,142 @@
1/**
2 * @file llerrorcontrol.h
3 * @date December 2006
4 * @brief error message system control
5 *
6 * Copyright (c) 2007-2007, Linden Research, Inc.
7 *
8 * The source code in this file ("Source Code") is provided by Linden Lab
9 * to you under the terms of the GNU General Public License, version 2.0
10 * ("GPL"), unless you have obtained a separate licensing agreement
11 * ("Other License"), formally executed by you and Linden Lab. Terms of
12 * the GPL can be found in doc/GPL-license.txt in this distribution, or
13 * online at http://secondlife.com/developers/opensource/gplv2
14 *
15 * There are special exceptions to the terms and conditions of the GPL as
16 * it is applied to this Source Code. View the full text of the exception
17 * in the file doc/FLOSS-exception.txt in this software distribution, or
18 * online at http://secondlife.com/developers/opensource/flossexception
19 *
20 * By copying, modifying or distributing this software, you acknowledge
21 * that you have read and understood your obligations described above,
22 * and agree to abide by those obligations.
23 *
24 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
25 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
26 * COMPLETENESS OR PERFORMANCE.
27 */
28
29#ifndef LL_LLERRORCONTROL_H
30#define LL_LLERRORCONTROL_H
31
32#include "llerror.h"
33
34#include <string>
35
36class LLFixedBuffer;
37class LLSD;
38
39/*
40 This is the part of the LLError namespace that manages the messages
41 produced by the logging. The logging support is defined in llerror.h.
42 Most files do not need to include this.
43
44 These implementations are in llerror.cpp.
45*/
46
47
48namespace LLError
49{
50 void initForServer(const std::string& identity);
51 // resets all logging settings to defaults needed by server processes
52 // logs to stderr, syslog, and windows debug log
53 // the identity string is used for in the syslog
54
55 void initForApplication(const std::string& dir);
56 // resets all logging settings to defaults needed by applicaitons
57 // logs to stderr and windows debug log
58 // sets up log configuration from the file logcontrol.xml in dir
59
60
61 /*
62 Settings that control what is logged.
63 Setting a level means log messages at that level or above.
64 */
65
66 void setPrintLocation(bool);
67 void setDefaultLevel(LLError::ELevel);
68 void setFunctionLevel(const std::string& function_name, LLError::ELevel);
69 void setClassLevel(const std::string& class_name, LLError::ELevel);
70 void setFileLevel(const std::string& file_name, LLError::ELevel);
71
72 void configure(const LLSD&);
73 // the LLSD can configure all of the settings
74 // usually read automatically from the live errorlog.xml file
75
76
77 /*
78 Control functions.
79 */
80
81 typedef void (*FatalFunction)(const std::string& message);
82 void crashAndLoop(const std::string& message);
83 // Default fatal funtion: divides by zero and loops forever
84
85 void setFatalFunction(FatalFunction);
86 // The fatal function will be called when an message of LEVEL_ERROR
87 // is logged. Note: supressing a LEVEL_ERROR message from being logged
88 // (by, for example, setting a class level to LEVEL_NONE), will keep
89 // the that message from causing the fatal funciton to be invoked.
90
91 typedef std::string (*TimeFunction)();
92 std::string utcTime();
93
94 void setTimeFunction(TimeFunction);
95 // The function is use to return the current time, formatted for
96 // display by those error recorders that want the time included.
97
98
99
100 class Recorder
101 {
102 // An object that handles the actual output or error messages.
103 public:
104 virtual ~Recorder();
105
106 virtual void recordMessage(LLError::ELevel, const std::string& message) = 0;
107 // use the level for better display, not for filtering
108
109 virtual bool wantsTime(); // default returns false
110 // override and return true if the recorder wants the time string
111 // included in the text of the message
112 };
113
114 void addRecorder(Recorder*);
115 void removeRecorder(Recorder*);
116 // each error message is passed to each recorder via recordMessage()
117
118 void logToFile(const std::string& filename);
119 void logToFixedBuffer(LLFixedBuffer*);
120 // Utilities to add recorders for logging to a file or a fixed buffer
121 // A second call to the same function will remove the logger added
122 // with the first.
123 // Passing the empty string or NULL to just removes any prior.
124 std::string logFileName();
125 // returns name of current logging file, empty string if none
126
127
128 /*
129 Utilities for use by the unit tests of LLError itself.
130 */
131
132 class Settings;
133 Settings* saveAndResetSettings();
134 void restoreSettings(Settings *);
135
136 std::string abbreviateFile(const std::string& filePath);
137 int shouldLogCallCount();
138
139};
140
141#endif // LL_LLERRORCONTROL_H
142
diff --git a/linden/indra/llcommon/llerrorlegacy.h b/linden/indra/llcommon/llerrorlegacy.h
new file mode 100644
index 0000000..5438a21
--- /dev/null
+++ b/linden/indra/llcommon/llerrorlegacy.h
@@ -0,0 +1,117 @@
1/**
2 * @file llerrorlegacy.h
3 * @date January 2007
4 * @brief old things from the older error system
5 *
6 * Copyright (c) 2007-2007, Linden Research, Inc.
7 *
8 * The source code in this file ("Source Code") is provided by Linden Lab
9 * to you under the terms of the GNU General Public License, version 2.0
10 * ("GPL"), unless you have obtained a separate licensing agreement
11 * ("Other License"), formally executed by you and Linden Lab. Terms of
12 * the GPL can be found in doc/GPL-license.txt in this distribution, or
13 * online at http://secondlife.com/developers/opensource/gplv2
14 *
15 * There are special exceptions to the terms and conditions of the GPL as
16 * it is applied to this Source Code. View the full text of the exception
17 * in the file doc/FLOSS-exception.txt in this software distribution, or
18 * online at http://secondlife.com/developers/opensource/flossexception
19 *
20 * By copying, modifying or distributing this software, you acknowledge
21 * that you have read and understood your obligations described above,
22 * and agree to abide by those obligations.
23 *
24 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
25 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
26 * COMPLETENESS OR PERFORMANCE.
27 */
28
29#ifndef LL_LLERRORLEGACY_H
30#define LL_LLERRORLEGACY_H
31
32
33
34/*
35 LEGACY -- DO NOT USE THIS STUFF ANYMORE
36*/
37
38// Specific error codes
39const int LL_ERR_NOERR = 0;
40const int LL_ERR_ASSET_REQUEST_FAILED = -1;
41//const int LL_ERR_ASSET_REQUEST_INVALID = -2;
42const int LL_ERR_ASSET_REQUEST_NONEXISTENT_FILE = -3;
43const int LL_ERR_ASSET_REQUEST_NOT_IN_DATABASE = -4;
44const int LL_ERR_INSUFFICIENT_PERMISSIONS = -5;
45const int LL_ERR_EOF = -39;
46const int LL_ERR_CANNOT_OPEN_FILE = -42;
47const int LL_ERR_FILE_NOT_FOUND = -43;
48const int LL_ERR_FILE_EMPTY = -44;
49const int LL_ERR_TCP_TIMEOUT = -23016;
50const int LL_ERR_CIRCUIT_GONE = -23017;
51
52
53
54// Define one of these for different error levels in release...
55// #define RELEASE_SHOW_DEBUG // Define this if you want your release builds to show lldebug output.
56#define RELEASE_SHOW_INFO // Define this if you want your release builds to show llinfo output
57#define RELEASE_SHOW_WARN // Define this if you want your release builds to show llwarn output.
58
59
60//////////////////////////////////////////
61//
62// Implementation - ignore
63//
64//
65#ifdef _DEBUG
66#define SHOW_DEBUG
67#define SHOW_WARN
68#define SHOW_INFO
69#define SHOW_ASSERT
70#else // _DEBUG
71
72#ifdef RELEASE_SHOW_DEBUG
73#define SHOW_DEBUG
74#endif
75
76#ifdef RELEASE_SHOW_WARN
77#define SHOW_WARN
78#endif
79
80#ifdef RELEASE_SHOW_INFO
81#define SHOW_INFO
82#endif
83
84#ifdef RELEASE_SHOW_ASSERT
85#define SHOW_ASSERT
86#endif
87
88#endif // _DEBUG
89
90
91
92#define lldebugst(type) lldebugs
93#define llendflush llendl
94
95
96#define llerror(msg, num) llerrs << "Error # " << num << ": " << msg << llendl;
97
98#define llwarning(msg, num) llwarns << "Warning # " << num << ": " << msg << llendl;
99
100#ifdef SHOW_ASSERT
101#define llassert(func) if (!(func)) llerrs << "ASSERT (" << #func << ")" << llendl;
102#else
103#define llassert(func)
104#endif
105#define llassert_always(func) if (!(func)) llerrs << "ASSERT (" << #func << ")" << llendl;
106
107#ifdef SHOW_ASSERT
108#define llverify(func) if (!(func)) llerrs << "ASSERT (" << #func << ")" << llendl;
109#else
110#define llverify(func) (func); // get rid of warning C4189
111#endif
112
113// handy compile-time assert - enforce those template parameters!
114#define cassert(expn) typedef char __C_ASSERT__[(expn)?1:-1] /* Flawfinder: ignore */
115 //XXX: used in two places in llcommon/llskipmap.h
116
117#endif // LL_LLERRORLEGACY_H
diff --git a/linden/indra/llcommon/llerrorstream.cpp b/linden/indra/llcommon/llerrorstream.cpp
deleted file mode 100644
index ed54d88..0000000
--- a/linden/indra/llcommon/llerrorstream.cpp
+++ /dev/null
@@ -1,188 +0,0 @@
1/**
2 * @file llerrorstream.cpp
3 * @brief Implementation of c++ log straming.
4 *
5 * Copyright (c) 2002-2007, Linden Research, Inc.
6 *
7 * The source code in this file ("Source Code") is provided by Linden Lab
8 * to you under the terms of the GNU General Public License, version 2.0
9 * ("GPL"), unless you have obtained a separate licensing agreement
10 * ("Other License"), formally executed by you and Linden Lab. Terms of
11 * the GPL can be found in doc/GPL-license.txt in this distribution, or
12 * online at http://secondlife.com/developers/opensource/gplv2
13 *
14 * There are special exceptions to the terms and conditions of the GPL as
15 * it is applied to this Source Code. View the full text of the exception
16 * in the file doc/FLOSS-exception.txt in this software distribution, or
17 * online at http://secondlife.com/developers/opensource/flossexception
18 *
19 * By copying, modifying or distributing this software, you acknowledge
20 * that you have read and understood your obligations described above,
21 * and agree to abide by those obligations.
22 *
23 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
24 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
25 * COMPLETENESS OR PERFORMANCE.
26 */
27
28#include "linden_common.h"
29
30#include "llerrorstream.h"
31#include "llerrorbuffer.h"
32#include "llerror.h"
33
34using namespace std;
35
36// Define this if we're using APR mutexes.
37#include "llapr.h"
38extern apr_thread_mutex_t *gLogMutexp;
39
40// In order to compile in Visual C++ 6.0, you must use std:: in the header, and then
41// use the std namespace in the cpp. Otherwise, you'll break the (very) fragile C++ parser.
42LLErrorStream::LLErrorStream(LLErrorBuffer *eb):
43 ostream(eb),
44 mErrorBuffer(eb),
45 mKill(FALSE),
46 mErrorCallback(NULL)
47{
48#ifdef SHOW_DEBUG
49 setErrorLevel(LLErrorBuffer::DEBUG);
50#else
51#ifdef SHOW_INFO
52 setErrorLevel(LLErrorBuffer::INFO);
53#else
54#ifdef SHOW_WARN
55 setErrorLevel(LLErrorBuffer::WARN);
56#else
57 setErrorLevel(LLErrorBuffer::FATAL);
58#endif // SHOW_WARN
59#endif // SHOW_INFO
60#endif // SHOW_DEBUG
61
62 setDebugMask(LLERR_NONE);
63 setPrintLocation(FALSE);
64}
65
66LLErrorBuffer::ELevel LLErrorStream::ELevelToBufferELevel(const ELevel l)
67{
68 switch (l)
69 {
70 case DEBUG:
71 return LLErrorBuffer::DEBUG;
72 case INFO:
73 return LLErrorBuffer::INFO;
74 case WARN:
75 return LLErrorBuffer::WARN;
76 case FATAL:
77 return LLErrorBuffer::FATAL;
78 default:
79 return LLErrorBuffer::FATAL;
80 }
81}
82
83LLErrorStream::ELevel LLErrorStream::BufferELevelToELevel(const LLErrorBuffer::ELevel l)
84{
85 switch(l)
86 {
87 case LLErrorBuffer::DEBUG:
88 return DEBUG;
89 case LLErrorBuffer::INFO:
90 return INFO;
91 case LLErrorBuffer::WARN:
92 return WARN;
93 case LLErrorBuffer::FATAL:
94 return FATAL;
95 default:
96 return FATAL;
97 }
98}
99
100
101BOOL LLErrorStream::isEnabledFor(const LLErrorBuffer::ELevel l)
102{
103 if (l == LLErrorBuffer::FATAL)
104 {
105 if (LLErrorBuffer::FATAL < getErrorLevel())
106 {
107 // Fatal error, but we're at log level NONE (used by signal handlers)
108 // We want to crash this process now instead of logging
109 _llcrash_and_loop();
110 }
111 }
112 // Always returns false if not safe (recursive call)
113 return (getErrorLevel() <= l);
114}
115
116
117BOOL LLErrorStream::isEnabledFor(const LLErrorBuffer::ELevel l, const U32 type)
118{
119 // Always returns false if not safe (recursive call)
120 return (getErrorLevel() <= l) && (mDebugMask & type);
121}
122
123
124
125void LLErrorStream::crashOnError(std::ostringstream &oss, LLErrorBuffer::ELevel l)
126{
127 if (gLogMutexp)
128 {
129 const S32 MAX_RETRIES = 5;
130 S32 attempts = 0;
131 while (attempts < MAX_RETRIES)
132 {
133 apr_status_t s = apr_thread_mutex_trylock(gLogMutexp);
134 if (!APR_STATUS_IS_EBUSY(s))
135 {
136 break;
137 }
138 else
139 {
140 attempts++;
141 ms_sleep(1);
142
143 //
144 // Just yielding won't necessarily work, I had problems with this on Linux - doug 12/02/04
145 //apr_thread_yield();
146 }
147 }
148 if (attempts == MAX_RETRIES)
149 {
150 // We're hosed, we can't get the mutex.
151 // I guess we just won't log, then. Blah.
152 fprintf(stderr, "LLErrorStream::crashOnError() failed to get mutex for log\n");
153 return;
154 }
155 }
156
157 mErrorBuffer->setPriority(l);
158 if (LLErrorBuffer::FATAL == l)
159 {
160 setError();
161 }
162
163 *this << oss.str();
164
165 if (mKill)
166 {
167 // We want to flush this stream.
168 flush();
169 }
170
171 BOOL crashme = FALSE;
172 if (mKill)
173 {
174 crashme = TRUE;
175 }
176 mKill = FALSE;
177
178 if (gLogMutexp)
179 {
180 apr_thread_mutex_unlock(gLogMutexp);
181 }
182
183 if (crashme)
184 {
185 mErrorCallback(oss.str());
186 _llcrash_and_loop();
187 }
188}
diff --git a/linden/indra/llcommon/llerrorstream.h b/linden/indra/llcommon/llerrorstream.h
deleted file mode 100644
index 4028583..0000000
--- a/linden/indra/llcommon/llerrorstream.h
+++ /dev/null
@@ -1,126 +0,0 @@
1/**
2 * @file llerrorstream.h
3 * @brief Declaration of c++ log straming.
4 *
5 * Copyright (c) 2002-2007, Linden Research, Inc.
6 *
7 * The source code in this file ("Source Code") is provided by Linden Lab
8 * to you under the terms of the GNU General Public License, version 2.0
9 * ("GPL"), unless you have obtained a separate licensing agreement
10 * ("Other License"), formally executed by you and Linden Lab. Terms of
11 * the GPL can be found in doc/GPL-license.txt in this distribution, or
12 * online at http://secondlife.com/developers/opensource/gplv2
13 *
14 * There are special exceptions to the terms and conditions of the GPL as
15 * it is applied to this Source Code. View the full text of the exception
16 * in the file doc/FLOSS-exception.txt in this software distribution, or
17 * online at http://secondlife.com/developers/opensource/flossexception
18 *
19 * By copying, modifying or distributing this software, you acknowledge
20 * that you have read and understood your obligations described above,
21 * and agree to abide by those obligations.
22 *
23 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
24 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
25 * COMPLETENESS OR PERFORMANCE.
26 */
27
28#ifndef LL_LLERRORSTREAM_H
29#define LL_LLERRORSTREAM_H
30
31// Usage:
32// LLErrorStream gErrorStream(gErrorBuffer);
33//
34// gErrorStream << debug << "This is a debug message" << endl;
35//
36// gErrorStream << fatal << "This message will cause a crash!" << endl;
37
38#include <iostream>
39#include "llerrorbuffer.h"
40#include "stdtypes.h"
41
42class LLFixedBuffer;
43
44class LLErrorStream : public std::ostream
45{
46 public:
47 LLErrorStream(LLErrorBuffer *eb);
48
49 // Specify error levels-- Use LLErrorBuffer::ELevel instead
50 enum ELevel
51 {
52 DEBUG = 0,
53 INFO = 1,
54 WARN = 2,
55 FATAL = 3,
56 NONE = 4 // Don't log anything
57 };
58
59 LLErrorBuffer *mErrorBuffer;
60
61 // This is used to specify if we need to merge the DebugMask
62 // or replace it
63 enum EControl
64 {
65 REPLACE = 0,
66 MERGE = 1
67 };
68
69 void setDebugMask(U32 mask) { mDebugMask = mask; }
70 void mergeDebugMask(U32 mask) { mDebugMask |= mask; }
71 U32 getDebugMask() { return mDebugMask; }
72 void setDebugFlag(U32 flag) { mDebugMask |= flag; }
73 void clearDebugFlag(U32 flag) { mDebugMask &= ~flag; }
74 BOOL setFile(const char *path) { return mErrorBuffer->setFile(path); }
75 void closeFile() { mErrorBuffer->closeFile(); }
76 const char *getFilename() const { return mErrorBuffer->getFilename(); }
77 void setFixedBuffer(LLFixedBuffer *b) { mErrorBuffer->setFixedBuffer(b); }
78 void setErrorLevel(const LLErrorBuffer::ELevel l) { mErrorBuffer->setLevel(l); }
79 LLErrorBuffer::ELevel getErrorLevel() { return mErrorBuffer->getLevel(); }
80 void mergeErrorLevel(const LLErrorBuffer::ELevel l) { mErrorBuffer->mergeLevel(l); }
81 void setError() { mKill = TRUE; };
82 void crashOnError(std::ostringstream &ss, LLErrorBuffer::ELevel l);
83
84 BOOL isEnabledFor(const LLErrorBuffer::ELevel l);
85 BOOL isEnabledFor(const LLErrorBuffer::ELevel l, const U32 type);
86
87
88 void mergeLevel(const LLErrorBuffer::ELevel l) { mErrorBuffer->mergeLevel(l); }
89
90 void setPrintLocation(BOOL b) { mPrintLocation = b; }
91 BOOL getPrintLocation() { return mPrintLocation; }
92
93 void setElevatedRemote(BOOL b) { mErrorBuffer->setElevatedRemote(b); }
94 void setUTCTimestamp(BOOL utc) { mErrorBuffer->setUTCTimestamp(utc); }
95
96 // Deprecated
97 void setLevel(const ELevel l) { setErrorLevel(ELevelToBufferELevel(l)); }
98 ELevel getLevel() { return BufferELevelToELevel(getErrorLevel()); }
99 void mergeLevel(const ELevel l) { mergeErrorLevel(ELevelToBufferELevel(l)); }
100
101
102 // Backwards compatilibity cruft. Should be removed
103 void mergeTime(BOOL b) { } // NOP
104 void mergeLocation(BOOL b) { } // NOP
105 void setTime(BOOL b) { } // NOP
106 char *getTime() { return ""; } // NOP
107
108 typedef void(*LLErrorCallback)(const std::string &error_string);
109 void setErrorCallback(LLErrorCallback callback) {mErrorCallback = callback;}
110
111private:
112 // This maintains the existing ELevel interface, but new code should use
113 // LLErrorBuffer::ELevel instead.
114 LLErrorBuffer::ELevel ELevelToBufferELevel(const ELevel l);
115 ELevel BufferELevelToELevel(const LLErrorBuffer::ELevel l);
116 U32 mDebugMask; // Mask for debugst() output
117
118 BOOL mPrintLocation;
119
120 S32 mSafeDepth; // Counter so we can safely do recursive calls, 0 means we're OK
121 BOOL mKill;
122 LLErrorCallback mErrorCallback;
123};
124
125
126#endif // LL_LLERRORSTREAM_H
diff --git a/linden/indra/llcommon/llevent.cpp b/linden/indra/llcommon/llevent.cpp
index e9b6a51..bbb37c5 100644
--- a/linden/indra/llcommon/llevent.cpp
+++ b/linden/indra/llcommon/llevent.cpp
@@ -186,16 +186,14 @@ void LLSimpleDispatcher::addListener(LLEventListener* listener, LLSD filter, con
186 186
187void LLSimpleDispatcher::removeListener(LLEventListener* listener) 187void LLSimpleDispatcher::removeListener(LLEventListener* listener)
188{ 188{
189 std::vector<LLListenerEntry>::iterator itor; 189 std::vector<LLListenerEntry>::iterator itor = mListeners.begin();
190 for (itor=mListeners.begin(); itor!=mListeners.end();) 190 std::vector<LLListenerEntry>::iterator end = mListeners.end();
191 for (; itor != end; ++itor)
191 { 192 {
192 if ((*itor).listener == listener) 193 if ((*itor).listener == listener)
193 { 194 {
194 mListeners.erase(itor); 195 mListeners.erase(itor);
195 } 196 break;
196 else
197 {
198 ++itor;
199 } 197 }
200 } 198 }
201 listener->handleDetach(mParent); 199 listener->handleDetach(mParent);
diff --git a/linden/indra/llcommon/llevent.h b/linden/indra/llcommon/llevent.h
index c48817e..bcb6ee9 100644
--- a/linden/indra/llcommon/llevent.h
+++ b/linden/indra/llcommon/llevent.h
@@ -31,6 +31,7 @@
31 31
32#include "llsd.h" 32#include "llsd.h"
33#include "llmemory.h" 33#include "llmemory.h"
34#include "llthread.h"
34 35
35class LLEventListener; 36class LLEventListener;
36class LLEvent; 37class LLEvent;
@@ -128,6 +129,7 @@ public:
128 129
129 // Adds a listener to this dispatcher, with a given user data 130 // Adds a listener to this dispatcher, with a given user data
130 // that will be passed to the listener when an event is fired. 131 // that will be passed to the listener when an event is fired.
132 // Duplicate pointers are removed on addtion.
131 void addListener(LLEventListener *listener, LLSD filter, const LLSD& userdata); 133 void addListener(LLEventListener *listener, LLSD filter, const LLSD& userdata);
132 134
133 // Removes a listener from this dispatcher 135 // Removes a listener from this dispatcher
diff --git a/linden/indra/llcommon/llfasttimer.h b/linden/indra/llcommon/llfasttimer.h
index b5e0734..47634ac 100644
--- a/linden/indra/llcommon/llfasttimer.h
+++ b/linden/indra/llcommon/llfasttimer.h
@@ -44,6 +44,7 @@ public:
44 FTM_UPDATE, 44 FTM_UPDATE,
45 FTM_RENDER, 45 FTM_RENDER,
46 FTM_SWAP, 46 FTM_SWAP,
47 FTM_CLIENT_COPY,
47 FTM_IDLE, 48 FTM_IDLE,
48 FTM_SLEEP, 49 FTM_SLEEP,
49 50
@@ -56,13 +57,23 @@ public:
56 FTM_UPDATE_TERRAIN, 57 FTM_UPDATE_TERRAIN,
57 FTM_UPDATE_PRIMITIVES, 58 FTM_UPDATE_PRIMITIVES,
58 FTM_UPDATE_PARTICLES, 59 FTM_UPDATE_PARTICLES,
60 FTM_SIMULATE_PARTICLES,
59 FTM_UPDATE_SKY, 61 FTM_UPDATE_SKY,
60 FTM_UPDATE_TEXTURES, 62 FTM_UPDATE_TEXTURES,
63 FTM_UPDATE_WATER,
64 FTM_UPDATE_CLOUDS,
65 FTM_UPDATE_GRASS,
66 FTM_UPDATE_TREE,
67 FTM_UPDATE_AVATAR,
61 68
62 // common render components 69 // common render components
63 FTM_RENDER_GEOMETRY, 70 FTM_RENDER_GEOMETRY,
64 FTM_RENDER_TERRAIN, 71 FTM_RENDER_TERRAIN,
65 FTM_RENDER_SIMPLE, 72 FTM_RENDER_SIMPLE,
73 FTM_RENDER_FULLBRIGHT,
74 FTM_RENDER_GLOW,
75 FTM_RENDER_GRASS,
76 FTM_RENDER_INVISIBLE,
66 FTM_RENDER_SHINY, 77 FTM_RENDER_SHINY,
67 FTM_RENDER_BUMP, 78 FTM_RENDER_BUMP,
68 FTM_RENDER_TREES, 79 FTM_RENDER_TREES,
@@ -81,6 +92,20 @@ public:
81 FTM_MESSAGES, 92 FTM_MESSAGES,
82 FTM_REBUILD, 93 FTM_REBUILD,
83 FTM_STATESORT, 94 FTM_STATESORT,
95 FTM_STATESORT_DRAWABLE,
96 FTM_STATESORT_POSTSORT,
97 FTM_REBUILD_VBO,
98 FTM_REBUILD_VOLUME_VB,
99 FTM_REBUILD_BRIDGE_VB,
100 FTM_REBUILD_HUD_VB,
101 FTM_REBUILD_TERRAIN_VB,
102 FTM_REBUILD_WATER_VB,
103 FTM_REBUILD_TREE_VB,
104 FTM_REBUILD_PARTICLE_VB,
105 FTM_REBUILD_CLOUD_VB,
106 FTM_REBUILD_GRASS_VB,
107 FTM_REBUILD_NONE_VB,
108 FTM_REBUILD_OCCLUSION_VB,
84 FTM_POOLS, 109 FTM_POOLS,
85 FTM_POOLRENDER, 110 FTM_POOLRENDER,
86 FTM_IDLE_CB, 111 FTM_IDLE_CB,
@@ -90,6 +115,7 @@ public:
90 FTM_UPDATE_LIGHTS, 115 FTM_UPDATE_LIGHTS,
91 FTM_CULL, 116 FTM_CULL,
92 FTM_CULL_REBOUND, 117 FTM_CULL_REBOUND,
118 FTM_FRUSTUM_CULL,
93 FTM_GEO_UPDATE, 119 FTM_GEO_UPDATE,
94 FTM_GEO_RESERVE, 120 FTM_GEO_RESERVE,
95 FTM_GEO_LIGHT, 121 FTM_GEO_LIGHT,
@@ -116,6 +142,7 @@ public:
116 FTM_IMAGE_UPDATE, 142 FTM_IMAGE_UPDATE,
117 FTM_IMAGE_CREATE, 143 FTM_IMAGE_CREATE,
118 FTM_IMAGE_DECODE, 144 FTM_IMAGE_DECODE,
145 FTM_IMAGE_MARK_DIRTY,
119 FTM_PIPELINE, 146 FTM_PIPELINE,
120 FTM_VFILE_WAIT, 147 FTM_VFILE_WAIT,
121 FTM_FLEXIBLE_UPDATE, 148 FTM_FLEXIBLE_UPDATE,
diff --git a/linden/indra/llcommon/llfile.cpp b/linden/indra/llcommon/llfile.cpp
index d9fd360..feac28f 100644
--- a/linden/indra/llcommon/llfile.cpp
+++ b/linden/indra/llcommon/llfile.cpp
@@ -48,6 +48,19 @@ int LLFile::mkdir(const char* dirname, int perms)
48} 48}
49 49
50// static 50// static
51int LLFile::rmdir(const char* dirname)
52{
53#if LL_WINDOWS
54 // permissions are ignored on Windows
55 std::string utf8dirname = dirname;
56 llutf16string utf16dirname = utf8str_to_utf16str(utf8dirname);
57 return _wrmdir(utf16dirname.c_str());
58#else
59 return ::rmdir(dirname);
60#endif
61}
62
63// static
51LLFILE* LLFile::fopen(const char* filename, const char* mode) /* Flawfinder: ignore */ 64LLFILE* LLFile::fopen(const char* filename, const char* mode) /* Flawfinder: ignore */
52{ 65{
53#if LL_WINDOWS 66#if LL_WINDOWS
@@ -184,9 +197,9 @@ void llifstream::close()
184 } 197 }
185} 198}
186 199
187void llifstream::open(const char *_Filename, 200void llifstream::open(const char* _Filename, /* Flawfinder: ignore */
188 ios_base::openmode _Mode, 201 ios_base::openmode _Mode,
189 int _Prot) /* Flawfinder: ignore */ 202 int _Prot)
190{ // open a C stream with specified mode 203{ // open a C stream with specified mode
191 204
192 FILE* filep = LLFile::_Fiopen(_Filename,_Mode | ios_base::in, _Prot); 205 FILE* filep = LLFile::_Fiopen(_Filename,_Mode | ios_base::in, _Prot);
@@ -197,6 +210,7 @@ void llifstream::open(const char *_Filename,
197 } 210 }
198 llassert(_Filebuffer == NULL); 211 llassert(_Filebuffer == NULL);
199 _Filebuffer = new _Myfb(filep); 212 _Filebuffer = new _Myfb(filep);
213 _ShouldClose = true;
200 _Myios::init(_Filebuffer); 214 _Myios::init(_Filebuffer);
201} 215}
202 216
@@ -208,13 +222,17 @@ bool llifstream::is_open() const
208} 222}
209llifstream::~llifstream() 223llifstream::~llifstream()
210{ 224{
225 if (_ShouldClose)
226 {
227 close();
228 }
211 delete _Filebuffer; 229 delete _Filebuffer;
212} 230}
213 231
214llifstream::llifstream(const char *_Filename, 232llifstream::llifstream(const char *_Filename,
215 ios_base::openmode _Mode, 233 ios_base::openmode _Mode,
216 int _Prot) 234 int _Prot)
217 : std::basic_istream< char , std::char_traits< char > >(NULL,true),_Filebuffer(NULL) 235 : std::basic_istream< char , std::char_traits< char > >(NULL,true),_Filebuffer(NULL),_ShouldClose(false)
218 236
219{ // construct with named file and specified mode 237{ // construct with named file and specified mode
220 open(_Filename, _Mode | ios_base::in, _Prot); /* Flawfinder: ignore */ 238 open(_Filename, _Mode | ios_base::in, _Prot); /* Flawfinder: ignore */
@@ -230,9 +248,9 @@ bool llofstream::is_open() const
230 return false; 248 return false;
231} 249}
232 250
233void llofstream::open(const char *_Filename, 251void llofstream::open(const char* _Filename, /* Flawfinder: ignore */
234 ios_base::openmode _Mode, 252 ios_base::openmode _Mode,
235 int _Prot) /* Flawfinder: ignore */ 253 int _Prot)
236{ // open a C stream with specified mode 254{ // open a C stream with specified mode
237 255
238 FILE* filep = LLFile::_Fiopen(_Filename,_Mode | ios_base::out, _Prot); 256 FILE* filep = LLFile::_Fiopen(_Filename,_Mode | ios_base::out, _Prot);
diff --git a/linden/indra/llcommon/llfile.h b/linden/indra/llcommon/llfile.h
index 554308f..5034cf7 100644
--- a/linden/indra/llcommon/llfile.h
+++ b/linden/indra/llcommon/llfile.h
@@ -69,6 +69,7 @@ public:
69 // be overridden by the user's umask. It is ignored on Windows. 69 // be overridden by the user's umask. It is ignored on Windows.
70 static int mkdir(const char* filename, int perms = 0700); 70 static int mkdir(const char* filename, int perms = 0700);
71 71
72 static int rmdir(const char* filename);
72 static int remove(const char* filename); 73 static int remove(const char* filename);
73 static int rename(const char* filename,const char* newname); 74 static int rename(const char* filename,const char* newname);
74 static int stat(const char* filename,llstat* file_status); 75 static int stat(const char* filename,llstat* file_status);
@@ -87,7 +88,7 @@ public:
87 typedef std::basic_ios<char,std::char_traits< char > > _Myios; 88 typedef std::basic_ios<char,std::char_traits< char > > _Myios;
88 89
89 llifstream() 90 llifstream()
90 : std::basic_istream<char,std::char_traits< char > >(NULL,true),_Filebuffer(NULL) 91 : std::basic_istream<char,std::char_traits< char > >(NULL,true),_Filebuffer(NULL),_ShouldClose(false)
91 { // construct unopened 92 { // construct unopened
92 } 93 }
93 94
@@ -97,7 +98,8 @@ public:
97 98
98 explicit llifstream(_Filet *_File) 99 explicit llifstream(_Filet *_File)
99 : std::basic_istream<char,std::char_traits< char > >(NULL,true), 100 : std::basic_istream<char,std::char_traits< char > >(NULL,true),
100 _Filebuffer(new _Myfb(_File)) 101 _Filebuffer(new _Myfb(_File)),
102 _ShouldClose(false)
101 { // construct with specified C stream 103 { // construct with specified C stream
102 } 104 }
103 virtual ~llifstream(); 105 virtual ~llifstream();
@@ -107,13 +109,14 @@ public:
107 return _Filebuffer; 109 return _Filebuffer;
108 } 110 }
109 bool is_open() const; 111 bool is_open() const;
110 void open(const char *_Filename, 112 void open(const char* _Filename, /* Flawfinder: ignore */
111 ios_base::openmode _Mode = ios_base::in, 113 ios_base::openmode _Mode = ios_base::in,
112 int _Prot = (int)ios_base::_Openprot); /* Flawfinder: ignore */ 114 int _Prot = (int)ios_base::_Openprot);
113 void close(); 115 void close();
114 116
115private: 117private:
116 _Myfb* _Filebuffer; // the file buffer 118 _Myfb* _Filebuffer; // the file buffer
119 bool _ShouldClose;
117}; 120};
118 121
119 122
diff --git a/linden/indra/llcommon/llformat.cpp b/linden/indra/llcommon/llformat.cpp
new file mode 100644
index 0000000..f088bc6
--- /dev/null
+++ b/linden/indra/llcommon/llformat.cpp
@@ -0,0 +1,47 @@
1/**
2 * @file llformat.cpp
3 * @date January 2007
4 * @brief string formatting utility
5 *
6 * Copyright (c) 2007-2007, Linden Research, Inc.
7 *
8 * The source code in this file ("Source Code") is provided by Linden Lab
9 * to you under the terms of the GNU General Public License, version 2.0
10 * ("GPL"), unless you have obtained a separate licensing agreement
11 * ("Other License"), formally executed by you and Linden Lab. Terms of
12 * the GPL can be found in doc/GPL-license.txt in this distribution, or
13 * online at http://secondlife.com/developers/opensource/gplv2
14 *
15 * There are special exceptions to the terms and conditions of the GPL as
16 * it is applied to this Source Code. View the full text of the exception
17 * in the file doc/FLOSS-exception.txt in this software distribution, or
18 * online at http://secondlife.com/developers/opensource/flossexception
19 *
20 * By copying, modifying or distributing this software, you acknowledge
21 * that you have read and understood your obligations described above,
22 * and agree to abide by those obligations.
23 *
24 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
25 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
26 * COMPLETENESS OR PERFORMANCE.
27 */
28
29#include "linden_common.h"
30
31#include "llformat.h"
32
33#include <stdarg.h>
34
35std::string llformat(const char *fmt, ...)
36{
37 char tstr[1024]; /* Flawfinder: ignore */
38 va_list va;
39 va_start(va, fmt);
40#if LL_WINDOWS
41 _vsnprintf(tstr, 1024, fmt, va);
42#else
43 vsnprintf(tstr, 1024, fmt, va); /* Flawfinder: ignore */
44#endif
45 va_end(va);
46 return std::string(tstr);
47}
diff --git a/linden/indra/llcommon/llformat.h b/linden/indra/llcommon/llformat.h
new file mode 100644
index 0000000..135f9d2
--- /dev/null
+++ b/linden/indra/llcommon/llformat.h
@@ -0,0 +1,42 @@
1/**
2 * @file llformat.h
3 * @date January 2007
4 * @brief string formatting utility
5 *
6 * Copyright (c) 2007-2007, Linden Research, Inc.
7 *
8 * The source code in this file ("Source Code") is provided by Linden Lab
9 * to you under the terms of the GNU General Public License, version 2.0
10 * ("GPL"), unless you have obtained a separate licensing agreement
11 * ("Other License"), formally executed by you and Linden Lab. Terms of
12 * the GPL can be found in doc/GPL-license.txt in this distribution, or
13 * online at http://secondlife.com/developers/opensource/gplv2
14 *
15 * There are special exceptions to the terms and conditions of the GPL as
16 * it is applied to this Source Code. View the full text of the exception
17 * in the file doc/FLOSS-exception.txt in this software distribution, or
18 * online at http://secondlife.com/developers/opensource/flossexception
19 *
20 * By copying, modifying or distributing this software, you acknowledge
21 * that you have read and understood your obligations described above,
22 * and agree to abide by those obligations.
23 *
24 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
25 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
26 * COMPLETENESS OR PERFORMANCE.
27 */
28
29#ifndef LL_LLFORMAT_H
30#define LL_LLFORMAT_H
31
32#include <string>
33
34// Use as follows:
35// llinfos << llformat("Test:%d (%.2f %.2f)", idx, x, y) << llendl;
36//
37// *NOTE: buffer limited to 1024, (but vsnprintf prevents overrun)
38// should perhaps be replaced with boost::format.
39
40std::string llformat(const char *fmt, ...);
41
42#endif // LL_LLFORMAT_H
diff --git a/linden/indra/llcommon/llliveappconfig.cpp b/linden/indra/llcommon/llliveappconfig.cpp
new file mode 100644
index 0000000..bcffa7c
--- /dev/null
+++ b/linden/indra/llcommon/llliveappconfig.cpp
@@ -0,0 +1,65 @@
1/**
2 * @file llliveappconfig.cpp
3 * @brief Configuration information for an LLApp that overrides indra.xml
4 *
5 * Copyright (c) 2003-2007, Linden Research, Inc.
6 *
7 * The source code in this file ("Source Code") is provided by Linden Lab
8 * to you under the terms of the GNU General Public License, version 2.0
9 * ("GPL"), unless you have obtained a separate licensing agreement
10 * ("Other License"), formally executed by you and Linden Lab. Terms of
11 * the GPL can be found in doc/GPL-license.txt in this distribution, or
12 * online at http://secondlife.com/developers/opensource/gplv2
13 *
14 * There are special exceptions to the terms and conditions of the GPL as
15 * it is applied to this Source Code. View the full text of the exception
16 * in the file doc/FLOSS-exception.txt in this software distribution, or
17 * online at http://secondlife.com/developers/opensource/flossexception
18 *
19 * By copying, modifying or distributing this software, you acknowledge
20 * that you have read and understood your obligations described above,
21 * and agree to abide by those obligations.
22 *
23 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
24 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
25 * COMPLETENESS OR PERFORMANCE.
26 */
27
28#include "linden_common.h"
29
30#include "llliveappconfig.h"
31
32#include "llapp.h"
33#include "llsd.h"
34#include "llsdserialize.h"
35
36LLLiveAppConfig::LLLiveAppConfig(LLApp* app, const std::string& filename, F32 refresh_period)
37: LLLiveFile(filename, refresh_period),
38 mApp(app)
39{ }
40
41
42LLLiveAppConfig::~LLLiveAppConfig()
43{ }
44
45// virtual
46void LLLiveAppConfig::loadFile()
47{
48 llinfos << "LLLiveAppConfig::loadFile(): reading from "
49 << filename() << llendl;
50 llifstream file(filename().c_str());
51 LLSD config;
52 if (file.is_open())
53 {
54 LLSDSerialize::fromXML(config, file);
55 if(!config.isMap())
56 {
57 llinfos << "LLDataserverConfig::loadFile(): not an map!"
58 << " Ignoring the data." << llendl;
59 return;
60 }
61 file.close();
62 }
63 mApp->setOptionData(
64 LLApp::PRIORITY_SPECIFIC_CONFIGURATION, config);
65}
diff --git a/linden/indra/newview/lldrawpooltreenew.h b/linden/indra/llcommon/llliveappconfig.h
index 9150331..822410f 100644
--- a/linden/indra/newview/lldrawpooltreenew.h
+++ b/linden/indra/llcommon/llliveappconfig.h
@@ -1,6 +1,6 @@
1/** 1/**
2 * @file lldrawpooltreenew.h 2 * @file llliveappconfig.h
3 * @brief LLDrawPoolTreeNew class definition 3 * @brief Configuration information for an LLApp that overrides indra.xml
4 * 4 *
5 * Copyright (c) 2003-2007, Linden Research, Inc. 5 * Copyright (c) 2003-2007, Linden Research, Inc.
6 * 6 *
@@ -25,31 +25,28 @@
25 * COMPLETENESS OR PERFORMANCE. 25 * COMPLETENESS OR PERFORMANCE.
26 */ 26 */
27 27
28#ifndef LL_LLDRAWPOOLTREENEW_H 28#ifndef LLLIVEAPPCONFIG_H
29#define LL_LLDRAWPOOLTREENEW_H 29#define LLLIVEAPPCONFIG_H
30 30
31#include "lldrawpool.h" 31#include "lllivefile.h"
32 32
33class LLDrawPoolTreeNew : public LLDrawPool 33class LLApp;
34
35class LLLiveAppConfig : public LLLiveFile
34{ 36{
35 LLPointer<LLViewerImage> mTexturep;
36public: 37public:
37 LLDrawPoolTreeNew(LLViewerImage *texturep); 38 // To use this, instantiate a LLLiveAppConfig object inside your main loop.
39 // The traditional name for it is live_config.
40 // Be sure to call live_config.checkAndReload() periodically.
38 41
39 /*virtual*/ LLDrawPool *instancePool(); 42 LLLiveAppConfig(LLApp* app, const std::string& filename, F32 refresh_period);
43 ~LLLiveAppConfig();
40 44
41 /*virtual*/ void prerender(); 45protected:
42 /*virtual*/ void render( S32 pass ); 46 /*virtual*/ void loadFile();
43 /*virtual*/ void renderForSelect();
44 /*virtual*/ S32 rebuild();
45 /*virtual*/ BOOL verify() const;
46 /*virtual*/ LLViewerImage *getTexture();
47 /*virtual*/ LLViewerImage *getDebugTexture();
48 /*virtual*/ LLColor3 getDebugColor() const; // For AGP debug display
49 virtual S32 getMaterialAttribIndex() { return 0; }
50 47
51private: 48private:
52 void renderTree(BOOL selecting = FALSE); 49 LLApp* mApp;
53}; 50};
54 51
55#endif // LL_LLDRAWPOOLTREE_H 52#endif
diff --git a/linden/indra/llcommon/lllivefile.cpp b/linden/indra/llcommon/lllivefile.cpp
index 33e2014..d289671 100644
--- a/linden/indra/llcommon/lllivefile.cpp
+++ b/linden/indra/llcommon/lllivefile.cpp
@@ -27,24 +27,56 @@
27#include "linden_common.h" 27#include "linden_common.h"
28 28
29#include "lllivefile.h" 29#include "lllivefile.h"
30#include "llframetimer.h"
31#include "lltimer.h"
30 32
33class LLLiveFile::Impl
34{
35public:
36 Impl(const std::string &filename, const F32 refresh_period);
37 ~Impl();
38
39 bool check();
40
41
42 bool mForceCheck;
43 F32 mRefreshPeriod;
44 LLFrameTimer mRefreshTimer;
31 45
32LLLiveFile::LLLiveFile(const std::string &filename, const F32 refresh_period) : 46 std::string mFilename;
33mForceCheck(true), 47 time_t mLastModTime;
34mRefreshPeriod(refresh_period), 48 bool mLastExists;
35mFilename(filename), 49
36mLastModTime(0), 50 LLEventTimer* mEventTimer;
37mLastExists(false) 51};
52
53LLLiveFile::Impl::Impl(const std::string &filename, const F32 refresh_period)
54 : mForceCheck(true),
55 mRefreshPeriod(refresh_period),
56 mFilename(filename),
57 mLastModTime(0),
58 mLastExists(false),
59 mEventTimer(NULL)
38{ 60{
39} 61}
40 62
63LLLiveFile::Impl::~Impl()
64{
65 delete mEventTimer;
66}
67
68LLLiveFile::LLLiveFile(const std::string &filename, const F32 refresh_period)
69 : impl(* new Impl(filename, refresh_period))
70{
71}
41 72
42LLLiveFile::~LLLiveFile() 73LLLiveFile::~LLLiveFile()
43{ 74{
75 delete &impl;
44} 76}
45 77
46 78
47bool LLLiveFile::checkAndReload() 79bool LLLiveFile::Impl::check()
48{ 80{
49 if (!mForceCheck && mRefreshTimer.getElapsedTimeF32() < mRefreshPeriod) 81 if (!mForceCheck && mRefreshTimer.getElapsedTimeF32() < mRefreshPeriod)
50 { 82 {
@@ -65,9 +97,8 @@ bool LLLiveFile::checkAndReload()
65 // broken somehow. Clear flags and return. 97 // broken somehow. Clear flags and return.
66 if (mLastExists) 98 if (mLastExists)
67 { 99 {
68 loadFile(); // Load the file, even though it's missing to allow it to clear state.
69 mLastExists = false; 100 mLastExists = false;
70 return true; 101 return true; // no longer existing is a change!
71 } 102 }
72 return false; 103 return false;
73 } 104 }
@@ -87,7 +118,44 @@ bool LLLiveFile::checkAndReload()
87 mLastExists = true; 118 mLastExists = true;
88 mLastModTime = stat_data.st_mtime; 119 mLastModTime = stat_data.st_mtime;
89 120
90 loadFile();
91 return true; 121 return true;
92} 122}
93 123
124bool LLLiveFile::checkAndReload()
125{
126 bool changed = impl.check();
127 if (changed)
128 {
129 loadFile();
130 }
131 return changed;
132}
133
134std::string LLLiveFile::filename() const
135{
136 return impl.mFilename;
137}
138
139namespace
140{
141 class LiveFileEventTimer : public LLEventTimer
142 {
143 public:
144 LiveFileEventTimer(LLLiveFile& f, F32 refresh)
145 : LLEventTimer(refresh), mLiveFile(f)
146 { }
147
148 void tick()
149 { mLiveFile.checkAndReload(); }
150
151 private:
152 LLLiveFile& mLiveFile;
153 };
154
155}
156
157void LLLiveFile::addToEventTimer()
158{
159 impl.mEventTimer = new LiveFileEventTimer(*this, impl.mRefreshPeriod);
160}
161
diff --git a/linden/indra/llcommon/lllivefile.h b/linden/indra/llcommon/lllivefile.h
index b305531..fbf2bdf 100644
--- a/linden/indra/llcommon/lllivefile.h
+++ b/linden/indra/llcommon/lllivefile.h
@@ -28,7 +28,6 @@
28#ifndef LL_LLLIVEFILE_H 28#ifndef LL_LLLIVEFILE_H
29#define LL_LLLIVEFILE_H 29#define LL_LLLIVEFILE_H
30 30
31#include "llframetimer.h"
32 31
33class LLLiveFile 32class LLLiveFile
34{ 33{
@@ -36,18 +35,22 @@ public:
36 LLLiveFile(const std::string &filename, const F32 refresh_period = 5.f); 35 LLLiveFile(const std::string &filename, const F32 refresh_period = 5.f);
37 virtual ~LLLiveFile(); 36 virtual ~LLLiveFile();
38 37
39 bool checkAndReload(); // Returns true if the file changed in any way 38 bool checkAndReload();
39 // Returns true if the file changed in any way
40 // Call this before using anything that was read & cached from the file
41
42 std::string filename() const;
43
44 void addToEventTimer();
45 // Normally, just calling checkAndReload() is enough. In some cases
46 // though, you may need to let the live file periodically check itself.
40 47
41protected: 48protected:
42 virtual void loadFile() = 0; // Implement this to load your file if it changed 49 virtual void loadFile() = 0; // Implement this to load your file if it changed
43 50
44 bool mForceCheck; 51private:
45 F32 mRefreshPeriod; 52 class Impl;
46 LLFrameTimer mRefreshTimer; 53 Impl& impl;
47
48 std::string mFilename;
49 time_t mLastModTime;
50 bool mLastExists;
51}; 54};
52 55
53#endif //LL_LLLIVEFILE_H 56#endif //LL_LLLIVEFILE_H
diff --git a/linden/indra/llcommon/lllslconstants.h b/linden/indra/llcommon/lllslconstants.h
index 52d2858..08c63e3 100644
--- a/linden/indra/llcommon/lllslconstants.h
+++ b/linden/indra/llcommon/lllslconstants.h
@@ -155,4 +155,8 @@ const S32 LIST_STAT_SUM_SQUARES = 7;
155const S32 LIST_STAT_NUM_COUNT = 8; 155const S32 LIST_STAT_NUM_COUNT = 8;
156const S32 LIST_STAT_GEO_MEAN = 9; 156const S32 LIST_STAT_GEO_MEAN = 9;
157 157
158const S32 STRING_TRIM_HEAD = 0x01;
159const S32 STRING_TRIM_TAIL = 0x02;
160const S32 STRING_TRIM = STRING_TRIM_HEAD | STRING_TRIM_TAIL;
161
158#endif 162#endif
diff --git a/linden/indra/llcommon/llmemory.cpp b/linden/indra/llcommon/llmemory.cpp
index 9bfbf88..8528433 100644
--- a/linden/indra/llcommon/llmemory.cpp
+++ b/linden/indra/llcommon/llmemory.cpp
@@ -28,6 +28,12 @@
28#include "linden_common.h" 28#include "linden_common.h"
29 29
30#include "llmemory.h" 30#include "llmemory.h"
31#include "llmemtype.h"
32
33// not defining nullfunc will currently crash when trying to use a LLHandle
34template< typename _Ty >
35 const typename LLHandle< _Ty >::NullFunc
36 LLHandle< _Ty >::sNullFunc = LLHandle< _Ty >::defaultNullFunc;
31 37
32//---------------------------------------------------------------------------- 38//----------------------------------------------------------------------------
33 39
@@ -258,43 +264,6 @@ void operator delete[] (void *p)
258 264
259//---------------------------------------------------------------------------- 265//----------------------------------------------------------------------------
260 266
261//static
262LLMutex* LLThreadSafeRefCount::sMutex = 0;
263
264//static
265void LLThreadSafeRefCount::initClass()
266{
267 if (!sMutex)
268 {
269 sMutex = new LLMutex(0);
270 }
271}
272
273//static
274void LLThreadSafeRefCount::cleanupClass()
275{
276 delete sMutex;
277 sMutex = NULL;
278}
279
280
281//----------------------------------------------------------------------------
282
283LLThreadSafeRefCount::LLThreadSafeRefCount() :
284 mRef(0)
285{
286}
287
288LLThreadSafeRefCount::~LLThreadSafeRefCount()
289{
290 if (mRef != 0)
291 {
292 llerrs << "deleting non-zero reference" << llendl;
293 }
294}
295
296//----------------------------------------------------------------------------
297
298LLRefCount::LLRefCount() : 267LLRefCount::LLRefCount() :
299 mRef(0) 268 mRef(0)
300{ 269{
diff --git a/linden/indra/llcommon/llmemory.h b/linden/indra/llcommon/llmemory.h
index b40ab79..7a7996b 100644
--- a/linden/indra/llcommon/llmemory.h
+++ b/linden/indra/llcommon/llmemory.h
@@ -31,8 +31,6 @@
31#include <cstdlib> 31#include <cstdlib>
32 32
33#include "llerror.h" 33#include "llerror.h"
34#include "llthread.h"
35#include "llmemtype.h"
36 34
37extern S32 gTotalDAlloc; 35extern S32 gTotalDAlloc;
38extern S32 gTotalDAUse; 36extern S32 gTotalDAUse;
@@ -61,53 +59,7 @@ private:
61// LLPointer<LLFoo> x = new LLFoo; // constructor does not do anything interesting 59// LLPointer<LLFoo> x = new LLFoo; // constructor does not do anything interesting
62// x->instantiate(); // does stuff like place x into an update queue 60// x->instantiate(); // does stuff like place x into an update queue
63 61
64class LLThreadSafeRefCount 62// see llthread.h for LLThreadSafeRefCount
65{
66public:
67 static void initClass(); // creates sMutex
68 static void cleanupClass(); // destroys sMutex
69
70private:
71 static LLMutex* sMutex;
72
73private:
74 LLThreadSafeRefCount(const LLThreadSafeRefCount&); // not implemented
75 LLThreadSafeRefCount&operator=(const LLThreadSafeRefCount&); // not implemented
76
77protected:
78 virtual ~LLThreadSafeRefCount(); // use unref()
79
80public:
81 LLThreadSafeRefCount();
82
83 void ref()
84 {
85 if (sMutex) sMutex->lock();
86 mRef++;
87 if (sMutex) sMutex->unlock();
88 }
89
90 S32 unref()
91 {
92 llassert(mRef >= 1);
93 if (sMutex) sMutex->lock();
94 S32 res = --mRef;
95 if (sMutex) sMutex->unlock();
96 if (0 == res)
97 {
98 delete this;
99 res = 0;
100 }
101 return res;
102 }
103 S32 getNumRefs() const
104 {
105 return mRef;
106 }
107
108private:
109 S32 mRef;
110};
111 63
112//---------------------------------------------------------------------------- 64//----------------------------------------------------------------------------
113 65
@@ -139,6 +91,7 @@ public:
139 } 91 }
140 return mRef; 92 return mRef;
141 } 93 }
94
142 S32 getNumRefs() const 95 S32 getNumRefs() const
143 { 96 {
144 return mRef; 97 return mRef;
@@ -150,6 +103,7 @@ private:
150 103
151//---------------------------------------------------------------------------- 104//----------------------------------------------------------------------------
152 105
106// Note: relies on Type having ref() and unref() methods
153template <class Type> class LLPointer 107template <class Type> class LLPointer
154{ 108{
155public: 109public:
@@ -268,6 +222,154 @@ protected:
268 Type* mPointer; 222 Type* mPointer;
269}; 223};
270 224
225//template <class Type>
226//class LLPointerTraits
227//{
228// static Type* null();
229//};
230//
231// Expands LLPointer to return a pointer to a special instance of class Type instead of NULL.
232// This is useful in instances where operations on NULL pointers are semantically safe and/or
233// when error checking occurs at a different granularity or in a different part of the code
234// than when referencing an object via a LLHandle.
235//
236
237template <class Type>
238class LLHandle
239{
240public:
241 LLHandle() :
242 mPointer(sNullFunc())
243 {
244 ref();
245 }
246
247 LLHandle(Type* ptr) :
248 mPointer(nonNull(ptr))
249 {
250 ref();
251 }
252
253 LLHandle(const LLHandle<Type>& ptr) :
254 mPointer(ptr.mPointer)
255 {
256 ref();
257 }
258
259 // support conversion up the type hierarchy. See Item 45 in Effective C++, 3rd Ed.
260 template<typename Subclass>
261 LLHandle(const LLHandle<Subclass>& ptr) :
262 mPointer(ptr.get())
263 {
264 ref();
265 }
266
267 ~LLHandle()
268 {
269 unref();
270 }
271
272 Type* get() const { return mPointer; }
273 const Type* operator->() const { return mPointer; }
274 Type* operator->() { return mPointer; }
275 const Type& operator*() const { return *mPointer; }
276 Type& operator*() { return *mPointer; }
277
278 operator BOOL() const { return (mPointer != sNullFunc()); }
279 operator bool() const { return (mPointer != sNullFunc()); }
280 bool operator!() const { return (mPointer == sNullFunc()); }
281 bool isNull() const { return (mPointer == sNullFunc()); }
282 bool notNull() const { return (mPointer != sNullFunc()); }
283
284
285 operator Type*() const { return mPointer; }
286 operator const Type*() const { return mPointer; }
287 bool operator !=(Type* ptr) const { return (mPointer != nonNull(ptr)); }
288 bool operator ==(Type* ptr) const { return (mPointer == nonNull(ptr)); }
289 bool operator ==(const LLHandle<Type>& ptr) const { return (mPointer == ptr.mPointer); }
290 bool operator < (const LLHandle<Type>& ptr) const { return (mPointer < ptr.mPointer); }
291 bool operator > (const LLHandle<Type>& ptr) const { return (mPointer > ptr.mPointer); }
292
293 LLHandle<Type>& operator =(Type* ptr)
294 {
295 if( mPointer != ptr )
296 {
297 unref();
298 mPointer = nonNull(ptr);
299 ref();
300 }
301
302 return *this;
303 }
304
305 LLHandle<Type>& operator =(const LLHandle<Type>& ptr)
306 {
307 if( mPointer != ptr.mPointer )
308 {
309 unref();
310 mPointer = ptr.mPointer;
311 ref();
312 }
313 return *this;
314 }
315
316 // support assignment up the type hierarchy. See Item 45 in Effective C++, 3rd Ed.
317 template<typename Subclass>
318 LLHandle<Type>& operator =(const LLHandle<Subclass>& ptr)
319 {
320 if( mPointer != ptr.get() )
321 {
322 unref();
323 mPointer = ptr.get();
324 ref();
325 }
326 return *this;
327 }
328
329public:
330 typedef Type* (*NullFunc)();
331 static const NullFunc sNullFunc;
332
333protected:
334 void ref()
335 {
336 if (mPointer)
337 {
338 mPointer->ref();
339 }
340 }
341
342 void unref()
343 {
344 if (mPointer)
345 {
346 Type *tempp = mPointer;
347 mPointer = sNullFunc();
348 tempp->unref();
349 if (mPointer != sNullFunc())
350 {
351 llwarns << "Unreference did assignment to non-NULL because of destructor" << llendl;
352 unref();
353 }
354 }
355 }
356
357 static Type* nonNull(Type* ptr)
358 {
359 return ptr == NULL ? sNullFunc() : ptr;
360 }
361
362 static Type* defaultNullFunc()
363 {
364 llerrs << "No null value provided for LLHandle" << llendl;
365 return NULL;
366 }
367
368protected:
369
370 Type* mPointer;
371};
372
271// LLInitializedPointer is just a pointer with a default constructor that initializes it to NULL 373// LLInitializedPointer is just a pointer with a default constructor that initializes it to NULL
272// NOT a smart pointer like LLPointer<> 374// NOT a smart pointer like LLPointer<>
273// Useful for example in std::map<int,LLInitializedPointer<LLFoo> > 375// Useful for example in std::map<int,LLInitializedPointer<LLFoo> >
diff --git a/linden/indra/llcommon/llmemtype.h b/linden/indra/llcommon/llmemtype.h
index 15ef924..0af1ed3 100644
--- a/linden/indra/llcommon/llmemtype.h
+++ b/linden/indra/llcommon/llmemtype.h
@@ -71,6 +71,7 @@ public:
71 71
72 MTYPE_DRAWABLE, 72 MTYPE_DRAWABLE,
73 MTYPE_OBJECT, 73 MTYPE_OBJECT,
74 MTYPE_VERTEX_DATA,
74 MTYPE_SPACE_PARTITION, 75 MTYPE_SPACE_PARTITION,
75 MTYPE_PIPELINE, 76 MTYPE_PIPELINE,
76 MTYPE_AVATAR, 77 MTYPE_AVATAR,
diff --git a/linden/indra/llcommon/llpreprocessor.h b/linden/indra/llcommon/llpreprocessor.h
index f03fe89..9db0108 100644
--- a/linden/indra/llcommon/llpreprocessor.h
+++ b/linden/indra/llcommon/llpreprocessor.h
@@ -51,7 +51,9 @@
51 #define LL_LIBXUL_ENABLED 1 51 #define LL_LIBXUL_ENABLED 1
52#elif LL_LINUX 52#elif LL_LINUX
53 #define LL_QUICKTIME_ENABLED 0 53 #define LL_QUICKTIME_ENABLED 0
54 #define LL_LIBXUL_ENABLED 0 54 #ifndef LL_LIBXUL_ENABLED
55 #define LL_LIBXUL_ENABLED 1
56 #endif // def LL_LIBXUL_ENABLED
55#endif 57#endif
56 58
57#if LL_LIBXUL_ENABLED && !defined(MOZILLA_INTERNAL_API) 59#if LL_LIBXUL_ENABLED && !defined(MOZILLA_INTERNAL_API)
@@ -80,7 +82,7 @@
80 82
81// Deal with the differeneces on Windows 83// Deal with the differeneces on Windows
82#if defined(LL_WINDOWS) 84#if defined(LL_WINDOWS)
83#define snprintf _snprintf 85#define snprintf _snprintf /*Flawfinder: ignore*/
84#endif // LL_WINDOWS 86#endif // LL_WINDOWS
85 87
86// Static linking with apr on windows needs to be declared. 88// Static linking with apr on windows needs to be declared.
@@ -110,6 +112,7 @@
110#pragma warning( disable : 4284 ) // silly MS warning deep inside their <map> include file 112#pragma warning( disable : 4284 ) // silly MS warning deep inside their <map> include file
111#pragma warning( disable : 4503 ) // 'decorated name length exceeded, name was truncated'. Does not seem to affect compilation. 113#pragma warning( disable : 4503 ) // 'decorated name length exceeded, name was truncated'. Does not seem to affect compilation.
112#pragma warning( disable : 4800 ) // 'BOOL' : forcing value to bool 'true' or 'false' (performance warning) 114#pragma warning( disable : 4800 ) // 'BOOL' : forcing value to bool 'true' or 'false' (performance warning)
115#pragma warning( disable : 4996 ) // warning: deprecated
113#endif // LL_WINDOWS 116#endif // LL_WINDOWS
114 117
115#endif // not LL_LINDEN_PREPROCESSOR_H 118#endif // not LL_LINDEN_PREPROCESSOR_H
diff --git a/linden/indra/llcommon/llprocessor.cpp b/linden/indra/llcommon/llprocessor.cpp
index b811678..3408cb1 100644
--- a/linden/indra/llcommon/llprocessor.cpp
+++ b/linden/indra/llcommon/llprocessor.cpp
@@ -604,7 +604,7 @@ bool CProcessor::AnalyzeIntelProcessor()
604 mov sig3, edx 604 mov sig3, edx
605 } 605 }
606 // Then we convert the data to a readable string 606 // Then we convert the data to a readable string
607 snprintf( 607 snprintf( /* Flawfinder: ignore */
608 CPUInfo.strProcessorSerial, 608 CPUInfo.strProcessorSerial,
609 sizeof(CPUInfo.strProcessorSerial), 609 sizeof(CPUInfo.strProcessorSerial),
610 "%04lX-%04lX-%04lX-%04lX-%04lX-%04lX", 610 "%04lX-%04lX-%04lX-%04lX-%04lX-%04lX",
@@ -612,15 +612,15 @@ bool CProcessor::AnalyzeIntelProcessor()
612 sig1 & 0xFFFF, 612 sig1 & 0xFFFF,
613 sig3 >> 16, 613 sig3 >> 16,
614 sig3 & 0xFFFF, 614 sig3 & 0xFFFF,
615 sig2 >> 16, sig2 & 0xFFFF); /* Flawfinder: ignore */ 615 sig2 >> 16, sig2 & 0xFFFF);
616 } 616 }
617 else 617 else
618 { 618 {
619 // If there's no serial number support we just put "No serial number" 619 // If there's no serial number support we just put "No serial number"
620 snprintf( 620 snprintf( /* Flawfinder: ignore */
621 CPUInfo.strProcessorSerial, 621 CPUInfo.strProcessorSerial,
622 sizeof(CPUInfo.strProcessorSerial), 622 sizeof(CPUInfo.strProcessorSerial),
623 "No Processor Serial Number"); /* Flawfinder: ignore */ 623 "No Processor Serial Number");
624 } 624 }
625 625
626 // Now we get the standard processor extensions 626 // Now we get the standard processor extensions
@@ -854,7 +854,7 @@ bool CProcessor::AnalyzeAMDProcessor()
854 break; 854 break;
855 case 0xD: // Model = 0xD: K6-2+ / K6-III+ 855 case 0xD: // Model = 0xD: K6-2+ / K6-III+
856 strcpy(CPUInfo.strModel, "AMD K6-2+ or K6-III+ (0.18 micron)"); /* Flawfinder: ignore */ 856 strcpy(CPUInfo.strModel, "AMD K6-2+ or K6-III+ (0.18 micron)"); /* Flawfinder: ignore */
857 strncat(strCPUName, "AMD K6-2+ or K6-III+ (0.18 micron)", sizeof(strCPUName) - strlen(strCPUName) -1); 857 strncat(strCPUName, "AMD K6-2+ or K6-III+ (0.18 micron)", sizeof(strCPUName) - strlen(strCPUName) -1); /* Flawfinder: ignore */
858 break; 858 break;
859 default: // ... 859 default: // ...
860 strcpy(CPUInfo.strModel, "Unknown AMD K5 or K6 model"); /* Flawfinder: ignore */ 860 strcpy(CPUInfo.strModel, "Unknown AMD K5 or K6 model"); /* Flawfinder: ignore */
diff --git a/linden/indra/llcommon/llqueuedthread.cpp b/linden/indra/llcommon/llqueuedthread.cpp
index 565836b..2e4324b 100644
--- a/linden/indra/llcommon/llqueuedthread.cpp
+++ b/linden/indra/llcommon/llqueuedthread.cpp
@@ -31,10 +31,9 @@
31//============================================================================ 31//============================================================================
32 32
33// MAIN THREAD 33// MAIN THREAD
34LLQueuedThread::LLQueuedThread(const std::string& name, bool threaded, bool runalways) : 34LLQueuedThread::LLQueuedThread(const std::string& name, bool threaded) :
35 LLThread(name), 35 LLThread(name),
36 mThreaded(threaded), 36 mThreaded(threaded),
37 mRunAlways(runalways),
38 mIdleThread(TRUE), 37 mIdleThread(TRUE),
39 mNextHandle(0) 38 mNextHandle(0)
40{ 39{
@@ -47,6 +46,12 @@ LLQueuedThread::LLQueuedThread(const std::string& name, bool threaded, bool runa
47// MAIN THREAD 46// MAIN THREAD
48LLQueuedThread::~LLQueuedThread() 47LLQueuedThread::~LLQueuedThread()
49{ 48{
49 shutdown();
50 // ~LLThread() will be called here
51}
52
53void LLQueuedThread::shutdown()
54{
50 setQuitting(); 55 setQuitting();
51 56
52 unpause(); // MAIN THREAD 57 unpause(); // MAIN THREAD
@@ -73,61 +78,69 @@ LLQueuedThread::~LLQueuedThread()
73 } 78 }
74 79
75 QueuedRequest* req; 80 QueuedRequest* req;
81 S32 active_count = 0;
76 while ( (req = (QueuedRequest*)mRequestHash.pop_element()) ) 82 while ( (req = (QueuedRequest*)mRequestHash.pop_element()) )
77 { 83 {
84 if (req->getStatus() == STATUS_QUEUED || req->getStatus() == STATUS_INPROGRESS)
85 {
86 ++active_count;
87 }
78 req->deleteRequest(); 88 req->deleteRequest();
79 } 89 }
80 90 if (active_count)
81 // ~LLThread() will be called here 91 {
92 llwarns << "~LLQueuedThread() called with active requests: " << active_count << llendl;
93 }
82} 94}
83 95
84//---------------------------------------------------------------------------- 96//----------------------------------------------------------------------------
85 97
86// MAIN THREAD 98// MAIN THREAD
87void LLQueuedThread::update(U32 ms_elapsed) 99// virtual
100S32 LLQueuedThread::update(U32 max_time_ms)
88{ 101{
89 updateQueue(0); 102 return updateQueue(max_time_ms);
90} 103}
91 104
92void LLQueuedThread::updateQueue(S32 inc) 105S32 LLQueuedThread::updateQueue(U32 max_time_ms)
93{ 106{
94 // If mRunAlways == TRUE, unpause the thread whenever we put something into the queue. 107 F64 max_time = (F64)max_time_ms * .001;
95 // If mRunAlways == FALSE, we only unpause the thread when updateQueue() is called from the main loop (i.e. between rendered frames) 108 LLTimer timer;
96 109 S32 pending = 1;
97 if (inc == 0) // Frame Update 110
111 // Frame Update
112 if (mThreaded)
98 { 113 {
99 if (mThreaded) 114 pending = getPending();
100 { 115 unpause();
101 unpause(); 116 }
102 wake(); // Wake the thread up if necessary. 117 else
103 } 118 {
104 else 119 while (pending > 0)
105 { 120 {
106 while (processNextRequest() > 0) 121 pending = processNextRequest();
107 ; 122 if (max_time && timer.getElapsedTimeF64() > max_time)
123 break;
108 } 124 }
109 } 125 }
110 else 126 return pending;
127}
128
129void LLQueuedThread::incQueue()
130{
131 // Something has been added to the queue
132 if (!isPaused())
111 { 133 {
112 // Something has been added to the queue 134 if (mThreaded)
113 if (mRunAlways)
114 { 135 {
115 if (mThreaded) 136 wake(); // Wake the thread up if necessary.
116 {
117 wake(); // Wake the thread up if necessary.
118 }
119 else
120 {
121 while(processNextRequest() > 0)
122 ;
123 }
124 } 137 }
125 } 138 }
126} 139}
127 140
128//virtual 141//virtual
129// May be called from any thread 142// May be called from any thread
130S32 LLQueuedThread::getPending(bool child_thread) 143S32 LLQueuedThread::getPending()
131{ 144{
132 S32 res; 145 S32 res;
133 lockData(); 146 lockData();
@@ -141,7 +154,7 @@ void LLQueuedThread::waitOnPending()
141{ 154{
142 while(1) 155 while(1)
143 { 156 {
144 updateQueue(0); 157 update(0);
145 158
146 if (mIdleThread) 159 if (mIdleThread)
147 { 160 {
@@ -200,7 +213,7 @@ bool LLQueuedThread::addRequest(QueuedRequest* req)
200#endif 213#endif
201 unlockData(); 214 unlockData();
202 215
203 updateQueue(1); 216 incQueue();
204 217
205 return true; 218 return true;
206} 219}
@@ -214,7 +227,7 @@ bool LLQueuedThread::waitForResult(LLQueuedThread::handle_t handle, bool auto_co
214 bool done = false; 227 bool done = false;
215 while(!done) 228 while(!done)
216 { 229 {
217 updateQueue(0); // unpauses 230 update(0); // unpauses
218 lockData(); 231 lockData();
219 QueuedRequest* req = (QueuedRequest*)mRequestHash.find(handle); 232 QueuedRequest* req = (QueuedRequest*)mRequestHash.find(handle);
220 if (!req) 233 if (!req)
@@ -272,51 +285,47 @@ LLQueuedThread::status_t LLQueuedThread::getRequestStatus(handle_t handle)
272 return res; 285 return res;
273} 286}
274 287
275LLQueuedThread::status_t LLQueuedThread::abortRequest(handle_t handle, U32 flags) 288void LLQueuedThread::abortRequest(handle_t handle, bool autocomplete)
276{ 289{
277 status_t res = STATUS_EXPIRED;
278 lockData(); 290 lockData();
279 QueuedRequest* req = (QueuedRequest*)mRequestHash.find(handle); 291 QueuedRequest* req = (QueuedRequest*)mRequestHash.find(handle);
280 if (req) 292 if (req)
281 { 293 {
282 res = req->abortRequest(flags); 294 req->setFlags(FLAG_ABORT | (autocomplete ? FLAG_AUTO_COMPLETE : 0));
283 if ((flags & AUTO_COMPLETE) && (res == STATUS_COMPLETE))
284 {
285 mRequestHash.erase(handle);
286 req->deleteRequest();
287// check();
288 }
289#if _DEBUG
290// llinfos << llformat("LLQueuedThread::Aborted req [%08d]",handle) << llendl;
291#endif
292 } 295 }
293 unlockData(); 296 unlockData();
294 return res;
295} 297}
296 298
297// MAIN thread 299// MAIN thread
298LLQueuedThread::status_t LLQueuedThread::setFlags(handle_t handle, U32 flags) 300void LLQueuedThread::setFlags(handle_t handle, U32 flags)
299{ 301{
300 status_t res = STATUS_EXPIRED;
301 lockData(); 302 lockData();
302 QueuedRequest* req = (QueuedRequest*)mRequestHash.find(handle); 303 QueuedRequest* req = (QueuedRequest*)mRequestHash.find(handle);
303 if (req) 304 if (req)
304 { 305 {
305 res = req->setFlags(flags); 306 req->setFlags(flags);
306 } 307 }
307 unlockData(); 308 unlockData();
308 return res;
309} 309}
310 310
311void LLQueuedThread::setPriority(handle_t handle, U32 priority) 311void LLQueuedThread::setPriority(handle_t handle, U32 priority)
312{ 312{
313 lockData(); 313 lockData();
314 QueuedRequest* req = (QueuedRequest*)mRequestHash.find(handle); 314 QueuedRequest* req = (QueuedRequest*)mRequestHash.find(handle);
315 if (req && (req->getStatus() == STATUS_QUEUED)) 315 if (req)
316 { 316 {
317 llverify(mRequestQueue.erase(req) == 1); 317 if(req->getStatus() == STATUS_INPROGRESS)
318 req->setPriority(priority); 318 {
319 mRequestQueue.insert(req); 319 // not in list
320 req->setPriority(priority);
321 }
322 else if(req->getStatus() == STATUS_QUEUED)
323 {
324 // remove from list then re-insert
325 llverify(mRequestQueue.erase(req) == 1);
326 req->setPriority(priority);
327 mRequestQueue.insert(req);
328 }
320 } 329 }
321 unlockData(); 330 unlockData();
322} 331}
@@ -328,9 +337,10 @@ bool LLQueuedThread::completeRequest(handle_t handle)
328 QueuedRequest* req = (QueuedRequest*)mRequestHash.find(handle); 337 QueuedRequest* req = (QueuedRequest*)mRequestHash.find(handle);
329 if (req) 338 if (req)
330 { 339 {
331 llassert(req->getStatus() != STATUS_QUEUED && req->getStatus() != STATUS_ABORT); 340 llassert_always(req->getStatus() != STATUS_QUEUED);
341 llassert_always(req->getStatus() != STATUS_INPROGRESS);
332#if _DEBUG 342#if _DEBUG
333// llinfos << llformat("LLQueuedThread::Completed req [%08d]",handle) << llendl; 343// llinfos << llformat("LLQueuedThread::Completed req [%08d]",handle) << llendl;
334#endif 344#endif
335 mRequestHash.erase(handle); 345 mRequestHash.erase(handle);
336 req->deleteRequest(); 346 req->deleteRequest();
@@ -364,28 +374,34 @@ bool LLQueuedThread::check()
364//============================================================================ 374//============================================================================
365// Runs on its OWN thread 375// Runs on its OWN thread
366 376
367int LLQueuedThread::processNextRequest() 377S32 LLQueuedThread::processNextRequest()
368{ 378{
369 QueuedRequest *req = 0; 379 QueuedRequest *req;
370 // Get next request from pool 380 // Get next request from pool
371 lockData(); 381 lockData();
372 while(1) 382 while(1)
373 { 383 {
374 if (!mRequestQueue.empty()) 384 req = NULL;
385 if (mRequestQueue.empty())
375 { 386 {
376 req = *mRequestQueue.begin(); 387 break;
377 mRequestQueue.erase(mRequestQueue.begin());
378 } 388 }
379 if (req && req->getStatus() == STATUS_ABORT) 389 req = *mRequestQueue.begin();
390 mRequestQueue.erase(mRequestQueue.begin());
391 if ((req->getFlags() & FLAG_ABORT) || (mStatus == QUITTING))
380 { 392 {
381 req->setStatus(STATUS_ABORTED); 393 req->setStatus(STATUS_ABORTED);
382 req = 0; 394 req->finishRequest(false);
383 } 395 if (req->getFlags() & FLAG_AUTO_COMPLETE)
384 else 396 {
385 { 397 mRequestHash.erase(req);
386 llassert (!req || req->getStatus() == STATUS_QUEUED) 398 req->deleteRequest();
387 break; 399// check();
400 }
401 continue;
388 } 402 }
403 llassert_always(req->getStatus() == STATUS_QUEUED);
404 break;
389 } 405 }
390 if (req) 406 if (req)
391 { 407 {
@@ -393,22 +409,22 @@ int LLQueuedThread::processNextRequest()
393 } 409 }
394 unlockData(); 410 unlockData();
395 411
396 // This is the only place we will cal req->setStatus() after 412 // This is the only place we will call req->setStatus() after
397 // it has initially been seet to STATUS_QUEUED, so it is 413 // it has initially been seet to STATUS_QUEUED, so it is
398 // safe to access req. 414 // safe to access req.
399 if (req) 415 if (req)
400 { 416 {
401 // process request 417 // process request
402 bool complete = processRequest(req); 418 bool complete = req->processRequest();
403 419
404 if (complete) 420 if (complete)
405 { 421 {
406 lockData(); 422 lockData();
407 req->setStatus(STATUS_COMPLETE); 423 req->setStatus(STATUS_COMPLETE);
408 req->finishRequest(); 424 req->finishRequest(true);
409 if (req->getFlags() & AUTO_COMPLETE) 425 if (req->getFlags() & FLAG_AUTO_COMPLETE)
410 { 426 {
411 llverify(mRequestHash.erase(req)) 427 mRequestHash.erase(req);
412 req->deleteRequest(); 428 req->deleteRequest();
413// check(); 429// check();
414 } 430 }
@@ -419,12 +435,18 @@ int LLQueuedThread::processNextRequest()
419 lockData(); 435 lockData();
420 req->setStatus(STATUS_QUEUED); 436 req->setStatus(STATUS_QUEUED);
421 mRequestQueue.insert(req); 437 mRequestQueue.insert(req);
438 U32 priority = req->getPriority();
422 unlockData(); 439 unlockData();
440 if (priority < PRIORITY_NORMAL)
441 {
442 ms_sleep(1); // sleep the thread a little
443 }
423 } 444 }
424 } 445 }
425 446
426 int res; 447 S32 res;
427 if (getPending(true) == 0) 448 S32 pending = getPending();
449 if (pending == 0)
428 { 450 {
429 if (isQuitting()) 451 if (isQuitting())
430 { 452 {
@@ -437,7 +459,7 @@ int LLQueuedThread::processNextRequest()
437 } 459 }
438 else 460 else
439 { 461 {
440 res = 1; 462 res = pending;
441 } 463 }
442 return res; 464 return res;
443} 465}
@@ -445,13 +467,14 @@ int LLQueuedThread::processNextRequest()
445bool LLQueuedThread::runCondition() 467bool LLQueuedThread::runCondition()
446{ 468{
447 // mRunCondition must be locked here 469 // mRunCondition must be locked here
448 return (mRequestQueue.empty() && mIdleThread) ? FALSE : TRUE; 470 if (mRequestQueue.empty() && mIdleThread)
471 return false;
472 else
473 return true;
449} 474}
450 475
451void LLQueuedThread::run() 476void LLQueuedThread::run()
452{ 477{
453 llinfos << "QUEUED THREAD STARTING" << llendl;
454
455 while (1) 478 while (1)
456 { 479 {
457 // this will block on the condition until runCondition() returns true, the thread is unpaused, or the thread leaves the RUNNING state. 480 // this will block on the condition until runCondition() returns true, the thread is unpaused, or the thread leaves the RUNNING state.
@@ -474,6 +497,8 @@ void LLQueuedThread::run()
474 { 497 {
475 break; 498 break;
476 } 499 }
500
501 //LLThread::yield(); // thread should yield after each request
477 } 502 }
478 503
479 llinfos << "QUEUED THREAD " << mName << " EXITING." << llendl; 504 llinfos << "QUEUED THREAD " << mName << " EXITING." << llendl;
@@ -491,20 +516,18 @@ LLQueuedThread::QueuedRequest::QueuedRequest(LLQueuedThread::handle_t handle, U3
491 516
492LLQueuedThread::QueuedRequest::~QueuedRequest() 517LLQueuedThread::QueuedRequest::~QueuedRequest()
493{ 518{
494 if (mStatus != STATUS_DELETE) 519 llassert_always(mStatus == STATUS_DELETE);
495 {
496 llerrs << "Attemt to directly delete a LLQueuedThread::QueuedRequest; use deleteRequest()" << llendl;
497 }
498} 520}
499 521
500//virtual 522//virtual
501void LLQueuedThread::QueuedRequest::finishRequest() 523void LLQueuedThread::QueuedRequest::finishRequest(bool completed)
502{ 524{
503} 525}
504 526
505//virtual 527//virtual
506void LLQueuedThread::QueuedRequest::deleteRequest() 528void LLQueuedThread::QueuedRequest::deleteRequest()
507{ 529{
530 llassert_always(mStatus != STATUS_INPROGRESS);
508 setStatus(STATUS_DELETE); 531 setStatus(STATUS_DELETE);
509 delete this; 532 delete this;
510} 533}
diff --git a/linden/indra/llcommon/llqueuedthread.h b/linden/indra/llcommon/llqueuedthread.h
index cc21b3b..7231285 100644
--- a/linden/indra/llcommon/llqueuedthread.h
+++ b/linden/indra/llcommon/llqueuedthread.h
@@ -52,7 +52,8 @@ public:
52 PRIORITY_HIGH = 0x30000000, 52 PRIORITY_HIGH = 0x30000000,
53 PRIORITY_NORMAL = 0x20000000, 53 PRIORITY_NORMAL = 0x20000000,
54 PRIORITY_LOW = 0x10000000, 54 PRIORITY_LOW = 0x10000000,
55 PRIORITY_LOWBITS = 0x0FFFFFFF 55 PRIORITY_LOWBITS = 0x0FFFFFFF,
56 PRIORITY_HIGHBITS = 0x70000000
56 }; 57 };
57 enum status_t { 58 enum status_t {
58 STATUS_EXPIRED = -1, 59 STATUS_EXPIRED = -1,
@@ -60,13 +61,13 @@ public:
60 STATUS_QUEUED = 1, 61 STATUS_QUEUED = 1,
61 STATUS_INPROGRESS = 2, 62 STATUS_INPROGRESS = 2,
62 STATUS_COMPLETE = 3, 63 STATUS_COMPLETE = 3,
63 STATUS_ABORT = 4, 64 STATUS_ABORTED = 4,
64 STATUS_ABORTED = 5, 65 STATUS_DELETE = 5
65 STATUS_DELETE = 6
66 }; 66 };
67 enum flags_t { 67 enum flags_t {
68 AUTO_COMPLETE = 1, 68 FLAG_AUTO_COMPLETE = 1,
69 AUTO_DELETE = 2 // child-class dependent 69 FLAG_AUTO_DELETE = 2, // child-class dependent
70 FLAG_ABORT = 4
70 }; 71 };
71 72
72 typedef U32 handle_t; 73 typedef U32 handle_t;
@@ -79,7 +80,7 @@ public:
79 friend class LLQueuedThread; 80 friend class LLQueuedThread;
80 81
81 protected: 82 protected:
82 ~QueuedRequest(); // use deleteRequest() 83 virtual ~QueuedRequest(); // use deleteRequest()
83 84
84 public: 85 public:
85 QueuedRequest(handle_t handle, U32 priority, U32 flags = 0); 86 QueuedRequest(handle_t handle, U32 priority, U32 flags = 0);
@@ -111,26 +112,14 @@ public:
111 mStatus = newstatus; 112 mStatus = newstatus;
112 return oldstatus; 113 return oldstatus;
113 } 114 }
114 status_t abortRequest(U32 flags) 115 void setFlags(U32 flags)
115 { 116 {
116 // NOTE: flags are |'d 117 // NOTE: flags are |'d
117 if (mStatus == STATUS_QUEUED)
118 {
119 setStatus(STATUS_ABORT);
120 }
121 mFlags |= flags; 118 mFlags |= flags;
122 status_t status = mStatus;
123 return status;
124 }
125 status_t setFlags(U32 flags)
126 {
127 // NOTE: flags are |'d
128 mFlags |= flags;
129 status_t status = mStatus;
130 return status;
131 } 119 }
132 120
133 virtual void finishRequest(); // Always called when after has been processed 121 virtual bool processRequest() = 0; // Return true when request has completed
122 virtual void finishRequest(bool completed); // Always called from thread after request has completed or aborted
134 virtual void deleteRequest(); // Only method to delete a request 123 virtual void deleteRequest(); // Only method to delete a request
135 124
136 void setPriority(U32 pri) 125 void setPriority(U32 pri)
@@ -160,9 +149,10 @@ public:
160 static handle_t nullHandle() { return handle_t(0); } 149 static handle_t nullHandle() { return handle_t(0); }
161 150
162public: 151public:
163 LLQueuedThread(const std::string& name, bool threaded = TRUE, bool runalways = TRUE); 152 LLQueuedThread(const std::string& name, bool threaded = true);
164 virtual ~LLQueuedThread(); 153 virtual ~LLQueuedThread();
165 154 virtual void shutdown();
155
166private: 156private:
167 // No copy constructor or copy assignment 157 // No copy constructor or copy assignment
168 LLQueuedThread(const LLQueuedThread&); 158 LLQueuedThread(const LLQueuedThread&);
@@ -174,26 +164,25 @@ private:
174protected: 164protected:
175 handle_t generateHandle(); 165 handle_t generateHandle();
176 bool addRequest(QueuedRequest* req); 166 bool addRequest(QueuedRequest* req);
177 int processNextRequest(void); 167 S32 processNextRequest(void);
168 void incQueue();
178 169
179 virtual bool processRequest(QueuedRequest* req) = 0;
180
181public: 170public:
182 bool waitForResult(handle_t handle, bool auto_complete = true); 171 bool waitForResult(handle_t handle, bool auto_complete = true);
183 172
184 void update(U32 ms_elapsed); 173 virtual S32 update(U32 max_time_ms);
185 void updateQueue(S32 inc); 174 S32 updateQueue(U32 max_time_ms);
175
186 void waitOnPending(); 176 void waitOnPending();
187 void printQueueStats(); 177 void printQueueStats();
188 178
189 S32 getPending(bool child_thread = false); 179 S32 getPending();
190 bool getThreaded() { return mThreaded ? true : false; } 180 bool getThreaded() { return mThreaded ? true : false; }
191 bool getRunAlways() { return mRunAlways ? true : false; }
192 181
193 // Request accessors 182 // Request accessors
194 status_t getRequestStatus(handle_t handle); 183 status_t getRequestStatus(handle_t handle);
195 status_t abortRequest(handle_t handle, U32 flags = 0); 184 void abortRequest(handle_t handle, bool autocomplete);
196 status_t setFlags(handle_t handle, U32 flags); 185 void setFlags(handle_t handle, U32 flags);
197 void setPriority(handle_t handle, U32 priority); 186 void setPriority(handle_t handle, U32 priority);
198 bool completeRequest(handle_t handle); 187 bool completeRequest(handle_t handle);
199 // This is public for support classes like LLWorkerThread, 188 // This is public for support classes like LLWorkerThread,
@@ -205,7 +194,6 @@ public:
205 194
206protected: 195protected:
207 BOOL mThreaded; // if false, run on main thread and do updates during update() 196 BOOL mThreaded; // if false, run on main thread and do updates during update()
208 BOOL mRunAlways; // if false, only wake the threads when updateClass() is called
209 LLAtomic32<BOOL> mIdleThread; // request queue is empty (or we are quitting) and the thread is idle 197 LLAtomic32<BOOL> mIdleThread; // request queue is empty (or we are quitting) and the thread is idle
210 198
211 typedef std::set<QueuedRequest*, queued_request_less> request_queue_t; 199 typedef std::set<QueuedRequest*, queued_request_less> request_queue_t;
diff --git a/linden/indra/llcommon/llsd.cpp b/linden/indra/llcommon/llsd.cpp
index 7a0ff9d..342e356 100644
--- a/linden/indra/llcommon/llsd.cpp
+++ b/linden/indra/llcommon/llsd.cpp
@@ -27,8 +27,12 @@
27 27
28#include "llsd.h" 28#include "llsd.h"
29 29
30#include <sstream>
30#include <math.h> 31#include <math.h>
32
33#include "llerror.h"
31#include "../llmath/llmath.h" 34#include "../llmath/llmath.h"
35#include "llformat.h"
32 36
33namespace { 37namespace {
34 class ImplMap; 38 class ImplMap;
@@ -251,7 +255,7 @@ namespace {
251 public: 255 public:
252 ImplUUID(const LLSD::UUID& v) : Base(v) { } 256 ImplUUID(const LLSD::UUID& v) : Base(v) { }
253 257
254 virtual LLSD::String asString() const{ return mValue.getString(); } 258 virtual LLSD::String asString() const{ return mValue.asString(); }
255 virtual LLSD::UUID asUUID() const { return mValue; } 259 virtual LLSD::UUID asUUID() const { return mValue; }
256 }; 260 };
257 261
diff --git a/linden/indra/llcommon/llsdserialize.cpp b/linden/indra/llcommon/llsdserialize.cpp
index 4c00c98..653fc66 100644
--- a/linden/indra/llcommon/llsdserialize.cpp
+++ b/linden/indra/llcommon/llsdserialize.cpp
@@ -804,7 +804,7 @@ S32 LLSDBinaryParser::parse(std::istream& istr, LLSD& data) const
804 // the size, and read it. 804 // the size, and read it.
805 // *FIX: Should we set a maximum size? 805 // *FIX: Should we set a maximum size?
806 U32 size_nbo = 0; 806 U32 size_nbo = 0;
807 istr.read((char*)&size_nbo, sizeof(U32)); 807 istr.read((char*)&size_nbo, sizeof(U32)); /*Flawfinder: ignore*/
808 S32 size = (S32)ntohl(size_nbo); 808 S32 size = (S32)ntohl(size_nbo);
809 std::vector<U8> value; 809 std::vector<U8> value;
810 if(size) 810 if(size)
@@ -944,7 +944,7 @@ void LLSDFormatter::realFormat(const std::string& format)
944void LLSDFormatter::formatReal(LLSD::Real real, std::ostream& ostr) const 944void LLSDFormatter::formatReal(LLSD::Real real, std::ostream& ostr) const
945{ 945{
946 char buffer[MAX_STRING]; /* Flawfinder: ignore */ 946 char buffer[MAX_STRING]; /* Flawfinder: ignore */
947 snprintf(buffer, MAX_STRING, mRealFormat.c_str(), real); 947 snprintf(buffer, MAX_STRING, mRealFormat.c_str(), real); /* Flawfinder: ignore */
948 ostr << buffer; 948 ostr << buffer;
949} 949}
950 950
diff --git a/linden/indra/llcommon/llsdserialize_xml.cpp b/linden/indra/llcommon/llsdserialize_xml.cpp
index 892f454..bb36fa7 100644
--- a/linden/indra/llcommon/llsdserialize_xml.cpp
+++ b/linden/indra/llcommon/llsdserialize_xml.cpp
@@ -190,6 +190,7 @@ S32 LLSDXMLFormatter::format_impl(const LLSD& data, std::ostream& ostr, U32 opti
190 else 190 else
191 { 191 {
192 // *FIX: memory inefficient. 192 // *FIX: memory inefficient.
193 // *TODO: convert to use LLBase64
193 ostr << pre << "<binary encoding=\"base64\">"; 194 ostr << pre << "<binary encoding=\"base64\">";
194 int b64_buffer_length = apr_base64_encode_len(buffer.size()); 195 int b64_buffer_length = apr_base64_encode_len(buffer.size());
195 char* b64_buffer = new char[b64_buffer_length]; 196 char* b64_buffer = new char[b64_buffer_length];
diff --git a/linden/indra/llcommon/llsecondlifeurls.cpp b/linden/indra/llcommon/llsecondlifeurls.cpp
index 6050d7f..4372373 100644
--- a/linden/indra/llcommon/llsecondlifeurls.cpp
+++ b/linden/indra/llcommon/llsecondlifeurls.cpp
@@ -76,7 +76,5 @@ const char LSL_DOC_URL[] =
76const char SL_KB_URL[] = 76const char SL_KB_URL[] =
77 "http://secondlife.com/knowledgebase/"; 77 "http://secondlife.com/knowledgebase/";
78 78
79const char ACCOUNT_TRANSACTIONS_URL[] =
80 "https://secondlife.com/account/transactions.php";
81
82const char RELEASE_NOTES[] = "releasenotes.txt"; 79const char RELEASE_NOTES[] = "releasenotes.txt";
80
diff --git a/linden/indra/llcommon/llsecondlifeurls.h b/linden/indra/llcommon/llsecondlifeurls.h
index f338bc3..1f7d359 100644
--- a/linden/indra/llcommon/llsecondlifeurls.h
+++ b/linden/indra/llcommon/llsecondlifeurls.h
@@ -50,18 +50,9 @@ extern const char UPGRADE_TO_PREMIUM_URL[];
50// How to get DirectX 9 50// How to get DirectX 9
51extern const char DIRECTX_9_URL[]; 51extern const char DIRECTX_9_URL[];
52 52
53// On AMD with bad AGP controller
54extern const char AMD_AGP_URL[];
55
56// Out of date VIA chipset 53// Out of date VIA chipset
57extern const char VIA_URL[]; 54extern const char VIA_URL[];
58 55
59// Out of date intel chipset driver
60extern const char INTEL_CHIPSET_URL[];
61
62// Out of date SiS chipset driver
63extern const char SIS_CHIPSET_URL[];
64
65// Linden Blogs page 56// Linden Blogs page
66extern const char BLOGS_URL[]; 57extern const char BLOGS_URL[];
67 58
@@ -74,9 +65,6 @@ extern const char LSL_DOC_URL[];
74// SL KnowledgeBase page 65// SL KnowledgeBase page
75extern const char SL_KB_URL[]; 66extern const char SL_KB_URL[];
76 67
77// Account transactions
78extern const char ACCOUNT_TRANSACTIONS_URL[];
79
80// Local Url Release Notes 68// Local Url Release Notes
81extern const char RELEASE_NOTES[]; 69extern const char RELEASE_NOTES[];
82 70
diff --git a/linden/indra/llcommon/llstreamtools.cpp b/linden/indra/llcommon/llstreamtools.cpp
index b68edd3..2c78e05 100644
--- a/linden/indra/llcommon/llstreamtools.cpp
+++ b/linden/indra/llcommon/llstreamtools.cpp
@@ -553,7 +553,7 @@ std::istream& fullread(std::istream& str, char *buf, std::streamsize requested)
553 553
554std::istream& operator>>(std::istream& str, const char *tocheck) 554std::istream& operator>>(std::istream& str, const char *tocheck)
555{ 555{
556 char c; 556 char c = '\0';
557 const char *p; 557 const char *p;
558 p = tocheck; 558 p = tocheck;
559 while (*p && !str.bad()) 559 while (*p && !str.bad())
diff --git a/linden/indra/llcommon/llstrider.h b/linden/indra/llcommon/llstrider.h
index 07b8c48..efc2ae4 100644
--- a/linden/indra/llcommon/llstrider.h
+++ b/linden/indra/llcommon/llstrider.h
@@ -51,6 +51,7 @@ public:
51 Object* operator->() { return mObjectp; } 51 Object* operator->() { return mObjectp; }
52 Object& operator *() { return *mObjectp; } 52 Object& operator *() { return *mObjectp; }
53 Object* operator ++(int) { Object* old = mObjectp; mBytep += mSkip; return old; } 53 Object* operator ++(int) { Object* old = mObjectp; mBytep += mSkip; return old; }
54 Object* operator +=(int i) { mBytep += mSkip*i; return mObjectp; }
54 Object& operator[](U32 index) { return *(Object*)(mBytep + (mSkip * index)); } 55 Object& operator[](U32 index) { return *(Object*)(mBytep + (mSkip * index)); }
55}; 56};
56 57
diff --git a/linden/indra/llcommon/llstring.cpp b/linden/indra/llcommon/llstring.cpp
index 5cb42cc..c9f684f 100644
--- a/linden/indra/llcommon/llstring.cpp
+++ b/linden/indra/llcommon/llstring.cpp
@@ -195,6 +195,7 @@ llutf16string utf8str_to_utf16str ( const LLString& utf8str )
195LLWString utf16str_to_wstring(const llutf16string &utf16str, S32 len) 195LLWString utf16str_to_wstring(const llutf16string &utf16str, S32 len)
196{ 196{
197 LLWString wout; 197 LLWString wout;
198 if((len <= 0) || utf16str.empty()) return wout;
198 199
199 S32 i = 0; 200 S32 i = 0;
200 // craziness to make gcc happy (llutf16string.c_str() is tweaked on linux): 201 // craziness to make gcc happy (llutf16string.c_str() is tweaked on linux):
diff --git a/linden/indra/llcommon/llstring.h b/linden/indra/llcommon/llstring.h
index a83b7cf..0485a1e 100644
--- a/linden/indra/llcommon/llstring.h
+++ b/linden/indra/llcommon/llstring.h
@@ -30,6 +30,7 @@
30 30
31#include "stdtypes.h" 31#include "stdtypes.h"
32#include "llerror.h" 32#include "llerror.h"
33#include "llfile.h"
33#include <algorithm> 34#include <algorithm>
34#include <map> 35#include <map>
35#include <stdio.h> 36#include <stdio.h>
@@ -101,7 +102,7 @@ struct char_traits<U16>
101 102
102 static char_type* 103 static char_type*
103 copy(char_type* __s1, const char_type* __s2, size_t __n) 104 copy(char_type* __s1, const char_type* __s2, size_t __n)
104 { return static_cast<char_type*>(memcpy(__s1, __s2, __n * sizeof(char_type))); } 105 { return static_cast<char_type*>(memcpy(__s1, __s2, __n * sizeof(char_type))); } /* Flawfinder: ignore */
105 106
106 static char_type* 107 static char_type*
107 assign(char_type* __s, size_t __n, char_type __a) 108 assign(char_type* __s, size_t __n, char_type __a)
@@ -922,7 +923,7 @@ void LLStringBase<T>::replaceNonstandardASCII( std::basic_string<T>& string, T r
922 923
923//static 924//static
924template<class T> 925template<class T>
925void LLStringBase<T>::replaceTabsWithSpaces( std::basic_string<T>& string, size_type spaces_per_tab ) 926void LLStringBase<T>::replaceTabsWithSpaces( std::basic_string<T>& str, size_type spaces_per_tab )
926{ 927{
927 llassert( spaces_per_tab >= 0 ); 928 llassert( spaces_per_tab >= 0 );
928 929
@@ -931,19 +932,19 @@ void LLStringBase<T>::replaceTabsWithSpaces( std::basic_string<T>& string, size_
931 932
932 LLStringBase<T> out_str; 933 LLStringBase<T> out_str;
933 // Replace tabs with spaces 934 // Replace tabs with spaces
934 for (size_type i = 0; i < string.length(); i++) 935 for (size_type i = 0; i < str.length(); i++)
935 { 936 {
936 if (string[i] == TAB) 937 if (str[i] == TAB)
937 { 938 {
938 for (size_type j = 0; j < spaces_per_tab; j++) 939 for (size_type j = 0; j < spaces_per_tab; j++)
939 out_str += SPACE; 940 out_str += SPACE;
940 } 941 }
941 else 942 else
942 { 943 {
943 out_str += string[i]; 944 out_str += str[i];
944 } 945 }
945 } 946 }
946 string = out_str; 947 str = out_str;
947} 948}
948 949
949//static 950//static
diff --git a/linden/indra/llcommon/llstringtable.h b/linden/indra/llcommon/llstringtable.h
index d53c0e1..ddfef88 100644
--- a/linden/indra/llcommon/llstringtable.h
+++ b/linden/indra/llcommon/llstringtable.h
@@ -29,14 +29,15 @@
29#ifndef LL_STRING_TABLE_H 29#ifndef LL_STRING_TABLE_H
30#define LL_STRING_TABLE_H 30#define LL_STRING_TABLE_H
31 31
32#include "lldefs.h"
33#include "llformat.h"
32#include "llstl.h" 34#include "llstl.h"
33#include <list> 35#include <list>
34#include <set> 36#include <set>
35 37
36#if LL_WINDOWS 38#if LL_WINDOWS
37# if (_MSC_VER >= 1300) 39# if (_MSC_VER >= 1300 && _MSC_VER < 1400)
38# define STRING_TABLE_HASH_MAP 1 40# define STRING_TABLE_HASH_MAP 1
39# pragma warning(disable : 4996)
40# endif 41# endif
41#else 42#else
42//# define STRING_TABLE_HASH_MAP 1 43//# define STRING_TABLE_HASH_MAP 1
diff --git a/linden/indra/llcommon/llsys.cpp b/linden/indra/llcommon/llsys.cpp
index 148e4de..906bc65 100644
--- a/linden/indra/llcommon/llsys.cpp
+++ b/linden/indra/llcommon/llsys.cpp
@@ -132,23 +132,23 @@ LLOSInfo::LLOSInfo() :
132 char tmp[MAX_STRING]; /* Flawfinder: ignore */ 132 char tmp[MAX_STRING]; /* Flawfinder: ignore */
133 if(osvi.dwMajorVersion <= 4) 133 if(osvi.dwMajorVersion <= 4)
134 { 134 {
135 snprintf( 135 snprintf( /* Flawfinder: ignore */
136 tmp, 136 tmp,
137 sizeof(tmp), 137 sizeof(tmp),
138 "version %d.%d %s (Build %d)", 138 "version %d.%d %s (Build %d)",
139 osvi.dwMajorVersion, 139 osvi.dwMajorVersion,
140 osvi.dwMinorVersion, 140 osvi.dwMinorVersion,
141 csdversion.c_str(), 141 csdversion.c_str(),
142 (osvi.dwBuildNumber & 0xffff)); /* Flawfinder: ignore */ 142 (osvi.dwBuildNumber & 0xffff));
143 } 143 }
144 else 144 else
145 { 145 {
146 snprintf( 146 snprintf( /* Flawfinder: ignore */
147 tmp, 147 tmp,
148 sizeof(tmp), 148 sizeof(tmp),
149 "%s (Build %d)", 149 "%s (Build %d)",
150 csdversion.c_str(), 150 csdversion.c_str(),
151 (osvi.dwBuildNumber & 0xffff)); /*Flawfinder: ignore*/ 151 (osvi.dwBuildNumber & 0xffff));
152 } 152 }
153 mOSString += tmp; 153 mOSString += tmp;
154 } 154 }
@@ -250,7 +250,7 @@ U32 LLOSInfo::getProcessVirtualSizeKB()
250#if LL_WINDOWS 250#if LL_WINDOWS
251#endif 251#endif
252#if LL_LINUX 252#if LL_LINUX
253 FILE *status_filep = LLFile::fopen("/proc/self/status", "r"); 253 FILE* status_filep = LLFile::fopen("/proc/self/status", "r"); /* Flawfinder: ignore */
254 S32 numRead = 0; 254 S32 numRead = 0;
255 char buff[STATUS_SIZE]; /* Flawfinder: ignore */ 255 char buff[STATUS_SIZE]; /* Flawfinder: ignore */
256 bzero(buff, STATUS_SIZE); 256 bzero(buff, STATUS_SIZE);
@@ -276,7 +276,7 @@ U32 LLOSInfo::getProcessResidentSizeKB()
276#if LL_WINDOWS 276#if LL_WINDOWS
277#endif 277#endif
278#if LL_LINUX 278#if LL_LINUX
279 FILE *status_filep = LLFile::fopen("/proc/self/status", "r"); 279 FILE* status_filep = LLFile::fopen("/proc/self/status", "r"); /* Flawfinder: ignore */
280 if (status_filep != NULL) 280 if (status_filep != NULL)
281 { 281 {
282 S32 numRead = 0; 282 S32 numRead = 0;
diff --git a/linden/indra/llcommon/llthread.cpp b/linden/indra/llcommon/llthread.cpp
index 290879d..d6b52f7 100644
--- a/linden/indra/llcommon/llthread.cpp
+++ b/linden/indra/llcommon/llthread.cpp
@@ -100,6 +100,11 @@ LLThread::LLThread(const std::string& name, apr_pool_t *poolp) :
100 100
101LLThread::~LLThread() 101LLThread::~LLThread()
102{ 102{
103 shutdown();
104}
105
106void LLThread::shutdown()
107{
103 // Warning! If you somehow call the thread destructor from itself, 108 // Warning! If you somehow call the thread destructor from itself,
104 // the thread will die in an unclean fashion! 109 // the thread will die in an unclean fashion!
105 if (mAPRThreadp) 110 if (mAPRThreadp)
@@ -205,18 +210,6 @@ void LLThread::checkPause()
205 210
206//============================================================================ 211//============================================================================
207 212
208bool LLThread::isQuitting() const
209{
210 return (QUITTING == mStatus);
211}
212
213
214bool LLThread::isStopped() const
215{
216 return (STOPPED == mStatus);
217}
218
219
220void LLThread::setQuitting() 213void LLThread::setQuitting()
221{ 214{
222 mRunCondition->lock(); 215 mRunCondition->lock();
@@ -347,3 +340,49 @@ void LLCondition::broadcast()
347 apr_thread_cond_broadcast(mAPRCondp); 340 apr_thread_cond_broadcast(mAPRCondp);
348} 341}
349 342
343//============================================================================
344
345//----------------------------------------------------------------------------
346
347//static
348LLMutex* LLThreadSafeRefCount::sMutex = 0;
349
350//static
351void LLThreadSafeRefCount::initClass()
352{
353 if (!sMutex)
354 {
355 sMutex = new LLMutex(0);
356 }
357}
358
359//static
360void LLThreadSafeRefCount::cleanupClass()
361{
362 delete sMutex;
363 sMutex = NULL;
364}
365
366
367//----------------------------------------------------------------------------
368
369LLThreadSafeRefCount::LLThreadSafeRefCount() :
370 mRef(0)
371{
372}
373
374LLThreadSafeRefCount::~LLThreadSafeRefCount()
375{
376 if (mRef != 0)
377 {
378 llerrs << "deleting non-zero reference" << llendl;
379 }
380}
381
382//============================================================================
383
384LLResponder::~LLResponder()
385{
386}
387
388//============================================================================
diff --git a/linden/indra/llcommon/llthread.h b/linden/indra/llcommon/llthread.h
index 2a13d72..cdf1d33 100644
--- a/linden/indra/llcommon/llthread.h
+++ b/linden/indra/llcommon/llthread.h
@@ -30,6 +30,7 @@
30 30
31#include "llapr.h" 31#include "llapr.h"
32#include "llapp.h" 32#include "llapp.h"
33#include "llmemory.h"
33 34
34#include "apr-1/apr_thread_cond.h" 35#include "apr-1/apr_thread_cond.h"
35 36
@@ -49,19 +50,20 @@ public:
49 50
50 LLThread(const std::string& name, apr_pool_t *poolp = NULL); 51 LLThread(const std::string& name, apr_pool_t *poolp = NULL);
51 virtual ~LLThread(); // Warning! You almost NEVER want to destroy a thread unless it's in the STOPPED state. 52 virtual ~LLThread(); // Warning! You almost NEVER want to destroy a thread unless it's in the STOPPED state.
52 53 virtual void shutdown(); // stops the thread
54
53 static void yield(); // Static because it can be called by the main thread, which doesn't have an LLThread data structure. 55 static void yield(); // Static because it can be called by the main thread, which doesn't have an LLThread data structure.
54 56
55 57
56 bool isQuitting() const; 58 bool isQuitting() const { return (QUITTING == mStatus); }
57 bool isStopped() const; 59 bool isStopped() const { return (STOPPED == mStatus); }
58 60
59 // PAUSE / RESUME functionality. See source code for important usage notes. 61 // PAUSE / RESUME functionality. See source code for important usage notes.
60public: 62public:
61 // Called from MAIN THREAD. 63 // Called from MAIN THREAD.
62 void pause(); 64 void pause();
63 void unpause(); 65 void unpause();
64 bool isPaused() { return mPaused ? true : false; } 66 bool isPaused() { return isStopped() || mPaused == TRUE; }
65 67
66 // Cause the thread to wake up and check its condition 68 // Cause the thread to wake up and check its condition
67 void wake(); 69 void wake();
@@ -79,7 +81,7 @@ public:
79 81
80private: 82private:
81 BOOL mPaused; 83 BOOL mPaused;
82 84
83 // static function passed to APR thread creation routine 85 // static function passed to APR thread creation routine
84 static void *APR_THREAD_FUNC staticRun(apr_thread_t *apr_threadp, void *datap); 86 static void *APR_THREAD_FUNC staticRun(apr_thread_t *apr_threadp, void *datap);
85 87
@@ -180,4 +182,67 @@ void LLThread::unlockData()
180 182
181//============================================================================ 183//============================================================================
182 184
185// see llmemory.h for LLPointer<> definition
186
187class LLThreadSafeRefCount
188{
189public:
190 static void initClass(); // creates sMutex
191 static void cleanupClass(); // destroys sMutex
192
193private:
194 static LLMutex* sMutex;
195
196private:
197 LLThreadSafeRefCount(const LLThreadSafeRefCount&); // not implemented
198 LLThreadSafeRefCount&operator=(const LLThreadSafeRefCount&); // not implemented
199
200protected:
201 virtual ~LLThreadSafeRefCount(); // use unref()
202
203public:
204 LLThreadSafeRefCount();
205
206 void ref()
207 {
208 if (sMutex) sMutex->lock();
209 mRef++;
210 if (sMutex) sMutex->unlock();
211 }
212
213 S32 unref()
214 {
215 llassert(mRef >= 1);
216 if (sMutex) sMutex->lock();
217 S32 res = --mRef;
218 if (sMutex) sMutex->unlock();
219 if (0 == res)
220 {
221 delete this;
222 res = 0;
223 }
224 return res;
225 }
226 S32 getNumRefs() const
227 {
228 return mRef;
229 }
230
231private:
232 S32 mRef;
233};
234
235//============================================================================
236
237// Simple responder for self destructing callbacks
238// Pure virtual class
239class LLResponder : public LLThreadSafeRefCount
240{
241public:
242 virtual ~LLResponder();
243 virtual void completed(bool success) = 0;
244};
245
246//============================================================================
247
183#endif // LL_LLTHREAD_H 248#endif // LL_LLTHREAD_H
diff --git a/linden/indra/llcommon/lluri.cpp b/linden/indra/llcommon/lluri.cpp
index e697ec1..bc3540e 100644
--- a/linden/indra/llcommon/lluri.cpp
+++ b/linden/indra/llcommon/lluri.cpp
@@ -32,273 +32,86 @@
32#include "llapp.h" 32#include "llapp.h"
33#include "lluri.h" 33#include "lluri.h"
34#include "llsd.h" 34#include "llsd.h"
35 35#include <iomanip>
36
36#include "../llmath/lluuid.h" 37#include "../llmath/lluuid.h"
37 38
38// uric = reserved | unreserved | escaped 39
39// reserved = ";" | "/" | "?" | ":" | "@" | "&" | "=" | "+" | "$" | "," 40// static
40// unreserved = alphanum | mark 41std::string LLURI::escape(const std::string& str, const std::string & allowed)
41// mark = "-" | "_" | "." | "!" | "~" | "*" | "'" | "(" | ")"
42// escaped = "%" hex hex
43static const char* ESCAPED_CHARACTERS[256] =
44{ 42{
45 "%00", // 0 43 std::ostringstream ostr;
46 "%01", // 1 44
47 "%02", // 2 45 std::string::const_iterator it = str.begin();
48 "%03", // 3 46 std::string::const_iterator end = str.end();
49 "%04", // 4 47 for(; it != end; ++it)
50 "%05", // 5 48 {
51 "%06", // 6 49 std::string::value_type c = *it;
52 "%07", // 7 50 if(allowed.find(c) == std::string::npos)
53 "%08", // 8 51 {
54 "%09", // 9 52 ostr << "%"
55 "%0a", // 10 53 << std::uppercase << std::hex << std::setw(2) << std::setfill('0')
56 "%0b", // 11 54 << static_cast<U32>(c);
57 "%0c", // 12 55 }
58 "%0d", // 13 56 else
59 "%0e", // 14 57 {
60 "%0f", // 15 58 ostr << c;
61 "%10", // 16 59 }
62 "%11", // 17 60 }
63 "%12", // 18 61 return ostr.str();
64 "%13", // 19 62}
65 "%14", // 20 63
66 "%15", // 21 64// static
67 "%16", // 22 65std::string LLURI::unescape(const std::string& str)
68 "%17", // 23 66{
69 "%18", // 24 67 std::ostringstream ostr;
70 "%19", // 25 68 std::string::const_iterator it = str.begin();
71 "%1a", // 26 69 std::string::const_iterator end = str.end();
72 "%1b", // 27 70 for(; it != end; ++it)
73 "%1c", // 28 71 {
74 "%1d", // 29 72 if((*it) == '%')
75 "%1e", // 30 73 {
76 "%1f", // 31 74 ++it;
77 "%20", // 32 75 if(it == end) break;
78 "!", // 33 76 U8 c = hex_as_nybble(*it++);
79 "%22", // 34 77 c = c << 4;
80 "%23", // 35 78 if (it == end) break;
81 "$", // 36 79 c |= hex_as_nybble(*it);
82 "%25", // 37 80 ostr.put((char)c);
83 "&", // 38 81 }
84 "'", // 39 82 else
85 "(", // 40 83 {
86 ")", // 41 84 ostr.put(*it);
87 "*", // 42 85 }
88 "+", // 43 86 }
89 ",", // 44 87 return ostr.str();
90 "-", // 45 88}
91 ".", // 46 89
92 "/", // 47 90namespace
93 "0", // 48 91{
94 "1", // 49 92 const std::string unreserved()
95 "2", // 50 93 {
96 "3", // 51 94 static const std::string s =
97 "4", // 52 95 "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
98 "5", // 53 96 "0123456789"
99 "6", // 54 97 "-._~";
100 "7", // 55 98 return s;
101 "8", // 56 99 }
102 "9", // 57 100 const std::string sub_delims()
103 ":", // 58 101 {
104 ";", // 59 102 static const std::string s = "!$&'()*+,;=";
105 "%3c", // 60 103 return s;
106 "=", // 61 104 }
107 "%3e", // 62 105
108 "?", // 63 106 std::string escapeHostAndPort(const std::string& s)
109 "@", // 64 107 { return LLURI::escape(s, unreserved() + sub_delims() +":"); }
110 "A", // 65 108 std::string escapePathComponent(const std::string& s)
111 "B", // 66 109 { return LLURI::escape(s, unreserved() + sub_delims() + ":@"); }
112 "C", // 67 110 std::string escapeQueryVariable(const std::string& s)
113 "D", // 68 111 { return LLURI::escape(s, unreserved() + ":@!$'()*+,"); } // sub_delims - "&;=" + ":@"
114 "E", // 69 112 std::string escapeQueryValue(const std::string& s)
115 "F", // 70 113 { return LLURI::escape(s, unreserved() + ":@!$'()*+,="); } // sub_delims - "&;" + ":@"
116 "G", // 71 114}
117 "H", // 72
118 "I", // 73
119 "J", // 74
120 "K", // 75
121 "L", // 76
122 "M", // 77
123 "N", // 78
124 "O", // 79
125 "P", // 80
126 "Q", // 81
127 "R", // 82
128 "S", // 83
129 "T", // 84
130 "U", // 85
131 "V", // 86
132 "W", // 87
133 "X", // 88
134 "Y", // 89
135 "Z", // 90
136 "%5b", // 91
137 "%5c", // 92
138 "%5d", // 93
139 "%5e", // 94
140 "_", // 95
141 "%60", // 96
142 "a", // 97
143 "b", // 98
144 "c", // 99
145 "d", // 100
146 "e", // 101
147 "f", // 102
148 "g", // 103
149 "h", // 104
150 "i", // 105
151 "j", // 106
152 "k", // 107
153 "l", // 108
154 "m", // 109
155 "n", // 110
156 "o", // 111
157 "p", // 112
158 "q", // 113
159 "r", // 114
160 "s", // 115
161 "t", // 116
162 "u", // 117
163 "v", // 118
164 "w", // 119
165 "x", // 120
166 "y", // 121
167 "z", // 122
168 "%7b", // 123
169 "%7c", // 124
170 "%7d", // 125
171 "~", // 126
172 "%7f", // 127
173 "%80", // 128
174 "%81", // 129
175 "%82", // 130
176 "%83", // 131
177 "%84", // 132
178 "%85", // 133
179 "%86", // 134
180 "%87", // 135
181 "%88", // 136
182 "%89", // 137
183 "%8a", // 138
184 "%8b", // 139
185 "%8c", // 140
186 "%8d", // 141
187 "%8e", // 142
188 "%8f", // 143
189 "%90", // 144
190 "%91", // 145
191 "%92", // 146
192 "%93", // 147
193 "%94", // 148
194 "%95", // 149
195 "%96", // 150
196 "%97", // 151
197 "%98", // 152
198 "%99", // 153
199 "%9a", // 154
200 "%9b", // 155
201 "%9c", // 156
202 "%9d", // 157
203 "%9e", // 158
204 "%9f", // 159
205 "%a0", // 160
206 "%a1", // 161
207 "%a2", // 162
208 "%a3", // 163
209 "%a4", // 164
210 "%a5", // 165
211 "%a6", // 166
212 "%a7", // 167
213 "%a8", // 168
214 "%a9", // 169
215 "%aa", // 170
216 "%ab", // 171
217 "%ac", // 172
218 "%ad", // 173
219 "%ae", // 174
220 "%af", // 175
221 "%b0", // 176
222 "%b1", // 177
223 "%b2", // 178
224 "%b3", // 179
225 "%b4", // 180
226 "%b5", // 181
227 "%b6", // 182
228 "%b7", // 183
229 "%b8", // 184
230 "%b9", // 185
231 "%ba", // 186
232 "%bb", // 187
233 "%bc", // 188
234 "%bd", // 189
235 "%be", // 190
236 "%bf", // 191
237 "%c0", // 192
238 "%c1", // 193
239 "%c2", // 194
240 "%c3", // 195
241 "%c4", // 196
242 "%c5", // 197
243 "%c6", // 198
244 "%c7", // 199
245 "%c8", // 200
246 "%c9", // 201
247 "%ca", // 202
248 "%cb", // 203
249 "%cc", // 204
250 "%cd", // 205
251 "%ce", // 206
252 "%cf", // 207
253 "%d0", // 208
254 "%d1", // 209
255 "%d2", // 210
256 "%d3", // 211
257 "%d4", // 212
258 "%d5", // 213
259 "%d6", // 214
260 "%d7", // 215
261 "%d8", // 216
262 "%d9", // 217
263 "%da", // 218
264 "%db", // 219
265 "%dc", // 220
266 "%dd", // 221
267 "%de", // 222
268 "%df", // 223
269 "%e0", // 224
270 "%e1", // 225
271 "%e2", // 226
272 "%e3", // 227
273 "%e4", // 228
274 "%e5", // 229
275 "%e6", // 230
276 "%e7", // 231
277 "%e8", // 232
278 "%e9", // 233
279 "%ea", // 234
280 "%eb", // 235
281 "%ec", // 236
282 "%ed", // 237
283 "%ee", // 238
284 "%ef", // 239
285 "%f0", // 240
286 "%f1", // 241
287 "%f2", // 242
288 "%f3", // 243
289 "%f4", // 244
290 "%f5", // 245
291 "%f6", // 246
292 "%f7", // 247
293 "%f8", // 248
294 "%f9", // 249
295 "%fa", // 250
296 "%fb", // 251
297 "%fc", // 252
298 "%fd", // 253
299 "%fe", // 254
300 "%ff" // 255
301};
302 115
303LLURI::LLURI() 116LLURI::LLURI()
304{ 117{
@@ -371,24 +184,23 @@ LLURI::~LLURI()
371{ 184{
372} 185}
373 186
374 187// static
375LLURI LLURI::buildHTTP(const std::string& host_port, 188LLURI LLURI::buildHTTP(const std::string& prefix,
376 const LLSD& path) 189 const LLSD& path)
377{ 190{
378 LLURI result; 191 LLURI result;
379 192
380 // TODO: deal with '/' '?' '#' in host_port 193 // TODO: deal with '/' '?' '#' in host_port
381 S32 index = host_port.find("://"); 194 if (prefix.find("://") != prefix.npos)
382 if (index != host_port.npos)
383 { 195 {
384 // The scheme is part of the host_port 196 // it is a prefix
385 result.mScheme = ""; 197 result = LLURI(prefix);
386 result.mEscapedAuthority = escape(host_port);
387 } 198 }
388 else 199 else
389 { 200 {
390 result.mScheme = "HTTP"; 201 // it is just a host and optional port
391 result.mEscapedAuthority = "//" + escape(host_port); 202 result.mScheme = "http";
203 result.mEscapedAuthority = escapeHostAndPort(prefix);
392 } 204 }
393 205
394 if (path.isArray()) 206 if (path.isArray())
@@ -399,20 +211,20 @@ LLURI LLURI::buildHTTP(const std::string& host_port,
399 ++it) 211 ++it)
400 { 212 {
401 lldebugs << "PATH: inserting " << it->asString() << llendl; 213 lldebugs << "PATH: inserting " << it->asString() << llendl;
402 result.mEscapedPath += "/" + escape(it->asString()); 214 result.mEscapedPath += "/" + escapePathComponent(it->asString());
403 } 215 }
404 } 216 }
405 result.mEscapedOpaque = result.mEscapedAuthority + 217 result.mEscapedOpaque = "//" + result.mEscapedAuthority +
406 result.mEscapedPath; 218 result.mEscapedPath;
407 return result; 219 return result;
408} 220}
409 221
410// static 222// static
411LLURI LLURI::buildHTTP(const std::string& host_port, 223LLURI LLURI::buildHTTP(const std::string& prefix,
412 const LLSD& path, 224 const LLSD& path,
413 const LLSD& query) 225 const LLSD& query)
414{ 226{
415 LLURI result = buildHTTP(host_port, path); 227 LLURI result = buildHTTP(prefix, path);
416 // break out and escape each query component 228 // break out and escape each query component
417 if (query.isMap()) 229 if (query.isMap())
418 { 230 {
@@ -420,8 +232,8 @@ LLURI LLURI::buildHTTP(const std::string& host_port,
420 it != query.endMap(); 232 it != query.endMap();
421 it++) 233 it++)
422 { 234 {
423 result.mEscapedQuery += escape(it->first) + 235 result.mEscapedQuery += escapeQueryVariable(it->first) +
424 (it->second.isUndefined() ? "" : "=" + it->second.asString()) + 236 (it->second.isUndefined() ? "" : "=" + escapeQueryValue(it->second.asString())) +
425 "&"; 237 "&";
426 } 238 }
427 if (query.size() > 0) 239 if (query.size() > 0)
@@ -433,8 +245,61 @@ LLURI LLURI::buildHTTP(const std::string& host_port,
433} 245}
434 246
435// static 247// static
248LLURI LLURI::buildHTTP(const std::string& host,
249 const U32& port,
250 const LLSD& path)
251{
252 return LLURI::buildHTTP(llformat("%s:%u", host.c_str(), port), path);
253}
254
255// static
256LLURI LLURI::buildHTTP(const std::string& host,
257 const U32& port,
258 const LLSD& path,
259 const LLSD& query)
260{
261 return LLURI::buildHTTP(llformat("%s:%u", host.c_str(), port), path, query);
262}
263
264
265namespace {
266 LLURI buildBackboneURL(LLApp* app,
267 const std::string& p1 = "",
268 const std::string& p2 = "",
269 const std::string& p3 = "")
270 {
271 std::string host = "localhost:12040";
272
273 if (app)
274 {
275 host = app->getOption("backbone-host-port").asString();
276 }
277
278 LLSD path = LLSD::emptyArray();
279 if (!p1.empty()) path.append(p1);
280 if (!p2.empty()) path.append(p2);
281 if (!p3.empty()) path.append(p3);
282
283 return LLURI::buildHTTP(host, path);
284 }
285}
286
287
288// static
436LLURI LLURI::buildAgentPresenceURI(const LLUUID& agent_id, LLApp* app) 289LLURI LLURI::buildAgentPresenceURI(const LLUUID& agent_id, LLApp* app)
437{ 290{
291 return buildBackboneURL(app, "agent", agent_id.asString(), "presence");
292}
293
294// static
295LLURI LLURI::buildBulkAgentPresenceURI(LLApp* app)
296{
297 return buildBackboneURL(app, "agent", "presence");
298}
299
300// static
301LLURI LLURI::buildBulkAgentNamesURI(LLApp* app)
302{
438 std::string host = "localhost:12040"; 303 std::string host = "localhost:12040";
439 304
440 if (app) 305 if (app)
@@ -444,14 +309,19 @@ LLURI LLURI::buildAgentPresenceURI(const LLUUID& agent_id, LLApp* app)
444 309
445 LLSD path = LLSD::emptyArray(); 310 LLSD path = LLSD::emptyArray();
446 path.append("agent"); 311 path.append("agent");
447 path.append(agent_id); 312 path.append("names");
448 path.append("presence");
449 313
450 return buildHTTP(host, path); 314 return buildHTTP(host, path);
451} 315}
452 316
453// static 317// static
454LLURI LLURI::buildBulkAgentPresenceURI(LLApp* app) 318LLURI LLURI::buildAgentSessionURI(const LLUUID& agent_id, LLApp* app)
319{
320 return buildBackboneURL(app, "agent", agent_id.asString(), "session");
321}
322
323// static
324LLURI LLURI::buildInventoryHostURI(const LLUUID& agent_id, LLApp* app)
455{ 325{
456 std::string host = "localhost:12040"; 326 std::string host = "localhost:12040";
457 327
@@ -462,13 +332,15 @@ LLURI LLURI::buildBulkAgentPresenceURI(LLApp* app)
462 332
463 LLSD path = LLSD::emptyArray(); 333 LLSD path = LLSD::emptyArray();
464 path.append("agent"); 334 path.append("agent");
465 path.append("presence"); 335 path.append(agent_id);
336 path.append("inventory");
337 path.append("host");
466 338
467 return buildHTTP(host, path); 339 return buildHTTP(host, path);
468} 340}
469 341
470// static 342// static
471LLURI LLURI::buildAgentSessionURI(const LLUUID& agent_id, LLApp* app) 343LLURI LLURI::buildAgentNameURI(const LLUUID& agent_id, LLApp* app)
472{ 344{
473 std::string host = "localhost:12040"; 345 std::string host = "localhost:12040";
474 346
@@ -480,7 +352,7 @@ LLURI LLURI::buildAgentSessionURI(const LLUUID& agent_id, LLApp* app)
480 LLSD path = LLSD::emptyArray(); 352 LLSD path = LLSD::emptyArray();
481 path.append("agent"); 353 path.append("agent");
482 path.append(agent_id); 354 path.append(agent_id);
483 path.append("session"); 355 path.append("name");
484 356
485 return buildHTTP(host, path); 357 return buildHTTP(host, path);
486} 358}
@@ -636,43 +508,3 @@ LLSD LLURI::queryMap(std::string escaped_query_string)
636 return result; 508 return result;
637} 509}
638 510
639// static
640std::string LLURI::escape(const std::string& str)
641{
642 std::ostringstream ostr;
643 std::string::const_iterator it = str.begin();
644 std::string::const_iterator end = str.end();
645 S32 c;
646 for(; it != end; ++it)
647 {
648 c = (S32)(*it);
649 ostr << ESCAPED_CHARACTERS[c];
650 }
651 return ostr.str();
652}
653
654// static
655std::string LLURI::unescape(const std::string& str)
656{
657 std::ostringstream ostr;
658 std::string::const_iterator it = str.begin();
659 std::string::const_iterator end = str.end();
660 for(; it != end; ++it)
661 {
662 if((*it) == '%')
663 {
664 ++it;
665 if(it == end) break;
666 U8 c = hex_as_nybble(*it++);
667 c = c << 4;
668 if (it == end) break;
669 c |= hex_as_nybble(*it);
670 ostr.put((char)c);
671 }
672 else
673 {
674 ostr.put(*it);
675 }
676 }
677 return ostr.str();
678}
diff --git a/linden/indra/llcommon/lluri.h b/linden/indra/llcommon/lluri.h
index f69472f..60b3d48 100644
--- a/linden/indra/llcommon/lluri.h
+++ b/linden/indra/llcommon/lluri.h
@@ -45,54 +45,70 @@ class LLApp;
45class LLURI 45class LLURI
46{ 46{
47public: 47public:
48 LLURI(); 48 LLURI();
49 LLURI(const std::string& escaped_str); 49 LLURI(const std::string& escaped_str);
50 // construct from escaped string, as would be transmitted on the net 50 // construct from escaped string, as would be transmitted on the net
51 51
52 ~LLURI(); 52 ~LLURI();
53 53
54 static LLURI buildHTTP(const std::string& host_port, 54 static LLURI buildHTTP(const std::string& prefix,
55 const LLSD& path); 55 const LLSD& path);
56 static LLURI buildHTTP(const std::string& host_port, 56 static LLURI buildHTTP(const std::string& prefix,
57 const LLSD& path, 57 const LLSD& path,
58 const LLSD& query); 58 const LLSD& query);
59 59 // prefix is either a full URL prefix of the form "http://example.com:8080",
60 std::string asString() const; 60 // or it can be simply a host and optional port like "example.com" or
61 // the whole URI, escaped as needed 61 // "example.com:8080", in these cases, the "http://" will be added
62 62
63 // Parts of a URI 63 static LLURI buildHTTP(const std::string& host,
64 // These functions return parts of the decoded URI. The returned 64 const U32& port,
65 // strings are un-escaped as needed 65 const LLSD& path);
66 66 static LLURI buildHTTP(const std::string& host,
67 // for all schemes 67 const U32& port,
68 std::string scheme() const; // ex.: "http", note lack of colon 68 const LLSD& path,
69 std::string opaque() const; // everything after the colon 69 const LLSD& query);
70
71
72 std::string asString() const;
73 // the whole URI, escaped as needed
74
75 // Parts of a URI
76 // These functions return parts of the decoded URI. The returned
77 // strings are un-escaped as needed
78
79 // for all schemes
80 std::string scheme() const; // ex.: "http", note lack of colon
81 std::string opaque() const; // everything after the colon
82
83 // for schemes that follow path like syntax (http, https, ftp)
84 std::string authority() const; // ex.: "host.com:80"
85 std::string hostName() const; // ex.: "host.com"
86 U16 hostPort() const; // ex.: 80, will include implicit port
87 std::string path() const; // ex.: "/abc/def", includes leading slash
88 // LLSD pathArray() const; // above decoded into an array of strings
89 std::string query() const; // ex.: "x=34", section after "?"
90 LLSD queryMap() const; // above decoded into a map
91 static LLSD queryMap(std::string escaped_query_string);
70 92
71 // for schemes that follow path like syntax (http, https, ftp) 93 // Escaping Utilities
72 std::string authority() const; // ex.: "bob@host.com:80" 94 // Escape a string by urlencoding all the characters that aren't in the allowed string.
73 std::string hostName() const; // ex.: "host.com" 95 static std::string escape(const std::string& str, const std::string & allowed);
74 U16 hostPort() const; // ex.: 80, will include implicit port 96 static std::string unescape(const std::string& str);
75 std::string path() const; // ex.: "/abc/def", includes leading slash
76// LLSD pathArray() const; // above decoded into an array of strings
77 std::string query() const; // ex.: "x=34", section after "?"
78 LLSD queryMap() const; // above decoded into a map
79 static LLSD queryMap(std::string escaped_query_string);
80
81 // Escaping Utilities
82 static std::string escape(const std::string& str);
83 static std::string unescape(const std::string& str);
84 97
85 // Functions for building specific URIs for web services 98 // Functions for building specific URIs for web services
86 static LLURI buildAgentPresenceURI(const LLUUID& agent_id, LLApp* app); 99 static LLURI buildAgentPresenceURI(const LLUUID& agent_id, LLApp* app);
87 static LLURI buildBulkAgentPresenceURI(LLApp* app); 100 static LLURI buildBulkAgentPresenceURI(LLApp* app);
101 static LLURI buildBulkAgentNamesURI(LLApp* app);
88 static LLURI buildAgentSessionURI(const LLUUID& agent_id, LLApp* app); 102 static LLURI buildAgentSessionURI(const LLUUID& agent_id, LLApp* app);
89 static LLURI buildAgentLoginInfoURI(const LLUUID& agent_id, const std::string& dataserver); 103 static LLURI buildAgentLoginInfoURI(const LLUUID& agent_id, const std::string& dataserver);
104 static LLURI buildInventoryHostURI(const LLUUID& agent_id, LLApp* app);
105 static LLURI buildAgentNameURI(const LLUUID& agent_id, LLApp* app);
90private: 106private:
91 std::string mScheme; 107 std::string mScheme;
92 std::string mEscapedOpaque; 108 std::string mEscapedOpaque;
93 std::string mEscapedAuthority; 109 std::string mEscapedAuthority;
94 std::string mEscapedPath; 110 std::string mEscapedPath;
95 std::string mEscapedQuery; 111 std::string mEscapedQuery;
96}; 112};
97 113
98#endif // LL_LLURI_H 114#endif // LL_LLURI_H
diff --git a/linden/indra/llcommon/llversion.h b/linden/indra/llcommon/llversion.h
index af21f72..a3e5152 100644
--- a/linden/indra/llcommon/llversion.h
+++ b/linden/indra/llcommon/llversion.h
@@ -32,9 +32,9 @@
32 32
33// MUST ALSO change version number in secondlife setup.nsi 33// MUST ALSO change version number in secondlife setup.nsi
34const S32 LL_VERSION_MAJOR = 1; 34const S32 LL_VERSION_MAJOR = 1;
35const S32 LL_VERSION_MINOR = 13; 35const S32 LL_VERSION_MINOR = 14;
36const S32 LL_VERSION_PATCH = 3; 36const S32 LL_VERSION_PATCH = 0;
37const S32 LL_VERSION_BUILD = 2; 37const S32 LL_VERSION_BUILD = 0;
38 38
39 39
40 40
diff --git a/linden/indra/llcommon/llworkerthread.cpp b/linden/indra/llcommon/llworkerthread.cpp
index 3190046..4f99393 100644
--- a/linden/indra/llcommon/llworkerthread.cpp
+++ b/linden/indra/llcommon/llworkerthread.cpp
@@ -33,98 +33,86 @@
33#endif 33#endif
34 34
35//============================================================================ 35//============================================================================
36
37/*static*/ LLWorkerThread* LLWorkerThread::sLocal = NULL;
38/*static*/ std::set<LLWorkerThread*> LLWorkerThread::sThreadList;
39
40//============================================================================
41// Run on MAIN thread 36// Run on MAIN thread
42 37
43//static 38LLWorkerThread::LLWorkerThread(const std::string& name, bool threaded) :
44void LLWorkerThread::initClass(bool local_is_threaded, bool local_run_always) 39 LLQueuedThread(name, threaded),
40 mWorkerAPRPoolp(NULL)
45{ 41{
46 if (!sLocal) 42 apr_pool_create(&mWorkerAPRPoolp, NULL);
47 { 43 mDeleteMutex = new LLMutex(getAPRPool());
48 sLocal = new LLWorkerThread(local_is_threaded, local_run_always);
49 }
50} 44}
51 45
52//static 46LLWorkerThread::~LLWorkerThread()
53void LLWorkerThread::cleanupClass()
54{ 47{
55 if (sLocal) 48 // Delete any workers in the delete queue (should be safe - had better be!)
49 if (!mDeleteList.empty())
56 { 50 {
57 while (sLocal->getPending()) 51 llwarns << "Worker Thread: " << mName << " destroyed with " << mDeleteList.size()
58 { 52 << " entries in delete list." << llendl;
59 sLocal->update(0);
60 }
61 delete sLocal;
62 sLocal = NULL;
63 llassert(sThreadList.size() == 0);
64 } 53 }
65}
66 54
67//static 55 delete mDeleteMutex;
68S32 LLWorkerThread::updateClass(U32 ms_elapsed) 56
69{ 57 // ~LLQueuedThread() will be called here
70 for (std::set<LLWorkerThread*>::iterator iter = sThreadList.begin(); iter != sThreadList.end(); iter++)
71 {
72 (*iter)->update(ms_elapsed);
73 }
74 return getAllPending();
75} 58}
76 59
77//static 60// virtual
78S32 LLWorkerThread::getAllPending() 61S32 LLWorkerThread::update(U32 max_time_ms)
79{ 62{
80 S32 res = 0; 63 S32 res = LLQueuedThread::update(max_time_ms);
81 for (std::set<LLWorkerThread*>::iterator iter = sThreadList.begin(); iter != sThreadList.end(); iter++) 64 // Delete scheduled workers
65 std::vector<LLWorkerClass*> delete_list;
66 std::vector<LLWorkerClass*> abort_list;
67 mDeleteMutex->lock();
68 for (delete_list_t::iterator iter = mDeleteList.begin();
69 iter != mDeleteList.end(); )
82 { 70 {
83 res += (*iter)->getPending(); 71 delete_list_t::iterator curiter = iter++;
72 LLWorkerClass* worker = *curiter;
73 if (worker->deleteOK())
74 {
75 if (worker->getFlags(LLWorkerClass::WCF_WORK_FINISHED))
76 {
77 delete_list.push_back(worker);
78 mDeleteList.erase(curiter);
79 }
80 else if (!worker->getFlags(LLWorkerClass::WCF_ABORT_REQUESTED))
81 {
82 abort_list.push_back(worker);
83 }
84 }
84 } 85 }
85 return res; 86 mDeleteMutex->unlock();
86} 87 // abort and delete after releasing mutex
87 88 for (std::vector<LLWorkerClass*>::iterator iter = abort_list.begin();
88//static 89 iter != abort_list.end(); ++iter)
89void LLWorkerThread::pauseAll()
90{
91 for (std::set<LLWorkerThread*>::iterator iter = sThreadList.begin(); iter != sThreadList.end(); iter++)
92 { 90 {
93 (*iter)->pause(); 91 (*iter)->abortWork(false);
94 } 92 }
95} 93 for (std::vector<LLWorkerClass*>::iterator iter = delete_list.begin();
96 94 iter != delete_list.end(); ++iter)
97//static
98void LLWorkerThread::waitOnAllPending()
99{
100 for (std::set<LLWorkerThread*>::iterator iter = sThreadList.begin(); iter != sThreadList.end(); iter++)
101 { 95 {
102 (*iter)->waitOnPending(); 96 LLWorkerClass* worker = *iter;
97 if (worker->mRequestHandle)
98 {
99 // Finished but not completed
100 completeRequest(worker->mRequestHandle);
101 worker->mRequestHandle = LLWorkerThread::nullHandle();
102 worker->clearFlags(LLWorkerClass::WCF_HAVE_WORK);
103 }
104 delete *iter;
103 } 105 }
106 return res;
104} 107}
105 108
106//---------------------------------------------------------------------------- 109//----------------------------------------------------------------------------
107 110
108LLWorkerThread::LLWorkerThread(bool threaded, bool runalways) : 111LLWorkerThread::handle_t LLWorkerThread::addWorkRequest(LLWorkerClass* workerclass, S32 param, U32 priority)
109 LLQueuedThread("Worker", threaded, runalways)
110{
111 sThreadList.insert(this);
112}
113
114LLWorkerThread::~LLWorkerThread()
115{
116 llverify(sThreadList.erase(this) == 1);
117 // ~LLQueuedThread() will be called here
118}
119
120//----------------------------------------------------------------------------
121
122
123LLWorkerThread::handle_t LLWorkerThread::add(LLWorkerClass* workerclass, S32 param, U32 priority)
124{ 112{
125 handle_t handle = generateHandle(); 113 handle_t handle = generateHandle();
126 114
127 Request* req = new Request(handle, priority, workerclass, param); 115 WorkRequest* req = new WorkRequest(handle, priority, workerclass, param);
128 116
129 bool res = addRequest(req); 117 bool res = addRequest(req);
130 if (!res) 118 if (!res)
@@ -137,63 +125,80 @@ LLWorkerThread::handle_t LLWorkerThread::add(LLWorkerClass* workerclass, S32 par
137 return handle; 125 return handle;
138} 126}
139 127
140//============================================================================ 128void LLWorkerThread::deleteWorker(LLWorkerClass* workerclass)
141// Runs on its OWN thread
142
143bool LLWorkerThread::processRequest(QueuedRequest* qreq)
144{ 129{
145 Request *req = (Request*)qreq; 130 mDeleteMutex->lock();
146 131 mDeleteList.push_back(workerclass);
147 req->getWorkerClass()->setWorking(true); 132 mDeleteMutex->unlock();
148
149 bool complete = req->getWorkerClass()->doWork(req->getParam());
150
151 req->getWorkerClass()->setWorking(false);
152
153 LLThread::yield(); // worker thread should yield after each request
154
155 return complete;
156} 133}
157 134
158//============================================================================ 135//============================================================================
136// Runs on its OWN thread
159 137
160LLWorkerThread::Request::Request(handle_t handle, U32 priority, LLWorkerClass* workerclass, S32 param) : 138LLWorkerThread::WorkRequest::WorkRequest(handle_t handle, U32 priority, LLWorkerClass* workerclass, S32 param) :
161 LLQueuedThread::QueuedRequest(handle, priority), 139 LLQueuedThread::QueuedRequest(handle, priority),
162 mWorkerClass(workerclass), 140 mWorkerClass(workerclass),
163 mParam(param) 141 mParam(param)
164{ 142{
165} 143}
166 144
167void LLWorkerThread::Request::deleteRequest() 145LLWorkerThread::WorkRequest::~WorkRequest()
146{
147}
148
149// virtual (required for access by LLWorkerThread)
150void LLWorkerThread::WorkRequest::deleteRequest()
168{ 151{
169 LLQueuedThread::QueuedRequest::deleteRequest(); 152 LLQueuedThread::QueuedRequest::deleteRequest();
170} 153}
171 154
155// virtual
156bool LLWorkerThread::WorkRequest::processRequest()
157{
158 LLWorkerClass* workerclass = getWorkerClass();
159 workerclass->setWorking(true);
160 bool complete = workerclass->doWork(getParam());
161 workerclass->setWorking(false);
162 return complete;
163}
164
165// virtual
166void LLWorkerThread::WorkRequest::finishRequest(bool completed)
167{
168 LLWorkerClass* workerclass = getWorkerClass();
169 workerclass->finishWork(getParam(), completed);
170 U32 flags = LLWorkerClass::WCF_WORK_FINISHED | (completed ? 0 : LLWorkerClass::WCF_WORK_ABORTED);
171 workerclass->setFlags(flags);
172}
173
172//============================================================================ 174//============================================================================
173// LLWorkerClass:: operates in main thread 175// LLWorkerClass:: operates in main thread
174 176
175LLWorkerClass::LLWorkerClass(LLWorkerThread* workerthread, const std::string& name) 177LLWorkerClass::LLWorkerClass(LLWorkerThread* workerthread, const std::string& name)
176 : mWorkerThread(workerthread), 178 : mWorkerThread(workerthread),
177 mWorkerClassName(name), 179 mWorkerClassName(name),
178 mWorkHandle(LLWorkerThread::nullHandle()), 180 mRequestHandle(LLWorkerThread::nullHandle()),
181 mMutex(workerthread->getWorkerAPRPool()),
179 mWorkFlags(0) 182 mWorkFlags(0)
180{ 183{
181 if (!mWorkerThread) 184 if (!mWorkerThread)
182 { 185 {
183 mWorkerThread = LLWorkerThread::sLocal; 186 llerrs << "LLWorkerClass() called with NULL workerthread: " << name << llendl;
184 } 187 }
185} 188}
189
186LLWorkerClass::~LLWorkerClass() 190LLWorkerClass::~LLWorkerClass()
187{ 191{
188 if (mWorkHandle != LLWorkerThread::nullHandle()) 192 llassert_always(!(mWorkFlags & WCF_WORKING));
193 llassert_always(mWorkFlags & WCF_DELETE_REQUESTED);
194 if (mRequestHandle != LLWorkerThread::nullHandle())
189 { 195 {
190 LLWorkerThread::Request* workreq = (LLWorkerThread::Request*)mWorkerThread->getRequest(mWorkHandle); 196 LLWorkerThread::WorkRequest* workreq = (LLWorkerThread::WorkRequest*)mWorkerThread->getRequest(mRequestHandle);
191 if (!workreq) 197 if (!workreq)
192 { 198 {
193 llerrs << "LLWorkerClass destroyed with stale work handle" << llendl; 199 llerrs << "LLWorkerClass destroyed with stale work handle" << llendl;
194 } 200 }
195 if (workreq->getStatus() != LLWorkerThread::STATUS_ABORT && 201 if (workreq->getStatus() != LLWorkerThread::STATUS_ABORTED &&
196 workreq->getStatus() != LLWorkerThread::STATUS_ABORTED &&
197 workreq->getStatus() != LLWorkerThread::STATUS_COMPLETE) 202 workreq->getStatus() != LLWorkerThread::STATUS_COMPLETE)
198 { 203 {
199 llerrs << "LLWorkerClass destroyed with active worker! Worker Status: " << workreq->getStatus() << llendl; 204 llerrs << "LLWorkerClass destroyed with active worker! Worker Status: " << workreq->getStatus() << llendl;
@@ -203,21 +208,58 @@ LLWorkerClass::~LLWorkerClass()
203 208
204void LLWorkerClass::setWorkerThread(LLWorkerThread* workerthread) 209void LLWorkerClass::setWorkerThread(LLWorkerThread* workerthread)
205{ 210{
206 if (mWorkHandle != LLWorkerThread::nullHandle()) 211 mMutex.lock();
212 if (mRequestHandle != LLWorkerThread::nullHandle())
207 { 213 {
208 llerrs << "LLWorkerClass attempt to change WorkerThread with active worker!" << llendl; 214 llerrs << "LLWorkerClass attempt to change WorkerThread with active worker!" << llendl;
209 } 215 }
210 mWorkerThread = workerthread; 216 mWorkerThread = workerthread;
217 mMutex.unlock();
218}
219
220//----------------------------------------------------------------------------
221
222//virtual
223void LLWorkerClass::finishWork(S32 param, bool success)
224{
225}
226
227//virtual
228bool LLWorkerClass::deleteOK()
229{
230 return true; // default always OK
231}
232
233//----------------------------------------------------------------------------
234
235// Called from worker thread
236void LLWorkerClass::setWorking(bool working)
237{
238 mMutex.lock();
239 if (working)
240 {
241 llassert_always(!(mWorkFlags & WCF_WORKING));
242 setFlags(WCF_WORKING);
243 }
244 else
245 {
246 llassert_always((mWorkFlags & WCF_WORKING));
247 clearFlags(WCF_WORKING);
248 }
249 mMutex.unlock();
211} 250}
212 251
213//---------------------------------------------------------------------------- 252//----------------------------------------------------------------------------
214 253
215bool LLWorkerClass::yield() 254bool LLWorkerClass::yield()
216{ 255{
217 llassert(mWorkFlags & WCF_WORKING);
218 LLThread::yield(); 256 LLThread::yield();
219 mWorkerThread->checkPause(); 257 mWorkerThread->checkPause();
220 return (getFlags() & WCF_ABORT_REQUESTED) ? true : false; 258 bool res;
259 mMutex.lock();
260 res = (getFlags() & WCF_ABORT_REQUESTED) ? true : false;
261 mMutex.unlock();
262 return res;
221} 263}
222 264
223//---------------------------------------------------------------------------- 265//----------------------------------------------------------------------------
@@ -225,7 +267,9 @@ bool LLWorkerClass::yield()
225// calls startWork, adds doWork() to queue 267// calls startWork, adds doWork() to queue
226void LLWorkerClass::addWork(S32 param, U32 priority) 268void LLWorkerClass::addWork(S32 param, U32 priority)
227{ 269{
228 if (mWorkHandle != LLWorkerThread::nullHandle()) 270 mMutex.lock();
271 llassert_always(!(mWorkFlags & (WCF_WORKING|WCF_HAVE_WORK)));
272 if (mRequestHandle != LLWorkerThread::nullHandle())
229 { 273 {
230 llerrs << "LLWorkerClass attempt to add work with active worker!" << llendl; 274 llerrs << "LLWorkerClass attempt to add work with active worker!" << llendl;
231 } 275 }
@@ -233,70 +277,93 @@ void LLWorkerClass::addWork(S32 param, U32 priority)
233// llinfos << "addWork: " << mWorkerClassName << " Param: " << param << llendl; 277// llinfos << "addWork: " << mWorkerClassName << " Param: " << param << llendl;
234#endif 278#endif
235 startWork(param); 279 startWork(param);
236 mWorkHandle = mWorkerThread->add(this, param, priority); 280 clearFlags(WCF_WORK_FINISHED|WCF_WORK_ABORTED);
281 setFlags(WCF_HAVE_WORK);
282 mRequestHandle = mWorkerThread->addWorkRequest(this, param, priority);
283 mMutex.unlock();
237} 284}
238 285
239void LLWorkerClass::abortWork() 286void LLWorkerClass::abortWork(bool autocomplete)
240{ 287{
288 mMutex.lock();
241#if _DEBUG 289#if _DEBUG
242// LLWorkerThread::Request* workreq = mWorkerThread->getRequest(mWorkHandle); 290// LLWorkerThread::WorkRequest* workreq = mWorkerThread->getRequest(mRequestHandle);
243// if (workreq) 291// if (workreq)
244// llinfos << "abortWork: " << mWorkerClassName << " Param: " << workreq->getParam() << llendl; 292// llinfos << "abortWork: " << mWorkerClassName << " Param: " << workreq->getParam() << llendl;
245#endif 293#endif
246 mWorkerThread->abortRequest(mWorkHandle); 294 if (mRequestHandle != LLWorkerThread::nullHandle())
247 setFlags(WCF_ABORT_REQUESTED); 295 {
296 mWorkerThread->abortRequest(mRequestHandle, autocomplete);
297 mWorkerThread->setPriority(mRequestHandle, LLQueuedThread::PRIORITY_IMMEDIATE);
298 setFlags(WCF_ABORT_REQUESTED);
299 }
300 mMutex.unlock();
248} 301}
249 302
250// if doWork is complete or aborted, call endWork() and return true 303// if doWork is complete or aborted, call endWork() and return true
251bool LLWorkerClass::checkWork() 304bool LLWorkerClass::checkWork(bool aborting)
252{ 305{
306 LLMutexLock lock(&mMutex);
253 bool complete = false, abort = false; 307 bool complete = false, abort = false;
254 LLWorkerThread::Request* workreq = (LLWorkerThread::Request*)mWorkerThread->getRequest(mWorkHandle); 308 if (mRequestHandle != LLWorkerThread::nullHandle())
255 llassert(workreq);
256 if (getFlags(WCF_ABORT_REQUESTED) || workreq->getStatus() == LLWorkerThread::STATUS_ABORTED)
257 { 309 {
258 complete = true; 310 LLWorkerThread::WorkRequest* workreq = (LLWorkerThread::WorkRequest*)mWorkerThread->getRequest(mRequestHandle);
259 abort = true; 311 llassert_always(workreq);
312 LLQueuedThread::status_t status = workreq->getStatus();
313 if (status == LLWorkerThread::STATUS_ABORTED)
314 {
315 complete = true;
316 abort = true;
317 }
318 else if (status == LLWorkerThread::STATUS_COMPLETE)
319 {
320 complete = true;
321 }
322 else
323 {
324 llassert_always(!aborting || (workreq->getFlags() & LLQueuedThread::FLAG_ABORT));
325 }
326 if (complete)
327 {
328 llassert_always(!(getFlags(WCF_WORKING)));
329 endWork(workreq->getParam(), abort);
330 mWorkerThread->completeRequest(mRequestHandle);
331 mRequestHandle = LLWorkerThread::nullHandle();
332 clearFlags(WCF_HAVE_WORK);
333 }
260 } 334 }
261 else if (workreq->getStatus() == LLWorkerThread::STATUS_COMPLETE) 335 else
262 { 336 {
263 complete = true; 337 complete = true;
264 } 338 }
265 if (complete)
266 {
267#if _DEBUG
268// llinfos << "endWork: " << mWorkerClassName << " Param: " << workreq->getParam() << llendl;
269#endif
270 endWork(workreq->getParam(), abort);
271 mWorkerThread->completeRequest(mWorkHandle);
272 mWorkHandle = LLWorkerThread::nullHandle();
273 }
274 return complete; 339 return complete;
275} 340}
276 341
277void LLWorkerClass::killWork() 342void LLWorkerClass::scheduleDelete()
278{ 343{
279 if (haveWork()) 344 bool do_delete = false;
345 mMutex.lock();
346 if (!(getFlags(WCF_DELETE_REQUESTED)))
280 { 347 {
281 abortWork(); 348 setFlags(WCF_DELETE_REQUESTED);
282 bool paused = mWorkerThread->isPaused(); 349 do_delete = true;
283 while (!checkWork()) 350 }
284 { 351 mMutex.unlock();
285 mWorkerThread->updateQueue(0); 352 if (do_delete)
286 } 353 {
287 if (paused) 354 mWorkerThread->deleteWorker(this);
288 {
289 mWorkerThread->pause();
290 }
291 } 355 }
292} 356}
293 357
294void LLWorkerClass::setPriority(U32 priority) 358void LLWorkerClass::setPriority(U32 priority)
295{ 359{
296 if (haveWork()) 360 mMutex.lock();
361 if (mRequestHandle != LLWorkerThread::nullHandle())
297 { 362 {
298 mWorkerThread->setPriority(mWorkHandle, priority); 363 mRequestPriority = priority;
364 mWorkerThread->setPriority(mRequestHandle, priority);
299 } 365 }
366 mMutex.unlock();
300} 367}
301 368
302//============================================================================ 369//============================================================================
diff --git a/linden/indra/llcommon/llworkerthread.h b/linden/indra/llcommon/llworkerthread.h
index f01e67b..17b7e7b 100644
--- a/linden/indra/llcommon/llworkerthread.h
+++ b/linden/indra/llcommon/llworkerthread.h
@@ -47,13 +47,13 @@ class LLWorkerClass;
47class LLWorkerThread : public LLQueuedThread 47class LLWorkerThread : public LLQueuedThread
48{ 48{
49public: 49public:
50 class Request : public LLQueuedThread::QueuedRequest 50 class WorkRequest : public LLQueuedThread::QueuedRequest
51 { 51 {
52 protected: 52 protected:
53 ~Request() {}; // use deleteRequest() 53 virtual ~WorkRequest(); // use deleteRequest()
54 54
55 public: 55 public:
56 Request(handle_t handle, U32 priority, LLWorkerClass* workerclass, S32 param); 56 WorkRequest(handle_t handle, U32 priority, LLWorkerClass* workerclass, S32 param);
57 57
58 S32 getParam() 58 S32 getParam()
59 { 59 {
@@ -64,6 +64,8 @@ public:
64 return mWorkerClass; 64 return mWorkerClass;
65 } 65 }
66 66
67 /*virtual*/ bool processRequest();
68 /*virtual*/ void finishRequest(bool completed);
67 /*virtual*/ void deleteRequest(); 69 /*virtual*/ void deleteRequest();
68 70
69 private: 71 private:
@@ -71,26 +73,24 @@ public:
71 S32 mParam; 73 S32 mParam;
72 }; 74 };
73 75
74public: 76private:
75 LLWorkerThread(bool threaded = true, bool runalways = true); 77 typedef std::list<LLWorkerClass*> delete_list_t;
76 ~LLWorkerThread(); 78 delete_list_t mDeleteList;
77 79 LLMutex* mDeleteMutex;
78protected: 80 apr_pool_t* mWorkerAPRPoolp;
79 /*virtual*/ bool processRequest(QueuedRequest* req);
80 81
81public: 82public:
82 handle_t add(LLWorkerClass* workerclass, S32 param, U32 priority = PRIORITY_NORMAL); 83 LLWorkerThread(const std::string& name, bool threaded = true);
83 84 ~LLWorkerThread();
84 static void initClass(bool local_is_threaded = true, bool local_run_always = true); // Setup sLocal
85 static S32 updateClass(U32 ms_elapsed);
86 static S32 getAllPending();
87 static void pauseAll();
88 static void waitOnAllPending();
89 static void cleanupClass(); // Delete sLocal
90 85
91public: 86 apr_pool_t* getWorkerAPRPool() { return mWorkerAPRPoolp; }
92 static LLWorkerThread* sLocal; // Default worker thread 87
93 static std::set<LLWorkerThread*> sThreadList; // array of threads (includes sLocal) 88 /*virtual*/ S32 update(U32 max_time_ms);
89
90 handle_t addWorkRequest(LLWorkerClass* workerclass, S32 param, U32 priority = PRIORITY_NORMAL);
91
92 void deleteWorker(LLWorkerClass* workerclass); // schedule for deletion
93 S32 getNumDeletes() { return mDeleteList.size(); } // debug
94}; 94};
95 95
96//============================================================================ 96//============================================================================
@@ -112,11 +112,17 @@ public:
112 112
113class LLWorkerClass 113class LLWorkerClass
114{ 114{
115 friend class LLWorkerThread;
116 friend class LLWorkerThread::WorkRequest;
115public: 117public:
116 typedef LLWorkerThread::handle_t handle_t; 118 typedef LLWorkerThread::handle_t handle_t;
117 enum FLAGS 119 enum FLAGS
118 { 120 {
119 WCF_WORKING = 0x01, 121 WCF_HAVE_WORK = 0x01,
122 WCF_WORKING = 0x02,
123 WCF_WORK_FINISHED = 0x10,
124 WCF_WORK_ABORTED = 0x20,
125 WCF_DELETE_REQUESTED = 0x40,
120 WCF_ABORT_REQUESTED = 0x80 126 WCF_ABORT_REQUESTED = 0x80
121 }; 127 };
122 128
@@ -125,17 +131,29 @@ public:
125 virtual ~LLWorkerClass(); 131 virtual ~LLWorkerClass();
126 132
127 // pure virtual, called from WORKER THREAD, returns TRUE if done 133 // pure virtual, called from WORKER THREAD, returns TRUE if done
128 virtual bool doWork(S32 param)=0; // Called from LLWorkerThread::processRequest() 134 virtual bool doWork(S32 param)=0; // Called from WorkRequest::processRequest()
129 135 // virtual, called from finishRequest() after completed or aborted
130 // called from WORKER THREAD 136 virtual void finishWork(S32 param, bool completed); // called from finishRequest() (WORK THREAD)
131 void setWorking(bool working) { working ? setFlags(WCF_WORKING) : clearFlags(WCF_WORKING); } 137 // virtual, returns true if safe to delete the worker
138 virtual bool deleteOK(); // called from update() (WORK THREAD)
132 139
140 // schedlueDelete(): schedules deletion once aborted or completed
141 void scheduleDelete();
142
143 bool haveWork() { return getFlags(WCF_HAVE_WORK); } // may still be true if aborted
133 bool isWorking() { return getFlags(WCF_WORKING); } 144 bool isWorking() { return getFlags(WCF_WORKING); }
134 bool wasAborted() { return getFlags(WCF_ABORT_REQUESTED); } 145 bool wasAborted() { return getFlags(WCF_ABORT_REQUESTED); }
146
147 // setPriority(): changes the priority of a request
148 void setPriority(U32 priority);
149 U32 getPriority() { return mRequestPriority; }
135 150
136 const std::string& getName() const { return mWorkerClassName; } 151 const std::string& getName() const { return mWorkerClassName; }
137 152
138protected: 153protected:
154 // called from WORKER THREAD
155 void setWorking(bool working);
156
139 // Call from doWork only to avoid eating up cpu time. 157 // Call from doWork only to avoid eating up cpu time.
140 // Returns true if work has been aborted 158 // Returns true if work has been aborted
141 // yields the current thread and calls mWorkerThread->checkPause() 159 // yields the current thread and calls mWorkerThread->checkPause()
@@ -147,20 +165,11 @@ protected:
147 void addWork(S32 param, U32 priority = LLWorkerThread::PRIORITY_NORMAL); 165 void addWork(S32 param, U32 priority = LLWorkerThread::PRIORITY_NORMAL);
148 166
149 // abortWork(): requests that work be aborted 167 // abortWork(): requests that work be aborted
150 void abortWork(); 168 void abortWork(bool autocomplete);
151 169
152 // checkWork(): if doWork is complete or aborted, call endWork() and return true 170 // checkWork(): if doWork is complete or aborted, call endWork() and return true
153 bool checkWork(); 171 bool checkWork(bool aborting = false);
154 172
155 // haveWork(): return true if mWorkHandle != null
156 bool haveWork() { return mWorkHandle != LLWorkerThread::nullHandle(); }
157
158 // killWork(): aborts work and waits for the abort to process
159 void killWork();
160
161 // setPriority(): changes the priority of a request
162 void setPriority(U32 priority);
163
164private: 173private:
165 void setFlags(U32 flags) { mWorkFlags = mWorkFlags | flags; } 174 void setFlags(U32 flags) { mWorkFlags = mWorkFlags | flags; }
166 void clearFlags(U32 flags) { mWorkFlags = mWorkFlags & ~flags; } 175 void clearFlags(U32 flags) { mWorkFlags = mWorkFlags & ~flags; }
@@ -175,9 +184,11 @@ private:
175protected: 184protected:
176 LLWorkerThread* mWorkerThread; 185 LLWorkerThread* mWorkerThread;
177 std::string mWorkerClassName; 186 std::string mWorkerClassName;
178 handle_t mWorkHandle; 187 handle_t mRequestHandle;
188 U32 mRequestPriority; // last priority set
179 189
180private: 190private:
191 LLMutex mMutex;
181 LLAtomicU32 mWorkFlags; 192 LLAtomicU32 mWorkFlags;
182}; 193};
183 194
diff --git a/linden/indra/llcommon/metaproperty.cpp b/linden/indra/llcommon/metaproperty.cpp
index e4983cc..312dd9d 100644
--- a/linden/indra/llcommon/metaproperty.cpp
+++ b/linden/indra/llcommon/metaproperty.cpp
@@ -44,7 +44,7 @@ const LLMetaClass& LLMetaProperty::getObjectMetaClass() const
44{ 44{
45 return mObjectClass; 45 return mObjectClass;
46} 46}
47 47
48void LLMetaProperty::checkObjectClass(const LLReflective* object) const 48void LLMetaProperty::checkObjectClass(const LLReflective* object) const
49{ 49{
50 if(! mObjectClass.isInstance(object)) 50 if(! mObjectClass.isInstance(object))
diff --git a/linden/indra/llcommon/u64.cpp b/linden/indra/llcommon/u64.cpp
index 45baa13..744e0ab 100644
--- a/linden/indra/llcommon/u64.cpp
+++ b/linden/indra/llcommon/u64.cpp
@@ -33,7 +33,7 @@
33U64 str_to_U64(const char *str) 33U64 str_to_U64(const char *str)
34{ 34{
35 U64 result = 0; 35 U64 result = 0;
36 char *aptr = strpbrk(str,"0123456789"); 36 const char *aptr = strpbrk(str,"0123456789");
37 37
38 if (!aptr) 38 if (!aptr)
39 { 39 {
@@ -66,27 +66,27 @@ char* U64_to_str(U64 value, char* result, S32 result_size)
66 66
67 if (part1) 67 if (part1)
68 { 68 {
69 snprintf( 69 snprintf( /* Flawfinder: ignore */
70 result, 70 result,
71 result_size, 71 result_size,
72 "%u%07u%07u", 72 "%u%07u%07u",
73 part1,part2,part3); /* Flawfinder: ignore */ 73 part1,part2,part3);
74 } 74 }
75 else if (part2) 75 else if (part2)
76 { 76 {
77 snprintf( 77 snprintf( /* Flawfinder: ignore */
78 result, 78 result,
79 result_size, 79 result_size,
80 "%u%07u", 80 "%u%07u",
81 part2,part3); /* Flawfinder: ignore */ 81 part2,part3);
82 } 82 }
83 else 83 else
84 { 84 {
85 snprintf( 85 snprintf( /* Flawfinder: ignore */
86 result, 86 result,
87 result_size, 87 result_size,
88 "%u", 88 "%u",
89 part3); /* Flawfinder: ignore */ 89 part3);
90 } 90 }
91 return (result); 91 return (result);
92} 92}
diff --git a/linden/indra/llimage/files.lst b/linden/indra/llimage/files.lst
index 83f53bc..9e14118 100644
--- a/linden/indra/llimage/files.lst
+++ b/linden/indra/llimage/files.lst
@@ -3,4 +3,5 @@ llimage/llimage.cpp
3llimage/llimagedxt.cpp 3llimage/llimagedxt.cpp
4llimage/llimagej2c.cpp 4llimage/llimagej2c.cpp
5llimage/llimagejpeg.cpp 5llimage/llimagejpeg.cpp
6llimage/llimagetga.cpp \ No newline at end of file 6llimage/llimagetga.cpp
7llimage/llimageworker.cpp
diff --git a/linden/indra/llimage/llimage.cpp b/linden/indra/llimage/llimage.cpp
index acd6aef..eb4ff46 100644
--- a/linden/indra/llimage/llimage.cpp
+++ b/linden/indra/llimage/llimage.cpp
@@ -36,7 +36,7 @@
36#include "llmath.h" 36#include "llmath.h"
37#include "stdtypes.h" 37#include "stdtypes.h"
38#include "v4coloru.h" 38#include "v4coloru.h"
39#include "llmemory.h" 39#include "llmemtype.h"
40 40
41#include "llimage.h" 41#include "llimage.h"
42#include "llimagebmp.h" 42#include "llimagebmp.h"
@@ -133,7 +133,7 @@ U8* LLImageBase::allocateData(S32 size)
133 llerrs << llformat("LLImageBase::allocateData called with bad dimentions: %dx%dx%d",mWidth,mHeight,mComponents) << llendl; 133 llerrs << llformat("LLImageBase::allocateData called with bad dimentions: %dx%dx%d",mWidth,mHeight,mComponents) << llendl;
134 } 134 }
135 } 135 }
136 else if ((size <= 0 || size > 4096*4096*16) && sSizeOverride == FALSE) 136 else if (size <= 0 || (size > 4096*4096*16 && sSizeOverride == FALSE))
137 { 137 {
138 llerrs << "LLImageBase::allocateData: bad size: " << size << llendl; 138 llerrs << "LLImageBase::allocateData: bad size: " << size << llendl;
139 } 139 }
@@ -167,7 +167,7 @@ U8* LLImageBase::reallocateData(S32 size)
167 if (mData) 167 if (mData)
168 { 168 {
169 S32 bytes = llmin(mDataSize, size); 169 S32 bytes = llmin(mDataSize, size);
170 memcpy(new_datap, mData, bytes); 170 memcpy(new_datap, mData, bytes); /* Flawfinder: ignore */
171 delete[] mData; 171 delete[] mData;
172 } 172 }
173 mData = new_datap; 173 mData = new_datap;
@@ -216,7 +216,8 @@ LLImageRaw::LLImageRaw(U8 *data, U16 width, U16 height, S8 components)
216 : LLImageBase() 216 : LLImageBase()
217{ 217{
218 mMemType = LLMemType::MTYPE_IMAGERAW; 218 mMemType = LLMemType::MTYPE_IMAGERAW;
219 copyData(data, width, height, components); 219 allocateDataSize(width, height, components);
220 memcpy(getData(), data, width*height*components);
220 ++sRawImageCount; 221 ++sRawImageCount;
221} 222}
222 223
@@ -258,16 +259,6 @@ void LLImageRaw::deleteData()
258 LLImageBase::deleteData(); 259 LLImageBase::deleteData();
259} 260}
260 261
261BOOL LLImageRaw::copyData(U8 *data, U16 width, U16 height, S8 components)
262{
263 if (!resize(width, height, components))
264 {
265 return FALSE;
266 }
267 memcpy(getData(), data, width*height*components);
268 return TRUE;
269}
270
271BOOL LLImageRaw::resize(U16 width, U16 height, S8 components) 262BOOL LLImageRaw::resize(U16 width, U16 height, S8 components)
272{ 263{
273 if ((getWidth() == width) && (getHeight() == height) && (getComponents() == components)) 264 if ((getWidth() == width) && (getHeight() == height) && (getComponents() == components))
@@ -288,11 +279,16 @@ U8 * LLImageRaw::getSubImage(U32 x_pos, U32 y_pos, U32 width, U32 height) const
288 U8 *data = new U8[width*height*getComponents()]; 279 U8 *data = new U8[width*height*getComponents()];
289 280
290 // Should do some simple bounds checking 281 // Should do some simple bounds checking
282 if (!data)
283 {
284 llerrs << "Out of memory in LLImageRaw::getSubImage" << llendl;
285 return NULL;
286 }
291 287
292 U32 i; 288 U32 i;
293 for (i = y_pos; i < y_pos+height; i++) 289 for (i = y_pos; i < y_pos+height; i++)
294 { 290 {
295 memcpy(data + i*width*getComponents(), 291 memcpy(data + i*width*getComponents(), /* Flawfinder: ignore */
296 getData() + ((y_pos + i)*getWidth() + x_pos)*getComponents(), getComponents()*width); 292 getData() + ((y_pos + i)*getWidth() + x_pos)*getComponents(), getComponents()*width);
297 } 293 }
298 return data; 294 return data;
@@ -328,7 +324,7 @@ BOOL LLImageRaw::setSubImage(U32 x_pos, U32 y_pos, U32 width, U32 height,
328 { 324 {
329 from_offset = i*width*getComponents(); 325 from_offset = i*width*getComponents();
330 } 326 }
331 memcpy(getData() + to_offset*getComponents(), 327 memcpy(getData() + to_offset*getComponents(), /* Flawfinder: ignore */
332 data + from_offset, getComponents()*width); 328 data + from_offset, getComponents()*width);
333 } 329 }
334 } 330 }
@@ -345,7 +341,7 @@ BOOL LLImageRaw::setSubImage(U32 x_pos, U32 y_pos, U32 width, U32 height,
345 { 341 {
346 from_offset = (height - 1 - i)*width*getComponents(); 342 from_offset = (height - 1 - i)*width*getComponents();
347 } 343 }
348 memcpy(getData() + to_offset*getComponents(), 344 memcpy(getData() + to_offset*getComponents(), /* Flawfinder: ignore */
349 data + from_offset, getComponents()*width); 345 data + from_offset, getComponents()*width);
350 } 346 }
351 } 347 }
@@ -392,14 +388,19 @@ void LLImageRaw::verticalFlip()
392 LLMemType mt1((LLMemType::EMemType)mMemType); 388 LLMemType mt1((LLMemType::EMemType)mMemType);
393 S32 row_bytes = getWidth() * getComponents(); 389 S32 row_bytes = getWidth() * getComponents();
394 U8* line_buffer = new U8[row_bytes]; 390 U8* line_buffer = new U8[row_bytes];
391 if (!line_buffer )
392 {
393 llerrs << "Out of memory in LLImageRaw::verticalFlip()" << llendl;
394 return;
395 }
395 S32 mid_row = getHeight() / 2; 396 S32 mid_row = getHeight() / 2;
396 for( S32 row = 0; row < mid_row; row++ ) 397 for( S32 row = 0; row < mid_row; row++ )
397 { 398 {
398 U8* row_a_data = getData() + row * row_bytes; 399 U8* row_a_data = getData() + row * row_bytes;
399 U8* row_b_data = getData() + (getHeight() - 1 - row) * row_bytes; 400 U8* row_b_data = getData() + (getHeight() - 1 - row) * row_bytes;
400 memcpy( line_buffer, row_a_data, row_bytes ); 401 memcpy( line_buffer, row_a_data, row_bytes ); /* Flawfinder: ignore */
401 memcpy( row_a_data, row_b_data, row_bytes ); 402 memcpy( row_a_data, row_b_data, row_bytes ); /* Flawfinder: ignore */
402 memcpy( row_b_data, line_buffer, row_bytes ); 403 memcpy( row_b_data, line_buffer, row_bytes ); /* Flawfinder: ignore */
403 } 404 }
404 delete[] line_buffer; 405 delete[] line_buffer;
405} 406}
@@ -691,7 +692,7 @@ void LLImageRaw::copyUnscaled(LLImageRaw* src)
691 llassert( src->getComponents() == dst->getComponents() ); 692 llassert( src->getComponents() == dst->getComponents() );
692 llassert( (src->getWidth() == dst->getWidth()) && (src->getHeight() == dst->getHeight()) ); 693 llassert( (src->getWidth() == dst->getWidth()) && (src->getHeight() == dst->getHeight()) );
693 694
694 memcpy( dst->getData(), src->getData(), getWidth() * getHeight() * getComponents() ); 695 memcpy( dst->getData(), src->getData(), getWidth() * getHeight() * getComponents() ); /* Flawfinder: ignore */
695} 696}
696 697
697 698
@@ -775,7 +776,7 @@ void LLImageRaw::copyScaled( LLImageRaw* src )
775 776
776 if( (src->getWidth() == dst->getWidth()) && (src->getHeight() == dst->getHeight()) ) 777 if( (src->getWidth() == dst->getWidth()) && (src->getHeight() == dst->getHeight()) )
777 { 778 {
778 memcpy( dst->getData(), src->getData(), getWidth() * getHeight() * getComponents() ); 779 memcpy( dst->getData(), src->getData(), getWidth() * getHeight() * getComponents() ); /* Flawfinder: ignore */
779 return; 780 return;
780 } 781 }
781 782
@@ -841,7 +842,12 @@ void LLImageRaw::scale( S32 new_width, S32 new_height, BOOL scale_image_data )
841 // copy out existing image data 842 // copy out existing image data
842 S32 temp_data_size = old_width * old_height * getComponents(); 843 S32 temp_data_size = old_width * old_height * getComponents();
843 U8* temp_buffer = new U8[ temp_data_size ]; 844 U8* temp_buffer = new U8[ temp_data_size ];
844 memcpy(temp_buffer, getData(), temp_data_size); 845 if (!temp_buffer)
846 {
847 llerrs << "Out of memory in LLImageRaw::scale( S32 new_width, S32 new_height, BOOL scale_image_data )" << llendl;
848 return;
849 }
850 memcpy(temp_buffer, getData(), temp_data_size); /* Flawfinder: ignore */
845 851
846 // allocate new image data, will delete old data 852 // allocate new image data, will delete old data
847 U8* new_buffer = allocateDataSize(new_width, new_height, getComponents()); 853 U8* new_buffer = allocateDataSize(new_width, new_height, getComponents());
@@ -850,7 +856,7 @@ void LLImageRaw::scale( S32 new_width, S32 new_height, BOOL scale_image_data )
850 { 856 {
851 if (row < old_height) 857 if (row < old_height)
852 { 858 {
853 memcpy(new_buffer + (new_width * row * getComponents()), temp_buffer + (old_width * row * getComponents()), getComponents() * llmin(old_width, new_width)); 859 memcpy(new_buffer + (new_width * row * getComponents()), temp_buffer + (old_width * row * getComponents()), getComponents() * llmin(old_width, new_width)); /* Flawfinder: ignore */
854 if (old_width < new_width) 860 if (old_width < new_width)
855 { 861 {
856 // pad out rest of row with black 862 // pad out rest of row with black
@@ -1204,7 +1210,7 @@ bool LLImageRaw::createFromFile(const LLString &filename, bool j2c_lowest_mip_on
1204 llassert(image.notNull()); 1210 llassert(image.notNull());
1205 1211
1206 U8 *buffer = image->allocateData(length); 1212 U8 *buffer = image->allocateData(length);
1207 ifs.read ((char*)buffer, length); 1213 ifs.read ((char*)buffer, length); /* Flawfinder: ignore */
1208 ifs.close(); 1214 ifs.close();
1209 1215
1210 image->updateData(); 1216 image->updateData();
@@ -1243,25 +1249,8 @@ bool LLImageRaw::createFromFile(const LLString &filename, bool j2c_lowest_mip_on
1243//static 1249//static
1244S32 LLImageFormatted::sGlobalFormattedMemory = 0; 1250S32 LLImageFormatted::sGlobalFormattedMemory = 0;
1245 1251
1246//static
1247LLWorkerThread* LLImageFormatted::sWorkerThread = NULL;
1248
1249//static
1250void LLImageFormatted::initClass(bool threaded, bool run_always)
1251{
1252 sWorkerThread = new LLWorkerThread(threaded, run_always);
1253}
1254
1255//static
1256void LLImageFormatted::cleanupClass()
1257{
1258 delete sWorkerThread;
1259 sWorkerThread = NULL;
1260}
1261
1262
1263LLImageFormatted::LLImageFormatted(S8 codec) 1252LLImageFormatted::LLImageFormatted(S8 codec)
1264 : LLImageBase(), LLWorkerClass(sWorkerThread, "ImageFormatted"), 1253 : LLImageBase(),
1265 mCodec(codec), 1254 mCodec(codec),
1266 mDecoding(0), 1255 mDecoding(0),
1267 mDecoded(0), 1256 mDecoded(0),
@@ -1276,64 +1265,14 @@ LLImageFormatted::~LLImageFormatted()
1276 // NOTE: ~LLimageBase() call to deleteData() calls LLImageBase::deleteData() 1265 // NOTE: ~LLimageBase() call to deleteData() calls LLImageBase::deleteData()
1277 // NOT LLImageFormatted::deleteData() 1266 // NOT LLImageFormatted::deleteData()
1278 deleteData(); 1267 deleteData();
1279 releaseDecodedData();
1280}
1281
1282//----------------------------------------------------------------------------
1283
1284//virtual
1285void LLImageFormatted::startWork(S32 param)
1286{
1287 if (mDecoding) llerrs << "WTF?" << llendl;
1288}
1289
1290bool LLImageFormatted::doWork(S32 param)
1291{
1292 if (!(isWorking())) llerrs << "WTF?" << llendl;
1293 llassert(mDecodedImage.notNull());
1294 if (param == 0)
1295 {
1296 // Decode primary channels
1297 mDecoded = decode(mDecodedImage, .001f); // 1ms
1298 }
1299 else
1300 {
1301 // Decode aux channel
1302 mDecoded = decode(mDecodedImage, .001f, param, param); // 1ms
1303 }
1304 if (mDecoded)
1305 {
1306 return true;
1307 }
1308 else
1309 {
1310 return false;
1311 }
1312}
1313
1314void LLImageFormatted::endWork(S32 param, bool aborted)
1315{
1316 if (mDecoding) llerrs << "WTF?" << llendl;
1317 if (!mDecoded) llerrs << "WTF?" << llendl;
1318} 1268}
1319 1269
1320//---------------------------------------------------------------------------- 1270//----------------------------------------------------------------------------
1321 1271
1322// static 1272// static
1323LLImageFormatted* LLImageFormatted::createFromExtension(const LLString& instring) 1273LLImageFormatted* LLImageFormatted::createFromType(S8 codec)
1324{ 1274{
1325 LLString exten; 1275 LLImageFormatted* image;
1326 size_t dotidx = instring.rfind('.');
1327 if (dotidx != LLString::npos)
1328 {
1329 exten = instring.substr(dotidx+1);
1330 }
1331 else
1332 {
1333 exten = instring;
1334 }
1335 S8 codec = get_codec(exten);
1336 LLPointer<LLImageFormatted> image;
1337 switch(codec) 1276 switch(codec)
1338 { 1277 {
1339 case IMG_CODEC_BMP: 1278 case IMG_CODEC_BMP:
@@ -1354,10 +1293,28 @@ LLImageFormatted* LLImageFormatted::createFromExtension(const LLString& instring
1354 image = new LLImageDXT(); 1293 image = new LLImageDXT();
1355 break; 1294 break;
1356 default: 1295 default:
1296 image = NULL;
1357 break; 1297 break;
1358 } 1298 }
1359 return image; 1299 return image;
1360} 1300}
1301
1302// static
1303LLImageFormatted* LLImageFormatted::createFromExtension(const LLString& instring)
1304{
1305 LLString exten;
1306 size_t dotidx = instring.rfind('.');
1307 if (dotidx != LLString::npos)
1308 {
1309 exten = instring.substr(dotidx+1);
1310 }
1311 else
1312 {
1313 exten = instring;
1314 }
1315 S8 codec = get_codec(exten);
1316 return createFromType(codec);
1317}
1361//---------------------------------------------------------------------------- 1318//----------------------------------------------------------------------------
1362 1319
1363// virtual 1320// virtual
@@ -1374,15 +1331,6 @@ void LLImageFormatted::dump()
1374 1331
1375//---------------------------------------------------------------------------- 1332//----------------------------------------------------------------------------
1376 1333
1377void LLImageFormatted::readHeader(U8* data, S32 size)
1378{
1379 if (size <= 0)
1380 {
1381 size = calcHeaderSize();
1382 }
1383 copyData(data, size); // calls updateData()
1384}
1385
1386S32 LLImageFormatted::calcDataSize(S32 discard_level) 1334S32 LLImageFormatted::calcDataSize(S32 discard_level)
1387{ 1335{
1388 if (discard_level < 0) 1336 if (discard_level < 0)
@@ -1426,82 +1374,6 @@ BOOL LLImageFormatted::decode(LLImageRaw* raw_image,F32 decode_time, S32 first_
1426 return decode( raw_image, decode_time ); // Loads first 4 channels by default. 1374 return decode( raw_image, decode_time ); // Loads first 4 channels by default.
1427} 1375}
1428 1376
1429// virtual
1430BOOL LLImageFormatted::requestDecodedData(LLPointer<LLImageRaw>& raw, S32 discard, F32 decode_time)
1431{
1432 llassert(getData() && getDataSize());
1433 // For most codecs, only mDiscardLevel data is available. (see LLImageDXT for exception)
1434 if (discard >= 0 && discard != mDiscardLevel)
1435 {
1436 llerrs << "Request for invalid discard level" << llendl;
1437 }
1438 if (haveWork())
1439 {
1440 checkWork();
1441 }
1442 if (!mDecoded)
1443 {
1444 if (!haveWork())
1445 {
1446 llassert(!mDecoding);
1447 mDecodedImage = new LLImageRaw(getWidth(), getHeight(), getComponents());
1448 addWork(0);
1449 }
1450 return FALSE;
1451 }
1452 else
1453 {
1454 llassert(mDecodedImage.notNull());
1455 llassert(!mDecoding);
1456 raw = mDecodedImage;
1457 return TRUE;
1458 }
1459}
1460
1461BOOL LLImageFormatted::requestDecodedAuxData(LLPointer<LLImageRaw>& raw, S32 channel,
1462 S32 discard, F32 decode_time)
1463{
1464 llassert(getData() && getDataSize());
1465 // For most codecs, only mDiscardLevel data is available. (see LLImageDXT for exception)
1466 if (discard >= 0 && discard != mDiscardLevel)
1467 {
1468 llerrs << "Request for invalid discard level" << llendl;
1469 }
1470 if (haveWork())
1471 {
1472 checkWork();
1473 }
1474 if (!mDecoded)
1475 {
1476 if (!haveWork())
1477 {
1478 llassert(!mDecoding);
1479 mDecodedImage = new LLImageRaw(getWidth(), getHeight(), 1);
1480 addWork(channel);
1481 }
1482 return FALSE;
1483 }
1484 else
1485 {
1486 llassert(mDecodedImage.notNull());
1487 llassert(!mDecoding);
1488 raw = mDecodedImage;
1489 return TRUE;
1490 }
1491}
1492
1493
1494// virtual
1495void LLImageFormatted::releaseDecodedData()
1496{
1497 if (mDecoded || mDecoding)
1498 {
1499 mDecodedImage = NULL; // deletes image
1500 mDecoded = FALSE;
1501 mDecoding = FALSE;
1502 }
1503}
1504
1505//---------------------------------------------------------------------------- 1377//----------------------------------------------------------------------------
1506 1378
1507// virtual 1379// virtual
@@ -1549,47 +1421,42 @@ void LLImageFormatted::sanityCheck()
1549 1421
1550BOOL LLImageFormatted::copyData(U8 *data, S32 size) 1422BOOL LLImageFormatted::copyData(U8 *data, S32 size)
1551{ 1423{
1552 if (data && data != getData()) 1424 if ( (data && data != getData()) || (size != getDataSize()) )
1553 { 1425 {
1554 deleteData(); 1426 deleteData();
1555 allocateData(size); 1427 allocateData(size);
1556 memcpy(getData(), data, size); 1428 memcpy(getData(), data, size); /* Flawfinder: ignore */
1557 } 1429 }
1558 updateData(); // virtual
1559
1560 return TRUE; 1430 return TRUE;
1561} 1431}
1562 1432
1563BOOL LLImageFormatted::appendData(U8 *data, S32 size) 1433// LLImageFormatted becomes the owner of data
1434void LLImageFormatted::setData(U8 *data, S32 size)
1564{ 1435{
1565 LLMemType mt1((LLMemType::EMemType)mMemType); 1436 if (data && data != getData())
1566 S32 old_size = getDataSize();
1567 U8* old_data = getData();
1568 S32 new_size = old_size + size;
1569 U8* new_data = new U8[new_size];
1570 // resize the image
1571 setDataAndSize(new_data, new_size);
1572 // copy the old data and delete it
1573 memcpy(new_data, old_data, old_size);
1574 delete old_data;
1575 // if we have new data, copy it and call updateData()
1576 if (data)
1577 { 1437 {
1578 memcpy(new_data + old_size, data, size); 1438 deleteData();
1579 updateData(); // virtual 1439 setDataAndSize(data, size); // Access private LLImageBase members
1440 sGlobalFormattedMemory += getDataSize();
1580 } 1441 }
1581 return TRUE;
1582} 1442}
1583 1443
1584BOOL LLImageFormatted::setData(U8 *data, S32 size) 1444void LLImageFormatted::appendData(U8 *data, S32 size)
1585{ 1445{
1586 if (data && data != getData()) 1446 if (data)
1587 { 1447 {
1588 deleteData(); 1448 if (!getData())
1589 setDataAndSize(data, size); // Access private LLImageBase members 1449 {
1590 sGlobalFormattedMemory += getDataSize(); 1450 setData(data, size);
1451 }
1452 else
1453 {
1454 S32 cursize = getDataSize();
1455 S32 newsize = cursize + size;
1456 reallocateData(newsize);
1457 memcpy(getData() + cursize, data, size);
1458 }
1591 } 1459 }
1592 return updateData(); // virtual
1593} 1460}
1594 1461
1595//---------------------------------------------------------------------------- 1462//----------------------------------------------------------------------------
@@ -1662,8 +1529,6 @@ S8 LLImageFormatted::getCodec() const
1662 1529
1663//============================================================================ 1530//============================================================================
1664 1531
1665//----------------------------------------------------------------------------
1666
1667static void avg4_colors4(const U8* a, const U8* b, const U8* c, const U8* d, U8* dst) 1532static void avg4_colors4(const U8* a, const U8* b, const U8* c, const U8* d, U8* dst)
1668{ 1533{
1669 dst[0] = (U8)(((U32)(a[0]) + b[0] + c[0] + d[0])>>2); 1534 dst[0] = (U8)(((U32)(a[0]) + b[0] + c[0] + d[0])>>2);
@@ -1789,3 +1654,5 @@ F32 LLImageBase::calc_download_priority(F32 virtual_size, F32 visible_pixels, S3
1789 1654
1790 return w_priority; 1655 return w_priority;
1791} 1656}
1657
1658//============================================================================
diff --git a/linden/indra/llimage/llimage.h b/linden/indra/llimage/llimage.h
index eb1805a..ef5496e 100644
--- a/linden/indra/llimage/llimage.h
+++ b/linden/indra/llimage/llimage.h
@@ -32,7 +32,7 @@
32#include "lluuid.h" 32#include "lluuid.h"
33#include "llstring.h" 33#include "llstring.h"
34#include "llmemory.h" 34#include "llmemory.h"
35#include "llworkerthread.h" 35#include "llthread.h"
36 36
37const S32 MIN_IMAGE_MIP = 2; // 4x4, only used for expand/contract power of 2 37const S32 MIN_IMAGE_MIP = 2; // 4x4, only used for expand/contract power of 2
38const S32 MAX_IMAGE_MIP = 11; // 2048x2048 38const S32 MAX_IMAGE_MIP = 11; // 2048x2048
@@ -154,8 +154,6 @@ public:
154 /*virtual*/ U8* allocateData(S32 size = -1); 154 /*virtual*/ U8* allocateData(S32 size = -1);
155 /*virtual*/ U8* reallocateData(S32 size); 155 /*virtual*/ U8* reallocateData(S32 size);
156 156
157 BOOL copyData(U8 *data, U16 width, U16 height, S8 components);
158
159 BOOL resize(U16 width, U16 height, S8 components); 157 BOOL resize(U16 width, U16 height, S8 components);
160 158
161 U8 * getSubImage(U32 x_pos, U32 y_pos, U32 width, U32 height) const; 159 U8 * getSubImage(U32 x_pos, U32 y_pos, U32 width, U32 height) const;
@@ -225,11 +223,10 @@ public:
225 223
226// Compressed representation of image. 224// Compressed representation of image.
227// Subclass from this class for the different representations (J2C, bmp) 225// Subclass from this class for the different representations (J2C, bmp)
228class LLImageFormatted : public LLImageBase, public LLWorkerClass 226class LLImageFormatted : public LLImageBase
229{ 227{
230public: 228public:
231 static void initClass(bool threaded = true, bool run_always = true); 229 static LLImageFormatted* createFromType(S8 codec);
232 static void cleanupClass();
233 static LLImageFormatted* createFromExtension(const LLString& instring); 230 static LLImageFormatted* createFromExtension(const LLString& instring);
234 231
235protected: 232protected:
@@ -247,22 +244,11 @@ public:
247 /*virtual*/ void dump(); 244 /*virtual*/ void dump();
248 /*virtual*/ void sanityCheck(); 245 /*virtual*/ void sanityCheck();
249 246
250 // LLWorkerThread
251public:
252 // called from WORKER THREAD, returns TRUE if done
253 /*virtual*/ bool doWork(S32 param);
254private:
255 // called from MAIN THREAD
256 /*virtual*/ void startWork(S32 param); // called from addWork()
257 /*virtual*/ void endWork(S32 param, bool aborted); // called from doWork()
258
259 // New methods 247 // New methods
260public: 248public:
261 // calcHeaderSize() returns the maximum size of header; 249 // calcHeaderSize() returns the maximum size of header;
262 // 0 indicates we don't know have a header and have to lead the entire file 250 // 0 indicates we don't know have a header and have to lead the entire file
263 virtual S32 calcHeaderSize() { return 0; }; 251 virtual S32 calcHeaderSize() { return 0; };
264 // readHeader() reads size bytes into mData, and sets width/height/ncomponents
265 virtual void readHeader(U8* data, S32 size);
266 // calcDataSize() returns how many bytes to read to load discard_level (including header) 252 // calcDataSize() returns how many bytes to read to load discard_level (including header)
267 virtual S32 calcDataSize(S32 discard_level); 253 virtual S32 calcDataSize(S32 discard_level);
268 // calcDiscardLevelBytes() returns the smallest valid discard level based on the number of input bytes 254 // calcDiscardLevelBytes() returns the smallest valid discard level based on the number of input bytes
@@ -272,27 +258,16 @@ public:
272 258
273 BOOL load(const LLString& filename); 259 BOOL load(const LLString& filename);
274 BOOL save(const LLString& filename); 260 BOOL save(const LLString& filename);
275// BOOL save(LLVFS *vfs, const LLUUID &uuid, const LLAssetType::EType type);
276// Depricated to remove VFS dependency (see .cpp for replacement):
277 261
278 virtual BOOL updateData() = 0; // pure virtual 262 virtual BOOL updateData() = 0; // pure virtual
279 BOOL copyData(U8 *data, S32 size); // calls updateData() 263 void setData(U8 *data, S32 size);
280 BOOL setData(U8 *data, S32 size); // calls updateData() 264 void appendData(U8 *data, S32 size);
281 BOOL appendData(U8 *data, S32 size); // use if some data (e.g header) is already loaded, calls updateData()
282 265
283 // Loads first 4 channels. 266 // Loads first 4 channels.
284 virtual BOOL decode(LLImageRaw* raw_image, F32 decode_time=0.0) = 0; 267 virtual BOOL decode(LLImageRaw* raw_image, F32 decode_time=0.0) = 0;
285 // Subclasses that can handle more than 4 channels should override this function. 268 // Subclasses that can handle more than 4 channels should override this function.
286 virtual BOOL decode(LLImageRaw* raw_image, F32 decode_time, S32 first_channel, S32 max_channel); 269 virtual BOOL decode(LLImageRaw* raw_image, F32 decode_time, S32 first_channel, S32 max_channel);
287 270
288 // Decode methods to return a pointer to raw data for purposes of passing to
289 // opengl or such. This class tracks the decoded data and keeps it alive until
290 // destroyed or releaseDecodedData() is called.
291 virtual BOOL requestDecodedData(LLPointer<LLImageRaw>& raw, S32 discard = -1, F32 decode_time=0.0);
292 virtual BOOL requestDecodedAuxData(LLPointer<LLImageRaw>& raw, S32 channel,
293 S32 discard = -1, F32 decode_time=0.0);
294 virtual void releaseDecodedData();
295
296 virtual BOOL encode(const LLImageRaw* raw_image, F32 encode_time=0.0) = 0; 271 virtual BOOL encode(const LLImageRaw* raw_image, F32 encode_time=0.0) = 0;
297 272
298 S8 getCodec() const; 273 S8 getCodec() const;
@@ -302,16 +277,16 @@ public:
302 S8 getDiscardLevel() const { return mDiscardLevel; } 277 S8 getDiscardLevel() const { return mDiscardLevel; }
303 278
304protected: 279protected:
280 BOOL copyData(U8 *data, S32 size); // calls updateData()
281
282protected:
305 S8 mCodec; 283 S8 mCodec;
306 S8 mDecoding; 284 S8 mDecoding;
307 S8 mDecoded; 285 S8 mDecoded;
308 S8 mDiscardLevel; 286 S8 mDiscardLevel;
309 287
310 LLPointer<LLImageRaw> mDecodedImage;
311
312public: 288public:
313 static S32 sGlobalFormattedMemory; 289 static S32 sGlobalFormattedMemory;
314 static LLWorkerThread* sWorkerThread;
315}; 290};
316 291
317#endif 292#endif
diff --git a/linden/indra/llimage/llimage.vcproj b/linden/indra/llimage/llimage.vcproj
index cd4c735..1f8a6ad 100644
--- a/linden/indra/llimage/llimage.vcproj
+++ b/linden/indra/llimage/llimage.vcproj
@@ -171,6 +171,9 @@
171 <File 171 <File
172 RelativePath=".\llimagetga.cpp"> 172 RelativePath=".\llimagetga.cpp">
173 </File> 173 </File>
174 <File
175 RelativePath=".\llimageworker.cpp">
176 </File>
174 </Filter> 177 </Filter>
175 <Filter 178 <Filter
176 Name="Header Files" 179 Name="Header Files"
@@ -197,6 +200,9 @@
197 <File 200 <File
198 RelativePath=".\llimagetga.h"> 201 RelativePath=".\llimagetga.h">
199 </File> 202 </File>
203 <File
204 RelativePath=".\llimageworker.h">
205 </File>
200 </Filter> 206 </Filter>
201 <Filter 207 <Filter
202 Name="Resource Files" 208 Name="Resource Files"
diff --git a/linden/indra/llimage/llimage_vc8.vcproj b/linden/indra/llimage/llimage_vc8.vcproj
new file mode 100644
index 0000000..052a28f
--- /dev/null
+++ b/linden/indra/llimage/llimage_vc8.vcproj
@@ -0,0 +1,306 @@
1<?xml version="1.0" encoding="Windows-1252"?>
2<VisualStudioProject
3 ProjectType="Visual C++"
4 Version="8.00"
5 Name="llimage"
6 ProjectGUID="{681FDD6C-2FAE-4CB9-AF6D-B952F2B151C5}"
7 Keyword="Win32Proj"
8 >
9 <Platforms>
10 <Platform
11 Name="Win32"
12 />
13 </Platforms>
14 <ToolFiles>
15 </ToolFiles>
16 <Configurations>
17 <Configuration
18 Name="Debug|Win32"
19 OutputDirectory="../lib_$(ConfigurationName)/i686-win32"
20 IntermediateDirectory="$(ConfigurationName)"
21 ConfigurationType="4"
22 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
23 CharacterSet="1"
24 >
25 <Tool
26 Name="VCPreBuildEventTool"
27 />
28 <Tool
29 Name="VCCustomBuildTool"
30 />
31 <Tool
32 Name="VCXMLDataGeneratorTool"
33 />
34 <Tool
35 Name="VCWebServiceProxyGeneratorTool"
36 />
37 <Tool
38 Name="VCMIDLTool"
39 />
40 <Tool
41 Name="VCCLCompilerTool"
42 Optimization="0"
43 AdditionalIncludeDirectories="..\llcommon;..\llmath; ..\llvfs; ..\..\libraries\i686-win32\include;..\..\libraries\include\"
44 PreprocessorDefinitions="WIN32;_DEBUG;_LIB;LL_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;LL_DEBUG"
45 MinimalRebuild="true"
46 BasicRuntimeChecks="3"
47 RuntimeLibrary="1"
48 StructMemberAlignment="4"
49 TreatWChar_tAsBuiltInType="false"
50 ForceConformanceInForLoopScope="true"
51 UsePrecompiledHeader="0"
52 WarningLevel="3"
53 WarnAsError="true"
54 Detect64BitPortabilityProblems="false"
55 DebugInformationFormat="4"
56 />
57 <Tool
58 Name="VCManagedResourceCompilerTool"
59 />
60 <Tool
61 Name="VCResourceCompilerTool"
62 />
63 <Tool
64 Name="VCPreLinkEventTool"
65 />
66 <Tool
67 Name="VCLibrarianTool"
68 OutputFile="$(OutDir)/llimage.lib"
69 />
70 <Tool
71 Name="VCALinkTool"
72 />
73 <Tool
74 Name="VCXDCMakeTool"
75 />
76 <Tool
77 Name="VCBscMakeTool"
78 />
79 <Tool
80 Name="VCFxCopTool"
81 />
82 <Tool
83 Name="VCPostBuildEventTool"
84 />
85 </Configuration>
86 <Configuration
87 Name="Release|Win32"
88 OutputDirectory="../lib_$(ConfigurationName)/i686-win32"
89 IntermediateDirectory="$(ConfigurationName)"
90 ConfigurationType="4"
91 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
92 CharacterSet="1"
93 >
94 <Tool
95 Name="VCPreBuildEventTool"
96 />
97 <Tool
98 Name="VCCustomBuildTool"
99 />
100 <Tool
101 Name="VCXMLDataGeneratorTool"
102 />
103 <Tool
104 Name="VCWebServiceProxyGeneratorTool"
105 />
106 <Tool
107 Name="VCMIDLTool"
108 />
109 <Tool
110 Name="VCCLCompilerTool"
111 InlineFunctionExpansion="2"
112 EnableIntrinsicFunctions="true"
113 AdditionalIncludeDirectories="..\llcommon;..\llmath; ..\llvfs; ..\..\libraries\i686-win32\include;..\..\libraries\include\"
114 PreprocessorDefinitions="WIN32;NDEBUG;_LIB;LL_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;LL_RELEASE"
115 RuntimeLibrary="0"
116 StructMemberAlignment="0"
117 TreatWChar_tAsBuiltInType="false"
118 ForceConformanceInForLoopScope="true"
119 UsePrecompiledHeader="0"
120 WarningLevel="3"
121 WarnAsError="false"
122 Detect64BitPortabilityProblems="false"
123 DebugInformationFormat="3"
124 />
125 <Tool
126 Name="VCManagedResourceCompilerTool"
127 />
128 <Tool
129 Name="VCResourceCompilerTool"
130 />
131 <Tool
132 Name="VCPreLinkEventTool"
133 />
134 <Tool
135 Name="VCLibrarianTool"
136 OutputFile="$(OutDir)/llimage.lib"
137 />
138 <Tool
139 Name="VCALinkTool"
140 />
141 <Tool
142 Name="VCXDCMakeTool"
143 />
144 <Tool
145 Name="VCBscMakeTool"
146 />
147 <Tool
148 Name="VCFxCopTool"
149 />
150 <Tool
151 Name="VCPostBuildEventTool"
152 />
153 </Configuration>
154 <Configuration
155 Name="ReleaseNoOpt|Win32"
156 OutputDirectory="../lib_$(ConfigurationName)/i686-win32"
157 IntermediateDirectory="$(ConfigurationName)"
158 ConfigurationType="4"
159 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
160 CharacterSet="1"
161 >
162 <Tool
163 Name="VCPreBuildEventTool"
164 />
165 <Tool
166 Name="VCCustomBuildTool"
167 />
168 <Tool
169 Name="VCXMLDataGeneratorTool"
170 />
171 <Tool
172 Name="VCWebServiceProxyGeneratorTool"
173 />
174 <Tool
175 Name="VCMIDLTool"
176 />
177 <Tool
178 Name="VCCLCompilerTool"
179 Optimization="0"
180 AdditionalIncludeDirectories="..\llcommon;..\llmath; ..\llvfs; ..\..\libraries\i686-win32\include;..\..\libraries\include\"
181 PreprocessorDefinitions="WIN32;NDEBUG;_LIB;LL_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;LL_RELEASE"
182 RuntimeLibrary="0"
183 StructMemberAlignment="0"
184 TreatWChar_tAsBuiltInType="false"
185 ForceConformanceInForLoopScope="true"
186 UsePrecompiledHeader="0"
187 WarningLevel="3"
188 WarnAsError="true"
189 Detect64BitPortabilityProblems="false"
190 DebugInformationFormat="3"
191 />
192 <Tool
193 Name="VCManagedResourceCompilerTool"
194 />
195 <Tool
196 Name="VCResourceCompilerTool"
197 />
198 <Tool
199 Name="VCPreLinkEventTool"
200 />
201 <Tool
202 Name="VCLibrarianTool"
203 OutputFile="$(OutDir)/llimage.lib"
204 />
205 <Tool
206 Name="VCALinkTool"
207 />
208 <Tool
209 Name="VCXDCMakeTool"
210 />
211 <Tool
212 Name="VCBscMakeTool"
213 />
214 <Tool
215 Name="VCFxCopTool"
216 />
217 <Tool
218 Name="VCPostBuildEventTool"
219 />
220 </Configuration>
221 </Configurations>
222 <References>
223 </References>
224 <Files>
225 <Filter
226 Name="Source Files"
227 Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
228 UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
229 >
230 <File
231 RelativePath=".\llimage.cpp"
232 >
233 </File>
234 <File
235 RelativePath=".\llimagebmp.cpp"
236 >
237 </File>
238 <File
239 RelativePath=".\llimagedxt.cpp"
240 >
241 </File>
242 <File
243 RelativePath=".\llimagej2c.cpp"
244 >
245 </File>
246 <File
247 RelativePath=".\llimagejpeg.cpp"
248 >
249 </File>
250 <File
251 RelativePath=".\llimagetga.cpp"
252 >
253 </File>
254 <File
255 RelativePath=".\llimageworker.cpp"
256 >
257 </File>
258 </Filter>
259 <Filter
260 Name="Header Files"
261 Filter="h;hpp;hxx;hm;inl;inc;xsd"
262 UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
263 >
264 <File
265 RelativePath=".\llimage.h"
266 >
267 </File>
268 <File
269 RelativePath=".\llimagebmp.h"
270 >
271 </File>
272 <File
273 RelativePath=".\llimageconstants.h"
274 >
275 </File>
276 <File
277 RelativePath=".\llimagedxt.h"
278 >
279 </File>
280 <File
281 RelativePath=".\llimagej2c.h"
282 >
283 </File>
284 <File
285 RelativePath=".\llimagejpeg.h"
286 >
287 </File>
288 <File
289 RelativePath=".\llimagetga.h"
290 >
291 </File>
292 <File
293 RelativePath=".\llimageworker.h"
294 >
295 </File>
296 </Filter>
297 <Filter
298 Name="Resource Files"
299 Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
300 UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
301 >
302 </Filter>
303 </Files>
304 <Globals>
305 </Globals>
306</VisualStudioProject>
diff --git a/linden/indra/llimage/llimagebmp.cpp b/linden/indra/llimage/llimagebmp.cpp
index fc9532e..e8cada5 100644
--- a/linden/indra/llimage/llimagebmp.cpp
+++ b/linden/indra/llimage/llimagebmp.cpp
@@ -142,7 +142,10 @@ BOOL LLImageBMP::updateData()
142 LLBMPHeader header; 142 LLBMPHeader header;
143 llassert( sizeof( header ) == BITMAP_HEADER_SIZE ); 143 llassert( sizeof( header ) == BITMAP_HEADER_SIZE );
144 144
145 memcpy((void *)&header, mdata + FILE_HEADER_SIZE, BITMAP_HEADER_SIZE); 145 memcpy( /* Flawfinder: ignore */
146 (void*)&header,
147 mdata + FILE_HEADER_SIZE,
148 BITMAP_HEADER_SIZE);
146 149
147 // convert BMP header from little endian (no-op on little endian builds) 150 // convert BMP header from little endian (no-op on little endian builds)
148 llendianswizzleone(header.mSize); 151 llendianswizzleone(header.mSize);
@@ -276,7 +279,7 @@ BOOL LLImageBMP::updateData()
276 279
277 280
278 extension_size = 4 * 3; 281 extension_size = 4 * 3;
279 memcpy( mBitfieldMask, mdata + FILE_HEADER_SIZE + BITMAP_HEADER_SIZE, extension_size); 282 memcpy( mBitfieldMask, mdata + FILE_HEADER_SIZE + BITMAP_HEADER_SIZE, extension_size); /* Flawfinder: ignore */
280 } 283 }
281 else 284 else
282 if( windows_95_version ) 285 if( windows_95_version )
@@ -285,11 +288,11 @@ BOOL LLImageBMP::updateData()
285 extension_size = sizeof( win_95_extension ); 288 extension_size = sizeof( win_95_extension );
286 289
287 llassert( sizeof( win_95_extension ) + BITMAP_HEADER_SIZE == 108 ); 290 llassert( sizeof( win_95_extension ) + BITMAP_HEADER_SIZE == 108 );
288 memcpy( &win_95_extension, mdata + FILE_HEADER_SIZE + BITMAP_HEADER_SIZE, sizeof( win_95_extension ) ); 291 memcpy( &win_95_extension, mdata + FILE_HEADER_SIZE + BITMAP_HEADER_SIZE, sizeof( win_95_extension ) ); /* Flawfinder: ignore */
289 292
290 if( 3 == header.mCompression ) 293 if( 3 == header.mCompression )
291 { 294 {
292 memcpy( mBitfieldMask, mdata + FILE_HEADER_SIZE + BITMAP_HEADER_SIZE, 4 * 4); 295 memcpy( mBitfieldMask, mdata + FILE_HEADER_SIZE + BITMAP_HEADER_SIZE, 4 * 4); /* Flawfinder: ignore */
293 } 296 }
294 297
295 // Color correction ignored for now 298 // Color correction ignored for now
@@ -317,7 +320,12 @@ BOOL LLImageBMP::updateData()
317 if( 0 != mColorPaletteColors ) 320 if( 0 != mColorPaletteColors )
318 { 321 {
319 mColorPalette = new U8[color_palette_size]; 322 mColorPalette = new U8[color_palette_size];
320 memcpy( mColorPalette, mdata + FILE_HEADER_SIZE + BITMAP_HEADER_SIZE + extension_size, color_palette_size ); 323 if (!mColorPalette)
324 {
325 llerrs << "Out of memory in LLImageBMP::updateData()" << llendl;
326 return FALSE;
327 }
328 memcpy( mColorPalette, mdata + FILE_HEADER_SIZE + BITMAP_HEADER_SIZE + extension_size, color_palette_size ); /* Flawfinder: ignore */
321 } 329 }
322 330
323 return TRUE; 331 return TRUE;
@@ -587,7 +595,7 @@ BOOL LLImageBMP::encode(const LLImageRaw* raw_image, F32 encode_time)
587 U32 cur_pos = 0; 595 U32 cur_pos = 0;
588 memcpy(mdata, magic, 14); 596 memcpy(mdata, magic, 14);
589 cur_pos += 14; 597 cur_pos += 14;
590 memcpy(mdata+cur_pos, &header, 40); 598 memcpy(mdata+cur_pos, &header, 40); /* Flawfinder: ignore */
591 cur_pos += 40; 599 cur_pos += 40;
592 if (getComponents() == 1) 600 if (getComponents() == 1)
593 { 601 {
diff --git a/linden/indra/llimage/llimagedxt.cpp b/linden/indra/llimage/llimagedxt.cpp
index 8b16f97..6676366 100644
--- a/linden/indra/llimage/llimagedxt.cpp
+++ b/linden/indra/llimage/llimagedxt.cpp
@@ -279,13 +279,12 @@ BOOL LLImageDXT::decode(LLImageRaw* raw_image, F32 time)
279 } 279 }
280 280
281 raw_image->resize(width, height, ncomponents); 281 raw_image->resize(width, height, ncomponents);
282 memcpy(raw_image->getData(), data, image_size); 282 memcpy(raw_image->getData(), data, image_size); /* Flawfinder: ignore */
283 283
284 return TRUE; 284 return TRUE;
285} 285}
286 286
287// virtual 287BOOL LLImageDXT::getMipData(LLPointer<LLImageRaw>& raw, S32 discard)
288BOOL LLImageDXT::requestDecodedData(LLPointer<LLImageRaw>& raw, S32 discard, F32 decode_time)
289{ 288{
290 if (discard < 0) 289 if (discard < 0)
291 { 290 {
@@ -302,11 +301,6 @@ BOOL LLImageDXT::requestDecodedData(LLPointer<LLImageRaw>& raw, S32 discard, F32
302 return TRUE; 301 return TRUE;
303} 302}
304 303
305void LLImageDXT::releaseDecodedData()
306{
307 // nothing to do
308}
309
310BOOL LLImageDXT::encode(const LLImageRaw* raw_image, F32 time, bool explicit_mips) 304BOOL LLImageDXT::encode(const LLImageRaw* raw_image, F32 time, bool explicit_mips)
311{ 305{
312 llassert_always(raw_image); 306 llassert_always(raw_image);
@@ -373,7 +367,7 @@ BOOL LLImageDXT::encode(const LLImageRaw* raw_image, F32 time, bool explicit_mip
373 S32 bytes = formatBytes(format, w, h); 367 S32 bytes = formatBytes(format, w, h);
374 if (mip==0) 368 if (mip==0)
375 { 369 {
376 memcpy(mipdata, raw_image->getData(), bytes); 370 memcpy(mipdata, raw_image->getData(), bytes); /* Flawfinder: ignore */
377 } 371 }
378 else if (explicit_mips) 372 else if (explicit_mips)
379 { 373 {
@@ -425,21 +419,27 @@ bool LLImageDXT::convertToDXR()
425 S32 total_bytes = getDataSize(); 419 S32 total_bytes = getDataSize();
426 U8* olddata = getData(); 420 U8* olddata = getData();
427 U8* newdata = new U8[total_bytes]; 421 U8* newdata = new U8[total_bytes];
422 if (!newdata)
423 {
424 llerrs << "Out of memory in LLImageDXT::convertToDXR()" << llendl;
425 return false;
426 }
428 llassert(total_bytes > 0); 427 llassert(total_bytes > 0);
429 memset(newdata, 0, total_bytes); 428 memset(newdata, 0, total_bytes);
430 memcpy(newdata, olddata, mHeaderSize); 429 memcpy(newdata, olddata, mHeaderSize); /* Flawfinder: ignore */
431 for (S32 mip=0; mip<nmips; mip++) 430 for (S32 mip=0; mip<nmips; mip++)
432 { 431 {
433 S32 bytes = formatBytes(mFileFormat, width, height); 432 S32 bytes = formatBytes(mFileFormat, width, height);
434 S32 newoffset = getMipOffset(mip); 433 S32 newoffset = getMipOffset(mip);
435 S32 oldoffset = mHeaderSize + (total_bytes - newoffset - bytes); 434 S32 oldoffset = mHeaderSize + (total_bytes - newoffset - bytes);
436 memcpy(newdata + newoffset, olddata + oldoffset, bytes); 435 memcpy(newdata + newoffset, olddata + oldoffset, bytes); /* Flawfinder: ignore */
437 width >>= 1; 436 width >>= 1;
438 height >>= 1; 437 height >>= 1;
439 } 438 }
440 dxtfile_header_t* header = (dxtfile_header_t*)newdata; 439 dxtfile_header_t* header = (dxtfile_header_t*)newdata;
441 header->pixel_fmt.fourcc = getFourCC(newformat); 440 header->pixel_fmt.fourcc = getFourCC(newformat);
442 setData(newdata, total_bytes); 441 setData(newdata, total_bytes);
442 updateData();
443 return true; 443 return true;
444} 444}
445 445
@@ -487,7 +487,7 @@ void LLImageDXT::extractMip(const U8 *indata, U8* mipdata, int width, int height
487 for (int h=0;h<mip_height;++h) 487 for (int h=0;h<mip_height;++h)
488 { 488 {
489 int start_offset = initial_offset + line_width * h + line_offset; 489 int start_offset = initial_offset + line_width * h + line_offset;
490 memcpy(mipdata + mip_line_width*h, indata + start_offset, mip_line_width); 490 memcpy(mipdata + mip_line_width*h, indata + start_offset, mip_line_width); /* Flawfinder: ignore */
491 } 491 }
492} 492}
493 493
diff --git a/linden/indra/llimage/llimagedxt.h b/linden/indra/llimage/llimagedxt.h
index c3c01c1..936258a 100644
--- a/linden/indra/llimage/llimagedxt.h
+++ b/linden/indra/llimage/llimagedxt.h
@@ -101,12 +101,11 @@ public:
101 BOOL encode(const LLImageRaw* raw_image, F32 time, bool explicit_mips); 101 BOOL encode(const LLImageRaw* raw_image, F32 time, bool explicit_mips);
102 /*virtual*/ BOOL encode(const LLImageRaw* raw_image, F32 time=0.0); 102 /*virtual*/ BOOL encode(const LLImageRaw* raw_image, F32 time=0.0);
103 103
104 /*virtual*/ BOOL requestDecodedData(LLPointer<LLImageRaw>& raw, S32 discard=-1, F32 decode_time=0.0);
105 /*virtual*/ void releaseDecodedData();
106
107 /*virtual*/ S32 calcHeaderSize(); 104 /*virtual*/ S32 calcHeaderSize();
108 /*virtual*/ S32 calcDataSize(S32 discard_level = 0); 105 /*virtual*/ S32 calcDataSize(S32 discard_level = 0);
109 106
107 BOOL getMipData(LLPointer<LLImageRaw>& raw, S32 discard=-1);
108
110 void setFormat(); 109 void setFormat();
111 S32 getMipOffset(S32 discard); 110 S32 getMipOffset(S32 discard);
112 111
diff --git a/linden/indra/llimage/llimagej2c.cpp b/linden/indra/llimage/llimagej2c.cpp
index 87852e7..51d9522 100644
--- a/linden/indra/llimage/llimagej2c.cpp
+++ b/linden/indra/llimage/llimagej2c.cpp
@@ -30,7 +30,7 @@
30 30
31#include "lldir.h" 31#include "lldir.h"
32#include "llimagej2c.h" 32#include "llimagej2c.h"
33#include "llmemory.h" 33#include "llmemtype.h"
34 34
35typedef LLImageJ2CImpl* (*CreateLLImageJ2CFunction)(); 35typedef LLImageJ2CImpl* (*CreateLLImageJ2CFunction)();
36typedef void (*DestroyLLImageJ2CFunction)(LLImageJ2CImpl*); 36typedef void (*DestroyLLImageJ2CFunction)(LLImageJ2CImpl*);
@@ -243,7 +243,22 @@ BOOL LLImageJ2C::decode(LLImageRaw *raw_imagep, F32 decode_time, S32 first_chann
243 // Update the raw discard level 243 // Update the raw discard level
244 updateRawDiscardLevel(); 244 updateRawDiscardLevel();
245 245
246 return mImpl->decodeImpl(*this, *raw_imagep, decode_time, first_channel, max_channel_count); 246 mDecoding = TRUE;
247 BOOL res = mImpl->decodeImpl(*this, *raw_imagep, decode_time, first_channel, max_channel_count);
248 if (res)
249 {
250 if (!mDecoding)
251 {
252 // Failed
253 raw_imagep->deleteData();
254 }
255 else
256 {
257 mDecoding = FALSE;
258 }
259 return TRUE; // done
260 }
261 return FALSE;
247} 262}
248 263
249 264
@@ -353,7 +368,7 @@ BOOL LLImageJ2C::loadAndValidate(const LLString &filename)
353 U8 *data = new U8[file_size]; 368 U8 *data = new U8[file_size];
354 apr_size_t bytes_read = file_size; 369 apr_size_t bytes_read = file_size;
355 apr_status_t s = apr_file_read(apr_file, data, &bytes_read); // modifies bytes_read 370 apr_status_t s = apr_file_read(apr_file, data, &bytes_read); // modifies bytes_read
356 if (s != APR_SUCCESS || bytes_read != file_size) 371 if (s != APR_SUCCESS || (S32)bytes_read != file_size)
357 { 372 {
358 delete[] data; 373 delete[] data;
359 setLastError("Unable to read entire file"); 374 setLastError("Unable to read entire file");
@@ -368,9 +383,9 @@ BOOL LLImageJ2C::loadAndValidate(const LLString &filename)
368BOOL LLImageJ2C::validate(U8 *data, U32 file_size) 383BOOL LLImageJ2C::validate(U8 *data, U32 file_size)
369{ 384{
370 LLMemType mt1((LLMemType::EMemType)mMemType); 385 LLMemType mt1((LLMemType::EMemType)mMemType);
371 // Taken from setData()
372 386
373 BOOL res = LLImageFormatted::setData(data, file_size); 387 setData(data, file_size);
388 BOOL res = updateData();
374 if ( !res ) 389 if ( !res )
375 { 390 {
376 return FALSE; 391 return FALSE;
@@ -386,10 +401,9 @@ BOOL LLImageJ2C::validate(U8 *data, U32 file_size)
386 return mImpl->getMetadata(*this); 401 return mImpl->getMetadata(*this);
387} 402}
388 403
389void LLImageJ2C::setDecodingDone(BOOL complete) 404void LLImageJ2C::decodeFailed()
390{ 405{
391 mDecoding = FALSE; 406 mDecoding = FALSE;
392 mDecoded = complete;
393} 407}
394 408
395void LLImageJ2C::updateRawDiscardLevel() 409void LLImageJ2C::updateRawDiscardLevel()
diff --git a/linden/indra/llimage/llimagej2c.h b/linden/indra/llimage/llimagej2c.h
index a6894ab..24a1429 100644
--- a/linden/indra/llimage/llimagej2c.h
+++ b/linden/indra/llimage/llimagej2c.h
@@ -72,7 +72,7 @@ protected:
72 friend class LLImageJ2CImpl; 72 friend class LLImageJ2CImpl;
73 friend class LLImageJ2COJ; 73 friend class LLImageJ2COJ;
74 friend class LLImageJ2CKDU; 74 friend class LLImageJ2CKDU;
75 void setDecodingDone(BOOL complete = TRUE); 75 void decodeFailed();
76 void updateRawDiscardLevel(); 76 void updateRawDiscardLevel();
77 77
78 S32 mMaxBytes; // Maximum number of bytes of data to use... 78 S32 mMaxBytes; // Maximum number of bytes of data to use...
@@ -87,7 +87,17 @@ class LLImageJ2CImpl
87public: 87public:
88 virtual ~LLImageJ2CImpl(); 88 virtual ~LLImageJ2CImpl();
89protected: 89protected:
90 // Find out the image size and number of channels.
91 // Return value:
92 // true: image size and number of channels was determined
93 // false: error on decode
90 virtual BOOL getMetadata(LLImageJ2C &base) = 0; 94 virtual BOOL getMetadata(LLImageJ2C &base) = 0;
95 // Decode the raw image optionally aborting (to continue later) after
96 // decode_time seconds. Decode at most max_channel_count and start
97 // decoding channel first_channel.
98 // Return value:
99 // true: decoding complete (even if it failed)
100 // false: time expired while decoding
91 virtual BOOL decodeImpl(LLImageJ2C &base, LLImageRaw &raw_image, F32 decode_time, S32 first_channel, S32 max_channel_count) = 0; 101 virtual BOOL decodeImpl(LLImageJ2C &base, LLImageRaw &raw_image, F32 decode_time, S32 first_channel, S32 max_channel_count) = 0;
92 virtual BOOL encodeImpl(LLImageJ2C &base, const LLImageRaw &raw_image, const char* comment_text, F32 encode_time=0.0) = 0; 102 virtual BOOL encodeImpl(LLImageJ2C &base, const LLImageRaw &raw_image, const char* comment_text, F32 encode_time=0.0) = 0;
93 103
diff --git a/linden/indra/llimage/llimagejpeg.cpp b/linden/indra/llimage/llimagejpeg.cpp
index 5c83f20..fdfcc16 100644
--- a/linden/indra/llimage/llimagejpeg.cpp
+++ b/linden/indra/llimage/llimagejpeg.cpp
@@ -354,7 +354,12 @@ boolean LLImageJPEG::encodeEmptyOutputBuffer( j_compress_ptr cinfo )
354 // Double the buffer size; 354 // Double the buffer size;
355 S32 new_buffer_size = self->mOutputBufferSize * 2; 355 S32 new_buffer_size = self->mOutputBufferSize * 2;
356 U8* new_buffer = new U8[ new_buffer_size ]; 356 U8* new_buffer = new U8[ new_buffer_size ];
357 memcpy( new_buffer, self->mOutputBuffer, self->mOutputBufferSize ); 357 if (!new_buffer)
358 {
359 llerrs << "Out of memory in LLImageJPEG::encodeEmptyOutputBuffer( j_compress_ptr cinfo )" << llendl;
360 return FALSE;
361 }
362 memcpy( new_buffer, self->mOutputBuffer, self->mOutputBufferSize ); /* Flawfinder: ignore */
358 delete[] self->mOutputBuffer; 363 delete[] self->mOutputBuffer;
359 self->mOutputBuffer = new_buffer; 364 self->mOutputBuffer = new_buffer;
360 365
@@ -378,7 +383,7 @@ void LLImageJPEG::encodeTermDestination( j_compress_ptr cinfo )
378 S32 file_bytes = (S32)(self->mOutputBufferSize - cinfo->dest->free_in_buffer); 383 S32 file_bytes = (S32)(self->mOutputBufferSize - cinfo->dest->free_in_buffer);
379 self->allocateData(file_bytes); 384 self->allocateData(file_bytes);
380 385
381 memcpy( self->getData(), self->mOutputBuffer, file_bytes ); 386 memcpy( self->getData(), self->mOutputBuffer, file_bytes ); /* Flawfinder: ignore */
382} 387}
383 388
384// static 389// static
@@ -435,7 +440,7 @@ void LLImageJPEG::errorEmitMessage( j_common_ptr cinfo, int msg_level )
435void LLImageJPEG::errorOutputMessage( j_common_ptr cinfo ) 440void LLImageJPEG::errorOutputMessage( j_common_ptr cinfo )
436{ 441{
437 // Create the message 442 // Create the message
438 char buffer[JMSG_LENGTH_MAX]; 443 char buffer[JMSG_LENGTH_MAX]; /* Flawfinder: ignore */
439 (*cinfo->err->format_message) (cinfo, buffer); 444 (*cinfo->err->format_message) (cinfo, buffer);
440 445
441 ((LLImageJPEG*) cinfo->client_data)->setLastError( buffer ); 446 ((LLImageJPEG*) cinfo->client_data)->setLastError( buffer );
diff --git a/linden/indra/llimage/llimagetga.cpp b/linden/indra/llimage/llimagetga.cpp
index 722bd1e..d5d60de 100644
--- a/linden/indra/llimage/llimagetga.cpp
+++ b/linden/indra/llimage/llimagetga.cpp
@@ -202,7 +202,7 @@ BOOL LLImageTGA::updateData()
202 // discard the ID field, if any 202 // discard the ID field, if any
203 if (mIDLength) 203 if (mIDLength)
204 { 204 {
205 memcpy(junk, getData()+mDataOffset, mIDLength); 205 memcpy(junk, getData()+mDataOffset, mIDLength); /* Flawfinder: ignore */
206 mDataOffset += mIDLength; 206 mDataOffset += mIDLength;
207 } 207 }
208 208
@@ -239,7 +239,12 @@ BOOL LLImageTGA::updateData()
239 if ( (1 == mImageType) || (9 == mImageType) ) 239 if ( (1 == mImageType) || (9 == mImageType) )
240 { 240 {
241 mColorMap = new U8[ color_map_bytes ]; 241 mColorMap = new U8[ color_map_bytes ];
242 memcpy( mColorMap, getData() + mDataOffset, color_map_bytes ); 242 if (!mColorMap)
243 {
244 llerrs << "Out of Memory in BOOL LLImageTGA::updateData()" << llendl;
245 return FALSE;
246 }
247 memcpy( mColorMap, getData() + mDataOffset, color_map_bytes ); /* Flawfinder: ignore */
243 } 248 }
244 249
245 mDataOffset += color_map_bytes; 250 mDataOffset += color_map_bytes;
@@ -451,7 +456,7 @@ BOOL LLImageTGA::decodeTruecolorNonRle( LLImageRaw* raw_image, BOOL &alpha_opaqu
451 } 456 }
452 else if (getComponents() == 1) 457 else if (getComponents() == 1)
453 { 458 {
454 memcpy(dst, src, pixels); 459 memcpy(dst, src, pixels); /* Flawfinder: ignore */
455 } 460 }
456 461
457 return TRUE; 462 return TRUE;
@@ -692,7 +697,7 @@ BOOL LLImageTGA::encode(const LLImageRaw* raw_image, F32 encode_time)
692 switch( getComponents() ) 697 switch( getComponents() )
693 { 698 {
694 case 1: 699 case 1:
695 memcpy( dst, src, bytes_per_pixel * pixels ); 700 memcpy( dst, src, bytes_per_pixel * pixels ); /* Flawfinder: ignore */
696 break; 701 break;
697 702
698 case 2: 703 case 2:
@@ -1072,7 +1077,7 @@ bool LLImageTGA::loadFile( const LLString& path )
1072 return false; 1077 return false;
1073 } 1078 }
1074 1079
1075 FILE *file = LLFile::fopen(path.c_str(), "rb"); 1080 FILE* file = LLFile::fopen(path.c_str(), "rb"); /* Flawfinder: ignore */
1076 if( !file ) 1081 if( !file )
1077 { 1082 {
1078 llwarns << "Couldn't open file " << path << llendl; 1083 llwarns << "Couldn't open file " << path << llendl;
diff --git a/linden/indra/llimage/llimageworker.cpp b/linden/indra/llimage/llimageworker.cpp
new file mode 100644
index 0000000..4550848
--- /dev/null
+++ b/linden/indra/llimage/llimageworker.cpp
@@ -0,0 +1,184 @@
1/**
2 * @file llimage.cpp
3 * @brief Base class for images.
4 *
5 * Copyright (c) 2001-2007, Linden Research, Inc.
6 *
7 * The source code in this file ("Source Code") is provided by Linden Lab
8 * to you under the terms of the GNU General Public License, version 2.0
9 * ("GPL"), unless you have obtained a separate licensing agreement
10 * ("Other License"), formally executed by you and Linden Lab. Terms of
11 * the GPL can be found in doc/GPL-license.txt in this distribution, or
12 * online at http://secondlife.com/developers/opensource/gplv2
13 *
14 * There are special exceptions to the terms and conditions of the GPL as
15 * it is applied to this Source Code. View the full text of the exception
16 * in the file doc/FLOSS-exception.txt in this software distribution, or
17 * online at http://secondlife.com/developers/opensource/flossexception
18 *
19 * By copying, modifying or distributing this software, you acknowledge
20 * that you have read and understood your obligations described above,
21 * and agree to abide by those obligations.
22 *
23 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
24 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
25 * COMPLETENESS OR PERFORMANCE.
26 */
27
28#include "linden_common.h"
29
30#include "llimageworker.h"
31#include "llimagedxt.h"
32
33//----------------------------------------------------------------------------
34
35//static
36LLWorkerThread* LLImageWorker::sWorkerThread = NULL;
37S32 LLImageWorker::sCount = 0;
38
39//static
40void LLImageWorker::initClass(LLWorkerThread* workerthread)
41{
42 sWorkerThread = workerthread;
43}
44
45//static
46void LLImageWorker::cleanupClass()
47{
48}
49
50//----------------------------------------------------------------------------
51
52LLImageWorker::LLImageWorker(LLImageFormatted* image, U32 priority, S32 discard, LLResponder* responder)
53 : LLWorkerClass(sWorkerThread, "Image"),
54 mFormattedImage(image),
55 mDecodedType(-1),
56 mDiscardLevel(discard),
57 mPriority(priority),
58 mResponder(responder)
59{
60 ++sCount;
61}
62
63LLImageWorker::~LLImageWorker()
64{
65 mDecodedImage = NULL;
66 mFormattedImage = NULL;
67 --sCount;
68}
69
70//----------------------------------------------------------------------------
71
72//virtual, main thread
73void LLImageWorker::startWork(S32 param)
74{
75 llassert_always(mDecodedImage.isNull());
76 mDecodedType = -1;
77}
78
79bool LLImageWorker::doWork(S32 param)
80{
81 bool decoded = false;
82 if(mDecodedImage.isNull())
83 {
84 if (!mFormattedImage->updateData())
85 {
86 mDecodedType = -2; // failed
87 return true;
88 }
89 if (mDiscardLevel >= 0)
90 {
91 mFormattedImage->setDiscardLevel(mDiscardLevel);
92 }
93 if (!(mFormattedImage->getWidth() * mFormattedImage->getHeight() * mFormattedImage->getComponents()))
94 {
95 decoded = true; // failed
96 }
97 else
98 {
99 S32 nc = param ? 1 : mFormattedImage->getComponents();
100 mDecodedImage = new LLImageRaw(mFormattedImage->getWidth(),
101 mFormattedImage->getHeight(),
102 nc);
103 }
104 }
105 if (!decoded)
106 {
107 if (param == 0)
108 {
109 // Decode primary channels
110 decoded = mFormattedImage->decode(mDecodedImage, .1f); // 1ms
111 }
112 else
113 {
114 // Decode aux channel
115 decoded = mFormattedImage->decode(mDecodedImage, .1f, param, param); // 1ms
116 }
117 }
118 if (decoded)
119 {
120 // Call the callback immediately; endWork doesn't get called until ckeckWork
121 if (mResponder.notNull())
122 {
123 bool success = (!wasAborted() && mDecodedImage.notNull() && mDecodedImage->getDataSize() != 0);
124 mResponder->completed(success);
125 }
126 }
127 return decoded;
128}
129
130void LLImageWorker::endWork(S32 param, bool aborted)
131{
132 if (mDecodedType != -2)
133 {
134 mDecodedType = aborted ? -2 : param;
135 }
136}
137
138//----------------------------------------------------------------------------
139
140
141BOOL LLImageWorker::requestDecodedAuxData(LLPointer<LLImageRaw>& raw, S32 channel, S32 discard)
142{
143 // For most codecs, only mDiscardLevel data is available.
144 // (see LLImageDXT for exception)
145 if (discard >= 0 && discard != mFormattedImage->getDiscardLevel())
146 {
147 llerrs << "Request for invalid discard level" << llendl;
148 }
149 checkWork();
150 if (mDecodedType == -2)
151 {
152 return TRUE; // aborted, done
153 }
154 if (mDecodedType != channel)
155 {
156 if (!haveWork())
157 {
158 addWork(channel, mPriority);
159 }
160 return FALSE;
161 }
162 else
163 {
164 llassert_always(!haveWork());
165 llassert_always(mDecodedType == channel);
166 raw = mDecodedImage; // smart pointer acquires ownership of data
167 mDecodedImage = NULL;
168 return TRUE;
169 }
170}
171
172BOOL LLImageWorker::requestDecodedData(LLPointer<LLImageRaw>& raw, S32 discard)
173{
174 if (mFormattedImage->getCodec() == IMG_CODEC_DXT)
175 {
176 // special case
177 LLImageDXT* imagedxt = (LLImageDXT*)((LLImageFormatted*)mFormattedImage);
178 return imagedxt->getMipData(raw, discard);
179 }
180 else
181 {
182 return requestDecodedAuxData(raw, 0, discard);
183 }
184}
diff --git a/linden/indra/llimage/llimageworker.h b/linden/indra/llimage/llimageworker.h
new file mode 100644
index 0000000..a39d21a
--- /dev/null
+++ b/linden/indra/llimage/llimageworker.h
@@ -0,0 +1,76 @@
1/**
2 * @file llimageworker.h
3 * @brief Object for managing images and their textures.
4 *
5 * Copyright (c) 2000-2007, Linden Research, Inc.
6 *
7 * The source code in this file ("Source Code") is provided by Linden Lab
8 * to you under the terms of the GNU General Public License, version 2.0
9 * ("GPL"), unless you have obtained a separate licensing agreement
10 * ("Other License"), formally executed by you and Linden Lab. Terms of
11 * the GPL can be found in doc/GPL-license.txt in this distribution, or
12 * online at http://secondlife.com/developers/opensource/gplv2
13 *
14 * There are special exceptions to the terms and conditions of the GPL as
15 * it is applied to this Source Code. View the full text of the exception
16 * in the file doc/FLOSS-exception.txt in this software distribution, or
17 * online at http://secondlife.com/developers/opensource/flossexception
18 *
19 * By copying, modifying or distributing this software, you acknowledge
20 * that you have read and understood your obligations described above,
21 * and agree to abide by those obligations.
22 *
23 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
24 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
25 * COMPLETENESS OR PERFORMANCE.
26 */
27
28#ifndef LL_LLIMAGEWORKER_H
29#define LL_LLIMAGEWORKER_H
30
31#include "llimage.h"
32#include "llworkerthread.h"
33
34class LLImageWorker : public LLWorkerClass
35{
36public:
37 static void initClass(LLWorkerThread* workerthread);
38 static void cleanupClass();
39 static LLWorkerThread* getWorkerThread() { return sWorkerThread; }
40
41 // LLWorkerThread
42public:
43 LLImageWorker(LLImageFormatted* image, U32 priority, S32 discard, LLResponder* responder = NULL);
44 ~LLImageWorker();
45
46 // called from WORKER THREAD, returns TRUE if done
47 /*virtual*/ bool doWork(S32 param);
48
49 BOOL requestDecodedData(LLPointer<LLImageRaw>& raw, S32 discard = -1);
50 BOOL requestDecodedAuxData(LLPointer<LLImageRaw>& raw, S32 channel, S32 discard = -1);
51 void releaseDecodedData();
52 void cancelDecode();
53
54private:
55 // called from MAIN THREAD
56 /*virtual*/ void startWork(S32 param); // called from addWork()
57 /*virtual*/ void endWork(S32 param, bool aborted); // called from doWork()
58
59protected:
60 LLPointer<LLImageFormatted> mFormattedImage;
61 LLPointer<LLImageRaw> mDecodedImage;
62 S32 mDecodedType;
63 S32 mDiscardLevel;
64
65private:
66 U32 mPriority;
67 LLPointer<LLResponder> mResponder;
68
69protected:
70 static LLWorkerThread* sWorkerThread;
71
72public:
73 static S32 sCount;
74};
75
76#endif
diff --git a/linden/indra/llimagej2coj/llimagej2coj.cpp b/linden/indra/llimagej2coj/llimagej2coj.cpp
index f292da9..307f952 100644
--- a/linden/indra/llimagej2coj/llimagej2coj.cpp
+++ b/linden/indra/llimagej2coj/llimagej2coj.cpp
@@ -28,6 +28,8 @@
28#include "linden_common.h" 28#include "linden_common.h"
29#include "llimagej2coj.h" 29#include "llimagej2coj.h"
30 30
31// this is defined so that we get static linking.
32#define OPJ_STATIC
31#include "openjpeg/openjpeg.h" 33#include "openjpeg/openjpeg.h"
32 34
33#include "lltimer.h" 35#include "lltimer.h"
@@ -122,46 +124,61 @@ BOOL LLImageJ2COJ::decodeImpl(LLImageJ2C &base, LLImageRaw &raw_image, F32 decod
122 124
123 /* decode the stream and fill the image structure */ 125 /* decode the stream and fill the image structure */
124 image = opj_decode(dinfo, cio); 126 image = opj_decode(dinfo, cio);
125 if(!image)
126 {
127 fprintf(stderr, "ERROR -> j2k_to_image: failed to decode image!\n");
128 opj_destroy_decompress(dinfo);
129 opj_cio_close(cio);
130 return 1;
131 }
132 127
133 /* close the byte stream */ 128 /* close the byte stream */
134 opj_cio_close(cio); 129 opj_cio_close(cio);
135 130
136
137 /* free remaining structures */ 131 /* free remaining structures */
138 if(dinfo) { 132 if(dinfo)
133 {
139 opj_destroy_decompress(dinfo); 134 opj_destroy_decompress(dinfo);
140 } 135 }
141 136
137 // The image decode failed if the return was NULL or the component
138 // count was zero. The latter is just a sanity check before we
139 // dereference the array.
140 if(!image || !image->numcomps)
141 {
142 fprintf(stderr, "ERROR -> decodeImpl: failed to decode image!\n");
143 if (image)
144 opj_image_destroy(image);
145
146 return TRUE; // done
147 }
148
142 // Copy image data into our raw image format (instead of the separate channel format 149 // Copy image data into our raw image format (instead of the separate channel format
143 S32 width = 0;
144 S32 height = 0;
145 150
146 S32 img_components = image->numcomps; 151 S32 img_components = image->numcomps;
147 S32 channels = img_components - first_channel; 152 S32 channels = img_components - first_channel;
148 if( channels > max_channel_count ) 153 if( channels > max_channel_count )
149 {
150 channels = max_channel_count; 154 channels = max_channel_count;
151 } 155
152 width = image->x1 - image->x0; 156 // Component buffers are allocated in an image width by height buffer.
153 height = image->y1 - image->y0; 157 // The image placed in that buffer is ceil(width/2^factor) by
158 // ceil(height/2^factor) and if the factor isn't zero it will be at the
159 // top left of the buffer with black filled in the rest of the pixels.
160 // It is integer math so the formula is written in ceildivpo2.
161 // (Assuming all the components have the same width, height and
162 // factor.)
163 S32 comp_width = image->comps[0].w;
164 S32 f=image->comps[0].factor;
165 S32 width = ceildivpow2(image->x1 - image->x0, f);
166 S32 height = ceildivpow2(image->y1 - image->y0, f);
154 raw_image.resize(width, height, channels); 167 raw_image.resize(width, height, channels);
155 U8 *rawp = raw_image.getData(); 168 U8 *rawp = raw_image.getData();
156 169
157 for (S32 comp = first_channel; comp < first_channel + channels; comp++) 170 // first_channel is what channel to start copying from
171 // dest is what channel to copy to. first_channel comes from the
172 // argument, dest always starts writing at channel zero.
173 for (S32 comp = first_channel, dest=0; comp < first_channel + channels;
174 comp++, dest++)
158 { 175 {
159 S32 offset = comp; 176 S32 offset = dest;
160 for (S32 y = (height - 1); y >= 0; y--) 177 for (S32 y = (height - 1); y >= 0; y--)
161 { 178 {
162 for (S32 x = 0; x < width; x++) 179 for (S32 x = 0; x < width; x++)
163 { 180 {
164 rawp[offset] = image->comps[comp].data[y*width + x]; 181 rawp[offset] = image->comps[comp].data[y*comp_width + x];
165 offset += channels; 182 offset += channels;
166 } 183 }
167 } 184 }
@@ -170,8 +187,7 @@ BOOL LLImageJ2COJ::decodeImpl(LLImageJ2C &base, LLImageRaw &raw_image, F32 decod
170 /* free image data structure */ 187 /* free image data structure */
171 opj_image_destroy(image); 188 opj_image_destroy(image);
172 189
173 base.setDecodingDone(); 190 return TRUE; // done
174 return TRUE;
175} 191}
176 192
177 193
@@ -281,6 +297,7 @@ BOOL LLImageJ2COJ::encodeImpl(LLImageJ2C &base, const LLImageRaw &raw_image, con
281 codestream_length = cio_tell(cio); 297 codestream_length = cio_tell(cio);
282 298
283 base.copyData(cio->buffer, codestream_length); 299 base.copyData(cio->buffer, codestream_length);
300 base.updateData(); // set width, height
284 301
285 /* close and free the byte stream */ 302 /* close and free the byte stream */
286 opj_cio_close(cio); 303 opj_cio_close(cio);
@@ -323,6 +340,9 @@ BOOL LLImageJ2COJ::getMetadata(LLImageJ2C &base)
323 /* set decoding parameters to default values */ 340 /* set decoding parameters to default values */
324 opj_set_default_decoder_parameters(&parameters); 341 opj_set_default_decoder_parameters(&parameters);
325 342
343 // Only decode what's required to get the size data.
344 parameters.cp_limit_decoding=LIMIT_TO_MAIN_HEADER;
345
326 //parameters.cp_reduce = mRawDiscardLevel; 346 //parameters.cp_reduce = mRawDiscardLevel;
327 347
328 /* decode the code-stream */ 348 /* decode the code-stream */
@@ -344,23 +364,22 @@ BOOL LLImageJ2COJ::getMetadata(LLImageJ2C &base)
344 364
345 /* decode the stream and fill the image structure */ 365 /* decode the stream and fill the image structure */
346 image = opj_decode(dinfo, cio); 366 image = opj_decode(dinfo, cio);
347 if(!image)
348 {
349 fprintf(stderr, "ERROR -> j2k_to_image: failed to decode image!\n");
350 opj_destroy_decompress(dinfo);
351 opj_cio_close(cio);
352 return 1;
353 }
354 367
355 /* close the byte stream */ 368 /* close the byte stream */
356 opj_cio_close(cio); 369 opj_cio_close(cio);
357 370
358
359 /* free remaining structures */ 371 /* free remaining structures */
360 if(dinfo) { 372 if(dinfo)
373 {
361 opj_destroy_decompress(dinfo); 374 opj_destroy_decompress(dinfo);
362 } 375 }
363 376
377 if(!image)
378 {
379 fprintf(stderr, "ERROR -> getMetadata: failed to decode image!\n");
380 return FALSE;
381 }
382
364 // Copy image data into our raw image format (instead of the separate channel format 383 // Copy image data into our raw image format (instead of the separate channel format
365 S32 width = 0; 384 S32 width = 0;
366 S32 height = 0; 385 S32 height = 0;
@@ -371,5 +390,6 @@ BOOL LLImageJ2COJ::getMetadata(LLImageJ2C &base)
371 base.setSize(width, height, img_components); 390 base.setSize(width, height, img_components);
372 391
373 /* free image data structure */ 392 /* free image data structure */
374 opj_image_destroy(image); return TRUE; 393 opj_image_destroy(image);
394 return TRUE;
375} 395}
diff --git a/linden/indra/llimagej2coj/llimagej2coj.h b/linden/indra/llimagej2coj/llimagej2coj.h
index 3fbf495..c3e3d52 100644
--- a/linden/indra/llimagej2coj/llimagej2coj.h
+++ b/linden/indra/llimagej2coj/llimagej2coj.h
@@ -40,6 +40,11 @@ protected:
40 /*virtual*/ BOOL getMetadata(LLImageJ2C &base); 40 /*virtual*/ BOOL getMetadata(LLImageJ2C &base);
41 /*virtual*/ BOOL decodeImpl(LLImageJ2C &base, LLImageRaw &raw_image, F32 decode_time, S32 first_channel, S32 max_channel_count); 41 /*virtual*/ BOOL decodeImpl(LLImageJ2C &base, LLImageRaw &raw_image, F32 decode_time, S32 first_channel, S32 max_channel_count);
42 /*virtual*/ BOOL encodeImpl(LLImageJ2C &base, const LLImageRaw &raw_image, const char* comment_text, F32 encode_time=0.0); 42 /*virtual*/ BOOL encodeImpl(LLImageJ2C &base, const LLImageRaw &raw_image, const char* comment_text, F32 encode_time=0.0);
43 int ceildivpow2(int a, int b)
44 {
45 // Divide a by b to the power of 2 and round upwards.
46 return (a + (1 << b) - 1) >> b;
47 }
43 48
44 // Temporary variables for in-progress decodes... 49 // Temporary variables for in-progress decodes...
45 LLImageRaw *mRawImagep; 50 LLImageRaw *mRawImagep;
diff --git a/linden/indra/llinventory/llinventory.cpp b/linden/indra/llinventory/llinventory.cpp
index 3235748..c5be7f7 100644
--- a/linden/indra/llinventory/llinventory.cpp
+++ b/linden/indra/llinventory/llinventory.cpp
@@ -32,7 +32,7 @@
32#include "llinventory.h" 32#include "llinventory.h"
33 33
34#include "lldbstrings.h" 34#include "lldbstrings.h"
35#include "llcrypto.h" 35#include "llxorcipher.h"
36#include "llsd.h" 36#include "llsd.h"
37#include "message.h" 37#include "message.h"
38#include <boost/tokenizer.hpp> 38#include <boost/tokenizer.hpp>
@@ -42,6 +42,24 @@
42#include "llsdutil.h" 42#include "llsdutil.h"
43 43
44///---------------------------------------------------------------------------- 44///----------------------------------------------------------------------------
45/// exported functions
46///----------------------------------------------------------------------------
47
48static const std::string INV_ITEM_ID_LABEL("item_id");
49static const std::string INV_FOLDER_ID_LABEL("folder_id");
50static const std::string INV_PARENT_ID_LABEL("parent_id");
51static const std::string INV_ASSET_TYPE_LABEL("type");
52static const std::string INV_PREFERRED_TYPE_LABEL("preferred_type");
53static const std::string INV_INVENTORY_TYPE_LABEL("inv_type");
54static const std::string INV_NAME_LABEL("name");
55static const std::string INV_DESC_LABEL("desc");
56static const std::string INV_PERMISSIONS_LABEL("permissions");
57static const std::string INV_ASSET_ID_LABEL("asset_id");
58static const std::string INV_SALE_INFO_LABEL("sale_info");
59static const std::string INV_FLAGS_LABEL("flags");
60static const std::string INV_CREATION_DATE_LABEL("created_at");
61
62///----------------------------------------------------------------------------
45/// Local function declarations, constants, enums, and typedefs 63/// Local function declarations, constants, enums, and typedefs
46///---------------------------------------------------------------------------- 64///----------------------------------------------------------------------------
47 65
@@ -322,16 +340,16 @@ BOOL LLInventoryObject::importLegacyStream(std::istream& input_stream)
322{ 340{
323 // *NOTE: Changing the buffer size will require changing the scanf 341 // *NOTE: Changing the buffer size will require changing the scanf
324 // calls below. 342 // calls below.
325 char buffer[MAX_STRING]; 343 char buffer[MAX_STRING]; /* Flawfinder: ignore */
326 char keyword[MAX_STRING]; 344 char keyword[MAX_STRING]; /* Flawfinder: ignore */
327 char valuestr[MAX_STRING]; 345 char valuestr[MAX_STRING]; /* Flawfinder: ignore */
328 346
329 keyword[0] = '\0'; 347 keyword[0] = '\0';
330 valuestr[0] = '\0'; 348 valuestr[0] = '\0';
331 while(input_stream.good()) 349 while(input_stream.good())
332 { 350 {
333 input_stream.getline(buffer, MAX_STRING); 351 input_stream.getline(buffer, MAX_STRING);
334 sscanf(buffer, " %254s %254s", keyword, valuestr); 352 sscanf(buffer, " %254s %254s", keyword, valuestr); /* Flawfinder: ignore */
335 if(!keyword) 353 if(!keyword)
336 { 354 {
337 continue; 355 continue;
@@ -360,7 +378,10 @@ BOOL LLInventoryObject::importLegacyStream(std::istream& input_stream)
360 { 378 {
361 //strcpy(valuestr, buffer + strlen(keyword) + 3); 379 //strcpy(valuestr, buffer + strlen(keyword) + 3);
362 // *NOTE: Not ANSI C, but widely supported. 380 // *NOTE: Not ANSI C, but widely supported.
363 sscanf(buffer, " %254s %254[^|]", keyword, valuestr); 381 sscanf( /* Flawfinder: ignore */
382 buffer,
383 " %254s %254[^|]",
384 keyword, valuestr);
364 mName.assign(valuestr); 385 mName.assign(valuestr);
365 LLString::replaceNonstandardASCII(mName, ' '); 386 LLString::replaceNonstandardASCII(mName, ' ');
366 LLString::replaceChar(mName, '|', ' '); 387 LLString::replaceChar(mName, '|', ' ');
@@ -380,7 +401,7 @@ BOOL LLInventoryObject::importLegacyStream(std::istream& input_stream)
380// not sure whether exportLegacyStream(llofstream(fp)) would work, fp may need to get icramented... 401// not sure whether exportLegacyStream(llofstream(fp)) would work, fp may need to get icramented...
381BOOL LLInventoryObject::exportFile(FILE* fp, BOOL) const 402BOOL LLInventoryObject::exportFile(FILE* fp, BOOL) const
382{ 403{
383 char uuid_str[UUID_STR_LENGTH]; 404 char uuid_str[UUID_STR_LENGTH]; /* Flawfinder: ignore */
384 fprintf(fp, "\tinv_object\t0\n\t{\n"); 405 fprintf(fp, "\tinv_object\t0\n\t{\n");
385 mUUID.toString(uuid_str); 406 mUUID.toString(uuid_str);
386 fprintf(fp, "\t\tobj_id\t%s\n", uuid_str); 407 fprintf(fp, "\t\tobj_id\t%s\n", uuid_str);
@@ -394,7 +415,7 @@ BOOL LLInventoryObject::exportFile(FILE* fp, BOOL) const
394 415
395BOOL LLInventoryObject::exportLegacyStream(std::ostream& output_stream, BOOL) const 416BOOL LLInventoryObject::exportLegacyStream(std::ostream& output_stream, BOOL) const
396{ 417{
397 char uuid_str[UUID_STR_LENGTH]; 418 char uuid_str[UUID_STR_LENGTH]; /* Flawfinder: ignore */
398 output_stream << "\tinv_object\t0\n\t{\n"; 419 output_stream << "\tinv_object\t0\n\t{\n";
399 mUUID.toString(uuid_str); 420 mUUID.toString(uuid_str);
400 output_stream << "\t\tobj_id\t" << uuid_str << "\n"; 421 output_stream << "\t\tobj_id\t" << uuid_str << "\n";
@@ -647,12 +668,12 @@ BOOL LLInventoryItem::unpackMessage(LLMessageSystem* msg, const char* block, S32
647 668
648 mSaleInfo.unpackMultiMessage(msg, block, block_num); 669 mSaleInfo.unpackMultiMessage(msg, block, block_num);
649 670
650 char name[DB_INV_ITEM_NAME_BUF_SIZE]; 671 char name[DB_INV_ITEM_NAME_BUF_SIZE]; /* Flawfinder: ignore */
651 msg->getStringFast(block, _PREHASH_Name, DB_INV_ITEM_NAME_BUF_SIZE, name, block_num); 672 msg->getStringFast(block, _PREHASH_Name, DB_INV_ITEM_NAME_BUF_SIZE, name, block_num);
652 mName.assign(name); 673 mName.assign(name);
653 LLString::replaceNonstandardASCII(mName, ' '); 674 LLString::replaceNonstandardASCII(mName, ' ');
654 675
655 char desc[DB_INV_ITEM_DESC_BUF_SIZE]; 676 char desc[DB_INV_ITEM_DESC_BUF_SIZE]; /* Flawfinder: ignore */
656 msg->getStringFast(block, _PREHASH_Description, DB_INV_ITEM_DESC_BUF_SIZE, desc, block_num); 677 msg->getStringFast(block, _PREHASH_Description, DB_INV_ITEM_DESC_BUF_SIZE, desc, block_num);
657 mDescription.assign(desc); 678 mDescription.assign(desc);
658 LLString::replaceNonstandardASCII(mDescription, ' '); 679 LLString::replaceNonstandardASCII(mDescription, ' ');
@@ -685,10 +706,10 @@ BOOL LLInventoryItem::importFile(FILE* fp)
685{ 706{
686 // *NOTE: Changing the buffer size will require changing the scanf 707 // *NOTE: Changing the buffer size will require changing the scanf
687 // calls below. 708 // calls below.
688 char buffer[MAX_STRING]; 709 char buffer[MAX_STRING]; /* Flawfinder: ignore */
689 char keyword[MAX_STRING]; 710 char keyword[MAX_STRING]; /* Flawfinder: ignore */
690 char valuestr[MAX_STRING]; 711 char valuestr[MAX_STRING]; /* Flawfinder: ignore */
691 char junk[MAX_STRING]; 712 char junk[MAX_STRING]; /* Flawfinder: ignore */
692 BOOL success = TRUE; 713 BOOL success = TRUE;
693 714
694 keyword[0] = '\0'; 715 keyword[0] = '\0';
@@ -699,7 +720,7 @@ BOOL LLInventoryItem::importFile(FILE* fp)
699 while(success && (!feof(fp))) 720 while(success && (!feof(fp)))
700 { 721 {
701 fgets(buffer, MAX_STRING, fp); 722 fgets(buffer, MAX_STRING, fp);
702 sscanf(buffer, " %254s %254s", keyword, valuestr); 723 sscanf(buffer, " %254s %254s", keyword, valuestr); /* Flawfinder: ignore */
703 if(!keyword) 724 if(!keyword)
704 { 725 {
705 continue; 726 continue;
@@ -773,7 +794,10 @@ BOOL LLInventoryItem::importFile(FILE* fp)
773 { 794 {
774 //strcpy(valuestr, buffer + strlen(keyword) + 3); 795 //strcpy(valuestr, buffer + strlen(keyword) + 3);
775 // *NOTE: Not ANSI C, but widely supported. 796 // *NOTE: Not ANSI C, but widely supported.
776 sscanf(buffer, " %254s%254[\t]%254[^|]", keyword, junk, valuestr); 797 sscanf( /* Flawfinder: ignore */
798 buffer,
799 " %254s%254[\t]%254[^|]",
800 keyword, junk, valuestr);
777 801
778 // IW: sscanf chokes and puts | in valuestr if there's no name 802 // IW: sscanf chokes and puts | in valuestr if there's no name
779 if (valuestr[0] == '|') 803 if (valuestr[0] == '|')
@@ -789,7 +813,10 @@ BOOL LLInventoryItem::importFile(FILE* fp)
789 { 813 {
790 //strcpy(valuestr, buffer + strlen(keyword) + 3); 814 //strcpy(valuestr, buffer + strlen(keyword) + 3);
791 // *NOTE: Not ANSI C, but widely supported. 815 // *NOTE: Not ANSI C, but widely supported.
792 sscanf(buffer, " %254s%254[\t]%254[^|]", keyword, junk, valuestr); 816 sscanf( /* Flawfinder: ignore */
817 buffer,
818 " %254s%254[\t]%254[^|]",
819 keyword, junk, valuestr);
793 820
794 if (valuestr[0] == '|') 821 if (valuestr[0] == '|')
795 { 822 {
@@ -831,7 +858,7 @@ BOOL LLInventoryItem::importFile(FILE* fp)
831 858
832BOOL LLInventoryItem::exportFile(FILE* fp, BOOL include_asset_key) const 859BOOL LLInventoryItem::exportFile(FILE* fp, BOOL include_asset_key) const
833{ 860{
834 char uuid_str[UUID_STR_LENGTH]; 861 char uuid_str[UUID_STR_LENGTH]; /* Flawfinder: ignore */
835 fprintf(fp, "\tinv_item\t0\n\t{\n"); 862 fprintf(fp, "\tinv_item\t0\n\t{\n");
836 mUUID.toString(uuid_str); 863 mUUID.toString(uuid_str);
837 fprintf(fp, "\t\titem_id\t%s\n", uuid_str); 864 fprintf(fp, "\t\titem_id\t%s\n", uuid_str);
@@ -881,10 +908,10 @@ BOOL LLInventoryItem::importLegacyStream(std::istream& input_stream)
881{ 908{
882 // *NOTE: Changing the buffer size will require changing the scanf 909 // *NOTE: Changing the buffer size will require changing the scanf
883 // calls below. 910 // calls below.
884 char buffer[MAX_STRING]; 911 char buffer[MAX_STRING]; /* Flawfinder: ignore */
885 char keyword[MAX_STRING]; 912 char keyword[MAX_STRING]; /* Flawfinder: ignore */
886 char valuestr[MAX_STRING]; 913 char valuestr[MAX_STRING]; /* Flawfinder: ignore */
887 char junk[MAX_STRING]; 914 char junk[MAX_STRING]; /* Flawfinder: ignore */
888 BOOL success = TRUE; 915 BOOL success = TRUE;
889 916
890 keyword[0] = '\0'; 917 keyword[0] = '\0';
@@ -895,7 +922,10 @@ BOOL LLInventoryItem::importLegacyStream(std::istream& input_stream)
895 while(success && input_stream.good()) 922 while(success && input_stream.good())
896 { 923 {
897 input_stream.getline(buffer, MAX_STRING); 924 input_stream.getline(buffer, MAX_STRING);
898 sscanf(buffer, " %254s %254s", keyword, valuestr); 925 sscanf( /* Flawfinder: ignore */
926 buffer,
927 " %254s %254s",
928 keyword, valuestr);
899 if(!keyword) 929 if(!keyword)
900 { 930 {
901 continue; 931 continue;
@@ -969,7 +999,10 @@ BOOL LLInventoryItem::importLegacyStream(std::istream& input_stream)
969 { 999 {
970 //strcpy(valuestr, buffer + strlen(keyword) + 3); 1000 //strcpy(valuestr, buffer + strlen(keyword) + 3);
971 // *NOTE: Not ANSI C, but widely supported. 1001 // *NOTE: Not ANSI C, but widely supported.
972 sscanf(buffer, " %254s%254[\t]%254[^|]", keyword, junk, valuestr); 1002 sscanf( /* Flawfinder: ignore */
1003 buffer,
1004 " %254s%254[\t]%254[^|]",
1005 keyword, junk, valuestr);
973 1006
974 // IW: sscanf chokes and puts | in valuestr if there's no name 1007 // IW: sscanf chokes and puts | in valuestr if there's no name
975 if (valuestr[0] == '|') 1008 if (valuestr[0] == '|')
@@ -985,7 +1018,10 @@ BOOL LLInventoryItem::importLegacyStream(std::istream& input_stream)
985 { 1018 {
986 //strcpy(valuestr, buffer + strlen(keyword) + 3); 1019 //strcpy(valuestr, buffer + strlen(keyword) + 3);
987 // *NOTE: Not ANSI C, but widely supported. 1020 // *NOTE: Not ANSI C, but widely supported.
988 sscanf(buffer, " %254s%254[\t]%254[^|]", keyword, junk, valuestr); 1021 sscanf( /* Flawfinder: ignore */
1022 buffer,
1023 " %254s%254[\t]%254[^|]",
1024 keyword, junk, valuestr);
989 1025
990 if (valuestr[0] == '|') 1026 if (valuestr[0] == '|')
991 { 1027 {
@@ -1027,7 +1063,7 @@ BOOL LLInventoryItem::importLegacyStream(std::istream& input_stream)
1027 1063
1028BOOL LLInventoryItem::exportLegacyStream(std::ostream& output_stream, BOOL include_asset_key) const 1064BOOL LLInventoryItem::exportLegacyStream(std::ostream& output_stream, BOOL include_asset_key) const
1029{ 1065{
1030 char uuid_str[UUID_STR_LENGTH]; 1066 char uuid_str[UUID_STR_LENGTH]; /* Flawfinder: ignore */
1031 output_stream << "\tinv_item\t0\n\t{\n"; 1067 output_stream << "\tinv_item\t0\n\t{\n";
1032 mUUID.toString(uuid_str); 1068 mUUID.toString(uuid_str);
1033 output_stream << "\t\titem_id\t" << uuid_str << "\n"; 1069 output_stream << "\t\titem_id\t" << uuid_str << "\n";
@@ -1064,8 +1100,8 @@ BOOL LLInventoryItem::exportLegacyStream(std::ostream& output_stream, BOOL inclu
1064 const char* inv_type_str = LLInventoryType::lookup(mInventoryType); 1100 const char* inv_type_str = LLInventoryType::lookup(mInventoryType);
1065 if(inv_type_str) 1101 if(inv_type_str)
1066 output_stream << "\t\tinv_type\t" << inv_type_str << "\n"; 1102 output_stream << "\t\tinv_type\t" << inv_type_str << "\n";
1067 char buffer[32]; 1103 char buffer[32]; /* Flawfinder: ignore */
1068 sprintf(buffer, "\t\tflags\t%08x\n", mFlags); 1104 snprintf(buffer, sizeof(buffer), "\t\tflags\t%08x\n", mFlags); /* Flawfinder: ignore */
1069 output_stream << buffer; 1105 output_stream << buffer;
1070 mSaleInfo.exportLegacyStream(output_stream); 1106 mSaleInfo.exportLegacyStream(output_stream);
1071 output_stream << "\t\tname\t" << mName.c_str() << "|\n"; 1107 output_stream << "\t\tname\t" << mName.c_str() << "|\n";
@@ -1114,24 +1150,24 @@ bool LLInventoryItem::fromLLSD(LLSD& sd)
1114{ 1150{
1115 mInventoryType = LLInventoryType::IT_NONE; 1151 mInventoryType = LLInventoryType::IT_NONE;
1116 mAssetUUID.setNull(); 1152 mAssetUUID.setNull();
1117 const char *w; 1153 std::string w;
1118 1154
1119 w = "item_id"; 1155 w = INV_ITEM_ID_LABEL;
1120 if (sd.has(w)) 1156 if (sd.has(w))
1121 { 1157 {
1122 mUUID = sd[w]; 1158 mUUID = sd[w];
1123 } 1159 }
1124 w = "parent_id"; 1160 w = INV_PARENT_ID_LABEL;
1125 if (sd.has(w)) 1161 if (sd.has(w))
1126 { 1162 {
1127 mParentUUID = sd[w]; 1163 mParentUUID = sd[w];
1128 } 1164 }
1129 w = "permissions"; 1165 w = INV_PERMISSIONS_LABEL;
1130 if (sd.has(w)) 1166 if (sd.has(w))
1131 { 1167 {
1132 mPermissions = ll_permissions_from_sd(sd[w]); 1168 mPermissions = ll_permissions_from_sd(sd[w]);
1133 } 1169 }
1134 w = "sale_info"; 1170 w = INV_SALE_INFO_LABEL;
1135 if (sd.has(w)) 1171 if (sd.has(w))
1136 { 1172 {
1137 // Sale info used to contain next owner perm. It is now in 1173 // Sale info used to contain next owner perm. It is now in
@@ -1165,40 +1201,40 @@ bool LLInventoryItem::fromLLSD(LLSD& sd)
1165 LLXORCipher cipher(MAGIC_ID.mData, UUID_BYTES); 1201 LLXORCipher cipher(MAGIC_ID.mData, UUID_BYTES);
1166 cipher.decrypt(mAssetUUID.mData, UUID_BYTES); 1202 cipher.decrypt(mAssetUUID.mData, UUID_BYTES);
1167 } 1203 }
1168 w = "asset_id"; 1204 w = INV_ASSET_ID_LABEL;
1169 if (sd.has(w)) 1205 if (sd.has(w))
1170 { 1206 {
1171 mAssetUUID = sd[w]; 1207 mAssetUUID = sd[w];
1172 } 1208 }
1173 w = "type"; 1209 w = INV_ASSET_TYPE_LABEL;
1174 if (sd.has(w)) 1210 if (sd.has(w))
1175 { 1211 {
1176 mType = LLAssetType::lookup(sd[w].asString().c_str()); 1212 mType = LLAssetType::lookup(sd[w].asString().c_str());
1177 } 1213 }
1178 w = "inv_type"; 1214 w = INV_INVENTORY_TYPE_LABEL;
1179 if (sd.has(w)) 1215 if (sd.has(w))
1180 { 1216 {
1181 mInventoryType = LLInventoryType::lookup(sd[w].asString().c_str()); 1217 mInventoryType = LLInventoryType::lookup(sd[w].asString().c_str());
1182 } 1218 }
1183 w = "flags"; 1219 w = INV_FLAGS_LABEL;
1184 if (sd.has(w)) 1220 if (sd.has(w))
1185 { 1221 {
1186 mFlags = ll_U32_from_sd(sd[w]); 1222 mFlags = ll_U32_from_sd(sd[w]);
1187 } 1223 }
1188 w = "name"; 1224 w = INV_NAME_LABEL;
1189 if (sd.has(w)) 1225 if (sd.has(w))
1190 { 1226 {
1191 mName = sd[w].asString(); 1227 mName = sd[w].asString();
1192 LLString::replaceNonstandardASCII(mName, ' '); 1228 LLString::replaceNonstandardASCII(mName, ' ');
1193 LLString::replaceChar(mName, '|', ' '); 1229 LLString::replaceChar(mName, '|', ' ');
1194 } 1230 }
1195 w = "desc"; 1231 w = INV_DESC_LABEL;
1196 if (sd.has(w)) 1232 if (sd.has(w))
1197 { 1233 {
1198 mDescription = sd[w].asString(); 1234 mDescription = sd[w].asString();
1199 LLString::replaceNonstandardASCII(mDescription, ' '); 1235 LLString::replaceNonstandardASCII(mDescription, ' ');
1200 } 1236 }
1201 w = "creation_date"; 1237 w = INV_CREATION_DATE_LABEL;
1202 if (sd.has(w)) 1238 if (sd.has(w))
1203 { 1239 {
1204 mCreationDate = sd[w]; 1240 mCreationDate = sd[w];
@@ -1335,18 +1371,18 @@ S32 LLInventoryItem::packBinaryBucket(U8* bin_bucket, LLPermissions* perm_overri
1335 1371
1336 // describe the inventory item 1372 // describe the inventory item
1337 char* buffer = (char*) bin_bucket; 1373 char* buffer = (char*) bin_bucket;
1338 char creator_id_str[UUID_STR_LENGTH]; 1374 char creator_id_str[UUID_STR_LENGTH]; /* Flawfinder: ignore */
1339 1375
1340 perm.getCreator().toString(creator_id_str); 1376 perm.getCreator().toString(creator_id_str);
1341 char owner_id_str[UUID_STR_LENGTH]; 1377 char owner_id_str[UUID_STR_LENGTH]; /* Flawfinder: ignore */
1342 perm.getOwner().toString(owner_id_str); 1378 perm.getOwner().toString(owner_id_str);
1343 char last_owner_id_str[UUID_STR_LENGTH]; 1379 char last_owner_id_str[UUID_STR_LENGTH]; /* Flawfinder: ignore */
1344 perm.getLastOwner().toString(last_owner_id_str); 1380 perm.getLastOwner().toString(last_owner_id_str);
1345 char group_id_str[UUID_STR_LENGTH]; 1381 char group_id_str[UUID_STR_LENGTH]; /* Flawfinder: ignore */
1346 perm.getGroup().toString(group_id_str); 1382 perm.getGroup().toString(group_id_str);
1347 char asset_id_str[UUID_STR_LENGTH]; 1383 char asset_id_str[UUID_STR_LENGTH]; /* Flawfinder: ignore */
1348 getAssetUUID().toString(asset_id_str); 1384 getAssetUUID().toString(asset_id_str);
1349 S32 size = sprintf(buffer, 1385 S32 size = sprintf(buffer, /* Flawfinder: ignore */
1350 "%d|%d|%s|%s|%s|%s|%s|%x|%x|%x|%x|%x|%s|%s|%d|%d|%x", 1386 "%d|%d|%s|%s|%s|%s|%s|%x|%x|%x|%x|%x|%s|%s|%d|%d|%x",
1351 getType(), 1387 getType(),
1352 getInventoryType(), 1388 getInventoryType(),
@@ -1376,7 +1412,15 @@ void LLInventoryItem::unpackBinaryBucket(U8* bin_bucket, S32 bin_bucket_size)
1376 1412
1377 // Convert the bin_bucket into a string. 1413 // Convert the bin_bucket into a string.
1378 char* item_buffer = new char[bin_bucket_size+1]; 1414 char* item_buffer = new char[bin_bucket_size+1];
1379 memcpy(item_buffer, bin_bucket, bin_bucket_size); 1415 if ((item_buffer != NULL) && (bin_bucket != NULL))
1416 {
1417 memcpy(item_buffer, bin_bucket, bin_bucket_size); /* Flawfinder: ignore */
1418 }
1419 else
1420 {
1421 llerrs << "unpackBinaryBucket failed. item_buffer or bin_bucket is Null." << llendl;
1422 return;
1423 }
1380 item_buffer[bin_bucket_size] = '\0'; 1424 item_buffer[bin_bucket_size] = '\0';
1381 std::string str(item_buffer); 1425 std::string str(item_buffer);
1382 1426
@@ -1519,7 +1563,7 @@ void LLInventoryCategory::unpackMessage(LLMessageSystem* msg,
1519 S8 type; 1563 S8 type;
1520 msg->getS8Fast(block, _PREHASH_Type, type, block_num); 1564 msg->getS8Fast(block, _PREHASH_Type, type, block_num);
1521 mPreferredType = static_cast<LLAssetType::EType>(type); 1565 mPreferredType = static_cast<LLAssetType::EType>(type);
1522 char name[DB_INV_ITEM_NAME_BUF_SIZE]; 1566 char name[DB_INV_ITEM_NAME_BUF_SIZE]; /* Flawfinder: ignore */
1523 msg->getStringFast(block, _PREHASH_Name, DB_INV_ITEM_NAME_BUF_SIZE, name, block_num); 1567 msg->getStringFast(block, _PREHASH_Name, DB_INV_ITEM_NAME_BUF_SIZE, name, block_num);
1524 mName.assign(name); 1568 mName.assign(name);
1525 LLString::replaceNonstandardASCII(mName, ' '); 1569 LLString::replaceNonstandardASCII(mName, ' ');
@@ -1530,16 +1574,19 @@ BOOL LLInventoryCategory::importFile(FILE* fp)
1530{ 1574{
1531 // *NOTE: Changing the buffer size will require changing the scanf 1575 // *NOTE: Changing the buffer size will require changing the scanf
1532 // calls below. 1576 // calls below.
1533 char buffer[MAX_STRING]; 1577 char buffer[MAX_STRING]; /* Flawfinder: ignore */
1534 char keyword[MAX_STRING]; 1578 char keyword[MAX_STRING]; /* Flawfinder: ignore */
1535 char valuestr[MAX_STRING]; 1579 char valuestr[MAX_STRING]; /* Flawfinder: ignore */
1536 1580
1537 keyword[0] = '\0'; 1581 keyword[0] = '\0';
1538 valuestr[0] = '\0'; 1582 valuestr[0] = '\0';
1539 while(!feof(fp)) 1583 while(!feof(fp))
1540 { 1584 {
1541 fgets(buffer, MAX_STRING, fp); 1585 fgets(buffer, MAX_STRING, fp);
1542 sscanf(buffer, " %254s %254s", keyword, valuestr); 1586 sscanf( /* Flawfinder: ignore */
1587 buffer,
1588 " %254s %254s",
1589 keyword, valuestr);
1543 if(!keyword) 1590 if(!keyword)
1544 { 1591 {
1545 continue; 1592 continue;
@@ -1572,7 +1619,10 @@ BOOL LLInventoryCategory::importFile(FILE* fp)
1572 { 1619 {
1573 //strcpy(valuestr, buffer + strlen(keyword) + 3); 1620 //strcpy(valuestr, buffer + strlen(keyword) + 3);
1574 // *NOTE: Not ANSI C, but widely supported. 1621 // *NOTE: Not ANSI C, but widely supported.
1575 sscanf(buffer, " %254s %254[^|]", keyword, valuestr); 1622 sscanf( /* Flawfinder: ignore */
1623 buffer,
1624 " %254s %254[^|]",
1625 keyword, valuestr);
1576 mName.assign(valuestr); 1626 mName.assign(valuestr);
1577 LLString::replaceNonstandardASCII(mName, ' '); 1627 LLString::replaceNonstandardASCII(mName, ' ');
1578 LLString::replaceChar(mName, '|', ' '); 1628 LLString::replaceChar(mName, '|', ' ');
@@ -1588,7 +1638,7 @@ BOOL LLInventoryCategory::importFile(FILE* fp)
1588 1638
1589BOOL LLInventoryCategory::exportFile(FILE* fp, BOOL) const 1639BOOL LLInventoryCategory::exportFile(FILE* fp, BOOL) const
1590{ 1640{
1591 char uuid_str[UUID_STR_LENGTH]; 1641 char uuid_str[UUID_STR_LENGTH]; /* Flawfinder: ignore */
1592 fprintf(fp, "\tinv_category\t0\n\t{\n"); 1642 fprintf(fp, "\tinv_category\t0\n\t{\n");
1593 mUUID.toString(uuid_str); 1643 mUUID.toString(uuid_str);
1594 fprintf(fp, "\t\tcat_id\t%s\n", uuid_str); 1644 fprintf(fp, "\t\tcat_id\t%s\n", uuid_str);
@@ -1607,16 +1657,19 @@ BOOL LLInventoryCategory::importLegacyStream(std::istream& input_stream)
1607{ 1657{
1608 // *NOTE: Changing the buffer size will require changing the scanf 1658 // *NOTE: Changing the buffer size will require changing the scanf
1609 // calls below. 1659 // calls below.
1610 char buffer[MAX_STRING]; 1660 char buffer[MAX_STRING]; /* Flawfinder: ignore */
1611 char keyword[MAX_STRING]; 1661 char keyword[MAX_STRING]; /* Flawfinder: ignore */
1612 char valuestr[MAX_STRING]; 1662 char valuestr[MAX_STRING]; /* Flawfinder: ignore */
1613 1663
1614 keyword[0] = '\0'; 1664 keyword[0] = '\0';
1615 valuestr[0] = '\0'; 1665 valuestr[0] = '\0';
1616 while(input_stream.good()) 1666 while(input_stream.good())
1617 { 1667 {
1618 input_stream.getline(buffer, MAX_STRING); 1668 input_stream.getline(buffer, MAX_STRING);
1619 sscanf(buffer, " %254s %254s", keyword, valuestr); 1669 sscanf( /* Flawfinder: ignore */
1670 buffer,
1671 " %254s %254s",
1672 keyword, valuestr);
1620 if(!keyword) 1673 if(!keyword)
1621 { 1674 {
1622 continue; 1675 continue;
@@ -1649,7 +1702,10 @@ BOOL LLInventoryCategory::importLegacyStream(std::istream& input_stream)
1649 { 1702 {
1650 //strcpy(valuestr, buffer + strlen(keyword) + 3); 1703 //strcpy(valuestr, buffer + strlen(keyword) + 3);
1651 // *NOTE: Not ANSI C, but widely supported. 1704 // *NOTE: Not ANSI C, but widely supported.
1652 sscanf(buffer, " %254s %254[^|]", keyword, valuestr); 1705 sscanf( /* Flawfinder: ignore */
1706 buffer,
1707 " %254s %254[^|]",
1708 keyword, valuestr);
1653 mName.assign(valuestr); 1709 mName.assign(valuestr);
1654 LLString::replaceNonstandardASCII(mName, ' '); 1710 LLString::replaceNonstandardASCII(mName, ' ');
1655 LLString::replaceChar(mName, '|', ' '); 1711 LLString::replaceChar(mName, '|', ' ');
@@ -1665,7 +1721,7 @@ BOOL LLInventoryCategory::importLegacyStream(std::istream& input_stream)
1665 1721
1666BOOL LLInventoryCategory::exportLegacyStream(std::ostream& output_stream, BOOL) const 1722BOOL LLInventoryCategory::exportLegacyStream(std::ostream& output_stream, BOOL) const
1667{ 1723{
1668 char uuid_str[UUID_STR_LENGTH]; 1724 char uuid_str[UUID_STR_LENGTH]; /* Flawfinder: ignore */
1669 output_stream << "\tinv_category\t0\n\t{\n"; 1725 output_stream << "\tinv_category\t0\n\t{\n";
1670 mUUID.toString(uuid_str); 1726 mUUID.toString(uuid_str);
1671 output_stream << "\t\tcat_id\t" << uuid_str << "\n"; 1727 output_stream << "\t\tcat_id\t" << uuid_str << "\n";
@@ -1701,24 +1757,6 @@ bool inventory_and_asset_types_match(
1701 return rv; 1757 return rv;
1702} 1758}
1703 1759
1704///----------------------------------------------------------------------------
1705/// exported functions
1706///----------------------------------------------------------------------------
1707
1708static const std::string INV_ITEM_ID_LABEL("item_id");
1709static const std::string INV_FOLDER_ID_LABEL("folder_id");
1710static const std::string INV_PARENT_ID_LABEL("parent_id");
1711static const std::string INV_ASSET_TYPE_LABEL("asset_type");
1712static const std::string INV_PREFERRED_TYPE_LABEL("preferred_type");
1713static const std::string INV_INVENTORY_TYPE_LABEL("inv_type");
1714static const std::string INV_NAME_LABEL("name");
1715static const std::string INV_DESC_LABEL("description");
1716static const std::string INV_PERMISSIONS_LABEL("permissions");
1717static const std::string INV_ASSET_ID_LABEL("asset_id");
1718static const std::string INV_SALE_INFO_LABEL("sale_info");
1719static const std::string INV_FLAGS_LABEL("flags");
1720static const std::string INV_CREATION_DATE_LABEL("created_at");
1721
1722LLSD ll_create_sd_from_inventory_item(LLPointer<LLInventoryItem> item) 1760LLSD ll_create_sd_from_inventory_item(LLPointer<LLInventoryItem> item)
1723{ 1761{
1724 LLSD rv; 1762 LLSD rv;
diff --git a/linden/indra/llinventory/llinventory.h b/linden/indra/llinventory/llinventory.h
index 1ebcabf..fc135de 100644
--- a/linden/indra/llinventory/llinventory.h
+++ b/linden/indra/llinventory/llinventory.h
@@ -32,6 +32,7 @@
32 32
33#include "llassetstorage.h" 33#include "llassetstorage.h"
34#include "lldarray.h" 34#include "lldarray.h"
35#include "llmemtype.h"
35#include "llpermissions.h" 36#include "llpermissions.h"
36#include "llsaleinfo.h" 37#include "llsaleinfo.h"
37#include "llsd.h" 38#include "llsd.h"
@@ -382,6 +383,12 @@ struct SetItemOwnerAndGroup
382 LLPermissions perm = item->getPermissions(); 383 LLPermissions perm = item->getPermissions();
383 bool is_atomic = (LLAssetType::AT_OBJECT == item->getType()) ? false : true; 384 bool is_atomic = (LLAssetType::AT_OBJECT == item->getType()) ? false : true;
384 perm.setOwnerAndGroup(mAuthorityID, mOwnerID, mGroupID, is_atomic); 385 perm.setOwnerAndGroup(mAuthorityID, mOwnerID, mGroupID, is_atomic);
386 // If no owner id is set, this is equivalent to a deed action.
387 // Clear 'share with group'.
388 if (mOwnerID.isNull())
389 {
390 perm.setMaskGroup(PERM_NONE);
391 }
385 item->setPermissions(perm); 392 item->setPermissions(perm);
386 } 393 }
387}; 394};
diff --git a/linden/indra/llinventory/llinventory_vc8.vcproj b/linden/indra/llinventory/llinventory_vc8.vcproj
new file mode 100644
index 0000000..d66f352
--- /dev/null
+++ b/linden/indra/llinventory/llinventory_vc8.vcproj
@@ -0,0 +1,336 @@
1<?xml version="1.0" encoding="Windows-1252"?>
2<VisualStudioProject
3 ProjectType="Visual C++"
4 Version="8.00"
5 Name="llinventory"
6 ProjectGUID="{328D1968-924F-4863-AAE8-5F9A95BA68E5}"
7 Keyword="Win32Proj"
8 >
9 <Platforms>
10 <Platform
11 Name="Win32"
12 />
13 </Platforms>
14 <ToolFiles>
15 </ToolFiles>
16 <Configurations>
17 <Configuration
18 Name="Debug|Win32"
19 OutputDirectory="../lib_$(ConfigurationName)/i686-win32"
20 IntermediateDirectory="Debug"
21 ConfigurationType="4"
22 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
23 CharacterSet="1"
24 >
25 <Tool
26 Name="VCPreBuildEventTool"
27 />
28 <Tool
29 Name="VCCustomBuildTool"
30 />
31 <Tool
32 Name="VCXMLDataGeneratorTool"
33 />
34 <Tool
35 Name="VCWebServiceProxyGeneratorTool"
36 />
37 <Tool
38 Name="VCMIDLTool"
39 />
40 <Tool
41 Name="VCCLCompilerTool"
42 Optimization="0"
43 AdditionalIncludeDirectories="..\llcommon;..\llmath;..\llvfs;..\llmessage;..\llxml;..\..\libraries\i686-win32\include;..\..\libraries\include"
44 PreprocessorDefinitions="WIN32;_DEBUG;_LIB;LL_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;LL_DEBUG"
45 MinimalRebuild="true"
46 BasicRuntimeChecks="3"
47 RuntimeLibrary="1"
48 StructMemberAlignment="4"
49 TreatWChar_tAsBuiltInType="false"
50 ForceConformanceInForLoopScope="true"
51 UsePrecompiledHeader="0"
52 WarningLevel="3"
53 WarnAsError="true"
54 Detect64BitPortabilityProblems="false"
55 DebugInformationFormat="4"
56 />
57 <Tool
58 Name="VCManagedResourceCompilerTool"
59 />
60 <Tool
61 Name="VCResourceCompilerTool"
62 />
63 <Tool
64 Name="VCPreLinkEventTool"
65 />
66 <Tool
67 Name="VCLibrarianTool"
68 OutputFile="$(OutDir)/llinventory.lib"
69 />
70 <Tool
71 Name="VCALinkTool"
72 />
73 <Tool
74 Name="VCXDCMakeTool"
75 />
76 <Tool
77 Name="VCBscMakeTool"
78 />
79 <Tool
80 Name="VCFxCopTool"
81 />
82 <Tool
83 Name="VCPostBuildEventTool"
84 />
85 </Configuration>
86 <Configuration
87 Name="Release|Win32"
88 OutputDirectory="../lib_$(ConfigurationName)/i686-win32"
89 IntermediateDirectory="Release"
90 ConfigurationType="4"
91 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
92 CharacterSet="1"
93 >
94 <Tool
95 Name="VCPreBuildEventTool"
96 />
97 <Tool
98 Name="VCCustomBuildTool"
99 />
100 <Tool
101 Name="VCXMLDataGeneratorTool"
102 />
103 <Tool
104 Name="VCWebServiceProxyGeneratorTool"
105 />
106 <Tool
107 Name="VCMIDLTool"
108 />
109 <Tool
110 Name="VCCLCompilerTool"
111 AdditionalIncludeDirectories="..\llcommon;..\llmath;..\llvfs;..\llmessage;..\llxml;..\..\libraries\i686-win32\include;..\..\libraries\include"
112 PreprocessorDefinitions="WIN32;NDEBUG;_LIB;LL_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;LL_RELEASE"
113 RuntimeLibrary="0"
114 StructMemberAlignment="0"
115 TreatWChar_tAsBuiltInType="false"
116 ForceConformanceInForLoopScope="true"
117 UsePrecompiledHeader="0"
118 WarningLevel="3"
119 WarnAsError="true"
120 Detect64BitPortabilityProblems="false"
121 DebugInformationFormat="3"
122 />
123 <Tool
124 Name="VCManagedResourceCompilerTool"
125 />
126 <Tool
127 Name="VCResourceCompilerTool"
128 />
129 <Tool
130 Name="VCPreLinkEventTool"
131 />
132 <Tool
133 Name="VCLibrarianTool"
134 OutputFile="$(OutDir)/llinventory.lib"
135 />
136 <Tool
137 Name="VCALinkTool"
138 />
139 <Tool
140 Name="VCXDCMakeTool"
141 />
142 <Tool
143 Name="VCBscMakeTool"
144 />
145 <Tool
146 Name="VCFxCopTool"
147 />
148 <Tool
149 Name="VCPostBuildEventTool"
150 />
151 </Configuration>
152 <Configuration
153 Name="ReleaseNoOpt|Win32"
154 OutputDirectory="../lib_$(ConfigurationName)/i686-win32"
155 IntermediateDirectory="$(ConfigurationName)"
156 ConfigurationType="4"
157 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
158 CharacterSet="1"
159 >
160 <Tool
161 Name="VCPreBuildEventTool"
162 />
163 <Tool
164 Name="VCCustomBuildTool"
165 />
166 <Tool
167 Name="VCXMLDataGeneratorTool"
168 />
169 <Tool
170 Name="VCWebServiceProxyGeneratorTool"
171 />
172 <Tool
173 Name="VCMIDLTool"
174 />
175 <Tool
176 Name="VCCLCompilerTool"
177 Optimization="0"
178 AdditionalIncludeDirectories="..\llcommon;..\llmath;..\llvfs;..\llmessage;..\llxml;..\..\libraries\i686-win32\include;..\..\libraries\include"
179 PreprocessorDefinitions="WIN32;NDEBUG;_LIB;LL_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;LL_RELEASE"
180 RuntimeLibrary="0"
181 StructMemberAlignment="0"
182 TreatWChar_tAsBuiltInType="false"
183 ForceConformanceInForLoopScope="true"
184 UsePrecompiledHeader="0"
185 WarningLevel="3"
186 WarnAsError="true"
187 Detect64BitPortabilityProblems="false"
188 DebugInformationFormat="3"
189 />
190 <Tool
191 Name="VCManagedResourceCompilerTool"
192 />
193 <Tool
194 Name="VCResourceCompilerTool"
195 />
196 <Tool
197 Name="VCPreLinkEventTool"
198 />
199 <Tool
200 Name="VCLibrarianTool"
201 OutputFile="$(OutDir)/llinventory.lib"
202 />
203 <Tool
204 Name="VCALinkTool"
205 />
206 <Tool
207 Name="VCXDCMakeTool"
208 />
209 <Tool
210 Name="VCBscMakeTool"
211 />
212 <Tool
213 Name="VCFxCopTool"
214 />
215 <Tool
216 Name="VCPostBuildEventTool"
217 />
218 </Configuration>
219 </Configurations>
220 <References>
221 </References>
222 <Files>
223 <Filter
224 Name="Source Files"
225 Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
226 UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
227 >
228 <File
229 RelativePath=".\llcategory.cpp"
230 >
231 </File>
232 <File
233 RelativePath=".\lleconomy.cpp"
234 >
235 </File>
236 <File
237 RelativePath=".\llinventory.cpp"
238 >
239 </File>
240 <File
241 RelativePath=".\lllandmark.cpp"
242 >
243 </File>
244 <File
245 RelativePath=".\llnotecard.cpp"
246 >
247 </File>
248 <File
249 RelativePath=".\llparcel.cpp"
250 >
251 </File>
252 <File
253 RelativePath=".\llpermissions.cpp"
254 >
255 </File>
256 <File
257 RelativePath=".\llsaleinfo.cpp"
258 >
259 </File>
260 <File
261 RelativePath=".\lltransactionflags.cpp"
262 >
263 </File>
264 <File
265 RelativePath=".\lluserrelations.cpp"
266 >
267 </File>
268 </Filter>
269 <Filter
270 Name="Header Files"
271 Filter="h;hpp;hxx;hm;inl;inc;xsd"
272 UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
273 >
274 <File
275 RelativePath=".\llcategory.h"
276 >
277 </File>
278 <File
279 RelativePath=".\lleconomy.h"
280 >
281 </File>
282 <File
283 RelativePath=".\llinventory.h"
284 >
285 </File>
286 <File
287 RelativePath=".\lllandmark.h"
288 >
289 </File>
290 <File
291 RelativePath=".\llnotecard.h"
292 >
293 </File>
294 <File
295 RelativePath=".\llparcel.h"
296 >
297 </File>
298 <File
299 RelativePath=".\llparcelflags.h"
300 >
301 </File>
302 <File
303 RelativePath=".\llpermissions.h"
304 >
305 </File>
306 <File
307 RelativePath=".\llpermissionsflags.h"
308 >
309 </File>
310 <File
311 RelativePath=".\llsaleinfo.h"
312 >
313 </File>
314 <File
315 RelativePath=".\lltransactionflags.h"
316 >
317 </File>
318 <File
319 RelativePath=".\lltransactiontypes.h"
320 >
321 </File>
322 <File
323 RelativePath=".\lluserrelations.h"
324 >
325 </File>
326 </Filter>
327 <Filter
328 Name="Resource Files"
329 Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
330 UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
331 >
332 </Filter>
333 </Files>
334 <Globals>
335 </Globals>
336</VisualStudioProject>
diff --git a/linden/indra/llinventory/lllandmark.cpp b/linden/indra/llinventory/lllandmark.cpp
index d7dca20..c153d68 100644
--- a/linden/indra/llinventory/lllandmark.cpp
+++ b/linden/indra/llinventory/lllandmark.cpp
@@ -140,10 +140,13 @@ LLLandmark* LLLandmark::constructFromString(const char *buffer)
140 { 140 {
141 // *NOTE: Changing the buffer size will require changing the 141 // *NOTE: Changing the buffer size will require changing the
142 // scanf call below. 142 // scanf call below.
143 char region_id_str[MAX_STRING]; 143 char region_id_str[MAX_STRING]; /* Flawfinder: ignore */
144 LLVector3 pos; 144 LLVector3 pos;
145 cur += chars_read; 145 cur += chars_read;
146 count = sscanf(cur, "region_id %254s\n%n", region_id_str, &chars_read); 146 count = sscanf( /* Flawfinder: ignore */
147 cur,
148 "region_id %254s\n%n",
149 region_id_str, &chars_read);
147 if(count != 1) goto error; 150 if(count != 1) goto error;
148 cur += chars_read; 151 cur += chars_read;
149 count = sscanf(cur, "local_pos %f %f %f\n%n", pos.mV+VX, pos.mV+VY, pos.mV+VZ, &chars_read); 152 count = sscanf(cur, "local_pos %f %f %f\n%n", pos.mV+VX, pos.mV+VY, pos.mV+VZ, &chars_read);
diff --git a/linden/indra/llinventory/llnotecard.cpp b/linden/indra/llinventory/llnotecard.cpp
index 5f48f0e..d40cabb 100644
--- a/linden/indra/llinventory/llnotecard.cpp
+++ b/linden/indra/llinventory/llnotecard.cpp
@@ -26,11 +26,10 @@
26 */ 26 */
27 27
28#include "linden_common.h" 28#include "linden_common.h"
29#include "llinventory.h"
30#include "llnotecard.h" 29#include "llnotecard.h"
31#include "llstreamtools.h" 30#include "llstreamtools.h"
32 31
33LLNotecard::LLNotecard(U32 max_text) 32LLNotecard::LLNotecard(S32 max_text)
34: mMaxText(max_text) 33: mMaxText(max_text)
35{ 34{
36} 35}
@@ -189,7 +188,7 @@ bool LLNotecard::importStream(std::istream& str)
189 return FALSE; 188 return FALSE;
190 } 189 }
191 190
192 char line_buf[STD_STRING_BUF_SIZE]; 191 char line_buf[STD_STRING_BUF_SIZE]; /* Flawfinder: ignore */
193 str.getline(line_buf, STD_STRING_BUF_SIZE); 192 str.getline(line_buf, STD_STRING_BUF_SIZE);
194 if(str.fail()) 193 if(str.fail())
195 { 194 {
@@ -198,7 +197,7 @@ bool LLNotecard::importStream(std::istream& str)
198 } 197 }
199 line_buf[STD_STRING_STR_LEN] = '\0'; 198 line_buf[STD_STRING_STR_LEN] = '\0';
200 199
201 U32 text_len = 0; 200 S32 text_len = 0;
202 if( 1 != sscanf(line_buf, "Text length %d", &text_len) ) 201 if( 1 != sscanf(line_buf, "Text length %d", &text_len) )
203 { 202 {
204 llwarns << "Invalid Linden text length field" << llendl; 203 llwarns << "Invalid Linden text length field" << llendl;
diff --git a/linden/indra/llinventory/llnotecard.h b/linden/indra/llinventory/llnotecard.h
index 2475fd1..511d779 100644
--- a/linden/indra/llinventory/llnotecard.h
+++ b/linden/indra/llinventory/llnotecard.h
@@ -28,12 +28,21 @@
28#ifndef LL_NOTECARD_H 28#ifndef LL_NOTECARD_H
29#define LL_NOTECARD_H 29#define LL_NOTECARD_H
30 30
31const S32 MAX_NOTECARD_SIZE = 65536; 31#include "llmemory.h"
32#include "llinventory.h"
32 33
33class LLNotecard 34class LLNotecard
34{ 35{
35public: 36public:
36 LLNotecard(U32 max_text); 37 /**
38 * @brief anonymous enumeration to set max size.
39 */
40 enum
41 {
42 MAX_SIZE = 65536
43 };
44
45 LLNotecard(S32 max_text = LLNotecard::MAX_SIZE);
37 virtual ~LLNotecard(); 46 virtual ~LLNotecard();
38 47
39 bool importStream(std::istream& str); 48 bool importStream(std::istream& str);
@@ -52,7 +61,7 @@ private:
52 bool exportEmbeddedItemsStream(std::ostream& str); 61 bool exportEmbeddedItemsStream(std::ostream& str);
53 std::vector<LLPointer<LLInventoryItem> > mItems; 62 std::vector<LLPointer<LLInventoryItem> > mItems;
54 LLString mText; 63 LLString mText;
55 U32 mMaxText; 64 S32 mMaxText;
56 S32 mVersion; 65 S32 mVersion;
57 S32 mEmbeddedVersion; 66 S32 mEmbeddedVersion;
58}; 67};
diff --git a/linden/indra/llinventory/llparcel.cpp b/linden/indra/llinventory/llparcel.cpp
index 9839e43..b4faf7c 100644
--- a/linden/indra/llinventory/llparcel.cpp
+++ b/linden/indra/llinventory/llparcel.cpp
@@ -1017,7 +1017,7 @@ BOOL LLParcel::importAccessEntry(std::istream& input_stream, LLAccessEntry* entr
1017BOOL LLParcel::exportStream(std::ostream& output_stream) 1017BOOL LLParcel::exportStream(std::ostream& output_stream)
1018{ 1018{
1019 S32 setting; 1019 S32 setting;
1020 char id_string[MAX_STRING]; 1020 char id_string[MAX_STRING]; /* Flawfinder: ignore */
1021 1021
1022 std::ios::fmtflags old_flags = output_stream.flags(); 1022 std::ios::fmtflags old_flags = output_stream.flags();
1023 output_stream.setf(std::ios::showpoint); 1023 output_stream.setf(std::ios::showpoint);
@@ -1248,7 +1248,7 @@ void LLParcel::packMessage(LLMessageSystem* msg)
1248 1248
1249void LLParcel::unpackMessage(LLMessageSystem* msg) 1249void LLParcel::unpackMessage(LLMessageSystem* msg)
1250{ 1250{
1251 char buffer[256]; 1251 char buffer[256]; /* Flawfinder: ignore */
1252 1252
1253 msg->getU32Fast( _PREHASH_ParcelData,_PREHASH_ParcelFlags, mParcelFlags ); 1253 msg->getU32Fast( _PREHASH_ParcelData,_PREHASH_ParcelFlags, mParcelFlags );
1254 msg->getS32Fast( _PREHASH_ParcelData,_PREHASH_SalePrice, mSalePrice ); 1254 msg->getS32Fast( _PREHASH_ParcelData,_PREHASH_SalePrice, mSalePrice );
diff --git a/linden/indra/llinventory/llpermissions.cpp b/linden/indra/llinventory/llpermissions.cpp
index 35dbc3e..0788ec6 100644
--- a/linden/indra/llinventory/llpermissions.cpp
+++ b/linden/indra/llinventory/llpermissions.cpp
@@ -283,6 +283,7 @@ BOOL LLPermissions::deedToGroup(const LLUUID& agent, const LLUUID& group)
283 mOwner.setNull(); 283 mOwner.setNull();
284 } 284 }
285 mMaskBase = mMaskNextOwner; 285 mMaskBase = mMaskNextOwner;
286 mMaskGroup = PERM_NONE;
286 mGroup = group; 287 mGroup = group;
287 mIsGroupOwned = true; 288 mIsGroupOwned = true;
288 fixFairUse(); 289 fixFairUse();
@@ -506,18 +507,18 @@ void LLPermissions::unpackMessage(LLMessageSystem* msg, const char* block, S32 b
506// File support 507// File support
507// 508//
508 509
509BOOL LLPermissions::importFile(FILE *fp) 510BOOL LLPermissions::importFile(FILE* fp)
510{ 511{
511 init(LLUUID::null, LLUUID::null, LLUUID::null, LLUUID::null); 512 init(LLUUID::null, LLUUID::null, LLUUID::null, LLUUID::null);
512 const S32 BUFSIZE = 16384; 513 const S32 BUFSIZE = 16384;
513 514
514 // *NOTE: Changing the buffer size will require changing the scanf 515 // *NOTE: Changing the buffer size will require changing the scanf
515 // calls below. 516 // calls below.
516 char buffer[BUFSIZE]; 517 char buffer[BUFSIZE]; /* Flawfinder: ignore */
517 char keyword[256]; 518 char keyword[256]; /* Flawfinder: ignore */
518 char valuestr[256]; 519 char valuestr[256]; /* Flawfinder: ignore */
519 char uuid_str[256]; 520 char uuid_str[256]; /* Flawfinder: ignore */
520 U32 mask; 521 U32 mask;
521 522
522 keyword[0] = '\0'; 523 keyword[0] = '\0';
523 valuestr[0] = '\0'; 524 valuestr[0] = '\0';
@@ -525,7 +526,10 @@ BOOL LLPermissions::importFile(FILE *fp)
525 while (!feof(fp)) 526 while (!feof(fp))
526 { 527 {
527 fgets(buffer, BUFSIZE, fp); 528 fgets(buffer, BUFSIZE, fp);
528 sscanf(buffer, " %255s %255s", keyword, valuestr); 529 sscanf( /* Flawfinder: ignore */
530 buffer,
531 " %255s %255s",
532 keyword, valuestr);
529 if (!keyword) 533 if (!keyword)
530 { 534 {
531 continue; 535 continue;
@@ -573,22 +577,22 @@ BOOL LLPermissions::importFile(FILE *fp)
573 } 577 }
574 else if (!strcmp("creator_id", keyword)) 578 else if (!strcmp("creator_id", keyword))
575 { 579 {
576 sscanf(valuestr, "%255s", uuid_str); 580 sscanf(valuestr, "%255s", uuid_str); /* Flawfinder: ignore */
577 mCreator.set(uuid_str); 581 mCreator.set(uuid_str);
578 } 582 }
579 else if (!strcmp("owner_id", keyword)) 583 else if (!strcmp("owner_id", keyword))
580 { 584 {
581 sscanf(valuestr, "%255s", uuid_str); 585 sscanf(valuestr, "%255s", uuid_str); /* Flawfinder: ignore */
582 mOwner.set(uuid_str); 586 mOwner.set(uuid_str);
583 } 587 }
584 else if (!strcmp("last_owner_id", keyword)) 588 else if (!strcmp("last_owner_id", keyword))
585 { 589 {
586 sscanf(valuestr, "%255s", uuid_str); 590 sscanf(valuestr, "%255s", uuid_str); /* Flawfinder: ignore */
587 mLastOwner.set(uuid_str); 591 mLastOwner.set(uuid_str);
588 } 592 }
589 else if (!strcmp("group_id", keyword)) 593 else if (!strcmp("group_id", keyword))
590 { 594 {
591 sscanf(valuestr, "%255s", uuid_str); 595 sscanf(valuestr, "%255s", uuid_str); /* Flawfinder: ignore */
592 mGroup.set(uuid_str); 596 mGroup.set(uuid_str);
593 } 597 }
594 else if (!strcmp("group_owned", keyword)) 598 else if (!strcmp("group_owned", keyword))
@@ -607,9 +611,9 @@ BOOL LLPermissions::importFile(FILE *fp)
607} 611}
608 612
609 613
610BOOL LLPermissions::exportFile(FILE *fp) const 614BOOL LLPermissions::exportFile(FILE* fp) const
611{ 615{
612 char uuid_str[256]; 616 char uuid_str[256]; /* Flawfinder: ignore */
613 617
614 fprintf(fp, "\tpermissions 0\n"); 618 fprintf(fp, "\tpermissions 0\n");
615 fprintf(fp, "\t{\n"); 619 fprintf(fp, "\t{\n");
@@ -648,11 +652,11 @@ BOOL LLPermissions::importLegacyStream(std::istream& input_stream)
648 652
649 // *NOTE: Changing the buffer size will require changing the scanf 653 // *NOTE: Changing the buffer size will require changing the scanf
650 // calls below. 654 // calls below.
651 char buffer[BUFSIZE]; 655 char buffer[BUFSIZE]; /* Flawfinder: ignore */
652 char keyword[256]; 656 char keyword[256]; /* Flawfinder: ignore */
653 char valuestr[256]; 657 char valuestr[256]; /* Flawfinder: ignore */
654 char uuid_str[256]; 658 char uuid_str[256]; /* Flawfinder: ignore */
655 U32 mask; 659 U32 mask;
656 660
657 keyword[0] = '\0'; 661 keyword[0] = '\0';
658 valuestr[0] = '\0'; 662 valuestr[0] = '\0';
@@ -660,7 +664,10 @@ BOOL LLPermissions::importLegacyStream(std::istream& input_stream)
660 while (input_stream.good()) 664 while (input_stream.good())
661 { 665 {
662 input_stream.getline(buffer, BUFSIZE); 666 input_stream.getline(buffer, BUFSIZE);
663 sscanf(buffer, " %255s %255s", keyword, valuestr); 667 sscanf( /* Flawfinder: ignore */
668 buffer,
669 " %255s %255s",
670 keyword, valuestr);
664 if (!keyword) 671 if (!keyword)
665 { 672 {
666 continue; 673 continue;
@@ -708,22 +715,22 @@ BOOL LLPermissions::importLegacyStream(std::istream& input_stream)
708 } 715 }
709 else if (!strcmp("creator_id", keyword)) 716 else if (!strcmp("creator_id", keyword))
710 { 717 {
711 sscanf(valuestr, "%255s", uuid_str); 718 sscanf(valuestr, "%255s", uuid_str); /* Flawfinder: ignore */
712 mCreator.set(uuid_str); 719 mCreator.set(uuid_str);
713 } 720 }
714 else if (!strcmp("owner_id", keyword)) 721 else if (!strcmp("owner_id", keyword))
715 { 722 {
716 sscanf(valuestr, "%255s", uuid_str); 723 sscanf(valuestr, "%255s", uuid_str); /* Flawfinder: ignore */
717 mOwner.set(uuid_str); 724 mOwner.set(uuid_str);
718 } 725 }
719 else if (!strcmp("last_owner_id", keyword)) 726 else if (!strcmp("last_owner_id", keyword))
720 { 727 {
721 sscanf(valuestr, "%255s", uuid_str); 728 sscanf(valuestr, "%255s", uuid_str); /* Flawfinder: ignore */
722 mLastOwner.set(uuid_str); 729 mLastOwner.set(uuid_str);
723 } 730 }
724 else if (!strcmp("group_id", keyword)) 731 else if (!strcmp("group_id", keyword))
725 { 732 {
726 sscanf(valuestr, "%255s", uuid_str); 733 sscanf(valuestr, "%255s", uuid_str); /* Flawfinder: ignore */
727 mGroup.set(uuid_str); 734 mGroup.set(uuid_str);
728 } 735 }
729 else if (!strcmp("group_owned", keyword)) 736 else if (!strcmp("group_owned", keyword))
@@ -744,21 +751,21 @@ BOOL LLPermissions::importLegacyStream(std::istream& input_stream)
744 751
745BOOL LLPermissions::exportLegacyStream(std::ostream& output_stream) const 752BOOL LLPermissions::exportLegacyStream(std::ostream& output_stream) const
746{ 753{
747 char uuid_str[256]; 754 char uuid_str[256]; /* Flawfinder: ignore */
748 755
749 output_stream << "\tpermissions 0\n"; 756 output_stream << "\tpermissions 0\n";
750 output_stream << "\t{\n"; 757 output_stream << "\t{\n";
751 758
752 char buffer[256]; 759 char buffer[256]; /* Flawfinder: ignore */
753 sprintf(buffer, "\t\tbase_mask\t%08x\n", mMaskBase); 760 snprintf(buffer, sizeof(buffer), "\t\tbase_mask\t%08x\n", mMaskBase); /* Flawfinder: ignore */
754 output_stream << buffer; 761 output_stream << buffer;
755 sprintf(buffer, "\t\towner_mask\t%08x\n", mMaskOwner); 762 snprintf(buffer, sizeof(buffer), "\t\towner_mask\t%08x\n", mMaskOwner); /* Flawfinder: ignore */
756 output_stream << buffer; 763 output_stream << buffer;
757 sprintf(buffer, "\t\tgroup_mask\t%08x\n", mMaskGroup); 764 snprintf(buffer, sizeof(buffer), "\t\tgroup_mask\t%08x\n", mMaskGroup); /* Flawfinder: ignore */
758 output_stream << buffer; 765 output_stream << buffer;
759 sprintf(buffer, "\t\teveryone_mask\t%08x\n", mMaskEveryone); 766 snprintf(buffer, sizeof(buffer), "\t\teveryone_mask\t%08x\n", mMaskEveryone); /* Flawfinder: ignore */
760 output_stream << buffer; 767 output_stream << buffer;
761 sprintf(buffer, "\t\tnext_owner_mask\t%08x\n", mMaskNextOwner); 768 snprintf(buffer, sizeof(buffer), "\t\tnext_owner_mask\t%08x\n", mMaskNextOwner); /* Flawfinder: ignore */
762 output_stream << buffer; 769 output_stream << buffer;
763 770
764 mCreator.toString(uuid_str); 771 mCreator.toString(uuid_str);
diff --git a/linden/indra/llinventory/llsaleinfo.cpp b/linden/indra/llinventory/llsaleinfo.cpp
index 98043d1..28801e5 100644
--- a/linden/indra/llinventory/llsaleinfo.cpp
+++ b/linden/indra/llinventory/llsaleinfo.cpp
@@ -160,9 +160,9 @@ BOOL LLSaleInfo::importFile(FILE* fp, BOOL& has_perm_mask, U32& perm_mask)
160 160
161 // *NOTE: Changing the buffer size will require changing the scanf 161 // *NOTE: Changing the buffer size will require changing the scanf
162 // calls below. 162 // calls below.
163 char buffer[MAX_STRING]; 163 char buffer[MAX_STRING]; /* Flawfinder: ignore */
164 char keyword[MAX_STRING]; 164 char keyword[MAX_STRING]; /* Flawfinder: ignore */
165 char valuestr[MAX_STRING]; 165 char valuestr[MAX_STRING]; /* Flawfinder: ignore */
166 BOOL success = TRUE; 166 BOOL success = TRUE;
167 167
168 keyword[0] = '\0'; 168 keyword[0] = '\0';
@@ -170,7 +170,10 @@ BOOL LLSaleInfo::importFile(FILE* fp, BOOL& has_perm_mask, U32& perm_mask)
170 while(success && (!feof(fp))) 170 while(success && (!feof(fp)))
171 { 171 {
172 fgets(buffer, MAX_STRING, fp); 172 fgets(buffer, MAX_STRING, fp);
173 sscanf(buffer, " %254s %254s", keyword, valuestr); 173 sscanf( /* Flawfinder: ignore */
174 buffer,
175 " %254s %254s",
176 keyword, valuestr);
174 if(!keyword) 177 if(!keyword)
175 { 178 {
176 continue; 179 continue;
@@ -213,9 +216,9 @@ BOOL LLSaleInfo::importLegacyStream(std::istream& input_stream, BOOL& has_perm_m
213 216
214 // *NOTE: Changing the buffer size will require changing the scanf 217 // *NOTE: Changing the buffer size will require changing the scanf
215 // calls below. 218 // calls below.
216 char buffer[MAX_STRING]; 219 char buffer[MAX_STRING]; /* Flawfinder: ignore */
217 char keyword[MAX_STRING]; 220 char keyword[MAX_STRING]; /* Flawfinder: ignore */
218 char valuestr[MAX_STRING]; 221 char valuestr[MAX_STRING]; /* Flawfinder: ignore */
219 BOOL success = TRUE; 222 BOOL success = TRUE;
220 223
221 keyword[0] = '\0'; 224 keyword[0] = '\0';
@@ -223,7 +226,10 @@ BOOL LLSaleInfo::importLegacyStream(std::istream& input_stream, BOOL& has_perm_m
223 while(success && input_stream.good()) 226 while(success && input_stream.good())
224 { 227 {
225 input_stream.getline(buffer, MAX_STRING); 228 input_stream.getline(buffer, MAX_STRING);
226 sscanf(buffer, " %254s %254s", keyword, valuestr); 229 sscanf( /* Flawfinder: ignore */
230 buffer,
231 " %254s %254s",
232 keyword, valuestr);
227 if(!keyword) 233 if(!keyword)
228 { 234 {
229 continue; 235 continue;
diff --git a/linden/indra/llmath/llcamera.cpp b/linden/indra/llmath/llcamera.cpp
index 13666ba..bc13c90 100644
--- a/linden/indra/llmath/llcamera.cpp
+++ b/linden/indra/llmath/llcamera.cpp
@@ -121,25 +121,25 @@ void LLCamera::setFar(F32 far_plane)
121 121
122size_t LLCamera::writeFrustumToBuffer(char *buffer) const 122size_t LLCamera::writeFrustumToBuffer(char *buffer) const
123{ 123{
124 memcpy(buffer, &mView, sizeof(F32)); 124 memcpy(buffer, &mView, sizeof(F32)); /* Flawfinder: ignore */
125 buffer += sizeof(F32); 125 buffer += sizeof(F32);
126 memcpy(buffer, &mAspect, sizeof(F32)); 126 memcpy(buffer, &mAspect, sizeof(F32)); /* Flawfinder: ignore */
127 buffer += sizeof(F32); 127 buffer += sizeof(F32);
128 memcpy(buffer, &mNearPlane, sizeof(F32)); 128 memcpy(buffer, &mNearPlane, sizeof(F32)); /* Flawfinder: ignore */
129 buffer += sizeof(F32); 129 buffer += sizeof(F32);
130 memcpy(buffer, &mFarPlane, sizeof(F32)); 130 memcpy(buffer, &mFarPlane, sizeof(F32)); /* Flawfinder: ignore */
131 return 4*sizeof(F32); 131 return 4*sizeof(F32);
132} 132}
133 133
134size_t LLCamera::readFrustumFromBuffer(const char *buffer) 134size_t LLCamera::readFrustumFromBuffer(const char *buffer)
135{ 135{
136 memcpy(&mView, buffer, sizeof(F32)); 136 memcpy(&mView, buffer, sizeof(F32)); /* Flawfinder: ignore */
137 buffer += sizeof(F32); 137 buffer += sizeof(F32);
138 memcpy(&mAspect, buffer, sizeof(F32)); 138 memcpy(&mAspect, buffer, sizeof(F32)); /* Flawfinder: ignore */
139 buffer += sizeof(F32); 139 buffer += sizeof(F32);
140 memcpy(&mNearPlane, buffer, sizeof(F32)); 140 memcpy(&mNearPlane, buffer, sizeof(F32)); /* Flawfinder: ignore */
141 buffer += sizeof(F32); 141 buffer += sizeof(F32);
142 memcpy(&mFarPlane, buffer, sizeof(F32)); 142 memcpy(&mFarPlane, buffer, sizeof(F32)); /* Flawfinder: ignore */
143 return 4*sizeof(F32); 143 return 4*sizeof(F32);
144} 144}
145 145
diff --git a/linden/indra/llmath/llcoordframe.cpp b/linden/indra/llmath/llcoordframe.cpp
index 552854d..c7d18bb 100644
--- a/linden/indra/llmath/llcoordframe.cpp
+++ b/linden/indra/llmath/llcoordframe.cpp
@@ -460,26 +460,26 @@ void LLCoordFrame::getRotMatrixToParent(LLMatrix4& mat) const
460 460
461size_t LLCoordFrame::writeOrientation(char *buffer) const 461size_t LLCoordFrame::writeOrientation(char *buffer) const
462{ 462{
463 memcpy(buffer, mOrigin.mV, 3*sizeof(F32)); 463 memcpy(buffer, mOrigin.mV, 3*sizeof(F32)); /*Flawfinder: ignore */
464 buffer += 3*sizeof(F32); 464 buffer += 3*sizeof(F32);
465 memcpy(buffer, mXAxis.mV, 3*sizeof(F32)); 465 memcpy(buffer, mXAxis.mV, 3*sizeof(F32)); /*Flawfinder: ignore */
466 buffer += 3*sizeof(F32); 466 buffer += 3*sizeof(F32);
467 memcpy(buffer, mYAxis.mV, 3*sizeof(F32)); 467 memcpy(buffer, mYAxis.mV, 3*sizeof(F32));/*Flawfinder: ignore */
468 buffer += 3*sizeof(F32); 468 buffer += 3*sizeof(F32);
469 memcpy(buffer, mZAxis.mV, 3*sizeof(F32)); 469 memcpy(buffer, mZAxis.mV, 3*sizeof(F32)); /*Flawfinder: ignore */
470 return 12*sizeof(F32); 470 return 12*sizeof(F32);
471} 471}
472 472
473 473
474size_t LLCoordFrame::readOrientation(const char *buffer) 474size_t LLCoordFrame::readOrientation(const char *buffer)
475{ 475{
476 memcpy(mOrigin.mV, buffer, 3*sizeof(F32)); 476 memcpy(mOrigin.mV, buffer, 3*sizeof(F32)); /*Flawfinder: ignore */
477 buffer += 3*sizeof(F32); 477 buffer += 3*sizeof(F32);
478 memcpy(mXAxis.mV, buffer, 3*sizeof(F32)); 478 memcpy(mXAxis.mV, buffer, 3*sizeof(F32)); /*Flawfinder: ignore */
479 buffer += 3*sizeof(F32); 479 buffer += 3*sizeof(F32);
480 memcpy(mYAxis.mV, buffer, 3*sizeof(F32)); 480 memcpy(mYAxis.mV, buffer, 3*sizeof(F32)); /*Flawfinder: ignore */
481 buffer += 3*sizeof(F32); 481 buffer += 3*sizeof(F32);
482 memcpy(mZAxis.mV, buffer, 3*sizeof(F32)); 482 memcpy(mZAxis.mV, buffer, 3*sizeof(F32)); /*Flawfinder: ignore */
483 483
484 if( !isFinite() ) 484 if( !isFinite() )
485 { 485 {
diff --git a/linden/indra/llmath/llcrc.cpp b/linden/indra/llmath/llcrc.cpp
index 4194432..1c0aa5d 100644
--- a/linden/indra/llmath/llcrc.cpp
+++ b/linden/indra/llmath/llcrc.cpp
@@ -161,9 +161,15 @@ void LLCRC::update(const U8* buffer, U32 buffer_size)
161 } 161 }
162} 162}
163 163
164void LLCRC::update(const char *filename) 164void LLCRC::update(const char* filename)
165{ 165{
166 FILE *fp = LLFile::fopen(filename, "rb"); 166 if (!filename)
167 {
168 llerrs << "No filename specified" << llendl;
169 return;
170 }
171
172 FILE* fp = LLFile::fopen(filename, "rb"); /* Flawfinder: ignore */
167 173
168 if (fp) 174 if (fp)
169 { 175 {
@@ -172,12 +178,15 @@ void LLCRC::update(const char *filename)
172 178
173 fseek(fp, 0, SEEK_SET); 179 fseek(fp, 0, SEEK_SET);
174 180
175 U8 *data = new U8[size]; 181 if (size > 0)
176 fread(data, size, 1, fp); 182 {
177 fclose(fp); 183 U8* data = new U8[size];
184 fread(data, size, 1, fp);
185 fclose(fp);
178 186
179 update(data, size); 187 update(data, size);
180 delete[] data; 188 delete[] data;
189 }
181 } 190 }
182} 191}
183 192
@@ -186,7 +195,7 @@ void LLCRC::update(const char *filename)
186BOOL LLCRC::testHarness() 195BOOL LLCRC::testHarness()
187{ 196{
188 const S32 TEST_BUFFER_SIZE = 16; 197 const S32 TEST_BUFFER_SIZE = 16;
189 const char TEST_BUFFER[TEST_BUFFER_SIZE] = "hello &#$)$&Nd0"; 198 const char TEST_BUFFER[TEST_BUFFER_SIZE] = "hello &#$)$&Nd0"; /* Flawfinder: ignore */
190 LLCRC c1, c2; 199 LLCRC c1, c2;
191 c1.update((U8*)TEST_BUFFER, TEST_BUFFER_SIZE - 1); 200 c1.update((U8*)TEST_BUFFER, TEST_BUFFER_SIZE - 1);
192 char* rh = (char*)TEST_BUFFER; 201 char* rh = (char*)TEST_BUFFER;
diff --git a/linden/indra/llmath/llmath.vcproj b/linden/indra/llmath/llmath.vcproj
index 9b6047d..82feb25 100644
--- a/linden/indra/llmath/llmath.vcproj
+++ b/linden/indra/llmath/llmath.vcproj
@@ -224,6 +224,9 @@
224 Filter="h;hpp;hxx;hm;inl;inc;xsd" 224 Filter="h;hpp;hxx;hm;inl;inc;xsd"
225 UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"> 225 UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
226 <File 226 <File
227 RelativePath=".\linden_math.h">
228 </File>
229 <File
227 RelativePath=".\llbboxlocal.h"> 230 RelativePath=".\llbboxlocal.h">
228 </File> 231 </File>
229 <File 232 <File
@@ -242,9 +245,6 @@
242 RelativePath=".\llinterp.h"> 245 RelativePath=".\llinterp.h">
243 </File> 246 </File>
244 <File 247 <File
245 RelativePath=".\llmath.h">
246 </File>
247 <File
248 RelativePath=".\llmd5.h"> 248 RelativePath=".\llmd5.h">
249 </File> 249 </File>
250 <File 250 <File
@@ -308,6 +308,9 @@
308 RelativePath=".\v4math.h"> 308 RelativePath=".\v4math.h">
309 </File> 309 </File>
310 <File 310 <File
311 RelativePath=".\vmath.h">
312 </File>
313 <File
311 RelativePath=".\xform.h"> 314 RelativePath=".\xform.h">
312 </File> 315 </File>
313 </Filter> 316 </Filter>
diff --git a/linden/indra/llmath/llmath_vc8.vcproj b/linden/indra/llmath/llmath_vc8.vcproj
new file mode 100644
index 0000000..ea23702
--- /dev/null
+++ b/linden/indra/llmath/llmath_vc8.vcproj
@@ -0,0 +1,453 @@
1<?xml version="1.0" encoding="Windows-1252"?>
2<VisualStudioProject
3 ProjectType="Visual C++"
4 Version="8.00"
5 Name="llmath"
6 ProjectGUID="{E87FD9BE-BE42-4EA3-BF4D-D992223046D9}"
7 Keyword="Win32Proj"
8 >
9 <Platforms>
10 <Platform
11 Name="Win32"
12 />
13 </Platforms>
14 <ToolFiles>
15 </ToolFiles>
16 <Configurations>
17 <Configuration
18 Name="Debug|Win32"
19 OutputDirectory="../lib_$(ConfigurationName)/i686-win32"
20 IntermediateDirectory="$(ConfigurationName)"
21 ConfigurationType="4"
22 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
23 CharacterSet="1"
24 >
25 <Tool
26 Name="VCPreBuildEventTool"
27 />
28 <Tool
29 Name="VCCustomBuildTool"
30 />
31 <Tool
32 Name="VCXMLDataGeneratorTool"
33 />
34 <Tool
35 Name="VCWebServiceProxyGeneratorTool"
36 />
37 <Tool
38 Name="VCMIDLTool"
39 />
40 <Tool
41 Name="VCCLCompilerTool"
42 Optimization="0"
43 AdditionalIncludeDirectories="..\llcommon;..\..\libraries\i686-win32\include;..\..\libraries\include\"
44 PreprocessorDefinitions="WIN32;_DEBUG;_LIB;LL_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;LL_DEBUG"
45 MinimalRebuild="true"
46 BasicRuntimeChecks="3"
47 RuntimeLibrary="1"
48 StructMemberAlignment="4"
49 TreatWChar_tAsBuiltInType="false"
50 ForceConformanceInForLoopScope="true"
51 UsePrecompiledHeader="0"
52 WarningLevel="3"
53 WarnAsError="true"
54 Detect64BitPortabilityProblems="false"
55 DebugInformationFormat="4"
56 />
57 <Tool
58 Name="VCManagedResourceCompilerTool"
59 />
60 <Tool
61 Name="VCResourceCompilerTool"
62 />
63 <Tool
64 Name="VCPreLinkEventTool"
65 />
66 <Tool
67 Name="VCLibrarianTool"
68 OutputFile="$(OutDir)/llmath.lib"
69 />
70 <Tool
71 Name="VCALinkTool"
72 />
73 <Tool
74 Name="VCXDCMakeTool"
75 />
76 <Tool
77 Name="VCBscMakeTool"
78 />
79 <Tool
80 Name="VCFxCopTool"
81 />
82 <Tool
83 Name="VCPostBuildEventTool"
84 />
85 </Configuration>
86 <Configuration
87 Name="Release|Win32"
88 OutputDirectory="../lib_$(ConfigurationName)/i686-win32"
89 IntermediateDirectory="$(ConfigurationName)"
90 ConfigurationType="4"
91 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
92 CharacterSet="1"
93 >
94 <Tool
95 Name="VCPreBuildEventTool"
96 />
97 <Tool
98 Name="VCCustomBuildTool"
99 />
100 <Tool
101 Name="VCXMLDataGeneratorTool"
102 />
103 <Tool
104 Name="VCWebServiceProxyGeneratorTool"
105 />
106 <Tool
107 Name="VCMIDLTool"
108 />
109 <Tool
110 Name="VCCLCompilerTool"
111 AdditionalIncludeDirectories="..\llcommon;..\..\libraries\i686-win32\include;..\..\libraries\include\"
112 PreprocessorDefinitions="WIN32;NDEBUG;_LIB;LL_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;LL_RELEASE"
113 RuntimeLibrary="0"
114 StructMemberAlignment="0"
115 TreatWChar_tAsBuiltInType="false"
116 ForceConformanceInForLoopScope="true"
117 UsePrecompiledHeader="0"
118 WarningLevel="3"
119 WarnAsError="true"
120 Detect64BitPortabilityProblems="false"
121 DebugInformationFormat="3"
122 />
123 <Tool
124 Name="VCManagedResourceCompilerTool"
125 />
126 <Tool
127 Name="VCResourceCompilerTool"
128 />
129 <Tool
130 Name="VCPreLinkEventTool"
131 />
132 <Tool
133 Name="VCLibrarianTool"
134 OutputFile="$(OutDir)/llmath.lib"
135 />
136 <Tool
137 Name="VCALinkTool"
138 />
139 <Tool
140 Name="VCXDCMakeTool"
141 />
142 <Tool
143 Name="VCBscMakeTool"
144 />
145 <Tool
146 Name="VCFxCopTool"
147 />
148 <Tool
149 Name="VCPostBuildEventTool"
150 />
151 </Configuration>
152 <Configuration
153 Name="ReleaseNoOpt|Win32"
154 OutputDirectory="../lib_$(ConfigurationName)/i686-win32"
155 IntermediateDirectory="$(ConfigurationName)"
156 ConfigurationType="4"
157 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
158 CharacterSet="1"
159 >
160 <Tool
161 Name="VCPreBuildEventTool"
162 />
163 <Tool
164 Name="VCCustomBuildTool"
165 />
166 <Tool
167 Name="VCXMLDataGeneratorTool"
168 />
169 <Tool
170 Name="VCWebServiceProxyGeneratorTool"
171 />
172 <Tool
173 Name="VCMIDLTool"
174 />
175 <Tool
176 Name="VCCLCompilerTool"
177 Optimization="0"
178 AdditionalIncludeDirectories="..\llcommon;..\..\libraries\i686-win32\include;..\..\libraries\include\"
179 PreprocessorDefinitions="WIN32;NDEBUG;_LIB;LL_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;LL_RELEASE"
180 RuntimeLibrary="0"
181 StructMemberAlignment="0"
182 TreatWChar_tAsBuiltInType="false"
183 ForceConformanceInForLoopScope="true"
184 UsePrecompiledHeader="0"
185 BrowseInformation="0"
186 WarningLevel="3"
187 WarnAsError="true"
188 Detect64BitPortabilityProblems="false"
189 DebugInformationFormat="3"
190 />
191 <Tool
192 Name="VCManagedResourceCompilerTool"
193 />
194 <Tool
195 Name="VCResourceCompilerTool"
196 />
197 <Tool
198 Name="VCPreLinkEventTool"
199 />
200 <Tool
201 Name="VCLibrarianTool"
202 OutputFile="$(OutDir)/llmath.lib"
203 />
204 <Tool
205 Name="VCALinkTool"
206 />
207 <Tool
208 Name="VCXDCMakeTool"
209 />
210 <Tool
211 Name="VCBscMakeTool"
212 />
213 <Tool
214 Name="VCFxCopTool"
215 />
216 <Tool
217 Name="VCPostBuildEventTool"
218 />
219 </Configuration>
220 </Configurations>
221 <References>
222 </References>
223 <Files>
224 <Filter
225 Name="Source Files"
226 Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
227 UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
228 >
229 <File
230 RelativePath=".\llbboxlocal.cpp"
231 >
232 </File>
233 <File
234 RelativePath=".\llcamera.cpp"
235 >
236 </File>
237 <File
238 RelativePath=".\llcoordframe.cpp"
239 >
240 </File>
241 <File
242 RelativePath=".\llcrc.cpp"
243 >
244 </File>
245 <File
246 RelativePath=".\llmd5.cpp"
247 >
248 </File>
249 <File
250 RelativePath=".\llperlin.cpp"
251 >
252 </File>
253 <File
254 RelativePath=".\llquaternion.cpp"
255 >
256 </File>
257 <File
258 RelativePath=".\llrand.cpp"
259 >
260 </File>
261 <File
262 RelativePath=".\llrect.cpp"
263 >
264 </File>
265 <File
266 RelativePath=".\lluuid.cpp"
267 >
268 </File>
269 <File
270 RelativePath=".\llvolume.cpp"
271 >
272 </File>
273 <File
274 RelativePath=".\llvolumemgr.cpp"
275 >
276 </File>
277 <File
278 RelativePath=".\m3math.cpp"
279 >
280 </File>
281 <File
282 RelativePath=".\m4math.cpp"
283 >
284 </File>
285 <File
286 RelativePath=".\raytrace.cpp"
287 >
288 </File>
289 <File
290 RelativePath=".\v2math.cpp"
291 >
292 </File>
293 <File
294 RelativePath=".\v3color.cpp"
295 >
296 </File>
297 <File
298 RelativePath=".\v3dmath.cpp"
299 >
300 </File>
301 <File
302 RelativePath=".\v3math.cpp"
303 >
304 </File>
305 <File
306 RelativePath=".\v4color.cpp"
307 >
308 </File>
309 <File
310 RelativePath=".\v4coloru.cpp"
311 >
312 </File>
313 <File
314 RelativePath=".\v4math.cpp"
315 >
316 </File>
317 <File
318 RelativePath=".\xform.cpp"
319 >
320 </File>
321 </Filter>
322 <Filter
323 Name="Header Files"
324 Filter="h;hpp;hxx;hm;inl;inc;xsd"
325 UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
326 >
327 <File
328 RelativePath=".\llbboxlocal.h"
329 >
330 </File>
331 <File
332 RelativePath=".\llcamera.h"
333 >
334 </File>
335 <File
336 RelativePath=".\llcoord.h"
337 >
338 </File>
339 <File
340 RelativePath=".\llcoordframe.h"
341 >
342 </File>
343 <File
344 RelativePath=".\llcrc.h"
345 >
346 </File>
347 <File
348 RelativePath=".\llinterp.h"
349 >
350 </File>
351 <File
352 RelativePath=".\llmath.h"
353 >
354 </File>
355 <File
356 RelativePath=".\llmd5.h"
357 >
358 </File>
359 <File
360 RelativePath=".\lloctree.h"
361 >
362 </File>
363 <File
364 RelativePath=".\llperlin.h"
365 >
366 </File>
367 <File
368 RelativePath=".\llquantize.h"
369 >
370 </File>
371 <File
372 RelativePath=".\llquaternion.h"
373 >
374 </File>
375 <File
376 RelativePath=".\llrand.h"
377 >
378 </File>
379 <File
380 RelativePath=".\llrect.h"
381 >
382 </File>
383 <File
384 RelativePath=".\lltreenode.h"
385 >
386 </File>
387 <File
388 RelativePath=".\lluuid.h"
389 >
390 </File>
391 <File
392 RelativePath=".\llvolume.h"
393 >
394 </File>
395 <File
396 RelativePath=".\llvolumemgr.h"
397 >
398 </File>
399 <File
400 RelativePath=".\m3math.h"
401 >
402 </File>
403 <File
404 RelativePath=".\m4math.h"
405 >
406 </File>
407 <File
408 RelativePath=".\raytrace.h"
409 >
410 </File>
411 <File
412 RelativePath=".\v2math.h"
413 >
414 </File>
415 <File
416 RelativePath=".\v3color.h"
417 >
418 </File>
419 <File
420 RelativePath=".\v3dmath.h"
421 >
422 </File>
423 <File
424 RelativePath=".\v3math.h"
425 >
426 </File>
427 <File
428 RelativePath=".\v4color.h"
429 >
430 </File>
431 <File
432 RelativePath=".\v4coloru.h"
433 >
434 </File>
435 <File
436 RelativePath=".\v4math.h"
437 >
438 </File>
439 <File
440 RelativePath=".\xform.h"
441 >
442 </File>
443 </Filter>
444 <Filter
445 Name="Resource Files"
446 Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
447 UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
448 >
449 </Filter>
450 </Files>
451 <Globals>
452 </Globals>
453</VisualStudioProject>
diff --git a/linden/indra/llmath/llmd5.cpp b/linden/indra/llmath/llmd5.cpp
index 19174af..267381c 100644
--- a/linden/indra/llmath/llmd5.cpp
+++ b/linden/indra/llmath/llmd5.cpp
@@ -122,10 +122,18 @@ void LLMD5::update (const uint1 *input, const uint4 input_length) {
122 // Transform as many times as possible. 122 // Transform as many times as possible.
123 if (input_length >= buffer_space) { // ie. we have enough to fill the buffer 123 if (input_length >= buffer_space) { // ie. we have enough to fill the buffer
124 // fill the rest of the buffer and transform 124 // fill the rest of the buffer and transform
125 memcpy (buffer + buffer_index, input, buffer_space); 125 memcpy( /* Flawfinder: ignore */
126 buffer + buffer_index,
127 input,
128 buffer_space);
126 transform (buffer); 129 transform (buffer);
127 130
128 // now, transform each 64-byte piece of the input, bypassing the buffer 131 // now, transform each 64-byte piece of the input, bypassing the buffer
132 if (input == NULL || input_length == 0){
133 std::cerr << "LLMD5::update: Invalid input!" << std::endl;
134 return;
135 }
136
129 for (input_index = buffer_space; input_index + 63 < input_length; 137 for (input_index = buffer_space; input_index + 63 < input_length;
130 input_index += 64) 138 input_index += 64)
131 transform (input+input_index); 139 transform (input+input_index);
@@ -137,7 +145,7 @@ void LLMD5::update (const uint1 *input, const uint4 input_length) {
137 145
138 146
139 // and here we do the buffering: 147 // and here we do the buffering:
140 memcpy(buffer+buffer_index, input+input_index, input_length-input_index); 148 memcpy(buffer+buffer_index, input+input_index, input_length-input_index); /* Flawfinder: ignore */
141} 149}
142 150
143 151
@@ -145,9 +153,9 @@ void LLMD5::update (const uint1 *input, const uint4 input_length) {
145// MD5 update for files. 153// MD5 update for files.
146// Like above, except that it works on files (and uses above as a primitive.) 154// Like above, except that it works on files (and uses above as a primitive.)
147 155
148void LLMD5::update(FILE *file){ 156void LLMD5::update(FILE* file){
149 157
150 unsigned char buffer[1024]; 158 unsigned char buffer[1024]; /* Flawfinder: ignore */
151 int len; 159 int len;
152 160
153 while ( (len=(int)fread(buffer, 1, 1024, file)) ) 161 while ( (len=(int)fread(buffer, 1, 1024, file)) )
@@ -167,11 +175,11 @@ void LLMD5::update(FILE *file){
167 175
168void LLMD5::update(std::istream& stream){ 176void LLMD5::update(std::istream& stream){
169 177
170 unsigned char buffer[1024]; 178 unsigned char buffer[1024]; /* Flawfinder: ignore */
171 int len; 179 int len;
172 180
173 while (stream.good()){ 181 while (stream.good()){
174 stream.read( (char*)buffer, 1024); // note that return value of read is unusable. 182 stream.read( (char*)buffer, 1024); /* Flawfinder: ignore */ // note that return value of read is unusable.
175 len=stream.gcount(); 183 len=stream.gcount();
176 update(buffer, len); 184 update(buffer, len);
177 } 185 }
@@ -182,35 +190,13 @@ void LLMD5::update(std::istream& stream){
182 190
183 191
184 192
185
186// MD5 update for ifstreams.
187// Like update for files; see above.
188
189void LLMD5::update(llifstream& stream){
190
191 unsigned char buffer[1024];
192 int len;
193
194 while (stream.good()){
195 stream.read( (char*)buffer, 1024); // note that return value of read is unusable.
196 len=stream.gcount();
197 update(buffer, len);
198 }
199
200}
201
202
203
204
205
206
207// MD5 finalization. Ends an MD5 message-digest operation, writing the 193// MD5 finalization. Ends an MD5 message-digest operation, writing the
208// the message digest and zeroizing the context. 194// the message digest and zeroizing the context.
209 195
210 196
211void LLMD5::finalize (){ 197void LLMD5::finalize (){
212 198
213 unsigned char bits[8]; 199 unsigned char bits[8]; /* Flawfinder: ignore */
214 unsigned int index, padLen; 200 unsigned int index, padLen;
215 static uint1 PADDING[64]={ 201 static uint1 PADDING[64]={
216 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 202 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
@@ -264,25 +250,16 @@ LLMD5::LLMD5(std::istream& stream){
264 finalize(); 250 finalize();
265} 251}
266 252
267
268
269LLMD5::LLMD5(llifstream& stream)
270{
271 init(); // must called by all constructors
272 update (stream);
273 finalize();
274}
275
276// Digest a string of the format ("%s:%i" % (s, number)) 253// Digest a string of the format ("%s:%i" % (s, number))
277LLMD5::LLMD5(const unsigned char *string, const unsigned int number) 254LLMD5::LLMD5(const unsigned char *string, const unsigned int number)
278{ 255{
279 const char *colon = ":"; 256 const char *colon = ":";
280 char tbuf[16]; 257 char tbuf[16]; /* Flawfinder: ignore */
281 init(); 258 init();
282 update(string, (U32)strlen((const char *) string)); 259 update(string, (U32)strlen((const char *) string)); /* Flawfinder: ignore */
283 update((const unsigned char *) colon, (U32)strlen(colon)); 260 update((const unsigned char *) colon, (U32)strlen(colon)); /* Flawfinder: ignore */
284 sprintf(tbuf, "%i", number); 261 snprintf(tbuf, sizeof(tbuf), "%i", number); /* Flawfinder: ignore */
285 update((const unsigned char *) tbuf, (U32)strlen(tbuf)); 262 update((const unsigned char *) tbuf, (U32)strlen(tbuf)); /* Flawfinder: ignore */
286 finalize(); 263 finalize();
287} 264}
288 265
@@ -290,7 +267,7 @@ LLMD5::LLMD5(const unsigned char *string, const unsigned int number)
290LLMD5::LLMD5(const unsigned char *s) 267LLMD5::LLMD5(const unsigned char *s)
291{ 268{
292 init(); 269 init();
293 update(s, (U32)strlen((const char *) s)); 270 update(s, (U32)strlen((const char *) s)); /* Flawfinder: ignore */
294 finalize(); 271 finalize();
295} 272}
296 273
@@ -304,7 +281,7 @@ void LLMD5::raw_digest(unsigned char *s)
304 return; 281 return;
305 } 282 }
306 283
307 memcpy(s, digest, 16); 284 memcpy(s, digest, 16); /* Flawfinder: ignore */
308 return; 285 return;
309} 286}
310 287
@@ -324,7 +301,7 @@ void LLMD5::hex_digest(char *s)
324 301
325 for (i=0; i<16; i++) 302 for (i=0; i<16; i++)
326 { 303 {
327 sprintf(s+i*2, "%02x", digest[i]); 304 sprintf(s+i*2, "%02x", digest[i]); /* Flawfinder: ignore */
328 } 305 }
329 306
330 s[32]='\0'; 307 s[32]='\0';
@@ -338,7 +315,7 @@ void LLMD5::hex_digest(char *s)
338 315
339std::ostream& operator<<(std::ostream &stream, LLMD5 context) 316std::ostream& operator<<(std::ostream &stream, LLMD5 context)
340{ 317{
341 char s[33]; 318 char s[33]; /* Flawfinder: ignore */
342 context.hex_digest(s); 319 context.hex_digest(s);
343 stream << s; 320 stream << s;
344 return stream; 321 return stream;
diff --git a/linden/indra/llmath/llmd5.h b/linden/indra/llmath/llmd5.h
index 1874b45..7b185b6 100644
--- a/linden/indra/llmath/llmd5.h
+++ b/linden/indra/llmath/llmd5.h
@@ -90,7 +90,6 @@ public:
90 void update (const uint1 *input, const uint4 input_length); 90 void update (const uint1 *input, const uint4 input_length);
91 void update (std::istream& stream); 91 void update (std::istream& stream);
92 void update (FILE *file); 92 void update (FILE *file);
93 void update (llifstream& stream);
94 void finalize (); 93 void finalize ();
95 94
96// constructors for special circumstances. All these constructors finalize 95// constructors for special circumstances. All these constructors finalize
@@ -98,7 +97,6 @@ public:
98 LLMD5 (const unsigned char *string); // digest string, finalize 97 LLMD5 (const unsigned char *string); // digest string, finalize
99 LLMD5 (std::istream& stream); // digest stream, finalize 98 LLMD5 (std::istream& stream); // digest stream, finalize
100 LLMD5 (FILE *file); // digest file, close, finalize 99 LLMD5 (FILE *file); // digest file, close, finalize
101 LLMD5 (llifstream& stream); // digest stream, close, finalize
102 LLMD5 (const unsigned char *string, const unsigned int number); 100 LLMD5 (const unsigned char *string, const unsigned int number);
103 101
104// methods to acquire finalized result 102// methods to acquire finalized result
diff --git a/linden/indra/llmath/lloctree.h b/linden/indra/llmath/lloctree.h
index 6e068cd..22f298c 100644
--- a/linden/indra/llmath/lloctree.h
+++ b/linden/indra/llmath/lloctree.h
@@ -40,6 +40,11 @@
40#endif 40#endif
41 41
42#define LL_OCTREE_PARANOIA_CHECK 0 42#define LL_OCTREE_PARANOIA_CHECK 0
43#if LL_DARWIN
44#define LL_OCTREE_MAX_CAPACITY 32
45#else
46#define LL_OCTREE_MAX_CAPACITY 256
47#endif
43 48
44template <class T> class LLOctreeState; 49template <class T> class LLOctreeState;
45template <class T> class LLOctreeNode; 50template <class T> class LLOctreeNode;
@@ -107,7 +112,8 @@ public:
107 virtual void removeByAddress(T* data) { getOctState()->removeByAddress(data); } 112 virtual void removeByAddress(T* data) { getOctState()->removeByAddress(data); }
108 virtual bool hasLeafState() const { return getOctState()->isLeaf(); } 113 virtual bool hasLeafState() const { return getOctState()->isLeaf(); }
109 virtual void destroy() { getOctState()->destroy(); } 114 virtual void destroy() { getOctState()->destroy(); }
110 virtual oct_node* getNodeAt(T* data) { return getOctState()->getNodeAt(data); } 115 virtual oct_node* getNodeAt(T* data) { return getNodeAt(data->getPositionGroup(), data->getBinRadius()); }
116 virtual oct_node* getNodeAt(const LLVector3d& pos, const F64& rad) { return getOctState()->getNodeAt(pos, rad); }
111 virtual U8 getOctant() const { return mOctant; } 117 virtual U8 getOctant() const { return mOctant; }
112 virtual void setOctant(U8 octant) { mOctant = octant; } 118 virtual void setOctant(U8 octant) { mOctant = octant; }
113 virtual const oct_state* getOctState() const { return (const oct_state*) BaseType::mState; } 119 virtual const oct_state* getOctState() const { return (const oct_state*) BaseType::mState; }
@@ -136,9 +142,14 @@ public:
136 return ret; 142 return ret;
137 } 143 }
138 144
145 virtual bool isInside(const LLVector3d& pos, const F64& rad) const
146 {
147 return rad <= mSize.mdV[0]*2.0 && isInside(pos);
148 }
149
139 virtual bool isInside(T* data) const 150 virtual bool isInside(T* data) const
140 { 151 {
141 return data->getBinRadius() <= mSize.mdV[0]*2.0 && isInside(data->getPositionGroup()); 152 return isInside(data->getPositionGroup(), data->getBinRadius());
142 } 153 }
143 154
144 virtual bool isInside(const LLVector3d& pos) const 155 virtual bool isInside(const LLVector3d& pos) const
@@ -174,6 +185,11 @@ public:
174 185
175 bool contains(T* xform) 186 bool contains(T* xform)
176 { 187 {
188 return contains(xform->getBinRadius());
189 }
190
191 bool contains(F64 radius)
192 {
177 if (mParent == NULL) 193 if (mParent == NULL)
178 { //root node contains nothing 194 { //root node contains nothing
179 return false; 195 return false;
@@ -181,7 +197,6 @@ public:
181 197
182 F64 size = mSize.mdV[0]; 198 F64 size = mSize.mdV[0];
183 F64 p_size = size * 2.0; 199 F64 p_size = size * 2.0;
184 F64 radius = xform->getBinRadius();
185 200
186 return (radius <= 0.001 && size <= 0.001) || 201 return (radius <= 0.001 && size <= 0.001) ||
187 (radius <= p_size && radius > size); 202 (radius <= p_size && radius > size);
@@ -189,17 +204,10 @@ public:
189 204
190 static void pushCenter(LLVector3d &center, LLVector3d &size, T* data) 205 static void pushCenter(LLVector3d &center, LLVector3d &size, T* data)
191 { 206 {
192 LLVector3 pos(data->getPositionGroup()); 207 LLVector3d pos(data->getPositionGroup());
193 F64 p[] =
194 {
195 (F64) pos.mV[0],
196 (F64) pos.mV[1],
197 (F64) pos.mV[2]
198 };
199
200 for (U32 i = 0; i < 3; i++) 208 for (U32 i = 0; i < 3; i++)
201 { 209 {
202 if (p[i] > center.mdV[i]) 210 if (pos.mdV[i] > center.mdV[i])
203 { 211 {
204 center.mdV[i] += size.mdV[i]; 212 center.mdV[i] += size.mdV[i];
205 } 213 }
@@ -273,11 +281,15 @@ public:
273 oct_node* getOctNode() { return (oct_node*) BaseType::getNode(); } 281 oct_node* getOctNode() { return (oct_node*) BaseType::getNode(); }
274 282
275 virtual oct_node* getNodeAt(T* data) 283 virtual oct_node* getNodeAt(T* data)
284 {
285 return getNodeAt(data->getPositionGroup(), data->getBinRadius());
286 }
287
288 virtual oct_node* getNodeAt(const LLVector3d& pos, const F64& rad)
276 { 289 {
277 const LLVector3d& pos = data->getPositionGroup();
278 LLOctreeNode<T>* node = getOctNode(); 290 LLOctreeNode<T>* node = getOctNode();
279 291
280 if (node->isInside(data)) 292 if (node->isInside(pos, rad))
281 { 293 {
282 //do a quick search by octant 294 //do a quick search by octant
283 U8 octant = node->getOctant(pos.mdV); 295 U8 octant = node->getOctant(pos.mdV);
@@ -287,7 +299,7 @@ public:
287 //at the appropriate octant or is smaller than the object. 299 //at the appropriate octant or is smaller than the object.
288 //by definition, that node is the smallest node that contains 300 //by definition, that node is the smallest node that contains
289 // the data 301 // the data
290 while (keep_going && node->getSize().mdV[0] >= data->getBinRadius()) 302 while (keep_going && node->getSize().mdV[0] >= rad)
291 { 303 {
292 keep_going = FALSE; 304 keep_going = FALSE;
293 for (U32 i = 0; i < node->getChildCount() && !keep_going; i++) 305 for (U32 i = 0; i < node->getChildCount() && !keep_going; i++)
@@ -301,9 +313,9 @@ public:
301 } 313 }
302 } 314 }
303 } 315 }
304 else if (!node->contains(data) && node->getParent()) 316 else if (!node->contains(rad) && node->getParent())
305 { //if we got here, data does not exist in this node 317 { //if we got here, data does not exist in this node
306 return ((LLOctreeNode<T>*) node->getParent())->getNodeAt(data); 318 return ((LLOctreeNode<T>*) node->getParent())->getNodeAt(pos, rad);
307 } 319 }
308 320
309 return node; 321 return node;
@@ -317,22 +329,15 @@ public:
317 return false; 329 return false;
318 } 330 }
319 LLOctreeNode<T>* node = getOctNode(); 331 LLOctreeNode<T>* node = getOctNode();
332 LLOctreeNode<T>* parent = node->getOctParent();
320 333
321 if (data->getBinRadius() <= node->getSize().mdV[0]) 334 //is it here?
322 { 335 if (node->isInside(data->getPositionGroup()))
323 oct_node* dest = getNodeAt(data);
324
325 if (dest != node)
326 {
327 dest->insert(data);
328 return false;
329 }
330 }
331
332 //no kid found, is it even here?
333 if (node->isInside(data))
334 { 336 {
335 if (node->contains(data)) 337 if (getElementCount() < LL_OCTREE_MAX_CAPACITY &&
338 (node->contains(data->getBinRadius()) ||
339 (data->getBinRadius() > node->getSize().mdV[0] &&
340 parent && parent->getElementCount() >= LL_OCTREE_MAX_CAPACITY)))
336 { //it belongs here 341 { //it belongs here
337 if (data == NULL) 342 if (data == NULL)
338 { 343 {
@@ -353,7 +358,19 @@ public:
353 return true; 358 return true;
354 } 359 }
355 else 360 else
356 { 361 {
362 //find a child to give it to
363 oct_node* child = NULL;
364 for (U32 i = 0; i < getChildCount(); i++)
365 {
366 child = getChild(i);
367 if (child->isInside(data->getPositionGroup()))
368 {
369 child->insert(data);
370 return false;
371 }
372 }
373
357 //it's here, but no kids are in the right place, make a new kid 374 //it's here, but no kids are in the right place, make a new kid
358 LLVector3d center(node->getCenter()); 375 LLVector3d center(node->getCenter());
359 LLVector3d size(node->getSize()*0.5); 376 LLVector3d size(node->getSize()*0.5);
@@ -385,7 +402,7 @@ public:
385 402
386 //make the new kid 403 //make the new kid
387 LLOctreeState<T>* newstate = new LLOctreeState<T>(); 404 LLOctreeState<T>* newstate = new LLOctreeState<T>();
388 oct_node* child = new LLOctreeNode<T>(center, size, newstate, node); 405 child = new LLOctreeNode<T>(center, size, newstate, node);
389 addChild(child); 406 addChild(child);
390 407
391 child->insert(data); 408 child->insert(data);
@@ -393,8 +410,15 @@ public:
393 } 410 }
394 else 411 else
395 { 412 {
396 //it's not in here, give it to the parent 413 //it's not in here, give it to the root
397 node->getOctParent()->insert(data); 414 LLOctreeNode<T>* parent = node->getOctParent();
415 while (parent)
416 {
417 node = parent;
418 parent = node->getOctParent();
419 }
420
421 node->insert(data);
398 } 422 }
399 423
400 return false; 424 return false;
diff --git a/linden/indra/llmath/llrand.cpp b/linden/indra/llmath/llrand.cpp
index c0f03d2..ae52010 100644
--- a/linden/indra/llmath/llrand.cpp
+++ b/linden/indra/llmath/llrand.cpp
@@ -140,7 +140,14 @@ F32 ll_frand(F32 val)
140{ 140{
141 // The clamping rules are described above. 141 // The clamping rules are described above.
142 F32 rv = ll_internal_random_float() * val; 142 F32 rv = ll_internal_random_float() * val;
143 if(rv >= val) return 0.0f; 143 if(val > 0)
144 {
145 if(rv >= val) return 0.0f;
146 }
147 else
148 {
149 if(rv <= val) return 0.0f;
150 }
144 return rv; 151 return rv;
145} 152}
146 153
@@ -153,6 +160,13 @@ F64 ll_drand(F64 val)
153{ 160{
154 // The clamping rules are described above. 161 // The clamping rules are described above.
155 F64 rv = ll_internal_random_double() * val; 162 F64 rv = ll_internal_random_double() * val;
156 if(rv >= val) return 0.0; 163 if(val > 0)
164 {
165 if(rv >= val) return 0.0;
166 }
167 else
168 {
169 if(rv <= val) return 0.0;
170 }
157 return rv; 171 return rv;
158} 172}
diff --git a/linden/indra/llmath/llrand.h b/linden/indra/llmath/llrand.h
index 47b5651..1bf055e 100644
--- a/linden/indra/llmath/llrand.h
+++ b/linden/indra/llmath/llrand.h
@@ -63,7 +63,7 @@
63S32 ll_rand(); 63S32 ll_rand();
64 64
65/** 65/**
66 *@brief Generate a float from [0, val). 66 *@brief Generate a float from [0, val) or (val, 0].
67 */ 67 */
68S32 ll_rand(S32 val); 68S32 ll_rand(S32 val);
69 69
@@ -73,7 +73,7 @@ S32 ll_rand(S32 val);
73F32 ll_frand(); 73F32 ll_frand();
74 74
75/** 75/**
76 *@brief Generate a float from [0, val). 76 *@brief Generate a float from [0, val) or (val, 0].
77 */ 77 */
78F32 ll_frand(F32 val); 78F32 ll_frand(F32 val);
79 79
@@ -83,7 +83,7 @@ F32 ll_frand(F32 val);
83F64 ll_drand(); 83F64 ll_drand();
84 84
85/** 85/**
86 *@brief Generate a double from [0, val). 86 *@brief Generate a double from [0, val) or (val, 0].
87 */ 87 */
88F64 ll_drand(F64 val); 88F64 ll_drand(F64 val);
89 89
diff --git a/linden/indra/llmath/lltreenode.h b/linden/indra/llmath/lltreenode.h
index 78ff759..ba3c867 100644
--- a/linden/indra/llmath/lltreenode.h
+++ b/linden/indra/llmath/lltreenode.h
@@ -41,7 +41,6 @@ class LLTreeState
41public: 41public:
42 LLTreeState(LLTreeNode<T>* node) { setNode(node); } 42 LLTreeState(LLTreeNode<T>* node) { setNode(node); }
43 virtual ~LLTreeState() { }; 43 virtual ~LLTreeState() { };
44
45 virtual bool insert(T* data) = 0; 44 virtual bool insert(T* data) = 0;
46 virtual bool remove(T* data) = 0; 45 virtual bool remove(T* data) = 0;
47 virtual void setNode(LLTreeNode<T>* node); 46 virtual void setNode(LLTreeNode<T>* node);
@@ -54,7 +53,7 @@ private:
54}; 53};
55 54
56template <class T> 55template <class T>
57class LLTreeListener 56class LLTreeListener: public LLRefCount
58{ 57{
59public: 58public:
60 virtual ~LLTreeListener() { }; 59 virtual ~LLTreeListener() { };
@@ -94,7 +93,7 @@ protected:
94 93
95 LLTreeState<T>* mState; 94 LLTreeState<T>* mState;
96public: 95public:
97 std::vector<LLTreeListener<T>*> mListeners; 96 std::vector<LLPointer<LLTreeListener<T> > > mListeners;
98}; 97};
99 98
100template <class T> 99template <class T>
diff --git a/linden/indra/llmath/lluuid.cpp b/linden/indra/llmath/lluuid.cpp
index 3fb31a6..b943fd9 100644
--- a/linden/indra/llmath/lluuid.cpp
+++ b/linden/indra/llmath/lluuid.cpp
@@ -170,15 +170,15 @@ void LLUUID::toString(char *out) const
170 170
171void LLUUID::toCompressedString(char *out) const 171void LLUUID::toCompressedString(char *out) const
172{ 172{
173 memcpy(out, mData, UUID_BYTES); 173 memcpy(out, mData, UUID_BYTES); /* Flawfinder: ignore */
174 out[UUID_BYTES] = '\0'; 174 out[UUID_BYTES] = '\0';
175} 175}
176 176
177LLString LLUUID::getString() const 177std::string LLUUID::asString() const
178{ 178{
179 char str[UUID_STR_SIZE]; 179 char str[UUID_STR_SIZE]; /* Flawfinder: ignore */
180 toString(str); 180 toString(str);
181 return LLString(str); 181 return std::string(str);
182} 182}
183 183
184BOOL LLUUID::set(const std::string& in_string, BOOL emit) 184BOOL LLUUID::set(const std::string& in_string, BOOL emit)
@@ -203,11 +203,11 @@ BOOL LLUUID::set(const char *in_string, BOOL emit)
203 return TRUE; 203 return TRUE;
204 } 204 }
205 205
206 if (strlen(in_string) != (UUID_STR_LENGTH - 1)) 206 if (strlen(in_string) != (UUID_STR_LENGTH - 1)) /* Flawfinder: ignore */
207 { 207 {
208 // I'm a moron. First implementation didn't have the right UUID format. 208 // I'm a moron. First implementation didn't have the right UUID format.
209 // Shouldn't see any of these any more 209 // Shouldn't see any of these any more
210 if (strlen(in_string) == (UUID_STR_LENGTH - 2)) 210 if (strlen(in_string) == (UUID_STR_LENGTH - 2)) /* Flawfinder: ignore */
211 { 211 {
212 if(emit) 212 if(emit)
213 { 213 {
@@ -307,10 +307,10 @@ BOOL LLUUID::validate(const char *in_string)
307 { 307 {
308 return FALSE; 308 return FALSE;
309 } 309 }
310 if (strlen(in_string) != (UUID_STR_LENGTH - 1)) 310 if (strlen(in_string) != (UUID_STR_LENGTH - 1)) /* Flawfinder: ignore */
311 { 311 {
312 // I'm a moron. First implementation didn't have the right UUID format. 312 // I'm a moron. First implementation didn't have the right UUID format.
313 if (strlen(in_string) == (UUID_STR_LENGTH - 2)) 313 if (strlen(in_string) == (UUID_STR_LENGTH - 2)) /* Flawfinder: ignore */
314 { 314 {
315 broken_format = TRUE; 315 broken_format = TRUE;
316 } 316 }
@@ -414,7 +414,7 @@ std::ostream& operator<<(std::ostream& s, const LLUUID &uuid)
414std::istream& operator>>(std::istream &s, LLUUID &uuid) 414std::istream& operator>>(std::istream &s, LLUUID &uuid)
415{ 415{
416 U32 i; 416 U32 i;
417 char uuid_str[UUID_STR_LENGTH]; 417 char uuid_str[UUID_STR_LENGTH]; /* Flawfinder: ignore */
418 for (i = 0; i < UUID_STR_LENGTH-1; i++) 418 for (i = 0; i < UUID_STR_LENGTH-1; i++)
419 { 419 {
420 s >> uuid_str[i]; 420 s >> uuid_str[i];
@@ -480,7 +480,7 @@ S32 LLUUID::getNodeID(unsigned char * node_id)
480 Ncb.ncb_command = NCBASTAT; 480 Ncb.ncb_command = NCBASTAT;
481 Ncb.ncb_lana_num = lenum.lana[i]; 481 Ncb.ncb_lana_num = lenum.lana[i];
482 482
483 strcpy( (char *)Ncb.ncb_callname, "* " ); 483 strcpy( (char *)Ncb.ncb_callname, "* " ); /* Flawfinder: ignore */
484 Ncb.ncb_buffer = (unsigned char *)&Adapter; 484 Ncb.ncb_buffer = (unsigned char *)&Adapter;
485 Ncb.ncb_length = sizeof(Adapter); 485 Ncb.ncb_length = sizeof(Adapter);
486 486
@@ -497,7 +497,7 @@ S32 LLUUID::getNodeID(unsigned char * node_id)
497// Adapter.adapt.adapter_address[3], 497// Adapter.adapt.adapter_address[3],
498// Adapter.adapt.adapter_address[4], 498// Adapter.adapt.adapter_address[4],
499// Adapter.adapt.adapter_address[5] ); 499// Adapter.adapt.adapter_address[5] );
500 memcpy(node_id,Adapter.adapt.adapter_address,6); 500 memcpy(node_id,Adapter.adapt.adapter_address,6); /* Flawfinder: ignore */
501 retval = 1; 501 retval = 1;
502 502
503 } 503 }
@@ -652,7 +652,7 @@ S32 LLUUID::getNodeID(unsigned char *node_id)
652 n = ifc.ifc_len; 652 n = ifc.ifc_len;
653 for (i = 0; i < n; i+= ifreq_size(*ifr) ) { 653 for (i = 0; i < n; i+= ifreq_size(*ifr) ) {
654 ifrp = (struct ifreq *)((char *) ifc.ifc_buf+i); 654 ifrp = (struct ifreq *)((char *) ifc.ifc_buf+i);
655 strncpy(ifr.ifr_name, ifrp->ifr_name, IFNAMSIZ); 655 strncpy(ifr.ifr_name, ifrp->ifr_name, IFNAMSIZ); /* Flawfinder: ignore */
656#ifdef SIOCGIFHWADDR 656#ifdef SIOCGIFHWADDR
657 if (ioctl(sd, SIOCGIFHWADDR, &ifr) < 0) 657 if (ioctl(sd, SIOCGIFHWADDR, &ifr) < 0)
658 continue; 658 continue;
@@ -674,7 +674,7 @@ S32 LLUUID::getNodeID(unsigned char *node_id)
674 if (!a[0] && !a[1] && !a[2] && !a[3] && !a[4] && !a[5]) 674 if (!a[0] && !a[1] && !a[2] && !a[3] && !a[4] && !a[5])
675 continue; 675 continue;
676 if (node_id) { 676 if (node_id) {
677 memcpy(node_id, a, 6); 677 memcpy(node_id, a, 6); /* Flawfinder: ignore */
678 close(sd); 678 close(sd);
679 return 1; 679 return 1;
680 } 680 }
@@ -783,7 +783,7 @@ void LLUUID::generate()
783 // Create a UUID. 783 // Create a UUID.
784 uuid_time_t timestamp; 784 uuid_time_t timestamp;
785 785
786 static unsigned char node_id[6]; 786 static unsigned char node_id[6]; /* Flawfinder: ignore */
787 static int has_init = 0; 787 static int has_init = 0;
788 788
789 // Create a UUID. 789 // Create a UUID.
@@ -827,7 +827,7 @@ void LLUUID::generate()
827 if (clock_seq == 0) clock_seq++; 827 if (clock_seq == 0) clock_seq++;
828 } 828 }
829 829
830 memcpy(mData+10, node_id, 6); 830 memcpy(mData+10, node_id, 6); /* Flawfinder: ignore */
831 U32 tmp; 831 U32 tmp;
832 tmp = timestamp.low; 832 tmp = timestamp.low;
833 mData[3] = (unsigned char) tmp; 833 mData[3] = (unsigned char) tmp;
@@ -865,7 +865,7 @@ void LLUUID::generate()
865 865
866U32 LLUUID::getRandomSeed() 866U32 LLUUID::getRandomSeed()
867{ 867{
868 static unsigned char seed[16]; 868 static unsigned char seed[16]; /* Flawfinder: ignore */
869 869
870 getNodeID(&seed[0]); 870 getNodeID(&seed[0]);
871 seed[6]='\0'; 871 seed[6]='\0';
diff --git a/linden/indra/llmath/lluuid.h b/linden/indra/llmath/lluuid.h
index b8288eb..aeda734 100644
--- a/linden/indra/llmath/lluuid.h
+++ b/linden/indra/llmath/lluuid.h
@@ -29,8 +29,7 @@
29 29
30#include <iostream> 30#include <iostream>
31#include <set> 31#include <set>
32 32#include "stdtypes.h"
33#include "llstring.h"
34 33
35const S32 UUID_BYTES = 16; 34const S32 UUID_BYTES = 16;
36const S32 UUID_WORDS = 4; 35const S32 UUID_WORDS = 4;
@@ -103,7 +102,9 @@ public:
103 102
104 void toString(char *out) const; // Does not allocate memory, needs 36 characters (including \0) 103 void toString(char *out) const; // Does not allocate memory, needs 36 characters (including \0)
105 void toCompressedString(char *out) const; // Does not allocate memory, needs 17 characters (including \0) 104 void toCompressedString(char *out) const; // Does not allocate memory, needs 17 characters (including \0)
106 LLString getString() const; 105
106 std::string asString() const;
107
107 U16 getCRC16() const; 108 U16 getCRC16() const;
108 U32 getCRC32() const; 109 U32 getCRC32() const;
109 110
diff --git a/linden/indra/llmath/llvolume.cpp b/linden/indra/llmath/llvolume.cpp
index c527e85..e42413a 100644
--- a/linden/indra/llmath/llvolume.cpp
+++ b/linden/indra/llmath/llvolume.cpp
@@ -724,11 +724,11 @@ BOOL LLProfile::generate(BOOL path_open,F32 detail, S32 split)
724BOOL LLProfileParams::importFile(FILE *fp) 724BOOL LLProfileParams::importFile(FILE *fp)
725{ 725{
726 const S32 BUFSIZE = 16384; 726 const S32 BUFSIZE = 16384;
727 char buffer[BUFSIZE]; 727 char buffer[BUFSIZE]; /* Flawfinder: ignore */
728 // *NOTE: changing the size or type of these buffers will require 728 // *NOTE: changing the size or type of these buffers will require
729 // changing the sscanf below. 729 // changing the sscanf below.
730 char keyword[256]; 730 char keyword[256]; /* Flawfinder: ignore */
731 char valuestr[256]; 731 char valuestr[256]; /* Flawfinder: ignore */
732 keyword[0] = 0; 732 keyword[0] = 0;
733 valuestr[0] = 0; 733 valuestr[0] = 0;
734 F32 tempF32; 734 F32 tempF32;
@@ -737,7 +737,10 @@ BOOL LLProfileParams::importFile(FILE *fp)
737 while (!feof(fp)) 737 while (!feof(fp))
738 { 738 {
739 fgets(buffer, BUFSIZE, fp); 739 fgets(buffer, BUFSIZE, fp);
740 sscanf(buffer, " %255s %255s", keyword, valuestr); 740 sscanf( /* Flawfinder: ignore */
741 buffer,
742 " %255s %255s",
743 keyword, valuestr);
741 if (!keyword) 744 if (!keyword)
742 { 745 {
743 continue; 746 continue;
@@ -796,11 +799,11 @@ BOOL LLProfileParams::exportFile(FILE *fp) const
796BOOL LLProfileParams::importLegacyStream(std::istream& input_stream) 799BOOL LLProfileParams::importLegacyStream(std::istream& input_stream)
797{ 800{
798 const S32 BUFSIZE = 16384; 801 const S32 BUFSIZE = 16384;
799 char buffer[BUFSIZE]; 802 char buffer[BUFSIZE]; /* Flawfinder: ignore */
800 // *NOTE: changing the size or type of these buffers will require 803 // *NOTE: changing the size or type of these buffers will require
801 // changing the sscanf below. 804 // changing the sscanf below.
802 char keyword[256]; 805 char keyword[256]; /* Flawfinder: ignore */
803 char valuestr[256]; 806 char valuestr[256]; /* Flawfinder: ignore */
804 keyword[0] = 0; 807 keyword[0] = 0;
805 valuestr[0] = 0; 808 valuestr[0] = 0;
806 F32 tempF32; 809 F32 tempF32;
@@ -809,7 +812,11 @@ BOOL LLProfileParams::importLegacyStream(std::istream& input_stream)
809 while (input_stream.good()) 812 while (input_stream.good())
810 { 813 {
811 input_stream.getline(buffer, BUFSIZE); 814 input_stream.getline(buffer, BUFSIZE);
812 sscanf(buffer, " %255s %255s", keyword, valuestr); 815 sscanf( /* Flawfinder: ignore */
816 buffer,
817 " %255s %255s",
818 keyword,
819 valuestr);
813 if (!keyword) 820 if (!keyword)
814 { 821 {
815 continue; 822 continue;
@@ -1218,11 +1225,11 @@ BOOL LLDynamicPath::generate(F32 detail, S32 split)
1218BOOL LLPathParams::importFile(FILE *fp) 1225BOOL LLPathParams::importFile(FILE *fp)
1219{ 1226{
1220 const S32 BUFSIZE = 16384; 1227 const S32 BUFSIZE = 16384;
1221 char buffer[BUFSIZE]; 1228 char buffer[BUFSIZE]; /* Flawfinder: ignore */
1222 // *NOTE: changing the size or type of these buffers will require 1229 // *NOTE: changing the size or type of these buffers will require
1223 // changing the sscanf below. 1230 // changing the sscanf below.
1224 char keyword[256]; 1231 char keyword[256]; /* Flawfinder: ignore */
1225 char valuestr[256]; 1232 char valuestr[256]; /* Flawfinder: ignore */
1226 keyword[0] = 0; 1233 keyword[0] = 0;
1227 valuestr[0] = 0; 1234 valuestr[0] = 0;
1228 1235
@@ -1233,7 +1240,10 @@ BOOL LLPathParams::importFile(FILE *fp)
1233 while (!feof(fp)) 1240 while (!feof(fp))
1234 { 1241 {
1235 fgets(buffer, BUFSIZE, fp); 1242 fgets(buffer, BUFSIZE, fp);
1236 sscanf(buffer, " %255s %255s", keyword, valuestr); 1243 sscanf( /* Flawfinder: ignore */
1244 buffer,
1245 " %255s %255s",
1246 keyword, valuestr);
1237 if (!keyword) 1247 if (!keyword)
1238 { 1248 {
1239 continue; 1249 continue;
@@ -1359,11 +1369,11 @@ BOOL LLPathParams::exportFile(FILE *fp) const
1359BOOL LLPathParams::importLegacyStream(std::istream& input_stream) 1369BOOL LLPathParams::importLegacyStream(std::istream& input_stream)
1360{ 1370{
1361 const S32 BUFSIZE = 16384; 1371 const S32 BUFSIZE = 16384;
1362 char buffer[BUFSIZE]; 1372 char buffer[BUFSIZE]; /* Flawfinder: ignore */
1363 // *NOTE: changing the size or type of these buffers will require 1373 // *NOTE: changing the size or type of these buffers will require
1364 // changing the sscanf below. 1374 // changing the sscanf below.
1365 char keyword[256]; 1375 char keyword[256]; /* Flawfinder: ignore */
1366 char valuestr[256]; 1376 char valuestr[256]; /* Flawfinder: ignore */
1367 keyword[0] = 0; 1377 keyword[0] = 0;
1368 valuestr[0] = 0; 1378 valuestr[0] = 0;
1369 1379
@@ -1374,7 +1384,10 @@ BOOL LLPathParams::importLegacyStream(std::istream& input_stream)
1374 while (input_stream.good()) 1384 while (input_stream.good())
1375 { 1385 {
1376 input_stream.getline(buffer, BUFSIZE); 1386 input_stream.getline(buffer, BUFSIZE);
1377 sscanf(buffer, " %255s %255s", keyword, valuestr); 1387 sscanf( /* Flawfinder: ignore */
1388 buffer,
1389 " %255s %255s",
1390 keyword, valuestr);
1378 if (!keyword) 1391 if (!keyword)
1379 { 1392 {
1380 continue; 1393 continue;
@@ -1771,9 +1784,6 @@ void LLVolume::createVolumeFaces()
1771 mVolumeFaces[i].create(); 1784 mVolumeFaces[i].create();
1772 } 1785 }
1773 } 1786 }
1774
1775 mBounds[1] = LLVector3(0,0,0);
1776 mBounds[0] = LLVector3(512,512,512);
1777} 1787}
1778 1788
1779 1789
@@ -1818,21 +1828,28 @@ void LLVolumeParams::copyParams(const LLVolumeParams &params)
1818 mPathParams.copyParams(params.mPathParams); 1828 mPathParams.copyParams(params.mPathParams);
1819} 1829}
1820 1830
1831// Less restricitve approx 0 for volumes
1832const F32 APPROXIMATELY_ZERO = 0.001f;
1833bool approx_zero( F32 f, F32 tolerance = APPROXIMATELY_ZERO)
1834{
1835 return (f >= -tolerance) && (f <= tolerance);
1836}
1837
1821// return true if in range (or nearly so) 1838// return true if in range (or nearly so)
1822static bool limit_range(F32& v, F32 min, F32 max) 1839static bool limit_range(F32& v, F32 min, F32 max, F32 tolerance = APPROXIMATELY_ZERO)
1823{ 1840{
1824 F32 min_delta = v - min; 1841 F32 min_delta = v - min;
1825 if (min_delta < 0.f) 1842 if (min_delta < 0.f)
1826 { 1843 {
1827 v = min; 1844 v = min;
1828 if (!is_approx_zero(min_delta)) 1845 if (!approx_zero(min_delta, tolerance))
1829 return false; 1846 return false;
1830 } 1847 }
1831 F32 max_delta = max - v; 1848 F32 max_delta = max - v;
1832 if (max_delta < 0.f) 1849 if (max_delta < 0.f)
1833 { 1850 {
1834 v = max; 1851 v = max;
1835 if (!is_approx_zero(max_delta)) 1852 if (!approx_zero(max_delta, tolerance))
1836 return false; 1853 return false;
1837 } 1854 }
1838 return true; 1855 return true;
@@ -1847,9 +1864,10 @@ bool LLVolumeParams::setBeginAndEndS(const F32 b, const F32 e)
1847 valid &= limit_range(begin, 0.f, 1.f - MIN_CUT_DELTA); 1864 valid &= limit_range(begin, 0.f, 1.f - MIN_CUT_DELTA);
1848 1865
1849 F32 end = e; 1866 F32 end = e;
1867 if (end >= .0149f && end < MIN_CUT_DELTA) end = MIN_CUT_DELTA; // eliminate warning for common rounding error
1850 valid &= limit_range(end, MIN_CUT_DELTA, 1.f); 1868 valid &= limit_range(end, MIN_CUT_DELTA, 1.f);
1851 1869
1852 valid &= limit_range(begin, 0.f, end - MIN_CUT_DELTA); 1870 valid &= limit_range(begin, 0.f, end - MIN_CUT_DELTA, .01f);
1853 1871
1854 // Now set them. 1872 // Now set them.
1855 mProfileParams.setBegin(begin); 1873 mProfileParams.setBegin(begin);
@@ -1869,7 +1887,7 @@ bool LLVolumeParams::setBeginAndEndT(const F32 b, const F32 e)
1869 F32 end = e; 1887 F32 end = e;
1870 valid &= limit_range(end, MIN_CUT_DELTA, 1.f); 1888 valid &= limit_range(end, MIN_CUT_DELTA, 1.f);
1871 1889
1872 valid &= limit_range(begin, 0.f, end - MIN_CUT_DELTA); 1890 valid &= limit_range(begin, 0.f, end - MIN_CUT_DELTA, .01f);
1873 1891
1874 // Now set them. 1892 // Now set them.
1875 mPathParams.setBegin(begin); 1893 mPathParams.setBegin(begin);
@@ -2026,7 +2044,7 @@ bool LLVolumeParams::setRadiusOffset(const F32 offset)
2026 { 2044 {
2027 radius_offset = max_radius_mag; 2045 radius_offset = max_radius_mag;
2028 } 2046 }
2029 valid = is_approx_zero(delta); 2047 valid = approx_zero(delta, .1f);
2030 } 2048 }
2031 2049
2032 mPathParams.setRadiusOffset(radius_offset); 2050 mPathParams.setRadiusOffset(radius_offset);
@@ -2060,7 +2078,7 @@ bool LLVolumeParams::setSkew(const F32 skew_value)
2060 { 2078 {
2061 skew = min_skew_mag; 2079 skew = min_skew_mag;
2062 } 2080 }
2063 valid = is_approx_zero(delta); 2081 valid = approx_zero(delta, .01f);
2064 } 2082 }
2065 2083
2066 mPathParams.setSkew(skew); 2084 mPathParams.setSkew(skew);
@@ -2185,7 +2203,7 @@ S32 *LLVolume::getTriangleIndices(U32 &num_indices) const
2185 size_s_out = getProfile().getTotalOut(); 2203 size_s_out = getProfile().getTotalOut();
2186 size_t = getPath().mPath.size(); 2204 size_t = getPath().mPath.size();
2187 2205
2188 if (open) 2206 if (open) /* Flawfinder: ignore */
2189 { 2207 {
2190 if (hollow) 2208 if (hollow)
2191 { 2209 {
@@ -2807,7 +2825,7 @@ noindices:
2807 return NULL; 2825 return NULL;
2808 } 2826 }
2809 num_indices = count; 2827 num_indices = count;
2810 memcpy(indices, index, count * sizeof(S32)); 2828 memcpy(indices, index, count * sizeof(S32)); /* Flawfinder: ignore */
2811 return indices; 2829 return indices;
2812} 2830}
2813 2831
@@ -2986,10 +3004,15 @@ void LLVolume::generateSilhouetteVertices(std::vector<LLVector3> &vertices,
2986 S32 v2 = face.mIndices[j*3+((k+1)%3)]; 3004 S32 v2 = face.mIndices[j*3+((k+1)%3)];
2987 3005
2988 vertices.push_back(face.mVertices[v1].mPosition*mat); 3006 vertices.push_back(face.mVertices[v1].mPosition*mat);
2989 normals.push_back(face.mVertices[v1].mNormal*norm_mat); 3007 LLVector3 norm1 = face.mVertices[v1].mNormal * norm_mat;
3008 norm1.normVec();
3009 normals.push_back(norm1);
2990 3010
2991 vertices.push_back(face.mVertices[v2].mPosition*mat); 3011 vertices.push_back(face.mVertices[v2].mPosition*mat);
2992 normals.push_back(face.mVertices[v2].mNormal*norm_mat); 3012 LLVector3 norm2 = face.mVertices[v2].mNormal * norm_mat;
3013 norm2.normVec();
3014 normals.push_back(norm2);
3015
2993 segments.push_back(vertices.size()); 3016 segments.push_back(vertices.size());
2994 } 3017 }
2995 } 3018 }
@@ -3310,7 +3333,7 @@ BOOL LLVolume::cleanupTriangleData( const S32 num_input_vertices,
3310 3333
3311 *output_triangles = new S32[cur_tri*3]; 3334 *output_triangles = new S32[cur_tri*3];
3312 num_output_triangles = cur_tri; 3335 num_output_triangles = cur_tri;
3313 memcpy(*output_triangles, sorted_tris, 3*cur_tri*sizeof(S32)); 3336 memcpy(*output_triangles, sorted_tris, 3*cur_tri*sizeof(S32)); /* Flawfinder: ignore */
3314 3337
3315 /* 3338 /*
3316 llinfos << "Out vertices: " << num_output_vertices << llendl; 3339 llinfos << "Out vertices: " << num_output_vertices << llendl;
@@ -3347,16 +3370,16 @@ BOOL LLVolumeParams::importFile(FILE *fp)
3347{ 3370{
3348 //llinfos << "importing volume" << llendl; 3371 //llinfos << "importing volume" << llendl;
3349 const S32 BUFSIZE = 16384; 3372 const S32 BUFSIZE = 16384;
3350 char buffer[BUFSIZE]; 3373 char buffer[BUFSIZE]; /* Flawfinder: ignore */
3351 // *NOTE: changing the size or type of this buffer will require 3374 // *NOTE: changing the size or type of this buffer will require
3352 // changing the sscanf below. 3375 // changing the sscanf below.
3353 char keyword[256]; 3376 char keyword[256]; /* Flawfinder: ignore */
3354 keyword[0] = 0; 3377 keyword[0] = 0;
3355 3378
3356 while (!feof(fp)) 3379 while (!feof(fp))
3357 { 3380 {
3358 fgets(buffer, BUFSIZE, fp); 3381 fgets(buffer, BUFSIZE, fp);
3359 sscanf(buffer, " %255s", keyword); 3382 sscanf(buffer, " %255s", keyword); /* Flawfinder: ignore */
3360 if (!keyword) 3383 if (!keyword)
3361 { 3384 {
3362 continue; 3385 continue;
@@ -3403,8 +3426,8 @@ BOOL LLVolumeParams::importLegacyStream(std::istream& input_stream)
3403 const S32 BUFSIZE = 16384; 3426 const S32 BUFSIZE = 16384;
3404 // *NOTE: changing the size or type of this buffer will require 3427 // *NOTE: changing the size or type of this buffer will require
3405 // changing the sscanf below. 3428 // changing the sscanf below.
3406 char buffer[BUFSIZE]; 3429 char buffer[BUFSIZE]; /* Flawfinder: ignore */
3407 char keyword[256]; 3430 char keyword[256]; /* Flawfinder: ignore */
3408 keyword[0] = 0; 3431 keyword[0] = 0;
3409 3432
3410 while (input_stream.good()) 3433 while (input_stream.good())
@@ -3753,6 +3776,9 @@ BOOL LLVolumeFace::createUnCutCubeCap()
3753 num_vertices = (grid_size+1)*(grid_size+1); 3776 num_vertices = (grid_size+1)*(grid_size+1);
3754 num_indices = quad_count * 4; 3777 num_indices = quad_count * 4;
3755 3778
3779 LLVector3& min = mExtents[0];
3780 LLVector3& max = mExtents[1];
3781
3756 S32 offset = 0; 3782 S32 offset = 0;
3757 if (mTypeMask & TOP_MASK) 3783 if (mTypeMask & TOP_MASK)
3758 offset = (max_t-1) * max_s; 3784 offset = (max_t-1) * max_s;
@@ -3792,32 +3818,6 @@ BOOL LLVolumeFace::createUnCutCubeCap()
3792 } 3818 }
3793 3819
3794 S32 vtop = mVertices.size(); 3820 S32 vtop = mVertices.size();
3795// S32 itop = mIndices.size();
3796/// vector_append(mVertices,4);
3797// vector_append(mIndices,4);
3798// LLVector3 new_pt = lerp(pt1, pt2, t_fraction);
3799#if 0
3800 for(int t=0;t<4;t++){
3801 VertexData vd;
3802 vd.mPosition = corners[t].mPosition;
3803 vd.mNormal =
3804 ((corners[(t+1)%4].mPosition-corners[t].mPosition)%
3805 (corners[(t+2)%4].mPosition-corners[(t+1)%4].mPosition));
3806 vd.mNormal.normVec();
3807
3808 if (mTypeMask & TOP_MASK)
3809 vd.mNormal *= -1.0f;
3810 vd.mBinormal = vd.mNormal;
3811 vd.mTexCoord = corners[t].mTexCoord;
3812 mVertices.push_back(vd);
3813 }
3814 int idxs[] = {0,1,2,2,3,0};
3815 if (mTypeMask & TOP_MASK){
3816 for(int i=0;i<6;i++)mIndices.push_back(vtop+idxs[i]);
3817 }else{
3818 for(int i=5;i>=0;i--)mIndices.push_back(vtop+idxs[i]);
3819 }
3820#else
3821 for(int gx = 0;gx<grid_size+1;gx++){ 3821 for(int gx = 0;gx<grid_size+1;gx++){
3822 for(int gy = 0;gy<grid_size+1;gy++){ 3822 for(int gy = 0;gy<grid_size+1;gy++){
3823 VertexData newVert; 3823 VertexData newVert;
@@ -3829,8 +3829,20 @@ BOOL LLVolumeFace::createUnCutCubeCap()
3829 (F32)gx/(F32)grid_size, 3829 (F32)gx/(F32)grid_size,
3830 (F32)gy/(F32)grid_size); 3830 (F32)gy/(F32)grid_size);
3831 mVertices.push_back(newVert); 3831 mVertices.push_back(newVert);
3832
3833 if (gx == 0 && gy == 0)
3834 {
3835 min = max = newVert.mPosition;
3836 }
3837 else
3838 {
3839 update_min_max(min,max,newVert.mPosition);
3840 }
3832 } 3841 }
3833 } 3842 }
3843
3844 mCenter = (min + max) * 0.5f;
3845
3834 int idxs[] = {0,1,(grid_size+1)+1,(grid_size+1)+1,(grid_size+1),0}; 3846 int idxs[] = {0,1,(grid_size+1)+1,(grid_size+1)+1,(grid_size+1),0};
3835 for(int gx = 0;gx<grid_size;gx++){ 3847 for(int gx = 0;gx<grid_size;gx++){
3836 for(int gy = 0;gy<grid_size;gy++){ 3848 for(int gy = 0;gy<grid_size;gy++){
@@ -3841,7 +3853,7 @@ BOOL LLVolumeFace::createUnCutCubeCap()
3841 } 3853 }
3842 } 3854 }
3843 } 3855 }
3844#endif 3856
3845 return TRUE; 3857 return TRUE;
3846} 3858}
3847 3859
@@ -3888,12 +3900,15 @@ BOOL LLVolumeFace::createCap()
3888 // Figure out the normal, assume all caps are flat faces. 3900 // Figure out the normal, assume all caps are flat faces.
3889 // Cross product to get normals. 3901 // Cross product to get normals.
3890 3902
3891 LLVector2 cuv = LLVector2(0,0); 3903 LLVector2 cuv;
3892 3904 LLVector2 min_uv, max_uv;
3905
3906 LLVector3& min = mExtents[0];
3907 LLVector3& max = mExtents[1];
3908
3893 // Copy the vertices into the array 3909 // Copy the vertices into the array
3894 for (i = 0; i < num_vertices; i++) 3910 for (i = 0; i < num_vertices; i++)
3895 { 3911 {
3896
3897 if (mTypeMask & TOP_MASK) 3912 if (mTypeMask & TOP_MASK)
3898 { 3913 {
3899 mVertices[i].mTexCoord.mV[0] = profile[i].mV[0]+0.5f; 3914 mVertices[i].mTexCoord.mV[0] = profile[i].mV[0]+0.5f;
@@ -3906,17 +3921,22 @@ BOOL LLVolumeFace::createCap()
3906 mVertices[i].mTexCoord.mV[1] = 0.5f - profile[i].mV[1]; 3921 mVertices[i].mTexCoord.mV[1] = 0.5f - profile[i].mV[1];
3907 } 3922 }
3908 3923
3909 if(i){ 3924 mVertices[i].mPosition = mesh[i + offset].mPos;
3910 //Dont include the first point of the profile in the average 3925
3911 cuv += mVertices[i].mTexCoord; 3926 if (i == 0)
3912 mCenter += mVertices[i].mPosition = mesh[i + offset].mPos; 3927 {
3928 min = max = mVertices[i].mPosition;
3929 min_uv = max_uv = mVertices[i].mTexCoord;
3930 }
3931 else
3932 {
3933 update_min_max(min,max, mVertices[i].mPosition);
3934 update_min_max(min_uv, max_uv, mVertices[i].mTexCoord);
3913 } 3935 }
3914 else mVertices[i].mPosition = mesh[i + offset].mPos;
3915 //mVertices[i].mNormal = normal;
3916 } 3936 }
3917 3937
3918 mCenter /= (F32)(num_vertices-1); 3938 mCenter = (min+max)*0.5f;
3919 cuv /= (F32)(num_vertices-1); 3939 cuv = (min_uv + max_uv)*0.5f;
3920 3940
3921 LLVector3 binormal = calc_binormal_from_triangle( 3941 LLVector3 binormal = calc_binormal_from_triangle(
3922 mCenter, cuv, 3942 mCenter, cuv,
@@ -4221,13 +4241,11 @@ BOOL LLVolumeFace::createCap()
4221 return TRUE; 4241 return TRUE;
4222} 4242}
4223 4243
4224
4225BOOL LLVolumeFace::createSide() 4244BOOL LLVolumeFace::createSide()
4226{ 4245{
4227 BOOL flat = mTypeMask & FLAT_MASK; 4246 BOOL flat = mTypeMask & FLAT_MASK;
4228 S32 num_vertices, num_indices; 4247 S32 num_vertices, num_indices;
4229 4248
4230
4231 const std::vector<LLVolume::Point>& mesh = mVolumep->getMesh(); 4249 const std::vector<LLVolume::Point>& mesh = mVolumep->getMesh();
4232 const std::vector<LLVector3>& profile = mVolumep->getProfile().mProfile; 4250 const std::vector<LLVector3>& profile = mVolumep->getProfile().mProfile;
4233 const std::vector<LLPath::PathPt>& path_data = mVolumep->getPath().mPath; 4251 const std::vector<LLPath::PathPt>& path_data = mVolumep->getPath().mPath;
@@ -4243,6 +4261,9 @@ BOOL LLVolumeFace::createSide()
4243 vector_append(mIndices,num_indices); 4261 vector_append(mIndices,num_indices);
4244 vector_append(mEdge, num_indices); 4262 vector_append(mEdge, num_indices);
4245 4263
4264 LLVector3& face_min = mExtents[0];
4265 LLVector3& face_max = mExtents[1];
4266
4246 mCenter.clearVec(); 4267 mCenter.clearVec();
4247 4268
4248 S32 begin_stex = llfloor( profile[mBeginS].mV[2] ); 4269 S32 begin_stex = llfloor( profile[mBeginS].mV[2] );
@@ -4290,17 +4311,26 @@ BOOL LLVolumeFace::createSide()
4290 i = mBeginS + s + max_s*t; 4311 i = mBeginS + s + max_s*t;
4291 } 4312 }
4292 4313
4293 mCenter += mVertices[cur_vertex].mPosition = mesh[i].mPos; 4314 mVertices[cur_vertex].mPosition = mesh[i].mPos;
4294 mVertices[cur_vertex].mTexCoord = LLVector2(ss,tt); 4315 mVertices[cur_vertex].mTexCoord = LLVector2(ss,tt);
4295 4316
4296 mVertices[cur_vertex].mNormal = LLVector3(0,0,0); 4317 mVertices[cur_vertex].mNormal = LLVector3(0,0,0);
4297 mVertices[cur_vertex].mBinormal = LLVector3(0,0,0); 4318 mVertices[cur_vertex].mBinormal = LLVector3(0,0,0);
4298 4319
4320 if (cur_vertex == 0)
4321 {
4322 face_min = face_max = mesh[i].mPos;
4323 }
4324 else
4325 {
4326 update_min_max(face_min, face_max, mesh[i].mPos);
4327 }
4328
4299 cur_vertex++; 4329 cur_vertex++;
4300 4330
4301 if ((mTypeMask & INNER_MASK) && (mTypeMask & FLAT_MASK) && mNumS > 2 && s > 0) 4331 if ((mTypeMask & INNER_MASK) && (mTypeMask & FLAT_MASK) && mNumS > 2 && s > 0)
4302 { 4332 {
4303 mCenter += mVertices[cur_vertex].mPosition = mesh[i].mPos; 4333 mVertices[cur_vertex].mPosition = mesh[i].mPos;
4304 mVertices[cur_vertex].mTexCoord = LLVector2(ss,tt); 4334 mVertices[cur_vertex].mTexCoord = LLVector2(ss,tt);
4305 4335
4306 mVertices[cur_vertex].mNormal = LLVector3(0,0,0); 4336 mVertices[cur_vertex].mNormal = LLVector3(0,0,0);
@@ -4322,15 +4352,19 @@ BOOL LLVolumeFace::createSide()
4322 4352
4323 i = mBeginS + s + max_s*t; 4353 i = mBeginS + s + max_s*t;
4324 ss = profile[mBeginS + s].mV[2] - begin_stex; 4354 ss = profile[mBeginS + s].mV[2] - begin_stex;
4325 mCenter += mVertices[cur_vertex].mPosition = mesh[i].mPos; 4355 mVertices[cur_vertex].mPosition = mesh[i].mPos;
4326 mVertices[cur_vertex].mTexCoord = LLVector2(ss,tt); 4356 mVertices[cur_vertex].mTexCoord = LLVector2(ss,tt);
4327 4357
4328 mVertices[cur_vertex].mNormal = LLVector3(0,0,0); 4358 mVertices[cur_vertex].mNormal = LLVector3(0,0,0);
4329 mVertices[cur_vertex].mBinormal = LLVector3(0,0,0); 4359 mVertices[cur_vertex].mBinormal = LLVector3(0,0,0);
4360
4361 update_min_max(face_min,face_max,mesh[i].mPos);
4362
4330 cur_vertex++; 4363 cur_vertex++;
4331 } 4364 }
4332 } 4365 }
4333 mCenter /= (F32)num_vertices; 4366
4367 mCenter = (face_min + face_max) * 0.5f;
4334 4368
4335 S32 cur_index = 0; 4369 S32 cur_index = 0;
4336 S32 cur_edge = 0; 4370 S32 cur_edge = 0;
@@ -4454,32 +4488,14 @@ BOOL LLVolumeFace::createSide()
4454 } 4488 }
4455 } 4489 }
4456 4490
4457 //this loop would LOVE OpenMP 4491 //normalize normals and binormals here so the meshes that reference
4458 LLVector3 min = mVolumep->mBounds[0] - mVolumep->mBounds[1]; 4492 //this volume data don't have to
4459 LLVector3 max = mVolumep->mBounds[0] + mVolumep->mBounds[1]; 4493 for (U32 i = 0; i < mVertices.size(); i++)
4460
4461 if (min == max && min == LLVector3(512,512,512))
4462 { 4494 {
4463 min = max = mVertices[0].mPosition;
4464 }
4465
4466 for (U32 i = 0; i < mVertices.size(); i++) {
4467 mVertices[i].mNormal.normVec(); 4495 mVertices[i].mNormal.normVec();
4468 mVertices[i].mBinormal.normVec(); 4496 mVertices[i].mBinormal.normVec();
4469
4470 for (U32 j = 0; j < 3; j++) {
4471 if (mVertices[i].mPosition.mV[j] > max.mV[j]) {
4472 max.mV[j] = mVertices[i].mPosition.mV[j];
4473 }
4474 if (mVertices[i].mPosition.mV[j] < min.mV[j]) {
4475 min.mV[j] = mVertices[i].mPosition.mV[j];
4476 }
4477 }
4478 } 4497 }
4479 4498
4480 mVolumep->mBounds[0] = (min + max) * 0.5f; //center
4481 mVolumep->mBounds[1] = (max - min) * 0.5f; //half-height
4482
4483 return TRUE; 4499 return TRUE;
4484} 4500}
4485 4501
@@ -4578,7 +4594,7 @@ LLVector3 calc_binormal_from_triangle(
4578 -r0.mV[VZ] / r0.mV[VX], 4594 -r0.mV[VZ] / r0.mV[VX],
4579 -r1.mV[VZ] / r1.mV[VX], 4595 -r1.mV[VZ] / r1.mV[VX],
4580 -r2.mV[VZ] / r2.mV[VX]); 4596 -r2.mV[VZ] / r2.mV[VX]);
4581 //binormal.normVec(); 4597 // binormal.normVec();
4582 return binormal; 4598 return binormal;
4583 } 4599 }
4584 else 4600 else
diff --git a/linden/indra/llmath/llvolume.h b/linden/indra/llmath/llvolume.h
index 63981da..91f7c9b 100644
--- a/linden/indra/llmath/llvolume.h
+++ b/linden/indra/llmath/llvolume.h
@@ -775,6 +775,8 @@ public:
775 S32 mNumS; 775 S32 mNumS;
776 S32 mNumT; 776 S32 mNumT;
777 777
778 LLVector3 mExtents[2]; //minimum and maximum point of face
779
778 std::vector<VertexData> mVertices; 780 std::vector<VertexData> mVertices;
779 std::vector<S32> mIndices; 781 std::vector<S32> mIndices;
780 std::vector<S32> mEdge; 782 std::vector<S32> mEdge;
@@ -868,7 +870,6 @@ public:
868 const LLVolumeFace &getVolumeFace(const S32 f) const {return mVolumeFaces[f];} // DO NOT DELETE VOLUME WHILE USING THIS REFERENCE, OR HOLD A POINTER TO THIS VOLUMEFACE 870 const LLVolumeFace &getVolumeFace(const S32 f) const {return mVolumeFaces[f];} // DO NOT DELETE VOLUME WHILE USING THIS REFERENCE, OR HOLD A POINTER TO THIS VOLUMEFACE
869 871
870 U32 mFaceMask; // bit array of which faces exist in this volume 872 U32 mFaceMask; // bit array of which faces exist in this volume
871 LLVector3 mBounds[2]; // bounding box (center, half-height)
872 LLVector3 mLODScaleBias; // vector for biasing LOD based on scale 873 LLVector3 mLODScaleBias; // vector for biasing LOD based on scale
873 874
874protected: 875protected:
diff --git a/linden/indra/llmath/llvolumemgr.cpp b/linden/indra/llmath/llvolumemgr.cpp
index 6b6182a..2aa480c 100644
--- a/linden/indra/llmath/llvolumemgr.cpp
+++ b/linden/indra/llmath/llvolumemgr.cpp
@@ -286,7 +286,7 @@ F32 LLVolumeLODGroup::getVolumeScaleFromDetail(const S32 detail)
286 286
287F32 LLVolumeLODGroup::dump() 287F32 LLVolumeLODGroup::dump()
288{ 288{
289 char dump_str[255]; 289 char dump_str[255]; /* Flawfinder: ignore */
290 F32 usage = 0.f; 290 F32 usage = 0.f;
291 for (S32 i = 0; i < NUM_LODS; i++) 291 for (S32 i = 0; i < NUM_LODS; i++)
292 { 292 {
@@ -297,7 +297,7 @@ F32 LLVolumeLODGroup::dump()
297 } 297 }
298 usage = usage / (F32)NUM_LODS; 298 usage = usage / (F32)NUM_LODS;
299 299
300 sprintf(dump_str, "%.3f %d %d %d %d", usage, mAccessCount[0], mAccessCount[1], mAccessCount[2], mAccessCount[3]); 300 snprintf(dump_str, sizeof(dump_str), "%.3f %d %d %d %d", usage, mAccessCount[0], mAccessCount[1], mAccessCount[2], mAccessCount[3]); /* Flawfinder: ignore */
301 301
302 llinfos << dump_str << llendl; 302 llinfos << dump_str << llendl;
303 return usage; 303 return usage;
diff --git a/linden/indra/llmath/m3math.cpp b/linden/indra/llmath/m3math.cpp
index c5d2c2d..4d93af6 100644
--- a/linden/indra/llmath/m3math.cpp
+++ b/linden/indra/llmath/m3math.cpp
@@ -52,14 +52,14 @@
52 52
53LLMatrix3::LLMatrix3(const LLQuaternion &q) 53LLMatrix3::LLMatrix3(const LLQuaternion &q)
54{ 54{
55 *this = q.getMatrix3(); 55 setRot(q);
56} 56}
57 57
58 58
59LLMatrix3::LLMatrix3(const F32 angle, const LLVector3 &vec) 59LLMatrix3::LLMatrix3(const F32 angle, const LLVector3 &vec)
60{ 60{
61 LLQuaternion quat(angle, vec); 61 LLQuaternion quat(angle, vec);
62 *this = setRot(quat); 62 setRot(quat);
63} 63}
64 64
65LLMatrix3::LLMatrix3(const F32 angle, const LLVector3d &vec) 65LLMatrix3::LLMatrix3(const F32 angle, const LLVector3d &vec)
@@ -67,60 +67,25 @@ LLMatrix3::LLMatrix3(const F32 angle, const LLVector3d &vec)
67 LLVector3 vec_f; 67 LLVector3 vec_f;
68 vec_f.setVec(vec); 68 vec_f.setVec(vec);
69 LLQuaternion quat(angle, vec_f); 69 LLQuaternion quat(angle, vec_f);
70 *this = setRot(quat); 70 setRot(quat);
71} 71}
72 72
73LLMatrix3::LLMatrix3(const F32 angle, const LLVector4 &vec) 73LLMatrix3::LLMatrix3(const F32 angle, const LLVector4 &vec)
74{ 74{
75 LLQuaternion quat(angle, vec); 75 LLQuaternion quat(angle, vec);
76 *this = setRot(quat); 76 setRot(quat);
77} 77}
78 78
79LLMatrix3::LLMatrix3(const F32 angle, const F32 x, const F32 y, const F32 z) 79LLMatrix3::LLMatrix3(const F32 angle, const F32 x, const F32 y, const F32 z)
80{ 80{
81 LLVector3 vec(x, y, z); 81 LLVector3 vec(x, y, z);
82 LLQuaternion quat(angle, vec); 82 LLQuaternion quat(angle, vec);
83 *this = setRot(quat); 83 setRot(quat);
84} 84}
85 85
86LLMatrix3::LLMatrix3(const F32 roll, const F32 pitch, const F32 yaw) 86LLMatrix3::LLMatrix3(const F32 roll, const F32 pitch, const F32 yaw)
87{ 87{
88 // Rotates RH about x-axis by 'roll' then 88 setRot(roll,pitch,yaw);
89 // rotates RH about the old y-axis by 'pitch' then
90 // rotates RH about the original z-axis by 'yaw'.
91 // .
92 // /|\ yaw axis
93 // | __.
94 // ._ ___| /| pitch axis
95 // _||\ \\ |-. /
96 // \|| \_______\_|__\_/_______
97 // | _ _ o o o_o_o_o o /_\_ ________\ roll axis
98 // // /_______/ /__________> /
99 // /_,-' // /
100 // /__,-'
101
102 F32 cx, sx, cy, sy, cz, sz;
103 F32 cxsy, sxsy;
104
105 cx = (F32)cos(roll); //A
106 sx = (F32)sin(roll); //B
107 cy = (F32)cos(pitch); //C
108 sy = (F32)sin(pitch); //D
109 cz = (F32)cos(yaw); //E
110 sz = (F32)sin(yaw); //F
111
112 cxsy = cx * sy; //AD
113 sxsy = sx * sy; //BD
114
115 mMatrix[0][0] = cy * cz;
116 mMatrix[1][0] = -cy * sz;
117 mMatrix[2][0] = sy;
118 mMatrix[0][1] = sxsy * cz + cx * sz;
119 mMatrix[1][1] = -sxsy * sz + cx * cz;
120 mMatrix[2][1] = -sx * cy;
121 mMatrix[0][2] = -cxsy * cz + sx * sz;
122 mMatrix[1][2] = cxsy * sz + sx * cz;
123 mMatrix[2][2] = cx * cy;
124} 89}
125 90
126// From Matrix and Quaternion FAQ 91// From Matrix and Quaternion FAQ
@@ -307,34 +272,64 @@ LLQuaternion LLMatrix3::quaternion() const
307// These functions take Rotation arguments 272// These functions take Rotation arguments
308const LLMatrix3& LLMatrix3::setRot(const F32 angle, const F32 x, const F32 y, const F32 z) 273const LLMatrix3& LLMatrix3::setRot(const F32 angle, const F32 x, const F32 y, const F32 z)
309{ 274{
310 LLMatrix3 mat(angle, x, y, z); 275 setRot(LLQuaternion(angle,x,y,z));
311 *this = mat;
312 return *this; 276 return *this;
313} 277}
314 278
315const LLMatrix3& LLMatrix3::setRot(const F32 angle, const LLVector3 &vec) 279const LLMatrix3& LLMatrix3::setRot(const F32 angle, const LLVector3 &vec)
316{ 280{
317 LLMatrix3 mat(angle, vec); 281 setRot(LLQuaternion(angle, vec));
318 *this = mat;
319 return *this; 282 return *this;
320} 283}
321 284
322const LLMatrix3& LLMatrix3::setRot(const F32 roll, const F32 pitch, const F32 yaw) 285const LLMatrix3& LLMatrix3::setRot(const F32 roll, const F32 pitch, const F32 yaw)
323{ 286{
324 LLMatrix3 mat(roll, pitch, yaw); 287 // Rotates RH about x-axis by 'roll' then
325 *this = mat; 288 // rotates RH about the old y-axis by 'pitch' then
289 // rotates RH about the original z-axis by 'yaw'.
290 // .
291 // /|\ yaw axis
292 // | __.
293 // ._ ___| /| pitch axis
294 // _||\ \\ |-. /
295 // \|| \_______\_|__\_/_______
296 // | _ _ o o o_o_o_o o /_\_ ________\ roll axis
297 // // /_______/ /__________> /
298 // /_,-' // /
299 // /__,-'
300
301 F32 cx, sx, cy, sy, cz, sz;
302 F32 cxsy, sxsy;
303
304 cx = (F32)cos(roll); //A
305 sx = (F32)sin(roll); //B
306 cy = (F32)cos(pitch); //C
307 sy = (F32)sin(pitch); //D
308 cz = (F32)cos(yaw); //E
309 sz = (F32)sin(yaw); //F
310
311 cxsy = cx * sy; //AD
312 sxsy = sx * sy; //BD
313
314 mMatrix[0][0] = cy * cz;
315 mMatrix[1][0] = -cy * sz;
316 mMatrix[2][0] = sy;
317 mMatrix[0][1] = sxsy * cz + cx * sz;
318 mMatrix[1][1] = -sxsy * sz + cx * cz;
319 mMatrix[2][1] = -sx * cy;
320 mMatrix[0][2] = -cxsy * cz + sx * sz;
321 mMatrix[1][2] = cxsy * sz + sx * cz;
322 mMatrix[2][2] = cx * cy;
326 return *this; 323 return *this;
327} 324}
328 325
329 326
330const LLMatrix3& LLMatrix3::setRot(const LLQuaternion &q) 327const LLMatrix3& LLMatrix3::setRot(const LLQuaternion &q)
331{ 328{
332 LLMatrix3 mat(q); 329 *this = q.getMatrix3();
333 *this = mat;
334 return *this; 330 return *this;
335} 331}
336 332
337
338const LLMatrix3& LLMatrix3::setRows(const LLVector3 &fwd, const LLVector3 &left, const LLVector3 &up) 333const LLMatrix3& LLMatrix3::setRows(const LLVector3 &fwd, const LLVector3 &left, const LLVector3 &up)
339{ 334{
340 mMatrix[0][0] = fwd.mV[0]; 335 mMatrix[0][0] = fwd.mV[0];
diff --git a/linden/indra/llmath/m3math.h b/linden/indra/llmath/m3math.h
index 74c5203..494856a 100644
--- a/linden/indra/llmath/m3math.h
+++ b/linden/indra/llmath/m3math.h
@@ -51,9 +51,6 @@ class LLQuaternion;
51 51
52 52
53static const U32 NUM_VALUES_IN_MAT3 = 3; 53static const U32 NUM_VALUES_IN_MAT3 = 3;
54#if LL_WINDOWS
55__declspec( align(16) )
56#endif
57class LLMatrix3 54class LLMatrix3
58{ 55{
59 public: 56 public:
@@ -138,11 +135,7 @@ class LLMatrix3
138 friend const LLMatrix3& operator*=(LLMatrix3 &a, const LLMatrix3 &b); // Return a * b 135 friend const LLMatrix3& operator*=(LLMatrix3 &a, const LLMatrix3 &b); // Return a * b
139 136
140 friend std::ostream& operator<<(std::ostream& s, const LLMatrix3 &a); // Stream a 137 friend std::ostream& operator<<(std::ostream& s, const LLMatrix3 &a); // Stream a
141} 138};
142#if LL_DARWIN
143__attribute__ ((aligned (16)))
144#endif
145;
146 139
147inline LLMatrix3::LLMatrix3(void) 140inline LLMatrix3::LLMatrix3(void)
148{ 141{
diff --git a/linden/indra/llmath/m4math.h b/linden/indra/llmath/m4math.h
index fe9b26a..7de29ed 100644
--- a/linden/indra/llmath/m4math.h
+++ b/linden/indra/llmath/m4math.h
@@ -92,9 +92,6 @@ class LLQuaternion;
92 92
93static const U32 NUM_VALUES_IN_MAT4 = 4; 93static const U32 NUM_VALUES_IN_MAT4 = 4;
94 94
95#if LL_WINDOWS
96__declspec(align(16))
97#endif
98class LLMatrix4 95class LLMatrix4
99{ 96{
100public: 97public:
@@ -237,11 +234,7 @@ public:
237 friend const LLMatrix4& operator*=(LLMatrix4 &a, const F32 &b); // Return a * b 234 friend const LLMatrix4& operator*=(LLMatrix4 &a, const F32 &b); // Return a * b
238 235
239 friend std::ostream& operator<<(std::ostream& s, const LLMatrix4 &a); // Stream a 236 friend std::ostream& operator<<(std::ostream& s, const LLMatrix4 &a); // Stream a
240} 237};
241#if LL_DARWIN
242__attribute__ ((aligned (16)))
243#endif
244;
245 238
246 239
247inline LLMatrix4::LLMatrix4() 240inline LLMatrix4::LLMatrix4()
diff --git a/linden/indra/llmath/v2math.h b/linden/indra/llmath/v2math.h
index 1832403..c978fc0 100644
--- a/linden/indra/llmath/v2math.h
+++ b/linden/indra/llmath/v2math.h
@@ -317,6 +317,21 @@ inline LLVector2 operator-(const LLVector2 &a)
317 return LLVector2( -a.mV[0], -a.mV[1] ); 317 return LLVector2( -a.mV[0], -a.mV[1] );
318} 318}
319 319
320inline void update_min_max(LLVector2& min, LLVector2& max, const LLVector2& pos)
321{
322 for (U32 i = 0; i < 2; i++)
323 {
324 if (min.mV[i] > pos.mV[i])
325 {
326 min.mV[i] = pos.mV[i];
327 }
328 if (max.mV[i] < pos.mV[i])
329 {
330 max.mV[i] = pos.mV[i];
331 }
332 }
333}
334
320inline std::ostream& operator<<(std::ostream& s, const LLVector2 &a) 335inline std::ostream& operator<<(std::ostream& s, const LLVector2 &a)
321{ 336{
322 s << "{ " << a.mV[VX] << ", " << a.mV[VY] << " }"; 337 s << "{ " << a.mV[VX] << ", " << a.mV[VY] << " }";
diff --git a/linden/indra/llmath/v3color.h b/linden/indra/llmath/v3color.h
index 606a810..06a94db 100644
--- a/linden/indra/llmath/v3color.h
+++ b/linden/indra/llmath/v3color.h
@@ -166,7 +166,7 @@ inline LLColor3::LLColor3(const F32 *vec)
166 166
167inline LLColor3::LLColor3(char* color_string) // takes a string of format "RRGGBB" where RR is hex 00..FF 167inline LLColor3::LLColor3(char* color_string) // takes a string of format "RRGGBB" where RR is hex 00..FF
168{ 168{
169 if (strlen(color_string) < 6) 169 if (strlen(color_string) < 6) /* Flawfinder: ignore */
170 { 170 {
171 mV[0] = 0.f; 171 mV[0] = 0.f;
172 mV[1] = 0.f; 172 mV[1] = 0.f;
@@ -174,8 +174,8 @@ inline LLColor3::LLColor3(char* color_string) // takes a string of format "RRGGB
174 return; 174 return;
175 } 175 }
176 176
177 static char tempstr[7]; 177 static char tempstr[7]; /* Flawfinder: ignore */
178 strncpy(tempstr,color_string,6); 178 strncpy(tempstr,color_string,6); /* Flawfinder: ignore */
179 tempstr[6] = '\0'; 179 tempstr[6] = '\0';
180 mV[VZ] = (F32)strtol(&tempstr[4],NULL,16)/255.f; 180 mV[VZ] = (F32)strtol(&tempstr[4],NULL,16)/255.f;
181 tempstr[4] = '\0'; 181 tempstr[4] = '\0';
diff --git a/linden/indra/llmath/v3math.cpp b/linden/indra/llmath/v3math.cpp
index 39d3b70..a97b6d8 100644
--- a/linden/indra/llmath/v3math.cpp
+++ b/linden/indra/llmath/v3math.cpp
@@ -137,7 +137,7 @@ const LLVector3& LLVector3::rotVec(F32 angle, const LLVector3 &vec)
137{ 137{
138 if ( !vec.isExactlyZero() && angle ) 138 if ( !vec.isExactlyZero() && angle )
139 { 139 {
140 *this = *this * LLMatrix3(angle, vec); 140 *this = *this * LLQuaternion(angle, vec);
141 } 141 }
142 return *this; 142 return *this;
143} 143}
@@ -147,7 +147,7 @@ const LLVector3& LLVector3::rotVec(F32 angle, F32 x, F32 y, F32 z)
147 LLVector3 vec(x, y, z); 147 LLVector3 vec(x, y, z);
148 if ( !vec.isExactlyZero() && angle ) 148 if ( !vec.isExactlyZero() && angle )
149 { 149 {
150 *this = *this * LLMatrix3(angle, vec); 150 *this = *this * LLQuaternion(angle, vec);
151 } 151 }
152 return *this; 152 return *this;
153} 153}
@@ -198,6 +198,33 @@ LLVector3::LLVector3(const LLVector4 &vec)
198 mV[VZ] = (F32)vec.mV[VZ]; 198 mV[VZ] = (F32)vec.mV[VZ];
199} 199}
200 200
201LLVector3::LLVector3(const LLSD& sd)
202{
203 setValue(sd);
204}
205
206LLSD LLVector3::getValue() const
207{
208 LLSD ret;
209 ret[0] = mV[0];
210 ret[1] = mV[1];
211 ret[2] = mV[2];
212 return ret;
213}
214
215void LLVector3::setValue(const LLSD& sd)
216{
217 mV[0] = (F32) sd[0].asReal();
218 mV[1] = (F32) sd[1].asReal();
219 mV[2] = (F32) sd[2].asReal();
220}
221
222const LLVector3& LLVector3::operator=(const LLSD& sd)
223{
224 setValue(sd);
225 return *this;
226}
227
201const LLVector3& operator*=(LLVector3 &a, const LLQuaternion &rot) 228const LLVector3& operator*=(LLVector3 &a, const LLQuaternion &rot)
202{ 229{
203 const F32 rw = - rot.mQ[VX] * a.mV[VX] - rot.mQ[VY] * a.mV[VY] - rot.mQ[VZ] * a.mV[VZ]; 230 const F32 rw = - rot.mQ[VX] * a.mV[VX] - rot.mQ[VY] * a.mV[VY] - rot.mQ[VZ] * a.mV[VZ];
diff --git a/linden/indra/llmath/v3math.h b/linden/indra/llmath/v3math.h
index 68e60de..e7134eb 100644
--- a/linden/indra/llmath/v3math.h
+++ b/linden/indra/llmath/v3math.h
@@ -37,7 +37,7 @@ class LLMatrix3;
37class LLVector3d; 37class LLVector3d;
38class LLQuaternion; 38class LLQuaternion;
39 39
40// Llvector3 = |x y z w| 40// LLvector3 = |x y z w|
41 41
42static const U32 LENGTHOFVECTOR3 = 3; 42static const U32 LENGTHOFVECTOR3 = 3;
43 43
@@ -60,32 +60,13 @@ class LLVector3
60 inline explicit LLVector3(const F32 *vec); // Initializes LLVector3 to (vec[0]. vec[1], vec[2]) 60 inline explicit LLVector3(const F32 *vec); // Initializes LLVector3 to (vec[0]. vec[1], vec[2])
61 explicit LLVector3(const LLVector3d &vec); // Initializes LLVector3 to (vec[0]. vec[1], vec[2]) 61 explicit LLVector3(const LLVector3d &vec); // Initializes LLVector3 to (vec[0]. vec[1], vec[2])
62 explicit LLVector3(const LLVector4 &vec); // Initializes LLVector4 to (vec[0]. vec[1], vec[2]) 62 explicit LLVector3(const LLVector4 &vec); // Initializes LLVector4 to (vec[0]. vec[1], vec[2])
63 LLVector3(const LLSD& sd) 63 LLVector3(const LLSD& sd);
64 {
65 setValue(sd);
66 }
67 64
68 LLSD getValue() const 65 LLSD getValue() const;
69 {
70 LLSD ret;
71 ret[0] = mV[0];
72 ret[1] = mV[1];
73 ret[2] = mV[2];
74 return ret;
75 }
76 66
77 void setValue(const LLSD& sd) 67 void setValue(const LLSD& sd);
78 {
79 mV[0] = (F32) sd[0].asReal();
80 mV[1] = (F32) sd[1].asReal();
81 mV[2] = (F32) sd[2].asReal();
82 }
83 68
84 const LLVector3& operator=(const LLSD& sd) 69 const LLVector3& operator=(const LLSD& sd);
85 {
86 setValue(sd);
87 return *this;
88 }
89 70
90 inline BOOL isFinite() const; // checks to see if all values of LLVector3 are finite 71 inline BOOL isFinite() const; // checks to see if all values of LLVector3 are finite
91 BOOL clamp(F32 min, F32 max); // Clamps all values to (min,max), returns TRUE if data changed 72 BOOL clamp(F32 min, F32 max); // Clamps all values to (min,max), returns TRUE if data changed
@@ -434,6 +415,20 @@ inline BOOL LLVector3::isNull() const
434 return FALSE; 415 return FALSE;
435} 416}
436 417
418inline void update_min_max(LLVector3& min, LLVector3& max, const LLVector3& pos)
419{
420 for (U32 i = 0; i < 3; i++)
421 {
422 if (min.mV[i] > pos.mV[i])
423 {
424 min.mV[i] = pos.mV[i];
425 }
426 if (max.mV[i] < pos.mV[i])
427 {
428 max.mV[i] = pos.mV[i];
429 }
430 }
431}
437 432
438inline F32 angle_between(const LLVector3& a, const LLVector3& b) 433inline F32 angle_between(const LLVector3& a, const LLVector3& b)
439{ 434{
diff --git a/linden/indra/llmath/v4math.h b/linden/indra/llmath/v4math.h
index 06ac777..f768ba7 100644
--- a/linden/indra/llmath/v4math.h
+++ b/linden/indra/llmath/v4math.h
@@ -40,10 +40,6 @@ class LLQuaternion;
40 40
41static const U32 LENGTHOFVECTOR4 = 4; 41static const U32 LENGTHOFVECTOR4 = 4;
42 42
43#if LL_WINDOWS
44__declspec( align(16) )
45#endif
46
47class LLVector4 43class LLVector4
48{ 44{
49 public: 45 public:
@@ -114,12 +110,7 @@ class LLVector4
114 friend const LLVector4& operator/=(LLVector4 &a, F32 k); // Return a divided by scaler k 110 friend const LLVector4& operator/=(LLVector4 &a, F32 k); // Return a divided by scaler k
115 111
116 friend LLVector4 operator-(const LLVector4 &a); // Return vector -a 112 friend LLVector4 operator-(const LLVector4 &a); // Return vector -a
117} 113};
118#if LL_DARWIN
119__attribute__ ((aligned (16)))
120#endif
121;
122
123 114
124// Non-member functions 115// Non-member functions
125F32 angle_between(const LLVector4 &a, const LLVector4 &b); // Returns angle (radians) between a and b 116F32 angle_between(const LLVector4 &a, const LLVector4 &b); // Returns angle (radians) between a and b
diff --git a/linden/indra/llmedia/llmedia_vc8.vcproj b/linden/indra/llmedia/llmedia_vc8.vcproj
new file mode 100644
index 0000000..12fa817
--- /dev/null
+++ b/linden/indra/llmedia/llmedia_vc8.vcproj
@@ -0,0 +1,297 @@
1<?xml version="1.0" encoding="Windows-1252"?>
2<VisualStudioProject
3 ProjectType="Visual C++"
4 Version="8.00"
5 Name="llmedia"
6 ProjectGUID="{9D0C7E02-6506-4EE7-BC5C-75671D28D594}"
7 RootNamespace="llmedia"
8 Keyword="Win32Proj"
9 >
10 <Platforms>
11 <Platform
12 Name="Win32"
13 />
14 </Platforms>
15 <ToolFiles>
16 </ToolFiles>
17 <Configurations>
18 <Configuration
19 Name="Debug|Win32"
20 OutputDirectory="../lib_$(ConfigurationName)/i686-win32"
21 IntermediateDirectory="Debug"
22 ConfigurationType="4"
23 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
24 CharacterSet="1"
25 >
26 <Tool
27 Name="VCPreBuildEventTool"
28 />
29 <Tool
30 Name="VCCustomBuildTool"
31 />
32 <Tool
33 Name="VCXMLDataGeneratorTool"
34 />
35 <Tool
36 Name="VCWebServiceProxyGeneratorTool"
37 />
38 <Tool
39 Name="VCMIDLTool"
40 />
41 <Tool
42 Name="VCCLCompilerTool"
43 Optimization="0"
44 AdditionalIncludeDirectories="..\llcommon;..\llrender;..\llwindow;..\llimage;..\llmath;..\llvfs;..\llmessage;..\llui;&quot;..\..\libraries\i686-win32\include&quot;;..\..\libraries\include\;&quot;..\..\libraries\i686-win32\include\quicktime&quot;"
45 PreprocessorDefinitions="WIN32;_DEBUG;_LIB;LL_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;LL_DEBUG;XP_WIN;XP_WIN32"
46 MinimalRebuild="true"
47 BasicRuntimeChecks="3"
48 RuntimeLibrary="1"
49 StructMemberAlignment="4"
50 TreatWChar_tAsBuiltInType="false"
51 ForceConformanceInForLoopScope="true"
52 UsePrecompiledHeader="0"
53 WarningLevel="3"
54 WarnAsError="true"
55 Detect64BitPortabilityProblems="false"
56 DebugInformationFormat="4"
57 DisableSpecificWarnings="4702"
58 />
59 <Tool
60 Name="VCManagedResourceCompilerTool"
61 />
62 <Tool
63 Name="VCResourceCompilerTool"
64 />
65 <Tool
66 Name="VCPreLinkEventTool"
67 />
68 <Tool
69 Name="VCLibrarianTool"
70 OutputFile="$(OutDir)/llmedia.lib"
71 AdditionalLibraryDirectories=""
72 />
73 <Tool
74 Name="VCALinkTool"
75 />
76 <Tool
77 Name="VCXDCMakeTool"
78 />
79 <Tool
80 Name="VCBscMakeTool"
81 />
82 <Tool
83 Name="VCFxCopTool"
84 />
85 <Tool
86 Name="VCPostBuildEventTool"
87 />
88 </Configuration>
89 <Configuration
90 Name="Release|Win32"
91 OutputDirectory="../lib_$(ConfigurationName)/i686-win32"
92 IntermediateDirectory="Release"
93 ConfigurationType="4"
94 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
95 CharacterSet="1"
96 >
97 <Tool
98 Name="VCPreBuildEventTool"
99 />
100 <Tool
101 Name="VCCustomBuildTool"
102 />
103 <Tool
104 Name="VCXMLDataGeneratorTool"
105 />
106 <Tool
107 Name="VCWebServiceProxyGeneratorTool"
108 />
109 <Tool
110 Name="VCMIDLTool"
111 />
112 <Tool
113 Name="VCCLCompilerTool"
114 InlineFunctionExpansion="0"
115 EnableIntrinsicFunctions="false"
116 AdditionalIncludeDirectories="..\llcommon;..\llrender;..\llwindow;..\llimage;..\llmath;..\llvfs;..\llmessage;..\llui;&quot;..\..\libraries\i686-win32\include&quot;;..\..\libraries\include\;&quot;..\..\libraries\i686-win32\include\quicktime&quot;"
117 PreprocessorDefinitions="WIN32;NDEBUG;_LIB;LL_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;LL_RELEASE;XP_WIN;XP_WIN32"
118 RuntimeLibrary="0"
119 StructMemberAlignment="0"
120 TreatWChar_tAsBuiltInType="false"
121 ForceConformanceInForLoopScope="true"
122 UsePrecompiledHeader="0"
123 WarningLevel="3"
124 WarnAsError="false"
125 Detect64BitPortabilityProblems="false"
126 DebugInformationFormat="3"
127 DisableSpecificWarnings="4702"
128 />
129 <Tool
130 Name="VCManagedResourceCompilerTool"
131 />
132 <Tool
133 Name="VCResourceCompilerTool"
134 />
135 <Tool
136 Name="VCPreLinkEventTool"
137 />
138 <Tool
139 Name="VCLibrarianTool"
140 OutputFile="$(OutDir)/llmedia.lib"
141 AdditionalLibraryDirectories=""
142 IgnoreAllDefaultLibraries="false"
143 IgnoreDefaultLibraryNames=""
144 />
145 <Tool
146 Name="VCALinkTool"
147 />
148 <Tool
149 Name="VCXDCMakeTool"
150 />
151 <Tool
152 Name="VCBscMakeTool"
153 />
154 <Tool
155 Name="VCFxCopTool"
156 />
157 <Tool
158 Name="VCPostBuildEventTool"
159 />
160 </Configuration>
161 <Configuration
162 Name="ReleaseNoOpt|Win32"
163 OutputDirectory="../lib_$(ConfigurationName)/i686-win32"
164 IntermediateDirectory="$(ConfigurationName)"
165 ConfigurationType="4"
166 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
167 CharacterSet="1"
168 >
169 <Tool
170 Name="VCPreBuildEventTool"
171 />
172 <Tool
173 Name="VCCustomBuildTool"
174 />
175 <Tool
176 Name="VCXMLDataGeneratorTool"
177 />
178 <Tool
179 Name="VCWebServiceProxyGeneratorTool"
180 />
181 <Tool
182 Name="VCMIDLTool"
183 />
184 <Tool
185 Name="VCCLCompilerTool"
186 Optimization="0"
187 InlineFunctionExpansion="0"
188 EnableIntrinsicFunctions="false"
189 AdditionalIncludeDirectories="..\llcommon;..\llrender;..\llwindow;..\llimage;..\llmath;..\llvfs;..\llmessage;..\llui;&quot;..\..\libraries\i686-win32\include&quot;;..\..\libraries\include\;&quot;..\..\libraries\i686-win32\include\quicktime&quot;"
190 PreprocessorDefinitions="WIN32;NDEBUG;_LIB;LL_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;LL_RELEASE;XP_WIN;XP_WIN32"
191 RuntimeLibrary="0"
192 StructMemberAlignment="0"
193 TreatWChar_tAsBuiltInType="false"
194 ForceConformanceInForLoopScope="true"
195 UsePrecompiledHeader="0"
196 WarningLevel="3"
197 WarnAsError="true"
198 Detect64BitPortabilityProblems="false"
199 DebugInformationFormat="3"
200 DisableSpecificWarnings="4702"
201 />
202 <Tool
203 Name="VCManagedResourceCompilerTool"
204 />
205 <Tool
206 Name="VCResourceCompilerTool"
207 />
208 <Tool
209 Name="VCPreLinkEventTool"
210 />
211 <Tool
212 Name="VCLibrarianTool"
213 OutputFile="$(OutDir)/llmedia.lib"
214 AdditionalLibraryDirectories=""
215 IgnoreAllDefaultLibraries="false"
216 IgnoreDefaultLibraryNames=""
217 />
218 <Tool
219 Name="VCALinkTool"
220 />
221 <Tool
222 Name="VCXDCMakeTool"
223 />
224 <Tool
225 Name="VCBscMakeTool"
226 />
227 <Tool
228 Name="VCFxCopTool"
229 />
230 <Tool
231 Name="VCPostBuildEventTool"
232 />
233 </Configuration>
234 </Configurations>
235 <References>
236 </References>
237 <Files>
238 <Filter
239 Name="Source Files"
240 Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
241 UniqueIdentifier="{44DBC47A-0AF0-4726-A094-2D6FBB65FFFA}"
242 >
243 <File
244 RelativePath=".\llmediabase.cpp"
245 >
246 </File>
247 <File
248 RelativePath=".\llmediaengine.cpp"
249 >
250 </File>
251 <File
252 RelativePath=".\llmediaimplquicktime.cpp"
253 >
254 </File>
255 <File
256 RelativePath=".\llmediamoviebase.cpp"
257 >
258 </File>
259 <File
260 RelativePath=".\llmediamoviebase.h"
261 >
262 </File>
263 </Filter>
264 <Filter
265 Name="Header Files"
266 Filter="h;hpp;hxx;hm;inl;inc;xsd"
267 UniqueIdentifier="{D188664C-B9B7-4982-8C4B-8D9A44B4D9EF}"
268 >
269 <File
270 RelativePath=".\llmediabase.h"
271 >
272 </File>
273 <File
274 RelativePath=".\llmediaemitter.h"
275 >
276 </File>
277 <File
278 RelativePath=".\llmediaemitterevents.h"
279 >
280 </File>
281 <File
282 RelativePath=".\llmediaengine.h"
283 >
284 </File>
285 <File
286 RelativePath=".\llmediaimplquicktime.h"
287 >
288 </File>
289 <File
290 RelativePath=".\llmediaobservers.h"
291 >
292 </File>
293 </Filter>
294 </Files>
295 <Globals>
296 </Globals>
297</VisualStudioProject>
diff --git a/linden/indra/llmedia/llmediaengine.cpp b/linden/indra/llmedia/llmediaengine.cpp
index c3930a4..c8a21ba 100644
--- a/linden/indra/llmedia/llmediaengine.cpp
+++ b/linden/indra/llmedia/llmediaengine.cpp
@@ -567,7 +567,7 @@ void LLMediaEngine::process_parcel_media( LLMessageSystem *msg, void ** )
567void LLMediaEngine::process_parcel_media_update( LLMessageSystem *msg, void ** ) 567void LLMediaEngine::process_parcel_media_update( LLMessageSystem *msg, void ** )
568{ 568{
569 LLUUID media_uuid; 569 LLUUID media_uuid;
570 char media_url[255]; 570 char media_url[255]; /* Flawfinder: ignore */
571 U8 auto_align; 571 U8 auto_align;
572 msg->getUUID( "DataBlock", "MediaID", media_uuid ); 572 msg->getUUID( "DataBlock", "MediaID", media_uuid );
573 msg->getString( "DataBlock", "MediaURL", 255, media_url ); 573 msg->getString( "DataBlock", "MediaURL", 255, media_url );
diff --git a/linden/indra/llmedia/llmediaengine.h b/linden/indra/llmedia/llmediaengine.h
index 1efebec..0d0db58 100644
--- a/linden/indra/llmedia/llmediaengine.h
+++ b/linden/indra/llmedia/llmediaengine.h
@@ -62,7 +62,7 @@ public:
62 BOOL update (); 62 BOOL update ();
63 63
64 // Pass web_url true if it's a web page, false if it's a movie. 64 // Pass web_url true if it's a web page, false if it's a movie.
65 // path is to mozilla directory for mozila 65 // path is to mozilla directory for mozilla
66 BOOL load( const LLString& urlIn, bool web_url, const LLString& path, S32 width_pixels, S32 height_pixels); 66 BOOL load( const LLString& urlIn, bool web_url, const LLString& path, S32 width_pixels, S32 height_pixels);
67 67
68 BOOL isLoaded (); 68 BOOL isLoaded ();
diff --git a/linden/indra/llmedia/llmediaimplquicktime.cpp b/linden/indra/llmedia/llmediaimplquicktime.cpp
index 74b6cd9..6489f66 100644
--- a/linden/indra/llmedia/llmediaimplquicktime.cpp
+++ b/linden/indra/llmedia/llmediaimplquicktime.cpp
@@ -383,7 +383,7 @@ myFrameDrawnCallback ( Movie callbackMovie, long refCon )
383 383
384 LockPixels ( myQtRenderer->pixmapHandle ); 384 LockPixels ( myQtRenderer->pixmapHandle );
385 385
386 memcpy ( ( U8* ) myQtRenderer->mediaData, pixels, myQtRenderer->getMediaBufferSize () ); 386 memcpy ( ( U8* ) myQtRenderer->mediaData, pixels, myQtRenderer->getMediaBufferSize () ); /* Flawfinder: ignore */
387 387
388 UnlockPixels ( myQtRenderer->pixmapHandle ); 388 UnlockPixels ( myQtRenderer->pixmapHandle );
389#endif 389#endif
diff --git a/linden/indra/llmessage/files.lst b/linden/indra/llmessage/files.lst
index b2f7d41..2ff3771 100644
--- a/linden/indra/llmessage/files.lst
+++ b/linden/indra/llmessage/files.lst
@@ -1,10 +1,12 @@
1llmessage/llassetstorage.cpp 1llmessage/llassetstorage.cpp
2llmessage/llblowfishcipher.cpp
2llmessage/llbuffer.cpp 3llmessage/llbuffer.cpp
3llmessage/llbufferstream.cpp 4llmessage/llbufferstream.cpp
4llmessage/llcachename.cpp 5llmessage/llcachename.cpp
5llmessage/llchainio.cpp 6llmessage/llchainio.cpp
6llmessage/llcircuit.cpp 7llmessage/llcircuit.cpp
7llmessage/llclassifiedflags.cpp 8llmessage/llclassifiedflags.cpp
9llmessage/llcurl.cpp
8llmessage/lldatapacker.cpp 10llmessage/lldatapacker.cpp
9llmessage/lldispatcher.cpp 11llmessage/lldispatcher.cpp
10llmessage/llfiltersd2xmlrpc.cpp 12llmessage/llfiltersd2xmlrpc.cpp
diff --git a/linden/indra/llmessage/llassetstorage.cpp b/linden/indra/llmessage/llassetstorage.cpp
index eb26157..a8cd0e5 100644
--- a/linden/indra/llmessage/llassetstorage.cpp
+++ b/linden/indra/llmessage/llassetstorage.cpp
@@ -174,10 +174,40 @@ LLAssetRequest::LLAssetRequest(const LLUUID &uuid, const LLAssetType::EType type
174 mTime = LLMessageSystem::getMessageTimeSeconds(TRUE); 174 mTime = LLMessageSystem::getMessageTimeSeconds(TRUE);
175} 175}
176 176
177// virtual
177LLAssetRequest::~LLAssetRequest() 178LLAssetRequest::~LLAssetRequest()
178{ 179{
179} 180}
180 181
182// virtual
183LLSD LLAssetRequest::getTerseDetails() const
184{
185 LLSD sd;
186 sd["asset_id"] = getUUID();
187 sd["type_long"] = LLAssetType::lookupHumanReadable(getType());
188 sd["type"] = LLAssetType::lookup(getType());
189 sd["time"] = mTime;
190 time_t timestamp = (time_t) mTime;
191 std::ostringstream time_string;
192 time_string << ctime(&timestamp);
193 sd["time_string"] = time_string.str();
194 return sd;
195}
196
197// virtual
198LLSD LLAssetRequest::getFullDetails() const
199{
200 LLSD sd = getTerseDetails();
201 sd["host"] = mHost.getIPandPort();
202 sd["requesting_agent"] = mRequestingAgentID;
203 sd["is_temp"] = mIsTemp;
204 sd["is_local"] = mIsLocal;
205 sd["is_priority"] = mIsPriority;
206 sd["data_send_in_first_packet"] = mDataSentInFirstPacket;
207 sd["data_is_in_vfs"] = mDataIsInVFS;
208
209 return sd;
210}
181 211
182///---------------------------------------------------------------------------- 212///----------------------------------------------------------------------------
183/// LLInvItemRequest 213/// LLInvItemRequest
@@ -298,47 +328,41 @@ void LLAssetStorage::checkForTimeouts()
298 328
299void LLAssetStorage::_cleanupRequests(BOOL all, S32 error) 329void LLAssetStorage::_cleanupRequests(BOOL all, S32 error)
300{ 330{
301 const S32 NUM_QUEUES = 3;
302 F64 mt_secs = LLMessageSystem::getMessageTimeSeconds(); 331 F64 mt_secs = LLMessageSystem::getMessageTimeSeconds();
303 332
304 std::list<LLAssetRequest*>* requests[NUM_QUEUES]; 333 request_list_t timed_out;
305 requests[0] = &mPendingDownloads; 334 S32 rt;
306 requests[1] = &mPendingUploads; 335 for (rt = 0; rt < RT_COUNT; rt++)
307 requests[2] = &mPendingLocalUploads;
308 static const char* REQUEST_TYPE[NUM_QUEUES] = { "download", "upload", "localuploads"};
309
310 std::list<LLAssetRequest*> timed_out;
311
312 for (S32 ii = 0; ii < NUM_QUEUES; ++ii)
313 { 336 {
314 for (std::list<LLAssetRequest*>::iterator iter = requests[ii]->begin(); 337 request_list_t* requests = getRequestList((ERequestType)rt);
315 iter != requests[ii]->end(); ) 338 for (request_list_t::iterator iter = requests->begin();
339 iter != requests->end(); )
316 { 340 {
317 std::list<LLAssetRequest*>::iterator curiter = iter++; 341 request_list_t::iterator curiter = iter++;
318 LLAssetRequest* tmp = *curiter; 342 LLAssetRequest* tmp = *curiter;
319 // if all is true, we want to clean up everything 343 // if all is true, we want to clean up everything
320 // otherwise just check for timed out requests 344 // otherwise just check for timed out requests
321 // EXCEPT for upload timeouts 345 // EXCEPT for upload timeouts
322 if (all 346 if (all
323 || ((0 == ii) 347 || ((RT_DOWNLOAD == rt)
324 && LL_ASSET_STORAGE_TIMEOUT < (mt_secs - tmp->mTime))) 348 && LL_ASSET_STORAGE_TIMEOUT < (mt_secs - tmp->mTime)))
325 { 349 {
326 llwarns << "Asset " << REQUEST_TYPE[ii] << " request " 350 llwarns << "Asset " << getRequestName((ERequestType)rt) << " request "
327 << (all ? "aborted" : "timed out") << " for " 351 << (all ? "aborted" : "timed out") << " for "
328 << tmp->getUUID() << "." 352 << tmp->getUUID() << "."
329 << LLAssetType::lookup(tmp->getType()) << llendl; 353 << LLAssetType::lookup(tmp->getType()) << llendl;
330 354
331 timed_out.push_front(tmp); 355 timed_out.push_front(tmp);
332 iter = requests[ii]->erase(curiter); 356 iter = requests->erase(curiter);
333 } 357 }
334 } 358 }
335 } 359 }
336 360
337 LLAssetInfo info; 361 LLAssetInfo info;
338 for (std::list<LLAssetRequest*>::iterator iter = timed_out.begin(); 362 for (request_list_t::iterator iter = timed_out.begin();
339 iter != timed_out.end(); ) 363 iter != timed_out.end(); )
340 { 364 {
341 std::list<LLAssetRequest*>::iterator curiter = iter++; 365 request_list_t::iterator curiter = iter++;
342 LLAssetRequest* tmp = *curiter; 366 LLAssetRequest* tmp = *curiter;
343 if (tmp->mUpCallback) 367 if (tmp->mUpCallback)
344 { 368 {
@@ -401,7 +425,7 @@ void LLAssetStorage::getAssetData(const LLUUID uuid, LLAssetType::EType type, vo
401 BOOL duplicate = FALSE; 425 BOOL duplicate = FALSE;
402 426
403 // check to see if there's a pending download of this uuid already 427 // check to see if there's a pending download of this uuid already
404 for (std::list<LLAssetRequest*>::iterator iter = mPendingDownloads.begin(); 428 for (request_list_t::iterator iter = mPendingDownloads.begin();
405 iter != mPendingDownloads.end(); ++iter ) 429 iter != mPendingDownloads.end(); ++iter )
406 { 430 {
407 LLAssetRequest *tmp = *iter; 431 LLAssetRequest *tmp = *iter;
@@ -523,11 +547,11 @@ void LLAssetStorage::downloadCompleteCallback(
523 // find and callback ALL pending requests for this UUID 547 // find and callback ALL pending requests for this UUID
524 // SJB: We process the callbacks in reverse order, I do not know if this is important, 548 // SJB: We process the callbacks in reverse order, I do not know if this is important,
525 // but I didn't want to mess with it. 549 // but I didn't want to mess with it.
526 std::list<LLAssetRequest*> requests; 550 request_list_t requests;
527 for (std::list<LLAssetRequest*>::iterator iter = gAssetStorage->mPendingDownloads.begin(); 551 for (request_list_t::iterator iter = gAssetStorage->mPendingDownloads.begin();
528 iter != gAssetStorage->mPendingDownloads.end(); ) 552 iter != gAssetStorage->mPendingDownloads.end(); )
529 { 553 {
530 std::list<LLAssetRequest*>::iterator curiter = iter++; 554 request_list_t::iterator curiter = iter++;
531 LLAssetRequest* tmp = *curiter; 555 LLAssetRequest* tmp = *curiter;
532 if ((tmp->getUUID() == req->getUUID()) && (tmp->getType()== req->getType())) 556 if ((tmp->getUUID() == req->getUUID()) && (tmp->getType()== req->getType()))
533 { 557 {
@@ -535,10 +559,10 @@ void LLAssetStorage::downloadCompleteCallback(
535 iter = gAssetStorage->mPendingDownloads.erase(curiter); 559 iter = gAssetStorage->mPendingDownloads.erase(curiter);
536 } 560 }
537 } 561 }
538 for (std::list<LLAssetRequest*>::iterator iter = requests.begin(); 562 for (request_list_t::iterator iter = requests.begin();
539 iter != requests.end(); ) 563 iter != requests.end(); )
540 { 564 {
541 std::list<LLAssetRequest*>::iterator curiter = iter++; 565 request_list_t::iterator curiter = iter++;
542 LLAssetRequest* tmp = *curiter; 566 LLAssetRequest* tmp = *curiter;
543 if (tmp->mDownCallback) 567 if (tmp->mDownCallback)
544 { 568 {
@@ -896,11 +920,11 @@ void LLAssetStorage::_callUploadCallbacks(const LLUUID &uuid, LLAssetType::EType
896{ 920{
897 // SJB: We process the callbacks in reverse order, I do not know if this is important, 921 // SJB: We process the callbacks in reverse order, I do not know if this is important,
898 // but I didn't want to mess with it. 922 // but I didn't want to mess with it.
899 std::list<LLAssetRequest*> requests; 923 request_list_t requests;
900 for (std::list<LLAssetRequest*>::iterator iter = mPendingUploads.begin(); 924 for (request_list_t::iterator iter = mPendingUploads.begin();
901 iter != mPendingUploads.end(); ) 925 iter != mPendingUploads.end(); )
902 { 926 {
903 std::list<LLAssetRequest*>::iterator curiter = iter++; 927 request_list_t::iterator curiter = iter++;
904 LLAssetRequest* req = *curiter; 928 LLAssetRequest* req = *curiter;
905 if ((req->getUUID() == uuid) && (req->getType() == asset_type)) 929 if ((req->getUUID() == uuid) && (req->getType() == asset_type))
906 { 930 {
@@ -908,10 +932,10 @@ void LLAssetStorage::_callUploadCallbacks(const LLUUID &uuid, LLAssetType::EType
908 iter = mPendingUploads.erase(curiter); 932 iter = mPendingUploads.erase(curiter);
909 } 933 }
910 } 934 }
911 for (std::list<LLAssetRequest*>::iterator iter = mPendingLocalUploads.begin(); 935 for (request_list_t::iterator iter = mPendingLocalUploads.begin();
912 iter != mPendingLocalUploads.end(); ) 936 iter != mPendingLocalUploads.end(); )
913 { 937 {
914 std::list<LLAssetRequest*>::iterator curiter = iter++; 938 request_list_t::iterator curiter = iter++;
915 LLAssetRequest* req = *curiter; 939 LLAssetRequest* req = *curiter;
916 if ((req->getUUID() == uuid) && (req->getType() == asset_type)) 940 if ((req->getUUID() == uuid) && (req->getType() == asset_type))
917 { 941 {
@@ -919,10 +943,10 @@ void LLAssetStorage::_callUploadCallbacks(const LLUUID &uuid, LLAssetType::EType
919 iter = mPendingLocalUploads.erase(curiter); 943 iter = mPendingLocalUploads.erase(curiter);
920 } 944 }
921 } 945 }
922 for (std::list<LLAssetRequest*>::iterator iter = requests.begin(); 946 for (request_list_t::iterator iter = requests.begin();
923 iter != requests.end(); ) 947 iter != requests.end(); )
924 { 948 {
925 std::list<LLAssetRequest*>::iterator curiter = iter++; 949 request_list_t::iterator curiter = iter++;
926 LLAssetRequest* req = *curiter; 950 LLAssetRequest* req = *curiter;
927 if (req->mUpCallback) 951 if (req->mUpCallback)
928 { 952 {
@@ -932,45 +956,239 @@ void LLAssetStorage::_callUploadCallbacks(const LLUUID &uuid, LLAssetType::EType
932 } 956 }
933} 957}
934 958
959LLAssetStorage::request_list_t* LLAssetStorage::getRequestList(LLAssetStorage::ERequestType rt)
960{
961 switch (rt)
962 {
963 case RT_DOWNLOAD:
964 return &mPendingDownloads;
965 case RT_UPLOAD:
966 return &mPendingUploads;
967 case RT_LOCALUPLOAD:
968 return &mPendingLocalUploads;
969 default:
970 llwarns << "Unable to find request list for request type '" << rt << "'" << llendl;
971 return NULL;
972 }
973}
974
975const LLAssetStorage::request_list_t* LLAssetStorage::getRequestList(LLAssetStorage::ERequestType rt) const
976{
977 switch (rt)
978 {
979 case RT_DOWNLOAD:
980 return &mPendingDownloads;
981 case RT_UPLOAD:
982 return &mPendingUploads;
983 case RT_LOCALUPLOAD:
984 return &mPendingLocalUploads;
985 default:
986 llwarns << "Unable to find request list for request type '" << rt << "'" << llendl;
987 return NULL;
988 }
989}
990
991// static
992std::string LLAssetStorage::getRequestName(LLAssetStorage::ERequestType rt)
993{
994 switch (rt)
995 {
996 case RT_DOWNLOAD:
997 return "download";
998 case RT_UPLOAD:
999 return "upload";
1000 case RT_LOCALUPLOAD:
1001 return "localupload";
1002 default:
1003 llwarns << "Unable to find request name for request type '" << rt << "'" << llendl;
1004 return "";
1005 }
1006}
1007
1008S32 LLAssetStorage::getNumPending(LLAssetStorage::ERequestType rt) const
1009{
1010 const request_list_t* requests = getRequestList(rt);
1011 S32 num_pending = -1;
1012 if (requests)
1013 {
1014 num_pending = requests->size();
1015 }
1016 return num_pending;
1017}
935 1018
936S32 LLAssetStorage::getNumPendingDownloads() const 1019S32 LLAssetStorage::getNumPendingDownloads() const
937{ 1020{
938 return mPendingDownloads.size(); 1021 return getNumPending(RT_DOWNLOAD);
939} 1022}
940 1023
941S32 LLAssetStorage::getNumPendingUploads() const 1024S32 LLAssetStorage::getNumPendingUploads() const
942{ 1025{
943 return mPendingUploads.size(); 1026 return getNumPending(RT_UPLOAD);
944} 1027}
945 1028
946S32 LLAssetStorage::getNumPendingLocalUploads() 1029S32 LLAssetStorage::getNumPendingLocalUploads()
947{ 1030{
948 return mPendingLocalUploads.size(); 1031 return getNumPending(RT_LOCALUPLOAD);
1032}
1033
1034// virtual
1035LLSD LLAssetStorage::getPendingDetails(LLAssetStorage::ERequestType rt,
1036 LLAssetType::EType asset_type,
1037 const std::string& detail_prefix) const
1038{
1039 const request_list_t* requests = getRequestList(rt);
1040 LLSD sd;
1041 sd["requests"] = getPendingDetails(requests, asset_type, detail_prefix);
1042 return sd;
1043}
1044
1045// virtual
1046LLSD LLAssetStorage::getPendingDetails(const LLAssetStorage::request_list_t* requests,
1047 LLAssetType::EType asset_type,
1048 const std::string& detail_prefix) const
1049{
1050 LLSD details;
1051 if (requests)
1052 {
1053 request_list_t::const_iterator it = requests->begin();
1054 request_list_t::const_iterator end = requests->end();
1055 for ( ; it != end; ++it)
1056 {
1057 LLAssetRequest* req = *it;
1058 if ( (LLAssetType::AT_NONE == asset_type)
1059 || (req->getType() == asset_type) )
1060 {
1061 LLSD row = req->getTerseDetails();
1062
1063 std::ostringstream detail;
1064 detail << detail_prefix << "/" << LLAssetType::lookup(req->getType())
1065 << "/" << req->getUUID();
1066 row["detail"] = LLURI(detail.str());
1067
1068 details.append(row);
1069 }
1070 }
1071 }
1072 return details;
1073}
1074
1075
1076// static
1077const LLAssetRequest* LLAssetStorage::findRequest(const LLAssetStorage::request_list_t* requests,
1078 LLAssetType::EType asset_type,
1079 const LLUUID& asset_id)
1080{
1081 if (requests)
1082 {
1083 // Search the requests list for the asset.
1084 request_list_t::const_iterator iter = requests->begin();
1085 request_list_t::const_iterator end = requests->end();
1086 for (; iter != end; ++iter)
1087 {
1088 const LLAssetRequest* req = *iter;
1089 if (asset_type == req->getType() &&
1090 asset_id == req->getUUID() )
1091 {
1092 return req;
1093 }
1094 }
1095 }
1096 return NULL;
949} 1097}
950 1098
951LLSD LLAssetStorage::getPendingTypes(const std::list<LLAssetRequest*>& requests) const 1099// static
1100LLAssetRequest* LLAssetStorage::findRequest(LLAssetStorage::request_list_t* requests,
1101 LLAssetType::EType asset_type,
1102 const LLUUID& asset_id)
952{ 1103{
953 LLSD type_counts; 1104 if (requests)
954 std::list<LLAssetRequest*>::const_iterator it = requests.begin();
955 std::list<LLAssetRequest*>::const_iterator end = requests.end();
956 for ( ; it != end; ++it)
957 { 1105 {
958 LLAssetRequest* req = *it; 1106 // Search the requests list for the asset.
1107 request_list_t::iterator iter = requests->begin();
1108 request_list_t::iterator end = requests->end();
1109 for (; iter != end; ++iter)
1110 {
1111 LLAssetRequest* req = *iter;
1112 if (asset_type == req->getType() &&
1113 asset_id == req->getUUID() )
1114 {
1115 return req;
1116 }
1117 }
1118 }
1119 return NULL;
1120}
1121
959 1122
960 const char* type_name = LLAssetType::lookupHumanReadable(req->getType()); 1123// virtual
961 type_counts[type_name] = type_counts[type_name].asInteger() + 1; 1124LLSD LLAssetStorage::getPendingRequest(LLAssetStorage::ERequestType rt,
1125 LLAssetType::EType asset_type,
1126 const LLUUID& asset_id) const
1127{
1128 const request_list_t* requests = getRequestList(rt);
1129 return getPendingRequest(requests, asset_type, asset_id);
1130}
1131
1132// virtual
1133LLSD LLAssetStorage::getPendingRequest(const LLAssetStorage::request_list_t* requests,
1134 LLAssetType::EType asset_type,
1135 const LLUUID& asset_id) const
1136{
1137 LLSD sd;
1138 const LLAssetRequest* req = findRequest(requests, asset_type, asset_id);
1139 if (req)
1140 {
1141 sd = req->getFullDetails();
962 } 1142 }
963 return type_counts; 1143 return sd;
964} 1144}
965 1145
966LLSD LLAssetStorage::getPendingDownloadTypes() const 1146// virtual
1147bool LLAssetStorage::deletePendingRequest(LLAssetStorage::ERequestType rt,
1148 LLAssetType::EType asset_type,
1149 const LLUUID& asset_id)
967{ 1150{
968 return getPendingTypes(mPendingDownloads); 1151 request_list_t* requests = getRequestList(rt);
1152 if (deletePendingRequest(requests, asset_type, asset_id))
1153 {
1154 llinfos << "Asset " << getRequestName(rt) << " request for "
1155 << asset_id << "." << LLAssetType::lookup(asset_type)
1156 << " removed from pending queue." << llendl;
1157 return true;
1158 }
1159 return false;
969} 1160}
970 1161
971LLSD LLAssetStorage::getPendingUploadTypes() const 1162// virtual
1163bool LLAssetStorage::deletePendingRequest(LLAssetStorage::request_list_t* requests,
1164 LLAssetType::EType asset_type,
1165 const LLUUID& asset_id)
972{ 1166{
973 return getPendingTypes(mPendingUploads); 1167 LLAssetRequest* req = findRequest(requests, asset_type, asset_id);
1168 if (req)
1169 {
1170 // Remove the request from this list.
1171 requests->remove(req);
1172 S32 error = LL_ERR_TCP_TIMEOUT;
1173 // Run callbacks.
1174 if (req->mUpCallback)
1175 {
1176 req->mUpCallback(req->getUUID(), req->mUserData, error);
1177 }
1178 if (req->mDownCallback)
1179 {
1180 req->mDownCallback(mVFS, req->getUUID(), req->getType(), req->mUserData, error);
1181 }
1182 if (req->mInfoCallback)
1183 {
1184 LLAssetInfo info;
1185 req->mInfoCallback(&info, req->mUserData, error);
1186 }
1187 delete req;
1188 return true;
1189 }
1190
1191 return false;
974} 1192}
975 1193
976// static 1194// static
@@ -1015,7 +1233,7 @@ const char* LLAssetStorage::getErrorString(S32 status)
1015void LLAssetStorage::getAssetData(const LLUUID uuid, LLAssetType::EType type, void (*callback)(const char*, const LLUUID&, void *, S32), void *user_data, BOOL is_priority) 1233void LLAssetStorage::getAssetData(const LLUUID uuid, LLAssetType::EType type, void (*callback)(const char*, const LLUUID&, void *, S32), void *user_data, BOOL is_priority)
1016{ 1234{
1017 // check for duplicates here, since we're about to fool the normal duplicate checker 1235 // check for duplicates here, since we're about to fool the normal duplicate checker
1018 for (std::list<LLAssetRequest*>::iterator iter = mPendingDownloads.begin(); 1236 for (request_list_t::iterator iter = mPendingDownloads.begin();
1019 iter != mPendingDownloads.end(); ) 1237 iter != mPendingDownloads.end(); )
1020 { 1238 {
1021 LLAssetRequest* tmp = *iter++; 1239 LLAssetRequest* tmp = *iter++;
@@ -1056,12 +1274,12 @@ void LLAssetStorage::legacyGetDataCallback(LLVFS *vfs, const LLUUID &uuid, LLAss
1056 uuid.toString(uuid_str); 1274 uuid.toString(uuid_str);
1057 snprintf(filename,sizeof(filename),"%s.%s",gDirUtilp->getExpandedFilename(LL_PATH_CACHE,uuid_str).c_str(),LLAssetType::lookup(type)); /* Flawfinder: ignore */ 1275 snprintf(filename,sizeof(filename),"%s.%s",gDirUtilp->getExpandedFilename(LL_PATH_CACHE,uuid_str).c_str(),LLAssetType::lookup(type)); /* Flawfinder: ignore */
1058 1276
1059 FILE *fp = LLFile::fopen(filename, "wb"); /* Flawfinder: ignore */ 1277 FILE* fp = LLFile::fopen(filename, "wb"); /* Flawfinder: ignore */
1060 if (fp) 1278 if (fp)
1061 { 1279 {
1062 const S32 buf_size = 65536; 1280 const S32 buf_size = 65536;
1063 U8 copy_buf[buf_size]; 1281 U8 copy_buf[buf_size];
1064 while (file.read(copy_buf, buf_size)) 1282 while (file.read(copy_buf, buf_size)) /* Flawfinder: ignore */
1065 { 1283 {
1066 if (fwrite(copy_buf, file.getLastBytesRead(), 1, fp) < 1) 1284 if (fwrite(copy_buf, file.getLastBytesRead(), 1, fp) < 1)
1067 { 1285 {
diff --git a/linden/indra/llmessage/llassetstorage.h b/linden/indra/llmessage/llassetstorage.h
index deccad3..639ab59 100644
--- a/linden/indra/llmessage/llassetstorage.h
+++ b/linden/indra/llmessage/llassetstorage.h
@@ -109,6 +109,19 @@ public:
109 BOOL mDataSentInFirstPacket; 109 BOOL mDataSentInFirstPacket;
110 BOOL mDataIsInVFS; 110 BOOL mDataIsInVFS;
111 LLUUID mRequestingAgentID; // Only valid for uploads from an agent 111 LLUUID mRequestingAgentID; // Only valid for uploads from an agent
112
113 virtual LLSD getTerseDetails() const;
114 virtual LLSD getFullDetails() const;
115};
116
117template <class T>
118struct ll_asset_request_equal : public std::equal_to<T>
119{
120 bool operator()(const T& x, const T& y) const
121 {
122 return ( x->getType() == y->getType()
123 && x->getUUID() == y->getUUID() );
124 }
112}; 125};
113 126
114 127
@@ -184,6 +197,15 @@ public:
184 LLVFS *mVFS; 197 LLVFS *mVFS;
185 typedef void (*LLStoreAssetCallback)(const LLUUID &asset_id, void *user_data, S32 status); 198 typedef void (*LLStoreAssetCallback)(const LLUUID &asset_id, void *user_data, S32 status);
186 199
200 enum ERequestType
201 {
202 RT_INVALID = -1,
203 RT_DOWNLOAD = 0,
204 RT_UPLOAD = 1,
205 RT_LOCALUPLOAD = 2,
206 RT_COUNT = 3
207 };
208
187protected: 209protected:
188 BOOL mShutDown; 210 BOOL mShutDown;
189 LLHost mUpstreamHost; 211 LLHost mUpstreamHost;
@@ -191,9 +213,11 @@ protected:
191 LLMessageSystem *mMessageSys; 213 LLMessageSystem *mMessageSys;
192 LLXferManager *mXferManager; 214 LLXferManager *mXferManager;
193 215
194 std::list<LLAssetRequest*> mPendingDownloads; 216
195 std::list<LLAssetRequest*> mPendingUploads; 217 typedef std::list<LLAssetRequest*> request_list_t;
196 std::list<LLAssetRequest*> mPendingLocalUploads; 218 request_list_t mPendingDownloads;
219 request_list_t mPendingUploads;
220 request_list_t mPendingLocalUploads;
197 221
198public: 222public:
199 LLAssetStorage(LLMessageSystem *msg, LLXferManager *xfer, 223 LLAssetStorage(LLMessageSystem *msg, LLXferManager *xfer,
@@ -258,14 +282,48 @@ public:
258 const LLUUID &asset_id, LLAssetType::EType atype, 282 const LLUUID &asset_id, LLAssetType::EType atype,
259 LLGetAssetCallback cb, void *user_data, BOOL is_priority = FALSE); // Get a particular inventory item. 283 LLGetAssetCallback cb, void *user_data, BOOL is_priority = FALSE); // Get a particular inventory item.
260 284
285protected:
286 virtual LLSD getPendingDetails(const request_list_t* requests,
287 LLAssetType::EType asset_type,
288 const std::string& detail_prefix) const;
289
290 virtual LLSD getPendingRequest(const request_list_t* requests,
291 LLAssetType::EType asset_type,
292 const LLUUID& asset_id) const;
293
294 virtual bool deletePendingRequest(request_list_t* requests,
295 LLAssetType::EType asset_type,
296 const LLUUID& asset_id);
297
298public:
299 static const LLAssetRequest* findRequest(const request_list_t* requests,
300 LLAssetType::EType asset_type,
301 const LLUUID& asset_id);
302 static LLAssetRequest* findRequest(request_list_t* requests,
303 LLAssetType::EType asset_type,
304 const LLUUID& asset_id);
305
306 request_list_t* getRequestList(ERequestType rt);
307 const request_list_t* getRequestList(ERequestType rt) const;
308 static std::string getRequestName(ERequestType rt);
261 309
262 S32 getNumPendingDownloads() const; 310 S32 getNumPendingDownloads() const;
263 S32 getNumPendingUploads() const; 311 S32 getNumPendingUploads() const;
264 S32 getNumPendingLocalUploads(); 312 S32 getNumPendingLocalUploads();
313 S32 getNumPending(ERequestType rt) const;
314
315 virtual LLSD getPendingDetails(ERequestType rt,
316 LLAssetType::EType asset_type,
317 const std::string& detail_prefix) const;
318
319 virtual LLSD getPendingRequest(ERequestType rt,
320 LLAssetType::EType asset_type,
321 const LLUUID& asset_id) const;
322
323 virtual bool deletePendingRequest(ERequestType rt,
324 LLAssetType::EType asset_type,
325 const LLUUID& asset_id);
265 326
266 // Returns a map from type to num pending, eg 'texture' => 5, 'object' => 10
267 LLSD getPendingDownloadTypes() const;
268 LLSD getPendingUploadTypes() const;
269 327
270 // download process callbacks 328 // download process callbacks
271 static void downloadCompleteCallback( 329 static void downloadCompleteCallback(
@@ -349,8 +407,6 @@ private:
349 LLXferManager *xfer, 407 LLXferManager *xfer,
350 LLVFS *vfs, 408 LLVFS *vfs,
351 const LLHost &upstream_host); 409 const LLHost &upstream_host);
352 LLSD getPendingTypes(const std::list<LLAssetRequest*>& requests) const;
353
354}; 410};
355 411
356//////////////////////////////////////////////////////////////////////// 412////////////////////////////////////////////////////////////////////////
diff --git a/linden/indra/llmessage/llblowfishcipher.cpp b/linden/indra/llmessage/llblowfishcipher.cpp
new file mode 100644
index 0000000..f9a68ab
--- /dev/null
+++ b/linden/indra/llmessage/llblowfishcipher.cpp
@@ -0,0 +1,154 @@
1/**
2 * @file llblowcipher.cpp
3 * @brief Wrapper around OpenSSL Blowfish encryption algorithm.
4 *
5 * We do not have OpenSSL headers or libraries on Windows, so this
6 * class only works on Linux.
7 *
8 * Copyright (c) 2007-2007, Linden Research, Inc.
9 *
10 * The source code in this file ("Source Code") is provided by Linden Lab
11 * to you under the terms of the GNU General Public License, version 2.0
12 * ("GPL"), unless you have obtained a separate licensing agreement
13 * ("Other License"), formally executed by you and Linden Lab. Terms of
14 * the GPL can be found in doc/GPL-license.txt in this distribution, or
15 * online at http://secondlife.com/developers/opensource/gplv2
16 *
17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlife.com/developers/opensource/flossexception
21 *
22 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above,
24 * and agree to abide by those obligations.
25 *
26 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
27 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
28 * COMPLETENESS OR PERFORMANCE.
29 */
30
31#include "linden_common.h"
32
33#include "llblowfishcipher.h"
34
35
36LLBlowfishCipher::LLBlowfishCipher(const U8* secret, size_t secret_size)
37: LLCipher()
38{
39 llassert(secret);
40
41 mSecretSize = secret_size;
42 mSecret = new U8[mSecretSize];
43 memcpy(mSecret, secret, mSecretSize);
44}
45
46LLBlowfishCipher::~LLBlowfishCipher()
47{
48 delete [] mSecret;
49 mSecret = NULL;
50}
51
52
53#if LL_LINUX
54
55#include <openssl/evp.h>
56
57// virtual
58U32 LLBlowfishCipher::encrypt(const U8* src, U32 src_len, U8* dst, U32 dst_len)
59{
60 if (!src || !src_len || !dst || !dst_len) return 0;
61 if (src_len > dst_len) return 0;
62
63 // OpenSSL uses "cipher contexts" to hold encryption parameters.
64 EVP_CIPHER_CTX context;
65 EVP_CIPHER_CTX_init(&context);
66
67 // We want a blowfish cyclic block chain cipher, but need to set
68 // the key length before we pass in a key, so call EncryptInit
69 // first with NULLs.
70 EVP_EncryptInit_ex(&context, EVP_bf_cbc(), NULL, NULL, NULL);
71 EVP_CIPHER_CTX_set_key_length(&context, (int)mSecretSize);
72
73 // Complete initialization. Per EVP_EncryptInit man page, the
74 // cipher pointer must be NULL. Apparently initial_vector must
75 // be 8 bytes for blowfish, as this is the block size.
76 unsigned char initial_vector[] = { 0, 0, 0, 0, 0, 0, 0, 0 };
77 EVP_EncryptInit_ex(&context, NULL, NULL, mSecret, initial_vector);
78
79 int blocksize = EVP_CIPHER_CTX_block_size(&context);
80 int keylen = EVP_CIPHER_CTX_key_length(&context);
81 int iv_length = EVP_CIPHER_CTX_iv_length(&context);
82 lldebugs << "LLBlowfishCipher blocksize " << blocksize
83 << " keylen " << keylen
84 << " iv_len " << iv_length
85 << llendl;
86
87 int output_len = 0;
88 if (!EVP_EncryptUpdate(&context,
89 dst,
90 &output_len,
91 src,
92 src_len))
93 {
94 llwarns << "LLBlowfishCipher::encrypt EVP_EncryptUpdate failure" << llendl;
95 return 0;
96 }
97
98 // There may be some final data left to encrypt if the input is
99 // not an exact multiple of the block size.
100 int temp_len = 0;
101 if (!EVP_EncryptFinal_ex(&context, (unsigned char*)(dst + output_len), &temp_len))
102 {
103 llwarns << "LLBlowfishCipher::encrypt EVP_EncryptFinal failure" << llendl;
104 return 0;
105 }
106 output_len += temp_len;
107 return output_len;
108}
109
110// virtual
111U32 LLBlowfishCipher::decrypt(const U8* src, U32 src_len, U8* dst, U32 dst_len)
112{
113 llerrs << "LLBlowfishCipher decrypt unsupported" << llendl;
114 return 0;
115}
116
117// virtual
118U32 LLBlowfishCipher::requiredEncryptionSpace(U32 len) const
119{
120 // *HACK: We know blowfish uses an 8 byte block size.
121 // Oddly, sometimes EVP_Encrypt produces an extra block
122 // if the input is an exact multiple of the block size.
123 // So round up.
124 const U32 BLOCK_SIZE = 8;
125 len += BLOCK_SIZE;
126 len -= (len % BLOCK_SIZE);
127 return len;
128}
129
130#else // !LL_LINUX
131
132// virtual
133U32 LLBlowfishCipher::encrypt(const U8* src, U32 src_len, U8* dst, U32 dst_len)
134{
135 llerrs << "LLBlowfishCipher only supported on Linux" << llendl;
136 return 0;
137}
138
139// virtual
140U32 LLBlowfishCipher::decrypt(const U8* src, U32 src_len, U8* dst, U32 dst_len)
141{
142 llerrs << "LLBlowfishCipher only supported on Linux" << llendl;
143 return 0;
144}
145
146// virtual
147U32 LLBlowfishCipher::requiredEncryptionSpace(U32 len) const
148{
149 llerrs << "LLBlowfishCipher only supported on Linux" << llendl;
150 return 0;
151}
152
153#endif
154
diff --git a/linden/indra/newview/lltexturebar.h b/linden/indra/llmessage/llblowfishcipher.h
index ea704a2..2557598 100644
--- a/linden/indra/newview/lltexturebar.h
+++ b/linden/indra/llmessage/llblowfishcipher.h
@@ -1,8 +1,11 @@
1/** 1/**
2 * @file lltexturebar.h 2 * @file llblowfishcipher.h
3 * @brief LLTextureBar class definition 3 * @brief A symmetric block cipher, designed in 1993 by Bruce Schneier.
4 * We use it because it has an 8 byte block size, allowing encryption of
5 * two UUIDs and a timestamp (16x2 + 4 = 36 bytes) with only 40 bytes of
6 * output. AES has a block size of 32 bytes, so this would require 64 bytes.
4 * 7 *
5 * Copyright (c) 2001-2007, Linden Research, Inc. 8 * Copyright (c) 2007-2007, Linden Research, Inc.
6 * 9 *
7 * The source code in this file ("Source Code") is provided by Linden Lab 10 * The source code in this file ("Source Code") is provided by Linden Lab
8 * to you under the terms of the GNU General Public License, version 2.0 11 * to you under the terms of the GNU General Public License, version 2.0
@@ -25,51 +28,31 @@
25 * COMPLETENESS OR PERFORMANCE. 28 * COMPLETENESS OR PERFORMANCE.
26 */ 29 */
27 30
28#ifndef LL_LLTEXTUREBAR_H 31#ifndef LLBLOWFISHCIPHER_H
29#define LL_LLTEXTUREBAR_H 32#define LLBLOWFISHCIPHER_H
30 33
31#include "llview.h" 34#include "llcipher.h"
32#include "lltimer.h"
33#include "llviewerimage.h"
34 35
35class LLAssetInfo;
36class LLTimer;
37 36
38 37class LLBlowfishCipher : public LLCipher
39class LLTextureBar : public LLView
40{ 38{
41public: 39public:
42 LLPointer<LLViewerImage> mImagep; 40 // Secret may be up to 56 bytes in length per Blowfish spec.
43 S32 mHilite; 41 LLBlowfishCipher(const U8* secret, size_t secret_size);
44 42 virtual ~LLBlowfishCipher();
45public: 43
46 LLTextureBar(const std::string& name, const LLRect& r); 44 // See llcipher.h for documentation.
47 45 /*virtual*/ U32 encrypt(const U8* src, U32 src_len, U8* dst, U32 dst_len);
48 virtual EWidgetType getWidgetType() const; 46 /*virtual*/ U32 decrypt(const U8* src, U32 src_len, U8* dst, U32 dst_len);
49 virtual LLString getWidgetTag() const; 47 /*virtual*/ U32 requiredEncryptionSpace(U32 src_len) const;
50 48
51 virtual void draw(); 49#ifdef _DEBUG
52 50 static BOOL testHarness();
53 virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask); 51#endif
54 52
55 virtual LLRect getRequiredRect(); // Return the height of this object, given the set options. 53private:
56}; 54 U8* mSecret;
57 55 size_t mSecretSize;
58class LLGLTexMemBar : public LLView
59{
60public:
61 LLGLTexMemBar(const std::string& name);
62
63 virtual EWidgetType getWidgetType() const;
64 virtual LLString getWidgetTag() const;
65
66 virtual void draw();
67
68 virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask);
69
70 virtual LLRect getRequiredRect(); // Return the height of this object, given the set options.
71
72protected:
73}; 56};
74 57
75#endif // LL_TEXTURE_BAR_ 58#endif // LL_LLCRYPTO_H
diff --git a/linden/indra/llmessage/llbuffer.cpp b/linden/indra/llmessage/llbuffer.cpp
index 07c730a..3dd34a0 100644
--- a/linden/indra/llmessage/llbuffer.cpp
+++ b/linden/indra/llmessage/llbuffer.cpp
@@ -109,7 +109,7 @@ LLHeapBuffer::LLHeapBuffer(const U8* src, S32 len)
109 allocate(len); 109 allocate(len);
110 if(mBuffer) 110 if(mBuffer)
111 { 111 {
112 memcpy(mBuffer, src, len); 112 memcpy(mBuffer, src, len); /*Flawfinder: ignore*/
113 } 113 }
114 } 114 }
115 else 115 else
@@ -735,7 +735,7 @@ bool LLBufferArray::copyIntoBuffers(
735 } 735 }
736 segments.push_back(segment); 736 segments.push_back(segment);
737 S32 bytes = llmin(segment.size(), len); 737 S32 bytes = llmin(segment.size(), len);
738 memcpy(segment.data(), src + copied, bytes); /* Flawfinder Ignore */ 738 memcpy(segment.data(), src + copied, bytes); /* Flawfinder: Ignore */
739 copied += bytes; 739 copied += bytes;
740 len -= bytes; 740 len -= bytes;
741 if(0 == len) 741 if(0 == len)
@@ -757,7 +757,7 @@ bool LLBufferArray::copyIntoBuffers(
757 return false; 757 return false;
758 } 758 }
759 segments.push_back(segment); 759 segments.push_back(segment);
760 memcpy(segment.data(), src + copied, segment.size()); 760 memcpy(segment.data(), src + copied, segment.size()); /*Flawfinder: ignore*/
761 copied += segment.size(); 761 copied += segment.size();
762 len -= segment.size(); 762 len -= segment.size();
763 } 763 }
diff --git a/linden/indra/llmessage/llcachename.cpp b/linden/indra/llmessage/llcachename.cpp
index 3a92812..e92c72f 100644
--- a/linden/indra/llmessage/llcachename.cpp
+++ b/linden/indra/llmessage/llcachename.cpp
@@ -276,6 +276,40 @@ void LLCacheName::addObserver(LLCacheNameCallback callback)
276 impl.mObservers.push_back(callback); 276 impl.mObservers.push_back(callback);
277} 277}
278 278
279void LLCacheName::removeObserver(LLCacheNameCallback callback)
280{
281 Observers::iterator it = impl.mObservers.begin();
282 Observers::iterator end = impl.mObservers.end();
283
284 for ( ; it != end; ++it)
285 {
286 const LLCacheNameCallback& cb = (*it);
287 if (cb == callback)
288 {
289 impl.mObservers.erase(it);
290 return;
291 }
292 }
293}
294
295void LLCacheName::cancelCallback(const LLUUID& id, LLCacheNameCallback callback, void* user_data)
296{
297 ReplyQueue::iterator it = impl.mReplyQueue.begin();
298 ReplyQueue::iterator end = impl.mReplyQueue.end();
299
300 for(; it != end; ++it)
301 {
302 const PendingReply& reply = (*it);
303
304 if ((callback == reply.mCallback)
305 && (id == reply.mID)
306 && (user_data == reply.mData) )
307 {
308 impl.mReplyQueue.erase(it);
309 return;
310 }
311 }
312}
279 313
280void LLCacheName::importFile(FILE* fp) 314void LLCacheName::importFile(FILE* fp)
281{ 315{
@@ -297,7 +331,10 @@ void LLCacheName::importFile(FILE* fp)
297 // *NOTE: This buffer size is hardcoded into sscanf() below 331 // *NOTE: This buffer size is hardcoded into sscanf() below
298 char version_string[BUFFER_SIZE]; /*Flawfinder: ignore*/ 332 char version_string[BUFFER_SIZE]; /*Flawfinder: ignore*/
299 S32 version = 0; 333 S32 version = 0;
300 S32 match = sscanf(buffer, "%1023s %d", version_string, &version); 334 S32 match = sscanf( /* Flawfinder: ignore */
335 buffer,
336 "%1023s %d",
337 version_string, &version);
301 if ( match != 2 338 if ( match != 2
302 || strcmp(version_string, "version") 339 || strcmp(version_string, "version")
303 || version != CN_FILE_VERSION) 340 || version != CN_FILE_VERSION)
@@ -316,7 +353,7 @@ void LLCacheName::importFile(FILE* fp)
316 valid = fgets(buffer, BUFFER_SIZE, fp); 353 valid = fgets(buffer, BUFFER_SIZE, fp);
317 if (!valid) break; 354 if (!valid) break;
318 355
319 match = sscanf( 356 match = sscanf( /* Flawfinder: ignore */
320 buffer, 357 buffer,
321 "%254s %u %254s %254s", 358 "%254s %u %254s %254s",
322 id_string, 359 id_string,
@@ -395,7 +432,7 @@ BOOL LLCacheName::getName(const LLUUID& id, char* first, char* last)
395 { 432 {
396 // The function signature needs to change to pass in the 433 // The function signature needs to change to pass in the
397 // length of first and last. 434 // length of first and last.
398 strcpy(first, CN_NOBODY); 435 strcpy(first, CN_NOBODY); /*Flawfinder: ignore*/
399 last[0] = '\0'; 436 last[0] = '\0';
400 return FALSE; 437 return FALSE;
401 } 438 }
@@ -405,8 +442,8 @@ BOOL LLCacheName::getName(const LLUUID& id, char* first, char* last)
405 { 442 {
406 // The function signature needs to change to pass in the 443 // The function signature needs to change to pass in the
407 // length of first and last. 444 // length of first and last.
408 strcpy(first, entry->mFirstName); 445 strcpy(first, entry->mFirstName); /*Flawfinder: ignore*/
409 strcpy(last, entry->mLastName); 446 strcpy(last, entry->mLastName); /*Flawfinder: ignore*/
410 return TRUE; 447 return TRUE;
411 } 448 }
412 else 449 else
@@ -416,7 +453,7 @@ BOOL LLCacheName::getName(const LLUUID& id, char* first, char* last)
416 strcpy(first,(ll_frand() < HIPPO_PROBABILITY) 453 strcpy(first,(ll_frand() < HIPPO_PROBABILITY)
417 ? CN_HIPPOS 454 ? CN_HIPPOS
418 : CN_WAITING); 455 : CN_WAITING);
419 strcpy(last, ""); 456 strcpy(last, ""); /*Flawfinder: ignore*/
420 457
421 impl.mAskNameQueue.push_back(id); 458 impl.mAskNameQueue.push_back(id);
422 return FALSE; 459 return FALSE;
@@ -432,7 +469,7 @@ BOOL LLCacheName::getGroupName(const LLUUID& id, char* group)
432 { 469 {
433 // The function signature needs to change to pass in the 470 // The function signature needs to change to pass in the
434 // length of first and last. 471 // length of first and last.
435 strcpy(group, CN_NONE); 472 strcpy(group, CN_NONE); /*Flawfinder: ignore*/
436 return FALSE; 473 return FALSE;
437 } 474 }
438 475
@@ -450,14 +487,14 @@ BOOL LLCacheName::getGroupName(const LLUUID& id, char* group)
450 { 487 {
451 // The function signature needs to change to pass in the length 488 // The function signature needs to change to pass in the length
452 // of group. 489 // of group.
453 strcpy(group, entry->mGroupName); 490 strcpy(group, entry->mGroupName); /*Flawfinder: ignore*/
454 return TRUE; 491 return TRUE;
455 } 492 }
456 else 493 else
457 { 494 {
458 // The function signature needs to change to pass in the length 495 // The function signature needs to change to pass in the length
459 // of first and last. 496 // of first and last.
460 strcpy(group, CN_WAITING); 497 strcpy(group, CN_WAITING); /*Flawfinder: ignore*/
461 498
462 impl.mAskGroupQueue.push_back(id); 499 impl.mAskGroupQueue.push_back(id);
463 return FALSE; 500 return FALSE;
diff --git a/linden/indra/llmessage/llcachename.h b/linden/indra/llmessage/llcachename.h
index 4dd42cb..9987f11 100644
--- a/linden/indra/llmessage/llcachename.h
+++ b/linden/indra/llmessage/llcachename.h
@@ -60,6 +60,8 @@ public:
60 void addObserver(LLCacheNameCallback callback); 60 void addObserver(LLCacheNameCallback callback);
61 void removeObserver(LLCacheNameCallback callback); 61 void removeObserver(LLCacheNameCallback callback);
62 62
63 void cancelCallback(const LLUUID& id, LLCacheNameCallback callback, void* user_data = NULL);
64
63 // storing cache on disk; for viewer, in name.cache 65 // storing cache on disk; for viewer, in name.cache
64 void importFile(FILE* fp); 66 void importFile(FILE* fp);
65 void exportFile(FILE* fp); 67 void exportFile(FILE* fp);
diff --git a/linden/indra/llmessage/llcipher.h b/linden/indra/llmessage/llcipher.h
new file mode 100644
index 0000000..c1f88ff
--- /dev/null
+++ b/linden/indra/llmessage/llcipher.h
@@ -0,0 +1,57 @@
1/**
2 * @file llcipher.h
3 * @brief Abstract base class for encryption ciphers.
4 *
5 * Copyright (c) 2003-2007, Linden Research, Inc.
6 *
7 * The source code in this file ("Source Code") is provided by Linden Lab
8 * to you under the terms of the GNU General Public License, version 2.0
9 * ("GPL"), unless you have obtained a separate licensing agreement
10 * ("Other License"), formally executed by you and Linden Lab. Terms of
11 * the GPL can be found in doc/GPL-license.txt in this distribution, or
12 * online at http://secondlife.com/developers/opensource/gplv2
13 *
14 * There are special exceptions to the terms and conditions of the GPL as
15 * it is applied to this Source Code. View the full text of the exception
16 * in the file doc/FLOSS-exception.txt in this software distribution, or
17 * online at http://secondlife.com/developers/opensource/flossexception
18 *
19 * By copying, modifying or distributing this software, you acknowledge
20 * that you have read and understood your obligations described above,
21 * and agree to abide by those obligations.
22 *
23 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
24 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
25 * COMPLETENESS OR PERFORMANCE.
26 */
27
28#ifndef LLCIPHER_H
29#define LLCIPHER_H
30
31//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
32// Class LLCipher
33//
34// Abstract base class for a cipher object.
35//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
36
37class LLCipher
38{
39public:
40 virtual ~LLCipher() {}
41
42 // encrypt src and place result into dst. returns TRUE if
43 // Returns number of bytes written into dst, or 0 on error.
44 virtual U32 encrypt(const U8* src, U32 src_len, U8* dst, U32 dst_len) = 0;
45
46 // decrypt src and place result into dst.
47 // Returns number of bytes written into dst, or 0 on error.
48 virtual U32 decrypt(const U8* src, U32 src_len, U8* dst, U32 dst_len) = 0;
49
50 // returns the minimum amount of space required to encrypt for a
51 // unencrypted source buffer of length len.
52 // *NOTE: This is estimated space and you should check the return value
53 // of the encrypt function.
54 virtual U32 requiredEncryptionSpace(U32 src_len) const = 0 ;
55};
56
57#endif
diff --git a/linden/indra/llmessage/llcurl.cpp b/linden/indra/llmessage/llcurl.cpp
new file mode 100644
index 0000000..886697e
--- /dev/null
+++ b/linden/indra/llmessage/llcurl.cpp
@@ -0,0 +1,343 @@
1/*
2 * llcurl.cpp
3 * MacTester
4 *
5 * Created by Zero Linden on 10/15/06.
6 * Copyright 2006 __MyCompanyName__. All rights reserved.
7 *
8 */
9
10#include "llcurl.h"
11
12#include <iomanip>
13
14#include "llsdserialize.h"
15
16//////////////////////////////////////////////////////////////////////////////
17/*
18 The trick to getting curl to do keep-alives is to reuse the
19 same easy handle for the requests. It appears that curl
20 keeps a pool of connections alive for each easy handle, but
21 doesn't share them between easy handles. Therefore it is
22 important to keep a pool of easy handles and reuse them,
23 rather than create and destroy them with each request. This
24 code does this.
25
26 Furthermore, it would behoove us to keep track of which
27 hosts an easy handle was used for and pick an easy handle
28 that matches the next request. This code does not current
29 do this.
30 */
31
32using namespace std;
33
34LLCurl::Responder::Responder()
35 : mReferenceCount(0)
36{
37}
38LLCurl::Responder::~Responder()
39{
40}
41
42// virtual
43void LLCurl::Responder::error(U32 status, const std::stringstream& content)
44{
45 llinfos << "LLCurl::Responder::error " << status << ": " << content.str() << llendl;
46}
47
48// virtual
49void LLCurl::Responder::result(const std::stringstream& content)
50{
51}
52
53// virtual
54void LLCurl::Responder::completed(U32 status, const std::stringstream& content)
55{
56 if (200 <= status && status < 300)
57 {
58 result(content);
59 }
60 else
61 {
62 error(status, content);
63 }
64}
65
66
67namespace boost
68{
69 void intrusive_ptr_add_ref(LLCurl::Responder* p)
70 {
71 ++p->mReferenceCount;
72 }
73
74 void intrusive_ptr_release(LLCurl::Responder* p)
75 {
76 if(0 == --p->mReferenceCount)
77 {
78 delete p;
79 }
80 }
81};
82
83//////////////////////////////////////////////////////////////////////////////
84
85size_t
86curlOutputCallback(void* data, size_t size, size_t nmemb, void* user_data)
87{
88 stringstream& output = *(stringstream*)user_data;
89
90 size_t n = size * nmemb;
91 output.write((const char*)data, n);
92 if (!((istream&)output).good()) {
93 std::cerr << "WHAT!?!?!? istream side bad" << std::endl;
94 }
95 if (!((ostream&)output).good()) {
96 std::cerr << "WHAT!?!?!? ostream side bad" << std::endl;
97 }
98
99 return n;
100}
101
102// Only used if request contained a body (post or put), Not currently implemented.
103// size_t
104// curlRequestCallback(void* data, size_t size, size_t nmemb, void* user_data)
105// {
106// stringstream& request = *(stringstream*)user_data;
107
108// size_t n = size * nmemb;
109// request.read((char*)data, n);
110// return request.gcount();
111// }
112
113
114
115
116
117LLCurl::Easy::Easy()
118{
119 mHeaders = 0;
120 mHeaders = curl_slist_append(mHeaders, "Connection: keep-alive");
121 mHeaders = curl_slist_append(mHeaders, "Keep-alive: 300");
122 mHeaders = curl_slist_append(mHeaders, "Content-Type: application/xml");
123 // FIXME: shouldn't be there for GET/DELETE
124 // FIXME: should have ACCEPT headers
125
126 mHandle = curl_easy_init();
127}
128
129LLCurl::Easy::~Easy()
130{
131 curl_easy_cleanup(mHandle);
132 curl_slist_free_all(mHeaders);
133}
134
135void
136LLCurl::Easy::get(const string& url, ResponderPtr responder)
137{
138 prep(url, responder);
139 curl_easy_setopt(mHandle, CURLOPT_HTTPGET, 1);
140}
141
142void
143LLCurl::Easy::getByteRange(const string& url, S32 offset, S32 length, ResponderPtr responder)
144{
145 mRange = llformat("Range: bytes=%d-%d", offset,offset+length-1);
146 mHeaders = curl_slist_append(mHeaders, mRange.c_str());
147 prep(url, responder);
148 curl_easy_setopt(mHandle, CURLOPT_HTTPGET, 1);
149}
150
151void
152LLCurl::Easy::perform()
153{
154 report(curl_easy_perform(mHandle));
155}
156
157void
158LLCurl::Easy::prep(const std::string& url, ResponderPtr responder)
159{
160#if !LL_DARWIN
161 curl_easy_reset(mHandle); // SJB: doesn't exisit on OSX 10.3.9
162#else
163 // SJB: equivalent? fast?
164 curl_easy_cleanup(mHandle);
165 mHandle = curl_easy_init();
166#endif
167
168 curl_easy_setopt(mHandle, CURLOPT_PRIVATE, this);
169
170// curl_easy_setopt(mHandle, CURLOPT_VERBOSE, 1); // usefull for debugging
171 curl_easy_setopt(mHandle, CURLOPT_NOSIGNAL, 1);
172 curl_easy_setopt(mHandle, CURLOPT_WRITEFUNCTION, &curlOutputCallback);
173 curl_easy_setopt(mHandle, CURLOPT_WRITEDATA, &mOutput);
174#if 1 // For debug
175 curl_easy_setopt(mHandle, CURLOPT_HEADERFUNCTION, &curlOutputCallback);
176 curl_easy_setopt(mHandle, CURLOPT_HEADERDATA, &mHeaderOutput);
177#endif
178 curl_easy_setopt(mHandle, CURLOPT_ERRORBUFFER, &mErrorBuffer);
179 curl_easy_setopt(mHandle, CURLOPT_ENCODING, "");
180 curl_easy_setopt(mHandle, CURLOPT_SSL_VERIFYPEER, false);
181 curl_easy_setopt(mHandle, CURLOPT_HTTPHEADER, mHeaders);
182
183 mOutput.str("");
184 if (!((istream&)mOutput).good()) {
185 std::cerr << "WHAT!?!?!? istream side bad" << std::endl;
186 }
187 if (!((ostream&)mOutput).good()) {
188 std::cerr << "WHAT!?!?!? ostream side bad" << std::endl;
189 }
190
191 mURL = url;
192 curl_easy_setopt(mHandle, CURLOPT_URL, mURL.c_str());
193
194 mResponder = responder;
195}
196
197void
198LLCurl::Easy::report(CURLcode code)
199{
200 if (!mResponder) return;
201
202 long responseCode;
203
204 if (code == CURLE_OK)
205 {
206 curl_easy_getinfo(mHandle, CURLINFO_RESPONSE_CODE, &responseCode);
207 }
208 else
209 {
210 responseCode = 499;
211 }
212
213 mResponder->completed(responseCode, mOutput);
214 mResponder = NULL;
215}
216
217
218
219
220
221
222LLCurl::Multi::Multi()
223{
224 mHandle = curl_multi_init();
225}
226
227LLCurl::Multi::~Multi()
228{
229 // FIXME: should clean up excess handles in mFreeEasy
230 curl_multi_cleanup(mHandle);
231}
232
233
234void
235LLCurl::Multi::get(const std::string& url, ResponderPtr responder)
236{
237 LLCurl::Easy* easy = easyAlloc();
238 easy->get(url, responder);
239 curl_multi_add_handle(mHandle, easy->mHandle);
240}
241
242void
243LLCurl::Multi::getByteRange(const std::string& url, S32 offset, S32 length, ResponderPtr responder)
244{
245 LLCurl::Easy* easy = easyAlloc();
246 easy->getByteRange(url, offset, length, responder);
247 curl_multi_add_handle(mHandle, easy->mHandle);
248}
249
250void
251LLCurl::Multi::process()
252{
253 int count;
254 for (int call_count = 0; call_count < 5; call_count += 1)
255 {
256 if (CURLM_CALL_MULTI_PERFORM != curl_multi_perform(mHandle, &count))
257 {
258 break;
259 }
260 }
261
262 CURLMsg* msg;
263 int msgs_in_queue;
264 while ((msg = curl_multi_info_read(mHandle, &msgs_in_queue)))
265 {
266 if (msg->msg != CURLMSG_DONE) continue;
267 Easy* easy = 0;
268 curl_easy_getinfo(msg->easy_handle, CURLINFO_PRIVATE, &easy);
269 if (!easy) continue;
270 easy->report(msg->data.result);
271
272 curl_multi_remove_handle(mHandle, easy->mHandle);
273 easyFree(easy);
274 }
275}
276
277
278
279LLCurl::Easy*
280LLCurl::Multi::easyAlloc()
281{
282 Easy* easy = 0;
283
284 if (mFreeEasy.empty())
285 {
286 easy = new Easy();
287 }
288 else
289 {
290 easy = mFreeEasy.back();
291 mFreeEasy.pop_back();
292 }
293
294 return easy;
295}
296
297void
298LLCurl::Multi::easyFree(Easy* easy)
299{
300 if (mFreeEasy.size() < 5)
301 {
302 mFreeEasy.push_back(easy);
303 }
304 else
305 {
306 delete easy;
307 }
308}
309
310
311
312namespace
313{
314 static LLCurl::Multi* sMainMulti = 0;
315
316 LLCurl::Multi*
317 mainMulti()
318 {
319 if (!sMainMulti) {
320 sMainMulti = new LLCurl::Multi();
321 }
322 return sMainMulti;
323 }
324}
325
326void
327LLCurl::get(const std::string& url, ResponderPtr responder)
328{
329 mainMulti()->get(url, responder);
330}
331
332void
333LLCurl::getByteRange(const std::string& url, S32 offset, S32 length, ResponderPtr responder)
334{
335 mainMulti()->getByteRange(url, offset, length, responder);
336}
337
338void
339LLCurl::process()
340{
341 mainMulti()->process();
342}
343
diff --git a/linden/indra/llmessage/llcurl.h b/linden/indra/llmessage/llcurl.h
new file mode 100644
index 0000000..4f1b5e6
--- /dev/null
+++ b/linden/indra/llmessage/llcurl.h
@@ -0,0 +1,118 @@
1/*
2 * llcurl.h
3 * MacTester
4 *
5 * Created by Zero Linden on 10/15/06.
6 * Copyright 2006 __MyCompanyName__. All rights reserved.
7 *
8 */
9
10#ifndef LL_LLCURL_H
11#define LL_LLCURL_H
12
13#include "linden_common.h"
14
15#include <sstream>
16#include <string>
17#include <vector>
18
19#include <boost/intrusive_ptr.hpp>
20#include <curl/curl.h>
21
22// #include "llhttpclient.h"
23
24class LLCurl
25{
26public:
27 class Multi;
28
29 class Responder
30 {
31 public:
32 Responder();
33 virtual ~Responder();
34
35 virtual void error(U32 status, const std::stringstream& content); // called with bad status codes
36
37 virtual void result(const std::stringstream& content);
38
39 virtual void completed(U32 status, const std::stringstream& content);
40 /**< The default implemetnation calls
41 either:
42 * result(), or
43 * error()
44 */
45
46 public: /* but not really -- don't touch this */
47 U32 mReferenceCount;
48 };
49 typedef boost::intrusive_ptr<Responder> ResponderPtr;
50
51 class Easy
52 {
53 public:
54 Easy();
55 ~Easy();
56
57 void get(const std::string& url, ResponderPtr);
58 void getByteRange(const std::string& url, S32 offset, S32 length, ResponderPtr);
59
60 void perform();
61
62 private:
63 void prep(const std::string& url, ResponderPtr);
64 void report(CURLcode);
65
66 CURL* mHandle;
67 struct curl_slist* mHeaders;
68
69 std::string mURL;
70 std::string mRange;
71 std::stringstream mRequest;
72
73 std::stringstream mOutput;
74 char mErrorBuffer[CURL_ERROR_SIZE];
75
76 std::stringstream mHeaderOutput; // Debug
77
78 ResponderPtr mResponder;
79
80 friend class Multi;
81 };
82
83
84 class Multi
85 {
86 public:
87 Multi();
88 ~Multi();
89
90 void get(const std::string& url, ResponderPtr);
91 void getByteRange(const std::string& url, S32 offset, S32 length, ResponderPtr);
92
93 void process();
94
95 private:
96 Easy* easyAlloc();
97 void easyFree(Easy*);
98
99 CURLM* mHandle;
100
101 typedef std::vector<Easy*> EasyList;
102 EasyList mFreeEasy;
103 };
104
105
106 static void get(const std::string& url, ResponderPtr);
107 static void getByteRange(const std::string& url, S32 offset, S32 length, ResponderPtr responder);
108
109 static void process();
110};
111
112namespace boost
113{
114 void intrusive_ptr_add_ref(LLCurl::Responder* p);
115 void intrusive_ptr_release(LLCurl::Responder* p);
116};
117
118#endif // LL_LLCURL_H
diff --git a/linden/indra/llmessage/lldatapacker.cpp b/linden/indra/llmessage/lldatapacker.cpp
index 4a15d8b..d4c8704 100644
--- a/linden/indra/llmessage/lldatapacker.cpp
+++ b/linden/indra/llmessage/lldatapacker.cpp
@@ -543,7 +543,7 @@ const LLDataPackerBinaryBuffer& LLDataPackerBinaryBuffer::operator=(const LLData
543 // We've got problems, ack! 543 // We've got problems, ack!
544 llerrs << "Trying to do an assignment with not enough room in the target." << llendl; 544 llerrs << "Trying to do an assignment with not enough room in the target." << llendl;
545 } 545 }
546 memcpy(mBufferp, a.mBufferp, a.getBufferSize()); 546 memcpy(mBufferp, a.mBufferp, a.getBufferSize()); /*Flawfinder: ignore*/
547 return *this; 547 return *this;
548} 548}
549 549
@@ -1236,7 +1236,7 @@ BOOL LLDataPackerAsciiBuffer::unpackUUID(LLUUID &value, const char *name)
1236 } 1236 }
1237 1237
1238 char tmp_str[64]; /* Flawfinder: ignore */ 1238 char tmp_str[64]; /* Flawfinder: ignore */
1239 sscanf(valuestr, "%63s", tmp_str); 1239 sscanf(valuestr, "%63s", tmp_str); /* Flawfinder: ignore */
1240 value.set(tmp_str); 1240 value.set(tmp_str);
1241 1241
1242 return success; 1242 return success;
@@ -1258,7 +1258,7 @@ void LLDataPackerAsciiBuffer::writeIndentedName(const char *name)
1258 } 1258 }
1259 else 1259 else
1260 { 1260 {
1261 numCopied = (S32)strlen(name) + 1; //name + tab /* Flawfinder: ignore */ 1261 numCopied = (S32)strlen(name) + 1; /* Flawfinder: ignore */ //name + tab
1262 } 1262 }
1263 1263
1264 // snprintf returns number of bytes that would have been written had the 1264 // snprintf returns number of bytes that would have been written had the
@@ -1288,9 +1288,9 @@ BOOL LLDataPackerAsciiBuffer::getValueStr(const char *name, char *out_value, S32
1288 // Read both the name and the value, and validate the name. 1288 // Read both the name and the value, and validate the name.
1289 sscanf(mCurBufferp, "%511[^\n]", buffer); 1289 sscanf(mCurBufferp, "%511[^\n]", buffer);
1290 // Skip the \n 1290 // Skip the \n
1291 mCurBufferp += (S32)strlen(buffer) + 1; 1291 mCurBufferp += (S32)strlen(buffer) + 1; /* Flawfinder: ignore */
1292 1292
1293 sscanf(buffer, "%511s %511[^\n]", keyword, value); 1293 sscanf(buffer, "%511s %511[^\n]", keyword, value); /* Flawfinder: ignore */
1294 1294
1295 if (strcmp(keyword, name)) 1295 if (strcmp(keyword, name))
1296 { 1296 {
@@ -1794,7 +1794,7 @@ BOOL LLDataPackerAsciiFile::unpackUUID(LLUUID &value, const char *name)
1794 } 1794 }
1795 1795
1796 char tmp_str[64]; /*Flawfinder: ignore */ 1796 char tmp_str[64]; /*Flawfinder: ignore */
1797 sscanf(valuestr,"%63s",tmp_str); 1797 sscanf(valuestr,"%63s",tmp_str); /* Flawfinder: ignore */
1798 value.set(tmp_str); 1798 value.set(tmp_str);
1799 1799
1800 return success; 1800 return success;
@@ -1838,7 +1838,7 @@ BOOL LLDataPackerAsciiFile::getValueStr(const char *name, char *out_value, S32 v
1838 fgetpos(mFP, &last_pos); 1838 fgetpos(mFP, &last_pos);
1839 fgets(buffer, DP_BUFSIZE, mFP); 1839 fgets(buffer, DP_BUFSIZE, mFP);
1840 1840
1841 sscanf(buffer, "%511s %511[^\n]", keyword, value); 1841 sscanf(buffer, "%511s %511[^\n]", keyword, value); /* Flawfinder: ignore */
1842 1842
1843 if (!keyword[0]) 1843 if (!keyword[0])
1844 { 1844 {
@@ -1863,7 +1863,7 @@ BOOL LLDataPackerAsciiFile::getValueStr(const char *name, char *out_value, S32 v
1863 { 1863 {
1864 mInputStream->getline(buffer, DP_BUFSIZE); 1864 mInputStream->getline(buffer, DP_BUFSIZE);
1865 1865
1866 sscanf(buffer, "%511s %511[^\n]", keyword, value); 1866 sscanf(buffer, "%511s %511[^\n]", keyword, value); /* Flawfinder: ignore */
1867 if (!keyword[0]) 1867 if (!keyword[0])
1868 { 1868 {
1869 llwarns << "Data packer could not get the keyword!" << llendl; 1869 llwarns << "Data packer could not get the keyword!" << llendl;
diff --git a/linden/indra/llmessage/lldispatcher.cpp b/linden/indra/llmessage/lldispatcher.cpp
index cf83079..7ba9f44 100644
--- a/linden/indra/llmessage/lldispatcher.cpp
+++ b/linden/indra/llmessage/lldispatcher.cpp
@@ -76,6 +76,7 @@ bool LLDispatcher::dispatch(
76 LLDispatchHandler* func = (*it).second; 76 LLDispatchHandler* func = (*it).second;
77 return (*func)(this, name, invoice, strings); 77 return (*func)(this, name, invoice, strings);
78 } 78 }
79 llwarns << "Unable to find handler for Generic message: " << name << llendl;
79 return false; 80 return false;
80} 81}
81 82
diff --git a/linden/indra/llmessage/llfiltersd2xmlrpc.cpp b/linden/indra/llmessage/llfiltersd2xmlrpc.cpp
index feae47a..63913d5 100644
--- a/linden/indra/llmessage/llfiltersd2xmlrpc.cpp
+++ b/linden/indra/llmessage/llfiltersd2xmlrpc.cpp
@@ -267,6 +267,7 @@ void LLFilterSD2XMLRPC::streamOut(std::ostream& ostr, const LLSD& sd)
267 LLSD::Binary buffer = sd.asBinary(); 267 LLSD::Binary buffer = sd.asBinary();
268 if(!buffer.empty()) 268 if(!buffer.empty())
269 { 269 {
270 // *TODO: convert to LLBase64
270 int b64_buffer_length = apr_base64_encode_len(buffer.size()); 271 int b64_buffer_length = apr_base64_encode_len(buffer.size());
271 char* b64_buffer = new char[b64_buffer_length]; 272 char* b64_buffer = new char[b64_buffer_length];
272 b64_buffer_length = apr_base64_encode_binary( 273 b64_buffer_length = apr_base64_encode_binary(
diff --git a/linden/indra/llmessage/llhost.cpp b/linden/indra/llmessage/llhost.cpp
index c071063..c1ca4b0 100644
--- a/linden/indra/llmessage/llhost.cpp
+++ b/linden/indra/llmessage/llhost.cpp
@@ -87,7 +87,7 @@ void LLHost::getIPString(char* buffer, S32 length) const
87 87
88std::string LLHost::getIPandPort() const 88std::string LLHost::getIPandPort() const
89{ 89{
90 char buffer[MAXADDRSTR + 1 + 5]; 90 char buffer[MAXADDRSTR + 1 + 5]; /*Flawfinder: ignore*/
91 getString(buffer, sizeof(buffer)); 91 getString(buffer, sizeof(buffer));
92 return buffer; 92 return buffer;
93} 93}
diff --git a/linden/indra/llmessage/llhttpassetstorage.cpp b/linden/indra/llmessage/llhttpassetstorage.cpp
index 2b64385..6c57499 100644
--- a/linden/indra/llmessage/llhttpassetstorage.cpp
+++ b/linden/indra/llmessage/llhttpassetstorage.cpp
@@ -30,12 +30,15 @@
30 30
31#include "llhttpassetstorage.h" 31#include "llhttpassetstorage.h"
32 32
33#include <sys/stat.h>
34
33#include "indra_constants.h" 35#include "indra_constants.h"
34#include "llvfile.h" 36#include "llvfile.h"
35#include "llvfs.h" 37#include "llvfs.h"
36 38
37#include "zlib/zlib.h" 39#include "zlib/zlib.h"
38 40
41const U32 MAX_RUNNING_REQUESTS = 4;
39const F32 MAX_PROCESSING_TIME = 0.005f; 42const F32 MAX_PROCESSING_TIME = 0.005f;
40const S32 CURL_XFER_BUFFER_SIZE = 65536; 43const S32 CURL_XFER_BUFFER_SIZE = 65536;
41// Try for 30 minutes for now. 44// Try for 30 minutes for now.
@@ -68,7 +71,9 @@ struct LLTempAssetData
68class LLHTTPAssetRequest : public LLAssetRequest 71class LLHTTPAssetRequest : public LLAssetRequest
69{ 72{
70public: 73public:
71 LLHTTPAssetRequest(LLHTTPAssetStorage *asp, const LLUUID &uuid, LLAssetType::EType type, const char *url, CURLM *curl_multi); 74 LLHTTPAssetRequest(LLHTTPAssetStorage *asp, const LLUUID &uuid,
75 LLAssetType::EType type, LLAssetStorage::ERequestType rt,
76 const char *url, CURLM *curl_multi);
72 virtual ~LLHTTPAssetRequest(); 77 virtual ~LLHTTPAssetRequest();
73 78
74 void setupCurlHandle(); 79 void setupCurlHandle();
@@ -80,6 +85,9 @@ public:
80 static size_t curlCompressedUploadCallback( 85 static size_t curlCompressedUploadCallback(
81 void *data, size_t size, size_t nmemb, void *user_data); 86 void *data, size_t size, size_t nmemb, void *user_data);
82 87
88 virtual LLSD getTerseDetails() const;
89 virtual LLSD getFullDetails() const;
90
83public: 91public:
84 LLHTTPAssetStorage *mAssetStoragep; 92 LLHTTPAssetStorage *mAssetStoragep;
85 93
@@ -89,9 +97,7 @@ public:
89 struct curl_slist *mHTTPHeaders; 97 struct curl_slist *mHTTPHeaders;
90 LLVFile *mVFile; 98 LLVFile *mVFile;
91 LLUUID mTmpUUID; 99 LLUUID mTmpUUID;
92 BOOL mIsUpload; 100 LLAssetStorage::ERequestType mRequestType;
93 BOOL mIsLocalUpload;
94 BOOL mIsDownload;
95 101
96 bool mZInitialized; 102 bool mZInitialized;
97 z_stream mZStream; 103 z_stream mZStream;
@@ -102,7 +108,12 @@ public:
102}; 108};
103 109
104 110
105LLHTTPAssetRequest::LLHTTPAssetRequest(LLHTTPAssetStorage *asp, const LLUUID &uuid, LLAssetType::EType type, const char *url, CURLM *curl_multi) 111LLHTTPAssetRequest::LLHTTPAssetRequest(LLHTTPAssetStorage *asp,
112 const LLUUID &uuid,
113 LLAssetType::EType type,
114 LLAssetStorage::ERequestType rt,
115 const char *url,
116 CURLM *curl_multi)
106 : LLAssetRequest(uuid, type), 117 : LLAssetRequest(uuid, type),
107 mZInitialized(false) 118 mZInitialized(false)
108{ 119{
@@ -110,15 +121,16 @@ LLHTTPAssetRequest::LLHTTPAssetRequest(LLHTTPAssetStorage *asp, const LLUUID &uu
110 mCurlHandle = NULL; 121 mCurlHandle = NULL;
111 mCurlMultiHandle = curl_multi; 122 mCurlMultiHandle = curl_multi;
112 mVFile = NULL; 123 mVFile = NULL;
113 mIsUpload = FALSE; 124 mRequestType = rt;
114 mIsLocalUpload = FALSE;
115 mIsDownload = FALSE;
116 mHTTPHeaders = NULL; 125 mHTTPHeaders = NULL;
126 mFP = NULL;
127 mZInputBuffer = NULL;
128 mZInputExhausted = false;
117 129
118 mURLBuffer = new char[strlen(url) + 1]; /*Flawfinder: ignore*/ 130 mURLBuffer = new char[strlen(url) + 1]; /*Flawfinder: ignore*/
119 if (mURLBuffer) 131 if (mURLBuffer)
120 { 132 {
121 strcpy(mURLBuffer, url); 133 strcpy(mURLBuffer, url); /*Flawfinder: ignore*/
122 } 134 }
123} 135}
124 136
@@ -132,22 +144,7 @@ LLHTTPAssetRequest::~LLHTTPAssetRequest()
132 if (mAssetStoragep) 144 if (mAssetStoragep)
133 { 145 {
134 // Terminating a request. Thus upload or download is no longer pending. 146 // Terminating a request. Thus upload or download is no longer pending.
135 if (mIsUpload) 147 mAssetStoragep->removeRunningRequest(mRequestType, this);
136 {
137 mAssetStoragep->clearPendingUpload();
138 }
139 else if (mIsLocalUpload)
140 {
141 mAssetStoragep->clearPendingLocalUpload();
142 }
143 else if (mIsDownload)
144 {
145 mAssetStoragep->clearPendingDownload();
146 }
147 else
148 {
149 llerrs << "LLHTTPAssetRequest::~LLHTTPAssetRequest - Destroyed request is not upload OR download, this is bad!" << llendl;
150 }
151 } 148 }
152 else 149 else
153 { 150 {
@@ -163,6 +160,82 @@ LLHTTPAssetRequest::~LLHTTPAssetRequest()
163 finishCompressedUpload(); 160 finishCompressedUpload();
164} 161}
165 162
163// virtual
164LLSD LLHTTPAssetRequest::getTerseDetails() const
165{
166 LLSD sd = LLAssetRequest::getTerseDetails();
167
168 sd["url"] = mURLBuffer;
169
170 return sd;
171}
172
173// virtual
174LLSD LLHTTPAssetRequest::getFullDetails() const
175{
176 LLSD sd = LLAssetRequest::getFullDetails();
177
178 if (mCurlHandle)
179 {
180 long curl_response = -1;
181 long curl_connect = -1;
182 double curl_total_time = -1.0f;
183 double curl_size_upload = -1.0f;
184 double curl_size_download = -1.0f;
185 long curl_content_length_upload = -1;
186 long curl_content_length_download = -1;
187 long curl_request_size = -1;
188 const char* curl_content_type = NULL;
189
190 curl_easy_getinfo(mCurlHandle, CURLINFO_HTTP_CODE, &curl_response);
191 curl_easy_getinfo(mCurlHandle, CURLINFO_HTTP_CONNECTCODE, &curl_connect);
192 curl_easy_getinfo(mCurlHandle, CURLINFO_TOTAL_TIME, &curl_total_time);
193 curl_easy_getinfo(mCurlHandle, CURLINFO_SIZE_UPLOAD, &curl_size_upload);
194 curl_easy_getinfo(mCurlHandle, CURLINFO_SIZE_DOWNLOAD, &curl_size_download);
195 curl_easy_getinfo(mCurlHandle, CURLINFO_CONTENT_LENGTH_UPLOAD, &curl_content_length_upload);
196 curl_easy_getinfo(mCurlHandle, CURLINFO_CONTENT_LENGTH_DOWNLOAD, &curl_content_length_download);
197 curl_easy_getinfo(mCurlHandle, CURLINFO_REQUEST_SIZE, &curl_request_size);
198 curl_easy_getinfo(mCurlHandle, CURLINFO_CONTENT_TYPE, &curl_content_type);
199
200 sd["curl_response_code"] = (int) curl_response;
201 sd["curl_http_connect_code"] = (int) curl_connect;
202 sd["curl_total_time"] = curl_total_time;
203 sd["curl_size_upload"] = curl_size_upload;
204 sd["curl_size_download"] = curl_size_download;
205 sd["curl_content_length_upload"] = (int) curl_content_length_upload;
206 sd["curl_content_length_download"] = (int) curl_content_length_download;
207 sd["curl_request_size"] = (int) curl_request_size;
208 if (curl_content_type)
209 {
210 sd["curl_content_type"] = curl_content_type;
211 }
212 else
213 {
214 sd["curl_content_type"] = "";
215 }
216 }
217
218 sd["temp_id"] = mTmpUUID;
219 sd["request_type"] = LLAssetStorage::getRequestName(mRequestType);
220 sd["z_initialized"] = mZInitialized;
221 sd["z_input_exhausted"] = mZInputExhausted;
222
223 S32 file_size = -1;
224 if (mFP)
225 {
226 struct stat file_stat;
227 int file_desc = fileno(mFP);
228 if ( fstat(file_desc, &file_stat) == 0)
229 {
230 file_size = file_stat.st_size;
231 }
232 }
233 sd["file_size"] = file_size;
234
235 return sd;
236}
237
238
166void LLHTTPAssetRequest::setupCurlHandle() 239void LLHTTPAssetRequest::setupCurlHandle()
167{ 240{
168 mCurlHandle = curl_easy_init(); 241 mCurlHandle = curl_easy_init();
@@ -170,7 +243,7 @@ void LLHTTPAssetRequest::setupCurlHandle()
170 curl_easy_setopt(mCurlHandle, CURLOPT_NOPROGRESS, 1); 243 curl_easy_setopt(mCurlHandle, CURLOPT_NOPROGRESS, 1);
171 curl_easy_setopt(mCurlHandle, CURLOPT_URL, mURLBuffer); 244 curl_easy_setopt(mCurlHandle, CURLOPT_URL, mURLBuffer);
172 curl_easy_setopt(mCurlHandle, CURLOPT_PRIVATE, this); 245 curl_easy_setopt(mCurlHandle, CURLOPT_PRIVATE, this);
173 if (mIsDownload) 246 if (LLAssetStorage::RT_DOWNLOAD == mRequestType)
174 { 247 {
175 curl_easy_setopt(mCurlHandle, CURLOPT_ENCODING, ""); 248 curl_easy_setopt(mCurlHandle, CURLOPT_ENCODING, "");
176 // only do this on downloads, as uploads 249 // only do this on downloads, as uploads
@@ -193,22 +266,7 @@ void LLHTTPAssetRequest::setupCurlHandle()
193 if (mAssetStoragep) 266 if (mAssetStoragep)
194 { 267 {
195 // Set the appropriate pending upload or download flag 268 // Set the appropriate pending upload or download flag
196 if (mIsUpload) 269 mAssetStoragep->addRunningRequest(mRequestType, this);
197 {
198 mAssetStoragep->setPendingUpload();
199 }
200 else if (mIsLocalUpload)
201 {
202 mAssetStoragep->setPendingLocalUpload();
203 }
204 else if (mIsDownload)
205 {
206 mAssetStoragep->setPendingDownload();
207 }
208 else
209 {
210 llerrs << "LLHTTPAssetRequest::setupCurlHandle - Request is not upload OR download, this is bad!" << llendl;
211 }
212 } 270 }
213 else 271 else
214 { 272 {
@@ -342,10 +400,6 @@ void LLHTTPAssetStorage::_init(const char *web_host, const char *local_web_host,
342 curl_global_init(CURL_GLOBAL_ALL); 400 curl_global_init(CURL_GLOBAL_ALL);
343 401
344 mCurlMultiHandle = curl_multi_init(); 402 mCurlMultiHandle = curl_multi_init();
345
346 mPendingDownload = FALSE;
347 mPendingUpload = FALSE;
348 mPendingLocalUpload = FALSE;
349} 403}
350 404
351LLHTTPAssetStorage::~LLHTTPAssetStorage() 405LLHTTPAssetStorage::~LLHTTPAssetStorage()
@@ -457,6 +511,113 @@ void LLHTTPAssetStorage::storeAssetData(
457 } 511 }
458} 512}
459 513
514// virtual
515LLSD LLHTTPAssetStorage::getPendingDetails(LLAssetStorage::ERequestType rt,
516 LLAssetType::EType asset_type,
517 const std::string& detail_prefix) const
518{
519 LLSD sd = LLAssetStorage::getPendingDetails(rt, asset_type, detail_prefix);
520 const request_list_t* running = getRunningList(rt);
521 if (running)
522 {
523 // Loop through the pending requests sd, and add extra info about its running status.
524 S32 num_pending = sd["requests"].size();
525 S32 i;
526 for (i = 0; i < num_pending; ++i)
527 {
528 LLSD& pending = sd["requests"][i];
529 // See if this pending request is running.
530 const LLAssetRequest* req = findRequest(running,
531 LLAssetType::lookup(pending["type"].asString().c_str()),
532 pending["asset_id"]);
533 if (req)
534 {
535 // Keep the detail_url so we don't have to rebuild it.
536 LLURI detail_url = pending["detail"];
537 pending = req->getTerseDetails();
538 pending["detail"] = detail_url;
539 pending["is_running"] = true;
540 }
541 else
542 {
543 pending["is_running"] = false;
544 }
545 }
546 }
547 return sd;
548}
549
550// virtual
551LLSD LLHTTPAssetStorage::getPendingRequest(LLAssetStorage::ERequestType rt,
552 LLAssetType::EType asset_type,
553 const LLUUID& asset_id) const
554{
555 // Look for this asset in the running list first.
556 const request_list_t* running = getRunningList(rt);
557 if (running)
558 {
559 LLSD sd = LLAssetStorage::getPendingRequest(running, asset_type, asset_id);
560 if (sd)
561 {
562 sd["is_running"] = true;
563 return sd;
564 }
565 }
566 LLSD sd = LLAssetStorage::getPendingRequest(rt, asset_type, asset_id);
567 if (sd)
568 {
569 sd["is_running"] = false;
570 }
571 return sd;
572}
573
574// virtual
575bool LLHTTPAssetStorage::deletePendingRequest(LLAssetStorage::ERequestType rt,
576 LLAssetType::EType asset_type,
577 const LLUUID& asset_id)
578{
579 // Try removing this from the running list first.
580 request_list_t* running = getRunningList(rt);
581 if (running)
582 {
583 LLAssetRequest* req = findRequest(running, asset_type, asset_id);
584 if (req)
585 {
586 // Remove this request from the running list to get it out of curl.
587 running->remove(req);
588
589 // Find this request in the pending list, so we can move it to the end of the line.
590 request_list_t* pending = getRequestList(rt);
591 if (pending)
592 {
593 request_list_t::iterator result = std::find_if(pending->begin(), pending->end(),
594 std::bind2nd(ll_asset_request_equal<LLAssetRequest*>(), req));
595 if (pending->end() != result)
596 {
597 // This request was found in the pending list. Move it to the end!
598 LLAssetRequest* pending_req = *result;
599 pending->remove(pending_req);
600 pending->push_back(pending_req);
601
602 llinfos << "Asset " << getRequestName(rt) << " request for "
603 << asset_id << "." << LLAssetType::lookup(asset_type)
604 << " removed from curl and placed at the end of the pending queue."
605 << llendl;
606 }
607 else
608 {
609 llwarns << "Unable to find pending " << getRequestName(rt) << " request for "
610 << asset_id << "." << LLAssetType::lookup(asset_type) << llendl;
611 }
612 }
613 delete req;
614
615 return true;
616 }
617 }
618 return LLAssetStorage::deletePendingRequest(rt, asset_type, asset_id);
619}
620
460// internal requester, used by getAssetData in superclass 621// internal requester, used by getAssetData in superclass
461void LLHTTPAssetStorage::_queueDataRequest(const LLUUID& uuid, LLAssetType::EType type, 622void LLHTTPAssetStorage::_queueDataRequest(const LLUUID& uuid, LLAssetType::EType type,
462 void (*callback)(LLVFS *vfs, const LLUUID&, LLAssetType::EType, void *, S32), 623 void (*callback)(LLVFS *vfs, const LLUUID&, LLAssetType::EType, void *, S32),
@@ -488,13 +649,41 @@ void LLHTTPAssetStorage::_queueDataRequest(const LLUUID& uuid, LLAssetType::ETyp
488 } 649 }
489} 650}
490 651
652LLAssetRequest* LLHTTPAssetStorage::findNextRequest(LLAssetStorage::request_list_t& pending,
653 LLAssetStorage::request_list_t& running)
654{
655 // Early exit if the running list is full, or we don't have more pending than running.
656 if (running.size() >= MAX_RUNNING_REQUESTS
657 || pending.size() <= running.size()) return NULL;
658
659 // Look for the first pending request that is not already running.
660 request_list_t::iterator running_begin = running.begin();
661 request_list_t::iterator running_end = running.end();
662
663 request_list_t::iterator pending_iter = pending.begin();
664 request_list_t::iterator pending_end = pending.end();
665 // Loop over all pending requests until we miss finding it in the running list.
666 for (; pending_iter != pending.end(); ++pending_iter)
667 {
668 LLAssetRequest* req = *pending_iter;
669 // Look for this pending request in the running list.
670 if (running_end == std::find_if(running_begin, running_end,
671 std::bind2nd(ll_asset_request_equal<LLAssetRequest*>(), req)))
672 {
673 // It isn't running! Return it.
674 return req;
675 }
676 }
677 return NULL;
678}
679
491// overloaded to additionally move data to/from the webserver 680// overloaded to additionally move data to/from the webserver
492void LLHTTPAssetStorage::checkForTimeouts() 681void LLHTTPAssetStorage::checkForTimeouts()
493{ 682{
494 LLAssetRequest *req = NULL; 683 CURLMcode mcode;
495 if (mPendingDownloads.size() > 0 && !mPendingDownload) 684 LLAssetRequest *req;
496 { 685 while (req = findNextRequest(mPendingDownloads, mRunningDownloads))
497 req = mPendingDownloads.front(); 686 {
498 // Setup this curl download request 687 // Setup this curl download request
499 // We need to generate a new request here 688 // We need to generate a new request here
500 // since the one in the list could go away 689 // since the one in the list could go away
@@ -504,9 +693,9 @@ void LLHTTPAssetStorage::checkForTimeouts()
504 std::string base_url = getBaseURL(req->getUUID(), req->getType()); 693 std::string base_url = getBaseURL(req->getUUID(), req->getType());
505 snprintf(tmp_url, sizeof(tmp_url), "%s/%36s.%s", base_url.c_str() , uuid_str, LLAssetType::lookup(req->getType())); /*Flawfinder: ignore*/ 694 snprintf(tmp_url, sizeof(tmp_url), "%s/%36s.%s", base_url.c_str() , uuid_str, LLAssetType::lookup(req->getType())); /*Flawfinder: ignore*/
506 695
507 LLHTTPAssetRequest *new_req = new LLHTTPAssetRequest(this, req->getUUID(), req->getType(), tmp_url, mCurlMultiHandle); 696 LLHTTPAssetRequest *new_req = new LLHTTPAssetRequest(this, req->getUUID(),
697 req->getType(), RT_DOWNLOAD, tmp_url, mCurlMultiHandle);
508 new_req->mTmpUUID.generate(); 698 new_req->mTmpUUID.generate();
509 new_req->mIsDownload = TRUE;
510 699
511 // Sets pending download flag internally 700 // Sets pending download flag internally
512 new_req->setupCurlHandle(); 701 new_req->setupCurlHandle();
@@ -514,15 +703,22 @@ void LLHTTPAssetStorage::checkForTimeouts()
514 curl_easy_setopt(new_req->mCurlHandle, CURLOPT_WRITEFUNCTION, &curlDownCallback); 703 curl_easy_setopt(new_req->mCurlHandle, CURLOPT_WRITEFUNCTION, &curlDownCallback);
515 curl_easy_setopt(new_req->mCurlHandle, CURLOPT_WRITEDATA, new_req->mCurlHandle); 704 curl_easy_setopt(new_req->mCurlHandle, CURLOPT_WRITEDATA, new_req->mCurlHandle);
516 705
517 curl_multi_add_handle(mCurlMultiHandle, new_req->mCurlHandle); 706 mcode = curl_multi_add_handle(mCurlMultiHandle, new_req->mCurlHandle);
518 llinfos << "Requesting " << new_req->mURLBuffer << llendl; 707 if (mcode > CURLM_OK)
519 708 {
709 // Failure. Deleting the pending request will remove it from the running
710 // queue, and push it to the end of the pending queue.
711 deletePendingRequest(RT_DOWNLOAD, req->getType(), req->getUUID());
712 break;
713 }
714 else
715 {
716 llinfos << "Requesting " << new_req->mURLBuffer << llendl;
717 }
520 } 718 }
521 719
522 720 while (req = findNextRequest(mPendingUploads, mRunningUploads))
523 if (mPendingUploads.size() > 0 && !mPendingUpload)
524 { 721 {
525 req = mPendingUploads.front();
526 // setup this curl upload request 722 // setup this curl upload request
527 723
528 bool do_compress = req->getType() == LLAssetType::AT_OBJECT; 724 bool do_compress = req->getType() == LLAssetType::AT_OBJECT;
@@ -534,8 +730,8 @@ void LLHTTPAssetStorage::checkForTimeouts()
534 do_compress ? "%s/%s.%s.gz" : "%s/%s.%s", 730 do_compress ? "%s/%s.%s.gz" : "%s/%s.%s",
535 mBaseURL.c_str(), uuid_str, LLAssetType::lookup(req->getType())); 731 mBaseURL.c_str(), uuid_str, LLAssetType::lookup(req->getType()));
536 732
537 LLHTTPAssetRequest *new_req = new LLHTTPAssetRequest(this, req->getUUID(), req->getType(), tmp_url, mCurlMultiHandle); 733 LLHTTPAssetRequest *new_req = new LLHTTPAssetRequest(this, req->getUUID(),
538 new_req->mIsUpload = TRUE; 734 req->getType(), RT_UPLOAD, tmp_url, mCurlMultiHandle);
539 if (do_compress) 735 if (do_compress)
540 { 736 {
541 new_req->prepareCompressedUpload(); 737 new_req->prepareCompressedUpload();
@@ -560,15 +756,23 @@ void LLHTTPAssetStorage::checkForTimeouts()
560 } 756 }
561 curl_easy_setopt(new_req->mCurlHandle, CURLOPT_READDATA, new_req->mCurlHandle); 757 curl_easy_setopt(new_req->mCurlHandle, CURLOPT_READDATA, new_req->mCurlHandle);
562 758
563 curl_multi_add_handle(mCurlMultiHandle, new_req->mCurlHandle); 759 mcode = curl_multi_add_handle(mCurlMultiHandle, new_req->mCurlHandle);
564 llinfos << "Requesting PUT " << new_req->mURLBuffer << llendl; 760 if (mcode > CURLM_OK)
761 {
762 // Failure. Deleting the pending request will remove it from the running
763 // queue, and push it to the end of the pending queue.
764 deletePendingRequest(RT_UPLOAD, req->getType(), req->getUUID());
765 break;
766 }
767 else
768 {
769 llinfos << "Requesting PUT " << new_req->mURLBuffer << llendl;
770 }
565 // Pending upload will have been flagged by the request 771 // Pending upload will have been flagged by the request
566 } 772 }
567 773
568 774 while (req = findNextRequest(mPendingLocalUploads, mRunningLocalUploads))
569 if (mPendingLocalUploads.size() > 0 && !mPendingLocalUpload)
570 { 775 {
571 req = mPendingLocalUploads.front();
572 // setup this curl upload request 776 // setup this curl upload request
573 LLVFile file(mVFS, req->getUUID(), req->getType()); 777 LLVFile file(mVFS, req->getUUID(), req->getType());
574 778
@@ -579,8 +783,8 @@ void LLHTTPAssetStorage::checkForTimeouts()
579 // KLW - All temporary uploads are saved locally "http://localhost:12041/asset" 783 // KLW - All temporary uploads are saved locally "http://localhost:12041/asset"
580 snprintf(tmp_url, sizeof(tmp_url), "%s/%36s.%s", mLocalBaseURL.c_str(), uuid_str, LLAssetType::lookup(req->getType())); /*Flawfinder: ignore*/ 784 snprintf(tmp_url, sizeof(tmp_url), "%s/%36s.%s", mLocalBaseURL.c_str(), uuid_str, LLAssetType::lookup(req->getType())); /*Flawfinder: ignore*/
581 785
582 LLHTTPAssetRequest *new_req = new LLHTTPAssetRequest(this, req->getUUID(), req->getType(), tmp_url, mCurlMultiHandle); 786 LLHTTPAssetRequest *new_req = new LLHTTPAssetRequest(this, req->getUUID(),
583 new_req->mIsLocalUpload = TRUE; 787 req->getType(), RT_LOCALUPLOAD, tmp_url, mCurlMultiHandle);
584 new_req->mRequestingAgentID = req->mRequestingAgentID; 788 new_req->mRequestingAgentID = req->mRequestingAgentID;
585 789
586 // Sets pending upload flag internally 790 // Sets pending upload flag internally
@@ -591,13 +795,22 @@ void LLHTTPAssetStorage::checkForTimeouts()
591 curl_easy_setopt(new_req->mCurlHandle, CURLOPT_READFUNCTION, &curlUpCallback); 795 curl_easy_setopt(new_req->mCurlHandle, CURLOPT_READFUNCTION, &curlUpCallback);
592 curl_easy_setopt(new_req->mCurlHandle, CURLOPT_READDATA, new_req->mCurlHandle); 796 curl_easy_setopt(new_req->mCurlHandle, CURLOPT_READDATA, new_req->mCurlHandle);
593 797
594 curl_multi_add_handle(mCurlMultiHandle, new_req->mCurlHandle); 798 mcode = curl_multi_add_handle(mCurlMultiHandle, new_req->mCurlHandle);
595 llinfos << "TAT: LLHTTPAssetStorage::checkForTimeouts() : pending local!" 799 if (mcode > CURLM_OK)
596 << " Requesting PUT " << new_req->mURLBuffer << llendl; 800 {
801 // Failure. Deleting the pending request will remove it from the running
802 // queue, and push it to the end of the pending queue.
803 deletePendingRequest(RT_LOCALUPLOAD, req->getType(), req->getUUID());
804 break;
805 }
806 else
807 {
808 llinfos << "TAT: LLHTTPAssetStorage::checkForTimeouts() : pending local!"
809 << " Requesting PUT " << new_req->mURLBuffer << llendl;
810 }
597 // Pending upload will have been flagged by the request 811 // Pending upload will have been flagged by the request
598 } 812 }
599 S32 count = 0; 813 S32 count = 0;
600 CURLMcode mcode;
601 int queue_length; 814 int queue_length;
602 do 815 do
603 { 816 {
@@ -618,12 +831,15 @@ void LLHTTPAssetStorage::checkForTimeouts()
618 curl_easy_getinfo(curl_msg->easy_handle, CURLINFO_PRIVATE, &req); 831 curl_easy_getinfo(curl_msg->easy_handle, CURLINFO_PRIVATE, &req);
619 832
620 curl_easy_getinfo(curl_msg->easy_handle, CURLINFO_HTTP_CODE, &curl_result); 833 curl_easy_getinfo(curl_msg->easy_handle, CURLINFO_HTTP_CODE, &curl_result);
621 if (req->mIsUpload || req->mIsLocalUpload) 834 if (RT_UPLOAD == req->mRequestType || RT_LOCALUPLOAD == req->mRequestType)
622 { 835 {
623 if (curl_msg->data.result == CURLE_OK && (curl_result == HTTP_OK || curl_result == HTTP_PUT_OK || curl_result == HTTP_NO_CONTENT)) 836 if (curl_msg->data.result == CURLE_OK &&
837 ( curl_result == HTTP_OK
838 || curl_result == HTTP_PUT_OK
839 || curl_result == HTTP_NO_CONTENT))
624 { 840 {
625 llinfos << "Success uploading " << req->getUUID() << " to " << req->mURLBuffer << llendl; 841 llinfos << "Success uploading " << req->getUUID() << " to " << req->mURLBuffer << llendl;
626 if (req->mIsLocalUpload) 842 if (RT_LOCALUPLOAD == req->mRequestType)
627 { 843 {
628 addTempAssetData(req->getUUID(), req->mRequestingAgentID, mHostName); 844 addTempAssetData(req->getUUID(), req->mRequestingAgentID, mHostName);
629 } 845 }
@@ -655,7 +871,7 @@ void LLHTTPAssetStorage::checkForTimeouts()
655 // Pending upload flag will get cleared when the request is deleted 871 // Pending upload flag will get cleared when the request is deleted
656 } 872 }
657 } 873 }
658 else if (req->mIsDownload) 874 else if (RT_DOWNLOAD == req->mRequestType)
659 { 875 {
660 if (curl_result == HTTP_OK && curl_msg->data.result == CURLE_OK) 876 if (curl_result == HTTP_OK && curl_msg->data.result == CURLE_OK)
661 { 877 {
@@ -667,7 +883,7 @@ void LLHTTPAssetStorage::checkForTimeouts()
667 } 883 }
668 else 884 else
669 { 885 {
670 // TODO: if this actually indicates a bad asset on the server 886 // *TODO: if this actually indicates a bad asset on the server
671 // (not certain at this point), then delete it 887 // (not certain at this point), then delete it
672 llwarns << "Found " << req->mURLBuffer << " to be zero size" << llendl; 888 llwarns << "Found " << req->mURLBuffer << " to be zero size" << llendl;
673 xfer_result = LL_ERR_ASSET_REQUEST_NOT_IN_DATABASE; 889 xfer_result = LL_ERR_ASSET_REQUEST_NOT_IN_DATABASE;
@@ -793,9 +1009,8 @@ S32 LLHTTPAssetStorage::getURLToFile(const LLUUID& uuid, LLAssetType::EType asse
793 } 1009 }
794 1010
795 // make sure we use the normal curl setup, even though we don't really need a request object 1011 // make sure we use the normal curl setup, even though we don't really need a request object
796 LLHTTPAssetRequest req(this, uuid, asset_type, url.c_str(), mCurlMultiHandle); 1012 LLHTTPAssetRequest req(this, uuid, asset_type, RT_DOWNLOAD, url.c_str(), mCurlMultiHandle);
797 req.mFP = fp; 1013 req.mFP = fp;
798 req.mIsDownload = TRUE;
799 1014
800 req.setupCurlHandle(); 1015 req.setupCurlHandle();
801 curl_easy_setopt(req.mCurlHandle, CURLOPT_FOLLOWLOCATION, TRUE); 1016 curl_easy_setopt(req.mCurlHandle, CURLOPT_FOLLOWLOCATION, TRUE);
@@ -887,6 +1102,63 @@ size_t LLHTTPAssetStorage::curlFileDownCallback(void *data, size_t size, size_t
887 return fwrite(data, size, nmemb, req->mFP); 1102 return fwrite(data, size, nmemb, req->mFP);
888} 1103}
889 1104
1105LLAssetStorage::request_list_t* LLHTTPAssetStorage::getRunningList(LLAssetStorage::ERequestType rt)
1106{
1107 switch (rt)
1108 {
1109 case RT_DOWNLOAD:
1110 return &mRunningDownloads;
1111 case RT_UPLOAD:
1112 return &mRunningUploads;
1113 case RT_LOCALUPLOAD:
1114 return &mRunningLocalUploads;
1115 default:
1116 return NULL;
1117 }
1118}
1119
1120const LLAssetStorage::request_list_t* LLHTTPAssetStorage::getRunningList(LLAssetStorage::ERequestType rt) const
1121{
1122 switch (rt)
1123 {
1124 case RT_DOWNLOAD:
1125 return &mRunningDownloads;
1126 case RT_UPLOAD:
1127 return &mRunningUploads;
1128 case RT_LOCALUPLOAD:
1129 return &mRunningLocalUploads;
1130 default:
1131 return NULL;
1132 }
1133}
1134
1135
1136void LLHTTPAssetStorage::addRunningRequest(ERequestType rt, LLHTTPAssetRequest* request)
1137{
1138 request_list_t* requests = getRunningList(rt);
1139 if (requests)
1140 {
1141 requests->push_back(request);
1142 }
1143 else
1144 {
1145 llerrs << "LLHTTPAssetStorage::addRunningRequest - Request is not an upload OR download, this is bad!" << llendl;
1146 }
1147}
1148
1149void LLHTTPAssetStorage::removeRunningRequest(ERequestType rt, LLHTTPAssetRequest* request)
1150{
1151 request_list_t* requests = getRunningList(rt);
1152 if (requests)
1153 {
1154 requests->remove(request);
1155 }
1156 else
1157 {
1158 llerrs << "LLHTTPAssetStorage::removeRunningRequest - Destroyed request is not an upload OR download, this is bad!" << llendl;
1159 }
1160}
1161
890// virtual 1162// virtual
891void LLHTTPAssetStorage::addTempAssetData(const LLUUID& asset_id, const LLUUID& agent_id, const std::string& host_name) 1163void LLHTTPAssetStorage::addTempAssetData(const LLUUID& asset_id, const LLUUID& agent_id, const std::string& host_name)
892{ 1164{
diff --git a/linden/indra/llmessage/llhttpassetstorage.h b/linden/indra/llmessage/llhttpassetstorage.h
index d09e2ce..d98af45 100644
--- a/linden/indra/llmessage/llhttpassetstorage.h
+++ b/linden/indra/llmessage/llhttpassetstorage.h
@@ -32,6 +32,7 @@
32#include "curl/curl.h" 32#include "curl/curl.h"
33 33
34class LLVFile; 34class LLVFile;
35class LLHTTPAssetRequest;
35typedef void (*progress_callback)(void* userdata); 36typedef void (*progress_callback)(void* userdata);
36 37
37struct LLTempAssetData; 38struct LLTempAssetData;
@@ -75,11 +76,25 @@ public:
75 bool temp_file, 76 bool temp_file,
76 bool is_priority); 77 bool is_priority);
77 78
79 virtual LLSD getPendingDetails(ERequestType rt,
80 LLAssetType::EType asset_type,
81 const std::string& detail_prefix) const;
82
83 virtual LLSD getPendingRequest(ERequestType rt,
84 LLAssetType::EType asset_type,
85 const LLUUID& asset_id) const;
86
87 virtual bool deletePendingRequest(ERequestType rt,
88 LLAssetType::EType asset_type,
89 const LLUUID& asset_id);
90
78 // Hack. One off curl download an URL to a file. Probably should be elsewhere. 91 // Hack. One off curl download an URL to a file. Probably should be elsewhere.
79 // Only used by lldynamicstate. The API is broken, and should be replaced with 92 // Only used by lldynamicstate. The API is broken, and should be replaced with
80 // a generic HTTP file fetch - Doug 9/25/06 93 // a generic HTTP file fetch - Doug 9/25/06
81 S32 getURLToFile(const LLUUID& uuid, LLAssetType::EType asset_type, const LLString &url, const char *filename, progress_callback callback, void *userdata); 94 S32 getURLToFile(const LLUUID& uuid, LLAssetType::EType asset_type, const LLString &url, const char *filename, progress_callback callback, void *userdata);
82 95
96 LLAssetRequest* findNextRequest(request_list_t& pending, request_list_t& running);
97
83 void checkForTimeouts(); 98 void checkForTimeouts();
84 99
85 static size_t curlDownCallback(void *data, size_t size, size_t nmemb, void *user_data); 100 static size_t curlDownCallback(void *data, size_t size, size_t nmemb, void *user_data);
@@ -88,12 +103,11 @@ public:
88 static size_t nullOutputCallback(void *data, size_t size, size_t nmemb, void *user_data); 103 static size_t nullOutputCallback(void *data, size_t size, size_t nmemb, void *user_data);
89 104
90 // Should only be used by the LLHTTPAssetRequest 105 // Should only be used by the LLHTTPAssetRequest
91 void setPendingUpload() { mPendingUpload = TRUE; } 106 void addRunningRequest(ERequestType rt, LLHTTPAssetRequest* request);
92 void setPendingLocalUpload() { mPendingLocalUpload = TRUE; } 107 void removeRunningRequest(ERequestType rt, LLHTTPAssetRequest* request);
93 void setPendingDownload() { mPendingDownload = TRUE; } 108
94 void clearPendingUpload() { mPendingUpload = FALSE; } 109 request_list_t* getRunningList(ERequestType rt);
95 void clearPendingLocalUpload() { mPendingLocalUpload = FALSE; } 110 const request_list_t* getRunningList(ERequestType rt) const;
96 void clearPendingDownload() { mPendingDownload = FALSE; }
97 111
98 // Temp assets are stored on sim nodes, they have agent ID and location data associated with them. 112 // Temp assets are stored on sim nodes, they have agent ID and location data associated with them.
99 virtual void addTempAssetData(const LLUUID& asset_id, const LLUUID& agent_id, const std::string& host_name); 113 virtual void addTempAssetData(const LLUUID& asset_id, const LLUUID& agent_id, const std::string& host_name);
@@ -125,9 +139,9 @@ protected:
125 139
126 CURLM *mCurlMultiHandle; 140 CURLM *mCurlMultiHandle;
127 141
128 BOOL mPendingDownload; 142 request_list_t mRunningDownloads;
129 BOOL mPendingUpload; 143 request_list_t mRunningUploads;
130 BOOL mPendingLocalUpload; 144 request_list_t mRunningLocalUploads;
131 145
132 uuid_tempdata_map mTempAssets; 146 uuid_tempdata_map mTempAssets;
133}; 147};
diff --git a/linden/indra/llmessage/llhttpclient.cpp b/linden/indra/llmessage/llhttpclient.cpp
index d94918e..3755ae0 100644
--- a/linden/indra/llmessage/llhttpclient.cpp
+++ b/linden/indra/llmessage/llhttpclient.cpp
@@ -37,6 +37,8 @@
37#include "llvfile.h" 37#include "llvfile.h"
38#include "llvfs.h" 38#include "llvfs.h"
39 39
40#include <curl/curl.h>
41
40static const F32 HTTP_REQUEST_EXPIRY_SECS = 60.0f; 42static const F32 HTTP_REQUEST_EXPIRY_SECS = 60.0f;
41 43
42static std::string gCABundle; 44static std::string gCABundle;
@@ -148,6 +150,27 @@ namespace
148 150
149 const LLSD mSD; 151 const LLSD mSD;
150 }; 152 };
153
154 class RawInjector : public Injector
155 {
156 public:
157 RawInjector(const U8* data, S32 size) : mData(data), mSize(size) {}
158 virtual ~RawInjector() {}
159
160 const char* contentType() { return "application/octet-stream"; }
161
162 virtual EStatus process_impl(const LLChannelDescriptors& channels,
163 buffer_ptr_t& buffer, bool& eos, LLSD& context, LLPumpIO* pump)
164 {
165 LLBufferStream ostream(channels, buffer.get());
166 ostream.write((const char *)mData, mSize); // hopefully chars are always U8s
167 eos = true;
168 return STATUS_DONE;
169 }
170
171 const U8* mData;
172 S32 mSize;
173 };
151 174
152 class FileInjector : public Injector 175 class FileInjector : public Injector
153 { 176 {
@@ -243,6 +266,84 @@ void LLHTTPClient::get(const std::string& url, ResponderPtr responder)
243 request(url, LLURLRequest::HTTP_GET, NULL, responder); 266 request(url, LLURLRequest::HTTP_GET, NULL, responder);
244} 267}
245 268
269// A simple class for managing data returned from a curl http request.
270class LLHTTPBuffer
271{
272public:
273 LLHTTPBuffer() { }
274
275 static size_t curl_write( void *ptr, size_t size, size_t nmemb, void *user_data)
276 {
277 LLHTTPBuffer* self = (LLHTTPBuffer*)user_data;
278
279 size_t bytes = (size * nmemb);
280 self->mBuffer.append((char*)ptr,bytes);
281 return nmemb;
282 }
283
284 LLSD asLLSD()
285 {
286 LLSD content;
287
288 if (mBuffer.empty()) return content;
289
290 std::istringstream istr(mBuffer);
291 LLSDSerialize::fromXML(content, istr);
292 return content;
293 }
294
295 std::string asString()
296 {
297 return mBuffer;
298 }
299
300private:
301 std::string mBuffer;
302};
303
304// This call is blocking! This is probably usually bad. :(
305LLSD LLHTTPClient::blockingGet(const std::string& url)
306{
307 llinfos << "blockingGet of " << url << llendl;
308
309 // Returns an LLSD map: {status: integer, body: map}
310 char curl_error_buffer[CURL_ERROR_SIZE];
311 CURL* curlp = curl_easy_init();
312
313 LLHTTPBuffer http_buffer;
314
315 curl_easy_setopt(curlp, CURLOPT_WRITEFUNCTION, LLHTTPBuffer::curl_write);
316 curl_easy_setopt(curlp, CURLOPT_WRITEDATA, &http_buffer);
317 curl_easy_setopt(curlp, CURLOPT_URL, url.c_str());
318 curl_easy_setopt(curlp, CURLOPT_ERRORBUFFER, curl_error_buffer);
319 curl_easy_setopt(curlp, CURLOPT_FAILONERROR, 1);
320
321 LLSD response = LLSD::emptyMap();
322
323 S32 curl_success = curl_easy_perform(curlp);
324
325 S32 http_status = 499;
326 curl_easy_getinfo(curlp,CURLINFO_RESPONSE_CODE, &http_status);
327
328 response["status"] = http_status;
329
330 if (curl_success != 0
331 && http_status != 404) // We expect 404s, don't spam for them.
332 {
333 llwarns << "CURL ERROR: " << curl_error_buffer << llendl;
334
335 response["body"] = http_buffer.asString();
336 }
337 else
338 {
339 response["body"] = http_buffer.asLLSD();
340 }
341
342 curl_easy_cleanup(curlp);
343
344 return response;
345}
346
246void LLHTTPClient::put(const std::string& url, const LLSD& body, ResponderPtr responder) 347void LLHTTPClient::put(const std::string& url, const LLSD& body, ResponderPtr responder)
247{ 348{
248 request(url, LLURLRequest::HTTP_PUT, new LLSDInjector(body), responder); 349 request(url, LLURLRequest::HTTP_PUT, new LLSDInjector(body), responder);
@@ -253,6 +354,11 @@ void LLHTTPClient::post(const std::string& url, const LLSD& body, ResponderPtr r
253 request(url, LLURLRequest::HTTP_POST, new LLSDInjector(body), responder); 354 request(url, LLURLRequest::HTTP_POST, new LLSDInjector(body), responder);
254} 355}
255 356
357void LLHTTPClient::post(const std::string& url, const U8* data, S32 size, ResponderPtr responder)
358{
359 request(url, LLURLRequest::HTTP_POST, new RawInjector(data, size), responder);
360}
361
256void LLHTTPClient::del(const std::string& url, ResponderPtr responder) 362void LLHTTPClient::del(const std::string& url, ResponderPtr responder)
257{ 363{
258 request(url, LLURLRequest::HTTP_DELETE, NULL, responder); 364 request(url, LLURLRequest::HTTP_DELETE, NULL, responder);
@@ -301,4 +407,3 @@ namespace boost
301 } 407 }
302 } 408 }
303}; 409};
304
diff --git a/linden/indra/llmessage/llhttpclient.h b/linden/indra/llmessage/llhttpclient.h
index d48d084..93859eb 100644
--- a/linden/indra/llmessage/llhttpclient.h
+++ b/linden/indra/llmessage/llhttpclient.h
@@ -73,10 +73,14 @@ public:
73 static void put(const std::string& url, const LLSD& body, ResponderPtr); 73 static void put(const std::string& url, const LLSD& body, ResponderPtr);
74 ///< non-blocking 74 ///< non-blocking
75 static void post(const std::string& url, const LLSD& body, ResponderPtr); 75 static void post(const std::string& url, const LLSD& body, ResponderPtr);
76 static void post(const std::string& url, const U8* data, S32 size, ResponderPtr responder);
76 static void postFile(const std::string& url, const std::string& filename, ResponderPtr); 77 static void postFile(const std::string& url, const std::string& filename, ResponderPtr);
77 static void postFile(const std::string& url, const LLUUID& uuid, 78 static void postFile(const std::string& url, const LLUUID& uuid,
78 LLAssetType::EType asset_type, ResponderPtr responder); 79 LLAssetType::EType asset_type, ResponderPtr responder);
79 80
81 // Blocking HTTP get that returns an LLSD map of status and body.
82 static LLSD blockingGet(const std::string& url);
83
80 static void del(const std::string& url, ResponderPtr); 84 static void del(const std::string& url, ResponderPtr);
81 ///< sends a DELETE method, but we can't call it delete in c++ 85 ///< sends a DELETE method, but we can't call it delete in c++
82 86
diff --git a/linden/indra/llmessage/llinstantmessage.cpp b/linden/indra/llmessage/llinstantmessage.cpp
index f1f4514..6f6e022 100644
--- a/linden/indra/llmessage/llinstantmessage.cpp
+++ b/linden/indra/llmessage/llinstantmessage.cpp
@@ -226,8 +226,8 @@ void pack_instant_message_block(
226 S32 bytes_left = MTUBYTES; 226 S32 bytes_left = MTUBYTES;
227 if(message) 227 if(message)
228 { 228 {
229 char buffer[MTUBYTES]; 229 char buffer[MTUBYTES]; /*Flawfinder: ignore*/
230 bytes_left -= snprintf(buffer, MTUBYTES, "%s", message); 230 bytes_left -= snprintf(buffer, MTUBYTES, "%s", message); /*Flawfinder: ignore*/
231 bytes_left = llmax(0, bytes_left); 231 bytes_left = llmax(0, bytes_left);
232 msg->addStringFast(_PREHASH_Message, buffer); 232 msg->addStringFast(_PREHASH_Message, buffer);
233 } 233 }
@@ -263,11 +263,11 @@ void LLIMInfo::unpackMessageBlock(LLMessageSystem* msg)
263 mIMType = (EInstantMessage) dialog; 263 mIMType = (EInstantMessage) dialog;
264 msg->getUUIDFast(_PREHASH_MessageBlock, _PREHASH_ID, mID); 264 msg->getUUIDFast(_PREHASH_MessageBlock, _PREHASH_ID, mID);
265 msg->getU32Fast(_PREHASH_MessageBlock, _PREHASH_Timestamp, mTimeStamp); 265 msg->getU32Fast(_PREHASH_MessageBlock, _PREHASH_Timestamp, mTimeStamp);
266 char name[DB_FULL_NAME_BUF_SIZE]; 266 char name[DB_FULL_NAME_BUF_SIZE]; /*Flawfinder: ignore*/
267 msg->getStringFast(_PREHASH_MessageBlock, _PREHASH_FromAgentName, DB_FULL_NAME_BUF_SIZE, name); 267 msg->getStringFast(_PREHASH_MessageBlock, _PREHASH_FromAgentName, DB_FULL_NAME_BUF_SIZE, name);
268 mName.assign(name); 268 mName.assign(name);
269 269
270 char message[DB_IM_MSG_BUF_SIZE]; 270 char message[DB_IM_MSG_BUF_SIZE]; /*Flawfinder: ignore*/
271 msg->getStringFast(_PREHASH_MessageBlock, _PREHASH_Message, DB_IM_MSG_BUF_SIZE, message); 271 msg->getStringFast(_PREHASH_MessageBlock, _PREHASH_Message, DB_IM_MSG_BUF_SIZE, message);
272 mMessage.assign(message); 272 mMessage.assign(message);
273 273
diff --git a/linden/indra/llmessage/llmail.cpp b/linden/indra/llmessage/llmail.cpp
index e84d097..aea3689 100644
--- a/linden/indra/llmessage/llmail.cpp
+++ b/linden/indra/llmessage/llmail.cpp
@@ -27,6 +27,8 @@
27 27
28#include "linden_common.h" 28#include "linden_common.h"
29 29
30#include "llmail.h"
31
30// APR on Windows needs full windows headers 32// APR on Windows needs full windows headers
31#ifdef LL_WINDOWS 33#ifdef LL_WINDOWS
32# undef WIN32_LEAN_AND_MEAN 34# undef WIN32_LEAN_AND_MEAN
@@ -38,14 +40,16 @@
38#include <sstream> 40#include <sstream>
39#include <boost/regex.hpp> 41#include <boost/regex.hpp>
40 42
41#include "llmail.h"
42
43#include "apr-1/apr_pools.h" 43#include "apr-1/apr_pools.h"
44#include "apr-1/apr_network_io.h" 44#include "apr-1/apr_network_io.h"
45 45
46#include "llapr.h" 46#include "llapr.h"
47#include "llbase32.h" // IM-to-email address
48#include "llblowfishcipher.h"
47#include "llerror.h" 49#include "llerror.h"
48#include "llhost.h" 50#include "llhost.h"
51#include "llstring.h"
52#include "lluuid.h"
49#include "net.h" 53#include "net.h"
50 54
51// 55//
@@ -105,11 +109,12 @@ void disconnect_smtp()
105 109
106// Returns TRUE on success. 110// Returns TRUE on success.
107// message should NOT be SMTP escaped. 111// message should NOT be SMTP escaped.
108BOOL send_mail(const char* from_name, const char* from_address, 112// static
113BOOL LLMail::send(const char* from_name, const char* from_address,
109 const char* to_name, const char* to_address, 114 const char* to_name, const char* to_address,
110 const char* subject, const char* message) 115 const char* subject, const char* message)
111{ 116{
112 std::string header = build_smtp_transaction( 117 std::string header = buildSMTPTransaction(
113 from_name, 118 from_name,
114 from_address, 119 from_address,
115 to_name, 120 to_name,
@@ -125,12 +130,13 @@ BOOL send_mail(const char* from_name, const char* from_address,
125 { 130 {
126 message_str = message; 131 message_str = message;
127 } 132 }
128 bool rv = send_mail(header, message_str, to_address, from_address); 133 bool rv = send(header, message_str, to_address, from_address);
129 if(rv) return TRUE; 134 if(rv) return TRUE;
130 return FALSE; 135 return FALSE;
131} 136}
132 137
133void init_mail(const std::string& hostname, apr_pool_t* pool) 138// static
139void LLMail::init(const std::string& hostname, apr_pool_t* pool)
134{ 140{
135 gMailSocket = NULL; 141 gMailSocket = NULL;
136 if(hostname.empty() || !pool) 142 if(hostname.empty() || !pool)
@@ -157,12 +163,14 @@ void init_mail(const std::string& hostname, apr_pool_t* pool)
157 } 163 }
158} 164}
159 165
160void enable_mail(bool mail_enabled) 166// static
167void LLMail::enable(bool mail_enabled)
161{ 168{
162 gMailEnabled = mail_enabled; 169 gMailEnabled = mail_enabled;
163} 170}
164 171
165std::string build_smtp_transaction( 172// static
173std::string LLMail::buildSMTPTransaction(
166 const char* from_name, 174 const char* from_name,
167 const char* from_address, 175 const char* from_address,
168 const char* to_name, 176 const char* to_name,
@@ -216,7 +224,8 @@ std::string build_smtp_transaction(
216 return header.str(); 224 return header.str();
217} 225}
218 226
219bool send_mail( 227// static
228bool LLMail::send(
220 const std::string& header, 229 const std::string& header,
221 const std::string& message, 230 const std::string& message,
222 const char* from_address, 231 const char* from_address,
@@ -309,3 +318,40 @@ bool send_mail(
309#endif 318#endif
310 return true; 319 return true;
311} 320}
321
322
323// static
324std::string LLMail::encryptIMEmailAddress(const LLUUID& from_agent_id,
325 const LLUUID& to_agent_id,
326 U32 time,
327 const U8* secret,
328 size_t secret_size)
329{
330#if LL_WINDOWS
331 return "blowfish-not-supported-on-windows";
332#else
333 size_t data_size = 4 + UUID_BYTES + UUID_BYTES;
334 // Convert input data into a binary blob
335 std::vector<U8> data;
336 data.resize(data_size);
337 // *NOTE: This may suffer from endian issues. Could be htonmemcpy.
338 memcpy(&data[0], &time, 4);
339 memcpy(&data[4], &from_agent_id.mData[0], UUID_BYTES);
340 memcpy(&data[4 + UUID_BYTES], &to_agent_id.mData[0], UUID_BYTES);
341
342 // Encrypt the blob
343 LLBlowfishCipher cipher(secret, secret_size);
344 size_t encrypted_size = cipher.requiredEncryptionSpace(data.size());
345 U8* encrypted = new U8[encrypted_size];
346 cipher.encrypt(&data[0], data_size, encrypted, encrypted_size);
347
348 std::string address = LLBase32::encode(encrypted, encrypted_size);
349
350 // Make it more pretty for humans.
351 LLString::toLower(address);
352
353 delete [] encrypted;
354
355 return address;
356#endif
357}
diff --git a/linden/indra/llmessage/llmail.h b/linden/indra/llmessage/llmail.h
index 82c272f..b1dc3b5 100644
--- a/linden/indra/llmessage/llmail.h
+++ b/linden/indra/llmessage/llmail.h
@@ -30,55 +30,84 @@
30 30
31typedef struct apr_pool_t apr_pool_t; 31typedef struct apr_pool_t apr_pool_t;
32 32
33// if hostname is NULL, then the host is resolved as 'mail' 33class LLUUID;
34void init_mail(const std::string& hostname, apr_pool_t* pool);
35 34
36// Allow all email transmission to be disabled/enabled. 35class LLMail
37void enable_mail(bool mail_enabled); 36{
37public:
38 // if hostname is NULL, then the host is resolved as 'mail'
39 static void init(const std::string& hostname, apr_pool_t* pool);
38 40
39// returns TRUE if the call succeeds, FALSE otherwise. 41 // Allow all email transmission to be disabled/enabled.
40// 42 static void enable(bool mail_enabled);
41// Results in:
42// From: "from_name" <from_address>
43// To: "to_name" <to_address>
44// Subject: subject
45// message
46BOOL send_mail(const char* from_name, const char* from_address,
47 const char* to_name, const char* to_address,
48 const char* subject, const char* message);
49 43
50/** 44 // returns TRUE if the call succeeds, FALSE otherwise.
51 * @brief build the complete smtp transaction & header for use in an 45 //
52 * mail. 46 // Results in:
53 * 47 // From: "from_name" <from_address>
54 * @param from_name The name of the email sender 48 // To: "to_name" <to_address>
55 * @param from_address The email address for the sender 49 // Subject: subject
56 * @param to_name The name of the email recipient 50 // message
57 * @param to_name The email recipient address 51 static BOOL send(const char* from_name, const char* from_address,
58 * @param subject The subject of the email 52 const char* to_name, const char* to_address,
59 * @return Returns the complete SMTP transaction mail header. 53 const char* subject, const char* message);
60 */
61std::string build_smtp_transaction(
62 const char* from_name,
63 const char* from_address,
64 const char* to_name,
65 const char* to_address,
66 const char* subject);
67 54
68/** 55 /**
69 * @brief send an email with header and body. 56 * @brief build the complete smtp transaction & header for use in an
70 * 57 * mail.
71 * @param header The email header. Use build_mail_header(). 58 *
72 * @param message The unescaped email message. 59 * @param from_name The name of the email sender
73 * @param from_address Used for debugging 60 * @param from_address The email address for the sender
74 * @param to_address Used for debugging 61 * @param to_name The name of the email recipient
75 * @return Returns true if the message could be sent. 62 * @param to_name The email recipient address
76 */ 63 * @param subject The subject of the email
77bool send_mail( 64 * @return Returns the complete SMTP transaction mail header.
78 const std::string& header, 65 */
79 const std::string& message, 66 static std::string buildSMTPTransaction(
80 const char* from_address, 67 const char* from_name,
81 const char* to_address); 68 const char* from_address,
69 const char* to_name,
70 const char* to_address,
71 const char* subject);
72
73 /**
74 * @brief send an email with header and body.
75 *
76 * @param header The email header. Use build_mail_header().
77 * @param message The unescaped email message.
78 * @param from_address Used for debugging
79 * @param to_address Used for debugging
80 * @return Returns true if the message could be sent.
81 */
82 static bool send(
83 const std::string& header,
84 const std::string& message,
85 const char* from_address,
86 const char* to_address);
87
88 // IM-to-email sessions use a "session id" based on an encrypted
89 // combination of from agent_id, to agent_id, and timestamp. When
90 // a user replies to an email we use the from_id to determine the
91 // sender's name and the to_id to route the message. The address
92 // is encrypted to prevent users from building addresses to spoof
93 // IMs from other users. The timestamps allow the "sessions" to
94 // expire, in case one of the sessions is stolen/hijacked.
95 //
96 // indra/tools/mailglue is responsible for parsing the inbound mail.
97 //
98 // secret: binary blob passed to blowfish, max length 56 bytes
99 // secret_size: length of blob, in bytes
100 //
101 // Returns: "base64" encoded email local-part, with _ and - as the
102 // non-alphanumeric characters. This allows better compatibility
103 // with email systems than the default / and + extra chars. JC
104 static std::string encryptIMEmailAddress(
105 const LLUUID& from_agent_id,
106 const LLUUID& to_agent_id,
107 U32 time,
108 const U8* secret,
109 size_t secret_size);
110};
82 111
83extern const size_t LL_MAX_KNOWN_GOOD_MAIL_SIZE; 112extern const size_t LL_MAX_KNOWN_GOOD_MAIL_SIZE;
84 113
diff --git a/linden/indra/llmessage/llmessage.vcproj b/linden/indra/llmessage/llmessage.vcproj
index 3043ee5..11f4dbf 100644
--- a/linden/indra/llmessage/llmessage.vcproj
+++ b/linden/indra/llmessage/llmessage.vcproj
@@ -153,6 +153,9 @@
153 RelativePath=".\llassetstorage.cpp"> 153 RelativePath=".\llassetstorage.cpp">
154 </File> 154 </File>
155 <File 155 <File
156 RelativePath=".\llblowfishcipher.cpp">
157 </File>
158 <File
156 RelativePath=".\llbuffer.cpp"> 159 RelativePath=".\llbuffer.cpp">
157 </File> 160 </File>
158 <File 161 <File
@@ -171,6 +174,9 @@
171 RelativePath=".\llclassifiedflags.cpp"> 174 RelativePath=".\llclassifiedflags.cpp">
172 </File> 175 </File>
173 <File 176 <File
177 RelativePath=".\llcurl.cpp">
178 </File>
179 <File
174 RelativePath=".\lldatapacker.cpp"> 180 RelativePath=".\lldatapacker.cpp">
175 </File> 181 </File>
176 <File 182 <File
@@ -344,6 +350,9 @@
344 RelativePath=".\llassetstorage.h"> 350 RelativePath=".\llassetstorage.h">
345 </File> 351 </File>
346 <File 352 <File
353 RelativePath=".\llblowfishcipher.h">
354 </File>
355 <File
347 RelativePath=".\llbuffer.h"> 356 RelativePath=".\llbuffer.h">
348 </File> 357 </File>
349 <File 358 <File
@@ -362,6 +371,9 @@
362 RelativePath=".\llchainio.h"> 371 RelativePath=".\llchainio.h">
363 </File> 372 </File>
364 <File 373 <File
374 RelativePath=".\llcipher.h">
375 </File>
376 <File
365 RelativePath=".\llcircuit.h"> 377 RelativePath=".\llcircuit.h">
366 </File> 378 </File>
367 <File 379 <File
@@ -371,7 +383,7 @@
371 RelativePath=".\llcoordframe.h"> 383 RelativePath=".\llcoordframe.h">
372 </File> 384 </File>
373 <File 385 <File
374 RelativePath=".\llcrypto.h"> 386 RelativePath=".\llcurl.h">
375 </File> 387 </File>
376 <File 388 <File
377 RelativePath=".\lldatapacker.h"> 389 RelativePath=".\lldatapacker.h">
@@ -440,6 +452,9 @@
440 RelativePath=".\llnamevalue.h"> 452 RelativePath=".\llnamevalue.h">
441 </File> 453 </File>
442 <File 454 <File
455 RelativePath=".\llnullcipher.h">
456 </File>
457 <File
443 RelativePath=".\llpacketack.h"> 458 RelativePath=".\llpacketack.h">
444 </File> 459 </File>
445 <File 460 <File
@@ -530,6 +545,9 @@
530 RelativePath=".\llxfermanager.h"> 545 RelativePath=".\llxfermanager.h">
531 </File> 546 </File>
532 <File 547 <File
548 RelativePath=".\llxorcipher.h">
549 </File>
550 <File
533 RelativePath=".\machine.h"> 551 RelativePath=".\machine.h">
534 </File> 552 </File>
535 <File 553 <File
diff --git a/linden/indra/llmessage/llmessage_vc8.vcproj b/linden/indra/llmessage/llmessage_vc8.vcproj
new file mode 100644
index 0000000..ac32525
--- /dev/null
+++ b/linden/indra/llmessage/llmessage_vc8.vcproj
@@ -0,0 +1,843 @@
1<?xml version="1.0" encoding="Windows-1252"?>
2<VisualStudioProject
3 ProjectType="Visual C++"
4 Version="8.00"
5 Name="llmessage"
6 ProjectGUID="{E5D94794-5671-4BD6-A16D-26EC18F3DB34}"
7 RootNamespace="llmessage"
8 Keyword="Win32Proj"
9 >
10 <Platforms>
11 <Platform
12 Name="Win32"
13 />
14 </Platforms>
15 <ToolFiles>
16 </ToolFiles>
17 <Configurations>
18 <Configuration
19 Name="Debug|Win32"
20 OutputDirectory="../lib_$(ConfigurationName)/i686-win32"
21 IntermediateDirectory="Debug"
22 ConfigurationType="4"
23 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
24 CharacterSet="1"
25 >
26 <Tool
27 Name="VCPreBuildEventTool"
28 />
29 <Tool
30 Name="VCCustomBuildTool"
31 />
32 <Tool
33 Name="VCXMLDataGeneratorTool"
34 />
35 <Tool
36 Name="VCWebServiceProxyGeneratorTool"
37 />
38 <Tool
39 Name="VCMIDLTool"
40 />
41 <Tool
42 Name="VCCLCompilerTool"
43 Optimization="0"
44 AdditionalIncludeDirectories="..\llcommon;..\llmath;..\llvfs;..\..\libraries\i686-win32\include;..\..\libraries\include\"
45 PreprocessorDefinitions="WIN32;_DEBUG;_LIB;LL_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;LL_DEBUG"
46 MinimalRebuild="true"
47 BasicRuntimeChecks="3"
48 RuntimeLibrary="1"
49 StructMemberAlignment="4"
50 TreatWChar_tAsBuiltInType="false"
51 ForceConformanceInForLoopScope="true"
52 UsePrecompiledHeader="0"
53 WarningLevel="3"
54 WarnAsError="true"
55 Detect64BitPortabilityProblems="false"
56 DebugInformationFormat="4"
57 />
58 <Tool
59 Name="VCManagedResourceCompilerTool"
60 />
61 <Tool
62 Name="VCResourceCompilerTool"
63 />
64 <Tool
65 Name="VCPreLinkEventTool"
66 />
67 <Tool
68 Name="VCLibrarianTool"
69 OutputFile="$(OutDir)/llmessage.lib"
70 />
71 <Tool
72 Name="VCALinkTool"
73 />
74 <Tool
75 Name="VCXDCMakeTool"
76 />
77 <Tool
78 Name="VCBscMakeTool"
79 />
80 <Tool
81 Name="VCFxCopTool"
82 />
83 <Tool
84 Name="VCPostBuildEventTool"
85 />
86 </Configuration>
87 <Configuration
88 Name="Release|Win32"
89 OutputDirectory="../lib_$(ConfigurationName)/i686-win32"
90 IntermediateDirectory="Release"
91 ConfigurationType="4"
92 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
93 CharacterSet="1"
94 >
95 <Tool
96 Name="VCPreBuildEventTool"
97 />
98 <Tool
99 Name="VCCustomBuildTool"
100 />
101 <Tool
102 Name="VCXMLDataGeneratorTool"
103 />
104 <Tool
105 Name="VCWebServiceProxyGeneratorTool"
106 />
107 <Tool
108 Name="VCMIDLTool"
109 />
110 <Tool
111 Name="VCCLCompilerTool"
112 AdditionalIncludeDirectories="..\llcommon;..\llmath;..\llvfs;..\..\libraries\i686-win32\include;..\..\libraries\include\"
113 PreprocessorDefinitions="WIN32;NDEBUG;_LIB;LL_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;LL_RELEASE"
114 RuntimeLibrary="0"
115 StructMemberAlignment="0"
116 TreatWChar_tAsBuiltInType="false"
117 ForceConformanceInForLoopScope="true"
118 UsePrecompiledHeader="0"
119 WarningLevel="3"
120 WarnAsError="true"
121 Detect64BitPortabilityProblems="false"
122 DebugInformationFormat="3"
123 />
124 <Tool
125 Name="VCManagedResourceCompilerTool"
126 />
127 <Tool
128 Name="VCResourceCompilerTool"
129 />
130 <Tool
131 Name="VCPreLinkEventTool"
132 />
133 <Tool
134 Name="VCLibrarianTool"
135 OutputFile="$(OutDir)/llmessage.lib"
136 />
137 <Tool
138 Name="VCALinkTool"
139 />
140 <Tool
141 Name="VCXDCMakeTool"
142 />
143 <Tool
144 Name="VCBscMakeTool"
145 />
146 <Tool
147 Name="VCFxCopTool"
148 />
149 <Tool
150 Name="VCPostBuildEventTool"
151 />
152 </Configuration>
153 <Configuration
154 Name="ReleaseNoOpt|Win32"
155 OutputDirectory="../lib_$(ConfigurationName)/i686-win32"
156 IntermediateDirectory="$(ConfigurationName)"
157 ConfigurationType="4"
158 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
159 CharacterSet="1"
160 >
161 <Tool
162 Name="VCPreBuildEventTool"
163 />
164 <Tool
165 Name="VCCustomBuildTool"
166 />
167 <Tool
168 Name="VCXMLDataGeneratorTool"
169 />
170 <Tool
171 Name="VCWebServiceProxyGeneratorTool"
172 />
173 <Tool
174 Name="VCMIDLTool"
175 />
176 <Tool
177 Name="VCCLCompilerTool"
178 Optimization="0"
179 AdditionalIncludeDirectories="..\llcommon;..\llmath;..\llvfs;..\..\libraries\i686-win32\include;..\..\libraries\include\"
180 PreprocessorDefinitions="WIN32;NDEBUG;_LIB;LL_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;LL_RELEASE"
181 RuntimeLibrary="0"
182 StructMemberAlignment="0"
183 TreatWChar_tAsBuiltInType="false"
184 ForceConformanceInForLoopScope="true"
185 UsePrecompiledHeader="0"
186 WarningLevel="3"
187 WarnAsError="true"
188 Detect64BitPortabilityProblems="false"
189 DebugInformationFormat="3"
190 />
191 <Tool
192 Name="VCManagedResourceCompilerTool"
193 />
194 <Tool
195 Name="VCResourceCompilerTool"
196 />
197 <Tool
198 Name="VCPreLinkEventTool"
199 />
200 <Tool
201 Name="VCLibrarianTool"
202 OutputFile="$(OutDir)/llmessage.lib"
203 />
204 <Tool
205 Name="VCALinkTool"
206 />
207 <Tool
208 Name="VCXDCMakeTool"
209 />
210 <Tool
211 Name="VCBscMakeTool"
212 />
213 <Tool
214 Name="VCFxCopTool"
215 />
216 <Tool
217 Name="VCPostBuildEventTool"
218 />
219 </Configuration>
220 </Configurations>
221 <References>
222 </References>
223 <Files>
224 <Filter
225 Name="Source Files"
226 Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
227 UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
228 >
229 <File
230 RelativePath=".\llassetstorage.cpp"
231 >
232 </File>
233 <File
234 RelativePath=".\llblowfishcipher.cpp"
235 >
236 </File>
237 <File
238 RelativePath=".\llbuffer.cpp"
239 >
240 </File>
241 <File
242 RelativePath=".\llbufferstream.cpp"
243 >
244 </File>
245 <File
246 RelativePath=".\llcachename.cpp"
247 >
248 </File>
249 <File
250 RelativePath=".\llchainio.cpp"
251 >
252 </File>
253 <File
254 RelativePath=".\llcircuit.cpp"
255 >
256 </File>
257 <File
258 RelativePath=".\llclassifiedflags.cpp"
259 >
260 </File>
261 <File
262 RelativePath=".\llcurl.cpp"
263 >
264 </File>
265 <File
266 RelativePath=".\lldatapacker.cpp"
267 >
268 </File>
269 <File
270 RelativePath=".\lldispatcher.cpp"
271 >
272 </File>
273 <File
274 RelativePath=".\llfiltersd2xmlrpc.cpp"
275 >
276 </File>
277 <File
278 RelativePath=".\llhost.cpp"
279 >
280 </File>
281 <File
282 RelativePath=".\llhttpassetstorage.cpp"
283 >
284 </File>
285 <File
286 RelativePath=".\llhttpassetstorage.h"
287 >
288 </File>
289 <File
290 RelativePath=".\llhttpclient.cpp"
291 >
292 </File>
293 <File
294 RelativePath=".\llhttpnode.cpp"
295 >
296 </File>
297 <File
298 RelativePath=".\llinstantmessage.cpp"
299 >
300 </File>
301 <File
302 RelativePath=".\lliobuffer.cpp"
303 >
304 </File>
305 <File
306 RelativePath=".\lliohttpserver.cpp"
307 >
308 </File>
309 <File
310 RelativePath=".\lliopipe.cpp"
311 >
312 </File>
313 <File
314 RelativePath=".\lliosocket.cpp"
315 >
316 </File>
317 <File
318 RelativePath=".\llioutil.cpp"
319 >
320 </File>
321 <File
322 RelativePath=".\lllogtextmessage.cpp"
323 >
324 </File>
325 <File
326 RelativePath=".\llmail.cpp"
327 >
328 </File>
329 <File
330 RelativePath=".\llmessagethrottle.cpp"
331 >
332 </File>
333 <File
334 RelativePath=".\llmime.cpp"
335 >
336 </File>
337 <File
338 RelativePath=".\llnamevalue.cpp"
339 >
340 </File>
341 <File
342 RelativePath=".\llnullcipher.cpp"
343 >
344 </File>
345 <File
346 RelativePath=".\llpacketbuffer.cpp"
347 >
348 </File>
349 <File
350 RelativePath=".\llpacketring.cpp"
351 >
352 </File>
353 <File
354 RelativePath=".\llpartdata.cpp"
355 >
356 </File>
357 <File
358 RelativePath=".\llpumpio.cpp"
359 >
360 </File>
361 <File
362 RelativePath=".\llsdappservices.cpp"
363 >
364 </File>
365 <File
366 RelativePath=".\llsdhttpserver.cpp"
367 >
368 </File>
369 <File
370 RelativePath=".\llsdmessagesystem.cpp"
371 >
372 </File>
373 <File
374 RelativePath=".\llsdrpcclient.cpp"
375 >
376 </File>
377 <File
378 RelativePath=".\llsdrpcserver.cpp"
379 >
380 </File>
381 <File
382 RelativePath=".\llservice.cpp"
383 >
384 </File>
385 <File
386 RelativePath=".\llthrottle.cpp"
387 >
388 </File>
389 <File
390 RelativePath=".\lltransfermanager.cpp"
391 >
392 </File>
393 <File
394 RelativePath=".\lltransfersourceasset.cpp"
395 >
396 </File>
397 <File
398 RelativePath=".\lltransfersourcefile.cpp"
399 >
400 </File>
401 <File
402 RelativePath=".\lltransfertargetfile.cpp"
403 >
404 </File>
405 <File
406 RelativePath=".\lltransfertargetvfile.cpp"
407 >
408 </File>
409 <File
410 RelativePath=".\llurlrequest.cpp"
411 >
412 </File>
413 <File
414 RelativePath=".\lluseroperation.cpp"
415 >
416 </File>
417 <File
418 RelativePath=".\llxfer.cpp"
419 >
420 </File>
421 <File
422 RelativePath=".\llxfer_file.cpp"
423 >
424 </File>
425 <File
426 RelativePath=".\llxfer_mem.cpp"
427 >
428 </File>
429 <File
430 RelativePath=".\llxfer_vfile.cpp"
431 >
432 </File>
433 <File
434 RelativePath=".\llxfermanager.cpp"
435 >
436 </File>
437 <File
438 RelativePath=".\llxorcipher.cpp"
439 >
440 </File>
441 <File
442 RelativePath=".\message.cpp"
443 >
444 </File>
445 <File
446 RelativePath=".\message_prehash.cpp"
447 >
448 </File>
449 <File
450 RelativePath=".\message_string_table.cpp"
451 >
452 </File>
453 <File
454 RelativePath=".\net.cpp"
455 >
456 </File>
457 <File
458 RelativePath=".\network.cpp"
459 >
460 </File>
461 <File
462 RelativePath=".\partsyspacket.cpp"
463 >
464 </File>
465 <File
466 RelativePath=".\patch_code.cpp"
467 >
468 </File>
469 <File
470 RelativePath=".\patch_dct.cpp"
471 >
472 </File>
473 <File
474 RelativePath=".\patch_idct.cpp"
475 >
476 </File>
477 </Filter>
478 <Filter
479 Name="Header Files"
480 Filter="h;hpp;hxx;hm;inl;inc;xsd"
481 UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
482 >
483 <File
484 RelativePath=".\camera.h"
485 >
486 </File>
487 <File
488 RelativePath=".\coordframe.h"
489 >
490 </File>
491 <File
492 RelativePath=".\llassetstorage.h"
493 >
494 </File>
495 <File
496 RelativePath=".\llblowfishcipher.h"
497 >
498 </File>
499 <File
500 RelativePath=".\llbuffer.h"
501 >
502 </File>
503 <File
504 RelativePath=".\llbufferstream.h"
505 >
506 </File>
507 <File
508 RelativePath=".\llcachename.h"
509 >
510 </File>
511 <File
512 RelativePath=".\llcallbacklisth.h"
513 >
514 </File>
515 <File
516 RelativePath=".\llcamera.h"
517 >
518 </File>
519 <File
520 RelativePath=".\llchainio.h"
521 >
522 </File>
523 <File
524 RelativePath=".\llcipher.h"
525 >
526 </File>
527 <File
528 RelativePath=".\llcircuit.h"
529 >
530 </File>
531 <File
532 RelativePath=".\llclassifiedflags.h"
533 >
534 </File>
535 <File
536 RelativePath=".\llcoordframe.h"
537 >
538 </File>
539 <File
540 RelativePath=".\llcurl.h"
541 >
542 </File>
543 <File
544 RelativePath=".\lldatapacker.h"
545 >
546 </File>
547 <File
548 RelativePath=".\lldbstrings.h"
549 >
550 </File>
551 <File
552 RelativePath=".\lldispatcher.h"
553 >
554 </File>
555 <File
556 RelativePath=".\lleventflags.h"
557 >
558 </File>
559 <File
560 RelativePath=".\llfiltersd2xmlrpc.h"
561 >
562 </File>
563 <File
564 RelativePath=".\llfollowcamparams.h"
565 >
566 </File>
567 <File
568 RelativePath=".\llhost.h"
569 >
570 </File>
571 <File
572 RelativePath=".\llhttpclient.h"
573 >
574 </File>
575 <File
576 RelativePath=".\llinstantmessage.h"
577 >
578 </File>
579 <File
580 RelativePath=".\llinvite.h"
581 >
582 </File>
583 <File
584 RelativePath=".\lliobuffer.h"
585 >
586 </File>
587 <File
588 RelativePath=".\lliohttpserver.h"
589 >
590 </File>
591 <File
592 RelativePath=".\lliopipe.h"
593 >
594 </File>
595 <File
596 RelativePath=".\lliosocket.h"
597 >
598 </File>
599 <File
600 RelativePath=".\llioutil.h"
601 >
602 </File>
603 <File
604 RelativePath=".\llloginflags.h"
605 >
606 </File>
607 <File
608 RelativePath=".\lllogtextmessage.h"
609 >
610 </File>
611 <File
612 RelativePath=".\lllsltransmit.h"
613 >
614 </File>
615 <File
616 RelativePath=".\llmail.h"
617 >
618 </File>
619 <File
620 RelativePath=".\llmessagethrottle.h"
621 >
622 </File>
623 <File
624 RelativePath=".\llmime.h"
625 >
626 </File>
627 <File
628 RelativePath=".\llnamevalue.h"
629 >
630 </File>
631 <File
632 RelativePath=".\llnullcipher.h"
633 >
634 </File>
635 <File
636 RelativePath=".\llpacketack.h"
637 >
638 </File>
639 <File
640 RelativePath=".\llpacketbuffer.h"
641 >
642 </File>
643 <File
644 RelativePath=".\llpacketring.h"
645 >
646 </File>
647 <File
648 RelativePath=".\llpartdata.h"
649 >
650 </File>
651 <File
652 RelativePath=".\llpumpio.h"
653 >
654 </File>
655 <File
656 RelativePath=".\llqueryflags.h"
657 >
658 </File>
659 <File
660 RelativePath=".\llregionflags.h"
661 >
662 </File>
663 <File
664 RelativePath=".\llregionhandle.h"
665 >
666 </File>
667 <File
668 RelativePath=".\llsdappservices.h"
669 >
670 </File>
671 <File
672 RelativePath=".\llsdhttpserver.h"
673 >
674 </File>
675 <File
676 RelativePath=".\llsdmessagesystem.h"
677 >
678 </File>
679 <File
680 RelativePath=".\llsdrpcclient.h"
681 >
682 </File>
683 <File
684 RelativePath=".\llsdrpcserver.h"
685 >
686 </File>
687 <File
688 RelativePath=".\llservice.h"
689 >
690 </File>
691 <File
692 RelativePath=".\lltaskname.h"
693 >
694 </File>
695 <File
696 RelativePath=".\llteleportflags.h"
697 >
698 </File>
699 <File
700 RelativePath=".\llthrottle.h"
701 >
702 </File>
703 <File
704 RelativePath=".\lltransfermanager.h"
705 >
706 </File>
707 <File
708 RelativePath=".\lltransfersourceasset.h"
709 >
710 </File>
711 <File
712 RelativePath=".\lltransfersourcefile.h"
713 >
714 </File>
715 <File
716 RelativePath=".\lltransfertargetfile.h"
717 >
718 </File>
719 <File
720 RelativePath=".\lltransfertargetvfile.h"
721 >
722 </File>
723 <File
724 RelativePath=".\llurlrequest.h"
725 >
726 </File>
727 <File
728 RelativePath=".\lluseroperation.h"
729 >
730 </File>
731 <File
732 RelativePath=".\llvehicleparams.h"
733 >
734 </File>
735 <File
736 RelativePath=".\llxfer.h"
737 >
738 </File>
739 <File
740 RelativePath=".\llxfer_file.h"
741 >
742 </File>
743 <File
744 RelativePath=".\llxfer_mem.h"
745 >
746 </File>
747 <File
748 RelativePath=".\llxfer_vfile.h"
749 >
750 </File>
751 <File
752 RelativePath=".\llxfermanager.h"
753 >
754 </File>
755 <File
756 RelativePath=".\llxorcipher.h"
757 >
758 </File>
759 <File
760 RelativePath=".\machine.h"
761 >
762 </File>
763 <File
764 RelativePath=".\mean_collision_data.h"
765 >
766 </File>
767 <File
768 RelativePath=".\message.h"
769 >
770 </File>
771 <File
772 RelativePath=".\message_prehash.h"
773 >
774 </File>
775 <File
776 RelativePath=".\net.h"
777 >
778 </File>
779 <File
780 RelativePath=".\network.h"
781 >
782 </File>
783 <File
784 RelativePath=".\partsyspacket.h"
785 >
786 </File>
787 <File
788 RelativePath=".\patch_code.h"
789 >
790 </File>
791 <File
792 RelativePath=".\patch_dct.h"
793 >
794 </File>
795 <File
796 RelativePath=".\sound_ids.h"
797 >
798 </File>
799 </Filter>
800 <Filter
801 Name="Resource Files"
802 Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
803 UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
804 >
805 </Filter>
806 <File
807 RelativePath="..\..\scripts\messages\message_template.msg"
808 >
809 <FileConfiguration
810 Name="Debug|Win32"
811 >
812 <Tool
813 Name="VCCustomBuildTool"
814 Description=""
815 CommandLine=""
816 Outputs=""
817 />
818 </FileConfiguration>
819 <FileConfiguration
820 Name="Release|Win32"
821 >
822 <Tool
823 Name="VCCustomBuildTool"
824 Description=""
825 CommandLine=""
826 Outputs=""
827 />
828 </FileConfiguration>
829 <FileConfiguration
830 Name="ReleaseNoOpt|Win32"
831 >
832 <Tool
833 Name="VCCustomBuildTool"
834 Description=""
835 CommandLine=""
836 Outputs=""
837 />
838 </FileConfiguration>
839 </File>
840 </Files>
841 <Globals>
842 </Globals>
843</VisualStudioProject>
diff --git a/linden/indra/llmessage/llnamevalue.cpp b/linden/indra/llmessage/llnamevalue.cpp
index 0b4f0b6..1304923 100644
--- a/linden/indra/llmessage/llnamevalue.cpp
+++ b/linden/indra/llmessage/llnamevalue.cpp
@@ -59,7 +59,7 @@ user_callback_map_t gUserCallbackMap;
59 59
60LLStringTable gNVNameTable(16384); 60LLStringTable gNVNameTable(16384);
61 61
62char NameValueTypeStrings[NVT_EOF][NAME_VALUE_TYPE_STRING_LENGTH] = 62char NameValueTypeStrings[NVT_EOF][NAME_VALUE_TYPE_STRING_LENGTH] = /*Flawfinder: Ignore*/
63{ 63{
64 "NULL", 64 "NULL",
65 "STRING", 65 "STRING",
@@ -70,17 +70,17 @@ char NameValueTypeStrings[NVT_EOF][NAME_VALUE_TYPE_STRING_LENGTH] =
70 "CAMERA", // Deprecated, but leaving in case removing completely would cause problems 70 "CAMERA", // Deprecated, but leaving in case removing completely would cause problems
71 "ASSET", 71 "ASSET",
72 "U64" 72 "U64"
73}; /*Flawfinder: Ignore*/ 73};
74 74
75char NameValueClassStrings[NVC_EOF][NAME_VALUE_CLASS_STRING_LENGTH] = 75char NameValueClassStrings[NVC_EOF][NAME_VALUE_CLASS_STRING_LENGTH] = /*Flawfinder: Ignore*/
76{ 76{
77 "NULL", 77 "NULL",
78 "R", // read only 78 "R", // read only
79 "RW", // read write 79 "RW", // read write
80 "CB" // callback 80 "CB" // callback
81}; /*Flawfinder: Ignore*/ 81};
82 82
83char NameValueSendtoStrings[NVS_EOF][NAME_VALUE_SENDTO_STRING_LENGTH] = 83char NameValueSendtoStrings[NVS_EOF][NAME_VALUE_SENDTO_STRING_LENGTH] = /*Flawfinder: Ignore*/
84{ 84{
85 "NULL", 85 "NULL",
86 "S", // "Sim", formerly SIM 86 "S", // "Sim", formerly SIM
@@ -412,11 +412,11 @@ LLNameValue::LLNameValue(const char *name, const char *type, const char *nvclass
412LLNameValue::LLNameValue(const char *data) 412LLNameValue::LLNameValue(const char *data)
413{ 413{
414 baseInit(); 414 baseInit();
415 static char name[NV_BUFFER_LEN]; 415 static char name[NV_BUFFER_LEN]; /*Flawfinder: ignore*/
416 static char type[NV_BUFFER_LEN]; 416 static char type[NV_BUFFER_LEN]; /*Flawfinder: ignore*/
417 static char nvclass[NV_BUFFER_LEN]; 417 static char nvclass[NV_BUFFER_LEN]; /*Flawfinder: ignore*/
418 static char nvsendto[NV_BUFFER_LEN]; 418 static char nvsendto[NV_BUFFER_LEN]; /*Flawfinder: ignore*/
419 static char nvdata[NV_BUFFER_LEN]; 419 static char nvdata[NV_BUFFER_LEN]; /*Flawfinder: ignore*/
420 420
421 S32 i; 421 S32 i;
422 422
@@ -440,7 +440,7 @@ LLNameValue::LLNameValue(const char *data)
440 } 440 }
441 441
442 // read in the name 442 // read in the name
443 sscanf((data + character_count), "%2047s", name); 443 sscanf((data + character_count), "%2047s", name); /*Flawfinder: ignore*/
444 444
445 // bump past it and add null terminator 445 // bump past it and add null terminator
446 length = (S32)strlen(name); /* Flawfinder: ignore */ 446 length = (S32)strlen(name); /* Flawfinder: ignore */
@@ -464,7 +464,7 @@ LLNameValue::LLNameValue(const char *data)
464 } 464 }
465 465
466 // read in the type 466 // read in the type
467 sscanf((data + character_count), "%2047s", type); 467 sscanf((data + character_count), "%2047s", type); /*Flawfinder: ignore*/
468 468
469 // bump past it and add null terminator 469 // bump past it and add null terminator
470 length = (S32)strlen(type); /* Flawfinder: ignore */ 470 length = (S32)strlen(type); /* Flawfinder: ignore */
@@ -500,7 +500,7 @@ LLNameValue::LLNameValue(const char *data)
500 { 500 {
501 // yes we do! 501 // yes we do!
502 // read in the class 502 // read in the class
503 sscanf((data + character_count), "%2047s", nvclass); 503 sscanf((data + character_count), "%2047s", nvclass); /*Flawfinder: ignore*/
504 504
505 // bump past it and add null terminator 505 // bump past it and add null terminator
506 length = (S32)strlen(nvclass); /* Flawfinder: ignore */ 506 length = (S32)strlen(nvclass); /* Flawfinder: ignore */
@@ -542,7 +542,7 @@ LLNameValue::LLNameValue(const char *data)
542 if (i != NVS_EOF) 542 if (i != NVS_EOF)
543 { 543 {
544 // found a sendto argument 544 // found a sendto argument
545 sscanf((data + character_count), "%2047s", nvsendto); 545 sscanf((data + character_count), "%2047s", nvsendto); /*Flawfinder: ignore*/
546 546
547 // add null terminator 547 // add null terminator
548 length = (S32)strlen(nvsendto); /* Flawfinder: ignore */ 548 length = (S32)strlen(nvsendto); /* Flawfinder: ignore */
diff --git a/linden/indra/llmessage/llnullcipher.cpp b/linden/indra/llmessage/llnullcipher.cpp
index 1b60e44..ad2b25f 100644
--- a/linden/indra/llmessage/llnullcipher.cpp
+++ b/linden/indra/llmessage/llnullcipher.cpp
@@ -27,33 +27,33 @@
27 27
28#include "linden_common.h" 28#include "linden_common.h"
29 29
30#include "llcrypto.h" 30#include "llnullcipher.h"
31 31
32///---------------------------------------------------------------------------- 32///----------------------------------------------------------------------------
33/// Class LLNullCipher 33/// Class LLNullCipher
34///---------------------------------------------------------------------------- 34///----------------------------------------------------------------------------
35 35
36BOOL LLNullCipher::encrypt(const U8* src, U32 src_len, U8* dst, U32 dst_len) 36U32 LLNullCipher::encrypt(const U8* src, U32 src_len, U8* dst, U32 dst_len)
37{ 37{
38 if((src_len == dst_len) && src && dst) 38 if((src_len == dst_len) && src && dst)
39 { 39 {
40 memmove(dst, src, src_len); 40 memmove(dst, src, src_len);
41 return TRUE; 41 return src_len;
42 } 42 }
43 return FALSE; 43 return 0;
44} 44}
45 45
46BOOL LLNullCipher::decrypt(const U8* src, U32 src_len, U8* dst, U32 dst_len) 46U32 LLNullCipher::decrypt(const U8* src, U32 src_len, U8* dst, U32 dst_len)
47{ 47{
48 if((src_len == dst_len) && src && dst) 48 if((src_len == dst_len) && src && dst)
49 { 49 {
50 memmove(dst, src, src_len); 50 memmove(dst, src, src_len);
51 return TRUE; 51 return src_len;
52 } 52 }
53 return FALSE; 53 return 0;
54} 54}
55 55
56U32 LLNullCipher::requiredEncryptionSpace(U32 len) 56U32 LLNullCipher::requiredEncryptionSpace(U32 len) const
57{ 57{
58 return len; 58 return len;
59} 59}
diff --git a/linden/indra/llmessage/llnullcipher.h b/linden/indra/llmessage/llnullcipher.h
new file mode 100644
index 0000000..75d022d
--- /dev/null
+++ b/linden/indra/llmessage/llnullcipher.h
@@ -0,0 +1,49 @@
1/**
2 * @file llnullcipher.h
3 *
4 * Copyright (c) 2003-2007, Linden Research, Inc.
5 *
6 * The source code in this file ("Source Code") is provided by Linden Lab
7 * to you under the terms of the GNU General Public License, version 2.0
8 * ("GPL"), unless you have obtained a separate licensing agreement
9 * ("Other License"), formally executed by you and Linden Lab. Terms of
10 * the GPL can be found in doc/GPL-license.txt in this distribution, or
11 * online at http://secondlife.com/developers/opensource/gplv2
12 *
13 * There are special exceptions to the terms and conditions of the GPL as
14 * it is applied to this Source Code. View the full text of the exception
15 * in the file doc/FLOSS-exception.txt in this software distribution, or
16 * online at http://secondlife.com/developers/opensource/flossexception
17 *
18 * By copying, modifying or distributing this software, you acknowledge
19 * that you have read and understood your obligations described above,
20 * and agree to abide by those obligations.
21 *
22 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
23 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
24 * COMPLETENESS OR PERFORMANCE.
25 */
26
27#ifndef LLNULLCIPHER_H
28#define LLNULLCIPHER_H
29
30#include "llcipher.h"
31
32//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
33// Class LLNullCipher
34//
35// A class which implements LLCipher, but does not transform src
36// during encryption.
37//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
38
39class LLNullCipher : public LLCipher
40{
41public:
42 LLNullCipher() {}
43 virtual ~LLNullCipher() {}
44 virtual U32 encrypt(const U8* src, U32 src_len, U8* dst, U32 dst_len);
45 virtual U32 decrypt(const U8* src, U32 src_len, U8* dst, U32 dst_len);
46 virtual U32 requiredEncryptionSpace(U32 src_len) const;
47};
48
49#endif
diff --git a/linden/indra/llmessage/llpacketack.h b/linden/indra/llmessage/llpacketack.h
index d7d960e..e8d598a 100644
--- a/linden/indra/llmessage/llpacketack.h
+++ b/linden/indra/llmessage/llpacketack.h
@@ -130,7 +130,7 @@ public:
130 mBuffer = new U8[buf_len]; 130 mBuffer = new U8[buf_len];
131 if (mBuffer != NULL) 131 if (mBuffer != NULL)
132 { 132 {
133 memcpy(mBuffer,buf_ptr,buf_len); 133 memcpy(mBuffer,buf_ptr,buf_len); /*Flawfinder: ignore*/
134 mBufferLength = buf_len; 134 mBufferLength = buf_len;
135 } 135 }
136 136
diff --git a/linden/indra/llmessage/llpacketbuffer.cpp b/linden/indra/llmessage/llpacketbuffer.cpp
index 3559ecb..855fb40 100644
--- a/linden/indra/llmessage/llpacketbuffer.cpp
+++ b/linden/indra/llmessage/llpacketbuffer.cpp
@@ -44,7 +44,7 @@ LLPacketBuffer::LLPacketBuffer(const LLHost &host, const char *datap, const S32
44 44
45 if (datap != NULL) 45 if (datap != NULL)
46 { 46 {
47 memcpy(mData, datap, size); 47 memcpy(mData, datap, size); /*Flawfinder: ignore*/
48 mSize = size; 48 mSize = size;
49 } 49 }
50 50
diff --git a/linden/indra/llmessage/llpacketring.cpp b/linden/indra/llmessage/llpacketring.cpp
index 6a6a456..a2e6eb9 100644
--- a/linden/indra/llmessage/llpacketring.cpp
+++ b/linden/indra/llmessage/llpacketring.cpp
@@ -132,7 +132,7 @@ S32 LLPacketRing::receiveFromRing (S32 socket, char *datap)
132 packet_size = packetp->getSize(); 132 packet_size = packetp->getSize();
133 if (packetp->getData() != NULL) 133 if (packetp->getData() != NULL)
134 { 134 {
135 memcpy(datap, packetp->getData(), packet_size); 135 memcpy(datap, packetp->getData(), packet_size); /*Flawfinder: ignore*/
136 } 136 }
137 // need to set sender IP/port!! 137 // need to set sender IP/port!!
138 mLastSender = packetp->getHost(); 138 mLastSender = packetp->getHost();
diff --git a/linden/indra/llmessage/llpartdata.cpp b/linden/indra/llmessage/llpartdata.cpp
index 11969d0..de0cb13 100644
--- a/linden/indra/llmessage/llpartdata.cpp
+++ b/linden/indra/llmessage/llpartdata.cpp
@@ -231,6 +231,20 @@ BOOL LLPartSysData::unpack(LLDataPacker &dp)
231 return TRUE; 231 return TRUE;
232} 232}
233 233
234std::ostream& operator<<(std::ostream& s, const LLPartSysData &data)
235{
236 s << "Flags: " << std::hex << data.mFlags;
237 s << " Pattern: " << std::hex << (U32) data.mPattern << "\n";
238 s << "Age: [" << data.mStartAge << ", " << data.mMaxAge << "]\n";
239 s << "Angle: [" << data.mInnerAngle << ", " << data.mOuterAngle << "]\n";
240 s << "Burst Rate: " << data.mBurstRate << "\n";
241 s << "Burst Radius: " << data.mBurstRadius << "\n";
242 s << "Burst Speed: [" << data.mBurstSpeedMin << ", " << data.mBurstSpeedMax << "]\n";
243 s << "Burst Part Count: " << std::hex << (U32) data.mBurstPartCount << "\n";
244 s << "Angular Velocity: " << data.mAngularVelocity << "\n";
245 s << "Accel: " << data.mPartAccel;
246 return s;
247}
234 248
235BOOL LLPartSysData::isNullPS(const S32 block_num) 249BOOL LLPartSysData::isNullPS(const S32 block_num)
236{ 250{
diff --git a/linden/indra/llmessage/llpartdata.h b/linden/indra/llmessage/llpartdata.h
index 4045ada..55d22d5 100644
--- a/linden/indra/llmessage/llpartdata.h
+++ b/linden/indra/llmessage/llpartdata.h
@@ -186,6 +186,9 @@ public:
186 // a combination of multiple parameters, we 186 // a combination of multiple parameters, we
187 // need to clamp it using a separate method instead of an accessor. 187 // need to clamp it using a separate method instead of an accessor.
188 void clampSourceParticleRate(); 188 void clampSourceParticleRate();
189
190 friend std::ostream& operator<<(std::ostream& s, const LLPartSysData &data); // Stream a
191
189public: 192public:
190 // Public because I'm lazy.... 193 // Public because I'm lazy....
191 194
diff --git a/linden/indra/llmessage/llpumpio.cpp b/linden/indra/llmessage/llpumpio.cpp
index b1495f6..c1f1821 100644
--- a/linden/indra/llmessage/llpumpio.cpp
+++ b/linden/indra/llmessage/llpumpio.cpp
@@ -887,7 +887,7 @@ void LLPumpIO::processChain(LLChainInfo& chain)
887 PUMP_DEBUG; 887 PUMP_DEBUG;
888 if(LLIOPipe::isError(status)) 888 if(LLIOPipe::isError(status))
889 { 889 {
890 llinfos << "Pump generated pipe error: '" 890 llinfos << "Pump generated pipe err: '"
891#if LL_DEBUG_PIPE_TYPE_IN_PUMP 891#if LL_DEBUG_PIPE_TYPE_IN_PUMP
892 << typeid(*((*it).mPipe)).name() << "':'" 892 << typeid(*((*it).mPipe)).name() << "':'"
893#endif 893#endif
diff --git a/linden/indra/llmessage/llsdappservices.cpp b/linden/indra/llmessage/llsdappservices.cpp
index d923b22..8574f87 100644
--- a/linden/indra/llmessage/llsdappservices.cpp
+++ b/linden/indra/llmessage/llsdappservices.cpp
@@ -261,7 +261,7 @@ public:
261 llinfos << "LLHTTPLiveConfigSingleService::validate(" << name 261 llinfos << "LLHTTPLiveConfigSingleService::validate(" << name
262 << ")" << llendl; 262 << ")" << llendl;
263 LLSD option = LLApp::instance()->getOption(name); 263 LLSD option = LLApp::instance()->getOption(name);
264 if(option) return true; 264 if(option.isDefined()) return true;
265 else return false; 265 else return false;
266 } 266 }
267 267
diff --git a/linden/indra/llmessage/llsdmessagesystem.cpp b/linden/indra/llmessage/llsdmessagesystem.cpp
index 7d508f0..66382ea 100644
--- a/linden/indra/llmessage/llsdmessagesystem.cpp
+++ b/linden/indra/llmessage/llsdmessagesystem.cpp
@@ -25,6 +25,7 @@
25 * COMPLETENESS OR PERFORMANCE. 25 * COMPLETENESS OR PERFORMANCE.
26 */ 26 */
27 27
28#include "linden_common.h"
28#include "llsdmessagesystem.h" 29#include "llsdmessagesystem.h"
29 30
30#include "llhttpnode.h" 31#include "llhttpnode.h"
@@ -98,7 +99,7 @@ void LLSDMessageSystem::getStringFast(const char *block, const char *var, S32 bu
98 std::string data = getLLSD(mInput, block, var, blocknum).asString(); 99 std::string data = getLLSD(mInput, block, var, blocknum).asString();
99 S32 length = data.length(); 100 S32 length = data.length();
100 memset(buffer, 0, buffer_size); 101 memset(buffer, 0, buffer_size);
101 strncpy(buffer, data.c_str(), llmin(length, buffer_size)); 102 strncpy(buffer, data.c_str(), llmin(length, buffer_size)); /* Flawfinder: ignore */
102} 103}
103 104
104//virtual 105//virtual
diff --git a/linden/indra/llmessage/lltransfermanager.cpp b/linden/indra/llmessage/lltransfermanager.cpp
index bfeedd0..43afa78 100644
--- a/linden/indra/llmessage/lltransfermanager.cpp
+++ b/linden/indra/llmessage/lltransfermanager.cpp
@@ -354,7 +354,7 @@ void LLTransferManager::processTransferInfo(LLMessageSystem *msgp, void **)
354 { 354 {
355 // Perhaps this stuff should be inside a method in LLTransferPacket? 355 // Perhaps this stuff should be inside a method in LLTransferPacket?
356 // I'm too lazy to do it now, though. 356 // I'm too lazy to do it now, though.
357 llinfos << "Playing back delayed packet " << packet_id << llendl; 357// llinfos << "Playing back delayed packet " << packet_id << llendl;
358 LLTransferPacket *packetp = ttp->mDelayedPacketMap[packet_id]; 358 LLTransferPacket *packetp = ttp->mDelayedPacketMap[packet_id];
359 359
360 // This is somewhat inefficient, but avoids us having to duplicate 360 // This is somewhat inefficient, but avoids us having to duplicate
@@ -365,7 +365,7 @@ void LLTransferManager::processTransferInfo(LLMessageSystem *msgp, void **)
365 { 365 {
366 if ((packetp->mDatap != NULL) && (size<(S32)sizeof(tmp_data))) 366 if ((packetp->mDatap != NULL) && (size<(S32)sizeof(tmp_data)))
367 { 367 {
368 memcpy(tmp_data, packetp->mDatap, size); 368 memcpy(tmp_data, packetp->mDatap, size); /*Flawfinder: ignore*/
369 } 369 }
370 } 370 }
371 status = packetp->mStatus; 371 status = packetp->mStatus;
@@ -474,6 +474,8 @@ void LLTransferManager::processTransferPacket(LLMessageSystem *msgp, void **)
474 ttcp->deleteTransfer(ttp); 474 ttcp->deleteTransfer(ttp);
475 return; 475 return;
476 } 476 }
477#if 0
478 // Spammy!
477 const S32 LL_TRANSFER_WARN_GAP = 10; 479 const S32 LL_TRANSFER_WARN_GAP = 10;
478 if(!ttp->gotInfo()) 480 if(!ttp->gotInfo())
479 { 481 {
@@ -487,6 +489,7 @@ void LLTransferManager::processTransferPacket(LLMessageSystem *msgp, void **)
487 << " from " << msgp->getSender() << ", got " << packet_id 489 << " from " << msgp->getSender() << ", got " << packet_id
488 << " expecting " << ttp->getNextPacketID() << llendl; 490 << " expecting " << ttp->getNextPacketID() << llendl;
489 } 491 }
492#endif
490 return; 493 return;
491 } 494 }
492 495
@@ -527,7 +530,7 @@ void LLTransferManager::processTransferPacket(LLMessageSystem *msgp, void **)
527 { 530 {
528 // Perhaps this stuff should be inside a method in LLTransferPacket? 531 // Perhaps this stuff should be inside a method in LLTransferPacket?
529 // I'm too lazy to do it now, though. 532 // I'm too lazy to do it now, though.
530 llinfos << "Playing back delayed packet " << packet_id << llendl; 533// llinfos << "Playing back delayed packet " << packet_id << llendl;
531 LLTransferPacket *packetp = ttp->mDelayedPacketMap[packet_id]; 534 LLTransferPacket *packetp = ttp->mDelayedPacketMap[packet_id];
532 535
533 // This is somewhat inefficient, but avoids us having to duplicate 536 // This is somewhat inefficient, but avoids us having to duplicate
@@ -538,7 +541,7 @@ void LLTransferManager::processTransferPacket(LLMessageSystem *msgp, void **)
538 { 541 {
539 if ((packetp->mDatap != NULL) && (size<(S32)sizeof(tmp_data))) 542 if ((packetp->mDatap != NULL) && (size<(S32)sizeof(tmp_data)))
540 { 543 {
541 memcpy(tmp_data, packetp->mDatap, size); 544 memcpy(tmp_data, packetp->mDatap, size); /*Flawfinder: ignore*/
542 } 545 }
543 } 546 }
544 status = packetp->mStatus; 547 status = packetp->mStatus;
@@ -738,8 +741,11 @@ LLTransferSourceChannel::LLTransferSourceChannel(const LLTransferChannelType cha
738 741
739LLTransferSourceChannel::~LLTransferSourceChannel() 742LLTransferSourceChannel::~LLTransferSourceChannel()
740{ 743{
741 LLPriQueueMap<LLTransferSource *>::pqm_iter iter; 744 LLPriQueueMap<LLTransferSource*>::pqm_iter iter =
742 for (iter = mTransferSources.mMap.begin(); iter != mTransferSources.mMap.end(); iter++) 745 mTransferSources.mMap.begin();
746 LLPriQueueMap<LLTransferSource*>::pqm_iter end =
747 mTransferSources.mMap.end();
748 for (; iter != end; ++iter)
743 { 749 {
744 // Just kill off all of the transfers 750 // Just kill off all of the transfers
745 (*iter).second->abortTransfer(); 751 (*iter).second->abortTransfer();
@@ -1176,7 +1182,7 @@ LLTransferPacket::LLTransferPacket(const S32 packet_id, const LLTSCode status, c
1176 mDatap = new U8[size]; 1182 mDatap = new U8[size];
1177 if (mDatap != NULL) 1183 if (mDatap != NULL)
1178 { 1184 {
1179 memcpy(mDatap, datap, size); 1185 memcpy(mDatap, datap, size); /*Flawfinder: ignore*/
1180 } 1186 }
1181} 1187}
1182 1188
diff --git a/linden/indra/llmessage/lltransfertargetvfile.cpp b/linden/indra/llmessage/lltransfertargetvfile.cpp
index ce21605..5a1acf3 100644
--- a/linden/indra/llmessage/lltransfertargetvfile.cpp
+++ b/linden/indra/llmessage/lltransfertargetvfile.cpp
@@ -34,33 +34,8 @@
34#include "llvfile.h" 34#include "llvfile.h"
35 35
36//static 36//static
37std::list<LLTransferTargetParamsVFile*> LLTransferTargetVFile::sCallbackQueue;
38
39//static
40void LLTransferTargetVFile::updateQueue(bool shutdown) 37void LLTransferTargetVFile::updateQueue(bool shutdown)
41{ 38{
42 for(std::list<LLTransferTargetParamsVFile*>::iterator iter = sCallbackQueue.begin();
43 iter != sCallbackQueue.end(); )
44 {
45 std::list<LLTransferTargetParamsVFile*>::iterator curiter = iter++;
46 LLTransferTargetParamsVFile* params = *curiter;
47 LLVFSThread::status_t s = LLVFile::getVFSThread()->getRequestStatus(params->mHandle);
48 if (s == LLVFSThread::STATUS_COMPLETE || s == LLVFSThread::STATUS_EXPIRED)
49 {
50 params->mCompleteCallback(
51 params->mErrCode,
52 params->getAssetID(),
53 params->getAssetType(),
54 params->mUserDatap);
55 delete params;
56 iter = sCallbackQueue.erase(curiter);
57 }
58 else if (shutdown)
59 {
60 delete params;
61 iter = sCallbackQueue.erase(curiter);
62 }
63 }
64} 39}
65 40
66 41
@@ -69,8 +44,7 @@ LLTransferTargetParamsVFile::LLTransferTargetParamsVFile() :
69 mAssetType(LLAssetType::AT_NONE), 44 mAssetType(LLAssetType::AT_NONE),
70 mCompleteCallback(NULL), 45 mCompleteCallback(NULL),
71 mUserDatap(NULL), 46 mUserDatap(NULL),
72 mErrCode(0), 47 mErrCode(0)
73 mHandle(LLVFSThread::nullHandle())
74{ 48{
75} 49}
76 50
@@ -185,7 +159,6 @@ void LLTransferTargetVFile::completionCallback(const LLTSCode status)
185 llwarns << "Aborting vfile transfer after asset storage shut down!" << llendl; 159 llwarns << "Aborting vfile transfer after asset storage shut down!" << llendl;
186 return; 160 return;
187 } 161 }
188 LLVFSThread::handle_t handle = LLVFSThread::nullHandle();
189 162
190 // Still need to gracefully handle error conditions. 163 // Still need to gracefully handle error conditions.
191 S32 err_code = 0; 164 S32 err_code = 0;
@@ -194,11 +167,11 @@ void LLTransferTargetVFile::completionCallback(const LLTSCode status)
194 case LLTS_DONE: 167 case LLTS_DONE:
195 if (!mNeedsCreate) 168 if (!mNeedsCreate)
196 { 169 {
197 handle = LLVFile::getVFSThread()->rename( 170 LLVFile file(gAssetStorage->mVFS, mTempID, mParams.getAssetType(), LLVFile::WRITE);
198 gAssetStorage->mVFS, 171 if (!file.rename(mParams.getAssetID(), mParams.getAssetType()))
199 mTempID, mParams.getAssetType(), 172 {
200 mParams.getAssetID(), mParams.getAssetType(), 173 llerrs << "LLTransferTargetVFile: rename failed" << llendl;
201 LLVFSThread::AUTO_DELETE); 174 }
202 } 175 }
203 err_code = LL_ERR_NOERR; 176 err_code = LL_ERR_NOERR;
204 lldebugs << "LLTransferTargetVFile::completionCallback for " 177 lldebugs << "LLTransferTargetVFile::completionCallback for "
@@ -238,20 +211,9 @@ void LLTransferTargetVFile::completionCallback(const LLTSCode status)
238 } 211 }
239 if (mParams.mCompleteCallback) 212 if (mParams.mCompleteCallback)
240 { 213 {
241 if (handle != LLVFSThread::nullHandle()) 214 mParams.mCompleteCallback(err_code,
242 { 215 mParams.getAssetID(),
243 LLTransferTargetParamsVFile* params = new LLTransferTargetParamsVFile(mParams); 216 mParams.getAssetType(),
244 params->mErrCode = err_code; 217 mParams.mUserDatap);
245 params->mHandle = handle;
246 sCallbackQueue.push_back(params);
247 }
248 else
249 {
250 mParams.mCompleteCallback(
251 err_code,
252 mParams.getAssetID(),
253 mParams.getAssetType(),
254 mParams.mUserDatap);
255 }
256 } 218 }
257} 219}
diff --git a/linden/indra/llmessage/lltransfertargetvfile.h b/linden/indra/llmessage/lltransfertargetvfile.h
index a4b6f93..4c915dc 100644
--- a/linden/indra/llmessage/lltransfertargetvfile.h
+++ b/linden/indra/llmessage/lltransfertargetvfile.h
@@ -90,8 +90,6 @@ protected:
90 90
91 BOOL mNeedsCreate; 91 BOOL mNeedsCreate;
92 LLUUID mTempID; 92 LLUUID mTempID;
93
94 static std::list<LLTransferTargetParamsVFile*> sCallbackQueue;
95}; 93};
96 94
97#endif // LL_LLTRANSFERTARGETFILE_H 95#endif // LL_LLTRANSFERTARGETFILE_H
diff --git a/linden/indra/llmessage/llxfer.cpp b/linden/indra/llmessage/llxfer.cpp
index f02d106..507b820 100644
--- a/linden/indra/llmessage/llxfer.cpp
+++ b/linden/indra/llmessage/llxfer.cpp
@@ -135,7 +135,7 @@ S32 LLXfer::receiveData (char *datap, S32 data_size)
135 { 135 {
136 if (datap != NULL) 136 if (datap != NULL)
137 { 137 {
138 memcpy(&mBuffer[mBufferLength],datap,data_size); 138 memcpy(&mBuffer[mBufferLength],datap,data_size); /*Flawfinder: ignore*/
139 mBufferLength += data_size; 139 mBufferLength += data_size;
140 } 140 }
141 else 141 else
@@ -212,7 +212,7 @@ void LLXfer::sendPacket(S32 packet_num)
212 num_copy = llmin(num_copy, (S32)(mBufferLength - desired_read_position)); 212 num_copy = llmin(num_copy, (S32)(mBufferLength - desired_read_position));
213 if (num_copy > 0) 213 if (num_copy > 0)
214 { 214 {
215 memcpy(fdata_buf,&mBuffer[desired_read_position],num_copy); 215 memcpy(fdata_buf,&mBuffer[desired_read_position],num_copy); /*Flawfinder: ignore*/
216 } 216 }
217 } 217 }
218 else 218 else
@@ -225,7 +225,7 @@ void LLXfer::sendPacket(S32 packet_num)
225 (S32)(mBufferLength - desired_read_position)); 225 (S32)(mBufferLength - desired_read_position));
226 if (num_copy > 0) 226 if (num_copy > 0)
227 { 227 {
228 memcpy( 228 memcpy( /*Flawfinder: ignore*/
229 fdata_buf + sizeof(S32), 229 fdata_buf + sizeof(S32),
230 &mBuffer[desired_read_position], 230 &mBuffer[desired_read_position],
231 num_copy); 231 num_copy);
diff --git a/linden/indra/llmessage/llxfer_file.cpp b/linden/indra/llmessage/llxfer_file.cpp
index 8d38644..2fec06b 100644
--- a/linden/indra/llmessage/llxfer_file.cpp
+++ b/linden/indra/llmessage/llxfer_file.cpp
@@ -413,8 +413,8 @@ U32 LLXfer_File::getXferTypeTag()
413S32 copy_file(const char* from, const char* to) 413S32 copy_file(const char* from, const char* to)
414{ 414{
415 S32 rv = 0; 415 S32 rv = 0;
416 FILE* in = LLFile::fopen(from, "rb"); 416 FILE* in = LLFile::fopen(from, "rb"); /*Flawfinder: ignore*/
417 FILE* out = LLFile::fopen(to, "wb"); 417 FILE* out = LLFile::fopen(to, "wb"); /*Flawfinder: ignore*/
418 if(in && out) 418 if(in && out)
419 { 419 {
420 S32 read = 0; 420 S32 read = 0;
diff --git a/linden/indra/llmessage/llxorcipher.cpp b/linden/indra/llmessage/llxorcipher.cpp
index 7a72866..3c3f690 100644
--- a/linden/indra/llmessage/llxorcipher.cpp
+++ b/linden/indra/llmessage/llxorcipher.cpp
@@ -27,7 +27,8 @@
27 27
28#include "linden_common.h" 28#include "linden_common.h"
29 29
30#include "llcrypto.h" 30#include "llxorcipher.h"
31
31#include "llerror.h" 32#include "llerror.h"
32 33
33///---------------------------------------------------------------------------- 34///----------------------------------------------------------------------------
@@ -63,25 +64,26 @@ LLXORCipher& LLXORCipher::operator=(const LLXORCipher& cipher)
63 return *this; 64 return *this;
64} 65}
65 66
66BOOL LLXORCipher::encrypt(const U8* src, U32 src_len, U8* dst, U32 dst_len) 67U32 LLXORCipher::encrypt(const U8* src, U32 src_len, U8* dst, U32 dst_len)
67{ 68{
68 if(!src || !src_len || !dst || !dst_len || !mPad) return FALSE; 69 if(!src || !src_len || !dst || !dst_len || !mPad) return 0;
69 U8* pad_end = mPad + mPadLen; 70 U8* pad_end = mPad + mPadLen;
70 while(src_len--) 71 U32 count = src_len;
72 while(count--)
71 { 73 {
72 *dst++ = *src++ ^ *mHead++; 74 *dst++ = *src++ ^ *mHead++;
73 if(mHead >= pad_end) mHead = mPad; 75 if(mHead >= pad_end) mHead = mPad;
74 } 76 }
75 return TRUE; 77 return src_len;
76} 78}
77 79
78BOOL LLXORCipher::decrypt(const U8* src, U32 src_len, U8* dst, U32 dst_len) 80U32 LLXORCipher::decrypt(const U8* src, U32 src_len, U8* dst, U32 dst_len)
79{ 81{
80 // xor is a symetric cipher, thus, just call the other function. 82 // xor is a symetric cipher, thus, just call the other function.
81 return encrypt(src, src_len, dst, dst_len); 83 return encrypt(src, src_len, dst, dst_len);
82} 84}
83 85
84U32 LLXORCipher::requiredEncryptionSpace(U32 len) 86U32 LLXORCipher::requiredEncryptionSpace(U32 len) const
85{ 87{
86 return len; 88 return len;
87} 89}
diff --git a/linden/indra/llmessage/llcrypto.h b/linden/indra/llmessage/llxorcipher.h
index b142d25..fbb879e 100644
--- a/linden/indra/llmessage/llcrypto.h
+++ b/linden/indra/llmessage/llxorcipher.h
@@ -1,8 +1,5 @@
1/** 1/**
2 * @file llcrypto.h 2 * @file llxorcipher.h
3 * @brief llcrypto library module header. For now, all crypto classes
4 * are here, and as we grow the library, we can split these things
5 * out.
6 * 3 *
7 * Copyright (c) 2003-2007, Linden Research, Inc. 4 * Copyright (c) 2003-2007, Linden Research, Inc.
8 * 5 *
@@ -27,50 +24,10 @@
27 * COMPLETENESS OR PERFORMANCE. 24 * COMPLETENESS OR PERFORMANCE.
28 */ 25 */
29 26
30#ifndef LL_LLCRYPTO_H 27#ifndef LLXORCIPHER_H
31#define LL_LLCRYPTO_H 28#define LLXORCIPHER_H
32 29
33//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 30#include "llcipher.h"
34// Class LLCipher
35//
36// Abstract base class for a cipher object.
37//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
38
39class LLCipher
40{
41public:
42 virtual ~LLCipher() {}
43
44 // encrypt src and place result into dst. returns TRUE if
45 // encryption was successful, otherwise FALSE.
46 virtual BOOL encrypt(const U8* src, U32 src_len, U8* dst, U32 dst_len) = 0;
47
48 // decrypt src and place result into dst. returns TRUE if
49 // encryption was successful, otherwise FALSE.
50 virtual BOOL decrpyt(const U8* src, U32 src_len, U8* dst, U32 dst_len) = 0;
51
52 // returns the space required to encrypt for a unencrypted source
53 // buffer of length len.
54 virtual U32 requiredEncryptionSpace(U32 src_len) const = 0 ;
55};
56
57
58//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
59// Class LLNullCipher
60//
61// A class which implements LLCipher, but does not transform src
62// during encryption.
63//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
64
65class LLNullCipher
66{
67public:
68 LLNullCipher() {}
69 virtual ~LLNullCipher() {}
70 virtual BOOL encrypt(const U8* src, U32 src_len, U8* dst, U32 dst_len);
71 virtual BOOL decrypt(const U8* src, U32 src_len, U8* dst, U32 dst_len);
72 virtual U32 requiredEncryptionSpace(U32 src_len);
73};
74 31
75//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 32//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
76// Class LLXORCipher 33// Class LLXORCipher
@@ -78,7 +35,7 @@ public:
78// Implementation of LLCipher which encrypts using a XOR pad. 35// Implementation of LLCipher which encrypts using a XOR pad.
79//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 36//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
80 37
81class LLXORCipher 38class LLXORCipher : public LLCipher
82{ 39{
83public: 40public:
84 LLXORCipher(const U8* pad, U32 pad_len); 41 LLXORCipher(const U8* pad, U32 pad_len);
@@ -87,9 +44,9 @@ public:
87 LLXORCipher& operator=(const LLXORCipher& cipher); 44 LLXORCipher& operator=(const LLXORCipher& cipher);
88 45
89 // Cipher functions 46 // Cipher functions
90 virtual BOOL encrypt(const U8* src, U32 src_len, U8* dst, U32 dst_len); 47 /*virtual*/ U32 encrypt(const U8* src, U32 src_len, U8* dst, U32 dst_len);
91 virtual BOOL decrypt(const U8* src, U32 src_len, U8* dst, U32 dst_len); 48 /*virtual*/ U32 decrypt(const U8* src, U32 src_len, U8* dst, U32 dst_len);
92 virtual U32 requiredEncryptionSpace(U32 src_len); 49 /*virtual*/ U32 requiredEncryptionSpace(U32 src_len) const;
93 50
94 // special syntactic-sugar since xor can be performed in place. 51 // special syntactic-sugar since xor can be performed in place.
95 BOOL encrypt(U8* buf, U32 len) { return encrypt((const U8*)buf, len, buf, len); } 52 BOOL encrypt(U8* buf, U32 len) { return encrypt((const U8*)buf, len, buf, len); }
@@ -108,4 +65,4 @@ protected:
108 U32 mPadLen; 65 U32 mPadLen;
109}; 66};
110 67
111#endif // LL_LLCRYPTO_H 68#endif
diff --git a/linden/indra/llmessage/message.cpp b/linden/indra/llmessage/message.cpp
index 5baefff..2e7cb6a 100644
--- a/linden/indra/llmessage/message.cpp
+++ b/linden/indra/llmessage/message.cpp
@@ -987,7 +987,7 @@ void LLMessageSystem::loadTemplateFile(const char* filename)
987 987
988 LLMessageVariable var; 988 LLMessageVariable var;
989 char var_name[MAX_MESSAGE_INTERNAL_NAME_SIZE]; /* Flawfinder: ignore */ 989 char var_name[MAX_MESSAGE_INTERNAL_NAME_SIZE]; /* Flawfinder: ignore */
990 char formatString[MAX_MESSAGE_INTERNAL_NAME_SIZE]; 990 char formatString[MAX_MESSAGE_INTERNAL_NAME_SIZE]; /* Flawfinder: ignore */
991 991
992 FILE* messagefilep = NULL; 992 FILE* messagefilep = NULL;
993 mMessageFileChecksum = 0; 993 mMessageFileChecksum = 0;
@@ -995,14 +995,19 @@ void LLMessageSystem::loadTemplateFile(const char* filename)
995 S32 checksum_offset = 0; 995 S32 checksum_offset = 0;
996 char* checkp = NULL; 996 char* checkp = NULL;
997 997
998 snprintf(formatString, sizeof(formatString), "%%%ds", MAX_MESSAGE_INTERNAL_NAME_SIZE); 998 // scanf needs 1 byte more than width, thus the MAX_... -1.
999 messagefilep = LLFile::fopen(filename, "r"); 999 snprintf( /* Flawfinder: ignore */
1000 formatString,
1001 sizeof(formatString),
1002 "%%%ds",
1003 MAX_MESSAGE_INTERNAL_NAME_SIZE - 1);
1004 messagefilep = LLFile::fopen(filename, "r"); /* Flawfinder: ignore */
1000 if (messagefilep) 1005 if (messagefilep)
1001 { 1006 {
1002// mName = gMessageStringTable.getString(filename); 1007// mName = gMessageStringTable.getString(filename);
1003 1008
1004 fseek(messagefilep, 0L, SEEK_SET ); 1009 fseek(messagefilep, 0L, SEEK_SET );
1005 while(fscanf(messagefilep, formatString, token) != EOF) 1010 while(fscanf(messagefilep, formatString, token) != EOF) /* Flawfinder: ignore */
1006 { 1011 {
1007 // skip comments 1012 // skip comments
1008 if (token[0] == '/') 1013 if (token[0] == '/')
@@ -1132,7 +1137,7 @@ void LLMessageSystem::loadTemplateFile(const char* filename)
1132 b_template = FALSE; 1137 b_template = FALSE;
1133 1138
1134 // name first 1139 // name first
1135 if (fscanf(messagefilep, formatString, template_name) == EOF) 1140 if (fscanf(messagefilep, formatString, template_name) == EOF) /* Flawfinder: ignore */
1136 { 1141 {
1137 // oops, file ended 1142 // oops, file ended
1138 llerrs << "Expected message template name, but file ended" 1143 llerrs << "Expected message template name, but file ended"
@@ -1164,7 +1169,7 @@ void LLMessageSystem::loadTemplateFile(const char* filename)
1164 } 1169 }
1165 1170
1166 // ok, now get Frequency ("High", "Medium", or "Low") 1171 // ok, now get Frequency ("High", "Medium", or "Low")
1167 if (fscanf(messagefilep, formatString, token) == EOF) 1172 if (fscanf(messagefilep, formatString, token) == EOF) /* Flawfinder: ignore */
1168 { 1173 {
1169 // oops, file ended 1174 // oops, file ended
1170 llerrs << "Expected message template frequency, found EOF." 1175 llerrs << "Expected message template frequency, found EOF."
@@ -1245,7 +1250,7 @@ void LLMessageSystem::loadTemplateFile(const char* filename)
1245 else if (!strcmp(token, "Fixed")) 1250 else if (!strcmp(token, "Fixed"))
1246 { 1251 {
1247 U32 message_num = 0; 1252 U32 message_num = 0;
1248 if (fscanf(messagefilep, formatString, token) == EOF) 1253 if (fscanf(messagefilep, formatString, token) == EOF) /* Flawfinder: ignore */
1249 { 1254 {
1250 // oops, file ended 1255 // oops, file ended
1251 llerrs << "Expected message template number (fixed)," 1256 llerrs << "Expected message template number (fixed),"
@@ -1279,7 +1284,7 @@ void LLMessageSystem::loadTemplateFile(const char* filename)
1279 } 1284 }
1280 1285
1281 // Now get trust ("Trusted", "NotTrusted") 1286 // Now get trust ("Trusted", "NotTrusted")
1282 if (fscanf(messagefilep, formatString, token) == EOF) 1287 if (fscanf(messagefilep, formatString, token) == EOF) /* Flawfinder: ignore */
1283 { 1288 {
1284 // File ended 1289 // File ended
1285 llerrs << "Expected message template " 1290 llerrs << "Expected message template "
@@ -1316,7 +1321,7 @@ void LLMessageSystem::loadTemplateFile(const char* filename)
1316 } 1321 }
1317 1322
1318 // get encoding 1323 // get encoding
1319 if (fscanf(messagefilep, formatString, token) == EOF) 1324 if (fscanf(messagefilep, formatString, token) == EOF) /* Flawfinder: ignore */
1320 { 1325 {
1321 // File ended 1326 // File ended
1322 llerrs << "Expected message encoding, but file ended." 1327 llerrs << "Expected message encoding, but file ended."
@@ -1362,7 +1367,7 @@ void LLMessageSystem::loadTemplateFile(const char* filename)
1362 // ok, need to pull header info 1367 // ok, need to pull header info
1363 1368
1364 // name first 1369 // name first
1365 if (fscanf(messagefilep, formatString, block_name) == EOF) 1370 if (fscanf(messagefilep, formatString, block_name) == EOF) /* Flawfinder: ignore */
1366 { 1371 {
1367 // oops, file ended 1372 // oops, file ended
1368 llerrs << "Expected block name, but file ended" << llendl; 1373 llerrs << "Expected block name, but file ended" << llendl;
@@ -1390,7 +1395,7 @@ void LLMessageSystem::loadTemplateFile(const char* filename)
1390 } 1395 }
1391 1396
1392 // now, block type ("Single", "Multiple", or "Variable") 1397 // now, block type ("Single", "Multiple", or "Variable")
1393 if (fscanf(messagefilep, formatString, token) == EOF) 1398 if (fscanf(messagefilep, formatString, token) == EOF) /* Flawfinder: ignore */
1394 { 1399 {
1395 // oops, file ended 1400 // oops, file ended
1396 llerrs << "Expected block type, but file ended." << llendl; 1401 llerrs << "Expected block type, but file ended." << llendl;
@@ -1415,7 +1420,7 @@ void LLMessageSystem::loadTemplateFile(const char* filename)
1415 else if (!strcmp(token, "Multiple")) 1420 else if (!strcmp(token, "Multiple"))
1416 { 1421 {
1417 // need to get the number of repeats 1422 // need to get the number of repeats
1418 if (fscanf(messagefilep, formatString, token) == EOF) 1423 if (fscanf(messagefilep, formatString, token) == EOF) /* Flawfinder: ignore */
1419 { 1424 {
1420 // oops, file ended 1425 // oops, file ended
1421 llerrs << "Expected block multiple count," 1426 llerrs << "Expected block multiple count,"
@@ -1471,7 +1476,7 @@ void LLMessageSystem::loadTemplateFile(const char* filename)
1471 // ok, need to pull header info 1476 // ok, need to pull header info
1472 1477
1473 // name first 1478 // name first
1474 if (fscanf(messagefilep, formatString, var_name) == EOF) 1479 if (fscanf(messagefilep, formatString, var_name) == EOF) /* Flawfinder: ignore */
1475 { 1480 {
1476 // oops, file ended 1481 // oops, file ended
1477 llerrs << "Expected variable name, but file ended." 1482 llerrs << "Expected variable name, but file ended."
@@ -1500,7 +1505,7 @@ void LLMessageSystem::loadTemplateFile(const char* filename)
1500 } 1505 }
1501 1506
1502 // now, variable type ("Fixed" or "Variable") 1507 // now, variable type ("Fixed" or "Variable")
1503 if (fscanf(messagefilep, formatString, token) == EOF) 1508 if (fscanf(messagefilep, formatString, token) == EOF) /* Flawfinder: ignore */
1504 { 1509 {
1505 // oops, file ended 1510 // oops, file ended
1506 llerrs << "Expected variable type, but file ended" 1511 llerrs << "Expected variable type, but file ended"
@@ -1594,7 +1599,7 @@ void LLMessageSystem::loadTemplateFile(const char* filename)
1594 else if (!strcmp(token, "Fixed")) 1599 else if (!strcmp(token, "Fixed"))
1595 { 1600 {
1596 // need to get the variable size 1601 // need to get the variable size
1597 if (fscanf(messagefilep, formatString, token) == EOF) 1602 if (fscanf(messagefilep, formatString, token) == EOF) /* Flawfinder: ignore */
1598 { 1603 {
1599 // oops, file ended 1604 // oops, file ended
1600 llerrs << "Expected variable size, but file ended" 1605 llerrs << "Expected variable size, but file ended"
@@ -1627,7 +1632,7 @@ void LLMessageSystem::loadTemplateFile(const char* filename)
1627 else if (!strcmp(token, "Variable")) 1632 else if (!strcmp(token, "Variable"))
1628 { 1633 {
1629 // need to get the variable size 1634 // need to get the variable size
1630 if (fscanf(messagefilep, formatString, token) == EOF) 1635 if (fscanf(messagefilep, formatString, token) == EOF) /* Flawfinder: ignore */
1631 { 1636 {
1632 // oops, file ended 1637 // oops, file ended
1633 llerrs << "Expected variable size, but file ended" 1638 llerrs << "Expected variable size, but file ended"
@@ -1676,7 +1681,7 @@ void LLMessageSystem::loadTemplateFile(const char* filename)
1676 if (!strcmp(token, "version")) 1681 if (!strcmp(token, "version"))
1677 { 1682 {
1678 // version number 1683 // version number
1679 if (fscanf(messagefilep, formatString, token) == EOF) 1684 if (fscanf(messagefilep, formatString, token) == EOF) /* Flawfinder: ignore */
1680 { 1685 {
1681 // oops, file ended 1686 // oops, file ended
1682 llerrs << "Expected version number, but file ended" 1687 llerrs << "Expected version number, but file ended"
@@ -1815,14 +1820,27 @@ BOOL LLMessageSystem::checkMessages( S64 frame_count )
1815 else 1820 else
1816 { 1821 {
1817 LLHost host; 1822 LLHost host;
1818 LLCircuitData *cdp; 1823 LLCircuitData* cdp;
1819 1824
1820 // note if packet acks are appended. 1825 // note if packet acks are appended.
1821 if(buffer[0] & LL_ACK_FLAG) 1826 if(buffer[0] & LL_ACK_FLAG)
1822 { 1827 {
1823 acks += buffer[--mReceiveSize]; 1828 acks += buffer[--mReceiveSize];
1824 true_rcv_size = mReceiveSize; 1829 true_rcv_size = mReceiveSize;
1825 mReceiveSize -= acks * sizeof(TPACKETID); 1830 if(mReceiveSize >= ((S32)(acks * sizeof(TPACKETID) + LL_MINIMUM_VALID_PACKET_SIZE)))
1831 {
1832 mReceiveSize -= acks * sizeof(TPACKETID);
1833 }
1834 else
1835 {
1836 // mal-formed packet. ignore it and continue with
1837 // the next one
1838 llwarns << "Malformed packet received. Packet size "
1839 << mReceiveSize << " with invalid no. of acks " << acks
1840 << llendl;
1841 valid_packet = FALSE;
1842 continue;
1843 }
1826 } 1844 }
1827 1845
1828 // process the message as normal 1846 // process the message as normal
@@ -2734,7 +2752,7 @@ void LLMessageSystem::buildMessage()
2734 temp_block_number = (U8)mbci->mBlockNumber; 2752 temp_block_number = (U8)mbci->mBlockNumber;
2735 if ((S32)(mSendSize + sizeof(U8)) < MAX_BUFFER_SIZE) 2753 if ((S32)(mSendSize + sizeof(U8)) < MAX_BUFFER_SIZE)
2736 { 2754 {
2737 memcpy(&mSendBuffer[mSendSize], &temp_block_number, sizeof(U8)); 2755 memcpy(&mSendBuffer[mSendSize], &temp_block_number, sizeof(U8)); /* Flawfinder: ignore */
2738 mSendSize += sizeof(U8); 2756 mSendSize += sizeof(U8);
2739 } 2757 }
2740 else 2758 else
@@ -2811,7 +2829,7 @@ void LLMessageSystem::buildMessage()
2811 { 2829 {
2812 if(mSendSize + mvci.getSize() < (S32)sizeof(mSendBuffer)) 2830 if(mSendSize + mvci.getSize() < (S32)sizeof(mSendBuffer))
2813 { 2831 {
2814 memcpy( 2832 memcpy( /* Flawfinder: ignore */
2815 &mSendBuffer[mSendSize], 2833 &mSendBuffer[mSendSize],
2816 mvci.getData(), 2834 mvci.getData(),
2817 mvci.getSize()); 2835 mvci.getSize());
@@ -3077,7 +3095,7 @@ S32 LLMessageSystem::sendMessage(const LLHost &host)
3077 3095
3078 if((S32)(buffer_length + sizeof(TPACKETID)) < MAX_BUFFER_SIZE) 3096 if((S32)(buffer_length + sizeof(TPACKETID)) < MAX_BUFFER_SIZE)
3079 { 3097 {
3080 memcpy(&buf_ptr[buffer_length], &packet_id, sizeof(TPACKETID)); 3098 memcpy(&buf_ptr[buffer_length], &packet_id, sizeof(TPACKETID)); /* Flawfinder: ignore */
3081 // Do the accounting 3099 // Do the accounting
3082 buffer_length += sizeof(TPACKETID); 3100 buffer_length += sizeof(TPACKETID);
3083 } 3101 }
@@ -3185,7 +3203,7 @@ BOOL LLMessageSystem::decodeTemplate(
3185 // it appears that if there is a NULL in the message #, it won't copy it.... 3203 // it appears that if there is a NULL in the message #, it won't copy it....
3186 // what was the goal? 3204 // what was the goal?
3187 //if(header[2]) 3205 //if(header[2])
3188 memcpy(&message_id_U16, &header[2], 2); 3206 memcpy(&message_id_U16, &header[2], 2); /* Flawfinder: ignore */
3189 3207
3190 // dependant on endian-ness: 3208 // dependant on endian-ness:
3191 // U32 temp = (255 << 24) | (255 << 16) | header[2]; 3209 // U32 temp = (255 << 24) | (255 << 16) | header[2];
@@ -3343,7 +3361,7 @@ BOOL LLMessageSystem::decodeData(const U8* buffer, const LLHost& sender )
3343 3361
3344 // create base working data set 3362 // create base working data set
3345 mCurrentRMessageData = new LLMsgData(mCurrentRMessageTemplate->mName); 3363 mCurrentRMessageData = new LLMsgData(mCurrentRMessageTemplate->mName);
3346 3364
3347 // loop through the template building the data structure as we go 3365 // loop through the template building the data structure as we go
3348 for (LLMessageTemplate::message_block_map_t::iterator iter = mCurrentRMessageTemplate->mMemberBlocks.begin(); 3366 for (LLMessageTemplate::message_block_map_t::iterator iter = mCurrentRMessageTemplate->mMemberBlocks.begin();
3349 iter != mCurrentRMessageTemplate->mMemberBlocks.end(); iter++) 3367 iter != mCurrentRMessageTemplate->mMemberBlocks.end(); iter++)
@@ -3596,7 +3614,7 @@ void LLMessageSystem::getDataFast(const char *blockname, const char *varname, vo
3596 ((U32*)datap)[1] = ((U32*)vardata.getData())[1]; 3614 ((U32*)datap)[1] = ((U32*)vardata.getData())[1];
3597 break; 3615 break;
3598 default: 3616 default:
3599 memcpy(datap, vardata.getData(), vardata_size); 3617 memcpy(datap, vardata.getData(), vardata_size); /* Flawfinder: ignore */
3600 break; 3618 break;
3601 } 3619 }
3602 } 3620 }
@@ -3608,7 +3626,7 @@ void LLMessageSystem::getDataFast(const char *blockname, const char *varname, vo
3608 << " but truncated to max size of " << max_size 3626 << " but truncated to max size of " << max_size
3609 << llendl; 3627 << llendl;
3610 3628
3611 memcpy(datap, vardata.getData(), max_size); 3629 memcpy(datap, vardata.getData(), max_size); /* Flawfinder: ignore */
3612 } 3630 }
3613} 3631}
3614 3632
@@ -4403,33 +4421,6 @@ void process_secured_template_checksum_request(LLMessageSystem* msg, void**)
4403 send_template_reply(msg, token); 4421 send_template_reply(msg, token);
4404} 4422}
4405 4423
4406void process_log_control(LLMessageSystem* msg, void**)
4407{
4408 U8 level;
4409 U32 mask;
4410 BOOL time;
4411 BOOL location;
4412 BOOL remote_infos;
4413
4414 msg->getU8Fast(_PREHASH_Options, _PREHASH_Level, level);
4415 msg->getU32Fast(_PREHASH_Options, _PREHASH_Mask, mask);
4416 msg->getBOOLFast(_PREHASH_Options, _PREHASH_Time, time);
4417 msg->getBOOLFast(_PREHASH_Options, _PREHASH_Location, location);
4418 msg->getBOOLFast(_PREHASH_Options, _PREHASH_RemoteInfos, remote_infos);
4419
4420 gErrorStream.setLevel(LLErrorStream::ELevel(level));
4421 gErrorStream.setDebugMask(mask);
4422 gErrorStream.setTime(time);
4423 gErrorStream.setPrintLocation(location);
4424 gErrorStream.setElevatedRemote(remote_infos);
4425
4426 llinfos << "Logging set to level " << gErrorStream.getLevel()
4427 << " mask " << std::hex << gErrorStream.getDebugMask() << std::dec
4428 << " time " << gErrorStream.getTime()
4429 << " loc " << gErrorStream.getPrintLocation()
4430 << llendl;
4431}
4432
4433void process_log_messages(LLMessageSystem* msg, void**) 4424void process_log_messages(LLMessageSystem* msg, void**)
4434{ 4425{
4435 U8 log_message; 4426 U8 log_message;
@@ -4475,7 +4466,7 @@ void process_create_trusted_circuit(LLMessageSystem *msg, void **)
4475 return; 4466 return;
4476 } 4467 }
4477 4468
4478 char their_digest[MD5HEX_STR_SIZE]; 4469 char their_digest[MD5HEX_STR_SIZE]; /* Flawfinder: ignore */
4479 S32 size = msg->getSizeFast(_PREHASH_DataBlock, _PREHASH_Digest); 4470 S32 size = msg->getSizeFast(_PREHASH_DataBlock, _PREHASH_Digest);
4480 if(size != MD5HEX_STR_BYTES) 4471 if(size != MD5HEX_STR_BYTES)
4481 { 4472 {
@@ -4555,7 +4546,7 @@ void encrypt_template(const char *src_name, const char *dest_name)
4555BOOL decrypt_template(const char *src_name, const char *dest_name) 4546BOOL decrypt_template(const char *src_name, const char *dest_name)
4556{ 4547{
4557 S32 buf_length = LL_ENCRYPT_BUF_LENGTH; 4548 S32 buf_length = LL_ENCRYPT_BUF_LENGTH;
4558 char buf[LL_ENCRYPT_BUF_LENGTH]; 4549 char buf[LL_ENCRYPT_BUF_LENGTH]; /* Flawfinder: ignore */
4559 4550
4560 FILE* infp = NULL; 4551 FILE* infp = NULL;
4561 FILE* outfp = NULL; 4552 FILE* outfp = NULL;
@@ -4570,7 +4561,7 @@ BOOL decrypt_template(const char *src_name, const char *dest_name)
4570 goto exit; 4561 goto exit;
4571 } 4562 }
4572 4563
4573 infp = LLFile::fopen(src_name,"rb"); 4564 infp = LLFile::fopen(src_name,"rb"); /* Flawfinder: ignore */
4574 if (!infp) 4565 if (!infp)
4575 { 4566 {
4576 llwarns << "could not open " << src_name << " for reading" << llendl; 4567 llwarns << "could not open " << src_name << " for reading" << llendl;
@@ -4583,7 +4574,7 @@ BOOL decrypt_template(const char *src_name, const char *dest_name)
4583 goto exit; 4574 goto exit;
4584 } 4575 }
4585 4576
4586 outfp = LLFile::fopen(dest_name,"w+b"); 4577 outfp = LLFile::fopen(dest_name,"w+b"); /* Flawfinder: ignore */
4587 if (!outfp) 4578 if (!outfp)
4588 { 4579 {
4589 llwarns << "could not open " << src_name << " for writing" << llendl; 4580 llwarns << "could not open " << src_name << " for writing" << llendl;
@@ -4618,7 +4609,7 @@ BOOL decrypt_template(const char *src_name, const char *dest_name)
4618void dump_prehash_files() 4609void dump_prehash_files()
4619{ 4610{
4620 U32 i; 4611 U32 i;
4621 FILE *fp = LLFile::fopen("../../indra/llmessage/message_prehash.h", "w"); 4612 FILE* fp = LLFile::fopen("../../indra/llmessage/message_prehash.h", "w"); /* Flawfinder: ignore */
4622 if (fp) 4613 if (fp)
4623 { 4614 {
4624 fprintf( 4615 fprintf(
@@ -4650,7 +4641,7 @@ void dump_prehash_files()
4650 fprintf(fp, "\n\n#endif\n"); 4641 fprintf(fp, "\n\n#endif\n");
4651 fclose(fp); 4642 fclose(fp);
4652 } 4643 }
4653 fp = LLFile::fopen("../../indra/llmessage/message_prehash.cpp", "w"); 4644 fp = LLFile::fopen("../../indra/llmessage/message_prehash.cpp", "w"); /* Flawfinder: ignore */
4654 if (fp) 4645 if (fp)
4655 { 4646 {
4656 fprintf( 4647 fprintf(
@@ -4750,7 +4741,6 @@ BOOL start_messaging_system(
4750 gMessageSystem->setHandlerFuncFast(_PREHASH_PacketAck, process_packet_ack, NULL); 4741 gMessageSystem->setHandlerFuncFast(_PREHASH_PacketAck, process_packet_ack, NULL);
4751 gMessageSystem->setHandlerFuncFast(_PREHASH_TemplateChecksumRequest, process_template_checksum_request, NULL); 4742 gMessageSystem->setHandlerFuncFast(_PREHASH_TemplateChecksumRequest, process_template_checksum_request, NULL);
4752 gMessageSystem->setHandlerFuncFast(_PREHASH_SecuredTemplateChecksumRequest, process_secured_template_checksum_request, NULL); 4743 gMessageSystem->setHandlerFuncFast(_PREHASH_SecuredTemplateChecksumRequest, process_secured_template_checksum_request, NULL);
4753 gMessageSystem->setHandlerFuncFast(_PREHASH_LogControl, process_log_control, NULL);
4754 gMessageSystem->setHandlerFuncFast(_PREHASH_LogMessages, process_log_messages, NULL); 4744 gMessageSystem->setHandlerFuncFast(_PREHASH_LogMessages, process_log_messages, NULL);
4755 gMessageSystem->setHandlerFuncFast(_PREHASH_CreateTrustedCircuit, 4745 gMessageSystem->setHandlerFuncFast(_PREHASH_CreateTrustedCircuit,
4756 process_create_trusted_circuit, 4746 process_create_trusted_circuit,
@@ -5565,13 +5555,21 @@ void LLMessageSystem::getUUID(const char *block, const char *var, LLUUID &u, S32
5565 getDataFast(gMessageStringTable.getString(block), gMessageStringTable.getString(var), u.mData, sizeof(u.mData), blocknum); 5555 getDataFast(gMessageStringTable.getString(block), gMessageStringTable.getString(var), u.mData, sizeof(u.mData), blocknum);
5566} 5556}
5567 5557
5568bool LLMessageSystem::generateDigestForNumberAndUUIDs(char* digest, const U32 number, const LLUUID &id1, const LLUUID &id2) const 5558bool LLMessageSystem::generateDigestForNumberAndUUIDs(
5559 char* digest,
5560 const U32 number,
5561 const LLUUID& id1,
5562 const LLUUID& id2) const
5569{ 5563{
5564 // *NOTE: This method is needlessly inefficient. Instead of
5565 // calling LLUUID::asString, it should just call
5566 // LLUUID::toString().
5567
5570 const char *colon = ":"; 5568 const char *colon = ":";
5571 char tbuf[16]; /* Flawfinder: ignore */ 5569 char tbuf[16]; /* Flawfinder: ignore */
5572 LLMD5 d; 5570 LLMD5 d;
5573 LLString id1string = id1.getString(); 5571 std::string id1string = id1.asString();
5574 LLString id2string = id2.getString(); 5572 std::string id2string = id2.asString();
5575 std::string shared_secret = get_shared_secret(); 5573 std::string shared_secret = get_shared_secret();
5576 unsigned char * secret = (unsigned char*)shared_secret.c_str(); 5574 unsigned char * secret = (unsigned char*)shared_secret.c_str();
5577 unsigned char * id1str = (unsigned char*)id1string.c_str(); 5575 unsigned char * id1str = (unsigned char*)id1string.c_str();
@@ -5581,7 +5579,7 @@ bool LLMessageSystem::generateDigestForNumberAndUUIDs(char* digest, const U32 nu
5581 5579
5582 if( secret != NULL) 5580 if( secret != NULL)
5583 { 5581 {
5584 d.update(secret, (U32)strlen((char *) secret)); 5582 d.update(secret, (U32)strlen((char *) secret)); /* Flawfinder: ignore */
5585 } 5583 }
5586 5584
5587 d.update((const unsigned char *) colon, (U32)strlen(colon)); /* Flawfinder: ignore */ 5585 d.update((const unsigned char *) colon, (U32)strlen(colon)); /* Flawfinder: ignore */
@@ -5592,13 +5590,13 @@ bool LLMessageSystem::generateDigestForNumberAndUUIDs(char* digest, const U32 nu
5592 d.update((const unsigned char *) colon, (U32)strlen(colon)); /* Flawfinder: ignore */ 5590 d.update((const unsigned char *) colon, (U32)strlen(colon)); /* Flawfinder: ignore */
5593 if( (char*) id1str != NULL) 5591 if( (char*) id1str != NULL)
5594 { 5592 {
5595 d.update(id1str, (U32)strlen((char *) id1str)); 5593 d.update(id1str, (U32)strlen((char *) id1str)); /* Flawfinder: ignore */
5596 } 5594 }
5597 d.update((const unsigned char *) colon, (U32)strlen(colon)); /* Flawfinder: ignore */ 5595 d.update((const unsigned char *) colon, (U32)strlen(colon)); /* Flawfinder: ignore */
5598 5596
5599 if( (char*) id2str != NULL) 5597 if( (char*) id2str != NULL)
5600 { 5598 {
5601 d.update(id2str, (U32)strlen((char *) id2str)); 5599 d.update(id2str, (U32)strlen((char *) id2str)); /* Flawfinder: ignore */
5602 } 5600 }
5603 5601
5604 d.finalize(); 5602 d.finalize();
diff --git a/linden/indra/llmessage/message.h b/linden/indra/llmessage/message.h
index df062e7..5cc3ec1 100644
--- a/linden/indra/llmessage/message.h
+++ b/linden/indra/llmessage/message.h
@@ -206,6 +206,8 @@ class LLMessagePollInfo;
206 206
207class LLMessageSystem 207class LLMessageSystem
208{ 208{
209 LOG_CLASS(LLMessageSystem);
210
209public: 211public:
210 U8 mSendBuffer[MAX_BUFFER_SIZE]; 212 U8 mSendBuffer[MAX_BUFFER_SIZE];
211 // Encoded send buffer needs to be slightly larger since the zero 213 // Encoded send buffer needs to be slightly larger since the zero
@@ -438,6 +440,7 @@ public:
438 void addStringFast( const char* varname, const std::string& s); // typed, checks storage space 440 void addStringFast( const char* varname, const std::string& s); // typed, checks storage space
439 void addString( const char* varname, const std::string& s); // typed, checks storage space 441 void addString( const char* varname, const std::string& s); // typed, checks storage space
440 442
443 TPACKETID getCurrentRecvPacketID() { return mCurrentRecvPacketID; }
441 S32 getCurrentSendTotal() const { return mCurrentSendTotal; } 444 S32 getCurrentSendTotal() const { return mCurrentSendTotal; }
442 445
443 // This method checks for current send total and returns true if 446 // This method checks for current send total and returns true if
@@ -776,7 +779,6 @@ BOOL start_messaging_system(
776void end_messaging_system(); 779void end_messaging_system();
777 780
778void null_message_callback(LLMessageSystem *msg, void **data); 781void null_message_callback(LLMessageSystem *msg, void **data);
779void process_log_control(LLMessageSystem* msg, void**);
780 782
781// 783//
782// Inlines 784// Inlines
diff --git a/linden/indra/llmessage/message_prehash.cpp b/linden/indra/llmessage/message_prehash.cpp
index 2753c87..ef01c82 100644
--- a/linden/indra/llmessage/message_prehash.cpp
+++ b/linden/indra/llmessage/message_prehash.cpp
@@ -508,7 +508,6 @@ char * _PREHASH_NVPair;
508char * _PREHASH_ObjectSpinStart; 508char * _PREHASH_ObjectSpinStart;
509char * _PREHASH_UseEstateSun; 509char * _PREHASH_UseEstateSun;
510char * _PREHASH_LogoutBlock; 510char * _PREHASH_LogoutBlock;
511char * _PREHASH_RelayLogControl;
512char * _PREHASH_RegionID; 511char * _PREHASH_RegionID;
513char * _PREHASH_Creator; 512char * _PREHASH_Creator;
514char * _PREHASH_ProposalText; 513char * _PREHASH_ProposalText;
@@ -1313,7 +1312,6 @@ char * _PREHASH_AssetBlock;
1313char * _PREHASH_AcceptNotices; 1312char * _PREHASH_AcceptNotices;
1314char * _PREHASH_SetGroupAcceptNotices; 1313char * _PREHASH_SetGroupAcceptNotices;
1315char * _PREHASH_CloseCircuit; 1314char * _PREHASH_CloseCircuit;
1316char * _PREHASH_LogControl;
1317char * _PREHASH_TeleportFinish; 1315char * _PREHASH_TeleportFinish;
1318char * _PREHASH_PathRevolutions; 1316char * _PREHASH_PathRevolutions;
1319char * _PREHASH_ClassifiedInfoReply; 1317char * _PREHASH_ClassifiedInfoReply;
@@ -1982,7 +1980,6 @@ void init_prehash_data()
1982 _PREHASH_ObjectSpinStart = gMessageStringTable.getString("ObjectSpinStart"); 1980 _PREHASH_ObjectSpinStart = gMessageStringTable.getString("ObjectSpinStart");
1983 _PREHASH_UseEstateSun = gMessageStringTable.getString("UseEstateSun"); 1981 _PREHASH_UseEstateSun = gMessageStringTable.getString("UseEstateSun");
1984 _PREHASH_LogoutBlock = gMessageStringTable.getString("LogoutBlock"); 1982 _PREHASH_LogoutBlock = gMessageStringTable.getString("LogoutBlock");
1985 _PREHASH_RelayLogControl = gMessageStringTable.getString("RelayLogControl");
1986 _PREHASH_RegionID = gMessageStringTable.getString("RegionID"); 1983 _PREHASH_RegionID = gMessageStringTable.getString("RegionID");
1987 _PREHASH_Creator = gMessageStringTable.getString("Creator"); 1984 _PREHASH_Creator = gMessageStringTable.getString("Creator");
1988 _PREHASH_ProposalText = gMessageStringTable.getString("ProposalText"); 1985 _PREHASH_ProposalText = gMessageStringTable.getString("ProposalText");
@@ -2787,7 +2784,6 @@ void init_prehash_data()
2787 _PREHASH_AcceptNotices = gMessageStringTable.getString("AcceptNotices"); 2784 _PREHASH_AcceptNotices = gMessageStringTable.getString("AcceptNotices");
2788 _PREHASH_SetGroupAcceptNotices = gMessageStringTable.getString("SetGroupAcceptNotices"); 2785 _PREHASH_SetGroupAcceptNotices = gMessageStringTable.getString("SetGroupAcceptNotices");
2789 _PREHASH_CloseCircuit = gMessageStringTable.getString("CloseCircuit"); 2786 _PREHASH_CloseCircuit = gMessageStringTable.getString("CloseCircuit");
2790 _PREHASH_LogControl = gMessageStringTable.getString("LogControl");
2791 _PREHASH_TeleportFinish = gMessageStringTable.getString("TeleportFinish"); 2787 _PREHASH_TeleportFinish = gMessageStringTable.getString("TeleportFinish");
2792 _PREHASH_PathRevolutions = gMessageStringTable.getString("PathRevolutions"); 2788 _PREHASH_PathRevolutions = gMessageStringTable.getString("PathRevolutions");
2793 _PREHASH_ClassifiedInfoReply = gMessageStringTable.getString("ClassifiedInfoReply"); 2789 _PREHASH_ClassifiedInfoReply = gMessageStringTable.getString("ClassifiedInfoReply");
diff --git a/linden/indra/llmessage/message_prehash.h b/linden/indra/llmessage/message_prehash.h
index aee8045..9cb4884 100644
--- a/linden/indra/llmessage/message_prehash.h
+++ b/linden/indra/llmessage/message_prehash.h
@@ -508,7 +508,6 @@ extern char * _PREHASH_NVPair;
508extern char * _PREHASH_ObjectSpinStart; 508extern char * _PREHASH_ObjectSpinStart;
509extern char * _PREHASH_UseEstateSun; 509extern char * _PREHASH_UseEstateSun;
510extern char * _PREHASH_LogoutBlock; 510extern char * _PREHASH_LogoutBlock;
511extern char * _PREHASH_RelayLogControl;
512extern char * _PREHASH_RegionID; 511extern char * _PREHASH_RegionID;
513extern char * _PREHASH_Creator; 512extern char * _PREHASH_Creator;
514extern char * _PREHASH_ProposalText; 513extern char * _PREHASH_ProposalText;
@@ -1313,7 +1312,6 @@ extern char * _PREHASH_AssetBlock;
1313extern char * _PREHASH_AcceptNotices; 1312extern char * _PREHASH_AcceptNotices;
1314extern char * _PREHASH_SetGroupAcceptNotices; 1313extern char * _PREHASH_SetGroupAcceptNotices;
1315extern char * _PREHASH_CloseCircuit; 1314extern char * _PREHASH_CloseCircuit;
1316extern char * _PREHASH_LogControl;
1317extern char * _PREHASH_TeleportFinish; 1315extern char * _PREHASH_TeleportFinish;
1318extern char * _PREHASH_PathRevolutions; 1316extern char * _PREHASH_PathRevolutions;
1319extern char * _PREHASH_ClassifiedInfoReply; 1317extern char * _PREHASH_ClassifiedInfoReply;
diff --git a/linden/indra/llmessage/message_string_table.cpp b/linden/indra/llmessage/message_string_table.cpp
index 88e073b..7fea048 100644
--- a/linden/indra/llmessage/message_string_table.cpp
+++ b/linden/indra/llmessage/message_string_table.cpp
@@ -76,7 +76,7 @@ char* LLMessageStringTable::getString(const char *str)
76 } 76 }
77 } 77 }
78 // not found, so add! 78 // not found, so add!
79 strncpy(mString[hash_value], str, MESSAGE_MAX_STRINGS_LENGTH); 79 strncpy(mString[hash_value], str, MESSAGE_MAX_STRINGS_LENGTH); /* Flawfinder: ignore */
80 mString[hash_value][MESSAGE_MAX_STRINGS_LENGTH - 1] = 0; 80 mString[hash_value][MESSAGE_MAX_STRINGS_LENGTH - 1] = 0;
81 mEmpty[hash_value] = FALSE; 81 mEmpty[hash_value] = FALSE;
82 mUsed++; 82 mUsed++;
diff --git a/linden/indra/llmessage/net.cpp b/linden/indra/llmessage/net.cpp
index d21165e..de19ef8 100644
--- a/linden/indra/llmessage/net.cpp
+++ b/linden/indra/llmessage/net.cpp
@@ -143,7 +143,7 @@ char *u32_to_ip_string(U32 ip, char *ip_string)
143 if (result != NULL) 143 if (result != NULL)
144 { 144 {
145 //the function signature needs to change to pass in the lengfth of first and last. 145 //the function signature needs to change to pass in the lengfth of first and last.
146 strcpy(ip_string, result); 146 strcpy(ip_string, result); /*Flawfinder: ignore*/
147 return ip_string; 147 return ip_string;
148 } 148 }
149 else 149 else
diff --git a/linden/indra/llmessage/partsyspacket.cpp b/linden/indra/llmessage/partsyspacket.cpp
index d491540..d6ba11e 100644
--- a/linden/indra/llmessage/partsyspacket.cpp
+++ b/linden/indra/llmessage/partsyspacket.cpp
@@ -1265,7 +1265,7 @@ BOOL LLPartSysCompressedPacket::fromUnsignedBytes(U8 *in, U32 bytesUsed)
1265{ 1265{
1266 if ((in != NULL) && (bytesUsed <= sizeof(mData))) 1266 if ((in != NULL) && (bytesUsed <= sizeof(mData)))
1267 { 1267 {
1268 memcpy(mData, in, bytesUsed); 1268 memcpy(mData, in, bytesUsed); /* Flawfinder: ignore */
1269 mNumBytes = bytesUsed; 1269 mNumBytes = bytesUsed;
1270 return TRUE; 1270 return TRUE;
1271 } 1271 }
diff --git a/linden/indra/llprimitive/llmaterialtable.h b/linden/indra/llprimitive/llmaterialtable.h
index 12be1e9..a472274 100644
--- a/linden/indra/llprimitive/llmaterialtable.h
+++ b/linden/indra/llprimitive/llmaterialtable.h
@@ -38,7 +38,7 @@ class LLMaterialInfo
38{ 38{
39public: 39public:
40 U8 mMCode; 40 U8 mMCode;
41 char mName[LLMATERIAL_INFO_NAME_LENGTH]; 41 char mName[LLMATERIAL_INFO_NAME_LENGTH]; /* Flawfinder: ignore */
42 LLUUID mDefaultTextureID; 42 LLUUID mDefaultTextureID;
43 LLUUID mShatterSoundID; 43 LLUUID mShatterSoundID;
44 F32 mDensity; // kg/m^3 44 F32 mDensity; // kg/m^3
diff --git a/linden/indra/llprimitive/llprimitive.cpp b/linden/indra/llprimitive/llprimitive.cpp
index 5fb95c8..859a34f 100644
--- a/linden/indra/llprimitive/llprimitive.cpp
+++ b/linden/indra/llprimitive/llprimitive.cpp
@@ -707,13 +707,13 @@ U8 LLPrimitive::pCodeToLegacy(const LLPCode pcode)
707// Don't crash or llerrs here! This function is used for debug strings. 707// Don't crash or llerrs here! This function is used for debug strings.
708const char * LLPrimitive::pCodeToString(const LLPCode pcode) 708const char * LLPrimitive::pCodeToString(const LLPCode pcode)
709{ 709{
710 static char pcode_string[255]; 710 static char pcode_string[255]; /* Flawfinder: ignore */
711 711
712 U8 base_code = pcode & LL_PCODE_BASE_MASK; 712 U8 base_code = pcode & LL_PCODE_BASE_MASK;
713 pcode_string[0] = 0; 713 pcode_string[0] = 0;
714 if (!pcode) 714 if (!pcode)
715 { 715 {
716 sprintf(pcode_string, "null"); 716 snprintf(pcode_string, sizeof(pcode_string), "null"); /* Flawfinder: ignore */
717 } 717 }
718 else if ((base_code) == LL_PCODE_LEGACY) 718 else if ((base_code) == LL_PCODE_LEGACY)
719 { 719 {
@@ -721,66 +721,66 @@ const char * LLPrimitive::pCodeToString(const LLPCode pcode)
721 switch (pcode) 721 switch (pcode)
722 { 722 {
723 case LL_PCODE_LEGACY_GRASS: 723 case LL_PCODE_LEGACY_GRASS:
724 sprintf(pcode_string, "grass"); 724 snprintf(pcode_string, sizeof(pcode_string), "grass"); /* Flawfinder: ignore */
725 break; 725 break;
726 case LL_PCODE_LEGACY_PART_SYS: 726 case LL_PCODE_LEGACY_PART_SYS:
727 sprintf(pcode_string, "particle system"); 727 snprintf(pcode_string, sizeof(pcode_string), "particle system"); /* Flawfinder: ignore */
728 break; 728 break;
729 case LL_PCODE_LEGACY_AVATAR: 729 case LL_PCODE_LEGACY_AVATAR:
730 sprintf(pcode_string, "avatar"); 730 snprintf(pcode_string, sizeof(pcode_string), "avatar"); /* Flawfinder: ignore */
731 break; 731 break;
732 case LL_PCODE_LEGACY_TEXT_BUBBLE: 732 case LL_PCODE_LEGACY_TEXT_BUBBLE:
733 sprintf(pcode_string, "text bubble"); 733 snprintf(pcode_string, sizeof(pcode_string), "text bubble"); /* Flawfinder: ignore */
734 break; 734 break;
735 case LL_PCODE_LEGACY_TREE: 735 case LL_PCODE_LEGACY_TREE:
736 sprintf(pcode_string, "tree"); 736 snprintf(pcode_string, sizeof(pcode_string), "tree"); /* Flawfinder: ignore */
737 break; 737 break;
738 case LL_PCODE_TREE_NEW: 738 case LL_PCODE_TREE_NEW:
739 sprintf(pcode_string, "tree_new"); 739 snprintf(pcode_string, sizeof(pcode_string), "tree_new"); /* Flawfinder: ignore */
740 break; 740 break;
741 default: 741 default:
742 sprintf(pcode_string, "unknown legacy pcode %i",(U32)pcode); 742 snprintf(pcode_string, sizeof(pcode_string), "unknown legacy pcode %i",(U32)pcode); /* Flawfinder: ignore */
743 } 743 }
744 } 744 }
745 else 745 else
746 { 746 {
747 char shape[32]; 747 char shape[32]; /* Flawfinder: ignore */
748 char mask[32]; 748 char mask[32]; /* Flawfinder: ignore */
749 if (base_code == LL_PCODE_CUBE) 749 if (base_code == LL_PCODE_CUBE)
750 { 750 {
751 sprintf(shape, "cube"); 751 snprintf(shape, sizeof(shape), "cube"); /* Flawfinder: ignore */
752 } 752 }
753 else if (base_code == LL_PCODE_CYLINDER) 753 else if (base_code == LL_PCODE_CYLINDER)
754 { 754 {
755 sprintf(shape, "cylinder"); 755 snprintf(shape, sizeof(shape), "cylinder"); /* Flawfinder: ignore */
756 } 756 }
757 else if (base_code == LL_PCODE_CONE) 757 else if (base_code == LL_PCODE_CONE)
758 { 758 {
759 sprintf(shape, "cone"); 759 snprintf(shape, sizeof(shape), "cone"); /* Flawfinder: ignore */
760 } 760 }
761 else if (base_code == LL_PCODE_PRISM) 761 else if (base_code == LL_PCODE_PRISM)
762 { 762 {
763 sprintf(shape, "prism"); 763 snprintf(shape, sizeof(shape), "prism"); /* Flawfinder: ignore */
764 } 764 }
765 else if (base_code == LL_PCODE_PYRAMID) 765 else if (base_code == LL_PCODE_PYRAMID)
766 { 766 {
767 sprintf(shape, "pyramid"); 767 snprintf(shape, sizeof(shape), "pyramid"); /* Flawfinder: ignore */
768 } 768 }
769 else if (base_code == LL_PCODE_SPHERE) 769 else if (base_code == LL_PCODE_SPHERE)
770 { 770 {
771 sprintf(shape, "sphere"); 771 snprintf(shape, sizeof(shape), "sphere"); /* Flawfinder: ignore */
772 } 772 }
773 else if (base_code == LL_PCODE_TETRAHEDRON) 773 else if (base_code == LL_PCODE_TETRAHEDRON)
774 { 774 {
775 sprintf(shape, "tetrahedron"); 775 snprintf(shape, sizeof(shape), "tetrahedron"); /* Flawfinder: ignore */
776 } 776 }
777 else if (base_code == LL_PCODE_VOLUME) 777 else if (base_code == LL_PCODE_VOLUME)
778 { 778 {
779 sprintf(shape, "volume"); 779 snprintf(shape, sizeof(shape), "volume"); /* Flawfinder: ignore */
780 } 780 }
781 else if (base_code == LL_PCODE_APP) 781 else if (base_code == LL_PCODE_APP)
782 { 782 {
783 sprintf(shape, "app"); 783 snprintf(shape, sizeof(shape), "app"); /* Flawfinder: ignore */
784 } 784 }
785 else 785 else
786 { 786 {
@@ -790,15 +790,15 @@ const char * LLPrimitive::pCodeToString(const LLPCode pcode)
790 U8 mask_code = pcode & (~LL_PCODE_BASE_MASK); 790 U8 mask_code = pcode & (~LL_PCODE_BASE_MASK);
791 if (base_code == LL_PCODE_APP) 791 if (base_code == LL_PCODE_APP)
792 { 792 {
793 sprintf(mask, "%x", mask_code); 793 snprintf(mask, sizeof(mask), "%x", mask_code); /* Flawfinder: ignore */
794 } 794 }
795 else if (mask_code & LL_PCODE_HEMI_MASK) 795 else if (mask_code & LL_PCODE_HEMI_MASK)
796 { 796 {
797 sprintf(mask, "hemi"); 797 snprintf(mask, sizeof(mask), "hemi"); /* Flawfinder: ignore */
798 } 798 }
799 else if (mask != 0) 799 else if (mask != 0)
800 { 800 {
801 sprintf(mask, "%x", mask_code); 801 snprintf(mask, sizeof(mask), "%x", mask_code); /* Flawfinder: ignore */
802 } 802 }
803 else 803 else
804 { 804 {
@@ -807,11 +807,11 @@ const char * LLPrimitive::pCodeToString(const LLPCode pcode)
807 807
808 if (mask[0]) 808 if (mask[0])
809 { 809 {
810 sprintf(pcode_string, "%s-%s", shape, mask); 810 snprintf(pcode_string, sizeof(pcode_string), "%s-%s", shape, mask); /* Flawfinder: ignore */
811 } 811 }
812 else 812 else
813 { 813 {
814 sprintf(pcode_string, "%s", shape); 814 snprintf(pcode_string, sizeof(pcode_string), "%s", shape); /* Flawfinder: ignore */
815 } 815 }
816 } 816 }
817 return pcode_string; 817 return pcode_string;
@@ -1197,7 +1197,7 @@ S32 LLPrimitive::packTEField(U8 *cur_ptr, U8 *data_ptr, U8 data_size, U8 last_fa
1197 { 1197 {
1198 if (!memcmp(data_ptr+(data_size *face_index), data_ptr+(data_size *i), data_size)) 1198 if (!memcmp(data_ptr+(data_size *face_index), data_ptr+(data_size *i), data_size))
1199 { 1199 {
1200 exception_faces |= (1 << i); 1200 exception_faces |= ((U64)1 << i);
1201 } 1201 }
1202 } 1202 }
1203 1203
@@ -1238,7 +1238,7 @@ S32 LLPrimitive::unpackTEField(U8 *cur_ptr, U8 *buffer_end, U8 *data_ptr, U8 dat
1238 for (i = 1; i < face_count; i++) 1238 for (i = 1; i < face_count; i++)
1239 { 1239 {
1240 // Already unswizzled, don't need to unswizzle it again! 1240 // Already unswizzled, don't need to unswizzle it again!
1241 memcpy(data_ptr+(i*data_size),data_ptr,data_size); 1241 memcpy(data_ptr+(i*data_size),data_ptr,data_size); /* Flawfinder: ignore */
1242 } 1242 }
1243 1243
1244 while ((cur_ptr < buffer_end) && (*cur_ptr != 0)) 1244 while ((cur_ptr < buffer_end) && (*cur_ptr != 0))
@@ -1301,7 +1301,7 @@ BOOL LLPrimitive::packTEMessage(LLMessageSystem *mesgsys) const
1301 for (face_index = 0; face_index <= last_face_index; face_index++) 1301 for (face_index = 0; face_index <= last_face_index; face_index++)
1302 { 1302 {
1303 // Directly sending image_ids is not safe! 1303 // Directly sending image_ids is not safe!
1304 memcpy(&image_ids[face_index*16],getTE(face_index)->getID().mData,16); 1304 memcpy(&image_ids[face_index*16],getTE(face_index)->getID().mData,16); /* Flawfinder: ignore */
1305 1305
1306 // Cast LLColor4 to LLColor4U 1306 // Cast LLColor4 to LLColor4U
1307 coloru.setVec( getTE(face_index)->getColor() ); 1307 coloru.setVec( getTE(face_index)->getColor() );
@@ -1377,7 +1377,7 @@ BOOL LLPrimitive::packTEMessage(LLDataPacker &dp) const
1377 for (face_index = 0; face_index <= last_face_index; face_index++) 1377 for (face_index = 0; face_index <= last_face_index; face_index++)
1378 { 1378 {
1379 // Directly sending image_ids is not safe! 1379 // Directly sending image_ids is not safe!
1380 memcpy(&image_ids[face_index*16],getTE(face_index)->getID().mData,16); 1380 memcpy(&image_ids[face_index*16],getTE(face_index)->getID().mData,16); /* Flawfinder: ignore */
1381 1381
1382 // Cast LLColor4 to LLColor4U 1382 // Cast LLColor4 to LLColor4U
1383 coloru.setVec( getTE(face_index)->getColor() ); 1383 coloru.setVec( getTE(face_index)->getColor() );
@@ -1588,7 +1588,7 @@ S32 LLPrimitive::unpackTEMessage(LLDataPacker &dp)
1588 for (i = 0; i < face_count; i++) 1588 for (i = 0; i < face_count; i++)
1589 { 1589 {
1590// llinfos << "BUMP unpack (Datapacker) [" << i << "]=" << S32(bump[i]) <<llendl; 1590// llinfos << "BUMP unpack (Datapacker) [" << i << "]=" << S32(bump[i]) <<llendl;
1591 memcpy(image_ids[i].mData,&image_data[i*16],16); 1591 memcpy(image_ids[i].mData,&image_data[i*16],16); /* Flawfinder: ignore */
1592 } 1592 }
1593 1593
1594 LLColor4 color; 1594 LLColor4 color;
@@ -1628,6 +1628,24 @@ void LLPrimitive::setTextureList(LLTextureEntry *listp)
1628 1628
1629//============================================================================ 1629//============================================================================
1630 1630
1631//static
1632BOOL LLNetworkData::isValid(U16 param_type, U32 size)
1633{
1634 // ew - better mechanism needed
1635
1636 switch(param_type)
1637 {
1638 case PARAMS_FLEXIBLE:
1639 return (size == 16);
1640 case PARAMS_LIGHT:
1641 return (size == 16);
1642 }
1643
1644 return FALSE;
1645}
1646
1647//============================================================================
1648
1631LLLightParams::LLLightParams() 1649LLLightParams::LLLightParams()
1632{ 1650{
1633 mColor.setToWhite(); 1651 mColor.setToWhite();
@@ -1650,12 +1668,22 @@ BOOL LLLightParams::pack(LLDataPacker &dp) const
1650 1668
1651BOOL LLLightParams::unpack(LLDataPacker &dp) 1669BOOL LLLightParams::unpack(LLDataPacker &dp)
1652{ 1670{
1653 LLColor4U color4u; 1671 LLColor4U color;
1654 dp.unpackColor4U(color4u, "color"); 1672 dp.unpackColor4U(color, "color");
1655 mColor = LLColor4(color4u); 1673 setColor(LLColor4(color));
1656 dp.unpackF32(mRadius, "radius"); 1674
1657 dp.unpackF32(mCutoff, "cutoff"); 1675 F32 radius;
1658 dp.unpackF32(mFalloff, "falloff"); 1676 dp.unpackF32(radius, "radius");
1677 setRadius(radius);
1678
1679 F32 cutoff;
1680 dp.unpackF32(cutoff, "cutoff");
1681 setCutoff(cutoff);
1682
1683 F32 falloff;
1684 dp.unpackF32(falloff, "falloff");
1685 setFalloff(falloff);
1686
1659 return TRUE; 1687 return TRUE;
1660} 1688}
1661 1689
diff --git a/linden/indra/llprimitive/llprimitive.h b/linden/indra/llprimitive/llprimitive.h
index e51fdcf..953d284 100644
--- a/linden/indra/llprimitive/llprimitive.h
+++ b/linden/indra/llprimitive/llprimitive.h
@@ -108,6 +108,7 @@ public:
108 virtual BOOL unpack(LLDataPacker &dp) = 0; 108 virtual BOOL unpack(LLDataPacker &dp) = 0;
109 virtual bool operator==(const LLNetworkData& data) const = 0; 109 virtual bool operator==(const LLNetworkData& data) const = 0;
110 virtual void copy(const LLNetworkData& data) = 0; 110 virtual void copy(const LLNetworkData& data) = 0;
111 static BOOL isValid(U16 param_type, U32 size);
111}; 112};
112 113
113extern const F32 LIGHT_MIN_RADIUS; 114extern const F32 LIGHT_MIN_RADIUS;
diff --git a/linden/indra/llprimitive/llprimitive_vc8.vcproj b/linden/indra/llprimitive/llprimitive_vc8.vcproj
new file mode 100644
index 0000000..5fbcbb1
--- /dev/null
+++ b/linden/indra/llprimitive/llprimitive_vc8.vcproj
@@ -0,0 +1,316 @@
1<?xml version="1.0" encoding="Windows-1252"?>
2<VisualStudioProject
3 ProjectType="Visual C++"
4 Version="8.00"
5 Name="llprimitive"
6 ProjectGUID="{FCC4483C-5B84-4944-B91F-4589A219BC0B}"
7 Keyword="Win32Proj"
8 >
9 <Platforms>
10 <Platform
11 Name="Win32"
12 />
13 </Platforms>
14 <ToolFiles>
15 </ToolFiles>
16 <Configurations>
17 <Configuration
18 Name="Debug|Win32"
19 OutputDirectory="../lib_$(ConfigurationName)/i686-win32"
20 IntermediateDirectory="Debug"
21 ConfigurationType="4"
22 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
23 CharacterSet="1"
24 >
25 <Tool
26 Name="VCPreBuildEventTool"
27 />
28 <Tool
29 Name="VCCustomBuildTool"
30 />
31 <Tool
32 Name="VCXMLDataGeneratorTool"
33 />
34 <Tool
35 Name="VCWebServiceProxyGeneratorTool"
36 />
37 <Tool
38 Name="VCMIDLTool"
39 />
40 <Tool
41 Name="VCCLCompilerTool"
42 Optimization="0"
43 AdditionalIncludeDirectories="..\llxml;..\llprimitive;..\llcommon;..\llmath;..\llmessage;..\..\libraries\i686-win32\include;..\..\libraries\include\"
44 PreprocessorDefinitions="WIN32;_DEBUG;_LIB;LL_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;LL_DEBUG"
45 MinimalRebuild="true"
46 BasicRuntimeChecks="3"
47 RuntimeLibrary="1"
48 StructMemberAlignment="4"
49 TreatWChar_tAsBuiltInType="false"
50 ForceConformanceInForLoopScope="true"
51 UsePrecompiledHeader="0"
52 WarningLevel="3"
53 WarnAsError="true"
54 Detect64BitPortabilityProblems="false"
55 DebugInformationFormat="4"
56 />
57 <Tool
58 Name="VCManagedResourceCompilerTool"
59 />
60 <Tool
61 Name="VCResourceCompilerTool"
62 />
63 <Tool
64 Name="VCPreLinkEventTool"
65 />
66 <Tool
67 Name="VCLibrarianTool"
68 OutputFile="$(OutDir)/llprimitive.lib"
69 />
70 <Tool
71 Name="VCALinkTool"
72 />
73 <Tool
74 Name="VCXDCMakeTool"
75 />
76 <Tool
77 Name="VCBscMakeTool"
78 />
79 <Tool
80 Name="VCFxCopTool"
81 />
82 <Tool
83 Name="VCPostBuildEventTool"
84 />
85 </Configuration>
86 <Configuration
87 Name="Release|Win32"
88 OutputDirectory="../lib_$(ConfigurationName)/i686-win32"
89 IntermediateDirectory="Release"
90 ConfigurationType="4"
91 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
92 CharacterSet="1"
93 >
94 <Tool
95 Name="VCPreBuildEventTool"
96 />
97 <Tool
98 Name="VCCustomBuildTool"
99 />
100 <Tool
101 Name="VCXMLDataGeneratorTool"
102 />
103 <Tool
104 Name="VCWebServiceProxyGeneratorTool"
105 />
106 <Tool
107 Name="VCMIDLTool"
108 />
109 <Tool
110 Name="VCCLCompilerTool"
111 AdditionalIncludeDirectories="..\llxml;..\llprimitive;..\llcommon;..\llmath;..\llmessage;..\..\libraries\i686-win32\include;..\..\libraries\include\"
112 PreprocessorDefinitions="WIN32;NDEBUG;_LIB;LL_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;LL_RELEASE"
113 RuntimeLibrary="0"
114 StructMemberAlignment="0"
115 TreatWChar_tAsBuiltInType="false"
116 ForceConformanceInForLoopScope="true"
117 UsePrecompiledHeader="0"
118 WarningLevel="3"
119 WarnAsError="true"
120 Detect64BitPortabilityProblems="false"
121 DebugInformationFormat="3"
122 />
123 <Tool
124 Name="VCManagedResourceCompilerTool"
125 />
126 <Tool
127 Name="VCResourceCompilerTool"
128 />
129 <Tool
130 Name="VCPreLinkEventTool"
131 />
132 <Tool
133 Name="VCLibrarianTool"
134 OutputFile="$(OutDir)/llprimitive.lib"
135 />
136 <Tool
137 Name="VCALinkTool"
138 />
139 <Tool
140 Name="VCXDCMakeTool"
141 />
142 <Tool
143 Name="VCBscMakeTool"
144 />
145 <Tool
146 Name="VCFxCopTool"
147 />
148 <Tool
149 Name="VCPostBuildEventTool"
150 />
151 </Configuration>
152 <Configuration
153 Name="ReleaseNoOpt|Win32"
154 OutputDirectory="../lib_$(ConfigurationName)/i686-win32"
155 IntermediateDirectory="$(ConfigurationName)"
156 ConfigurationType="4"
157 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
158 CharacterSet="1"
159 >
160 <Tool
161 Name="VCPreBuildEventTool"
162 />
163 <Tool
164 Name="VCCustomBuildTool"
165 />
166 <Tool
167 Name="VCXMLDataGeneratorTool"
168 />
169 <Tool
170 Name="VCWebServiceProxyGeneratorTool"
171 />
172 <Tool
173 Name="VCMIDLTool"
174 />
175 <Tool
176 Name="VCCLCompilerTool"
177 Optimization="0"
178 AdditionalIncludeDirectories="..\llxml;..\llprimitive;..\llcommon;..\llmath;..\llmessage;..\..\libraries\i686-win32\include;..\..\libraries\include\"
179 PreprocessorDefinitions="WIN32;NDEBUG;_LIB;LL_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;LL_RELEASE"
180 RuntimeLibrary="0"
181 StructMemberAlignment="0"
182 TreatWChar_tAsBuiltInType="false"
183 ForceConformanceInForLoopScope="true"
184 UsePrecompiledHeader="0"
185 WarningLevel="3"
186 WarnAsError="true"
187 Detect64BitPortabilityProblems="false"
188 DebugInformationFormat="3"
189 />
190 <Tool
191 Name="VCManagedResourceCompilerTool"
192 />
193 <Tool
194 Name="VCResourceCompilerTool"
195 />
196 <Tool
197 Name="VCPreLinkEventTool"
198 />
199 <Tool
200 Name="VCLibrarianTool"
201 OutputFile="$(OutDir)/llprimitive.lib"
202 />
203 <Tool
204 Name="VCALinkTool"
205 />
206 <Tool
207 Name="VCXDCMakeTool"
208 />
209 <Tool
210 Name="VCBscMakeTool"
211 />
212 <Tool
213 Name="VCFxCopTool"
214 />
215 <Tool
216 Name="VCPostBuildEventTool"
217 />
218 </Configuration>
219 </Configurations>
220 <References>
221 </References>
222 <Files>
223 <Filter
224 Name="Source Files"
225 Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
226 UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
227 >
228 <File
229 RelativePath=".\llmaterialtable.cpp"
230 >
231 </File>
232 <File
233 RelativePath=".\llprimitive.cpp"
234 >
235 </File>
236 <File
237 RelativePath=".\lltextureanim.cpp"
238 >
239 </File>
240 <File
241 RelativePath=".\lltextureentry.cpp"
242 >
243 </File>
244 <File
245 RelativePath=".\lltreeparams.cpp"
246 >
247 </File>
248 <File
249 RelativePath=".\llvolumemessage.cpp"
250 >
251 </File>
252 <File
253 RelativePath=".\llvolumexml.cpp"
254 >
255 </File>
256 </Filter>
257 <Filter
258 Name="Header Files"
259 Filter="h;hpp;hxx;hm;inl;inc;xsd"
260 UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
261 >
262 <File
263 RelativePath=".\legacy_object_types.h"
264 >
265 </File>
266 <File
267 RelativePath=".\llmaterialtable.h"
268 >
269 </File>
270 <File
271 RelativePath=".\llprimitive.h"
272 >
273 </File>
274 <File
275 RelativePath=".\lltextureanim.h"
276 >
277 </File>
278 <File
279 RelativePath=".\lltextureentry.h"
280 >
281 </File>
282 <File
283 RelativePath=".\lltree_common.h"
284 >
285 </File>
286 <File
287 RelativePath=".\lltreeparams.h"
288 >
289 </File>
290 <File
291 RelativePath=".\llvolumemessage.h"
292 >
293 </File>
294 <File
295 RelativePath=".\llvolumexml.h"
296 >
297 </File>
298 <File
299 RelativePath=".\material_codes.h"
300 >
301 </File>
302 <File
303 RelativePath=".\object_flags.h"
304 >
305 </File>
306 </Filter>
307 <Filter
308 Name="Resource Files"
309 Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
310 UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
311 >
312 </Filter>
313 </Files>
314 <Globals>
315 </Globals>
316</VisualStudioProject>
diff --git a/linden/indra/llprimitive/llvolumemessage.cpp b/linden/indra/llprimitive/llvolumemessage.cpp
index cecd2c2..b00bbc5 100644
--- a/linden/indra/llprimitive/llvolumemessage.cpp
+++ b/linden/indra/llprimitive/llvolumemessage.cpp
@@ -448,41 +448,36 @@ bool LLVolumeMessage::unpackPathParams(LLPathParams* params, LLDataPacker &dp)
448// static 448// static
449bool LLVolumeMessage::constrainVolumeParams(LLVolumeParams& params) 449bool LLVolumeMessage::constrainVolumeParams(LLVolumeParams& params)
450{ 450{
451 bool ok = true; 451 U32 bad = 0;
452 452
453 // This is called immediately after an unpack. feed the raw data 453 // This is called immediately after an unpack. feed the raw data
454 // through the checked setters to constraint it to a valid set of 454 // through the checked setters to constraint it to a valid set of
455 // volume params. 455 // volume params.
456 ok &= params.setType( 456 bad |= params.setType(params.getProfileParams().getCurveType(),
457 params.getProfileParams().getCurveType(), 457 params.getPathParams().getCurveType()) ? 0 : 1;
458 params.getPathParams().getCurveType()); 458 bad |= params.setBeginAndEndS(params.getProfileParams().getBegin(),
459 ok &= params.setBeginAndEndS( 459 params.getProfileParams().getEnd()) ? 0 : 2;
460 params.getProfileParams().getBegin(), 460 bad |= params.setBeginAndEndT(params.getPathParams().getBegin(),
461 params.getProfileParams().getEnd()); 461 params.getPathParams().getEnd()) ? 0 : 4;
462 ok &= params.setBeginAndEndT( 462 bad |= params.setHollow(params.getProfileParams().getHollow()) ? 0 : 8;
463 params.getPathParams().getBegin(), 463 bad |= params.setTwistBegin(params.getPathParams().getTwistBegin()) ? 0 : 0x10;
464 params.getPathParams().getEnd()); 464 bad |= params.setTwistEnd(params.getPathParams().getTwistEnd()) ? 0 : 0x20;
465 ok &= params.setHollow(params.getProfileParams().getHollow()); 465 bad |= params.setRatio(params.getPathParams().getScaleX(),
466 ok &= params.setTwistBegin(params.getPathParams().getTwistBegin()); 466 params.getPathParams().getScaleY()) ? 0 : 0x40;
467 ok &= params.setTwistEnd(params.getPathParams().getTwistEnd()); 467 bad |= params.setShear(params.getPathParams().getShearX(),
468 ok &= params.setRatio( 468 params.getPathParams().getShearY()) ? 0 : 0x80;
469 params.getPathParams().getScaleX(), 469 bad |= params.setTaper(params.getPathParams().getTaperX(),
470 params.getPathParams().getScaleY()); 470 params.getPathParams().getTaperY()) ? 0 : 0x100;
471 ok &= params.setShear( 471 bad |= params.setRevolutions(params.getPathParams().getRevolutions()) ? 0 : 0x200;
472 params.getPathParams().getShearX(), 472 bad |= params.setRadiusOffset(params.getPathParams().getRadiusOffset()) ? 0 : 0x400;
473 params.getPathParams().getShearY()); 473 bad |= params.setSkew(params.getPathParams().getSkew()) ? 0 : 0x800;
474 ok &= params.setTaper( 474 if(bad)
475 params.getPathParams().getTaperX(),
476 params.getPathParams().getTaperY());
477 ok &= params.setRevolutions(params.getPathParams().getRevolutions());
478 ok &= params.setRadiusOffset(params.getPathParams().getRadiusOffset());
479 ok &= params.setSkew(params.getPathParams().getSkew());
480 if(!ok)
481 { 475 {
482 llwarns << "LLVolumeMessage::constrainVolumeParams() - " 476 llwarns << "LLVolumeMessage::constrainVolumeParams() - "
483 << "forced to constrain incoming volume params." << llendl; 477 << "forced to constrain incoming volume params: "
478 << llformat("0x%04x",bad) << llendl;
484 } 479 }
485 return ok; 480 return bad ? false : true;
486} 481}
487 482
488bool LLVolumeMessage::packVolumeParams(const LLVolumeParams* params, LLMessageSystem *mesgsys) 483bool LLVolumeMessage::packVolumeParams(const LLVolumeParams* params, LLMessageSystem *mesgsys)
diff --git a/linden/indra/llrender/files.lst b/linden/indra/llrender/files.lst
index e7b3cec..a813342 100644
--- a/linden/indra/llrender/files.lst
+++ b/linden/indra/llrender/files.lst
@@ -1,8 +1,6 @@
1llrender/llagpmempoolarb.cpp
2llrender/llagpmempool.cpp
3llrender/llfont.cpp 1llrender/llfont.cpp
4llrender/llfontgl.cpp 2llrender/llfontgl.cpp
5llrender/llgldbg.cpp 3llrender/llgldbg.cpp
6llrender/llimagegl.cpp 4llrender/llimagegl.cpp
7llrender/llvertexprogramgl.cpp 5llrender/llvertexbuffer.cpp
8llrender/text_out.cpp 6llrender/text_out.cpp
diff --git a/linden/indra/llrender/llagpmempool.cpp b/linden/indra/llrender/llagpmempool.cpp
deleted file mode 100644
index 39cd3e8..0000000
--- a/linden/indra/llrender/llagpmempool.cpp
+++ /dev/null
@@ -1,194 +0,0 @@
1/**
2 * @file llagpmempool.cpp
3 * @brief LLAGPMemPool base class
4 *
5 * Copyright (c) 2001-2007, Linden Research, Inc.
6 *
7 * The source code in this file ("Source Code") is provided by Linden Lab
8 * to you under the terms of the GNU General Public License, version 2.0
9 * ("GPL"), unless you have obtained a separate licensing agreement
10 * ("Other License"), formally executed by you and Linden Lab. Terms of
11 * the GPL can be found in doc/GPL-license.txt in this distribution, or
12 * online at http://secondlife.com/developers/opensource/gplv2
13 *
14 * There are special exceptions to the terms and conditions of the GPL as
15 * it is applied to this Source Code. View the full text of the exception
16 * in the file doc/FLOSS-exception.txt in this software distribution, or
17 * online at http://secondlife.com/developers/opensource/flossexception
18 *
19 * By copying, modifying or distributing this software, you acknowledge
20 * that you have read and understood your obligations described above,
21 * and agree to abide by those obligations.
22 *
23 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
24 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
25 * COMPLETENESS OR PERFORMANCE.
26 */
27
28#include "linden_common.h"
29
30#include "llagpmempool.h"
31#include "llgl.h"
32
33#include "llagpmempoolarb.h"
34#include "llagpmempoolnv.h"
35#include "llagpmempoolati.h"
36
37#if LL_DARWIN
38#include "llagpmempoolapple.h"
39#endif // LL_DARWIN
40
41//static
42S32 LLAGPMemPool::LLFreeBlock::sNumBlocks = 0;
43
44LLAGPMemPool::LLAGPMemPool()
45{
46 mSize = 0;
47 mTotalAllocated = 0;
48}
49
50LLAGPMemPool::~LLAGPMemPool()
51{
52 mFreeList.deleteAll();
53}
54
55LLAGPMemPool *LLAGPMemPool::createPool(const U32 size, const BOOL use_vbo)
56{
57 if (gGLManager.mHasVertexBufferObject && use_vbo)
58 {
59 return new LLAGPMemPoolARB(size);
60 }
61#if LL_WINDOWS // *FIX: linux can use these, too, with some work.
62 if (gGLManager.mHasNVFence)
63 {
64 return new LLAGPMemPoolNV(size);
65 }
66 else if (gGLManager.mHasATIVAO)
67 {
68 return new LLAGPMemPoolATI(size);
69 }
70 else
71#elif LL_DARWIN
72 if (gGLManager.mHasAPPLEFence && gGLManager.mHasAPPLEVertexArrayRange)
73 {
74 return new LLAGPMemPoolAPPLE(size);
75 }
76 else
77#endif
78 {
79 // No AGP memory allocation at all!
80 return NULL;
81 }
82}
83
84
85LLAGPMemBlock *LLAGPMemPool::allocBlock(const S32 size)
86{
87 S32 aligned_size = size;
88 if (size & 0x0f)
89 {
90 aligned_size += 16 - (size & 0x0f);
91 }
92
93 if (aligned_size > (mSize - mTotalAllocated))
94 {
95 // We're totally out of AGP memory, bail.
96 return NULL;
97 }
98
99 LLFreeBlock *free_block = mFreeList.getFirst();
100
101 while (free_block && free_block->mSize < aligned_size)
102 {
103 free_block = free_block->getNext();
104 }
105
106 U32 offset = 0;
107
108 if (free_block)
109 {
110 if (free_block->mSize == aligned_size)
111 {
112 free_block->unlink();
113 offset = free_block->mOffset;
114 delete free_block;
115 }
116 else
117 {
118 offset = free_block->mOffset + free_block->mSize - aligned_size;
119 free_block->mSize -= aligned_size;
120 if (0 == free_block->mSize)
121 {
122 free_block->unlink();
123 }
124 }
125 }
126 else
127 {
128 //llwarns << "LLAGPMemPool unable to allocate " << size << " bytes" << llendl;
129 return NULL;
130 }
131
132 mTotalAllocated += aligned_size;
133 return createBlock(offset, aligned_size);
134}
135
136
137void LLAGPMemPool::freeBlock(LLAGPMemBlock *blockp)
138{
139 if (!blockp->getSize())
140 {
141 return;
142 }
143
144 LLFreeBlock *prev_free = NULL;
145 LLFreeBlock *cur_free = mFreeList.getFirst();
146
147 while (cur_free && blockp->getOffset() > (U32)cur_free->mOffset)
148 {
149 prev_free = cur_free;
150 cur_free = cur_free->getNext();
151 }
152
153 LLFreeBlock *new_free = new LLFreeBlock(blockp->getOffset(), blockp->getSize());
154
155 if (prev_free)
156 {
157 prev_free->append(*new_free);
158 coalesce(new_free);
159 coalesce(prev_free);
160 }
161 else
162 {
163 mFreeList.append(*new_free);
164 coalesce(new_free);
165 }
166 mTotalAllocated -= blockp->getSize();
167}
168
169void LLAGPMemPool::coalesce(LLFreeBlock *free_block)
170{
171 LLFreeBlock *next = free_block->getNext();
172
173 if (next && (free_block->mOffset + free_block->mSize == next->mOffset))
174 {
175 free_block->mSize += next->mSize;
176
177 next->unlink();
178 delete next;
179
180 coalesce(free_block);
181 }
182}
183
184void LLAGPMemPool::printFreeList()
185{
186 LLFreeBlock *cur_block = mFreeList.getFirst();
187 while (cur_block)
188 {
189 llinfos << "Cur block begin: " << cur_block->mOffset << llendl;
190 llinfos << "Cur block end: " << cur_block->mOffset + cur_block->mSize << llendl;
191 cur_block = cur_block->getNext();
192 }
193}
194
diff --git a/linden/indra/llrender/llagpmempool.h b/linden/indra/llrender/llagpmempool.h
deleted file mode 100644
index f992876..0000000
--- a/linden/indra/llrender/llagpmempool.h
+++ /dev/null
@@ -1,121 +0,0 @@
1/**
2 * @file llagpmempool.h
3 * @brief LLAGPMemPool base class
4 *
5 * Copyright (c) 2001-2007, Linden Research, Inc.
6 *
7 * The source code in this file ("Source Code") is provided by Linden Lab
8 * to you under the terms of the GNU General Public License, version 2.0
9 * ("GPL"), unless you have obtained a separate licensing agreement
10 * ("Other License"), formally executed by you and Linden Lab. Terms of
11 * the GPL can be found in doc/GPL-license.txt in this distribution, or
12 * online at http://secondlife.com/developers/opensource/gplv2
13 *
14 * There are special exceptions to the terms and conditions of the GPL as
15 * it is applied to this Source Code. View the full text of the exception
16 * in the file doc/FLOSS-exception.txt in this software distribution, or
17 * online at http://secondlife.com/developers/opensource/flossexception
18 *
19 * By copying, modifying or distributing this software, you acknowledge
20 * that you have read and understood your obligations described above,
21 * and agree to abide by those obligations.
22 *
23 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
24 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
25 * COMPLETENESS OR PERFORMANCE.
26 */
27
28#ifndef LL_LLAGPMEMPOOL_H
29#define LL_LLAGPMEMPOOL_H
30
31#include "stdtypes.h"
32#include "lldlinked.h"
33
34// Raw memory handling abstraction, which handles interaction with
35// the nVidia and ATI AGP extensions.
36
37// Minimum size we allow allocation for, in order to allow AGP usage...
38const S32 MIN_AGP_SIZE = 8000000;
39
40class LLAGPMemBlock;
41
42class LLAGPMemPool
43{
44public:
45 LLAGPMemPool();
46 virtual ~LLAGPMemPool();
47
48 virtual LLAGPMemBlock *allocBlock(const S32 size);
49 virtual void freeBlock(LLAGPMemBlock *blockp);
50
51 virtual void flush() = 0;
52 virtual void dump() = 0;
53 virtual void enable() = 0;
54 virtual void disable() = 0;
55 virtual void bind() = 0;
56
57 virtual S32 getSize() { return mSize; }
58
59 S32 getTotalAllocated() const { return mTotalAllocated; }
60 static LLAGPMemPool *createPool(const U32 size, const BOOL use_vbo);
61
62 struct LLFreeBlock: public LLDLinked<LLFreeBlock>
63 {
64 S32 mOffset;
65 S32 mSize;
66 LLFreeBlock(const S32 offset, const S32 size) { mOffset = offset; mSize = size; sNumBlocks++; }
67 ~LLFreeBlock() { sNumBlocks--; }
68
69 static S32 sNumBlocks;
70 };
71
72 // Fencing (for nVidia and Apple) - default is to do nothing (ATI, ARB do not need fencing)
73 virtual U32 createFence() { return 0; }
74 virtual void deleteFence(const U32 fence) {}
75 virtual void sendFence(U32 fence) {}
76 virtual void waitFence(U32 fence) {}
77
78 void printFreeList();
79protected:
80
81 void coalesce(LLFreeBlock *free_block);
82 virtual LLAGPMemBlock *createBlock(const U32 offset, const U32 size) = 0;
83 LLDLinked<LLFreeBlock> mFreeList;
84
85 S32 mSize;
86 S32 mTotalAllocated;
87};
88
89// An AGP memory block, which contains all the info needed to
90// copy data in/out.
91class LLAGPMemBlock
92{
93public:
94 LLAGPMemBlock(LLAGPMemPool *mem_poolp) : mMemPoolp(mem_poolp) {}
95 virtual ~LLAGPMemBlock() {}
96 virtual void copy (void *source, const U32 size_bytes) = 0;
97 virtual void copyColor(void *source, const U32 size_bytes) = 0;
98
99 virtual void bindGLVertexPointer(const U32 stride, const U32 offset) = 0;
100 virtual void bindGLNormalPointer(const U32 stride, const U32 offset) = 0;
101 virtual void bindGLBinormalPointer(const S32 index, const U32 stride, const U32 offset) = 0;
102 virtual void bindGLColorPointer(const U32 stride, const U32 offset) = 0;
103 virtual void bindGLTexCoordPointer(const U32 stride, const U32 offset) = 0;
104 virtual void bindGLVertexWeightPointer(const S32 index, const U32 stride, const U32 offset) = 0;
105 virtual void bindGLVertexClothingWeightPointer(const S32 index, const U32 stride, const U32 offset) = 0;
106
107 virtual BOOL hasMappedMem() const = 0;
108 virtual U8* getMappedMem() = 0;
109
110 virtual U32 createFence() = 0;
111 virtual void deleteFence(const U32 fence) = 0;
112 virtual void sendFence(U32 fence) = 0;
113 virtual void waitFence(U32 fence) = 0;
114
115 virtual U32 getOffset() const = 0;
116 virtual U32 getSize() const = 0;
117protected:
118 LLAGPMemPool *mMemPoolp;
119};
120
121#endif // LL_LLAGPMEMPOOL_H
diff --git a/linden/indra/llrender/llagpmempoolapple.cpp b/linden/indra/llrender/llagpmempoolapple.cpp
deleted file mode 100644
index 9aa4993..0000000
--- a/linden/indra/llrender/llagpmempoolapple.cpp
+++ /dev/null
@@ -1,314 +0,0 @@
1/**
2 * @file llagpmempoolapple.cpp
3 * @brief LLAGPMemPoolAPPLE base class
4 *
5 * Copyright (c) 2001-2007, Linden Research, Inc.
6 *
7 * The source code in this file ("Source Code") is provided by Linden Lab
8 * to you under the terms of the GNU General Public License, version 2.0
9 * ("GPL"), unless you have obtained a separate licensing agreement
10 * ("Other License"), formally executed by you and Linden Lab. Terms of
11 * the GPL can be found in doc/GPL-license.txt in this distribution, or
12 * online at http://secondlife.com/developers/opensource/gplv2
13 *
14 * There are special exceptions to the terms and conditions of the GPL as
15 * it is applied to this Source Code. View the full text of the exception
16 * in the file doc/FLOSS-exception.txt in this software distribution, or
17 * online at http://secondlife.com/developers/opensource/flossexception
18 *
19 * By copying, modifying or distributing this software, you acknowledge
20 * that you have read and understood your obligations described above,
21 * and agree to abide by those obligations.
22 *
23 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
24 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
25 * COMPLETENESS OR PERFORMANCE.
26 */
27
28#ifdef LL_DARWIN
29
30#include "linden_common.h"
31
32#include "llagpmempoolapple.h"
33#include "llgl.h"
34
35#include "llglheaders.h"
36
37LLAGPMemPoolAPPLE::LLAGPMemPoolAPPLE(S32 request) : LLAGPMemPool()
38{
39 llinfos << "Creating LLAGPMemPoolAPPLE" << llendl;
40 stop_glerror();
41 if (!gGLManager.mHasAPPLEFence || !gGLManager.mHasAPPLEVertexArrayRange)
42 {
43 llerrs << "necessary extensions not present!" << llendl;
44 }
45
46 // No special allocation is necessary for the Apple extensions
47 mBase = (U8*)::malloc(request);
48 mSize = request;
49
50 if (mBase)
51 {
52 mFreeList.append(*(new LLFreeBlock(0,mSize)));
53 }
54 else
55 {
56 mSize = 0;
57 }
58
59 flush_glerror();
60}
61
62LLAGPMemBlockAPPLE::~LLAGPMemBlockAPPLE()
63{
64 mMemPoolp->freeBlock(this);
65}
66
67LLAGPMemBlock *LLAGPMemPoolAPPLE::createBlock(const U32 offset, const U32 size)
68{
69 return new LLAGPMemBlockAPPLE(this, mBase, offset, size);
70}
71
72LLAGPMemPoolAPPLE::~LLAGPMemPoolAPPLE()
73{
74 if (mBase)
75 {
76 // MBW -- This really belongs in a call which is the opposite of bind()...
77 glVertexArrayRangeAPPLE(0, 0);
78 ::free(mBase);
79 }
80}
81
82void LLAGPMemPoolAPPLE::bind()
83{
84 if(mBase)
85 {
86 glVertexArrayRangeAPPLE(mSize, mBase);
87 }
88}
89
90void LLAGPMemPoolAPPLE::enable()
91{
92 glEnableClientState(GL_VERTEX_ARRAY_RANGE_APPLE);
93}
94
95void LLAGPMemPoolAPPLE::disable()
96{
97 glDisableClientState(GL_VERTEX_ARRAY_RANGE_APPLE);
98}
99
100void LLAGPMemPoolAPPLE::flush()
101{
102 if(mBase)
103 {
104 glFlushVertexArrayRangeAPPLE(mSize, mBase);
105 }
106}
107
108void LLAGPMemPoolAPPLE::dump()
109{
110 LLFreeBlock *prev = 0;
111 LLFreeBlock *block = mFreeList.getFirst();
112
113 int d=0;
114
115 int i=0;
116 while (block)
117 {
118 i++;
119 if (prev)
120 {
121 d = (S32)block->mOffset - ((S32)prev->mOffset + prev->mSize);
122 }
123 else d = 0;
124
125 prev = block;
126 block = block->getNext();
127 }
128}
129
130
131U32 LLAGPMemPoolAPPLE::createFence()
132{
133 U32 fence;
134 glGenFencesAPPLE(1, (GLuint*)&fence);
135 glSetFenceAPPLE(fence);
136 glFinishFenceAPPLE(fence);
137 return fence;
138}
139
140
141void LLAGPMemPoolAPPLE::deleteFence(const U32 fence)
142{
143 glDeleteFencesAPPLE(1, (GLuint*)&fence);
144}
145
146
147void LLAGPMemPoolAPPLE::sendFence(U32 fence)
148{
149 glSetFenceAPPLE(fence);
150}
151
152
153void LLAGPMemPoolAPPLE::waitFence(U32 fence)
154{
155 if(!glTestFenceAPPLE(fence))
156 {
157 glFinishFenceAPPLE(fence);
158 }
159}
160
161
162/////////////////////////////
163//
164// LLAGPMemBlockAPPLE
165//
166// APPLE Implementation of an AGP memory block
167//
168
169LLAGPMemBlockAPPLE::LLAGPMemBlockAPPLE(LLAGPMemPool *mem_poolp, U8 *baseptr, S32 offset, const U32 size) : LLAGPMemBlock(mem_poolp)
170{
171 mMemp = baseptr + offset;
172 mOffset = offset;
173 mSize = size;
174}
175
176
177void LLAGPMemBlockAPPLE::bindGLVertexPointer(const U32 stride, const U32 offset)
178{
179 if (!mMemp)
180 {
181 llerrs << "Binding empty vertex array" << llendl;
182 }
183 glVertexPointer(3, GL_FLOAT, stride, mMemp + offset);
184}
185
186void LLAGPMemBlockAPPLE::bindGLNormalPointer(const U32 stride, const U32 offset)
187{
188 if (!mMemp)
189 {
190 llerrs << "Binding empty normal array" << llendl;
191 }
192 glNormalPointer(GL_FLOAT, stride, mMemp + offset);
193}
194
195
196void LLAGPMemBlockAPPLE::bindGLColorPointer(const U32 stride, const U32 offset)
197{
198 if (!mMemp)
199 {
200 llerrs << "Binding empty color array" << llendl;
201 }
202 glColorPointer(4, GL_UNSIGNED_BYTE, stride, mMemp + offset);
203}
204
205
206void LLAGPMemBlockAPPLE::bindGLTexCoordPointer(const U32 stride, const U32 offset)
207{
208 if (!mMemp)
209 {
210 llerrs << "Binding empty texcoord array" << llendl;
211 }
212 glTexCoordPointer(2, GL_FLOAT, stride, mMemp + offset);
213}
214
215
216void LLAGPMemBlockAPPLE::bindGLBinormalPointer(const S32 index, const U32 stride, const U32 offset)
217{
218 if (!mMemp)
219 {
220 llerrs << "Binding empty vertex weight array" << llendl;
221 }
222
223 if (index > 0) glVertexAttribPointerARB(index, 3, GL_FLOAT, FALSE, stride, (F32 *)(mMemp + offset));
224}
225
226void LLAGPMemBlockAPPLE::bindGLVertexWeightPointer(const S32 index, const U32 stride, const U32 offset)
227{
228 if (!mMemp)
229 {
230 llerrs << "Binding empty vertex weight array" << llendl;
231 }
232
233 if (index > 0) glVertexAttribPointerARB(index, 1, GL_FLOAT, FALSE, 0, (F32 *)(mMemp + offset));
234}
235
236void LLAGPMemBlockAPPLE::bindGLVertexClothingWeightPointer(const S32 index, const U32 stride, const U32 offset)
237{
238 if (!mMemp)
239 {
240 llerrs << "Binding empty vertex weight array" << llendl;
241 }
242 set_vertex_clothing_weights(index, stride, (LLVector4 *)(mMemp + offset));
243}
244
245U8* LLAGPMemBlockAPPLE::getMappedMem()
246{
247 return mMemp;
248}
249
250
251void LLAGPMemBlockAPPLE::copy(void *mem, const U32 size)
252{
253 if (!mMemp || !mem)
254 {
255 return;
256 }
257 llassert(size <= mSize);
258
259 memcpy( mMemp, mem, size );
260
261 glFlushVertexArrayRangeAPPLE(size, mMemp);
262}
263
264void LLAGPMemBlockAPPLE::copyColor(void *mem, const U32 size)
265{
266 if (!mMemp || !mem)
267 {
268 return;
269 }
270 llassert(size <= mSize);
271
272 memcpy( mMemp, mem, size );
273
274 glFlushVertexArrayRangeAPPLE(size, mMemp);
275}
276
277
278
279U32 LLAGPMemBlockAPPLE::createFence()
280{
281 U32 fence;
282 glGenFencesAPPLE(1, (GLuint*)&fence);
283 glSetFenceAPPLE(fence);
284 glFinishFenceAPPLE(fence);
285 return fence;
286}
287
288void LLAGPMemBlockAPPLE::deleteFence(const U32 fence)
289{
290 glDeleteFencesAPPLE(1, (GLuint*)&fence);
291}
292
293void LLAGPMemBlockAPPLE::sendFence(U32 fence)
294{
295 glSetFenceAPPLE(fence);
296}
297
298void LLAGPMemBlockAPPLE::waitFence(U32 fence)
299{
300 if(!glTestFenceAPPLE(fence))
301 {
302 glFinishFenceAPPLE(fence);
303 }
304}
305
306// MBW -- May want this at some point...
307#if 0
308void LLAGPMemBlockAPPLE::flush()
309{
310 glFlushVertexArrayRangeAPPLE(mSize, mMemp);
311}
312#endif
313
314#endif // LL_DARWIN
diff --git a/linden/indra/llrender/llagpmempoolapple.h b/linden/indra/llrender/llagpmempoolapple.h
deleted file mode 100644
index 4a72a28..0000000
--- a/linden/indra/llrender/llagpmempoolapple.h
+++ /dev/null
@@ -1,95 +0,0 @@
1/**
2 * @file llagpmempoolapple.h
3 * @brief LLAGPMemPoolAPPLE base class
4 *
5 * Copyright (c) 2001-2007, Linden Research, Inc.
6 *
7 * The source code in this file ("Source Code") is provided by Linden Lab
8 * to you under the terms of the GNU General Public License, version 2.0
9 * ("GPL"), unless you have obtained a separate licensing agreement
10 * ("Other License"), formally executed by you and Linden Lab. Terms of
11 * the GPL can be found in doc/GPL-license.txt in this distribution, or
12 * online at http://secondlife.com/developers/opensource/gplv2
13 *
14 * There are special exceptions to the terms and conditions of the GPL as
15 * it is applied to this Source Code. View the full text of the exception
16 * in the file doc/FLOSS-exception.txt in this software distribution, or
17 * online at http://secondlife.com/developers/opensource/flossexception
18 *
19 * By copying, modifying or distributing this software, you acknowledge
20 * that you have read and understood your obligations described above,
21 * and agree to abide by those obligations.
22 *
23 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
24 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
25 * COMPLETENESS OR PERFORMANCE.
26 */
27
28#ifndef LL_LLAGPMEMPOOLAPPLE_H
29#define LL_LLAGPMEMPOOLAPPLE_H
30
31#include "llagpmempool.h"
32
33#if LL_DARWIN
34class LLAGPMemPoolAPPLE : public LLAGPMemPool
35{
36public:
37 LLAGPMemPoolAPPLE(S32 request);
38 virtual ~LLAGPMemPoolAPPLE();
39
40 /*virtual*/ void flush();
41 /*virtual*/ void dump();
42 /*virtual*/ void enable();
43 /*virtual*/ void disable();
44 /*virtual*/ void bind();
45
46 /*virtual*/ U32 createFence();
47 /*virtual*/ void deleteFence(const U32 fence);
48 /*virtual*/ void sendFence(U32 fence);
49 /*virtual*/ void waitFence(U32 fence);
50
51protected:
52 /*virtual*/ LLAGPMemBlock *createBlock(const U32 offset, const U32 size);
53
54protected:
55 U8 *mBase;
56};
57
58class LLAGPMemBlockAPPLE : public LLAGPMemBlock
59{
60public:
61 LLAGPMemBlockAPPLE(LLAGPMemPool *mem_poolp, U8 *baseptr, const S32 offset, const U32 size);
62 virtual ~LLAGPMemBlockAPPLE();
63
64 /*virtual*/ void copy (void *source, const U32 size_bytes);
65 /*virtual*/ void copyColor(void *source, const U32 size_bytes);
66 /*virtual*/ void free();
67
68 /*virtual*/ void bindGLVertexPointer(const U32 stride, const U32 offset);
69 /*virtual*/ void bindGLNormalPointer(const U32 stride, const U32 offset);
70 /*virtual*/ void bindGLBinormalPointer(const S32 index, const U32 stride, const U32 offset);
71 /*virtual*/ void bindGLColorPointer(const U32 stride, const U32 offset);
72 /*virtual*/ void bindGLTexCoordPointer(const U32 stride, const U32 offset);
73 /*virtual*/ void bindGLVertexWeightPointer(const S32 index, const U32 stride, const U32 offset);
74 /*virtual*/ void bindGLVertexClothingWeightPointer(const S32 index, const U32 stride, const U32 offset);
75
76 /*virtual*/ U32 getOffset() const { return mOffset; }
77 /*virtual*/ U32 getSize() const { return mSize; }
78
79 /*virtual*/ BOOL hasMappedMem() const { return TRUE; }
80 /*virtual*/ U8* getMappedMem();
81 /*virtual*/ U32 createFence();
82 /*virtual*/ void deleteFence(const U32 fence);
83 /*virtual*/ void sendFence(U32 fence);
84 /*virtual*/ void waitFence(U32 fence);
85
86private:
87 U8 *mMemp;
88 U32 mOffset; // Offset from base
89 U32 mSize;
90 friend class LLAGPMemPoolAPPLE;
91};
92
93#endif // LL_DARWIN
94
95#endif // LL_LLAGPMEMPOOLAPPLE_H
diff --git a/linden/indra/llrender/llagpmempoolarb.cpp b/linden/indra/llrender/llagpmempoolarb.cpp
deleted file mode 100644
index ab97c97..0000000
--- a/linden/indra/llrender/llagpmempoolarb.cpp
+++ /dev/null
@@ -1,230 +0,0 @@
1/**
2 * @file llagpmempoolarb.cpp
3 * @brief LLAGPMemPoolARB base class
4 *
5 * Copyright (c) 2001-2007, Linden Research, Inc.
6 *
7 * The source code in this file ("Source Code") is provided by Linden Lab
8 * to you under the terms of the GNU General Public License, version 2.0
9 * ("GPL"), unless you have obtained a separate licensing agreement
10 * ("Other License"), formally executed by you and Linden Lab. Terms of
11 * the GPL can be found in doc/GPL-license.txt in this distribution, or
12 * online at http://secondlife.com/developers/opensource/gplv2
13 *
14 * There are special exceptions to the terms and conditions of the GPL as
15 * it is applied to this Source Code. View the full text of the exception
16 * in the file doc/FLOSS-exception.txt in this software distribution, or
17 * online at http://secondlife.com/developers/opensource/flossexception
18 *
19 * By copying, modifying or distributing this software, you acknowledge
20 * that you have read and understood your obligations described above,
21 * and agree to abide by those obligations.
22 *
23 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
24 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
25 * COMPLETENESS OR PERFORMANCE.
26 */
27
28#include "linden_common.h"
29#include "llagpmempoolarb.h"
30#include "llgl.h"
31
32#include "llglheaders.h"
33
34LLAGPMemPoolARB::LLAGPMemPoolARB(S32 request) : LLAGPMemPool()
35{
36 llinfos << "Creating LLAGPMemPoolARB" << llendl;
37 stop_glerror();
38 if (!gGLManager.mHasVertexBufferObject)
39 {
40 llerrs << "No ARB vertex buffer object extension!" << llendl;
41 }
42
43 mName = 0;
44
45 mSize = request;
46 flush_glerror();
47}
48
49
50LLAGPMemPoolARB::~LLAGPMemPoolARB()
51{
52}
53
54
55LLAGPMemBlock* LLAGPMemPoolARB::allocBlock(const S32 size)
56{
57 return allocBlock(size, GL_ARRAY_BUFFER_ARB);
58}
59
60LLAGPMemBlock *LLAGPMemPoolARB::allocBlock(const S32 size, U32 target)
61{
62 S32 aligned_size = size;
63 if (size & 0x0f)
64 {
65 aligned_size += 16 - (size & 0x0f);
66 }
67
68 if (aligned_size > (mSize - mTotalAllocated))
69 {
70 // We're totally out of AGP memory, bail.
71 return (LLAGPMemBlock *)0;
72 }
73
74 mTotalAllocated += aligned_size;
75 return createBlock(0, aligned_size, target);
76}
77
78
79void LLAGPMemPoolARB::freeBlock(LLAGPMemBlock *blockp)
80{
81 if (!blockp->getSize())
82 {
83 return;
84 }
85 LLAGPMemBlockARB *arb_blockp = (LLAGPMemBlockARB*)blockp;
86 U32 name[1];
87 name[0] = arb_blockp->getName();
88 stop_glerror();
89 glDeleteBuffersARB(1, (GLuint*)name);
90 stop_glerror();
91 mTotalAllocated -= blockp->getSize();
92}
93
94LLAGPMemBlock *LLAGPMemPoolARB::createBlock(const U32 offset, const U32 size)
95{
96 return createBlock(offset, size, GL_ARRAY_BUFFER_ARB);
97}
98
99LLAGPMemBlock *LLAGPMemPoolARB::createBlock(const U32 offset, const U32 size, const U32 target)
100{
101 U32 name[1];
102 stop_glerror();
103 glGenBuffersARB(1, (GLuint*)name);
104 stop_glerror();
105 return new LLAGPMemBlockARB(this, name[0], offset, size, target);
106}
107
108void LLAGPMemPoolARB::disable()
109{
110}
111
112void LLAGPMemPoolARB::dump()
113{
114}
115
116
117/////////////////////////////
118//
119// LLAGPMemBlockARB
120//
121// ARB ImplementARBon of an AGP memory block
122//
123
124LLAGPMemBlockARB::LLAGPMemBlockARB(LLAGPMemPool *mem_poolp, const U32 name, const U32 offset, const U32 size, U32 target) :
125 LLAGPMemBlock(mem_poolp), mTarget(target)
126{
127 llassert(name > 0);
128 mName = name;
129 stop_glerror();
130 glBindBufferARB(mTarget, mName);
131 stop_glerror();
132
133 glBufferDataARB(mTarget, size, NULL, GL_DYNAMIC_DRAW_ARB);
134
135 stop_glerror();
136 glBindBufferARB(mTarget, 0);
137 stop_glerror();
138 mSize = size;
139}
140
141
142void LLAGPMemBlockARB::bindGLVertexPointer(const U32 stride, const U32 offset)
143{
144 stop_glerror();
145 glBindBufferARB(mTarget, mName);
146 glVertexPointer(3, GL_FLOAT, stride, (GLvoid*)((intptr_t)offset));
147 glBindBufferARB(mTarget, 0);
148}
149
150
151void LLAGPMemBlockARB::bindGLNormalPointer(const U32 stride, const U32 offset)
152{
153 stop_glerror();
154 glBindBufferARB(mTarget, mName);
155 glNormalPointer(GL_FLOAT, stride, (GLvoid*)((intptr_t)offset));
156 glBindBufferARB(mTarget, 0);
157 stop_glerror();
158}
159
160
161void LLAGPMemBlockARB::bindGLColorPointer(const U32 stride, const U32 offset)
162{
163 stop_glerror();
164 glBindBufferARB(mTarget, mName);
165 glColorPointer(4, GL_UNSIGNED_BYTE, stride, (GLvoid*)((intptr_t)offset));
166 glBindBufferARB(mTarget, 0);
167 stop_glerror();
168}
169
170
171void LLAGPMemBlockARB::bindGLTexCoordPointer(const U32 stride, const U32 offset)
172{
173 stop_glerror();
174 glBindBufferARB(mTarget, mName);
175 glTexCoordPointer(2, GL_FLOAT, stride, (GLvoid*)((intptr_t)offset));
176 glBindBufferARB(mTarget, 0);
177 stop_glerror();
178}
179
180
181void LLAGPMemBlockARB::bindGLVertexWeightPointer(const S32 index, const U32 stride, const U32 offset)
182{
183 stop_glerror();
184 glBindBufferARB(mTarget, mName);
185 set_vertex_weights(index, (F32*)(intptr_t)offset);
186 glBindBufferARB(mTarget, 0);
187 stop_glerror();
188}
189
190void LLAGPMemBlockARB::bindGLBinormalPointer(const S32 index, const U32 stride, const U32 offset)
191{
192 stop_glerror();
193 glBindBufferARB(mTarget, mName);
194 set_binormals(index, stride, (LLVector3*)(intptr_t)offset);
195 glBindBufferARB(mTarget, 0);
196 stop_glerror();
197}
198
199
200void LLAGPMemBlockARB::bindGLVertexClothingWeightPointer(const S32 index, const U32 stride, const U32 offset)
201{
202 return;
203}
204
205
206void LLAGPMemBlockARB::copy(void *mem, const U32 size)
207{
208 stop_glerror();
209 llassert(size <= mSize);
210 glBindBufferARB(mTarget, mName);
211 glBufferSubDataARB(mTarget, 0, size, mem);
212 glBindBufferARB(mTarget, 0);
213 stop_glerror();
214}
215
216void LLAGPMemBlockARB::copyColor(void *mem, const U32 size)
217{
218 stop_glerror();
219 llassert(size <= mSize);
220 glBindBufferARB(mTarget, mName);
221 glBufferSubDataARB(mTarget, 0, size, mem);
222 glBindBufferARB(mTarget, 0);
223 stop_glerror();
224}
225
226
227U8* LLAGPMemBlockARB::getMappedMem()
228{
229 return NULL;
230}
diff --git a/linden/indra/llrender/llagpmempoolarb.h b/linden/indra/llrender/llagpmempoolarb.h
deleted file mode 100644
index 7358862..0000000
--- a/linden/indra/llrender/llagpmempoolarb.h
+++ /dev/null
@@ -1,103 +0,0 @@
1/**
2 * @file llagpmempoolarb.h
3 * @brief LLAGPMemPoolARB base class
4 *
5 * Copyright (c) 2001-2007, Linden Research, Inc.
6 *
7 * The source code in this file ("Source Code") is provided by Linden Lab
8 * to you under the terms of the GNU General Public License, version 2.0
9 * ("GPL"), unless you have obtained a separate licensing agreement
10 * ("Other License"), formally executed by you and Linden Lab. Terms of
11 * the GPL can be found in doc/GPL-license.txt in this distribution, or
12 * online at http://secondlife.com/developers/opensource/gplv2
13 *
14 * There are special exceptions to the terms and conditions of the GPL as
15 * it is applied to this Source Code. View the full text of the exception
16 * in the file doc/FLOSS-exception.txt in this software distribution, or
17 * online at http://secondlife.com/developers/opensource/flossexception
18 *
19 * By copying, modifying or distributing this software, you acknowledge
20 * that you have read and understood your obligations described above,
21 * and agree to abide by those obligations.
22 *
23 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
24 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
25 * COMPLETENESS OR PERFORMANCE.
26 */
27
28#ifndef LL_LLAGPMEMPOOLARB_H
29#define LL_LLAGPMEMPOOLARB_H
30
31#include "llagpmempool.h"
32
33class LLAGPMemPoolARB : public LLAGPMemPool
34{
35public:
36 LLAGPMemPoolARB(S32 request);
37 virtual ~LLAGPMemPoolARB();
38
39 /*virtual*/ LLAGPMemBlock* allocBlock(const S32 size);
40 LLAGPMemBlock *allocBlock(const S32 size, U32 target);
41 /*virtual*/ void freeBlock(LLAGPMemBlock *blockp);
42
43 void bind() {}
44
45 void enable() {}
46
47 /*virtual*/ void disable();
48
49 void flush() {}
50
51 // No point in these being inline, is there? They're virtual functions anyway...
52 /*virtual*/ inline LLAGPMemBlock *alloc(S32 size);
53 /*virtual*/ inline void free(LLAGPMemBlock *block);
54 /*virtual*/ inline void dump();
55protected:
56 /*virtual*/ LLAGPMemBlock *createBlock(const U32 offset, const U32 size);
57 LLAGPMemBlock *createBlock(const U32 offset, const U32 size, const U32 target);
58
59protected:
60 U32 mName;
61};
62
63class LLAGPMemBlockARB : public LLAGPMemBlock
64{
65public:
66 LLAGPMemBlockARB(LLAGPMemPool *mem_poolp, const U32 name, const U32 offset, const U32 size, U32 target);
67 virtual ~LLAGPMemBlockARB() { mMemPoolp->freeBlock(this); };
68
69 /*virtual*/ void copy (void *source, const U32 size_bytes);
70 /*virtual*/ void copyColor(void *source, const U32 size_bytes);
71 /*virtual*/ void free();
72
73 /*virtual*/ void bind();
74 /*virtual*/ void unbind();
75
76 /*virtual*/ void bindGLVertexPointer(const U32 stride, const U32 offset);
77 /*virtual*/ void bindGLNormalPointer(const U32 stride, const U32 offset);
78 /*virtual*/ void bindGLBinormalPointer(const S32 index, const U32 stride, const U32 offset);
79 /*virtual*/ void bindGLColorPointer(const U32 stride, const U32 offset);
80 /*virtual*/ void bindGLTexCoordPointer(const U32 stride, const U32 offset);
81 /*virtual*/ void bindGLVertexWeightPointer(const S32 index, const U32 stride, const U32 offset);
82 /*virtual*/ void bindGLVertexClothingWeightPointer(const S32 index, const U32 stride, const U32 offset);
83
84 /*virtual*/ U32 getOffset() const { return 0; }
85 /*virtual*/ U32 getSize() const { return mSize; }
86
87 /*virtual*/ BOOL hasMappedMem() const { return FALSE; }
88 /*virtual*/ U8* getMappedMem();
89 /*virtual*/ U32 createFence() { return 0; }
90 /*virtual*/ void deleteFence(const U32 fence) {}
91 /*virtual*/ void sendFence(U32 fence) { }
92 /*virtual*/ void waitFence(U32 fence) { }
93
94 U32 getName() const { return mName; }
95private:
96 U32 mName;
97 U32 mSize;
98 U32 mTarget;
99
100 friend class LLAGPMemPoolARB;
101};
102
103#endif // LL_LLAGPMEMPOOLARB_H
diff --git a/linden/indra/llrender/llagpmempoolati.cpp b/linden/indra/llrender/llagpmempoolati.cpp
deleted file mode 100644
index f29db95..0000000
--- a/linden/indra/llrender/llagpmempoolati.cpp
+++ /dev/null
@@ -1,160 +0,0 @@
1/**
2 * @file llagpmempoolati.cpp
3 * @brief LLAGPMemPoolATI base class
4 *
5 * Copyright (c) 2001-2007, Linden Research, Inc.
6 *
7 * The source code in this file ("Source Code") is provided by Linden Lab
8 * to you under the terms of the GNU General Public License, version 2.0
9 * ("GPL"), unless you have obtained a separate licensing agreement
10 * ("Other License"), formally executed by you and Linden Lab. Terms of
11 * the GPL can be found in doc/GPL-license.txt in this distribution, or
12 * online at http://secondlife.com/developers/opensource/gplv2
13 *
14 * There are special exceptions to the terms and conditions of the GPL as
15 * it is applied to this Source Code. View the full text of the exception
16 * in the file doc/FLOSS-exception.txt in this software distribution, or
17 * online at http://secondlife.com/developers/opensource/flossexception
18 *
19 * By copying, modifying or distributing this software, you acknowledge
20 * that you have read and understood your obligations described above,
21 * and agree to abide by those obligations.
22 *
23 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
24 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
25 * COMPLETENESS OR PERFORMANCE.
26 */
27
28#include "linden_common.h"
29
30#include "llagpmempoolati.h"
31#include "llgl.h"
32
33#include "llglheaders.h"
34
35LLAGPMemPoolATI::LLAGPMemPoolATI(S32 request) : LLAGPMemPool()
36{
37 llinfos << "Creating LLAGPMemPoolATI" << llendl;
38 stop_glerror();
39 if (!gGLManager.mHasATIVAO)
40 {
41 llerrs << "No ATI AGI memory extension!" << llendl;
42 }
43
44 mName = 0;
45
46 // More than 4MB of agp available
47 while (!mName && (request > 0))
48 {
49 mName = glNewObjectBufferATI(request, NULL, GL_DYNAMIC_ATI);
50 mSize = request;
51 request >>= 1;
52 }
53
54 if (mName)
55 {
56 mFreeList.append(*(new LLFreeBlock(0, mSize)));
57 }
58 else
59 {
60 llinfos << "Unable to allocate AGP memory!" << llendl;
61 mSize = 0;
62 }
63 flush_glerror();
64}
65
66
67LLAGPMemPoolATI::~LLAGPMemPoolATI()
68{
69 if (mName)
70 {
71 glFreeObjectBufferATI(mName);
72 }
73}
74
75
76LLAGPMemBlock *LLAGPMemPoolATI::createBlock(const U32 offset, const U32 size)
77{
78 return new LLAGPMemBlockATI(this, mName, offset, size);
79}
80
81
82void LLAGPMemPoolATI::dump()
83{
84}
85
86
87/////////////////////////////
88//
89// LLAGPMemBlockATI
90//
91// ATI Implementation of an AGP memory block
92//
93
94LLAGPMemBlockATI::LLAGPMemBlockATI(LLAGPMemPool *mem_poolp, const U32 name, const U32 offset, const U32 size) :
95 LLAGPMemBlock(mem_poolp)
96{
97 mName = name;
98 mOffset = offset;
99 mSize = size;
100}
101
102
103void LLAGPMemBlockATI::bindGLVertexPointer(const U32 stride, const U32 offset)
104{
105 glArrayObjectATI(GL_VERTEX_ARRAY, 3, GL_FLOAT, stride, mName, mOffset + offset);
106}
107
108
109void LLAGPMemBlockATI::bindGLNormalPointer(const U32 stride, const U32 offset)
110{
111 glArrayObjectATI(GL_NORMAL_ARRAY, 3, GL_FLOAT, stride, mName, mOffset + offset);
112}
113
114
115void LLAGPMemBlockATI::bindGLColorPointer(const U32 stride, const U32 offset)
116{
117 glArrayObjectATI(GL_COLOR_ARRAY, 4, GL_UNSIGNED_BYTE, stride, mName, mOffset + offset);
118}
119
120
121void LLAGPMemBlockATI::bindGLTexCoordPointer(const U32 stride, const U32 offset)
122{
123 glArrayObjectATI(GL_TEXTURE_COORD_ARRAY, 2, GL_FLOAT, stride, mName, mOffset + offset);
124}
125
126
127void LLAGPMemBlockATI::bindGLBinormalPointer(const S32 index, const U32 stride, const U32 offset)
128{
129 glVertexAttribArrayObjectATI(index, 3, GL_FLOAT, FALSE, stride, mName, mOffset + offset);
130}
131
132
133void LLAGPMemBlockATI::bindGLVertexWeightPointer(const S32 index, const U32 stride, const U32 offset)
134{
135 //glArrayObjectATI(GL_WEIGHT_ARRAY_ARB, 1, GL_FLOAT, stride, mName, mOffset + offset);
136 glVertexAttribArrayObjectATI(index, 1, GL_FLOAT, FALSE, stride, mName, mOffset + offset);
137}
138
139void LLAGPMemBlockATI::bindGLVertexClothingWeightPointer(const S32 index, const U32 stride, const U32 offset)
140{
141 glVertexAttribArrayObjectATI(index, 4, GL_FLOAT, FALSE, stride, mName, mOffset + offset);
142}
143
144U8* LLAGPMemBlockATI::getMappedMem()
145{
146 return NULL;
147}
148
149void LLAGPMemBlockATI::copy(void *mem, const U32 size)
150{
151 llassert(size <= mSize);
152 glUpdateObjectBufferATI(mName, mOffset, size, mem, GL_PRESERVE_ATI);
153}
154
155void LLAGPMemBlockATI::copyColor(void *mem, const U32 size)
156{
157 llassert(size <= mSize);
158 glUpdateObjectBufferATI(mName, mOffset, size, mem, GL_PRESERVE_ATI);
159}
160
diff --git a/linden/indra/llrender/llagpmempoolati.h b/linden/indra/llrender/llagpmempoolati.h
deleted file mode 100644
index 67803f6..0000000
--- a/linden/indra/llrender/llagpmempoolati.h
+++ /dev/null
@@ -1,92 +0,0 @@
1/**
2 * @file llagpmempoolati.h
3 * @brief LLAGPMemPoolATI base class
4 *
5 * Copyright (c) 2001-2007, Linden Research, Inc.
6 *
7 * The source code in this file ("Source Code") is provided by Linden Lab
8 * to you under the terms of the GNU General Public License, version 2.0
9 * ("GPL"), unless you have obtained a separate licensing agreement
10 * ("Other License"), formally executed by you and Linden Lab. Terms of
11 * the GPL can be found in doc/GPL-license.txt in this distribution, or
12 * online at http://secondlife.com/developers/opensource/gplv2
13 *
14 * There are special exceptions to the terms and conditions of the GPL as
15 * it is applied to this Source Code. View the full text of the exception
16 * in the file doc/FLOSS-exception.txt in this software distribution, or
17 * online at http://secondlife.com/developers/opensource/flossexception
18 *
19 * By copying, modifying or distributing this software, you acknowledge
20 * that you have read and understood your obligations described above,
21 * and agree to abide by those obligations.
22 *
23 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
24 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
25 * COMPLETENESS OR PERFORMANCE.
26 */
27
28#ifndef LL_LLAGPMEMPOOLATI_H
29#define LL_LLAGPMEMPOOLATI_H
30
31#include "llagpmempool.h"
32
33class LLAGPMemPoolATI : public LLAGPMemPool
34{
35public:
36 LLAGPMemPoolATI(S32 request);
37 virtual ~LLAGPMemPoolATI();
38
39 void bind() {}
40
41 void enable() {}
42
43 void disable() {}
44
45 void flush() {}
46
47 // No point in these being inline, is there? They're virtual functions anyway...
48 /*virtual*/ inline LLAGPMemBlock *alloc(S32 size);
49 /*virtual*/ inline void free(LLAGPMemBlock *block);
50 /*virtual*/ inline void dump();
51protected:
52 /*virtual*/ LLAGPMemBlock *createBlock(const U32 offset, const U32 size);
53
54protected:
55 U32 mName;
56};
57
58class LLAGPMemBlockATI : public LLAGPMemBlock
59{
60public:
61 LLAGPMemBlockATI(LLAGPMemPool *mem_poolp, const U32 name, const U32 offset, const U32 size);
62 virtual ~LLAGPMemBlockATI() { mMemPoolp->freeBlock(this); };
63
64 /*virtual*/ void copy (void *source, const U32 size_bytes);
65 /*virtual*/ void copyColor(void *source, const U32 size_bytes);
66 /*virtual*/ void free();
67 /*virtual*/ void bindGLVertexPointer(const U32 stride, const U32 offset);
68 /*virtual*/ void bindGLNormalPointer(const U32 stride, const U32 offset);
69 /*virtual*/ void bindGLBinormalPointer(const S32 index, const U32 stride,const U32 offset);
70 /*virtual*/ void bindGLColorPointer(const U32 stride, const U32 offset);
71 /*virtual*/ void bindGLTexCoordPointer(const U32 stride, const U32 offset);
72 /*virtual*/ void bindGLVertexWeightPointer(const S32 index, const U32 stride, const U32 offset);
73 /*virtual*/ void bindGLVertexClothingWeightPointer(const S32 index, const U32 stride, const U32 offset);
74
75 /*virtual*/ U32 getOffset() const { return mOffset; }
76 /*virtual*/ U32 getSize() const { return mSize; }
77
78 /*virtual*/ BOOL hasMappedMem() const { return TRUE; }
79 /*virtual*/ U8* getMappedMem();
80 /*virtual*/ U32 createFence() { return 0; }
81 /*virtual*/ void deleteFence(const U32 fence) {}
82 /*virtual*/ void sendFence(U32 fence) { }
83 /*virtual*/ void waitFence(U32 fence) { }
84private:
85 U32 mName;
86 U32 mOffset;
87 U32 mSize;
88
89 friend class LLAGPMemPoolATI;
90};
91
92#endif // LL_LLAGPMEMPOOLATI_H
diff --git a/linden/indra/llrender/llagpmempoolnv.cpp b/linden/indra/llrender/llagpmempoolnv.cpp
deleted file mode 100644
index 8bbaef9..0000000
--- a/linden/indra/llrender/llagpmempoolnv.cpp
+++ /dev/null
@@ -1,320 +0,0 @@
1/**
2 * @file llagpmempoolnv.cpp
3 * @brief LLAGPMemPoolNV base class
4 *
5 * Copyright (c) 2001-2007, Linden Research, Inc.
6 *
7 * The source code in this file ("Source Code") is provided by Linden Lab
8 * to you under the terms of the GNU General Public License, version 2.0
9 * ("GPL"), unless you have obtained a separate licensing agreement
10 * ("Other License"), formally executed by you and Linden Lab. Terms of
11 * the GPL can be found in doc/GPL-license.txt in this distribution, or
12 * online at http://secondlife.com/developers/opensource/gplv2
13 *
14 * There are special exceptions to the terms and conditions of the GPL as
15 * it is applied to this Source Code. View the full text of the exception
16 * in the file doc/FLOSS-exception.txt in this software distribution, or
17 * online at http://secondlife.com/developers/opensource/flossexception
18 *
19 * By copying, modifying or distributing this software, you acknowledge
20 * that you have read and understood your obligations described above,
21 * and agree to abide by those obligations.
22 *
23 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
24 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
25 * COMPLETENESS OR PERFORMANCE.
26 */
27
28#include "linden_common.h"
29
30#ifndef LL_LINUX
31
32#include "llagpmempoolnv.h"
33#include "llgl.h"
34
35#include "llglheaders.h"
36
37#if LL_WINDOWS
38//#define LL_USE_NEW_MEM_OPS 1
39#endif
40#if LL_USE_NEW_MEM_OPS
41#include "new_mem_ops.h"
42#endif
43
44BOOL LLAGPMemPoolNV::sWriteOK = TRUE;
45
46LLAGPMemPoolNV::LLAGPMemPoolNV(int request) : LLAGPMemPool()
47{
48 llinfos << "Creating LLAGPMemPoolNV" << llendl;
49 stop_glerror();
50 if (!gGLManager.mHasNVFence)
51 {
52 llerrs << "wglAllocateMemoryNV not defined!" << llendl;
53 }
54
55 mBase = 0;
56
57 if (!mBase)
58 {
59 // More than 4MB of AGP available
60 while (!mBase && (request > 0))
61 {
62 // Stupid arbitrary nVidia magic numbers.
63 // read freq, write freq, priority
64 // AGP: 0.0, 0.1, 0.5
65 // Video: 0.0, 0.1, 1.0
66 mBase = (U8*)wglAllocateMemoryNV(request, 0.0f, 0.1f, 0.5f);
67 mSize = request;
68 request >>= 1;
69 }
70 }
71
72 if (mBase)
73 {
74 mFreeList.append(*(new LLFreeBlock(0,mSize)));
75 }
76 else
77 {
78 mSize = 0;
79 }
80
81 sWriteOK = TRUE;
82 flush_glerror();
83}
84
85
86LLAGPMemBlock *LLAGPMemPoolNV::createBlock(const U32 offset, const U32 size)
87{
88 return new LLAGPMemBlockNV(this, mBase, offset, size);
89}
90
91LLAGPMemPoolNV::~LLAGPMemPoolNV()
92{
93 if (mBase)
94 {
95 wglFreeMemoryNV(mBase);
96 }
97}
98
99void LLAGPMemPoolNV::bind()
100{
101 glVertexArrayRangeNV(mSize, mBase);
102}
103
104void LLAGPMemPoolNV::enable()
105{
106 glEnableClientState(GL_VERTEX_ARRAY_RANGE_NV);
107 sWriteOK = FALSE;
108}
109
110void LLAGPMemPoolNV::disable()
111{
112 glDisableClientState(GL_VERTEX_ARRAY_RANGE_NV);
113 sWriteOK = TRUE;
114}
115
116void LLAGPMemPoolNV::flush()
117{
118 glFlushVertexArrayRangeNV();
119}
120
121U32 LLAGPMemPoolNV::createFence()
122{
123 U32 fence;
124 glGenFencesNV(1, &fence);
125 glSetFenceNV(fence, GL_ALL_COMPLETED_NV);
126 glFinishFenceNV(fence);
127 return fence;
128}
129
130void LLAGPMemPoolNV::deleteFence(const U32 fence)
131{
132 glDeleteFencesNV(1, &fence);
133}
134
135void LLAGPMemPoolNV::sendFence(U32 fence)
136{
137 glSetFenceNV(fence, GL_ALL_COMPLETED_NV);
138}
139
140void LLAGPMemPoolNV::waitFence(U32 fence)
141{
142 if(!glTestFenceNV(fence))
143 {
144 glFinishFenceNV(fence);
145 }
146}
147
148
149//static
150BOOL LLAGPMemPoolNV::isWriteOK()
151{
152 return sWriteOK;
153}
154
155void LLAGPMemPoolNV::dump()
156{
157 LLFreeBlock *prev = 0;
158 LLFreeBlock *block = mFreeList.getFirst();
159
160 int d=0;
161
162 int i=0;
163 while (block)
164 {
165 i++;
166 if (prev)
167 {
168 d = (S32)block->mOffset - ((S32)prev->mOffset + prev->mSize);
169 }
170 else d = 0;
171
172 prev = block;
173 block = block->getNext();
174 }
175}
176
177
178LLAGPMemBlockNV::LLAGPMemBlockNV(LLAGPMemPool *mem_poolp, U8 *baseptr, S32 offset, const U32 size) : LLAGPMemBlock(mem_poolp)
179{
180 mMemp = baseptr + offset;
181 mOffset = offset;
182 mSize = size;
183}
184
185extern U8* gAGPVertices;
186
187void LLAGPMemBlockNV::bindGLVertexPointer(const U32 stride, const U32 offset)
188{
189 if (!mMemp)
190 {
191 llerrs << "Binding empty vertex array" << llendl;
192 }
193 glVertexPointer(3, GL_FLOAT, stride, mMemp + offset);
194}
195
196void LLAGPMemBlockNV::bindGLNormalPointer(const U32 stride, const U32 offset)
197{
198 if (!mMemp)
199 {
200 llerrs << "Binding empty normal array" << llendl;
201 }
202 glNormalPointer(GL_FLOAT, stride, mMemp + offset);
203}
204
205
206void LLAGPMemBlockNV::bindGLColorPointer(const U32 stride, const U32 offset)
207{
208 if (!mMemp)
209 {
210 llerrs << "Binding empty color array" << llendl;
211 }
212 glColorPointer(4, GL_UNSIGNED_BYTE, stride, mMemp + offset);
213}
214
215
216void LLAGPMemBlockNV::bindGLTexCoordPointer(const U32 stride, const U32 offset)
217{
218 if (!mMemp)
219 {
220 llerrs << "Binding empty texcoord array" << llendl;
221 }
222 glTexCoordPointer(2, GL_FLOAT, stride, mMemp + offset);
223}
224
225
226void LLAGPMemBlockNV::bindGLBinormalPointer(const S32 index, const U32 stride, const U32 offset)
227{
228 if (!mMemp)
229 {
230 llerrs << "Binding empty vertex weight array" << llendl;
231 }
232
233 glVertexAttribPointerARB(index, 3, GL_FLOAT, FALSE, stride, (F32 *)(mMemp + offset));
234}
235
236void LLAGPMemBlockNV::bindGLVertexWeightPointer(const S32 index, const U32 stride, const U32 offset)
237{
238 if (!mMemp)
239 {
240 llerrs << "Binding empty vertex weight array" << llendl;
241 }
242
243 glVertexAttribPointerARB(index, 1, GL_FLOAT, FALSE, 0, (F32 *)(mMemp + offset));
244}
245
246void LLAGPMemBlockNV::bindGLVertexClothingWeightPointer(const S32 index, const U32 stride, const U32 offset)
247{
248 if (!mMemp)
249 {
250 llerrs << "Binding empty vertex weight array" << llendl;
251 }
252 set_vertex_clothing_weights(index, stride, (LLVector4 *)(mMemp + offset));
253}
254
255U8* LLAGPMemBlockNV::getMappedMem()
256{
257 return mMemp;
258}
259
260void LLAGPMemBlockNV::copy(void *mem, const U32 size)
261{
262 if (!mMemp || !mem)
263 {
264 return;
265 }
266 llassert(LLAGPMemPoolNV::isWriteOK());
267 llassert(size <= mSize);
268
269#if LL_USE_NEW_MEM_OPS
270 inline_new_memcpy( mMemp, mem, size );
271#else
272 memcpy( mMemp, mem, size );
273#endif
274}
275
276void LLAGPMemBlockNV::copyColor(void *mem, const U32 size)
277{
278 if (!mMemp || !mem)
279 {
280 return;
281 }
282 llassert(LLAGPMemPoolNV::isWriteOK());
283 llassert(size <= mSize);
284
285#if LL_USE_NEW_MEM_OPS
286 inline_new_memcpy( mMemp, mem, size );
287#else
288 memcpy( mMemp, mem, size );
289#endif
290}
291
292
293U32 LLAGPMemBlockNV::createFence()
294{
295 U32 fence;
296 glGenFencesNV(1, &fence);
297 glSetFenceNV(fence, GL_ALL_COMPLETED_NV);
298 glFinishFenceNV(fence);
299 return fence;
300}
301
302void LLAGPMemBlockNV::deleteFence(const U32 fence)
303{
304 glDeleteFencesNV(1, &fence);
305}
306
307void LLAGPMemBlockNV::sendFence(U32 fence)
308{
309 glSetFenceNV(fence, GL_ALL_COMPLETED_NV);
310}
311
312void LLAGPMemBlockNV::waitFence(U32 fence)
313{
314 if(!glTestFenceNV(fence))
315 {
316 glFinishFenceNV(fence);
317 }
318}
319
320#endif //LL_LINUX
diff --git a/linden/indra/llrender/llagpmempoolnv.h b/linden/indra/llrender/llagpmempoolnv.h
deleted file mode 100644
index cffe397..0000000
--- a/linden/indra/llrender/llagpmempoolnv.h
+++ /dev/null
@@ -1,95 +0,0 @@
1/**
2 * @file llagpmempoolnv.h
3 * @brief LLAGPMemPoolNV base class
4 *
5 * Copyright (c) 2001-2007, Linden Research, Inc.
6 *
7 * The source code in this file ("Source Code") is provided by Linden Lab
8 * to you under the terms of the GNU General Public License, version 2.0
9 * ("GPL"), unless you have obtained a separate licensing agreement
10 * ("Other License"), formally executed by you and Linden Lab. Terms of
11 * the GPL can be found in doc/GPL-license.txt in this distribution, or
12 * online at http://secondlife.com/developers/opensource/gplv2
13 *
14 * There are special exceptions to the terms and conditions of the GPL as
15 * it is applied to this Source Code. View the full text of the exception
16 * in the file doc/FLOSS-exception.txt in this software distribution, or
17 * online at http://secondlife.com/developers/opensource/flossexception
18 *
19 * By copying, modifying or distributing this software, you acknowledge
20 * that you have read and understood your obligations described above,
21 * and agree to abide by those obligations.
22 *
23 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
24 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
25 * COMPLETENESS OR PERFORMANCE.
26 */
27
28#ifndef LL_LLAGPMEMPOOLNV_H
29#define LL_LLAGPMEMPOOLNV_H
30
31#include "llagpmempool.h"
32
33class LLAGPMemPoolNV : public LLAGPMemPool
34{
35public:
36 LLAGPMemPoolNV(int request);
37 virtual ~LLAGPMemPoolNV();
38
39 /*virtual*/ void flush();
40 /*virtual*/ void dump();
41 /*virtual*/ void enable();
42 /*virtual*/ void disable();
43 /*virtual*/ void bind();
44
45 static BOOL isWriteOK();
46
47 /*virtual*/ U32 createFence();
48 /*virtual*/ void deleteFence(const U32 fence);
49 /*virtual*/ void sendFence(U32 fence);
50 /*virtual*/ void waitFence(U32 fence);
51protected:
52 /*virtual*/ LLAGPMemBlock *createBlock(const U32 offset, const U32 size);
53
54protected:
55 U8 *mBase;
56
57 static BOOL sWriteOK;
58};
59
60class LLAGPMemBlockNV : public LLAGPMemBlock
61{
62public:
63 LLAGPMemBlockNV(LLAGPMemPool *mem_poolp, U8 *baseptr, const S32 offset, const U32 size);
64 virtual ~LLAGPMemBlockNV() { mMemPoolp->freeBlock(this); };
65
66 /*virtual*/ void copy (void *source, const U32 size_bytes);
67 /*virtual*/ void copyColor(void *source, const U32 size_bytes);
68 /*virtual*/ void free();
69
70 /*virtual*/ void bindGLVertexPointer(const U32 stride, const U32 offset);
71 /*virtual*/ void bindGLNormalPointer(const U32 stride, const U32 offset);
72 /*virtual*/ void bindGLBinormalPointer(const S32 index, const U32 stride, const U32 offset);
73 /*virtual*/ void bindGLColorPointer(const U32 stride, const U32 offset);
74 /*virtual*/ void bindGLTexCoordPointer(const U32 stride, const U32 offset);
75 /*virtual*/ void bindGLVertexWeightPointer(const S32 index, const U32 stride, const U32 offset);
76 /*virtual*/ void bindGLVertexClothingWeightPointer(const S32 index, const U32 stride, const U32 offset);
77
78 /*virtual*/ U32 getOffset() const { return mOffset; }
79 /*virtual*/ U32 getSize() const { return mSize; }
80
81 /*virtual*/ BOOL hasMappedMem() const { return TRUE; }
82 /*virtual*/ U8* getMappedMem();
83 /*virtual*/ U32 createFence();
84 /*virtual*/ void deleteFence(const U32 fence);
85 /*virtual*/ void sendFence(U32 fence);
86 /*virtual*/ void waitFence(U32 fence);
87
88private:
89 U8 *mMemp;
90 U32 mOffset; // Offset from base
91 U32 mSize;
92 friend class LLAGPMemPoolNV;
93};
94
95#endif // LL_LLAGPMEMPOOLNV_H
diff --git a/linden/indra/llrender/llfont.h b/linden/indra/llrender/llfont.h
index dadeafd..a84a302 100644
--- a/linden/indra/llrender/llfont.h
+++ b/linden/indra/llrender/llfont.h
@@ -31,6 +31,7 @@
31#include <map> 31#include <map>
32//#include "lllocalidhashmap.h" 32//#include "lllocalidhashmap.h"
33#include "llmemory.h" 33#include "llmemory.h"
34#include "llstl.h"
34 35
35class LLImageRaw; 36class LLImageRaw;
36class LLFontManager; 37class LLFontManager;
diff --git a/linden/indra/llrender/llfontgl.cpp b/linden/indra/llrender/llfontgl.cpp
index 2774e8d..2740c6c 100644
--- a/linden/indra/llrender/llfontgl.cpp
+++ b/linden/indra/llrender/llfontgl.cpp
@@ -33,6 +33,7 @@
33#include "llfontgl.h" 33#include "llfontgl.h"
34#include "llgl.h" 34#include "llgl.h"
35#include "v4color.h" 35#include "v4color.h"
36#include "llstl.h"
36 37
37const S32 BOLD_OFFSET = 1; 38const S32 BOLD_OFFSET = 1;
38 39
@@ -155,7 +156,7 @@ LLString LLFontGL::getFontPathSystem()
155 // Try to figure out where the system's font files are stored. 156 // Try to figure out where the system's font files are stored.
156 char *system_root = NULL; 157 char *system_root = NULL;
157#if LL_WINDOWS 158#if LL_WINDOWS
158 system_root = getenv("SystemRoot"); 159 system_root = getenv("SystemRoot"); /* Flawfinder: ignore */
159 if (!system_root) 160 if (!system_root)
160 { 161 {
161 llwarns << "SystemRoot not found, attempting to load fonts from default path." << llendl; 162 llwarns << "SystemRoot not found, attempting to load fonts from default path." << llendl;
@@ -647,7 +648,7 @@ S32 LLFontGL::render(const LLWString &wstr,
647 case LEFT: 648 case LEFT:
648 break; 649 break;
649 case RIGHT: 650 case RIGHT:
650 cur_x -= (F32)getWidth(wstr.c_str(), 0, length) * sScaleX; 651 cur_x -= llmin(scaled_max_pixels, llround(getWidthF32(wstr.c_str(), 0, length) * sScaleX));
651 break; 652 break;
652 case HCENTER: 653 case HCENTER:
653 cur_x -= llmin(scaled_max_pixels, llround(getWidthF32(wstr.c_str(), 0, length) * sScaleX)) / 2; 654 cur_x -= llmin(scaled_max_pixels, llround(getWidthF32(wstr.c_str(), 0, length) * sScaleX)) / 2;
@@ -672,12 +673,13 @@ S32 LLFontGL::render(const LLWString &wstr,
672 673
673 674
674 BOOL draw_ellipses = FALSE; 675 BOOL draw_ellipses = FALSE;
675 if (use_ellipses) 676 if (use_ellipses && halign == LEFT)
676 { 677 {
677 // check for too long of a string 678 // check for too long of a string
678 if (getWidthF32(wstr.c_str(), 0, max_chars) > scaled_max_pixels) 679 if (getWidthF32(wstr.c_str(), 0, max_chars) > scaled_max_pixels)
679 { 680 {
680 const LLWString dots(utf8str_to_wstring(LLString("..."))); 681 // use four dots for ellipsis width to generate padding
682 const LLWString dots(utf8str_to_wstring(LLString("....")));
681 scaled_max_pixels = llmax(0, scaled_max_pixels - llround(getWidthF32(dots.c_str()))); 683 scaled_max_pixels = llmax(0, scaled_max_pixels - llround(getWidthF32(dots.c_str())));
682 draw_ellipses = TRUE; 684 draw_ellipses = TRUE;
683 } 685 }
@@ -1330,7 +1332,7 @@ LLString LLFontGL::nameFromFont(const LLFontGL* fontp)
1330{ 1332{
1331 if (fontp == sSansSerifHuge) 1333 if (fontp == sSansSerifHuge)
1332 { 1334 {
1333 return LLString("SansSerifHude"); 1335 return LLString("SansSerifHuge");
1334 } 1336 }
1335 else if (fontp == sSansSerifSmall) 1337 else if (fontp == sSansSerifSmall)
1336 { 1338 {
diff --git a/linden/indra/llrender/llgldbg.cpp b/linden/indra/llrender/llgldbg.cpp
index 4d9f5f9..ab35353 100644
--- a/linden/indra/llrender/llgldbg.cpp
+++ b/linden/indra/llrender/llgldbg.cpp
@@ -89,8 +89,8 @@ char *fv4(F32 *f)
89//------------------------------------------------------------------------ 89//------------------------------------------------------------------------
90char *fv3(F32 *f) 90char *fv3(F32 *f)
91{ 91{
92 static char str[128]; 92 static char str[128]; /* Flawfinder: ignore */
93 sprintf(str, "%8.3f, %8.3f, %8.3f", f[0], f[1], f[2]); 93 snprintf(str, sizeof(str), "%8.3f, %8.3f, %8.3f", f[0], f[1], f[2]); /* Flawfinder: ignore */
94 return str; 94 return str;
95} 95}
96 96
@@ -99,8 +99,8 @@ char *fv3(F32 *f)
99//------------------------------------------------------------------------ 99//------------------------------------------------------------------------
100char *fv1(F32 *f) 100char *fv1(F32 *f)
101{ 101{
102 static char str[128]; 102 static char str[128]; /* Flawfinder: ignore */
103 sprintf(str, "%8.3f", f[0]); 103 snprintf(str, sizeof(str), "%8.3f", f[0]); /* Flawfinder: ignore */
104 return str; 104 return str;
105} 105}
106 106
diff --git a/linden/indra/llrender/llimagegl.cpp b/linden/indra/llrender/llimagegl.cpp
index 5ea7322..8386e95 100644
--- a/linden/indra/llrender/llimagegl.cpp
+++ b/linden/indra/llrender/llimagegl.cpp
@@ -134,6 +134,15 @@ void LLImageGL::unbindTexture(S32 stage, LLGLenum bind_target)
134 sCurrentBoundTextures[stage] = 0; 134 sCurrentBoundTextures[stage] = 0;
135} 135}
136 136
137// static (duplicated for speed and to avoid GL_TEXTURE_2D default argument which requires GL header dependency)
138void LLImageGL::unbindTexture(S32 stage)
139{
140 glActiveTextureARB(GL_TEXTURE0_ARB + stage);
141 glClientActiveTextureARB(GL_TEXTURE0_ARB + stage);
142 glBindTexture(GL_TEXTURE_2D, 0);
143 sCurrentBoundTextures[stage] = 0;
144}
145
137// static 146// static
138void LLImageGL::updateStats(F32 current_time) 147void LLImageGL::updateStats(F32 current_time)
139{ 148{
@@ -390,13 +399,8 @@ BOOL LLImageGL::bindTextureInternal(const S32 stage) const
390 llwarns << "Trying to bind a texture while GL is disabled!" << llendl; 399 llwarns << "Trying to bind a texture while GL is disabled!" << llendl;
391 } 400 }
392 401
393 stop_glerror();
394
395 glActiveTextureARB(GL_TEXTURE0_ARB + stage); 402 glActiveTextureARB(GL_TEXTURE0_ARB + stage);
396 //glClientActiveTextureARB(GL_TEXTURE0_ARB + stage); 403
397
398 stop_glerror();
399
400 if (sCurrentBoundTextures[stage] && sCurrentBoundTextures[stage] == mTexName) 404 if (sCurrentBoundTextures[stage] && sCurrentBoundTextures[stage] == mTexName)
401 { 405 {
402 // already set! 406 // already set!
@@ -411,7 +415,6 @@ BOOL LLImageGL::bindTextureInternal(const S32 stage) const
411 415
412 glBindTexture(mBindTarget, mTexName); 416 glBindTexture(mBindTarget, mTexName);
413 sCurrentBoundTextures[stage] = mTexName; 417 sCurrentBoundTextures[stage] = mTexName;
414 stop_glerror();
415 418
416 if (mLastBindTime != sLastFrameTime) 419 if (mLastBindTime != sLastFrameTime)
417 { 420 {
@@ -650,6 +653,7 @@ void LLImageGL::setImage(const U8* data_in, BOOL data_hasmips)
650 } 653 }
651 mHasMipMaps = FALSE; 654 mHasMipMaps = FALSE;
652 } 655 }
656 glFlush();
653 stop_glerror(); 657 stop_glerror();
654} 658}
655 659
@@ -664,6 +668,11 @@ BOOL LLImageGL::setSubImage(const U8* datap, S32 data_width, S32 data_height, S3
664 llwarns << "Setting subimage on image without GL texture" << llendl; 668 llwarns << "Setting subimage on image without GL texture" << llendl;
665 return FALSE; 669 return FALSE;
666 } 670 }
671 if (datap == NULL)
672 {
673 llwarns << "Setting subimage on image with NULL datap" << llendl;
674 return FALSE;
675 }
667 676
668 if (x_pos == 0 && y_pos == 0 && width == getWidth() && height == getHeight()) 677 if (x_pos == 0 && y_pos == 0 && width == getWidth() && height == getHeight())
669 { 678 {
@@ -676,7 +685,9 @@ BOOL LLImageGL::setSubImage(const U8* datap, S32 data_width, S32 data_height, S3
676 dump(); 685 dump();
677 llerrs << "setSubImage called with mipmapped image (not supported)" << llendl; 686 llerrs << "setSubImage called with mipmapped image (not supported)" << llendl;
678 } 687 }
679 llassert(mCurrentDiscardLevel == 0); 688 llassert_always(mCurrentDiscardLevel == 0);
689 llassert_always(x_pos >= 0 && y_pos >= 0);
690
680 if (((x_pos + width) > getWidth()) || 691 if (((x_pos + width) > getWidth()) ||
681 (y_pos + height) > getHeight()) 692 (y_pos + height) > getHeight())
682 { 693 {
@@ -717,9 +728,12 @@ BOOL LLImageGL::setSubImage(const U8* datap, S32 data_width, S32 data_height, S3
717 728
718 datap += (y_pos * data_width + x_pos) * getComponents(); 729 datap += (y_pos * data_width + x_pos) * getComponents();
719 // Update the GL texture 730 // Update the GL texture
720 llverify(bindTextureInternal(0)); 731 BOOL res = bindTextureInternal(0);
732 if (!res) llerrs << "LLImageGL::setSubImage(): bindTexture failed" << llendl;
721 stop_glerror(); 733 stop_glerror();
722 734
735 LLGLEnable tex( GL_TEXTURE_2D );
736
723 glTexSubImage2D(mTarget, 0, x_pos, y_pos, 737 glTexSubImage2D(mTarget, 0, x_pos, y_pos,
724 width, height, mFormatPrimary, mFormatType, datap); 738 width, height, mFormatPrimary, mFormatType, datap);
725 stop_glerror(); 739 stop_glerror();
@@ -733,7 +747,7 @@ BOOL LLImageGL::setSubImage(const U8* datap, S32 data_width, S32 data_height, S3
733 glPixelStorei(GL_UNPACK_ROW_LENGTH, 0); 747 glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
734 stop_glerror(); 748 stop_glerror();
735 } 749 }
736 750 glFlush();
737 return TRUE; 751 return TRUE;
738} 752}
739 753
diff --git a/linden/indra/llrender/llimagegl.h b/linden/indra/llrender/llimagegl.h
index 6356703..20c31d1 100644
--- a/linden/indra/llrender/llimagegl.h
+++ b/linden/indra/llrender/llimagegl.h
@@ -36,7 +36,7 @@
36 36
37//============================================================================ 37//============================================================================
38 38
39class LLImageGL : public LLThreadSafeRefCount 39class LLImageGL : public LLRefCount
40{ 40{
41public: 41public:
42 // Size calculation 42 // Size calculation
@@ -48,6 +48,7 @@ public:
48 // Usually you want stage = 0 and bind_target = GL_TEXTURE_2D 48 // Usually you want stage = 0 and bind_target = GL_TEXTURE_2D
49 static void bindExternalTexture( LLGLuint gl_name, S32 stage, LLGLenum bind_target); 49 static void bindExternalTexture( LLGLuint gl_name, S32 stage, LLGLenum bind_target);
50 static void unbindTexture(S32 stage, LLGLenum target); 50 static void unbindTexture(S32 stage, LLGLenum target);
51 static void unbindTexture(S32 stage); // Uses GL_TEXTURE_2D (not a default arg to avoid gl.h dependency)
51 52
52 // needs to be called every frame 53 // needs to be called every frame
53 static void updateStats(F32 current_time); 54 static void updateStats(F32 current_time);
diff --git a/linden/indra/llrender/llrender.vcproj b/linden/indra/llrender/llrender.vcproj
index 9ca9b03..d13384d 100644
--- a/linden/indra/llrender/llrender.vcproj
+++ b/linden/indra/llrender/llrender.vcproj
@@ -154,18 +154,6 @@
154 Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx" 154 Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
155 UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"> 155 UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
156 <File 156 <File
157 RelativePath=".\llagpmempool.cpp">
158 </File>
159 <File
160 RelativePath=".\llagpmempoolarb.cpp">
161 </File>
162 <File
163 RelativePath=".\llagpmempoolati.cpp">
164 </File>
165 <File
166 RelativePath=".\llagpmempoolnv.cpp">
167 </File>
168 <File
169 RelativePath=".\llfont.cpp"> 157 RelativePath=".\llfont.cpp">
170 </File> 158 </File>
171 <File 159 <File
@@ -178,6 +166,9 @@
178 RelativePath=".\llimagegl.cpp"> 166 RelativePath=".\llimagegl.cpp">
179 </File> 167 </File>
180 <File 168 <File
169 RelativePath=".\llvertexbuffer.cpp">
170 </File>
171 <File
181 RelativePath=".\text_out.cpp"> 172 RelativePath=".\text_out.cpp">
182 </File> 173 </File>
183 </Filter> 174 </Filter>
@@ -213,6 +204,9 @@
213 RelativePath=".\llimagegl.h"> 204 RelativePath=".\llimagegl.h">
214 </File> 205 </File>
215 <File 206 <File
207 RelativePath=".\llvertexbuffer.h">
208 </File>
209 <File
216 RelativePath=".\llvertexprogramgl.h"> 210 RelativePath=".\llvertexprogramgl.h">
217 </File> 211 </File>
218 <File 212 <File
diff --git a/linden/indra/llrender/llrender_vc8.vcproj b/linden/indra/llrender/llrender_vc8.vcproj
new file mode 100644
index 0000000..daa2cfc
--- /dev/null
+++ b/linden/indra/llrender/llrender_vc8.vcproj
@@ -0,0 +1,302 @@
1<?xml version="1.0" encoding="Windows-1252"?>
2<VisualStudioProject
3 ProjectType="Visual C++"
4 Version="8.00"
5 Name="llrender"
6 ProjectGUID="{2ADE3C14-94C4-40BF-B033-70F3C954EE90}"
7 Keyword="Win32Proj"
8 >
9 <Platforms>
10 <Platform
11 Name="Win32"
12 />
13 </Platforms>
14 <ToolFiles>
15 </ToolFiles>
16 <Configurations>
17 <Configuration
18 Name="Debug|Win32"
19 OutputDirectory="../lib_$(ConfigurationName)/i686-win32"
20 IntermediateDirectory="Debug"
21 ConfigurationType="4"
22 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
23 CharacterSet="1"
24 >
25 <Tool
26 Name="VCPreBuildEventTool"
27 />
28 <Tool
29 Name="VCCustomBuildTool"
30 />
31 <Tool
32 Name="VCXMLDataGeneratorTool"
33 />
34 <Tool
35 Name="VCWebServiceProxyGeneratorTool"
36 />
37 <Tool
38 Name="VCMIDLTool"
39 />
40 <Tool
41 Name="VCCLCompilerTool"
42 Optimization="0"
43 AdditionalIncludeDirectories="..\llcommon;..\llmath;..\llvfs;..\llmessage;..\llimage;..\llwindow;..\..\libraries\i686-win32\include;..\..\libraries\include\"
44 PreprocessorDefinitions="WIN32;_DEBUG;_LIB;LL_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;LL_DEBUG"
45 MinimalRebuild="true"
46 BasicRuntimeChecks="3"
47 RuntimeLibrary="1"
48 StructMemberAlignment="4"
49 TreatWChar_tAsBuiltInType="false"
50 ForceConformanceInForLoopScope="true"
51 UsePrecompiledHeader="0"
52 WarningLevel="3"
53 WarnAsError="true"
54 Detect64BitPortabilityProblems="false"
55 DebugInformationFormat="4"
56 />
57 <Tool
58 Name="VCManagedResourceCompilerTool"
59 />
60 <Tool
61 Name="VCResourceCompilerTool"
62 />
63 <Tool
64 Name="VCPreLinkEventTool"
65 />
66 <Tool
67 Name="VCLibrarianTool"
68 OutputFile="$(OutDir)/llrender.lib"
69 />
70 <Tool
71 Name="VCALinkTool"
72 />
73 <Tool
74 Name="VCXDCMakeTool"
75 />
76 <Tool
77 Name="VCBscMakeTool"
78 />
79 <Tool
80 Name="VCFxCopTool"
81 />
82 <Tool
83 Name="VCPostBuildEventTool"
84 />
85 </Configuration>
86 <Configuration
87 Name="Release|Win32"
88 OutputDirectory="../lib_$(ConfigurationName)/i686-win32"
89 IntermediateDirectory="Release"
90 ConfigurationType="4"
91 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
92 CharacterSet="1"
93 >
94 <Tool
95 Name="VCPreBuildEventTool"
96 />
97 <Tool
98 Name="VCCustomBuildTool"
99 />
100 <Tool
101 Name="VCXMLDataGeneratorTool"
102 />
103 <Tool
104 Name="VCWebServiceProxyGeneratorTool"
105 />
106 <Tool
107 Name="VCMIDLTool"
108 />
109 <Tool
110 Name="VCCLCompilerTool"
111 InlineFunctionExpansion="2"
112 EnableIntrinsicFunctions="true"
113 AdditionalIncludeDirectories="..\llcommon;..\llmath;..\llvfs;..\llmessage;..\llimage;..\llwindow;..\..\libraries\i686-win32\include;..\..\libraries\include\"
114 PreprocessorDefinitions="WIN32;NDEBUG;_LIB;LL_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;LL_RELEASE"
115 RuntimeLibrary="0"
116 StructMemberAlignment="0"
117 TreatWChar_tAsBuiltInType="false"
118 ForceConformanceInForLoopScope="true"
119 UsePrecompiledHeader="0"
120 WarningLevel="3"
121 WarnAsError="true"
122 Detect64BitPortabilityProblems="false"
123 DebugInformationFormat="3"
124 />
125 <Tool
126 Name="VCManagedResourceCompilerTool"
127 />
128 <Tool
129 Name="VCResourceCompilerTool"
130 />
131 <Tool
132 Name="VCPreLinkEventTool"
133 />
134 <Tool
135 Name="VCLibrarianTool"
136 OutputFile="$(OutDir)/llrender.lib"
137 />
138 <Tool
139 Name="VCALinkTool"
140 />
141 <Tool
142 Name="VCXDCMakeTool"
143 />
144 <Tool
145 Name="VCBscMakeTool"
146 />
147 <Tool
148 Name="VCFxCopTool"
149 />
150 <Tool
151 Name="VCPostBuildEventTool"
152 />
153 </Configuration>
154 <Configuration
155 Name="ReleaseNoOpt|Win32"
156 OutputDirectory="../lib_$(ConfigurationName)/i686-win32"
157 IntermediateDirectory="$(ConfigurationName)"
158 ConfigurationType="4"
159 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
160 CharacterSet="1"
161 >
162 <Tool
163 Name="VCPreBuildEventTool"
164 />
165 <Tool
166 Name="VCCustomBuildTool"
167 />
168 <Tool
169 Name="VCXMLDataGeneratorTool"
170 />
171 <Tool
172 Name="VCWebServiceProxyGeneratorTool"
173 />
174 <Tool
175 Name="VCMIDLTool"
176 />
177 <Tool
178 Name="VCCLCompilerTool"
179 Optimization="0"
180 AdditionalIncludeDirectories="..\llcommon;..\llmath;..\llvfs;..\llmessage;..\llimage;..\llwindow;..\..\libraries\i686-win32\include;..\..\libraries\include\"
181 PreprocessorDefinitions="WIN32;NDEBUG;_LIB;LL_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;LL_RELEASE"
182 RuntimeLibrary="0"
183 StructMemberAlignment="0"
184 TreatWChar_tAsBuiltInType="false"
185 ForceConformanceInForLoopScope="true"
186 UsePrecompiledHeader="0"
187 WarningLevel="3"
188 WarnAsError="true"
189 Detect64BitPortabilityProblems="false"
190 DebugInformationFormat="3"
191 />
192 <Tool
193 Name="VCManagedResourceCompilerTool"
194 />
195 <Tool
196 Name="VCResourceCompilerTool"
197 />
198 <Tool
199 Name="VCPreLinkEventTool"
200 />
201 <Tool
202 Name="VCLibrarianTool"
203 OutputFile="$(OutDir)/llrender.lib"
204 />
205 <Tool
206 Name="VCALinkTool"
207 />
208 <Tool
209 Name="VCXDCMakeTool"
210 />
211 <Tool
212 Name="VCBscMakeTool"
213 />
214 <Tool
215 Name="VCFxCopTool"
216 />
217 <Tool
218 Name="VCPostBuildEventTool"
219 />
220 </Configuration>
221 </Configurations>
222 <References>
223 </References>
224 <Files>
225 <Filter
226 Name="Source Files"
227 Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
228 UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
229 >
230 <File
231 RelativePath=".\llfont.cpp"
232 >
233 </File>
234 <File
235 RelativePath=".\llfontgl.cpp"
236 >
237 </File>
238 <File
239 RelativePath=".\llgldbg.cpp"
240 >
241 </File>
242 <File
243 RelativePath=".\llimagegl.cpp"
244 >
245 </File>
246 <File
247 RelativePath=".\llvertexbuffer.cpp"
248 >
249 </File>
250 <File
251 RelativePath=".\text_out.cpp"
252 >
253 </File>
254 </Filter>
255 <Filter
256 Name="Header Files"
257 Filter="h;hpp;hxx;hm;inl;inc;xsd"
258 UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
259 >
260 <File
261 RelativePath=".\glext.h"
262 >
263 </File>
264 <File
265 RelativePath=".\llfont.h"
266 >
267 </File>
268 <File
269 RelativePath=".\llfontgl.h"
270 >
271 </File>
272 <File
273 RelativePath=".\llgldbg.h"
274 >
275 </File>
276 <File
277 RelativePath=".\llimagegl.h"
278 >
279 </File>
280 <File
281 RelativePath=".\llvertexbuffer.h"
282 >
283 </File>
284 <File
285 RelativePath=".\llvertexprogramgl.h"
286 >
287 </File>
288 <File
289 RelativePath=".\text_out.h"
290 >
291 </File>
292 </Filter>
293 <Filter
294 Name="Resource Files"
295 Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
296 UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
297 >
298 </Filter>
299 </Files>
300 <Globals>
301 </Globals>
302</VisualStudioProject>
diff --git a/linden/indra/llrender/llvertexbuffer.cpp b/linden/indra/llrender/llvertexbuffer.cpp
new file mode 100644
index 0000000..b94f593
--- /dev/null
+++ b/linden/indra/llrender/llvertexbuffer.cpp
@@ -0,0 +1,922 @@
1#include "linden_common.h"
2
3#include "llvertexbuffer.h"
4// #include "llrender.h"
5#include "llglheaders.h"
6#include "llmemory.h"
7#include "llmemtype.h"
8
9//============================================================================
10
11//static
12S32 LLVertexBuffer::sCount = 0;
13S32 LLVertexBuffer::sGLCount = 0;
14BOOL LLVertexBuffer::sEnableVBOs = TRUE;
15U32 LLVertexBuffer::sGLRenderBuffer = 0;
16U32 LLVertexBuffer::sGLRenderIndices = 0;
17U32 LLVertexBuffer::sLastMask = 0;
18BOOL LLVertexBuffer::sVBOActive = FALSE;
19BOOL LLVertexBuffer::sIBOActive = FALSE;
20U32 LLVertexBuffer::sAllocatedBytes = 0;
21BOOL LLVertexBuffer::sRenderActive = FALSE;
22
23std::vector<U32> LLVertexBuffer::sDeleteList;
24LLVertexBuffer::buffer_list_t LLVertexBuffer::sLockedList;
25
26S32 LLVertexBuffer::sTypeOffsets[LLVertexBuffer::TYPE_MAX] =
27{
28 sizeof(LLVector3), // TYPE_VERTEX,
29 sizeof(LLVector3), // TYPE_NORMAL,
30 sizeof(LLVector2), // TYPE_TEXCOORD,
31 sizeof(LLVector2), // TYPE_TEXCOORD2,
32 sizeof(LLColor4U), // TYPE_COLOR,
33 sizeof(LLVector3), // TYPE_BINORMAL,
34 sizeof(F32), // TYPE_WEIGHT,
35 sizeof(LLVector4), // TYPE_CLOTHWEIGHT,
36};
37
38//static
39void LLVertexBuffer::initClass(bool use_vbo)
40{
41 sEnableVBOs = use_vbo;
42}
43
44//static
45void LLVertexBuffer::unbind()
46{
47 if (sVBOActive)
48 {
49 glBindBufferARB(GL_ARRAY_BUFFER_ARB, 0);
50 sVBOActive = FALSE;
51 }
52 if (sIBOActive)
53 {
54 glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, 0);
55 sIBOActive = FALSE;
56 }
57
58 sGLRenderBuffer = 0;
59 sGLRenderIndices = 0;
60}
61
62//static
63void LLVertexBuffer::cleanupClass()
64{
65 LLMemType mt(LLMemType::MTYPE_VERTEX_DATA);
66 sLockedList.clear();
67 startRender();
68 stopRender();
69 clientCopy(); // deletes GL buffers
70}
71
72//static, call before rendering VBOs
73void LLVertexBuffer::startRender()
74{
75 LLMemType mt(LLMemType::MTYPE_VERTEX_DATA);
76 if (sEnableVBOs)
77 {
78 glBindBufferARB(GL_ARRAY_BUFFER_ARB, 0);
79 glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, 0);
80 sVBOActive = FALSE;
81 sIBOActive = FALSE;
82 }
83
84 sRenderActive = TRUE;
85 sGLRenderBuffer = 0;
86 sGLRenderIndices = 0;
87 sLastMask = 0;
88}
89
90void LLVertexBuffer::stopRender()
91{
92 sRenderActive = FALSE;
93}
94
95void LLVertexBuffer::clientCopy(F64 max_time)
96{
97 if (!sDeleteList.empty())
98 {
99 size_t num = sDeleteList.size();
100 glDeleteBuffersARB(sDeleteList.size(), (GLuint*) &(sDeleteList[0]));
101 sDeleteList.clear();
102 sGLCount -= num;
103 }
104
105 if (sEnableVBOs)
106 {
107 LLTimer timer;
108 BOOL reset = TRUE;
109 buffer_list_t::iterator iter = sLockedList.begin();
110 while(iter != sLockedList.end())
111 {
112 LLVertexBuffer* buffer = *iter;
113 if (buffer->isLocked() && buffer->useVBOs())
114 {
115 buffer->setBuffer(0);
116 }
117 ++iter;
118 if (reset)
119 {
120 reset = FALSE;
121 timer.reset(); //skip first copy (don't count pipeline stall)
122 }
123 else
124 {
125 if (timer.getElapsedTimeF64() > max_time)
126 {
127 break;
128 }
129 }
130
131 }
132
133 sLockedList.erase(sLockedList.begin(), iter);
134 }
135}
136
137//----------------------------------------------------------------------------
138
139// For debugging
140struct VTNC /// Simple
141{
142 F32 v1,v2,v3;
143 F32 n1,n2,n3;
144 F32 t1,t2;
145 U32 c;
146};
147static VTNC dbg_vtnc;
148
149struct VTUNCB // Simple + Bump
150{
151 F32 v1,v2,v3;
152 F32 n1,n2,n3;
153 F32 t1,t2;
154 F32 u1,u2;
155 F32 b1,b2,b3;
156 U32 c;
157};
158static VTUNCB dbg_vtuncb;
159
160struct VTUNC // Surfacepatch
161{
162 F32 v1,v2,v3;
163 F32 n1,n2,n3;
164 F32 t1,t2;
165 F32 u1,u2;
166 U32 c;
167};
168static VTUNC dbg_vtunc;
169
170struct VTNW /// Avatar
171{
172 F32 v1,v2,v3;
173 F32 n1,n2,n3;
174 F32 t1,t2;
175 F32 w;
176};
177static VTNW dbg_vtnw;
178
179struct VTNPAD /// Avatar Output
180{
181 F32 v1,v2,v3,p1;
182 F32 n1,n2,n3,p2;
183 F32 t1,t2,p3,p4;
184};
185static VTNPAD dbg_vtnpad;
186
187//----------------------------------------------------------------------------
188
189LLVertexBuffer::LLVertexBuffer(U32 typemask, S32 usage) :
190 LLRefCount(),
191 mNumVerts(0), mNumIndices(0), mUsage(usage), mGLBuffer(0), mGLIndices(0),
192 mMappedData(NULL),
193 mMappedIndexData(NULL), mLocked(FALSE),
194 mFinal(FALSE),
195 mFilthy(FALSE),
196 mEmpty(TRUE),
197 mResized(FALSE)
198{
199 LLMemType mt(LLMemType::MTYPE_VERTEX_DATA);
200 if (!sEnableVBOs)
201 {
202 mUsage = GL_STREAM_DRAW_ARB;
203 }
204
205 S32 stride = 0;
206 for (S32 i=0; i<TYPE_MAX; i++)
207 {
208 U32 mask = 1<<i;
209 if (typemask & mask)
210 {
211 mOffsets[i] = stride;
212 stride += sTypeOffsets[i];
213 }
214 }
215 mTypeMask = typemask;
216 mStride = stride;
217 sCount++;
218}
219
220// protected, use unref()
221//virtual
222LLVertexBuffer::~LLVertexBuffer()
223{
224 LLMemType mt(LLMemType::MTYPE_VERTEX_DATA);
225 destroyGLBuffer();
226 destroyGLIndices();
227 sCount--;
228
229 if (mLocked)
230 {
231 //pull off of locked list
232 for (buffer_list_t::iterator i = sLockedList.begin(); i != sLockedList.end(); ++i)
233 {
234 if (*i == this)
235 {
236 sLockedList.erase(i);
237 break;
238 }
239 }
240 }
241};
242
243//----------------------------------------------------------------------------
244
245void LLVertexBuffer::createGLBuffer()
246{
247 LLMemType mt(LLMemType::MTYPE_VERTEX_DATA);
248
249 U32 size = getSize();
250 if (mGLBuffer)
251 {
252 destroyGLBuffer();
253 }
254
255 if (size == 0)
256 {
257 return;
258 }
259
260 mMappedData = new U8[size];
261 memset(mMappedData, 0, size);
262 mEmpty = TRUE;
263
264 if (useVBOs())
265 {
266 glGenBuffersARB(1, (GLuint*) &mGLBuffer);
267 mResized = TRUE;
268 sGLCount++;
269 }
270 else
271 {
272 static int gl_buffer_idx = 0;
273 mGLBuffer = ++gl_buffer_idx;
274 }
275}
276
277void LLVertexBuffer::createGLIndices()
278{
279 LLMemType mt(LLMemType::MTYPE_VERTEX_DATA);
280 U32 size = getIndicesSize();
281
282 if (mGLIndices)
283 {
284 destroyGLIndices();
285 }
286
287 if (size == 0)
288 {
289 return;
290 }
291
292 mMappedIndexData = new U8[size];
293 memset(mMappedIndexData, 0, size);
294 mEmpty = TRUE;
295
296 if (useVBOs())
297 {
298 glGenBuffersARB(1, (GLuint*) &mGLIndices);
299 mResized = TRUE;
300 sGLCount++;
301 }
302 else
303 {
304 static int gl_buffer_idx = 0;
305 mGLIndices = ++gl_buffer_idx;
306 }
307}
308
309void LLVertexBuffer::destroyGLBuffer()
310{
311 LLMemType mt(LLMemType::MTYPE_VERTEX_DATA);
312 if (mGLBuffer)
313 {
314 if (useVBOs())
315 {
316 sDeleteList.push_back(mGLBuffer);
317 }
318
319 delete [] mMappedData;
320 mMappedData = NULL;
321 mEmpty = TRUE;
322 sAllocatedBytes -= getSize();
323 }
324
325 mGLBuffer = 0;
326}
327
328void LLVertexBuffer::destroyGLIndices()
329{
330 LLMemType mt(LLMemType::MTYPE_VERTEX_DATA);
331 if (mGLIndices)
332 {
333 if (useVBOs())
334 {
335 sDeleteList.push_back(mGLIndices);
336 }
337
338 delete [] mMappedIndexData;
339 mMappedIndexData = NULL;
340 mEmpty = TRUE;
341 sAllocatedBytes -= getIndicesSize();
342 }
343
344 mGLIndices = 0;
345}
346
347void LLVertexBuffer::updateNumVerts(S32 nverts)
348{
349 LLMemType mt(LLMemType::MTYPE_VERTEX_DATA);
350 if (!mDynamicSize)
351 {
352 mNumVerts = nverts;
353 }
354 else if (mUsage == GL_STATIC_DRAW_ARB ||
355 nverts > mNumVerts ||
356 nverts < mNumVerts/2)
357 {
358 if (mUsage != GL_STATIC_DRAW_ARB)
359 {
360 nverts += nverts/4;
361 }
362
363 mNumVerts = nverts;
364 }
365}
366
367void LLVertexBuffer::updateNumIndices(S32 nindices)
368{
369 LLMemType mt(LLMemType::MTYPE_VERTEX_DATA);
370 if (!mDynamicSize)
371 {
372 mNumIndices = nindices;
373 }
374 else if (mUsage == GL_STATIC_DRAW_ARB ||
375 nindices > mNumIndices ||
376 nindices < mNumIndices/2)
377 {
378 if (mUsage != GL_STATIC_DRAW_ARB)
379 {
380 nindices += nindices/4;
381 }
382
383 mNumIndices = nindices;
384 }
385}
386
387void LLVertexBuffer::makeStatic()
388{
389 if (!sEnableVBOs)
390 {
391 return;
392 }
393
394 if (sRenderActive)
395 {
396 llerrs << "Make static called during render." << llendl;
397 }
398
399 if (mUsage != GL_STATIC_DRAW_ARB)
400 {
401 if (useVBOs())
402 {
403 if (mGLBuffer)
404 {
405 sDeleteList.push_back(mGLBuffer);
406 }
407 if (mGLIndices)
408 {
409 sDeleteList.push_back(mGLIndices);
410 }
411 }
412
413 if (mGLBuffer)
414 {
415 sGLCount++;
416 glGenBuffersARB(1, (GLuint*) &mGLBuffer);
417 }
418 if (mGLIndices)
419 {
420 sGLCount++;
421 glGenBuffersARB(1, (GLuint*) &mGLIndices);
422 }
423
424 mUsage = GL_STATIC_DRAW_ARB;
425 mResized = TRUE;
426
427 if (!mLocked)
428 {
429 mLocked = TRUE;
430 sLockedList.push_back(this);
431 }
432 }
433}
434
435void LLVertexBuffer::allocateBuffer(S32 nverts, S32 nindices, bool create)
436{
437 LLMemType mt(LLMemType::MTYPE_VERTEX_DATA);
438
439 updateNumVerts(nverts);
440 updateNumIndices(nindices);
441
442 if (mMappedData)
443 {
444 llerrs << "LLVertexBuffer::allocateBuffer() called redundantly." << llendl;
445 }
446 if (create && (nverts || nindices))
447 {
448 createGLBuffer();
449 createGLIndices();
450 }
451
452 sAllocatedBytes += getSize() + getIndicesSize();
453}
454
455void LLVertexBuffer::resizeBuffer(S32 newnverts, S32 newnindices)
456{
457 LLMemType mt(LLMemType::MTYPE_VERTEX_DATA);
458 mDynamicSize = TRUE;
459 if (mUsage == GL_STATIC_DRAW_ARB)
460 { //always delete/allocate static buffers on resize
461 destroyGLBuffer();
462 destroyGLIndices();
463 allocateBuffer(newnverts, newnindices, TRUE);
464 mFinal = FALSE;
465 }
466 else if (newnverts > mNumVerts || newnindices > mNumIndices ||
467 newnverts < mNumVerts/2 || newnindices < mNumIndices/2)
468 {
469 sAllocatedBytes -= getSize() + getIndicesSize();
470
471 S32 oldsize = getSize();
472 S32 old_index_size = getIndicesSize();
473
474 updateNumVerts(newnverts);
475 updateNumIndices(newnindices);
476
477 S32 newsize = getSize();
478 S32 new_index_size = getIndicesSize();
479
480 sAllocatedBytes += newsize + new_index_size;
481
482 if (newsize)
483 {
484 if (!mGLBuffer)
485 { //no buffer exists, create a new one
486 createGLBuffer();
487 }
488 else
489 {
490 //delete old buffer, keep GL buffer for now
491 U8* old = mMappedData;
492 mMappedData = new U8[newsize];
493 if (old)
494 {
495 memcpy(mMappedData, old, llmin(newsize, oldsize));
496 if (newsize > oldsize)
497 {
498 memset(mMappedData+oldsize, 0, newsize-oldsize);
499 }
500
501 delete [] old;
502 }
503 else
504 {
505 memset(mMappedData, 0, newsize);
506 mEmpty = TRUE;
507 }
508 mResized = TRUE;
509 }
510 }
511 else if (mGLBuffer)
512 {
513 destroyGLBuffer();
514 }
515
516 if (new_index_size)
517 {
518 if (!mGLIndices)
519 {
520 createGLIndices();
521 }
522 else
523 {
524 //delete old buffer, keep GL buffer for now
525 U8* old = mMappedIndexData;
526 mMappedIndexData = new U8[new_index_size];
527 if (old)
528 {
529 memcpy(mMappedIndexData, old, llmin(new_index_size, old_index_size));
530 if (new_index_size > old_index_size)
531 {
532 memset(mMappedIndexData+old_index_size, 0, new_index_size - old_index_size);
533 }
534 delete [] old;
535 }
536 else
537 {
538 memset(mMappedIndexData, 0, new_index_size);
539 mEmpty = TRUE;
540 }
541 mResized = TRUE;
542 }
543 }
544 else if (mGLIndices)
545 {
546 destroyGLIndices();
547 }
548 }
549}
550
551BOOL LLVertexBuffer::useVBOs() const
552{
553 //it's generally ineffective to use VBO for things that are streaming
554 //when we already have a client buffer around
555 if (mUsage == GL_STREAM_DRAW_ARB)
556 {
557 return FALSE;
558 }
559
560 return sEnableVBOs && (!sRenderActive || !mLocked);
561}
562
563//----------------------------------------------------------------------------
564
565// Map for data access
566U8* LLVertexBuffer::mapBuffer(S32 access)
567{
568 LLMemType mt(LLMemType::MTYPE_VERTEX_DATA);
569 if (sRenderActive)
570 {
571 llwarns << "Buffer mapped during render frame!" << llendl;
572 }
573 if (!mGLBuffer && !mGLIndices)
574 {
575 llerrs << "LLVertexBuffer::mapBuffer() called before createGLBuffer" << llendl;
576 }
577 if (mFinal)
578 {
579 llerrs << "LLVertexBuffer::mapBuffer() called on a finalized buffer." << llendl;
580 }
581 if (!mMappedData && !mMappedIndexData)
582 {
583 llerrs << "LLVertexBuffer::mapBuffer() called on unallocated buffer." << llendl;
584 }
585
586 if (!mLocked && useVBOs())
587 {
588 mLocked = TRUE;
589 sLockedList.push_back(this);
590 }
591
592 return mMappedData;
593}
594
595void LLVertexBuffer::unmapBuffer()
596{
597 LLMemType mt(LLMemType::MTYPE_VERTEX_DATA);
598 if (mMappedData || mMappedIndexData)
599 {
600 if (useVBOs() && mLocked)
601 {
602 if (mGLBuffer)
603 {
604 if (mResized)
605 {
606 glBufferDataARB(GL_ARRAY_BUFFER_ARB, getSize(), mMappedData, mUsage);
607 }
608 else
609 {
610 if (mEmpty || mDirtyRegions.empty())
611 {
612 glBufferSubDataARB(GL_ARRAY_BUFFER_ARB, 0, getSize(), mMappedData);
613 }
614 else
615 {
616 for (std::vector<DirtyRegion>::iterator i = mDirtyRegions.begin(); i != mDirtyRegions.end(); ++i)
617 {
618 DirtyRegion& region = *i;
619 glBufferSubDataARB(GL_ARRAY_BUFFER_ARB, region.mIndex*mStride, region.mCount*mStride, mMappedData + region.mIndex*mStride);
620 }
621 }
622 }
623 }
624
625 if (mGLIndices)
626 {
627 if (mResized)
628 {
629 glBufferDataARB(GL_ELEMENT_ARRAY_BUFFER_ARB, getIndicesSize(), mMappedIndexData, mUsage);
630 }
631 else
632 {
633 if (mEmpty || mDirtyRegions.empty())
634 {
635 glBufferSubDataARB(GL_ELEMENT_ARRAY_BUFFER_ARB, 0, getIndicesSize(), mMappedIndexData);
636 }
637 else
638 {
639 for (std::vector<DirtyRegion>::iterator i = mDirtyRegions.begin(); i != mDirtyRegions.end(); ++i)
640 {
641 DirtyRegion& region = *i;
642 glBufferSubDataARB(GL_ELEMENT_ARRAY_BUFFER_ARB, region.mIndicesIndex*sizeof(U32),
643 region.mIndicesCount*sizeof(U32), mMappedIndexData + region.mIndicesIndex*sizeof(U32));
644 }
645 }
646 }
647 }
648
649 mDirtyRegions.clear();
650 mFilthy = FALSE;
651 mResized = FALSE;
652
653 if (mUsage == GL_STATIC_DRAW_ARB)
654 { //static draw buffers can only be mapped a single time
655 //throw out client data (we won't be using it again)
656 delete [] mMappedData;
657 delete [] mMappedIndexData;
658 mMappedIndexData = NULL;
659 mMappedData = NULL;
660 mEmpty = TRUE;
661 mFinal = TRUE;
662 }
663 else
664 {
665 mEmpty = FALSE;
666 }
667
668 mLocked = FALSE;
669
670 glFlush();
671 }
672 }
673}
674
675//----------------------------------------------------------------------------
676
677template <class T,S32 type> struct VertexBufferStrider
678{
679 typedef LLStrider<T> strider_t;
680 static bool get(LLVertexBuffer& vbo,
681 strider_t& strider,
682 S32 index)
683 {
684 vbo.mapBuffer();
685 if (type == LLVertexBuffer::TYPE_INDEX)
686 {
687 S32 stride = sizeof(T);
688 strider = (T*)(vbo.getMappedIndices() + index*stride);
689 strider.setStride(0);
690 return TRUE;
691 }
692 else if (vbo.hasDataType(type))
693 {
694 S32 stride = vbo.getStride();
695 strider = (T*)(vbo.getMappedData() + vbo.getOffset(type) + index*stride);
696 strider.setStride(stride);
697 return TRUE;
698 }
699 else
700 {
701 llerrs << "VertexBufferStrider could not find valid vertex data." << llendl;
702 }
703 return FALSE;
704 }
705};
706
707
708bool LLVertexBuffer::getVertexStrider(LLStrider<LLVector3>& strider, S32 index)
709{
710 return VertexBufferStrider<LLVector3,TYPE_VERTEX>::get(*this, strider, index);
711}
712bool LLVertexBuffer::getIndexStrider(LLStrider<U32>& strider, S32 index)
713{
714 return VertexBufferStrider<U32,TYPE_INDEX>::get(*this, strider, index);
715}
716bool LLVertexBuffer::getTexCoordStrider(LLStrider<LLVector2>& strider, S32 index)
717{
718 return VertexBufferStrider<LLVector2,TYPE_TEXCOORD>::get(*this, strider, index);
719}
720bool LLVertexBuffer::getTexCoord2Strider(LLStrider<LLVector2>& strider, S32 index)
721{
722 return VertexBufferStrider<LLVector2,TYPE_TEXCOORD2>::get(*this, strider, index);
723}
724bool LLVertexBuffer::getNormalStrider(LLStrider<LLVector3>& strider, S32 index)
725{
726 return VertexBufferStrider<LLVector3,TYPE_NORMAL>::get(*this, strider, index);
727}
728bool LLVertexBuffer::getBinormalStrider(LLStrider<LLVector3>& strider, S32 index)
729{
730 return VertexBufferStrider<LLVector3,TYPE_BINORMAL>::get(*this, strider, index);
731}
732bool LLVertexBuffer::getColorStrider(LLStrider<LLColor4U>& strider, S32 index)
733{
734 return VertexBufferStrider<LLColor4U,TYPE_COLOR>::get(*this, strider, index);
735}
736bool LLVertexBuffer::getWeightStrider(LLStrider<F32>& strider, S32 index)
737{
738 return VertexBufferStrider<F32,TYPE_WEIGHT>::get(*this, strider, index);
739}
740bool LLVertexBuffer::getClothWeightStrider(LLStrider<LLVector4>& strider, S32 index)
741{
742 return VertexBufferStrider<LLVector4,TYPE_CLOTHWEIGHT>::get(*this, strider, index);
743}
744
745void LLVertexBuffer::setStride(S32 type, S32 new_stride)
746{
747 LLMemType mt(LLMemType::MTYPE_VERTEX_DATA);
748 if (mNumVerts)
749 {
750 llerrs << "LLVertexBuffer::setOffset called with mNumVerts = " << mNumVerts << llendl;
751 }
752 // This code assumes that setStride() will only be called once per VBO per type.
753 S32 delta = new_stride - sTypeOffsets[type];
754 for (S32 i=type+1; i<TYPE_MAX; i++)
755 {
756 if (mTypeMask & (1<<i))
757 {
758 mOffsets[i] += delta;
759 }
760 }
761 mStride += delta;
762}
763
764//----------------------------------------------------------------------------
765
766// Set for rendering
767void LLVertexBuffer::setBuffer(U32 data_mask)
768{
769 LLMemType mt(LLMemType::MTYPE_VERTEX_DATA);
770 //set up pointers if the data mask is different ...
771 BOOL setup = (sLastMask != data_mask);
772
773 if (useVBOs())
774 {
775 if (mGLBuffer && (mGLBuffer != sGLRenderBuffer || !sVBOActive))
776 {
777 glBindBufferARB(GL_ARRAY_BUFFER_ARB, mGLBuffer);
778 sVBOActive = TRUE;
779 setup = TRUE; // ... or the bound buffer changed
780 }
781 if (mGLIndices && (mGLIndices != sGLRenderIndices || !sIBOActive))
782 {
783 glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, mGLIndices);
784 sIBOActive = TRUE;
785 }
786
787 unmapBuffer();
788 }
789 else
790 {
791 if (mGLBuffer)
792 {
793 if (sEnableVBOs && sVBOActive)
794 {
795 glBindBufferARB(GL_ARRAY_BUFFER_ARB, 0);
796 sVBOActive = FALSE;
797 setup = TRUE; // ... or a VBO is deactivated
798 }
799 if (sGLRenderBuffer != mGLBuffer)
800 {
801 setup = TRUE; // ... or a client memory pointer changed
802 }
803 }
804 if (sEnableVBOs && mGLIndices && sIBOActive)
805 {
806 glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, 0);
807 sIBOActive = FALSE;
808 }
809 }
810
811 if (mGLIndices)
812 {
813 sGLRenderIndices = mGLIndices;
814 }
815 if (mGLBuffer)
816 {
817 sGLRenderBuffer = mGLBuffer;
818 if (data_mask && setup)
819 {
820 if (!sRenderActive)
821 {
822 llwarns << "Vertex buffer set for rendering outside of render frame." << llendl;
823 }
824 setupVertexBuffer(data_mask); // subclass specific setup (virtual function)
825 sLastMask = data_mask;
826 }
827 }
828}
829
830// virtual (default)
831void LLVertexBuffer::setupVertexBuffer(U32 data_mask) const
832{
833 LLMemType mt(LLMemType::MTYPE_VERTEX_DATA);
834 stop_glerror();
835 U8* base = useVBOs() ? NULL : mMappedData;
836 S32 stride = mStride;
837
838 if ((data_mask & mTypeMask) != data_mask)
839 {
840 llerrs << "LLVertexBuffer::setupVertexBuffer missing required components for supplied data mask." << llendl;
841 }
842
843 if (data_mask & MAP_VERTEX)
844 {
845 glVertexPointer(3,GL_FLOAT, stride, (void*)(base + 0));
846 }
847 if (data_mask & MAP_NORMAL)
848 {
849 glNormalPointer(GL_FLOAT, stride, (void*)(base + mOffsets[TYPE_NORMAL]));
850 }
851 if (data_mask & MAP_TEXCOORD2)
852 {
853 glClientActiveTextureARB(GL_TEXTURE1_ARB);
854 glTexCoordPointer(2,GL_FLOAT, stride, (void*)(base + mOffsets[TYPE_TEXCOORD2]));
855 }
856 if (data_mask & MAP_TEXCOORD)
857 {
858 glClientActiveTextureARB(GL_TEXTURE0_ARB);
859 glTexCoordPointer(2,GL_FLOAT, stride, (void*)(base + mOffsets[TYPE_TEXCOORD]));
860 }
861 if (data_mask & MAP_COLOR)
862 {
863 glColorPointer(4, GL_UNSIGNED_BYTE, stride, (void*)(base + mOffsets[TYPE_COLOR]));
864 }
865 if (data_mask & MAP_BINORMAL)
866 {
867 glVertexAttribPointerARB(6, 3, GL_FLOAT, FALSE, stride, (void*)(base + mOffsets[TYPE_BINORMAL]));
868 }
869 if (data_mask & MAP_WEIGHT)
870 {
871 glVertexAttribPointerARB(1, 1, GL_FLOAT, FALSE, stride, (void*)(base + mOffsets[TYPE_WEIGHT]));
872 }
873 if (data_mask & MAP_CLOTHWEIGHT)
874 {
875 glVertexAttribPointerARB(4, 4, GL_FLOAT, TRUE, stride, (void*)(base + mOffsets[TYPE_CLOTHWEIGHT]));
876 }
877
878 llglassertok();
879}
880
881void LLVertexBuffer::markDirty(U32 vert_index, U32 vert_count, U32 indices_index, U32 indices_count)
882{
883 if (useVBOs() && !mFilthy)
884 {
885 if (!mDirtyRegions.empty())
886 {
887 DirtyRegion& region = *(mDirtyRegions.rbegin());
888
889 if (region.mIndex+region.mCount > vert_index)
890 {
891 //this buffer has received multiple updates since the last copy, mark it filthy
892 mFilthy = TRUE;
893 mDirtyRegions.clear();
894 return;
895 }
896
897 if (region.mIndex + region.mCount == vert_index &&
898 region.mIndicesIndex + region.mIndicesCount == indices_index)
899 {
900 region.mCount += vert_count;
901 region.mIndicesCount += indices_count;
902 return;
903 }
904 }
905
906 mDirtyRegions.push_back(DirtyRegion(vert_index,vert_count,indices_index,indices_count));
907 }
908}
909
910void LLVertexBuffer::markClean()
911{
912 if (!mResized && !mEmpty && !mFilthy)
913 {
914 buffer_list_t::reverse_iterator iter = sLockedList.rbegin();
915 if (*iter == this)
916 {
917 mLocked = FALSE;
918 sLockedList.pop_back();
919 }
920 }
921}
922
diff --git a/linden/indra/llrender/llvertexbuffer.h b/linden/indra/llrender/llvertexbuffer.h
new file mode 100644
index 0000000..b221d35
--- /dev/null
+++ b/linden/indra/llrender/llvertexbuffer.h
@@ -0,0 +1,179 @@
1#ifndef LL_LLVERTEXBUFFER_H
2#define LL_LLVERTEXBUFFER_H
3
4#include "llgl.h"
5#include "v2math.h"
6#include "v3math.h"
7#include "v4math.h"
8#include "v4coloru.h"
9#include "llstrider.h"
10#include "llmemory.h"
11#include <set>
12#include <vector>
13
14//============================================================================
15// NOTES
16// Threading:
17// All constructors should take an 'create' paramater which should only be
18// 'true' when called from the main thread. Otherwise createGLBuffer() will
19// be called as soon as getVertexPointer(), etc is called (which MUST ONLY be
20// called from the main (i.e OpenGL) thread)
21
22//============================================================================
23// base class
24
25class LLVertexBuffer : public LLRefCount
26{
27public:
28 static void initClass(bool use_vbo);
29 static void cleanupClass();
30 static void startRender(); //between start and stop render, no client copies will occur
31 static void stopRender(); //any buffer not copied to GL will be rendered from client memory
32 static void clientCopy(F64 max_time = 0.005); //copy data from client to GL
33 static void unbind(); //unbind any bound vertex buffer
34
35 enum {
36 TYPE_VERTEX,
37 TYPE_NORMAL,
38 TYPE_TEXCOORD,
39 TYPE_TEXCOORD2,
40 TYPE_COLOR,
41 // These use VertexAttribPointer and should possibly be made generic
42 TYPE_BINORMAL,
43 TYPE_WEIGHT,
44 TYPE_CLOTHWEIGHT,
45 TYPE_MAX,
46 TYPE_INDEX,
47 };
48 enum {
49 MAP_VERTEX = (1<<TYPE_VERTEX),
50 MAP_NORMAL = (1<<TYPE_NORMAL),
51 MAP_TEXCOORD = (1<<TYPE_TEXCOORD),
52 MAP_TEXCOORD2 = (1<<TYPE_TEXCOORD2),
53 MAP_COLOR = (1<<TYPE_COLOR),
54 // These use VertexAttribPointer and should possibly be made generic
55 MAP_BINORMAL = (1<<TYPE_BINORMAL),
56 MAP_WEIGHT = (1<<TYPE_WEIGHT),
57 MAP_CLOTHWEIGHT = (1<<TYPE_CLOTHWEIGHT),
58 MAP_DRAW = 0x2000, // Buffer is in draw (read-only) mode
59 MAP_MAPPED = 0x4000, // Indicates that buffer has been mapped, but not to any type of data
60 MAP_UNMAPPED = 0x8000 // Indicates that buffer has been logically un-mapped
61 };
62
63protected:
64 virtual ~LLVertexBuffer(); // use unref()
65
66 virtual void setupVertexBuffer(U32 data_mask) const; // pure virtual, called from mapBuffer()
67
68 void createGLBuffer();
69 void createGLIndices();
70 void destroyGLBuffer();
71 void destroyGLIndices();
72 void updateNumVerts(S32 nverts);
73 void updateNumIndices(S32 nindices);
74 virtual BOOL useVBOs() const;
75 void unmapBuffer();
76
77public:
78 LLVertexBuffer(U32 typemask, S32 usage);
79
80 // map for data access
81 U8* mapBuffer(S32 access = -1);
82 // set for rendering
83 virtual void setBuffer(U32 data_mask); // calls setupVertexBuffer() if data_mask is not 0
84 // allocate buffer
85 void allocateBuffer(S32 nverts, S32 nindices, bool create);
86 virtual void resizeBuffer(S32 newnverts, S32 newnindices);
87 void makeStatic();
88
89 // Only call each getVertexPointer, etc, once before calling unmapBuffer()
90 // call unmapBuffer() after calls to getXXXStrider() before any cals to setBuffer()
91 // example:
92 // vb->getVertexBuffer(verts);
93 // vb->getNormalStrider(norms);
94 // setVertsNorms(verts, norms);
95 // vb->unmapBuffer();
96 bool getVertexStrider(LLStrider<LLVector3>& strider, S32 index=0);
97 bool getIndexStrider(LLStrider<U32>& strider, S32 index=0);
98 bool getTexCoordStrider(LLStrider<LLVector2>& strider, S32 index=0);
99 bool getTexCoord2Strider(LLStrider<LLVector2>& strider, S32 index=0);
100 bool getNormalStrider(LLStrider<LLVector3>& strider, S32 index=0);
101 bool getBinormalStrider(LLStrider<LLVector3>& strider, S32 index=0);
102 bool getColorStrider(LLStrider<LLColor4U>& strider, S32 index=0);
103 bool getWeightStrider(LLStrider<F32>& strider, S32 index=0);
104 bool getClothWeightStrider(LLStrider<LLVector4>& strider, S32 index=0);
105
106 BOOL isEmpty() const { return mEmpty; }
107 BOOL isLocked() const { return mLocked; }
108 S32 getNumVerts() const { return mNumVerts; }
109 S32 getNumIndices() const { return mNumIndices; }
110 U8* getIndicesPointer() const { return useVBOs() ? NULL : mMappedIndexData; }
111 U8* getVerticesPointer() const { return useVBOs() ? NULL : mMappedData; }
112 S32 getStride() const { return mStride; }
113 S32 getTypeMask() const { return mTypeMask; }
114 BOOL hasDataType(S32 type) const { return ((1 << type) & getTypeMask()) ? TRUE : FALSE; }
115 S32 getSize() const { return mNumVerts*mStride; }
116 S32 getIndicesSize() const { return mNumIndices * sizeof(U32); }
117 U8* getMappedData() const { return mMappedData; }
118 U8* getMappedIndices() const { return mMappedIndexData; }
119 S32 getOffset(S32 type) const { return mOffsets[type]; }
120 S32 getUsage() const { return mUsage; }
121
122 void setStride(S32 type, S32 new_stride);
123
124 void markDirty(U32 vert_index, U32 vert_count, U32 indices_index, U32 indices_count);
125 void markClean();
126
127protected:
128 S32 mNumVerts; // Number of vertices
129 S32 mNumIndices; // Number of indices
130 S32 mStride;
131 U32 mTypeMask;
132 S32 mUsage; // GL usage
133 U32 mGLBuffer; // GL VBO handle
134 U32 mGLIndices; // GL IBO handle
135 U8* mMappedData; // pointer to currently mapped data (NULL if unmapped)
136 U8* mMappedIndexData; // pointer to currently mapped indices (NULL if unmapped)
137 BOOL mLocked; // if TRUE, buffer is being or has been written to in client memory
138 BOOL mFinal; // if TRUE, buffer can not be mapped again
139 BOOL mFilthy; // if TRUE, entire buffer must be copied (used to prevent redundant dirty flags)
140 BOOL mEmpty; // if TRUE, client buffer is empty (or NULL). Old values have been discarded.
141 S32 mOffsets[TYPE_MAX];
142 BOOL mResized; // if TRUE, client buffer has been resized and GL buffer has not
143 BOOL mDynamicSize; // if TRUE, buffer has been resized at least once (and should be padded)
144
145 class DirtyRegion
146 {
147 public:
148 U32 mIndex;
149 U32 mCount;
150 U32 mIndicesIndex;
151 U32 mIndicesCount;
152
153 DirtyRegion(U32 vi, U32 vc, U32 ii, U32 ic)
154 : mIndex(vi), mCount(vc), mIndicesIndex(ii), mIndicesCount(ic)
155 { }
156 };
157
158 std::vector<DirtyRegion> mDirtyRegions; //vector of dirty regions to rebuild
159
160public:
161 static BOOL sRenderActive;
162 static S32 sCount;
163 static S32 sGLCount;
164 static std::vector<U32> sDeleteList;
165 typedef std::list<LLVertexBuffer*> buffer_list_t;
166 static buffer_list_t sLockedList;
167
168 static BOOL sEnableVBOs;
169 static S32 sTypeOffsets[TYPE_MAX];
170 static U32 sGLRenderBuffer;
171 static U32 sGLRenderIndices;
172 static BOOL sVBOActive;
173 static BOOL sIBOActive;
174 static U32 sLastMask;
175 static U32 sAllocatedBytes;
176};
177
178
179#endif // LL_LLVERTEXBUFFER_H
diff --git a/linden/indra/llrender/llvertexprogramgl.cpp b/linden/indra/llrender/llvertexprogramgl.cpp
index bc00a64..4ccdf01 100644
--- a/linden/indra/llrender/llvertexprogramgl.cpp
+++ b/linden/indra/llrender/llvertexprogramgl.cpp
@@ -92,13 +92,13 @@ BOOL LLVertexProgramGL::load(const char * filename)
92 line_num++; 92 line_num++;
93 next_token = strchr(next_token, '\n'); 93 next_token = strchr(next_token, '\n');
94 } 94 }
95 char output[1024];
96 char bad_code[11]; 95 char bad_code[11];
97 strncpy(bad_code, text_buffer + error_pos, 10); 96 strncpy(bad_code, text_buffer + error_pos, 10);
98 bad_code[10] = '\0'; 97 bad_code[10] = '\0';
99 98
100 sprintf(output, "%s(%d): Vertex Program Error: %s at (%s)\n", filename, line_num, program_error_string, bad_code); 99 llerrs << filename << "(" << line_num << "): Vertex Program Error: "
101 gErrorStream << output << std::endl; 100 << program_error_string << " at (" << bad_code<< ")"
101 << llendl;
102 // clean up buffer 102 // clean up buffer
103 delete[] text_buffer; 103 delete[] text_buffer;
104 return FALSE; 104 return FALSE;
diff --git a/linden/indra/llrender/text_out.cpp b/linden/indra/llrender/text_out.cpp
index f4892b2..572ed03 100644
--- a/linden/indra/llrender/text_out.cpp
+++ b/linden/indra/llrender/text_out.cpp
@@ -52,7 +52,7 @@ typedef struct s_text_line
52// const LLFontGL *font; 52// const LLFontGL *font;
53// U8 color[3]; 53// U8 color[3];
54// U8 bg_color[3]; 54// U8 bg_color[3];
55 char line[MAX_TEXT_LINE_LENGTH]; 55 char line[MAX_TEXT_LINE_LENGTH]; /* Flawfinder: ignore */
56 S32 x, y; 56 S32 x, y;
57// ETextModifiers tm; 57// ETextModifiers tm;
58// ETextColorModifiers fcm; 58// ETextColorModifiers fcm;
@@ -84,7 +84,7 @@ void add_text(S32 x, S32 y, char *text) // , ETextModifiers tm, ETextColorModifi
84 84
85 TEXT_LINE *linep = &gTextLine[gNumTextLines++]; 85 TEXT_LINE *linep = &gTextLine[gNumTextLines++];
86 86
87 strcpy(linep->line, text); 87 strcpy(linep->line, text); /* Flawfinder: ignore */
88 linep->x = x; 88 linep->x = x;
89 linep->y = y; 89 linep->y = y;
90} 90}
diff --git a/linden/indra/llui/llalertdialog.cpp b/linden/indra/llui/llalertdialog.cpp
index 861bbc6..6523e44 100644
--- a/linden/indra/llui/llalertdialog.cpp
+++ b/linden/indra/llui/llalertdialog.cpp
@@ -218,7 +218,7 @@ bool LLAlertDialog::show()
218 } 218 }
219 startModal(); 219 startModal();
220 gFloaterView->adjustToFitScreen(this, FALSE); 220 gFloaterView->adjustToFitScreen(this, FALSE);
221 open(); 221 open(); /* Flawfinder: ignore */
222 setFocus(TRUE); 222 setFocus(TRUE);
223 if (mLineEditor) 223 if (mLineEditor)
224 { 224 {
diff --git a/linden/indra/llui/llbutton.cpp b/linden/indra/llui/llbutton.cpp
index 736bc59..41c2269 100644
--- a/linden/indra/llui/llbutton.cpp
+++ b/linden/indra/llui/llbutton.cpp
@@ -603,7 +603,7 @@ void LLButton::draw()
603 else 603 else
604 { 604 {
605 // no image 605 // no image
606 llalerts << "No image for button " << mName << llendl; 606 llwarns << "No image for button " << mName << llendl;
607 // draw it in pink so we can find it 607 // draw it in pink so we can find it
608 gl_rect_2d(0, mRect.getHeight(), mRect.getWidth(), 0, LLColor4::pink1, FALSE); 608 gl_rect_2d(0, mRect.getHeight(), mRect.getWidth(), 0, LLColor4::pink1, FALSE);
609 } 609 }
diff --git a/linden/indra/llui/llcombobox.cpp b/linden/indra/llui/llcombobox.cpp
index b19be9a..7c3755a 100644
--- a/linden/indra/llui/llcombobox.cpp
+++ b/linden/indra/llui/llcombobox.cpp
@@ -62,6 +62,7 @@ LLComboBox::LLComboBox( const LLString& name, const LLRect &rect, const LLString
62 mDrawButton(TRUE), 62 mDrawButton(TRUE),
63 mTextEntry(NULL), 63 mTextEntry(NULL),
64 mArrowImage(NULL), 64 mArrowImage(NULL),
65 mArrowImageWidth(8),
65 mAllowTextEntry(FALSE), 66 mAllowTextEntry(FALSE),
66 mMaxChars(20), 67 mMaxChars(20),
67 mTextEntryTentative(TRUE), 68 mTextEntryTentative(TRUE),
@@ -118,6 +119,7 @@ LLComboBox::LLComboBox( const LLString& name, const LLRect &rect, const LLString
118 119
119 LLUUID arrow_image_id( LLUI::sAssetsGroup->getString("combobox_arrow.tga") ); 120 LLUUID arrow_image_id( LLUI::sAssetsGroup->getString("combobox_arrow.tga") );
120 mArrowImage = LLUI::sImageProvider->getUIImageByID(arrow_image_id); 121 mArrowImage = LLUI::sImageProvider->getUIImageByID(arrow_image_id);
122 mArrowImageWidth = llmax(8,mArrowImage->getWidth()); // In case image hasn't loaded yet
121} 123}
122 124
123 125
@@ -521,7 +523,7 @@ void LLComboBox::setButtonVisible(BOOL visible)
521 LLRect text_entry_rect(0, mRect.getHeight(), mRect.getWidth(), 0); 523 LLRect text_entry_rect(0, mRect.getHeight(), mRect.getWidth(), 0);
522 if (visible) 524 if (visible)
523 { 525 {
524 text_entry_rect.mRight -= mArrowImage->getWidth() + 2 * LLUI::sConfigGroup->getS32("DropShadowButton"); 526 text_entry_rect.mRight -= mArrowImageWidth + 2 * LLUI::sConfigGroup->getS32("DropShadowButton");
525 } 527 }
526 //mTextEntry->setRect(text_entry_rect); 528 //mTextEntry->setRect(text_entry_rect);
527 mTextEntry->reshape(text_entry_rect.getWidth(), text_entry_rect.getHeight(), TRUE); 529 mTextEntry->reshape(text_entry_rect.getWidth(), text_entry_rect.getHeight(), TRUE);
@@ -544,7 +546,7 @@ void LLComboBox::draw()
544 // Paste the graphic on the right edge 546 // Paste the graphic on the right edge
545 if (!mArrowImage.isNull()) 547 if (!mArrowImage.isNull())
546 { 548 {
547 S32 left = mRect.getWidth() - mArrowImage->getWidth() - LLUI::sConfigGroup->getS32("DropShadowButton"); 549 S32 left = mRect.getWidth() - mArrowImageWidth - LLUI::sConfigGroup->getS32("DropShadowButton");
548 550
549 gl_draw_image( left, 0, mArrowImage, 551 gl_draw_image( left, 0, mArrowImage,
550 LLColor4::white); 552 LLColor4::white);
@@ -844,7 +846,7 @@ void LLComboBox::setAllowTextEntry(BOOL allow, S32 max_chars, BOOL set_tentative
844 if (allow && !mAllowTextEntry) 846 if (allow && !mAllowTextEntry)
845 { 847 {
846 S32 shadow_size = LLUI::sConfigGroup->getS32("DropShadowButton"); 848 S32 shadow_size = LLUI::sConfigGroup->getS32("DropShadowButton");
847 mButton->setRect(LLRect( mRect.getWidth() - mArrowImage->getWidth() - 2 * shadow_size, 849 mButton->setRect(LLRect( mRect.getWidth() - mArrowImageWidth - 2 * shadow_size,
848 rect.mTop, rect.mRight, rect.mBottom)); 850 rect.mTop, rect.mRight, rect.mBottom));
849 mButton->setTabStop(FALSE); 851 mButton->setTabStop(FALSE);
850 852
@@ -854,7 +856,7 @@ void LLComboBox::setAllowTextEntry(BOOL allow, S32 max_chars, BOOL set_tentative
854 if (!mTextEntry) 856 if (!mTextEntry)
855 { 857 {
856 LLRect text_entry_rect(0, mRect.getHeight(), mRect.getWidth(), 0); 858 LLRect text_entry_rect(0, mRect.getHeight(), mRect.getWidth(), 0);
857 text_entry_rect.mRight -= mArrowImage->getWidth() + 2 * LLUI::sConfigGroup->getS32("DropShadowButton"); 859 text_entry_rect.mRight -= mArrowImageWidth + 2 * LLUI::sConfigGroup->getS32("DropShadowButton");
858 mTextEntry = new LLLineEditor("combo_text_entry", 860 mTextEntry = new LLLineEditor("combo_text_entry",
859 text_entry_rect, 861 text_entry_rect,
860 "", 862 "",
diff --git a/linden/indra/llui/llcombobox.h b/linden/indra/llui/llcombobox.h
index b1dd468..5de9463 100644
--- a/linden/indra/llui/llcombobox.h
+++ b/linden/indra/llui/llcombobox.h
@@ -186,8 +186,9 @@ protected:
186 BOOL mDrawButton; 186 BOOL mDrawButton;
187 LLLineEditor* mTextEntry; 187 LLLineEditor* mTextEntry;
188 LLPointer<LLImageGL> mArrowImage; 188 LLPointer<LLImageGL> mArrowImage;
189 S32 mArrowImageWidth;
189 BOOL mAllowTextEntry; 190 BOOL mAllowTextEntry;
190 S32 mMaxChars; 191 S32 mMaxChars;
191 BOOL mTextEntryTentative; 192 BOOL mTextEntryTentative;
192 void (*mPrearrangeCallback)(LLUICtrl*,void*); 193 void (*mPrearrangeCallback)(LLUICtrl*,void*);
193 void (*mTextEntryCallback)(LLLineEditor*, void*); 194 void (*mTextEntryCallback)(LLLineEditor*, void*);
diff --git a/linden/indra/llui/llctrlselectioninterface.cpp b/linden/indra/llui/llctrlselectioninterface.cpp
index 5478d61..446eb63 100644
--- a/linden/indra/llui/llctrlselectioninterface.cpp
+++ b/linden/indra/llui/llctrlselectioninterface.cpp
@@ -1,8 +1,8 @@
1/** 1/**
2 * @file llctrlselectioninterface.cpp 2 * @file llctrlselectioninterface.cpp
3 * @brief Programmatic selection of items in a list. 3 * @brief Programmatic selection of items in a list.
4 * 4 *
5 * Copyright (c) 2006-2007, Linden Research, Inc. 5 * Copyright (c) 2006-2007, Linden Research, Inc.
6 * 6 *
7 * The source code in this file ("Source Code") is provided by Linden Lab 7 * The source code in this file ("Source Code") is provided by Linden Lab
8 * to you under the terms of the GNU General Public License, version 2.0 8 * to you under the terms of the GNU General Public License, version 2.0
@@ -22,42 +22,42 @@
22 * 22 *
23 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO 23 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
24 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, 24 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
25 * COMPLETENESS OR PERFORMANCE. 25 * COMPLETENESS OR PERFORMANCE.
26 */ 26 */
27 27
28#include "llctrlselectioninterface.h" 28#include "llctrlselectioninterface.h"
29 29
30#include "llsd.h" 30#include "llsd.h"
31 31
32// virtual 32// virtual
33LLCtrlSelectionInterface::~LLCtrlSelectionInterface() 33LLCtrlSelectionInterface::~LLCtrlSelectionInterface()
34{ } 34{ }
35 35
36BOOL LLCtrlSelectionInterface::selectByValue(LLSD value) 36BOOL LLCtrlSelectionInterface::selectByValue(LLSD value)
37{ 37{
38 return setSelectedByValue(value, TRUE); 38 return setSelectedByValue(value, TRUE);
39} 39}
40 40
41BOOL LLCtrlSelectionInterface::deselectByValue(LLSD value) 41BOOL LLCtrlSelectionInterface::deselectByValue(LLSD value)
42{ 42{
43 return setSelectedByValue(value, FALSE); 43 return setSelectedByValue(value, FALSE);
44} 44}
45 45
46 46
47// virtual 47// virtual
48LLCtrlListInterface::~LLCtrlListInterface() 48LLCtrlListInterface::~LLCtrlListInterface()
49{ } 49{ }
50 50
51LLScrollListItem* LLCtrlListInterface::addSimpleElement(const LLString& value) 51LLScrollListItem* LLCtrlListInterface::addSimpleElement(const LLString& value)
52{ 52{
53 return addSimpleElement(value, ADD_BOTTOM, LLSD()); 53 return addSimpleElement(value, ADD_BOTTOM, LLSD());
54} 54}
55 55
56LLScrollListItem* LLCtrlListInterface::addSimpleElement(const LLString& value, EAddPosition pos) 56LLScrollListItem* LLCtrlListInterface::addSimpleElement(const LLString& value, EAddPosition pos)
57{ 57{
58 return addSimpleElement(value, pos, LLSD()); 58 return addSimpleElement(value, pos, LLSD());
59} 59}
60 60
61// virtual 61// virtual
62LLCtrlScrollInterface::~LLCtrlScrollInterface() 62LLCtrlScrollInterface::~LLCtrlScrollInterface()
63{ } 63{ }
diff --git a/linden/indra/llui/llctrlselectioninterface.h b/linden/indra/llui/llctrlselectioninterface.h
index 8f422f4..189d2e1 100644
--- a/linden/indra/llui/llctrlselectioninterface.h
+++ b/linden/indra/llui/llctrlselectioninterface.h
@@ -1,8 +1,8 @@
1/** 1/**
2 * @file llctrlselectioninterface.h 2 * @file llctrlselectioninterface.h
3 * @brief Programmatic selection of items in a list. 3 * @brief Programmatic selection of items in a list.
4 * 4 *
5 * Copyright (c) 2006-2007, Linden Research, Inc. 5 * Copyright (c) 2006-2007, Linden Research, Inc.
6 * 6 *
7 * The source code in this file ("Source Code") is provided by Linden Lab 7 * The source code in this file ("Source Code") is provided by Linden Lab
8 * to you under the terms of the GNU General Public License, version 2.0 8 * to you under the terms of the GNU General Public License, version 2.0
@@ -22,82 +22,82 @@
22 * 22 *
23 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO 23 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
24 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, 24 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
25 * COMPLETENESS OR PERFORMANCE. 25 * COMPLETENESS OR PERFORMANCE.
26 */ 26 */
27 27
28#ifndef LLCTRLSELECTIONINTERFACE_H 28#ifndef LLCTRLSELECTIONINTERFACE_H
29#define LLCTRLSELECTIONINTERFACE_H 29#define LLCTRLSELECTIONINTERFACE_H
30 30
31#include "stdtypes.h" 31#include "stdtypes.h"
32#include "stdenums.h" 32#include "stdenums.h"
33#include "llstring.h" 33#include "llstring.h"
34 34
35class LLSD; 35class LLSD;
36class LLUUID; 36class LLUUID;
37class LLScrollListItem; 37class LLScrollListItem;
38 38
39class LLCtrlSelectionInterface 39class LLCtrlSelectionInterface
40{ 40{
41public: 41public:
42 virtual ~LLCtrlSelectionInterface(); 42 virtual ~LLCtrlSelectionInterface();
43 43
44 enum EOperation 44 enum EOperation
45 { 45 {
46 OP_DELETE = 1, 46 OP_DELETE = 1,
47 OP_SELECT, 47 OP_SELECT,
48 OP_DESELECT, 48 OP_DESELECT,
49 }; 49 };
50 50
51 virtual BOOL getCanSelect() const = 0; 51 virtual BOOL getCanSelect() const = 0;
52 52
53 virtual BOOL selectFirstItem() = 0; 53 virtual BOOL selectFirstItem() = 0;
54 virtual BOOL selectNthItem( S32 index ) = 0; 54 virtual BOOL selectNthItem( S32 index ) = 0;
55 55
56 virtual S32 getFirstSelectedIndex() = 0; 56 virtual S32 getFirstSelectedIndex() = 0;
57 57
58 // TomY TODO: Simply cast the UUIDs to LLSDs, using the selectByValue function 58 // TomY TODO: Simply cast the UUIDs to LLSDs, using the selectByValue function
59 virtual BOOL setCurrentByID( const LLUUID& id ) = 0; 59 virtual BOOL setCurrentByID( const LLUUID& id ) = 0;
60 virtual LLUUID getCurrentID() = 0; 60 virtual LLUUID getCurrentID() = 0;
61 61
62 BOOL selectByValue(LLSD value); 62 BOOL selectByValue(LLSD value);
63 BOOL deselectByValue(LLSD value); 63 BOOL deselectByValue(LLSD value);
64 virtual BOOL setSelectedByValue(LLSD value, BOOL selected) = 0; 64 virtual BOOL setSelectedByValue(LLSD value, BOOL selected) = 0;
65 virtual LLSD getSimpleSelectedValue() = 0; 65 virtual LLSD getSimpleSelectedValue() = 0;
66 66
67 virtual BOOL isSelected(LLSD value) = 0; 67 virtual BOOL isSelected(LLSD value) = 0;
68 68
69 virtual BOOL operateOnSelection(EOperation op) = 0; 69 virtual BOOL operateOnSelection(EOperation op) = 0;
70 virtual BOOL operateOnAll(EOperation op) = 0; 70 virtual BOOL operateOnAll(EOperation op) = 0;
71}; 71};
72 72
73class LLCtrlListInterface : public LLCtrlSelectionInterface 73class LLCtrlListInterface : public LLCtrlSelectionInterface
74{ 74{
75public: 75public:
76 virtual ~LLCtrlListInterface(); 76 virtual ~LLCtrlListInterface();
77 77
78 virtual S32 getItemCount() const = 0; 78 virtual S32 getItemCount() const = 0;
79 virtual void addColumn(const LLSD& column, EAddPosition pos = ADD_BOTTOM) = 0; 79 virtual void addColumn(const LLSD& column, EAddPosition pos = ADD_BOTTOM) = 0;
80 virtual void clearColumns() = 0; 80 virtual void clearColumns() = 0;
81 virtual void setColumnLabel(const LLString& column, const LLString& label) = 0; 81 virtual void setColumnLabel(const LLString& column, const LLString& label) = 0;
82 // TomY TODO: Document this 82 // TomY TODO: Document this
83 virtual LLScrollListItem* addElement(const LLSD& value, EAddPosition pos = ADD_BOTTOM, void* userdata = NULL) = 0; 83 virtual LLScrollListItem* addElement(const LLSD& value, EAddPosition pos = ADD_BOTTOM, void* userdata = NULL) = 0;
84 84
85 LLScrollListItem* addSimpleElement(const LLString& value); // defaults to bottom 85 LLScrollListItem* addSimpleElement(const LLString& value); // defaults to bottom
86 LLScrollListItem* addSimpleElement(const LLString& value, EAddPosition pos); // defaults to no LLSD() id 86 LLScrollListItem* addSimpleElement(const LLString& value, EAddPosition pos); // defaults to no LLSD() id
87 virtual LLScrollListItem* addSimpleElement(const LLString& value, EAddPosition pos, const LLSD& id) = 0; 87 virtual LLScrollListItem* addSimpleElement(const LLString& value, EAddPosition pos, const LLSD& id) = 0;
88 88
89 virtual void clearRows() = 0; 89 virtual void clearRows() = 0;
90 virtual void sortByColumn(LLString name, BOOL ascending) = 0; 90 virtual void sortByColumn(LLString name, BOOL ascending) = 0;
91}; 91};
92 92
93class LLCtrlScrollInterface 93class LLCtrlScrollInterface
94{ 94{
95public: 95public:
96 virtual ~LLCtrlScrollInterface(); 96 virtual ~LLCtrlScrollInterface();
97 97
98 virtual S32 getScrollPos() = 0; 98 virtual S32 getScrollPos() = 0;
99 virtual void setScrollPos( S32 pos ) = 0; 99 virtual void setScrollPos( S32 pos ) = 0;
100 virtual void scrollToShowSelected() = 0; 100 virtual void scrollToShowSelected() = 0;
101}; 101};
102 102
103#endif 103#endif
diff --git a/linden/indra/llui/llfloater.cpp b/linden/indra/llui/llfloater.cpp
index bc5f197..02a410e 100644
--- a/linden/indra/llui/llfloater.cpp
+++ b/linden/indra/llui/llfloater.cpp
@@ -506,26 +506,25 @@ void LLFloater::setVisible( BOOL visible )
506 } 506 }
507} 507}
508 508
509LLView* LLFloater::getRootMostFastFrameView() 509void LLFloater::open() /* Flawfinder: ignore */
510{ 510{
511 // trying to render a background floater in a fast frame, abort!!! 511 if (mSoundFlags != SILENT
512 //if (!isFrontmost()) 512 // don't play open sound for hosted (tabbed) windows
513 //{ 513 && !getHost()
514 // gViewerWindow->finishFastFrame(); 514 && !sHostp
515 //} 515 && (!getVisible() || isMinimized()))
516 516 {
517 return LLView::getRootMostFastFrameView(); 517 make_ui_sound("UISndWindowOpen");
518} 518 }
519 519
520void LLFloater::open()
521{
522 //RN: for now, we don't allow rehosting from one multifloater to another 520 //RN: for now, we don't allow rehosting from one multifloater to another
523 // just need to fix the bugs 521 // just need to fix the bugs
524 LLMultiFloater* hostp = getHost(); 522 LLMultiFloater* hostp = getHost();
525 if (sHostp != NULL && hostp == NULL) 523 if (sHostp != NULL && hostp == NULL)
526 { 524 {
527 // needs a host 525 // needs a host
528 sHostp->addFloater(this, TRUE); 526 // only select tabs if window they are hosted in is visible
527 sHostp->addFloater(this, sHostp->getVisible());
529 } 528 }
530 else if (hostp != NULL) 529 else if (hostp != NULL)
531 { 530 {
@@ -538,13 +537,7 @@ void LLFloater::open()
538 setVisibleAndFrontmost(mAutoFocus); 537 setVisibleAndFrontmost(mAutoFocus);
539 } 538 }
540 539
541 if (mSoundFlags != SILENT) 540 onOpen();
542 {
543 if (!getVisible() || isMinimized())
544 {
545 make_ui_sound("UISndWindowOpen");
546 }
547 }
548} 541}
549 542
550void LLFloater::close(bool app_quitting) 543void LLFloater::close(bool app_quitting)
@@ -562,6 +555,7 @@ void LLFloater::close(bool app_quitting)
562 555
563 if (mSoundFlags != SILENT 556 if (mSoundFlags != SILENT
564 && getVisible() 557 && getVisible()
558 && !getHost()
565 && !app_quitting) 559 && !app_quitting)
566 { 560 {
567 make_ui_sound("UISndWindowClose"); 561 make_ui_sound("UISndWindowClose");
@@ -689,7 +683,7 @@ const LLString& LLFloater::getTitle() const
689 683
690void LLFloater::translate(S32 x, S32 y) 684void LLFloater::translate(S32 x, S32 y)
691{ 685{
692 LLView::translate(x, y); 686 LLPanel::translate(x, y);
693 687
694 if (x != 0 || y != 0) 688 if (x != 0 || y != 0)
695 { 689 {
@@ -719,7 +713,7 @@ BOOL LLFloater::canSnapTo(LLView* other_view)
719 } 713 }
720 } 714 }
721 715
722 return LLView::canSnapTo(other_view); 716 return LLPanel::canSnapTo(other_view);
723} 717}
724 718
725void LLFloater::snappedTo(LLView* snap_view) 719void LLFloater::snappedTo(LLView* snap_view)
@@ -783,8 +777,6 @@ void LLFloater::setMinimized(BOOL minimize)
783 777
784 if (minimize) 778 if (minimize)
785 { 779 {
786 mMinimized = TRUE;
787
788 mPreviousRect = mRect; 780 mPreviousRect = mRect;
789 781
790 reshape( MINIMIZED_WIDTH, LLFLOATER_HEADER_SIZE, TRUE); 782 reshape( MINIMIZED_WIDTH, LLFLOATER_HEADER_SIZE, TRUE);
@@ -830,6 +822,8 @@ void LLFloater::setMinimized(BOOL minimize)
830 ++dependent_it; 822 ++dependent_it;
831 } 823 }
832 824
825 mMinimized = TRUE;
826
833 // Lose keyboard focus when minimized 827 // Lose keyboard focus when minimized
834 releaseFocus(); 828 releaseFocus();
835 } 829 }
@@ -1207,12 +1201,12 @@ void LLFloater::onClickTearOff(void *userdata)
1207 1201
1208 new_rect.setLeftTopAndSize(host_floater->getRect().mLeft + 5, host_floater->getRect().mTop - LLFLOATER_HEADER_SIZE - 5, self->mRect.getWidth(), self->mRect.getHeight()); 1202 new_rect.setLeftTopAndSize(host_floater->getRect().mLeft + 5, host_floater->getRect().mTop - LLFLOATER_HEADER_SIZE - 5, self->mRect.getWidth(), self->mRect.getHeight());
1209 1203
1210 self->open(); 1204 self->open(); /* Flawfinder: ignore */
1211 self->setRect(new_rect); 1205 self->setRect(new_rect);
1212 gFloaterView->adjustToFitScreen(self, FALSE); 1206 gFloaterView->adjustToFitScreen(self, FALSE);
1213 self->setCanDrag(TRUE); 1207 self->setCanDrag(TRUE);
1214 self->setCanResize(TRUE); 1208 // give focus to new window to keep continuity for the user
1215 self->setCanMinimize(TRUE); 1209 self->setFocus(TRUE);
1216 } 1210 }
1217 else //Attach to parent. 1211 else //Attach to parent.
1218 { 1212 {
@@ -1234,24 +1228,36 @@ void LLFloater::onClickEdit(void *userdata)
1234} 1228}
1235 1229
1236// static 1230// static
1237void LLFloater::closeByMenu( void* userdata ) 1231void LLFloater::closeFocusedFloater()
1238{ 1232{
1239 LLFloater* self = (LLFloater*) userdata; 1233 LLFloater* focused_floater = NULL;
1240 if (!self || self->getHost()) return;
1241 1234
1242 LLFloaterView* parent = (LLFloaterView*) self->getParent(); 1235 std::map<LLViewHandle, LLFloater*>::iterator iter;
1236 for(iter = sFloaterMap.begin(); iter != sFloaterMap.end(); ++iter)
1237 {
1238 focused_floater = iter->second;
1239 if (focused_floater->hasFocus())
1240 {
1241 break;
1242 }
1243 }
1243 1244
1244 // grab focus status before close just in case floater is deleted 1245 if (iter == sFloaterMap.end())
1245 BOOL has_focus = gFocusMgr.childHasKeyboardFocus(self); 1246 {
1246 self->close(); 1247 // nothing found, return
1248 return;
1249 }
1250
1251 focused_floater->close();
1247 1252
1248 // if this floater used to have focus and now nothing took focus 1253 // if nothing took focus after closing focused floater
1249 // give it to next floater (to allow closing multiple windows via keyboard in rapid succession) 1254 // give it to next floater (to allow closing multiple windows via keyboard in rapid succession)
1250 if (has_focus && gFocusMgr.getKeyboardFocus() == NULL) 1255 if (gFocusMgr.getKeyboardFocus() == NULL)
1251 { 1256 {
1252 parent->focusFrontFloater(); 1257 // HACK: use gFloaterView directly in case we are using Ctrl-W to close snapshot window
1258 // which sits in gSnapshotFloaterView, and needs to pass focus on to normal floater view
1259 gFloaterView->focusFrontFloater();
1253 } 1260 }
1254
1255} 1261}
1256 1262
1257 1263
@@ -1351,10 +1357,26 @@ void LLFloater::draw()
1351 focused_child->setVisible(TRUE); 1357 focused_child->setVisible(TRUE);
1352 } 1358 }
1353 drawChild(focused_child); 1359 drawChild(focused_child);
1360
1361 // update tearoff button for torn off floaters
1362 // when last host goes away
1363 if (mCanTearOff && !getHost())
1364 {
1365 LLFloater* old_host = gFloaterView->getFloaterByHandle(mLastHostHandle);
1366 if (!old_host)
1367 {
1368 setCanTearOff(FALSE);
1369 }
1370 }
1354 } 1371 }
1355} 1372}
1356 1373
1357// virtual 1374// virtual
1375void LLFloater::onOpen()
1376{
1377}
1378
1379// virtual
1358void LLFloater::onClose(bool app_quitting) 1380void LLFloater::onClose(bool app_quitting)
1359{ 1381{
1360 destroy(); 1382 destroy();
@@ -2018,23 +2040,52 @@ void LLFloaterView::focusFrontFloater()
2018 2040
2019void LLFloaterView::getMinimizePosition(S32 *left, S32 *bottom) 2041void LLFloaterView::getMinimizePosition(S32 *left, S32 *bottom)
2020{ 2042{
2021 // count the number of minimized children 2043 S32 col = 0;
2022 S32 count = 0; 2044 LLRect snap_rect_local = getSnapRect();
2023 for ( child_list_const_iter_t child_it = getChildList()->begin(); child_it != getChildList()->end(); ++child_it) 2045 snap_rect_local.translate(-mRect.mLeft, -mRect.mBottom);
2024 { 2046 for(S32 row = snap_rect_local.mBottom;
2025 LLView* viewp = *child_it; 2047 row < snap_rect_local.getHeight() - LLFLOATER_HEADER_SIZE;
2026 LLFloater *floater = (LLFloater *)viewp; 2048 row += LLFLOATER_HEADER_SIZE ) //loop rows
2027 if (floater->isMinimized()) 2049 {
2028 { 2050 for(col = snap_rect_local.mLeft;
2029 count++; 2051 col < snap_rect_local.getWidth() - MINIMIZED_WIDTH;
2030 } 2052 col += MINIMIZED_WIDTH)
2053 {
2054 bool foundGap = TRUE;
2055 for(child_list_const_iter_t child_it = getChildList()->begin();
2056 child_it != getChildList()->end();
2057 ++child_it) //loop floaters
2058 {
2059 // Examine minimized children.
2060 LLFloater* floater = (LLFloater*)((LLView*)*child_it);
2061 if(floater->isMinimized())
2062 {
2063 LLRect r = floater->getRect();
2064 if((r.mBottom < (row + LLFLOATER_HEADER_SIZE))
2065 && (r.mBottom > (row - LLFLOATER_HEADER_SIZE))
2066 && (r.mLeft < (col + MINIMIZED_WIDTH))
2067 && (r.mLeft > (col - MINIMIZED_WIDTH)))
2068 {
2069 // needs the check for off grid. can't drag,
2070 // but window resize makes them off
2071 foundGap = FALSE;
2072 break;
2073 }
2074 }
2075 } //done floaters
2076 if(foundGap)
2077 {
2078 *left = col;
2079 *bottom = row;
2080 return; //done
2081 }
2082 } //done this col
2031 } 2083 }
2032 2084
2033 // space over for that many and up if necessary 2085 // crude - stack'em all at 0,0 when screen is full of minimized
2034 S32 tiles_per_row = mRect.getWidth() / MINIMIZED_WIDTH; 2086 // floaters.
2035 2087 *left = snap_rect_local.mLeft;
2036 *left = (count % tiles_per_row) * MINIMIZED_WIDTH; 2088 *bottom = snap_rect_local.mBottom;
2037 *bottom = (count / tiles_per_row) * LLFLOATER_HEADER_SIZE;
2038} 2089}
2039 2090
2040 2091
@@ -2211,7 +2262,7 @@ LLFloater *LLFloaterView::getFrontmost()
2211 for ( child_list_const_iter_t child_it = getChildList()->begin(); child_it != getChildList()->end(); ++child_it) 2262 for ( child_list_const_iter_t child_it = getChildList()->begin(); child_it != getChildList()->end(); ++child_it)
2212 { 2263 {
2213 LLView* viewp = *child_it; 2264 LLView* viewp = *child_it;
2214 if ( viewp->getVisible() ) 2265 if ( viewp->getVisible() && !viewp->isDead())
2215 { 2266 {
2216 return (LLFloater *)viewp; 2267 return (LLFloater *)viewp;
2217 } 2268 }
@@ -2423,31 +2474,11 @@ LLString LLMultiFloater::getWidgetTag() const
2423 return LL_MULTI_FLOATER_TAG; 2474 return LL_MULTI_FLOATER_TAG;
2424} 2475}
2425 2476
2426void LLMultiFloater::init(const LLString& title, BOOL resizable, 2477void LLMultiFloater::open() /* Flawfinder: ignore */
2427 S32 min_width, S32 min_height, BOOL drag_on_left,
2428 BOOL minimizable, BOOL close_btn)
2429{
2430 LLFloater::init(title, resizable, min_width, min_height, drag_on_left, minimizable, close_btn);
2431
2432 /*mTabContainer = new LLTabContainer("Preview Tabs",
2433 LLRect(LLPANEL_BORDER_WIDTH, mRect.getHeight() - LLFLOATER_HEADER_SIZE, mRect.getWidth() - LLPANEL_BORDER_WIDTH, 0),
2434 mTabPos,
2435 NULL,
2436 NULL);
2437 mTabContainer->setFollowsAll();
2438 if (mResizable && mTabPos == LLTabContainerCommon::BOTTOM)
2439 {
2440 mTabContainer->setRightTabBtnOffset(RESIZE_HANDLE_WIDTH);
2441 }
2442
2443 addChild(mTabContainer);*/
2444}
2445
2446void LLMultiFloater::open()
2447{ 2478{
2448 if (mTabContainer->getTabCount() > 0) 2479 if (mTabContainer->getTabCount() > 0)
2449 { 2480 {
2450 LLFloater::open(); 2481 LLFloater::open(); /* Flawfinder: ignore */
2451 } 2482 }
2452 else 2483 else
2453 { 2484 {
@@ -2519,16 +2550,9 @@ void LLMultiFloater::growToFit(LLFloater* floaterp, S32 width, S32 height)
2519 // store new width and height with this floater so that it will keep its size when detached 2550 // store new width and height with this floater so that it will keep its size when detached
2520 found_data_it->second.mWidth = width; 2551 found_data_it->second.mWidth = width;
2521 found_data_it->second.mHeight = height; 2552 found_data_it->second.mHeight = height;
2522
2523 S32 cur_height = mRect.getHeight();
2524 reshape(llmax(mRect.getWidth(), width + LLPANEL_BORDER_WIDTH * 2), llmax(mRect.getHeight(), height + LLFLOATER_HEADER_SIZE + TABCNTR_HEADER_HEIGHT + (LLPANEL_BORDER_WIDTH * 2)));
2525
2526 // make sure upper left corner doesn't move
2527 translate(0, mRect.getHeight() - cur_height);
2528
2529 // Try to keep whole view onscreen, don't allow partial offscreen.
2530 gFloaterView->adjustToFitScreen(this, FALSE);
2531 } 2553 }
2554
2555 resizeToContents();
2532} 2556}
2533 2557
2534/** 2558/**
@@ -2597,8 +2621,6 @@ void LLMultiFloater::addFloater(LLFloater* floaterp, BOOL select_added_floater,
2597 if ( select_added_floater ) 2621 if ( select_added_floater )
2598 { 2622 {
2599 mTabContainer->selectLastTab(); 2623 mTabContainer->selectLastTab();
2600 // explicitly call tabopen to load preview assets, etc.
2601 tabOpen((LLFloater*)mTabContainer->getCurrentPanel(), true);
2602 } 2624 }
2603 2625
2604 floaterp->setHost(this); 2626 floaterp->setHost(this);
@@ -2671,24 +2693,7 @@ void LLMultiFloater::removeFloater(LLFloater* floaterp)
2671 2693
2672 if (mAutoResize) 2694 if (mAutoResize)
2673 { 2695 {
2674 floater_data_map_t::iterator floater_it; 2696 resizeToContents();
2675 S32 new_width = 0;
2676 S32 new_height = 0;
2677 for (floater_it = mFloaterDataMap.begin(); floater_it != mFloaterDataMap.end(); ++floater_it)
2678 {
2679 new_width = llmax(new_width, floater_it->second.mWidth + LLPANEL_BORDER_WIDTH * 2);
2680 new_height = llmax(new_height, floater_it->second.mHeight + LLFLOATER_HEADER_SIZE + TABCNTR_HEADER_HEIGHT);
2681 }
2682
2683 S32 cur_height = mRect.getHeight();
2684
2685 reshape(new_width, new_height);
2686
2687 // make sure upper left corner doesn't move
2688 translate(0, cur_height - new_height);
2689
2690 // Try to keep whole view onscreen, don't allow partial offscreen.
2691 gFloaterView->adjustToFitScreen(this, FALSE);
2692 } 2697 }
2693 2698
2694 tabOpen((LLFloater*)mTabContainer->getCurrentPanel(), false); 2699 tabOpen((LLFloater*)mTabContainer->getCurrentPanel(), false);
@@ -2721,6 +2726,13 @@ void LLMultiFloater::setVisible(BOOL visible)
2721 { 2726 {
2722 cur_floaterp->setVisible(visible); 2727 cur_floaterp->setVisible(visible);
2723 } 2728 }
2729
2730 // if no tab selected, and we're being shown,
2731 // select last tab to be added
2732 if (visible && !cur_floaterp)
2733 {
2734 mTabContainer->selectLastTab();
2735 }
2724 } 2736 }
2725} 2737}
2726 2738
@@ -2823,6 +2835,43 @@ BOOL LLMultiFloater::postBuild()
2823 return FALSE; 2835 return FALSE;
2824} 2836}
2825 2837
2838void LLMultiFloater::resizeToContents()
2839{
2840 // we're already in the middle of a reshape, don't interrupt it
2841 floater_data_map_t::iterator floater_it;
2842 S32 new_width = 0;
2843 S32 new_height = 0;
2844 for (floater_it = mFloaterDataMap.begin(); floater_it != mFloaterDataMap.end(); ++floater_it)
2845 {
2846 new_width = llmax(new_width, floater_it->second.mWidth + LLPANEL_BORDER_WIDTH * 2);
2847 new_height = llmax(new_height, floater_it->second.mHeight + LLFLOATER_HEADER_SIZE + TABCNTR_HEADER_HEIGHT);
2848 }
2849
2850 S32 new_min_width = 0;
2851 S32 new_min_height = 0;
2852 S32 tab_idx;
2853 for (tab_idx = 0; tab_idx < mTabContainer->getTabCount(); ++tab_idx)
2854 {
2855 LLFloater* floaterp = (LLFloater*)mTabContainer->getPanelByIndex(tab_idx);
2856 if (floaterp)
2857 {
2858 new_min_width = llmax(new_min_width, floaterp->getMinWidth() + LLPANEL_BORDER_WIDTH * 2);
2859 new_min_height = llmax(new_min_height, floaterp->getMinHeight() + LLFLOATER_HEADER_SIZE + TABCNTR_HEADER_HEIGHT);
2860 }
2861 }
2862 setResizeLimits(new_min_width, new_min_height);
2863
2864 S32 cur_height = mRect.getHeight();
2865
2866 reshape(new_width, new_height);
2867
2868 // make sure upper left corner doesn't move
2869 translate(0, cur_height - new_height);
2870
2871 // Try to keep whole view onscreen, don't allow partial offscreen.
2872 gFloaterView->adjustToFitScreen(this, FALSE);
2873}
2874
2826// virtual 2875// virtual
2827LLXMLNodePtr LLFloater::getXML(bool save_children) const 2876LLXMLNodePtr LLFloater::getXML(bool save_children) const
2828{ 2877{
@@ -2872,7 +2921,7 @@ LLView* LLFloater::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *f
2872 return floaterp; 2921 return floaterp;
2873} 2922}
2874 2923
2875void LLFloater::initFloaterXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory, BOOL open) 2924void LLFloater::initFloaterXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory, BOOL open) /* Flawfinder: ignore */
2876{ 2925{
2877 LLString name(getName()); 2926 LLString name(getName());
2878 LLString title(getTitle()); 2927 LLString title(getTitle());
@@ -2946,8 +2995,8 @@ void LLFloater::initFloaterXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactor
2946 } 2995 }
2947 2996
2948 applyRectControl(); 2997 applyRectControl();
2949 if (open) 2998 if (open) /* Flawfinder: ignore */
2950 { 2999 {
2951 this->open(); 3000 this->open(); /* Flawfinder: ignore */
2952 } 3001 }
2953} 3002}
diff --git a/linden/indra/llui/llfloater.h b/linden/indra/llui/llfloater.h
index 4826648..25b2697 100644
--- a/linden/indra/llui/llfloater.h
+++ b/linden/indra/llui/llfloater.h
@@ -122,7 +122,7 @@ public:
122 virtual EWidgetType getWidgetType() const; 122 virtual EWidgetType getWidgetType() const;
123 virtual LLString getWidgetTag() const; 123 virtual LLString getWidgetTag() const;
124 124
125 virtual void open(); 125 virtual void open(); /* Flawfinder: ignore */
126 126
127 // If allowed, close the floater cleanly, releasing focus. 127 // If allowed, close the floater cleanly, releasing focus.
128 // app_quitting is passed to onClose() below. 128 // app_quitting is passed to onClose() below.
@@ -176,6 +176,9 @@ public:
176 176
177 virtual void draw(); 177 virtual void draw();
178 178
179 // does nothing by default
180 virtual void onOpen();
181
179 // Call destroy() to free memory, or setVisible(FALSE) to keep it 182 // Call destroy() to free memory, or setVisible(FALSE) to keep it
180 // If app_quitting, you might not want to save your visibility. 183 // If app_quitting, you might not want to save your visibility.
181 // Defaults to destroy(). 184 // Defaults to destroy().
@@ -197,9 +200,8 @@ public:
197 void clearSnapTarget() { mSnappedTo.markDead(); } 200 void clearSnapTarget() { mSnappedTo.markDead(); }
198 LLViewHandle getSnapTarget() { return mSnappedTo; } 201 LLViewHandle getSnapTarget() { return mSnappedTo; }
199 202
200 /*virtual*/ LLView* getRootMostFastFrameView(); 203 static void closeFocusedFloater();
201 204
202 static void closeByMenu(void *userdata);
203 static void onClickClose(void *userdata); 205 static void onClickClose(void *userdata);
204 static void onClickMinimize(void *userdata); 206 static void onClickMinimize(void *userdata);
205 static void onClickTearOff(void *userdata); 207 static void onClickTearOff(void *userdata);
@@ -356,12 +358,8 @@ public:
356 LLMultiFloater(const LLString& name, const LLString& rect_control, LLTabContainer::TabPosition tab_pos = LLTabContainer::TOP, BOOL auto_resize = FALSE); 358 LLMultiFloater(const LLString& name, const LLString& rect_control, LLTabContainer::TabPosition tab_pos = LLTabContainer::TOP, BOOL auto_resize = FALSE);
357 virtual ~LLMultiFloater(); 359 virtual ~LLMultiFloater();
358 360
359 virtual void init(const LLString& title, BOOL resizable,
360 S32 min_width, S32 min_height, BOOL drag_on_left,
361 BOOL minimizable, BOOL close_btn);
362
363 virtual BOOL postBuild(); 361 virtual BOOL postBuild();
364 /*virtual*/ void open(); 362 /*virtual*/ void open(); /* Flawfinder: ignore */
365 /*virtual*/ void onClose(bool app_quitting); 363 /*virtual*/ void onClose(bool app_quitting);
366 /*virtual*/ void draw(); 364 /*virtual*/ void draw();
367 /*virtual*/ void setVisible(BOOL visible); 365 /*virtual*/ void setVisible(BOOL visible);
@@ -393,6 +391,8 @@ public:
393 void setTabContainer(LLTabContainerCommon* tab_container) { if (!mTabContainer) mTabContainer = tab_container; } 391 void setTabContainer(LLTabContainerCommon* tab_container) { if (!mTabContainer) mTabContainer = tab_container; }
394 static void onTabSelected(void* userdata, bool); 392 static void onTabSelected(void* userdata, bool);
395 393
394 virtual void resizeToContents();
395
396protected: 396protected:
397 struct LLFloaterData 397 struct LLFloaterData
398 { 398 {
diff --git a/linden/indra/llui/llkeywords.cpp b/linden/indra/llui/llkeywords.cpp
index fd224d8..05ec652 100644
--- a/linden/indra/llui/llkeywords.cpp
+++ b/linden/indra/llui/llkeywords.cpp
@@ -73,10 +73,10 @@ BOOL LLKeywords::loadFromFile( const LLString& filename )
73 // File header 73 // File header
74 74
75 const S32 BUFFER_SIZE = 1024; 75 const S32 BUFFER_SIZE = 1024;
76 char buffer[BUFFER_SIZE]; 76 char buffer[BUFFER_SIZE]; /* Flawfinder: ignore */
77 77
78 llifstream file; 78 llifstream file;
79 file.open(filename.c_str()); 79 file.open(filename.c_str()); /* Flawfinder: ignore */
80 if( file.fail() ) 80 if( file.fail() )
81 { 81 {
82 llinfos << "LLKeywords::loadFromFile() Unable to open file: " << filename << llendl; 82 llinfos << "LLKeywords::loadFromFile() Unable to open file: " << filename << llendl;
@@ -114,34 +114,34 @@ BOOL LLKeywords::loadFromFile( const LLString& filename )
114 while (!file.eof()) 114 while (!file.eof())
115 { 115 {
116 file.getline( buffer, BUFFER_SIZE ); 116 file.getline( buffer, BUFFER_SIZE );
117 if( !strncmp( buffer, SOL_COMMENT, strlen(SOL_COMMENT) ) ) 117 if( !strncmp( buffer, SOL_COMMENT, strlen(SOL_COMMENT) ) ) /* Flawfinder: ignore */
118 { 118 {
119 continue; 119 continue;
120 } 120 }
121 else 121 else
122 if( !strncmp( buffer, SOL_WORD, strlen(SOL_WORD) ) ) 122 if( !strncmp( buffer, SOL_WORD, strlen(SOL_WORD) ) ) /* Flawfinder: ignore */
123 { 123 {
124 cur_color = readColor( buffer + strlen(SOL_WORD) ); 124 cur_color = readColor( buffer + strlen(SOL_WORD) ); /* Flawfinder: ignore */
125 cur_type = LLKeywordToken::WORD; 125 cur_type = LLKeywordToken::WORD;
126 continue; 126 continue;
127 } 127 }
128 else 128 else
129 if( !strncmp( buffer, SOL_LINE, strlen(SOL_LINE) ) ) 129 if( !strncmp( buffer, SOL_LINE, strlen(SOL_LINE) ) ) /* Flawfinder: ignore */
130 { 130 {
131 cur_color = readColor( buffer + strlen(SOL_LINE) ); 131 cur_color = readColor( buffer + strlen(SOL_LINE) ); /* Flawfinder: ignore */
132 cur_type = LLKeywordToken::LINE; 132 cur_type = LLKeywordToken::LINE;
133 continue; 133 continue;
134 } 134 }
135 else 135 else
136 if( !strncmp( buffer, SOL_TWO_SIDED_DELIMITER, strlen(SOL_TWO_SIDED_DELIMITER) ) ) 136 if( !strncmp( buffer, SOL_TWO_SIDED_DELIMITER, strlen(SOL_TWO_SIDED_DELIMITER) ) ) /* Flawfinder: ignore */
137 { 137 {
138 cur_color = readColor( buffer + strlen(SOL_TWO_SIDED_DELIMITER) ); 138 cur_color = readColor( buffer + strlen(SOL_TWO_SIDED_DELIMITER) ); /* Flawfinder: ignore */
139 cur_type = LLKeywordToken::TWO_SIDED_DELIMITER; 139 cur_type = LLKeywordToken::TWO_SIDED_DELIMITER;
140 continue; 140 continue;
141 } 141 }
142 if( !strncmp( buffer, SOL_ONE_SIDED_DELIMITER, strlen(SOL_ONE_SIDED_DELIMITER) ) ) 142 if( !strncmp( buffer, SOL_ONE_SIDED_DELIMITER, strlen(SOL_ONE_SIDED_DELIMITER) ) ) /* Flawfinder: ignore */
143 { 143 {
144 cur_color = readColor( buffer + strlen(SOL_ONE_SIDED_DELIMITER) ); 144 cur_color = readColor( buffer + strlen(SOL_ONE_SIDED_DELIMITER) ); /* Flawfinder: ignore */
145 cur_type = LLKeywordToken::ONE_SIDED_DELIMITER; 145 cur_type = LLKeywordToken::ONE_SIDED_DELIMITER;
146 continue; 146 continue;
147 } 147 }
@@ -220,7 +220,7 @@ LLColor3 LLKeywords::readColor( const LLString& s )
220 F32 r, g, b; 220 F32 r, g, b;
221 r = g = b = 0.0f; 221 r = g = b = 0.0f;
222 S32 read = sscanf(s.c_str(), "%f, %f, %f]", &r, &g, &b ); 222 S32 read = sscanf(s.c_str(), "%f, %f, %f]", &r, &g, &b );
223 if( read != 3 ) 223 if( read != 3 ) /* Flawfinder: ignore */
224 { 224 {
225 llinfos << " poorly formed color in keyword file" << llendl; 225 llinfos << " poorly formed color in keyword file" << llendl;
226 } 226 }
diff --git a/linden/indra/llui/llmenugl.cpp b/linden/indra/llui/llmenugl.cpp
index 97069fa..1748956 100644
--- a/linden/indra/llui/llmenugl.cpp
+++ b/linden/indra/llui/llmenugl.cpp
@@ -62,7 +62,7 @@
62#include <boost/tokenizer.hpp> 62#include <boost/tokenizer.hpp>
63 63
64// static 64// static
65LLView *LLMenuGL::sDefaultMenuContainer = NULL; 65LLMenuHolderGL *LLMenuGL::sMenuContainer = NULL;
66 66
67S32 MENU_BAR_HEIGHT = 0; 67S32 MENU_BAR_HEIGHT = 0;
68S32 MENU_BAR_WIDTH = 0; 68S32 MENU_BAR_WIDTH = 0;
@@ -404,14 +404,10 @@ void LLMenuItemGL::doIt( void )
404{ 404{
405 // close all open menus by default 405 // close all open menus by default
406 // if parent menu is actually visible (and we are not triggering menu item via accelerator) 406 // if parent menu is actually visible (and we are not triggering menu item via accelerator)
407 // HACK: do not call hidemenus() from a pie menu item, as most pie menu operations 407 if (!getMenu()->getTornOff()
408 // assume that the thing you clicked on stays selected (parcel and/or object) after the
409 // pie menu is gone --RN
410 if (getMenu()->getWidgetType() != WIDGET_TYPE_PIE_MENU
411 && !getMenu()->getTornOff()
412 && getMenu()->getVisible()) 408 && getMenu()->getVisible())
413 { 409 {
414 ((LLMenuHolderGL*)getMenu()->getParent())->hideMenus(); 410 LLMenuGL::sMenuContainer->hideMenus();
415 } 411 }
416} 412}
417 413
@@ -473,18 +469,28 @@ BOOL LLMenuItemGL::handleKeyHere( KEY key, MASK mask, BOOL called_from_parent )
473 469
474BOOL LLMenuItemGL::handleMouseUp( S32 x, S32 y, MASK ) 470BOOL LLMenuItemGL::handleMouseUp( S32 x, S32 y, MASK )
475{ 471{
476 //llinfos << mLabel.c_str() << " handleMouseUp " << x << "," << y
477 // << llendl;
478 if (mEnabled) 472 if (mEnabled)
479 { 473 {
480 // switch to mouse navigation mode 474 // switch to mouse navigation mode
481 LLMenuGL::setKeyboardMode(FALSE); 475 LLMenuGL::setKeyboardMode(FALSE);
482 476
483 doIt(); 477 doIt();
484 setHighlight(FALSE);
485 make_ui_sound("UISndClickRelease"); 478 make_ui_sound("UISndClickRelease");
486 return TRUE; 479 return TRUE;
487 } 480 }
481 return FALSE;
482}
483
484BOOL LLMenuItemGL::handleMouseDown( S32 x, S32 y, MASK )
485{
486 if (mEnabled)
487 {
488 // switch to mouse navigation mode
489 LLMenuGL::setKeyboardMode(FALSE);
490
491 setHighlight(TRUE);
492 return TRUE;
493 }
488 else 494 else
489 { 495 {
490 return FALSE; 496 return FALSE;
@@ -1168,70 +1174,6 @@ void LLMenuItemToggleGL::doIt( void )
1168} 1174}
1169 1175
1170 1176
1171//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1172// Class LLMenuItemBranchGL
1173//
1174// The LLMenuItemBranchGL represents a menu item that has a
1175// sub-menu. This is used to make cascading menus.
1176//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1177
1178class LLMenuItemBranchGL : public LLMenuItemGL
1179{
1180protected:
1181 LLMenuGL* mBranch;
1182
1183public:
1184 LLMenuItemBranchGL( const LLString& name, const LLString& label, LLMenuGL* branch,
1185 KEY key = KEY_NONE, MASK mask = MASK_NONE );
1186 virtual LLXMLNodePtr getXML(bool save_children = true) const;
1187
1188 virtual LLView* getChildByName(const LLString& name, BOOL recurse) const;
1189
1190 virtual LLString getType() const { return "menu"; }
1191
1192 virtual EWidgetType getWidgetType() const;
1193 virtual LLString getWidgetTag() const;
1194
1195 virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask);
1196
1197 virtual BOOL handleAcceleratorKey(KEY key, MASK mask);
1198
1199 // check if we've used these accelerators already
1200 virtual BOOL addToAcceleratorList(std::list <LLKeyBinding*> *listp);
1201
1202 // called to rebuild the draw label
1203 virtual void buildDrawLabel( void );
1204
1205 // doIt() - do the primary funcationality of the menu item.
1206 virtual void doIt( void );
1207
1208 virtual BOOL handleKey(KEY key, MASK mask, BOOL called_from_parent);
1209 virtual BOOL handleUnicodeChar(llwchar uni_char, BOOL called_from_parent);
1210
1211 // set the hover status (called by it's menu) and if the object is
1212 // active. This is used for behavior transfer.
1213 virtual void setHighlight( BOOL highlight );
1214
1215 virtual BOOL handleKeyHere(KEY key, MASK mask, BOOL called_from_parent);
1216
1217 virtual BOOL isActive() const;
1218
1219 virtual BOOL isOpen() const;
1220
1221 LLMenuGL *getBranch() const { return mBranch; }
1222
1223 virtual void updateBranchParent( LLView* parentp );
1224
1225 // LLView Functionality
1226 virtual void onVisibilityChange( BOOL curVisibilityIn );
1227
1228 virtual void draw();
1229
1230 virtual void setEnabledSubMenus(BOOL enabled);
1231
1232 virtual void openMenu();
1233};
1234
1235LLMenuItemBranchGL::LLMenuItemBranchGL( const LLString& name, const LLString& label, LLMenuGL* branch, 1177LLMenuItemBranchGL::LLMenuItemBranchGL( const LLString& name, const LLString& label, LLMenuGL* branch,
1236 KEY key, MASK mask ) : 1178 KEY key, MASK mask ) :
1237 LLMenuItemGL( name, label, key, mask ), 1179 LLMenuItemGL( name, label, key, mask ),
@@ -1502,6 +1444,9 @@ void LLMenuItemBranchGL::openMenu()
1502 } 1444 }
1503 else if( !mBranch->getVisible() ) 1445 else if( !mBranch->getVisible() )
1504 { 1446 {
1447 // get valid rectangle for menus
1448 const LLRect menu_region_rect = LLMenuGL::sMenuContainer->getMenuRect();
1449
1505 mBranch->arrange(); 1450 mBranch->arrange();
1506 1451
1507 LLRect rect = mBranch->getRect(); 1452 LLRect rect = mBranch->getRect();
@@ -1524,13 +1469,13 @@ void LLMenuItemBranchGL::openMenu()
1524 mBranch->localPointToOtherView( 0, 0, &x, &y, mBranch->getParent() ); 1469 mBranch->localPointToOtherView( 0, 0, &x, &y, mBranch->getParent() );
1525 S32 delta_x = 0; 1470 S32 delta_x = 0;
1526 S32 delta_y = 0; 1471 S32 delta_y = 0;
1527 if( y < 0 ) 1472 if( y < menu_region_rect.mBottom )
1528 { 1473 {
1529 delta_y = -y; 1474 delta_y = menu_region_rect.mBottom - y;
1530 } 1475 }
1531 1476
1532 S32 window_width = mBranch->getParent()->getRect().getWidth(); 1477 S32 menu_region_width = menu_region_rect.getWidth();
1533 if( x > window_width - rect.getWidth() ) 1478 if( x - menu_region_rect.mLeft > menu_region_width - rect.getWidth() )
1534 { 1479 {
1535 // move sub-menu over to left side 1480 // move sub-menu over to left side
1536 delta_x = llmax(-x, (-1 * (rect.getWidth() + mRect.getWidth()))); 1481 delta_x = llmax(-x, (-1 * (rect.getWidth() + mRect.getWidth())));
@@ -1709,7 +1654,7 @@ BOOL LLMenuItemBranchDownGL::handleAcceleratorKey(KEY key, MASK mask)
1709{ 1654{
1710 BOOL branch_visible = mBranch->getVisible(); 1655 BOOL branch_visible = mBranch->getVisible();
1711 BOOL handled = mBranch->handleAcceleratorKey(key, mask); 1656 BOOL handled = mBranch->handleAcceleratorKey(key, mask);
1712 if (handled && !branch_visible) 1657 if (handled && !branch_visible && getVisible())
1713 { 1658 {
1714 // flash this menu entry because we triggered an invisible menu item 1659 // flash this menu entry because we triggered an invisible menu item
1715 LLMenuHolderGL::setActivatedItem(this); 1660 LLMenuHolderGL::setActivatedItem(this);
@@ -1721,7 +1666,8 @@ BOOL LLMenuItemBranchDownGL::handleAcceleratorKey(KEY key, MASK mask)
1721BOOL LLMenuItemBranchDownGL::handleKeyHere(KEY key, MASK mask, BOOL called_from_parent) 1666BOOL LLMenuItemBranchDownGL::handleKeyHere(KEY key, MASK mask, BOOL called_from_parent)
1722{ 1667{
1723 BOOL menu_open = mBranch->getVisible(); 1668 BOOL menu_open = mBranch->getVisible();
1724 if (getHighlight() && getMenu()->getVisible()) 1669 // don't do keyboard navigation of top-level menus unless in keyboard mode, or menu expanded
1670 if (getHighlight() && getMenu()->getVisible() && (isActive() || LLMenuGL::getKeyboardMode()))
1725 { 1671 {
1726 if (key == KEY_LEFT) 1672 if (key == KEY_LEFT)
1727 { 1673 {
@@ -1961,9 +1907,9 @@ void LLMenuGL::parseChildXML(LLXMLNodePtr child, LLView *parent, LLUICtrlFactory
1961 // SUBMENU 1907 // SUBMENU
1962 LLMenuGL *submenu = (LLMenuGL*)LLMenuGL::fromXML(child, parent, factory); 1908 LLMenuGL *submenu = (LLMenuGL*)LLMenuGL::fromXML(child, parent, factory);
1963 appendMenu(submenu); 1909 appendMenu(submenu);
1964 if (LLMenuGL::sDefaultMenuContainer != NULL) 1910 if (LLMenuGL::sMenuContainer != NULL)
1965 { 1911 {
1966 submenu->updateParent(LLMenuGL::sDefaultMenuContainer); 1912 submenu->updateParent(LLMenuGL::sMenuContainer);
1967 } 1913 }
1968 else 1914 else
1969 { 1915 {
@@ -2337,6 +2283,12 @@ void LLMenuGL::setBackgroundColor( const LLColor4& color )
2337 mBackgroundColor = color; 2283 mBackgroundColor = color;
2338} 2284}
2339 2285
2286LLColor4 LLMenuGL::getBackgroundColor()
2287{
2288 return mBackgroundColor;
2289}
2290
2291
2340// rearrange the child rects so they fit the shape of the menu. 2292// rearrange the child rects so they fit the shape of the menu.
2341void LLMenuGL::arrange( void ) 2293void LLMenuGL::arrange( void )
2342{ 2294{
@@ -2350,8 +2302,10 @@ void LLMenuGL::arrange( void )
2350 2302
2351 if( mItems.size() ) 2303 if( mItems.size() )
2352 { 2304 {
2353 U32 max_width = (getParent() != NULL) ? getParent()->getRect().getWidth() : U32_MAX; 2305 const LLRect menu_region_rect = LLMenuGL::sMenuContainer ? LLMenuGL::sMenuContainer->getMenuRect() : LLRect(0, S32_MAX, S32_MAX, 0);
2354 U32 max_height = (getParent() != NULL) ? getParent()->getRect().getHeight() : U32_MAX; 2306
2307 U32 max_width = menu_region_rect.getWidth();
2308 U32 max_height = menu_region_rect.getHeight();
2355 // *FIX: create the item first and then ask for its dimensions? 2309 // *FIX: create the item first and then ask for its dimensions?
2356 S32 spillover_item_width = PLAIN_PAD_PIXELS + LLFontGL::sSansSerif->getWidth( "More" ); 2310 S32 spillover_item_width = PLAIN_PAD_PIXELS + LLFontGL::sSansSerif->getWidth( "More" );
2357 S32 spillover_item_height = llround(LLFontGL::sSansSerif->getLineHeight()) + MENU_ITEM_PADDING; 2311 S32 spillover_item_height = llround(LLFontGL::sSansSerif->getLineHeight()) + MENU_ITEM_PADDING;
@@ -2472,7 +2426,7 @@ void LLMenuGL::createSpilloverBranch()
2472 // technically, you can't tear off spillover menus, but we're passing the handle 2426 // technically, you can't tear off spillover menus, but we're passing the handle
2473 // along just to be safe 2427 // along just to be safe
2474 mSpilloverMenu = new LLMenuGL("More", "More", mParentFloaterHandle); 2428 mSpilloverMenu = new LLMenuGL("More", "More", mParentFloaterHandle);
2475 mSpilloverMenu->updateParent(getParent()); 2429 mSpilloverMenu->updateParent(LLMenuGL::sMenuContainer);
2476 // Inherit colors 2430 // Inherit colors
2477 mSpilloverMenu->setBackgroundColor( mBackgroundColor ); 2431 mSpilloverMenu->setBackgroundColor( mBackgroundColor );
2478 mSpilloverMenu->setCanTearOff(FALSE); 2432 mSpilloverMenu->setCanTearOff(FALSE);
@@ -3110,7 +3064,6 @@ void LLMenuGL::setVisible(BOOL visible)
3110 mFadeTimer.stop(); 3064 mFadeTimer.stop();
3111 } 3065 }
3112 3066
3113 //gViewerWindow->finishFastFrame();
3114 LLView::setVisible(visible); 3067 LLView::setVisible(visible);
3115 } 3068 }
3116} 3069}
@@ -3157,6 +3110,8 @@ void hide_top_view( LLView* view )
3157// static 3110// static
3158void LLMenuGL::showPopup(LLView* spawning_view, LLMenuGL* menu, S32 x, S32 y) 3111void LLMenuGL::showPopup(LLView* spawning_view, LLMenuGL* menu, S32 x, S32 y)
3159{ 3112{
3113 const LLRect menu_region_rect = LLMenuGL::sMenuContainer->getMenuRect();
3114
3160 const S32 HPAD = 2; 3115 const S32 HPAD = 2;
3161 LLRect rect = menu->getRect(); 3116 LLRect rect = menu->getRect();
3162 //LLView* cur_view = spawning_view; 3117 //LLView* cur_view = spawning_view;
@@ -3177,13 +3132,15 @@ void LLMenuGL::showPopup(LLView* spawning_view, LLMenuGL* menu, S32 x, S32 y)
3177 // &left, &bottom ); 3132 // &left, &bottom );
3178 S32 delta_x = 0; 3133 S32 delta_x = 0;
3179 S32 delta_y = 0; 3134 S32 delta_y = 0;
3180 if( bottom < 0 ) 3135 if( bottom < menu_region_rect.mBottom )
3181 { 3136 {
3182 delta_y = -bottom; 3137 // At this point, we need to move the context menu to the
3138 // other side of the mouse.
3139 //delta_y = menu_region_rect.mBottom - bottom;
3140 delta_y = (rect.getHeight() + 2 * HPAD);
3183 } 3141 }
3184 3142
3185 S32 parent_width = menu->getParent()->getRect().getWidth(); 3143 if( left > menu_region_rect.mRight - rect.getWidth() )
3186 if( left > parent_width - rect.getWidth() )
3187 { 3144 {
3188 // At this point, we need to move the context menu to the 3145 // At this point, we need to move the context menu to the
3189 // other side of the mouse. 3146 // other side of the mouse.
@@ -3283,7 +3240,7 @@ void LLPieMenuBranch::doIt( void )
3283 S32 center_y; 3240 S32 center_y;
3284 parent->localPointToScreen(rect.getWidth() / 2, rect.getHeight() / 2, &center_x, &center_y); 3241 parent->localPointToScreen(rect.getWidth() / 2, rect.getHeight() / 2, &center_x, &center_y);
3285 3242
3286 parent->hide(TRUE); 3243 parent->hide(FALSE);
3287 mBranch->show( center_x, center_y, FALSE ); 3244 mBranch->show( center_x, center_y, FALSE );
3288} 3245}
3289 3246
@@ -3473,6 +3430,11 @@ BOOL LLPieMenu::handleMouseDown( S32 x, S32 y, MASK mask )
3473 // to make sure it's within the item's rectangle 3430 // to make sure it's within the item's rectangle
3474 handled = item->handleMouseDown( 0, 0, mask ); 3431 handled = item->handleMouseDown( 0, 0, mask );
3475 } 3432 }
3433 else if (!mRightMouseDown)
3434 {
3435 // call hidemenus to make sure transient selections get cleared
3436 ((LLMenuHolderGL*)getParent())->hideMenus();
3437 }
3476 3438
3477 // always handle mouse down as mouse up will close open menus 3439 // always handle mouse down as mouse up will close open menus
3478 return handled; 3440 return handled;
@@ -3546,6 +3508,11 @@ BOOL LLPieMenu::handleMouseUp( S32 x, S32 y, MASK mask )
3546 hide(TRUE); 3508 hide(TRUE);
3547 } 3509 }
3548 } 3510 }
3511 else if (!mRightMouseDown)
3512 {
3513 // call hidemenus to make sure transient selections get cleared
3514 ((LLMenuHolderGL*)getParent())->hideMenus();
3515 }
3549 3516
3550 if (handled) 3517 if (handled)
3551 { 3518 {
@@ -3555,7 +3522,7 @@ BOOL LLPieMenu::handleMouseUp( S32 x, S32 y, MASK mask )
3555 if (!handled && !mUseInfiniteRadius) 3522 if (!handled && !mUseInfiniteRadius)
3556 { 3523 {
3557 // call hidemenus to make sure transient selections get cleared 3524 // call hidemenus to make sure transient selections get cleared
3558 ((LLMenuHolderGL*)getParent())->hideMenus(); 3525 sMenuContainer->hideMenus();
3559 } 3526 }
3560 3527
3561 if (mFirstMouseDown) 3528 if (mFirstMouseDown)
@@ -3866,10 +3833,9 @@ void LLPieMenu::show(S32 x, S32 y, BOOL mouse_down)
3866 S32 width = mRect.getWidth(); 3833 S32 width = mRect.getWidth();
3867 S32 height = mRect.getHeight(); 3834 S32 height = mRect.getHeight();
3868 3835
3869 LLView* parent_view = getParent(); 3836 const LLRect menu_region_rect = LLMenuGL::sMenuContainer->getMenuRect();
3870 S32 menu_region_width = parent_view->getRect().getWidth();
3871 S32 menu_region_height = parent_view->getRect().getHeight();
3872 3837
3838 LLView* parent_view = getParent();
3873 BOOL moved = FALSE; 3839 BOOL moved = FALSE;
3874 3840
3875 S32 local_x, local_y; 3841 S32 local_x, local_y;
@@ -3879,36 +3845,36 @@ void LLPieMenu::show(S32 x, S32 y, BOOL mouse_down)
3879 arrange(); 3845 arrange();
3880 3846
3881 // Adjust the pie rectangle to keep it on screen 3847 // Adjust the pie rectangle to keep it on screen
3882 if (mRect.mLeft < 0) 3848 if (mRect.mLeft < menu_region_rect.mLeft)
3883 { 3849 {
3884 //mShiftHoriz = 0 - mRect.mLeft; 3850 //mShiftHoriz = menu_region_rect.mLeft - mRect.mLeft;
3885 //mRect.translate( mShiftHoriz, 0 ); 3851 //mRect.translate( mShiftHoriz, 0 );
3886 mRect.translate( 0 - mRect.mLeft, 0 ); 3852 mRect.translate( menu_region_rect.mLeft - mRect.mLeft, 0 );
3887 moved = TRUE; 3853 moved = TRUE;
3888 } 3854 }
3889 3855
3890 if (mRect.mRight > menu_region_width) 3856 if (mRect.mRight > menu_region_rect.mRight)
3891 { 3857 {
3892 //mShiftHoriz = menu_region_width - mRect.mRight; 3858 //mShiftHoriz = menu_region_rect.mRight - mRect.mRight;
3893 //mRect.translate( mShiftHoriz, 0); 3859 //mRect.translate( mShiftHoriz, 0);
3894 mRect.translate( menu_region_width - mRect.mRight, 0 ); 3860 mRect.translate( menu_region_rect.mRight - mRect.mRight, 0 );
3895 moved = TRUE; 3861 moved = TRUE;
3896 } 3862 }
3897 3863
3898 if (mRect.mBottom < 0) 3864 if (mRect.mBottom < menu_region_rect.mBottom)
3899 { 3865 {
3900 //mShiftVert = -mRect.mBottom; 3866 //mShiftVert = menu_region_rect.mBottom - mRect.mBottom;
3901 //mRect.translate( 0, mShiftVert ); 3867 //mRect.translate( 0, mShiftVert );
3902 mRect.translate( 0, 0 - mRect.mBottom ); 3868 mRect.translate( 0, menu_region_rect.mBottom - mRect.mBottom );
3903 moved = TRUE; 3869 moved = TRUE;
3904 } 3870 }
3905 3871
3906 3872
3907 if (mRect.mTop > menu_region_height) 3873 if (mRect.mTop > menu_region_rect.mTop)
3908 { 3874 {
3909 //mShiftVert = menu_region_height - mRect.mTop; 3875 //mShiftVert = menu_region_rect.mTop - mRect.mTop;
3910 //mRect.translate( 0, mShiftVert ); 3876 //mRect.translate( 0, mShiftVert );
3911 mRect.translate( 0, menu_region_height - mRect.mTop ); 3877 mRect.translate( 0, menu_region_rect.mTop - mRect.mTop );
3912 moved = TRUE; 3878 moved = TRUE;
3913 } 3879 }
3914 3880
@@ -4067,9 +4033,9 @@ LLView* LLMenuBarGL::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory
4067 menu->setCanTearOff(TRUE, parent_handle); 4033 menu->setCanTearOff(TRUE, parent_handle);
4068 } 4034 }
4069 menubar->appendMenu(menu); 4035 menubar->appendMenu(menu);
4070 if (LLMenuGL::sDefaultMenuContainer != NULL) 4036 if (LLMenuGL::sMenuContainer != NULL)
4071 { 4037 {
4072 menu->updateParent(LLMenuGL::sDefaultMenuContainer); 4038 menu->updateParent(LLMenuGL::sMenuContainer);
4073 } 4039 }
4074 else 4040 else
4075 { 4041 {
@@ -4198,9 +4164,9 @@ void LLMenuBarGL::checkMenuTrigger()
4198 4164
4199BOOL LLMenuBarGL::jumpKeysActive() 4165BOOL LLMenuBarGL::jumpKeysActive()
4200{ 4166{
4201 // require item to be highlighted to activate key triggers 4167 // require user to be in keyboard navigation mode to activate key triggers
4202 // as menu bars are always visible 4168 // as menu bars are always visible and it is easy to leave the mouse cursor over them
4203 return getHighlightedItem() && LLMenuGL::jumpKeysActive(); 4169 return LLMenuGL::getKeyboardMode() && getHighlightedItem() && LLMenuGL::jumpKeysActive();
4204} 4170}
4205 4171
4206// rearrange the child rects so they fit the shape of the menu bar. 4172// rearrange the child rects so they fit the shape of the menu bar.
@@ -4218,6 +4184,7 @@ void LLMenuBarGL::arrange( void )
4218 item->setRect( rect ); 4184 item->setRect( rect );
4219 item->buildDrawLabel(); 4185 item->buildDrawLabel();
4220 } 4186 }
4187 reshape(rect.mRight, rect.getHeight());
4221} 4188}
4222 4189
4223 4190
@@ -4430,12 +4397,12 @@ void LLMenuHolderGL::reshape(S32 width, S32 height, BOOL called_from_parent)
4430 LLView::reshape(width, height, called_from_parent); 4397 LLView::reshape(width, height, called_from_parent);
4431} 4398}
4432 4399
4433BOOL LLMenuHolderGL::hasVisibleMenu() 4400BOOL LLMenuHolderGL::hasVisibleMenu() const
4434{ 4401{
4435 for ( child_list_const_iter_t child_it = getChildList()->begin(); child_it != getChildList()->end(); ++child_it) 4402 for ( child_list_const_iter_t child_it = getChildList()->begin(); child_it != getChildList()->end(); ++child_it)
4436 { 4403 {
4437 LLView* viewp = *child_it; 4404 LLView* viewp = *child_it;
4438 if (viewp->getVisible()) 4405 if (viewp->getVisible() && viewp->getWidgetType() != WIDGET_TYPE_MENU_BAR)
4439 { 4406 {
4440 return TRUE; 4407 return TRUE;
4441 } 4408 }
@@ -4443,6 +4410,11 @@ BOOL LLMenuHolderGL::hasVisibleMenu()
4443 return FALSE; 4410 return FALSE;
4444} 4411}
4445 4412
4413const LLRect LLMenuHolderGL::getMenuRect() const
4414{
4415 return getLocalRect();
4416}
4417
4446BOOL LLMenuHolderGL::hideMenus() 4418BOOL LLMenuHolderGL::hideMenus()
4447{ 4419{
4448 if (!mCanHide) 4420 if (!mCanHide)
@@ -4452,11 +4424,13 @@ BOOL LLMenuHolderGL::hideMenus()
4452 BOOL menu_visible = hasVisibleMenu(); 4424 BOOL menu_visible = hasVisibleMenu();
4453 if (menu_visible) 4425 if (menu_visible)
4454 { 4426 {
4427 LLMenuGL::setKeyboardMode(FALSE);
4455 // clicked off of menu, hide them all 4428 // clicked off of menu, hide them all
4456 for ( child_list_const_iter_t child_it = getChildList()->begin(); child_it != getChildList()->end(); ++child_it) 4429 for ( child_list_const_iter_t child_it = getChildList()->begin(); child_it != getChildList()->end(); ++child_it)
4457 { 4430 {
4458 LLView* viewp = *child_it; 4431 LLView* viewp = *child_it;
4459 if (viewp->getVisible()) 4432 // clicks off of menu do not hide menu bar
4433 if (viewp->getWidgetType() != WIDGET_TYPE_MENU_BAR && viewp->getVisible())
4460 { 4434 {
4461 viewp->setVisible(FALSE); 4435 viewp->setVisible(FALSE);
4462 } 4436 }
@@ -4598,7 +4572,7 @@ LLTearOffMenu* LLTearOffMenu::create(LLMenuGL* menup)
4598 LLTearOffMenu* tearoffp = new LLTearOffMenu(menup); 4572 LLTearOffMenu* tearoffp = new LLTearOffMenu(menup);
4599 // keep onscreen 4573 // keep onscreen
4600 gFloaterView->adjustToFitScreen(tearoffp, FALSE); 4574 gFloaterView->adjustToFitScreen(tearoffp, FALSE);
4601 tearoffp->open(); 4575 tearoffp->open(); /* Flawfinder: ignore */
4602 return tearoffp; 4576 return tearoffp;
4603} 4577}
4604 4578
diff --git a/linden/indra/llui/llmenugl.h b/linden/indra/llui/llmenugl.h
index 77e2b31..c4a0043 100644
--- a/linden/indra/llui/llmenugl.h
+++ b/linden/indra/llui/llmenugl.h
@@ -41,6 +41,7 @@
41#include "llview.h" 41#include "llview.h"
42 42
43class LLMenuItemGL; 43class LLMenuItemGL;
44class LLMenuHolderGL;
44 45
45extern S32 MENU_BAR_HEIGHT; 46extern S32 MENU_BAR_HEIGHT;
46extern S32 MENU_BAR_WIDTH; 47extern S32 MENU_BAR_WIDTH;
@@ -163,6 +164,7 @@ public:
163 164
164 // LLView Functionality 165 // LLView Functionality
165 virtual BOOL handleKeyHere( KEY key, MASK mask, BOOL called_from_parent ); 166 virtual BOOL handleKeyHere( KEY key, MASK mask, BOOL called_from_parent );
167 virtual BOOL handleMouseDown( S32 x, S32 y, MASK mask );
166 virtual BOOL handleMouseUp( S32 x, S32 y, MASK mask ); 168 virtual BOOL handleMouseUp( S32 x, S32 y, MASK mask );
167 virtual void draw( void ); 169 virtual void draw( void );
168 170
@@ -441,6 +443,7 @@ public:
441 443
442 static void setDefaultBackgroundColor( const LLColor4& color ); 444 static void setDefaultBackgroundColor( const LLColor4& color );
443 void setBackgroundColor( const LLColor4& color ); 445 void setBackgroundColor( const LLColor4& color );
446 LLColor4 getBackgroundColor();
444 void setBackgroundVisible( BOOL b ) { mBgVisible = b; } 447 void setBackgroundVisible( BOOL b ) { mBgVisible = b; }
445 void setCanTearOff(BOOL tear_off, LLViewHandle parent_floater_handle = LLViewHandle::sDeadHandle); 448 void setCanTearOff(BOOL tear_off, LLViewHandle parent_floater_handle = LLViewHandle::sDeadHandle);
446 449
@@ -523,7 +526,8 @@ public:
523 static BOOL getKeyboardMode() { return sKeyboardMode; } 526 static BOOL getKeyboardMode() { return sKeyboardMode; }
524 527
525 static void onFocusLost(LLView* old_focus); 528 static void onFocusLost(LLView* old_focus);
526 static LLView *sDefaultMenuContainer; 529
530 static LLMenuHolderGL* sMenuContainer;
527 531
528protected: 532protected:
529 void createSpilloverBranch(); 533 void createSpilloverBranch();
@@ -558,6 +562,75 @@ protected:
558 KEY mJumpKey; 562 KEY mJumpKey;
559}; 563};
560 564
565
566
567//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
568// Class LLMenuItemBranchGL
569//
570// The LLMenuItemBranchGL represents a menu item that has a
571// sub-menu. This is used to make cascading menus.
572//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
573
574class LLMenuItemBranchGL : public LLMenuItemGL
575{
576protected:
577 LLMenuGL* mBranch;
578
579public:
580 LLMenuItemBranchGL( const LLString& name, const LLString& label, LLMenuGL* branch,
581 KEY key = KEY_NONE, MASK mask = MASK_NONE );
582 virtual LLXMLNodePtr getXML(bool save_children = true) const;
583
584 virtual LLView* getChildByName(const LLString& name, BOOL recurse) const;
585
586 virtual LLString getType() const { return "menu"; }
587
588 virtual EWidgetType getWidgetType() const;
589 virtual LLString getWidgetTag() const;
590
591 virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask);
592
593 virtual BOOL handleAcceleratorKey(KEY key, MASK mask);
594
595 // check if we've used these accelerators already
596 virtual BOOL addToAcceleratorList(std::list <LLKeyBinding*> *listp);
597
598 // called to rebuild the draw label
599 virtual void buildDrawLabel( void );
600
601 // doIt() - do the primary funcationality of the menu item.
602 virtual void doIt( void );
603
604 virtual BOOL handleKey(KEY key, MASK mask, BOOL called_from_parent);
605 virtual BOOL handleUnicodeChar(llwchar uni_char, BOOL called_from_parent);
606
607 // set the hover status (called by it's menu) and if the object is
608 // active. This is used for behavior transfer.
609 virtual void setHighlight( BOOL highlight );
610
611 virtual BOOL handleKeyHere(KEY key, MASK mask, BOOL called_from_parent);
612
613 virtual BOOL isActive() const;
614
615 virtual BOOL isOpen() const;
616
617 LLMenuGL *getBranch() const { return mBranch; }
618
619 virtual void updateBranchParent( LLView* parentp );
620
621 // LLView Functionality
622 virtual void onVisibilityChange( BOOL curVisibilityIn );
623
624 virtual void draw();
625
626 virtual void setEnabledSubMenus(BOOL enabled);
627
628 virtual void openMenu();
629};
630
631
632
633
561//----------------------------------------------------------------------------- 634//-----------------------------------------------------------------------------
562// class LLPieMenu 635// class LLPieMenu
563// A circular menu of items, icons, etc. 636// A circular menu of items, icons, etc.
@@ -698,8 +771,10 @@ public:
698 virtual BOOL handleMouseDown( S32 x, S32 y, MASK mask ); 771 virtual BOOL handleMouseDown( S32 x, S32 y, MASK mask );
699 virtual BOOL handleRightMouseDown( S32 x, S32 y, MASK mask ); 772 virtual BOOL handleRightMouseDown( S32 x, S32 y, MASK mask );
700 773
774 virtual const LLRect getMenuRect() const;
775 virtual BOOL hasVisibleMenu() const;
776
701 static void setActivatedItem(LLMenuItemGL* item); 777 static void setActivatedItem(LLMenuItemGL* item);
702 BOOL hasVisibleMenu();
703 778
704protected: 779protected:
705 static LLViewHandle sItemLastSelectedHandle; 780 static LLViewHandle sItemLastSelectedHandle;
diff --git a/linden/indra/llui/llpanel.cpp b/linden/indra/llui/llpanel.cpp
index c2c29bb..8d3fba6 100644
--- a/linden/indra/llui/llpanel.cpp
+++ b/linden/indra/llui/llpanel.cpp
@@ -183,10 +183,11 @@ void LLPanel::draw()
183 // draw background 183 // draw background
184 if( mBgVisible ) 184 if( mBgVisible )
185 { 185 {
186 S32 left = LLPANEL_BORDER_WIDTH; 186 //RN: I don't see the point of this
187 S32 top = mRect.getHeight() - LLPANEL_BORDER_WIDTH; 187 S32 left = 0;//LLPANEL_BORDER_WIDTH;
188 S32 right = mRect.getWidth() - LLPANEL_BORDER_WIDTH; 188 S32 top = mRect.getHeight();// - LLPANEL_BORDER_WIDTH;
189 S32 bottom = LLPANEL_BORDER_WIDTH; 189 S32 right = mRect.getWidth();// - LLPANEL_BORDER_WIDTH;
190 S32 bottom = 0;//LLPANEL_BORDER_WIDTH;
190 191
191 if (mBgOpaque ) 192 if (mBgOpaque )
192 { 193 {
@@ -357,16 +358,6 @@ BOOL LLPanel::handleKeyHere( KEY key, MASK mask, BOOL called_from_parent )
357 gFocusMgr.childHasKeyboardFocus(this) && !called_from_parent ) 358 gFocusMgr.childHasKeyboardFocus(this) && !called_from_parent )
358 { 359 {
359 LLUICtrl* cur_focus = gFocusMgr.getKeyboardFocus(); 360 LLUICtrl* cur_focus = gFocusMgr.getKeyboardFocus();
360 if (key == KEY_RETURN && mask == MASK_NONE)
361 {
362 // set keyboard focus to self to trigger commitOnFocusLost behavior on current ctrl
363 if (cur_focus && cur_focus->acceptsTextInput())
364 {
365 cur_focus->onCommit();
366 handled = TRUE;
367 }
368 }
369
370 // If we have a default button, click it when 361 // If we have a default button, click it when
371 // return is pressed, unless current focus is a return-capturing button 362 // return is pressed, unless current focus is a return-capturing button
372 // in which case *that* button will handle the return key 363 // in which case *that* button will handle the return key
@@ -382,6 +373,16 @@ BOOL LLPanel::handleKeyHere( KEY key, MASK mask, BOOL called_from_parent )
382 handled = TRUE; 373 handled = TRUE;
383 } 374 }
384 } 375 }
376
377 if (key == KEY_RETURN && mask == MASK_NONE)
378 {
379 // set keyboard focus to self to trigger commitOnFocusLost behavior on current ctrl
380 if (cur_focus && cur_focus->acceptsTextInput())
381 {
382 cur_focus->onCommit();
383 handled = TRUE;
384 }
385 }
385 } 386 }
386 387
387 return handled; 388 return handled;
@@ -478,6 +479,11 @@ void LLPanel::setBackgroundColor(const LLColor4& color)
478 mBgColorOpaque = color; 479 mBgColorOpaque = color;
479} 480}
480 481
482LLColor4 LLPanel::getBackgroundColor()
483{
484 return mBgColorOpaque;
485}
486
481void LLPanel::setTransparentColor(const LLColor4& color) 487void LLPanel::setTransparentColor(const LLColor4& color)
482{ 488{
483 mBgColorAlpha = color; 489 mBgColorAlpha = color;
diff --git a/linden/indra/llui/llpanel.h b/linden/indra/llui/llpanel.h
index 975c747..d9bd19c 100644
--- a/linden/indra/llui/llpanel.h
+++ b/linden/indra/llui/llpanel.h
@@ -36,6 +36,7 @@
36#include "llviewborder.h" 36#include "llviewborder.h"
37#include "v4color.h" 37#include "v4color.h"
38#include <list> 38#include <list>
39#include <queue>
39 40
40const S32 LLPANEL_BORDER_WIDTH = 1; 41const S32 LLPANEL_BORDER_WIDTH = 1;
41const BOOL BORDER_YES = TRUE; 42const BOOL BORDER_YES = TRUE;
@@ -105,6 +106,7 @@ public:
105 static BOOL nextAlert(LLAlertInfo &alert); 106 static BOOL nextAlert(LLAlertInfo &alert);
106 107
107 void setBackgroundColor( const LLColor4& color ); 108 void setBackgroundColor( const LLColor4& color );
109 LLColor4 getBackgroundColor();
108 void setTransparentColor(const LLColor4& color); 110 void setTransparentColor(const LLColor4& color);
109 void setBackgroundVisible( BOOL b ) { mBgVisible = b; } 111 void setBackgroundVisible( BOOL b ) { mBgVisible = b; }
110 void setBackgroundOpaque(BOOL b) { mBgOpaque = b; } 112 void setBackgroundOpaque(BOOL b) { mBgOpaque = b; }
diff --git a/linden/indra/llui/llresmgr.cpp b/linden/indra/llui/llresmgr.cpp
index 3c54cf6..a73b487 100644
--- a/linden/indra/llui/llresmgr.cpp
+++ b/linden/indra/llui/llresmgr.cpp
@@ -321,8 +321,8 @@ void LLResMgr::getMonetaryString( LLString& output, S32 input ) const
321 } 321 }
322 S32 group_count = cur_group; 322 S32 group_count = cur_group;
323 323
324 char reversed_output[20] = ""; 324 char reversed_output[20] = ""; /* Flawfinder: ignore */
325 char forward_output[20] = ""; 325 char forward_output[20] = ""; /* Flawfinder: ignore */
326 S32 output_pos = 0; 326 S32 output_pos = 0;
327 327
328 cur_group = 0; 328 cur_group = 0;
diff --git a/linden/indra/llui/llrootview.cpp b/linden/indra/llui/llrootview.cpp
index 699a2f6..49e512c 100644
--- a/linden/indra/llui/llrootview.cpp
+++ b/linden/indra/llui/llrootview.cpp
@@ -1,8 +1,8 @@
1/** 1/**
2 * @file llrootview.cpp 2 * @file llrootview.cpp
3 * @brief Container for all other views in an application 3 * @brief Container for all other views in an application
4 * 4 *
5 * Copyright (c) 2006-2007, Linden Research, Inc. 5 * Copyright (c) 2006-2007, Linden Research, Inc.
6 * 6 *
7 * The source code in this file ("Source Code") is provided by Linden Lab 7 * The source code in this file ("Source Code") is provided by Linden Lab
8 * to you under the terms of the GNU General Public License, version 2.0 8 * to you under the terms of the GNU General Public License, version 2.0
@@ -22,23 +22,23 @@
22 * 22 *
23 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO 23 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
24 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, 24 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
25 * COMPLETENESS OR PERFORMANCE. 25 * COMPLETENESS OR PERFORMANCE.
26 */ 26 */
27 27
28#include "llrootview.h" 28#include "llrootview.h"
29 29
30LLRootView::LLRootView(const LLString& name, const LLRect& rect, BOOL mouse_opaque, U32 follows) 30LLRootView::LLRootView(const LLString& name, const LLRect& rect, BOOL mouse_opaque, U32 follows)
31: LLView(name,rect,mouse_opaque,follows) 31: LLView(name,rect,mouse_opaque,follows)
32{ } 32{ }
33 33
34// virtual 34// virtual
35EWidgetType LLRootView::getWidgetType() const 35EWidgetType LLRootView::getWidgetType() const
36{ 36{
37 return WIDGET_TYPE_ROOT_VIEW; 37 return WIDGET_TYPE_ROOT_VIEW;
38} 38}
39 39
40// virtual 40// virtual
41LLString LLRootView::getWidgetTag() const 41LLString LLRootView::getWidgetTag() const
42{ 42{
43 return LL_ROOT_VIEW_TAG; 43 return LL_ROOT_VIEW_TAG;
44} 44}
diff --git a/linden/indra/llui/llrootview.h b/linden/indra/llui/llrootview.h
index 212b93b..84a989b 100644
--- a/linden/indra/llui/llrootview.h
+++ b/linden/indra/llui/llrootview.h
@@ -1,8 +1,8 @@
1/** 1/**
2 * @file llrootview.h 2 * @file llrootview.h
3 * @brief Container for all other views in an application 3 * @brief Container for all other views in an application
4 * 4 *
5 * Copyright (c) 2006-2007, Linden Research, Inc. 5 * Copyright (c) 2006-2007, Linden Research, Inc.
6 * 6 *
7 * The source code in this file ("Source Code") is provided by Linden Lab 7 * The source code in this file ("Source Code") is provided by Linden Lab
8 * to you under the terms of the GNU General Public License, version 2.0 8 * to you under the terms of the GNU General Public License, version 2.0
@@ -22,21 +22,21 @@
22 * 22 *
23 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO 23 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
24 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, 24 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
25 * COMPLETENESS OR PERFORMANCE. 25 * COMPLETENESS OR PERFORMANCE.
26 */ 26 */
27 27
28#ifndef LLROOTVIEW_H 28#ifndef LLROOTVIEW_H
29#define LLROOTVIEW_H 29#define LLROOTVIEW_H
30 30
31#include "llview.h" 31#include "llview.h"
32 32
33class LLRootView : public LLView 33class LLRootView : public LLView
34{ 34{
35public: 35public:
36 LLRootView(const LLString& name, const LLRect& rect, BOOL mouse_opaque, U32 follows=FOLLOWS_NONE); 36 LLRootView(const LLString& name, const LLRect& rect, BOOL mouse_opaque, U32 follows=FOLLOWS_NONE);
37 37
38 /*virtual*/ EWidgetType getWidgetType() const; 38 /*virtual*/ EWidgetType getWidgetType() const;
39 /*virtual*/ LLString getWidgetTag() const; 39 /*virtual*/ LLString getWidgetTag() const;
40}; 40};
41 41
42#endif 42#endif
diff --git a/linden/indra/llui/llscrollbar.cpp b/linden/indra/llui/llscrollbar.cpp
index da3e472..578fdb1 100644
--- a/linden/indra/llui/llscrollbar.cpp
+++ b/linden/indra/llui/llscrollbar.cpp
@@ -405,21 +405,23 @@ BOOL LLScrollbar::handleScrollWheel(S32 x, S32 y, S32 clicks)
405BOOL LLScrollbar::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, 405BOOL LLScrollbar::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop,
406 EDragAndDropType cargo_type, void *carge_data, EAcceptance *accept, LLString &tooltip_msg) 406 EDragAndDropType cargo_type, void *carge_data, EAcceptance *accept, LLString &tooltip_msg)
407{ 407{
408 if (!drop) 408 // enable this to get drag and drop to control scrollbars
409 { 409 //if (!drop)
410 //TODO: refactor this 410 //{
411 S32 variable_lines = getDocPosMax(); 411 // //TODO: refactor this
412 S32 pos = (VERTICAL == mOrientation) ? y : x; 412 // S32 variable_lines = getDocPosMax();
413 S32 thumb_length = (VERTICAL == mOrientation) ? mThumbRect.getHeight() : mThumbRect.getWidth(); 413 // S32 pos = (VERTICAL == mOrientation) ? y : x;
414 S32 thumb_track_length = (VERTICAL == mOrientation) ? (mRect.getHeight() - 2 * SCROLLBAR_SIZE) : (mRect.getWidth() - 2 * SCROLLBAR_SIZE); 414 // S32 thumb_length = (VERTICAL == mOrientation) ? mThumbRect.getHeight() : mThumbRect.getWidth();
415 S32 usable_track_length = thumb_track_length - thumb_length; 415 // S32 thumb_track_length = (VERTICAL == mOrientation) ? (mRect.getHeight() - 2 * SCROLLBAR_SIZE) : (mRect.getWidth() - 2 * SCROLLBAR_SIZE);
416 F32 ratio = (VERTICAL == mOrientation) ? F32(pos - SCROLLBAR_SIZE - thumb_length) / usable_track_length 416 // S32 usable_track_length = thumb_track_length - thumb_length;
417 : F32(pos - SCROLLBAR_SIZE) / usable_track_length; 417 // F32 ratio = (VERTICAL == mOrientation) ? F32(pos - SCROLLBAR_SIZE - thumb_length) / usable_track_length
418 S32 new_pos = (VERTICAL == mOrientation) ? llclamp( S32(variable_lines - ratio * variable_lines + 0.5f), 0, variable_lines ) 418 // : F32(pos - SCROLLBAR_SIZE) / usable_track_length;
419 : llclamp( S32(ratio * variable_lines + 0.5f), 0, variable_lines ); 419 // S32 new_pos = (VERTICAL == mOrientation) ? llclamp( S32(variable_lines - ratio * variable_lines + 0.5f), 0, variable_lines )
420 changeLine( new_pos - mDocPos, TRUE ); 420 // : llclamp( S32(ratio * variable_lines + 0.5f), 0, variable_lines );
421 } 421 // changeLine( new_pos - mDocPos, TRUE );
422 return TRUE; 422 //}
423 //return TRUE;
424 return FALSE;
423} 425}
424 426
425BOOL LLScrollbar::handleMouseUp(S32 x, S32 y, MASK mask) 427BOOL LLScrollbar::handleMouseUp(S32 x, S32 y, MASK mask)
diff --git a/linden/indra/llui/llscrolllistctrl.cpp b/linden/indra/llui/llscrolllistctrl.cpp
index df4ca64..4d5c49f 100644
--- a/linden/indra/llui/llscrolllistctrl.cpp
+++ b/linden/indra/llui/llscrolllistctrl.cpp
@@ -95,7 +95,7 @@ protected:
95// LLScrollListIcon 95// LLScrollListIcon
96// 96//
97LLScrollListIcon::LLScrollListIcon(LLImageGL* icon, S32 width, LLUUID image_id) : 97LLScrollListIcon::LLScrollListIcon(LLImageGL* icon, S32 width, LLUUID image_id) :
98mIcon(icon), mImageUUID(image_id.getString()) 98mIcon(icon), mImageUUID(image_id.asString())
99{ 99{
100 if (width) 100 if (width)
101 { 101 {
@@ -156,13 +156,15 @@ BOOL LLScrollListCheck::handleClick()
156// 156//
157U32 LLScrollListText::sCount = 0; 157U32 LLScrollListText::sCount = 0;
158 158
159LLScrollListText::LLScrollListText( const LLString& text, const LLFontGL* font, S32 width, U8 font_style, LLColor4& color, BOOL use_color, BOOL visible) 159LLScrollListText::LLScrollListText( const LLString& text, const LLFontGL* font, S32 width, U8 font_style, LLFontGL::HAlign font_alignment, LLColor4& color, BOOL use_color, BOOL visible)
160: mText( text ), 160: mText( text ),
161 mFont( font ), 161 mFont( font ),
162 mFontStyle( font_style ), 162 mFontStyle( font_style ),
163 mFontAlignment( font_alignment ),
163 mWidth( width ), 164 mWidth( width ),
164 mVisible( visible ), 165 mVisible( visible ),
165 mHighlightChars( 0 ) 166 mHighlightCount( 0 ),
167 mHighlightOffset( 0 )
166{ 168{
167 if (use_color) 169 if (use_color)
168 { 170 {
@@ -181,10 +183,6 @@ LLScrollListText::LLScrollListText( const LLString& text, const LLFontGL* font,
181 { 183 {
182 mRoundedRectImage = LLUI::sImageProvider->getUIImageByID(LLUUID(LLUI::sAssetsGroup->getString("rounded_square.tga"))); 184 mRoundedRectImage = LLUI::sImageProvider->getUIImageByID(LLUUID(LLUI::sAssetsGroup->getString("rounded_square.tga")));
183 } 185 }
184
185 // Yes, that's four dots, because we want it to have a little
186 // padding, in proportion to the font size.
187 mEllipsisWidth = (S32)mFont->getWidth("....");
188} 186}
189 187
190LLScrollListText::~LLScrollListText() 188LLScrollListText::~LLScrollListText()
@@ -216,13 +214,26 @@ void LLScrollListText::drawToWidth(S32 width, const LLColor4& color, const LLCol
216 display_color = &color; 214 display_color = &color;
217 } 215 }
218 216
219 if (mHighlightChars > 0) 217 if (mHighlightCount > 0)
220 { 218 {
221 mRoundedRectImage->bind(); 219 mRoundedRectImage->bind();
222 glColor4fv(highlight_color.mV); 220 glColor4fv(highlight_color.mV);
223 gl_segmented_rect_2d_tex(-2, 221 S32 left = 0;
222 switch(mFontAlignment)
223 {
224 case LLFontGL::LEFT:
225 left = mFont->getWidth(mText.getString(), 0, mHighlightOffset);
226 break;
227 case LLFontGL::RIGHT:
228 left = width - mFont->getWidth(mText.getString(), mHighlightOffset, S32_MAX);
229 break;
230 case LLFontGL::HCENTER:
231 left = (width - mFont->getWidth(mText.getString())) / 2;
232 break;
233 }
234 gl_segmented_rect_2d_tex(left - 2,
224 llround(mFont->getLineHeight()) + 1, 235 llround(mFont->getLineHeight()) + 1,
225 mFont->getWidth(mText.getString(), 0, mHighlightChars) + 1, 236 left + mFont->getWidth(mText.getString(), mHighlightOffset, mHighlightCount) + 1,
226 1, 237 1,
227 mRoundedRectImage->getWidth(), 238 mRoundedRectImage->getWidth(),
228 mRoundedRectImage->getHeight(), 239 mRoundedRectImage->getHeight(),
@@ -232,21 +243,28 @@ void LLScrollListText::drawToWidth(S32 width, const LLColor4& color, const LLCol
232 // Try to draw the entire string 243 // Try to draw the entire string
233 F32 right_x; 244 F32 right_x;
234 U32 string_chars = mText.length(); 245 U32 string_chars = mText.length();
235 U32 drawn_chars = mFont->render(mText.getWString(), 0, 0, 2, 246 F32 start_x = 0.f;
236 *display_color, 247 switch(mFontAlignment)
237 LLFontGL::LEFT, 248 {
238 LLFontGL::BOTTOM, 249 case LLFontGL::LEFT:
239 mFontStyle, 250 start_x = 0.f;
240 string_chars, 251 break;
241 width - mEllipsisWidth, 252 case LLFontGL::RIGHT:
242 &right_x, FALSE); 253 start_x = (F32)width;
243 254 break;
244 // If we didn't get the whole string, abbreviate 255 case LLFontGL::HCENTER:
245 if (drawn_chars < string_chars && drawn_chars) 256 start_x = (F32)width * 0.5f;
246 { 257 break;
247 mFont->renderUTF8("...", 0, right_x, 0.f, color, LLFontGL::LEFT, LLFontGL::BOTTOM, mFontStyle, 258 }
248 S32_MAX, S32_MAX, NULL, FALSE); 259 mFont->render(mText.getWString(), 0,
249 } 260 start_x, 2.f,
261 *display_color,
262 mFontAlignment,
263 LLFontGL::BOTTOM,
264 mFontStyle,
265 string_chars,
266 width,
267 &right_x, FALSE, TRUE);
250} 268}
251 269
252 270
@@ -378,20 +396,21 @@ LLScrollListCtrl::LLScrollListCtrl(const LLString& name, const LLRect& rect,
378 mFgUnselectedColor( LLUI::sColorsGroup->getColor("ScrollUnselectedColor") ), 396 mFgUnselectedColor( LLUI::sColorsGroup->getColor("ScrollUnselectedColor") ),
379 mFgDisabledColor( LLUI::sColorsGroup->getColor("ScrollDisabledColor") ), 397 mFgDisabledColor( LLUI::sColorsGroup->getColor("ScrollDisabledColor") ),
380 mHighlightedColor( LLUI::sColorsGroup->getColor("ScrollHighlightedColor") ), 398 mHighlightedColor( LLUI::sColorsGroup->getColor("ScrollHighlightedColor") ),
381 mHighlightedItem(-1),
382 mBorderThickness( 2 ), 399 mBorderThickness( 2 ),
383 mOnDoubleClickCallback( NULL ), 400 mOnDoubleClickCallback( NULL ),
384 mOnMaximumSelectCallback( NULL ), 401 mOnMaximumSelectCallback( NULL ),
385 mOnSortChangedCallback( NULL ), 402 mOnSortChangedCallback( NULL ),
386 mDrewSelected(FALSE), 403 mHighlightedItem(-1),
387 mBorder(NULL), 404 mBorder(NULL),
388 mSearchColumn(0),
389 mDefaultColumn("SIMPLE"), 405 mDefaultColumn("SIMPLE"),
406 mSearchColumn(0),
390 407
391 mNumDynamicWidthColumns(0), 408 mNumDynamicWidthColumns(0),
392 mTotalStaticColumnWidth(0), 409 mTotalStaticColumnWidth(0),
393 mSortColumn(0), 410 mSortColumn(0),
394 mSortAscending(TRUE) 411 mSortAscending(TRUE),
412
413 mDrewSelected(FALSE)
395{ 414{
396 mItemListRect.setOriginAndSize( 415 mItemListRect.setOriginAndSize(
397 mBorderThickness + LIST_BORDER_PAD, 416 mBorderThickness + LIST_BORDER_PAD,
@@ -1160,11 +1179,17 @@ BOOL LLScrollListCtrl::selectSimpleItemByPrefix(const LLWString& target, BOOL ca
1160 { 1179 {
1161 LLWString::toLower(item_label); 1180 LLWString::toLower(item_label);
1162 } 1181 }
1182 // remove extraneous whitespace from searchable label
1183 LLWString trimmed_label = item_label;
1184 LLWString::trim(trimmed_label);
1163 1185
1164 BOOL select = item->getEnabled() && !item_label.compare(0, target_len, target_trimmed); 1186 BOOL select = item->getEnabled() && trimmed_label.compare(0, target_trimmed.size(), target_trimmed) == 0;
1165 1187
1166 if (select) 1188 if (select)
1167 { 1189 {
1190 // find offset of matching text (might have leading whitespace)
1191 S32 offset = item_label.find(target_trimmed);
1192 cellp->highlightText(offset, target_trimmed.size());
1168 selectItem(item); 1193 selectItem(item);
1169 found = TRUE; 1194 found = TRUE;
1170 break; 1195 break;
@@ -1466,6 +1491,9 @@ BOOL LLScrollListCtrl::handleMouseDown(S32 x, S32 y, MASK mask)
1466{ 1491{
1467 BOOL handled = LLView::childrenHandleMouseDown(x, y, mask) != NULL; 1492 BOOL handled = LLView::childrenHandleMouseDown(x, y, mask) != NULL;
1468 1493
1494 // set keyboard focus first, in case click action wants to move focus elsewhere
1495 setFocus(TRUE);
1496
1469 if( !handled && mCanSelect) 1497 if( !handled && mCanSelect)
1470 { 1498 {
1471 LLScrollListItem* hit_item = hitItem(x, y); 1499 LLScrollListItem* hit_item = hitItem(x, y);
@@ -1558,8 +1586,6 @@ BOOL LLScrollListCtrl::handleMouseDown(S32 x, S32 y, MASK mask)
1558 } 1586 }
1559 } 1587 }
1560 1588
1561 gFocusMgr.setKeyboardFocus(this, NULL);
1562
1563 return TRUE; 1589 return TRUE;
1564} 1590}
1565 1591
@@ -1758,7 +1784,7 @@ BOOL LLScrollListCtrl::handleKeyHere(KEY key,MASK mask, BOOL called_from_parent
1758 LLScrollListCell* cellp = getFirstSelected()->getColumn(mSearchColumn); 1784 LLScrollListCell* cellp = getFirstSelected()->getColumn(mSearchColumn);
1759 if (cellp) 1785 if (cellp)
1760 { 1786 {
1761 cellp->highlightText(0); 1787 cellp->highlightText(0, 0);
1762 } 1788 }
1763 } 1789 }
1764 } 1790 }
@@ -1767,13 +1793,6 @@ BOOL LLScrollListCtrl::handleKeyHere(KEY key,MASK mask, BOOL called_from_parent
1767 // update search string only on successful match 1793 // update search string only on successful match
1768 mSearchTimer.reset(); 1794 mSearchTimer.reset();
1769 1795
1770 // highlight current search on matching item
1771 LLScrollListCell* cellp = getFirstSelected()->getColumn(mSearchColumn);
1772 if (cellp)
1773 {
1774 cellp->highlightText(mSearchString.size());
1775 }
1776
1777 if (mCommitOnKeyboardMovement 1796 if (mCommitOnKeyboardMovement
1778 && !mCommitOnSelectionChange) 1797 && !mCommitOnSelectionChange)
1779 { 1798 {
@@ -1813,13 +1832,6 @@ BOOL LLScrollListCtrl::handleUnicodeCharHere(llwchar uni_char, BOOL called_from_
1813 mSearchString += uni_char; 1832 mSearchString += uni_char;
1814 mSearchTimer.reset(); 1833 mSearchTimer.reset();
1815 1834
1816 // highlight current search on matching item
1817 LLScrollListCell* cellp = getFirstSelected()->getColumn(mSearchColumn);
1818 if (cellp)
1819 {
1820 cellp->highlightText(mSearchString.size());
1821 }
1822
1823 if (mCommitOnKeyboardMovement 1835 if (mCommitOnKeyboardMovement
1824 && !mCommitOnSelectionChange) 1836 && !mCommitOnSelectionChange)
1825 { 1837 {
@@ -1862,7 +1874,7 @@ BOOL LLScrollListCtrl::handleUnicodeCharHere(llwchar uni_char, BOOL called_from_
1862 if (item->getEnabled() && LLStringOps::toLower(item_label[0]) == uni_char) 1874 if (item->getEnabled() && LLStringOps::toLower(item_label[0]) == uni_char)
1863 { 1875 {
1864 selectItem(item); 1876 selectItem(item);
1865 cellp->highlightText(1); 1877 cellp->highlightText(0, 1);
1866 mSearchTimer.reset(); 1878 mSearchTimer.reset();
1867 1879
1868 if (mCommitOnKeyboardMovement 1880 if (mCommitOnKeyboardMovement
@@ -1925,7 +1937,7 @@ void LLScrollListCtrl::selectItem(LLScrollListItem* itemp, BOOL select_single_it
1925 LLScrollListCell* cellp = mLastSelected->getColumn(mSearchColumn); 1937 LLScrollListCell* cellp = mLastSelected->getColumn(mSearchColumn);
1926 if (cellp) 1938 if (cellp)
1927 { 1939 {
1928 cellp->highlightText(0); 1940 cellp->highlightText(0, 0);
1929 } 1941 }
1930 } 1942 }
1931 if (select_single_item) 1943 if (select_single_item)
@@ -1953,7 +1965,7 @@ void LLScrollListCtrl::deselectItem(LLScrollListItem* itemp)
1953 LLScrollListCell* cellp = itemp->getColumn(mSearchColumn); 1965 LLScrollListCell* cellp = itemp->getColumn(mSearchColumn);
1954 if (cellp) 1966 if (cellp)
1955 { 1967 {
1956 cellp->highlightText(0); 1968 cellp->highlightText(0, 0);
1957 } 1969 }
1958 mSelectionChanged = TRUE; 1970 mSelectionChanged = TRUE;
1959 } 1971 }
@@ -2195,7 +2207,7 @@ LLView* LLScrollListCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFac
2195 NULL, 2207 NULL,
2196 multi_select, 2208 multi_select,
2197 draw_border); 2209 draw_border);
2198 2210
2199 scroll_list->setDisplayHeading(draw_heading); 2211 scroll_list->setDisplayHeading(draw_heading);
2200 if (node->hasAttribute("heading_height")) 2212 if (node->hasAttribute("heading_height"))
2201 { 2213 {
@@ -2250,6 +2262,8 @@ LLView* LLScrollListCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFac
2250 F32 columnrelwidth = 0.f; 2262 F32 columnrelwidth = 0.f;
2251 child->getAttributeF32("relwidth", columnrelwidth); 2263 child->getAttributeF32("relwidth", columnrelwidth);
2252 2264
2265 LLFontGL::HAlign h_align = LLFontGL::LEFT;
2266 h_align = LLView::selectFontHAlign(child);
2253 2267
2254 columns[index]["name"] = columnname; 2268 columns[index]["name"] = columnname;
2255 columns[index]["sort"] = sortname; 2269 columns[index]["sort"] = sortname;
@@ -2258,6 +2272,7 @@ LLView* LLScrollListCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFac
2258 columns[index]["width"] = columnwidth; 2272 columns[index]["width"] = columnwidth;
2259 columns[index]["relwidth"] = columnrelwidth; 2273 columns[index]["relwidth"] = columnrelwidth;
2260 columns[index]["dynamicwidth"] = columndynamicwidth; 2274 columns[index]["dynamicwidth"] = columndynamicwidth;
2275 columns[index]["halign"] = (S32)h_align;
2261 index++; 2276 index++;
2262 } 2277 }
2263 } 2278 }
@@ -2604,6 +2619,7 @@ LLScrollListItem* LLScrollListCtrl::addElement(const LLSD& value, EAddPosition p
2604 2619
2605 S32 index = column_itor->second.mIndex; 2620 S32 index = column_itor->second.mIndex;
2606 S32 width = column_itor->second.mWidth; 2621 S32 width = column_itor->second.mWidth;
2622 LLFontGL::HAlign font_alignment = column_itor->second.mFontAlignment;
2607 2623
2608 LLSD value = (*itor)["value"]; 2624 LLSD value = (*itor)["value"];
2609 LLString fontname = (*itor)["font"].asString(); 2625 LLString fontname = (*itor)["font"].asString();
@@ -2631,7 +2647,7 @@ LLScrollListItem* LLScrollListCtrl::addElement(const LLSD& value, EAddPosition p
2631 } 2647 }
2632 else 2648 else
2633 { 2649 {
2634 new_item->setColumn(index, new LLScrollListText(value.asString(), font, width, font_style)); 2650 new_item->setColumn(index, new LLScrollListText(value.asString(), font, width, font_style, font_alignment));
2635 } 2651 }
2636 } 2652 }
2637 2653
@@ -2724,7 +2740,7 @@ void LLScrollListCtrl::setFocus(BOOL b)
2724 if (!getFirstSelected()) 2740 if (!getFirstSelected())
2725 { 2741 {
2726 selectFirstItem(); 2742 selectFirstItem();
2727 onCommit(); 2743 //onCommit(); // SJB: selectFirstItem() will call onCommit() if appropriate
2728 } 2744 }
2729 LLUICtrl::setFocus(b); 2745 LLUICtrl::setFocus(b);
2730} 2746}
@@ -2739,3 +2755,4 @@ void LLScrollListCtrl::onFocusLost()
2739 } 2755 }
2740 } 2756 }
2741} 2757}
2758
diff --git a/linden/indra/llui/llscrolllistctrl.h b/linden/indra/llui/llscrolllistctrl.h
index d097cb5..a1c4853 100644
--- a/linden/indra/llui/llscrolllistctrl.h
+++ b/linden/indra/llui/llscrolllistctrl.h
@@ -57,7 +57,7 @@ public:
57 virtual const LLString& getTextLower() const { return LLString::null; } 57 virtual const LLString& getTextLower() const { return LLString::null; }
58 virtual const BOOL getVisible() const { return TRUE; } 58 virtual const BOOL getVisible() const { return TRUE; }
59 virtual void setWidth(S32 width) = 0; 59 virtual void setWidth(S32 width) = 0;
60 virtual void highlightText(S32 num_chars) {} 60 virtual void highlightText(S32 offset, S32 num_chars) {}
61 61
62 virtual BOOL handleClick() { return FALSE; } 62 virtual BOOL handleClick() { return FALSE; }
63 virtual void setEnabled(BOOL enable) { } 63 virtual void setEnabled(BOOL enable) { }
@@ -65,9 +65,8 @@ public:
65 65
66class LLScrollListText : public LLScrollListCell 66class LLScrollListText : public LLScrollListCell
67{ 67{
68 static U32 sCount;
69public: 68public:
70 LLScrollListText( const LLString& text, const LLFontGL* font, S32 width = 0, U8 font_style = LLFontGL::NORMAL, LLColor4& color = LLColor4::black, BOOL use_color = FALSE, BOOL visible = TRUE); 69 LLScrollListText( const LLString& text, const LLFontGL* font, S32 width = 0, U8 font_style = LLFontGL::NORMAL, LLFontGL::HAlign font_alignment = LLFontGL::LEFT, LLColor4& color = LLColor4::black, BOOL use_color = FALSE, BOOL visible = TRUE);
71 /*virtual*/ ~LLScrollListText(); 70 /*virtual*/ ~LLScrollListText();
72 71
73 virtual void drawToWidth(S32 width, const LLColor4& color, const LLColor4& highlight_color) const; 72 virtual void drawToWidth(S32 width, const LLColor4& color, const LLColor4& highlight_color) const;
@@ -76,7 +75,7 @@ public:
76 virtual S32 getHeight() const { return llround(mFont->getLineHeight()); } 75 virtual S32 getHeight() const { return llround(mFont->getLineHeight()); }
77 virtual const LLString& getText() const { return mText.getString(); } 76 virtual const LLString& getText() const { return mText.getString(); }
78 virtual const BOOL getVisible() const { return mVisible; } 77 virtual const BOOL getVisible() const { return mVisible; }
79 virtual void highlightText(S32 num_chars) {mHighlightChars = num_chars;} 78 virtual void highlightText(S32 offset, S32 num_chars) {mHighlightOffset = offset; mHighlightCount = num_chars;}
80 void setText(const LLString& text); 79 void setText(const LLString& text);
81 80
82private: 81private:
@@ -84,12 +83,15 @@ private:
84 const LLFontGL* mFont; 83 const LLFontGL* mFont;
85 LLColor4* mColor; 84 LLColor4* mColor;
86 const U8 mFontStyle; 85 const U8 mFontStyle;
86 LLFontGL::HAlign mFontAlignment;
87 S32 mWidth; 87 S32 mWidth;
88 S32 mEllipsisWidth; // in pixels, of "..."
89 BOOL mVisible; 88 BOOL mVisible;
90 S32 mHighlightChars; 89 S32 mHighlightCount;
90 S32 mHighlightOffset;
91 91
92 LLPointer<LLImageGL> mRoundedRectImage; 92 LLPointer<LLImageGL> mRoundedRectImage;
93
94 static U32 sCount;
93}; 95};
94 96
95class LLScrollListIcon : public LLScrollListCell 97class LLScrollListIcon : public LLScrollListCell
@@ -134,9 +136,10 @@ class LLScrollListColumn
134{ 136{
135public: 137public:
136 // Default constructor 138 // Default constructor
137 LLScrollListColumn() : mName(""), mSortingColumn(""), mLabel(""), mWidth(-1), mRelWidth(-1.0), mDynamicWidth(FALSE), mIndex(-1), mParentCtrl(NULL), mButton(NULL) { } 139 LLScrollListColumn() : mName(""), mSortingColumn(""), mLabel(""), mWidth(-1), mRelWidth(-1.0), mDynamicWidth(FALSE), mIndex(-1), mParentCtrl(NULL), mButton(NULL), mFontAlignment(LLFontGL::LEFT)
140 { }
138 141
139 LLScrollListColumn(LLString name, LLString label, S32 width, F32 relwidth) 142 LLScrollListColumn(LLString name, LLString label, S32 width, F32 relwidth)
140 : mName(name), mSortingColumn(name), mLabel(label), mWidth(width), mRelWidth(relwidth), mDynamicWidth(FALSE), mIndex(-1), mParentCtrl(NULL), mButton(NULL) { } 143 : mName(name), mSortingColumn(name), mLabel(label), mWidth(width), mRelWidth(relwidth), mDynamicWidth(FALSE), mIndex(-1), mParentCtrl(NULL), mButton(NULL) { }
141 144
142 LLScrollListColumn(const LLSD &sd) 145 LLScrollListColumn(const LLSD &sd)
@@ -168,20 +171,27 @@ public:
168 mDynamicWidth = FALSE; 171 mDynamicWidth = FALSE;
169 mRelWidth = -1; 172 mRelWidth = -1;
170 } 173 }
174
175 if (sd.has("halign"))
176 {
177 mFontAlignment = (LLFontGL::HAlign)llclamp(sd.get("halign").asInteger(), (S32)LLFontGL::LEFT, (S32)LLFontGL::HCENTER);
178 }
179
171 mIndex = -1; 180 mIndex = -1;
172 mParentCtrl = NULL; 181 mParentCtrl = NULL;
173 mButton = NULL; 182 mButton = NULL;
174 } 183 }
175 184
176 LLString mName; 185 LLString mName;
177 LLString mSortingColumn; 186 LLString mSortingColumn;
178 LLString mLabel; 187 LLString mLabel;
179 S32 mWidth; 188 S32 mWidth;
180 F32 mRelWidth; 189 F32 mRelWidth;
181 BOOL mDynamicWidth; 190 BOOL mDynamicWidth;
182 S32 mIndex; 191 S32 mIndex;
183 LLScrollListCtrl *mParentCtrl; 192 LLScrollListCtrl* mParentCtrl;
184 LLButton *mButton; 193 LLButton* mButton;
194 LLFontGL::HAlign mFontAlignment;
185}; 195};
186 196
187class LLScrollListItem 197class LLScrollListItem
@@ -208,8 +218,8 @@ public:
208 218
209 // If width = 0, just use the width of the text. Otherwise override with 219 // If width = 0, just use the width of the text. Otherwise override with
210 // specified width in pixels. 220 // specified width in pixels.
211 void addColumn( const LLString& text, const LLFontGL* font, S32 width = 0 , U8 font_style = LLFontGL::NORMAL, BOOL visible = TRUE) 221 void addColumn( const LLString& text, const LLFontGL* font, S32 width = 0 , U8 font_style = LLFontGL::NORMAL, LLFontGL::HAlign font_alignment = LLFontGL::LEFT, BOOL visible = TRUE)
212 { mColumns.push_back( new LLScrollListText(text, font, width, font_style, LLColor4::black, FALSE, visible) ); } 222 { mColumns.push_back( new LLScrollListText(text, font, width, font_style, font_alignment, LLColor4::black, FALSE, visible) ); }
213 223
214 void addColumn( LLImageGL* icon, S32 width = 0 ) 224 void addColumn( LLImageGL* icon, S32 width = 0 )
215 { mColumns.push_back( new LLScrollListIcon(icon, width) ); } 225 { mColumns.push_back( new LLScrollListIcon(icon, width) ); }
diff --git a/linden/indra/llui/llsliderctrl.cpp b/linden/indra/llui/llsliderctrl.cpp
index ca8f3ad..c62ec9a 100644
--- a/linden/indra/llui/llsliderctrl.cpp
+++ b/linden/indra/llui/llsliderctrl.cpp
@@ -215,7 +215,7 @@ void LLSliderCtrl::updateText()
215 LLLocale locale(LLLocale::USER_LOCALE); 215 LLLocale locale(LLLocale::USER_LOCALE);
216 216
217 // Don't display very small negative values as -0.000 217 // Don't display very small negative values as -0.000
218 F32 displayed_value = (F32)(floor(getValueF32() * pow(10, mPrecision) + 0.5) / pow(10, mPrecision)); 218 F32 displayed_value = (F32)(floor(getValueF32() * pow(10.0, (F64)mPrecision) + 0.5) / pow(10.0, (F64)mPrecision));
219 219
220 LLString format = llformat("%%.%df", mPrecision); 220 LLString format = llformat("%%.%df", mPrecision);
221 LLString text = llformat(format.c_str(), displayed_value); 221 LLString text = llformat(format.c_str(), displayed_value);
diff --git a/linden/indra/llui/llspinctrl.cpp b/linden/indra/llui/llspinctrl.cpp
index b93ed02..1f33279 100644
--- a/linden/indra/llui/llspinctrl.cpp
+++ b/linden/indra/llui/llspinctrl.cpp
@@ -248,7 +248,7 @@ void LLSpinCtrl::updateEditor()
248 LLLocale locale(LLLocale::USER_LOCALE); 248 LLLocale locale(LLLocale::USER_LOCALE);
249 249
250 // Don't display very small negative values as -0.000 250 // Don't display very small negative values as -0.000
251 F32 displayed_value = (F32)floor(getValue().asReal() * pow(10, mPrecision) + 0.5) / (F32)pow(10, mPrecision); 251 F32 displayed_value = (F32)floor(getValue().asReal() * pow(10.0, (F64)mPrecision) + 0.5) / (F32)pow(10.0, (F64)mPrecision);
252 252
253// if( S32( displayed_value * pow( 10, mPrecision ) ) == 0 ) 253// if( S32( displayed_value * pow( 10, mPrecision ) ) == 0 )
254// { 254// {
diff --git a/linden/indra/llui/lltexteditor.cpp b/linden/indra/llui/lltexteditor.cpp
index b0f8b5a..8f22545 100644
--- a/linden/indra/llui/lltexteditor.cpp
+++ b/linden/indra/llui/lltexteditor.cpp
@@ -3782,7 +3782,7 @@ BOOL LLTextEditor::importBuffer(const LLString& buffer )
3782 // <text without \0> (text may contain ext_char_values) 3782 // <text without \0> (text may contain ext_char_values)
3783 // }\n 3783 // }\n
3784 3784
3785 char tbuf[MAX_STRING]; 3785 char tbuf[MAX_STRING]; /* Flawfinder: ignore */
3786 3786
3787 S32 version = 0; 3787 S32 version = 0;
3788 instream.getline(tbuf, MAX_STRING); 3788 instream.getline(tbuf, MAX_STRING);
@@ -3822,11 +3822,16 @@ BOOL LLTextEditor::importBuffer(const LLString& buffer )
3822 BOOL success = TRUE; 3822 BOOL success = TRUE;
3823 3823
3824 char* text = new char[ text_len + 1]; 3824 char* text = new char[ text_len + 1];
3825 if (text == NULL)
3826 {
3827 llerrs << "Memory allocation failure." << llendl;
3828 return FALSE;
3829 }
3825 instream.get(text, text_len + 1, '\0'); 3830 instream.get(text, text_len + 1, '\0');
3826 text[text_len] = '\0'; 3831 text[text_len] = '\0';
3827 if( text_len != (S32)strlen(text) ) 3832 if( text_len != (S32)strlen(text) )/* Flawfinder: ignore */
3828 { 3833 {
3829 llwarns << llformat("Invalid text length: %d != %d ",strlen(text),text_len) << llendl; 3834 llwarns << llformat("Invalid text length: %d != %d ",strlen(text),text_len) << llendl;/* Flawfinder: ignore */
3830 success = FALSE; 3835 success = FALSE;
3831 } 3836 }
3832 3837
@@ -3948,6 +3953,8 @@ LLXMLNodePtr LLTextEditor::getXML(bool save_children) const
3948 3953
3949 node->createChild("word_wrap", TRUE)->setBoolValue(mWordWrap); 3954 node->createChild("word_wrap", TRUE)->setBoolValue(mWordWrap);
3950 3955
3956 node->createChild("hide_scrollbar", TRUE)->setBoolValue(mHideScrollbarForShortDocs);
3957
3951 addColorXML(node, mCursorColor, "cursor_color", "TextCursorColor"); 3958 addColorXML(node, mCursorColor, "cursor_color", "TextCursorColor");
3952 addColorXML(node, mFgColor, "text_color", "TextFgColor"); 3959 addColorXML(node, mFgColor, "text_color", "TextFgColor");
3953 addColorXML(node, mReadOnlyFgColor, "text_readonly_color", "TextFgReadOnlyColor"); 3960 addColorXML(node, mReadOnlyFgColor, "text_readonly_color", "TextFgReadOnlyColor");
diff --git a/linden/indra/llui/llui.cpp b/linden/indra/llui/llui.cpp
index c62f353..61dede2 100644
--- a/linden/indra/llui/llui.cpp
+++ b/linden/indra/llui/llui.cpp
@@ -1497,7 +1497,7 @@ void load_tr(const LLString& lang)
1497 LLString filename = gDirUtilp->getExpandedFilename(LL_PATH_SKINS, inname.c_str()); 1497 LLString filename = gDirUtilp->getExpandedFilename(LL_PATH_SKINS, inname.c_str());
1498 1498
1499 llifstream file; 1499 llifstream file;
1500 file.open(filename.c_str(), std::ios_base::binary); 1500 file.open(filename.c_str(), std::ios_base::binary); /* Flawfinder: ignore */
1501 if (!file) 1501 if (!file)
1502 { 1502 {
1503 llinfos << "No translation dictionary for: " << filename << llendl; 1503 llinfos << "No translation dictionary for: " << filename << llendl;
@@ -1510,7 +1510,7 @@ void load_tr(const LLString& lang)
1510 gUntranslated.clear(); 1510 gUntranslated.clear();
1511 1511
1512 const S32 MAX_LINE_LEN = 1024; 1512 const S32 MAX_LINE_LEN = 1024;
1513 char buffer[MAX_LINE_LEN]; 1513 char buffer[MAX_LINE_LEN]; /* Flawfinder: ignore */
1514 while (!file.eof()) 1514 while (!file.eof())
1515 { 1515 {
1516 file.getline(buffer, MAX_LINE_LEN); 1516 file.getline(buffer, MAX_LINE_LEN);
@@ -1550,7 +1550,7 @@ void cleanup_tr()
1550 LLString outname = "untranslated_" + gLanguage + ".txt"; 1550 LLString outname = "untranslated_" + gLanguage + ".txt";
1551 LLString outfilename = gDirUtilp->getExpandedFilename(LL_PATH_SKINS, outname.c_str()); 1551 LLString outfilename = gDirUtilp->getExpandedFilename(LL_PATH_SKINS, outname.c_str());
1552 llofstream outfile; 1552 llofstream outfile;
1553 outfile.open(outfilename.c_str()); 1553 outfile.open(outfilename.c_str()); /* Flawfinder: ignore */
1554 if (!outfile) 1554 if (!outfile)
1555 { 1555 {
1556 return; 1556 return;
diff --git a/linden/indra/llui/llui_vc8.vcproj b/linden/indra/llui/llui_vc8.vcproj
new file mode 100644
index 0000000..a78c71c
--- /dev/null
+++ b/linden/indra/llui/llui_vc8.vcproj
@@ -0,0 +1,588 @@
1<?xml version="1.0" encoding="Windows-1252"?>
2<VisualStudioProject
3 ProjectType="Visual C++"
4 Version="8.00"
5 Name="llui"
6 ProjectGUID="{DE55D666-6A3D-476C-937F-109269B83681}"
7 Keyword="Win32Proj"
8 >
9 <Platforms>
10 <Platform
11 Name="Win32"
12 />
13 </Platforms>
14 <ToolFiles>
15 </ToolFiles>
16 <Configurations>
17 <Configuration
18 Name="Debug|Win32"
19 OutputDirectory="../lib_$(ConfigurationName)/i686-win32"
20 IntermediateDirectory="Debug"
21 ConfigurationType="4"
22 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
23 CharacterSet="1"
24 >
25 <Tool
26 Name="VCPreBuildEventTool"
27 />
28 <Tool
29 Name="VCCustomBuildTool"
30 />
31 <Tool
32 Name="VCXMLDataGeneratorTool"
33 />
34 <Tool
35 Name="VCWebServiceProxyGeneratorTool"
36 />
37 <Tool
38 Name="VCMIDLTool"
39 />
40 <Tool
41 Name="VCCLCompilerTool"
42 Optimization="0"
43 AdditionalIncludeDirectories="..\llmath;..\llvfs;..\llcommon;..\llprimitive;..\llwindow;..\llrender;..\llimage;..\llaudio;..\llxml;..\llmessage;&quot;..\..\libraries\i686-win32\include&quot;;..\..\libraries\include\"
44 PreprocessorDefinitions="WIN32;_DEBUG;_LIB;LL_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;LL_DEBUG"
45 MinimalRebuild="true"
46 BasicRuntimeChecks="3"
47 RuntimeLibrary="1"
48 StructMemberAlignment="4"
49 TreatWChar_tAsBuiltInType="false"
50 ForceConformanceInForLoopScope="true"
51 UsePrecompiledHeader="0"
52 WarningLevel="3"
53 WarnAsError="true"
54 Detect64BitPortabilityProblems="false"
55 DebugInformationFormat="4"
56 />
57 <Tool
58 Name="VCManagedResourceCompilerTool"
59 />
60 <Tool
61 Name="VCResourceCompilerTool"
62 />
63 <Tool
64 Name="VCPreLinkEventTool"
65 />
66 <Tool
67 Name="VCLibrarianTool"
68 OutputFile="$(OutDir)/llui.lib"
69 />
70 <Tool
71 Name="VCALinkTool"
72 />
73 <Tool
74 Name="VCXDCMakeTool"
75 />
76 <Tool
77 Name="VCBscMakeTool"
78 />
79 <Tool
80 Name="VCFxCopTool"
81 />
82 <Tool
83 Name="VCPostBuildEventTool"
84 />
85 </Configuration>
86 <Configuration
87 Name="Release|Win32"
88 OutputDirectory="../lib_$(ConfigurationName)/i686-win32"
89 IntermediateDirectory="Release"
90 ConfigurationType="4"
91 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
92 CharacterSet="1"
93 >
94 <Tool
95 Name="VCPreBuildEventTool"
96 />
97 <Tool
98 Name="VCCustomBuildTool"
99 />
100 <Tool
101 Name="VCXMLDataGeneratorTool"
102 />
103 <Tool
104 Name="VCWebServiceProxyGeneratorTool"
105 />
106 <Tool
107 Name="VCMIDLTool"
108 />
109 <Tool
110 Name="VCCLCompilerTool"
111 AdditionalIncludeDirectories="..\llmath;..\llvfs;..\llcommon;..\llprimitive;..\llwindow;..\llrender;..\llimage;..\llaudio;..\llxml;..\llmessage;&quot;..\..\libraries\i686-win32\include&quot;;..\..\libraries\include\"
112 PreprocessorDefinitions="WIN32;NDEBUG;_LIB;LL_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;LL_RELEASE"
113 RuntimeLibrary="0"
114 StructMemberAlignment="0"
115 TreatWChar_tAsBuiltInType="false"
116 ForceConformanceInForLoopScope="true"
117 UsePrecompiledHeader="0"
118 WarningLevel="3"
119 WarnAsError="true"
120 Detect64BitPortabilityProblems="false"
121 DebugInformationFormat="3"
122 />
123 <Tool
124 Name="VCManagedResourceCompilerTool"
125 />
126 <Tool
127 Name="VCResourceCompilerTool"
128 />
129 <Tool
130 Name="VCPreLinkEventTool"
131 />
132 <Tool
133 Name="VCLibrarianTool"
134 OutputFile="$(OutDir)/llui.lib"
135 />
136 <Tool
137 Name="VCALinkTool"
138 />
139 <Tool
140 Name="VCXDCMakeTool"
141 />
142 <Tool
143 Name="VCBscMakeTool"
144 />
145 <Tool
146 Name="VCFxCopTool"
147 />
148 <Tool
149 Name="VCPostBuildEventTool"
150 />
151 </Configuration>
152 <Configuration
153 Name="ReleaseNoOpt|Win32"
154 OutputDirectory="../lib_$(ConfigurationName)/i686-win32"
155 IntermediateDirectory="$(ConfigurationName)"
156 ConfigurationType="4"
157 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
158 CharacterSet="1"
159 >
160 <Tool
161 Name="VCPreBuildEventTool"
162 />
163 <Tool
164 Name="VCCustomBuildTool"
165 />
166 <Tool
167 Name="VCXMLDataGeneratorTool"
168 />
169 <Tool
170 Name="VCWebServiceProxyGeneratorTool"
171 />
172 <Tool
173 Name="VCMIDLTool"
174 />
175 <Tool
176 Name="VCCLCompilerTool"
177 Optimization="0"
178 AdditionalIncludeDirectories="..\llmath;..\llvfs;..\llcommon;..\llprimitive;..\llwindow;..\llrender;..\llimage;..\llaudio;..\llxml;..\llmessage;&quot;..\..\libraries\i686-win32\include&quot;;..\..\libraries\include\"
179 PreprocessorDefinitions="WIN32;NDEBUG;_LIB;LL_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;LL_RELEASE"
180 RuntimeLibrary="0"
181 StructMemberAlignment="0"
182 TreatWChar_tAsBuiltInType="false"
183 ForceConformanceInForLoopScope="true"
184 UsePrecompiledHeader="0"
185 WarningLevel="3"
186 WarnAsError="true"
187 Detect64BitPortabilityProblems="false"
188 DebugInformationFormat="3"
189 />
190 <Tool
191 Name="VCManagedResourceCompilerTool"
192 />
193 <Tool
194 Name="VCResourceCompilerTool"
195 />
196 <Tool
197 Name="VCPreLinkEventTool"
198 />
199 <Tool
200 Name="VCLibrarianTool"
201 OutputFile="$(OutDir)/llui.lib"
202 />
203 <Tool
204 Name="VCALinkTool"
205 />
206 <Tool
207 Name="VCXDCMakeTool"
208 />
209 <Tool
210 Name="VCBscMakeTool"
211 />
212 <Tool
213 Name="VCFxCopTool"
214 />
215 <Tool
216 Name="VCPostBuildEventTool"
217 />
218 </Configuration>
219 </Configurations>
220 <References>
221 </References>
222 <Files>
223 <Filter
224 Name="Source Files"
225 Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
226 UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
227 >
228 <File
229 RelativePath=".\llalertdialog.cpp"
230 >
231 </File>
232 <File
233 RelativePath=".\llbutton.cpp"
234 >
235 </File>
236 <File
237 RelativePath=".\llcheckboxctrl.cpp"
238 >
239 </File>
240 <File
241 RelativePath=".\llclipboard.cpp"
242 >
243 </File>
244 <File
245 RelativePath=".\llcombobox.cpp"
246 >
247 </File>
248 <File
249 RelativePath=".\llctrlselectioninterface.cpp"
250 >
251 </File>
252 <File
253 RelativePath=".\lldraghandle.cpp"
254 >
255 </File>
256 <File
257 RelativePath=".\lleditmenuhandler.cpp"
258 >
259 </File>
260 <File
261 RelativePath=".\llfloater.cpp"
262 >
263 </File>
264 <File
265 RelativePath=".\llfocusmgr.cpp"
266 >
267 </File>
268 <File
269 RelativePath=".\lliconctrl.cpp"
270 >
271 </File>
272 <File
273 RelativePath=".\llkeywords.cpp"
274 >
275 </File>
276 <File
277 RelativePath=".\lllineeditor.cpp"
278 >
279 </File>
280 <File
281 RelativePath=".\llmenugl.cpp"
282 >
283 </File>
284 <File
285 RelativePath=".\llmodaldialog.cpp"
286 >
287 </File>
288 <File
289 RelativePath=".\llpanel.cpp"
290 >
291 </File>
292 <File
293 RelativePath=".\llradiogroup.cpp"
294 >
295 </File>
296 <File
297 RelativePath=".\llresizebar.cpp"
298 >
299 </File>
300 <File
301 RelativePath=".\llresizehandle.cpp"
302 >
303 </File>
304 <File
305 RelativePath=".\llresmgr.cpp"
306 >
307 </File>
308 <File
309 RelativePath=".\llrootview.cpp"
310 >
311 </File>
312 <File
313 RelativePath=".\llscrollbar.cpp"
314 >
315 </File>
316 <File
317 RelativePath=".\llscrollcontainer.cpp"
318 >
319 </File>
320 <File
321 RelativePath=".\llscrollingpanellist.cpp"
322 >
323 </File>
324 <File
325 RelativePath=".\llscrolllistctrl.cpp"
326 >
327 </File>
328 <File
329 RelativePath=".\llslider.cpp"
330 >
331 </File>
332 <File
333 RelativePath=".\llsliderctrl.cpp"
334 >
335 </File>
336 <File
337 RelativePath=".\llspinctrl.cpp"
338 >
339 </File>
340 <File
341 RelativePath=".\llstyle.cpp"
342 >
343 </File>
344 <File
345 RelativePath=".\lltabcontainer.cpp"
346 >
347 </File>
348 <File
349 RelativePath=".\lltabcontainervertical.cpp"
350 >
351 </File>
352 <File
353 RelativePath=".\lltextbox.cpp"
354 >
355 </File>
356 <File
357 RelativePath=".\lltexteditor.cpp"
358 >
359 </File>
360 <File
361 RelativePath=".\llui.cpp"
362 >
363 </File>
364 <File
365 RelativePath=".\lluictrl.cpp"
366 >
367 </File>
368 <File
369 RelativePath=".\lluictrlfactory.cpp"
370 >
371 </File>
372 <File
373 RelativePath=".\lluistring.cpp"
374 >
375 </File>
376 <File
377 RelativePath=".\llundo.cpp"
378 >
379 </File>
380 <File
381 RelativePath=".\llview.cpp"
382 >
383 </File>
384 <File
385 RelativePath=".\llviewborder.cpp"
386 >
387 </File>
388 <File
389 RelativePath=".\llviewquery.cpp"
390 >
391 </File>
392 </Filter>
393 <Filter
394 Name="Header Files"
395 Filter="h;hpp;hxx;hm;inl;inc;xsd"
396 UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
397 >
398 <File
399 RelativePath=".\llalertdialog.h"
400 >
401 </File>
402 <File
403 RelativePath=".\llbutton.h"
404 >
405 </File>
406 <File
407 RelativePath=".\llcallbackmap.h"
408 >
409 </File>
410 <File
411 RelativePath=".\llcheckboxctrl.h"
412 >
413 </File>
414 <File
415 RelativePath=".\llclipboard.h"
416 >
417 </File>
418 <File
419 RelativePath=".\llcombobox.h"
420 >
421 </File>
422 <File
423 RelativePath=".\llctrlselectioninterface.h"
424 >
425 </File>
426 <File
427 RelativePath=".\lldraghandle.h"
428 >
429 </File>
430 <File
431 RelativePath=".\lleditmenuhandler.h"
432 >
433 </File>
434 <File
435 RelativePath=".\llfloater.h"
436 >
437 </File>
438 <File
439 RelativePath=".\llfocusmgr.h"
440 >
441 </File>
442 <File
443 RelativePath=".\lliconctrl.h"
444 >
445 </File>
446 <File
447 RelativePath=".\llkeywords.h"
448 >
449 </File>
450 <File
451 RelativePath=".\lllineeditor.h"
452 >
453 </File>
454 <File
455 RelativePath=".\llmemberlistener.h"
456 >
457 </File>
458 <File
459 RelativePath=".\llmenugl.h"
460 >
461 </File>
462 <File
463 RelativePath=".\llmodaldialog.h"
464 >
465 </File>
466 <File
467 RelativePath=".\llpanel.h"
468 >
469 </File>
470 <File
471 RelativePath=".\llradiogroup.h"
472 >
473 </File>
474 <File
475 RelativePath=".\llresizebar.h"
476 >
477 </File>
478 <File
479 RelativePath=".\llresizehandle.h"
480 >
481 </File>
482 <File
483 RelativePath=".\llresmgr.h"
484 >
485 </File>
486 <File
487 RelativePath=".\llrootview.h"
488 >
489 </File>
490 <File
491 RelativePath=".\llscrollbar.h"
492 >
493 </File>
494 <File
495 RelativePath=".\llscrollcontainer.h"
496 >
497 </File>
498 <File
499 RelativePath=".\llscrollingpanellist.h"
500 >
501 </File>
502 <File
503 RelativePath=".\llscrolllistctrl.h"
504 >
505 </File>
506 <File
507 RelativePath=".\llslider.h"
508 >
509 </File>
510 <File
511 RelativePath=".\llsliderctrl.h"
512 >
513 </File>
514 <File
515 RelativePath=".\llspinctrl.h"
516 >
517 </File>
518 <File
519 RelativePath=".\llstyle.h"
520 >
521 </File>
522 <File
523 RelativePath=".\lltabcontainer.h"
524 >
525 </File>
526 <File
527 RelativePath=".\lltabcontainervertical.h"
528 >
529 </File>
530 <File
531 RelativePath=".\lltextbox.h"
532 >
533 </File>
534 <File
535 RelativePath=".\lltexteditor.h"
536 >
537 </File>
538 <File
539 RelativePath=".\llui.h"
540 >
541 </File>
542 <File
543 RelativePath=".\lluiconstants.h"
544 >
545 </File>
546 <File
547 RelativePath=".\lluictrl.h"
548 >
549 </File>
550 <File
551 RelativePath=".\lluictrlfactory.h"
552 >
553 </File>
554 <File
555 RelativePath=".\lluistring.h"
556 >
557 </File>
558 <File
559 RelativePath=".\lluixmltags.h"
560 >
561 </File>
562 <File
563 RelativePath=".\llundo.h"
564 >
565 </File>
566 <File
567 RelativePath=".\llview.h"
568 >
569 </File>
570 <File
571 RelativePath=".\llviewborder.h"
572 >
573 </File>
574 <File
575 RelativePath=".\llviewquery.h"
576 >
577 </File>
578 </Filter>
579 <Filter
580 Name="Resource Files"
581 Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
582 UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
583 >
584 </Filter>
585 </Files>
586 <Globals>
587 </Globals>
588</VisualStudioProject>
diff --git a/linden/indra/llui/lluictrl.h b/linden/indra/llui/lluictrl.h
index 7f48378..47b5d66 100644
--- a/linden/indra/llui/lluictrl.h
+++ b/linden/indra/llui/lluictrl.h
@@ -36,7 +36,6 @@
36// 36//
37// Classes 37// Classes
38// 38//
39class LLViewerImage;
40class LLFontGL; 39class LLFontGL;
41class LLButton; 40class LLButton;
42class LLTextBox; 41class LLTextBox;
diff --git a/linden/indra/llui/lluictrlfactory.cpp b/linden/indra/llui/lluictrlfactory.cpp
index 5a35783..77ef749 100644
--- a/linden/indra/llui/lluictrlfactory.cpp
+++ b/linden/indra/llui/lluictrlfactory.cpp
@@ -210,12 +210,18 @@ LLUICtrlFactory::LLUICtrlFactory()
210 LLUICtrlCreator<LLMenuBarGL>::registerCreator(LL_MENU_BAR_GL_TAG, this); 210 LLUICtrlCreator<LLMenuBarGL>::registerCreator(LL_MENU_BAR_GL_TAG, this);
211 LLUICtrlCreator<LLScrollingPanelList>::registerCreator(LL_SCROLLING_PANEL_LIST_TAG, this); 211 LLUICtrlCreator<LLScrollingPanelList>::registerCreator(LL_SCROLLING_PANEL_LIST_TAG, this);
212 212
213 setupPaths();
213 214
215}
216
217void LLUICtrlFactory::setupPaths()
218{
214 LLString filename = gDirUtilp->getExpandedFilename(LL_PATH_SKINS, "paths.xml"); 219 LLString filename = gDirUtilp->getExpandedFilename(LL_PATH_SKINS, "paths.xml");
215 220
216 LLXMLNodePtr root; 221 LLXMLNodePtr root;
217 BOOL success = LLXMLNode::parseFile(filename, root, NULL); 222 BOOL success = LLXMLNode::parseFile(filename, root, NULL);
218 223 mXUIPaths.clear();
224
219 if (!success) 225 if (!success)
220 { 226 {
221 LLString slash = gDirUtilp->getDirDelimiter(); 227 LLString slash = gDirUtilp->getDirDelimiter();
@@ -239,7 +245,7 @@ LLUICtrlFactory::LLUICtrlFactory()
239 path_val_ui.setArg("[Language]", language); 245 path_val_ui.setArg("[Language]", language);
240 LLString fullpath = app_dir + path_val_ui.getString(); 246 LLString fullpath = app_dir + path_val_ui.getString();
241 247
242 if (mXUIPaths.empty() || (find(mXUIPaths.begin(), mXUIPaths.end(), fullpath) == mXUIPaths.end()) ) 248 if (std::find(mXUIPaths.begin(), mXUIPaths.end(), fullpath) == mXUIPaths.end())
243 { 249 {
244 mXUIPaths.push_back(app_dir + path_val_ui.getString()); 250 mXUIPaths.push_back(app_dir + path_val_ui.getString());
245 } 251 }
@@ -297,7 +303,7 @@ bool LLUICtrlFactory::getLayeredXMLNode(const LLString &filename, LLXMLNodePtr&
297// buildFloater() 303// buildFloater()
298//----------------------------------------------------------------------------- 304//-----------------------------------------------------------------------------
299void LLUICtrlFactory::buildFloater(LLFloater* floaterp, const LLString &filename, 305void LLUICtrlFactory::buildFloater(LLFloater* floaterp, const LLString &filename,
300 const LLCallbackMap::map_t* factory_map, BOOL open) 306 const LLCallbackMap::map_t* factory_map, BOOL open) /* Flawfinder: ignore */
301{ 307{
302 LLXMLNodePtr root; 308 LLXMLNodePtr root;
303 309
@@ -318,7 +324,7 @@ void LLUICtrlFactory::buildFloater(LLFloater* floaterp, const LLString &filename
318 mFactoryStack.push_front(factory_map); 324 mFactoryStack.push_front(factory_map);
319 } 325 }
320 326
321 floaterp->initFloaterXML(root, NULL, this, open); 327 floaterp->initFloaterXML(root, NULL, this, open); /* Flawfinder: ignore */
322 328
323 if (LLUI::sShowXUINames) 329 if (LLUI::sShowXUINames)
324 { 330 {
diff --git a/linden/indra/llui/lluictrlfactory.h b/linden/indra/llui/lluictrlfactory.h
index ed2a396..b96dc5d 100644
--- a/linden/indra/llui/lluictrlfactory.h
+++ b/linden/indra/llui/lluictrlfactory.h
@@ -74,6 +74,8 @@ public:
74 // do not call! needs to be public so run-time can clean up the singleton 74 // do not call! needs to be public so run-time can clean up the singleton
75 virtual ~LLUICtrlFactory(); 75 virtual ~LLUICtrlFactory();
76 76
77 void setupPaths();
78
77 void buildFloater(LLFloater* floaterp, const LLString &filename, 79 void buildFloater(LLFloater* floaterp, const LLString &filename,
78 const LLCallbackMap::map_t* factory_map = NULL, BOOL open = TRUE); 80 const LLCallbackMap::map_t* factory_map = NULL, BOOL open = TRUE);
79 81
diff --git a/linden/indra/llui/llview.cpp b/linden/indra/llui/llview.cpp
index ab06c0f..13f1ddc 100644
--- a/linden/indra/llui/llview.cpp
+++ b/linden/indra/llui/llview.cpp
@@ -51,7 +51,6 @@
51BOOL LLView::sDebugRects = FALSE; 51BOOL LLView::sDebugRects = FALSE;
52BOOL LLView::sDebugKeys = FALSE; 52BOOL LLView::sDebugKeys = FALSE;
53S32 LLView::sDepth = 0; 53S32 LLView::sDepth = 0;
54LLView* LLView::sFastFrameView = NULL;
55BOOL LLView::sDebugMouseHandling = FALSE; 54BOOL LLView::sDebugMouseHandling = FALSE;
56LLString LLView::sMouseHandlerMessage; 55LLString LLView::sMouseHandlerMessage;
57S32 LLView::sSelectID = GL_NAME_UI_RESERVED; 56S32 LLView::sSelectID = GL_NAME_UI_RESERVED;
@@ -112,7 +111,6 @@ LLView::LLView() :
112 mSaveToXML(TRUE), 111 mSaveToXML(TRUE),
113 mIsFocusRoot(FALSE), 112 mIsFocusRoot(FALSE),
114 mLastVisible(TRUE), 113 mLastVisible(TRUE),
115 mRenderInFastFrame(TRUE),
116 mSpanChildren(FALSE), 114 mSpanChildren(FALSE),
117 mVisible(TRUE), 115 mVisible(TRUE),
118 mHidden(FALSE), 116 mHidden(FALSE),
@@ -133,7 +131,6 @@ LLView::LLView(const LLString& name, BOOL mouse_opaque) :
133 mSaveToXML(TRUE), 131 mSaveToXML(TRUE),
134 mIsFocusRoot(FALSE), 132 mIsFocusRoot(FALSE),
135 mLastVisible(TRUE), 133 mLastVisible(TRUE),
136 mRenderInFastFrame(TRUE),
137 mSpanChildren(FALSE), 134 mSpanChildren(FALSE),
138 mVisible(TRUE), 135 mVisible(TRUE),
139 mHidden(FALSE), 136 mHidden(FALSE),
@@ -157,7 +154,6 @@ LLView::LLView(
157 mSaveToXML(TRUE), 154 mSaveToXML(TRUE),
158 mIsFocusRoot(FALSE), 155 mIsFocusRoot(FALSE),
159 mLastVisible(TRUE), 156 mLastVisible(TRUE),
160 mRenderInFastFrame(TRUE),
161 mSpanChildren(FALSE), 157 mSpanChildren(FALSE),
162 mVisible(TRUE), 158 mVisible(TRUE),
163 mHidden(FALSE), 159 mHidden(FALSE),
@@ -199,11 +195,6 @@ LLView::~LLView()
199 mParentView->removeChild(this); 195 mParentView->removeChild(this);
200 } 196 }
201 197
202 if(LLView::sFastFrameView == this)
203 {
204 LLView::sFastFrameView = NULL;
205 }
206
207 dispatch_list_t::iterator itor; 198 dispatch_list_t::iterator itor;
208 for (itor = mDispatchList.begin(); itor != mDispatchList.end(); ++itor) 199 for (itor = mDispatchList.begin(); itor != mDispatchList.end(); ++itor)
209 { 200 {
@@ -1789,26 +1780,6 @@ void LLView::localRectToScreen(const LLRect& local, LLRect* screen) const
1789 } 1780 }
1790} 1781}
1791 1782
1792LLView* LLView::getRootMostFastFrameView()
1793{
1794 if (gFocusMgr.getTopView() == this)
1795 {
1796 return this;
1797 }
1798
1799 if (getParent())
1800 {
1801 LLView* rootmost_view = getParent()->getRootMostFastFrameView();
1802 if (rootmost_view)
1803 {
1804 return rootmost_view;
1805 }
1806 }
1807
1808 return mRenderInFastFrame ? this : NULL;
1809}
1810
1811
1812LLView* LLView::getRootView() 1783LLView* LLView::getRootView()
1813{ 1784{
1814 LLView* view = this; 1785 LLView* view = this;
diff --git a/linden/indra/llui/llview.h b/linden/indra/llui/llview.h
index 268f157..3885789 100644
--- a/linden/indra/llui/llview.h
+++ b/linden/indra/llui/llview.h
@@ -164,7 +164,6 @@ protected:
164public: 164public:
165 LLViewHandle mViewHandle; 165 LLViewHandle mViewHandle;
166 BOOL mLastVisible; 166 BOOL mLastVisible;
167 BOOL mRenderInFastFrame;
168 BOOL mSpanChildren; 167 BOOL mSpanChildren;
169 168
170private: 169private:
@@ -180,7 +179,6 @@ public:
180 static BOOL sDebugRects; // Draw debug rects behind everything. 179 static BOOL sDebugRects; // Draw debug rects behind everything.
181 static BOOL sDebugKeys; 180 static BOOL sDebugKeys;
182 static S32 sDepth; 181 static S32 sDepth;
183 static LLView* sFastFrameView;
184 static BOOL sDebugMouseHandling; 182 static BOOL sDebugMouseHandling;
185 static LLString sMouseHandlerMessage; 183 static LLString sMouseHandlerMessage;
186 static S32 sSelectID; 184 static S32 sSelectID;
@@ -338,8 +336,8 @@ public:
338 virtual void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE); 336 virtual void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE);
339 337
340 virtual void translate( S32 x, S32 y ); 338 virtual void translate( S32 x, S32 y );
339 virtual void setOrigin( S32 x, S32 y ) { mRect.translate( x - mRect.mLeft, y - mRect.mBottom ); }
341 BOOL translateIntoRect( const LLRect& constraint, BOOL allow_partial_outside ); 340 BOOL translateIntoRect( const LLRect& constraint, BOOL allow_partial_outside );
342 void setOrigin( S32 x, S32 y ) { mRect.translate( x - mRect.mLeft, y - mRect.mBottom ); }
343 LLView* findSnapRect(LLRect& new_rect, const LLCoordGL& mouse_dir, LLView::ESnapType snap_type, S32 threshold, S32 padding = 0); 341 LLView* findSnapRect(LLRect& new_rect, const LLCoordGL& mouse_dir, LLView::ESnapType snap_type, S32 threshold, S32 padding = 0);
344 LLView* findSnapEdge(S32& new_edge_val, const LLCoordGL& mouse_dir, ESnapEdge snap_edge, ESnapType snap_type, S32 threshold, S32 padding = 0); 342 LLView* findSnapEdge(S32& new_edge_val, const LLCoordGL& mouse_dir, ESnapEdge snap_edge, ESnapType snap_type, S32 threshold, S32 padding = 0);
345 343
@@ -437,8 +435,6 @@ public:
437 virtual void localRectToScreen( const LLRect& local, LLRect* screen ) const; 435 virtual void localRectToScreen( const LLRect& local, LLRect* screen ) const;
438 virtual BOOL localRectToOtherView( const LLRect& local, LLRect* other, LLView* other_view ) const; 436 virtual BOOL localRectToOtherView( const LLRect& local, LLRect* other, LLView* other_view ) const;
439 437
440 void setRenderInFastFrame(BOOL render) { mRenderInFastFrame = render; }
441 virtual LLView* getRootMostFastFrameView();
442 438
443 static LLWindow* getWindow(void); 439 static LLWindow* getWindow(void);
444 440
diff --git a/linden/indra/llui/llviewquery.cpp b/linden/indra/llui/llviewquery.cpp
index 4867116..89b2192 100644
--- a/linden/indra/llui/llviewquery.cpp
+++ b/linden/indra/llui/llviewquery.cpp
@@ -1,8 +1,8 @@
1/** 1/**
2 * @file llviewquery.cpp 2 * @file llviewquery.cpp
3 * @brief Implementation of view query class. 3 * @brief Implementation of view query class.
4 * 4 *
5 * Copyright (c) 2001-2007, Linden Research, Inc. 5 * Copyright (c) 2001-2007, Linden Research, Inc.
6 * 6 *
7 * The source code in this file ("Source Code") is provided by Linden Lab 7 * The source code in this file ("Source Code") is provided by Linden Lab
8 * to you under the terms of the GNU General Public License, version 2.0 8 * to you under the terms of the GNU General Public License, version 2.0
@@ -22,124 +22,124 @@
22 * 22 *
23 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO 23 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
24 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, 24 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
25 * COMPLETENESS OR PERFORMANCE. 25 * COMPLETENESS OR PERFORMANCE.
26 */ 26 */
27 27
28#include "llview.h" 28#include "llview.h"
29#include "lluictrl.h" 29#include "lluictrl.h"
30#include "llviewquery.h" 30#include "llviewquery.h"
31 31
32void LLQuerySorter::operator() (LLView * parent, viewList_t &children) const {} 32void LLQuerySorter::operator() (LLView * parent, viewList_t &children) const {}
33 33
34filterResult_t LLNoLeavesFilter::operator() (const LLView* const view, const viewList_t & children) const 34filterResult_t LLNoLeavesFilter::operator() (const LLView* const view, const viewList_t & children) const
35{ 35{
36 return filterResult_t(!(view->getChildList()->size() == 0), TRUE); 36 return filterResult_t(!(view->getChildList()->size() == 0), TRUE);
37} 37}
38 38
39filterResult_t LLVisibleFilter::operator() (const LLView* const view, const viewList_t & children) const 39filterResult_t LLVisibleFilter::operator() (const LLView* const view, const viewList_t & children) const
40{ 40{
41 return filterResult_t(view->getVisible(), view->getVisible()); 41 return filterResult_t(view->getVisible(), view->getVisible());
42} 42}
43filterResult_t LLEnabledFilter::operator() (const LLView* const view, const viewList_t & children) const 43filterResult_t LLEnabledFilter::operator() (const LLView* const view, const viewList_t & children) const
44{ 44{
45 return filterResult_t(view->getEnabled(), view->getEnabled()); 45 return filterResult_t(view->getEnabled(), view->getEnabled());
46} 46}
47filterResult_t LLTabStopFilter::operator() (const LLView* const view, const viewList_t & children) const 47filterResult_t LLTabStopFilter::operator() (const LLView* const view, const viewList_t & children) const
48{ 48{
49 return filterResult_t(view->isCtrl() && static_cast<const LLUICtrl* const>(view)->hasTabStop(), 49 return filterResult_t(view->isCtrl() && static_cast<const LLUICtrl* const>(view)->hasTabStop(),
50 view->canFocusChildren()); 50 view->canFocusChildren());
51} 51}
52 52
53// LLViewQuery 53// LLViewQuery
54 54
55LLViewQuery::LLViewQuery(): mPreFilters(), mPostFilters(), mSorterp() 55LLViewQuery::LLViewQuery(): mPreFilters(), mPostFilters(), mSorterp()
56{ 56{
57} 57}
58 58
59void LLViewQuery::addPreFilter(const LLQueryFilter* prefilter) { mPreFilters.push_back(prefilter); } 59void LLViewQuery::addPreFilter(const LLQueryFilter* prefilter) { mPreFilters.push_back(prefilter); }
60 60
61void LLViewQuery::addPostFilter(const LLQueryFilter* postfilter) { mPostFilters.push_back(postfilter); } 61void LLViewQuery::addPostFilter(const LLQueryFilter* postfilter) { mPostFilters.push_back(postfilter); }
62 62
63const LLViewQuery::filterList_t & LLViewQuery::getPreFilters() const { return mPreFilters; } 63const LLViewQuery::filterList_t & LLViewQuery::getPreFilters() const { return mPreFilters; }
64 64
65const LLViewQuery::filterList_t & LLViewQuery::getPostFilters() const { return mPostFilters; } 65const LLViewQuery::filterList_t & LLViewQuery::getPostFilters() const { return mPostFilters; }
66 66
67void LLViewQuery::setSorter(const LLQuerySorter* sorterp) { mSorterp = sorterp; } 67void LLViewQuery::setSorter(const LLQuerySorter* sorterp) { mSorterp = sorterp; }
68const LLQuerySorter* LLViewQuery::getSorter() const { return mSorterp; } 68const LLQuerySorter* LLViewQuery::getSorter() const { return mSorterp; }
69 69
70viewList_t LLViewQuery::run(LLView * view) const 70viewList_t LLViewQuery::run(LLView * view) const
71{ 71{
72 viewList_t result; 72 viewList_t result;
73 73
74 filterResult_t pre = runFilters(view, viewList_t(), mPreFilters); 74 filterResult_t pre = runFilters(view, viewList_t(), mPreFilters);
75 if(!pre.first && !pre.second) 75 if(!pre.first && !pre.second)
76 { 76 {
77 // skip post filters completely if we're not including ourselves or the children 77 // skip post filters completely if we're not including ourselves or the children
78 return result; 78 return result;
79 } 79 }
80 if(pre.second) 80 if(pre.second)
81 { 81 {
82 // run filters on children 82 // run filters on children
83 viewList_t filtered_children; 83 viewList_t filtered_children;
84 filterChildren(view, filtered_children); 84 filterChildren(view, filtered_children);
85 filterResult_t post = runFilters(view, filtered_children, mPostFilters); 85 filterResult_t post = runFilters(view, filtered_children, mPostFilters);
86 if(pre.first && post.first) 86 if(pre.first && post.first)
87 { 87 {
88 result.push_back(view); 88 result.push_back(view);
89 } 89 }
90 if(post.second) 90 if(post.second)
91 { 91 {
92 result.insert(result.end(), filtered_children.begin(), filtered_children.end()); 92 result.insert(result.end(), filtered_children.begin(), filtered_children.end());
93 } 93 }
94 } 94 }
95 else 95 else
96 { 96 {
97 if(pre.first) 97 if(pre.first)
98 { 98 {
99 result.push_back(view); 99 result.push_back(view);
100 } 100 }
101 } 101 }
102 return result; 102 return result;
103} 103}
104 104
105void LLViewQuery::filterChildren(LLView * view, viewList_t & filtered_children) const 105void LLViewQuery::filterChildren(LLView * view, viewList_t & filtered_children) const
106{ 106{
107 LLView::child_list_t views(*(view->getChildList())); 107 LLView::child_list_t views(*(view->getChildList()));
108 (*mSorterp)(view, views); // sort the children per the sorter 108 (*mSorterp)(view, views); // sort the children per the sorter
109 for(LLView::child_list_iter_t iter = views.begin(); 109 for(LLView::child_list_iter_t iter = views.begin();
110 iter != views.end(); 110 iter != views.end();
111 iter++) 111 iter++)
112 { 112 {
113 viewList_t indiv_children = this->run(*iter); 113 viewList_t indiv_children = this->run(*iter);
114 filtered_children.insert(filtered_children.end(), indiv_children.begin(), indiv_children.end()); 114 filtered_children.insert(filtered_children.end(), indiv_children.begin(), indiv_children.end());
115 } 115 }
116} 116}
117 117
118filterResult_t LLViewQuery::runFilters(LLView * view, const viewList_t children, const filterList_t filters) const 118filterResult_t LLViewQuery::runFilters(LLView * view, const viewList_t children, const filterList_t filters) const
119{ 119{
120 filterResult_t result = filterResult_t(TRUE, TRUE); 120 filterResult_t result = filterResult_t(TRUE, TRUE);
121 for(filterList_const_iter_t iter = filters.begin(); 121 for(filterList_const_iter_t iter = filters.begin();
122 iter != filters.end(); 122 iter != filters.end();
123 iter++) 123 iter++)
124 { 124 {
125 filterResult_t filtered = (**iter)(view, children); 125 filterResult_t filtered = (**iter)(view, children);
126 result.first = result.first && filtered.first; 126 result.first = result.first && filtered.first;
127 result.second = result.second && filtered.second; 127 result.second = result.second && filtered.second;
128 } 128 }
129 return result; 129 return result;
130} 130}
131 131
132class SortByTabOrder : public LLQuerySorter, public LLSingleton<SortByTabOrder> 132class SortByTabOrder : public LLQuerySorter, public LLSingleton<SortByTabOrder>
133{ 133{
134 /*virtual*/ void operator() (LLView * parent, LLView::child_list_t &children) const 134 /*virtual*/ void operator() (LLView * parent, LLView::child_list_t &children) const
135 { 135 {
136 children.sort(LLCompareByTabOrder(parent->getCtrlOrder())); 136 children.sort(LLCompareByTabOrder(parent->getCtrlOrder()));
137 } 137 }
138}; 138};
139 139
140LLCtrlQuery::LLCtrlQuery() : 140LLCtrlQuery::LLCtrlQuery() :
141 LLViewQuery() 141 LLViewQuery()
142{ 142{
143 setSorter(SortByTabOrder::getInstance()); 143 setSorter(SortByTabOrder::getInstance());
144} 144}
145 145
diff --git a/linden/indra/llui/llviewquery.h b/linden/indra/llui/llviewquery.h
index 3dc2861..7ab401a 100644
--- a/linden/indra/llui/llviewquery.h
+++ b/linden/indra/llui/llviewquery.h
@@ -1,8 +1,8 @@
1/** 1/**
2 * @file llviewquery.h 2 * @file llviewquery.h
3 * @brief Query algorithm for flattening and filtering the view hierarchy. 3 * @brief Query algorithm for flattening and filtering the view hierarchy.
4 * 4 *
5 * Copyright (c) 2001-2007, Linden Research, Inc. 5 * Copyright (c) 2001-2007, Linden Research, Inc.
6 * 6 *
7 * The source code in this file ("Source Code") is provided by Linden Lab 7 * The source code in this file ("Source Code") is provided by Linden Lab
8 * to you under the terms of the GNU General Public License, version 2.0 8 * to you under the terms of the GNU General Public License, version 2.0
@@ -22,87 +22,87 @@
22 * 22 *
23 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO 23 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
24 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, 24 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
25 * COMPLETENESS OR PERFORMANCE. 25 * COMPLETENESS OR PERFORMANCE.
26 */ 26 */
27 27
28#ifndef LL_LLVIEWQUERY_H 28#ifndef LL_LLVIEWQUERY_H
29#define LL_LLVIEWQUERY_H 29#define LL_LLVIEWQUERY_H
30 30
31#include <list> 31#include <list>
32 32
33#include "llmemory.h" 33#include "llmemory.h"
34 34
35class LLView; 35class LLView;
36 36
37typedef std::list<LLView *> viewList_t; 37typedef std::list<LLView *> viewList_t;
38typedef std::pair<BOOL, BOOL> filterResult_t; 38typedef std::pair<BOOL, BOOL> filterResult_t;
39 39
40// Abstract base class for all filters. 40// Abstract base class for all filters.
41class LLQueryFilter : public LLRefCount 41class LLQueryFilter : public LLRefCount
42{ 42{
43public: 43public:
44 virtual filterResult_t operator() (const LLView* const view, const viewList_t & children) const =0; 44 virtual filterResult_t operator() (const LLView* const view, const viewList_t & children) const =0;
45}; 45};
46 46
47class LLQuerySorter : public LLRefCount 47class LLQuerySorter : public LLRefCount
48{ 48{
49public: 49public:
50 virtual void operator() (LLView * parent, viewList_t &children) const; 50 virtual void operator() (LLView * parent, viewList_t &children) const;
51}; 51};
52 52
53class LLNoLeavesFilter : public LLQueryFilter, public LLSingleton<LLNoLeavesFilter> 53class LLNoLeavesFilter : public LLQueryFilter, public LLSingleton<LLNoLeavesFilter>
54{ 54{
55 /*virtual*/ filterResult_t operator() (const LLView* const view, const viewList_t & children) const; 55 /*virtual*/ filterResult_t operator() (const LLView* const view, const viewList_t & children) const;
56}; 56};
57class LLVisibleFilter : public LLQueryFilter, public LLSingleton<LLVisibleFilter> 57class LLVisibleFilter : public LLQueryFilter, public LLSingleton<LLVisibleFilter>
58{ 58{
59 /*virtual*/ filterResult_t operator() (const LLView* const view, const viewList_t & children) const; 59 /*virtual*/ filterResult_t operator() (const LLView* const view, const viewList_t & children) const;
60}; 60};
61class LLEnabledFilter : public LLQueryFilter, public LLSingleton<LLEnabledFilter> 61class LLEnabledFilter : public LLQueryFilter, public LLSingleton<LLEnabledFilter>
62{ 62{
63 /*virtual*/ filterResult_t operator() (const LLView* const view, const viewList_t & children) const; 63 /*virtual*/ filterResult_t operator() (const LLView* const view, const viewList_t & children) const;
64}; 64};
65class LLTabStopFilter : public LLQueryFilter, public LLSingleton<LLTabStopFilter> 65class LLTabStopFilter : public LLQueryFilter, public LLSingleton<LLTabStopFilter>
66{ 66{
67 /*virtual*/ filterResult_t operator() (const LLView* const view, const viewList_t & children) const; 67 /*virtual*/ filterResult_t operator() (const LLView* const view, const viewList_t & children) const;
68}; 68};
69 69
70// Algorithm for flattening 70// Algorithm for flattening
71class LLViewQuery 71class LLViewQuery
72{ 72{
73public: 73public:
74 typedef std::list<const LLQueryFilter*> filterList_t; 74 typedef std::list<const LLQueryFilter*> filterList_t;
75 typedef filterList_t::iterator filterList_iter_t; 75 typedef filterList_t::iterator filterList_iter_t;
76 typedef filterList_t::const_iterator filterList_const_iter_t; 76 typedef filterList_t::const_iterator filterList_const_iter_t;
77 77
78 LLViewQuery(); 78 LLViewQuery();
79 virtual ~LLViewQuery() {} 79 virtual ~LLViewQuery() {}
80 80
81 void addPreFilter(const LLQueryFilter* prefilter); 81 void addPreFilter(const LLQueryFilter* prefilter);
82 void addPostFilter(const LLQueryFilter* postfilter); 82 void addPostFilter(const LLQueryFilter* postfilter);
83 const filterList_t & getPreFilters() const; 83 const filterList_t & getPreFilters() const;
84 const filterList_t & getPostFilters() const; 84 const filterList_t & getPostFilters() const;
85 85
86 void setSorter(const LLQuerySorter* sorter); 86 void setSorter(const LLQuerySorter* sorter);
87 const LLQuerySorter* getSorter() const; 87 const LLQuerySorter* getSorter() const;
88 88
89 viewList_t run(LLView * view) const; 89 viewList_t run(LLView * view) const;
90 // syntactic sugar 90 // syntactic sugar
91 viewList_t operator () (LLView * view) const { return run(view); } 91 viewList_t operator () (LLView * view) const { return run(view); }
92protected: 92protected:
93 // override this method to provide iteration over other types of children 93 // override this method to provide iteration over other types of children
94 virtual void filterChildren(LLView * view, viewList_t & filtered_children) const; 94 virtual void filterChildren(LLView * view, viewList_t & filtered_children) const;
95 filterResult_t runFilters(LLView * view, const viewList_t children, const filterList_t filters) const; 95 filterResult_t runFilters(LLView * view, const viewList_t children, const filterList_t filters) const;
96protected: 96protected:
97 filterList_t mPreFilters; 97 filterList_t mPreFilters;
98 filterList_t mPostFilters; 98 filterList_t mPostFilters;
99 const LLQuerySorter* mSorterp; 99 const LLQuerySorter* mSorterp;
100}; 100};
101 101
102class LLCtrlQuery : public LLViewQuery 102class LLCtrlQuery : public LLViewQuery
103{ 103{
104public: 104public:
105 LLCtrlQuery(); 105 LLCtrlQuery();
106}; 106};
107 107
108#endif 108#endif
diff --git a/linden/indra/llvfs/lldir.cpp b/linden/indra/llvfs/lldir.cpp
index b0d9d92..6d0e956 100644
--- a/linden/indra/llvfs/lldir.cpp
+++ b/linden/indra/llvfs/lldir.cpp
@@ -202,6 +202,27 @@ const std::string &LLDir::getTempDir() const
202 return mTempDir; 202 return mTempDir;
203} 203}
204 204
205const std::string LLDir::getCacheDir(bool get_default) const
206{
207 if (mCacheDir.empty() || get_default)
208 {
209 std::string res;
210 if (getOSUserAppDir().empty())
211 {
212 res = "data";
213 }
214 else
215 {
216 res = getOSUserAppDir() + mDirDelimiter + "cache";
217 }
218 return res;
219 }
220 else
221 {
222 return mCacheDir;
223 }
224}
225
205const std::string &LLDir::getCAFile() const 226const std::string &LLDir::getCAFile() const
206{ 227{
207 return mCAFile; 228 return mCAFile;
@@ -217,7 +238,12 @@ const std::string &LLDir::getSkinDir() const
217 return mSkinDir; 238 return mSkinDir;
218} 239}
219 240
220std::string LLDir::getExpandedFilename(ELLPath location, const std::string &filename) const 241std::string LLDir::getExpandedFilename(ELLPath location, const std::string& filename) const
242{
243 return getExpandedFilename(location, "", filename);
244}
245
246std::string LLDir::getExpandedFilename(ELLPath location, const std::string& subdir, const std::string& in_filename) const
221{ 247{
222 std::string prefix; 248 std::string prefix;
223 switch (location) 249 switch (location)
@@ -249,16 +275,7 @@ std::string LLDir::getExpandedFilename(ELLPath location, const std::string &file
249 break; 275 break;
250 276
251 case LL_PATH_CACHE: 277 case LL_PATH_CACHE:
252 if (getOSUserAppDir().empty()) 278 prefix = getCacheDir();
253 {
254 prefix = "data";
255 }
256 else
257 {
258 prefix = getOSUserAppDir();
259 prefix += mDirDelimiter;
260 prefix += "cache";
261 }
262 break; 279 break;
263 280
264 case LL_PATH_USER_SETTINGS: 281 case LL_PATH_USER_SETTINGS:
@@ -309,6 +326,16 @@ std::string LLDir::getExpandedFilename(ELLPath location, const std::string &file
309 llassert(0); 326 llassert(0);
310 } 327 }
311 328
329 std::string filename = in_filename;
330 if (!subdir.empty())
331 {
332 filename = subdir + mDirDelimiter + in_filename;
333 }
334 else
335 {
336 filename = in_filename;
337 }
338
312 std::string expanded_filename; 339 std::string expanded_filename;
313 if (!filename.empty()) 340 if (!filename.empty())
314 { 341 {
@@ -323,8 +350,7 @@ std::string LLDir::getExpandedFilename(ELLPath location, const std::string &file
323 expanded_filename = filename; 350 expanded_filename = filename;
324 } 351 }
325 } 352 }
326 else 353 else if (!prefix.empty())
327 if (!prefix.empty())
328 { 354 {
329 // Directory only, no file name. 355 // Directory only, no file name.
330 expanded_filename = prefix; 356 expanded_filename = prefix;
@@ -342,7 +368,7 @@ std::string LLDir::getExpandedFilename(ELLPath location, const std::string &file
342std::string LLDir::getTempFilename() const 368std::string LLDir::getTempFilename() const
343{ 369{
344 LLUUID random_uuid; 370 LLUUID random_uuid;
345 char uuid_str[64]; 371 char uuid_str[64]; /* Flawfinder: ignore */
346 372
347 random_uuid.generate(); 373 random_uuid.generate();
348 random_uuid.toString(uuid_str); 374 random_uuid.toString(uuid_str);
@@ -424,6 +450,30 @@ void LLDir::setSkinFolder(const std::string &skin_folder)
424 mSkinDir += skin_folder; 450 mSkinDir += skin_folder;
425} 451}
426 452
453bool LLDir::setCacheDir(const std::string &path)
454{
455 if (path.empty() )
456 {
457 // reset to default
458 mCacheDir = "";
459 return true;
460 }
461 else
462 {
463 LLFile::mkdir(path.c_str());
464 std::string tempname = path + mDirDelimiter + "temp";
465 LLFILE* file = LLFile::fopen(tempname.c_str(),"wt");
466 if (file)
467 {
468 fclose(file);
469 LLFile::remove(tempname.c_str());
470 mCacheDir = path;
471 return true;
472 }
473 return false;
474 }
475}
476
427void LLDir::dumpCurrentDirectories() 477void LLDir::dumpCurrentDirectories()
428{ 478{
429 llinfos << "Current Directories:" << llendl; 479 llinfos << "Current Directories:" << llendl;
diff --git a/linden/indra/llvfs/lldir.h b/linden/indra/llvfs/lldir.h
index 2012f1b..60188f3 100644
--- a/linden/indra/llvfs/lldir.h
+++ b/linden/indra/llvfs/lldir.h
@@ -79,12 +79,14 @@ class LLDir
79 const std::string &getChatLogsDir() const; // Location of the chat logs dir. 79 const std::string &getChatLogsDir() const; // Location of the chat logs dir.
80 const std::string &getPerAccountChatLogsDir() const; // Location of the per account chat logs dir. 80 const std::string &getPerAccountChatLogsDir() const; // Location of the per account chat logs dir.
81 const std::string &getTempDir() const; // Common temporary directory 81 const std::string &getTempDir() const; // Common temporary directory
82 const std::string getCacheDir(bool get_default = false) const; // Location of the cache.
82 const std::string &getCAFile() const; // File containing TLS certificate authorities 83 const std::string &getCAFile() const; // File containing TLS certificate authorities
83 const std::string &getDirDelimiter() const; // directory separator for platform (ie. '\' or '/' or ':') 84 const std::string &getDirDelimiter() const; // directory separator for platform (ie. '\' or '/' or ':')
84 const std::string &getSkinDir() const; // User-specified skin folder. 85 const std::string &getSkinDir() const; // User-specified skin folder.
85 86
86 // Expanded filename 87 // Expanded filename
87 std::string getExpandedFilename(ELLPath location, const std::string &filename) const; 88 std::string getExpandedFilename(ELLPath location, const std::string &filename) const;
89 std::string getExpandedFilename(ELLPath location, const std::string &subdir, const std::string &filename) const;
88 90
89 // random filename in common temporary directory 91 // random filename in common temporary directory
90 std::string getTempFilename() const; 92 std::string getTempFilename() const;
@@ -93,6 +95,7 @@ class LLDir
93 virtual void setPerAccountChatLogsDir(const std::string &first, const std::string &last); // Set the per user chat log directory. 95 virtual void setPerAccountChatLogsDir(const std::string &first, const std::string &last); // Set the per user chat log directory.
94 virtual void setLindenUserDir(const std::string &first, const std::string &last); // Set the linden user dir to this user's dir 96 virtual void setLindenUserDir(const std::string &first, const std::string &last); // Set the linden user dir to this user's dir
95 virtual void setSkinFolder(const std::string &skin_folder); 97 virtual void setSkinFolder(const std::string &skin_folder);
98 virtual bool setCacheDir(const std::string &path);
96 99
97 virtual void dumpCurrentDirectories(); 100 virtual void dumpCurrentDirectories();
98 101
@@ -110,6 +113,7 @@ protected:
110 std::string mChatLogsDir; // Location for chat logs. 113 std::string mChatLogsDir; // Location for chat logs.
111 std::string mCAFile; // Location of the TLS certificate authority PEM file. 114 std::string mCAFile; // Location of the TLS certificate authority PEM file.
112 std::string mTempDir; 115 std::string mTempDir;
116 std::string mCacheDir;
113 std::string mDirDelimiter; 117 std::string mDirDelimiter;
114 std::string mSkinDir; // Location for u ser-specified skin info. 118 std::string mSkinDir; // Location for u ser-specified skin info.
115}; 119};
diff --git a/linden/indra/llvfs/lldir_linux.cpp b/linden/indra/llvfs/lldir_linux.cpp
index 780fbdb..f46ccf2 100644
--- a/linden/indra/llvfs/lldir_linux.cpp
+++ b/linden/indra/llvfs/lldir_linux.cpp
@@ -51,7 +51,7 @@ static std::string getCurrentUserHome(char* fallback)
51 else 51 else
52 { 52 {
53 llinfos << "Couldn't detect home directory from passwd - trying $HOME" << llendl; 53 llinfos << "Couldn't detect home directory from passwd - trying $HOME" << llendl;
54 const char *const home_env = getenv("HOME"); 54 const char *const home_env = getenv("HOME"); /* Flawfinder: ignore */
55 if (home_env) 55 if (home_env)
56 { 56 {
57 result_cstr = (char*) home_env; 57 result_cstr = (char*) home_env;
@@ -73,7 +73,7 @@ LLDir_Linux::LLDir_Linux()
73 mCurrentDirCount = -1; 73 mCurrentDirCount = -1;
74 mDirp = NULL; 74 mDirp = NULL;
75 75
76 char tmp_str[LL_MAX_PATH]; 76 char tmp_str[LL_MAX_PATH]; /* Flawfinder: ignore */
77 getcwd(tmp_str, LL_MAX_PATH); 77 getcwd(tmp_str, LL_MAX_PATH);
78 78
79 mExecutableFilename = ""; 79 mExecutableFilename = "";
@@ -85,13 +85,13 @@ LLDir_Linux::LLDir_Linux()
85 mOSUserAppDir = ""; 85 mOSUserAppDir = "";
86 mLindenUserDir = tmp_str; 86 mLindenUserDir = tmp_str;
87 87
88 char path [32]; 88 char path [32]; /* Flawfinder: ignore */
89 89
90 // *NOTE: /proc/%d/exe doesn't work on FreeBSD. But that's ok, 90 // *NOTE: /proc/%d/exe doesn't work on FreeBSD. But that's ok,
91 // because this is the linux implementation. 91 // because this is the linux implementation.
92 92
93 sprintf (path, "/proc/%d/exe", (int) getpid ()); 93 snprintf (path, sizeof(path), "/proc/%d/exe", (int) getpid ()); /* Flawfinder: ignore */
94 int rc = readlink (path, tmp_str, sizeof (tmp_str)-1); 94 int rc = readlink (path, tmp_str, sizeof (tmp_str)-1); /* Flawfinder: ignore */
95 if ( (rc != -1) && (rc <= ((int) sizeof (tmp_str)-1)) ) 95 if ( (rc != -1) && (rc <= ((int) sizeof (tmp_str)-1)) )
96 { 96 {
97 tmp_str[rc] = '\0'; //readlink() doesn't 0-terminate the buffer 97 tmp_str[rc] = '\0'; //readlink() doesn't 0-terminate the buffer
@@ -128,7 +128,7 @@ void LLDir_Linux::initAppDirs(const std::string &app_name)
128 LLString upper_app_name(app_name); 128 LLString upper_app_name(app_name);
129 LLString::toUpper(upper_app_name); 129 LLString::toUpper(upper_app_name);
130 130
131 char* app_home_env = getenv((upper_app_name + "_USER_DIR").c_str()); 131 char* app_home_env = getenv((upper_app_name + "_USER_DIR").c_str()); /* Flawfinder: ignore */
132 if (app_home_env) 132 if (app_home_env)
133 { 133 {
134 // user has specified own userappdir i.e. $SECONDLIFE_USER_DIR 134 // user has specified own userappdir i.e. $SECONDLIFE_USER_DIR
@@ -326,7 +326,7 @@ void LLDir_Linux::getRandomFileInDir(const std::string &dirname, const std::stri
326 326
327std::string LLDir_Linux::getCurPath() 327std::string LLDir_Linux::getCurPath()
328{ 328{
329 char tmp_str[LL_MAX_PATH]; 329 char tmp_str[LL_MAX_PATH]; /* Flawfinder: ignore */
330 getcwd(tmp_str, LL_MAX_PATH); 330 getcwd(tmp_str, LL_MAX_PATH);
331 return tmp_str; 331 return tmp_str;
332} 332}
diff --git a/linden/indra/llvfs/lldir_mac.cpp b/linden/indra/llvfs/lldir_mac.cpp
index 7f1d2ce..7ed7697 100644
--- a/linden/indra/llvfs/lldir_mac.cpp
+++ b/linden/indra/llvfs/lldir_mac.cpp
@@ -354,7 +354,7 @@ S32 LLDir_Mac::deleteFilesInDir(const std::string &dirname, const std::string &m
354 354
355std::string LLDir_Mac::getCurPath() 355std::string LLDir_Mac::getCurPath()
356{ 356{
357 char tmp_str[LL_MAX_PATH]; 357 char tmp_str[LL_MAX_PATH]; /* Flawfinder: ignore */
358 getcwd(tmp_str, LL_MAX_PATH); 358 getcwd(tmp_str, LL_MAX_PATH);
359 return tmp_str; 359 return tmp_str;
360} 360}
diff --git a/linden/indra/llvfs/lldir_win32.cpp b/linden/indra/llvfs/lldir_win32.cpp
index ad72752..fd264a7 100644
--- a/linden/indra/llvfs/lldir_win32.cpp
+++ b/linden/indra/llvfs/lldir_win32.cpp
@@ -64,9 +64,9 @@ LLDir_Win32::LLDir_Win32()
64 64
65 if (GetTempPath(MAX_PATH, w_str)) 65 if (GetTempPath(MAX_PATH, w_str))
66 { 66 {
67 if (wcslen(w_str)) 67 if (wcslen(w_str)) /* Flawfinder: ignore */
68 { 68 {
69 w_str[wcslen(w_str)-1] = '\0'; // remove trailing slash 69 w_str[wcslen(w_str)-1] = '\0'; /* Flawfinder: ignore */ // remove trailing slash
70 } 70 }
71 mTempDir = utf16str_to_utf8str(llutf16string(w_str)); 71 mTempDir = utf16str_to_utf8str(llutf16string(w_str));
72 } 72 }
@@ -361,7 +361,7 @@ DWORD GetDllVersion(LPCTSTR lpszDllName)
361 HINSTANCE hinstDll; 361 HINSTANCE hinstDll;
362 DWORD dwVersion = 0; 362 DWORD dwVersion = 0;
363 363
364 hinstDll = LoadLibrary(lpszDllName); 364 hinstDll = LoadLibrary(lpszDllName); /* Flawfinder: ignore */
365 365
366 if(hinstDll) 366 if(hinstDll)
367 { 367 {
diff --git a/linden/indra/llvfs/lllfsthread.cpp b/linden/indra/llvfs/lllfsthread.cpp
index b7335e2..25edb52 100644
--- a/linden/indra/llvfs/lllfsthread.cpp
+++ b/linden/indra/llvfs/lllfsthread.cpp
@@ -38,10 +38,10 @@
38//============================================================================ 38//============================================================================
39// Run on MAIN thread 39// Run on MAIN thread
40//static 40//static
41void LLLFSThread::initClass(bool local_is_threaded, bool local_run_always) 41void LLLFSThread::initClass(bool local_is_threaded)
42{ 42{
43 llassert(sLocal == NULL); 43 llassert(sLocal == NULL);
44 sLocal = new LLLFSThread(local_is_threaded, local_run_always); 44 sLocal = new LLLFSThread(local_is_threaded);
45} 45}
46 46
47//static 47//static
@@ -65,8 +65,9 @@ void LLLFSThread::cleanupClass()
65 65
66//---------------------------------------------------------------------------- 66//----------------------------------------------------------------------------
67 67
68LLLFSThread::LLLFSThread(bool threaded, bool runalways) : 68LLLFSThread::LLLFSThread(bool threaded) :
69 LLQueuedThread("LFS", threaded, runalways) 69 LLQueuedThread("LFS", threaded),
70 mPriorityCounter(PRIORITY_LOWBITS)
70{ 71{
71} 72}
72 73
@@ -77,251 +78,165 @@ LLLFSThread::~LLLFSThread()
77 78
78//---------------------------------------------------------------------------- 79//----------------------------------------------------------------------------
79 80
80LLLFSThread::handle_t LLLFSThread::read(const LLString& filename, 81LLLFSThread::handle_t LLLFSThread::read(const LLString& filename, /* Flawfinder: ignore */
81 U8* buffer, S32 offset, S32 numbytes, U32 priority, U32 flags) 82 U8* buffer, S32 offset, S32 numbytes,
83 Responder* responder, U32 priority)
82{ 84{
83 handle_t handle = generateHandle(); 85 handle_t handle = generateHandle();
84 86
85 priority = llmax(priority, (U32)PRIORITY_LOW); // All reads are at least PRIORITY_LOW 87 if (priority == 0) priority = PRIORITY_NORMAL | priorityCounter();
86 Request* req = new Request(handle, priority, flags, 88 else if (priority < PRIORITY_LOW) priority |= PRIORITY_LOW; // All reads are at least PRIORITY_LOW
89
90 Request* req = new Request(this, handle, priority,
87 FILE_READ, filename, 91 FILE_READ, filename,
88 buffer, offset, numbytes); 92 buffer, offset, numbytes,
93 responder);
89 94
90 bool res = addRequest(req); 95 bool res = addRequest(req);
91 if (!res) 96 if (!res)
92 { 97 {
93 llerrs << "LLLFSThread::read called after LLLFSThread::cleanupClass()" << llendl; 98 llerrs << "LLLFSThread::read called after LLLFSThread::cleanupClass()" << llendl;
94 req->deleteRequest();
95 handle = nullHandle();
96 } 99 }
97 100
98 return handle; 101 return handle;
99} 102}
100 103
101S32 LLLFSThread::readImmediate(const LLString& filename,
102 U8* buffer, S32 offset, S32 numbytes)
103{
104 handle_t handle = generateHandle();
105
106 Request* req = new Request(handle, PRIORITY_IMMEDIATE, 0,
107 FILE_READ, filename,
108 buffer, offset, numbytes);
109
110 S32 res = addRequest(req) ? 1 : 0;
111 if (res == 0)
112 {
113 llerrs << "LLLFSThread::read called after LLLFSThread::cleanupClass()" << llendl;
114 req->deleteRequest();
115 }
116 else
117 {
118 llverify(waitForResult(handle, false) == true);
119 res = req->getBytesRead();
120 completeRequest(handle);
121 }
122 return res;
123}
124
125LLLFSThread::handle_t LLLFSThread::write(const LLString& filename, 104LLLFSThread::handle_t LLLFSThread::write(const LLString& filename,
126 U8* buffer, S32 offset, S32 numbytes, U32 flags) 105 U8* buffer, S32 offset, S32 numbytes,
106 Responder* responder, U32 priority)
127{ 107{
128 handle_t handle = generateHandle(); 108 handle_t handle = generateHandle();
129 109
130 Request* req = new Request(handle, 0, flags, 110 if (priority == 0) priority = PRIORITY_LOW | priorityCounter();
131 FILE_WRITE, filename,
132 buffer, offset, numbytes);
133
134 bool res = addRequest(req);
135 if (!res)
136 {
137 llerrs << "LLLFSThread::read called after LLLFSThread::cleanupClass()" << llendl;
138 req->deleteRequest();
139 handle = nullHandle();
140 }
141 111
142 return handle; 112 Request* req = new Request(this, handle, priority,
143}
144
145S32 LLLFSThread::writeImmediate(const LLString& filename,
146 U8* buffer, S32 offset, S32 numbytes)
147{
148 handle_t handle = generateHandle();
149
150 Request* req = new Request(handle, PRIORITY_IMMEDIATE, 0,
151 FILE_WRITE, filename, 113 FILE_WRITE, filename,
152 buffer, offset, numbytes); 114 buffer, offset, numbytes,
153 115 responder);
154 S32 res = addRequest(req) ? 1 : 0;
155 if (res == 0)
156 {
157 llerrs << "LLLFSThread::write called after LLLFSThread::cleanupClass()" << llendl;
158 req->deleteRequest();
159 }
160 else
161 {
162 llverify(waitForResult(handle, false) == true);
163 res = req->getBytesRead();
164 completeRequest(handle);
165 }
166 return res;
167}
168
169
170LLLFSThread::handle_t LLLFSThread::rename(const LLString& filename, const LLString& newname, U32 flags)
171{
172 handle_t handle = generateHandle();
173
174 LLString* new_name_str = new LLString(newname); // deleted with Request
175 Request* req = new Request(handle, 0, flags,
176 FILE_RENAME, filename,
177 (U8*)new_name_str, 0, 0);
178
179 bool res = addRequest(req);
180 if (!res)
181 {
182 llerrs << "LLLFSThread::rename called after LLLFSThread::cleanupClass()" << llendl;
183 req->deleteRequest();
184 handle = nullHandle();
185 }
186
187 return handle;
188}
189
190LLLFSThread::handle_t LLLFSThread::remove(const LLString& filename, U32 flags)
191{
192 handle_t handle = generateHandle();
193
194 Request* req = new Request(handle, 0, flags,
195 FILE_RENAME, filename,
196 NULL, 0, 0);
197 116
198 bool res = addRequest(req); 117 bool res = addRequest(req);
199 if (!res) 118 if (!res)
200 { 119 {
201 llerrs << "LLLFSThread::remove called after LLLFSThread::cleanupClass()" << llendl; 120 llerrs << "LLLFSThread::read called after LLLFSThread::cleanupClass()" << llendl;
202 req->deleteRequest();
203 handle = nullHandle();
204 } 121 }
205 122
206 return handle; 123 return handle;
207} 124}
208 125
209//============================================================================ 126//============================================================================
210// Runs on its OWN thread
211
212bool LLLFSThread::processRequest(QueuedRequest* qreq)
213{
214 Request *req = (Request*)qreq;
215
216 bool complete = req->processIO();
217
218 return complete;
219}
220
221//============================================================================
222 127
223LLLFSThread::Request::Request(handle_t handle, U32 priority, U32 flags, 128LLLFSThread::Request::Request(LLLFSThread* thread,
129 handle_t handle, U32 priority,
224 operation_t op, const LLString& filename, 130 operation_t op, const LLString& filename,
225 U8* buffer, S32 offset, S32 numbytes) : 131 U8* buffer, S32 offset, S32 numbytes,
226 QueuedRequest(handle, priority, flags), 132 Responder* responder) :
133 QueuedRequest(handle, priority, FLAG_AUTO_COMPLETE),
134 mThread(thread),
227 mOperation(op), 135 mOperation(op),
228 mFileName(filename), 136 mFileName(filename),
229 mBuffer(buffer), 137 mBuffer(buffer),
230 mOffset(offset), 138 mOffset(offset),
231 mBytes(numbytes), 139 mBytes(numbytes),
232 mBytesRead(0) 140 mBytesRead(0),
141 mResponder(responder)
233{ 142{
234 llassert(mBuffer); 143 if (numbytes <= 0)
235
236 if (numbytes <= 0 && mOperation != FILE_RENAME && mOperation != FILE_REMOVE)
237 { 144 {
238 llwarns << "LLLFSThread: Request with numbytes = " << numbytes << llendl; 145 llwarns << "LLLFSThread: Request with numbytes = " << numbytes << llendl;
239 } 146 }
240} 147}
241 148
242void LLLFSThread::Request::finishRequest() 149LLLFSThread::Request::~Request()
243{ 150{
244} 151}
245 152
153// virtual, called from own thread
154void LLLFSThread::Request::finishRequest(bool completed)
155{
156 if (mResponder.notNull())
157 {
158 mResponder->completed(completed ? mBytesRead : 0);
159 mResponder = NULL;
160 }
161}
162
246void LLLFSThread::Request::deleteRequest() 163void LLLFSThread::Request::deleteRequest()
247{ 164{
248 if (getStatus() == STATUS_QUEUED || getStatus() == STATUS_ABORT) 165 if (getStatus() == STATUS_QUEUED)
249 { 166 {
250 llerrs << "Attempt to delete a queued LLLFSThread::Request!" << llendl; 167 llerrs << "Attempt to delete a queued LLLFSThread::Request!" << llendl;
251 } 168 }
252 if (mOperation == FILE_WRITE) 169 if (mResponder.notNull())
253 {
254 if (mFlags & AUTO_DELETE)
255 {
256 delete mBuffer;
257 }
258 }
259 else if (mOperation == FILE_RENAME)
260 { 170 {
261 LLString* new_name = (LLString*)mBuffer; 171 mResponder->completed(0);
262 delete new_name; 172 mResponder = NULL;
263 } 173 }
264 LLQueuedThread::QueuedRequest::deleteRequest(); 174 LLQueuedThread::QueuedRequest::deleteRequest();
265} 175}
266 176
267bool LLLFSThread::Request::processIO() 177bool LLLFSThread::Request::processRequest()
268{ 178{
269 bool complete = false; 179 bool complete = false;
270 if (mOperation == FILE_READ) 180 if (mOperation == FILE_READ)
271 { 181 {
272 llassert(mOffset >= 0); 182 llassert(mOffset >= 0);
273 apr_file_t* filep = ll_apr_file_open(mFileName, LL_APR_RB); 183 apr_file_t* filep = ll_apr_file_open(mFileName, LL_APR_RB, mThread->mAPRPoolp);
274 if (!filep) 184 if (!filep)
275 { 185 {
276 llwarns << "LLLFS: Unable to read file: " << mFileName << llendl; 186 llwarns << "LLLFS: Unable to read file: " << mFileName << llendl;
277 mBytesRead = 0; // fail 187 mBytesRead = 0; // fail
278 return true; 188 return true;
279 } 189 }
190 S32 off;
280 if (mOffset < 0) 191 if (mOffset < 0)
281 ll_apr_file_seek(filep, APR_END, 0); 192 off = ll_apr_file_seek(filep, APR_END, 0);
282 else 193 else
283 ll_apr_file_seek(filep, APR_SET, mOffset); 194 off = ll_apr_file_seek(filep, APR_SET, mOffset);
195 llassert_always(off >= 0);
284 mBytesRead = ll_apr_file_read(filep, mBuffer, mBytes ); 196 mBytesRead = ll_apr_file_read(filep, mBuffer, mBytes );
285 apr_file_close(filep); 197 apr_file_close(filep);
286 complete = true; 198 complete = true;
287 //llinfos << llformat("LLLFSThread::READ '%s': %d bytes",mFileName.c_str(),mBytesRead) << llendl; 199// llinfos << "LLLFSThread::READ:" << mFileName << " Bytes: " << mBytesRead << llendl;
288 } 200 }
289 else if (mOperation == FILE_WRITE) 201 else if (mOperation == FILE_WRITE)
290 { 202 {
291 apr_file_t* filep = ll_apr_file_open(mFileName, LL_APR_WB); 203 apr_int32_t flags = APR_CREATE|APR_WRITE|APR_BINARY;
204 if (mOffset < 0)
205 flags |= APR_APPEND;
206 apr_file_t* filep = ll_apr_file_open(mFileName, flags, mThread->mAPRPoolp);
292 if (!filep) 207 if (!filep)
293 { 208 {
294 llwarns << "LLLFS: Unable to write file: " << mFileName << llendl; 209 llwarns << "LLLFS: Unable to write file: " << mFileName << llendl;
295 mBytesRead = 0; // fail 210 mBytesRead = 0; // fail
296 return true; 211 return true;
297 } 212 }
298 if (mOffset < 0) 213 if (mOffset >= 0)
299 ll_apr_file_seek(filep, APR_END, 0); 214 {
300 else 215 S32 seek = ll_apr_file_seek(filep, APR_SET, mOffset);
301 ll_apr_file_seek(filep, APR_SET, mOffset); 216 if (seek < 0)
217 {
218 apr_file_close(filep);
219 llwarns << "LLLFS: Unable to write file (seek failed): " << mFileName << llendl;
220 mBytesRead = 0; // fail
221 return true;
222 }
223 }
302 mBytesRead = ll_apr_file_write(filep, mBuffer, mBytes ); 224 mBytesRead = ll_apr_file_write(filep, mBuffer, mBytes );
303 complete = true; 225 complete = true;
304 apr_file_close(filep); 226 apr_file_close(filep);
305 //llinfos << llformat("LLLFSThread::WRITE '%s': %d bytes",mFileName.c_str(),mBytesRead) << llendl; 227// llinfos << "LLLFSThread::WRITE:" << mFileName << " Bytes: " << mBytesRead << "/" << mBytes << " Offset:" << mOffset << llendl;
306 }
307 else if (mOperation == FILE_RENAME)
308 {
309 LLString* new_name = (LLString*)mBuffer;
310 ll_apr_file_rename(mFileName, *new_name);
311 complete = true;
312 //llinfos << llformat("LLLFSThread::RENAME '%s': '%s'",mFileName.c_str(),new_name->c_str()) << llendl;
313 }
314 else if (mOperation == FILE_REMOVE)
315 {
316 ll_apr_file_remove(mFileName);
317 complete = true;
318 //llinfos << llformat("LLLFSThread::REMOVE '%s'",mFileName.c_str()) << llendl;
319 } 228 }
320 else 229 else
321 { 230 {
322 llerrs << llformat("LLLFSThread::unknown operation: %d", mOperation) << llendl; 231 llerrs << "LLLFSThread::unknown operation: " << (S32)mOperation << llendl;
323 } 232 }
324 return complete; 233 return complete;
325} 234}
326 235
327//============================================================================ 236//============================================================================
237
238LLLFSThread::Responder::~Responder()
239{
240}
241
242//============================================================================
diff --git a/linden/indra/llvfs/lllfsthread.h b/linden/indra/llvfs/lllfsthread.h
index 8af66b1..06c53aa 100644
--- a/linden/indra/llvfs/lllfsthread.h
+++ b/linden/indra/llvfs/lllfsthread.h
@@ -55,15 +55,24 @@ public:
55 //------------------------------------------------------------------------ 55 //------------------------------------------------------------------------
56public: 56public:
57 57
58 class Responder : public LLThreadSafeRefCount
59 {
60 public:
61 virtual ~Responder();
62 virtual void completed(S32 bytes) = 0;
63 };
64
58 class Request : public QueuedRequest 65 class Request : public QueuedRequest
59 { 66 {
60 protected: 67 protected:
61 ~Request() {}; // use deleteRequest() 68 virtual ~Request(); // use deleteRequest()
62 69
63 public: 70 public:
64 Request(handle_t handle, U32 priority, U32 flags, 71 Request(LLLFSThread* thread,
72 handle_t handle, U32 priority,
65 operation_t op, const LLString& filename, 73 operation_t op, const LLString& filename,
66 U8* buffer, S32 offset, S32 numbytes); 74 U8* buffer, S32 offset, S32 numbytes,
75 Responder* responder);
67 76
68 S32 getBytes() 77 S32 getBytes()
69 { 78 {
@@ -86,12 +95,12 @@ public:
86 return mFileName; 95 return mFileName;
87 } 96 }
88 97
89 /*virtual*/ void finishRequest(); 98 /*virtual*/ bool processRequest();
99 /*virtual*/ void finishRequest(bool completed);
90 /*virtual*/ void deleteRequest(); 100 /*virtual*/ void deleteRequest();
91
92 bool processIO();
93 101
94 private: 102 private:
103 LLLFSThread* mThread;
95 operation_t mOperation; 104 operation_t mOperation;
96 105
97 LLString mFileName; 106 LLString mFileName;
@@ -99,35 +108,36 @@ public:
99 U8* mBuffer; // dest for reads, source for writes, new UUID for rename 108 U8* mBuffer; // dest for reads, source for writes, new UUID for rename
100 S32 mOffset; // offset into file, -1 = append (WRITE only) 109 S32 mOffset; // offset into file, -1 = append (WRITE only)
101 S32 mBytes; // bytes to read from file, -1 = all 110 S32 mBytes; // bytes to read from file, -1 = all
102 S32 mBytesRead; // bytes read from file 111 S32 mBytesRead; // bytes read from file
112
113 LLPointer<Responder> mResponder;
103 }; 114 };
104 115
105 //------------------------------------------------------------------------ 116 //------------------------------------------------------------------------
106public: 117public:
107 LLLFSThread(bool threaded = TRUE, bool runalways = TRUE); 118 LLLFSThread(bool threaded = TRUE);
108 ~LLLFSThread(); 119 ~LLLFSThread();
109 120
110 // Return a Request handle 121 // Return a Request handle
111 handle_t read(const LLString& filename, 122 handle_t read(const LLString& filename, /* Flawfinder: ignore */
112 U8* buffer, S32 offset, S32 numbytes, U32 pri=PRIORITY_NORMAL, U32 flags = 0); 123 U8* buffer, S32 offset, S32 numbytes,
124 Responder* responder, U32 pri=0);
113 handle_t write(const LLString& filename, 125 handle_t write(const LLString& filename,
114 U8* buffer, S32 offset, S32 numbytes, U32 flags = 0); 126 U8* buffer, S32 offset, S32 numbytes,
115 handle_t rename(const LLString& filename, const LLString& newname, U32 flags = 0); 127 Responder* responder, U32 pri=0);
116 handle_t remove(const LLString& filename, U32 flags = 0);
117 128
118 // Return number of bytes read 129 // Misc
119 S32 readImmediate(const LLString& filename, 130 U32 priorityCounter() { return mPriorityCounter-- & PRIORITY_LOWBITS; } // Use to order IO operations
120 U8* buffer, S32 offset, S32 numbytes); 131
121 S32 writeImmediate(const LLString& filename, 132 // static initializers
122 U8* buffer, S32 offset, S32 numbytes); 133 static void initClass(bool local_is_threaded = TRUE); // Setup sLocal
123
124 static void initClass(bool local_is_threaded = TRUE, bool run_always = TRUE); // Setup sLocal
125 static S32 updateClass(U32 ms_elapsed); 134 static S32 updateClass(U32 ms_elapsed);
126 static void cleanupClass(); // Delete sLocal 135 static void cleanupClass(); // Delete sLocal
127 136
128protected: 137
129 /*virtual*/ bool processRequest(QueuedRequest* req); 138private:
130 139 U32 mPriorityCounter;
140
131public: 141public:
132 static LLLFSThread* sLocal; // Default local file thread 142 static LLLFSThread* sLocal; // Default local file thread
133}; 143};
diff --git a/linden/indra/llvfs/llvfile.cpp b/linden/indra/llvfs/llvfile.cpp
index 2faa5c3..e958b33 100644
--- a/linden/indra/llvfs/llvfile.cpp
+++ b/linden/indra/llvfs/llvfile.cpp
@@ -70,12 +70,12 @@ LLVFile::~LLVFile()
70 { 70 {
71 if (!(mMode & LLVFile::WRITE)) 71 if (!(mMode & LLVFile::WRITE))
72 { 72 {
73 // llwarns << "Destroying LLVFile with pending async read/write, aborting..." << llendl; 73 //llwarns << "Destroying LLVFile with pending async read/write, aborting..." << llendl;
74 sVFSThread->abortRequest(mHandle, LLVFSThread::AUTO_COMPLETE); 74 sVFSThread->setFlags(mHandle, LLVFSThread::FLAG_AUTO_COMPLETE | LLVFSThread::FLAG_ABORT);
75 } 75 }
76 else // WRITE 76 else // WRITE
77 { 77 {
78 sVFSThread->setFlags(mHandle, LLVFSThread::AUTO_COMPLETE); 78 sVFSThread->setFlags(mHandle, LLVFSThread::FLAG_AUTO_COMPLETE);
79 } 79 }
80 } 80 }
81 } 81 }
@@ -135,7 +135,7 @@ U8* LLVFile::readFile(LLVFS *vfs, const LLUUID &uuid, LLAssetType::EType type, S
135 else 135 else
136 { 136 {
137 data = new U8[file_size]; 137 data = new U8[file_size];
138 file.read(data, file_size); 138 file.read(data, file_size); /* Flawfinder: ignore */
139 139
140 if (file.getLastBytesRead() != (S32)file_size) 140 if (file.getLastBytesRead() != (S32)file_size)
141 { 141 {
@@ -213,8 +213,8 @@ BOOL LLVFile::write(const U8 *buffer, S32 bytes)
213 S32 offset = -1; 213 S32 offset = -1;
214 mHandle = sVFSThread->write(mVFS, mFileID, mFileType, 214 mHandle = sVFSThread->write(mVFS, mFileID, mFileType,
215 writebuf, offset, bytes, 215 writebuf, offset, bytes,
216 LLVFSThread::AUTO_COMPLETE | LLVFSThread::AUTO_DELETE); 216 LLVFSThread::FLAG_AUTO_COMPLETE | LLVFSThread::FLAG_AUTO_DELETE);
217 mHandle = LLVFSThread::nullHandle(); // AUTO_COMPLETE means we don't track this 217 mHandle = LLVFSThread::nullHandle(); // FLAG_AUTO_COMPLETE means we don't track this
218 } 218 }
219 else 219 else
220 { 220 {
@@ -323,7 +323,7 @@ BOOL LLVFile::setMaxSize(S32 size)
323 } 323 }
324 if (sVFSThread->isPaused()) 324 if (sVFSThread->isPaused())
325 { 325 {
326 sVFSThread->updateQueue(0); 326 sVFSThread->update(0);
327 } 327 }
328 ms_sleep(10); 328 ms_sleep(10);
329 } 329 }
@@ -427,7 +427,7 @@ void LLVFile::waitForLock(EVFSLock lock)
427 { 427 {
428 if (sVFSThread->isPaused()) 428 if (sVFSThread->isPaused())
429 { 429 {
430 sVFSThread->updateQueue(0); 430 sVFSThread->update(0);
431 } 431 }
432 ms_sleep(1); 432 ms_sleep(1);
433 } 433 }
diff --git a/linden/indra/llvfs/llvfile.h b/linden/indra/llvfs/llvfile.h
index dcc3cb5..c574cbc 100644
--- a/linden/indra/llvfs/llvfile.h
+++ b/linden/indra/llvfs/llvfile.h
@@ -39,7 +39,7 @@ public:
39 LLVFile(LLVFS *vfs, const LLUUID &file_id, const LLAssetType::EType file_type, S32 mode = LLVFile::READ); 39 LLVFile(LLVFS *vfs, const LLUUID &file_id, const LLAssetType::EType file_type, S32 mode = LLVFile::READ);
40 ~LLVFile(); 40 ~LLVFile();
41 41
42 BOOL read(U8 *buffer, S32 bytes, BOOL async = FALSE, F32 priority = 128.f); 42 BOOL read(U8 *buffer, S32 bytes, BOOL async = FALSE, F32 priority = 128.f); /* Flawfinder: ignore */
43 static U8* readFile(LLVFS *vfs, const LLUUID &uuid, LLAssetType::EType type, S32* bytes_read = 0); 43 static U8* readFile(LLVFS *vfs, const LLUUID &uuid, LLAssetType::EType type, S32* bytes_read = 0);
44 void setReadPriority(const F32 priority); 44 void setReadPriority(const F32 priority);
45 BOOL isReadComplete(); 45 BOOL isReadComplete();
diff --git a/linden/indra/llvfs/llvfs.cpp b/linden/indra/llvfs/llvfs.cpp
index bb211df..88476eb 100644
--- a/linden/indra/llvfs/llvfs.cpp
+++ b/linden/indra/llvfs/llvfs.cpp
@@ -63,12 +63,11 @@ public:
63 mLength = size; 63 mLength = size;
64 } 64 }
65 65
66 static BOOL insertFirstLL(LLVFSBlock *first, LLVFSBlock *second) 66 static bool locationSortPredicate(
67 const LLVFSBlock* lhs,
68 const LLVFSBlock* rhs)
67 { 69 {
68 return first->mLocation != second->mLocation 70 return lhs->mLocation < rhs->mLocation;
69 ? first->mLocation < second->mLocation
70 : first->mLength < second->mLength;
71
72 } 71 }
73 72
74public: 73public:
@@ -129,7 +128,7 @@ public:
129 } 128 }
130 129
131 #ifdef LL_LITTLE_ENDIAN 130 #ifdef LL_LITTLE_ENDIAN
132 inline void swizzleCopy(void *dst, void *src, int size) { memcpy(dst, src, size); } 131 inline void swizzleCopy(void *dst, void *src, int size) { memcpy(dst, src, size); /* Flawfinder: ignore */}
133 132
134 #else 133 #else
135 134
@@ -156,7 +155,7 @@ public:
156 else 155 else
157 { 156 {
158 // Perhaps this should assert... 157 // Perhaps this should assert...
159 memcpy(dst, src, size); 158 memcpy(dst, src, size); /* Flawfinder: ignore */
160 } 159 }
161 } 160 }
162 161
@@ -170,7 +169,7 @@ public:
170 buffer +=4; 169 buffer +=4;
171 swizzleCopy(buffer, &mAccessTime, 4); 170 swizzleCopy(buffer, &mAccessTime, 4);
172 buffer +=4; 171 buffer +=4;
173 memcpy(buffer, &mFileID.mData, 16); 172 memcpy(buffer, &mFileID.mData, 16); /* Flawfinder: ignore */
174 buffer += 16; 173 buffer += 16;
175 S16 temp_type = mFileType; 174 S16 temp_type = mFileType;
176 swizzleCopy(buffer, &temp_type, 2); 175 swizzleCopy(buffer, &temp_type, 2);
@@ -239,10 +238,15 @@ LLVFS::LLVFS(const char *index_filename, const char *data_filename, const BOOL r
239 } 238 }
240 mValid = VFSVALID_OK; 239 mValid = VFSVALID_OK;
241 mReadOnly = read_only; 240 mReadOnly = read_only;
242 mIndexFilename = new char[strlen(index_filename) + 1]; 241 mIndexFilename = new char[strlen(index_filename) + 1]; /* Flawfinder: ignore */
243 mDataFilename = new char[strlen(data_filename) + 1]; 242 mDataFilename = new char[strlen(data_filename) + 1]; /* Flawfinder: ignore */
244 strcpy(mIndexFilename, index_filename); 243 if (mIndexFilename == NULL || mDataFilename == NULL)
245 strcpy(mDataFilename, data_filename); 244 {
245 llerrs << "Memory Allocation Failure" << llendl;
246 return;
247 }
248 strcpy(mIndexFilename, index_filename); /* Flawfinder: ignore */
249 strcpy(mDataFilename, data_filename); /* Flawfinder: ignore */
246 250
247 const char *file_mode = mReadOnly ? "rb" : "r+b"; 251 const char *file_mode = mReadOnly ? "rb" : "r+b";
248 252
@@ -266,13 +270,23 @@ LLVFS::LLVFS(const char *index_filename, const char *data_filename, const BOOL r
266 { 270 {
267 llwarns << "Can't open VFS data file " << mDataFilename << " attempting to use alternate" << llendl; 271 llwarns << "Can't open VFS data file " << mDataFilename << " attempting to use alternate" << llendl;
268 272
269 char *temp_index = new char[strlen(mIndexFilename) + 10]; 273 char *temp_index = new char[strlen(mIndexFilename) + 10]; /* Flawfinder: ignore */
270 char *temp_data = new char[strlen(mDataFilename) + 10]; 274 if (!temp_index)
275 {
276 llerrs << "Out of the memory in LLVFS::LLVFS(const char *index_filename, const char *data_filename, const BOOL read_only, const U32 presize, const BOOL remove_after_crash)" << llendl;
277 return;
278 }
279 char *temp_data = new char[strlen(mDataFilename) + 10]; /* Flawfinder: ignore */
280 if (!temp_data)
281 {
282 llerrs << "Out of the memory in LLVFS::LLVFS(const char *index_filename, const char *data_filename, const BOOL read_only, const U32 presize, const BOOL remove_after_crash)" << llendl;
283 return;
284 }
271 285
272 for (U32 count = 0; count < 256; count++) 286 for (U32 count = 0; count < 256; count++)
273 { 287 {
274 sprintf(temp_index, "%s.%u", mIndexFilename, count); 288 sprintf(temp_index, "%s.%u", mIndexFilename, count); /* Flawfinder: ignore */
275 sprintf(temp_data, "%s.%u", mDataFilename, count); 289 sprintf(temp_data, "%s.%u", mDataFilename, count); /* Flawfinder: ignore */
276 290
277 // try just opening, then creating, each alternate 291 // try just opening, then creating, each alternate
278 if ((mDataFP = openAndLock(temp_data, "r+b", FALSE))) 292 if ((mDataFP = openAndLock(temp_data, "r+b", FALSE)))
@@ -313,8 +327,13 @@ LLVFS::LLVFS(const char *index_filename, const char *data_filename, const BOOL r
313 if (!mReadOnly && mRemoveAfterCrash) 327 if (!mReadOnly && mRemoveAfterCrash)
314 { 328 {
315 llstat marker_info; 329 llstat marker_info;
316 char* marker = new char[strlen(mDataFilename) + strlen(".open") + 1]; 330 char* marker = new char[strlen(mDataFilename) + strlen(".open") + 1]; /* Flawfinder: ignore */
317 sprintf(marker, "%s.open", mDataFilename); 331 if (!marker )
332 {
333 llerrs << "Out of memory in LLVFS::LLVFS(const char *index_filename, const char *data_filename, const BOOL read_only, const U32 presize, const BOOL remove_after_crash)" << llendl;
334 return;
335 }
336 sprintf(marker, "%s.open", mDataFilename); /* Flawfinder: ignore */
318 if (!LLFile::stat(marker, &marker_info)) 337 if (!LLFile::stat(marker, &marker_info))
319 { 338 {
320 // marker exists, kill the lock and the VFS files 339 // marker exists, kill the lock and the VFS files
@@ -361,9 +380,8 @@ LLVFS::LLVFS(const char *index_filename, const char *data_filename, const BOOL r
361 380
362 U8 *tmp_ptr = buffer; 381 U8 *tmp_ptr = buffer;
363 382
364 LLLinkedList<LLVFSBlock> files_by_loc; 383 std::vector<LLVFSFileBlock*> files_by_loc;
365 files_by_loc.setInsertBefore(LLVFSBlock::insertFirstLL); 384
366
367 while (tmp_ptr < buffer + fbuf.st_size) 385 while (tmp_ptr < buffer + fbuf.st_size)
368 { 386 {
369 LLVFSFileBlock *block = new LLVFSFileBlock(); 387 LLVFSFileBlock *block = new LLVFSFileBlock();
@@ -383,7 +401,7 @@ LLVFS::LLVFS(const char *index_filename, const char *data_filename, const BOOL r
383 block->mFileType < LLAssetType::AT_COUNT) 401 block->mFileType < LLAssetType::AT_COUNT)
384 { 402 {
385 mFileBlocks.insert(fileblock_map::value_type(*block, block)); 403 mFileBlocks.insert(fileblock_map::value_type(*block, block));
386 files_by_loc.addDataSorted(block); 404 files_by_loc.push_back(block);
387 } 405 }
388 else 406 else
389 if (block->mLength && block->mSize > 0) 407 if (block->mLength && block->mSize > 0)
@@ -419,22 +437,40 @@ LLVFS::LLVFS(const char *index_filename, const char *data_filename, const BOOL r
419 tmp_ptr += block->SERIAL_SIZE; 437 tmp_ptr += block->SERIAL_SIZE;
420 } 438 }
421 delete[] buffer; 439 delete[] buffer;
422 440
423 // discover all the free blocks 441 std::sort(
424 LLVFSFileBlock *last_file_block = (LLVFSFileBlock*)files_by_loc.getFirstData(); 442 files_by_loc.begin(),
425 443 files_by_loc.end(),
426 if (last_file_block) 444 LLVFSFileBlock::locationSortPredicate);
445
446 // There are 3 cases that have to be considered.
447 // 1. No blocks
448 // 2. One block.
449 // 3. Two or more blocks.
450 if (!files_by_loc.empty())
427 { 451 {
428 // check for empty space at the beginning 452 // cur walks through the list.
453 std::vector<LLVFSFileBlock*>::iterator cur = files_by_loc.begin();
454 std::vector<LLVFSFileBlock*>::iterator end = files_by_loc.end();
455 LLVFSFileBlock* last_file_block = *cur;
456
457 // Check to see if there is an empty space before the first file.
429 if (last_file_block->mLocation > 0) 458 if (last_file_block->mLocation > 0)
430 { 459 {
431 LLVFSBlock *block = new LLVFSBlock(0, last_file_block->mLocation); 460 // If so, create a free block.
432 addFreeBlock(block); 461 addFreeBlock(new LLVFSBlock(0, last_file_block->mLocation));
433 } 462 }
434 463
435 LLVFSFileBlock *cur_file_block; 464 // Walk through the 2nd+ block. If there is a free space
436 while ((cur_file_block = (LLVFSFileBlock*)files_by_loc.getNextData())) 465 // between cur_file_block and last_file_block, add it to
466 // the free space collection. This block will not need to
467 // run in the case there is only one entry in the VFS.
468 ++cur;
469 while( cur != end )
437 { 470 {
471 LLVFSFileBlock* cur_file_block = *cur;
472
473 // Dupe check on the block
438 if (cur_file_block->mLocation == last_file_block->mLocation 474 if (cur_file_block->mLocation == last_file_block->mLocation
439 && cur_file_block->mLength == last_file_block->mLength) 475 && cur_file_block->mLength == last_file_block->mLength)
440 { 476 {
@@ -451,21 +487,29 @@ LLVFS::LLVFS(const char *index_filename, const char *data_filename, const BOOL r
451 if (cur_file_block->mLength > 0) 487 if (cur_file_block->mLength > 0)
452 { 488 {
453 // convert to hole 489 // convert to hole
454 LLVFSBlock* block = new LLVFSBlock(cur_file_block->mLocation, 490 addFreeBlock(
455 cur_file_block->mLength); 491 new LLVFSBlock(
456 addFreeBlock(block); 492 cur_file_block->mLocation,
493 cur_file_block->mLength));
457 } 494 }
458 lockData(); // needed for sync() 495 lockData(); // needed for sync()
459 sync(cur_file_block, TRUE); // remove first on disk 496 sync(cur_file_block, TRUE); // remove first on disk
460 sync(last_file_block, TRUE); // remove last on disk 497 sync(last_file_block, TRUE); // remove last on disk
461 unlockData(); // needed for sync() 498 unlockData(); // needed for sync()
462 last_file_block = cur_file_block; 499 last_file_block = cur_file_block;
500 ++cur;
463 continue; 501 continue;
464 } 502 }
465 503
466 U32 loc = last_file_block->mLocation + last_file_block->mLength; 504 // Figure out where the last block ended.
505 U32 loc = last_file_block->mLocation+last_file_block->mLength;
506
507 // Figure out how much space there is between where
508 // the last block ended and this block begins.
467 S32 length = cur_file_block->mLocation - loc; 509 S32 length = cur_file_block->mLocation - loc;
468 510
511 // Check for more errors... Seeing if the current
512 // entry and the last entry make sense together.
469 if (length < 0 || loc < 0 || loc > data_size) 513 if (length < 0 || loc < 0 || loc > data_size)
470 { 514 {
471 // Invalid VFS 515 // Invalid VFS
@@ -487,27 +531,25 @@ LLVFS::LLVFS(const char *index_filename, const char *data_filename, const BOOL r
487 return; 531 return;
488 } 532 }
489 533
534 // we don't want to add empty blocks to the list...
490 if (length > 0) 535 if (length > 0)
491 { 536 {
492 LLVFSBlock *block = new LLVFSBlock(loc, length); 537 addFreeBlock(new LLVFSBlock(loc, length));
493 addFreeBlock(block);
494 } 538 }
495
496 last_file_block = cur_file_block; 539 last_file_block = cur_file_block;
540 ++cur;
497 } 541 }
498 542
499 // also note any empty space at the end 543 // also note any empty space at the end
500 U32 loc = last_file_block->mLocation + last_file_block->mLength; 544 U32 loc = last_file_block->mLocation + last_file_block->mLength;
501 if (loc < data_size) 545 if (loc < data_size)
502 { 546 {
503 LLVFSBlock *block = new LLVFSBlock(loc, data_size - loc); 547 addFreeBlock(new LLVFSBlock(loc, data_size - loc));
504 addFreeBlock(block);
505 } 548 }
506 } 549 }
507 else 550 else // There where no blocks in the file.
508 { 551 {
509 LLVFSBlock *first_block = new LLVFSBlock(0, data_size); 552 addFreeBlock(new LLVFSBlock(0, data_size));
510 addFreeBlock(first_block);
511 } 553 }
512 } 554 }
513 else 555 else
@@ -542,8 +584,13 @@ LLVFS::LLVFS(const char *index_filename, const char *data_filename, const BOOL r
542 if (!mReadOnly && mRemoveAfterCrash) 584 if (!mReadOnly && mRemoveAfterCrash)
543 { 585 {
544 char* marker = new char[strlen(mDataFilename) + strlen(".open") + 1]; 586 char* marker = new char[strlen(mDataFilename) + strlen(".open") + 1];
545 sprintf(marker, "%s.open", mDataFilename); 587 if (!marker)
546 FILE* marker_fp = LLFile::fopen(marker, "w"); 588 {
589 llerrs << "Out of memory in LLVFS::LLVFS(const char *index_filename, const char *data_filename, const BOOL read_only, const U32 presize, const BOOL remove_after_crash)" << llendl;
590 return;
591 }
592 sprintf(marker, "%s.open", mDataFilename); /* Flawfinder: ignore */
593 FILE* marker_fp = LLFile::fopen(marker, "w"); /* Flawfinder: ignore */
547 if (marker_fp) 594 if (marker_fp)
548 { 595 {
549 fclose(marker_fp); 596 fclose(marker_fp);
@@ -586,7 +633,12 @@ LLVFS::~LLVFS()
586 if (!mReadOnly && mRemoveAfterCrash) 633 if (!mReadOnly && mRemoveAfterCrash)
587 { 634 {
588 char* marker_file = new char[strlen(mDataFilename) + strlen(".open") + 1]; 635 char* marker_file = new char[strlen(mDataFilename) + strlen(".open") + 1];
589 sprintf(marker_file, "%s.open", mDataFilename); 636 if (marker_file == NULL)
637 {
638 llerrs << "Memory Allocation Failure" << llendl;
639 return;
640 }
641 sprintf(marker_file, "%s.open", mDataFilename); /* Flawfinder: ignore */
590 LLFile::remove(marker_file); 642 LLFile::remove(marker_file);
591 delete [] marker_file; 643 delete [] marker_file;
592 marker_file = NULL; 644 marker_file = NULL;
@@ -738,12 +790,17 @@ BOOL LLVFS::setMaxSize(const LLUUID &file_id, const LLAssetType::EType file_type
738 } 790 }
739 791
740 // round all sizes upward to KB increments 792 // round all sizes upward to KB increments
741 if (max_size & FILE_BLOCK_MASK) 793 // SJB: Need to not round for the new texture-pipeline code so we know the correct
794 // max file size. Need to investigate the potential problems with this...
795 if (file_type != LLAssetType::AT_TEXTURE)
742 { 796 {
743 max_size += FILE_BLOCK_MASK; 797 if (max_size & FILE_BLOCK_MASK)
744 max_size &= ~FILE_BLOCK_MASK; 798 {
745 } 799 max_size += FILE_BLOCK_MASK;
746 800 max_size &= ~FILE_BLOCK_MASK;
801 }
802 }
803
747 if (block && block->mLength > 0) 804 if (block && block->mLength > 0)
748 { 805 {
749 block->mAccessTime = (U32)time(NULL); 806 block->mAccessTime = (U32)time(NULL);
@@ -1230,6 +1287,7 @@ void LLVFS::eraseBlockLength(LLVFSBlock *block)
1230 S32 length = block->mLength; 1287 S32 length = block->mLength;
1231 blocks_length_map_t::iterator iter = mFreeBlocksByLength.lower_bound(length); 1288 blocks_length_map_t::iterator iter = mFreeBlocksByLength.lower_bound(length);
1232 blocks_length_map_t::iterator end = mFreeBlocksByLength.end(); 1289 blocks_length_map_t::iterator end = mFreeBlocksByLength.end();
1290 bool found_block = false;
1233 while(iter != end) 1291 while(iter != end)
1234 { 1292 {
1235 LLVFSBlock *tblock = iter->second; 1293 LLVFSBlock *tblock = iter->second;
@@ -1237,13 +1295,14 @@ void LLVFS::eraseBlockLength(LLVFSBlock *block)
1237 if (tblock == block) 1295 if (tblock == block)
1238 { 1296 {
1239 mFreeBlocksByLength.erase(iter); 1297 mFreeBlocksByLength.erase(iter);
1298 found_block = true;
1240 break; 1299 break;
1241 } 1300 }
1242 ++iter; 1301 ++iter;
1243 } 1302 }
1244 if (iter == end) 1303 if(!found_block)
1245 { 1304 {
1246 llerrs << "eraseBlock could not find block" << llendl; 1305 llwarns << "eraseBlock could not find block" << llendl;
1247 } 1306 }
1248} 1307}
1249 1308
@@ -1963,7 +2022,7 @@ LLString get_extension(LLAssetType::EType type)
1963 switch(type) 2022 switch(type)
1964 { 2023 {
1965 case LLAssetType::AT_TEXTURE: 2024 case LLAssetType::AT_TEXTURE:
1966 extension = ".jp2"; // ".j2c"; // IrfanView recognizes .jp2 -sjb 2025 extension = ".j2c";
1967 break; 2026 break;
1968 case LLAssetType::AT_SOUND: 2027 case LLAssetType::AT_SOUND:
1969 extension = ".ogg"; 2028 extension = ".ogg";
@@ -2033,7 +2092,7 @@ void LLVFS::dumpFiles()
2033 lockData(); 2092 lockData();
2034 2093
2035 LLString extension = get_extension(type); 2094 LLString extension = get_extension(type);
2036 LLString filename = id.getString() + extension; 2095 LLString filename = id.asString() + extension;
2037 llinfos << " Writing " << filename << llendl; 2096 llinfos << " Writing " << filename << llendl;
2038 apr_file_t* file = ll_apr_file_open(filename, LL_APR_WB); 2097 apr_file_t* file = ll_apr_file_open(filename, LL_APR_WB);
2039 ll_apr_file_write(file, buffer, size); 2098 ll_apr_file_write(file, buffer, size);
@@ -2064,7 +2123,7 @@ FILE *LLVFS::openAndLock(const char *filename, const char *mode, BOOL read_lock)
2064 // first test the lock in a non-destructive way 2123 // first test the lock in a non-destructive way
2065 if (strstr(mode, "w")) 2124 if (strstr(mode, "w"))
2066 { 2125 {
2067 fp = LLFile::fopen(filename, "rb"); 2126 fp = LLFile::fopen(filename, "rb"); /* Flawfinder: ignore */
2068 if (fp) 2127 if (fp)
2069 { 2128 {
2070 fd = fileno(fp); 2129 fd = fileno(fp);
@@ -2079,7 +2138,7 @@ FILE *LLVFS::openAndLock(const char *filename, const char *mode, BOOL read_lock)
2079 } 2138 }
2080 2139
2081 // now actually open the file for use 2140 // now actually open the file for use
2082 fp = LLFile::fopen(filename, mode); 2141 fp = LLFile::fopen(filename, mode); /* Flawfinder: ignore */
2083 if (fp) 2142 if (fp)
2084 { 2143 {
2085 fd = fileno(fp); 2144 fd = fileno(fp);
diff --git a/linden/indra/llvfs/llvfs_vc8.vcproj b/linden/indra/llvfs/llvfs_vc8.vcproj
new file mode 100644
index 0000000..7d4c0ae
--- /dev/null
+++ b/linden/indra/llvfs/llvfs_vc8.vcproj
@@ -0,0 +1,292 @@
1<?xml version="1.0" encoding="Windows-1252"?>
2<VisualStudioProject
3 ProjectType="Visual C++"
4 Version="8.00"
5 Name="llvfs"
6 ProjectGUID="{D37774F4-253D-4760-BF64-372A943224A1}"
7 Keyword="Win32Proj"
8 >
9 <Platforms>
10 <Platform
11 Name="Win32"
12 />
13 </Platforms>
14 <ToolFiles>
15 </ToolFiles>
16 <Configurations>
17 <Configuration
18 Name="Debug|Win32"
19 OutputDirectory="../lib_$(ConfigurationName)/i686-win32"
20 IntermediateDirectory="Debug"
21 ConfigurationType="4"
22 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
23 CharacterSet="1"
24 >
25 <Tool
26 Name="VCPreBuildEventTool"
27 />
28 <Tool
29 Name="VCCustomBuildTool"
30 />
31 <Tool
32 Name="VCXMLDataGeneratorTool"
33 />
34 <Tool
35 Name="VCWebServiceProxyGeneratorTool"
36 />
37 <Tool
38 Name="VCMIDLTool"
39 />
40 <Tool
41 Name="VCCLCompilerTool"
42 Optimization="0"
43 AdditionalIncludeDirectories="..\..\libraries\i686-win32\include;..\..\libraries\include\;..\llcommon;..\llmath"
44 PreprocessorDefinitions="WIN32;_DEBUG;_LIB;LL_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;LL_DEBUG"
45 MinimalRebuild="true"
46 BasicRuntimeChecks="3"
47 RuntimeLibrary="1"
48 StructMemberAlignment="4"
49 TreatWChar_tAsBuiltInType="false"
50 ForceConformanceInForLoopScope="true"
51 UsePrecompiledHeader="0"
52 WarningLevel="3"
53 WarnAsError="true"
54 Detect64BitPortabilityProblems="false"
55 DebugInformationFormat="4"
56 />
57 <Tool
58 Name="VCManagedResourceCompilerTool"
59 />
60 <Tool
61 Name="VCResourceCompilerTool"
62 />
63 <Tool
64 Name="VCPreLinkEventTool"
65 />
66 <Tool
67 Name="VCLibrarianTool"
68 OutputFile="$(OutDir)/llvfs.lib"
69 />
70 <Tool
71 Name="VCALinkTool"
72 />
73 <Tool
74 Name="VCXDCMakeTool"
75 />
76 <Tool
77 Name="VCBscMakeTool"
78 />
79 <Tool
80 Name="VCFxCopTool"
81 />
82 <Tool
83 Name="VCPostBuildEventTool"
84 />
85 </Configuration>
86 <Configuration
87 Name="Release|Win32"
88 OutputDirectory="../lib_$(ConfigurationName)/i686-win32"
89 IntermediateDirectory="Release"
90 ConfigurationType="4"
91 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
92 CharacterSet="1"
93 >
94 <Tool
95 Name="VCPreBuildEventTool"
96 />
97 <Tool
98 Name="VCCustomBuildTool"
99 />
100 <Tool
101 Name="VCXMLDataGeneratorTool"
102 />
103 <Tool
104 Name="VCWebServiceProxyGeneratorTool"
105 />
106 <Tool
107 Name="VCMIDLTool"
108 />
109 <Tool
110 Name="VCCLCompilerTool"
111 AdditionalIncludeDirectories="..\..\libraries\i686-win32\include;..\..\libraries\include\;..\llcommon;..\llmath"
112 PreprocessorDefinitions="WIN32;NDEBUG;_LIB;LL_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;LL_RELEASE"
113 RuntimeLibrary="0"
114 StructMemberAlignment="0"
115 TreatWChar_tAsBuiltInType="false"
116 ForceConformanceInForLoopScope="true"
117 UsePrecompiledHeader="0"
118 WarningLevel="3"
119 WarnAsError="true"
120 Detect64BitPortabilityProblems="false"
121 DebugInformationFormat="3"
122 />
123 <Tool
124 Name="VCManagedResourceCompilerTool"
125 />
126 <Tool
127 Name="VCResourceCompilerTool"
128 />
129 <Tool
130 Name="VCPreLinkEventTool"
131 />
132 <Tool
133 Name="VCLibrarianTool"
134 OutputFile="$(OutDir)/llvfs.lib"
135 />
136 <Tool
137 Name="VCALinkTool"
138 />
139 <Tool
140 Name="VCXDCMakeTool"
141 />
142 <Tool
143 Name="VCBscMakeTool"
144 />
145 <Tool
146 Name="VCFxCopTool"
147 />
148 <Tool
149 Name="VCPostBuildEventTool"
150 />
151 </Configuration>
152 <Configuration
153 Name="ReleaseNoOpt|Win32"
154 OutputDirectory="../lib_$(ConfigurationName)/i686-win32"
155 IntermediateDirectory="$(ConfigurationName)"
156 ConfigurationType="4"
157 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
158 CharacterSet="1"
159 >
160 <Tool
161 Name="VCPreBuildEventTool"
162 />
163 <Tool
164 Name="VCCustomBuildTool"
165 />
166 <Tool
167 Name="VCXMLDataGeneratorTool"
168 />
169 <Tool
170 Name="VCWebServiceProxyGeneratorTool"
171 />
172 <Tool
173 Name="VCMIDLTool"
174 />
175 <Tool
176 Name="VCCLCompilerTool"
177 Optimization="0"
178 AdditionalIncludeDirectories="..\..\libraries\i686-win32\include;..\..\libraries\include\;..\llcommon;..\llmath"
179 PreprocessorDefinitions="WIN32;NDEBUG;_LIB;LL_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;LL_RELEASE"
180 RuntimeLibrary="0"
181 StructMemberAlignment="0"
182 TreatWChar_tAsBuiltInType="false"
183 ForceConformanceInForLoopScope="true"
184 UsePrecompiledHeader="0"
185 WarningLevel="3"
186 WarnAsError="true"
187 Detect64BitPortabilityProblems="false"
188 DebugInformationFormat="3"
189 />
190 <Tool
191 Name="VCManagedResourceCompilerTool"
192 />
193 <Tool
194 Name="VCResourceCompilerTool"
195 />
196 <Tool
197 Name="VCPreLinkEventTool"
198 />
199 <Tool
200 Name="VCLibrarianTool"
201 OutputFile="$(OutDir)/llvfs.lib"
202 />
203 <Tool
204 Name="VCALinkTool"
205 />
206 <Tool
207 Name="VCXDCMakeTool"
208 />
209 <Tool
210 Name="VCBscMakeTool"
211 />
212 <Tool
213 Name="VCFxCopTool"
214 />
215 <Tool
216 Name="VCPostBuildEventTool"
217 />
218 </Configuration>
219 </Configurations>
220 <References>
221 </References>
222 <Files>
223 <Filter
224 Name="Source Files"
225 Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
226 UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
227 >
228 <File
229 RelativePath=".\lldir.cpp"
230 >
231 </File>
232 <File
233 RelativePath=".\lldir_win32.cpp"
234 >
235 </File>
236 <File
237 RelativePath=".\lllfsthread.cpp"
238 >
239 </File>
240 <File
241 RelativePath=".\llvfile.cpp"
242 >
243 </File>
244 <File
245 RelativePath=".\llvfs.cpp"
246 >
247 </File>
248 <File
249 RelativePath=".\llvfsthread.cpp"
250 >
251 </File>
252 </Filter>
253 <Filter
254 Name="Header Files"
255 Filter="h;hpp;hxx;hm;inl;inc;xsd"
256 UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
257 >
258 <File
259 RelativePath=".\lldir.h"
260 >
261 </File>
262 <File
263 RelativePath=".\lldir_win32.h"
264 >
265 </File>
266 <File
267 RelativePath=".\lllfsthread.h"
268 >
269 </File>
270 <File
271 RelativePath=".\llvfile.h"
272 >
273 </File>
274 <File
275 RelativePath=".\llvfs.h"
276 >
277 </File>
278 <File
279 RelativePath=".\llvfsthread.h"
280 >
281 </File>
282 </Filter>
283 <Filter
284 Name="Resource Files"
285 Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
286 UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
287 >
288 </Filter>
289 </Files>
290 <Globals>
291 </Globals>
292</VisualStudioProject>
diff --git a/linden/indra/llvfs/llvfsthread.cpp b/linden/indra/llvfs/llvfsthread.cpp
index be23bd5..9226230 100644
--- a/linden/indra/llvfs/llvfsthread.cpp
+++ b/linden/indra/llvfs/llvfsthread.cpp
@@ -39,10 +39,10 @@
39//============================================================================ 39//============================================================================
40// Run on MAIN thread 40// Run on MAIN thread
41//static 41//static
42void LLVFSThread::initClass(bool local_is_threaded, bool local_run_always) 42void LLVFSThread::initClass(bool local_is_threaded)
43{ 43{
44 llassert(sLocal == NULL); 44 llassert(sLocal == NULL);
45 sLocal = new LLVFSThread(local_is_threaded, local_run_always); 45 sLocal = new LLVFSThread(local_is_threaded);
46} 46}
47 47
48//static 48//static
@@ -66,8 +66,8 @@ void LLVFSThread::cleanupClass()
66 66
67//---------------------------------------------------------------------------- 67//----------------------------------------------------------------------------
68 68
69LLVFSThread::LLVFSThread(bool threaded, bool runalways) : 69LLVFSThread::LLVFSThread(bool threaded) :
70 LLQueuedThread("VFS", threaded, runalways) 70 LLQueuedThread("VFS", threaded)
71{ 71{
72} 72}
73 73
@@ -164,38 +164,26 @@ S32 LLVFSThread::writeImmediate(LLVFS* vfs, const LLUUID &file_id, const LLAsset
164} 164}
165 165
166 166
167LLVFSThread::handle_t LLVFSThread::rename(LLVFS* vfs, const LLUUID &file_id, const LLAssetType::EType file_type, 167// LLVFSThread::handle_t LLVFSThread::rename(LLVFS* vfs, const LLUUID &file_id, const LLAssetType::EType file_type,
168 const LLUUID &new_id, const LLAssetType::EType new_type, U32 flags) 168// const LLUUID &new_id, const LLAssetType::EType new_type, U32 flags)
169{ 169// {
170 handle_t handle = generateHandle(); 170// handle_t handle = generateHandle();
171 171
172 LLUUID* new_idp = new LLUUID(new_id); // deleted with Request 172// LLUUID* new_idp = new LLUUID(new_id); // deleted with Request
173 // new_type is passed as "numbytes" 173// // new_type is passed as "numbytes"
174 Request* req = new Request(handle, 0, flags, FILE_RENAME, vfs, file_id, file_type, 174// Request* req = new Request(handle, 0, flags, FILE_RENAME, vfs, file_id, file_type,
175 (U8*)new_idp, 0, (S32)new_type); 175// (U8*)new_idp, 0, (S32)new_type);
176 176
177 bool res = addRequest(req); 177// bool res = addRequest(req);
178 if (!res) 178// if (!res)
179 { 179// {
180 llerrs << "LLVFSThread::read called after LLVFSThread::cleanupClass()" << llendl; 180// llerrs << "LLVFSThread::read called after LLVFSThread::cleanupClass()" << llendl;
181 req->deleteRequest(); 181// req->deleteRequest();
182 handle = nullHandle(); 182// handle = nullHandle();
183 } 183// }
184 184
185 return handle; 185// return handle;
186} 186// }
187
188//============================================================================
189// Runs on its OWN thread
190
191bool LLVFSThread::processRequest(QueuedRequest* qreq)
192{
193 Request *req = (Request*)qreq;
194
195 bool complete = req->processIO();
196
197 return complete;
198}
199 187
200//============================================================================ 188//============================================================================
201 189
@@ -242,7 +230,7 @@ LLVFSThread::Request::Request(handle_t handle, U32 priority, U32 flags,
242} 230}
243 231
244// dec locks as soon as a request finishes 232// dec locks as soon as a request finishes
245void LLVFSThread::Request::finishRequest() 233void LLVFSThread::Request::finishRequest(bool completed)
246{ 234{
247 if (mOperation == FILE_WRITE) 235 if (mOperation == FILE_WRITE)
248 { 236 {
@@ -260,13 +248,13 @@ void LLVFSThread::Request::finishRequest()
260 248
261void LLVFSThread::Request::deleteRequest() 249void LLVFSThread::Request::deleteRequest()
262{ 250{
263 if (getStatus() == STATUS_QUEUED || getStatus() == STATUS_ABORT) 251 if (getStatus() == STATUS_QUEUED)
264 { 252 {
265 llerrs << "Attempt to delete a queued LLVFSThread::Request!" << llendl; 253 llerrs << "Attempt to delete a queued LLVFSThread::Request!" << llendl;
266 } 254 }
267 if (mOperation == FILE_WRITE) 255 if (mOperation == FILE_WRITE)
268 { 256 {
269 if (mFlags & AUTO_DELETE) 257 if (mFlags & FLAG_AUTO_DELETE)
270 { 258 {
271 delete [] mBuffer; 259 delete [] mBuffer;
272 } 260 }
@@ -279,7 +267,7 @@ void LLVFSThread::Request::deleteRequest()
279 LLQueuedThread::QueuedRequest::deleteRequest(); 267 LLQueuedThread::QueuedRequest::deleteRequest();
280} 268}
281 269
282bool LLVFSThread::Request::processIO() 270bool LLVFSThread::Request::processRequest()
283{ 271{
284 bool complete = false; 272 bool complete = false;
285 if (mOperation == FILE_READ) 273 if (mOperation == FILE_READ)
@@ -302,7 +290,7 @@ bool LLVFSThread::Request::processIO()
302 mVFS->renameFile(mFileID, mFileType, *new_idp, new_type); 290 mVFS->renameFile(mFileID, mFileType, *new_idp, new_type);
303 mFileID = *new_idp; 291 mFileID = *new_idp;
304 complete = true; 292 complete = true;
305 //llinfos << llformat("LLVFSThread::WRITE '%s': %d bytes arg:%d",getFilename(),mBytesRead) << llendl; 293 //llinfos << llformat("LLVFSThread::RENAME '%s': %d bytes arg:%d",getFilename(),mBytesRead) << llendl;
306 } 294 }
307 else 295 else
308 { 296 {
diff --git a/linden/indra/llvfs/llvfsthread.h b/linden/indra/llvfs/llvfsthread.h
index c3a5a55..3c90808 100644
--- a/linden/indra/llvfs/llvfsthread.h
+++ b/linden/indra/llvfs/llvfsthread.h
@@ -83,15 +83,14 @@ public:
83 } 83 }
84 std::string getFilename() 84 std::string getFilename()
85 { 85 {
86 char tbuf[40]; 86 char tbuf[40]; /* Flawfinder: ignore */
87 mFileID.toString(tbuf); 87 mFileID.toString(tbuf);
88 return std::string(tbuf); 88 return std::string(tbuf);
89 } 89 }
90 90
91 /*virtual*/ void finishRequest(); 91 /*virtual*/ bool processRequest();
92 /*virtual*/ void finishRequest(bool completed);
92 /*virtual*/ void deleteRequest(); 93 /*virtual*/ void deleteRequest();
93
94 bool processIO();
95 94
96 private: 95 private:
97 operation_t mOperation; 96 operation_t mOperation;
@@ -109,19 +108,20 @@ public:
109 //------------------------------------------------------------------------ 108 //------------------------------------------------------------------------
110public: 109public:
111 static std::string sDataPath; 110 static std::string sDataPath;
112 static void setDataPath(const std::string& path) { sDataPath = path; } 111 static LLVFSThread* sLocal; // Default worker thread
113 112
114public: 113public:
115 LLVFSThread(bool threaded = TRUE, bool runalways = TRUE); 114 LLVFSThread(bool threaded = TRUE);
116 ~LLVFSThread(); 115 ~LLVFSThread();
117 116
118 // Return a Request handle 117 // Return a Request handle
119 handle_t read(LLVFS* vfs, const LLUUID &file_id, const LLAssetType::EType file_type, 118 handle_t read(LLVFS* vfs, const LLUUID &file_id, const LLAssetType::EType file_type, /* Flawfinder: ignore */
120 U8* buffer, S32 offset, S32 numbytes, U32 pri=PRIORITY_NORMAL, U32 flags = 0); 119 U8* buffer, S32 offset, S32 numbytes, U32 pri=PRIORITY_NORMAL, U32 flags = 0);
121 handle_t write(LLVFS* vfs, const LLUUID &file_id, const LLAssetType::EType file_type, 120 handle_t write(LLVFS* vfs, const LLUUID &file_id, const LLAssetType::EType file_type,
122 U8* buffer, S32 offset, S32 numbytes, U32 flags); 121 U8* buffer, S32 offset, S32 numbytes, U32 flags);
123 handle_t rename(LLVFS* vfs, const LLUUID &file_id, const LLAssetType::EType file_type, 122 // SJB: rename seems to have issues, especially when threaded
124 const LLUUID &new_id, const LLAssetType::EType new_type, U32 flags); 123// handle_t rename(LLVFS* vfs, const LLUUID &file_id, const LLAssetType::EType file_type,
124// const LLUUID &new_id, const LLAssetType::EType new_type, U32 flags);
125 // Return number of bytes read 125 // Return number of bytes read
126 S32 readImmediate(LLVFS* vfs, const LLUUID &file_id, const LLAssetType::EType file_type, 126 S32 readImmediate(LLVFS* vfs, const LLUUID &file_id, const LLAssetType::EType file_type,
127 U8* buffer, S32 offset, S32 numbytes); 127 U8* buffer, S32 offset, S32 numbytes);
@@ -130,12 +130,11 @@ public:
130 130
131 /*virtual*/ bool processRequest(QueuedRequest* req); 131 /*virtual*/ bool processRequest(QueuedRequest* req);
132 132
133 static void initClass(bool local_is_threaded = TRUE, bool run_always = TRUE); // Setup sLocal 133public:
134 static void initClass(bool local_is_threaded = TRUE); // Setup sLocal
134 static S32 updateClass(U32 ms_elapsed); 135 static S32 updateClass(U32 ms_elapsed);
135 static void cleanupClass(); // Delete sLocal 136 static void cleanupClass(); // Delete sLocal
136 137 static void setDataPath(const std::string& path) { sDataPath = path; }
137public:
138 static LLVFSThread* sLocal; // Default worker thread
139}; 138};
140 139
141//============================================================================ 140//============================================================================
diff --git a/linden/indra/llwindow/lldxhardware.cpp b/linden/indra/llwindow/lldxhardware.cpp
index 5dd632b..b2e1b04 100644
--- a/linden/indra/llwindow/lldxhardware.cpp
+++ b/linden/indra/llwindow/lldxhardware.cpp
@@ -66,16 +66,16 @@ std::string get_string(IDxDiagContainer *containerp, WCHAR *wszPropName)
66 switch( var.vt ) 66 switch( var.vt )
67 { 67 {
68 case VT_UI4: 68 case VT_UI4:
69 swprintf( wszPropValue, L"%d", var.ulVal ); 69 swprintf( wszPropValue, L"%d", var.ulVal ); /* Flawfinder: ignore */
70 break; 70 break;
71 case VT_I4: 71 case VT_I4:
72 swprintf( wszPropValue, L"%d", var.lVal ); 72 swprintf( wszPropValue, L"%d", var.lVal ); /* Flawfinder: ignore */
73 break; 73 break;
74 case VT_BOOL: 74 case VT_BOOL:
75 wcscpy( wszPropValue, (var.boolVal) ? L"true" : L"false" ); 75 wcscpy( wszPropValue, (var.boolVal) ? L"true" : L"false" ); /* Flawfinder: ignore */
76 break; 76 break;
77 case VT_BSTR: 77 case VT_BSTR:
78 wcsncpy( wszPropValue, var.bstrVal, 255 ); 78 wcsncpy( wszPropValue, var.bstrVal, 255 ); /* Flawfinder: ignore */
79 wszPropValue[255] = 0; 79 wszPropValue[255] = 0;
80 break; 80 break;
81 } 81 }
diff --git a/linden/indra/llwindow/llgl.cpp b/linden/indra/llwindow/llgl.cpp
index ec22907..aabe9da 100644
--- a/linden/indra/llwindow/llgl.cpp
+++ b/linden/indra/llwindow/llgl.cpp
@@ -44,6 +44,7 @@
44 44
45#include "llglheaders.h" 45#include "llglheaders.h"
46 46
47#define LL_DEBUG_GL 1
47 48
48#if LL_LINUX && !LL_MESA_HEADLESS 49#if LL_LINUX && !LL_MESA_HEADLESS
49// The __APPLE__ hack is to make glh_extensions.h not symbol-clash horribly 50// The __APPLE__ hack is to make glh_extensions.h not symbol-clash horribly
@@ -118,6 +119,10 @@ PFNGLGETQUERYIVARBPROC glGetQueryivARB = NULL;
118PFNGLGETQUERYOBJECTIVARBPROC glGetQueryObjectivARB = NULL; 119PFNGLGETQUERYOBJECTIVARBPROC glGetQueryObjectivARB = NULL;
119PFNGLGETQUERYOBJECTUIVARBPROC glGetQueryObjectuivARB = NULL; 120PFNGLGETQUERYOBJECTUIVARBPROC glGetQueryObjectuivARB = NULL;
120 121
122// GL_ARB_point_parameters
123PFNGLPOINTPARAMETERFARBPROC glPointParameterfARB = NULL;
124PFNGLPOINTPARAMETERFVARBPROC glPointParameterfvARB = NULL;
125
121//shader object prototypes 126//shader object prototypes
122PFNGLDELETEOBJECTARBPROC glDeleteObjectARB = NULL; 127PFNGLDELETEOBJECTARBPROC glDeleteObjectARB = NULL;
123PFNGLGETHANDLEARBPROC glGetHandleARB = NULL; 128PFNGLGETHANDLEARBPROC glGetHandleARB = NULL;
@@ -267,6 +272,7 @@ LLGLManager::LLGLManager()
267 mHasVertexShader = FALSE; 272 mHasVertexShader = FALSE;
268 mHasFragmentShader = FALSE; 273 mHasFragmentShader = FALSE;
269 mHasShaderObjects = FALSE; 274 mHasShaderObjects = FALSE;
275 mHasPointParameters = FALSE;
270 276
271#if LL_WINDOWS 277#if LL_WINDOWS
272 mHasWGLARBPixelFormat = FALSE; 278 mHasWGLARBPixelFormat = FALSE;
@@ -290,7 +296,6 @@ LLGLManager::LLGLManager()
290 mVRAM = 0; 296 mVRAM = 0;
291 mGLMaxVertexRange = 0; 297 mGLMaxVertexRange = 0;
292 mGLMaxIndexRange = 0; 298 mGLMaxIndexRange = 0;
293 mSoftwareBlendSSE = TRUE;
294} 299}
295 300
296//--------------------------------------------------------------------- 301//---------------------------------------------------------------------
@@ -506,8 +511,6 @@ extern LLCPUInfo gSysCPU;
506 511
507void LLGLManager::initExtensions() 512void LLGLManager::initExtensions()
508{ 513{
509 mSoftwareBlendSSE = gSysCPU.hasSSE();
510
511#if LL_MESA_HEADLESS 514#if LL_MESA_HEADLESS
512# if GL_ARB_multitexture 515# if GL_ARB_multitexture
513 mHasMultitexture = TRUE; 516 mHasMultitexture = TRUE;
@@ -538,6 +541,7 @@ void LLGLManager::initExtensions()
538 mHasCubeMap = FALSE; 541 mHasCubeMap = FALSE;
539 mHasATIVAO = FALSE; 542 mHasATIVAO = FALSE;
540 mHasOcclusionQuery = FALSE; 543 mHasOcclusionQuery = FALSE;
544 mHasPointParameters = FALSE;
541 mHasShaderObjects = FALSE; 545 mHasShaderObjects = FALSE;
542 mHasVertexShader = FALSE; 546 mHasVertexShader = FALSE;
543 mHasFragmentShader = FALSE; 547 mHasFragmentShader = FALSE;
@@ -553,9 +557,12 @@ void LLGLManager::initExtensions()
553 mHasCubeMap = ExtensionExists("GL_ARB_texture_cube_map", gGLHExts.mSysExts); 557 mHasCubeMap = ExtensionExists("GL_ARB_texture_cube_map", gGLHExts.mSysExts);
554 mHasARBEnvCombine = ExtensionExists("GL_ARB_texture_env_combine", gGLHExts.mSysExts); 558 mHasARBEnvCombine = ExtensionExists("GL_ARB_texture_env_combine", gGLHExts.mSysExts);
555 mHasCompressedTextures = glh_init_extensions("GL_ARB_texture_compression"); 559 mHasCompressedTextures = glh_init_extensions("GL_ARB_texture_compression");
556 mHasVertexBufferObject = ExtensionExists("GL_ARB_vertex_buffer_object", gGLHExts.mSysExts);
557 mHasATIVAO = ExtensionExists("GL_ATI_vertex_array_object", gGLHExts.mSysExts); 560 mHasATIVAO = ExtensionExists("GL_ATI_vertex_array_object", gGLHExts.mSysExts);
558 mHasOcclusionQuery = ExtensionExists("GL_ARB_occlusion_query", gGLHExts.mSysExts); 561 mHasOcclusionQuery = ExtensionExists("GL_ARB_occlusion_query", gGLHExts.mSysExts);
562 mHasVertexBufferObject = ExtensionExists("GL_ARB_vertex_buffer_object", gGLHExts.mSysExts);
563#if !LL_DARWIN
564 mHasPointParameters = !mIsATI && ExtensionExists("GL_ARB_point_parameters", gGLHExts.mSysExts);
565#endif
559 mHasShaderObjects = ExtensionExists("GL_ARB_shader_objects", gGLHExts.mSysExts) && ExtensionExists("GL_ARB_shading_language_100", gGLHExts.mSysExts); 566 mHasShaderObjects = ExtensionExists("GL_ARB_shader_objects", gGLHExts.mSysExts) && ExtensionExists("GL_ARB_shading_language_100", gGLHExts.mSysExts);
560 mHasVertexShader = ExtensionExists("GL_ARB_vertex_program", gGLHExts.mSysExts) && ExtensionExists("GL_ARB_vertex_shader", gGLHExts.mSysExts) 567 mHasVertexShader = ExtensionExists("GL_ARB_vertex_program", gGLHExts.mSysExts) && ExtensionExists("GL_ARB_vertex_shader", gGLHExts.mSysExts)
561 && ExtensionExists("GL_ARB_shading_language_100", gGLHExts.mSysExts); 568 && ExtensionExists("GL_ARB_shading_language_100", gGLHExts.mSysExts);
@@ -565,7 +572,7 @@ void LLGLManager::initExtensions()
565#if LL_LINUX 572#if LL_LINUX
566 // Our extension support for the Linux Client is very young with some 573 // Our extension support for the Linux Client is very young with some
567 // potential driver gotchas, so offer a semi-secret way to turn it off. 574 // potential driver gotchas, so offer a semi-secret way to turn it off.
568 if (getenv("LL_GL_NOEXT")) 575 if (getenv("LL_GL_NOEXT")) /* Flawfinder: ignore */
569 { 576 {
570 //mHasMultitexture = FALSE; // NEEDED! 577 //mHasMultitexture = FALSE; // NEEDED!
571 mHasARBEnvCombine = FALSE; 578 mHasARBEnvCombine = FALSE;
@@ -580,13 +587,14 @@ void LLGLManager::initExtensions()
580 mHasCubeMap = FALSE; 587 mHasCubeMap = FALSE;
581 mHasATIVAO = FALSE; 588 mHasATIVAO = FALSE;
582 mHasOcclusionQuery = FALSE; 589 mHasOcclusionQuery = FALSE;
590 mHasPointParameters = FALSE;
583 mHasShaderObjects = FALSE; 591 mHasShaderObjects = FALSE;
584 mHasVertexShader = FALSE; 592 mHasVertexShader = FALSE;
585 mHasFragmentShader = FALSE; 593 mHasFragmentShader = FALSE;
586 llwarns << "GL extension support DISABLED via LL_GL_NOEXT" << 594 llwarns << "GL extension support DISABLED via LL_GL_NOEXT" <<
587 llendl; 595 llendl;
588 } 596 }
589 else if (getenv("LL_GL_BASICEXT")) 597 else if (getenv("LL_GL_BASICEXT")) /* Flawfinder: ignore */
590 { 598 {
591 // This switch attempts to turn off all support for exotic 599 // This switch attempts to turn off all support for exotic
592 // extensions which I believe correspond to fatal driver 600 // extensions which I believe correspond to fatal driver
@@ -597,6 +605,7 @@ void LLGLManager::initExtensions()
597 mHasNVVertexArrayRange = FALSE; 605 mHasNVVertexArrayRange = FALSE;
598 mHasNVFence = FALSE; 606 mHasNVFence = FALSE;
599 mHasAnisotropic = FALSE; 607 mHasAnisotropic = FALSE;
608 mHasCubeMap = FALSE; // apparently fatal on Intel 915 & similar
600 mHasATIVAO = FALSE; 609 mHasATIVAO = FALSE;
601 mHasOcclusionQuery = FALSE; // source of many ATI system hangs 610 mHasOcclusionQuery = FALSE; // source of many ATI system hangs
602 mHasShaderObjects = FALSE; 611 mHasShaderObjects = FALSE;
@@ -605,12 +614,12 @@ void LLGLManager::initExtensions()
605 llwarns << "GL extension support forced to SIMPLE level via LL_GL_BASICEXT" << 614 llwarns << "GL extension support forced to SIMPLE level via LL_GL_BASICEXT" <<
606 llendl; 615 llendl;
607 } 616 }
608 if (getenv("LL_GL_BLACKLIST")) 617 if (getenv("LL_GL_BLACKLIST")) /* Flawfinder: ignore */
609 { 618 {
610 // This lets advanced troubleshooters disable specific 619 // This lets advanced troubleshooters disable specific
611 // GL extensions to isolate problems with their hardware. 620 // GL extensions to isolate problems with their hardware.
612 // SL-28126 621 // SL-28126
613 const char *const blacklist = getenv("LL_GL_BLACKLIST"); 622 const char *const blacklist = getenv("LL_GL_BLACKLIST"); /* Flawfinder: ignore */
614 llwarns << "GL extension support partially disabled via LL_GL_BLACKLIST: " << blacklist << llendl; 623 llwarns << "GL extension support partially disabled via LL_GL_BLACKLIST: " << blacklist << llendl;
615 if (strchr(blacklist,'a')) mHasARBEnvCombine = FALSE; 624 if (strchr(blacklist,'a')) mHasARBEnvCombine = FALSE;
616 if (strchr(blacklist,'b')) mHasCompressedTextures = FALSE; 625 if (strchr(blacklist,'b')) mHasCompressedTextures = FALSE;
@@ -621,12 +630,13 @@ void LLGLManager::initExtensions()
621 if (strchr(blacklist,'g')) mHasNVFence = FALSE;//S 630 if (strchr(blacklist,'g')) mHasNVFence = FALSE;//S
622 if (strchr(blacklist,'h')) mHasSeparateSpecularColor = FALSE; 631 if (strchr(blacklist,'h')) mHasSeparateSpecularColor = FALSE;
623 if (strchr(blacklist,'i')) mHasAnisotropic = FALSE;//S 632 if (strchr(blacklist,'i')) mHasAnisotropic = FALSE;//S
624 if (strchr(blacklist,'j')) mHasCubeMap = FALSE; 633 if (strchr(blacklist,'j')) mHasCubeMap = FALSE;//S
625 if (strchr(blacklist,'k')) mHasATIVAO = FALSE;//S 634 if (strchr(blacklist,'k')) mHasATIVAO = FALSE;//S
626 if (strchr(blacklist,'l')) mHasOcclusionQuery = FALSE; 635 if (strchr(blacklist,'l')) mHasOcclusionQuery = FALSE;
627 if (strchr(blacklist,'m')) mHasShaderObjects = FALSE;//S 636 if (strchr(blacklist,'m')) mHasShaderObjects = FALSE;//S
628 if (strchr(blacklist,'n')) mHasVertexShader = FALSE;//S 637 if (strchr(blacklist,'n')) mHasVertexShader = FALSE;//S
629 if (strchr(blacklist,'o')) mHasFragmentShader = FALSE;//S 638 if (strchr(blacklist,'o')) mHasFragmentShader = FALSE;//S
639 if (strchr(blacklist,'p')) mHasPointParameters = FALSE;//S
630 } 640 }
631#endif // LL_LINUX 641#endif // LL_LINUX
632 642
@@ -677,6 +687,10 @@ void LLGLManager::initExtensions()
677 { 687 {
678 llinfos << "Couldn't initialize GL_ARB_occlusion_query" << llendl; 688 llinfos << "Couldn't initialize GL_ARB_occlusion_query" << llendl;
679 } 689 }
690 if (!mHasPointParameters)
691 {
692 llinfos << "Couldn't initialize GL_ARB_point_parameters" << llendl;
693 }
680 if (!mHasShaderObjects) 694 if (!mHasShaderObjects)
681 { 695 {
682 llinfos << "Couldn't initialize GL_ARB_shader_objects" << llendl; 696 llinfos << "Couldn't initialize GL_ARB_shader_objects" << llendl;
@@ -741,16 +755,23 @@ void LLGLManager::initExtensions()
741 if (mHasVertexBufferObject) 755 if (mHasVertexBufferObject)
742 { 756 {
743 glBindBufferARB = (PFNGLBINDBUFFERARBPROC)GLH_EXT_GET_PROC_ADDRESS("glBindBufferARB"); 757 glBindBufferARB = (PFNGLBINDBUFFERARBPROC)GLH_EXT_GET_PROC_ADDRESS("glBindBufferARB");
744 glDeleteBuffersARB = (PFNGLDELETEBUFFERSARBPROC)GLH_EXT_GET_PROC_ADDRESS("glDeleteBuffersARB"); 758 if (glBindBufferARB)
745 glGenBuffersARB = (PFNGLGENBUFFERSARBPROC)GLH_EXT_GET_PROC_ADDRESS("glGenBuffersARB"); 759 {
746 glIsBufferARB = (PFNGLISBUFFERARBPROC)GLH_EXT_GET_PROC_ADDRESS("glIsBufferARB"); 760 glDeleteBuffersARB = (PFNGLDELETEBUFFERSARBPROC)GLH_EXT_GET_PROC_ADDRESS("glDeleteBuffersARB");
747 glBufferDataARB = (PFNGLBUFFERDATAARBPROC)GLH_EXT_GET_PROC_ADDRESS("glBufferDataARB"); 761 glGenBuffersARB = (PFNGLGENBUFFERSARBPROC)GLH_EXT_GET_PROC_ADDRESS("glGenBuffersARB");
748 glBufferSubDataARB = (PFNGLBUFFERSUBDATAARBPROC)GLH_EXT_GET_PROC_ADDRESS("glBufferSubDataARB"); 762 glIsBufferARB = (PFNGLISBUFFERARBPROC)GLH_EXT_GET_PROC_ADDRESS("glIsBufferARB");
749 glGetBufferSubDataARB = (PFNGLGETBUFFERSUBDATAARBPROC)GLH_EXT_GET_PROC_ADDRESS("glGetBufferSubDataARB"); 763 glBufferDataARB = (PFNGLBUFFERDATAARBPROC)GLH_EXT_GET_PROC_ADDRESS("glBufferDataARB");
750 glMapBufferARB = (PFNGLMAPBUFFERARBPROC)GLH_EXT_GET_PROC_ADDRESS("glMapBufferARB"); 764 glBufferSubDataARB = (PFNGLBUFFERSUBDATAARBPROC)GLH_EXT_GET_PROC_ADDRESS("glBufferSubDataARB");
751 glUnmapBufferARB = (PFNGLUNMAPBUFFERARBPROC)GLH_EXT_GET_PROC_ADDRESS("glUnmapBufferARB"); 765 glGetBufferSubDataARB = (PFNGLGETBUFFERSUBDATAARBPROC)GLH_EXT_GET_PROC_ADDRESS("glGetBufferSubDataARB");
752 glGetBufferParameterivARB = (PFNGLGETBUFFERPARAMETERIVARBPROC)GLH_EXT_GET_PROC_ADDRESS("glGetBufferParameterivARB"); 766 glMapBufferARB = (PFNGLMAPBUFFERARBPROC)GLH_EXT_GET_PROC_ADDRESS("glMapBufferARB");
753 glGetBufferPointervARB = (PFNGLGETBUFFERPOINTERVARBPROC)GLH_EXT_GET_PROC_ADDRESS("glGetBufferPointervARB"); 767 glUnmapBufferARB = (PFNGLUNMAPBUFFERARBPROC)GLH_EXT_GET_PROC_ADDRESS("glUnmapBufferARB");
768 glGetBufferParameterivARB = (PFNGLGETBUFFERPARAMETERIVARBPROC)GLH_EXT_GET_PROC_ADDRESS("glGetBufferParameterivARB");
769 glGetBufferPointervARB = (PFNGLGETBUFFERPOINTERVARBPROC)GLH_EXT_GET_PROC_ADDRESS("glGetBufferPointervARB");
770 }
771 else
772 {
773 mHasVertexBufferObject = FALSE;
774 }
754 } 775 }
755 if (mHasATIVAO) 776 if (mHasATIVAO)
756 { 777 {
@@ -797,6 +818,11 @@ void LLGLManager::initExtensions()
797 glGetQueryObjectivARB = (PFNGLGETQUERYOBJECTIVARBPROC)GLH_EXT_GET_PROC_ADDRESS("glGetQueryObjectivARB"); 818 glGetQueryObjectivARB = (PFNGLGETQUERYOBJECTIVARBPROC)GLH_EXT_GET_PROC_ADDRESS("glGetQueryObjectivARB");
798 glGetQueryObjectuivARB = (PFNGLGETQUERYOBJECTUIVARBPROC)GLH_EXT_GET_PROC_ADDRESS("glGetQueryObjectuivARB"); 819 glGetQueryObjectuivARB = (PFNGLGETQUERYOBJECTUIVARBPROC)GLH_EXT_GET_PROC_ADDRESS("glGetQueryObjectuivARB");
799 } 820 }
821 if (mHasPointParameters)
822 {
823 glPointParameterfARB = (PFNGLPOINTPARAMETERFARBPROC)GLH_EXT_GET_PROC_ADDRESS("glPointParameterfARB");
824 glPointParameterfvARB = (PFNGLPOINTPARAMETERFVARBPROC)GLH_EXT_GET_PROC_ADDRESS("glPointParameterfvARB");
825 }
800 if (mHasShaderObjects) 826 if (mHasShaderObjects)
801 { 827 {
802 glDeleteObjectARB = (PFNGLDELETEOBJECTARBPROC) GLH_EXT_GET_PROC_ADDRESS("glDeleteObjectARB"); 828 glDeleteObjectARB = (PFNGLDELETEOBJECTARBPROC) GLH_EXT_GET_PROC_ADDRESS("glDeleteObjectARB");
@@ -991,6 +1017,7 @@ void LLGLState::dumpStates()
991 1017
992void LLGLState::checkStates() 1018void LLGLState::checkStates()
993{ 1019{
1020#if LL_DEBUG_GL
994 stop_glerror(); 1021 stop_glerror();
995 1022
996 GLint activeTexture; 1023 GLint activeTexture;
@@ -1025,10 +1052,12 @@ void LLGLState::checkStates()
1025 } 1052 }
1026 1053
1027 stop_glerror(); 1054 stop_glerror();
1055#endif
1028} 1056}
1029 1057
1030void LLGLState::checkTextureChannels() 1058void LLGLState::checkTextureChannels()
1031{ 1059{
1060#if LL_DEBUG_GL
1032 GLint activeTexture; 1061 GLint activeTexture;
1033 glGetIntegerv(GL_ACTIVE_TEXTURE_ARB, &activeTexture); 1062 glGetIntegerv(GL_ACTIVE_TEXTURE_ARB, &activeTexture);
1034 1063
@@ -1109,42 +1138,103 @@ void LLGLState::checkTextureChannels()
1109 { 1138 {
1110 LL_GL_ERRS << "GL texture state corruption detected." << llendl; 1139 LL_GL_ERRS << "GL texture state corruption detected." << llendl;
1111 } 1140 }
1141#endif
1112} 1142}
1113 1143
1114void LLGLState::checkClientArrays() 1144void LLGLState::checkClientArrays(U32 data_mask)
1115{ 1145{
1146#if LL_DEBUG_GL
1147 stop_glerror();
1116 BOOL error = FALSE; 1148 BOOL error = FALSE;
1117 static const char* label[] = 1149 static const char* label[] =
1118 { 1150 {
1119 //"GL_INDEX_ARRAY", 1151 "GL_VERTEX_ARRAY",
1120 "GL_NORMAL_ARRAY", 1152 "GL_NORMAL_ARRAY",
1121 //"GL_VERTEX_ARRAY",
1122 "GL_COLOR_ARRAY", 1153 "GL_COLOR_ARRAY",
1123 "GL_TEXTURE_COORD_ARRAY" 1154 "GL_TEXTURE_COORD_ARRAY"
1124 }; 1155 };
1125 1156
1126 static GLint value[] = 1157 static GLint value[] =
1127 { 1158 {
1128 //GL_INDEX_ARRAY, 1159 GL_VERTEX_ARRAY,
1129 GL_NORMAL_ARRAY, 1160 GL_NORMAL_ARRAY,
1130 //GL_VERTEX_ARRAY,
1131 GL_COLOR_ARRAY, 1161 GL_COLOR_ARRAY,
1132 GL_TEXTURE_COORD_ARRAY 1162 GL_TEXTURE_COORD_ARRAY
1163 };
1164
1165 U32 mask[] =
1166 { //copied from llvertexbuffer.h
1167 0x0001, //MAP_VERTEX,
1168 0x0002, //MAP_NORMAL,
1169 0x0010, //MAP_COLOR,
1170 0x0004, //MAP_TEXCOORD
1133 }; 1171 };
1134 1172
1135 for (S32 j = 0; j < 3; j++) 1173
1174 for (S32 j = 0; j < 4; j++)
1136 { 1175 {
1137 if (glIsEnabled(value[j])) 1176 if (glIsEnabled(value[j]))
1138 { 1177 {
1178 if (!(mask[j] & data_mask))
1179 {
1180 error = TRUE;
1181 llwarns << "GL still has " << label[j] << " enabled." << llendl;
1182 }
1183 }
1184 else
1185 {
1186 if (mask[j] & data_mask)
1187 {
1188 error = TRUE;
1189 llwarns << "GL does not have " << label[j] << " enabled." << llendl;
1190 }
1191 }
1192 }
1193
1194 glClientActiveTextureARB(GL_TEXTURE1_ARB);
1195 glActiveTextureARB(GL_TEXTURE1_ARB);
1196 if (glIsEnabled(GL_TEXTURE_COORD_ARRAY))
1197 {
1198 if (!(data_mask & 0x0008))
1199 {
1200 error = TRUE;
1201 llwarns << "GL still has GL_TEXTURE_COORD_ARRAY enabled on channel 1." << llendl;
1202 }
1203 }
1204 else
1205 {
1206 if (data_mask & 0x0008)
1207 {
1139 error = TRUE; 1208 error = TRUE;
1140 llwarns << "GL still has " << label[j] << " enabled." << llendl; 1209 llwarns << "GL does not have GL_TEXTURE_COORD_ARRAY enabled on channel 1." << llendl;
1141 } 1210 }
1142 } 1211 }
1143 1212
1213 if (glIsEnabled(GL_TEXTURE_2D))
1214 {
1215 if (!(data_mask & 0x0008))
1216 {
1217 error = TRUE;
1218 llwarns << "GL still has GL_TEXTURE_2D enabled on channel 1." << llendl;
1219 }
1220 }
1221 else
1222 {
1223 if (data_mask & 0x0008)
1224 {
1225 error = TRUE;
1226 llwarns << "GL does not have GL_TEXTURE_2D enabled on channel 1." << llendl;
1227 }
1228 }
1229
1230 glClientActiveTextureARB(GL_TEXTURE0_ARB);
1231 glActiveTextureARB(GL_TEXTURE0_ARB);
1232
1144 if (error) 1233 if (error)
1145 { 1234 {
1146 LL_GL_ERRS << "GL client array corruption detected." << llendl; 1235 LL_GL_ERRS << "GL client array corruption detected." << llendl;
1147 } 1236 }
1237#endif
1148} 1238}
1149 1239
1150//============================================================================ 1240//============================================================================
@@ -1190,9 +1280,8 @@ LLGLState::~LLGLState()
1190 stop_glerror(); 1280 stop_glerror();
1191 if (mState) 1281 if (mState)
1192 { 1282 {
1193#if LL_DEBUG 1283#if LL_DEBUG_GL
1194 LLGLboolean cur_state = sStateMap[mState]; 1284 llassert(sStateMap[mState] == glIsEnabled(mState));
1195 llassert(cur_state == glIsEnabled(mState));
1196#endif 1285#endif
1197 if (mIsEnabled != mWasEnabled) 1286 if (mIsEnabled != mWasEnabled)
1198 { 1287 {
@@ -1270,10 +1359,10 @@ void disable_cloth_weights(const S32 index)
1270#endif 1359#endif
1271} 1360}
1272 1361
1273void set_vertex_weights(const S32 index, const F32 *weights) 1362void set_vertex_weights(const S32 index, const U32 stride, const F32 *weights)
1274{ 1363{
1275#if GL_ARB_vertex_program 1364#if GL_ARB_vertex_program
1276 if (index > 0) glVertexAttribPointerARB(index, 1, GL_FLOAT, FALSE, 0, weights); 1365 if (index > 0) glVertexAttribPointerARB(index, 1, GL_FLOAT, FALSE, stride, weights);
1277 stop_glerror(); 1366 stop_glerror();
1278#endif 1367#endif
1279} 1368}
@@ -1321,7 +1410,7 @@ void parse_gl_version( S32* major, S32* minor, S32* release, LLString* vendor_sp
1321 } 1410 }
1322 1411
1323 LLString ver_copy( version ); 1412 LLString ver_copy( version );
1324 S32 len = (S32)strlen( version ); 1413 S32 len = (S32)strlen( version ); /* Flawfinder: ignore */
1325 S32 i = 0; 1414 S32 i = 0;
1326 S32 start; 1415 S32 start;
1327 // Find the major version 1416 // Find the major version
diff --git a/linden/indra/llwindow/llgl.h b/linden/indra/llwindow/llgl.h
index c0668ca..34bf400 100644
--- a/linden/indra/llwindow/llgl.h
+++ b/linden/indra/llwindow/llgl.h
@@ -73,6 +73,7 @@ public:
73 BOOL mHasVertexShader; 73 BOOL mHasVertexShader;
74 BOOL mHasFragmentShader; 74 BOOL mHasFragmentShader;
75 BOOL mHasOcclusionQuery; 75 BOOL mHasOcclusionQuery;
76 BOOL mHasPointParameters;
76 77
77 // nVidia extensions. 78 // nVidia extensions.
78 BOOL mHasAnisotropic; 79 BOOL mHasAnisotropic;
@@ -117,7 +118,6 @@ public:
117 S32 mVRAM; // VRAM in MB 118 S32 mVRAM; // VRAM in MB
118 S32 mGLMaxVertexRange; 119 S32 mGLMaxVertexRange;
119 S32 mGLMaxIndexRange; 120 S32 mGLMaxIndexRange;
120 BOOL mSoftwareBlendSSE;
121 121
122 void getPixelFormat(); // Get the best pixel format 122 void getPixelFormat(); // Get the best pixel format
123 123
@@ -223,7 +223,7 @@ public:
223 static void dumpStates(); 223 static void dumpStates();
224 static void checkStates(); 224 static void checkStates();
225 static void checkTextureChannels(); 225 static void checkTextureChannels();
226 static void checkClientArrays(); 226 static void checkClientArrays(U32 data_mask = 0x0001);
227 227
228protected: 228protected:
229 static std::map<LLGLenum, LLGLboolean> sStateMap; 229 static std::map<LLGLenum, LLGLboolean> sStateMap;
@@ -262,7 +262,7 @@ void enable_binormals(const S32 index);
262void disable_binormals(const S32 index); 262void disable_binormals(const S32 index);
263void enable_cloth_weights(const S32 index); 263void enable_cloth_weights(const S32 index);
264void disable_cloth_weights(const S32 index); 264void disable_cloth_weights(const S32 index);
265void set_vertex_weights(const S32 index, const F32 *weights); 265void set_vertex_weights(const S32 index, const U32 stride, const F32 *weights);
266void set_vertex_clothing_weights(const S32 index, const U32 stride, const LLVector4 *weights); 266void set_vertex_clothing_weights(const S32 index, const U32 stride, const LLVector4 *weights);
267void set_binormals(const S32 index, const U32 stride, const LLVector3 *binormals); 267void set_binormals(const S32 index, const U32 stride, const LLVector3 *binormals);
268void set_palette(U8* palette_data); 268void set_palette(U8* palette_data);
diff --git a/linden/indra/llwindow/llglheaders.h b/linden/indra/llwindow/llglheaders.h
index e67b6c7..7c4d8fd 100644
--- a/linden/indra/llwindow/llglheaders.h
+++ b/linden/indra/llwindow/llglheaders.h
@@ -92,6 +92,10 @@ extern PFNGLGETQUERYIVARBPROC glGetQueryivARB;
92extern PFNGLGETQUERYOBJECTIVARBPROC glGetQueryObjectivARB; 92extern PFNGLGETQUERYOBJECTIVARBPROC glGetQueryObjectivARB;
93extern PFNGLGETQUERYOBJECTUIVARBPROC glGetQueryObjectuivARB; 93extern PFNGLGETQUERYOBJECTUIVARBPROC glGetQueryObjectuivARB;
94 94
95// GL_ARB_point_parameters
96extern PFNGLPOINTPARAMETERFARBPROC glPointParameterfARB;
97extern PFNGLPOINTPARAMETERFVARBPROC glPointParameterfvARB;
98
95// GL_ARB_shader_objects 99// GL_ARB_shader_objects
96extern PFNGLDELETEOBJECTARBPROC glDeleteObjectARB; 100extern PFNGLDELETEOBJECTARBPROC glDeleteObjectARB;
97extern PFNGLGETHANDLEARBPROC glGetHandleARB; 101extern PFNGLGETHANDLEARBPROC glGetHandleARB;
@@ -255,6 +259,10 @@ extern PFNGLGETQUERYIVARBPROC glGetQueryivARB;
255extern PFNGLGETQUERYOBJECTIVARBPROC glGetQueryObjectivARB; 259extern PFNGLGETQUERYOBJECTIVARBPROC glGetQueryObjectivARB;
256extern PFNGLGETQUERYOBJECTUIVARBPROC glGetQueryObjectuivARB; 260extern PFNGLGETQUERYOBJECTUIVARBPROC glGetQueryObjectuivARB;
257 261
262// GL_ARB_point_parameters
263extern PFNGLPOINTPARAMETERFARBPROC glPointParameterfARB;
264extern PFNGLPOINTPARAMETERFVARBPROC glPointParameterfvARB;
265
258// GL_ARB_shader_objects 266// GL_ARB_shader_objects
259extern PFNGLDELETEOBJECTARBPROC glDeleteObjectARB; 267extern PFNGLDELETEOBJECTARBPROC glDeleteObjectARB;
260extern PFNGLGETHANDLEARBPROC glGetHandleARB; 268extern PFNGLGETHANDLEARBPROC glGetHandleARB;
@@ -435,7 +443,7 @@ typedef GLboolean (* glIsBufferARBProcPtr) (GLuint buffer);
435typedef void (* glBufferDataARBProcPtr) (GLenum target, GLsizeiptrARB size, const GLvoid *data, GLenum usage); 443typedef void (* glBufferDataARBProcPtr) (GLenum target, GLsizeiptrARB size, const GLvoid *data, GLenum usage);
436typedef void (* glBufferSubDataARBProcPtr) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, const GLvoid *data); 444typedef void (* glBufferSubDataARBProcPtr) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, const GLvoid *data);
437typedef void (* glGetBufferSubDataARBProcPtr) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, GLvoid *data); 445typedef void (* glGetBufferSubDataARBProcPtr) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, GLvoid *data);
438typedef GLvoid* (* glMapBufferARBProcPtr) (GLenum target, GLenum access); 446typedef GLvoid* (* glMapBufferARBProcPtr) (GLenum target, GLenum access); /* Flawfinder: ignore */
439typedef GLboolean (* glUnmapBufferARBProcPtr) (GLenum target); 447typedef GLboolean (* glUnmapBufferARBProcPtr) (GLenum target);
440typedef void (* glGetBufferParameterivARBProcPtr) (GLenum target, GLenum pname, GLint *params); 448typedef void (* glGetBufferParameterivARBProcPtr) (GLenum target, GLenum pname, GLint *params);
441typedef void (* glGetBufferPointervARBProcPtr) (GLenum target, GLenum pname, GLvoid* *params); 449typedef void (* glGetBufferPointervARBProcPtr) (GLenum target, GLenum pname, GLvoid* *params);
diff --git a/linden/indra/llwindow/llgltypes.h b/linden/indra/llwindow/llgltypes.h
index 52a58b5..fffa979 100644
--- a/linden/indra/llwindow/llgltypes.h
+++ b/linden/indra/llwindow/llgltypes.h
@@ -1,8 +1,8 @@
1/** 1/**
2 * @file llgltypes.h 2 * @file llgltypes.h
3 * @brief LLGL definition 3 * @brief LLGL definition
4 * 4 *
5 * Copyright (c) 2006-2007, Linden Research, Inc. 5 * Copyright (c) 2006-2007, Linden Research, Inc.
6 * 6 *
7 * The source code in this file ("Source Code") is provided by Linden Lab 7 * The source code in this file ("Source Code") is provided by Linden Lab
8 * to you under the terms of the GNU General Public License, version 2.0 8 * to you under the terms of the GNU General Public License, version 2.0
@@ -22,19 +22,19 @@
22 * 22 *
23 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO 23 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
24 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, 24 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
25 * COMPLETENESS OR PERFORMANCE. 25 * COMPLETENESS OR PERFORMANCE.
26 */ 26 */
27 27
28#ifndef LLGLTYPES_H 28#ifndef LLGLTYPES_H
29#define LLGLTYPES_H 29#define LLGLTYPES_H
30 30
31#define MAX_GL_TEXTURE_UNITS 16 31#define MAX_GL_TEXTURE_UNITS 16
32 32
33typedef U32 LLGLenum; 33typedef U32 LLGLenum;
34typedef U32 LLGLuint; 34typedef U32 LLGLuint;
35typedef S32 LLGLint; 35typedef S32 LLGLint;
36typedef F32 LLGLfloat; 36typedef F32 LLGLfloat;
37typedef F64 LLGLdouble; 37typedef F64 LLGLdouble;
38typedef U8 LLGLboolean; 38typedef U8 LLGLboolean;
39 39
40#endif 40#endif
diff --git a/linden/indra/llwindow/llkeyboard.cpp b/linden/indra/llwindow/llkeyboard.cpp
index 409bb13..0da1644 100644
--- a/linden/indra/llwindow/llkeyboard.cpp
+++ b/linden/indra/llwindow/llkeyboard.cpp
@@ -330,7 +330,7 @@ LLString LLKeyboard::stringFromKey(KEY key)
330 LLString res = get_if_there(sKeysToNames, key, LLString::null); 330 LLString res = get_if_there(sKeysToNames, key, LLString::null);
331 if (res.empty()) 331 if (res.empty())
332 { 332 {
333 char buffer[2]; 333 char buffer[2]; /* Flawfinder: ignore */
334 buffer[0] = key; 334 buffer[0] = key;
335 buffer[1] = '\0'; 335 buffer[1] = '\0';
336 res = LLString(buffer); 336 res = LLString(buffer);
diff --git a/linden/indra/llwindow/llkeyboardwin32.cpp b/linden/indra/llwindow/llkeyboardwin32.cpp
index e166ec2..33664b9 100644
--- a/linden/indra/llwindow/llkeyboardwin32.cpp
+++ b/linden/indra/llwindow/llkeyboardwin32.cpp
@@ -187,10 +187,7 @@ MASK LLKeyboardWin32::updateModifiers()
187 187
188 // Scan the modifier keys as of the last Windows key message 188 // Scan the modifier keys as of the last Windows key message
189 // (keydown encoded in high order bit of short) 189 // (keydown encoded in high order bit of short)
190 //setModifierKeyLevel( KEY_SHIFT, GetKeyState(VK_SHIFT) & 0x8000 ); 190 mKeyLevel[KEY_CAPSLOCK] = (GetKeyState(VK_CAPITAL) & 0x0001) != 0; // Low order bit carries the toggle state.
191 //setModifierKeyLevel( KEY_CONTROL, GetKeyState(VK_CONTROL) & 0x8000 );
192 //setModifierKeyLevel( KEY_ALT, GetKeyState(VK_MENU) & 0x8000 );
193 //setModifierKeyLevel( KEY_CAPSLOCK, GetKeyState(VK_CAPITAL) & 0x0001); // Low order bit carries the toggle state.
194 // Get mask for keyboard events 191 // Get mask for keyboard events
195 MASK mask = currentMask(FALSE); 192 MASK mask = currentMask(FALSE);
196 return mask; 193 return mask;
@@ -214,7 +211,6 @@ BOOL LLKeyboardWin32::handleKeyDown(const U16 key, MASK mask)
214 return handled; 211 return handled;
215} 212}
216 213
217
218// mask is ignored, except for extended flag -- we poll the modifier keys for the other flags 214// mask is ignored, except for extended flag -- we poll the modifier keys for the other flags
219BOOL LLKeyboardWin32::handleKeyUp(const U16 key, MASK mask) 215BOOL LLKeyboardWin32::handleKeyUp(const U16 key, MASK mask)
220{ 216{
@@ -248,10 +244,14 @@ MASK LLKeyboardWin32::currentMask(BOOL)
248void LLKeyboardWin32::scanKeyboard() 244void LLKeyboardWin32::scanKeyboard()
249{ 245{
250 S32 key; 246 S32 key;
247 MSG msg;
248 BOOL pending_key_events = PeekMessage(&msg, NULL, WM_KEYFIRST, WM_KEYLAST, PM_NOREMOVE | PM_NOYIELD);
251 for (key = 0; key < KEY_COUNT; key++) 249 for (key = 0; key < KEY_COUNT; key++)
252 { 250 {
253 // On Windows, verify key down state. JC 251 // On Windows, verify key down state. JC
254 if (mKeyLevel[key]) 252 // RN: only do this if we don't have further key events in the queue
253 // as otherwise there might be key repeat events still waiting for this key we are now dumping
254 if (!pending_key_events && mKeyLevel[key])
255 { 255 {
256 // *TODO: I KNOW there must be a better way of 256 // *TODO: I KNOW there must be a better way of
257 // interrogating the key state than this, using async key 257 // interrogating the key state than this, using async key
@@ -262,9 +262,9 @@ void LLKeyboardWin32::scanKeyboard()
262 // ...translate back to windows key 262 // ...translate back to windows key
263 U16 virtual_key = inverseTranslateExtendedKey(key); 263 U16 virtual_key = inverseTranslateExtendedKey(key);
264 // keydown in highest bit 264 // keydown in highest bit
265 if (!(GetAsyncKeyState(virtual_key) & 0x8000)) 265 if (!pending_key_events && !(GetAsyncKeyState(virtual_key) & 0x8000))
266 { 266 {
267 //llinfos << "Key up event missed, resetting" << llendl; 267 //llinfos << "Key up event missed, resetting" << llendl;
268 mKeyLevel[key] = FALSE; 268 mKeyLevel[key] = FALSE;
269 } 269 }
270 } 270 }
diff --git a/linden/indra/llwindow/llmousehandler.h b/linden/indra/llwindow/llmousehandler.h
index b907b55..4e9b882 100644
--- a/linden/indra/llwindow/llmousehandler.h
+++ b/linden/indra/llwindow/llmousehandler.h
@@ -28,10 +28,14 @@
28#ifndef LL_MOUSEHANDLER_H 28#ifndef LL_MOUSEHANDLER_H
29#define LL_MOUSEHANDLER_H 29#define LL_MOUSEHANDLER_H
30 30
31#include "llstring.h"
32
31// Abstract interface. 33// Abstract interface.
32// Intended for use via multiple inheritance. 34// Intended for use via multiple inheritance.
33// A class may have as many interfaces as it likes, but never needs to inherit one more than once. 35// A class may have as many interfaces as it likes, but never needs to inherit one more than once.
34 36
37#include "llstring.h"
38
35class LLMouseHandler 39class LLMouseHandler
36{ 40{
37public: 41public:
diff --git a/linden/indra/llwindow/llwindow.h b/linden/indra/llwindow/llwindow.h
index ac427f1..f4bb147 100644
--- a/linden/indra/llwindow/llwindow.h
+++ b/linden/indra/llwindow/llwindow.h
@@ -317,6 +317,7 @@ public:
317// 317//
318// helper funcs 318// helper funcs
319// 319//
320extern BOOL gDebugWindowProc;
320 321
321// Protocols, like "http" and "https" we support in URLs 322// Protocols, like "http" and "https" we support in URLs
322extern const S32 gURLProtocolWhitelistCount; 323extern const S32 gURLProtocolWhitelistCount;
diff --git a/linden/indra/llwindow/llwindow_vc8.vcproj b/linden/indra/llwindow/llwindow_vc8.vcproj
new file mode 100644
index 0000000..b04477f
--- /dev/null
+++ b/linden/indra/llwindow/llwindow_vc8.vcproj
@@ -0,0 +1,392 @@
1<?xml version="1.0" encoding="Windows-1252"?>
2<VisualStudioProject
3 ProjectType="Visual C++"
4 Version="8.00"
5 Name="llwindow"
6 ProjectGUID="{B5B53617-416F-404A-BF10-22EBCCA0E4FB}"
7 Keyword="Win32Proj"
8 >
9 <Platforms>
10 <Platform
11 Name="Win32"
12 />
13 </Platforms>
14 <ToolFiles>
15 </ToolFiles>
16 <Configurations>
17 <Configuration
18 Name="Debug|Win32"
19 OutputDirectory="../lib_$(ConfigurationName)/i686-win32"
20 IntermediateDirectory="Debug"
21 ConfigurationType="4"
22 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
23 CharacterSet="1"
24 >
25 <Tool
26 Name="VCPreBuildEventTool"
27 />
28 <Tool
29 Name="VCCustomBuildTool"
30 />
31 <Tool
32 Name="VCXMLDataGeneratorTool"
33 />
34 <Tool
35 Name="VCWebServiceProxyGeneratorTool"
36 />
37 <Tool
38 Name="VCMIDLTool"
39 />
40 <Tool
41 Name="VCCLCompilerTool"
42 Optimization="0"
43 AdditionalIncludeDirectories="..\llcommon;..\llmath;..\llxml;..\llvfs;..\llmessage;..\llscene;..\llimage;..\..\libraries\i686-win32\include;..\..\libraries\include\"
44 PreprocessorDefinitions="WIN32;_DEBUG;_LIB;LL_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;LL_DEBUG"
45 MinimalRebuild="true"
46 BasicRuntimeChecks="3"
47 RuntimeLibrary="1"
48 StructMemberAlignment="4"
49 TreatWChar_tAsBuiltInType="false"
50 ForceConformanceInForLoopScope="true"
51 UsePrecompiledHeader="0"
52 WarningLevel="3"
53 WarnAsError="true"
54 Detect64BitPortabilityProblems="false"
55 DebugInformationFormat="4"
56 />
57 <Tool
58 Name="VCManagedResourceCompilerTool"
59 />
60 <Tool
61 Name="VCResourceCompilerTool"
62 />
63 <Tool
64 Name="VCPreLinkEventTool"
65 />
66 <Tool
67 Name="VCLibrarianTool"
68 OutputFile="$(OutDir)/llwindow.lib"
69 />
70 <Tool
71 Name="VCALinkTool"
72 />
73 <Tool
74 Name="VCXDCMakeTool"
75 />
76 <Tool
77 Name="VCBscMakeTool"
78 />
79 <Tool
80 Name="VCFxCopTool"
81 />
82 <Tool
83 Name="VCPostBuildEventTool"
84 />
85 </Configuration>
86 <Configuration
87 Name="Release|Win32"
88 OutputDirectory="../lib_$(ConfigurationName)/i686-win32"
89 IntermediateDirectory="Release"
90 ConfigurationType="4"
91 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
92 CharacterSet="1"
93 >
94 <Tool
95 Name="VCPreBuildEventTool"
96 />
97 <Tool
98 Name="VCCustomBuildTool"
99 />
100 <Tool
101 Name="VCXMLDataGeneratorTool"
102 />
103 <Tool
104 Name="VCWebServiceProxyGeneratorTool"
105 />
106 <Tool
107 Name="VCMIDLTool"
108 />
109 <Tool
110 Name="VCCLCompilerTool"
111 AdditionalIncludeDirectories="..\llcommon;..\llmath;..\llxml;..\llvfs;..\llmessage;..\llscene;..\llimage;..\..\libraries\i686-win32\include;..\..\libraries\include\"
112 PreprocessorDefinitions="WIN32;NDEBUG;_LIB;LL_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;LL_RELEASE"
113 RuntimeLibrary="0"
114 StructMemberAlignment="0"
115 TreatWChar_tAsBuiltInType="false"
116 ForceConformanceInForLoopScope="true"
117 UsePrecompiledHeader="0"
118 WarningLevel="3"
119 WarnAsError="true"
120 Detect64BitPortabilityProblems="false"
121 DebugInformationFormat="3"
122 />
123 <Tool
124 Name="VCManagedResourceCompilerTool"
125 />
126 <Tool
127 Name="VCResourceCompilerTool"
128 />
129 <Tool
130 Name="VCPreLinkEventTool"
131 />
132 <Tool
133 Name="VCLibrarianTool"
134 OutputFile="$(OutDir)/llwindow.lib"
135 />
136 <Tool
137 Name="VCALinkTool"
138 />
139 <Tool
140 Name="VCXDCMakeTool"
141 />
142 <Tool
143 Name="VCBscMakeTool"
144 />
145 <Tool
146 Name="VCFxCopTool"
147 />
148 <Tool
149 Name="VCPostBuildEventTool"
150 />
151 </Configuration>
152 <Configuration
153 Name="DebugMesaHeadless|Win32"
154 OutputDirectory="../lib_debug/i686-win32"
155 IntermediateDirectory="$(ConfigurationName)"
156 ConfigurationType="4"
157 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
158 CharacterSet="1"
159 >
160 <Tool
161 Name="VCPreBuildEventTool"
162 />
163 <Tool
164 Name="VCCustomBuildTool"
165 />
166 <Tool
167 Name="VCXMLDataGeneratorTool"
168 />
169 <Tool
170 Name="VCWebServiceProxyGeneratorTool"
171 />
172 <Tool
173 Name="VCMIDLTool"
174 />
175 <Tool
176 Name="VCCLCompilerTool"
177 Optimization="0"
178 AdditionalIncludeDirectories="..\llcommon;..\llmath;..\llxml;..\llvfs;..\llmessage;..\llscene;..\llimage;..\..\libraries\i686-win32\include;..\..\libraries\include\GLMESA;..\..\libraries\i686-win32\include;..\..\libraries\include\"
179 PreprocessorDefinitions="WIN32;_DEBUG;_LIB;LL_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;LL_DEBUG;LL_MESA;LL_MESA_HEADLESS"
180 MinimalRebuild="true"
181 BasicRuntimeChecks="3"
182 RuntimeLibrary="1"
183 StructMemberAlignment="4"
184 ForceConformanceInForLoopScope="true"
185 UsePrecompiledHeader="0"
186 WarningLevel="3"
187 WarnAsError="true"
188 Detect64BitPortabilityProblems="false"
189 DebugInformationFormat="4"
190 />
191 <Tool
192 Name="VCManagedResourceCompilerTool"
193 />
194 <Tool
195 Name="VCResourceCompilerTool"
196 />
197 <Tool
198 Name="VCPreLinkEventTool"
199 />
200 <Tool
201 Name="VCLibrarianTool"
202 OutputFile="$(OutDir)/llwindow_mesaheadless.lib"
203 />
204 <Tool
205 Name="VCALinkTool"
206 />
207 <Tool
208 Name="VCXDCMakeTool"
209 />
210 <Tool
211 Name="VCBscMakeTool"
212 />
213 <Tool
214 Name="VCFxCopTool"
215 />
216 <Tool
217 Name="VCPostBuildEventTool"
218 />
219 </Configuration>
220 <Configuration
221 Name="ReleaseNoOpt|Win32"
222 OutputDirectory="../lib_$(ConfigurationName)/i686-win32"
223 IntermediateDirectory="$(ConfigurationName)"
224 ConfigurationType="4"
225 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
226 CharacterSet="1"
227 >
228 <Tool
229 Name="VCPreBuildEventTool"
230 />
231 <Tool
232 Name="VCCustomBuildTool"
233 />
234 <Tool
235 Name="VCXMLDataGeneratorTool"
236 />
237 <Tool
238 Name="VCWebServiceProxyGeneratorTool"
239 />
240 <Tool
241 Name="VCMIDLTool"
242 />
243 <Tool
244 Name="VCCLCompilerTool"
245 Optimization="0"
246 AdditionalIncludeDirectories="..\llcommon;..\llmath;..\llxml;..\llvfs;..\llmessage;..\llscene;..\llimage;..\..\libraries\i686-win32\include;..\..\libraries\include\"
247 PreprocessorDefinitions="WIN32;NDEBUG;_LIB;LL_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;LL_RELEASE"
248 RuntimeLibrary="0"
249 StructMemberAlignment="0"
250 TreatWChar_tAsBuiltInType="false"
251 ForceConformanceInForLoopScope="true"
252 UsePrecompiledHeader="0"
253 WarningLevel="3"
254 WarnAsError="true"
255 Detect64BitPortabilityProblems="false"
256 DebugInformationFormat="3"
257 />
258 <Tool
259 Name="VCManagedResourceCompilerTool"
260 />
261 <Tool
262 Name="VCResourceCompilerTool"
263 />
264 <Tool
265 Name="VCPreLinkEventTool"
266 />
267 <Tool
268 Name="VCLibrarianTool"
269 OutputFile="$(OutDir)/llwindow.lib"
270 />
271 <Tool
272 Name="VCALinkTool"
273 />
274 <Tool
275 Name="VCXDCMakeTool"
276 />
277 <Tool
278 Name="VCBscMakeTool"
279 />
280 <Tool
281 Name="VCFxCopTool"
282 />
283 <Tool
284 Name="VCPostBuildEventTool"
285 />
286 </Configuration>
287 </Configurations>
288 <References>
289 </References>
290 <Files>
291 <Filter
292 Name="Source Files"
293 Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
294 UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
295 >
296 <File
297 RelativePath=".\lldxhardware.cpp"
298 >
299 </File>
300 <File
301 RelativePath=".\llgl.cpp"
302 >
303 </File>
304 <File
305 RelativePath=".\llkeyboard.cpp"
306 >
307 </File>
308 <File
309 RelativePath=".\llkeyboardwin32.cpp"
310 >
311 </File>
312 <File
313 RelativePath=".\llwindow.cpp"
314 >
315 </File>
316 <File
317 RelativePath=".\llwindowheadless.cpp"
318 >
319 </File>
320 <File
321 RelativePath=".\llwindowmesaheadless.cpp"
322 >
323 </File>
324 <File
325 RelativePath=".\llwindowwin32.cpp"
326 >
327 </File>
328 </Filter>
329 <Filter
330 Name="Header Files"
331 Filter="h;hpp;hxx;hm;inl;inc;xsd"
332 UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
333 >
334 <File
335 RelativePath=".\lldxhardware.h"
336 >
337 </File>
338 <File
339 RelativePath=".\llgl.h"
340 >
341 </File>
342 <File
343 RelativePath=".\llglheaders.h"
344 >
345 </File>
346 <File
347 RelativePath=".\llglstates.h"
348 >
349 </File>
350 <File
351 RelativePath=".\llgltypes.h"
352 >
353 </File>
354 <File
355 RelativePath=".\llkeyboard.h"
356 >
357 </File>
358 <File
359 RelativePath=".\llkeyboardwin32.h"
360 >
361 </File>
362 <File
363 RelativePath=".\llmousehandler.h"
364 >
365 </File>
366 <File
367 RelativePath=".\llwindow.h"
368 >
369 </File>
370 <File
371 RelativePath=".\llwindowheadless.h"
372 >
373 </File>
374 <File
375 RelativePath=".\llwindowmesaheadless.h"
376 >
377 </File>
378 <File
379 RelativePath=".\llwindowwin32.h"
380 >
381 </File>
382 </Filter>
383 <Filter
384 Name="Resource Files"
385 Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
386 UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
387 >
388 </Filter>
389 </Files>
390 <Globals>
391 </Globals>
392</VisualStudioProject>
diff --git a/linden/indra/llwindow/llwindowmacosx.cpp b/linden/indra/llwindow/llwindowmacosx.cpp
index d990bb5..7313fd3 100644
--- a/linden/indra/llwindow/llwindowmacosx.cpp
+++ b/linden/indra/llwindow/llwindowmacosx.cpp
@@ -30,6 +30,7 @@
30#include "linden_common.h" 30#include "linden_common.h"
31 31
32#include <Carbon/Carbon.h> 32#include <Carbon/Carbon.h>
33#include <OpenGL/OpenGL.h>
33 34
34#include "llwindowmacosx.h" 35#include "llwindowmacosx.h"
35#include "llkeyboardmacosx.h" 36#include "llkeyboardmacosx.h"
@@ -89,8 +90,8 @@ BOOL check_for_card(const char* RENDERER, const char* bad_card)
89{ 90{
90 if (!strnicmp(RENDERER, bad_card, strlen(bad_card))) 91 if (!strnicmp(RENDERER, bad_card, strlen(bad_card)))
91 { 92 {
92 char buffer[1024]; 93 char buffer[1024];/* Flawfinder: ignore */
93 sprintf(buffer, 94 snprintf(buffer, sizeof(buffer), /* Flawfinder: ignore */
94 "Your video card appears to be a %s, which Second Life does not support.\n" 95 "Your video card appears to be a %s, which Second Life does not support.\n"
95 "\n" 96 "\n"
96 "Second Life requires a video card with 32 Mb of memory or more, as well as\n" 97 "Second Life requires a video card with 32 Mb of memory or more, as well as\n"
@@ -246,8 +247,8 @@ LLWindowMacOSX::LLWindowMacOSX(char *title, char *name, S32 x, S32 y, S32 width,
246 mOriginalAspectRatio = (double)CGDisplayPixelsWide(mDisplay) / (double)CGDisplayPixelsHigh(mDisplay); 247 mOriginalAspectRatio = (double)CGDisplayPixelsWide(mDisplay) / (double)CGDisplayPixelsHigh(mDisplay);
247 248
248 // Stash the window title 249 // Stash the window title
249 strcpy((char*)mWindowTitle + 1, title); 250 strcpy((char*)mWindowTitle + 1, title); /* Flawfinder: ignore */
250 mWindowTitle[0] = strlen(title); 251 mWindowTitle[0] = strlen(title); /* Flawfinder: ignore */
251 252
252 mEventHandlerUPP = NewEventHandlerUPP(staticEventHandler); 253 mEventHandlerUPP = NewEventHandlerUPP(staticEventHandler);
253 mGlobalHandlerRef = NULL; 254 mGlobalHandlerRef = NULL;
@@ -424,8 +425,8 @@ BOOL LLWindowMacOSX::createContext(int x, int y, int width, int height, int bits
424 mFullscreenBits = -1; 425 mFullscreenBits = -1;
425 mFullscreenRefresh = -1; 426 mFullscreenRefresh = -1;
426 427
427 char error[256]; 428 char error[256]; /* Flawfinder: ignore */
428 sprintf(error, "Unable to run fullscreen at %d x %d.\nRunning in window.", width, height); 429 snprintf(error, sizeof(error), "Unable to run fullscreen at %d x %d.\nRunning in window.", width, height); /* Flawfinder: ignore */
429 OSMessageBox(error, "Error", OSMB_OK); 430 OSMessageBox(error, "Error", OSMB_OK);
430 } 431 }
431 } 432 }
@@ -738,6 +739,22 @@ BOOL LLWindowMacOSX::createContext(int x, int y, int width, int height, int bits
738 } 739 }
739 aglSetInteger(mContext, AGL_SWAP_INTERVAL, &frames_per_swap); 740 aglSetInteger(mContext, AGL_SWAP_INTERVAL, &frames_per_swap);
740 741
742#if 0 // SJB: Got a compile error. Plus I don't want to test this along with everything else ; save it for later
743 //enable multi-threaded OpenGL
744 CGLError cgl_err;
745 CGLContextObj ctx = CGLGetCurrentContext();
746
747 cgl_err = CGLEnable( ctx, kCGLCEMPEngine);
748
749 if (cgl_err != kCGLNoError )
750 {
751 llinfos << "Multi-threaded OpenGL not available." << llendl;
752 }
753 else
754 {
755 llinfos << "Multi-threaded OpenGL enabled." << llendl;
756 }
757#endif
741 // Don't need to get the current gamma, since there's a call that restores it to the system defaults. 758 // Don't need to get the current gamma, since there's a call that restores it to the system defaults.
742 return TRUE; 759 return TRUE;
743} 760}
@@ -2738,7 +2755,7 @@ void spawn_web_browser(const char* escaped_url)
2738 S32 i; 2755 S32 i;
2739 for (i = 0; i < gURLProtocolWhitelistCount; i++) 2756 for (i = 0; i < gURLProtocolWhitelistCount; i++)
2740 { 2757 {
2741 S32 len = strlen(gURLProtocolWhitelist[i]); 2758 S32 len = strlen(gURLProtocolWhitelist[i]); /* Flawfinder: ignore */
2742 if (!strncmp(escaped_url, gURLProtocolWhitelist[i], len) 2759 if (!strncmp(escaped_url, gURLProtocolWhitelist[i], len)
2743 && escaped_url[len] == ':') 2760 && escaped_url[len] == ':')
2744 { 2761 {
diff --git a/linden/indra/llwindow/llwindowsdl.cpp b/linden/indra/llwindow/llwindowsdl.cpp
index a94284e..85836af 100644
--- a/linden/indra/llwindow/llwindowsdl.cpp
+++ b/linden/indra/llwindow/llwindowsdl.cpp
@@ -68,20 +68,12 @@ const S32 MAX_NUM_RESOLUTIONS = 32;
68 68
69#if LL_X11 69#if LL_X11
70# include <X11/Xutil.h> 70# include <X11/Xutil.h>
71// A global! Well, SDL isn't really designed for communicating
72// with multiple physical X11 displays. Heck, it's not really
73// designed for multiple X11 windows.
74// So, we need this for the SDL/X11 event filter callback (which
75// doesnt have a userdata parameter) and more.
76static Display *SDL_Display = NULL;
77static Window SDL_XWindowID = None;
78#endif //LL_X11 71#endif //LL_X11
79 72
80// TOFU HACK -- (*exactly* the same hack as LLWindowMacOSX for the same reasons) 73// TOFU HACK -- (*exactly* the same hack as LLWindowMacOSX for a similar
81// For SDL, to put up an OS dialog in full screen mode, we must first switch OUT of full screen mode. 74// set of reasons): Stash a pointer to the LLWindowSDL object here and
82// The proper way to do this is to bracket the dialog with calls to beforeDialog() and afterDialog(), but these 75// maintain in the constructor and destructor. This assumes that there will
83// require a pointer to the LLWindowMacSDL object. Stash it here and maintain in the constructor and destructor. 76// be only one object of this class at any time. Hopefully this is true.
84// This assumes that there will be only one object of this class at any time. Hopefully this is true.
85static LLWindowSDL *gWindowImplementation = NULL; 77static LLWindowSDL *gWindowImplementation = NULL;
86 78
87static BOOL was_fullscreen = FALSE; 79static BOOL was_fullscreen = FALSE;
@@ -113,14 +105,51 @@ void show_window_creation_error(const char* title)
113} 105}
114 106
115 107
108void maybe_lock_display(void)
109{
110 if (gWindowImplementation) {
111 gWindowImplementation->Lock_Display();
112 }
113}
114
115
116void maybe_unlock_display(void)
117{
118 if (gWindowImplementation) {
119 gWindowImplementation->Unlock_Display();
120 }
121}
122
123
116#if LL_GTK 124#if LL_GTK
117// Check the runtime GTK version for goodness. 125// Lazily initialize and check the runtime GTK version for goodness.
118static BOOL maybe_do_gtk_diagnostics(void) 126BOOL ll_try_gtk_init(void)
119{ 127{
120 static BOOL done_gtk_diag = FALSE; 128 static BOOL done_gtk_diag = FALSE;
121 static BOOL is_good = TRUE; 129 static BOOL gtk_is_good = FALSE;
122 gtk_disable_setlocale(); 130 static BOOL done_setlocale = FALSE;
123 if ((!done_gtk_diag) && gtk_init_check(NULL, NULL)) 131 static BOOL tried_gtk_init = FALSE;
132
133 if (!done_setlocale)
134 {
135 llinfos << "Starting GTK Initialization." << llendl;
136 maybe_lock_display();
137 gtk_disable_setlocale();
138 maybe_unlock_display();
139 done_setlocale = TRUE;
140 }
141
142 if (!tried_gtk_init)
143 {
144 tried_gtk_init = TRUE;
145 maybe_lock_display();
146 gtk_is_good = gtk_init_check(NULL, NULL);
147 maybe_unlock_display();
148 if (!gtk_is_good)
149 llwarns << "GTK Initialization failed." << llendl;
150 }
151
152 if (gtk_is_good && !done_gtk_diag)
124 { 153 {
125 llinfos << "GTK Initialized." << llendl; 154 llinfos << "GTK Initialized." << llendl;
126 llinfos << "- Compiled against GTK version " 155 llinfos << "- Compiled against GTK version "
@@ -132,29 +161,51 @@ static BOOL maybe_do_gtk_diagnostics(void)
132 << gtk_minor_version << "." 161 << gtk_minor_version << "."
133 << gtk_micro_version << llendl; 162 << gtk_micro_version << llendl;
134 gchar *gtk_warning; 163 gchar *gtk_warning;
164 maybe_lock_display();
135 gtk_warning = gtk_check_version(GTK_MAJOR_VERSION, 165 gtk_warning = gtk_check_version(GTK_MAJOR_VERSION,
136 GTK_MINOR_VERSION, 166 GTK_MINOR_VERSION,
137 GTK_MICRO_VERSION); 167 GTK_MICRO_VERSION);
168 maybe_unlock_display();
138 if (gtk_warning) 169 if (gtk_warning)
139 { 170 {
140 llwarns << "- GTK COMPATIBILITY WARNING: " << 171 llwarns << "- GTK COMPATIBILITY WARNING: " <<
141 gtk_warning << llendl; 172 gtk_warning << llendl;
142 is_good = FALSE; 173 gtk_is_good = FALSE;
143 } 174 }
144 175
145 done_gtk_diag = TRUE; 176 done_gtk_diag = TRUE;
146 } 177 }
147 return is_good; 178
179 return gtk_is_good;
148} 180}
149#endif // LL_GTK 181#endif // LL_GTK
150 182
151 183
184#if LL_X11
185Window get_SDL_XWindowID(void)
186{
187 if (gWindowImplementation) {
188 return gWindowImplementation->mSDL_XWindowID;
189 }
190 return None;
191}
192
193Display* get_SDL_Display(void)
194{
195 if (gWindowImplementation) {
196 return gWindowImplementation->mSDL_Display;
197 }
198 return NULL;
199}
200#endif // LL_X11
201
202
152BOOL check_for_card(const char* RENDERER, const char* bad_card) 203BOOL check_for_card(const char* RENDERER, const char* bad_card)
153{ 204{
154 if (!strncasecmp(RENDERER, bad_card, strlen(bad_card))) 205 if (!strncasecmp(RENDERER, bad_card, strlen(bad_card)))
155 { 206 {
156 char buffer[1024]; 207 char buffer[1024]; /* Flawfinder: ignore */
157 sprintf(buffer, 208 snprintf(buffer, sizeof(buffer), /* Flawfinder: ignore */
158 "Your video card appears to be a %s, which Second Life does not support.\n" 209 "Your video card appears to be a %s, which Second Life does not support.\n"
159 "\n" 210 "\n"
160 "Second Life requires a video card with 32 Mb of memory or more, as well as\n" 211 "Second Life requires a video card with 32 Mb of memory or more, as well as\n"
@@ -209,6 +260,19 @@ LLWindowSDL::LLWindowSDL(char *title, S32 x, S32 y, S32 width,
209 mHaveInputFocus = -1; 260 mHaveInputFocus = -1;
210 mIsMinimized = -1; 261 mIsMinimized = -1;
211 262
263#if LL_X11
264 mSDL_XWindowID = None;
265 mSDL_Display = NULL;
266#endif // LL_X11
267
268#if LL_GTK
269 // We MUST be the first to initialize GTK, i.e. we have to beat
270 // our embedded Mozilla to the punch so that GTK doesn't get badly
271 // initialized with a non-C locale and cause lots of serious random
272 // weirdness.
273 ll_try_gtk_init();
274#endif // LL_GTK
275
212 // Get the original aspect ratio of the main device. 276 // Get the original aspect ratio of the main device.
213 mOriginalAspectRatio = 1024.0 / 768.0; // !!! FIXME //(double)CGDisplayPixelsWide(mDisplay) / (double)CGDisplayPixelsHigh(mDisplay); 277 mOriginalAspectRatio = 1024.0 / 768.0; // !!! FIXME //(double)CGDisplayPixelsWide(mDisplay) / (double)CGDisplayPixelsHigh(mDisplay);
214 278
@@ -216,9 +280,14 @@ LLWindowSDL::LLWindowSDL(char *title, S32 x, S32 y, S32 width,
216 title = "SDL Window"; // *FIX: (???) 280 title = "SDL Window"; // *FIX: (???)
217 281
218 // Stash the window title 282 // Stash the window title
219 mWindowTitle = new char[strlen(title) + 1]; 283 mWindowTitle = new char[strlen(title) + 1]; /* Flawfinder: ignore */
220 strcpy(mWindowTitle, title); 284 if(mWindowTitle == NULL)
285 {
286 llerrs << "Memory allocation failure" << llendl;
287 return;
288 }
221 289
290 strcpy(mWindowTitle, title); /* Flawfinder: ignore */
222 // Create the GL context and set it up for windowed or fullscreen, as appropriate. 291 // Create the GL context and set it up for windowed or fullscreen, as appropriate.
223 if(createContext(x, y, width, height, 32, fullscreen, disable_vsync)) 292 if(createContext(x, y, width, height, 32, fullscreen, disable_vsync))
224 { 293 {
@@ -242,10 +311,10 @@ LLWindowSDL::LLWindowSDL(char *title, S32 x, S32 y, S32 width,
242static SDL_Surface *Load_BMP_Resource(const char *basename) 311static SDL_Surface *Load_BMP_Resource(const char *basename)
243{ 312{
244 const int PATH_BUFFER_SIZE=1000; 313 const int PATH_BUFFER_SIZE=1000;
245 char path_buffer[PATH_BUFFER_SIZE]; 314 char path_buffer[PATH_BUFFER_SIZE]; /* Flawfinder: ignore */
246 315
247 // Figure out where our BMP is living on the disk 316 // Figure out where our BMP is living on the disk
248 snprintf(path_buffer, PATH_BUFFER_SIZE-1, "%s%sres-sdl%s%s", 317 snprintf(path_buffer, PATH_BUFFER_SIZE-1, "%s%sres-sdl%s%s", /* Flawfinder: ignore */
249 gDirUtilp->getAppRODataDir().c_str(), 318 gDirUtilp->getAppRODataDir().c_str(),
250 gDirUtilp->getDirDelimiter().c_str(), 319 gDirUtilp->getDirDelimiter().c_str(),
251 gDirUtilp->getDirDelimiter().c_str(), 320 gDirUtilp->getDirDelimiter().c_str(),
@@ -271,7 +340,7 @@ BOOL LLWindowSDL::createContext(int x, int y, int width, int height, int bits, B
271 { 340 {
272 llinfos << "sdl_init() failed! " << SDL_GetError() << llendl; 341 llinfos << "sdl_init() failed! " << SDL_GetError() << llendl;
273 setupFailure("window creation error", "error", OSMB_OK); 342 setupFailure("window creation error", "error", OSMB_OK);
274 return false; 343 return false;
275 } 344 }
276 345
277 SDL_version c_sdl_version; 346 SDL_version c_sdl_version;
@@ -415,8 +484,8 @@ BOOL LLWindowSDL::createContext(int x, int y, int width, int height, int bits, B
415 mFullscreenBits = -1; 484 mFullscreenBits = -1;
416 mFullscreenRefresh = -1; 485 mFullscreenRefresh = -1;
417 486
418 char error[256]; 487 char error[256]; /* Flawfinder: ignore */
419 sprintf(error, "Unable to run fullscreen at %d x %d.\nRunning in window.", width, height); 488 snprintf(error, sizeof(error), "Unable to run fullscreen at %d x %d.\nRunning in window.", width, height); /* Flawfinder: ignore */
420 OSMessageBox(error, "Error", OSMB_OK); 489 OSMessageBox(error, "Error", OSMB_OK);
421 } 490 }
422 } 491 }
@@ -948,24 +1017,29 @@ void LLWindowSDL::beforeDialog()
948 } 1017 }
949 1018
950#if LL_X11 1019#if LL_X11
951 if (SDL_Display) 1020 if (mSDL_Display)
952 { 1021 {
953 // Everything that we/SDL asked for should happen before we 1022 // Everything that we/SDL asked for should happen before we
954 // potentially hand control over to GTK. 1023 // potentially hand control over to GTK.
955 XSync(SDL_Display, False); 1024 XSync(mSDL_Display, False);
956 } 1025 }
957#endif // LL_X11 1026#endif // LL_X11
958 1027
959#if LL_GTK 1028#if LL_GTK
960 // this is a good time to grab some GTK version information for 1029 // this is a good time to grab some GTK version information for
961 // diagnostics 1030 // diagnostics, if not already done.
962 maybe_do_gtk_diagnostics(); 1031 ll_try_gtk_init();
963#endif // LL_GTK 1032#endif // LL_GTK
1033
1034 maybe_lock_display();
964} 1035}
965 1036
966void LLWindowSDL::afterDialog() 1037void LLWindowSDL::afterDialog()
967{ 1038{
968 llinfos << "LLWindowSDL::afterDialog()" << llendl; 1039 llinfos << "LLWindowSDL::afterDialog()" << llendl;
1040
1041 maybe_unlock_display();
1042
969 if (old_fullscreen && !was_fullscreen) 1043 if (old_fullscreen && !was_fullscreen)
970 { 1044 {
971 // *FIX: NOT YET WORKING (see below) 1045 // *FIX: NOT YET WORKING (see below)
@@ -985,13 +1059,13 @@ S32 LLWindowSDL::stat(const char* file_name, struct stat* stat_info)
985// set/reset the XWMHints flag for 'urgency' that usually makes the icon flash 1059// set/reset the XWMHints flag for 'urgency' that usually makes the icon flash
986void LLWindowSDL::x11_set_urgent(BOOL urgent) 1060void LLWindowSDL::x11_set_urgent(BOOL urgent)
987{ 1061{
988 if (SDL_Display && !mFullscreen) 1062 if (mSDL_Display && !mFullscreen)
989 { 1063 {
990 XWMHints *wm_hints; 1064 XWMHints *wm_hints;
991 1065
992 llinfos << "X11 hint for urgency, " << urgent << llendl; 1066 llinfos << "X11 hint for urgency, " << urgent << llendl;
993 1067
994 wm_hints = XGetWMHints(SDL_Display, mSDL_XWindowID); 1068 wm_hints = XGetWMHints(mSDL_Display, mSDL_XWindowID);
995 if (!wm_hints) 1069 if (!wm_hints)
996 wm_hints = XAllocWMHints(); 1070 wm_hints = XAllocWMHints();
997 1071
@@ -1000,9 +1074,9 @@ void LLWindowSDL::x11_set_urgent(BOOL urgent)
1000 else 1074 else
1001 wm_hints->flags &= ~XUrgencyHint; 1075 wm_hints->flags &= ~XUrgencyHint;
1002 1076
1003 XSetWMHints(SDL_Display, mSDL_XWindowID, wm_hints); 1077 XSetWMHints(mSDL_Display, mSDL_XWindowID, wm_hints);
1004 XFree(wm_hints); 1078 XFree(wm_hints);
1005 XSync(SDL_Display, False); 1079 XSync(mSDL_Display, False);
1006 } 1080 }
1007} 1081}
1008#endif // LL_X11 1082#endif // LL_X11
@@ -1035,6 +1109,8 @@ void LLWindowSDL::flashIcon(F32 seconds)
1035 right now it has the rare and desirable trait of being 1109 right now it has the rare and desirable trait of being
1036 generally stable and working. */ 1110 generally stable and working. */
1037 1111
1112typedef Atom x11clipboard_type;
1113
1038/* PRIMARY and CLIPBOARD are the two main kinds of 1114/* PRIMARY and CLIPBOARD are the two main kinds of
1039 X11 clipboard. A third are the CUT_BUFFERs which an 1115 X11 clipboard. A third are the CUT_BUFFERs which an
1040 obsolete holdover from X10 days and use a quite orthogonal 1116 obsolete holdover from X10 days and use a quite orthogonal
@@ -1047,26 +1123,52 @@ void LLWindowSDL::flashIcon(F32 seconds)
1047 we support (to as full an extent as the clipboard content type 1123 we support (to as full an extent as the clipboard content type
1048 allows) CLIPBOARD, PRIMARY, and CUT_BUFFER0. 1124 allows) CLIPBOARD, PRIMARY, and CUT_BUFFER0.
1049 */ 1125 */
1050#define SL_READWRITE_XCLIPBOARD_TYPE XInternAtom(SDL_Display, "CLIPBOARD", False) 1126static x11clipboard_type get_x11_readwrite_clipboard_type(void)
1051#define SL_WRITE_XCLIPBOARD_TYPE XA_PRIMARY 1127{
1128 return XInternAtom(get_SDL_Display(), "CLIPBOARD", False);
1129}
1130
1131static x11clipboard_type get_x11_write_clipboard_type(void)
1132{
1133 return XA_PRIMARY;
1134}
1052 1135
1053/* This is where our own private cutbuffer goes - we don't use 1136/* This is where our own private cutbuffer goes - we don't use
1054 a regular cutbuffer (XA_CUT_BUFFER0 etc) for intermediate 1137 a regular cutbuffer (XA_CUT_BUFFER0 etc) for intermediate
1055 storage because their use isn't really defined for holding UTF8. */ 1138 storage because their use isn't really defined for holding UTF8. */
1056#define SL_CUTBUFFER_TYPE XInternAtom(SDL_Display, "SECONDLIFE_CUTBUFFER", False) 1139static x11clipboard_type get_x11_cutbuffer_clipboard_type(void)
1140{
1141 return XInternAtom(get_SDL_Display(), "SECONDLIFE_CUTBUFFER", False);
1142}
1143
1144/* Some X11 atom-generators */
1145static Atom get_x11_targets_atom(void)
1146{
1147 return XInternAtom(get_SDL_Display(), "TARGETS", False);
1148}
1149
1150static Atom get_x11_text_atom(void)
1151{
1152 return XInternAtom(get_SDL_Display(), "TEXT", False);
1153}
1057 1154
1058/* These defines, and convert_data/convert_x11clipboard, 1155/* These defines, and convert_data/convert_x11clipboard,
1059 mostly exist to support non-text or unusually-encoded 1156 mostly exist to support non-text or unusually-encoded
1060 clipboard data, which we don't really have a need for at 1157 clipboard data, which we don't really have a need for at
1061 the moment. */ 1158 the moment. */
1062#define SDLCLIPTYPE(A, B, C, D) (int)((A<<24)|(B<<16)|(C<<8)|(D<<0)) 1159#define SDLCLIPTYPE(A, B, C, D) (int)(((A)<<24)|((B)<<16)|((C)<<8)|((D)<<0))
1063#define FORMAT_PREFIX "SECONDLIFE_x11clipboard_0x" 1160#define FORMAT_PREFIX "SECONDLIFE_x11clipboard_0x"
1064 1161
1065typedef Atom x11clipboard_type;
1066
1067static 1162static
1068x11clipboard_type convert_format(int type) 1163x11clipboard_type convert_format(int type)
1069{ 1164{
1165 if (!gWindowImplementation)
1166 {
1167 llwarns << "!gWindowImplementation in convert_format()"
1168 << llendl;
1169 return XA_STRING;
1170 }
1171
1070 switch (type) 1172 switch (type)
1071 { 1173 {
1072 case SDLCLIPTYPE('T', 'E', 'X', 'T'): 1174 case SDLCLIPTYPE('T', 'E', 'X', 'T'):
@@ -1074,15 +1176,17 @@ x11clipboard_type convert_format(int type)
1074 return XA_STRING; 1176 return XA_STRING;
1075 case SDLCLIPTYPE('U', 'T', 'F', '8'): 1177 case SDLCLIPTYPE('U', 'T', 'F', '8'):
1076 // newer de-facto UTF8 clipboard atom 1178 // newer de-facto UTF8 clipboard atom
1077 return XInternAtom(SDL_Display, "UTF8_STRING", False); 1179 return XInternAtom(gWindowImplementation->mSDL_Display,
1180 "UTF8_STRING", False);
1078 default: 1181 default:
1079 { 1182 {
1080 /* completely arbitrary clipboard types... we don't actually use 1183 /* completely arbitrary clipboard types... we don't actually use
1081 these right now, and support is skeletal. */ 1184 these right now, and support is skeletal. */
1082 char format[sizeof(FORMAT_PREFIX)+8+1]; 1185 char format[sizeof(FORMAT_PREFIX)+8+1]; /* Flawfinder: ignore */
1083 1186
1084 sprintf(format, "%s%08lx", FORMAT_PREFIX, (unsigned long)type); 1187 snprintf(format, sizeof(format), "%s%08lx", FORMAT_PREFIX, (unsigned long)type); /* Flawfinder: ignore */
1085 return XInternAtom(SDL_Display, format, False); 1188 return XInternAtom(gWindowImplementation->mSDL_Display,
1189 format, False);
1086 } 1190 }
1087 } 1191 }
1088} 1192}
@@ -1099,14 +1203,18 @@ convert_data(int type, char *dst, const char *src, int srclen)
1099 { 1203 {
1100 case SDLCLIPTYPE('T', 'E', 'X', 'T'): 1204 case SDLCLIPTYPE('T', 'E', 'X', 'T'):
1101 case SDLCLIPTYPE('U', 'T', 'F', '8'): 1205 case SDLCLIPTYPE('U', 'T', 'F', '8'):
1206 if (src == NULL)
1207 {
1208 break;
1209 }
1102 if ( srclen == 0 ) 1210 if ( srclen == 0 )
1103 srclen = strlen(src); 1211 srclen = strlen(src); /* Flawfinder: ignore */
1104 1212
1105 dstlen = srclen + 1; 1213 dstlen = srclen + 1;
1106 1214
1107 if ( dst ) // assume caller made it big enough by asking us 1215 if ( dst ) // assume caller made it big enough by asking us
1108 { 1216 {
1109 memcpy(dst, src, srclen); 1217 memcpy(dst, src, srclen); /* Flawfinder: ignore */
1110 dst[srclen] = '\0'; 1218 dst[srclen] = '\0';
1111 } 1219 }
1112 break; 1220 break;
@@ -1131,14 +1239,18 @@ convert_x11clipboard(int type, char *dst, const char *src, int srclen)
1131 { 1239 {
1132 case SDLCLIPTYPE('U', 'T', 'F', '8'): 1240 case SDLCLIPTYPE('U', 'T', 'F', '8'):
1133 case SDLCLIPTYPE('T', 'E', 'X', 'T'): 1241 case SDLCLIPTYPE('T', 'E', 'X', 'T'):
1242 if (src == NULL)
1243 {
1244 break;
1245 }
1134 if ( srclen == 0 ) 1246 if ( srclen == 0 )
1135 srclen = strlen(src); 1247 srclen = strlen(src); /* Flawfinder: ignore */
1136 1248
1137 dstlen = srclen + 1; 1249 dstlen = srclen + 1;
1138 1250
1139 if ( dst ) // assume caller made it big enough by asking us 1251 if ( dst ) // assume caller made it big enough by asking us
1140 { 1252 {
1141 memcpy(dst, src, srclen); 1253 memcpy(dst, src, srclen); /* Flawfinder: ignore */
1142 dst[srclen] = '\0'; 1254 dst[srclen] = '\0';
1143 } 1255 }
1144 break; 1256 break;
@@ -1155,9 +1267,9 @@ LLWindowSDL::is_empty_x11clipboard(void)
1155{ 1267{
1156 int retval; 1268 int retval;
1157 1269
1158 Lock_Display(); 1270 maybe_lock_display();
1159 retval = ( XGetSelectionOwner(SDL_Display, SL_READWRITE_XCLIPBOARD_TYPE) == None ); 1271 retval = ( XGetSelectionOwner(mSDL_Display, get_x11_readwrite_clipboard_type()) == None );
1160 Unlock_Display(); 1272 maybe_unlock_display();
1161 1273
1162 return(retval); 1274 return(retval);
1163} 1275}
@@ -1175,8 +1287,8 @@ LLWindowSDL::put_x11clipboard(int type, int srclen, const char *src)
1175 dst = (char *)malloc(dstlen); 1287 dst = (char *)malloc(dstlen);
1176 if ( dst != NULL ) 1288 if ( dst != NULL )
1177 { 1289 {
1178 Window root = DefaultRootWindow(SDL_Display); 1290 maybe_lock_display();
1179 Lock_Display(); 1291 Window root = DefaultRootWindow(mSDL_Display);
1180 convert_data(type, dst, src, srclen); 1292 convert_data(type, dst, src, srclen);
1181 // Cutbuffers are only allowed to have STRING atom types, 1293 // Cutbuffers are only allowed to have STRING atom types,
1182 // but Emacs puts UTF8 inside them anyway. We cautiously 1294 // but Emacs puts UTF8 inside them anyway. We cautiously
@@ -1185,7 +1297,7 @@ LLWindowSDL::put_x11clipboard(int type, int srclen, const char *src)
1185 { 1297 {
1186 // dstlen-1 so we don't include the trailing \0 1298 // dstlen-1 so we don't include the trailing \0
1187 llinfos << "X11: Populating cutbuffer." <<llendl; 1299 llinfos << "X11: Populating cutbuffer." <<llendl;
1188 XChangeProperty(SDL_Display, root, 1300 XChangeProperty(mSDL_Display, root,
1189 XA_CUT_BUFFER0, XA_STRING, 8, PropModeReplace, 1301 XA_CUT_BUFFER0, XA_STRING, 8, PropModeReplace,
1190 (unsigned char*)dst, dstlen-1); 1302 (unsigned char*)dst, dstlen-1);
1191 } else { 1303 } else {
@@ -1194,18 +1306,18 @@ LLWindowSDL::put_x11clipboard(int type, int srclen, const char *src)
1194 //XDeleteProperty(SDL_Display, root, XA_CUT_BUFFER0); 1306 //XDeleteProperty(SDL_Display, root, XA_CUT_BUFFER0);
1195 } 1307 }
1196 // Private cutbuffer of an appropriate type. 1308 // Private cutbuffer of an appropriate type.
1197 XChangeProperty(SDL_Display, root, 1309 XChangeProperty(mSDL_Display, root,
1198 SL_CUTBUFFER_TYPE, format, 8, PropModeReplace, 1310 get_x11_cutbuffer_clipboard_type(), format, 8, PropModeReplace,
1199 (unsigned char*)dst, dstlen-1); 1311 (unsigned char*)dst, dstlen-1);
1200 free(dst); 1312 free(dst);
1201 1313
1202 /* Claim ownership of both PRIMARY and CLIPBOARD */ 1314 /* Claim ownership of both PRIMARY and CLIPBOARD */
1203 XSetSelectionOwner(SDL_Display, SL_READWRITE_XCLIPBOARD_TYPE, 1315 XSetSelectionOwner(mSDL_Display, get_x11_readwrite_clipboard_type(),
1204 mSDL_XWindowID, CurrentTime); 1316 mSDL_XWindowID, CurrentTime);
1205 XSetSelectionOwner(SDL_Display, SL_WRITE_XCLIPBOARD_TYPE, 1317 XSetSelectionOwner(mSDL_Display, get_x11_write_clipboard_type(),
1206 mSDL_XWindowID, CurrentTime); 1318 mSDL_XWindowID, CurrentTime);
1207 1319
1208 Unlock_Display(); 1320 maybe_unlock_display();
1209 } 1321 }
1210} 1322}
1211 1323
@@ -1225,19 +1337,19 @@ LLWindowSDL::get_x11clipboard(int type, int *dstlen, char **dst)
1225 unsigned long overflow; 1337 unsigned long overflow;
1226 char *src; 1338 char *src;
1227 1339
1228 Lock_Display(); 1340 maybe_lock_display();
1229 owner = XGetSelectionOwner(SDL_Display, SL_READWRITE_XCLIPBOARD_TYPE); 1341 owner = XGetSelectionOwner(mSDL_Display, get_x11_readwrite_clipboard_type());
1230 Unlock_Display(); 1342 maybe_unlock_display();
1231 if (owner == None) 1343 if (owner == None)
1232 { 1344 {
1233 // Fall right back to ancient X10 cut-buffers 1345 // Fall right back to ancient X10 cut-buffers
1234 owner = DefaultRootWindow(SDL_Display); 1346 owner = DefaultRootWindow(mSDL_Display);
1235 selection = XA_CUT_BUFFER0; 1347 selection = XA_CUT_BUFFER0;
1236 } else if (owner == mSDL_XWindowID) 1348 } else if (owner == mSDL_XWindowID)
1237 { 1349 {
1238 // Use our own uncooked opaque string property 1350 // Use our own uncooked opaque string property
1239 owner = DefaultRootWindow(SDL_Display); 1351 owner = DefaultRootWindow(mSDL_Display);
1240 selection = SL_CUTBUFFER_TYPE; 1352 selection = get_x11_cutbuffer_clipboard_type();
1241 } 1353 }
1242 else 1354 else
1243 { 1355 {
@@ -1246,11 +1358,11 @@ LLWindowSDL::get_x11clipboard(int type, int *dstlen, char **dst)
1246 SDL_Event event; 1358 SDL_Event event;
1247 1359
1248 owner = mSDL_XWindowID; 1360 owner = mSDL_XWindowID;
1249 Lock_Display(); 1361 maybe_lock_display();
1250 selection = XInternAtom(SDL_Display, "SDL_SELECTION", False); 1362 selection = XInternAtom(mSDL_Display, "SDL_SELECTION", False);
1251 XConvertSelection(SDL_Display, SL_READWRITE_XCLIPBOARD_TYPE, format, 1363 XConvertSelection(mSDL_Display, get_x11_readwrite_clipboard_type(), format,
1252 selection, owner, CurrentTime); 1364 selection, owner, CurrentTime);
1253 Unlock_Display(); 1365 maybe_unlock_display();
1254 llinfos << "X11: Waiting for clipboard to arrive." <<llendl; 1366 llinfos << "X11: Waiting for clipboard to arrive." <<llendl;
1255 while ( ! selection_response ) 1367 while ( ! selection_response )
1256 { 1368 {
@@ -1276,8 +1388,8 @@ LLWindowSDL::get_x11clipboard(int type, int *dstlen, char **dst)
1276 llinfos << "X11: Clipboard arrived." <<llendl; 1388 llinfos << "X11: Clipboard arrived." <<llendl;
1277 } 1389 }
1278 1390
1279 Lock_Display(); 1391 maybe_lock_display();
1280 if ( XGetWindowProperty(SDL_Display, owner, selection, 0, INT_MAX/4, 1392 if ( XGetWindowProperty(mSDL_Display, owner, selection, 0, INT_MAX/4,
1281 False, format, &seln_type, &seln_format, 1393 False, format, &seln_type, &seln_format,
1282 &nbytes, &overflow, (unsigned char **)&src) == Success ) 1394 &nbytes, &overflow, (unsigned char **)&src) == Success )
1283 { 1395 {
@@ -1292,8 +1404,7 @@ LLWindowSDL::get_x11clipboard(int type, int *dstlen, char **dst)
1292 } 1404 }
1293 XFree(src); 1405 XFree(src);
1294 } 1406 }
1295 1407 maybe_unlock_display();
1296 Unlock_Display();
1297} 1408}
1298 1409
1299int clipboard_filter_callback(const SDL_Event *event) 1410int clipboard_filter_callback(const SDL_Event *event)
@@ -1306,7 +1417,7 @@ int clipboard_filter_callback(const SDL_Event *event)
1306 1417
1307 /* Handle window-manager specific clipboard events */ 1418 /* Handle window-manager specific clipboard events */
1308 switch (event->syswm.msg->event.xevent.type) { 1419 switch (event->syswm.msg->event.xevent.type) {
1309 /* Copy the selection from SL_CUTBUFFER_TYPE to the requested property */ 1420 /* Copy the selection from SECONDLIFE_CUTBUFFER to the requested property */
1310 case SelectionRequest: { 1421 case SelectionRequest: {
1311 XSelectionRequestEvent *req; 1422 XSelectionRequestEvent *req;
1312 XEvent sevent; 1423 XEvent sevent;
@@ -1323,8 +1434,8 @@ int clipboard_filter_callback(const SDL_Event *event)
1323 sevent.xselection.property = None; 1434 sevent.xselection.property = None;
1324 sevent.xselection.requestor = req->requestor; 1435 sevent.xselection.requestor = req->requestor;
1325 sevent.xselection.time = req->time; 1436 sevent.xselection.time = req->time;
1326 if ( XGetWindowProperty(SDL_Display, DefaultRootWindow(SDL_Display), 1437 if ( XGetWindowProperty(get_SDL_Display(), DefaultRootWindow(get_SDL_Display()),
1327 SL_CUTBUFFER_TYPE, 0, INT_MAX/4, False, req->target, 1438 get_x11_cutbuffer_clipboard_type(), 0, INT_MAX/4, False, req->target,
1328 &sevent.xselection.target, &seln_format, 1439 &sevent.xselection.target, &seln_format,
1329 &nbytes, &overflow, &seln_data) == Success ) 1440 &nbytes, &overflow, &seln_data) == Success )
1330 { 1441 {
@@ -1337,21 +1448,20 @@ int clipboard_filter_callback(const SDL_Event *event)
1337 if ( seln_data[nbytes-1] == '\0' ) 1448 if ( seln_data[nbytes-1] == '\0' )
1338 --nbytes; 1449 --nbytes;
1339 } 1450 }
1340 XChangeProperty(SDL_Display, req->requestor, req->property, 1451 XChangeProperty(get_SDL_Display(), req->requestor, req->property,
1341 req->target, seln_format, PropModeReplace, 1452 req->target, seln_format, PropModeReplace,
1342 seln_data, nbytes); 1453 seln_data, nbytes);
1343 sevent.xselection.property = req->property; 1454 sevent.xselection.property = req->property;
1344#define XA_TARGETS XInternAtom(SDL_Display, "TARGETS", False) 1455 } else if (get_x11_targets_atom() == req->target) {
1345 } else if (XA_TARGETS == req->target) {
1346 /* only advertise what we currently support */ 1456 /* only advertise what we currently support */
1347 const int num_supported = 3; 1457 const int num_supported = 3;
1348 Atom supported[num_supported] = { 1458 Atom supported[num_supported] = {
1349 XA_STRING, // will be over-written below 1459 XA_STRING, // will be over-written below
1350 XInternAtom(SDL_Display, "TEXT",False), 1460 get_x11_text_atom(),
1351 XA_TARGETS 1461 get_x11_targets_atom()
1352 }; 1462 };
1353 supported[0] = sevent.xselection.target; 1463 supported[0] = sevent.xselection.target;
1354 XChangeProperty(SDL_Display, req->requestor, 1464 XChangeProperty(get_SDL_Display(), req->requestor,
1355 req->property, XA_ATOM, 32, PropModeReplace, 1465 req->property, XA_ATOM, 32, PropModeReplace,
1356 (unsigned char*)supported, 1466 (unsigned char*)supported,
1357 num_supported); 1467 num_supported);
@@ -1364,10 +1474,10 @@ int clipboard_filter_callback(const SDL_Event *event)
1364 XFree(seln_data); 1474 XFree(seln_data);
1365 } 1475 }
1366 int sendret = 1476 int sendret =
1367 XSendEvent(SDL_Display,req->requestor,False,0,&sevent); 1477 XSendEvent(get_SDL_Display(),req->requestor,False,0,&sevent);
1368 if ((sendret==BadValue) || (sendret==BadWindow)) 1478 if ((sendret==BadValue) || (sendret==BadWindow))
1369 llwarns << "Clipboard SendEvent failed" << llendl; 1479 llwarns << "Clipboard SendEvent failed" << llendl;
1370 XSync(SDL_Display, False); 1480 XSync(get_SDL_Display(), False);
1371 } 1481 }
1372 break; 1482 break;
1373 } 1483 }
@@ -1392,8 +1502,7 @@ LLWindowSDL::init_x11clipboard(void)
1392 /* Save the information for later use */ 1502 /* Save the information for later use */
1393 if ( info.subsystem == SDL_SYSWM_X11 ) 1503 if ( info.subsystem == SDL_SYSWM_X11 )
1394 { 1504 {
1395 SDL_Display = info.info.x11.display; 1505 mSDL_Display = info.info.x11.display;
1396 SDL_XWindowID = info.info.x11.wmwindow;
1397 mSDL_XWindowID = info.info.x11.wmwindow; 1506 mSDL_XWindowID = info.info.x11.wmwindow;
1398 Lock_Display = info.info.x11.lock_func; 1507 Lock_Display = info.info.x11.lock_func;
1399 Unlock_Display = info.info.x11.unlock_func; 1508 Unlock_Display = info.info.x11.unlock_func;
@@ -1415,8 +1524,7 @@ LLWindowSDL::init_x11clipboard(void)
1415void 1524void
1416LLWindowSDL::quit_x11clipboard(void) 1525LLWindowSDL::quit_x11clipboard(void)
1417{ 1526{
1418 SDL_Display = NULL; 1527 mSDL_Display = NULL;
1419 SDL_XWindowID = None;
1420 mSDL_XWindowID = None; 1528 mSDL_XWindowID = None;
1421 Lock_Display = NULL; 1529 Lock_Display = NULL;
1422 Unlock_Display = NULL; 1530 Unlock_Display = NULL;
@@ -1470,7 +1578,11 @@ BOOL LLWindowSDL::copyTextToClipboard(const LLWString &s)
1470{ 1578{
1471 std::string utf8text = wstring_to_utf8str(s); 1579 std::string utf8text = wstring_to_utf8str(s);
1472 const char* cstr = utf8text.c_str(); 1580 const char* cstr = utf8text.c_str();
1473 int cstrlen = strlen(cstr); 1581 if (cstr == NULL)
1582 {
1583 return FALSE;
1584 }
1585 int cstrlen = strlen(cstr); /* Flawfinder: ignore */
1474 int i; 1586 int i;
1475 for (i=0; i<cstrlen; ++i) 1587 for (i=0; i<cstrlen; ++i)
1476 { 1588 {
@@ -1653,7 +1765,7 @@ BOOL LLWindowSDL::SDLReallyCaptureInput(BOOL capture)
1653 if (!mFullscreen) /* only bother if we're windowed anyway */ 1765 if (!mFullscreen) /* only bother if we're windowed anyway */
1654 { 1766 {
1655#if LL_X11 1767#if LL_X11
1656 if (SDL_Display) 1768 if (mSDL_Display)
1657 { 1769 {
1658 /* we dirtily mix raw X11 with SDL so that our pointer 1770 /* we dirtily mix raw X11 with SDL so that our pointer
1659 isn't (as often) constrained to the limits of the 1771 isn't (as often) constrained to the limits of the
@@ -1669,7 +1781,7 @@ BOOL LLWindowSDL::SDLReallyCaptureInput(BOOL capture)
1669 { 1781 {
1670 //llinfos << "X11 POINTER GRABBY" << llendl; 1782 //llinfos << "X11 POINTER GRABBY" << llendl;
1671 //newmode = SDL_WM_GrabInput(wantmode); 1783 //newmode = SDL_WM_GrabInput(wantmode);
1672 result = XGrabPointer(SDL_Display, mSDL_XWindowID, 1784 result = XGrabPointer(mSDL_Display, mSDL_XWindowID,
1673 True, 0, GrabModeAsync, 1785 True, 0, GrabModeAsync,
1674 GrabModeAsync, 1786 GrabModeAsync,
1675 None, None, CurrentTime); 1787 None, None, CurrentTime);
@@ -1683,9 +1795,9 @@ BOOL LLWindowSDL::SDLReallyCaptureInput(BOOL capture)
1683 newmode = SDL_GRAB_OFF; 1795 newmode = SDL_GRAB_OFF;
1684 //newmode = SDL_WM_GrabInput(SDL_GRAB_OFF); 1796 //newmode = SDL_WM_GrabInput(SDL_GRAB_OFF);
1685 1797
1686 XUngrabPointer(SDL_Display, CurrentTime); 1798 XUngrabPointer(mSDL_Display, CurrentTime);
1687 // Make sure the ungrab happens RIGHT NOW. 1799 // Make sure the ungrab happens RIGHT NOW.
1688 XSync(SDL_Display, False); 1800 XSync(mSDL_Display, False);
1689 } else 1801 } else
1690 { 1802 {
1691 newmode = SDL_GRAB_QUERY; // neutral 1803 newmode = SDL_GRAB_QUERY; // neutral
@@ -1751,6 +1863,29 @@ void LLWindowSDL::gatherInput()
1751 static Uint32 lastRightDown = 0; 1863 static Uint32 lastRightDown = 0;
1752 SDL_Event event; 1864 SDL_Event event;
1753 1865
1866#if LL_GTK && LL_LIBXUL_ENABLED
1867 // Pump GTK events so embedded Gecko doesn't starve.
1868 if (ll_try_gtk_init())
1869 {
1870 // Yuck, Mozilla's GTK callbacks play with the locale - push/pop
1871 // the locale to protect it, as exotic/non-C locales
1872 // causes our code lots of general critical weirdness
1873 // and crashness. (SL-35450)
1874 char *saved_locale = setlocale(LC_ALL, NULL);
1875
1876 // Do a limited number of pumps so SL doesn't starve!
1877 // FIXME - this should ideally be time-limited, not count-limited.
1878 gtk_main_iteration_do(0); // Always do one non-blocking pump
1879 for (int iter=0; iter<10; ++iter)
1880 if (gtk_events_pending())
1881 gtk_main_iteration();
1882
1883 if (saved_locale)
1884 setlocale(LC_ALL, saved_locale);
1885 }
1886#endif // LL_GTK && LL_LIBXUL_ENABLED
1887
1888 // Handle all outstanding SDL events
1754 while (SDL_PollEvent(&event)) 1889 while (SDL_PollEvent(&event))
1755 { 1890 {
1756 switch (event.type) 1891 switch (event.type)
@@ -2237,15 +2372,12 @@ S32 OSMessageBoxSDL(const char* text, const char* caption, U32 type)
2237{ 2372{
2238 S32 rtn = OSBTN_CANCEL; 2373 S32 rtn = OSBTN_CANCEL;
2239 2374
2240#if LL_GTK 2375 ll_try_gtk_init();
2241 maybe_do_gtk_diagnostics();
2242#endif // LL_GTK
2243 2376
2244 if(gWindowImplementation != NULL) 2377 if(gWindowImplementation != NULL)
2245 gWindowImplementation->beforeDialog(); 2378 gWindowImplementation->beforeDialog();
2246 2379
2247 gtk_disable_setlocale(); 2380 if (ll_try_gtk_init()
2248 if (gtk_init_check(NULL, NULL)
2249 // We can NOT expect to combine GTK and SDL's aggressive fullscreen 2381 // We can NOT expect to combine GTK and SDL's aggressive fullscreen
2250 && ((NULL==gWindowImplementation) || (!was_fullscreen)) 2382 && ((NULL==gWindowImplementation) || (!was_fullscreen))
2251 ) 2383 )
@@ -2281,10 +2413,11 @@ S32 OSMessageBoxSDL(const char* text, const char* caption, U32 type)
2281 // Make GTK tell the window manager to associate this 2413 // Make GTK tell the window manager to associate this
2282 // dialog with our non-GTK SDL window, which should try 2414 // dialog with our non-GTK SDL window, which should try
2283 // to keep it on top etc. 2415 // to keep it on top etc.
2284 if (SDL_XWindowID != None) 2416 if (gWindowImplementation &&
2417 gWindowImplementation->mSDL_XWindowID != None)
2285 { 2418 {
2286 gtk_widget_realize(GTK_WIDGET(win)); // so we can get its gdkwin 2419 gtk_widget_realize(GTK_WIDGET(win)); // so we can get its gdkwin
2287 GdkWindow *gdkwin = gdk_window_foreign_new(SDL_XWindowID); 2420 GdkWindow *gdkwin = gdk_window_foreign_new(gWindowImplementation->mSDL_XWindowID);
2288 gdk_window_set_transient_for(GTK_WIDGET(win)->window, 2421 gdk_window_set_transient_for(GTK_WIDGET(win)->window,
2289 gdkwin); 2422 gdkwin);
2290 } 2423 }
@@ -2353,8 +2486,7 @@ BOOL LLWindowSDL::dialog_color_picker ( F32 *r, F32 *g, F32 *b)
2353 2486
2354 beforeDialog(); 2487 beforeDialog();
2355 2488
2356 gtk_disable_setlocale(); 2489 if (ll_try_gtk_init()
2357 if (gtk_init_check(NULL, NULL)
2358 // We can NOT expect to combine GTK and SDL's aggressive fullscreen 2490 // We can NOT expect to combine GTK and SDL's aggressive fullscreen
2359 && !was_fullscreen 2491 && !was_fullscreen
2360 ) 2492 )
@@ -2367,10 +2499,10 @@ BOOL LLWindowSDL::dialog_color_picker ( F32 *r, F32 *g, F32 *b)
2367 // Get GTK to tell the window manager to associate this 2499 // Get GTK to tell the window manager to associate this
2368 // dialog with our non-GTK SDL window, which should try 2500 // dialog with our non-GTK SDL window, which should try
2369 // to keep it on top etc. 2501 // to keep it on top etc.
2370 if (SDL_XWindowID != None) 2502 if (mSDL_XWindowID != None)
2371 { 2503 {
2372 gtk_widget_realize(GTK_WIDGET(win)); // so we can get its gdkwin 2504 gtk_widget_realize(GTK_WIDGET(win)); // so we can get its gdkwin
2373 GdkWindow *gdkwin = gdk_window_foreign_new(SDL_XWindowID); 2505 GdkWindow *gdkwin = gdk_window_foreign_new(mSDL_XWindowID);
2374 gdk_window_set_transient_for(GTK_WIDGET(win)->window, 2506 gdk_window_set_transient_for(GTK_WIDGET(win)->window,
2375 gdkwin); 2507 gdkwin);
2376 } 2508 }
@@ -2442,8 +2574,9 @@ void spawn_web_browser(const char* escaped_url)
2442 2574
2443#if LL_LINUX 2575#if LL_LINUX
2444# if LL_X11 2576# if LL_X11
2445 if (SDL_Display) // Just in case - before forking. 2577 if (gWindowImplementation &&
2446 XSync(SDL_Display, False); 2578 gWindowImplementation->mSDL_Display) // Just in case - before forking.
2579 XSync(gWindowImplementation->mSDL_Display, False);
2447# endif // LL_X11 2580# endif // LL_X11
2448 2581
2449 std::string cmd; 2582 std::string cmd;
@@ -2461,7 +2594,7 @@ void spawn_web_browser(const char* escaped_url)
2461 close(1); 2594 close(1);
2462 close(2); 2595 close(2);
2463 // end ourself by running the command 2596 // end ourself by running the command
2464 execv(cmd.c_str(), argv); 2597 execv(cmd.c_str(), argv); /* Flawfinder: ignore */
2465 // if execv returns at all, there was a problem. 2598 // if execv returns at all, there was a problem.
2466 llwarns << "execv failure when trying to start " << cmd << llendl; 2599 llwarns << "execv failure when trying to start " << cmd << llendl;
2467 _exit(1); // _exit because we don't want atexit() clean-up! 2600 _exit(1); // _exit because we don't want atexit() clean-up!
@@ -2488,13 +2621,26 @@ void shell_open( const char* file_path )
2488 2621
2489void *LLWindowSDL::getPlatformWindow() 2622void *LLWindowSDL::getPlatformWindow()
2490{ 2623{
2491#if LL_X11 2624#if LL_GTK && LL_LIBXUL_ENABLED
2492 // pointer to our static raw X window 2625 if (ll_try_gtk_init())
2493 return (void*)&SDL_XWindowID; 2626 {
2494#else 2627 GtkWidget *win = gtk_window_new(GTK_WINDOW_TOPLEVEL);
2495 // doubt we really want to return a high-level SDL structure here. 2628
2629 // These hacks were attempts to get Gecko to see the keyboard,
2630 // but I think they're doomed to fail.
2631 //GdkWindow *gdkwin = gdk_window_foreign_new(SDL_XWindowID);
2632 //GTK_WIDGET(win)->window = gdkwin;
2633 //gtk_widget_set_parent_window(win, gdkwin);
2634
2635 // show the hidden-widget while debugging (needs mozlib change)
2636 //gtk_widget_show_all(GTK_WIDGET(win));
2637
2638 gtk_widget_realize(GTK_WIDGET(win));
2639 return win;
2640 }
2641#endif // LL_GTK && LL_LIBXUL_ENABLED
2642 // Unixoid mozilla really needs GTK.
2496 return NULL; 2643 return NULL;
2497#endif
2498} 2644}
2499 2645
2500void LLWindowSDL::bringToFront() 2646void LLWindowSDL::bringToFront()
diff --git a/linden/indra/llwindow/llwindowsdl.h b/linden/indra/llwindow/llwindowsdl.h
index 0528b84..ed529a2 100644
--- a/linden/indra/llwindow/llwindowsdl.h
+++ b/linden/indra/llwindow/llwindowsdl.h
@@ -112,7 +112,17 @@ public:
112 112
113 /*virtual*/ void *getPlatformWindow(); 113 /*virtual*/ void *getPlatformWindow();
114 /*virtual*/ void bringToFront(); 114 /*virtual*/ void bringToFront();
115 115
116 // Not great that these are public, but they have to be accessible
117 // by non-class code and it's better than making them global.
118#if LL_X11
119 // These are set up by the X11 clipboard initialization code
120 Window mSDL_XWindowID;
121 Display *mSDL_Display;
122#endif
123 void (*Lock_Display)(void);
124 void (*Unlock_Display)(void);
125
116protected: 126protected:
117 LLWindowSDL( 127 LLWindowSDL(
118 char *title, int x, int y, int width, int height, U32 flags, 128 char *title, int x, int y, int width, int height, U32 flags,
@@ -179,10 +189,6 @@ protected:
179 189
180#if LL_X11 190#if LL_X11
181private: 191private:
182 // These are set up by the X11 clipboard initialization code
183 Window mSDL_XWindowID;
184 void (*Lock_Display)(void);
185 void (*Unlock_Display)(void);
186 // more X11 clipboard stuff 192 // more X11 clipboard stuff
187 int init_x11clipboard(void); 193 int init_x11clipboard(void);
188 void quit_x11clipboard(void); 194 void quit_x11clipboard(void);
@@ -214,4 +220,14 @@ S32 OSMessageBoxSDL(const char* text, const char* caption, U32 type);
214void load_url_external(const char* url); 220void load_url_external(const char* url);
215void shell_open( const char* file_path ); 221void shell_open( const char* file_path );
216 222
223#if LL_GTK
224// Lazily initialize and check the runtime GTK version for goodness.
225BOOL ll_try_gtk_init(void);
226#endif // LL_GTK
227
228#if LL_X11
229Window get_SDL_XWindowID(void);
230Display* get_SDL_Display(void);
231#endif // LL_X11
232
217#endif //LL_LLWINDOWSDL_H 233#endif //LL_LLWINDOWSDL_H
diff --git a/linden/indra/llwindow/llwindowwin32.cpp b/linden/indra/llwindow/llwindowwin32.cpp
index 5929fb5..1d084d2 100644
--- a/linden/indra/llwindow/llwindowwin32.cpp
+++ b/linden/indra/llwindow/llwindowwin32.cpp
@@ -74,57 +74,6 @@ void show_window_creation_error(const char* title)
74{ 74{
75 llwarns << title << llendl; 75 llwarns << title << llendl;
76 shell_open( "help/window_creation_error.html"); 76 shell_open( "help/window_creation_error.html");
77 /*
78 OSMessageBox(
79 "Second Life is unable to run because it can't set up your display.\n"
80 "We need to be able to make a 32-bit color window at 1024x768, with\n"
81 "an 8 bit alpha channel.\n"
82 "\n"
83 "First, be sure your monitor is set to True Color (32-bit) in\n"
84 "Start -> Control Panels -> Display -> Settings.\n"
85 "\n"
86 "Otherwise, this may be due to video card driver issues.\n"
87 "Please make sure you have the latest video card drivers installed.\n"
88 "ATI drivers are available at http://www.ati.com/\n"
89 "nVidia drivers are available at http://www.nvidia.com/\n"
90 "\n"
91 "If you continue to receive this message, contact customer service.",
92 title,
93 OSMB_OK);
94 */
95}
96
97BOOL check_for_card(const char* RENDERER, const char* bad_card)
98{
99 if (!strnicmp(RENDERER, bad_card, strlen(bad_card)))
100 {
101 char buffer[1024];
102 sprintf(buffer,
103 "Your video card appears to be a %s, which Second Life does not support.\n"
104 "\n"
105 "Second Life requires a video card with 32 Mb of memory or more, as well as\n"
106 "multitexture support. We explicitly support nVidia GeForce 2 or better, \n"
107 "and ATI Radeon 8500 or better.\n"
108 "\n"
109 "If you own a supported card and continue to receive this message, try \n"
110 "updating to the latest video card drivers. Otherwise look in the\n"
111 "secondlife.com support section or e-mail technical support\n"
112 "\n"
113 "You can try to run Second Life, but it will probably crash or run\n"
114 "very slowly. Try anyway?",
115 bad_card);
116 S32 button = OSMessageBox(buffer, "Unsupported video card", OSMB_YESNO);
117 if (OSBTN_YES == button)
118 {
119 return FALSE;
120 }
121 else
122 {
123 return TRUE;
124 }
125 }
126
127 return FALSE;
128} 77}
129 78
130//static 79//static
@@ -147,6 +96,7 @@ LLWindowWin32::LLWindowWin32(char *title, char *name, S32 x, S32 y, S32 width,
147 BOOL ignore_pixel_depth) 96 BOOL ignore_pixel_depth)
148 : LLWindow(fullscreen, flags) 97 : LLWindow(fullscreen, flags)
149{ 98{
99 S32 i = 0;
150 mIconResource = gIconResource; 100 mIconResource = gIconResource;
151 mOverrideAspectRatio = 0.f; 101 mOverrideAspectRatio = 0.f;
152 mNativeAspectRatio = 0.f; 102 mNativeAspectRatio = 0.f;
@@ -348,8 +298,8 @@ LLWindowWin32::LLWindowWin32(char *title, char *name, S32 x, S32 y, S32 width,
348 mFullscreenBits = -1; 298 mFullscreenBits = -1;
349 mFullscreenRefresh = -1; 299 mFullscreenRefresh = -1;
350 300
351 char error[256]; 301 char error[256]; /* Flawfinder: ignore */
352 sprintf(error, "Unable to run fullscreen at %d x %d.\nRunning in window.", width, height); 302 snprintf(error, sizeof(error), "Unable to run fullscreen at %d x %d.\nRunning in window.", width, height); /* Flawfinder: ignore */
353 OSMessageBox(error, "Error", OSMB_OK); 303 OSMessageBox(error, "Error", OSMB_OK);
354 } 304 }
355 } 305 }
@@ -515,37 +465,6 @@ LLWindowWin32::LLWindowWin32(char *title, char *name, S32 x, S32 y, S32 width,
515 return; 465 return;
516 } 466 }
517 467
518 // Check for some explicitly unsupported cards.
519 const char* RENDERER = (const char*) glGetString(GL_RENDERER);
520
521 const char* CARD_LIST[] =
522 { "RAGE 128",
523 "RIVA TNT2",
524 "Intel 810",
525 "3Dfx/Voodoo3",
526 "Radeon 7000",
527 "Radeon 7200",
528 "Radeon 7500",
529 "Radeon DDR",
530 "Radeon VE",
531 "GDI Generic" };
532 const S32 CARD_COUNT = sizeof(CARD_LIST)/sizeof(char*);
533
534 // Future candidates:
535 // ProSavage/Twister
536 // SuperSavage
537
538 S32 i;
539 for (i = 0; i < CARD_COUNT; i++)
540 {
541 if (check_for_card(RENDERER, CARD_LIST[i]))
542 {
543 close();
544 shell_open( "help/unsupported_card.html" );
545 return;
546 }
547 }
548
549 gGLManager.initWGL(); 468 gGLManager.initWGL();
550 469
551 if (gGLManager.mHasWGLARBPixelFormat && (wglChoosePixelFormatARB != NULL)) 470 if (gGLManager.mHasWGLARBPixelFormat && (wglChoosePixelFormatARB != NULL))
@@ -1976,20 +1895,6 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_
1976 << " key " << S32(w_param) 1895 << " key " << S32(w_param)
1977 << llendl; 1896 << llendl;
1978 } 1897 }
1979 // lower 15 bits hold key repeat count
1980 S32 key_repeat_count = l_param & 0x7fff;
1981 if (key_repeat_count > 1)
1982 {
1983 KEY translated_key;
1984 gKeyboard->translateKey(w_param, &translated_key);
1985 if (!gKeyboard->getKeyDown(translated_key))
1986 {
1987 //RN: hack for handling key repeats when we no longer recognize the key as being down
1988 //This is necessary because we sometimes ignore the message queue and use getAsyncKeyState
1989 // to clear key level flags before we've processed all key repeat messages
1990 return 0;
1991 }
1992 }
1993 if(gKeyboard->handleKeyDown(w_param, mask) && eat_keystroke) 1898 if(gKeyboard->handleKeyDown(w_param, mask) && eat_keystroke)
1994 { 1899 {
1995 return 0; 1900 return 0;
@@ -2469,7 +2374,7 @@ BOOL LLWindowWin32::copyTextToClipboard(const LLWString& wstr)
2469 WCHAR* copy_utf16 = (WCHAR*) GlobalLock(hglobal_copy_utf16); 2374 WCHAR* copy_utf16 = (WCHAR*) GlobalLock(hglobal_copy_utf16);
2470 if (copy_utf16) 2375 if (copy_utf16)
2471 { 2376 {
2472 memcpy(copy_utf16, out_utf16.c_str(), size_utf16); 2377 memcpy(copy_utf16, out_utf16.c_str(), size_utf16); /* Flawfinder: ignore */
2473 GlobalUnlock(hglobal_copy_utf16); 2378 GlobalUnlock(hglobal_copy_utf16);
2474 2379
2475 if (SetClipboardData(CF_UNICODETEXT, hglobal_copy_utf16)) 2380 if (SetClipboardData(CF_UNICODETEXT, hglobal_copy_utf16))
@@ -2493,7 +2398,7 @@ BOOL LLWindowWin32::copyTextToClipboard(const LLWString& wstr)
2493 char* copy = (char*) GlobalLock(hglobal_copy); 2398 char* copy = (char*) GlobalLock(hglobal_copy);
2494 if( copy ) 2399 if( copy )
2495 { 2400 {
2496 memcpy(copy, out_s.c_str(), size); 2401 memcpy(copy, out_s.c_str(), size); /* Flawfinder: ignore */
2497 GlobalUnlock(hglobal_copy); 2402 GlobalUnlock(hglobal_copy);
2498 2403
2499 if (SetClipboardData(CF_TEXT, hglobal_copy)) 2404 if (SetClipboardData(CF_TEXT, hglobal_copy))
@@ -2594,7 +2499,7 @@ BOOL LLWindowWin32::sendEmail(const char* address, const char* subject, const ch
2594 } 2499 }
2595 else 2500 else
2596 { 2501 {
2597 HINSTANCE hMAPIInst = LoadLibrary(L"MAPI32.DLL"); 2502 HINSTANCE hMAPIInst = LoadLibrary(L"MAPI32.DLL"); /* Flawfinder: ignore */
2598 if(!hMAPIInst) 2503 if(!hMAPIInst)
2599 { 2504 {
2600 result = LL_EMAIL_MAPILOAD_FAILED; 2505 result = LL_EMAIL_MAPILOAD_FAILED;
@@ -3112,7 +3017,7 @@ void spawn_web_browser(const char* escaped_url )
3112 S32 i; 3017 S32 i;
3113 for (i = 0; i < gURLProtocolWhitelistCount; i++) 3018 for (i = 0; i < gURLProtocolWhitelistCount; i++)
3114 { 3019 {
3115 S32 len = strlen(gURLProtocolWhitelist[i]); 3020 S32 len = strlen(gURLProtocolWhitelist[i]); /* Flawfinder: ignore */
3116 if (!strncmp(escaped_url, gURLProtocolWhitelist[i], len) 3021 if (!strncmp(escaped_url, gURLProtocolWhitelist[i], len)
3117 && escaped_url[len] == ':') 3022 && escaped_url[len] == ':')
3118 { 3023 {
@@ -3131,8 +3036,8 @@ void spawn_web_browser(const char* escaped_url )
3131 3036
3132 // Figure out the user's default web browser 3037 // Figure out the user's default web browser
3133 // HKEY_CLASSES_ROOT\http\shell\open\command 3038 // HKEY_CLASSES_ROOT\http\shell\open\command
3134 char reg_path_str[256]; 3039 char reg_path_str[256]; /* Flawfinder: ignore */
3135 sprintf(reg_path_str, "%s\\shell\\open\\command", gURLProtocolWhitelistHandler[i]); 3040 snprintf(reg_path_str, sizeof(reg_path_str), "%s\\shell\\open\\command", gURLProtocolWhitelistHandler[i]); /* Flawfinder: ignore */
3136 WCHAR reg_path_wstr[256]; 3041 WCHAR reg_path_wstr[256];
3137 mbstowcs(reg_path_wstr, reg_path_str, 1024); 3042 mbstowcs(reg_path_wstr, reg_path_str, 1024);
3138 3043
@@ -3183,7 +3088,7 @@ void spawn_web_browser(const char* escaped_url )
3183 // MS docs say to cast to int and compare to 32. 3088 // MS docs say to cast to int and compare to 32.
3184 HWND our_window = NULL; 3089 HWND our_window = NULL;
3185 LPCWSTR directory_wstr = NULL; 3090 LPCWSTR directory_wstr = NULL;
3186 int retval = (int) ShellExecute(our_window, 3091 int retval = (int) ShellExecute(our_window, /* Flawfinder: ignore */
3187 L"open", 3092 L"open",
3188 browser_exec_utf16.c_str(), 3093 browser_exec_utf16.c_str(),
3189 url_utf16.c_str(), 3094 url_utf16.c_str(),
@@ -3207,7 +3112,7 @@ void shell_open( const char* file_path )
3207 mbstowcs(wstr, file_path, 1024); 3112 mbstowcs(wstr, file_path, 1024);
3208 3113
3209 HWND our_window = NULL; 3114 HWND our_window = NULL;
3210 int retval = (int) ShellExecute(our_window, L"open", wstr, NULL, NULL, SW_SHOWNORMAL); 3115 int retval = (int) ShellExecute(our_window, L"open", wstr, NULL, NULL, SW_SHOWNORMAL); /* Flawfinder: ignore */
3211 if (retval > 32) 3116 if (retval > 32)
3212 { 3117 {
3213 llinfos << "ShellExecute success with " << retval << llendl; 3118 llinfos << "ShellExecute success with " << retval << llendl;
diff --git a/linden/indra/llwindow/llwindowwin32.h b/linden/indra/llwindow/llwindowwin32.h
index 77696e6..f6300f6 100644
--- a/linden/indra/llwindow/llwindowwin32.h
+++ b/linden/indra/llwindow/llwindowwin32.h
@@ -201,6 +201,7 @@ private:
201}; 201};
202 202
203extern LLW32MsgCallback gAsyncMsgCallback; 203extern LLW32MsgCallback gAsyncMsgCallback;
204extern LPWSTR gIconResource;
204 205
205static void handleMessage( const MSG& msg ); 206static void handleMessage( const MSG& msg );
206 207
diff --git a/linden/indra/llxml/llcontrol.cpp b/linden/indra/llxml/llcontrol.cpp
index 79fd522..c365aed 100644
--- a/linden/indra/llxml/llcontrol.cpp
+++ b/linden/indra/llxml/llcontrol.cpp
@@ -132,7 +132,8 @@ void LLControlGroup::cleanup()
132 132
133LLControlBase* LLControlGroup::getControl(const LLString& name) 133LLControlBase* LLControlGroup::getControl(const LLString& name)
134{ 134{
135 return mNameTable[name]; 135 ctrl_name_table_t::iterator iter = mNameTable.find(name);
136 return iter == mNameTable.end() ? NULL : (LLControlBase*)iter->second;
136} 137}
137 138
138BOOL LLControlGroup::declareControl(const LLString& name, eControlType type, const LLSD initial_val, const LLString& comment, BOOL persist) 139BOOL LLControlGroup::declareControl(const LLString& name, eControlType type, const LLSD initial_val, const LLString& comment, BOOL persist)
@@ -143,9 +144,11 @@ BOOL LLControlGroup::declareControl(const LLString& name, eControlType type, con
143 LLControl* control = new LLControl(name, type, initial_val, comment, persist); 144 LLControl* control = new LLControl(name, type, initial_val, comment, persist);
144 mNameTable[name] = control; 145 mNameTable[name] = control;
145 return TRUE; 146 return TRUE;
146 } else 147 }
148 else
147 { 149 {
148 llwarns << "LLControlGroup::declareControl: Control named " << name << " already exists." << llendl; 150 llwarns << "LLControlGroup::declareControl: Control named " << name << " already exists." << llendl;
151 mNameTable.erase(name);
149 return FALSE; 152 return FALSE;
150 } 153 }
151} 154}
@@ -207,7 +210,7 @@ BOOL LLControlGroup::declareColor3(const LLString& name, const LLColor3 &initial
207 210
208LLSD LLControlGroup::registerListener(const LLString& name, LLSimpleListenerObservable *listener) 211LLSD LLControlGroup::registerListener(const LLString& name, LLSimpleListenerObservable *listener)
209{ 212{
210 LLControlBase *control = mNameTable[name]; 213 LLControlBase *control = getControl(name);
211 if (control) 214 if (control)
212 { 215 {
213 return control->registerListener(listener); 216 return control->registerListener(listener);
@@ -217,7 +220,7 @@ LLSD LLControlGroup::registerListener(const LLString& name, LLSimpleListenerObse
217 220
218BOOL LLControlGroup::getBOOL(const LLString& name) 221BOOL LLControlGroup::getBOOL(const LLString& name)
219{ 222{
220 LLControlBase* control = mNameTable[name]; 223 LLControlBase* control = getControl(name);
221 224
222 if (control && control->isType(TYPE_BOOLEAN)) 225 if (control && control->isType(TYPE_BOOLEAN))
223 return control->get().asBoolean(); 226 return control->get().asBoolean();
@@ -230,7 +233,7 @@ BOOL LLControlGroup::getBOOL(const LLString& name)
230 233
231S32 LLControlGroup::getS32(const LLString& name) 234S32 LLControlGroup::getS32(const LLString& name)
232{ 235{
233 LLControlBase* control = mNameTable[name]; 236 LLControlBase* control = getControl(name);
234 237
235 if (control && control->isType(TYPE_S32)) 238 if (control && control->isType(TYPE_S32))
236 return control->get().asInteger(); 239 return control->get().asInteger();
@@ -243,7 +246,7 @@ S32 LLControlGroup::getS32(const LLString& name)
243 246
244U32 LLControlGroup::getU32(const LLString& name) 247U32 LLControlGroup::getU32(const LLString& name)
245{ 248{
246 LLControlBase* control = mNameTable[name]; 249 LLControlBase* control = getControl(name);
247 250
248 if (control && control->isType(TYPE_U32)) 251 if (control && control->isType(TYPE_U32))
249 return control->get().asInteger(); 252 return control->get().asInteger();
@@ -256,7 +259,7 @@ U32 LLControlGroup::getU32(const LLString& name)
256 259
257F32 LLControlGroup::getF32(const LLString& name) 260F32 LLControlGroup::getF32(const LLString& name)
258{ 261{
259 LLControlBase* control = mNameTable[name]; 262 LLControlBase* control = getControl(name);
260 263
261 if (control && control->isType(TYPE_F32)) 264 if (control && control->isType(TYPE_F32))
262 return (F32) control->get().asReal(); 265 return (F32) control->get().asReal();
@@ -269,7 +272,7 @@ F32 LLControlGroup::getF32(const LLString& name)
269 272
270LLString LLControlGroup::findString(const LLString& name) 273LLString LLControlGroup::findString(const LLString& name)
271{ 274{
272 LLControlBase* control = mNameTable[name]; 275 LLControlBase* control = getControl(name);
273 276
274 if (control && control->isType(TYPE_STRING)) 277 if (control && control->isType(TYPE_STRING))
275 return control->get().asString(); 278 return control->get().asString();
@@ -278,7 +281,7 @@ LLString LLControlGroup::findString(const LLString& name)
278 281
279LLString LLControlGroup::getString(const LLString& name) 282LLString LLControlGroup::getString(const LLString& name)
280{ 283{
281 LLControlBase* control = mNameTable[name]; 284 LLControlBase* control = getControl(name);
282 285
283 if (control && control->isType(TYPE_STRING)) 286 if (control && control->isType(TYPE_STRING))
284 return control->get().asString(); 287 return control->get().asString();
@@ -304,7 +307,7 @@ LLString LLControlGroup::getText(const LLString& name)
304 307
305LLVector3 LLControlGroup::getVector3(const LLString& name) 308LLVector3 LLControlGroup::getVector3(const LLString& name)
306{ 309{
307 LLControlBase* control = mNameTable[name]; 310 LLControlBase* control = getControl(name);
308 311
309 if (control && control->isType(TYPE_VEC3)) 312 if (control && control->isType(TYPE_VEC3))
310 return control->get(); 313 return control->get();
@@ -317,7 +320,7 @@ LLVector3 LLControlGroup::getVector3(const LLString& name)
317 320
318LLVector3d LLControlGroup::getVector3d(const LLString& name) 321LLVector3d LLControlGroup::getVector3d(const LLString& name)
319{ 322{
320 LLControlBase* control = mNameTable[name]; 323 LLControlBase* control = getControl(name);
321 324
322 if (control && control->isType(TYPE_VEC3D)) 325 if (control && control->isType(TYPE_VEC3D))
323 return control->get(); 326 return control->get();
@@ -330,7 +333,7 @@ LLVector3d LLControlGroup::getVector3d(const LLString& name)
330 333
331LLRect LLControlGroup::getRect(const LLString& name) 334LLRect LLControlGroup::getRect(const LLString& name)
332{ 335{
333 LLControlBase* control = mNameTable[name]; 336 LLControlBase* control = getControl(name);
334 337
335 if (control && control->isType(TYPE_RECT)) 338 if (control && control->isType(TYPE_RECT))
336 return control->get(); 339 return control->get();
@@ -376,7 +379,7 @@ LLColor4 LLControlGroup::getColor(const LLString& name)
376 379
377LLColor4U LLControlGroup::getColor4U(const LLString& name) 380LLColor4U LLControlGroup::getColor4U(const LLString& name)
378{ 381{
379 LLControlBase* control = mNameTable[name]; 382 LLControlBase* control = getControl(name);
380 383
381 if (control && control->isType(TYPE_COL4U)) 384 if (control && control->isType(TYPE_COL4U))
382 return control->get(); 385 return control->get();
@@ -389,7 +392,7 @@ LLColor4U LLControlGroup::getColor4U(const LLString& name)
389 392
390LLColor4 LLControlGroup::getColor4(const LLString& name) 393LLColor4 LLControlGroup::getColor4(const LLString& name)
391{ 394{
392 LLControlBase* control = mNameTable[name]; 395 LLControlBase* control = getControl(name);
393 396
394 if (control && control->isType(TYPE_COL4)) 397 if (control && control->isType(TYPE_COL4))
395 return control->get(); 398 return control->get();
@@ -402,7 +405,7 @@ LLColor4 LLControlGroup::getColor4(const LLString& name)
402 405
403LLColor3 LLControlGroup::getColor3(const LLString& name) 406LLColor3 LLControlGroup::getColor3(const LLString& name)
404{ 407{
405 LLControlBase* control = mNameTable[name]; 408 LLControlBase* control = getControl(name);
406 409
407 if (control && control->isType(TYPE_COL3)) 410 if (control && control->isType(TYPE_COL3))
408 return control->get(); 411 return control->get();
@@ -415,9 +418,8 @@ LLColor3 LLControlGroup::getColor3(const LLString& name)
415 418
416BOOL LLControlGroup::controlExists(const LLString& name) 419BOOL LLControlGroup::controlExists(const LLString& name)
417{ 420{
418 void *control = mNameTable[name]; 421 ctrl_name_table_t::iterator iter = mNameTable.find(name);
419 422 return iter != mNameTable.end();
420 return (control != 0);
421} 423}
422 424
423//------------------------------------------------------------------- 425//-------------------------------------------------------------------
@@ -426,7 +428,7 @@ BOOL LLControlGroup::controlExists(const LLString& name)
426 428
427void LLControlGroup::setBOOL(const LLString& name, BOOL val) 429void LLControlGroup::setBOOL(const LLString& name, BOOL val)
428{ 430{
429 LLControlBase* control = mNameTable[name]; 431 LLControlBase* control = getControl(name);
430 432
431 if (control && control->isType(TYPE_BOOLEAN)) 433 if (control && control->isType(TYPE_BOOLEAN))
432 { 434 {
@@ -441,7 +443,7 @@ void LLControlGroup::setBOOL(const LLString& name, BOOL val)
441 443
442void LLControlGroup::setS32(const LLString& name, S32 val) 444void LLControlGroup::setS32(const LLString& name, S32 val)
443{ 445{
444 LLControlBase* control = mNameTable[name]; 446 LLControlBase* control = getControl(name);
445 447
446 if (control && control->isType(TYPE_S32)) 448 if (control && control->isType(TYPE_S32))
447 { 449 {
@@ -456,7 +458,7 @@ void LLControlGroup::setS32(const LLString& name, S32 val)
456 458
457void LLControlGroup::setF32(const LLString& name, F32 val) 459void LLControlGroup::setF32(const LLString& name, F32 val)
458{ 460{
459 LLControlBase* control = mNameTable[name]; 461 LLControlBase* control = getControl(name);
460 462
461 if (control && control->isType(TYPE_F32)) 463 if (control && control->isType(TYPE_F32))
462 { 464 {
@@ -471,7 +473,7 @@ void LLControlGroup::setF32(const LLString& name, F32 val)
471 473
472void LLControlGroup::setU32(const LLString& name, U32 val) 474void LLControlGroup::setU32(const LLString& name, U32 val)
473{ 475{
474 LLControlBase* control = mNameTable[name]; 476 LLControlBase* control = getControl(name);
475 477
476 if (control && control->isType(TYPE_U32)) 478 if (control && control->isType(TYPE_U32))
477 { 479 {
@@ -486,7 +488,7 @@ void LLControlGroup::setU32(const LLString& name, U32 val)
486 488
487void LLControlGroup::setString(const LLString& name, const LLString &val) 489void LLControlGroup::setString(const LLString& name, const LLString &val)
488{ 490{
489 LLControlBase* control = mNameTable[name]; 491 LLControlBase* control = getControl(name);
490 492
491 if (control && control->isType(TYPE_STRING)) 493 if (control && control->isType(TYPE_STRING))
492 { 494 {
@@ -501,7 +503,7 @@ void LLControlGroup::setString(const LLString& name, const LLString &val)
501 503
502void LLControlGroup::setVector3(const LLString& name, const LLVector3 &val) 504void LLControlGroup::setVector3(const LLString& name, const LLVector3 &val)
503{ 505{
504 LLControlBase* control = mNameTable[name]; 506 LLControlBase* control = getControl(name);
505 507
506 if (control && control->isType(TYPE_VEC3)) 508 if (control && control->isType(TYPE_VEC3))
507 { 509 {
@@ -515,7 +517,7 @@ void LLControlGroup::setVector3(const LLString& name, const LLVector3 &val)
515 517
516void LLControlGroup::setVector3d(const LLString& name, const LLVector3d &val) 518void LLControlGroup::setVector3d(const LLString& name, const LLVector3d &val)
517{ 519{
518 LLControlBase* control = mNameTable[name]; 520 LLControlBase* control = getControl(name);
519 521
520 if (control && control->isType(TYPE_VEC3D)) 522 if (control && control->isType(TYPE_VEC3D))
521 { 523 {
@@ -529,7 +531,7 @@ void LLControlGroup::setVector3d(const LLString& name, const LLVector3d &val)
529 531
530void LLControlGroup::setRect(const LLString& name, const LLRect &val) 532void LLControlGroup::setRect(const LLString& name, const LLRect &val)
531{ 533{
532 LLControlBase* control = mNameTable[name]; 534 LLControlBase* control = getControl(name);
533 535
534 if (control && control->isType(TYPE_RECT)) 536 if (control && control->isType(TYPE_RECT))
535 { 537 {
@@ -543,7 +545,7 @@ void LLControlGroup::setRect(const LLString& name, const LLRect &val)
543 545
544void LLControlGroup::setColor4U(const LLString& name, const LLColor4U &val) 546void LLControlGroup::setColor4U(const LLString& name, const LLColor4U &val)
545{ 547{
546 LLControlBase* control = mNameTable[name]; 548 LLControlBase* control = getControl(name);
547 549
548 if (control && control->isType(TYPE_COL4U)) 550 if (control && control->isType(TYPE_COL4U))
549 { 551 {
@@ -557,7 +559,7 @@ void LLControlGroup::setColor4U(const LLString& name, const LLColor4U &val)
557 559
558void LLControlGroup::setColor4(const LLString& name, const LLColor4 &val) 560void LLControlGroup::setColor4(const LLString& name, const LLColor4 &val)
559{ 561{
560 LLControlBase* control = mNameTable[name]; 562 LLControlBase* control = getControl(name);
561 563
562 if (control && control->isType(TYPE_COL4)) 564 if (control && control->isType(TYPE_COL4))
563 { 565 {
@@ -576,7 +578,7 @@ void LLControlGroup::setValue(const LLString& name, const LLSD& val)
576 return; 578 return;
577 } 579 }
578 580
579 LLControlBase* control = mNameTable[name]; 581 LLControlBase* control = getControl(name);
580 582
581 if (control) 583 if (control)
582 { 584 {
@@ -599,7 +601,7 @@ U32 LLControlGroup::loadFromFileLegacy(const LLString& filename, BOOL require_de
599 llifstream file; 601 llifstream file;
600 S32 version; 602 S32 version;
601 603
602 file.open(filename.c_str()); 604 file.open(filename.c_str()); /*Flawfinder: ignore*/
603 605
604 if (!file) 606 if (!file)
605 { 607 {
@@ -629,7 +631,7 @@ U32 LLControlGroup::loadFromFileLegacy(const LLString& filename, BOOL require_de
629 if (name.substr(0,2) == "//") 631 if (name.substr(0,2) == "//")
630 { 632 {
631 // This is a comment. 633 // This is a comment.
632 char buffer[MAX_STRING]; 634 char buffer[MAX_STRING]; /*Flawfinder: ignore*/
633 file.getline(buffer, MAX_STRING); 635 file.getline(buffer, MAX_STRING);
634 continue; 636 continue;
635 } 637 }
@@ -643,7 +645,7 @@ U32 LLControlGroup::loadFromFileLegacy(const LLString& filename, BOOL require_de
643 if (!name.empty()) 645 if (!name.empty())
644 { 646 {
645 //read in to end of line 647 //read in to end of line
646 char buffer[MAX_STRING]; 648 char buffer[MAX_STRING]; /*Flawfinder: ignore*/
647 file.getline(buffer, MAX_STRING); 649 file.getline(buffer, MAX_STRING);
648 llwarns << "LLControlGroup::loadFromFile() : Trying to set \"" << name << "\", setting doesn't exist." << llendl; 650 llwarns << "LLControlGroup::loadFromFile() : Trying to set \"" << name << "\", setting doesn't exist." << llendl;
649 } 651 }
@@ -709,7 +711,7 @@ U32 LLControlGroup::loadFromFileLegacy(const LLString& filename, BOOL require_de
709 break; 711 break;
710 case TYPE_BOOLEAN: 712 case TYPE_BOOLEAN:
711 { 713 {
712 char boolstring[256]; 714 char boolstring[256]; /*Flawfinder: ignore*/
713 BOOL valid = FALSE; 715 BOOL valid = FALSE;
714 BOOL initial = FALSE; 716 BOOL initial = FALSE;
715 717
@@ -858,7 +860,7 @@ U32 LLControlGroup::loadFromFile(const LLString& filename, BOOL require_declarat
858 { 860 {
859 name = child_nodep->getName(); 861 name = child_nodep->getName();
860 862
861 BOOL declared = (mNameTable[name].notNull()); 863 BOOL declared = controlExists(name);
862 864
863 if (require_declaration && !declared) 865 if (require_declaration && !declared)
864 { 866 {
@@ -1045,8 +1047,7 @@ U32 LLControlGroup::saveToFile(const LLString& filename, BOOL nondefault_only)
1045 break; 1047 break;
1046 } 1048 }
1047 1049
1048 LLControlBase* control = (LLControlBase *)mNameTable[name]; 1050 LLControlBase* control = (LLControlBase *)iter->second;
1049
1050 if (!control) 1051 if (!control)
1051 { 1052 {
1052 llwarns << "Tried to save invalid control: " << name << llendl; 1053 llwarns << "Tried to save invalid control: " << name << llendl;
@@ -1067,7 +1068,7 @@ U32 LLControlGroup::saveToFile(const LLString& filename, BOOL nondefault_only)
1067 } 1068 }
1068 1069
1069 llofstream file; 1070 llofstream file;
1070 file.open(filename.c_str()); 1071 file.open(filename.c_str()); /*Flawfinder: ignore*/
1071 1072
1072 if (!file.is_open()) 1073 if (!file.is_open())
1073 { 1074 {
diff --git a/linden/indra/llxml/llcontrol.h b/linden/indra/llxml/llcontrol.h
index 846a3b5..ca5f711 100644
--- a/linden/indra/llxml/llcontrol.h
+++ b/linden/indra/llxml/llcontrol.h
@@ -67,6 +67,7 @@ protected:
67 BOOL mHasRange; 67 BOOL mHasRange;
68 BOOL mPersist; 68 BOOL mPersist;
69 BOOL mIsDefault; 69 BOOL mIsDefault;
70
70 static std::set<LLControlBase*> mChangedControls; 71 static std::set<LLControlBase*> mChangedControls;
71 static std::list<S32> mFreeIDs;//These lists are used to store the ID's of registered event listeners. 72 static std::list<S32> mFreeIDs;//These lists are used to store the ID's of registered event listeners.
72 static std::list<S32> mUsedIDs; 73 static std::list<S32> mUsedIDs;
@@ -171,7 +172,10 @@ public:
171 } 172 }
172 } 173 }
173 174
174 /*virtual*/ void resetToDefault() { mCurrent = mDefault; mIsDefault = TRUE;} 175 /*virtual*/ void resetToDefault()
176 {
177 setValue(mDefault);
178 }
175 179
176 virtual ~LLControl() 180 virtual ~LLControl()
177 { 181 {
diff --git a/linden/indra/llxml/llxml_vc8.vcproj b/linden/indra/llxml/llxml_vc8.vcproj
new file mode 100644
index 0000000..0b2a2b1
--- /dev/null
+++ b/linden/indra/llxml/llxml_vc8.vcproj
@@ -0,0 +1,276 @@
1<?xml version="1.0" encoding="Windows-1252"?>
2<VisualStudioProject
3 ProjectType="Visual C++"
4 Version="8.00"
5 Name="llxml"
6 ProjectGUID="{A5470DA6-0C3A-4602-B930-43DB25511A59}"
7 Keyword="Win32Proj"
8 >
9 <Platforms>
10 <Platform
11 Name="Win32"
12 />
13 </Platforms>
14 <ToolFiles>
15 </ToolFiles>
16 <Configurations>
17 <Configuration
18 Name="Debug|Win32"
19 OutputDirectory="../lib_$(ConfigurationName)/i686-win32"
20 IntermediateDirectory="Debug"
21 ConfigurationType="4"
22 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
23 CharacterSet="1"
24 >
25 <Tool
26 Name="VCPreBuildEventTool"
27 />
28 <Tool
29 Name="VCCustomBuildTool"
30 />
31 <Tool
32 Name="VCXMLDataGeneratorTool"
33 />
34 <Tool
35 Name="VCWebServiceProxyGeneratorTool"
36 />
37 <Tool
38 Name="VCMIDLTool"
39 />
40 <Tool
41 Name="VCCLCompilerTool"
42 Optimization="0"
43 AdditionalIncludeDirectories="..\llcommon;..\llmath;..\..\libraries\i686-win32\include;..\..\libraries\include\"
44 PreprocessorDefinitions="WIN32;_DEBUG;_LIB;LL_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;LL_DEBUG"
45 MinimalRebuild="true"
46 BasicRuntimeChecks="3"
47 RuntimeLibrary="1"
48 StructMemberAlignment="4"
49 TreatWChar_tAsBuiltInType="false"
50 ForceConformanceInForLoopScope="true"
51 UsePrecompiledHeader="0"
52 WarningLevel="3"
53 WarnAsError="true"
54 Detect64BitPortabilityProblems="false"
55 DebugInformationFormat="4"
56 />
57 <Tool
58 Name="VCManagedResourceCompilerTool"
59 />
60 <Tool
61 Name="VCResourceCompilerTool"
62 />
63 <Tool
64 Name="VCPreLinkEventTool"
65 />
66 <Tool
67 Name="VCLibrarianTool"
68 OutputFile="$(OutDir)/llxml.lib"
69 />
70 <Tool
71 Name="VCALinkTool"
72 />
73 <Tool
74 Name="VCXDCMakeTool"
75 />
76 <Tool
77 Name="VCBscMakeTool"
78 />
79 <Tool
80 Name="VCFxCopTool"
81 />
82 <Tool
83 Name="VCPostBuildEventTool"
84 />
85 </Configuration>
86 <Configuration
87 Name="Release|Win32"
88 OutputDirectory="../lib_$(ConfigurationName)/i686-win32"
89 IntermediateDirectory="Release"
90 ConfigurationType="4"
91 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
92 CharacterSet="1"
93 >
94 <Tool
95 Name="VCPreBuildEventTool"
96 />
97 <Tool
98 Name="VCCustomBuildTool"
99 />
100 <Tool
101 Name="VCXMLDataGeneratorTool"
102 />
103 <Tool
104 Name="VCWebServiceProxyGeneratorTool"
105 />
106 <Tool
107 Name="VCMIDLTool"
108 />
109 <Tool
110 Name="VCCLCompilerTool"
111 AdditionalIncludeDirectories="..\llcommon;..\llmath;..\..\libraries\i686-win32\include;..\..\libraries\include\"
112 PreprocessorDefinitions="WIN32;NDEBUG;_LIB;LL_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;LL_RELEASE"
113 RuntimeLibrary="0"
114 StructMemberAlignment="0"
115 TreatWChar_tAsBuiltInType="false"
116 ForceConformanceInForLoopScope="true"
117 UsePrecompiledHeader="0"
118 WarningLevel="3"
119 WarnAsError="true"
120 Detect64BitPortabilityProblems="false"
121 DebugInformationFormat="3"
122 />
123 <Tool
124 Name="VCManagedResourceCompilerTool"
125 />
126 <Tool
127 Name="VCResourceCompilerTool"
128 />
129 <Tool
130 Name="VCPreLinkEventTool"
131 />
132 <Tool
133 Name="VCLibrarianTool"
134 OutputFile="$(OutDir)/llxml.lib"
135 />
136 <Tool
137 Name="VCALinkTool"
138 />
139 <Tool
140 Name="VCXDCMakeTool"
141 />
142 <Tool
143 Name="VCBscMakeTool"
144 />
145 <Tool
146 Name="VCFxCopTool"
147 />
148 <Tool
149 Name="VCPostBuildEventTool"
150 />
151 </Configuration>
152 <Configuration
153 Name="ReleaseNoOpt|Win32"
154 OutputDirectory="../lib_$(ConfigurationName)/i686-win32"
155 IntermediateDirectory="$(ConfigurationName)"
156 ConfigurationType="4"
157 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
158 CharacterSet="1"
159 >
160 <Tool
161 Name="VCPreBuildEventTool"
162 />
163 <Tool
164 Name="VCCustomBuildTool"
165 />
166 <Tool
167 Name="VCXMLDataGeneratorTool"
168 />
169 <Tool
170 Name="VCWebServiceProxyGeneratorTool"
171 />
172 <Tool
173 Name="VCMIDLTool"
174 />
175 <Tool
176 Name="VCCLCompilerTool"
177 Optimization="0"
178 AdditionalIncludeDirectories="..\llcommon;..\llmath;..\..\libraries\i686-win32\include;..\..\libraries\include\"
179 PreprocessorDefinitions="WIN32;NDEBUG;_LIB;LL_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;LL_RELEASE"
180 RuntimeLibrary="0"
181 StructMemberAlignment="0"
182 TreatWChar_tAsBuiltInType="false"
183 ForceConformanceInForLoopScope="true"
184 UsePrecompiledHeader="0"
185 WarningLevel="3"
186 WarnAsError="true"
187 Detect64BitPortabilityProblems="false"
188 DebugInformationFormat="3"
189 />
190 <Tool
191 Name="VCManagedResourceCompilerTool"
192 />
193 <Tool
194 Name="VCResourceCompilerTool"
195 />
196 <Tool
197 Name="VCPreLinkEventTool"
198 />
199 <Tool
200 Name="VCLibrarianTool"
201 OutputFile="$(OutDir)/llxml.lib"
202 />
203 <Tool
204 Name="VCALinkTool"
205 />
206 <Tool
207 Name="VCXDCMakeTool"
208 />
209 <Tool
210 Name="VCBscMakeTool"
211 />
212 <Tool
213 Name="VCFxCopTool"
214 />
215 <Tool
216 Name="VCPostBuildEventTool"
217 />
218 </Configuration>
219 </Configurations>
220 <References>
221 </References>
222 <Files>
223 <Filter
224 Name="Source Files"
225 Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
226 UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
227 >
228 <File
229 RelativePath=".\llcontrol.cpp"
230 >
231 </File>
232 <File
233 RelativePath=".\llxmlnode.cpp"
234 >
235 </File>
236 <File
237 RelativePath=".\llxmlparser.cpp"
238 >
239 </File>
240 <File
241 RelativePath=".\llxmltree.cpp"
242 >
243 </File>
244 </Filter>
245 <Filter
246 Name="Header Files"
247 Filter="h;hpp;hxx;hm;inl;inc;xsd"
248 UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
249 >
250 <File
251 RelativePath=".\llcontrol.h"
252 >
253 </File>
254 <File
255 RelativePath=".\llxmlnode.h"
256 >
257 </File>
258 <File
259 RelativePath=".\llxmlparser.h"
260 >
261 </File>
262 <File
263 RelativePath=".\llxmltree.h"
264 >
265 </File>
266 </Filter>
267 <Filter
268 Name="Resource Files"
269 Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
270 UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
271 >
272 </Filter>
273 </Files>
274 <Globals>
275 </Globals>
276</VisualStudioProject>
diff --git a/linden/indra/llxml/llxmlnode.cpp b/linden/indra/llxml/llxmlnode.cpp
index 6366519..50a08be 100644
--- a/linden/indra/llxml/llxmlnode.cpp
+++ b/linden/indra/llxml/llxmlnode.cpp
@@ -561,7 +561,7 @@ bool LLXMLNode::parseFile(
561 LLXMLNode* defaults_tree) 561 LLXMLNode* defaults_tree)
562{ 562{
563 // Read file 563 // Read file
564 FILE* fp = LLFile::fopen(filename.c_str(), "rb"); 564 FILE* fp = LLFile::fopen(filename.c_str(), "rb"); /* Flawfinder: ignore */
565 if (fp == NULL) 565 if (fp == NULL)
566 { 566 {
567 node = new LLXMLNode(); 567 node = new LLXMLNode();
@@ -1865,12 +1865,12 @@ U32 LLXMLNode::getUUIDValue(U32 expected_length, LLUUID *array)
1865 LLUUID uuid_value; 1865 LLUUID uuid_value;
1866 value_string = skipWhitespace(value_string); 1866 value_string = skipWhitespace(value_string);
1867 1867
1868 if (strlen(value_string) < (UUID_STR_LENGTH-1)) 1868 if (strlen(value_string) < (UUID_STR_LENGTH-1)) /* Flawfinder: ignore */
1869 { 1869 {
1870 break; 1870 break;
1871 } 1871 }
1872 char uuid_string[UUID_STR_LENGTH]; 1872 char uuid_string[UUID_STR_LENGTH]; /* Flawfinder: ignore */
1873 memcpy(uuid_string, value_string, (UUID_STR_LENGTH-1)); 1873 memcpy(uuid_string, value_string, (UUID_STR_LENGTH-1)); /* Flawfinder: ignore */
1874 uuid_string[(UUID_STR_LENGTH-1)] = 0; 1874 uuid_string[(UUID_STR_LENGTH-1)] = 0;
1875 1875
1876 if (!LLUUID::parseUUID(uuid_string, &uuid_value)) 1876 if (!LLUUID::parseUUID(uuid_string, &uuid_value))
@@ -2155,18 +2155,18 @@ void LLXMLNode::setFloatValue(U32 length, const F32 *array, Encoding encoding, U
2155 LLString new_value; 2155 LLString new_value;
2156 if (encoding == ENCODING_DEFAULT || encoding == ENCODING_DECIMAL) 2156 if (encoding == ENCODING_DEFAULT || encoding == ENCODING_DECIMAL)
2157 { 2157 {
2158 char format_string[10]; 2158 char format_string[10]; /* Flawfinder: ignore */
2159 if (precision > 0) 2159 if (precision > 0)
2160 { 2160 {
2161 if (precision > 25) 2161 if (precision > 25)
2162 { 2162 {
2163 precision = 25; 2163 precision = 25;
2164 } 2164 }
2165 sprintf(format_string, "%%.%dg", precision); 2165 snprintf(format_string, sizeof(format_string), "%%.%dg", precision); /* Flawfinder: ignore */
2166 } 2166 }
2167 else 2167 else
2168 { 2168 {
2169 sprintf(format_string, "%%g"); 2169 snprintf(format_string, sizeof(format_string), "%%g"); /* Flawfinder: ignore */
2170 } 2170 }
2171 2171
2172 for (U32 pos=0; pos<length; ++pos) 2172 for (U32 pos=0; pos<length; ++pos)
@@ -2206,18 +2206,18 @@ void LLXMLNode::setDoubleValue(U32 length, const F64 *array, Encoding encoding,
2206 LLString new_value; 2206 LLString new_value;
2207 if (encoding == ENCODING_DEFAULT || encoding == ENCODING_DECIMAL) 2207 if (encoding == ENCODING_DEFAULT || encoding == ENCODING_DECIMAL)
2208 { 2208 {
2209 char format_string[10]; 2209 char format_string[10]; /* Flawfinder: ignore */
2210 if (precision > 0) 2210 if (precision > 0)
2211 { 2211 {
2212 if (precision > 25) 2212 if (precision > 25)
2213 { 2213 {
2214 precision = 25; 2214 precision = 25;
2215 } 2215 }
2216 sprintf(format_string, "%%.%dg", precision); 2216 snprintf(format_string, sizeof(format_string), "%%.%dg", precision); /* Flawfinder: ignore */
2217 } 2217 }
2218 else 2218 else
2219 { 2219 {
2220 sprintf(format_string, "%%g"); 2220 snprintf(format_string, sizeof(format_string), "%%g"); /* Flawfinder: ignore */
2221 } 2221 }
2222 for (U32 pos=0; pos<length; ++pos) 2222 for (U32 pos=0; pos<length; ++pos)
2223 { 2223 {
@@ -2294,7 +2294,7 @@ void LLXMLNode::setUUIDValue(U32 length, const LLUUID *array)
2294 LLString new_value; 2294 LLString new_value;
2295 for (U32 pos=0; pos<length; ++pos) 2295 for (U32 pos=0; pos<length; ++pos)
2296 { 2296 {
2297 new_value.append(array[pos].getString()); 2297 new_value.append(array[pos].asString());
2298 if (pos < length-1) new_value.append(" "); 2298 if (pos < length-1) new_value.append(" ");
2299 } 2299 }
2300 2300
@@ -2491,7 +2491,7 @@ LLXMLNode *get_rand_node(LLXMLNode *node)
2491void LLXMLNode::createUnitTest(S32 max_num_children) 2491void LLXMLNode::createUnitTest(S32 max_num_children)
2492{ 2492{
2493 // Random ID 2493 // Random ID
2494 char rand_id[20]; 2494 char rand_id[20]; /* Flawfinder: ignore */
2495 U32 rand_id_len = get_rand(10)+5; 2495 U32 rand_id_len = get_rand(10)+5;
2496 U32 pos = 0; 2496 U32 pos = 0;
2497 for (; pos<rand_id_len; ++pos) 2497 for (; pos<rand_id_len; ++pos)
@@ -2520,7 +2520,7 @@ void LLXMLNode::createUnitTest(S32 max_num_children)
2520 for (U32 child_num=0; child_num<num_children; ++child_num) 2520 for (U32 child_num=0; child_num<num_children; ++child_num)
2521 { 2521 {
2522 // Random Name 2522 // Random Name
2523 char child_name[20]; 2523 char child_name[20]; /* Flawfinder: ignore */
2524 U32 child_name_len = get_rand(10)+5; 2524 U32 child_name_len = get_rand(10)+5;
2525 pos = 0; 2525 pos = 0;
2526 for (; pos<child_name_len; ++pos) 2526 for (; pos<child_name_len; ++pos)
@@ -2532,7 +2532,7 @@ void LLXMLNode::createUnitTest(S32 max_num_children)
2532 LLXMLNode *new_child = createChild(child_name, FALSE); 2532 LLXMLNode *new_child = createChild(child_name, FALSE);
2533 2533
2534 // Random ID 2534 // Random ID
2535 char child_id[20]; 2535 char child_id[20]; /* Flawfinder: ignore */
2536 U32 child_id_len = get_rand(10)+5; 2536 U32 child_id_len = get_rand(10)+5;
2537 pos = 0; 2537 pos = 0;
2538 for (; pos<child_id_len; ++pos) 2538 for (; pos<child_id_len; ++pos)
@@ -2653,7 +2653,7 @@ void LLXMLNode::createUnitTest(S32 max_num_children)
2653 { 2653 {
2654 random_node_array[value] = get_rand_node(root); 2654 random_node_array[value] = get_rand_node(root);
2655 const char *node_name = random_node_array[value]->mName->mString; 2655 const char *node_name = random_node_array[value]->mName->mString;
2656 for (U32 pos=0; pos<strlen(node_name); ++pos) 2656 for (U32 pos=0; pos<strlen(node_name); ++pos) /* Flawfinder: ignore */
2657 { 2657 {
2658 U32 hash_contrib = U32(node_name[pos]) << ((pos % 4) * 8); 2658 U32 hash_contrib = U32(node_name[pos]) << ((pos % 4) * 8);
2659 noderef_checksum ^= hash_contrib; 2659 noderef_checksum ^= hash_contrib;
@@ -2825,7 +2825,7 @@ BOOL LLXMLNode::performUnitTest(LLString &error_buffer)
2825 for (U32 pos=0; pos<node->mLength; ++pos) 2825 for (U32 pos=0; pos<node->mLength; ++pos)
2826 { 2826 {
2827 const char *node_name = node_array[pos]->mName->mString; 2827 const char *node_name = node_array[pos]->mName->mString;
2828 for (U32 pos2=0; pos2<strlen(node_name); ++pos2) 2828 for (U32 pos2=0; pos2<strlen(node_name); ++pos2) /* Flawfinder: ignore */
2829 { 2829 {
2830 U32 hash_contrib = U32(node_name[pos2]) << ((pos2 % 4) * 8); 2830 U32 hash_contrib = U32(node_name[pos2]) << ((pos2 % 4) * 8);
2831 noderef_checksum ^= hash_contrib; 2831 noderef_checksum ^= hash_contrib;
@@ -2896,7 +2896,7 @@ BOOL LLXMLNode::performUnitTest(LLString &error_buffer)
2896 } 2896 }
2897 if (node_uuid_checksum != uuid_checksum) 2897 if (node_uuid_checksum != uuid_checksum)
2898 { 2898 {
2899 error_buffer.append(llformat("ERROR Node %s: UUID checksum mismatch: read %s / calc %s.\n", mName->mString, node_uuid_checksum.getString().c_str(), uuid_checksum.getString().c_str())); 2899 error_buffer.append(llformat("ERROR Node %s: UUID checksum mismatch: read %s / calc %s.\n", mName->mString, node_uuid_checksum.asString().c_str(), uuid_checksum.asString().c_str()));
2900 return FALSE; 2900 return FALSE;
2901 } 2901 }
2902 } 2902 }
diff --git a/linden/indra/llxml/llxmlnode.h b/linden/indra/llxml/llxmlnode.h
index 6ecd9ce..bfe0fbe 100644
--- a/linden/indra/llxml/llxmlnode.h
+++ b/linden/indra/llxml/llxmlnode.h
@@ -34,6 +34,7 @@
34 34
35#include "indra_constants.h" 35#include "indra_constants.h"
36#include "llmemory.h" 36#include "llmemory.h"
37#include "llthread.h"
37#include "llstring.h" 38#include "llstring.h"
38#include "llstringtable.h" 39#include "llstringtable.h"
39 40
diff --git a/linden/indra/llxml/llxmlparser.cpp b/linden/indra/llxml/llxmlparser.cpp
index 57e6a30..056d850 100644
--- a/linden/indra/llxml/llxmlparser.cpp
+++ b/linden/indra/llxml/llxmlparser.cpp
@@ -41,7 +41,7 @@ LLXmlParser::LLXmlParser()
41 mParser( NULL ), 41 mParser( NULL ),
42 mDepth( 0 ) 42 mDepth( 0 )
43{ 43{
44 strcpy( mAuxErrorString, "no error" ); 44 strcpy( mAuxErrorString, "no error" ); /* Flawfinder: ignore */
45 45
46 // Override the document's declared encoding. 46 // Override the document's declared encoding.
47 mParser = XML_ParserCreate(NULL); 47 mParser = XML_ParserCreate(NULL);
@@ -73,10 +73,10 @@ BOOL LLXmlParser::parseFile(const std::string &path)
73 73
74 BOOL success = TRUE; 74 BOOL success = TRUE;
75 75
76 FILE *file = LLFile::fopen(path.c_str(), "rb"); 76 FILE* file = LLFile::fopen(path.c_str(), "rb"); /* Flawfinder: ignore */
77 if( !file ) 77 if( !file )
78 { 78 {
79 sprintf( mAuxErrorString, "Couldn't open file %s", path.c_str()); 79 snprintf( mAuxErrorString, sizeof(mAuxErrorString), "Couldn't open file %s", path.c_str()); /* Flawfinder: ignore */
80 success = FALSE; 80 success = FALSE;
81 } 81 }
82 else 82 else
@@ -90,7 +90,7 @@ BOOL LLXmlParser::parseFile(const std::string &path)
90 void* buffer = XML_GetBuffer(mParser, buffer_size); 90 void* buffer = XML_GetBuffer(mParser, buffer_size);
91 if( !buffer ) 91 if( !buffer )
92 { 92 {
93 sprintf( mAuxErrorString, "Unable to allocate XML buffer while reading file %s", path.c_str() ); 93 snprintf( mAuxErrorString, sizeof(mAuxErrorString), "Unable to allocate XML buffer while reading file %s", path.c_str() ); /* Flawfinder: ignore */
94 success = FALSE; 94 success = FALSE;
95 goto exit_label; 95 goto exit_label;
96 } 96 }
@@ -98,14 +98,14 @@ BOOL LLXmlParser::parseFile(const std::string &path)
98 bytes_read = (S32)fread(buffer, 1, buffer_size, file); 98 bytes_read = (S32)fread(buffer, 1, buffer_size, file);
99 if( bytes_read <= 0 ) 99 if( bytes_read <= 0 )
100 { 100 {
101 sprintf( mAuxErrorString, "Error while reading file %s", path.c_str() ); 101 snprintf( mAuxErrorString, sizeof(mAuxErrorString), "Error while reading file %s", path.c_str() ); /* Flawfinder: ignore */
102 success = FALSE; 102 success = FALSE;
103 goto exit_label; 103 goto exit_label;
104 } 104 }
105 105
106 if( !XML_ParseBuffer(mParser, bytes_read, TRUE ) ) 106 if( !XML_ParseBuffer(mParser, bytes_read, TRUE ) )
107 { 107 {
108 sprintf( mAuxErrorString, "Error while parsing file %s", path.c_str() ); 108 snprintf( mAuxErrorString, sizeof(mAuxErrorString), "Error while parsing file %s", path.c_str() ); /* Flawfinder: ignore */
109 success = FALSE; 109 success = FALSE;
110 } 110 }
111 111
diff --git a/linden/indra/llxml/llxmlparser.h b/linden/indra/llxml/llxmlparser.h
index 27c137a..e1bd2e2 100644
--- a/linden/indra/llxml/llxmlparser.h
+++ b/linden/indra/llxml/llxmlparser.h
@@ -122,7 +122,7 @@ public:
122protected: 122protected:
123 XML_Parser mParser; 123 XML_Parser mParser;
124 int mDepth; 124 int mDepth;
125 char mAuxErrorString[1024]; 125 char mAuxErrorString[1024]; /*Flawfinder: ignore*/
126}; 126};
127 127
128#endif // LL_LLXMLPARSER_H 128#endif // LL_LLXMLPARSER_H
diff --git a/linden/indra/lscript/lscript_byteformat.h b/linden/indra/lscript/lscript_byteformat.h
index a69f1fe..8b8e487 100644
--- a/linden/indra/lscript/lscript_byteformat.h
+++ b/linden/indra/lscript/lscript_byteformat.h
@@ -70,7 +70,7 @@ typedef enum e_lscript_registers
70 LREG_EOF 70 LREG_EOF
71} LSCRIPTRegisters; 71} LSCRIPTRegisters;
72 72
73const S32 gLSCRIPTRegisterAddresses[LREG_EOF] = 73const S32 gLSCRIPTRegisterAddresses[LREG_EOF] = /* Flawfinder: ignore */
74{ 74{
75 0, // LREG_INVALID 75 0, // LREG_INVALID
76 4, // LREG_IP 76 4, // LREG_IP
@@ -468,7 +468,7 @@ const U8 LSCRIPTTypeHi4Bits[LST_EOF] =
468 LST_LIST << 4, 468 LST_LIST << 4,
469}; 469};
470 470
471const char * const LSCRIPTTypeNames[LST_EOF] = 471const char * const LSCRIPTTypeNames[LST_EOF] = /*Flawfinder: ignore*/
472{ 472{
473 "VOID", 473 "VOID",
474 "integer", 474 "integer",
@@ -511,7 +511,7 @@ typedef enum e_lscript_runtime_faults
511 LSRF_EOF 511 LSRF_EOF
512} LSCRIPTRunTimeFaults; 512} LSCRIPTRunTimeFaults;
513 513
514extern char *LSCRIPTRunTimeFaultStrings[LSRF_EOF]; 514extern char* LSCRIPTRunTimeFaultStrings[LSRF_EOF]; /*Flawfinder: ignore*/
515 515
516const S32 LSCRIPTRunTimeFaultBits[LSRF_EOF] = 516const S32 LSCRIPTRunTimeFaultBits[LSRF_EOF] =
517{ 517{
diff --git a/linden/indra/lscript/lscript_compile/indra.l b/linden/indra/lscript/lscript_compile/indra.l
index 1290018..f4199df 100644
--- a/linden/indra/lscript/lscript_compile/indra.l
+++ b/linden/indra/lscript/lscript_compile/indra.l
@@ -4,7 +4,7 @@ L [a-zA-Z_]
4H [a-fA-F0-9] 4H [a-fA-F0-9]
5E [Ee][+-]?{D}+ 5E [Ee][+-]?{D}+
6FS (f|F) 6FS (f|F)
7%e 8000 7%e 9000
8%n 4000 8%n 4000
9%p 5000 9%p 5000
10 10
@@ -559,6 +559,10 @@ extern "C" { int yyerror(const char *fmt, ...); }
559"PARCEL_DETAILS_GROUP" { count(); yylval.ival = PARCEL_DETAILS_GROUP; return(INTEGER_CONSTANT); } 559"PARCEL_DETAILS_GROUP" { count(); yylval.ival = PARCEL_DETAILS_GROUP; return(INTEGER_CONSTANT); }
560"PARCEL_DETAILS_AREA" { count(); yylval.ival = PARCEL_DETAILS_AREA; return(INTEGER_CONSTANT); } 560"PARCEL_DETAILS_AREA" { count(); yylval.ival = PARCEL_DETAILS_AREA; return(INTEGER_CONSTANT); }
561 561
562"STRING_TRIM_HEAD" { count(); yylval.ival = STRING_TRIM_HEAD; return(INTEGER_CONSTANT); }
563"STRING_TRIM_TAIL" { count(); yylval.ival = STRING_TRIM_TAIL; return(INTEGER_CONSTANT); }
564"STRING_TRIM" { count(); yylval.ival = STRING_TRIM; return(INTEGER_CONSTANT); }
565
562{L}({L}|{N})* { count(); yylval.sval = new char[strlen(yytext) + 1]; strcpy(yylval.sval, yytext); return(IDENTIFIER); } 566{L}({L}|{N})* { count(); yylval.sval = new char[strlen(yytext) + 1]; strcpy(yylval.sval, yytext); return(IDENTIFIER); }
563 567
564{D}+{E} { count(); yylval.fval = (F32)atof(yytext); return(FP_CONSTANT); } 568{D}+{E} { count(); yylval.fval = (F32)atof(yytext); return(FP_CONSTANT); }
diff --git a/linden/indra/lscript/lscript_compile/lscript_bytecode.cpp b/linden/indra/lscript/lscript_compile/lscript_bytecode.cpp
index 6d18a1a..b696cc6 100644
--- a/linden/indra/lscript/lscript_compile/lscript_bytecode.cpp
+++ b/linden/indra/lscript/lscript_compile/lscript_bytecode.cpp
@@ -78,7 +78,7 @@ void LLScriptByteCodeChunk::addByte(U8 byte)
78 if (mCodeChunk) 78 if (mCodeChunk)
79 { 79 {
80 U8 *temp = new U8[mCurrentOffset + 1]; 80 U8 *temp = new U8[mCurrentOffset + 1];
81 memcpy(temp, mCodeChunk, mCurrentOffset); 81 memcpy(temp, mCodeChunk, mCurrentOffset); /* Flawfinder: ignore */
82 delete [] mCodeChunk; 82 delete [] mCodeChunk;
83 mCodeChunk = temp; 83 mCodeChunk = temp;
84 } 84 }
@@ -102,7 +102,7 @@ void LLScriptByteCodeChunk::addBytes(U8 *bytes, S32 size)
102 if (mCodeChunk) 102 if (mCodeChunk)
103 { 103 {
104 U8 *temp = new U8[mCurrentOffset + size]; 104 U8 *temp = new U8[mCurrentOffset + size];
105 memcpy(temp, mCodeChunk, mCurrentOffset); 105 memcpy(temp, mCodeChunk, mCurrentOffset); /* Flawfinder: ignore */
106 delete [] mCodeChunk; 106 delete [] mCodeChunk;
107 mCodeChunk = temp; 107 mCodeChunk = temp;
108 } 108 }
@@ -110,7 +110,7 @@ void LLScriptByteCodeChunk::addBytes(U8 *bytes, S32 size)
110 { 110 {
111 mCodeChunk = new U8[size]; 111 mCodeChunk = new U8[size];
112 } 112 }
113 memcpy(mCodeChunk + mCurrentOffset, bytes, size); 113 memcpy(mCodeChunk + mCurrentOffset, bytes, size);/* Flawfinder: ignore */
114 mCurrentOffset += size; 114 mCurrentOffset += size;
115} 115}
116 116
@@ -119,7 +119,7 @@ void LLScriptByteCodeChunk::addBytes(char *bytes, S32 size)
119 if (mCodeChunk) 119 if (mCodeChunk)
120 { 120 {
121 U8 *temp = new U8[mCurrentOffset + size]; 121 U8 *temp = new U8[mCurrentOffset + size];
122 memcpy(temp, mCodeChunk, mCurrentOffset); 122 memcpy(temp, mCodeChunk, mCurrentOffset); /*Flawfinder: ignore*/
123 delete [] mCodeChunk; 123 delete [] mCodeChunk;
124 mCodeChunk = temp; 124 mCodeChunk = temp;
125 } 125 }
@@ -127,7 +127,7 @@ void LLScriptByteCodeChunk::addBytes(char *bytes, S32 size)
127 { 127 {
128 mCodeChunk = new U8[size]; 128 mCodeChunk = new U8[size];
129 } 129 }
130 memcpy(mCodeChunk + mCurrentOffset, bytes, size); 130 memcpy(mCodeChunk + mCurrentOffset, bytes, size); /*Flawfinder: ignore*/
131 mCurrentOffset += size; 131 mCurrentOffset += size;
132} 132}
133 133
@@ -136,7 +136,7 @@ void LLScriptByteCodeChunk::addBytes(S32 size)
136 if (mCodeChunk) 136 if (mCodeChunk)
137 { 137 {
138 U8 *temp = new U8[mCurrentOffset + size]; 138 U8 *temp = new U8[mCurrentOffset + size];
139 memcpy(temp, mCodeChunk, mCurrentOffset); 139 memcpy(temp, mCodeChunk, mCurrentOffset); /*Flawfinder: ignore*/
140 delete [] mCodeChunk; 140 delete [] mCodeChunk;
141 mCodeChunk = temp; 141 mCodeChunk = temp;
142 } 142 }
@@ -153,7 +153,7 @@ void LLScriptByteCodeChunk::addBytesDontInc(S32 size)
153 if (mCodeChunk) 153 if (mCodeChunk)
154 { 154 {
155 U8 *temp = new U8[mCurrentOffset + size]; 155 U8 *temp = new U8[mCurrentOffset + size];
156 memcpy(temp, mCodeChunk, mCurrentOffset); 156 memcpy(temp, mCodeChunk, mCurrentOffset); /*Flawfinder: ignore*/
157 delete [] mCodeChunk; 157 delete [] mCodeChunk;
158 mCodeChunk = temp; 158 mCodeChunk = temp;
159 } 159 }
@@ -256,7 +256,7 @@ void LLScriptScriptCodeChunk::build(FILE *efp, FILE *bcfp)
256 mCompleteCode = new U8[mTotalSize]; 256 mCompleteCode = new U8[mTotalSize];
257 memset(mCompleteCode, 0, mTotalSize); 257 memset(mCompleteCode, 0, mTotalSize);
258 258
259 memcpy(mCompleteCode, mRegisters->mCodeChunk, mRegisters->mCurrentOffset); 259 memcpy(mCompleteCode, mRegisters->mCodeChunk, mRegisters->mCurrentOffset);
260 offset += mRegisters->mCurrentOffset; 260 offset += mRegisters->mCurrentOffset;
261 261
262 set_register(mCompleteCode, LREG_IP, 0); 262 set_register(mCompleteCode, LREG_IP, 0);
@@ -267,12 +267,12 @@ void LLScriptScriptCodeChunk::build(FILE *efp, FILE *bcfp)
267 267
268 set_register(mCompleteCode, LREG_GVR, offset); 268 set_register(mCompleteCode, LREG_GVR, offset);
269 269
270 memcpy(mCompleteCode + offset, mGlobalVariables->mCodeChunk, mGlobalVariables->mCurrentOffset); 270 memcpy(mCompleteCode + offset, mGlobalVariables->mCodeChunk, mGlobalVariables->mCurrentOffset); /*Flawfinder: ignore*/
271 offset += mGlobalVariables->mCurrentOffset; 271 offset += mGlobalVariables->mCurrentOffset;
272 272
273 set_register(mCompleteCode, LREG_GFR, offset); 273 set_register(mCompleteCode, LREG_GFR, offset);
274 274
275 memcpy(mCompleteCode + offset, mGlobalFunctions->mCodeChunk, mGlobalFunctions->mCurrentOffset); 275 memcpy(mCompleteCode + offset, mGlobalFunctions->mCodeChunk, mGlobalFunctions->mCurrentOffset); /*Flawfinder: ignore*/
276 offset += mGlobalFunctions->mCurrentOffset; 276 offset += mGlobalFunctions->mCurrentOffset;
277 277
278 set_register(mCompleteCode, LREG_SR, offset); 278 set_register(mCompleteCode, LREG_SR, offset);
@@ -291,12 +291,12 @@ void LLScriptScriptCodeChunk::build(FILE *efp, FILE *bcfp)
291 } 291 }
292 set_event_register(mCompleteCode, LREG_ER, bytestream2u64(mStates->mCodeChunk, default_state_offset), LSL2_CURRENT_MAJOR_VERSION); 292 set_event_register(mCompleteCode, LREG_ER, bytestream2u64(mStates->mCodeChunk, default_state_offset), LSL2_CURRENT_MAJOR_VERSION);
293 293
294 memcpy(mCompleteCode + offset, mStates->mCodeChunk, mStates->mCurrentOffset); 294 memcpy(mCompleteCode + offset, mStates->mCodeChunk, mStates->mCurrentOffset); /*Flawfinder: ignore*/
295 offset += mStates->mCurrentOffset; 295 offset += mStates->mCurrentOffset;
296 296
297 set_register(mCompleteCode, LREG_HR, offset); 297 set_register(mCompleteCode, LREG_HR, offset);
298 298
299 memcpy(mCompleteCode + offset, mHeap->mCodeChunk, mHeap->mCurrentOffset); 299 memcpy(mCompleteCode + offset, mHeap->mCodeChunk, mHeap->mCurrentOffset); /*Flawfinder: ignore*/
300 offset += mHeap->mCurrentOffset; 300 offset += mHeap->mCurrentOffset;
301 301
302 set_register(mCompleteCode, LREG_HP, offset); 302 set_register(mCompleteCode, LREG_HP, offset);
diff --git a/linden/indra/lscript/lscript_compile/lscript_compile_fb_vc8.vcproj b/linden/indra/lscript/lscript_compile/lscript_compile_fb_vc8.vcproj
new file mode 100644
index 0000000..c61e6ec
--- /dev/null
+++ b/linden/indra/lscript/lscript_compile/lscript_compile_fb_vc8.vcproj
@@ -0,0 +1,106 @@
1<?xml version="1.0" encoding="Windows-1252"?>
2<VisualStudioProject
3 ProjectType="Visual C++"
4 Version="7.10"
5 Name="lscript_compile_fb"
6 ProjectGUID="{B771CF1B-E253-47BD-8B0A-6B0440CC9228}"
7 RootNamespace="lscript_compile_fb"
8 Keyword="MakeFileProj">
9 <Platforms>
10 <Platform
11 Name="Win32"/>
12 </Platforms>
13 <Configurations>
14 <Configuration
15 Name="Debug|Win32"
16 OutputDirectory="."
17 IntermediateDirectory="Debug_fb"
18 ConfigurationType="10">
19 <Tool
20 Name="VCCustomBuildTool"/>
21 <Tool
22 Name="VCMIDLTool"/>
23 <Tool
24 Name="VCPostBuildEventTool"/>
25 <Tool
26 Name="VCPreBuildEventTool"/>
27 </Configuration>
28 <Configuration
29 Name="Release|Win32"
30 OutputDirectory="."
31 IntermediateDirectory="Release_fb"
32 ConfigurationType="10">
33 <Tool
34 Name="VCCustomBuildTool"/>
35 <Tool
36 Name="VCMIDLTool"/>
37 <Tool
38 Name="VCPostBuildEventTool"/>
39 <Tool
40 Name="VCPreBuildEventTool"/>
41 </Configuration>
42 </Configurations>
43 <References>
44 </References>
45 <Files>
46 <Filter
47 Name="Source Files"
48 Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
49 UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
50 </Filter>
51 <Filter
52 Name="Header Files"
53 Filter="h;hpp;hxx;hm;inl;inc;xsd"
54 UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
55 </Filter>
56 <Filter
57 Name="Resource Files"
58 Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
59 UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
60 </Filter>
61 <File
62 RelativePath=".\indra.l">
63 <FileConfiguration
64 Name="Debug|Win32">
65 <Tool
66 Name="VCCustomBuildTool"
67 Description="Building lex_yy.cpp"
68 CommandLine="C:\cygwin\bin\flex.exe -olex_yy.cpp indra.l
69"
70 Outputs="lex_yy.cpp"/>
71 </FileConfiguration>
72 <FileConfiguration
73 Name="Release|Win32">
74 <Tool
75 Name="VCCustomBuildTool"
76 Description="Building lex_yy.cpp"
77 CommandLine="C:\cygwin\bin\flex.exe -olex_yy.cpp indra.l
78"
79 Outputs="lex_yy.cpp"/>
80 </FileConfiguration>
81 </File>
82 <File
83 RelativePath=".\indra.y">
84 <FileConfiguration
85 Name="Debug|Win32">
86 <Tool
87 Name="VCCustomBuildTool"
88 Description="Building ytab.cpp"
89 CommandLine="C:\cygwin\bin\bison.exe -o ytab.cpp -v -d indra.y
90"
91 Outputs="ytab.cpp;ytab.h"/>
92 </FileConfiguration>
93 <FileConfiguration
94 Name="Release|Win32">
95 <Tool
96 Name="VCCustomBuildTool"
97 Description="Building ytab.cpp"
98 CommandLine="C:\cygwin\bin\bison.exe -y -d -v -o ytab.cpp indra.y
99C:\cygwin\bin\mv.exe ytab.hpp ytab.h"
100 Outputs="ytab.cpp;ytab.h"/>
101 </FileConfiguration>
102 </File>
103 </Files>
104 <Globals>
105 </Globals>
106</VisualStudioProject>
diff --git a/linden/indra/lscript/lscript_compile/lscript_compile_ly.vcproj b/linden/indra/lscript/lscript_compile/lscript_compile_ly.vcproj
new file mode 100644
index 0000000..c324ed9
--- /dev/null
+++ b/linden/indra/lscript/lscript_compile/lscript_compile_ly.vcproj
@@ -0,0 +1,110 @@
1<?xml version="1.0" encoding="Windows-1252"?>
2<VisualStudioProject
3 ProjectType="Visual C++"
4 Version="7.10"
5 Name="lscript_compile_ly"
6 ProjectGUID="{FF8ECB70-C788-47D4-91BF-F88448AE8940}"
7 RootNamespace="lscript_compile_ly"
8 Keyword="MakeFileProj">
9 <Platforms>
10 <Platform
11 Name="Win32"/>
12 </Platforms>
13 <Configurations>
14 <Configuration
15 Name="Debug|Win32"
16 OutputDirectory="."
17 IntermediateDirectory="Debug_ly"
18 ConfigurationType="10">
19 <Tool
20 Name="VCCustomBuildTool"/>
21 <Tool
22 Name="VCMIDLTool"/>
23 <Tool
24 Name="VCPostBuildEventTool"/>
25 <Tool
26 Name="VCPreBuildEventTool"/>
27 </Configuration>
28 <Configuration
29 Name="Release|Win32"
30 OutputDirectory="."
31 IntermediateDirectory="Release_ly"
32 ConfigurationType="10">
33 <Tool
34 Name="VCCustomBuildTool"/>
35 <Tool
36 Name="VCMIDLTool"/>
37 <Tool
38 Name="VCPostBuildEventTool"/>
39 <Tool
40 Name="VCPreBuildEventTool"/>
41 </Configuration>
42 </Configurations>
43 <References>
44 </References>
45 <Files>
46 <Filter
47 Name="Source Files"
48 Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
49 UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
50 </Filter>
51 <Filter
52 Name="Header Files"
53 Filter="h;hpp;hxx;hm;inl;inc;xsd"
54 UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
55 </Filter>
56 <Filter
57 Name="Resource Files"
58 Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
59 UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
60 </Filter>
61 <File
62 RelativePath=".\indra.l">
63 <FileConfiguration
64 Name="Debug|Win32">
65 <Tool
66 Name="VCCustomBuildTool"
67 Description="Building lex_yy.cpp"
68 CommandLine="set ROOTDIR=..\..\..\libraries\i686-win32\mks
69..\..\..\libraries\i686-win32\mks\lex.exe -o lex_yy.cpp indra.l
70"
71 Outputs="lex_yy.cpp"/>
72 </FileConfiguration>
73 <FileConfiguration
74 Name="Release|Win32">
75 <Tool
76 Name="VCCustomBuildTool"
77 Description="Building lex_yy.cpp"
78 CommandLine="set ROOTDIR=..\..\..\libraries\i686-win32\mks
79..\..\..\libraries\i686-win32\mks\lex.exe -o lex_yy.cpp indra.l
80"
81 Outputs="lex_yy.cpp"/>
82 </FileConfiguration>
83 </File>
84 <File
85 RelativePath=".\indra.y">
86 <FileConfiguration
87 Name="Debug|Win32">
88 <Tool
89 Name="VCCustomBuildTool"
90 Description="Building ytab.cpp"
91 CommandLine="set ROOTDIR=..\..\..\libraries\i686-win32\mks
92..\..\..\libraries\i686-win32\mks\yacc.exe -o ytab.cpp -v -d indra.y
93"
94 Outputs="ytab.cpp;ytab.h"/>
95 </FileConfiguration>
96 <FileConfiguration
97 Name="Release|Win32">
98 <Tool
99 Name="VCCustomBuildTool"
100 Description="Building ytab.cpp"
101 CommandLine="set ROOTDIR=..\..\..\libraries\i686-win32\mks
102..\..\..\libraries\i686-win32\mks\yacc.exe -o ytab.cpp -v -d indra.y
103"
104 Outputs="ytab.cpp;ytab.h"/>
105 </FileConfiguration>
106 </File>
107 </Files>
108 <Globals>
109 </Globals>
110</VisualStudioProject>
diff --git a/linden/indra/lscript/lscript_compile/lscript_compile_ly_vc8.vcproj b/linden/indra/lscript/lscript_compile/lscript_compile_ly_vc8.vcproj
new file mode 100644
index 0000000..baa202a
--- /dev/null
+++ b/linden/indra/lscript/lscript_compile/lscript_compile_ly_vc8.vcproj
@@ -0,0 +1,131 @@
1<?xml version="1.0" encoding="Windows-1252"?>
2<VisualStudioProject
3 ProjectType="Visual C++"
4 Version="8.00"
5 Name="lscript_compile_ly"
6 ProjectGUID="{FF8ECB70-C788-47D4-91BF-F88448AE8940}"
7 RootNamespace="lscript_compile_ly"
8 Keyword="MakeFileProj"
9 >
10 <Platforms>
11 <Platform
12 Name="Win32"
13 />
14 </Platforms>
15 <ToolFiles>
16 </ToolFiles>
17 <Configurations>
18 <Configuration
19 Name="Debug|Win32"
20 OutputDirectory="."
21 IntermediateDirectory="Debug_ly"
22 ConfigurationType="10"
23 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
24 >
25 <Tool
26 Name="VCPreBuildEventTool"
27 />
28 <Tool
29 Name="VCCustomBuildTool"
30 />
31 <Tool
32 Name="VCMIDLTool"
33 />
34 <Tool
35 Name="VCPostBuildEventTool"
36 />
37 </Configuration>
38 <Configuration
39 Name="Release|Win32"
40 OutputDirectory="."
41 IntermediateDirectory="Release_ly"
42 ConfigurationType="10"
43 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
44 >
45 <Tool
46 Name="VCPreBuildEventTool"
47 />
48 <Tool
49 Name="VCCustomBuildTool"
50 />
51 <Tool
52 Name="VCMIDLTool"
53 />
54 <Tool
55 Name="VCPostBuildEventTool"
56 />
57 </Configuration>
58 </Configurations>
59 <References>
60 </References>
61 <Files>
62 <Filter
63 Name="Source Files"
64 Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
65 UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
66 >
67 </Filter>
68 <Filter
69 Name="Header Files"
70 Filter="h;hpp;hxx;hm;inl;inc;xsd"
71 UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
72 >
73 </Filter>
74 <Filter
75 Name="Resource Files"
76 Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
77 UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
78 >
79 </Filter>
80 <File
81 RelativePath=".\indra.l"
82 >
83 <FileConfiguration
84 Name="Debug|Win32"
85 >
86 <Tool
87 Name="VCCustomBuildTool"
88 Description="Building lex_yy.cpp"
89 CommandLine="set ROOTDIR=..\..\..\libraries\i686-win32\mks&#x0D;&#x0A;..\..\..\libraries\i686-win32\mks\lex.exe -o lex_yy.cpp indra.l&#x0D;&#x0A;"
90 Outputs="lex_yy.cpp"
91 />
92 </FileConfiguration>
93 <FileConfiguration
94 Name="Release|Win32"
95 >
96 <Tool
97 Name="VCCustomBuildTool"
98 Description="Building lex_yy.cpp"
99 CommandLine="set ROOTDIR=..\..\..\libraries\i686-win32\mks&#x0D;&#x0A;..\..\..\libraries\i686-win32\mks\lex.exe -o lex_yy.cpp indra.l&#x0D;&#x0A;"
100 Outputs="lex_yy.cpp"
101 />
102 </FileConfiguration>
103 </File>
104 <File
105 RelativePath=".\indra.y"
106 >
107 <FileConfiguration
108 Name="Debug|Win32"
109 >
110 <Tool
111 Name="VCCustomBuildTool"
112 Description="Building ytab.cpp"
113 CommandLine="set ROOTDIR=..\..\..\libraries\i686-win32\mks&#x0D;&#x0A;..\..\..\libraries\i686-win32\mks\yacc.exe -o ytab.cpp -v -d indra.y&#x0D;&#x0A;"
114 Outputs="ytab.cpp;ytab.h"
115 />
116 </FileConfiguration>
117 <FileConfiguration
118 Name="Release|Win32"
119 >
120 <Tool
121 Name="VCCustomBuildTool"
122 Description="Building ytab.cpp"
123 CommandLine="set ROOTDIR=..\..\..\libraries\i686-win32\mks&#x0D;&#x0A;..\..\..\libraries\i686-win32\mks\yacc.exe -o ytab.cpp -v -d indra.y&#x0D;&#x0A;"
124 Outputs="ytab.cpp;ytab.h"
125 />
126 </FileConfiguration>
127 </File>
128 </Files>
129 <Globals>
130 </Globals>
131</VisualStudioProject>
diff --git a/linden/indra/lscript/lscript_compile/lscript_compile_vc8.vcproj b/linden/indra/lscript/lscript_compile/lscript_compile_vc8.vcproj
new file mode 100644
index 0000000..1427015
--- /dev/null
+++ b/linden/indra/lscript/lscript_compile/lscript_compile_vc8.vcproj
@@ -0,0 +1,329 @@
1<?xml version="1.0" encoding="Windows-1252"?>
2<VisualStudioProject
3 ProjectType="Visual C++"
4 Version="8.00"
5 Name="lscript_compile"
6 ProjectGUID="{44CE6D82-7320-4609-8FC3-5965C19F4808}"
7 RootNamespace="lscript_compile"
8 Keyword="Win32Proj"
9 >
10 <Platforms>
11 <Platform
12 Name="Win32"
13 />
14 </Platforms>
15 <ToolFiles>
16 </ToolFiles>
17 <Configurations>
18 <Configuration
19 Name="Debug|Win32"
20 OutputDirectory="../../lib_$(ConfigurationName)/i686-win32"
21 IntermediateDirectory="Debug"
22 ConfigurationType="4"
23 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
24 CharacterSet="1"
25 >
26 <Tool
27 Name="VCPreBuildEventTool"
28 />
29 <Tool
30 Name="VCCustomBuildTool"
31 />
32 <Tool
33 Name="VCXMLDataGeneratorTool"
34 />
35 <Tool
36 Name="VCWebServiceProxyGeneratorTool"
37 />
38 <Tool
39 Name="VCMIDLTool"
40 />
41 <Tool
42 Name="VCCLCompilerTool"
43 Optimization="0"
44 AdditionalIncludeDirectories="..;..\..\llcommon;..\..\llmath;..\..\llvfs;..\..\llmessage;..\..\llinventory;&quot;..\..\..\libraries\i686-win32\include&quot;;..\..\..\libraries\include"
45 PreprocessorDefinitions="WIN32;_DEBUG;_LIB;LL_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;LL_DEBUG"
46 MinimalRebuild="true"
47 BasicRuntimeChecks="3"
48 RuntimeLibrary="1"
49 StructMemberAlignment="4"
50 TreatWChar_tAsBuiltInType="false"
51 ForceConformanceInForLoopScope="true"
52 UsePrecompiledHeader="0"
53 WarningLevel="3"
54 WarnAsError="true"
55 Detect64BitPortabilityProblems="false"
56 DebugInformationFormat="4"
57 />
58 <Tool
59 Name="VCManagedResourceCompilerTool"
60 />
61 <Tool
62 Name="VCResourceCompilerTool"
63 />
64 <Tool
65 Name="VCPreLinkEventTool"
66 />
67 <Tool
68 Name="VCLibrarianTool"
69 OutputFile="$(OutDir)/lscript_compile.lib"
70 />
71 <Tool
72 Name="VCALinkTool"
73 />
74 <Tool
75 Name="VCXDCMakeTool"
76 />
77 <Tool
78 Name="VCBscMakeTool"
79 />
80 <Tool
81 Name="VCFxCopTool"
82 />
83 <Tool
84 Name="VCPostBuildEventTool"
85 />
86 </Configuration>
87 <Configuration
88 Name="Release|Win32"
89 OutputDirectory="../../lib_$(ConfigurationName)/i686-win32"
90 IntermediateDirectory="Release"
91 ConfigurationType="4"
92 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
93 CharacterSet="1"
94 >
95 <Tool
96 Name="VCPreBuildEventTool"
97 />
98 <Tool
99 Name="VCCustomBuildTool"
100 />
101 <Tool
102 Name="VCXMLDataGeneratorTool"
103 />
104 <Tool
105 Name="VCWebServiceProxyGeneratorTool"
106 />
107 <Tool
108 Name="VCMIDLTool"
109 />
110 <Tool
111 Name="VCCLCompilerTool"
112 AdditionalIncludeDirectories="..;..\..\llcommon;..\..\llmath;..\..\llvfs;..\..\llmessage;..\..\llinventory;&quot;..\..\..\libraries\i686-win32\include&quot;;..\..\..\libraries\include"
113 PreprocessorDefinitions="WIN32;NDEBUG;_LIB;LL_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;LL_RELEASE"
114 RuntimeLibrary="0"
115 StructMemberAlignment="0"
116 TreatWChar_tAsBuiltInType="false"
117 ForceConformanceInForLoopScope="true"
118 UsePrecompiledHeader="0"
119 WarningLevel="3"
120 WarnAsError="true"
121 Detect64BitPortabilityProblems="false"
122 DebugInformationFormat="3"
123 />
124 <Tool
125 Name="VCManagedResourceCompilerTool"
126 />
127 <Tool
128 Name="VCResourceCompilerTool"
129 />
130 <Tool
131 Name="VCPreLinkEventTool"
132 />
133 <Tool
134 Name="VCLibrarianTool"
135 OutputFile="$(OutDir)/lscript_compile.lib"
136 />
137 <Tool
138 Name="VCALinkTool"
139 />
140 <Tool
141 Name="VCXDCMakeTool"
142 />
143 <Tool
144 Name="VCBscMakeTool"
145 />
146 <Tool
147 Name="VCFxCopTool"
148 />
149 <Tool
150 Name="VCPostBuildEventTool"
151 />
152 </Configuration>
153 <Configuration
154 Name="ReleaseNoOpt|Win32"
155 OutputDirectory="../../lib_$(ConfigurationName)/i686-win32"
156 IntermediateDirectory="$(ConfigurationName)"
157 ConfigurationType="4"
158 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
159 CharacterSet="1"
160 >
161 <Tool
162 Name="VCPreBuildEventTool"
163 />
164 <Tool
165 Name="VCCustomBuildTool"
166 />
167 <Tool
168 Name="VCXMLDataGeneratorTool"
169 />
170 <Tool
171 Name="VCWebServiceProxyGeneratorTool"
172 />
173 <Tool
174 Name="VCMIDLTool"
175 />
176 <Tool
177 Name="VCCLCompilerTool"
178 Optimization="0"
179 AdditionalIncludeDirectories="..;..\..\llcommon;..\..\llmath;..\..\llvfs;..\..\llmessage;..\..\llinventory;&quot;..\..\..\libraries\i686-win32\include&quot;;..\..\..\libraries\include"
180 PreprocessorDefinitions="WIN32;NDEBUG;_LIB;LL_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;LL_RELEASE"
181 RuntimeLibrary="0"
182 StructMemberAlignment="0"
183 TreatWChar_tAsBuiltInType="false"
184 ForceConformanceInForLoopScope="true"
185 UsePrecompiledHeader="0"
186 WarningLevel="3"
187 WarnAsError="true"
188 Detect64BitPortabilityProblems="false"
189 DebugInformationFormat="3"
190 />
191 <Tool
192 Name="VCManagedResourceCompilerTool"
193 />
194 <Tool
195 Name="VCResourceCompilerTool"
196 />
197 <Tool
198 Name="VCPreLinkEventTool"
199 />
200 <Tool
201 Name="VCLibrarianTool"
202 OutputFile="$(OutDir)/lscript_compile.lib"
203 />
204 <Tool
205 Name="VCALinkTool"
206 />
207 <Tool
208 Name="VCXDCMakeTool"
209 />
210 <Tool
211 Name="VCBscMakeTool"
212 />
213 <Tool
214 Name="VCFxCopTool"
215 />
216 <Tool
217 Name="VCPostBuildEventTool"
218 />
219 </Configuration>
220 </Configurations>
221 <References>
222 </References>
223 <Files>
224 <Filter
225 Name="Source Files"
226 Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
227 UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
228 >
229 <File
230 RelativePath=".\lex_yy.cpp"
231 >
232 </File>
233 <File
234 RelativePath=".\lscript_alloc.cpp"
235 >
236 </File>
237 <File
238 RelativePath=".\lscript_bytecode.cpp"
239 >
240 </File>
241 <File
242 RelativePath=".\lscript_error.cpp"
243 >
244 </File>
245 <File
246 RelativePath=".\lscript_heap.cpp"
247 >
248 </File>
249 <File
250 RelativePath=".\lscript_resource.cpp"
251 >
252 </File>
253 <File
254 RelativePath=".\lscript_scope.cpp"
255 >
256 </File>
257 <File
258 RelativePath=".\lscript_tree.cpp"
259 >
260 </File>
261 <File
262 RelativePath=".\lscript_typecheck.cpp"
263 >
264 </File>
265 <File
266 RelativePath=".\ytab.cpp"
267 >
268 <FileConfiguration
269 Name="Release|Win32"
270 >
271 <Tool
272 Name="VCCLCompilerTool"
273 CompileAs="2"
274 />
275 </FileConfiguration>
276 </File>
277 </Filter>
278 <Filter
279 Name="Header Files"
280 Filter="h;hpp;hxx;hm;inl;inc;xsd"
281 UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
282 >
283 <File
284 RelativePath=".\generated_lex_yy.hpp"
285 >
286 </File>
287 <File
288 RelativePath=".\generated_ytab.hpp"
289 >
290 </File>
291 <File
292 RelativePath=".\lscript_bytecode.h"
293 >
294 </File>
295 <File
296 RelativePath=".\lscript_error.h"
297 >
298 </File>
299 <File
300 RelativePath=".\lscript_heap.h"
301 >
302 </File>
303 <File
304 RelativePath=".\lscript_resource.h"
305 >
306 </File>
307 <File
308 RelativePath=".\lscript_scope.h"
309 >
310 </File>
311 <File
312 RelativePath=".\lscript_tree.h"
313 >
314 </File>
315 <File
316 RelativePath=".\lscript_typecheck.h"
317 >
318 </File>
319 </Filter>
320 <Filter
321 Name="Resource Files"
322 Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
323 UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
324 >
325 </Filter>
326 </Files>
327 <Globals>
328 </Globals>
329</VisualStudioProject>
diff --git a/linden/indra/lscript/lscript_compile/lscript_error.cpp b/linden/indra/lscript/lscript_compile/lscript_error.cpp
index d9f4d49..5ec50d3 100644
--- a/linden/indra/lscript/lscript_compile/lscript_error.cpp
+++ b/linden/indra/lscript/lscript_compile/lscript_error.cpp
@@ -45,13 +45,13 @@ void LLScriptFilePosition::fdotabs(FILE *fp, S32 tabs, S32 tabsize)
45 } 45 }
46} 46}
47 47
48char *gWarningText[LSWARN_EOF] = 48char* gWarningText[LSWARN_EOF] = /*Flawfinder: ignore*/
49{ 49{
50 "INVALID", 50 "INVALID",
51 "Dead code found beyond return statement" 51 "Dead code found beyond return statement"
52}; 52};
53 53
54char *gErrorText[LSERROR_EOF] = 54char* gErrorText[LSERROR_EOF] = /*Flawfinder: ignore*/
55{ 55{
56 "INVALID", 56 "INVALID",
57 "Syntax error", 57 "Syntax error",
diff --git a/linden/indra/lscript/lscript_compile/lscript_heap.cpp b/linden/indra/lscript/lscript_compile/lscript_heap.cpp
index 4adf84a..2cbd6bb 100644
--- a/linden/indra/lscript/lscript_compile/lscript_heap.cpp
+++ b/linden/indra/lscript/lscript_compile/lscript_heap.cpp
@@ -53,9 +53,9 @@ LLScriptHeapEntry::~LLScriptHeapEntry()
53 53
54void LLScriptHeapEntry::addString(char *string) 54void LLScriptHeapEntry::addString(char *string)
55{ 55{
56 S32 size = strlen(string) + 1; 56 S32 size = strlen(string) + 1; /*Flawfinder: ignore*/
57 S32 offset = 0; 57 S32 offset = 0;
58 memcpy(mData, string, size); 58 memcpy(mData, string, size); /*Flawfinder: ignore*/
59 mNext += size; 59 mNext += size;
60 integer2bytestream(mEntry, offset, mNext); 60 integer2bytestream(mEntry, offset, mNext);
61 mRefCount++; 61 mRefCount++;
diff --git a/linden/indra/lscript/lscript_compile/lscript_scope.h b/linden/indra/lscript/lscript_compile/lscript_scope.h
index ff20ad3..62fef88 100644
--- a/linden/indra/lscript/lscript_compile/lscript_scope.h
+++ b/linden/indra/lscript/lscript_compile/lscript_scope.h
@@ -45,7 +45,7 @@ typedef enum e_lscript_identifier_type
45 LIT_EOF 45 LIT_EOF
46} LSCRIPTIdentifierType; 46} LSCRIPTIdentifierType;
47 47
48const char LSCRIPTFunctionTypeStrings[LST_EOF] = 48const char LSCRIPTFunctionTypeStrings[LST_EOF] = /*Flawfinder: ignore*/
49{ 49{
50 '0', 50 '0',
51 'i', 51 'i',
@@ -58,7 +58,7 @@ const char LSCRIPTFunctionTypeStrings[LST_EOF] =
58 '0' 58 '0'
59}; 59};
60 60
61const char * const LSCRIPTListDescription[LST_EOF] = 61const char * const LSCRIPTListDescription[LST_EOF] = /*Flawfinder: ignore*/
62{ 62{
63 "PUSHARGB 0", 63 "PUSHARGB 0",
64 "PUSHARGB 1", 64 "PUSHARGB 1",
@@ -71,7 +71,7 @@ const char * const LSCRIPTListDescription[LST_EOF] =
71 "PUSHARGB 0" 71 "PUSHARGB 0"
72}; 72};
73 73
74const char * const LSCRIPTTypePush[LST_EOF] = 74const char * const LSCRIPTTypePush[LST_EOF] = /*Flawfinder: ignore*/
75{ 75{
76 "INVALID", 76 "INVALID",
77 "PUSHE", 77 "PUSHE",
@@ -84,7 +84,7 @@ const char * const LSCRIPTTypePush[LST_EOF] =
84 "undefined" 84 "undefined"
85}; 85};
86 86
87const char * const LSCRIPTTypeReturn[LST_EOF] = 87const char * const LSCRIPTTypeReturn[LST_EOF] = /*Flawfinder: ignore*/
88{ 88{
89 "INVALID", 89 "INVALID",
90 "LOADP -12", 90 "LOADP -12",
@@ -97,7 +97,7 @@ const char * const LSCRIPTTypeReturn[LST_EOF] =
97 "undefined" 97 "undefined"
98}; 98};
99 99
100const char * const LSCRIPTTypePop[LST_EOF] = 100const char * const LSCRIPTTypePop[LST_EOF] = /*Flawfinder: ignore*/
101{ 101{
102 "INVALID", 102 "INVALID",
103 "POP", 103 "POP",
@@ -110,7 +110,7 @@ const char * const LSCRIPTTypePop[LST_EOF] =
110 "undefined" 110 "undefined"
111}; 111};
112 112
113const char * const LSCRIPTTypeDuplicate[LST_EOF] = 113const char * const LSCRIPTTypeDuplicate[LST_EOF] = /*Flawfinder: ignore*/
114{ 114{
115 "INVALID", 115 "INVALID",
116 "DUP", 116 "DUP",
@@ -123,7 +123,7 @@ const char * const LSCRIPTTypeDuplicate[LST_EOF] =
123 "undefined" 123 "undefined"
124}; 124};
125 125
126const char * const LSCRIPTTypeLocalStore[LST_EOF] = 126const char * const LSCRIPTTypeLocalStore[LST_EOF] = /*Flawfinder: ignore*/
127{ 127{
128 "INVALID", 128 "INVALID",
129 "STORE ", 129 "STORE ",
@@ -136,7 +136,7 @@ const char * const LSCRIPTTypeLocalStore[LST_EOF] =
136 "undefined" 136 "undefined"
137}; 137};
138 138
139const char * const LSCRIPTTypeLocalDeclaration[LST_EOF] = 139const char * const LSCRIPTTypeLocalDeclaration[LST_EOF] = /*Flawfinder: ignore*/
140{ 140{
141 "INVALID", 141 "INVALID",
142 "STOREP ", 142 "STOREP ",
@@ -149,7 +149,7 @@ const char * const LSCRIPTTypeLocalDeclaration[LST_EOF] =
149 "undefined" 149 "undefined"
150}; 150};
151 151
152const char * const LSCRIPTTypeGlobalStore[LST_EOF] = 152const char * const LSCRIPTTypeGlobalStore[LST_EOF] = /*Flawfinder: ignore*/
153{ 153{
154 "INVALID", 154 "INVALID",
155 "STOREG ", 155 "STOREG ",
@@ -162,7 +162,7 @@ const char * const LSCRIPTTypeGlobalStore[LST_EOF] =
162 "undefined" 162 "undefined"
163}; 163};
164 164
165const char * const LSCRIPTTypeLocalPush[LST_EOF] = 165const char * const LSCRIPTTypeLocalPush[LST_EOF] = /*Flawfinder: ignore*/
166{ 166{
167 "INVALID", 167 "INVALID",
168 "PUSH ", 168 "PUSH ",
@@ -175,7 +175,7 @@ const char * const LSCRIPTTypeLocalPush[LST_EOF] =
175 "undefined" 175 "undefined"
176}; 176};
177 177
178const char * const LSCRIPTTypeLocalPush1[LST_EOF] = 178const char * const LSCRIPTTypeLocalPush1[LST_EOF] = /*Flawfinder: ignore*/
179{ 179{
180 "INVALID", 180 "INVALID",
181 "PUSHARGI 1", 181 "PUSHARGI 1",
@@ -188,7 +188,7 @@ const char * const LSCRIPTTypeLocalPush1[LST_EOF] =
188 "undefined" 188 "undefined"
189}; 189};
190 190
191const char * const LSCRIPTTypeGlobalPush[LST_EOF] = 191const char * const LSCRIPTTypeGlobalPush[LST_EOF] = /*Flawfinder: ignore*/
192{ 192{
193 "INVALID", 193 "INVALID",
194 "PUSHG ", 194 "PUSHG ",
@@ -213,7 +213,7 @@ public:
213 { 213 {
214 if (!mString) 214 if (!mString)
215 return LST_NULL; 215 return LST_NULL;
216 S32 length = (S32)strlen(mString); 216 S32 length = (S32)strlen(mString); /*Flawfinder: ignore*/
217 if (count >= length) 217 if (count >= length)
218 { 218 {
219 return LST_NULL; 219 return LST_NULL;
@@ -244,9 +244,9 @@ public:
244 S32 count = 0; 244 S32 count = 0;
245 if (mString) 245 if (mString)
246 { 246 {
247 count = (S32)strlen(mString); 247 count = (S32)strlen(mString); /*Flawfinder: ignore*/
248 char *temp = new char[count + 2]; 248 char *temp = new char[count + 2];
249 memcpy(temp, mString, count); 249 memcpy(temp, mString, count); /*Flawfinder: ignore*/
250 delete [] mString; 250 delete [] mString;
251 mString = temp; 251 mString = temp;
252 mString[count + 1] = 0; 252 mString[count + 1] = 0;
@@ -262,7 +262,7 @@ public:
262 S32 getNumber() 262 S32 getNumber()
263 { 263 {
264 if (mString) 264 if (mString)
265 return (S32)strlen(mString); 265 return (S32)strlen(mString); /*Flawfinder: ignore*/
266 else 266 else
267 return 0; 267 return 0;
268 } 268 }
diff --git a/linden/indra/lscript/lscript_compile/lscript_tree.cpp b/linden/indra/lscript/lscript_compile/lscript_tree.cpp
index bda09dd..0812ed5 100644
--- a/linden/indra/lscript/lscript_compile/lscript_tree.cpp
+++ b/linden/indra/lscript/lscript_compile/lscript_tree.cpp
@@ -270,7 +270,7 @@ void LLScriptConstantString::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIPTCom
270 break; 270 break;
271 case LSCP_EMIT_ASSEMBLY: 271 case LSCP_EMIT_ASSEMBLY:
272 fprintf(fp, "PUSHARGS \"%s\"\n", mValue); 272 fprintf(fp, "PUSHARGS \"%s\"\n", mValue);
273 fprintf(fp, "STACKTOS %lu\n", strlen(mValue) + 1); 273 fprintf(fp, "STACKTOS %lu\n", strlen(mValue) + 1); /*Flawfinder: ignore*/
274 break; 274 break;
275 case LSCP_TYPE: 275 case LSCP_TYPE:
276 type = mType; 276 type = mType;
@@ -290,7 +290,7 @@ void LLScriptConstantString::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIPTCom
290 case LSCP_TO_STACK: 290 case LSCP_TO_STACK:
291 { 291 {
292 chunk->addByte(LSCRIPTOpCodes[LOPC_PUSHARGS]); 292 chunk->addByte(LSCRIPTOpCodes[LOPC_PUSHARGS]);
293 chunk->addBytes(mValue, (S32)strlen(mValue) + 1); 293 chunk->addBytes(mValue, (S32)strlen(mValue) + 1); /*Flawfinder: ignore*/
294 type = mType; 294 type = mType;
295 } 295 }
296 break; 296 break;
@@ -310,7 +310,7 @@ void LLScriptConstantString::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIPTCom
310 310
311S32 LLScriptConstantString::getSize() 311S32 LLScriptConstantString::getSize()
312{ 312{
313 return (S32)strlen(mValue) + 1; 313 return (S32)strlen(mValue) + 1; /*Flawfinder: ignore*/
314} 314}
315 315
316 316
@@ -1161,7 +1161,7 @@ void LLScriptGlobalVariable::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIPTCom
1161 // it also includes the name of the variable as well as the type 1161 // it also includes the name of the variable as well as the type
1162 // plus 4 bytes of offset from it's apparent address to the actual data 1162 // plus 4 bytes of offset from it's apparent address to the actual data
1163#ifdef LSL_INCLUDE_DEBUG_INFO 1163#ifdef LSL_INCLUDE_DEBUG_INFO
1164 count += strlen(mIdentifier->mName) + 1 + 1 + 4; 1164 count += strlen(mIdentifier->mName) + 1 + 1 + 4; /*Flawfinder: ignore*/
1165#else 1165#else
1166 count += 1 + 1 + 4; 1166 count += 1 + 1 + 4;
1167#endif 1167#endif
@@ -1184,7 +1184,7 @@ void LLScriptGlobalVariable::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIPTCom
1184 chunk->addBytes(&vtype, 1); 1184 chunk->addBytes(&vtype, 1);
1185 // null terminated name 1185 // null terminated name
1186#ifdef LSL_INCLUDE_DEBUG_INFO 1186#ifdef LSL_INCLUDE_DEBUG_INFO
1187 chunk->addBytes(mIdentifier->mName, strlen(mIdentifier->mName) + 1); 1187 chunk->addBytes(mIdentifier->mName, strlen(mIdentifier->mName) + 1); /*Flawfinder: ignore*/
1188#else 1188#else
1189 chunk->addBytes(1); 1189 chunk->addBytes(1);
1190#endif 1190#endif
@@ -1315,7 +1315,7 @@ void LLScriptStateEntryEvent::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIPTCo
1315 { 1315 {
1316#ifdef LSL_INCLUDE_DEBUG_INFO 1316#ifdef LSL_INCLUDE_DEBUG_INFO
1317 char name[] = "state_entry"; 1317 char name[] = "state_entry";
1318 chunk->addBytes(name, strlen(name) + 1); 1318 chunk->addBytes(name, strlen(name) + 1); /*Flawfinder: ignore*/
1319#endif 1319#endif
1320 } 1320 }
1321 break; 1321 break;
@@ -1351,7 +1351,7 @@ void LLScriptStateExitEvent::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIPTCom
1351 { 1351 {
1352#ifdef LSL_INCLUDE_DEBUG_INFO 1352#ifdef LSL_INCLUDE_DEBUG_INFO
1353 char name[] = "state_exit"; 1353 char name[] = "state_exit";
1354 chunk->addBytes(name, strlen(name) + 1); 1354 chunk->addBytes(name, strlen(name) + 1); /*Flawfinder: ignore*/
1355#endif 1355#endif
1356 } 1356 }
1357 break; 1357 break;
@@ -1409,8 +1409,8 @@ void LLScriptTouchStartEvent::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIPTCo
1409 { 1409 {
1410#ifdef LSL_INCLUDE_DEBUG_INFO 1410#ifdef LSL_INCLUDE_DEBUG_INFO
1411 char name[] = "touch_start"; 1411 char name[] = "touch_start";
1412 chunk->addBytes(name, strlen(name) + 1); 1412 chunk->addBytes(name, strlen(name) + 1); /*Flawfinder: ignore*/
1413 chunk->addBytes(mCount->mName, strlen(mCount->mName) + 1); 1413 chunk->addBytes(mCount->mName, strlen(mCount->mName) + 1); /*Flawfinder: ignore*/
1414#endif 1414#endif
1415 } 1415 }
1416 break; 1416 break;
@@ -1467,8 +1467,8 @@ void LLScriptTouchEvent::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIPTCompile
1467 { 1467 {
1468#ifdef LSL_INCLUDE_DEBUG_INFO 1468#ifdef LSL_INCLUDE_DEBUG_INFO
1469 char name[] = "touch"; 1469 char name[] = "touch";
1470 chunk->addBytes(name, strlen(name) + 1); 1470 chunk->addBytes(name, strlen(name) + 1); /*Flawfinder: ignore*/
1471 chunk->addBytes(mCount->mName, strlen(mCount->mName) + 1); 1471 chunk->addBytes(mCount->mName, strlen(mCount->mName) + 1); /*Flawfinder: ignore*/
1472#endif 1472#endif
1473 } 1473 }
1474 break; 1474 break;
@@ -1525,8 +1525,8 @@ void LLScriptTouchEndEvent::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIPTComp
1525 { 1525 {
1526#ifdef LSL_INCLUDE_DEBUG_INFO 1526#ifdef LSL_INCLUDE_DEBUG_INFO
1527 char name[] = "touch_end"; 1527 char name[] = "touch_end";
1528 chunk->addBytes(name, strlen(name) + 1); 1528 chunk->addBytes(name, strlen(name) + 1); /*Flawfinder: ignore*/
1529 chunk->addBytes(mCount->mName, strlen(mCount->mName) + 1); 1529 chunk->addBytes(mCount->mName, strlen(mCount->mName) + 1); /*Flawfinder: ignore*/
1530#endif 1530#endif
1531 } 1531 }
1532 break; 1532 break;
@@ -1583,8 +1583,8 @@ void LLScriptCollisionStartEvent::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRI
1583 { 1583 {
1584#ifdef LSL_INCLUDE_DEBUG_INFO 1584#ifdef LSL_INCLUDE_DEBUG_INFO
1585 char name[] = "collision_start"; 1585 char name[] = "collision_start";
1586 chunk->addBytes(name, (S32)strlen(name) + 1); 1586 chunk->addBytes(name, (S32)strlen(name) + 1); /*Flawfinder: ignore*/
1587 chunk->addBytes(mCount->mName, (S32)strlen(mCount->mName) + 1); 1587 chunk->addBytes(mCount->mName, (S32)strlen(mCount->mName) + 1); /*Flawfinder: ignore*/
1588#endif 1588#endif
1589 } 1589 }
1590 break; 1590 break;
@@ -1641,8 +1641,8 @@ void LLScriptCollisionEvent::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIPTCom
1641 { 1641 {
1642#ifdef LSL_INCLUDE_DEBUG_INFO 1642#ifdef LSL_INCLUDE_DEBUG_INFO
1643 char name[] = "collision"; 1643 char name[] = "collision";
1644 chunk->addBytes(name, strlen(name) + 1); 1644 chunk->addBytes(name, strlen(name) + 1); /*Flawfinder: ignore*/
1645 chunk->addBytes(mCount->mName, strlen(mCount->mName) + 1); 1645 chunk->addBytes(mCount->mName, strlen(mCount->mName) + 1); /*Flawfinder: ignore*/
1646#endif 1646#endif
1647 } 1647 }
1648 break; 1648 break;
@@ -1699,8 +1699,8 @@ void LLScriptCollisionEndEvent::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIPT
1699 { 1699 {
1700#ifdef LSL_INCLUDE_DEBUG_INFO 1700#ifdef LSL_INCLUDE_DEBUG_INFO
1701 char name[] = "collision_end"; 1701 char name[] = "collision_end";
1702 chunk->addBytes(name, strlen(name) + 1); 1702 chunk->addBytes(name, strlen(name) + 1); /*Flawfinder: ignore*/
1703 chunk->addBytes(mCount->mName, strlen(mCount->mName) + 1); 1703 chunk->addBytes(mCount->mName, strlen(mCount->mName) + 1); /*Flawfinder: ignore*/
1704#endif 1704#endif
1705 } 1705 }
1706 break; 1706 break;
@@ -1756,8 +1756,8 @@ void LLScriptLandCollisionStartEvent::recurse(FILE *fp, S32 tabs, S32 tabsize, L
1756 { 1756 {
1757#ifdef LSL_INCLUDE_DEBUG_INFO 1757#ifdef LSL_INCLUDE_DEBUG_INFO
1758 char name[] = "land_collision_start"; 1758 char name[] = "land_collision_start";
1759 chunk->addBytes(name, strlen(name) + 1); 1759 chunk->addBytes(name, strlen(name) + 1); /*Flawfinder: ignore*/
1760 chunk->addBytes(mPosition->mName, strlen(mPosition->mName) + 1); 1760 chunk->addBytes(mPosition->mName, strlen(mPosition->mName) + 1); /*Flawfinder: ignore*/
1761#endif 1761#endif
1762 } 1762 }
1763 break; 1763 break;
@@ -1815,8 +1815,8 @@ void LLScriptLandCollisionEvent::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIP
1815 { 1815 {
1816#ifdef LSL_INCLUDE_DEBUG_INFO 1816#ifdef LSL_INCLUDE_DEBUG_INFO
1817 char name[] = "land_collision"; 1817 char name[] = "land_collision";
1818 chunk->addBytes(name, strlen(name) + 1); 1818 chunk->addBytes(name, strlen(name) + 1); /*Flawfinder: ignore*/
1819 chunk->addBytes(mPosition->mName, strlen(mPosition->mName) + 1); 1819 chunk->addBytes(mPosition->mName, strlen(mPosition->mName) + 1); /*Flawfinder: ignore*/
1820#endif 1820#endif
1821 } 1821 }
1822 break; 1822 break;
@@ -1872,9 +1872,9 @@ void LLScriptLandCollisionEndEvent::recurse(FILE *fp, S32 tabs, S32 tabsize, LSC
1872 case LSCP_EMIT_BYTE_CODE: 1872 case LSCP_EMIT_BYTE_CODE:
1873 { 1873 {
1874#ifdef LSL_INCLUDE_DEBUG_INFO 1874#ifdef LSL_INCLUDE_DEBUG_INFO
1875 char name[] = "land_collision_end"; 1875 char name[] = "land_collision_end"; /*Flawfinder: ignore*/
1876 chunk->addBytes(name, strlen(name) + 1); 1876 chunk->addBytes(name, strlen(name) + 1); /*Flawfinder: ignore*/
1877 chunk->addBytes(mPosition->mName, strlen(mPosition->mName) + 1); 1877 chunk->addBytes(mPosition->mName, strlen(mPosition->mName) + 1); /*Flawfinder: ignore*/
1878#endif 1878#endif
1879 } 1879 }
1880 break; 1880 break;
@@ -1931,8 +1931,8 @@ void LLScriptInventoryEvent::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIPTCom
1931 { 1931 {
1932#ifdef LSL_INCLUDE_DEBUG_INFO 1932#ifdef LSL_INCLUDE_DEBUG_INFO
1933 char name[] = "changed"; 1933 char name[] = "changed";
1934 chunk->addBytes(name, strlen(name) + 1); 1934 chunk->addBytes(name, strlen(name) + 1); /*Flawfinder: ignore*/
1935 chunk->addBytes(mChange->mName, strlen(mChange->mName) + 1); 1935 chunk->addBytes(mChange->mName, strlen(mChange->mName) + 1); /*Flawfinder: ignore*/
1936#endif 1936#endif
1937 } 1937 }
1938 break; 1938 break;
@@ -1988,8 +1988,8 @@ void LLScriptAttachEvent::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIPTCompil
1988 { 1988 {
1989#ifdef LSL_INCLUDE_DEBUG_INFO 1989#ifdef LSL_INCLUDE_DEBUG_INFO
1990 char name[] = "attach"; 1990 char name[] = "attach";
1991 chunk->addBytes(name, strlen(name) + 1); 1991 chunk->addBytes(name, strlen(name) + 1); /*Flawfinder: ignore*/
1992 chunk->addBytes(mAttach->mName, strlen(mAttach->mName) + 1); 1992 chunk->addBytes(mAttach->mName, strlen(mAttach->mName) + 1); /*Flawfinder: ignore*/
1993#endif 1993#endif
1994 } 1994 }
1995 break; 1995 break;
@@ -2058,9 +2058,9 @@ void LLScriptDataserverEvent::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIPTCo
2058 { 2058 {
2059#ifdef LSL_INCLUDE_DEBUG_INFO 2059#ifdef LSL_INCLUDE_DEBUG_INFO
2060 char name[] = "dataserver"; 2060 char name[] = "dataserver";
2061 chunk->addBytes(name, strlen(name) + 1); 2061 chunk->addBytes(name, strlen(name) + 1); /*Flawfinder: ignore*/
2062 chunk->addBytes(mID->mName, strlen(mID->mName) + 1); 2062 chunk->addBytes(mID->mName, strlen(mID->mName) + 1); /*Flawfinder: ignore*/
2063 chunk->addBytes(mData->mName, strlen(mData->mName) + 1); 2063 chunk->addBytes(mData->mName, strlen(mData->mName) + 1); /*Flawfinder: ignore*/
2064#endif 2064#endif
2065 } 2065 }
2066 break; 2066 break;
@@ -2096,7 +2096,7 @@ void LLScriptTimerEvent::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIPTCompile
2096 { 2096 {
2097#ifdef LSL_INCLUDE_DEBUG_INFO 2097#ifdef LSL_INCLUDE_DEBUG_INFO
2098 char name[] = "timer"; 2098 char name[] = "timer";
2099 chunk->addBytes(name, strlen(name) + 1); 2099 chunk->addBytes(name, strlen(name) + 1); /*Flawfinder: ignore*/
2100#endif 2100#endif
2101 } 2101 }
2102 break; 2102 break;
@@ -2127,7 +2127,7 @@ void LLScriptMovingStartEvent::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIPTC
2127 { 2127 {
2128#ifdef LSL_INCLUDE_DEBUG_INFO 2128#ifdef LSL_INCLUDE_DEBUG_INFO
2129 char name[] = "moving_start"; 2129 char name[] = "moving_start";
2130 chunk->addBytes(name, strlen(name) + 1); 2130 chunk->addBytes(name, strlen(name) + 1); /*Flawfinder: ignore*/
2131#endif 2131#endif
2132 } 2132 }
2133 break; 2133 break;
@@ -2158,7 +2158,7 @@ void LLScriptMovingEndEvent::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIPTCom
2158 { 2158 {
2159#ifdef LSL_INCLUDE_DEBUG_INFO 2159#ifdef LSL_INCLUDE_DEBUG_INFO
2160 char name[] = "moving_end"; 2160 char name[] = "moving_end";
2161 chunk->addBytes(name, strlen(name) + 1); 2161 chunk->addBytes(name, strlen(name) + 1); /*Flawfinder: ignore*/
2162#endif 2162#endif
2163 } 2163 }
2164 break; 2164 break;
@@ -2212,8 +2212,8 @@ void LLScriptRTPEvent::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIPTCompilePa
2212 { 2212 {
2213#ifdef LSL_INCLUDE_DEBUG_INFO 2213#ifdef LSL_INCLUDE_DEBUG_INFO
2214 char name[] = "chat"; 2214 char name[] = "chat";
2215 chunk->addBytes(name, strlen(name) + 1); 2215 chunk->addBytes(name, strlen(name) + 1); /*Flawfinder: ignore*/
2216 chunk->addBytes(mRTPermissions->mName, strlen(mRTPermissions->mName) + 1); 2216 chunk->addBytes(mRTPermissions->mName, strlen(mRTPermissions->mName) + 1); /*Flawfinder: ignore*/
2217#endif 2217#endif
2218 } 2218 }
2219 break; 2219 break;
@@ -2308,11 +2308,11 @@ void LLScriptChatEvent::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIPTCompileP
2308 { 2308 {
2309#ifdef LSL_INCLUDE_DEBUG_INFO 2309#ifdef LSL_INCLUDE_DEBUG_INFO
2310 char name[] = "chat"; 2310 char name[] = "chat";
2311 chunk->addBytes(name, strlen(name) + 1); 2311 chunk->addBytes(name, strlen(name) + 1); /*Flawfinder: ignore*/
2312 chunk->addBytes(mChannel->mName, strlen(mChannel->mName) + 1); 2312 chunk->addBytes(mChannel->mName, strlen(mChannel->mName) + 1); /*Flawfinder: ignore*/
2313 chunk->addBytes(mName->mName, strlen(mName->mName) + 1); 2313 chunk->addBytes(mName->mName, strlen(mName->mName) + 1); /*Flawfinder: ignore*/
2314 chunk->addBytes(mID->mName, strlen(mID->mName) + 1); 2314 chunk->addBytes(mID->mName, strlen(mID->mName) + 1); /*Flawfinder: ignore*/
2315 chunk->addBytes(mMessage->mName, strlen(mMessage->mName) + 1); 2315 chunk->addBytes(mMessage->mName, strlen(mMessage->mName) + 1); /*Flawfinder: ignore*/
2316#endif 2316#endif
2317 } 2317 }
2318 break; 2318 break;
@@ -2371,8 +2371,8 @@ void LLScriptSensorEvent::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIPTCompil
2371 { 2371 {
2372#ifdef LSL_INCLUDE_DEBUG_INFO 2372#ifdef LSL_INCLUDE_DEBUG_INFO
2373 char name[] = "sensor"; 2373 char name[] = "sensor";
2374 chunk->addBytes(name, strlen(name) + 1); 2374 chunk->addBytes(name, strlen(name) + 1); /*Flawfinder: ignore*/
2375 chunk->addBytes(mNumber->mName, strlen(mNumber->mName) + 1); 2375 chunk->addBytes(mNumber->mName, strlen(mNumber->mName) + 1); /*Flawfinder: ignore*/
2376#endif 2376#endif
2377 } 2377 }
2378 break; 2378 break;
@@ -2428,8 +2428,8 @@ void LLScriptObjectRezEvent::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIPTCom
2428 { 2428 {
2429#ifdef LSL_INCLUDE_DEBUG_INFO 2429#ifdef LSL_INCLUDE_DEBUG_INFO
2430 char name[] = "sensor"; 2430 char name[] = "sensor";
2431 chunk->addBytes(name, strlen(name) + 1); 2431 chunk->addBytes(name, strlen(name) + 1); /*Flawfinder: ignore*/
2432 chunk->addBytes(mID->mName, strlen(mID->mName) + 1); 2432 chunk->addBytes(mID->mName, strlen(mID->mName) + 1); /*Flawfinder: ignore*/
2433#endif 2433#endif
2434 } 2434 }
2435 break; 2435 break;
@@ -2511,10 +2511,10 @@ void LLScriptControlEvent::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIPTCompi
2511 { 2511 {
2512#ifdef LSL_INCLUDE_DEBUG_INFO 2512#ifdef LSL_INCLUDE_DEBUG_INFO
2513 char name[] = "control"; 2513 char name[] = "control";
2514 chunk->addBytes(name, strlen(name) + 1); 2514 chunk->addBytes(name, strlen(name) + 1); /*Flawfinder: ignore*/
2515 chunk->addBytes(mName->mName, strlen(mName->mName) + 1); 2515 chunk->addBytes(mName->mName, strlen(mName->mName) + 1); /*Flawfinder: ignore*/
2516 chunk->addBytes(mLevels->mName, strlen(mLevels->mName) + 1); 2516 chunk->addBytes(mLevels->mName, strlen(mLevels->mName) + 1); /*Flawfinder: ignore*/
2517 chunk->addBytes(mEdges->mName, strlen(mEdges->mName) + 1); 2517 chunk->addBytes(mEdges->mName, strlen(mEdges->mName) + 1); /*Flawfinder: ignore*/
2518#endif 2518#endif
2519 } 2519 }
2520 break; 2520 break;
@@ -2611,11 +2611,11 @@ void LLScriptLinkMessageEvent::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIPTC
2611 { 2611 {
2612#ifdef LSL_INCLUDE_DEBUG_INFO 2612#ifdef LSL_INCLUDE_DEBUG_INFO
2613 char name[] = "link_message"; 2613 char name[] = "link_message";
2614 chunk->addBytes(name, strlen(name) + 1); 2614 chunk->addBytes(name, strlen(name) + 1); /*Flawfinder: ignore*/
2615 chunk->addBytes(mSender->mName, strlen(mSender->mName) + 1); 2615 chunk->addBytes(mSender->mName, strlen(mSender->mName) + 1); /*Flawfinder: ignore*/
2616 chunk->addBytes(mNum->mName, strlen(mNum->mName) + 1); 2616 chunk->addBytes(mNum->mName, strlen(mNum->mName) + 1); /*Flawfinder: ignore*/
2617 chunk->addBytes(mStr->mName, strlen(mStr->mName) + 1); 2617 chunk->addBytes(mStr->mName, strlen(mStr->mName) + 1); /*Flawfinder: ignore*/
2618 chunk->addBytes(mID->mName, strlen(mID->mName) + 1); 2618 chunk->addBytes(mID->mName, strlen(mID->mName) + 1); /*Flawfinder: ignore*/
2619#endif 2619#endif
2620 } 2620 }
2621 break; 2621 break;
@@ -2739,13 +2739,13 @@ void LLScriptRemoteEvent::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIPTCompil
2739 { 2739 {
2740#ifdef LSL_INCLUDE_DEBUG_INFO 2740#ifdef LSL_INCLUDE_DEBUG_INFO
2741 char name[] = "remote_event"; 2741 char name[] = "remote_event";
2742 chunk->addBytes(name, strlen(name) + 1); 2742 chunk->addBytes(name, strlen(name) + 1); /*Flawfinder: ignore*/
2743 chunk->addBytes(mType->mName, strlen(mType->mName) + 1); 2743 chunk->addBytes(mType->mName, strlen(mType->mName) + 1); /*Flawfinder: ignore*/
2744 chunk->addBytes(mChannel->mName, strlen(mChannel->mName) + 1); 2744 chunk->addBytes(mChannel->mName, strlen(mChannel->mName) + 1); /*Flawfinder: ignore*/
2745 chunk->addBytes(mMessageID->mName, strlen(mMessageID->mName) + 1); 2745 chunk->addBytes(mMessageID->mName, strlen(mMessageID->mName) + 1); /*Flawfinder: ignore*/
2746 chunk->addBytes(mSender->mName, strlen(mSender->mName) + 1); 2746 chunk->addBytes(mSender->mName, strlen(mSender->mName) + 1); /*Flawfinder: ignore*/
2747 chunk->addBytes(mIntVal->mName, strlen(mIntVal->mName) + 1); 2747 chunk->addBytes(mIntVal->mName, strlen(mIntVal->mName) + 1); /*Flawfinder: ignore*/
2748 chunk->addBytes(mStrVal->mName, strlen(mStrVal->mName) + 1); 2748 chunk->addBytes(mStrVal->mName, strlen(mStrVal->mName) + 1); /*Flawfinder: ignore*/
2749#endif 2749#endif
2750 } 2750 }
2751 break; 2751 break;
@@ -2854,11 +2854,11 @@ void LLScriptHTTPResponseEvent::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIPT
2854 { 2854 {
2855#ifdef LSL_INCLUDE_DEBUG_INFO 2855#ifdef LSL_INCLUDE_DEBUG_INFO
2856 char name[] = "http_response"; 2856 char name[] = "http_response";
2857 chunk->addBytes(name, strlen(name) + 1); 2857 chunk->addBytes(name, strlen(name) + 1); /*Flawfinder: ignore*/
2858 chunk->addBytes(mRequestId->mName, strlen(mRequestId->mName) + 1); 2858 chunk->addBytes(mRequestId->mName, strlen(mRequestId->mName) + 1); /*Flawfinder: ignore*/
2859 chunk->addBytes(mStatus->mName, strlen(mStatus->mName) + 1); 2859 chunk->addBytes(mStatus->mName, strlen(mStatus->mName) + 1); /*Flawfinder: ignore*/
2860 chunk->addBytes(mMetadata->mName, strlen(mMetadata->mName) + 1); 2860 chunk->addBytes(mMetadata->mName, strlen(mMetadata->mName) + 1); /*Flawfinder: ignore*/
2861 chunk->addBytes(mBody->mName, strlen(mBody->mName) + 1); 2861 chunk->addBytes(mBody->mName, strlen(mBody->mName) + 1); /*Flawfinder: ignore*/
2862#endif 2862#endif
2863 } 2863 }
2864 break; 2864 break;
@@ -2932,9 +2932,9 @@ void LLScriptMoneyEvent::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIPTCompile
2932 { 2932 {
2933#ifdef LSL_INCLUDE_DEBUG_INFO 2933#ifdef LSL_INCLUDE_DEBUG_INFO
2934 char name[] = "money"; 2934 char name[] = "money";
2935 chunk->addBytes(name, strlen(name) + 1); 2935 chunk->addBytes(name, strlen(name) + 1); /*Flawfinder: ignore*/
2936 chunk->addBytes(mName->mName, strlen(mName->mName) + 1); 2936 chunk->addBytes(mName->mName, strlen(mName->mName) + 1); /*Flawfinder: ignore*/
2937 chunk->addBytes(mAmount->mName, strlen(mAmount->mName) + 1); 2937 chunk->addBytes(mAmount->mName, strlen(mAmount->mName) + 1); /*Flawfinder: ignore*/
2938#endif 2938#endif
2939 } 2939 }
2940 break; 2940 break;
@@ -3043,12 +3043,12 @@ void LLScriptEmailEvent::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIPTCompile
3043 { 3043 {
3044#ifdef LSL_INCLUDE_DEBUG_INFO 3044#ifdef LSL_INCLUDE_DEBUG_INFO
3045 char name[] = "email"; 3045 char name[] = "email";
3046 chunk->addBytes(name, strlen(name) + 1); 3046 chunk->addBytes(name, strlen(name) + 1); /*Flawfinder: ignore*/
3047 chunk->addBytes(mTime->mName, strlen(mTime->mName) + 1); 3047 chunk->addBytes(mTime->mName, strlen(mTime->mName) + 1); /*Flawfinder: ignore*/
3048 chunk->addBytes(mAddress->mName, strlen(mAddress->mName) + 1); 3048 chunk->addBytes(mAddress->mName, strlen(mAddress->mName) + 1); /*Flawfinder: ignore*/
3049 chunk->addBytes(mSubject->mName, strlen(mSubject->mName) + 1); 3049 chunk->addBytes(mSubject->mName, strlen(mSubject->mName) + 1); /*Flawfinder: ignore*/
3050 chunk->addBytes(mBody->mName, strlen(mBody->mName) + 1); 3050 chunk->addBytes(mBody->mName, strlen(mBody->mName) + 1); /*Flawfinder: ignore*/
3051 chunk->addBytes(mNumber->mName, strlen(mNumber->mName) + 1); 3051 chunk->addBytes(mNumber->mName, strlen(mNumber->mName) + 1); /*Flawfinder: ignore*/
3052#endif 3052#endif
3053 } 3053 }
3054 break; 3054 break;
@@ -3108,8 +3108,8 @@ void LLScriptRezEvent::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIPTCompilePa
3108 { 3108 {
3109#ifdef LSL_INCLUDE_DEBUG_INFO 3109#ifdef LSL_INCLUDE_DEBUG_INFO
3110 char name[] = "rez"; 3110 char name[] = "rez";
3111 chunk->addBytes(name, strlen(name) + 1); 3111 chunk->addBytes(name, strlen(name) + 1); /*Flawfinder: ignore*/
3112 chunk->addBytes(mStartParam->mName, strlen(mStartParam->mName) + 1); 3112 chunk->addBytes(mStartParam->mName, strlen(mStartParam->mName) + 1); /*Flawfinder: ignore*/
3113#endif 3113#endif
3114 } 3114 }
3115 break; 3115 break;
@@ -3144,7 +3144,7 @@ void LLScriptNoSensorEvent::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIPTComp
3144 { 3144 {
3145#ifdef LSL_INCLUDE_DEBUG_INFO 3145#ifdef LSL_INCLUDE_DEBUG_INFO
3146 char name[] = "no_sensor"; 3146 char name[] = "no_sensor";
3147 chunk->addBytes(name, strlen(name) + 1); 3147 chunk->addBytes(name, strlen(name) + 1); /*Flawfinder: ignore*/
3148#endif 3148#endif
3149 } 3149 }
3150 break; 3150 break;
@@ -3223,11 +3223,11 @@ void LLScriptAtTarget::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIPTCompilePa
3223 case LSCP_EMIT_BYTE_CODE: 3223 case LSCP_EMIT_BYTE_CODE:
3224 { 3224 {
3225#ifdef LSL_INCLUDE_DEBUG_INFO 3225#ifdef LSL_INCLUDE_DEBUG_INFO
3226 char name[] = "at_target"; 3226 char name[] = "at_target"; /*Flawfinder: ignore*/
3227 chunk->addBytes(name, strlen(name) + 1); 3227 chunk->addBytes(name, strlen(name) + 1); /*Flawfinder: ignore*/
3228 chunk->addBytes(mTargetNumber->mName, strlen(mTargetNumber->mName) + 1); 3228 chunk->addBytes(mTargetNumber->mName, strlen(mTargetNumber->mName) + 1); /*Flawfinder: ignore*/
3229 chunk->addBytes(mTargetPosition->mName, strlen(mTargetPosition->mName) + 1); 3229 chunk->addBytes(mTargetPosition->mName, strlen(mTargetPosition->mName) + 1); /*Flawfinder: ignore*/
3230 chunk->addBytes(mOurPosition->mName, strlen(mOurPosition->mName) + 1); 3230 chunk->addBytes(mOurPosition->mName, strlen(mOurPosition->mName) + 1); /*Flawfinder: ignore*/
3231#endif 3231#endif
3232 } 3232 }
3233 break; 3233 break;
@@ -3265,8 +3265,8 @@ void LLScriptNotAtTarget::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIPTCompil
3265 case LSCP_EMIT_BYTE_CODE: 3265 case LSCP_EMIT_BYTE_CODE:
3266 { 3266 {
3267#ifdef LSL_INCLUDE_DEBUG_INFO 3267#ifdef LSL_INCLUDE_DEBUG_INFO
3268 char name[] = "not_at_target"; 3268 char name[] = "not_at_target"; /*Flawfinder: ignore*/
3269 chunk->addBytes(name, strlen(name) + 1); 3269 chunk->addBytes(name, strlen(name) + 1); /*Flawfinder: ignore*/
3270#endif 3270#endif
3271 } 3271 }
3272 break; 3272 break;
@@ -3346,10 +3346,10 @@ void LLScriptAtRotTarget::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIPTCompil
3346 { 3346 {
3347#ifdef LSL_INCLUDE_DEBUG_INFO 3347#ifdef LSL_INCLUDE_DEBUG_INFO
3348 char name[] = "at_rot_target"; 3348 char name[] = "at_rot_target";
3349 chunk->addBytes(name, strlen(name) + 1); 3349 chunk->addBytes(name, strlen(name) + 1); /*Flawfinder: ignore*/
3350 chunk->addBytes(mTargetNumber->mName, strlen(mTargetNumber->mName) + 1); 3350 chunk->addBytes(mTargetNumber->mName, strlen(mTargetNumber->mName) + 1); /*Flawfinder: ignore*/
3351 chunk->addBytes(mTargetRotation->mName, strlen(mTargetRotation->mName) + 1); 3351 chunk->addBytes(mTargetRotation->mName, strlen(mTargetRotation->mName) + 1); /*Flawfinder: ignore*/
3352 chunk->addBytes(mOurRotation->mName, strlen(mOurRotation->mName) + 1); 3352 chunk->addBytes(mOurRotation->mName, strlen(mOurRotation->mName) + 1); /*Flawfinder: ignore*/
3353#endif 3353#endif
3354 } 3354 }
3355 break; 3355 break;
@@ -3388,7 +3388,7 @@ void LLScriptNotAtRotTarget::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIPTCom
3388 { 3388 {
3389#ifdef LSL_INCLUDE_DEBUG_INFO 3389#ifdef LSL_INCLUDE_DEBUG_INFO
3390 char name[] = "not_at_rot_target"; 3390 char name[] = "not_at_rot_target";
3391 chunk->addBytes(name, strlen(name) + 1); 3391 chunk->addBytes(name, strlen(name) + 1); /*Flawfinder: ignore*/
3392#endif 3392#endif
3393 } 3393 }
3394 break; 3394 break;
@@ -7143,7 +7143,7 @@ void LLScriptFunctionCall::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIPTCompi
7143 gErrorToText.writeError(fp, this, LSERROR_FUNCTION_TYPE_ERROR); 7143 gErrorToText.writeError(fp, this, LSERROR_FUNCTION_TYPE_ERROR);
7144 } 7144 }
7145 } 7145 }
7146 else if (argcount != strlen(mIdentifier->mScopeEntry->mFunctionArgs.mString)) 7146 else if (argcount != strlen(mIdentifier->mScopeEntry->mFunctionArgs.mString)) /*Flawfinder: ignore*/
7147 { 7147 {
7148 gErrorToText.writeError(fp, this, LSERROR_FUNCTION_TYPE_ERROR); 7148 gErrorToText.writeError(fp, this, LSERROR_FUNCTION_TYPE_ERROR);
7149 } 7149 }
@@ -7459,7 +7459,7 @@ void add_exit_pops(LLScriptByteCodeChunk *chunk, LLScriptScopeEntry *entry)
7459 7459
7460 if (entry->mLocals.mString) 7460 if (entry->mLocals.mString)
7461 { 7461 {
7462 number = (S32)strlen(entry->mLocals.mString); 7462 number = (S32)strlen(entry->mLocals.mString); /*Flawfinder: ignore*/
7463 for (i = number - 1; i >= 0; i--) 7463 for (i = number - 1; i >= 0; i--)
7464 { 7464 {
7465 switch(entry->mLocals.getType(i)) 7465 switch(entry->mLocals.getType(i))
@@ -7492,7 +7492,7 @@ void add_exit_pops(LLScriptByteCodeChunk *chunk, LLScriptScopeEntry *entry)
7492 7492
7493 if (entry->mFunctionArgs.mString) 7493 if (entry->mFunctionArgs.mString)
7494 { 7494 {
7495 number = (S32)strlen(entry->mFunctionArgs.mString); 7495 number = (S32)strlen(entry->mFunctionArgs.mString); /*Flawfinder: ignore*/
7496 for (i = number - 1; i >= 0; i--) 7496 for (i = number - 1; i >= 0; i--)
7497 { 7497 {
7498 switch(entry->mFunctionArgs.getType(i)) 7498 switch(entry->mFunctionArgs.getType(i))
@@ -7531,7 +7531,7 @@ void print_exit_pops(FILE *fp, LLScriptScopeEntry *entry)
7531 7531
7532 if (entry->mLocals.mString) 7532 if (entry->mLocals.mString)
7533 { 7533 {
7534 number = (S32)strlen(entry->mLocals.mString); 7534 number = (S32)strlen(entry->mLocals.mString); /*Flawfinder: ignore*/
7535 for (i = number - 1; i >= 0; i--) 7535 for (i = number - 1; i >= 0; i--)
7536 { 7536 {
7537 fprintf(fp, "%s", LSCRIPTTypePop[entry->mLocals.getType(i)]); 7537 fprintf(fp, "%s", LSCRIPTTypePop[entry->mLocals.getType(i)]);
@@ -7540,7 +7540,7 @@ void print_exit_pops(FILE *fp, LLScriptScopeEntry *entry)
7540 7540
7541 if (entry->mFunctionArgs.mString) 7541 if (entry->mFunctionArgs.mString)
7542 { 7542 {
7543 number = (S32)strlen(entry->mFunctionArgs.mString); 7543 number = (S32)strlen(entry->mFunctionArgs.mString); /*Flawfinder: ignore*/
7544 for (i = number - 1; i >= 0; i--) 7544 for (i = number - 1; i >= 0; i--)
7545 { 7545 {
7546 fprintf(fp, "%s", LSCRIPTTypePop[entry->mFunctionArgs.getType(i)]); 7546 fprintf(fp, "%s", LSCRIPTTypePop[entry->mFunctionArgs.getType(i)]);
@@ -7985,8 +7985,8 @@ void LLScriptIf::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIPTCompilePass pas
7985 break; 7985 break;
7986 case LSCP_EMIT_BYTE_CODE: 7986 case LSCP_EMIT_BYTE_CODE:
7987 { 7987 {
7988 char jumpname[32]; 7988 char jumpname[32]; /*Flawfinder: ignore*/
7989 sprintf(jumpname, "##Temp Jump %d##", gTempJumpCount++); 7989 snprintf(jumpname, sizeof(jumpname),"##Temp Jump %d##", gTempJumpCount++); /*Flawfinder: ignore*/
7990 7990
7991 mExpression->recurse(fp, tabs, tabsize, LSCP_TO_STACK, ptype, prunearg, scope, type, basetype, count, chunk, heap, stacksize, entry, entrycount, NULL); 7991 mExpression->recurse(fp, tabs, tabsize, LSCP_TO_STACK, ptype, prunearg, scope, type, basetype, count, chunk, heap, stacksize, entry, entrycount, NULL);
7992 chunk->addByte(LSCRIPTOpCodes[LOPC_JUMPNIF]); 7992 chunk->addByte(LSCRIPTOpCodes[LOPC_JUMPNIF]);
@@ -8066,10 +8066,10 @@ void LLScriptIfElse::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIPTCompilePass
8066 break; 8066 break;
8067 case LSCP_EMIT_BYTE_CODE: 8067 case LSCP_EMIT_BYTE_CODE:
8068 { 8068 {
8069 char jumpname1[32]; 8069 char jumpname1[32]; /*Flawfinder: ignore*/
8070 sprintf(jumpname1, "##Temp Jump %d##", gTempJumpCount++); 8070 snprintf(jumpname1, sizeof(jumpname1), "##Temp Jump %d##", gTempJumpCount++); /*Flawfinder: ignore*/
8071 char jumpname2[32]; 8071 char jumpname2[32]; /*Flawfinder: ignore*/
8072 sprintf(jumpname2, "##Temp Jump %d##", gTempJumpCount++); 8072 snprintf(jumpname2, sizeof(jumpname2), "##Temp Jump %d##", gTempJumpCount++); /*Flawfinder: ignore*/
8073 8073
8074 mExpression->recurse(fp, tabs, tabsize, LSCP_TO_STACK, ptype, prunearg, scope, type, basetype, count, chunk, heap, stacksize, entry, entrycount, NULL); 8074 mExpression->recurse(fp, tabs, tabsize, LSCP_TO_STACK, ptype, prunearg, scope, type, basetype, count, chunk, heap, stacksize, entry, entrycount, NULL);
8075 chunk->addByte(LSCRIPTOpCodes[LOPC_JUMPNIF]); 8075 chunk->addByte(LSCRIPTOpCodes[LOPC_JUMPNIF]);
@@ -8169,10 +8169,10 @@ void LLScriptFor::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIPTCompilePass pa
8169 break; 8169 break;
8170 case LSCP_EMIT_BYTE_CODE: 8170 case LSCP_EMIT_BYTE_CODE:
8171 { 8171 {
8172 char jumpname1[32]; 8172 char jumpname1[32]; /*Flawfinder: ignore*/
8173 sprintf(jumpname1, "##Temp Jump %d##", gTempJumpCount++); 8173 snprintf(jumpname1, sizeof(jumpname1), "##Temp Jump %d##", gTempJumpCount++); /*Flawfinder: ignore*/
8174 char jumpname2[32]; 8174 char jumpname2[32]; /*Flawfinder: ignore*/
8175 sprintf(jumpname2, "##Temp Jump %d##", gTempJumpCount++); 8175 snprintf(jumpname2, sizeof(jumpname2), "##Temp Jump %d##", gTempJumpCount++); /*Flawfinder: ignore*/
8176 8176
8177 if(mSequence) 8177 if(mSequence)
8178 mSequence->recurse(fp, tabs, tabsize, LSCP_TO_STACK, ptype, prunearg, scope, type, basetype, count, chunk, heap, stacksize, entry, entrycount, NULL); 8178 mSequence->recurse(fp, tabs, tabsize, LSCP_TO_STACK, ptype, prunearg, scope, type, basetype, count, chunk, heap, stacksize, entry, entrycount, NULL);
@@ -8266,8 +8266,8 @@ void LLScriptDoWhile::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIPTCompilePas
8266 break; 8266 break;
8267 case LSCP_EMIT_BYTE_CODE: 8267 case LSCP_EMIT_BYTE_CODE:
8268 { 8268 {
8269 char jumpname1[32]; 8269 char jumpname1[32]; /*Flawfinder: ignore*/
8270 sprintf(jumpname1, "##Temp Jump %d##", gTempJumpCount++); 8270 snprintf(jumpname1, sizeof(jumpname1), "##Temp Jump %d##", gTempJumpCount++); /*Flawfinder: ignore*/
8271 8271
8272 chunk->addLabel(jumpname1); 8272 chunk->addLabel(jumpname1);
8273 mStatement->recurse(fp, tabs, tabsize, pass, ptype, prunearg, scope, type, basetype, count, chunk, heap, stacksize, entry, entrycount, NULL); 8273 mStatement->recurse(fp, tabs, tabsize, pass, ptype, prunearg, scope, type, basetype, count, chunk, heap, stacksize, entry, entrycount, NULL);
@@ -8340,10 +8340,10 @@ void LLScriptWhile::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIPTCompilePass
8340 break; 8340 break;
8341 case LSCP_EMIT_BYTE_CODE: 8341 case LSCP_EMIT_BYTE_CODE:
8342 { 8342 {
8343 char jumpname1[32]; 8343 char jumpname1[32]; /*Flawfinder: ignore*/
8344 sprintf(jumpname1, "##Temp Jump %d##", gTempJumpCount++); 8344 snprintf(jumpname1, sizeof(jumpname1), "##Temp Jump %d##", gTempJumpCount++); /*Flawfinder: ignore*/
8345 char jumpname2[32]; 8345 char jumpname2[32]; /*Flawfinder: ignore*/
8346 sprintf(jumpname2, "##Temp Jump %d##", gTempJumpCount++); 8346 snprintf(jumpname2, sizeof(jumpname2), "##Temp Jump %d##", gTempJumpCount++); /*Flawfinder: ignore*/
8347 8347
8348 chunk->addLabel(jumpname1); 8348 chunk->addLabel(jumpname1);
8349 mExpression->recurse(fp, tabs, tabsize, LSCP_TO_STACK, ptype, prunearg, scope, type, basetype, count, chunk, heap, stacksize, entry, entrycount, NULL); 8349 mExpression->recurse(fp, tabs, tabsize, LSCP_TO_STACK, ptype, prunearg, scope, type, basetype, count, chunk, heap, stacksize, entry, entrycount, NULL);
@@ -9018,7 +9018,7 @@ void LLScriptEventHandler::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIPTCompi
9018 fprintf(fp, ".method public hidebysig instance default void "); 9018 fprintf(fp, ".method public hidebysig instance default void ");
9019 9019
9020 // Mangle event handler name by prefixing it with state name. Allows state changing by finding handlers prefixed with new state name. 9020 // Mangle event handler name by prefixing it with state name. Allows state changing by finding handlers prefixed with new state name.
9021 fprintf(fp, entry->mIdentifier); 9021 fprintf(fp, entry->mIdentifier); /*Flawfinder: ignore*/
9022 9022
9023 // Handler name and arguments. 9023 // Handler name and arguments.
9024 mEventp->recurse(fp, tabs, tabsize, pass, ptype, prunearg, scope, type, basetype, count, chunk, heap, stacksize, entry, entrycount, NULL); 9024 mEventp->recurse(fp, tabs, tabsize, pass, ptype, prunearg, scope, type, basetype, count, chunk, heap, stacksize, entry, entrycount, NULL);
@@ -9154,7 +9154,7 @@ void LLScriptFunctionDec::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIPTCompil
9154 chunk->addBytes(&typereturn, 1); 9154 chunk->addBytes(&typereturn, 1);
9155 // name 9155 // name
9156#ifdef LSL_INCLUDE_DEBUG_INFO 9156#ifdef LSL_INCLUDE_DEBUG_INFO
9157 chunk->addBytes(mIdentifier->mName, strlen(mIdentifier->mName) + 1); 9157 chunk->addBytes(mIdentifier->mName, strlen(mIdentifier->mName) + 1); /*Flawfinder: ignore*/
9158#else 9158#else
9159 chunk->addBytes(1); 9159 chunk->addBytes(1);
9160#endif 9160#endif
@@ -9391,7 +9391,7 @@ void LLScriptGlobalFunctions::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIPTCo
9391 9391
9392 // null terminated function name 9392 // null terminated function name
9393#ifdef LSL_INCLUDE_DEBUG_INFO 9393#ifdef LSL_INCLUDE_DEBUG_INFO
9394 chunk->addBytes(mIdentifier->mName, strlen(mIdentifier->mName) + 1); 9394 chunk->addBytes(mIdentifier->mName, strlen(mIdentifier->mName) + 1); /*Flawfinder: ignore*/
9395#else 9395#else
9396 chunk->addBytes(1); 9396 chunk->addBytes(1);
9397#endif 9397#endif
@@ -9642,7 +9642,7 @@ void LLScriptState::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIPTCompilePass
9642 9642
9643 // null terminated state name 9643 // null terminated state name
9644#ifdef LSL_INCLUDE_DEBUG_INFO 9644#ifdef LSL_INCLUDE_DEBUG_INFO
9645 chunk->addBytes(mIdentifier->mName, strlen(mIdentifier->mName) + 1); 9645 chunk->addBytes(mIdentifier->mName, strlen(mIdentifier->mName) + 1); /*Flawfinder: ignore*/
9646#else 9646#else
9647 chunk->addBytes(1); 9647 chunk->addBytes(1);
9648#endif 9648#endif
@@ -9697,8 +9697,8 @@ LLScriptScript::LLScriptScript(LLScritpGlobalStorage *globals,
9697 mStates(states), mGlobalScope(NULL), mGlobals(NULL), mGlobalFunctions(NULL), mGodLike(FALSE) 9697 mStates(states), mGlobalScope(NULL), mGlobals(NULL), mGlobalFunctions(NULL), mGodLike(FALSE)
9698{ 9698{
9699 const char DEFAULT_BYTECODE_FILENAME[] = "lscript.lso"; 9699 const char DEFAULT_BYTECODE_FILENAME[] = "lscript.lso";
9700 strcpy(mBytecodeDest, DEFAULT_BYTECODE_FILENAME); 9700 strncpy(mBytecodeDest, DEFAULT_BYTECODE_FILENAME, sizeof(mBytecodeDest) -1); /*Flawfinder: ignore*/
9701 9701 mBytecodeDest[MAX_STRING-1] = '\0';
9702 LLScriptGlobalVariable *tvar; 9702 LLScriptGlobalVariable *tvar;
9703 LLScriptGlobalFunctions *tfunc; 9703 LLScriptGlobalFunctions *tfunc;
9704 LLScritpGlobalStorage *temp; 9704 LLScritpGlobalStorage *temp;
@@ -9744,7 +9744,7 @@ LLScriptScript::LLScriptScript(LLScritpGlobalStorage *globals,
9744 9744
9745void LLScriptScript::setBytecodeDest(const char* dst_filename) 9745void LLScriptScript::setBytecodeDest(const char* dst_filename)
9746{ 9746{
9747 strncpy(mBytecodeDest, dst_filename, MAX_STRING); 9747 strncpy(mBytecodeDest, dst_filename, MAX_STRING); /*Flawfinder: ignore*/
9748 mBytecodeDest[MAX_STRING-1] = '\0'; 9748 mBytecodeDest[MAX_STRING-1] = '\0';
9749} 9749}
9750 9750
@@ -9753,7 +9753,7 @@ void print_cil_globals(FILE* fp, LLScriptGlobalVariable* global)
9753 fprintf(fp, ".field private "); 9753 fprintf(fp, ".field private ");
9754 print_cil_type(fp, global->mType->mType); 9754 print_cil_type(fp, global->mType->mType);
9755 fprintf(fp, " "); 9755 fprintf(fp, " ");
9756 fprintf(fp, global->mIdentifier->mName); 9756 fprintf(fp, global->mIdentifier->mName); /*Flawfinder: ignore*/
9757 fprintf(fp, "\n"); 9757 fprintf(fp, "\n");
9758 if(NULL != global->mNextp) 9758 if(NULL != global->mNextp)
9759 { 9759 {
@@ -9932,7 +9932,7 @@ void LLScriptScript::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIPTCompilePass
9932 9932
9933 // now, put it all together and spit it out 9933 // now, put it all together and spit it out
9934 // we need 9934 // we need
9935 FILE *bcfp = LLFile::fopen(mBytecodeDest, "wb"); 9935 FILE* bcfp = LLFile::fopen(mBytecodeDest, "wb"); /*Flawfinder: ignore*/
9936 9936
9937 code->build(fp, bcfp); 9937 code->build(fp, bcfp);
9938 fclose(bcfp); 9938 fclose(bcfp);
diff --git a/linden/indra/lscript/lscript_compile/lscript_tree.h b/linden/indra/lscript/lscript_compile/lscript_tree.h
index a535e76..11be92d 100644
--- a/linden/indra/lscript/lscript_compile/lscript_tree.h
+++ b/linden/indra/lscript/lscript_compile/lscript_tree.h
@@ -2267,7 +2267,7 @@ public:
2267 BOOL mGodLike; 2267 BOOL mGodLike;
2268 2268
2269private: 2269private:
2270 char mBytecodeDest[MAX_STRING]; 2270 char mBytecodeDest[MAX_STRING]; /*Flawfinder: ignore*/
2271}; 2271};
2272 2272
2273class LLScriptAllocationManager 2273class LLScriptAllocationManager
diff --git a/linden/indra/lscript/lscript_execute/lscript_execute.cpp b/linden/indra/lscript/lscript_execute/lscript_execute.cpp
index a81d706..b5d395e 100644
--- a/linden/indra/lscript/lscript_execute/lscript_execute.cpp
+++ b/linden/indra/lscript/lscript_execute/lscript_execute.cpp
@@ -39,7 +39,7 @@
39void (*binary_operations[LST_EOF][LST_EOF])(U8 *buffer, LSCRIPTOpCodesEnum opcode); 39void (*binary_operations[LST_EOF][LST_EOF])(U8 *buffer, LSCRIPTOpCodesEnum opcode);
40void (*unary_operations[LST_EOF])(U8 *buffer, LSCRIPTOpCodesEnum opcode); 40void (*unary_operations[LST_EOF])(U8 *buffer, LSCRIPTOpCodesEnum opcode);
41 41
42char *LSCRIPTRunTimeFaultStrings[LSRF_EOF] = 42char* LSCRIPTRunTimeFaultStrings[LSRF_EOF] = /*Flawfinder: ignore*/
43{ 43{
44 "invalid", // LSRF_INVALID, 44 "invalid", // LSRF_INVALID,
45 "Math Error", // LSRF_MATH, 45 "Math Error", // LSRF_MATH,
@@ -2596,6 +2596,7 @@ BOOL run_jump(U8 *buffer, S32 &offset, BOOL b_print, const LLUUID &id)
2596 offset += arg; 2596 offset += arg;
2597 return FALSE; 2597 return FALSE;
2598} 2598}
2599
2599BOOL run_jumpif(U8 *buffer, S32 &offset, BOOL b_print, const LLUUID &id) 2600BOOL run_jumpif(U8 *buffer, S32 &offset, BOOL b_print, const LLUUID &id)
2600{ 2601{
2601 if (b_print) 2602 if (b_print)
@@ -2648,8 +2649,10 @@ BOOL run_jumpif(U8 *buffer, S32 &offset, BOOL b_print, const LLUUID &id)
2648 else if (type == LST_STRING) 2649 else if (type == LST_STRING)
2649 { 2650 {
2650 S32 base_address = lscript_pop_int(buffer); 2651 S32 base_address = lscript_pop_int(buffer);
2651 // this bit of nastiness is to get around that code paths to local variables can result in lack of initialization 2652 // this bit of nastiness is to get around that code paths to
2652 // and function clean up of ref counts isn't based on scope (a mistake, I know) 2653 // local variables can result in lack of initialization and
2654 // function clean up of ref counts isn't based on scope (a
2655 // mistake, I know)
2653 S32 address = base_address + get_register(buffer, LREG_HR) - 1; 2656 S32 address = base_address + get_register(buffer, LREG_HR) - 1;
2654 if (address) 2657 if (address)
2655 { 2658 {
@@ -2662,7 +2665,7 @@ BOOL run_jumpif(U8 *buffer, S32 &offset, BOOL b_print, const LLUUID &id)
2662 S32 size = toffset - string; 2665 S32 size = toffset - string;
2663 char *sdata = new char[size]; 2666 char *sdata = new char[size];
2664 bytestream2char(sdata, buffer, string); 2667 bytestream2char(sdata, buffer, string);
2665 if (strlen(sdata)) 2668 if (strlen(sdata)) /*Flawfinder: ignore*/
2666 { 2669 {
2667 offset += arg; 2670 offset += arg;
2668 } 2671 }
@@ -2674,8 +2677,10 @@ BOOL run_jumpif(U8 *buffer, S32 &offset, BOOL b_print, const LLUUID &id)
2674 else if (type == LST_KEY) 2677 else if (type == LST_KEY)
2675 { 2678 {
2676 S32 base_address = lscript_pop_int(buffer); 2679 S32 base_address = lscript_pop_int(buffer);
2677 // this bit of nastiness is to get around that code paths to local variables can result in lack of initialization 2680 // this bit of nastiness is to get around that code paths to
2678 // and function clean up of ref counts isn't based on scope (a mistake, I know) 2681 // local variables can result in lack of initialization and
2682 // function clean up of ref counts isn't based on scope (a
2683 // mistake, I know)
2679 S32 address = base_address + get_register(buffer, LREG_HR) - 1; 2684 S32 address = base_address + get_register(buffer, LREG_HR) - 1;
2680 if (address) 2685 if (address)
2681 { 2686 {
@@ -2688,29 +2693,37 @@ BOOL run_jumpif(U8 *buffer, S32 &offset, BOOL b_print, const LLUUID &id)
2688 S32 size = toffset - string; 2693 S32 size = toffset - string;
2689 char *sdata = new char[size]; 2694 char *sdata = new char[size];
2690 bytestream2char(sdata, buffer, string); 2695 bytestream2char(sdata, buffer, string);
2691 if (strlen(sdata)) 2696 if (strlen(sdata)) /*Flawfinder: ignore*/
2692 { 2697 {
2693 LLUUID id; 2698 LLUUID id;
2694 id.set(sdata); 2699 if (id.set(sdata) && id.notNull())
2695 if (id != LLUUID::null)
2696 offset += arg; 2700 offset += arg;
2697 } 2701 }
2698 delete [] sdata; 2702 delete [] sdata;
2699 } 2703 }
2700 lsa_decrease_ref_count(buffer, base_address); 2704 lsa_decrease_ref_count(buffer, base_address);
2701 } 2705 }
2702 else if (type == LST_LIST) 2706 }
2707 else if (type == LST_LIST)
2708 {
2709 S32 base_address = lscript_pop_int(buffer);
2710 S32 address = base_address + get_register(buffer, LREG_HR) - 1;
2711 if (address)
2703 { 2712 {
2704 S32 address = lscript_pop_int(buffer); 2713 if (safe_heap_check_address(buffer, address + SIZEOF_SCRIPT_ALLOC_ENTRY, 1))
2705 LLScriptLibData *list = lsa_get_data(buffer, address, TRUE);
2706 if (list->getListLength())
2707 { 2714 {
2708 offset += arg; 2715 LLScriptLibData *list = lsa_get_list_ptr(buffer, base_address, TRUE);
2716 if (list && list->getListLength())
2717 {
2718 offset += arg;
2719 }
2720 delete list;
2709 } 2721 }
2710 } 2722 }
2711 } 2723 }
2712 return FALSE; 2724 return FALSE;
2713} 2725}
2726
2714BOOL run_jumpnif(U8 *buffer, S32 &offset, BOOL b_print, const LLUUID &id) 2727BOOL run_jumpnif(U8 *buffer, S32 &offset, BOOL b_print, const LLUUID &id)
2715{ 2728{
2716 if (b_print) 2729 if (b_print)
@@ -2763,8 +2776,10 @@ BOOL run_jumpnif(U8 *buffer, S32 &offset, BOOL b_print, const LLUUID &id)
2763 else if (type == LST_STRING) 2776 else if (type == LST_STRING)
2764 { 2777 {
2765 S32 base_address = lscript_pop_int(buffer); 2778 S32 base_address = lscript_pop_int(buffer);
2766 // this bit of nastiness is to get around that code paths to local variables can result in lack of initialization 2779 // this bit of nastiness is to get around that code paths to
2767 // and function clean up of ref counts isn't based on scope (a mistake, I know) 2780 // local variables can result in lack of initialization and
2781 // function clean up of ref counts isn't based on scope (a
2782 // mistake, I know)
2768 S32 address = base_address + get_register(buffer, LREG_HR) - 1; 2783 S32 address = base_address + get_register(buffer, LREG_HR) - 1;
2769 if (address) 2784 if (address)
2770 { 2785 {
@@ -2777,7 +2792,7 @@ BOOL run_jumpnif(U8 *buffer, S32 &offset, BOOL b_print, const LLUUID &id)
2777 S32 size = toffset - string; 2792 S32 size = toffset - string;
2778 char *sdata = new char[size]; 2793 char *sdata = new char[size];
2779 bytestream2char(sdata, buffer, string); 2794 bytestream2char(sdata, buffer, string);
2780 if (!strlen(sdata)) 2795 if (!strlen(sdata)) /*Flawfinder: ignore*/
2781 { 2796 {
2782 offset += arg; 2797 offset += arg;
2783 } 2798 }
@@ -2789,8 +2804,10 @@ BOOL run_jumpnif(U8 *buffer, S32 &offset, BOOL b_print, const LLUUID &id)
2789 else if (type == LST_KEY) 2804 else if (type == LST_KEY)
2790 { 2805 {
2791 S32 base_address = lscript_pop_int(buffer); 2806 S32 base_address = lscript_pop_int(buffer);
2792 // this bit of nastiness is to get around that code paths to local variables can result in lack of initialization 2807 // this bit of nastiness is to get around that code paths to
2793 // and function clean up of ref counts isn't based on scope (a mistake, I know) 2808 // local variables can result in lack of initialization and
2809 // function clean up of ref counts isn't based on scope (a
2810 // mistake, I know)
2794 S32 address = base_address + get_register(buffer, LREG_HR) - 1; 2811 S32 address = base_address + get_register(buffer, LREG_HR) - 1;
2795 if (address) 2812 if (address)
2796 { 2813 {
@@ -2803,11 +2820,10 @@ BOOL run_jumpnif(U8 *buffer, S32 &offset, BOOL b_print, const LLUUID &id)
2803 S32 size = toffset - string; 2820 S32 size = toffset - string;
2804 char *sdata = new char[size]; 2821 char *sdata = new char[size];
2805 bytestream2char(sdata, buffer, string); 2822 bytestream2char(sdata, buffer, string);
2806 if (strlen(sdata)) 2823 if (strlen(sdata)) /*Flawfinder: ignore*/
2807 { 2824 {
2808 LLUUID id; 2825 LLUUID id;
2809 id.set(sdata); 2826 if (!id.set(sdata) || id.isNull())
2810 if (id == LLUUID::null)
2811 offset += arg; 2827 offset += arg;
2812 } 2828 }
2813 else 2829 else
@@ -2818,13 +2834,25 @@ BOOL run_jumpnif(U8 *buffer, S32 &offset, BOOL b_print, const LLUUID &id)
2818 } 2834 }
2819 lsa_decrease_ref_count(buffer, base_address); 2835 lsa_decrease_ref_count(buffer, base_address);
2820 } 2836 }
2821 else if (type == LST_LIST) 2837 }
2838 else if (type == LST_LIST)
2839 {
2840 S32 base_address = lscript_pop_int(buffer);
2841 // this bit of nastiness is to get around that code paths to
2842 // local variables can result in lack of initialization and
2843 // function clean up of ref counts isn't based on scope (a
2844 // mistake, I know)
2845 S32 address = base_address + get_register(buffer, LREG_HR) - 1;
2846 if (address)
2822 { 2847 {
2823 S32 address = lscript_pop_int(buffer); 2848 if (safe_heap_check_address(buffer, address + SIZEOF_SCRIPT_ALLOC_ENTRY, 1))
2824 LLScriptLibData *list = lsa_get_data(buffer, address, TRUE);
2825 if (!list->getListLength())
2826 { 2849 {
2827 offset += arg; 2850 LLScriptLibData *list = lsa_get_list_ptr(buffer, base_address, TRUE);
2851 if (!list || !list->getListLength())
2852 {
2853 offset += arg;
2854 }
2855 delete list;
2828 } 2856 }
2829 } 2857 }
2830 } 2858 }
@@ -2954,7 +2982,7 @@ S32 axtoi(char *hexStg)
2954 2982
2955BOOL run_cast(U8 *buffer, S32 &offset, BOOL b_print, const LLUUID &id) 2983BOOL run_cast(U8 *buffer, S32 &offset, BOOL b_print, const LLUUID &id)
2956{ 2984{
2957 char caststr[1024]; 2985 char caststr[1024]; /*Flawfinder: ignore*/
2958 if (b_print) 2986 if (b_print)
2959 printf("[0x%X]\tCAST ", offset); 2987 printf("[0x%X]\tCAST ", offset);
2960 offset++; 2988 offset++;
@@ -2987,7 +3015,7 @@ BOOL run_cast(U8 *buffer, S32 &offset, BOOL b_print, const LLUUID &id)
2987 case LST_STRING: 3015 case LST_STRING:
2988 { 3016 {
2989 S32 address, source = lscript_pop_int(buffer); 3017 S32 address, source = lscript_pop_int(buffer);
2990 sprintf(caststr, "%d", source); 3018 snprintf(caststr, sizeof(caststr), "%d", source); /*Flawfinder: ignore*/
2991 address = lsa_heap_add_data(buffer, new LLScriptLibData(caststr), get_max_heap_size(buffer), TRUE); 3019 address = lsa_heap_add_data(buffer, new LLScriptLibData(caststr), get_max_heap_size(buffer), TRUE);
2992 lscript_push(buffer, address); 3020 lscript_push(buffer, address);
2993 } 3021 }
@@ -3024,7 +3052,7 @@ BOOL run_cast(U8 *buffer, S32 &offset, BOOL b_print, const LLUUID &id)
3024 { 3052 {
3025 S32 address; 3053 S32 address;
3026 F32 source = lscript_pop_float(buffer); 3054 F32 source = lscript_pop_float(buffer);
3027 sprintf(caststr, "%f", source); 3055 snprintf(caststr, sizeof(caststr), "%f", source); /*Flawfinder: ignore*/
3028 address = lsa_heap_add_data(buffer, new LLScriptLibData(caststr), get_max_heap_size(buffer), TRUE); 3056 address = lsa_heap_add_data(buffer, new LLScriptLibData(caststr), get_max_heap_size(buffer), TRUE);
3029 lscript_push(buffer, address); 3057 lscript_push(buffer, address);
3030 } 3058 }
@@ -3233,7 +3261,7 @@ BOOL run_cast(U8 *buffer, S32 &offset, BOOL b_print, const LLUUID &id)
3233 S32 address; 3261 S32 address;
3234 LLVector3 source; 3262 LLVector3 source;
3235 lscript_pop_vector(buffer, source); 3263 lscript_pop_vector(buffer, source);
3236 sprintf(caststr, "<%5.5f, %5.5f, %5.5f>", source.mV[VX], source.mV[VY], source.mV[VZ]); 3264 snprintf(caststr, sizeof(caststr), "<%5.5f, %5.5f, %5.5f>", source.mV[VX], source.mV[VY], source.mV[VZ]); /*Flawfinder: ignore*/
3237 address = lsa_heap_add_data(buffer, new LLScriptLibData(caststr), get_max_heap_size(buffer), TRUE); 3265 address = lsa_heap_add_data(buffer, new LLScriptLibData(caststr), get_max_heap_size(buffer), TRUE);
3238 lscript_push(buffer, address); 3266 lscript_push(buffer, address);
3239 } 3267 }
@@ -3266,7 +3294,7 @@ BOOL run_cast(U8 *buffer, S32 &offset, BOOL b_print, const LLUUID &id)
3266 S32 address; 3294 S32 address;
3267 LLQuaternion source; 3295 LLQuaternion source;
3268 lscript_pop_quaternion(buffer, source); 3296 lscript_pop_quaternion(buffer, source);
3269 sprintf(caststr, "<%5.5f, %5.5f, %5.5f, %5.5f>", source.mQ[VX], source.mQ[VY], source.mQ[VZ], source.mQ[VS]); 3297 snprintf(caststr, sizeof(caststr), "<%5.5f, %5.5f, %5.5f, %5.5f>", source.mQ[VX], source.mQ[VY], source.mQ[VZ], source.mQ[VS]); /*Flawfinder: ignore*/
3270 address = lsa_heap_add_data(buffer, new LLScriptLibData(caststr), get_max_heap_size(buffer), TRUE); 3298 address = lsa_heap_add_data(buffer, new LLScriptLibData(caststr), get_max_heap_size(buffer), TRUE);
3271 lscript_push(buffer, address); 3299 lscript_push(buffer, address);
3272 } 3300 }
@@ -3590,22 +3618,29 @@ void lscript_run(char *filename, BOOL b_debug)
3590 char *error; 3618 char *error;
3591 BOOL b_state; 3619 BOOL b_state;
3592 LLScriptExecute *execute = NULL; 3620 LLScriptExecute *execute = NULL;
3593 FILE *file = LLFile::fopen(filename, "r"); 3621 if (filename == NULL)
3622 {
3623 llerrs << "filename is empty" << llendl;
3624 // Just reporting error is likely not enough. Need
3625 // to check how to abort or error out gracefully
3626 // from this function. XXXTBD
3627 }
3628 FILE* file = LLFile::fopen(filename, "r"); /* Flawfinder: ignore */
3594 if (file) 3629 if (file)
3595 { 3630 {
3596 execute = new LLScriptExecute(file); 3631 execute = new LLScriptExecute(file);
3597 fclose(file); 3632 fclose(file);
3598 } 3633 }
3599 file = LLFile::fopen(filename, "r"); 3634 file = LLFile::fopen(filename, "r"); /* Flawfinder: ignore */
3600 if (file) 3635 if (file)
3601 { 3636 {
3602 FILE *fp = LLFile::fopen("lscript.parse", "w"); 3637 FILE* fp = LLFile::fopen("lscript.parse", "w"); /*Flawfinder: ignore*/
3603 LLScriptLSOParse *parse = new LLScriptLSOParse(file); 3638 LLScriptLSOParse *parse = new LLScriptLSOParse(file);
3604 parse->printData(fp); 3639 parse->printData(fp);
3605 fclose(file); 3640 fclose(file);
3606 fclose(fp); 3641 fclose(fp);
3607 } 3642 }
3608 file = LLFile::fopen(filename, "r"); 3643 file = LLFile::fopen(filename, "r"); /*Flawfinder: ignore*/
3609 if (file && execute) 3644 if (file && execute)
3610 { 3645 {
3611 timer.reset(); 3646 timer.reset();
@@ -3814,7 +3849,7 @@ BOOL run_calllib(U8 *buffer, S32 &offset, BOOL b_print, const LLUUID &id)
3814 3849
3815 if (gScriptLibrary.mFunctions[arg]->mArgs) 3850 if (gScriptLibrary.mFunctions[arg]->mArgs)
3816 { 3851 {
3817 number = (S32)strlen(gScriptLibrary.mFunctions[arg]->mArgs); 3852 number = (S32)strlen(gScriptLibrary.mFunctions[arg]->mArgs); /*Flawfinder: ignore*/
3818 arguments = new LLScriptLibData[number]; 3853 arguments = new LLScriptLibData[number];
3819 } 3854 }
3820 else 3855 else
@@ -3885,7 +3920,7 @@ BOOL run_calllib_two_byte(U8 *buffer, S32 &offset, BOOL b_print, const LLUUID &i
3885 3920
3886 if (gScriptLibrary.mFunctions[arg]->mArgs) 3921 if (gScriptLibrary.mFunctions[arg]->mArgs)
3887 { 3922 {
3888 number = (S32)strlen(gScriptLibrary.mFunctions[arg]->mArgs); 3923 number = (S32)strlen(gScriptLibrary.mFunctions[arg]->mArgs); /*Flawfinder: ignore*/
3889 arguments = new LLScriptLibData[number]; 3924 arguments = new LLScriptLibData[number];
3890 } 3925 }
3891 else 3926 else
diff --git a/linden/indra/lscript/lscript_execute/lscript_execute_vc8.vcproj b/linden/indra/lscript/lscript_execute/lscript_execute_vc8.vcproj
new file mode 100644
index 0000000..0a987c8
--- /dev/null
+++ b/linden/indra/lscript/lscript_execute/lscript_execute_vc8.vcproj
@@ -0,0 +1,276 @@
1<?xml version="1.0" encoding="Windows-1252"?>
2<VisualStudioProject
3 ProjectType="Visual C++"
4 Version="8.00"
5 Name="lscript_execute"
6 ProjectGUID="{F882263E-4F2A-43D9-A45A-FA4C8EC66552}"
7 Keyword="Win32Proj"
8 >
9 <Platforms>
10 <Platform
11 Name="Win32"
12 />
13 </Platforms>
14 <ToolFiles>
15 </ToolFiles>
16 <Configurations>
17 <Configuration
18 Name="Debug|Win32"
19 OutputDirectory="../../lib_$(ConfigurationName)/i686-win32"
20 IntermediateDirectory="Debug"
21 ConfigurationType="4"
22 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
23 CharacterSet="1"
24 >
25 <Tool
26 Name="VCPreBuildEventTool"
27 />
28 <Tool
29 Name="VCCustomBuildTool"
30 />
31 <Tool
32 Name="VCXMLDataGeneratorTool"
33 />
34 <Tool
35 Name="VCWebServiceProxyGeneratorTool"
36 />
37 <Tool
38 Name="VCMIDLTool"
39 />
40 <Tool
41 Name="VCCLCompilerTool"
42 Optimization="0"
43 AdditionalIncludeDirectories="..;..\..\llcommon;..\..\llmath;&quot;..\..\..\libraries\i686-win32\include&quot;;..\..\..\libraries\include"
44 PreprocessorDefinitions="WIN32;_DEBUG;_LIB;LL_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;LL_DEBUG"
45 MinimalRebuild="true"
46 BasicRuntimeChecks="3"
47 RuntimeLibrary="1"
48 StructMemberAlignment="4"
49 TreatWChar_tAsBuiltInType="false"
50 ForceConformanceInForLoopScope="true"
51 UsePrecompiledHeader="0"
52 WarningLevel="3"
53 WarnAsError="true"
54 Detect64BitPortabilityProblems="false"
55 DebugInformationFormat="4"
56 />
57 <Tool
58 Name="VCManagedResourceCompilerTool"
59 />
60 <Tool
61 Name="VCResourceCompilerTool"
62 />
63 <Tool
64 Name="VCPreLinkEventTool"
65 />
66 <Tool
67 Name="VCLibrarianTool"
68 OutputFile="$(OutDir)/lscript_execute.lib"
69 />
70 <Tool
71 Name="VCALinkTool"
72 />
73 <Tool
74 Name="VCXDCMakeTool"
75 />
76 <Tool
77 Name="VCBscMakeTool"
78 />
79 <Tool
80 Name="VCFxCopTool"
81 />
82 <Tool
83 Name="VCPostBuildEventTool"
84 />
85 </Configuration>
86 <Configuration
87 Name="Release|Win32"
88 OutputDirectory="../../lib_$(ConfigurationName)/i686-win32"
89 IntermediateDirectory="Release"
90 ConfigurationType="4"
91 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
92 CharacterSet="1"
93 >
94 <Tool
95 Name="VCPreBuildEventTool"
96 />
97 <Tool
98 Name="VCCustomBuildTool"
99 />
100 <Tool
101 Name="VCXMLDataGeneratorTool"
102 />
103 <Tool
104 Name="VCWebServiceProxyGeneratorTool"
105 />
106 <Tool
107 Name="VCMIDLTool"
108 />
109 <Tool
110 Name="VCCLCompilerTool"
111 AdditionalIncludeDirectories="..;..\..\llcommon;..\..\llmath;&quot;..\..\..\libraries\i686-win32\include&quot;;..\..\..\libraries\include"
112 PreprocessorDefinitions="WIN32;NDEBUG;_LIB;LL_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;LL_RELEASE"
113 RuntimeLibrary="0"
114 StructMemberAlignment="0"
115 TreatWChar_tAsBuiltInType="false"
116 ForceConformanceInForLoopScope="true"
117 UsePrecompiledHeader="0"
118 WarningLevel="3"
119 WarnAsError="true"
120 Detect64BitPortabilityProblems="false"
121 DebugInformationFormat="3"
122 />
123 <Tool
124 Name="VCManagedResourceCompilerTool"
125 />
126 <Tool
127 Name="VCResourceCompilerTool"
128 />
129 <Tool
130 Name="VCPreLinkEventTool"
131 />
132 <Tool
133 Name="VCLibrarianTool"
134 OutputFile="$(OutDir)/lscript_execute.lib"
135 />
136 <Tool
137 Name="VCALinkTool"
138 />
139 <Tool
140 Name="VCXDCMakeTool"
141 />
142 <Tool
143 Name="VCBscMakeTool"
144 />
145 <Tool
146 Name="VCFxCopTool"
147 />
148 <Tool
149 Name="VCPostBuildEventTool"
150 />
151 </Configuration>
152 <Configuration
153 Name="ReleaseNoOpt|Win32"
154 OutputDirectory="../../lib_$(ConfigurationName)/i686-win32"
155 IntermediateDirectory="$(ConfigurationName)"
156 ConfigurationType="4"
157 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
158 CharacterSet="1"
159 >
160 <Tool
161 Name="VCPreBuildEventTool"
162 />
163 <Tool
164 Name="VCCustomBuildTool"
165 />
166 <Tool
167 Name="VCXMLDataGeneratorTool"
168 />
169 <Tool
170 Name="VCWebServiceProxyGeneratorTool"
171 />
172 <Tool
173 Name="VCMIDLTool"
174 />
175 <Tool
176 Name="VCCLCompilerTool"
177 Optimization="0"
178 AdditionalIncludeDirectories="..;..\..\llcommon;..\..\llmath;&quot;..\..\..\libraries\i686-win32\include&quot;;..\..\..\libraries\include"
179 PreprocessorDefinitions="WIN32;NDEBUG;_LIB;LL_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;LL_RELEASE"
180 RuntimeLibrary="0"
181 StructMemberAlignment="0"
182 TreatWChar_tAsBuiltInType="false"
183 ForceConformanceInForLoopScope="true"
184 UsePrecompiledHeader="0"
185 WarningLevel="3"
186 WarnAsError="true"
187 Detect64BitPortabilityProblems="false"
188 DebugInformationFormat="3"
189 />
190 <Tool
191 Name="VCManagedResourceCompilerTool"
192 />
193 <Tool
194 Name="VCResourceCompilerTool"
195 />
196 <Tool
197 Name="VCPreLinkEventTool"
198 />
199 <Tool
200 Name="VCLibrarianTool"
201 OutputFile="$(OutDir)/lscript_execute.lib"
202 />
203 <Tool
204 Name="VCALinkTool"
205 />
206 <Tool
207 Name="VCXDCMakeTool"
208 />
209 <Tool
210 Name="VCBscMakeTool"
211 />
212 <Tool
213 Name="VCFxCopTool"
214 />
215 <Tool
216 Name="VCPostBuildEventTool"
217 />
218 </Configuration>
219 </Configurations>
220 <References>
221 </References>
222 <Files>
223 <Filter
224 Name="Source Files"
225 Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
226 UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
227 >
228 <File
229 RelativePath=".\lscript_execute.cpp"
230 >
231 </File>
232 <File
233 RelativePath=".\lscript_heapruntime.cpp"
234 >
235 </File>
236 <File
237 RelativePath=".\lscript_readlso.cpp"
238 >
239 </File>
240 </Filter>
241 <Filter
242 Name="Header Files"
243 Filter="h;hpp;hxx;hm;inl;inc;xsd"
244 UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
245 >
246 <File
247 RelativePath="..\lscript_byteconvert.h"
248 >
249 </File>
250 <File
251 RelativePath="..\lscript_byteformat.h"
252 >
253 </File>
254 <File
255 RelativePath="..\lscript_execute.h"
256 >
257 </File>
258 <File
259 RelativePath=".\lscript_heapruntime.h"
260 >
261 </File>
262 <File
263 RelativePath=".\lscript_readlso.h"
264 >
265 </File>
266 </Filter>
267 <Filter
268 Name="Resource Files"
269 Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
270 UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
271 >
272 </Filter>
273 </Files>
274 <Globals>
275 </Globals>
276</VisualStudioProject>
diff --git a/linden/indra/lscript/lscript_execute/lscript_readlso.cpp b/linden/indra/lscript/lscript_execute/lscript_readlso.cpp
index 6734d58..ea40892 100644
--- a/linden/indra/lscript/lscript_execute/lscript_readlso.cpp
+++ b/linden/indra/lscript/lscript_execute/lscript_readlso.cpp
@@ -122,7 +122,7 @@ void LLScriptLSOParse::printGlobals(FILE *fp)
122 F32 fpvalue; 122 F32 fpvalue;
123 LLVector3 vvalue; 123 LLVector3 vvalue;
124 LLQuaternion qvalue; 124 LLQuaternion qvalue;
125 char name[256]; 125 char name[256]; /*Flawfinder: ignore*/
126 U8 type; 126 U8 type;
127 127
128 S32 global_v_offset = get_register(mRawData, LREG_GVR); 128 S32 global_v_offset = get_register(mRawData, LREG_GVR);
@@ -190,7 +190,7 @@ void LLScriptLSOParse::printGlobalFunctions(FILE *fp)
190 S32 i, offset; 190 S32 i, offset;
191// LLVector3 vvalue; unused 191// LLVector3 vvalue; unused
192// LLQuaternion qvalue; unused 192// LLQuaternion qvalue; unused
193 char name[256]; 193 char name[256]; /*Flawfinder: ignore*/
194 U8 type; 194 U8 type;
195 195
196 offset = get_register(mRawData, LREG_GFR); 196 offset = get_register(mRawData, LREG_GFR);
@@ -280,7 +280,7 @@ void LLScriptLSOParse::printStates(FILE *fp)
280 U32 j, k; 280 U32 j, k;
281// LLVector3 vvalue; unused 281// LLVector3 vvalue; unused
282// LLQuaternion qvalue; unused 282// LLQuaternion qvalue; unused
283 char name[256]; 283 char name[256]; /*Flawfinder: ignore*/
284 284
285 S32 state_offset = get_register(mRawData, LREG_SR); 285 S32 state_offset = get_register(mRawData, LREG_SR);
286 286
@@ -1196,7 +1196,7 @@ void print_pushargf(FILE *fp, U8 *buffer, S32 &offset, S32 tabs)
1196 1196
1197void print_pushargs(FILE *fp, U8 *buffer, S32 &offset, S32 tabs) 1197void print_pushargs(FILE *fp, U8 *buffer, S32 &offset, S32 tabs)
1198{ 1198{
1199 char arg[1024]; 1199 char arg[1024]; /*Flawfinder: ignore*/
1200 lso_print_tabs(fp, tabs); 1200 lso_print_tabs(fp, tabs);
1201 fprintf(fp, "[0x%X]\tPUSHARGS ", offset++); 1201 fprintf(fp, "[0x%X]\tPUSHARGS ", offset++);
1202 bytestream2char(arg, buffer, offset); 1202 bytestream2char(arg, buffer, offset);
diff --git a/linden/indra/lscript/lscript_library.h b/linden/indra/lscript/lscript_library.h
index 300cbb6..33fc9d6 100644
--- a/linden/indra/lscript/lscript_library.h
+++ b/linden/indra/lscript/lscript_library.h
@@ -182,10 +182,10 @@ public:
182 size += 4; 182 size += 4;
183 break; 183 break;
184 case LST_KEY: 184 case LST_KEY:
185 size += (S32)strlen(mKey) + 1; 185 size += (S32)strlen(mKey) + 1; /*Flawfinder: ignore*/
186 break; 186 break;
187 case LST_STRING: 187 case LST_STRING:
188 size += (S32)strlen(mString) + 1; 188 size += (S32)strlen(mString) + 1; /*Flawfinder: ignore*/
189 break; 189 break;
190 case LST_LIST: 190 case LST_LIST:
191 break; 191 break;
@@ -241,19 +241,29 @@ public:
241 { 241 {
242 if (data.mKey) 242 if (data.mKey)
243 { 243 {
244 mKey = new char[strlen(data.mKey) + 1]; 244 mKey = new char[strlen(data.mKey) + 1]; /* Flawfinder: ignore */
245 strcpy(mKey, data.mKey); 245 if (mKey == NULL)
246 {
247 llerrs << "Memory Allocation Failed" << llendl;
248 return;
249 }
250 strcpy(mKey, data.mKey); /* Flawfinder: ignore */
246 } 251 }
247 if (data.mString) 252 if (data.mString)
248 { 253 {
249 mString = new char[strlen(data.mString) + 1]; 254 mString = new char[strlen(data.mString) + 1]; /* Flawfinder: ignore */
250 strcpy(mString, data.mString); 255 if (mString == NULL)
256 {
257 llerrs << "Memory Allocation Failed" << llendl;
258 return;
259 }
260 strcpy(mString, data.mString); /* Flawfinder: ignore */
251 } 261 }
252 } 262 }
253 263
254 LLScriptLibData(U8 *src, S32 &offset) : mListp(NULL) 264 LLScriptLibData(U8 *src, S32 &offset) : mListp(NULL)
255 { 265 {
256 static char temp[TOP_OF_MEMORY]; 266 static char temp[TOP_OF_MEMORY]; /* Flawfinder: ignore */
257 mType = (LSCRIPTType)bytestream2integer(src, offset); 267 mType = (LSCRIPTType)bytestream2integer(src, offset);
258 switch(mType) 268 switch(mType)
259 { 269 {
@@ -266,15 +276,25 @@ public:
266 case LST_KEY: 276 case LST_KEY:
267 { 277 {
268 bytestream2char(temp, src, offset); 278 bytestream2char(temp, src, offset);
269 mKey = new char[strlen(temp) + 1]; 279 mKey = new char[strlen(temp) + 1]; /* Flawfinder: ignore */
270 strcpy(mKey, temp); 280 if (mKey == NULL)
281 {
282 llerrs << "Memory Allocation Failed" << llendl;
283 return;
284 }
285 strcpy(mKey, temp); /* Flawfinder: ignore */
271 } 286 }
272 break; 287 break;
273 case LST_STRING: 288 case LST_STRING:
274 { 289 {
275 bytestream2char(temp, src, offset); 290 bytestream2char(temp, src, offset);
276 mString = new char[strlen(temp) + 1]; 291 mString = new char[strlen(temp) + 1]; /* Flawfinder: ignore */
277 strcpy(mString, temp); 292 if (mString == NULL)
293 {
294 llerrs << "Memory Allocation Failed" << llendl;
295 return;
296 }
297 strcpy(mString, temp); /* Flawfinder: ignore */
278 } 298 }
279 break; 299 break;
280 case LST_LIST: 300 case LST_LIST:
@@ -292,7 +312,7 @@ public:
292 312
293 void set(U8 *src, S32 &offset) 313 void set(U8 *src, S32 &offset)
294 { 314 {
295 static char temp[TOP_OF_MEMORY]; 315 static char temp[TOP_OF_MEMORY]; /* Flawfinder: ignore */
296 mType = (LSCRIPTType)bytestream2integer(src, offset); 316 mType = (LSCRIPTType)bytestream2integer(src, offset);
297 switch(mType) 317 switch(mType)
298 { 318 {
@@ -305,15 +325,25 @@ public:
305 case LST_KEY: 325 case LST_KEY:
306 { 326 {
307 bytestream2char(temp, src, offset); 327 bytestream2char(temp, src, offset);
308 mKey = new char[strlen(temp) + 1]; 328 mKey = new char[strlen(temp) + 1]; /* Flawfinder: ignore */
309 strcpy(mKey, temp); 329 if (mKey == NULL)
330 {
331 llerrs << "Memory Allocation Failed" << llendl;
332 return;
333 }
334 strcpy(mKey, temp); /* Flawfinder: ignore */
310 } 335 }
311 break; 336 break;
312 case LST_STRING: 337 case LST_STRING:
313 { 338 {
314 bytestream2char(temp, src, offset); 339 bytestream2char(temp, src, offset);
315 mString = new char[strlen(temp) + 1]; 340 mString = new char[strlen(temp) + 1]; /* Flawfinder: ignore */
316 strcpy(mString, temp); 341 if (mString == NULL)
342 {
343 llerrs << "Memory Allocation Failed" << llendl;
344 return;
345 }
346 strcpy(mString, temp); /* Flawfinder: ignore */
317 } 347 }
318 break; 348 break;
319 case LST_LIST: 349 case LST_LIST:
@@ -335,8 +365,13 @@ public:
335 void setFromCSV(char *src) 365 void setFromCSV(char *src)
336 { 366 {
337 mType = LST_STRING; 367 mType = LST_STRING;
338 mString = new char[strlen(src) + 1]; 368 mString = new char[strlen(src) + 1]; /* Flawfinder: ignore */
339 strcpy(mString, src); 369 if (mString == NULL)
370 {
371 llerrs << "Memory Allocation Failed" << llendl;
372 return;
373 }
374 strcpy(mString, src); /* Flawfinder: ignore */
340 } 375 }
341 376
342 LLScriptLibData(S32 integer) : mType(LST_INTEGER), mInteger(integer), mFP(0.f), mKey(NULL), mString(NULL), mVec(), mQuat(), mListp(NULL) 377 LLScriptLibData(S32 integer) : mType(LST_INTEGER), mInteger(integer), mFP(0.f), mKey(NULL), mString(NULL), mVec(), mQuat(), mListp(NULL)
@@ -362,8 +397,13 @@ public:
362 } 397 }
363 else 398 else
364 { 399 {
365 mString = new char[strlen(string) + 1]; 400 mString = new char[strlen(string) + 1]; /* Flawfinder: ignore */
366 strcpy(mString, string); 401 if (mString == NULL)
402 {
403 llerrs << "Memory Allocation Failed" << llendl;
404 return;
405 }
406 strcpy(mString, string); /* Flawfinder: ignore */
367 } 407 }
368 } 408 }
369 409
@@ -376,8 +416,13 @@ public:
376 } 416 }
377 else 417 else
378 { 418 {
379 mString = new char[strlen(string) + 1]; 419 mString = new char[strlen(string) + 1]; /* Flawfinder: ignore */
380 strcpy(mString, string); 420 if (mString == NULL)
421 {
422 llerrs << "Memory Allocation Failed" << llendl;
423 return;
424 }
425 strcpy(mString, string); /* Flawfinder: ignore */
381 } 426 }
382 } 427 }
383 428
diff --git a/linden/indra/lscript/lscript_library/lscript_alloc.cpp b/linden/indra/lscript/lscript_library/lscript_alloc.cpp
index 4636c0b..b39cd1f 100644
--- a/linden/indra/lscript/lscript_library/lscript_alloc.cpp
+++ b/linden/indra/lscript/lscript_library/lscript_alloc.cpp
@@ -127,10 +127,10 @@ S32 lsa_heap_add_data(U8 *buffer, LLScriptLibData *data, S32 heapsize, BOOL b_de
127 size = 4; 127 size = 4;
128 break; 128 break;
129 case LST_KEY: 129 case LST_KEY:
130 size = (S32)strlen(data->mKey) + 1; 130 size = (S32)strlen(data->mKey) + 1; /*Flawfinder: ignore*/
131 break; 131 break;
132 case LST_STRING: 132 case LST_STRING:
133 size = (S32)strlen(data->mString) + 1; 133 size = (S32)strlen(data->mString) + 1; /*Flawfinder: ignore*/
134 break; 134 break;
135 case LST_LIST: 135 case LST_LIST:
136 // list data 4 bytes of number of entries followed by number of pointer 136 // list data 4 bytes of number of entries followed by number of pointer
@@ -354,7 +354,7 @@ S32 lsa_create_data_block(U8 **buffer, LLScriptLibData *data, S32 base_offset)
354 { 354 {
355 if (data->mString) 355 if (data->mString)
356 { 356 {
357 size = (S32)strlen(data->mString) + 1; 357 size = (S32)strlen(data->mString) + 1; /*Flawfinder: ignore*/
358 } 358 }
359 else 359 else
360 { 360 {
@@ -365,7 +365,7 @@ S32 lsa_create_data_block(U8 **buffer, LLScriptLibData *data, S32 base_offset)
365 { 365 {
366 if (data->mKey) 366 if (data->mKey)
367 { 367 {
368 size = (S32)strlen(data->mKey) + 1; 368 size = (S32)strlen(data->mKey) + 1; /*Flawfinder: ignore*/
369 } 369 }
370 else 370 else
371 { 371 {
@@ -432,8 +432,12 @@ S32 lsa_create_data_block(U8 **buffer, LLScriptLibData *data, S32 base_offset)
432 if (listsize) 432 if (listsize)
433 { 433 {
434 U8 *tbuff = new U8[size + listsize]; 434 U8 *tbuff = new U8[size + listsize];
435 memcpy(tbuff, *buffer, size); 435 if (tbuff == NULL)
436 memcpy(tbuff + size, listbuf, listsize); 436 {
437 llerrs << "Memory Allocation Failed" << llendl;
438 }
439 memcpy(tbuff, *buffer, size); /*Flawfinder: ignore*/
440 memcpy(tbuff + size, listbuf, listsize); /*Flawfinder: ignore*/
437 size += listsize; 441 size += listsize;
438 delete [] *buffer; 442 delete [] *buffer;
439 delete [] listbuf; 443 delete [] listbuf;
@@ -516,7 +520,7 @@ void lsa_decrease_ref_count(U8 *buffer, S32 offset)
516 alloc_entry2bytestream(buffer, orig_offset, entry); 520 alloc_entry2bytestream(buffer, orig_offset, entry);
517} 521}
518 522
519char gLSAStringRead[16384]; 523char gLSAStringRead[16384]; /*Flawfinder: ignore*/
520 524
521 525
522LLScriptLibData *lsa_get_data(U8 *buffer, S32 &offset, BOOL b_dec_ref) 526LLScriptLibData *lsa_get_data(U8 *buffer, S32 &offset, BOOL b_dec_ref)
@@ -557,13 +561,13 @@ LLScriptLibData *lsa_get_data(U8 *buffer, S32 &offset, BOOL b_dec_ref)
557 break; 561 break;
558 case LST_KEY: 562 case LST_KEY:
559 bytestream2char(gLSAStringRead, buffer, offset); 563 bytestream2char(gLSAStringRead, buffer, offset);
560 retval->mKey = new char[strlen(gLSAStringRead) + 1]; 564 retval->mKey = new char[strlen(gLSAStringRead) + 1]; /*Flawfinder: ignore*/
561 strcpy(retval->mKey, gLSAStringRead); 565 strcpy(retval->mKey, gLSAStringRead); /*Flawfinder: ignore*/
562 break; 566 break;
563 case LST_STRING: 567 case LST_STRING:
564 bytestream2char(gLSAStringRead, buffer, offset); 568 bytestream2char(gLSAStringRead, buffer, offset);
565 retval->mString = new char[strlen(gLSAStringRead) + 1]; 569 retval->mString = new char[strlen(gLSAStringRead) + 1]; /*Flawfinder: ignore*/
566 strcpy(retval->mString, gLSAStringRead); 570 strcpy(retval->mString, gLSAStringRead); /*Flawfinder: ignore*/
567 break; 571 break;
568 case LST_VECTOR: 572 case LST_VECTOR:
569 bytestream2vector(retval->mVec, buffer, offset); 573 bytestream2vector(retval->mVec, buffer, offset);
@@ -703,13 +707,13 @@ S32 lsa_cat_strings(U8 *buffer, S32 offset1, S32 offset2, S32 heapsize)
703 return 0; 707 return 0;
704 } 708 }
705 709
706 S32 size = (S32)strlen(test1) + (S32)strlen(test2) + 1; 710 S32 size = (S32)strlen(test1) + (S32)strlen(test2) + 1; /*Flawfinder: ignore*/
707 711
708 LLScriptLibData *string3 = new LLScriptLibData; 712 LLScriptLibData *string3 = new LLScriptLibData;
709 string3->mType = LST_STRING; 713 string3->mType = LST_STRING;
710 string3->mString = new char[size]; 714 string3->mString = new char[size];
711 strcpy(string3->mString, test1); 715 strcpy(string3->mString, test1); /*Flawfinder: ignore*/
712 strcat(string3->mString, test2); 716 strcat(string3->mString, test2); /*Flawfinder: ignore*/
713 717
714 delete string1; 718 delete string1;
715 delete string2; 719 delete string2;
@@ -779,7 +783,7 @@ void lsa_print_heap(U8 *buffer)
779 F32 fpvalue; 783 F32 fpvalue;
780 LLVector3 vvalue; 784 LLVector3 vvalue;
781 LLQuaternion qvalue; 785 LLQuaternion qvalue;
782 char string[4096]; 786 char string[4096]; /*Flawfinder: ignore*/
783 787
784 LLScriptAllocEntry entry; 788 LLScriptAllocEntry entry;
785 789
@@ -849,7 +853,7 @@ void lsa_fprint_heap(U8 *buffer, FILE *fp)
849 F32 fpvalue; 853 F32 fpvalue;
850 LLVector3 vvalue; 854 LLVector3 vvalue;
851 LLQuaternion qvalue; 855 LLQuaternion qvalue;
852 char string[4096]; 856 char string[4096]; /*Flawfinder: ignore*/
853 857
854 LLScriptAllocEntry entry; 858 LLScriptAllocEntry entry;
855 859
@@ -997,58 +1001,9 @@ S32 lsa_cmp_lists(U8 *buffer, S32 offset1, S32 offset2)
997 1001
998 S32 length1 = list1->getListLength(); 1002 S32 length1 = list1->getListLength();
999 S32 length2 = list2->getListLength(); 1003 S32 length2 = list2->getListLength();
1000
1001 if (length1 != length2)
1002 {
1003 return length1 - length2;
1004 }
1005
1006 LLScriptLibData *runner1 = list1;
1007 LLScriptLibData *runner2 = list2;
1008
1009 S32 count = 0;
1010
1011 while (runner1)
1012 {
1013 if (runner1->mType != runner2->mType)
1014 return count;
1015
1016 switch(runner1->mType)
1017 {
1018 case LST_INTEGER:
1019 if (runner1->mInteger != runner2->mInteger)
1020 return count;
1021 break;
1022 case LST_FLOATINGPOINT:
1023 if (runner1->mFP != runner2->mFP)
1024 return count;
1025 break;
1026 case LST_KEY:
1027 if (strcmp(runner1->mKey, runner2->mKey))
1028 return count;
1029 break;
1030 case LST_STRING:
1031 if (strcmp(runner1->mString, runner2->mString))
1032 return count;
1033 break;
1034 case LST_VECTOR:
1035 if (runner1->mVec != runner2->mVec)
1036 return count;
1037 case LST_QUATERNION:
1038 if (runner1->mQuat != runner2->mQuat)
1039 return count;
1040 break;
1041 default:
1042 break;
1043 }
1044
1045 runner1 = runner1->mListp;
1046 runner2 = runner2->mListp;
1047 }
1048
1049 delete list1; 1004 delete list1;
1050 delete list2; 1005 delete list2;
1051 return 0; 1006 return length1 - length2;
1052} 1007}
1053 1008
1054 1009
diff --git a/linden/indra/lscript/lscript_library/lscript_library.cpp b/linden/indra/lscript/lscript_library/lscript_library.cpp
index 1b92608..7263ec3 100644
--- a/linden/indra/lscript/lscript_library/lscript_library.cpp
+++ b/linden/indra/lscript/lscript_library/lscript_library.cpp
@@ -119,7 +119,7 @@ void LLScriptLibrary::init()
119 addFunction(new LLScriptLibraryFunction(10.f, 0.2f, dummy_func, "llSetTexture", NULL, "si", "llSetTexture(string texture, integer face)\nsets the texture of face")); 119 addFunction(new LLScriptLibraryFunction(10.f, 0.2f, dummy_func, "llSetTexture", NULL, "si", "llSetTexture(string texture, integer face)\nsets the texture of face"));
120 addFunction(new LLScriptLibraryFunction(10.f, 0.2f, dummy_func, "llScaleTexture", NULL, "ffi", "llScaleTexture(float scales, float scalet, integer face)\nsets the texture s, t scales for the chosen face")); 120 addFunction(new LLScriptLibraryFunction(10.f, 0.2f, dummy_func, "llScaleTexture", NULL, "ffi", "llScaleTexture(float scales, float scalet, integer face)\nsets the texture s, t scales for the chosen face"));
121 addFunction(new LLScriptLibraryFunction(10.f, 0.2f, dummy_func, "llOffsetTexture", NULL, "ffi", "llOffsetTexture(float offsets, float offsett, integer face)\nsets the texture s, t offsets for the chosen face")); 121 addFunction(new LLScriptLibraryFunction(10.f, 0.2f, dummy_func, "llOffsetTexture", NULL, "ffi", "llOffsetTexture(float offsets, float offsett, integer face)\nsets the texture s, t offsets for the chosen face"));
122 addFunction(new LLScriptLibraryFunction(10.f, 0.2f, dummy_func, "llRotateTexture", NULL, "fi", "llOffsetTexture(float rotation, integer face)\nsets the texture rotation for the chosen face")); 122 addFunction(new LLScriptLibraryFunction(10.f, 0.2f, dummy_func, "llRotateTexture", NULL, "fi", "llRotateTexture(float rotation, integer face)\nsets the texture rotation for the chosen face"));
123 addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "llGetTexture", "s", "i", "string llGetTexture(integer face)\ngets the texture of face (if it's a texture in the object inventory, otherwise the key in a string)")); 123 addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "llGetTexture", "s", "i", "string llGetTexture(integer face)\ngets the texture of face (if it's a texture in the object inventory, otherwise the key in a string)"));
124 addFunction(new LLScriptLibraryFunction(10.f, 0.2f, dummy_func, "llSetPos", NULL, "v", "llSetPos(vector pos)\nsets the position (if the script isn't physical)")); 124 addFunction(new LLScriptLibraryFunction(10.f, 0.2f, dummy_func, "llSetPos", NULL, "v", "llSetPos(vector pos)\nsets the position (if the script isn't physical)"));
125 addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "llGetPos", "v", NULL, "vector llGetPos()\ngets the position (if the script isn't physical)")); 125 addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "llGetPos", "v", NULL, "vector llGetPos()\ngets the position (if the script isn't physical)"));
@@ -416,7 +416,14 @@ void LLScriptLibrary::init()
416 addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "llGetParcelPrimCount", "i", "vii","integer llGetParcelPrimCount(vector pos, integer category, integer sim_wide)\nGets the number of prims on the parcel of the given category.\nCategories: PARCEL_COUNT_TOTAL, _OWNER, _GROUP, _OTHER, _SELECTED, _TEMP.")); 416 addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "llGetParcelPrimCount", "i", "vii","integer llGetParcelPrimCount(vector pos, integer category, integer sim_wide)\nGets the number of prims on the parcel of the given category.\nCategories: PARCEL_COUNT_TOTAL, _OWNER, _GROUP, _OTHER, _SELECTED, _TEMP."));
417 addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "llGetParcelMaxPrims", "i", "vi","integer llGetParcelMaxPrims(vector pos, integer sim_wide)\nGets the maximum number of prims allowed on the parcel at pos.")); 417 addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "llGetParcelMaxPrims", "i", "vi","integer llGetParcelMaxPrims(vector pos, integer sim_wide)\nGets the maximum number of prims allowed on the parcel at pos."));
418 addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "llGetParcelDetails", "l", "vl","list llGetParcelDetails(vector pos, list params)\nGets the parcel details specified in params for the parcel at pos.\nParams is one or more of: PARCEL_DETAILS_NAME, _DESC, _OWNER, _GROUP, _AREA")); 418 addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "llGetParcelDetails", "l", "vl","list llGetParcelDetails(vector pos, list params)\nGets the parcel details specified in params for the parcel at pos.\nParams is one or more of: PARCEL_DETAILS_NAME, _DESC, _OWNER, _GROUP, _AREA"));
419
420
421 addFunction(new LLScriptLibraryFunction(10.f, 0.2f, dummy_func, "llSetLinkPrimitiveParams", NULL, "il", "llSetLinkPrimitiveParams(integer linknumber, list rules)\nSet primitive parameters for linknumber based on rules."));
422 addFunction(new LLScriptLibraryFunction(10.f, 0.2f, dummy_func, "llSetLinkTexture", NULL, "isi", "llSetLinkTexture(integer link_pos, string texture, integer face)\nSets the texture of face for link_pos"));
423
419 424
425 addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "llStringTrim", "s", "si", "string llStringTrim(string src, integer trim_type)\nTrim leading and/or trailing spaces from a string.\nUses trim_type of STRING_TRIM, STRING_TRIM_HEAD or STRING_TRIM_TAIL."));
426
420 // energy, sleep, dummy_func, name, return type, parameters, help text, gods-only 427 // energy, sleep, dummy_func, name, return type, parameters, help text, gods-only
421 428
422 // IF YOU ADD NEW SCRIPT CALLS, YOU MUST PUT THEM AT THE END OF THIS LIST. 429 // IF YOU ADD NEW SCRIPT CALLS, YOU MUST PUT THEM AT THE END OF THIS LIST.
@@ -440,10 +447,6 @@ void LLScriptLibrary::init()
440 //addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "llSetCamPositionLocked", NULL, "i", "llSetCamPositionLocked(TRUE or FALSE)\nLocks the camera position so it will not move")); 447 //addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "llSetCamPositionLocked", NULL, "i", "llSetCamPositionLocked(TRUE or FALSE)\nLocks the camera position so it will not move"));
441 //addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "llSetCamFocusLocked", NULL, "i", "llSetCamFocusLocked(TRUE or FALSE)\nLocks the camera focus so it will not move")); 448 //addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "llSetCamFocusLocked", NULL, "i", "llSetCamFocusLocked(TRUE or FALSE)\nLocks the camera focus so it will not move"));
442 449
443// These functions are being put on hold until we think through how we want them handled (security issues). DK 02/16/05
444 //addFunction(new LLScriptLibraryFunction(10.f, 0.2f, dummy_func, "llSetLinkPrimitiveParams", NULL, "il", "llSetLinkPrimitiveParams(integer linknumber, list rules)\nSet primitive parameters for linknumber based on rules."));
445 //addFunction(new LLScriptLibraryFunction(10.f, 0.2f, dummy_func, "llSetLinkTexture", NULL, "isi", "llSetLinkTexture(integer link_pos, string texture, integer face)\nSets the texture of face for link_pos"));
446
447 //addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "llSetForSale", "i", "ii", "integer llSetForSale(integer selltype, integer price)\nSets this object for sale in mode selltype for price. Returns TRUE if successfully set for sale.")); 450 //addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "llSetForSale", "i", "ii", "integer llSetForSale(integer selltype, integer price)\nSets this object for sale in mode selltype for price. Returns TRUE if successfully set for sale."));
448 451
449LLScriptLibraryFunction::LLScriptLibraryFunction(F32 eu, F32 st, void (*exec_func)(LLScriptLibData *, LLScriptLibData *, const LLUUID &), char *name, char *ret_type, char *args, char *desc, BOOL god_only) 452LLScriptLibraryFunction::LLScriptLibraryFunction(F32 eu, F32 st, void (*exec_func)(LLScriptLibData *, LLScriptLibData *, const LLUUID &), char *name, char *ret_type, char *args, char *desc, BOOL god_only)
@@ -452,11 +455,17 @@ LLScriptLibraryFunction::LLScriptLibraryFunction(F32 eu, F32 st, void (*exec_fun
452 mDesc = new char[512]; 455 mDesc = new char[512];
453 if (mSleepTime) 456 if (mSleepTime)
454 { 457 {
455 sprintf(mDesc,"%s\nSleeps script for %.1f seconds.",desc,mSleepTime); 458 snprintf( /* Flawfinder: ignore */
459 mDesc,
460 512,
461 "%s\nSleeps script for %.1f seconds.",
462 desc,
463 mSleepTime);
456 } 464 }
457 else 465 else
458 { 466 {
459 strcpy(mDesc,desc); 467 strncpy(mDesc, desc, 512); /* Flawfinder: ignore */
468 mDesc[511] = '\0'; // just in case.
460 } 469 }
461} 470}
462 471
@@ -470,7 +479,10 @@ void LLScriptLibrary::addFunction(LLScriptLibraryFunction *func)
470 LLScriptLibraryFunction **temp = new LLScriptLibraryFunction*[mNextNumber + 1]; 479 LLScriptLibraryFunction **temp = new LLScriptLibraryFunction*[mNextNumber + 1];
471 if (mNextNumber) 480 if (mNextNumber)
472 { 481 {
473 memcpy(temp, mFunctions, sizeof(LLScriptLibraryFunction *)*mNextNumber); 482 memcpy( /* Flawfinder: ignore */
483 temp,
484 mFunctions,
485 sizeof(LLScriptLibraryFunction*)*mNextNumber);
474 delete [] mFunctions; 486 delete [] mFunctions;
475 } 487 }
476 mFunctions = temp; 488 mFunctions = temp;
@@ -492,7 +504,7 @@ void LLScriptLibrary::assignExec(char *name, void (*exec_func)(LLScriptLibData *
492 504
493void LLScriptLibData::print(std::ostream &s, BOOL b_prepend_comma) 505void LLScriptLibData::print(std::ostream &s, BOOL b_prepend_comma)
494{ 506{
495 char tmp[1024]; 507 char tmp[1024]; /*Flawfinder: ignore*/
496 if (b_prepend_comma) 508 if (b_prepend_comma)
497 { 509 {
498 s << ", "; 510 s << ", ";
@@ -503,7 +515,7 @@ void LLScriptLibData::print(std::ostream &s, BOOL b_prepend_comma)
503 s << mInteger; 515 s << mInteger;
504 break; 516 break;
505 case LST_FLOATINGPOINT: 517 case LST_FLOATINGPOINT:
506 snprintf(tmp, 1024, "%f", mFP); 518 snprintf(tmp, 1024, "%f", mFP); /*Flawfinder: ignore*/
507 s << tmp; 519 s << tmp;
508 break; 520 break;
509 case LST_KEY: 521 case LST_KEY:
@@ -513,12 +525,12 @@ void LLScriptLibData::print(std::ostream &s, BOOL b_prepend_comma)
513 s << mString; 525 s << mString;
514 break; 526 break;
515 case LST_VECTOR: 527 case LST_VECTOR:
516 snprintf(tmp, 1024, "<%f, %f, %f>", mVec.mV[VX], 528 snprintf(tmp, 1024, "<%f, %f, %f>", mVec.mV[VX], /* Flawfinder: ignore */
517 mVec.mV[VY], mVec.mV[VZ]); 529 mVec.mV[VY], mVec.mV[VZ]);
518 s << tmp; 530 s << tmp;
519 break; 531 break;
520 case LST_QUATERNION: 532 case LST_QUATERNION:
521 snprintf(tmp, 1024, "<%f, %f, %f, %f>", mQuat.mQ[VX], mQuat.mQ[VY], 533 snprintf(tmp, 1024, "<%f, %f, %f, %f>", mQuat.mQ[VX], mQuat.mQ[VY], /* Flawfinder: ignore */
522 mQuat.mQ[VZ], mQuat.mQ[VS]); 534 mQuat.mQ[VZ], mQuat.mQ[VS]);
523 s << tmp; 535 s << tmp;
524 break; 536 break;
@@ -536,7 +548,7 @@ void LLScriptLibData::print_separator(std::ostream& ostr, BOOL b_prepend_sep, ch
536 //print(ostr, FALSE); 548 //print(ostr, FALSE);
537 { 549 {
538 BOOL b_prepend_comma = FALSE; 550 BOOL b_prepend_comma = FALSE;
539 char tmp[1024]; 551 char tmp[1024]; /* Flawfinder: ignore */
540 if (b_prepend_comma) 552 if (b_prepend_comma)
541 { 553 {
542 ostr << ", "; 554 ostr << ", ";
@@ -547,7 +559,7 @@ void LLScriptLibData::print_separator(std::ostream& ostr, BOOL b_prepend_sep, ch
547 ostr << mInteger; 559 ostr << mInteger;
548 break; 560 break;
549 case LST_FLOATINGPOINT: 561 case LST_FLOATINGPOINT:
550 snprintf(tmp, 1024, "%f", mFP); 562 snprintf(tmp, 1024, "%f", mFP); /* Flawfinder: ignore */
551 ostr << tmp; 563 ostr << tmp;
552 break; 564 break;
553 case LST_KEY: 565 case LST_KEY:
@@ -557,12 +569,12 @@ void LLScriptLibData::print_separator(std::ostream& ostr, BOOL b_prepend_sep, ch
557 ostr << mString; 569 ostr << mString;
558 break; 570 break;
559 case LST_VECTOR: 571 case LST_VECTOR:
560 snprintf(tmp, 1024, "<%f, %f, %f>", mVec.mV[VX], 572 snprintf(tmp, 1024, "<%f, %f, %f>", mVec.mV[VX], /* Flawfinder: ignore */
561 mVec.mV[VY], mVec.mV[VZ]); 573 mVec.mV[VY], mVec.mV[VZ]);
562 ostr << tmp; 574 ostr << tmp;
563 break; 575 break;
564 case LST_QUATERNION: 576 case LST_QUATERNION:
565 snprintf(tmp, 1024, "<%f, %f, %f, %f>", mQuat.mQ[VX], mQuat.mQ[VY], 577 snprintf(tmp, 1024, "<%f, %f, %f, %f>", mQuat.mQ[VX], mQuat.mQ[VY], /* Flawfinder: ignore */
566 mQuat.mQ[VZ], mQuat.mQ[VS]); 578 mQuat.mQ[VZ], mQuat.mQ[VS]);
567 ostr << tmp; 579 ostr << tmp;
568 break; 580 break;
diff --git a/linden/indra/lscript/lscript_library/lscript_library_vc8.vcproj b/linden/indra/lscript/lscript_library/lscript_library_vc8.vcproj
new file mode 100644
index 0000000..ee92752
--- /dev/null
+++ b/linden/indra/lscript/lscript_library/lscript_library_vc8.vcproj
@@ -0,0 +1,268 @@
1<?xml version="1.0" encoding="Windows-1252"?>
2<VisualStudioProject
3 ProjectType="Visual C++"
4 Version="8.00"
5 Name="lscript_library"
6 ProjectGUID="{BFA102B0-C891-4E13-B1CF-C2F28073DA8E}"
7 Keyword="Win32Proj"
8 >
9 <Platforms>
10 <Platform
11 Name="Win32"
12 />
13 </Platforms>
14 <ToolFiles>
15 </ToolFiles>
16 <Configurations>
17 <Configuration
18 Name="Debug|Win32"
19 OutputDirectory="../../lib_$(ConfigurationName)/i686-win32"
20 IntermediateDirectory="Debug"
21 ConfigurationType="4"
22 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
23 CharacterSet="1"
24 >
25 <Tool
26 Name="VCPreBuildEventTool"
27 />
28 <Tool
29 Name="VCCustomBuildTool"
30 />
31 <Tool
32 Name="VCXMLDataGeneratorTool"
33 />
34 <Tool
35 Name="VCWebServiceProxyGeneratorTool"
36 />
37 <Tool
38 Name="VCMIDLTool"
39 />
40 <Tool
41 Name="VCCLCompilerTool"
42 Optimization="0"
43 AdditionalIncludeDirectories="..\;..\..\llmath;..\..\llcommon;&quot;..\..\..\libraries\i686-win32&quot;;..\..\..\libraries\include"
44 PreprocessorDefinitions="WIN32;_DEBUG;_LIB;LL_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;LL_DEBUG"
45 MinimalRebuild="true"
46 BasicRuntimeChecks="3"
47 RuntimeLibrary="1"
48 StructMemberAlignment="4"
49 TreatWChar_tAsBuiltInType="false"
50 ForceConformanceInForLoopScope="true"
51 UsePrecompiledHeader="0"
52 WarningLevel="3"
53 WarnAsError="true"
54 Detect64BitPortabilityProblems="false"
55 DebugInformationFormat="4"
56 />
57 <Tool
58 Name="VCManagedResourceCompilerTool"
59 />
60 <Tool
61 Name="VCResourceCompilerTool"
62 />
63 <Tool
64 Name="VCPreLinkEventTool"
65 />
66 <Tool
67 Name="VCLibrarianTool"
68 OutputFile="$(OutDir)/lscript_library.lib"
69 />
70 <Tool
71 Name="VCALinkTool"
72 />
73 <Tool
74 Name="VCXDCMakeTool"
75 />
76 <Tool
77 Name="VCBscMakeTool"
78 />
79 <Tool
80 Name="VCFxCopTool"
81 />
82 <Tool
83 Name="VCPostBuildEventTool"
84 />
85 </Configuration>
86 <Configuration
87 Name="Release|Win32"
88 OutputDirectory="../../lib_$(ConfigurationName)/i686-win32"
89 IntermediateDirectory="Release"
90 ConfigurationType="4"
91 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
92 CharacterSet="1"
93 >
94 <Tool
95 Name="VCPreBuildEventTool"
96 />
97 <Tool
98 Name="VCCustomBuildTool"
99 />
100 <Tool
101 Name="VCXMLDataGeneratorTool"
102 />
103 <Tool
104 Name="VCWebServiceProxyGeneratorTool"
105 />
106 <Tool
107 Name="VCMIDLTool"
108 />
109 <Tool
110 Name="VCCLCompilerTool"
111 AdditionalIncludeDirectories="..\;..\..\llmath;..\..\llcommon;&quot;..\..\..\libraries\i686-win32&quot;;..\..\..\libraries\include"
112 PreprocessorDefinitions="WIN32;NDEBUG;_LIB;LL_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;LL_RELEASE"
113 RuntimeLibrary="0"
114 StructMemberAlignment="0"
115 TreatWChar_tAsBuiltInType="false"
116 ForceConformanceInForLoopScope="true"
117 UsePrecompiledHeader="0"
118 WarningLevel="3"
119 WarnAsError="true"
120 Detect64BitPortabilityProblems="false"
121 DebugInformationFormat="3"
122 />
123 <Tool
124 Name="VCManagedResourceCompilerTool"
125 />
126 <Tool
127 Name="VCResourceCompilerTool"
128 />
129 <Tool
130 Name="VCPreLinkEventTool"
131 />
132 <Tool
133 Name="VCLibrarianTool"
134 OutputFile="$(OutDir)/lscript_library.lib"
135 />
136 <Tool
137 Name="VCALinkTool"
138 />
139 <Tool
140 Name="VCXDCMakeTool"
141 />
142 <Tool
143 Name="VCBscMakeTool"
144 />
145 <Tool
146 Name="VCFxCopTool"
147 />
148 <Tool
149 Name="VCPostBuildEventTool"
150 />
151 </Configuration>
152 <Configuration
153 Name="ReleaseNoOpt|Win32"
154 OutputDirectory="../../lib_$(ConfigurationName)/i686-win32"
155 IntermediateDirectory="$(ConfigurationName)"
156 ConfigurationType="4"
157 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
158 CharacterSet="1"
159 >
160 <Tool
161 Name="VCPreBuildEventTool"
162 />
163 <Tool
164 Name="VCCustomBuildTool"
165 />
166 <Tool
167 Name="VCXMLDataGeneratorTool"
168 />
169 <Tool
170 Name="VCWebServiceProxyGeneratorTool"
171 />
172 <Tool
173 Name="VCMIDLTool"
174 />
175 <Tool
176 Name="VCCLCompilerTool"
177 Optimization="0"
178 AdditionalIncludeDirectories="..\;..\..\llmath;..\..\llcommon;&quot;..\..\..\libraries\i686-win32&quot;;..\..\..\libraries\include"
179 PreprocessorDefinitions="WIN32;NDEBUG;_LIB;LL_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;LL_RELEASE"
180 RuntimeLibrary="0"
181 StructMemberAlignment="0"
182 TreatWChar_tAsBuiltInType="false"
183 ForceConformanceInForLoopScope="true"
184 UsePrecompiledHeader="0"
185 WarningLevel="3"
186 WarnAsError="true"
187 Detect64BitPortabilityProblems="false"
188 DebugInformationFormat="3"
189 />
190 <Tool
191 Name="VCManagedResourceCompilerTool"
192 />
193 <Tool
194 Name="VCResourceCompilerTool"
195 />
196 <Tool
197 Name="VCPreLinkEventTool"
198 />
199 <Tool
200 Name="VCLibrarianTool"
201 OutputFile="$(OutDir)/lscript_library.lib"
202 />
203 <Tool
204 Name="VCALinkTool"
205 />
206 <Tool
207 Name="VCXDCMakeTool"
208 />
209 <Tool
210 Name="VCBscMakeTool"
211 />
212 <Tool
213 Name="VCFxCopTool"
214 />
215 <Tool
216 Name="VCPostBuildEventTool"
217 />
218 </Configuration>
219 </Configurations>
220 <References>
221 </References>
222 <Files>
223 <Filter
224 Name="Source Files"
225 Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
226 UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
227 >
228 <File
229 RelativePath=".\lscript_alloc.cpp"
230 >
231 </File>
232 <File
233 RelativePath=".\lscript_export.cpp"
234 >
235 </File>
236 <File
237 RelativePath=".\lscript_library.cpp"
238 >
239 </File>
240 </Filter>
241 <Filter
242 Name="Header Files"
243 Filter="h;hpp;hxx;hm;inl;inc;xsd"
244 UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
245 >
246 <File
247 RelativePath="..\lscript_alloc.h"
248 >
249 </File>
250 <File
251 RelativePath="..\lscript_export.h"
252 >
253 </File>
254 <File
255 RelativePath="..\lscript_library.h"
256 >
257 </File>
258 </Filter>
259 <Filter
260 Name="Resource Files"
261 Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
262 UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
263 >
264 </Filter>
265 </Files>
266 <Globals>
267 </Globals>
268</VisualStudioProject>
diff --git a/linden/indra/mac_crash_logger/mac_crash_logger.cpp b/linden/indra/mac_crash_logger/mac_crash_logger.cpp
index 372050d..4af95fe 100644
--- a/linden/indra/mac_crash_logger/mac_crash_logger.cpp
+++ b/linden/indra/mac_crash_logger/mac_crash_logger.cpp
@@ -100,7 +100,7 @@ OSStatus dialogHandler(EventHandlerCallRef handler, EventRef event, void *userda
100 { 100 {
101 case kHICommandOK: 101 case kHICommandOK:
102 { 102 {
103 char buffer[65535]; 103 char buffer[65535]; /* Flawfinder: ignore */
104 Size size = sizeof(buffer) - 1; 104 Size size = sizeof(buffer) - 1;
105 ControlRef textField = NULL; 105 ControlRef textField = NULL;
106 ControlID id; 106 ControlID id;
@@ -334,9 +334,9 @@ int main(int argc, char **argv)
334 // *NOTE: changing the size of either of these buffers will 334 // *NOTE: changing the size of either of these buffers will
335 // require changing the sscanf() format string to correctly 335 // require changing the sscanf() format string to correctly
336 // account for it. 336 // account for it.
337 char tmp_sl_name[LL_MAX_PATH]; 337 char tmp_sl_name[LL_MAX_PATH]; /* Flawfinder: ignore */
338 tmp_sl_name[0] = '\0'; 338 tmp_sl_name[0] = '\0';
339 char tmp_space[MAX_STRING]; 339 char tmp_space[MAX_STRING]; /* Flawfinder: ignore */
340 tmp_space[0] = '\0'; 340 tmp_space[0] = '\0';
341 341
342 // Look for it in the debug_info.log file 342 // Look for it in the debug_info.log file
@@ -395,7 +395,7 @@ int main(int argc, char **argv)
395 // MBW -- This needs to go find "~/Library/Logs/CrashReporter/Second Life.crash.log" on 10.3 395 // MBW -- This needs to go find "~/Library/Logs/CrashReporter/Second Life.crash.log" on 10.3
396 // or "~/Library/Logs/Second Life.crash.log" on 10.2. 396 // or "~/Library/Logs/Second Life.crash.log" on 10.2.
397 { 397 {
398 char path[MAX_PATH]; 398 char path[MAX_PATH]; /* Flawfinder: ignore */
399 FSRef folder; 399 FSRef folder;
400 400
401 if(FSFindFolder(kUserDomain, kLogsFolderType, false, &folder) == noErr) 401 if(FSFindFolder(kUserDomain, kLogsFolderType, false, &folder) == noErr)
@@ -596,7 +596,7 @@ LLFileEncoder::LLFileEncoder(const char *form_name, const char *filename, bool i
596 } 596 }
597 597
598 S32 buf_size = stat_data.st_size; 598 S32 buf_size = stat_data.st_size;
599 FILE *fp = fopen(mFilename.c_str(), "rb"); 599 FILE* fp = fopen(mFilename.c_str(), "rb"); /* Flawfinder: ignore */
600 U8 *buf = new U8[buf_size + 1]; 600 U8 *buf = new U8[buf_size + 1];
601 fread(buf, 1, buf_size, fp); 601 fread(buf, 1, buf_size, fp);
602 fclose(fp); 602 fclose(fp);
@@ -617,7 +617,7 @@ LLFileEncoder::LLFileEncoder(const char *form_name, const char *filename, bool i
617 while(temp != NULL) 617 while(temp != NULL)
618 { 618 {
619 // Skip past the marker we just found 619 // Skip past the marker we just found
620 cur = temp + strlen(sep); 620 cur = temp + strlen(sep); /* Flawfinder: ignore */
621 621
622 // and try to find another 622 // and try to find another
623 temp = strstr(cur, sep); 623 temp = strstr(cur, sep);
@@ -657,11 +657,15 @@ LLString LLFileEncoder::encodeURL(const S32 max_length)
657 S32 buf_size = mBuf.size(); 657 S32 buf_size = mBuf.size();
658 S32 url_buf_size = 3*mBuf.size() + 1; 658 S32 url_buf_size = 3*mBuf.size() + 1;
659 char *url_buf = new char[url_buf_size]; 659 char *url_buf = new char[url_buf_size];
660 660 if (url_buf == NULL)
661 {
662 llerrs << "Memory Allocation Failed" << llendl;
663 return result;
664 }
661 S32 cur_pos = 0; 665 S32 cur_pos = 0;
662 for (; i < buf_size; i++) 666 for (; i < buf_size; i++)
663 { 667 {
664 sprintf(url_buf + cur_pos, "%%%02x", mBuf[i]); 668 sprintf(url_buf + cur_pos, "%%%02x", mBuf[i]); /* Flawfinder: ignore */
665 cur_pos += 3; 669 cur_pos += 3;
666 } 670 }
667 url_buf[i*3] = 0; 671 url_buf[i*3] = 0;
@@ -680,12 +684,17 @@ LLString encode_string(const char *formname, const LLString &str)
680 S32 buf_size = str.size(); 684 S32 buf_size = str.size();
681 S32 url_buf_size = 3*str.size() + 1; 685 S32 url_buf_size = 3*str.size() + 1;
682 char *url_buf = new char[url_buf_size]; 686 char *url_buf = new char[url_buf_size];
687 if (url_buf == NULL)
688 {
689 llerrs << "Memory Allocation Failed" << llendl;
690 return result;
691 }
683 692
684 S32 cur_pos = 0; 693 S32 cur_pos = 0;
685 S32 i; 694 S32 i;
686 for (i = 0; i < buf_size; i++) 695 for (i = 0; i < buf_size; i++)
687 { 696 {
688 sprintf(url_buf + cur_pos, "%%%02x", str[i]); 697 sprintf(url_buf + cur_pos, "%%%02x", str[i]); /* Flawfinder: ignore */
689 cur_pos += 3; 698 cur_pos += 3;
690 } 699 }
691 url_buf[i*3] = 0; 700 url_buf[i*3] = 0;
diff --git a/linden/indra/mac_updater/FSCopyObject.c b/linden/indra/mac_updater/FSCopyObject.c
index b9210d2..f794358 100644
--- a/linden/indra/mac_updater/FSCopyObject.c
+++ b/linden/indra/mac_updater/FSCopyObject.c
@@ -913,7 +913,7 @@ static OSErr ProcessFolderList( FSCopyFolderGlobals *folderGlobals )
913 { 913 {
914 #if DEBUG && !TARGET_API_MAC_OS8 914 #if DEBUG && !TARGET_API_MAC_OS8
915 { 915 {
916 char path[1024]; 916 char path[1024]; /* Flawfinder: ignore */
917 myverify_noerr(FSRefMakePath( &(folderListData->sourceDirRef), (unsigned char*)path, 1024 )); 917 myverify_noerr(FSRefMakePath( &(folderListData->sourceDirRef), (unsigned char*)path, 1024 ));
918 dwarning(("\n\n%s -- Copying contents of\n\t%s\n", __FUNCTION__, path)); 918 dwarning(("\n\n%s -- Copying contents of\n\t%s\n", __FUNCTION__, path));
919 myverify_noerr(FSRefMakePath( &(folderListData->destDirRef), (unsigned char*)path, 1024 )); 919 myverify_noerr(FSRefMakePath( &(folderListData->destDirRef), (unsigned char*)path, 1024 ));
@@ -1451,7 +1451,7 @@ OSErr FSDeleteObjects( const FSRef *source )
1451 #if DEBUG && !TARGET_API_MAC_OS8 1451 #if DEBUG && !TARGET_API_MAC_OS8
1452 if( err == noErr ) 1452 if( err == noErr )
1453 { 1453 {
1454 char path[1024]; 1454 char path[1024]; /* Flawfinder: ignore */
1455 myverify_noerr(FSRefMakePath( source, (unsigned char*)path, 1024 )); 1455 myverify_noerr(FSRefMakePath( source, (unsigned char*)path, 1024 ));
1456 dwarning(("\n%s -- Deleting %s\n", __FUNCTION__, path)); 1456 dwarning(("\n%s -- Deleting %s\n", __FUNCTION__, path));
1457 } 1457 }
@@ -1834,7 +1834,7 @@ static OSErr GetUniqueName( const FSRef *destDir,
1834{ 1834{
1835 HFSUniStr255 tmpName = *sourceName; 1835 HFSUniStr255 tmpName = *sourceName;
1836 FSRef tmpRef; 1836 FSRef tmpRef;
1837 unsigned char hexStr[17] = "123456789"; /* yeah, only 9... I'm lazy, sosumi */ 1837 unsigned char hexStr[17] = "123456789"; /* Flawfinder: ignore */ /* yeah, only 9... I'm lazy, sosumi */
1838 long count = 0; 1838 long count = 0;
1839 int index; 1839 int index;
1840 OSErr err; 1840 OSErr err;
@@ -1983,4 +1983,4 @@ static pascal void MyCloseForkProc( void *pData )
1983 myverify_noerr( FSCloseFork( refNum ) ); /* the fork was opened, so close it */ 1983 myverify_noerr( FSCloseFork( refNum ) ); /* the fork was opened, so close it */
1984 1984
1985 DisposePtr( (char*) pData ); 1985 DisposePtr( (char*) pData );
1986} \ No newline at end of file 1986}
diff --git a/linden/indra/mac_updater/MoreFilesX.c b/linden/indra/mac_updater/MoreFilesX.c
index 33d3424..283628d 100644
--- a/linden/indra/mac_updater/MoreFilesX.c
+++ b/linden/indra/mac_updater/MoreFilesX.c
@@ -1845,7 +1845,7 @@ GenerateUniqueHFSUniStr(
1845 long i; 1845 long i;
1846 FSRefParam pb; 1846 FSRefParam pb;
1847 FSRef newRef; 1847 FSRef newRef;
1848 unsigned char hexStr[17] = "0123456789ABCDEF"; 1848 unsigned char hexStr[17] = "0123456789ABCDEF"; /* Flawfinder: ignore */
1849 1849
1850 /* set up the parameter block */ 1850 /* set up the parameter block */
1851 pb.name = uniqueName->unicode; 1851 pb.name = uniqueName->unicode;
diff --git a/linden/indra/mac_updater/mac_updater.cpp b/linden/indra/mac_updater/mac_updater.cpp
index 2061ab4..d05b73f 100644
--- a/linden/indra/mac_updater/mac_updater.cpp
+++ b/linden/indra/mac_updater/mac_updater.cpp
@@ -67,7 +67,7 @@ Boolean gCancelled = false;
67 67
68char *gUserServer; 68char *gUserServer;
69char *gProductName; 69char *gProductName;
70char gUpdateURL[2048]; 70char gUpdateURL[2048]; /* Flawfinder: ignore */
71 71
72void *updatethreadproc(void*); 72void *updatethreadproc(void*);
73 73
@@ -381,7 +381,7 @@ int main(int argc, char **argv)
381 llinfos << "Starting " << gProductName << " Updater" << llendl; 381 llinfos << "Starting " << gProductName << " Updater" << llendl;
382 382
383 // Build the URL to download the update 383 // Build the URL to download the update
384 snprintf(gUpdateURL, sizeof(gUpdateURL), "http://secondlife.com/update-macos.php?userserver=%s", gUserServer); 384 snprintf(gUpdateURL, sizeof(gUpdateURL), "http://secondlife.com/update-macos.php?userserver=%s", gUserServer); /* Flawfinder: ignore */
385 385
386 // Real UI... 386 // Real UI...
387 OSStatus err; 387 OSStatus err;
@@ -389,8 +389,8 @@ int main(int argc, char **argv)
389 389
390 err = CreateNibReference(CFSTR("AutoUpdater"), &nib); 390 err = CreateNibReference(CFSTR("AutoUpdater"), &nib);
391 391
392 char windowTitle[MAX_PATH]; 392 char windowTitle[MAX_PATH]; /* Flawfinder: ignore */
393 snprintf(windowTitle, sizeof(windowTitle), "%s Updater", gProductName); 393 snprintf(windowTitle, sizeof(windowTitle), "%s Updater", gProductName); /* Flawfinder: ignore */
394 CFStringRef windowTitleRef = NULL; 394 CFStringRef windowTitleRef = NULL;
395 windowTitleRef = CFStringCreateWithCString(NULL, windowTitle, kCFStringEncodingUTF8); 395 windowTitleRef = CFStringCreateWithCString(NULL, windowTitle, kCFStringEncodingUTF8);
396 396
@@ -507,7 +507,7 @@ bool isDirWritable(FSRef &dir)
507 // This is kinda lame, but will pretty much always give the right answer. 507 // This is kinda lame, but will pretty much always give the right answer.
508 508
509 OSStatus err = noErr; 509 OSStatus err = noErr;
510 char temp[PATH_MAX]; 510 char temp[PATH_MAX]; /* Flawfinder: ignore */
511 511
512 err = FSRefMakePath(&dir, (UInt8*)temp, sizeof(temp)); 512 err = FSRefMakePath(&dir, (UInt8*)temp, sizeof(temp));
513 513
@@ -557,15 +557,15 @@ static void utf8str_to_HFSUniStr255(HFSUniStr255 *dest, const char* src)
557 // Truncate to avoid stack smaching or other badness. 557 // Truncate to avoid stack smaching or other badness.
558 dest->length = 255; 558 dest->length = 255;
559 } 559 }
560 memcpy(dest->unicode, utf16str.data(), sizeof(UniChar)* dest->length); 560 memcpy(dest->unicode, utf16str.data(), sizeof(UniChar)* dest->length); /* Flawfinder: ignore */
561} 561}
562 562
563int restoreObject(const char* aside, const char* target, const char* path, const char* object) 563int restoreObject(const char* aside, const char* target, const char* path, const char* object)
564{ 564{
565 char source[PATH_MAX]; 565 char source[PATH_MAX]; /* Flawfinder: ignore */
566 char dest[PATH_MAX]; 566 char dest[PATH_MAX]; /* Flawfinder: ignore */
567 snprintf(source, sizeof(source), "%s/%s/%s", aside, path, object); 567 snprintf(source, sizeof(source), "%s/%s/%s", aside, path, object); /* Flawfinder: ignore */
568 snprintf(dest, sizeof(dest), "%s/%s", target, path); 568 snprintf(dest, sizeof(dest), "%s/%s", target, path); /* Flawfinder: ignore */
569 FSRef sourceRef; 569 FSRef sourceRef;
570 FSRef destRef; 570 FSRef destRef;
571 OSStatus err; 571 OSStatus err;
@@ -597,28 +597,28 @@ int restoreObject(const char* aside, const char* target, const char* path, const
597// Replace any mention of "Second Life" with the product name. 597// Replace any mention of "Second Life" with the product name.
598void filterFile(const char* filename) 598void filterFile(const char* filename)
599{ 599{
600 char temp[PATH_MAX]; 600 char temp[PATH_MAX]; /* Flawfinder: ignore */
601 // First copy the target's version, so we can run it through sed. 601 // First copy the target's version, so we can run it through sed.
602 snprintf(temp, sizeof(temp), "cp '%s' '%s.tmp'", filename, filename); 602 snprintf(temp, sizeof(temp), "cp '%s' '%s.tmp'", filename, filename); /* Flawfinder: ignore */
603 system(temp); 603 system(temp); /* Flawfinder: ignore */
604 604
605 // Now run it through sed. 605 // Now run it through sed.
606 snprintf(temp, sizeof(temp), 606 snprintf(temp, sizeof(temp), /* Flawfinder: ignore */
607 "sed 's/Second Life/%s/g' '%s.tmp' > '%s'", gProductName, filename, filename); 607 "sed 's/Second Life/%s/g' '%s.tmp' > '%s'", gProductName, filename, filename);
608 system(temp); 608 system(temp); /* Flawfinder: ignore */
609} 609}
610 610
611void *updatethreadproc(void*) 611void *updatethreadproc(void*)
612{ 612{
613 char tempDir[PATH_MAX] = ""; 613 char tempDir[PATH_MAX] = ""; /* Flawfinder: ignore */
614 FSRef tempDirRef; 614 FSRef tempDirRef;
615 char temp[PATH_MAX]; 615 char temp[PATH_MAX]; /* Flawfinder: ignore */
616 // *NOTE: This buffer length is used in a scanf() below. 616 // *NOTE: This buffer length is used in a scanf() below.
617 char deviceNode[1024] = ""; 617 char deviceNode[1024] = ""; /* Flawfinder: ignore */
618 FILE *downloadFile = NULL; 618 FILE *downloadFile = NULL;
619 OSStatus err; 619 OSStatus err;
620 ProcessSerialNumber psn; 620 ProcessSerialNumber psn;
621 char target[PATH_MAX]; 621 char target[PATH_MAX]; /* Flawfinder: ignore */
622 FSRef targetRef; 622 FSRef targetRef;
623 FSRef targetParentRef; 623 FSRef targetParentRef;
624 FSVolumeRefNum targetVol; 624 FSVolumeRefNum targetVol;
@@ -759,7 +759,7 @@ void *updatethreadproc(void*)
759 throw 0; 759 throw 0;
760 } 760 }
761 761
762 snprintf(target, sizeof(target), "/Applications/%s.app", gProductName); 762 snprintf(target, sizeof(target), "/Applications/%s.app", gProductName); /* Flawfinder: ignore */
763 763
764 memset(&targetRef, 0, sizeof(targetRef)); 764 memset(&targetRef, 0, sizeof(targetRef));
765 err = FSPathMakeRef((UInt8*)target, &targetRef, NULL); 765 err = FSPathMakeRef((UInt8*)target, &targetRef, NULL);
@@ -844,7 +844,7 @@ void *updatethreadproc(void*)
844 throw 0; 844 throw 0;
845 } 845 }
846 846
847 strcpy(tempDir, temp); 847 strcpy(tempDir, temp); /* Flawfinder: ignore */
848 848
849 llinfos << "tempDir is " << tempDir << llendl; 849 llinfos << "tempDir is " << tempDir << llendl;
850 850
@@ -855,9 +855,9 @@ void *updatethreadproc(void*)
855 855
856 chdir(tempDir); 856 chdir(tempDir);
857 857
858 snprintf(temp, sizeof(temp), "SecondLife.dmg"); 858 snprintf(temp, sizeof(temp), "SecondLife.dmg"); /* Flawfinder: ignore */
859 859
860 downloadFile = fopen(temp, "wb"); 860 downloadFile = fopen(temp, "wb"); /* Flawfinder: ignore */
861 if(downloadFile == NULL) 861 if(downloadFile == NULL)
862 { 862 {
863 throw 0; 863 throw 0;
@@ -902,7 +902,7 @@ void *updatethreadproc(void*)
902 // NOTE: we could add -private at the end of this command line to keep the image from showing up in the Finder, 902 // NOTE: we could add -private at the end of this command line to keep the image from showing up in the Finder,
903 // but if our cleanup fails, this makes it much harder for the user to unmount the image. 903 // but if our cleanup fails, this makes it much harder for the user to unmount the image.
904 LLString mountOutput; 904 LLString mountOutput;
905 FILE *mounter = popen("hdiutil attach SecondLife.dmg -mountpoint mnt", "r"); 905 FILE* mounter = popen("hdiutil attach SecondLife.dmg -mountpoint mnt", "r"); /* Flawfinder: ignore */
906 906
907 if(mounter == NULL) 907 if(mounter == NULL)
908 { 908 {
@@ -937,8 +937,8 @@ void *updatethreadproc(void*)
937 937
938 if(sub != NULL) 938 if(sub != NULL)
939 { 939 {
940 sub += strlen(prefix); 940 sub += strlen(prefix); /* Flawfinder: ignore */
941 sscanf(sub, "%1023s", deviceNode); 941 sscanf(sub, "%1023s", deviceNode); /* Flawfinder: ignore */
942 } 942 }
943 } 943 }
944 944
@@ -953,7 +953,7 @@ void *updatethreadproc(void*)
953 953
954 // Get an FSRef to the new application on the disk image 954 // Get an FSRef to the new application on the disk image
955 FSRef sourceRef; 955 FSRef sourceRef;
956 snprintf(temp, sizeof(temp), "%s/mnt/Second Life.app", tempDir); 956 snprintf(temp, sizeof(temp), "%s/mnt/Second Life.app", tempDir); /* Flawfinder: ignore */
957 957
958 llinfos << "Source application is: " << temp << llendl; 958 llinfos << "Source application is: " << temp << llendl;
959 959
@@ -962,7 +962,7 @@ void *updatethreadproc(void*)
962 throw 0; 962 throw 0;
963 963
964 FSRef asideRef; 964 FSRef asideRef;
965 char aside[MAX_PATH]; 965 char aside[MAX_PATH]; /* Flawfinder: ignore */
966 966
967 // this will hold the name of the destination target 967 // this will hold the name of the destination target
968 HFSUniStr255 appNameUniStr; 968 HFSUniStr255 appNameUniStr;
@@ -985,8 +985,8 @@ void *updatethreadproc(void*)
985 else 985 else
986 { 986 {
987 // Construct the name of the target based on the product name 987 // Construct the name of the target based on the product name
988 char appName[MAX_PATH]; 988 char appName[MAX_PATH]; /* Flawfinder: ignore */
989 snprintf(appName, sizeof(appName), "%s.app", gProductName); 989 snprintf(appName, sizeof(appName), "%s.app", gProductName); /* Flawfinder: ignore */
990 utf8str_to_HFSUniStr255( &appNameUniStr, appName ); 990 utf8str_to_HFSUniStr255( &appNameUniStr, appName );
991 } 991 }
992 992
@@ -1034,8 +1034,8 @@ void *updatethreadproc(void*)
1034 1034
1035 llinfos << "Clearing cache..." << llendl; 1035 llinfos << "Clearing cache..." << llendl;
1036 1036
1037 char mask[LL_MAX_PATH]; 1037 char mask[LL_MAX_PATH]; /* Flawfinder: ignore */
1038 sprintf(mask, "%s*.*", gDirUtilp->getDirDelimiter().c_str()); 1038 snprintf(mask, LL_MAX_PATH, "%s*.*", gDirUtilp->getDirDelimiter().c_str()); /* Flawfinder: ignore */
1039 gDirUtilp->deleteFilesInDir(gDirUtilp->getExpandedFilename(LL_PATH_CACHE,""),mask); 1039 gDirUtilp->deleteFilesInDir(gDirUtilp->getExpandedFilename(LL_PATH_CACHE,""),mask);
1040 1040
1041 llinfos << "Clear complete." << llendl; 1041 llinfos << "Clear complete." << llendl;
@@ -1067,8 +1067,8 @@ void *updatethreadproc(void*)
1067 { 1067 {
1068 llinfos << "Detaching disk image." << llendl; 1068 llinfos << "Detaching disk image." << llendl;
1069 1069
1070 snprintf(temp, sizeof(temp), "hdiutil detach '%s'", deviceNode); 1070 snprintf(temp, sizeof(temp), "hdiutil detach '%s'", deviceNode); /* Flawfinder: ignore */
1071 system(temp); 1071 system(temp); /* Flawfinder: ignore */
1072 } 1072 }
1073 1073
1074 sendProgress(2, 3); 1074 sendProgress(2, 3);
@@ -1092,13 +1092,13 @@ void *updatethreadproc(void*)
1092 { 1092 {
1093 llinfos << "Touching application bundle." << llendl; 1093 llinfos << "Touching application bundle." << llendl;
1094 1094
1095 snprintf(temp, sizeof(temp), "touch '%s'", target); 1095 snprintf(temp, sizeof(temp), "touch '%s'", target); /* Flawfinder: ignore */
1096 system(temp); 1096 system(temp); /* Flawfinder: ignore */
1097 1097
1098 llinfos << "Launching updated application." << llendl; 1098 llinfos << "Launching updated application." << llendl;
1099 1099
1100 snprintf(temp, sizeof(temp), "open '%s'", target); 1100 snprintf(temp, sizeof(temp), "open '%s'", target); /* Flawfinder: ignore */
1101 system(temp); 1101 system(temp); /* Flawfinder: ignore */
1102 } 1102 }
1103 1103
1104 sendDone(); 1104 sendDone();
diff --git a/linden/indra/newview/English.lproj/InfoPlist.strings b/linden/indra/newview/English.lproj/InfoPlist.strings
index 6ef64e4..6efc60a 100644
--- a/linden/indra/newview/English.lproj/InfoPlist.strings
+++ b/linden/indra/newview/English.lproj/InfoPlist.strings
@@ -1,5 +1,5 @@
1/* Localized versions of Info.plist keys */ 1/* Localized versions of Info.plist keys */
2 2
3CFBundleName = "Second Life"; 3CFBundleName = "Second Life";
4CFBundleShortVersionString = "Second Life version 1.13.3.2"; 4CFBundleShortVersionString = "Second Life version 1.14.0.0";
5CFBundleGetInfoString = "Second Life version 1.13.3.2, Copyright 2004-2006 Linden Research, Inc."; 5CFBundleGetInfoString = "Second Life version 1.14.0.0, Copyright 2004-2007 Linden Research, Inc.";
diff --git a/linden/indra/newview/Info-SecondLife.plist b/linden/indra/newview/Info-SecondLife.plist
index 6e1de8b..fbfd040 100644
--- a/linden/indra/newview/Info-SecondLife.plist
+++ b/linden/indra/newview/Info-SecondLife.plist
@@ -32,7 +32,7 @@
32 </dict> 32 </dict>
33 </array> 33 </array>
34 <key>CFBundleVersion</key> 34 <key>CFBundleVersion</key>
35 <string>1.13.3.2</string> 35 <string>1.14.0.0</string>
36 <key>CSResourcesFileMapped</key> 36 <key>CSResourcesFileMapped</key>
37 <true/> 37 <true/>
38</dict> 38</dict>
diff --git a/linden/indra/newview/app_settings/keywords.ini b/linden/indra/newview/app_settings/keywords.ini
index 0545c38..bf49c2c 100644
--- a/linden/indra/newview/app_settings/keywords.ini
+++ b/linden/indra/newview/app_settings/keywords.ini
@@ -468,6 +468,10 @@ PARCEL_DETAILS_OWNER Used with llGetParcelDetails to get the parcel owner id.
468PARCEL_DETAILS_GROUP Used with llGetParcelDetails to get the parcel group id. 468PARCEL_DETAILS_GROUP Used with llGetParcelDetails to get the parcel group id.
469PARCEL_DETAILS_AREA Used with llGetParcelDetails to get the parcel area in square meters. 469PARCEL_DETAILS_AREA Used with llGetParcelDetails to get the parcel area in square meters.
470 470
471STRING_TRIM_HEAD Used with llStringTrim to trim leading spaces from a string.
472STRING_TRIM_TAIL Used with llStringTrim to trim trailing spaces from a string.
473STRING_TRIM Used with llStringTrim to trim both leading and trailing spaces from a string.
474
471# string constants 475# string constants
472[word .1, .3, .5] 476[word .1, .3, .5]
473NULL_KEY Indicates an empty key 477NULL_KEY Indicates an empty key
diff --git a/linden/indra/newview/app_settings/shaders/class1/lighting/lightF.glsl b/linden/indra/newview/app_settings/shaders/class1/lighting/lightF.glsl
index b2a6d67..c169fce 100644
--- a/linden/indra/newview/app_settings/shaders/class1/lighting/lightF.glsl
+++ b/linden/indra/newview/app_settings/shaders/class1/lighting/lightF.glsl
@@ -5,7 +5,7 @@ uniform sampler2D diffuseMap;
5void default_lighting() 5void default_lighting()
6{ 6{
7 vec4 color = gl_Color * texture2D(diffuseMap, gl_TexCoord[0].xy); 7 vec4 color = gl_Color * texture2D(diffuseMap, gl_TexCoord[0].xy);
8 applyScatter(color.rgb); 8 //applyScatter(color.rgb);
9 gl_FragColor = color; 9 gl_FragColor = color;
10} 10}
11 11
diff --git a/linden/indra/newview/app_settings/shaders/class1/objects/shinyF.glsl b/linden/indra/newview/app_settings/shaders/class1/objects/shinyF.glsl
new file mode 100644
index 0000000..12c99a6
--- /dev/null
+++ b/linden/indra/newview/app_settings/shaders/class1/objects/shinyF.glsl
@@ -0,0 +1,13 @@
1void applyScatter(inout vec3 col);
2
3uniform samplerCube environmentMap;
4
5void main()
6{
7 vec3 ref = textureCube(environmentMap, gl_TexCoord[0].xyz).rgb;
8
9 applyScatter(ref);
10
11 gl_FragColor.rgb = ref;
12 gl_FragColor.a = gl_Color.a;
13}
diff --git a/linden/indra/newview/app_settings/shaders/class1/objects/shinyV.glsl b/linden/indra/newview/app_settings/shaders/class1/objects/shinyV.glsl
new file mode 100644
index 0000000..621ff6b
--- /dev/null
+++ b/linden/indra/newview/app_settings/shaders/class1/objects/shinyV.glsl
@@ -0,0 +1,27 @@
1void default_scatter(vec3 viewVec, vec3 lightDir);
2
3uniform vec4 origin;
4
5void main()
6{
7 //transform vertex
8 gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
9
10 vec3 pos = (gl_ModelViewMatrix * gl_Vertex).xyz;
11 vec3 norm = normalize(gl_NormalMatrix * gl_Normal);
12
13 gl_FrontColor = gl_Color;
14
15 vec3 ref = reflect(pos, norm);
16
17 vec3 d = pos - origin.xyz;
18 float dist = dot(normalize(d), ref);
19 vec3 e = d + (ref * max(origin.w-dist, 0.0));
20
21 ref = e - origin.xyz;
22
23 gl_TexCoord[0] = gl_TextureMatrix[0]*vec4(ref,1.0);
24
25 default_scatter(pos.xyz, gl_LightSource[0].position.xyz);
26}
27
diff --git a/linden/indra/newview/app_settings/shaders/class2/environment/waterV.glsl b/linden/indra/newview/app_settings/shaders/class2/environment/waterV.glsl
index 5f06aeb..25309fa 100644
--- a/linden/indra/newview/app_settings/shaders/class2/environment/waterV.glsl
+++ b/linden/indra/newview/app_settings/shaders/class2/environment/waterV.glsl
@@ -47,7 +47,7 @@ void main()
47 gl_TexCoord[0].zw = littleWave1; 47 gl_TexCoord[0].zw = littleWave1;
48 gl_TexCoord[1].xy = littleWave2; 48 gl_TexCoord[1].xy = littleWave2;
49 gl_TexCoord[1].zw = bigWave; 49 gl_TexCoord[1].zw = bigWave;
50 gl_TexCoord[2] = oEyeVec; 50 gl_TexCoord[2].xyz = oEyeVec.xyz;
51 gl_TexCoord[3].xyz = oRefCoord; 51 gl_TexCoord[3].xyz = oRefCoord;
52 gl_FrontColor = col; 52 gl_FrontColor = col;
53} 53}
diff --git a/linden/indra/newview/app_settings/shaders/class2/lighting/lightF.glsl b/linden/indra/newview/app_settings/shaders/class2/lighting/lightF.glsl
index 0ef1129..6f732ed 100644
--- a/linden/indra/newview/app_settings/shaders/class2/lighting/lightF.glsl
+++ b/linden/indra/newview/app_settings/shaders/class2/lighting/lightF.glsl
@@ -5,7 +5,7 @@ uniform sampler2D diffuseMap;
5void default_lighting() 5void default_lighting()
6{ 6{
7 vec4 color = gl_Color * texture2D(diffuseMap, gl_TexCoord[0].xy); 7 vec4 color = gl_Color * texture2D(diffuseMap, gl_TexCoord[0].xy);
8 applyScatter(color.rgb); 8 //applyScatter(color.rgb);
9 gl_FragColor = color; 9 gl_FragColor = color;
10} 10}
11 11
diff --git a/linden/indra/newview/app_settings/shaders/class3/environment/groundF.glsl b/linden/indra/newview/app_settings/shaders/class3/environment/groundF.glsl
deleted file mode 100644
index 8618dad..0000000
--- a/linden/indra/newview/app_settings/shaders/class3/environment/groundF.glsl
+++ /dev/null
@@ -1,12 +0,0 @@
1vec4 getScatter(vec3 viewVec, vec3 lightDir);
2
3varying vec3 lightd;
4varying vec3 viewVec;
5
6void main()
7{
8 vec4 color = gl_Color;
9 vec4 haze = getScatter(viewVec, lightd) * vec4(gl_Fog.color.rgb, 1.0);
10 color.rgb = haze.rgb + haze.a * color.rgb;
11 gl_FragColor = color;
12}
diff --git a/linden/indra/newview/app_settings/shaders/class3/environment/groundV.glsl b/linden/indra/newview/app_settings/shaders/class3/environment/groundV.glsl
deleted file mode 100644
index a6f5270..0000000
--- a/linden/indra/newview/app_settings/shaders/class3/environment/groundV.glsl
+++ /dev/null
@@ -1,11 +0,0 @@
1varying vec3 lightd;
2varying vec3 viewVec;
3
4void main()
5{
6 gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
7 lightd = gl_LightSource[0].position.xyz;
8 viewVec = (gl_ModelViewMatrix * gl_Vertex).xyz;
9
10 gl_FrontColor = gl_Color;
11}
diff --git a/linden/indra/newview/app_settings/shaders/class3/environment/scatterF.glsl b/linden/indra/newview/app_settings/shaders/class3/environment/scatterF.glsl
deleted file mode 100644
index 7a9245f..0000000
--- a/linden/indra/newview/app_settings/shaders/class3/environment/scatterF.glsl
+++ /dev/null
@@ -1,25 +0,0 @@
1uniform sampler2D scatterMap;
2
3//for per-pixel scatter
4vec4 getScatter(vec3 viewVec, vec3 lightDir)
5{
6 vec2 scatterCoord;
7 scatterCoord.x = length(viewVec);
8 vec3 normVec = viewVec / scatterCoord.x;
9 scatterCoord.y = dot(normVec, lightDir)*0.5 + 0.5;
10 scatterCoord.x = scatterCoord.x / gl_Fog.end;
11 scatterCoord.x *= scatterCoord.x; // HACK!! Remove this when we can push the view distance farther out
12 return texture2D(scatterMap, scatterCoord) * vec4(gl_Fog.color.rgb, 1.0);
13}
14
15void applyScatter(inout vec3 color, vec4 haze)
16{
17 color.rgb = haze.rgb + haze.a * color.rgb;
18}
19
20//for per-vertex scatter
21void applyScatter(inout vec3 color)
22{
23 vec4 haze = texture2D(scatterMap, gl_TexCoord[5].xy) * vec4(gl_Fog.color.rgb, 1.0);
24 color.rgb = haze.rgb + haze.a * color.rgb;
25}
diff --git a/linden/indra/newview/app_settings/shaders/class3/environment/scatterV.glsl b/linden/indra/newview/app_settings/shaders/class3/environment/scatterV.glsl
deleted file mode 100644
index c9ebd9e..0000000
--- a/linden/indra/newview/app_settings/shaders/class3/environment/scatterV.glsl
+++ /dev/null
@@ -1,16 +0,0 @@
1
2vec2 getScatterCoord(vec3 viewVec, vec3 lightDir)
3{
4 vec2 scatterCoord;
5 scatterCoord.x = length(viewVec);
6 vec3 normVec = normalize(viewVec);
7 scatterCoord.y = dot(normVec, lightDir)*0.5 + 0.5;
8 scatterCoord.x = scatterCoord.x / gl_Fog.end;
9 scatterCoord.x *= scatterCoord.x; // HACK!! Remove this when we can push the view distance farther out
10 return scatterCoord;
11}
12
13void default_scatter(vec3 viewVec, vec3 lightDir)
14{
15 gl_TexCoord[5].xy = getScatterCoord(viewVec, lightDir);
16}
diff --git a/linden/indra/newview/app_settings/shaders/class3/environment/waterF.glsl b/linden/indra/newview/app_settings/shaders/class3/environment/waterF.glsl
new file mode 100644
index 0000000..3a117c5
--- /dev/null
+++ b/linden/indra/newview/app_settings/shaders/class3/environment/waterF.glsl
@@ -0,0 +1,145 @@
1void applyScatter(inout vec3 color);
2
3uniform sampler2D diffuseMap;
4uniform sampler2D bumpMap;
5uniform samplerCube environmentMap; //: TEXUNIT4, // Environment map texture
6uniform sampler2D screenTex; // : TEXUNIT5
7
8uniform vec3 lightDir;
9uniform vec3 specular;
10uniform float lightExp;
11uniform vec2 fbScale;
12uniform float refScale;
13
14float msin(float x) {
15 float k = sin(x)+1.0;
16 k *= 0.5;
17 k *= k;
18 return 2.0 * k;
19}
20
21float mcos(float x) {
22 float k = cos(x)+1.0;
23 k *= 0.5;
24 k *= k;
25 return 2.0 * k;
26}
27
28float waveS(vec2 v, float t, float a, float f, vec2 d, float s, sampler1D sinMap)
29{
30 return texture1D(sinMap, (dot(d, v)*f + t*s)*f).r*a;
31}
32
33float waveC(vec2 v, float t, float a, float f, vec2 d, float s, sampler1D sinMap)
34{
35 return texture1D(sinMap, (dot(d, v)*f + t*s)*f).g*a*2.0-1.0;
36}
37
38float magnitude(vec3 vec) {
39 return sqrt(dot(vec,vec));
40}
41
42vec3 mreflect(vec3 i, vec3 n) {
43 return i + n * 2.0 * abs(dot(n,i))+vec3(0.0,0.0,0.5);
44}
45
46void main()
47{
48 vec2 texCoord = gl_TexCoord[0].xy; // Texture coordinates
49 vec2 littleWave1 = gl_TexCoord[0].zw;
50 vec2 littleWave2 = gl_TexCoord[1].xy;
51 vec2 bigWave = gl_TexCoord[1].zw;
52 vec3 viewVec = gl_TexCoord[2].xyz;
53 vec4 refCoord = gl_TexCoord[3];
54 vec4 col = gl_Color;
55 vec4 color;
56
57 //get color from alpha map (alpha denotes water depth), rgb denotes water color
58 vec4 wcol = texture2D(diffuseMap, texCoord.xy);
59
60 float dist = length(viewVec);
61
62 //store texture alpha
63 float da = wcol.a;
64
65 //modulate by incoming water color
66 //wcol.a *= refCoord.w;
67
68 //scale wcol.a (water depth) for steep transition
69 wcol.a *= wcol.a;
70
71 //normalize view vector
72 viewVec = normalize(viewVec);
73
74 //get bigwave normal
75 vec3 wavef = texture2D(bumpMap, bigWave).xyz*2.0;
76
77 vec3 view = vec3(viewVec.x, viewVec.y, viewVec.z);
78
79 float dx = 1.0-(dot(wavef*2.0-vec3(1.0), view))*da;
80 dx *= 0.274;
81
82 //get detail normals
83 vec3 dcol = texture2D(bumpMap, littleWave1+dx*view.xy).rgb*0.75;
84 dcol += texture2D(bumpMap, littleWave2+view.xy*dx*0.1).rgb*1.25;
85
86 //interpolate between big waves and little waves (big waves in deep water)
87 wavef = wavef*wcol.a + dcol*(1.0-wcol.a);
88
89 //crunch normal to range [-1,1]
90 wavef -= vec3(1,1,1);
91 wavef = normalize(wavef);
92 //wavef = vec3(0.0, 0.0, 1.0);
93
94 //get base fresnel component
95 float df = dot(viewVec,wavef);
96 //translate and flip fresnel
97 df = 1.0-clamp(-df,0.0,1.0);
98
99 //set output alpha based on fresnel
100 color.a = clamp((1.0-df+da)*0.5,0.0,1.0);
101
102 //calculate reflection vector
103 vec3 refnorm = vec3(wavef.x*0.5, wavef.y*0.5, wavef.z*2.0);
104
105 //ramp normal towards eye for far view stuff
106 float ramp = dist/256.0;
107 refnorm -= viewVec * ramp;
108 vec3 ref = reflect(viewVec.xyz, normalize(refnorm));
109 ref.z /= sqrt(dist);
110
111 //get diffuse component
112 float diff = clamp(dot(ref, wavef),0.0,1.0)*0.9;
113
114 //fudge diffuse for extra contrast and ambience
115 diff *= diff;
116 diff += 0.4;
117
118 vec3 fog = gl_TexCoord[5].rgb*0.5;
119
120 //read from reflection map
121 vec3 refcol = textureCube(environmentMap, ref).rgb;
122 //tint reflection by fresnal, bias by z component of view vec
123 color.rgb = refcol*(df*df*dcol.x*dcol.y);
124
125 //add diffuse contribution (fake blue water, yay!)
126 vec3 blue = vec3(0.1, 0.3, 0.6);
127 color.rgb += (diff/(max(ramp, 1.0)))*vec3(fog.r*blue.r, fog.g*blue.g, fog.b*blue.b);
128
129 //figure out distortion vector (ripply)
130 vec2 distort = clamp(((refCoord.xy/refCoord.z) * 0.5 + 0.5 + wavef.xy*refScale),0.0,0.99);
131
132 //read from framebuffer (offset)
133 vec4 fb = texture2D(screenTex, distort*fbScale);
134
135 //tint by framebuffer
136 color.rgb = da*color.rgb + (1.0-da)*fb.rgb;
137
138 //render as solid (previous pixel color already present)
139 color.a = 1.0;
140
141 //apply fog
142 applyScatter(color.rgb);
143
144 gl_FragColor = color;
145}
diff --git a/linden/indra/newview/app_settings/viewerart.ini b/linden/indra/newview/app_settings/viewerart.ini
deleted file mode 100644
index e3d7af4..0000000
--- a/linden/indra/newview/app_settings/viewerart.ini
+++ /dev/null
@@ -1,503 +0,0 @@
1version 101
2closebox.tga 47a8c844-cd2a-4b1a-be01-df8b1612fe5d
3close_in_blue.tga e5821134-23c0-4bd0-af06-7fa95b9fb01a
4tearoffbox.tga 74e1a96f-4833-a24d-a1bb-1bce1468b0e7
5tearoff_pressed.tga d2524c13-4ba6-af7c-e305-8ac6cc18d86a
6resize_handle_bottom_right_blue.tga e3690e25-9690-4f6c-a745-e7dcd885285a
7scrollbutton_up_out_blue.tga dad084d7-9a46-452a-b0ff-4b9f1cefdde9
8scrollbutton_up_in_blue.tga a93abdf3-27b5-4e22-a8fa-c48216cd2e3a
9scrollbutton_down_out_blue.tga b4ecdecf-5c8d-44e7-b882-17a77e88ed55
10scrollbutton_down_in_blue.tga d2421bab-2eaf-4863-b8f6-5e4c52519247
11scrollbutton_left_out_blue.tga 43773e8d-49aa-48e0-80f3-a04715f4677a
12scrollbutton_left_in_blue.tga ea137a32-6718-4d05-9c22-7d570d27b2cd
13scrollbutton_right_out_blue.tga 3d700d19-e708-465d-87f2-46c8c0ee7938
14scrollbutton_right_in_blue.tga b749de64-e903-4c3c-ac0b-25fb6fa39cb5
15spin_up_out_blue.tga 56576e6e-6710-4e66-89f9-471b59122794
16spin_up_in_blue.tga c8450082-96a0-4319-8090-d3ff900b4954
17spin_down_out_blue.tga b6d240dd-5602-426f-b606-bbb49a30726d
18spin_down_in_blue.tga a985ac71-052f-48e6-9c33-d931c813ac92
19radio_active_false.tga 7a1ba9b8-1047-4d1e-9cfc-bc478c80b63f
20radio_active_true.tga 52f09e07-5816-4052-953c-94c6c10479b7
21radio_inactive_false.tga 90688481-67ff-4af0-be69-4aa084bcad1e
22radio_inactive_true.tga 1975db39-aa29-4251-aea0-409ac09d414d
23checkbox_enabled_false.tga 05bb64ee-96fd-4243-b74e-f40a41bc53ba
24checkbox_enabled_true.tga cf4a2ed7-1533-4686-9dde-df9a37ddca55
25checkbox_disabled_false.tga 7d94cb59-32a2-49bf-a516-9e5a2045f9d9
26checkbox_disabled_true.tga c817c642-9abd-4236-9287-ae0513fe7d2b
27tab_top_blue.tga 1ed83f57-41cf-4052-a3b4-2e8bb78d8191
28tab_top_selected_blue.tga 16d032e8-817b-4368-8a4e-b7b947ae3889
29tab_bottom_blue.tga bf0a8779-689b-48c3-bb9a-6af546366ef4
30tab_bottom_selected_blue.tga c001d8fd-a869-4b6f-86a1-fdcb106df9c7
31tab_left.tga 1097dcb3-aef9-8152-f471-431d840ea89e
32tab_left_selected.tga bea77041-5835-1661-f298-47e2d32b7a70
33crosshairs.tga 6e1a3980-bf2d-4274-8970-91e60d85fb52
34move_backward_in.tga db11d956-5e7d-4aa5-b39d-7774d339fc5c
35move_backward_out.tga 3ae8bb18-ed97-4cd3-ae5c-d54bc8479fe7
36move_down_in.tga b92a70b9-c841-4c94-b4b3-cee9eb460d48
37move_down_out.tga b5abc9fa-9e62-4e03-bc33-82c4c1b6b689
38move_forward_in.tga 54197a61-f5d1-4c29-95d2-c071d08849cb
39move_forward_out.tga a0eb4021-1b20-4a53-892d-8faa9265a6f5
40move_left_in.tga 724996f5-b956-46f6-9844-4fcfce1d5e83
41move_left_out.tga 82476321-0374-4c26-9567-521535ab4cd7
42move_right_in.tga 7eeb57d2-3f37-454d-a729-8b217b8be443
43move_right_out.tga 1fbe4e60-0607-44d1-a50a-032eff56ae75
44move_turn_left_in.tga 95463c78-aaa6-464d-892d-3a805b6bb7bf
45move_turn_left_out.tga 13a93910-6b44-45eb-ad3a-4d1324c59bac
46move_turn_right_in.tga 5e616d0d-4335-476f-9977-560bccd009da
47move_turn_right_out.tga 5a44fd04-f52b-4c30-8b00-4a31e27614bd
48move_up_out.tga f887146d-829f-4e39-9211-cf872b78f97c
49move_up_in.tga 49b4b357-e430-4b56-b9e0-05b8759c3c82
50cam_rotate_out.tga 88745b46-da05-11d5-8ac0-0003477c4611
51cam_rotate_in.tga 70bf2262-3eed-4996-88ac-076907e8921d
52cam_zoom_out.tga bb02e941-cb3b-4dd3-892a-6841b5de6e45
53cam_zoom_plus_in.tga c7aefd32-ce13-4242-82cc-2631d44ff9d3
54cam_zoom_minus_in.tga deed3f4b-93e9-4183-a3b0-a5a98a6de1bb
55cam_tracking_out.tga 95c4ea0e-e3c2-4904-b847-7d7676139ebb
56cam_tracking_in.tga fe2fc73b-5a64-4a8e-aacc-46fa81faf96a
57direction_arrow.tga 586383e8-4d9b-4fba-9196-2b5938e79c2c
58minimize.tga 34c9398d-bb78-4643-9633-46a2fa3e9637
59minimize_inactive.tga 6e72abba-1378-437f-bf7a-f0c15f3e99a3
60minimize_pressed.tga 39801651-26cb-4926-af57-7af9352c273c
61restore.tga 111b39de-8928-4690-b7b2-e17d5c960277
62restore_inactive.tga 0eafa471-70af-4882-b8c1-40a310929744
63restore_pressed.tga 90a0ed5c-2e7b-4845-9958-a64a1b30f312
64combobox_arrow.tga b31c1335-0e9c-4927-bc90-53277777d9c1
65white.tga 5748decc-f629-461c-9a36-a35a221fe21f
66darkgray.tga 267e26d3-e0e1-41b8-91b1-3b337102928d
67lightgray.tga c520bf46-cc5d-412b-a60b-9f1bd245189f
68eyes.tga 6522e74d-1660-4e7f-b601-6f48c1659a77
69hair.tga 7ca39b4c-bd19-4699-aff7-f93fd03d3e7b
70black.tga e2244626-f22f-4839-8123-1e7baddeb659
71close_inactive_blue.tga 779e4fa3-9b13-f74a-fba9-3886fe9c86ba
72button_disabled_32x128.tga f8124d60-2875-c358-7847-2acb63e5400c
73button_enabled_32x128.tga d8faf8cb-ee6e-b0b5-abd9-bde873ad3461
74button_enabled_selected_32x128.tga 1eddba75-b682-110a-104e-6cdcce616a25
75button_anim_play_selected.tga 119c37bb-24af-45fe-ae11-3a6bc3c85138
76button_anim_pause_selected.tga ad65d67a-777b-fbfa-693d-4bdcfca2acca
77button_anim_pause.tga db2d9c2d-0bbd-21e2-e83a-103ea2def7a8
78button_anim_play.tga 2a7f6738-5d82-2ff3-d419-30ed09cbb72b
79button_anim_stop.tga e10c9e36-d9f6-c8b4-de96-557dccce9205
80button_anim_stop_selected.tga b8c0e0aa-2771-439e-c919-d2f5dad69a1c
81rounded_square.tga 38ce8b3c-fb30-5c59-9926-bd643613f606
82rounded_square_soft.tga 4c95e6bc-fe77-9cb4-b58a-909848042c1e
83badge_ok.tga 211035a7-c313-378d-478c-e80bbd0fde63
84badge_note.tga 13f6e639-b3f9-28da-a1e6-e990a43052b6
85badge_warn.tga 0992d4bc-7af8-4a1f-f2e6-e6c4083b066e
86badge_error.tga 00c50485-8491-ab70-2ea8-43f26fd028e2
87status_money.tga 5863eb7a-1546-6501-533a-6061f73a36b7
88status_health.tga 4330e8ce-b39b-1eb8-c2ec-a97c0b3947b5
89status_fly.tga 0e058115-5b8f-c3d7-dcaa-9623d92885d1
90status_build.tga 175a6b75-45c9-c2c2-4765-bf37a3909b53
91status_busy.tga beb0d821-6725-abdf-032d-1f70cdabde82
92status_scripts.tga 4cc1afcd-04dd-178f-e074-0f9dc730ab45
93status_buy_currency.tga f43a535a-59ac-26e3-84bc-c786735fabe4
94status_buy_currency_pressed.tga bfa5be70-37c7-8126-fecd-df55390954d5
95status_buy_land.tga 1a0edac5-3e50-fc9b-2752-70c1f69cb959
96status_buy_land_pressed.tga 257647b7-199f-99ff-8be9-f6753289a3aa
97terrain_dirt.tga b8d3965a-ad78-bf43-699b-bff8eca6c975
98terrain_grass.tga abb783e6-3e93-26c0-248a-247666855da3
99terrain_mountain.tga 179cdabd-398a-9b6b-1391-4dc333ba321f
100terrain_rock.tga beb169c7-11ea-fff2-efe5-0f24dc881df2
101terrain_dirt_detail.tga 0bc58228-74a0-7e83-89bc-5c23464bcec5
102terrain_grass_detail.tga 63338ede-0037-c4fd-855b-015d77112fc8
103terrain_mountain_detail.tga 303cd381-8560-7579-23f1-f0a880799740
104terrain_rock_detail.tga 53a2f406-4895-1d13-d541-d2e3b86bc19c
105square_btn_32x128.tga b28df901-6b8d-d31c-7903-4eb9676d4bfc
106square_btn_selected_32x128.tga c48c9e95-191b-96d3-08b2-6e8ada58b651
107tree_pine_1.tga 0187babf-6c0d-5891-ebed-4ecab1426683
108tree_oak.tga 8a515889-eac9-fb55-8eba-d2dc09eb32c8
109tree_tropical_1.tga 5bc11cd6-2f40-071e-a8da-0903394204f9
110tree_palm_1.tga ca4e8c27-473c-eb1c-2f5d-50ee3f07d85c
111tree_dogwood.tga 64367bd1-697e-b3e6-0b65-3f862a577366
112tree_tropical_2.tga cdd9a9fc-6d0b-f90d-8416-c72b6019bca8
113tree_palm_2.tga 2d784476-d0db-9979-0cff-9408745a7cf3
114tree_cypress_1.tga fb2ae204-3fd1-df33-594f-c9f882830e66
115tree_cypress_2.tga 30047cec-269d-408e-0c30-b2603b887268
116tree_pine_2.tga d691a01c-13b7-578d-57c0-5caef0b4e7e1
117tree_plumeria.tga 6de37e4e-7029-61f5-54b8-f5e63f983f58
118winter_tree_aspen.tga 7c0cf89b-44b1-1ce2-dd74-07102a98ac2a
119winter_tree_pine_1.tga 10d2a01a-0818-84b9-4b96-c2eb63256519
120winter_tree_pine_2.tga 67931331-0c02-4876-1255-28770896c6a2
121tree_eucalyptus.tga a6162133-724b-54df-a12f-51cd070ad6f3
122tree_fern.tga 8872f2b8-31db-42d8-580a-b3e4a91262de
123tree_eelgrass.tga 96b4de31-f4fa-337d-ec78-451e3609769e
124tree_sea_sword.tga 5894e2e7-ab8d-edfa-e61c-18cf16854ba3
125tree_kelp_1.tga 2caf1179-7861-6ff3-4b7d-46e17780bdfa
126tree_kelp_2.tga 2a4880b6-b7a3-690a-2049-bfbe38eafb9f
127tree_beach_grass_1.tga 18fb888b-e8f1-dce7-7da7-321d651ea6b0
128tool_dozer.tga d2a0d4d4-54eb-4d16-be4b-4eae43845c74
129tool_dozer_active.tga d4afdbbe-1550-4b7d-91de-95731f47e8e3
130tool_land.tga 86fe4df4-0ecb-4382-b9ae-475925a92388
131tool_land_active.tga 34e60587-0791-4a07-8918-f5995fcc22a3
132tool_zoom.tga 27eb8829-fe65-45ed-a49a-73aac42f4b38
133tool_zoom_active.tga 69445f58-5c8e-44e0-9d2e-47408bb43b39
134tool_orbit.tga 06964fe4-033f-448a-95c9-30dc41d1be8b
135tool_orbit_active.tga ee4e07db-3f72-4098-bd4c-aef34515a7bc
136tool_pan.tga a32aa302-0a15-48d2-b2b1-4d69f1161173
137tool_pan_active.tga 24d9ad33-0b42-4eb5-99a3-659d838bc5c0
138inv_folder_texture.tga 743f035b-a049-43f4-16c7-7ec8daa2c481
139inv_folder_sound.tga e10cb910-1e71-da47-bd12-8c53f7793714
140inv_folder_callingcard.tga a3735971-e2b2-d78a-580d-d265cd8f2484
141inv_folder_landmark.tga 9f921155-7c8c-e276-d5ec-03ac9340584d
142inv_folder_script.tga baa5c310-6a6d-cc48-51eb-65196ba31d77
143inv_folder_object.tga 113e5133-fd0d-ee51-4a59-9d67ca10e8a7
144inv_folder_notecard.tga a9e75d84-5073-9cb7-10a9-1ca68ef5c7ba
145inv_folder_clothing.tga f1427d3d-b2e8-97c4-69ab-1f36d4c0e8f0
146inv_folder_bodypart.tga 1fe05580-1d2f-0345-b28b-52b6e3a20e5d
147inv_folder_trash.tga 88ad072e-ea0b-aabd-5ac0-b37862a6eb66
148inv_folder_plain_closed.tga 86f00960-c3e9-9680-145d-3beffd743e9c
149inv_folder_plain_open.tga d15dc243-2d0b-47af-0ce1-ec376464bdc8
150inv_folder_snapshot.tga 6efe85e7-800f-1843-296c-a5b7adffe091
151inv_folder_lostandfound.tga 9a371a04-297d-bacf-0d16-5f49753efe1d
152inv_folder_animation.tga 4d59b3ee-f29d-b912-2bcc-9bb1f8a07ec6
153inv_folder_gesture.tga 4de9129a-9fc1-d759-d739-364293906ba2
154inv_item_texture.tga 19f452d7-4eee-9f46-76cc-5497d17f1dd9
155inv_item_sound.tga eb414d69-c77d-d4e7-66e6-6c2e6f6c1976
156inv_item_callingcard_online.tga 672cc53e-8dc0-ba91-2a4e-574104cf071c
157inv_item_callingcard_offline.tga d0afe86b-2489-7600-55b7-6abb0a63d9f9
158inv_item_landmark.tga bf25a2a0-85da-7fa0-0993-e461768d0221
159inv_item_landmark_visited.tga 229fac85-5428-4ab7-adeb-eb8389e91092
160inv_item_script.tga 59a3df81-ed76-06c9-7264-6dada535e7a3
161inv_item_clothing.tga 34dfe476-8e26-0e3a-11cf-76cc4a7126ce
162inv_item_object.tga 0f0780a0-89c4-742a-ef28-26405a41cf85
163inv_item_notecard.tga 23ce8a2c-9ea2-d863-6572-806f0645b0c7
164inv_item_bodypart.tga d2a5362d-5c55-57dd-a9e9-5c814d1ddc16
165inv_item_attach.tga 5bcae41e-aa5d-02f8-edf1-605ebdd875ab
166inv_item_snapshot.tga 3810d584-b092-7caa-57e0-010f192b9659
167inv_item_eyes.tga eaa5fd96-5c25-06ef-2280-7ef20203e167
168inv_item_gloves.tga 117b11cb-c04e-5081-13da-1a8846070fd0
169inv_item_hair.tga 6bca3bf4-ed6d-d438-63a0-2a7066d03a0b
170inv_item_jacket.tga 8df59386-56e0-c811-0443-840da3acb3a5
171inv_item_pants.tga a87a58ca-f857-63b1-0acf-072711ed1bdb
172inv_item_shape.tga 4463e433-4db5-79ef-c1b0-4821b03ddb07
173inv_item_shirt.tga e2ffb62b-6abc-22d6-952d-764759b4d636
174inv_item_shoes.tga cf384fa5-1edd-c37c-2134-283dd4fe3396
175inv_item_skirt.tga 0b43f826-2abc-2944-7d72-10777a51d19b
176inv_item_socks.tga 22137c6d-6ec5-6eee-9a2e-2d7a9e6cbcd4
177inv_item_underpants.tga 2f15dc09-4385-526c-aa5d-d9d516ec7d99
178inv_item_undershirt.tga f72ab629-a3ab-de0c-35c0-5285e27478ce
179inv_item_animation.tga b5cda0d6-d196-ce48-63db-d04323ef8931
180inv_item_gesture.tga 5579245d-d5bf-5f13-46b0-8624490de24c
181pixiesmall.tga 168e6813-096e-07ea-97ae-fd416826f627
182legend.tga ca7609c6-6ec6-32d9-332e-0d8f437ef644
183propertyline.tga e3548c46-8d5e-03da-fcab-4fc36ad818bb
184startup_logo.tga 66864f3c-e095-d9c8-058d-d6575e6ed1b8
185grass_texture_1.tga 79504bf5-c3ec-0763-6563-d843de66d0a1
186grass_texture_2.tga 6c4727b8-ac79-ba44-3b81-f9aa887b47eb
187grass_texture_3.tga 99bd60a2-3250-efc9-2e39-2fbcadefbecc
188grass_texture_4.tga 7a2b3a4a-53c2-53ac-5716-aac7d743c020
189undergrowth_1.tga 8f458549-173b-23ff-d4ff-bfaa5ea2371b
190silhouette.tga da5d4079-7819-6b53-d2a4-dc9929381d7d
191avatar_thumb_bkgrnd.tga 3a7f4f0d-be14-ee78-29e3-fc8b0b2a68d3
192missing_asset.tga 32dfd1c8-7ff6-5909-d983-6d4adfb4255d
193alpha_gradient.tga e97cf410-8e61-7005-ec06-629eba4cd1fb
194alpha_gradient_2d.tga 38b86f85-2575-52a9-a531-23108d8da837
195alpha_noise.tga b9e1cf8a-9660-c020-0c69-18f1ea27268a
196alpha_sizzle.tga e121e2fc-7573-740f-edfd-0d45a9ba486e
197bump_woodgrain.tga 058c75c0-a0d5-f2f8-43f3-e9699a89c2fc
198bump_bark.tga 6c9fa78a-1c69-2168-325b-3e03ffa348ce
199bump_bricks.tga b8eed5f0-64b7-6e12-b67f-43fa8e773440
200bump_checker.tga 9deab416-9c63-78d6-d558-9a156f12044c
201bump_concrete.tga db9d39ec-a896-c287-1ced-64566217021e
202bump_crustytile.tga f2d7b6f6-4200-1e9a-fd5b-96459e950f94
203bump_cutstone.tga d9258671-868f-7511-c321-7baef9e948a4
204bump_discs.tga d21e44ca-ff1c-a96e-b2ef-c0753426b7d9
205bump_gravel.tga 4726f13e-bd07-f2fb-feb0-bfa2ac58ab61
206bump_petridish.tga e569711a-27c2-aad4-9246-0c910239a179
207bump_siding.tga 073c9723-540c-5449-cdd4-0e87fdc159e3
208bump_stonetile.tga ae874d1a-93ef-54fb-5fd3-eb0cb156afc0
209bump_stucco.tga 92e66e00-f56f-598a-7997-048aa64cde18
210bump_suction.tga 83b77fc6-10b4-63ec-4de7-f40629f238c5
211bump_weave.tga 735198cf-6ea0-2550-e222-21d3c6a341ae
212icon_avatar_online.tga 529ed15b-3d41-dcc1-79de-90bf21770b5b
213icon_avatar_offline.tga 34648c67-5bfb-5790-e05e-8bd6600fd087
214icon_event.tga be235ae0-53cf-1d68-b3ae-cf375ed1fb58
215icon_event_mature.tga cc090999-1b3e-2e97-7a38-c9f4afd10297
216icon_group.tga 04237108-a879-5a95-9b0c-b18fd09bc447
217icon_place.tga ba0bac4e-815e-14e1-2895-5065b8c703b3
218icon_top_pick.tga 77ca91a2-4431-aeaf-6249-3dd99c7dd86d
219icon_popular.tga bdd47da5-5b5b-c906-37ad-16aaa64f096f
220icon_for_sale.tga f20728fd-1670-3771-2293-e0dd3f0bcaab
221icon_auction.tga 96abf5b1-335c-6b76-61e3-74ada07f3cb8
222icon_land_for_landless.tga c421ddf2-b9d7-b373-503c-f4c423f37f1c
223icon_day_cycle.tga 5b30a285-f1e3-92b1-dcd3-0d07366ced3e
224icon_lock.tga 9beb8cdd-3dce-53c2-b28e-e1f3bc2ec0a4
225noentrylines.tga 5d3e196b-fd4d-ada7-e4c1-99f8e9f1cfbf
226noentrypasslines.tga ac8f8627-6a30-8da8-d4bd-958668eea7a0
227notify_tip_icon.tga 74ba3584-58ea-9984-5b76-62d37942ab77
228notify_box_icon.tga b2ef2d31-9714-a07b-6ca7-31638166364b
229notify_next.tga 07d0ea4c-af0c-aad1-dbbf-c24020ff2b80
230map_avatar_you_8.tga 02fbdc40-5e07-a6e1-228b-58e10f8335b7
231map_avatar_8.tga 0be58a91-8065-c02b-7a12-2cc14dddbc37
232map_avatar_16.tga db0dadd5-026a-88cf-f5c1-523a0a2daa3e
233map_telehub.tga bf1b2bb0-13b1-40ae-3354-b1b93761bdb4
234map_infohub.tga 85b1a79a-7f6c-9df3-4d6c-17b1a4efb55a
235map_home.tga ae9b8f5f-03a1-2e71-db77-6eb27a1ba181
236map_event.tga 6008be5e-9267-2a3a-9798-e81b076c22ca
237map_event_mature.tga f9cdba28-a227-d613-2f16-ce06209314ae
238map_track_8.tga bfdc7bf6-e2ee-1754-f4df-cc25887714ad
239map_track_16.tga a3878395-ef00-a0e6-ee9a-f45ed6b9ce59
240object_cone.tga c2b8c90a-7dca-26e3-1a63-7aa4a0389cf9
241object_cone_active.tga cf69c64b-f19e-e1f3-a586-42fef31a23be
242object_cube.tga 70c747ac-1de3-a8b9-514d-101753ca6ccb
243object_cube_active.tga f9c5e213-1076-7a7d-7889-52388aad2c1a
244object_cylinder.tga 13e35d95-5f6c-9a91-1766-49dedf9b1267
245object_cylinder_active.tga 3f3e4932-8412-e2a7-cfe9-92caf5978b1b
246object_grass.tga 7ca8e672-920b-4653-3970-1abc91abef58
247object_grass_active.tga d0fc7cc9-646a-6860-cf7c-1d9e58cd6dab
248object_hemi_cone.tga 69d5e60c-739a-40b1-b526-84072121e394
249object_hemi_cone_active.tga 2e0c5435-95bb-1c0d-5da1-42336fb1cfc0
250object_hemi_cylinder.tga f4be3e06-24a8-f86e-acc7-7daefc0572b7
251object_hemi_cylinder_active.tga 67279486-cfc1-3633-de42-85db65db373c
252object_hemi_sphere.tga b67251ab-1716-b9fb-f911-967ba3fe027b
253object_hemi_sphere_active.tga 6c489466-3058-6475-6b1b-e5fc1d49f1f3
254object_pyramid.tga 9dde8b56-2cc4-a932-b63a-38c3a83221ad
255object_pyramid_active.tga e7217b1a-e3d8-e339-d28a-d7714d0b5bee
256object_sphere.tga 7fa122c0-b994-460e-8636-cdc451d67268
257object_sphere_active.tga f2c3bcbc-2904-41a5-1c22-688f176fd1ee
258object_tetrahedron.tga e17db404-9fc5-9534-1038-777c82b2771f
259object_tetrahedron_active.tga 2792ea3b-c052-85fe-d168-a62b2f4e9d7c
260object_tree.tga 710d1bec-fb33-28f1-e77e-ddbb5b51f5ed
261object_tree_active.tga da4835c7-b12a-41dd-11db-dae452f040c2
262object_prism.tga 02935f3a-dcda-3b42-1874-da89d4c12870
263object_prism_active.tga 223aac97-bd2f-ec2e-ad45-5641b77c78f9
264object_torus.tga 19e1f4c9-6aa6-4414-981d-59a1343a6472
265object_torus_active.tga ef2bca77-5004-4547-b00a-3b96e463f89f
266object_tube.tga 7ce81316-a478-480f-961c-435fcbdecaf0
267object_tube_active.tga 55c3e4d1-cfdc-48a8-af32-a34844b91832
268object_ring_active.tga 2c955a73-fa31-237b-a4a1-5c8ede3bae50
269object_ring.tga a7610e41-4647-16d8-0e0e-85a1211c1596
270container_animation.tga c4e657a1-4c86-0159-2da0-32ff948484e6
271container_bodypart.tga 770cb2df-758d-34d5-36c7-e3de06db5b5d
272container_clothing.tga dd90406f-4c8f-a3f9-41df-d562f94f09e0
273container_gesture.tga 59cd31c0-2791-3c48-f740-f0a36c68653e
274container_landmark.tga 24c63386-04f7-ce6f-4ff2-dfb215d2e21f
275container_many_things.tga 849d3292-d9fa-7186-5465-dd7b5fc1ec48
276container_object.tga ad887ae1-2bee-f2c9-6786-5599de3c95c4
277container_script.tga b93bd494-c4bd-bcdf-4a59-35a9497d03f3
278container_sound.tga 5ddea031-cfa3-2776-43e3-c7146c1b4cd6
279container_texture.tga b3f95caf-bd62-bef3-0ded-dea752920629
280avatar_aim_l_bow.bvh 46bb4359-de38-4ed8-6a22-f1f52fe8f506
281avatar_aim_r_bazooka.bvh b5b4a67d-0aee-30d2-72cd-77b333e932ef
282avatar_aim_r_handgun.bvh 3147d815-6338-b932-f011-16b56d9ac18b
283avatar_aim_r_rifle.bvh ea633413-8006-180a-c3ba-96dd1d756720
284avatar_angry_fingerwag.bvh c1bc7f36-3ba0-d844-f93c-93be945d644f
285avatar_angry_tantrum.bvh 11000694-3f41-adc2-606b-eee1d66f3724
286avatar_away.bvh fd037134-85d4-f241-72c6-4f42164fedee
287avatar_backflip.bvh c4ca6188-9127-4f31-0158-23c4e2f93304
288avatar_blowkiss.bvh db84829b-462c-ee83-1e27-9bbee66bd624
289avatar_bow.bvh 82e99230-c906-1403-4d9c-3889dd98daba
290avatar_brush.bvh 349a3801-54f9-bf2c-3bd0-1ac89772af01
291avatar_clap.bvh 9b0c1c4e-8ac7-7969-1494-28c874c4f668
292avatar_courtbow.bvh 9ba1c942-08be-e43a-fb29-16ad440efc50
293avatar_crouch.bvh 201f3fdf-cb1f-dbec-201f-7333e328ae7c
294avatar_crouchwalk.bvh 47f5f6fb-22e5-ae44-f871-73aaaf4a6022
295avatar_dance1.bvh b68a3d7c-de9e-fc87-eec8-543d787e5b0d
296avatar_dance2.bvh 928cae18-e31d-76fd-9cc9-2f55160ff818
297avatar_dance3.bvh 30047778-10ea-1af7-6881-4db7a3a5a114
298avatar_dance4.bvh 951469f4-c7b2-c818-9dee-ad7eea8c30b7
299avatar_dance5.bvh 4bd69a1d-1114-a0b4-625f-84e0a5237155
300avatar_dance6.bvh cd28b69b-9c95-bb78-3f94-8d605ff1bb12
301avatar_dance7.bvh a54d8ee2-28bb-80a9-7f0c-7afbbe24a5d6
302avatar_dance8.bvh b0dc417c-1f11-af36-2e80-7e7489fa7cdc
303avatar_dead.bvh 57abaae6-1d17-7b1b-5f98-6d11a6411276
304avatar_drink.bvh 0f86e355-dd31-a61c-fdb0-3a96b9aad05f
305avatar_express_afraid.bvh 6b61c8e8-4747-0d75-12d7-e49ff207a4ca
306avatar_express_anger.bvh 5747a48e-073e-c331-f6f3-7c2149613d3e
307avatar_express_bored.bvh b906c4ba-703b-1940-32a3-0c7f7d791510
308avatar_express_cry.bvh 92624d3e-1068-f1aa-a5ec-8244585193ed
309avatar_express_embarrased.bvh 514af488-9051-044a-b3fc-d4dbf76377c6
310avatar_express_laugh.bvh 18b3a4b5-b463-bd48-e4b6-71eaac76c515
311avatar_express_repulsed.bvh 36f81a92-f076-5893-dc4b-7c3795e487cf
312avatar_express_sad.bvh 0eb702e2-cc5a-9a88-56a5-661a55c0676a
313avatar_express_shrug.bvh 70ea714f-3a97-d742-1b01-590a8fcd1db5
314avatar_express_surprise.bvh 313b9881-4302-73c0-c7d0-0e7a36b6c224
315avatar_express_wink.bvh 869ecdad-a44b-671e-3266-56aef2e3ac2e
316avatar_express_worry.bvh 9f496bd2-589a-709f-16cc-69bf7df1d36c
317avatar_falldown.bvh 666307d9-a860-572d-6fd4-c3ab8865c094
318avatar_female_walk.bvh f5fc7433-043d-e819-8298-f519a119b688
319avatar_fist_pump.bvh 7db00ccd-f380-f3ee-439d-61968ec69c8a
320avatar_fly.bvh aec4610c-757f-bc4e-c092-c6e9caf18daf
321avatar_flyslow.bvh 2b5a38b2-5e00-3a97-a495-4c826bc443e6
322avatar_hello.bvh 9b29cd61-c45b-5689-ded2-91756b8d76a9
323avatar_hold_l_bow.bvh 8b102617-bcba-037b-86c1-b76219f90c88
324avatar_hold_r_bazooka.bvh ef62d355-c815-4816-2474-b1acc21094a6
325avatar_hold_r_handgun.bvh efdc1727-8b8a-c800-4077-975fc27ee2f2
326avatar_hold_r_rifle.bvh 3d94bad0-c55b-7dcc-8763-033c59405d33
327avatar_hover.bvh 4ae8016b-31b9-03bb-c401-b1ea941db41d
328avatar_hover_down.bvh 20f063ea-8306-2562-0b07-5c853b37b31e
329avatar_hover_up.bvh 62c5de58-cb33-5743-3d07-9e4cd4352864
330avatar_impatient.bvh 5ea3991f-c293-392e-6860-91dfa01278a3
331avatar_jump.bvh 2305bd75-1ca9-b03b-1faa-b176b8a8c49e
332avatar_jumpforjoy.bvh 709ea28e-1573-c023-8bf8-520c8bc637fa
333avatar_kick_roundhouse_r.bvh 49aea43b-5ac3-8a44-b595-96100af0beda
334avatar_kissmybutt.bvh 19999406-3a3a-d58c-a2ac-d72e555dcf51
335avatar_land.bvh 7a17b059-12b2-41b1-570a-186368b6aa6f
336avatar_laugh_short.bvh ca5b3f14-3194-7a2b-c894-aa699b718d1f
337avatar_motorcycle_sit.bvh 08464f78-3a8e-2944-cba5-0c94aff3af29
338avatar_musclebeach.bvh 315c3a41-a5f3-0ba4-27da-f893f769e69b
339avatar_no_head.bvh 5a977ed9-7f72-44e9-4c4c-6e913df8ae74
340avatar_no_unhappy.bvh d83fa0e5-97ed-7eb2-e798-7bd006215cb4
341avatar_nyanya.bvh f061723d-0a18-754f-66ee-29a44795a32f
342avatar_peace.bvh b312b10e-65ab-a0a4-8b3c-1326ea8e3ed9
343avatar_point_me.bvh 17c024cc-eef2-f6a0-3527-9869876d7752
344avatar_point_you.bvh ec952cca-61ef-aa3b-2789-4d1344f016de
345avatar_prejump.bvh 7a4e87fe-de39-6fcb-6223-024b00893244
346avatar_punch_l.bvh f3300ad9-3462-1d07-2044-0fef80062da0
347avatar_punch_onetwo.bvh eefc79be-daae-a239-8c04-890f5d23654a
348avatar_punch_r.bvh c8e42d32-7310-6906-c903-cab5d4a34656
349avatar_rps_countdown.bvh 35db4f7e-28c2-6679-cea9-3ee108f7fc7f
350avatar_rps_paper.bvh 0836b67f-7f7b-f37b-c00a-460dc1521f5a
351avatar_rps_rock.bvh 42dd95d5-0bc6-6392-f650-777304946c0f
352avatar_rps_scissors.bvh 16803a9f-5140-e042-4d7b-d28ba247c325
353avatar_run.bvh 05ddbff8-aaa9-92a1-2b74-8fe77a29b445
354avatar_salute.bvh cd7668a6-7011-d7e2-ead8-fc69eff1a104
355avatar_shoot_l_bow.bvh e04d450d-fdb5-0432-fd68-818aaf5935f8
356avatar_shout.bvh 6bd01860-4ebd-127a-bb3d-d1427e8e0c42
357avatar_sit.bvh 1a5fe8ac-a804-8a5d-7cbd-56bd83184568
358avatar_sit_female.bvh b1709c8d-ecd3-54a1-4f28-d55ac0840782
359avatar_sit_generic.bvh 245f3c54-f1c0-bf2e-811f-46d8eeb386e7
360avatar_sit_ground.bvh 1c7600d6-661f-b87b-efe2-d7421eb93c86
361avatar_sit_ground_constrained.bvh 1a2bd58e-87ff-0df8-0b4c-53e047b0bb6e
362avatar_sit_to_stand.bvh a8dee56f-2eae-9e7a-05a2-6fb92b97e21e
363avatar_sleep.bvh f2bed5f9-9d44-39af-b0cd-257b2a17fe40
364avatar_smoke_idle.bvh d2f2ee58-8ad1-06c9-d8d3-3827ba31567a
365avatar_smoke_inhale.bvh 6802d553-49da-0778-9f85-1599a2266526
366avatar_smoke_throw_down.bvh 0a9fb970-8b44-9114-d3a9-bf69cfe804d6
367avatar_snapshot.bvh eae8905b-271a-99e2-4c0e-31106afd100c
368avatar_soft_land.bvh f4f00d6e-b9fe-9292-f4cb-0ae06ea58d57
369avatar_stand.bvh 2408fe9e-df1d-1d7d-f4ff-1384fa7b350f
370avatar_stand_1.bvh 15468e00-3400-bb66-cecc-646d7c14458e
371avatar_stand_2.bvh 370f3a20-6ca6-9971-848c-9a01bc42ae3c
372avatar_stand_3.bvh 42b46214-4b44-79ae-deb8-0df61424ff4b
373avatar_stand_4.bvh f22fed8b-a5ed-2c93-64d5-bdd8b93c889f
374avatar_standup.bvh 3da1d753-028a-5446-24f3-9c9b856d9422
375avatar_stretch.bvh 80700431-74ec-a008-14f8-77575e73693f
376avatar_stride.bvh 1cb562b0-ba21-2202-efb3-30f82cdf9595
377avatar_surf.bvh 41426836-7437-7e89-025d-0aa4d10f1d69
378avatar_sword_strike_r.bvh 85428680-6bf9-3e64-b489-6f81087c24bd
379avatar_talk.bvh 5c682a95-6da4-a463-0bf6-0f5b7be129d1
380avatar_throw_r.bvh aa134404-7dac-7aca-2cba-435f9db875ca
381avatar_tryon_shirt.bvh 83ff59fe-2346-f236-9009-4e3608af64c1
382avatar_turn_180.bvh 038fcec9-5ebd-8a8e-0e2e-6e71a0a1ac53
383avatar_turnback_180.bvh 6883a61a-b27b-5914-a61e-dda118a9ee2c
384avatar_turnleft.bvh 56e0ba0d-4a9f-7f27-6117-32f2ebbf6135
385avatar_turnright.bvh 2d6daa51-3192-6794-8e2e-a15f8338ec30
386avatar_type.bvh c541c47f-e0c0-058b-ad1a-d6ae3a4584d9
387avatar_walk.bvh 6ed24bd8-91aa-4b12-ccc7-c97c857ab4e0
388avatar_whisper.bvh 7693f268-06c7-ea71-fa21-2b30d6533f8f
389avatar_whistle.bvh b1ed7982-c68e-a982-7561-52a88a5298c0
390avatar_wink_hollywood.bvh c0c4030f-c02b-49de-24ba-2331f43fe41c
391avatar_yes_happy.bvh b8c8b2a3-9008-1771-3bfc-90924955ab2d
392avatar_yes_head.bvh 15dd911d-be82-2856-26db-27659b142875
393avatar_yoga_float.bvh 42ecd00b-9947-a97c-400a-bbc9174c7aeb
394fringe.tga 8ac54e9d-ec09-d804-60ab-47404a9b4a36
395foot_shadow.tga 14e8a47d-1055-0a68-5d55-eafd9ad3da5b
396img_smoke_poof.tga c734da52-f2ba-f0ba-d59e-15ea49f3d5e9
397img_shot.tga 173b05c7-53a9-4cf8-ce6b-5eec21c5c63f
398folder_arrow.tga 09a324a8-acc1-d9cd-2cbd-7465d90d3a98
399color_swatch_alpha.tga f13db22f-c55c-8bdf-7b1c-221e56fde253
400script_error.tga e5a0ec29-f59e-d29e-2c59-ed66c187c26c
401status_script_debug.tga 7775b5cc-93a5-6efd-0d9b-4e079afac217
402water_normal.tga 822ded49-9a6c-f61c-cb89-6df54f42cdf4
403icon_groupnotice.tga 21579c81-a85e-f11c-2d80-33a4c007d88c
404icon_groupnoticeinventory.tga 8fcca699-08e7-3d58-2f05-86c9d52bbe82
405tab_background_lightgrey.tga c769e547-c307-43ca-2b6a-51cad6d1c527
406tab_background_purple.tga 0ae8a2e9-aff4-249c-fc4a-0f41f89847dd
407tab_background_darkpurple.tga 38ff4f7e-3078-a749-8302-d6cc94b404c4
408smicon_warn.tga f47c17a3-8bfb-3c9f-22b8-77923de7eed9
409uv_test1.tga f43b75f5-9aa5-18ec-d5d9-e6d1b8442613
410uv_test2.tga 300ce95f-3d3f-7c1a-3a22-3fc48f873fb9
411eye_button_active.tga 2b42b375-f9b4-788e-46c7-7ef38762d0ba
412eye_button_inactive.tga be1b7225-98b5-eb2a-2c86-ddaae3328a6e
413account_id_blue.tga 6ab9179a-7308-58db-6c9d-893d3b52bece
414account_id_orange.tga fbe89371-1251-4e77-d2d8-8eeccffe3ca8
415account_id_green.tga 3bf64d5a-38d3-b752-cf52-3d9f8fca353a
416status_push.tga 07d1f523-e327-4d10-20d6-8bc22a6e8f56
417ff_visible_online.tga d609a41f-34c0-7aae-b2c6-2fc3ab26d916
418ff_visible_map.tga 20b52706-c1ab-414a-9dea-1cb788ad5689
419ff_edit_mine.tga 1baee0b9-4b89-39eb-8815-866d82300ab5
420ff_edit_theirs.tga 32e981cd-4700-da5a-7fc7-d573ec3742f4
421inv_item_script_dangerous.tga 0b502db8-6fcd-c442-ecfe-483a0dce875e
422ff_visible_map_button.tga c1079bef-5cf9-90f3-6dcd-48989851c252
423ff_visible_online_button.tga 36749b47-93d6-2c5e-7ebd-d38d30311163
424ff_edit_theirs_button.tga ca229f65-d7e0-133e-1bc2-674abc33f3d5
425ff_edit_mine_button.tga 57f05b46-63d8-c3d5-66d6-8b915746b956
426ff_online_status_button.tga 3b1b6a53-9c8c-568a-22c5-2a8f3e5286f5
427oi_hud_cen_0_0.tga 3c650257-9caf-7cad-b26c-84c9eca560f1
428oi_hud_intro.tga 7611fb3d-9ff2-abd3-d98f-805c1c87e757
429oi_hud_underwater.tga cde61aea-83c2-3001-d598-6b348f7a8e0b
430oi_hud_got_passport.tga 1271838d-d777-b811-7c4c-2a00308bd80a
431oi_hud_texture_off_edge.tga 852be205-b1ea-6356-58c8-8c5ee5a841a6
432oi_hud_texture_on_edge.tga ab11e6ff-a732-be70-67df-c43131274562
433oi_hud_flyingabovewater.tga c9d150d6-2739-5f8b-cce6-3cf98242920a
434oi_hud_walkingabovewater.tga 78284eeb-05f3-ff25-11a0-3cc9dbb30f0c
435oi_hud_landmark.tga 6cd9c221-9d42-a283-256b-09a113a87271
436oi_hud_cus_5_3.tga 7c12f4fb-f502-26d1-a2f3-cdb6aff61663
437oi_hud_cus_5_2.tga c52c9c94-adc0-0f4e-6658-ed33d6ea8829
438oi_hud_cus_5_1.tga 9f6d5d11-6ca9-608c-e8a6-b77989350292
439oi_hud_cus_5_0.tga 2000cff1-119f-2023-66c0-ac5630d2f96e
440oi_hud_cus_4_5.tga f302a935-ccd1-e2f5-3a38-e185cc262f3a
441oi_hud_cus_4_3.tga af8d5b3c-b40f-cea5-b0b2-440fbd84a11a
442oi_hud_cus_4_2.tga 11b26901-8207-12bc-5224-10a12ac4c651
443oi_hud_cus_4_1.tga 41baadb7-1b94-907e-9443-54e92bba77cd
444oi_hud_cus_4_0.tga 9d627f8e-092c-5d32-6c12-ef76ab81cedc
445oi_hud_cus_3_4.tga b196486e-d0d2-4fd7-529a-c84b4495fc74
446oi_hud_cus_3_2.tga 0b81c4bb-de33-e493-7bcb-e7221d97e5e7
447oi_hud_cus_3_1.tga 436dab74-25ae-8b60-c648-50663b7faa1d
448oi_hud_cus_3_0.tga 6c1594de-1e66-273c-a2ab-8f0ffa8b4633
449oi_hud_cus_2_4.tga bb31fe48-8566-eec0-e96b-64025f832b63
450oi_hud_cus_2_2.tga c946959a-26ae-eb66-efa0-20154057789d
451oi_hud_cus_2_1.tga c946959a-26ae-eb66-efa0-20154057789d
452oi_hud_cus_2_0.tga d7833106-b4a8-7666-bde1-64886de289f9
453oi_hud_cus_1_0.tga 811ded22-5940-940c-4821-6fbbfb6611d6
454oi_hud_cus_1_1.tga eda8513b-a343-5109-1fd6-f1c7ad89b703
455oi_hud_cus_1_2.tga 7a4ce18c-e715-34d4-dfee-704c270a8ac8
456oi_hud_cus_1_4.tga d3771c15-ac03-b762-b992-d9fd2fedf38a
457oi_hud_com_4_4.tga d9e1e90d-3cc3-6269-128e-67f7a2b32d26
458oi_hud_com_4_2.tga 0f649a26-6fdb-c73b-ffac-e50fc311d5ce
459oi_hud_com_4_1.tga ae5b1ce6-a2d2-22d2-f532-6280b3bc6adb
460oi_hud_com_4_0.tga 12cda3a0-58c7-dfa8-7f9b-380e5bb8baf9
461oi_hud_com_3_4.tga ff326257-0530-356a-e0f8-be535044e540
462oi_hud_com_3_2.tga 66740ddb-1d56-89f9-f0c9-ae5eb7bb9537
463oi_hud_com_3_1.tga 55d662f4-6a28-6388-7c75-af1c9fd33055
464oi_hud_com_3_0.tga de9d318f-b69e-82f9-0c61-43b868c5ca6b
465oi_hud_com_2_4.tga 01d47e68-400a-d0e1-afb7-d6806d1d477e
466oi_hud_com_2_0.tga 09c98850-27d4-6a12-abae-4af4bba23b6b
467oi_hud_com_1_3.tga 5c2049b9-f797-6608-ca71-758f3716aa90
468oi_hud_com_1_1.tga 1116ff68-cdc4-1cfc-e137-30f8426afeda
469oi_hud_com_1_0.tga bd847d31-f5af-95f7-2b9c-af47d8ba53bd
470oi_hud_nav_4_5.tga 66194280-b087-db94-35d9-41e8f7518515
471oi_hud_nav_4_4.tga 180c4241-e309-4c05-13ee-9080ab69498d
472oi_hud_nav_4_3.tga e98a6ba6-99c6-fa15-84b6-9afadea6c467
473oi_hud_nav_4_2.tga 2e19f352-1893-59a9-949b-4d2cfd3a8222
474oi_hud_nav_4_1.tga 13a1675b-fb5a-19b3-b5a3-74b0a6765f7d
475oi_hud_nav_4_0.tga e7526e8d-b085-b26c-b0ae-2708ec231401
476oi_hud_nav_3_5.tga 5e67b0d0-29a2-6a08-c85e-b12d59e53d6e
477oi_hud_nav_3_4.tga 2ed8fbc2-5c4d-53c2-b289-88baffceab1a
478oi_hud_nav_3_3.tga e0a72f1a-282e-1c1a-2cb7-6423feb41759
479oi_hud_nav_3_2.tga 4bcebb23-da5e-47d9-eac1-e4453f762c8c
480oi_hud_nav_3_1.tga 6ac87575-330e-3a2d-3b80-a34e7b277e50
481oi_hud_nav_3_0.tga f1451e8e-7310-9152-47d5-5d037c28fef3
482oi_hud_nav_2_6.tga c60b42ff-ee60-98e4-e603-ca2470141d4b
483oi_hud_nav_2_5.tga a02b5a1a-bbdb-5556-ae5b-a2e68494755a
484oi_hud_nav_2_4.tga 625535ab-8abf-b3e7-48fb-43f728b77c79
485oi_hud_nav_2_3.tga 00a609c3-5750-3b5a-3ce3-458bdf632203
486oi_hud_nav_2_2.tga 94903387-d37f-092c-e4d2-c190f68577b8
487oi_hud_nav_2_1.tga ee0cd82c-6ce8-8e73-307b-6d0dc77b19e8
488oi_hud_nav_2_0.tga 3e10b379-ed2c-7424-1fe7-bef3558c7536
489oi_hud_nav_1_4.tga bf8d0be8-2012-1664-3ea5-e69a71c206e9
490oi_hud_nav_1_2.tga 72100f87-18a7-fc4a-4793-de281e8b02cc
491oi_hud_nav_1_1.tga b048faf3-60ce-c3a2-d034-36613449d377
492oi_hud_nav_1_0.tga 0ad45106-3b26-6448-0b90-feae8bd46c38
493oi_hud_mov_4_5.tga 7c4a45c2-37dd-312c-c6ab-20896dd0a5a6
494oi_hud_mov_4_3.tga 8a88da1c-3735-c71e-d48a-016df0798de4
495oi_hud_mov_4_2.tga f55ae4d3-7d6a-e6ac-4cf7-03014ce14390
496oi_hud_mov_4_1.tga 1cc3fcf1-35c0-e222-27d2-6905cf5c4cee
497oi_hud_mov_4_0.tga 1ae592dc-46f4-616e-b7c6-0dff3e6f40e5
498oi_hud_mov_3_4.tga 831b39be-99fc-45bd-ba85-708f9dc93bfd
499oi_hud_mov_3_2.tga 9f7e7373-92a9-d66a-ad5a-afb55ca6ac1f
500oi_hud_mov_3_1.tga ab37ed0d-7e66-1f77-3acf-b0fe4b74dbe8
501oi_hud_mov_3_0.tga f5ff1f08-4c92-8606-1854-cc5b9d3e445c
502oi_hud_mov_1_2.tga 1e3abeed-e893-c44e-1f9d-5ecc76d21e5d
503oi_hud_mov_1_0.tga e300fc95-aa94-8e31-c501-ce903cac8b7c
diff --git a/linden/indra/newview/app_settings/viewerart.xml b/linden/indra/newview/app_settings/viewerart.xml
index dbd2227..d56efea 100644
--- a/linden/indra/newview/app_settings/viewerart.xml
+++ b/linden/indra/newview/app_settings/viewerart.xml
@@ -1,282 +1,4 @@
1<settings version = "101"> 1<settings version = "101">
2 <closebox.tga value="47a8c844-cd2a-4b1a-be01-df8b1612fe5d"/>
3 <close_in_blue.tga value="e5821134-23c0-4bd0-af06-7fa95b9fb01a"/>
4 <tearoffbox.tga value="74e1a96f-4833-a24d-a1bb-1bce1468b0e7"/>
5 <tearoff_pressed.tga value="d2524c13-4ba6-af7c-e305-8ac6cc18d86a"/>
6 <resize_handle_bottom_right_blue.tga value="e3690e25-9690-4f6c-a745-e7dcd885285a"/>
7 <scrollbutton_up_out_blue.tga value="dad084d7-9a46-452a-b0ff-4b9f1cefdde9"/>
8 <scrollbutton_up_in_blue.tga value="a93abdf3-27b5-4e22-a8fa-c48216cd2e3a"/>
9 <scrollbutton_down_out_blue.tga value="b4ecdecf-5c8d-44e7-b882-17a77e88ed55"/>
10 <scrollbutton_down_in_blue.tga value="d2421bab-2eaf-4863-b8f6-5e4c52519247"/>
11 <scrollbutton_left_out_blue.tga value="43773e8d-49aa-48e0-80f3-a04715f4677a"/>
12 <scrollbutton_left_in_blue.tga value="ea137a32-6718-4d05-9c22-7d570d27b2cd"/>
13 <scrollbutton_right_out_blue.tga value="3d700d19-e708-465d-87f2-46c8c0ee7938"/>
14 <scrollbutton_right_in_blue.tga value="b749de64-e903-4c3c-ac0b-25fb6fa39cb5"/>
15 <spin_up_out_blue.tga value="56576e6e-6710-4e66-89f9-471b59122794"/>
16 <spin_up_in_blue.tga value="c8450082-96a0-4319-8090-d3ff900b4954"/>
17 <spin_down_out_blue.tga value="b6d240dd-5602-426f-b606-bbb49a30726d"/>
18 <spin_down_in_blue.tga value="a985ac71-052f-48e6-9c33-d931c813ac92"/>
19 <radio_active_false.tga value="7a1ba9b8-1047-4d1e-9cfc-bc478c80b63f"/>
20 <radio_active_true.tga value="52f09e07-5816-4052-953c-94c6c10479b7"/>
21 <radio_inactive_false.tga value="90688481-67ff-4af0-be69-4aa084bcad1e"/>
22 <radio_inactive_true.tga value="1975db39-aa29-4251-aea0-409ac09d414d"/>
23 <checkbox_enabled_false.tga value="05bb64ee-96fd-4243-b74e-f40a41bc53ba"/>
24 <checkbox_enabled_true.tga value="cf4a2ed7-1533-4686-9dde-df9a37ddca55"/>
25 <checkbox_disabled_false.tga value="7d94cb59-32a2-49bf-a516-9e5a2045f9d9"/>
26 <checkbox_disabled_true.tga value="c817c642-9abd-4236-9287-ae0513fe7d2b"/>
27 <tab_top_blue.tga value="1ed83f57-41cf-4052-a3b4-2e8bb78d8191"/>
28 <tab_top_selected_blue.tga value="16d032e8-817b-4368-8a4e-b7b947ae3889"/>
29 <tab_bottom_blue.tga value="bf0a8779-689b-48c3-bb9a-6af546366ef4"/>
30 <tab_bottom_selected_blue.tga value="c001d8fd-a869-4b6f-86a1-fdcb106df9c7"/>
31 <tab_left.tga value="1097dcb3-aef9-8152-f471-431d840ea89e"/>
32 <tab_left_selected.tga value="bea77041-5835-1661-f298-47e2d32b7a70"/>
33 <crosshairs.tga value="6e1a3980-bf2d-4274-8970-91e60d85fb52"/>
34 <move_backward_in.tga value="db11d956-5e7d-4aa5-b39d-7774d339fc5c"/>
35 <move_backward_out.tga value="3ae8bb18-ed97-4cd3-ae5c-d54bc8479fe7"/>
36 <move_down_in.tga value="b92a70b9-c841-4c94-b4b3-cee9eb460d48"/>
37 <move_down_out.tga value="b5abc9fa-9e62-4e03-bc33-82c4c1b6b689"/>
38 <move_forward_in.tga value="54197a61-f5d1-4c29-95d2-c071d08849cb"/>
39 <move_forward_out.tga value="a0eb4021-1b20-4a53-892d-8faa9265a6f5"/>
40 <move_left_in.tga value="724996f5-b956-46f6-9844-4fcfce1d5e83"/>
41 <move_left_out.tga value="82476321-0374-4c26-9567-521535ab4cd7"/>
42 <move_right_in.tga value="7eeb57d2-3f37-454d-a729-8b217b8be443"/>
43 <move_right_out.tga value="1fbe4e60-0607-44d1-a50a-032eff56ae75"/>
44 <move_turn_left_in.tga value="95463c78-aaa6-464d-892d-3a805b6bb7bf"/>
45 <move_turn_left_out.tga value="13a93910-6b44-45eb-ad3a-4d1324c59bac"/>
46 <move_turn_right_in.tga value="5e616d0d-4335-476f-9977-560bccd009da"/>
47 <move_turn_right_out.tga value="5a44fd04-f52b-4c30-8b00-4a31e27614bd"/>
48 <move_up_out.tga value="f887146d-829f-4e39-9211-cf872b78f97c"/>
49 <move_up_in.tga value="49b4b357-e430-4b56-b9e0-05b8759c3c82"/>
50 <cam_rotate_out.tga value="88745b46-da05-11d5-8ac0-0003477c4611"/>
51 <cam_rotate_in.tga value="70bf2262-3eed-4996-88ac-076907e8921d"/>
52 <cam_zoom_out.tga value="bb02e941-cb3b-4dd3-892a-6841b5de6e45"/>
53 <cam_zoom_plus_in.tga value="c7aefd32-ce13-4242-82cc-2631d44ff9d3"/>
54 <cam_zoom_minus_in.tga value="deed3f4b-93e9-4183-a3b0-a5a98a6de1bb"/>
55 <cam_tracking_out.tga value="95c4ea0e-e3c2-4904-b847-7d7676139ebb"/>
56 <cam_tracking_in.tga value="fe2fc73b-5a64-4a8e-aacc-46fa81faf96a"/>
57 <direction_arrow.tga value="586383e8-4d9b-4fba-9196-2b5938e79c2c"/>
58 <minimize.tga value="34c9398d-bb78-4643-9633-46a2fa3e9637"/>
59 <minimize_inactive.tga value="6e72abba-1378-437f-bf7a-f0c15f3e99a3"/>
60 <minimize_pressed.tga value="39801651-26cb-4926-af57-7af9352c273c"/>
61 <restore.tga value="111b39de-8928-4690-b7b2-e17d5c960277"/>
62 <restore_inactive.tga value="0eafa471-70af-4882-b8c1-40a310929744"/>
63 <restore_pressed.tga value="90a0ed5c-2e7b-4845-9958-a64a1b30f312"/>
64 <combobox_arrow.tga value="b31c1335-0e9c-4927-bc90-53277777d9c1"/>
65 <white.tga value="5748decc-f629-461c-9a36-a35a221fe21f"/>
66 <darkgray.tga value="267e26d3-e0e1-41b8-91b1-3b337102928d"/>
67 <lightgray.tga value="c520bf46-cc5d-412b-a60b-9f1bd245189f"/>
68 <eyes.tga value="6522e74d-1660-4e7f-b601-6f48c1659a77"/>
69 <hair.tga value="7ca39b4c-bd19-4699-aff7-f93fd03d3e7b"/>
70 <black.tga value="e2244626-f22f-4839-8123-1e7baddeb659"/>
71 <close_inactive_blue.tga value="779e4fa3-9b13-f74a-fba9-3886fe9c86ba"/>
72 <button_disabled_32x128.tga value="f8124d60-2875-c358-7847-2acb63e5400c"/>
73 <button_enabled_32x128.tga value="d8faf8cb-ee6e-b0b5-abd9-bde873ad3461"/>
74 <button_enabled_selected_32x128.tga value="1eddba75-b682-110a-104e-6cdcce616a25"/>
75 <button_anim_play_selected.tga value="119c37bb-24af-45fe-ae11-3a6bc3c85138"/>
76 <button_anim_pause_selected.tga value="ad65d67a-777b-fbfa-693d-4bdcfca2acca"/>
77 <button_anim_pause.tga value="db2d9c2d-0bbd-21e2-e83a-103ea2def7a8"/>
78 <button_anim_play.tga value="2a7f6738-5d82-2ff3-d419-30ed09cbb72b"/>
79 <button_anim_stop.tga value="e10c9e36-d9f6-c8b4-de96-557dccce9205"/>
80 <button_anim_stop_selected.tga value="b8c0e0aa-2771-439e-c919-d2f5dad69a1c"/>
81 <rounded_square.tga value="38ce8b3c-fb30-5c59-9926-bd643613f606"/>
82 <rounded_square_soft.tga value="4c95e6bc-fe77-9cb4-b58a-909848042c1e"/>
83 <badge_ok.tga value="211035a7-c313-378d-478c-e80bbd0fde63"/>
84 <badge_note.tga value="13f6e639-b3f9-28da-a1e6-e990a43052b6"/>
85 <badge_warn.tga value="0992d4bc-7af8-4a1f-f2e6-e6c4083b066e"/>
86 <badge_error.tga value="00c50485-8491-ab70-2ea8-43f26fd028e2"/>
87 <status_money.tga value="5863eb7a-1546-6501-533a-6061f73a36b7"/>
88 <status_health.tga value="4330e8ce-b39b-1eb8-c2ec-a97c0b3947b5"/>
89 <status_fly.tga value="0e058115-5b8f-c3d7-dcaa-9623d92885d1"/>
90 <status_build.tga value="175a6b75-45c9-c2c2-4765-bf37a3909b53"/>
91 <status_busy.tga value="beb0d821-6725-abdf-032d-1f70cdabde82"/>
92 <status_scripts.tga value="4cc1afcd-04dd-178f-e074-0f9dc730ab45"/>
93 <status_buy_currency.tga value="f43a535a-59ac-26e3-84bc-c786735fabe4"/>
94 <status_buy_currency_pressed.tga value="bfa5be70-37c7-8126-fecd-df55390954d5"/>
95 <status_buy_land.tga value="1a0edac5-3e50-fc9b-2752-70c1f69cb959"/>
96 <status_buy_land_pressed.tga value="257647b7-199f-99ff-8be9-f6753289a3aa"/>
97 <terrain_dirt.tga value="b8d3965a-ad78-bf43-699b-bff8eca6c975"/>
98 <terrain_grass.tga value="abb783e6-3e93-26c0-248a-247666855da3"/>
99 <terrain_mountain.tga value="179cdabd-398a-9b6b-1391-4dc333ba321f"/>
100 <terrain_rock.tga value="beb169c7-11ea-fff2-efe5-0f24dc881df2"/>
101 <terrain_dirt_detail.tga value="0bc58228-74a0-7e83-89bc-5c23464bcec5"/>
102 <terrain_grass_detail.tga value="63338ede-0037-c4fd-855b-015d77112fc8"/>
103 <terrain_mountain_detail.tga value="303cd381-8560-7579-23f1-f0a880799740"/>
104 <terrain_rock_detail.tga value="53a2f406-4895-1d13-d541-d2e3b86bc19c"/>
105 <square_btn_32x128.tga value="b28df901-6b8d-d31c-7903-4eb9676d4bfc"/>
106 <square_btn_selected_32x128.tga value="c48c9e95-191b-96d3-08b2-6e8ada58b651"/>
107 <tree_pine_1.tga value="0187babf-6c0d-5891-ebed-4ecab1426683"/>
108 <tree_oak.tga value="8a515889-eac9-fb55-8eba-d2dc09eb32c8"/>
109 <tree_tropical_1.tga value="5bc11cd6-2f40-071e-a8da-0903394204f9"/>
110 <tree_palm_1.tga value="ca4e8c27-473c-eb1c-2f5d-50ee3f07d85c"/>
111 <tree_dogwood.tga value="64367bd1-697e-b3e6-0b65-3f862a577366"/>
112 <tree_tropical_2.tga value="cdd9a9fc-6d0b-f90d-8416-c72b6019bca8"/>
113 <tree_palm_2.tga value="2d784476-d0db-9979-0cff-9408745a7cf3"/>
114 <tree_cypress_1.tga value="fb2ae204-3fd1-df33-594f-c9f882830e66"/>
115 <tree_cypress_2.tga value="30047cec-269d-408e-0c30-b2603b887268"/>
116 <tree_pine_2.tga value="d691a01c-13b7-578d-57c0-5caef0b4e7e1"/>
117 <tree_plumeria.tga value="6de37e4e-7029-61f5-54b8-f5e63f983f58"/>
118 <winter_tree_aspen.tga value="7c0cf89b-44b1-1ce2-dd74-07102a98ac2a"/>
119 <winter_tree_pine_1.tga value="10d2a01a-0818-84b9-4b96-c2eb63256519"/>
120 <winter_tree_pine_2.tga value="67931331-0c02-4876-1255-28770896c6a2"/>
121 <tree_eucalyptus.tga value="a6162133-724b-54df-a12f-51cd070ad6f3"/>
122 <tree_fern.tga value="8872f2b8-31db-42d8-580a-b3e4a91262de"/>
123 <tree_eelgrass.tga value="96b4de31-f4fa-337d-ec78-451e3609769e"/>
124 <tree_sea_sword.tga value="5894e2e7-ab8d-edfa-e61c-18cf16854ba3"/>
125 <tree_kelp_1.tga value="2caf1179-7861-6ff3-4b7d-46e17780bdfa"/>
126 <tree_kelp_2.tga value="2a4880b6-b7a3-690a-2049-bfbe38eafb9f"/>
127 <tree_beach_grass_1.tga value="18fb888b-e8f1-dce7-7da7-321d651ea6b0"/>
128 <tool_dozer.tga value="d2a0d4d4-54eb-4d16-be4b-4eae43845c74"/>
129 <tool_dozer_active.tga value="d4afdbbe-1550-4b7d-91de-95731f47e8e3"/>
130 <tool_land.tga value="86fe4df4-0ecb-4382-b9ae-475925a92388"/>
131 <tool_land_active.tga value="34e60587-0791-4a07-8918-f5995fcc22a3"/>
132 <tool_zoom.tga value="27eb8829-fe65-45ed-a49a-73aac42f4b38"/>
133 <tool_zoom_active.tga value="69445f58-5c8e-44e0-9d2e-47408bb43b39"/>
134 <tool_orbit.tga value="06964fe4-033f-448a-95c9-30dc41d1be8b"/>
135 <tool_orbit_active.tga value="ee4e07db-3f72-4098-bd4c-aef34515a7bc"/>
136 <tool_pan.tga value="a32aa302-0a15-48d2-b2b1-4d69f1161173"/>
137 <tool_pan_active.tga value="24d9ad33-0b42-4eb5-99a3-659d838bc5c0"/>
138 <inv_folder_texture.tga value="743f035b-a049-43f4-16c7-7ec8daa2c481"/>
139 <inv_folder_sound.tga value="e10cb910-1e71-da47-bd12-8c53f7793714"/>
140 <inv_folder_callingcard.tga value="a3735971-e2b2-d78a-580d-d265cd8f2484"/>
141 <inv_folder_landmark.tga value="9f921155-7c8c-e276-d5ec-03ac9340584d"/>
142 <inv_folder_script.tga value="baa5c310-6a6d-cc48-51eb-65196ba31d77"/>
143 <inv_folder_object.tga value="113e5133-fd0d-ee51-4a59-9d67ca10e8a7"/>
144 <inv_folder_notecard.tga value="a9e75d84-5073-9cb7-10a9-1ca68ef5c7ba"/>
145 <inv_folder_clothing.tga value="f1427d3d-b2e8-97c4-69ab-1f36d4c0e8f0"/>
146 <inv_folder_bodypart.tga value="1fe05580-1d2f-0345-b28b-52b6e3a20e5d"/>
147 <inv_folder_trash.tga value="88ad072e-ea0b-aabd-5ac0-b37862a6eb66"/>
148 <inv_folder_plain_closed.tga value="86f00960-c3e9-9680-145d-3beffd743e9c"/>
149 <inv_folder_plain_open.tga value="d15dc243-2d0b-47af-0ce1-ec376464bdc8"/>
150 <inv_folder_snapshot.tga value="6efe85e7-800f-1843-296c-a5b7adffe091"/>
151 <inv_folder_lostandfound.tga value="9a371a04-297d-bacf-0d16-5f49753efe1d"/>
152 <inv_folder_animation.tga value="4d59b3ee-f29d-b912-2bcc-9bb1f8a07ec6"/>
153 <inv_folder_gesture.tga value="4de9129a-9fc1-d759-d739-364293906ba2"/>
154 <inv_item_texture.tga value="19f452d7-4eee-9f46-76cc-5497d17f1dd9"/>
155 <inv_item_sound.tga value="eb414d69-c77d-d4e7-66e6-6c2e6f6c1976"/>
156 <inv_item_callingcard_online.tga value="672cc53e-8dc0-ba91-2a4e-574104cf071c"/>
157 <inv_item_callingcard_offline.tga value="d0afe86b-2489-7600-55b7-6abb0a63d9f9"/>
158 <inv_item_landmark.tga value="bf25a2a0-85da-7fa0-0993-e461768d0221"/>
159 <inv_item_landmark_visited.tga value="229fac85-5428-4ab7-adeb-eb8389e91092"/>
160 <inv_item_script.tga value="59a3df81-ed76-06c9-7264-6dada535e7a3"/>
161 <inv_item_clothing.tga value="34dfe476-8e26-0e3a-11cf-76cc4a7126ce"/>
162 <inv_item_object.tga value="0f0780a0-89c4-742a-ef28-26405a41cf85"/>
163 <inv_item_notecard.tga value="23ce8a2c-9ea2-d863-6572-806f0645b0c7"/>
164 <inv_item_bodypart.tga value="d2a5362d-5c55-57dd-a9e9-5c814d1ddc16"/>
165 <inv_item_attach.tga value="5bcae41e-aa5d-02f8-edf1-605ebdd875ab"/>
166 <inv_item_snapshot.tga value="3810d584-b092-7caa-57e0-010f192b9659"/>
167 <inv_item_eyes.tga value="eaa5fd96-5c25-06ef-2280-7ef20203e167"/>
168 <inv_item_gloves.tga value="117b11cb-c04e-5081-13da-1a8846070fd0"/>
169 <inv_item_hair.tga value="6bca3bf4-ed6d-d438-63a0-2a7066d03a0b"/>
170 <inv_item_jacket.tga value="8df59386-56e0-c811-0443-840da3acb3a5"/>
171 <inv_item_pants.tga value="a87a58ca-f857-63b1-0acf-072711ed1bdb"/>
172 <inv_item_shape.tga value="4463e433-4db5-79ef-c1b0-4821b03ddb07"/>
173 <inv_item_shirt.tga value="e2ffb62b-6abc-22d6-952d-764759b4d636"/>
174 <inv_item_shoes.tga value="cf384fa5-1edd-c37c-2134-283dd4fe3396"/>
175 <inv_item_skirt.tga value="0b43f826-2abc-2944-7d72-10777a51d19b"/>
176 <inv_item_socks.tga value="22137c6d-6ec5-6eee-9a2e-2d7a9e6cbcd4"/>
177 <inv_item_underpants.tga value="2f15dc09-4385-526c-aa5d-d9d516ec7d99"/>
178 <inv_item_undershirt.tga value="f72ab629-a3ab-de0c-35c0-5285e27478ce"/>
179 <inv_item_animation.tga value="b5cda0d6-d196-ce48-63db-d04323ef8931"/>
180 <inv_item_gesture.tga value="5579245d-d5bf-5f13-46b0-8624490de24c"/>
181 <pixiesmall.tga value="168e6813-096e-07ea-97ae-fd416826f627"/>
182 <legend.tga value="ca7609c6-6ec6-32d9-332e-0d8f437ef644"/>
183 <propertyline.tga value="e3548c46-8d5e-03da-fcab-4fc36ad818bb"/>
184 <startup_logo.tga value="66864f3c-e095-d9c8-058d-d6575e6ed1b8"/>
185 <grass_texture_1.tga value="79504bf5-c3ec-0763-6563-d843de66d0a1"/>
186 <grass_texture_2.tga value="6c4727b8-ac79-ba44-3b81-f9aa887b47eb"/>
187 <grass_texture_3.tga value="99bd60a2-3250-efc9-2e39-2fbcadefbecc"/>
188 <grass_texture_4.tga value="7a2b3a4a-53c2-53ac-5716-aac7d743c020"/>
189 <undergrowth_1.tga value="8f458549-173b-23ff-d4ff-bfaa5ea2371b"/>
190 <silhouette.tga value="da5d4079-7819-6b53-d2a4-dc9929381d7d"/>
191 <avatar_thumb_bkgrnd.tga value="3a7f4f0d-be14-ee78-29e3-fc8b0b2a68d3"/>
192 <missing_asset.tga value="32dfd1c8-7ff6-5909-d983-6d4adfb4255d"/>
193 <alpha_gradient.tga value="e97cf410-8e61-7005-ec06-629eba4cd1fb"/>
194 <alpha_gradient_2d.tga value="38b86f85-2575-52a9-a531-23108d8da837"/>
195 <alpha_noise.tga value="b9e1cf8a-9660-c020-0c69-18f1ea27268a"/>
196 <alpha_sizzle.tga value="e121e2fc-7573-740f-edfd-0d45a9ba486e"/>
197 <bump_woodgrain.tga value="058c75c0-a0d5-f2f8-43f3-e9699a89c2fc"/>
198 <bump_bark.tga value="6c9fa78a-1c69-2168-325b-3e03ffa348ce"/>
199 <bump_bricks.tga value="b8eed5f0-64b7-6e12-b67f-43fa8e773440"/>
200 <bump_checker.tga value="9deab416-9c63-78d6-d558-9a156f12044c"/>
201 <bump_concrete.tga value="db9d39ec-a896-c287-1ced-64566217021e"/>
202 <bump_crustytile.tga value="f2d7b6f6-4200-1e9a-fd5b-96459e950f94"/>
203 <bump_cutstone.tga value="d9258671-868f-7511-c321-7baef9e948a4"/>
204 <bump_discs.tga value="d21e44ca-ff1c-a96e-b2ef-c0753426b7d9"/>
205 <bump_gravel.tga value="4726f13e-bd07-f2fb-feb0-bfa2ac58ab61"/>
206 <bump_petridish.tga value="e569711a-27c2-aad4-9246-0c910239a179"/>
207 <bump_siding.tga value="073c9723-540c-5449-cdd4-0e87fdc159e3"/>
208 <bump_stonetile.tga value="ae874d1a-93ef-54fb-5fd3-eb0cb156afc0"/>
209 <bump_stucco.tga value="92e66e00-f56f-598a-7997-048aa64cde18"/>
210 <bump_suction.tga value="83b77fc6-10b4-63ec-4de7-f40629f238c5"/>
211 <bump_weave.tga value="735198cf-6ea0-2550-e222-21d3c6a341ae"/>
212 <icon_avatar_online.tga value="529ed15b-3d41-dcc1-79de-90bf21770b5b"/>
213 <icon_avatar_offline.tga value="34648c67-5bfb-5790-e05e-8bd6600fd087"/>
214 <icon_event.tga value="be235ae0-53cf-1d68-b3ae-cf375ed1fb58"/>
215 <icon_event_mature.tga value="cc090999-1b3e-2e97-7a38-c9f4afd10297"/>
216 <icon_group.tga value="04237108-a879-5a95-9b0c-b18fd09bc447"/>
217 <icon_place.tga value="ba0bac4e-815e-14e1-2895-5065b8c703b3"/>
218 <icon_top_pick.tga value="77ca91a2-4431-aeaf-6249-3dd99c7dd86d"/>
219 <icon_popular.tga value="bdd47da5-5b5b-c906-37ad-16aaa64f096f"/>
220 <icon_for_sale.tga value="f20728fd-1670-3771-2293-e0dd3f0bcaab"/>
221 <icon_auction.tga value="96abf5b1-335c-6b76-61e3-74ada07f3cb8"/>
222 <icon_land_for_landless.tga value="c421ddf2-b9d7-b373-503c-f4c423f37f1c"/>
223 <icon_day_cycle.tga value="5b30a285-f1e3-92b1-dcd3-0d07366ced3e"/>
224 <icon_lock.tga value="9beb8cdd-3dce-53c2-b28e-e1f3bc2ec0a4"/>
225 <noentrylines.tga value="5d3e196b-fd4d-ada7-e4c1-99f8e9f1cfbf"/>
226 <noentrypasslines.tga value="ac8f8627-6a30-8da8-d4bd-958668eea7a0"/>
227 <notify_tip_icon.tga value="74ba3584-58ea-9984-5b76-62d37942ab77"/>
228 <notify_box_icon.tga value="b2ef2d31-9714-a07b-6ca7-31638166364b"/>
229 <notify_next.tga value="07d0ea4c-af0c-aad1-dbbf-c24020ff2b80"/>
230 <map_avatar_you_8.tga value="02fbdc40-5e07-a6e1-228b-58e10f8335b7"/>
231 <map_avatar_8.tga value="0be58a91-8065-c02b-7a12-2cc14dddbc37"/>
232 <map_avatar_16.tga value="db0dadd5-026a-88cf-f5c1-523a0a2daa3e"/>
233 <map_telehub.tga value="bf1b2bb0-13b1-40ae-3354-b1b93761bdb4"/>
234 <map_infohub.tga value="85b1a79a-7f6c-9df3-4d6c-17b1a4efb55a"/>
235 <map_home.tga value="ae9b8f5f-03a1-2e71-db77-6eb27a1ba181"/>
236 <map_event.tga value="6008be5e-9267-2a3a-9798-e81b076c22ca"/>
237 <map_event_mature.tga value="f9cdba28-a227-d613-2f16-ce06209314ae"/>
238 <map_track_8.tga value="bfdc7bf6-e2ee-1754-f4df-cc25887714ad"/>
239 <map_track_16.tga value="a3878395-ef00-a0e6-ee9a-f45ed6b9ce59"/>
240 <object_cone.tga value="c2b8c90a-7dca-26e3-1a63-7aa4a0389cf9"/>
241 <object_cone_active.tga value="cf69c64b-f19e-e1f3-a586-42fef31a23be"/>
242 <object_cube.tga value="70c747ac-1de3-a8b9-514d-101753ca6ccb"/>
243 <object_cube_active.tga value="f9c5e213-1076-7a7d-7889-52388aad2c1a"/>
244 <object_cylinder.tga value="13e35d95-5f6c-9a91-1766-49dedf9b1267"/>
245 <object_cylinder_active.tga value="3f3e4932-8412-e2a7-cfe9-92caf5978b1b"/>
246 <object_grass.tga value="7ca8e672-920b-4653-3970-1abc91abef58"/>
247 <object_grass_active.tga value="d0fc7cc9-646a-6860-cf7c-1d9e58cd6dab"/>
248 <object_hemi_cone.tga value="69d5e60c-739a-40b1-b526-84072121e394"/>
249 <object_hemi_cone_active.tga value="2e0c5435-95bb-1c0d-5da1-42336fb1cfc0"/>
250 <object_hemi_cylinder.tga value="f4be3e06-24a8-f86e-acc7-7daefc0572b7"/>
251 <object_hemi_cylinder_active.tga value="67279486-cfc1-3633-de42-85db65db373c"/>
252 <object_hemi_sphere.tga value="b67251ab-1716-b9fb-f911-967ba3fe027b"/>
253 <object_hemi_sphere_active.tga value="6c489466-3058-6475-6b1b-e5fc1d49f1f3"/>
254 <object_pyramid.tga value="9dde8b56-2cc4-a932-b63a-38c3a83221ad"/>
255 <object_pyramid_active.tga value="e7217b1a-e3d8-e339-d28a-d7714d0b5bee"/>
256 <object_sphere.tga value="7fa122c0-b994-460e-8636-cdc451d67268"/>
257 <object_sphere_active.tga value="f2c3bcbc-2904-41a5-1c22-688f176fd1ee"/>
258 <object_tetrahedron.tga value="e17db404-9fc5-9534-1038-777c82b2771f"/>
259 <object_tetrahedron_active.tga value="2792ea3b-c052-85fe-d168-a62b2f4e9d7c"/>
260 <object_tree.tga value="710d1bec-fb33-28f1-e77e-ddbb5b51f5ed"/>
261 <object_tree_active.tga value="da4835c7-b12a-41dd-11db-dae452f040c2"/>
262 <object_prism.tga value="02935f3a-dcda-3b42-1874-da89d4c12870"/>
263 <object_prism_active.tga value="223aac97-bd2f-ec2e-ad45-5641b77c78f9"/>
264 <object_torus.tga value="19e1f4c9-6aa6-4414-981d-59a1343a6472"/>
265 <object_torus_active.tga value="ef2bca77-5004-4547-b00a-3b96e463f89f"/>
266 <object_tube.tga value="7ce81316-a478-480f-961c-435fcbdecaf0"/>
267 <object_tube_active.tga value="55c3e4d1-cfdc-48a8-af32-a34844b91832"/>
268 <object_ring_active.tga value="2c955a73-fa31-237b-a4a1-5c8ede3bae50"/>
269 <object_ring.tga value="a7610e41-4647-16d8-0e0e-85a1211c1596"/>
270 <container_animation.tga value="c4e657a1-4c86-0159-2da0-32ff948484e6"/>
271 <container_bodypart.tga value="770cb2df-758d-34d5-36c7-e3de06db5b5d"/>
272 <container_clothing.tga value="dd90406f-4c8f-a3f9-41df-d562f94f09e0"/>
273 <container_gesture.tga value="59cd31c0-2791-3c48-f740-f0a36c68653e"/>
274 <container_landmark.tga value="24c63386-04f7-ce6f-4ff2-dfb215d2e21f"/>
275 <container_many_things.tga value="849d3292-d9fa-7186-5465-dd7b5fc1ec48"/>
276 <container_object.tga value="ad887ae1-2bee-f2c9-6786-5599de3c95c4"/>
277 <container_script.tga value="b93bd494-c4bd-bcdf-4a59-35a9497d03f3"/>
278 <container_sound.tga value="5ddea031-cfa3-2776-43e3-c7146c1b4cd6"/>
279 <container_texture.tga value="b3f95caf-bd62-bef3-0ded-dea752920629"/>
280 <avatar_aim_l_bow.bvh value="46bb4359-de38-4ed8-6a22-f1f52fe8f506"/> 2 <avatar_aim_l_bow.bvh value="46bb4359-de38-4ed8-6a22-f1f52fe8f506"/>
281 <avatar_aim_r_bazooka.bvh value="b5b4a67d-0aee-30d2-72cd-77b333e932ef"/> 3 <avatar_aim_r_bazooka.bvh value="b5b4a67d-0aee-30d2-72cd-77b333e932ef"/>
282 <avatar_aim_r_handgun.bvh value="3147d815-6338-b932-f011-16b56d9ac18b"/> 4 <avatar_aim_r_handgun.bvh value="3147d815-6338-b932-f011-16b56d9ac18b"/>
@@ -391,114 +113,4 @@
391 <avatar_yes_happy.bvh value="b8c8b2a3-9008-1771-3bfc-90924955ab2d"/> 113 <avatar_yes_happy.bvh value="b8c8b2a3-9008-1771-3bfc-90924955ab2d"/>
392 <avatar_yes_head.bvh value="15dd911d-be82-2856-26db-27659b142875"/> 114 <avatar_yes_head.bvh value="15dd911d-be82-2856-26db-27659b142875"/>
393 <avatar_yoga_float.bvh value="42ecd00b-9947-a97c-400a-bbc9174c7aeb"/> 115 <avatar_yoga_float.bvh value="42ecd00b-9947-a97c-400a-bbc9174c7aeb"/>
394 <fringe.tga value="8ac54e9d-ec09-d804-60ab-47404a9b4a36"/>
395 <foot_shadow.tga value="14e8a47d-1055-0a68-5d55-eafd9ad3da5b"/>
396 <img_smoke_poof.tga value="c734da52-f2ba-f0ba-d59e-15ea49f3d5e9"/>
397 <img_shot.tga value="173b05c7-53a9-4cf8-ce6b-5eec21c5c63f"/>
398 <folder_arrow.tga value="09a324a8-acc1-d9cd-2cbd-7465d90d3a98"/>
399 <color_swatch_alpha.tga value="f13db22f-c55c-8bdf-7b1c-221e56fde253"/>
400 <script_error.tga value="e5a0ec29-f59e-d29e-2c59-ed66c187c26c"/>
401 <status_script_debug.tga value="7775b5cc-93a5-6efd-0d9b-4e079afac217"/>
402 <water_normal.tga value="822ded49-9a6c-f61c-cb89-6df54f42cdf4"/>
403 <icon_groupnotice.tga value="21579c81-a85e-f11c-2d80-33a4c007d88c"/>
404 <icon_groupnoticeinventory.tga value="8fcca699-08e7-3d58-2f05-86c9d52bbe82"/>
405 <tab_background_lightgrey.tga value="c769e547-c307-43ca-2b6a-51cad6d1c527"/>
406 <tab_background_purple.tga value="0ae8a2e9-aff4-249c-fc4a-0f41f89847dd"/>
407 <tab_background_darkpurple.tga value="38ff4f7e-3078-a749-8302-d6cc94b404c4"/>
408 <smicon_warn.tga value="f47c17a3-8bfb-3c9f-22b8-77923de7eed9"/>
409 <uv_test1.tga value="f43b75f5-9aa5-18ec-d5d9-e6d1b8442613"/>
410 <uv_test2.tga value="300ce95f-3d3f-7c1a-3a22-3fc48f873fb9"/>
411 <eye_button_active.tga value="2b42b375-f9b4-788e-46c7-7ef38762d0ba"/>
412 <eye_button_inactive.tga value="be1b7225-98b5-eb2a-2c86-ddaae3328a6e"/>
413 <account_id_blue.tga value="6ab9179a-7308-58db-6c9d-893d3b52bece"/>
414 <account_id_orange.tga value="fbe89371-1251-4e77-d2d8-8eeccffe3ca8"/>
415 <account_id_green.tga value="3bf64d5a-38d3-b752-cf52-3d9f8fca353a"/>
416 <status_push.tga value="07d1f523-e327-4d10-20d6-8bc22a6e8f56"/>
417 <ff_visible_online.tga value="d609a41f-34c0-7aae-b2c6-2fc3ab26d916"/>
418 <ff_visible_map.tga value="20b52706-c1ab-414a-9dea-1cb788ad5689"/>
419 <ff_edit_mine.tga value="1baee0b9-4b89-39eb-8815-866d82300ab5"/>
420 <ff_edit_theirs.tga value="32e981cd-4700-da5a-7fc7-d573ec3742f4"/>
421 <inv_item_script_dangerous.tga value="0b502db8-6fcd-c442-ecfe-483a0dce875e"/>
422 <ff_visible_map_button.tga value="c1079bef-5cf9-90f3-6dcd-48989851c252"/>
423 <ff_visible_online_button.tga value="36749b47-93d6-2c5e-7ebd-d38d30311163"/>
424 <ff_edit_theirs_button.tga value="ca229f65-d7e0-133e-1bc2-674abc33f3d5"/>
425 <ff_edit_mine_button.tga value="57f05b46-63d8-c3d5-66d6-8b915746b956"/>
426 <ff_online_status_button.tga value="3b1b6a53-9c8c-568a-22c5-2a8f3e5286f5"/>
427 <oi_hud_cen_0_0.tga value="3c650257-9caf-7cad-b26c-84c9eca560f1"/>
428 <oi_hud_intro.tga value="7611fb3d-9ff2-abd3-d98f-805c1c87e757"/>
429 <oi_hud_underwater.tga value="cde61aea-83c2-3001-d598-6b348f7a8e0b"/>
430 <oi_hud_got_passport.tga value="1271838d-d777-b811-7c4c-2a00308bd80a"/>
431 <oi_hud_texture_off_edge.tga value="852be205-b1ea-6356-58c8-8c5ee5a841a6"/>
432 <oi_hud_texture_on_edge.tga value="ab11e6ff-a732-be70-67df-c43131274562"/>
433 <oi_hud_flyingabovewater.tga value="c9d150d6-2739-5f8b-cce6-3cf98242920a"/>
434 <oi_hud_walkingabovewater.tga value="78284eeb-05f3-ff25-11a0-3cc9dbb30f0c"/>
435 <oi_hud_landmark.tga value="6cd9c221-9d42-a283-256b-09a113a87271"/>
436 <oi_hud_cus_5_3.tga value="7c12f4fb-f502-26d1-a2f3-cdb6aff61663"/>
437 <oi_hud_cus_5_2.tga value="c52c9c94-adc0-0f4e-6658-ed33d6ea8829"/>
438 <oi_hud_cus_5_1.tga value="9f6d5d11-6ca9-608c-e8a6-b77989350292"/>
439 <oi_hud_cus_5_0.tga value="2000cff1-119f-2023-66c0-ac5630d2f96e"/>
440 <oi_hud_cus_4_5.tga value="f302a935-ccd1-e2f5-3a38-e185cc262f3a"/>
441 <oi_hud_cus_4_3.tga value="af8d5b3c-b40f-cea5-b0b2-440fbd84a11a"/>
442 <oi_hud_cus_4_2.tga value="11b26901-8207-12bc-5224-10a12ac4c651"/>
443 <oi_hud_cus_4_1.tga value="41baadb7-1b94-907e-9443-54e92bba77cd"/>
444 <oi_hud_cus_4_0.tga value="9d627f8e-092c-5d32-6c12-ef76ab81cedc"/>
445 <oi_hud_cus_3_4.tga value="b196486e-d0d2-4fd7-529a-c84b4495fc74"/>
446 <oi_hud_cus_3_2.tga value="0b81c4bb-de33-e493-7bcb-e7221d97e5e7"/>
447 <oi_hud_cus_3_1.tga value="436dab74-25ae-8b60-c648-50663b7faa1d"/>
448 <oi_hud_cus_3_0.tga value="6c1594de-1e66-273c-a2ab-8f0ffa8b4633"/>
449 <oi_hud_cus_2_4.tga value="bb31fe48-8566-eec0-e96b-64025f832b63"/>
450 <oi_hud_cus_2_2.tga value="c946959a-26ae-eb66-efa0-20154057789d"/>
451 <oi_hud_cus_2_1.tga value="c946959a-26ae-eb66-efa0-20154057789d"/>
452 <oi_hud_cus_2_0.tga value="d7833106-b4a8-7666-bde1-64886de289f9"/>
453 <oi_hud_cus_1_0.tga value="811ded22-5940-940c-4821-6fbbfb6611d6"/>
454 <oi_hud_cus_1_1.tga value="eda8513b-a343-5109-1fd6-f1c7ad89b703"/>
455 <oi_hud_cus_1_2.tga value="7a4ce18c-e715-34d4-dfee-704c270a8ac8"/>
456 <oi_hud_cus_1_4.tga value="d3771c15-ac03-b762-b992-d9fd2fedf38a"/>
457 <oi_hud_com_4_4.tga value="d9e1e90d-3cc3-6269-128e-67f7a2b32d26"/>
458 <oi_hud_com_4_2.tga value="0f649a26-6fdb-c73b-ffac-e50fc311d5ce"/>
459 <oi_hud_com_4_1.tga value="ae5b1ce6-a2d2-22d2-f532-6280b3bc6adb"/>
460 <oi_hud_com_4_0.tga value="12cda3a0-58c7-dfa8-7f9b-380e5bb8baf9"/>
461 <oi_hud_com_3_4.tga value="ff326257-0530-356a-e0f8-be535044e540"/>
462 <oi_hud_com_3_2.tga value="66740ddb-1d56-89f9-f0c9-ae5eb7bb9537"/>
463 <oi_hud_com_3_1.tga value="55d662f4-6a28-6388-7c75-af1c9fd33055"/>
464 <oi_hud_com_3_0.tga value="de9d318f-b69e-82f9-0c61-43b868c5ca6b"/>
465 <oi_hud_com_2_4.tga value="01d47e68-400a-d0e1-afb7-d6806d1d477e"/>
466 <oi_hud_com_2_0.tga value="09c98850-27d4-6a12-abae-4af4bba23b6b"/>
467 <oi_hud_com_1_3.tga value="5c2049b9-f797-6608-ca71-758f3716aa90"/>
468 <oi_hud_com_1_1.tga value="1116ff68-cdc4-1cfc-e137-30f8426afeda"/>
469 <oi_hud_com_1_0.tga value="bd847d31-f5af-95f7-2b9c-af47d8ba53bd"/>
470 <oi_hud_nav_4_5.tga value="66194280-b087-db94-35d9-41e8f7518515"/>
471 <oi_hud_nav_4_4.tga value="180c4241-e309-4c05-13ee-9080ab69498d"/>
472 <oi_hud_nav_4_3.tga value="e98a6ba6-99c6-fa15-84b6-9afadea6c467"/>
473 <oi_hud_nav_4_2.tga value="2e19f352-1893-59a9-949b-4d2cfd3a8222"/>
474 <oi_hud_nav_4_1.tga value="13a1675b-fb5a-19b3-b5a3-74b0a6765f7d"/>
475 <oi_hud_nav_4_0.tga value="e7526e8d-b085-b26c-b0ae-2708ec231401"/>
476 <oi_hud_nav_3_5.tga value="5e67b0d0-29a2-6a08-c85e-b12d59e53d6e"/>
477 <oi_hud_nav_3_4.tga value="2ed8fbc2-5c4d-53c2-b289-88baffceab1a"/>
478 <oi_hud_nav_3_3.tga value="e0a72f1a-282e-1c1a-2cb7-6423feb41759"/>
479 <oi_hud_nav_3_2.tga value="4bcebb23-da5e-47d9-eac1-e4453f762c8c"/>
480 <oi_hud_nav_3_1.tga value="6ac87575-330e-3a2d-3b80-a34e7b277e50"/>
481 <oi_hud_nav_3_0.tga value="f1451e8e-7310-9152-47d5-5d037c28fef3"/>
482 <oi_hud_nav_2_6.tga value="c60b42ff-ee60-98e4-e603-ca2470141d4b"/>
483 <oi_hud_nav_2_5.tga value="a02b5a1a-bbdb-5556-ae5b-a2e68494755a"/>
484 <oi_hud_nav_2_4.tga value="625535ab-8abf-b3e7-48fb-43f728b77c79"/>
485 <oi_hud_nav_2_3.tga value="00a609c3-5750-3b5a-3ce3-458bdf632203"/>
486 <oi_hud_nav_2_2.tga value="94903387-d37f-092c-e4d2-c190f68577b8"/>
487 <oi_hud_nav_2_1.tga value="ee0cd82c-6ce8-8e73-307b-6d0dc77b19e8"/>
488 <oi_hud_nav_2_0.tga value="3e10b379-ed2c-7424-1fe7-bef3558c7536"/>
489 <oi_hud_nav_1_4.tga value="bf8d0be8-2012-1664-3ea5-e69a71c206e9"/>
490 <oi_hud_nav_1_2.tga value="72100f87-18a7-fc4a-4793-de281e8b02cc"/>
491 <oi_hud_nav_1_1.tga value="b048faf3-60ce-c3a2-d034-36613449d377"/>
492 <oi_hud_nav_1_0.tga value="0ad45106-3b26-6448-0b90-feae8bd46c38"/>
493 <oi_hud_mov_4_5.tga value="7c4a45c2-37dd-312c-c6ab-20896dd0a5a6"/>
494 <oi_hud_mov_4_3.tga value="8a88da1c-3735-c71e-d48a-016df0798de4"/>
495 <oi_hud_mov_4_2.tga value="f55ae4d3-7d6a-e6ac-4cf7-03014ce14390"/>
496 <oi_hud_mov_4_1.tga value="1cc3fcf1-35c0-e222-27d2-6905cf5c4cee"/>
497 <oi_hud_mov_4_0.tga value="1ae592dc-46f4-616e-b7c6-0dff3e6f40e5"/>
498 <oi_hud_mov_3_4.tga value="831b39be-99fc-45bd-ba85-708f9dc93bfd"/>
499 <oi_hud_mov_3_2.tga value="9f7e7373-92a9-d66a-ad5a-afb55ca6ac1f"/>
500 <oi_hud_mov_3_1.tga value="ab37ed0d-7e66-1f77-3acf-b0fe4b74dbe8"/>
501 <oi_hud_mov_3_0.tga value="f5ff1f08-4c92-8606-1854-cc5b9d3e445c"/>
502 <oi_hud_mov_1_2.tga value="1e3abeed-e893-c44e-1f9d-5ecc76d21e5d"/>
503 <oi_hud_mov_1_0.tga value="e300fc95-aa94-8e31-c501-ce903cac8b7c"/>
504</settings> \ No newline at end of file 116</settings> \ No newline at end of file
diff --git a/linden/indra/newview/character/avatar_lad.xml b/linden/indra/newview/character/avatar_lad.xml
index 8038983..3b81fa2 100644
--- a/linden/indra/newview/character/avatar_lad.xml
+++ b/linden/indra/newview/character/avatar_lad.xml
@@ -1,7 +1,9 @@
1<?xml version="1.0" encoding="US-ASCII" standalone="yes"?> 1<?xml version="1.0" encoding="US-ASCII" standalone="yes"?>
2<linden_avatar 2<linden_avatar
3 version="1.0" 3 version="1.0"
4 wearable_definition_version="22"> 4 wearable_definition_version="22">
5 <!-- The wearable_definition_version is checked during asset upload. -->
6 <!-- If you increment it, check indra/lib/python/indra/assetutil.py. -->
5 <skeleton 7 <skeleton
6 file_name="avatar_skeleton.xml"> 8 file_name="avatar_skeleton.xml">
7 <attachment_point 9 <attachment_point
diff --git a/linden/indra/newview/featuretable.txt b/linden/indra/newview/featuretable.txt
index 3675fc3..59e816d 100644
--- a/linden/indra/newview/featuretable.txt
+++ b/linden/indra/newview/featuretable.txt
@@ -1,4 +1,4 @@
1version 9 1version 10
2 2
3// NOTE: This is mostly identical to featuretable_mac.txt with a few differences 3// NOTE: This is mostly identical to featuretable_mac.txt with a few differences
4// Should be combined into one table 4// Should be combined into one table
@@ -23,7 +23,7 @@ version 9
23// NOTE: All settings are set to the MIN of applied values, including 'all'! 23// NOTE: All settings are set to the MIN of applied values, including 'all'!
24// 24//
25list all 25list all
26RenderAGP 1 1 26RenderVBO 1 1
27RenderAniso 1 0 27RenderAniso 1 0
28RenderAvatarMode 1 2 28RenderAvatarMode 1 2
29RenderAvatarVP 1 1 29RenderAvatarVP 1 1
@@ -40,6 +40,7 @@ VertexShaderEnable 1 1
40// 40//
41list Class0 41list Class0
42VertexShaderEnable 1 0 42VertexShaderEnable 1 0
43RenderVBO 1 1
43RenderDistance 1 64 44RenderDistance 1 64
44RenderAvatarVP 1 0 45RenderAvatarVP 1 0
45RenderAvatarMode 1 0 46RenderAvatarMode 1 0
@@ -52,6 +53,7 @@ RenderRippleWater 1 0
52// 53//
53list Class1 54list Class1
54VertexShaderEnable 1 0 55VertexShaderEnable 1 0
56RenderVBO 1 1
55RenderDistance 1 96 57RenderDistance 1 96
56RenderAvatarVP 1 1 58RenderAvatarVP 1 1
57RenderAvatarMode 1 0 59RenderAvatarMode 1 0
@@ -99,7 +101,7 @@ RenderAvatarVP 0 0
99// "Default" setups for safe, low, medium, high 101// "Default" setups for safe, low, medium, high
100// 102//
101list safe 103list safe
102RenderAGP 1 0 104RenderVBO 1 0
103RenderAniso 1 0 105RenderAniso 1 0
104RenderAvatarVP 0 0 106RenderAvatarVP 0 0
105RenderLighting 1 0 107RenderLighting 1 0
@@ -108,7 +110,7 @@ RenderTerrainDetail 1 0
108 110
109 111
110list low 112list low
111RenderAGP 1 1 113RenderVBO 1 0
112RenderAniso 1 0 114RenderAniso 1 0
113RenderLighting 1 0 115RenderLighting 1 0
114 116
@@ -135,12 +137,17 @@ RenderObjectBump 0 0
135// 137//
136// Graphics card based feature masks 138// Graphics card based feature masks
137// 139//
138list Brookdale 140list OpenGLPre15
141RenderVBO 1 0
142
143list Intel
144RenderVBO 1 0
139RenderAniso 1 0 145RenderAniso 1 0
140RenderLighting 1 0 146RenderLighting 1 0
141RenderTerrainDetail 1 0 147RenderTerrainDetail 1 0
142 148
143list GeForce2 149list GeForce2
150RenderVBO 1 1
144RenderAniso 1 0 151RenderAniso 1 0
145RenderLighting 1 0 152RenderLighting 1 0
146RenderParticleCount 1 2048 153RenderParticleCount 1 2048
@@ -150,10 +157,7 @@ list GeForce3
150 157
151list ATI 158list ATI
152 159
153// Hacked to be paranoid "safe"
154// Disable AGP entirely, in Catalyst 4.3 it's at least 50% slower
155list Radeon8500 160list Radeon8500
156RenderAGP 0 0
157RenderLighting 1 0 161RenderLighting 1 0
158RenderParticleCount 1 4096 162RenderParticleCount 1 4096
159 163
@@ -162,9 +166,8 @@ list Radeon9700
162RenderParticleCount 1 4096 166RenderParticleCount 1 4096
163 167
164// Hacked to be paranoid "safe" 168// Hacked to be paranoid "safe"
165// Disable AGP entirely, in Catalyst 4.3 it's at least 50% slower
166list MobilityRadeon9000 169list MobilityRadeon9000
167RenderLighting 1 0 170RenderLighting 1 0
168RenderParticleCount 1 4096 171RenderParticleCount 1 4096
169 172
170list GeForceFX 173list GeForceFX
diff --git a/linden/indra/newview/featuretable_mac.txt b/linden/indra/newview/featuretable_mac.txt
index 25228fc..2685e3b 100644
--- a/linden/indra/newview/featuretable_mac.txt
+++ b/linden/indra/newview/featuretable_mac.txt
@@ -1,4 +1,4 @@
1version 9 1version 10
2 2
3// NOTE: This is mostly identical to featuretable.txt with a few differences 3// NOTE: This is mostly identical to featuretable.txt with a few differences
4// Should be combined into one table 4// Should be combined into one table
@@ -24,7 +24,7 @@ version 9
24// 24//
25// Mac specific: RenderAvatarVP not enabled at all 25// Mac specific: RenderAvatarVP not enabled at all
26list all 26list all
27RenderAGP 1 1 27RenderVBO 1 0
28RenderAniso 1 0 28RenderAniso 1 0
29RenderAvatarMode 1 2 29RenderAvatarMode 1 2
30RenderAvatarVP 1 0 30RenderAvatarVP 1 0
@@ -99,7 +99,7 @@ RenderAvatarVP 0 0
99// "Default" setups for safe, low, medium, high 99// "Default" setups for safe, low, medium, high
100// 100//
101list safe 101list safe
102RenderAGP 1 0 102RenderVBO 1 0
103RenderAniso 1 0 103RenderAniso 1 0
104RenderAvatarVP 0 0 104RenderAvatarVP 0 0
105RenderDistance 1 64 105RenderDistance 1 64
@@ -109,7 +109,7 @@ RenderTerrainDetail 1 0
109 109
110 110
111list low 111list low
112RenderAGP 1 1 112RenderVBO 1 0
113RenderAniso 1 0 113RenderAniso 1 0
114RenderDistance 1 96 114RenderDistance 1 96
115RenderLighting 1 0 115RenderLighting 1 0
@@ -135,6 +135,12 @@ list RAM256MB
135RenderDistance 1 96 135RenderDistance 1 96
136RenderObjectBump 0 0 136RenderObjectBump 0 0
137 137
138//
139// Graphics card based feature masks
140//
141list OpenGLPre15
142RenderVBO 1 0
143
138// nVidia settings 144// nVidia settings
139list NVIDIA 145list NVIDIA
140 146
@@ -146,6 +152,6 @@ RenderParticleCount 1 2048
146RenderTerrainDetail 1 0 152RenderTerrainDetail 1 0
147 153
148// 154//
149// ATI and AGP now work okay. 155// ATI settings
150// 156//
151list ATI 157list ATI
diff --git a/linden/indra/newview/files.lst b/linden/indra/newview/files.lst
index 0439fff..000799d 100644
--- a/linden/indra/newview/files.lst
+++ b/linden/indra/newview/files.lst
@@ -32,19 +32,16 @@ newview/lldebugmessagebox.cpp
32newview/lldebugview.cpp 32newview/lldebugview.cpp
33newview/lldirpicker.cpp 33newview/lldirpicker.cpp
34newview/lldrawable.cpp 34newview/lldrawable.cpp
35newview/lldrawpool.cpp
35newview/lldrawpoolalpha.cpp 36newview/lldrawpoolalpha.cpp
36newview/lldrawpoolavatar.cpp 37newview/lldrawpoolavatar.cpp
37newview/lldrawpoolbump.cpp 38newview/lldrawpoolbump.cpp
38newview/lldrawpoolclouds.cpp
39newview/lldrawpool.cpp
40newview/lldrawpoolground.cpp 39newview/lldrawpoolground.cpp
41newview/lldrawpoolhud.cpp
42newview/lldrawpoolsimple.cpp 40newview/lldrawpoolsimple.cpp
43newview/lldrawpoolsky.cpp 41newview/lldrawpoolsky.cpp
44newview/lldrawpoolstars.cpp 42newview/lldrawpoolstars.cpp
45newview/lldrawpoolterrain.cpp 43newview/lldrawpoolterrain.cpp
46newview/lldrawpooltree.cpp 44newview/lldrawpooltree.cpp
47newview/lldrawpooltreenew.cpp
48newview/lldrawpoolwater.cpp 45newview/lldrawpoolwater.cpp
49newview/lldriverparam.cpp 46newview/lldriverparam.cpp
50newview/lldynamictexture.cpp 47newview/lldynamictexture.cpp
@@ -60,7 +57,6 @@ newview/llfilepicker.cpp
60newview/llfirstuse.cpp 57newview/llfirstuse.cpp
61newview/llflexibleobject.cpp 58newview/llflexibleobject.cpp
62newview/llfloaterabout.cpp 59newview/llfloaterabout.cpp
63newview/llfloateraccounthistory.cpp
64newview/llfloateranimpreview.cpp 60newview/llfloateranimpreview.cpp
65newview/llfloaterauction.cpp 61newview/llfloaterauction.cpp
66newview/llfloateravatarinfo.cpp 62newview/llfloateravatarinfo.cpp
@@ -197,7 +193,6 @@ newview/llpanelland.cpp
197newview/llpanellandobjects.cpp 193newview/llpanellandobjects.cpp
198newview/llpanellandoptions.cpp 194newview/llpanellandoptions.cpp
199newview/llpanellogin.cpp 195newview/llpanellogin.cpp
200newview/llpanelmoney.cpp
201newview/llpanelmorph.cpp 196newview/llpanelmorph.cpp
202newview/llpanelmsgs.cpp 197newview/llpanelmsgs.cpp
203newview/llpanelnetwork.cpp 198newview/llpanelnetwork.cpp
@@ -237,7 +232,8 @@ newview/llstatview.cpp
237newview/llsurface.cpp 232newview/llsurface.cpp
238newview/llsurfacepatch.cpp 233newview/llsurfacepatch.cpp
239newview/lltexlayer.cpp 234newview/lltexlayer.cpp
240newview/lltexturebar.cpp 235newview/lltexturecache.cpp
236newview/lltexturefetch.cpp
241newview/lltexturectrl.cpp 237newview/lltexturectrl.cpp
242newview/lltexturetable.cpp 238newview/lltexturetable.cpp
243newview/lltextureview.cpp 239newview/lltextureview.cpp
@@ -310,14 +306,12 @@ newview/llvograss.cpp
310newview/llvoground.cpp 306newview/llvoground.cpp
311newview/llvoinventorylistener.cpp 307newview/llvoinventorylistener.cpp
312newview/llvolumesliderctrl.cpp 308newview/llvolumesliderctrl.cpp
313newview/llvopart.cpp
314newview/llvopartgroup.cpp 309newview/llvopartgroup.cpp
315newview/llvosky.cpp 310newview/llvosky.cpp
316newview/llvostars.cpp 311newview/llvostars.cpp
317newview/llvosurfacepatch.cpp 312newview/llvosurfacepatch.cpp
318newview/llvotextbubble.cpp 313newview/llvotextbubble.cpp
319newview/llvotree.cpp 314newview/llvotree.cpp
320newview/llvotreenew.cpp
321newview/llvovolume.cpp 315newview/llvovolume.cpp
322newview/llvowater.cpp 316newview/llvowater.cpp
323newview/llwaterpatch.cpp 317newview/llwaterpatch.cpp
diff --git a/linden/indra/newview/gpu_table.txt b/linden/indra/newview/gpu_table.txt
index fae0894..92f9b44 100644
--- a/linden/indra/newview/gpu_table.txt
+++ b/linden/indra/newview/gpu_table.txt
@@ -17,11 +17,14 @@
173Dfx .*3Dfx.* 0 173Dfx .*3Dfx.* 0
183Dlabs .*3Dlabs.* 0 183Dlabs .*3Dlabs.* 0
19ATI All-in-Wonder PCI-E .*ATI.*All-in-Wonder.*PCI-E.* 1 19ATI All-in-Wonder PCI-E .*ATI.*All-in-Wonder.*PCI-E.* 1
20ATI All-in-Wonder X800 .*ATI.*All-in-Wonder X8.* 2
20ATI All-in-Wonder X1800 .*ATI.*All-in-Wonder X18.* 3 21ATI All-in-Wonder X1800 .*ATI.*All-in-Wonder X18.* 3
21ATI All-in-Wonder X1900 .*ATI.*All-in-Wonder X19.* 3 22ATI All-in-Wonder X1900 .*ATI.*All-in-Wonder X19.* 3
22ATI ASUS X1300 .*ATI.*ASUS X13.* 3 23ATI ASUS X1xxx .*ASUS X1.* 3
23ATI ASUS X1600 .*ATI.*ASUS X16.* 3 24ATI Mobility Radeon X1xxx .*ATI.*Mobility.*X1.* 2
24ATI Diamond X1300 .*ATI.*Diamond X13.* 3 25ATI Radeon OpenGL .*ATI.*Radeon OpenGL.* 3
26ATI Diamond X1xxx .*ATI.*Diamond.*X1.* 3
27ATI FireGL 5xxx .*ATI.*FireGL V5.* 3
25ATI FireGL .*ATI.*Fire.*GL.* 0 28ATI FireGL .*ATI.*Fire.*GL.* 0
26ATI FireMV .*ATI.*FireMV.* 0 29ATI FireMV .*ATI.*FireMV.* 0
27ATI Generic .*ATI.*Generic.* 0 30ATI Generic .*ATI.*Generic.* 0
@@ -35,14 +38,19 @@ ATI Radeon 9600 .*ATI.*Radeon 96.* 1
35ATI Radeon 9700 .*ATI.*Radeon 97.* 1 38ATI Radeon 9700 .*ATI.*Radeon 97.* 1
36ATI Radeon 9800 .*ATI.*Radeon 98.* 1 39ATI Radeon 9800 .*ATI.*Radeon 98.* 1
37ATI Radeon X1300 .*ATI.*Radeon X13.* 3 40ATI Radeon X1300 .*ATI.*Radeon X13.* 3
41ATI Radeon X1400 .*ATI.*Radeon X14.* 3
42ATI Radeon X1500 .*ATI.*Radeon X15.* 3
38ATI Radeon X1600 .*ATI.*Radeon X16.* 3 43ATI Radeon X1600 .*ATI.*Radeon X16.* 3
44ATI Radeon X1700 .*ATI.*Radeon X17.* 3
39ATI Radeon X1800 .*ATI.*Radeon X18.* 3 45ATI Radeon X1800 .*ATI.*Radeon X18.* 3
40ATI Radeon X1900 .*ATI.*Radeon X19.* 3 46ATI Radeon X1900 .*ATI.*Radeon X19.* 3
41ATI Radeon X300 .*ATI.*Radeon X3.* 2 47ATI Radeon X300 .*ATI.*Radeon X3.* 2
48ATI Radeon X400 .*ATI.*Radeon X4.* 2
42ATI Radeon X500 .*ATI.*Radeon X5.* 2 49ATI Radeon X500 .*ATI.*Radeon X5.* 2
43ATI Radeon X600 .*ATI.*Radeon X6.* 2 50ATI Radeon X600 .*ATI.*Radeon X6.* 2
44ATI Radeon X700 .*ATI.*Radeon X7.* 2 51ATI Radeon X700 .*ATI.*Radeon X7.* 2
45ATI Radeon X800 .*ATI.*Radeon X8.* 2 52ATI Radeon X800 .*ATI.*Radeon X8.* 2
53ATI Radeon X900 .*ATI.*Radeon X9.* 2
46ATI Radeon Xpress .*ATI.*Radeon Xpress.* 1 54ATI Radeon Xpress .*ATI.*Radeon Xpress.* 1
47ATI Rage 128 .*ATI.*Rage 128.* 0 55ATI Rage 128 .*ATI.*Rage 128.* 0
48Intel 830M .*Intel.*830M 0 56Intel 830M .*Intel.*830M 0
@@ -91,7 +99,6 @@ NVIDIA GeForce FX Go5600 .*NVIDIA.*GeForce FX Go56.* 1
91NVIDIA GeForce FX Go5700 .*NVIDIA.*GeForce FX Go57.* 1 99NVIDIA GeForce FX Go5700 .*NVIDIA.*GeForce FX Go57.* 1
92NVIDIA GeForce FX Go5800 .*NVIDIA.*GeForce FX Go58.* 1 100NVIDIA GeForce FX Go5800 .*NVIDIA.*GeForce FX Go58.* 1
93NVIDIA GeForce FX Go5900 .*NVIDIA.*GeForce FX Go59.* 1 101NVIDIA GeForce FX Go5900 .*NVIDIA.*GeForce FX Go59.* 1
94NVIDIA GeForce Go 6 .*GeForce Go 6.* 2
95NVIDIA GeForce Go 6100 .*NVIDIA.*GeForce Go 61.* 2 102NVIDIA GeForce Go 6100 .*NVIDIA.*GeForce Go 61.* 2
96NVIDIA GeForce Go 6200 .*NVIDIA.*GeForce Go 62.* 2 103NVIDIA GeForce Go 6200 .*NVIDIA.*GeForce Go 62.* 2
97NVIDIA GeForce Go 6500 .*NVIDIA.*GeForce Go 65.* 2 104NVIDIA GeForce Go 6500 .*NVIDIA.*GeForce Go 65.* 2
@@ -103,6 +110,7 @@ NVIDIA GeForce Go 7400 .*NVIDIA.*GeForce Go 74.* 3
103NVIDIA GeForce Go 7600 .*NVIDIA.*GeForce Go 76.* 3 110NVIDIA GeForce Go 7600 .*NVIDIA.*GeForce Go 76.* 3
104NVIDIA GeForce Go 7800 .*NVIDIA.*GeForce Go 78.* 3 111NVIDIA GeForce Go 7800 .*NVIDIA.*GeForce Go 78.* 3
105NVIDIA GeForce Go 7900 .*NVIDIA.*GeForce Go 79.* 3 112NVIDIA GeForce Go 7900 .*NVIDIA.*GeForce Go 79.* 3
113NVIDIA GeForce Go 6 .*GeForce Go 6.* 2
106NVIDIA GeForce PCX .*GeForce PCX.* 1 114NVIDIA GeForce PCX .*GeForce PCX.* 1
107NVIDIA Generic .*NVIDIA.*NV.* 0 115NVIDIA Generic .*NVIDIA.*NV.* 0
108NVIDIA Generic .*NVIDIA.*Unknown.* 0 116NVIDIA Generic .*NVIDIA.*Unknown.* 0
diff --git a/linden/indra/newview/help/Advanced/Advanced_Second_Life_Skills.html b/linden/indra/newview/help/Advanced/Advanced_Second_Life_Skills.html
deleted file mode 100644
index 16c192d..0000000
--- a/linden/indra/newview/help/Advanced/Advanced_Second_Life_Skills.html
+++ /dev/null
@@ -1,46 +0,0 @@
1<html>
2<head>
3 <title>Advanced Second Life Skills</title>
4</head>
5
6<body>
7<br>
8<font color="#000000">You've learned the basics and spent a little time exploring Second Life.</font>
9<p>
10<font color="#000000">To get the most out of this world, you'll want to learn a few more simple things and have a few more new experiences.</font>
11<p>
12<font color="#000000">The different topics below are arranged to be easiest if you follow them in order, first to last. But it's your life. Do what you want. However you choose to proceed, take your time and play along the way.</font>
13<p>
14<a href="The_Lay_of_the_Land.html">The Lay of the Land</a> -- Get an overview of the world where you live your Second Life, and find out where to go for a good time.
15<p>
16<a href="Getting_Around.html">Getting Around: Navigation and Landmarks</a> -- Learn some tricks for navigation around the world.
17<p>
18<a href="Nesting.html">Nesting</a> -- Find a place to call home and buy some land.
19<p>
20<a href="Home_Time.html">Home Time</a> -- Buy a house, then decorate it.
21<p>
22<a href="Personalize_Your_Home.html">Personalize Your Home</a> -- A little paint and wallpaper goes a long way.
23<p>
24<a href="The_Second_Life_Economy.html">The Second Life Economy</a> -- A little more information about how the money system works in Second Life.
25<p>
26<a href="Shopping_201.html">Shopping 201</a> -- Pick up some furnishings for your new home.
27<p>
28<a href="People.html">People</a> -- Find people you know and people and groups you may want to meet.
29<p>
30<a href="More_Ways_to_Communicate.html">More Ways to Communicate</a> -- Gestures, sounds and shortcuts will spruce up and speed up your conversations.
31<p>
32<a href="Clothing_Makes_the_Avatar.html">Clothing Makes the Avatar</a> -- Go deeper into Avatar customization and create your own look.
33<p>
34<a href="Party_Time.html">Party Time</a> -- Time to go dancing and meet some new people.
35<p>
36<a href="Dangerous_Time.html">Dangerous Time</a> -- Jessie is where you can play the deadliest game.
37<p>
38<a href="Creation_101.html">Creation 101</a> -- Some basics on creating and building new things in Second Life.
39<p>
40<a href="Graduation.html">Graduation</a> -- Congrats on a job well done, and where to go if you want to learn even more.
41<p>
42[ <a href="The_Lay_of_the_Land.html">Next</a> ]
43
44
45</body>
46</html>
diff --git a/linden/indra/newview/help/Advanced/Building_the_Lamp_Base.html b/linden/indra/newview/help/Advanced/Building_the_Lamp_Base.html
deleted file mode 100644
index 07edd57..0000000
--- a/linden/indra/newview/help/Advanced/Building_the_Lamp_Base.html
+++ /dev/null
@@ -1,68 +0,0 @@
1
2<html>
3<head>
4 <title>Creation 101: Building the Lamp Base</title>
5</head>
6
7<body>
8<br>
9<font color="#000000">Let's start by building the lamp's base.</font>
10<p>
11<font color="#000080">1. You should be at your home, or a nice, flat area, with the model lamp nearby.</font>
12<p>
13<font color="#000080">2. Click on the ground near the model lamp.</font>
14<p>
15<font color="#000080">3. When the pie menu opens, select <font color="#B00000">Create</font>.</font>
16<p>
17<font color="#000000">A few things happen: the view focuses on the ground where you clicked, the cursor changes to the creation wand, and the Tool palette opens.</font>
18<p>
19<font color="#000000">On the Tool palette are a number of shapes you can create. We want the box shape on the far left.</font>
20<p>
21<font color="#000080">4. Click on the box shape in the tool palette.</font>
22<p>
23<font color="#000080">5. Click on the ground to create a box.</font>
24<p>
25<font color="#000000">The default box has been created. We'll want to change it. </font>
26<p>
27<font color="#000080">6. Click on the box you just created to make sure it's selected.</font>
28<p>
29<font color="#000080">7. Click on the <font color="#B00000">More</font> button in the Tool Palette.</font>
30<p>
31<font color="#000000">The Tool Palette expands.</font>
32<p>
33<font color="#000080">8. Click on the <font color="#B00000">Object tab</font> in the Tool Palette.</font>
34<p>
35<font color="#000000">The Tool Palette now shows a lot of controls for changing the box. It looks complicated, but we'll only deal with a few of the controls at a time.</font>
36<p>
37<font color="#000080">9. Find the <font color="#B00000">Size (meters)</font> controls.</font>
38<p>
39<font color="#000080">10. Change the number in the Z Size control to <font color="#B00000">0.100</font>.</font>
40<p>
41<font color="#000000">You can do this with the arrows, or highlight the number that's there and type in a new one.</font>
42<p>
43<font color="#000000">Now let's change the material that the box is made of.</font>
44<p>
45<font color="#000080">11. Find the <font color="#B00000">Material</font> drop-down menu at the bottom of the Tool Palette. </font>
46<p>
47<font color="#000080">12. Click on the Material menu and select <font color="#B00000">Metal</font>.</font>
48<p>
49<font color="#000000">It looks like nothing has happened. That's OK. You've changed the material of the box, so it will act like metal, but it still has the wood texture. In Second Life, you can put any texture on any material. This gives you as much flexibility as possible.</font>
50<p>
51<font color="#000000">So, let's make the metal box look like metal.</font>
52<p>
53<font color="#000080">13. Click on the <font color="#B00000">Texture tab</font> in the Tool Palette.</font>
54<p>
55<font color="#000080">14. Click on the picture of the wooden texture.</font>
56<p>
57<font color="#000000">The Pick: Texture dialog opens.</font>
58<p>
59<font color="#000080">15. Click on the drop-down menu (it should say Default), and choose <font color="#B00000">Steel Plate</font>, then click OK.</font>
60<p>
61<font color="#000000">The look of the box now changes </font>
62<p>
63<font color="#000000">Steel Plate is the texture used in the model lamp, but you can pick any other texture that you prefer. Take some time if you like and try out a few different textures. Once you pick one that you like, move on to the next step.</font>
64<p>
65[ <a href="Advanced_Second_Life_Skills.html">Advanced Skills Home</a> | <a href="Creation_101.html">Creation 101 Home</a> | <a href="Building_the_Lamp_Pole.html">Next</a> ]
66
67</body>
68</html>
diff --git a/linden/indra/newview/help/Advanced/Building_the_Lamp_Bulb.html b/linden/indra/newview/help/Advanced/Building_the_Lamp_Bulb.html
deleted file mode 100644
index 11e3537..0000000
--- a/linden/indra/newview/help/Advanced/Building_the_Lamp_Bulb.html
+++ /dev/null
@@ -1,43 +0,0 @@
1
2<html>
3<head>
4 <title>Creation 101: Building the Lamp Bulb</title>
5</head>
6
7<body>
8<br>
9<font color="#000000">Now let's build the bulb.</font>
10<p>
11<font color="#000080">1. Click on the <font color="#B00000">Create</font> icon in the Tool Palette.</font>
12<p>
13<font color="#000080">2. Click on the <font color="#B00000">half-sphere</font> icon (top row, far right).</font>
14<p>
15<font color="#000080">3. Click on the ground near your lamp base and pole.</font>
16<p>
17<font color="#000000">The default size will work just fine, so we won't have to change that, but we'll want to
18change the material.</font>
19<p>
20<font color="#000080">4. Click on the <font color="#B00000">Edit</font> icon in the Tool Palette, then make sure the new half-sphere is selected.</font>
21<p>
22<font color="#000080">5. Click on the <font color="#B00000">Object tab</font>,then click on the <font color="#B00000">Material drop-down</font>, and then select Light.</font>
23<p>
24<font color="#000000">Now you've got what looks like a glowing piece of wood. Let's change the texture to get something that looks more like a light bulb.</font>
25<p>
26<font color="#000080">6. Click on the <font color="#B00000">Texture tab</font>, then click on the <font color="#B00000">wood texture</font> to open the Pick: Texture dialog.</font>
27<p>
28<font color="#000080">7. Click on the <font color="#B00000">White</font> button, then click <font color="#B00000">OK</font>.</font>
29<p>
30<font color="#000000">You now have a white, glowing bulb.</font>
31<p>
32<font color="#000000">Now, let's move the bulb into place on top of the pole.</font>
33<p>
34<font color="#000080">8. Click on the Edit icon, then on the bulb, then drag the three arrows and place the half-sphere on top of the pole.</font>
35<p>
36<font color="#000000">Again, moving things around in 3-D is tricky. Be patient and don't be afraid to use the Focus tool and move the camera around so you can see things at different angles.</font>
37<p>
38<font color="#000000">After futzing with placing the bulb for a while, it may occur to you that there has to be a more exact way to do this. There is: by using the Position controls in the Object tab.</font>
39<p>
40[ <a href="Advanced_Second_Life_Skills.html">Advanced Skills Home</a> | <a href="Creation_101.html">Creation 101 Home</a> | <a href="Building_the_Lamp_Pole.html">Previous</a> | <a href="Positioning_with_Numbers.html">Next</a> ]
41
42</body>
43</html>
diff --git a/linden/indra/newview/help/Advanced/Building_the_Lamp_Pole.html b/linden/indra/newview/help/Advanced/Building_the_Lamp_Pole.html
deleted file mode 100644
index 80c600c..0000000
--- a/linden/indra/newview/help/Advanced/Building_the_Lamp_Pole.html
+++ /dev/null
@@ -1,43 +0,0 @@
1
2<html>
3<head>
4 <title>Creation 101: Building the Lamp Pole</title>
5</head>
6
7<body>
8<br>
9<font color="#000000">Now we'll build the lamp's pole.</font>
10<p>
11<font color="#000080">1. Click on the <font color="#B00000">Create</font> button in the Tool Palette.</font>
12<p>
13<font color="#000080">2. Click on the <font color="#B00000">Cylinder</font> button (top row, 5th from the left).</font>
14<p>
15<font color="#000080">3. Click on the ground near the lamp base you made.</font>
16<p>
17<font color="#000080">4. Click on the <font color="#B00000">Object tab</font> in the Tool Palette.</font>
18<p>
19<font color="#000080">5. Change the X Size to 0.100, change the Y Size to 0.100, and change the Z Size to 2.000.</font>
20<p>
21<font color="#000080">6. Change the pole's Material to <font color="#B00000">Metal</font>.</font>
22<p>
23<font color="#000080">7. Change the pole's texture to match the base.</font>
24<p>
25<font color="#000000">Now we need to move the pole to the center of the base. Moving things in 3-D is tricky, so be patient.</font>
26<p>
27<font color="#000000">You may find that you'll need to change your view at times. To change your view at any time, click on the Focus icon, and move the camera around until you can see what you want. (We learned how to do this earlier--it works just like using the Focus On feature from the pie menu.)</font>
28<p>
29<font color="#000080">8. Click on the <font color="#B00000">Edit</font> icon in the Tool Palette.</font>
30<p>
31<font color="#000080">9. Click on the pole.</font>
32<p>
33<font color="#000000">Now you'll see red, green and blue arrows. These are axes (plural of axis). You can move things around be dragging these arrows.</font>
34<p>
35<font color="#000080">10. Drag the up-pointing blue arrow until the pole is just resting on the ground (not half-buried).</font>
36<p>
37<font color="#000080">11. Drag the red and green arrows to place the pole right in the middle of the base.</font>
38<p>
39
40[ <a href="Advanced_Second_Life_Skills.html">Advanced Skills Home</a> | <a href="Creation_101.html">Creation 101 Home</a> | <a href="Building_the_Lamp_Base.html">Previous</a> | <a href="Building_the_Lamp_Bulb.html">Next</a> ]
41
42</body>
43</html>
diff --git a/linden/indra/newview/help/Advanced/Clothing_Makes_the_Avatar.html b/linden/indra/newview/help/Advanced/Clothing_Makes_the_Avatar.html
deleted file mode 100644
index d370e01..0000000
--- a/linden/indra/newview/help/Advanced/Clothing_Makes_the_Avatar.html
+++ /dev/null
@@ -1,73 +0,0 @@
1<html>
2<head>
3 <title>Clothing Makes the Avatar</title>
4</head>
5
6<body>
7<br>
8<font color="#000000">Soon, we'll be going out for a party. We need a new outfit for the occasion.</font>
9<p>
10<font color="#000080">1. Click on your avatar, then click on Appearance....</font>
11<p>
12<font color="#000080">2. Click on the Make Outfit button at the bottom of the Appearance dialog.</font>
13<p>
14<font color="#000000">Another dialog opens.</font>
15<p>
16<font color="#000080">3. Under Folder name: type in Everyday Clothes.</font>
17<p>
18<font color="#000000">You'll notice that you can choose to include your avatar's Shape, Skin, Hair and Eyes in the new outfit as well as clothes. This lets you not only instantly change clothes, but also change the entire look of your avatar any time you want.</font>
19<p>
20<font color="#000000">For now, let's only include Hair, Eyes, Shirt, Pants, Shoes, Socks and Jacket. You can always modify other things later.</font>
21<p>
22<font color="#000080">4. Check the boxes next to Hair, Eyes, Shirt, Pants, Shoes, Socks and Jacket, then click Save.</font>
23<p>
24<font color="#000000">We have now saved the complete current outfit that we're wearing, so we can return to it instantly at any time.</font>
25<p>
26<font color="#000080">5. Click on the Make Outfit button again.</font>
27<p>
28<font color="#000080">6. Under Folder name: type in Party Clothes and click Save.</font>
29<p>
30<font color="#000000">Now, we have a duplicate set of clothes that we can modify. Let's create our new party outfit, starting with the jacket.</font>
31<p>
32<font color="#000080">7. Click on the Shirt button on the left side of the Appearance dialog.</font>
33<p>
34<font color="#000080">8. Click on the Upper Fabric square.</font>
35<p>
36<font color="#000000">A small dialog opens, displaying a swatch of the current jacket fabric.</font>
37<p>
38<font color="#000080">9. Click on the pop-up menu just below the swatch, and choose a new fabric for your jacket, then click OK.</font>
39<p>
40<font color="#000080">10. Try on a few fabrics, then choose one to keep.</font>
41<p>
42<font color="#000080">11. Choose a Fabric for the jacket's Lower Fabric.</font>
43<p>
44<font color="#000000">It can be the same as the Upper Fabric, or different, depending on your personal preference.</font>
45<p>
46<font color="#000080">12. Now play with the sliders to adjust the look and fit of the jacket.</font>
47<p>
48<font color="#000080">13. Change your shirt, pants, shoes and socks in the same way.</font>
49<p>
50<font color="#000080">14. Now, give yourself a new hairdo and a custom eye color.</font>
51<p>
52<font color="#000080">15. When you're all done modifying your outfit, click on the Save All button.</font>
53<p>
54<font color="#000000">You have now saved all of the recent modifications into your Inventory.</font>
55<p>
56<font color="#000000">Let's see how easy it is to change.</font>
57<p>
58<font color="#000080">16. Open the Inventory and then open the Clothing folder.</font>
59<p>
60<font color="#000080">17. Drag the Everyday Clothes folder out of your Inventory and onto your avatar.</font>
61<p>
62<font color="#000000">Everything should change -- even the hairstyle and eye color.</font>
63<p>
64<font color="#000080">18. Drag the Party Clothes folder out of your Inventory and onto your avatar.</font>
65<p>
66<font color="Black">You've instantly changed back into your party clothes, and you're ready for a night on the town.</font>
67
68<p>
69[ <a href="Advanced_Second_Life_Skills.html">Advanced Skills Home</a> | <a href="More_Ways_to_Communicate.html">Previous</a> | <a href="Party_Time.html">Next</a> ]
70
71
72</body>
73</html>
diff --git a/linden/indra/newview/help/Advanced/Creation_101.html b/linden/indra/newview/help/Advanced/Creation_101.html
deleted file mode 100644
index d2f26c7..0000000
--- a/linden/indra/newview/help/Advanced/Creation_101.html
+++ /dev/null
@@ -1,53 +0,0 @@
1<html>
2<head>
3 <title>Creation 101</title>
4</head>
5
6<body>
7<br>
8<font color="#000000">Pretty soon, you'll want or need something that you can't find. Or maybe you'll just have an urge to make your mark in this life. Either way, you'll reach a point where you'll want to learn how to build things in Second Life.</font>
9<p>
10<font color="#000000">In this, the last of the Advanced Second Life Skills, we'll create a simple floor lamp for your home. Then we'll use scripting to turn the light on and off in a couple of ways.</font>
11<p>
12<font color="#000000">To help guide you as you build the lamp, we've put a model in your Inventory.</font>
13<p>
14<font color="#000080">1. Go to your home, or find a nice, flat area to build your lamp.</font>
15<p>
16<font color="#000000">You can build on your own land, or on public land. You can only build on someone else's land if they give you permission.</font>
17<p>
18<font color="#000080">2. Open your Inventory.</font>
19<p>
20<font color="#000080">3. Open the Objects folder.</font>
21<p>
22<font color="#000080">4. Open the Household folder.</font>
23<p>
24<font color="#000080">5. Find the <font color="#B00000">Floor Lamp</font>, and drag it out of your Inventory and onto the ground near you.</font>
25<p>
26<font color="#000000">As you can see, the lamp is made of three parts, each of which is a different shape: a square base, a cylindrical pole, and a half-spherical globe (the part that lights up).</font>
27<p>
28<font color="#000000">You'll also notice that the lamp isn't very beautiful -- but it's nice and simple, so it makes a good first project.</font>
29<p>
30<font color="#000080">6. Click on the lamp's globe.</font>
31<p>
32<font color="#000000">The light turns off.</font>
33<p>
34<font color="#000080">7. Click on the lamp's globe again.</font>
35<p>
36<font color="#000000">The light turns on.</font>
37<p>
38<font color="#000080">8. Hit Enter (Return), type &quot;off&quot; then hit Enter again.</font>
39<p>
40<font color="#000000">The light turns off.</font>
41<p>
42<font color="#000080">9. Hit Enter (Return), type &quot;on&quot; then hit Enter again.</font>
43<p>
44<font color="#000000">The light turns on.</font>
45<p>
46<font color="#000000">As you can see, the lamp is reasonably functional.</font>
47
48<font color="#000000">Click next to begin building your own version of the lamp.</font>
49<p>
50[ <a href="Advanced_Second_Life_Skills.html">Advanced Skills Home</a> | <a href="Dangerous_Time.html">Previous</a> | <a href="Building_the_Lamp_Base.html">Next</a> ]
51
52</body>
53</html>
diff --git a/linden/indra/newview/help/Advanced/Dangerous_Time.html b/linden/indra/newview/help/Advanced/Dangerous_Time.html
deleted file mode 100644
index 7793d6c..0000000
--- a/linden/indra/newview/help/Advanced/Dangerous_Time.html
+++ /dev/null
@@ -1,37 +0,0 @@
1<html>
2<head>
3 <title>Dangerous Time</title>
4</head>
5
6<body>
7<br>
8<font color="#000000">Now let's visit Jessie and see how much danger we can handle.</font>
9<p>
10<font color="#000080">1. Navigate your way to the Jessie Wall and cross over.</font>
11<p>
12<font color="#000000">Once you enter Jessie, you'll notice that your health rating appears in the lower-left corner of the screen. That means your avatar can be damaged or killed here. Be careful.</font>
13<p>
14<font color="#000000"It's good idea to be armed when travelling in Jessie, and you'll usually find a number of merchants there ready to help outfit you with weapons.</font>
15<p>
16<font color="#000080">2. Buy a gun or other weapon.</font>
17<p>
18<font color="#000080">3. The use of your weapon will very from type to type -- most come with an instructional Notecard detailing proper operation.
19<p>
20<font color="#000000">The most efficient way to maneuver and fire weapons is in Mouselook.</font>
21<p>
22<font color="#000080">4. Press the M key on your keyboard to enter Mouselook mode.</font>
23<p>
24<font color="#000000">In general, you'll use the keyboard's W and S keys to move forward and backward, and use the mouse to steer. If you haven't moved around in Mouselook before, you may want to practice a little.</font>
25<p>
26<font color="#000000">One more thing you'll need to know: you also aim the gun with the mouse, and press the left mouse button to fire.</font>
27<p>
28<font color="#000080">5. Wander around in Mouselook and take some practice shots.</font>
29<p>
30<font color="#000080">6. Once you feel secure that you can move, aim, and shoot, head deep into Jessie.
31<p>
32<font color="#000000">You can stay and play if you want, otherwise click Next below to leap from destruction to creation and learn how to build things in Second Life.</font>
33<p>
34[ <a href="Advanced_Second_Life_Skills.html">Advanced Skills Home</a> | <a href="Party_Time.html">Previous</a> | <a href="Creation_101.html">Next</a> ]
35
36</body>
37</html>
diff --git a/linden/indra/newview/help/Advanced/Getting_Around.html b/linden/indra/newview/help/Advanced/Getting_Around.html
deleted file mode 100644
index b100cfd..0000000
--- a/linden/indra/newview/help/Advanced/Getting_Around.html
+++ /dev/null
@@ -1,29 +0,0 @@
1<html>
2<head>
3 <title>Getting Around: Navigation and Landmarks</title>
4</head>
5
6<body>
7<br>
8<font color="#000000">Open the World Map and double-click any place the looks interesting; your avatar will teleport to the Telehub closest to your chosen location.</font>
9<p>
10<font color="#000080">Fly down from the Telehub and choose a spot that you'd like to explore more in the future.
11<p>
12<font color="#000000">Now, let's make a landmark so that you can find your way back again later.</font>
13<p>
14<font color="#000080">12. Open the World menu and select Create Landmark Here.</font>
15<p>
16<font color="#000000">Your Inventory will open if (it's not already open), and a new landmark, called New Landmark, is there and highlighted.</font>
17<p>
18<font color="#000080">13. Right-click on the New Landmark, and select Rename.</font>
19<p>
20<font color="#000080">14. Type in a new name for the landmark, something the describes the place, and hit Enter (Return).</font>
21<p>
22<font color="#000000">Now you have a new landmark to use any time you want.</font>
23<p>
24<font color="#000000">When you use your landmark, you'll be teleported to the nearest Telehub location. From there, turn your avatar until you see the red beacon and follow it to the final destination.</font>
25[ <a href="Advanced_Second_Life_Skills.html">Advanced Skills Home</a> | <a href="The_Lay_of_the_Land.html">Previous</a> | <a href="Nesting.html">Next</a> ]
26
27
28</body>
29</html>
diff --git a/linden/indra/newview/help/Advanced/Graduation.html b/linden/indra/newview/help/Advanced/Graduation.html
deleted file mode 100644
index 15cd03f..0000000
--- a/linden/indra/newview/help/Advanced/Graduation.html
+++ /dev/null
@@ -1,29 +0,0 @@
1<html>
2<head>
3 <title>Graduation</title>
4</head>
5
6<body>
7<br>
8<font color="#000000">You've now absorbed the Advanced Second Life Skills.</font>
9<p>
10<font color="#000000">For many, if not most, this is all you'll want or need to live our your Second Life. </font>
11<p>
12<font color="#000000">But more information is available for those of you who really want to learn how to build things and write scripts:</font>
13<p>
14<font color="#006000">Script Help ...</font> <font color="#000000">in the Help menu provides a complete reference to the Second Life Scripting Language.</font>
15<p>
16You can find even more scripting information in the <a href="https://secondlife.com/badgeo/wakka.php?wakka=HomePage">Scripting Wiki</a>, a document constantly updated and added to by Second Life resident scripters.
17<p>
18Even more information on various parts of the Second Life world can be found in the general Support Wiki at <a href="http://secondlife.com/help">http://secondlife.com/help</a>.
19<p>
20<font color="#006000">More documents in PDF format</font> <font color="#000000">are available on the Second Life Members website, under the Downloads menu.</font>
21<p>
22<font color="#000000">Possibly the best resources for learning are the </font><font color="#006000">Forums</font> <font color="#000000">at Secondlife.com, where you can ask questions and get answers. You can also see what others have been asking about.</font>
23<p>
24<font color="#000000">Have a nice life.</font>
25<p>
26[ <a href="Advanced_Second_Life_Skills.html">Advanced Skills Home</a> | <a href="Creation_101.html">Previous</a> ]
27
28</body>
29</html>
diff --git a/linden/indra/newview/help/Advanced/Home_Time.html b/linden/indra/newview/help/Advanced/Home_Time.html
deleted file mode 100644
index feb44a9..0000000
--- a/linden/indra/newview/help/Advanced/Home_Time.html
+++ /dev/null
@@ -1,29 +0,0 @@
1<html>
2<head>
3 <title>Home Time</title>
4</head>
5
6<body>
7<br>
8<font color="#000000">Now that you have some land, you need a house to put there.</font>
9<p>
10Fortunately, there's a cozy little basic cabin in your Inventory, ready to build. This cabin isn't very big or fancy. And you'll see a number of them around.
11<p>
12But you can do a lot of customizing to make it more original. And once you learn the ways of the world and as you participate more in the Second Life economy, you'll be able to afford to buy a much nicer house -- or design and build your own.
13<p>
14<font color="#000080">1. Open your Inventory and open the Objects folder.</font>
15<p>
16<font color="#000080">2. Find the object called "Cabin, Little," and drag it out of your Inventory and onto your land.
17<p>
18<font color="#000000">Technically -- and this is an important point to understand -- the cabin itself wasn't in your inventory -- just the design for the cabin. When you pull that design out of your inventory and place it on the ground, it is then built. We'll discuss this in a minute.</font>
19<p>
20<font color="#000080">3. Click on the cabin and select Edit from the pie menu.</font>
21<p>
22<font color="#000080">4. Drag the cabin around by the arrows to place it exactly where you want it. (Don't forget to adjust it up and down.)</font>
23<p>
24<font color="#000000">Once your new cabin is in place, click on next to take the next step -- customizing and personalizing your new home.</font>
25<p>
26[ <a href="Advanced_Second_Life_Skills.html">Advanced Skills Home</a> | <a href="Nesting.html">Previous</a> | <a href="Personalize_Your_Home.html">Next</a> ]
27
28</body>
29</html>
diff --git a/linden/indra/newview/help/Advanced/Installing_a_Script.html b/linden/indra/newview/help/Advanced/Installing_a_Script.html
deleted file mode 100644
index 7e8bc14..0000000
--- a/linden/indra/newview/help/Advanced/Installing_a_Script.html
+++ /dev/null
@@ -1,73 +0,0 @@
1<html>
2<head>
3 <title>Creation 101: Installing a Script</title>
4</head>
5
6<body>
7<br>
8<font color="#000000">The Second Life scripting language is very powerful. It lets you add more functionality and interactivity to everything you build.</font>
9<p>
10<font color="#000000">If you're a programmer or are familiar with other scripting languages, you'll have no trouble learning the Second Life scripting language. A complete reference to the scripting language can be found in the Help menu.</font>
11<p>
12<font color="#000000">Even if you're not a programmer and you have no interest in learning to write scripts, you can still make use of them in your creations.</font>
13<p>
14<font color="#000000">If you need something complex or special scriptwise, there will be people to write it for you -- for a certain amount of Linden Dollars.</font>
15<p>
16<font color="#000000">But for simple things -- especially common ones like turning lights on and off -- there are scripts available for the taking. A number of useful scripts can be found in your Inventory.</font>
17<p>
18<font color="#000000">A good way to get scripts is to copy them from objects that already have them. As you travel through your Second Life, you'll find things that you like, some of which have scripts that you can take.</font>
19<p>
20<font color="#000000">When someone creates something, with or without a script, they can set the permissions either so people can or can't copy any or all of it. You'll no doubt find cool things that you can't copy, but many of things can be copied and you'll have access to copy the scripts, as well.</font>
21<p>
22<font color="#000000">Obviously, the model lamp has exactly the script you need for your lamp. Let's take the script out, then add it to our new lamp.</font>
23<p>
24<font color="#000000">The script you want is actually attached to the bulb of the model lamp. To access that single part, we'll first have to Unlink the lamp's parts.</font>
25<p>
26<font color="#000080">1. Click on the model lamp to select it.</font>
27<p>
28<font color="#000080">2. Open the Tools menu (the Tools menu at the top of the screen, not the Tool Palette) and select <font color="#B00000">Unlink</font>.</font>
29<p>
30<font color="#000080">3. Click on the ground near the model lamp to unselect it, then click on the bulb.</font>
31<p>
32<font color="#000080">4. Click on the Content tab of the Tool Palette. </font>
33<p>
34<font color="#000000">You should see a couple of button sounds and a script called LightScript in the contents.</font>
35<p>
36<font color="#000080">5. Drag the script into the <font color="#B00000">Scripts</font> folder of your Inventory.</font>
37<p>
38<font color="#000080">6. Now, click on the bulb of your new lamp.</font>
39<p>
40<font color="#000000">You should see an empty Contents tab in the Tool Palette.</font>
41<p>
42<font color="#000080">7. Drag LightScript from the Scripts folder of your Inventory into the Contents folder in the Tool Palette.</font>
43<p>
44<font color="#000000">The script is installed. It's that simple.</font>
45<p>
46<font color="#000000">This script also plays sounds -- button clicks -- when the lamp turns on and off. So we'll also add those two sounds to the Contents folder (so the script can access them). We could have copied them from the other lamp, but since they're common sounds used by a number of things, they're already in your Inventory in the Sounds folder.</font>
47<p>
48<font color="#000080">8. In your Inventory, open the Sounds folder, and drag both Button_click_down and Button_click_up into the Contents folder.</font>
49<p>
50<font color="#000080">9. Close the Tool Palette to get out of Edit view.</font>
51<p>
52<font color="#000080">10. Click on the bulb of your new lamp.</font>
53<p>
54<font color="#000000">The bulb should turn off.</font>
55<p>
56<font color="#000080">11. Click on it again.</font>
57<p>
58<font color="#000000">The bulb turns on.</font>
59<p>
60<font color="#000080">12. Hit Enter (Return) and type &quot;off&quot;, and hit Enter again.</font>
61<p>
62<font color="#000000">Again, the light turns off.</font>
63<p>
64<font color="#000080">13. Hit Enter (Return) and type &quot;on&quot;, and hit Enter again.</font>
65<p>
66<font color="#000000">And again, the light turns on.</font>
67<p>
68<font color="#000000">Next, let's take a look at a script and learn how we can easily modify it.</font>
69<p>
70[ <a href="Advanced_Second_Life_Skills.html">Advanced Skills Home</a> | <a href="Creation_101.html">Creation 101 Home</a> | <a href="Simple_on_off.html">Previous</a> | <a href="Modifying_a_Script.html">Next</a> ]
71
72</body>
73</html>
diff --git a/linden/indra/newview/help/Advanced/Modifying_a_Script.html b/linden/indra/newview/help/Advanced/Modifying_a_Script.html
deleted file mode 100644
index 9ae2137..0000000
--- a/linden/indra/newview/help/Advanced/Modifying_a_Script.html
+++ /dev/null
@@ -1,74 +0,0 @@
1<html>
2<head>
3 <title>Creation 101: Modifying a Script</title>
4</head>
5
6<body>
7<br>
8<font color="#000000">Now, we'll open up LightScript, look through it and make a small customization.</font>
9<p>
10<font color="#000080">1. Right-click on your lamp's bulb, and select Edit from the pie menu.</font>
11<p>
12<font color="#000000">The reason you have to right-click to select the bulb is because it has a script that has taken over the left click to turn the light on and off.</font>
13<p>
14<font color="#000080">2. Look at the Content tab of the Tool Palette.</font>
15<p>
16<font color="#000080">3. Double-click on LightScript.</font>
17<p>
18<font color="#000000">A new window opens, showing the script. It may look complicated if you've never played with scripts before, but it's really not hard at all to understand enough to make a few useful changes.</font>
19<p>
20<font color="#000080">4. Read through the script and see if any of it makes sense to you.</font>
21<p>
22<font color="#000000">Lines of text that begin with // are comments. They aren't actually part of the code -- they're there to explain what's going on. A well-written script will have good, clear comments that explain how the script works.</font>
23<p>
24<font color="#000080">5. Look for the lines that start with <font color="#B00000">llListen</font>. </font>
25<p>
26<font color="#000000">Near the end of one, there's the word &quot;on&quot; and near the end of the other is the word &quot;off&quot;.</font>
27<p>
28<font color="#000000">These lines tell the light bulb to look for the words on and off to turn itself on and off.</font>
29<p>
30<font color="#000000">One simple modification that we can do without understand the script at all is to change the words that turn the lamp on and off.</font>
31<p>
32<font color="#000000">Why bother? For a light, there's not really much of a reason to change the activating words, but you could modify a script for a door in the same way, setting up a password for entry that only you and your friends will know. </font>
33<p>
34<font color="#000080">6. In the lines that begin with llListen, change the word &quot;<font color="#B00000">on</font>&quot; to &quot;<font color="#B00000">light</font>&quot;, and the word &quot;<font color="#B00000">off</font>&quot; to &quot;<font color="#B00000">dark</font>&quot;. (You can use any other code words you want.)</font>
35<p>
36<font color="#000000">There's one more place you have to modify:</font>
37<p>
38<font color="#000080">7. Scroll down the script to the line that says if (text = &quot;on&quot;), and change &quot;on&quot; to &quot;light&quot; (or whatever other code word you chose).</font>
39<p>
40<font color="#000080">8. Click the <font color="#B00000">Save</font> button.</font>
41<p>
42<font color="#000080">9. Close the Script window and the Tool Palette.</font>
43<p>
44<font color="#000080">10.Test your lamp with the new words for on and off.</font>
45<p>
46<font color="#000000">Now that you've created a masterpiece, it's time to link it together and save it to your Inventory.</font>
47<p>
48<font color="#000080">11. Right-click on one part of the lamp and select Edit from the pie menu.</font>
49<p>
50<font color="#000080">12. Hold down the Shift key and click on the other two parts of the lamp,so they're all highlighted.</font>
51<p>
52<font color="#000080">13. Open the Tools menu and select <font color="#B00000">Link</font>.</font>
53<p>
54<font color="#000000">The lamp is now all linked together, so you can move the whole thing around instead of having to move each piece separately.</font>
55<p>
56<font color="#000080">14. With the lamp still highlighted, open the Tools menu and select <font color="#B00000">Take Copy of Object</font>.</font>
57<p>
58<font color="#000000">A copy of the lamp will be placed in the Objects folder of your Inventory.</font>
59<p>
60<font color="#000080">15. Right-click on the new object (named Object) in your Inventory, and select <font color="#B00000">Rename</font>.</font>
61<p>
62<font color="#000080">16. Type in a new name, like &quot;My Floor Lamp&quot;.</font>
63<p>
64<font color="#000080">17. Drag the newly named lamp from the Objects folder into the Furniture folder.</font>
65<p>
66<font color="#000080">18. Now you can delete both the model lamp and the lamp you made. </font>
67<p>
68<font color="#000000">You can pull them out of your Inventory any time you need them.</font>
69<p>
70
71[ <a href="Advanced_Second_Life_Skills.html">Advanced Skills Home</a> | <a href="Creation_101.html">Creation 101 Home</a> | <a href="Installing_a_Script.html">Previous</a> | <a href="Graduation.html">Next</a> ]
72
73</body>
74</html>
diff --git a/linden/indra/newview/help/Advanced/More_Ways_to_Communicate.html b/linden/indra/newview/help/Advanced/More_Ways_to_Communicate.html
deleted file mode 100644
index 15c66c2..0000000
--- a/linden/indra/newview/help/Advanced/More_Ways_to_Communicate.html
+++ /dev/null
@@ -1,55 +0,0 @@
1<html>
2<head>
3 <title>More Ways to Communicate</title>
4</head>
5
6<body>
7<br>
8<font color="#000000">Chat is great. But it could be a little more flexible and a little more expressive. In Second life, it is.</font>
9<p>
10<font color="#000000">You can expand your chat capabilities through shortcuts, gestures, sounds and even words.</font>
11<p>
12<font color="#000080">1. Hold down the ALT key and click on your avatar to Focus on yourself.</font>
13<p>
14<font color="#000080">2. Move the camera around so you can see yourself from the front.</font>
15<p>
16<font color="#000080">3. Hit the F2 key.</font>
17<p>
18<font color="#000000">What happened?</font>
19<p>
20<font color="#000080">4. One at a time, hit the F3 through F12 keys.</font>
21<p>
22<font color="#000080">5. Now, one at a time, hit shift-F2 through shift-F12.</font>
23<p>
24<font color="#000080">6. And now hit ctrl-F2 through ctrl-F12.</font>
25<p>
26<font color="#000000">All of these motions, expressions, sounds and chat are preset -- but they can easily be changed in any way you want.</font>
27<p>
28<font color="#000000">You can delete the ones you don't want, to free up F-keys for ones you do want. You can set up your shortcuts to chat any text you want. You can even upload your own sounds -- even your own voice -- and have your avatar say anything you want. The Gesture Starter menu on the chat bar is another way to activate gestures.</font>
29<p>
30<font color="#000000">Let's look behind the curtain and see how this works and how to change it.</font>
31<p>
32<font color="#000080">7. Press CTRL-G to open the Gestures window</font>
33<p>
34<font color="#000000">As you've seen, you can activate gestures (and sounds and text) either through the F-Keys or by typing things into Chat.</font>
35<p>
36<font color="#000000">The left column is where you enter the Chat Input -- whatever you want to use as the trigger to set off the gesture. You can put your Chat Input shortcut in the middle of a regular chat sentence, or use it by itself.</font>
37<p>
38<font color="#000000">Chat Input is case-sensitive. That means if you set &quot;Hi&quot; as the Chat Input for, &quot;Hello there! I'm pleased to meet you,&quot; this message will not be sent if you type in &quot;hi&quot; or &quot;HI.&quot; </font>
39<p>
40<font color="#000000">Notice that some of the Chat Inputs begin with a forward slash (/). This stops your avatar from performing the Chat typing animation while you're typing in your message. When you're chatting, this animation lets others know that you're busily typing away. But there are times when you might not want to play the animation -- like while dancing. </font>
41<p>
42<font color="#000000">You don't need to have a Chat Input if you have a Shortcut Key, but it doesn't hurt to have both.</font>
43<p>
44<font color="#000000">Speaking of Shortcut Keys, the next two columns are for choosing them. Your choices are all the F-keys -- except F1, which is for Help -- by themselves, and with the shift keys and the control keys.</font>
45<p>
46<font color="#000000">That's a total of 33 possible shortcut key combinations you can use. But with the Chat Input, you have an almost unlimited amount of shortcuts for animations, sounds and Chat Output.</font>
47<p>
48<font color="#000000">You choose the sound you want to play with the Sound pop-up menu. All the sounds in your Inventory are listed here. If you record your own sounds and upload them, they'll automatically appear here. You can upload an unlimited number of sounds, but they need to be less than 10 seconds long.</font>
49<p>
50<font color="#000000">Animations are also chosen with a drop-down menu. Many animations are supplied, and more will find their way into your Inventory over time, so check the list every so often to see if any new ones have appeared.</font>
51<p>
52[ <a href="Advanced_Second_Life_Skills.html">Advanced Skills Home</a> | <a href="People.html">Previous</a> | <a href="Clothing_Makes_the_Avatar.html">Next</a> ]
53
54</body>
55</html>
diff --git a/linden/indra/newview/help/Advanced/Nesting.html b/linden/indra/newview/help/Advanced/Nesting.html
deleted file mode 100644
index a2ab004..0000000
--- a/linden/indra/newview/help/Advanced/Nesting.html
+++ /dev/null
@@ -1,74 +0,0 @@
1<html>
2<head>
3 <title>Nesting</title>
4</head>
5
6<body>
7<br>
8<font color="#000000">It's time to find yourself a home.</font>
9<p>
10<font color="#000000">You've flown all over the world and seen some of the sights. Think about all the places you've been. It makes sense to make your home near your favorite activities. That way, you'll spend less time commuting, and less money if you teleport.</font>
11<p>
12<font color="#000000">You can always change your home later if you decide to move.</font>
13<p>
14<font color="#000080">Look at the map and decide on a general area you'd like to call home. Using the "Land You Can Buy" selection from the Background pull down menu in the World Map window will help you find areas with available land. Premium Access members can own up to 512 square meters of land before incurring additional land fees; Basic Access users will be advised that they need to pay additional fees in order to own land.</font>
15<p>
16<font color="#000000">Once you've found a likely area, find out what land is available.</font>
17<p>
18<font color="#000080">Open the View menu at the top of your screen and activate the view Land Owners function.</font>
19<p>
20<font color="#000000">Land that's owned by others will be marked with a brightly colored overlay. Land that isn't colored is open to you.</font>
21<p>
22<font color="#000080">Wander around and pick a nice little spot that you like.</font>
23<p>
24<font color="#000000">Land costs money to buy, so don't overextend yourself. Just pick out a nice little plot.</font>
25<p>
26<font color="#000080">Click on the land you want to buy.</font>
27<p>
28<font color="#000000">A pie menu will open.</font>
29<p>
30<font color="#000080">Choose Edit Land ...</font>
31<p>
32<font color="#000000">A small parcel of land -- 4 by 4 meters by default -- will be marked off, and a tool panel will open.</font>
33<p>
34<font color="#000000">We'll want a little more land than what's marked, so:</font>
35<p>
36<font color="#000080">Click and drag on the land to mark out a rectangle that's at least 12 by 12 meters.</font>
37<p>
38<font color="#000000">Land is parceled out in 4 by 4 meter chunks, so if you make a rectangle that's 3 by 3 chunks, that'll be 12 by 12 meters. 12 by 12 is the minimum size you'll want to have room to place a small house and have a little room for a yard or garden.</font>
39<p>
40<font color="#000080">Click on the Claim Land ... button in the tool panel to buy the land.</font>
41<p>
42<font color="#000000">A dialog will open, giving details of the sale, including the cost to claim and any changes to your billing required to claim the land.</font>
43<p>
44<font color="#000080">Click on the Claim button.</font>
45<p>
46<font color="#000000">Your account will be deducted for the sale. If claiming the land changes your billing, you'll need to approve the transaction in a confirmation email before the land is added to your account.</font>
47<p>
48<font color="#000000">YOu can locate your land at anytime using the My Land tool located in World menu at the top of your screen.</font>
49<p>
50<font color="#000000">Now let's mark this land as your Home.</font>
51<p>
52<font color="#000080">Hit Esc to close the tool panel, then move your avatar onto your land.</font>
53<p>
54<font color="#000080">Open the World menu and select Set Home to Here.</font>
55<p>
56<font color="#000000">Now your newly purchased land has been set as your home location.</font>
57<p>
58<font color="#000000">Because this is your &quot;official&quot; home (at least for now), whenever you enter Second Life, you have the option to enter here (or enter at the last place you were last time you were in-world).</font>
59<p>
60<font color="#000000">If the land isn't flat, let's flatten it to prepare it for a house. (If it is flat, skip to the next help screen.)</font>
61<p>
62<font color="#000080">Fly your avatar up and position it so you can see your whole parcel of land.</font>
63<p>
64<font color="#000080">Click on the land and select Edit Land ... in the pie menu.</font>
65<p>
66<font color="#000080">In the tool panel, click on Flatten Land.</font>
67<p>
68<font color="#000080">Slowly move the cursor over your land until it's fairly flat.</font>
69<p>
70<font color="#000000">It doesn't have to be perfect, just &quot;flattish,&quot; so you can plop down a house there.</font>
71<p>
72[ <a href="Advanced_Second_Life_Skills.html">Advanced Skills Home</a> | <a href="Getting_Around.html">Previous</a> | <a href="Home_Time.html">Next</a> ]
73</body>
74</html>
diff --git a/linden/indra/newview/help/Advanced/Party_Time.html b/linden/indra/newview/help/Advanced/Party_Time.html
deleted file mode 100644
index b7d5130..0000000
--- a/linden/indra/newview/help/Advanced/Party_Time.html
+++ /dev/null
@@ -1,23 +0,0 @@
1<html>
2<head>
3 <title>Party Time</title>
4</head>
5
6<body>
7<br>
8<font color="#000000">Now it's time to find a party.</font>
9<p>
10<font color="#000080">1. Open the Events window by clicking the Events button at the bottom of your screen.</font>
11<p>
12<font color="#000000">2. Look at the events listed and find one that's happening now or is about to start. If there isn't an event going on right now, find one that you might want to attend later.</font>
13<p>
14<font color="#000080">3. Once you've selected an event, you can select Teleport to get there quickly or you can select Map to have the event location tracked in the World Map window.</font>
15<p>
16<font color="#000080">4. Depending on the type of event, you might need to find a seat and enjoy the show, or you could end up on stage performing! Take your lead from other attendees, and don't be afraid to ask your host if you have any questions.</font>
17<p>
18<font color="#000000">Stay and enjoy the event until you're ready to move on, then click Next below to take a trip to Jessie.</font>
19<p>
20[ <a href="Advanced_Second_Life_Skills.html">Advanced Skills Home</a> | <a href="Clothing_Makes_the_Avatar.html">Previous</a> | <a href="Dangerous_Time.html">Next</a> ]
21
22</body>
23</html>
diff --git a/linden/indra/newview/help/Advanced/People.html b/linden/indra/newview/help/Advanced/People.html
deleted file mode 100644
index 5808753..0000000
--- a/linden/indra/newview/help/Advanced/People.html
+++ /dev/null
@@ -1,40 +0,0 @@
1<html>
2<head>
3 <title>People</title>
4</head>
5
6<body>
7<br>
8<font color="#000000">Spending time with other people is one of the joys of life. And it's just as true in your Second Life.</font>
9<p>
10<font color="#000000">So how do you find people?</font>
11<p>
12<font color="#000000">People who you've met -- and exchanged calling cards with -- are easy to find, if they're in-world.</font>
13<p>
14<font color="#000080">1. Make sure the World Map window is open.</font>
15<p>
16<font color="#000080">2. Click on the Person Tracking pull-down menu (just above the Landmark pull-down) on the right side of the window.</font>
17<p>
18<font color="#000000">A list of people shows up. Names only show up here if they're on your Friends list, and only if that Resident is currently in-world. </font>
19<p>
20<font color="#000080">3. Choose a name on the list, then look at the Map.</font>
21<p>
22<font color="#000000">Your friend will be shown on the map as a red circle. </font>
23<p>
24<font color="#000080">4. Back in the main Second Life window, fly up a ways and turn around until you see a red beacon.</font>
25<p>
26<font color="#000000">This beacon works just like the landmark beacon. You can find it and follow it to your friend. You can also click on the Teleport or Fly button in the World Map window to get to your friend more quickly.</font>
27<p>
28<font color="#000000">Finding people you already know is easy. So, how do you find new friends? Use the Finder.</font>
29<p>
30<font color="#000080">5. Click the Find button at the top of your screen to open the Finder</font>
31<p>
32<font color="#000000">The Finder helps you to locate people in Second Life, and many other things as well.</font>
33<p>
34<font color="#000000">If only our first lives were this easy.</font>
35<p>
36[ <a href="Advanced_Second_Life_Skills.html">Advanced Skills Home</a> | <a href="Shopping_201.html">Previous</a> | <a href="More_Ways_to_Communicate.html">Next</a> ]
37
38
39</body>
40</html>
diff --git a/linden/indra/newview/help/Advanced/Personalize_Your_Home.html b/linden/indra/newview/help/Advanced/Personalize_Your_Home.html
deleted file mode 100644
index 24f2852..0000000
--- a/linden/indra/newview/help/Advanced/Personalize_Your_Home.html
+++ /dev/null
@@ -1,56 +0,0 @@
1<html>
2<head>
3 <title>Personalize Your Home</title>
4</head>
5
6<body>
7<br>
8<font color="#000000">Now let's personalize the cabin a little, by changing the flooring and painting the walls.</font>
9<p>
10<font color="#000080">1. Walk into your cabin and take a look around.</font>
11<p>
12It's nice and quaint. But we could upgrade that floor a little.
13<p>
14<font color="#000080">2. Make sure your Inventory is open, then open the Textures folder.</font>
15<p>
16<font color="#000080">3. Now, open the Building Materials folder, and find Spanish Tile.</font>
17<p>
18<font color="#000080">4. Drag Spanish Tile out of your Inventory and onto the floor of your cabin.</font>
19<p>
20The floor is instantly converted to tile.
21<p>
22Now, let's do something with the walls. We could change the textures of the walls in the same way as we changed the floor, but let's try something else.
23<p>
24Let's keep that rough stucco-like texture, but paint a bit of a tint over it.
25<p>
26<font color="#000080">5. Click on one of the walls of the house, and select Edit from the pie menu.</font>
27<p>
28Because the house is all linked so it can be easily moved around in a single piece, if you perform an editing function, like painting a wall, the whole house will be affected. So what we'll do is first select a single wall then paint it.
29<p>
30<font color="#000080">6. Click on Select Individual in the Tool Palette, then click on the wall you want to paint.</font>
31<p>
32<font color="#000080">7. Click on the More >> button on the tool palette to expand the palette, then click on the Texture tab in the Tool Palette, and then click on the Color box.</font>
33<p>
34The Color dialog opens.
35<p>
36<font color="#000080">8. Choose a nice, bold color -- click on an orange square on the left side of the Color dialog, then click OK.</font>
37<p>
38The wall keeps the stucco-like feel, but is now painted orange.
39<p>
40Before we continue, let's look at what we did. We changed two things: Texture and Color.
41<p>
42<font color="#000000">Changing texture is picking a graphic file to apply to the surface of an object. It's like applying wallpaper, but without the glue, mess or Laurel and Hardy hijinks.</font>
43<p>
44<font color="#000000">Color lets you modify the texture by tinting it almost any color. If you want a solid color, then first apply the White texture, then apply the color.</font>
45<p>
46<font color="#000000">There's no cost for painting or applying textures, so you can modify your home (or other possessions) all you want without charge. (There is, however, a small, one-time fee o fL$10 to upload your own textures into the system.)</font>
47<p>
48<font color="#000000">You can take your time now and continue to redecorate your home as much as you want by painting other walls (and the ceiling) or changing any or all of the textures.
49<p>
50Later, you'll be able to gather up some furniture and customize your house in other ways.</font>
51<p>
52[ <a href="Advanced_Second_Life_Skills.html">Advanced Skills Home</a> | <a href="Home_Time.html">Previous</a> | <a href="The_Second_Life_Economy.html">Next</a> ]
53
54
55</body>
56</html>
diff --git a/linden/indra/newview/help/Advanced/Positioning_with_Numbers.html b/linden/indra/newview/help/Advanced/Positioning_with_Numbers.html
deleted file mode 100644
index 8af704a..0000000
--- a/linden/indra/newview/help/Advanced/Positioning_with_Numbers.html
+++ /dev/null
@@ -1,28 +0,0 @@
1
2<html>
3<head>
4 <title>Creation 101: Positioning with Numbers</title>
5</head>
6
7<body>
8<br>
9<font color="#000000">Let's use Position to perfectly align our three parts. What we'll do is copy the X and Y Position values from the base, and paste them into the X and Y position values of both the pole and the bulb.</font>
10<p>
11<font color="#000080">1. Click on the Edit icon, then on the base, then on the Object tab.</font>
12<p>
13<font color="#000080">2. Highlight and copy the X Position value.</font>
14<p>
15<font color="#000080">3. Click on the pole, then highlight the X Position and paste in the value from the base.</font>
16<p>
17<font color="#000080">4. Click on the bulb, highlight the X Position and paste in the value from the base.</font>
18<p>
19<font color="#000080">5. Repeat the last four steps, but this time copy and paste the Y Position value from the base to both the pole and the bulb.</font>
20<p>
21<font color="#000000">Now the three parts are exactly lined up and centered. Of course, you don't want to copy and paste the Z Position value, because you want the three parts to be different heights.</font>
22<p>
23<font color="#000080">6. Adjust the heights of the three parts as needed.</font>
24<p>
25[ <a href="Advanced_Second_Life_Skills.html">Advanced Skills Home</a> | <a href="Creation_101.html">Creation 101 Home</a> | <a href="Building_the_Lamp_Bulb.html">Previous</a> | <a href="Simple_on_off.html">Next</a> ]
26
27</body>
28</html>
diff --git a/linden/indra/newview/help/Advanced/Shopping_201.html b/linden/indra/newview/help/Advanced/Shopping_201.html
deleted file mode 100644
index b45c396..0000000
--- a/linden/indra/newview/help/Advanced/Shopping_201.html
+++ /dev/null
@@ -1,47 +0,0 @@
1<html>
2<head>
3 <title>Shopping 201</title>
4</head>
5
6<body>
7<br>
8<font color="#000000">Let's get some furniture for your new home.</font>
9<p>
10<font color="#000000">You don't need much for now, just a place for guests to sit, and maybe a lamp or two. </font>
11<p>
12<font color="#000080">1. Use the World Map window to find your way to the shopping mall in Luna.</font>
13<p>
14<font color="#000080">2. Wander around the place and find a few things that you think will go well in your new home.</font>
15<p>
16<font color="#000080">3. Click on one of the things you want to buy, then select Buy.</font>
17<p>
18<font color="#000000">A confirmation dialog will open, giving the details of the transaction and the permissions involved. You'll notice that you are buying a copy, not the original. You'll also find out if you'll be able to modify or copy the thing you buy.</font>
19<p>
20<font color="#000080">4. Click Buy.</font>
21<p>
22<font color="#000000">A copy of the item will be put into your Inventory.</font>
23<p>
24<font color="#000080">5. Return to your home, and go inside.</font>
25<p>
26<font color="#000080">6. Open your inventory. Drag your new purchases out of inventory and into your home.</font>
27<p>
28<font color="#000080">7. Click on one of the items, and select Edit from the pie menu.</font>
29<p>
30<font color="#000080">8. Drag the item around by the arrows to place it where it belongs.</font>
31<p>
32<font color="#000000">Chances are, you'll also need to rotate it.</font>
33<p>
34<font color="#000080">9. In the tool panel, click on Rotate.</font>
35<p>
36<font color="#000000">The arrows turn into rounded axes surrounding the item.</font>
37<p>
38<font color="#000080">10. Drag the rounded axes to rotate the item to the proper position.</font>
39<p>
40<font color="#000080">11. Place the other items you bought where you want them.</font>
41<p>
42<font color="#000000">So, now you have a party pad. How do you find people to invite over?</font>
43<p>
44[ <a href="Advanced_Second_Life_Skills.html">Advanced Skills Home</a> | <a href="The_Second_Life_Economy.html">Previous</a> | <a href="People.html">Next</a> ]
45
46</body>
47</html>
diff --git a/linden/indra/newview/help/Advanced/Simple_on_off.html b/linden/indra/newview/help/Advanced/Simple_on_off.html
deleted file mode 100644
index bfa3e7b..0000000
--- a/linden/indra/newview/help/Advanced/Simple_on_off.html
+++ /dev/null
@@ -1,30 +0,0 @@
1
2<html>
3<head>
4 <title>Creation 101: Simple On/Off</title>
5</head>
6
7<body>
8<br>
9<font color="#000000">So, we have a lamp, but how do we turn it off -- and then on again?</font>
10<p>
11<font color="#000000">The most basic way would be to change the bulb's texture from white to black. The black texture blocks the light's glow.</font>
12<p>
13<font color="#000080">1. Highlight the bulb, then click on the Edit icon, then the Texture tab.</font>
14<p>
15<font color="#000080">2. Find and click on the <font color="#B00000">Color</font> control.</font>
16<p>
17<font color="#000000">The Color dialog opens. You've seen this before.</font>
18<p>
19<font color="#000080">3. Select <font color="#B00000">black</font> in the Color dialog (lower-left corner of the basic colors) and click OK.</font>
20<p>
21<font color="#000000">The bulb is now black -- basically, off. If we wanted to turn it back on, all we have to do is change the color. What a pain.</font>
22<p>
23<font color="#000000">There has to be an easier -- and better -- way.</font>
24<p>
25<font color="#000000">There is: with a script.</font>
26<p>
27[ <a href="Advanced_Second_Life_Skills.html">Advanced Skills Home</a> | <a href="Creation_101.html">Creation 101 Home</a> | <a href="Positioning_with_Numbers.html">Previous</a> | <a href="Installing_a_Script.html">Next</a> ]
28
29</body>
30</html>
diff --git a/linden/indra/newview/help/Advanced/The_Lay_of_the_Land.html b/linden/indra/newview/help/Advanced/The_Lay_of_the_Land.html
deleted file mode 100644
index 3db0d76..0000000
--- a/linden/indra/newview/help/Advanced/The_Lay_of_the_Land.html
+++ /dev/null
@@ -1,44 +0,0 @@
1<html>
2<head>
3 <title>The Lay of the Land</title>
4</head>
5
6<body>
7<br>
8<font color="#000000">Before going anywhere, let's get an overview of the Second Life world, and locate a few important places.</font>
9<p>
10<font color="#000080">1. If the World Map window isn't open, click the Mini Map or click the Map button at the bottom of the screen to open it.</font>
11<p>
12The World Map window isn't static -- it changes with the world, so every change to the land, every new building and every person within your avatar's sight is on the map.
13<p>
14In addition, the map in the Map window can be zoomed in and out.
15<p>
16The Map window can be used to track people and find landmarks, but only the names of regions are labeled.
17<p>
18Let's see what the World Map window can do for us.
19<p>
20<font color="#000080">2. Find the Zoom slider at the bottom right of the World Map window.</font>
21<p>
22<font color="#000080">3. Move and enlarge the Map window so it fills most of the screen.</font>
23<p>
24<font color="#000080">4. Zoom the map so you can see the entire Second Life world. Left-clicking and holding on the map allows you slide the map and center in on places of interest.</font>
25<p>
26<font color="#000080">5. Examine the map and find the following places:</font>
27<p>
28- <font color="#006000">Welcome Area in Ahern</font><font color="#000000"> -- this is where new residents enter Second Life</font>.<br>
29- <font color="#006000">The Sandbox in Cordova</font><font color="#000000"> -- a place where any resident can freely build and experiment. (Sandboxes are cleared twice daily; any object left behind is deleted.)<br>
30- <font color="#006000">Jessie</font><font color="#000000"> -- a damage-enable area for wargaming</font>.<br>
31- <font color="#006000">Busy Ben's Hoverboard Ranch in Oak Grove</font><font color="#000000"> -- A vehicle dealership with easy access to the Vehicle Recreation Area.</font>
32<p>
33<font color="#000000">You can freely build in the Sandbox areas. If you want to build something (like a home) that will stay inworld permanently, you may want to own your own land. Be sure to check out <a href="http://secondlife.com/land/">http://secondlife.com/land/</a> for all the details behind land ownership.</font>
34<p>
35<font color="#000000">As you travel across the world in the next steps, look over the areas you cross as potential homesites. You can use the tabs at the top of the Map to display land that has recently been marked For Sale.</font>
36<p>
37<font color="#000080">6. Zoom the map smaller and shrink the Map window a bit, then close it.</font>
38<p>
39<font color="#000080">7. Click Next to continue.</font>
40<p>
41[ <a href="Advanced_Second_Life_Skills.html">Advanced Skills Home</a> | <a href="Getting_Around.html">Next</a> ]
42
43</body>
44</html>
diff --git a/linden/indra/newview/help/Advanced/The_Second_Life_Economy.html b/linden/indra/newview/help/Advanced/The_Second_Life_Economy.html
deleted file mode 100644
index 2f483a3..0000000
--- a/linden/indra/newview/help/Advanced/The_Second_Life_Economy.html
+++ /dev/null
@@ -1,18 +0,0 @@
1<html>
2<head>
3 <title>The Second Life Economy</title>
4</head>
5
6<body>
7<br>
8<font color="#000080">Earning Money</font>
9<font color="#000000">Second Life is an entrepreneurial world. You can create your own segment of the economy; create new goods and services that other inhabitants will be willing to pay for. Your creativity in simulated business can be as important -- and fun -- as your creativity in other aspects of Second Life.</font>
10<p>
11<font color="#000000">Every Second Life resident receives a basic weekly Linden Dollar grant. This will be enough to explore, have fun and participate in all sorts of events and practice building objects. If you need or want more money than your grant, you'll have to find a way to earn it.</font>
12<p>
13<font color="#000080">Developer Incentives</font>
14<font color="#000000">Second Life's best attractions, creations, and entertaining diversions are created by Second Life's Residents. Developer Incentives acknowledge these hard-working Residents with real-world cash. US Dollars are awarded monthly to the creators, designers, hosts, and bon-vivants who make Second Life more than the sum of its parts. We'll use a variety of measures and mechanisms to seek out those worthy of rewards - not just traffic. Stay tuned for additional details about this exciting development. </font>
15
16
17</body>
18</html>
diff --git a/linden/indra/newview/help/Concepts/3D_Terminology.html b/linden/indra/newview/help/Concepts/3D_Terminology.html
deleted file mode 100644
index b2771eb..0000000
--- a/linden/indra/newview/help/Concepts/3D_Terminology.html
+++ /dev/null
@@ -1,30 +0,0 @@
1<html>
2<head>
3 <title>3D Terminology</title>
4</head>
5
6<body>
7<br>
8There are some terms in 3D technology that you'll run across in Second Life and in this document. <p>
9<font color="#006000">OBJECTS</font><br>
10An object is something created in Second Life. Objects are made out of primitives (see below) and can be just about any shape, material or appearance. Objects can have physics and/or scripts assigned to them for added functionality.<p>
11<font color="#006000">PRIMITIVES</font><br>
12Primitives are basic 3D shapes, like cubes, cones and cylinders. Primitives can be resized, reshaped, hollowed out and otherwise modified, then combined and connected to make more complex shapes and objects. All building starts with primitives.<p>
13<font color="#006000">TEXTURES</font><br>
14Textures are the visual patterns applied to sides, or faces of primitives or objects. Textures in Second Life need to be in the form of a graphic file in either .TGA (Targa) or .BMP (Bitmap) format, set to 24-bit color-depth.<p>
15<font color="#006000">CAMERA</font><br>
16In 3D graphics, scenes are generated from a particular viewpoint or location, known as the camera. Think of yourself as a movie director when building in Second Life, with the ability to move the camera around in the world to get the best shot.<p>
17<font color="#006000">AXIS (PLURAL: AXES)</font><br>
18Everything in a 3-D world-including the &quot;real&quot; world, can be located in space by three numbers, one on each of three axes.<p>
19Remember making graphs in math class? This is just like that, but with depth.<p>
20The x-axis goes from left to right on the computer screen.<br>
21The y-axis goes from bottom to top of the computer screen.<br>
22The z-axis goes from the screen straight back into the monitor, providing the illusion of depth.<p>
23Sounds simple. But there's a little more to it.<p>
24Since Second Life is full 3D, and you can look at anything from any angle, things get turned around. When a primitive is created, it is assigned X, Y and Z axes. These axes stay consistent with the primitive-not with the screen. If you rotate the primitive, its axes rotate along with it. <p>
25Axes come into play for more than just positioning, especially when you get into joints (moveable connections like wheels or hinges).<p>
26
27[ <a href="Second_Life_Concepts.html">Concepts Home</a> | <a href="Building_in_3D.html">Previous</a> | <a href="Building_Tools.html">Next</a> ]
28
29</body>
30</html>
diff --git a/linden/indra/newview/help/Concepts/Building_Tools.html b/linden/indra/newview/help/Concepts/Building_Tools.html
deleted file mode 100644
index 22eed3e..0000000
--- a/linden/indra/newview/help/Concepts/Building_Tools.html
+++ /dev/null
@@ -1,22 +0,0 @@
1<html>
2<head>
3 <title>Building Tools</title>
4</head>
5
6<body>
7<br>
8The basic tools that you will use in Second Life to build things are:<p>
9- <font color="#006000">Focus</font> -- Take control of the camera to view objects from any angle.<br>
10- <font color="#006000">Move</font> -- move a primitive or object around.<br>
11- <font color="#006000">Edit</font> -- Move, resize, or rotate an object.<br>
12- <font color="#006000">Create</font> -- Make a new primitive.<br>
13- <font color="#006000">Land</font> -- Modify the land in Second Life, raising, lowering or flattening as needed to prepare it for building.<br>
14- <font color="#006000">Link</font> -- connect two or more primitives into a single object.<br>
15- <font color="#006000">Make Joints</font> -- connect two primitives with a moveable connection.
16<p>
17There are many variations and additions to these basic tools that we'll get to later on. But if you understand just these few simple tools, you've made a good start.
18<p>
19[ <a href="Second_Life_Concepts.html">Concepts Home</a> | <a href="3D_Terminology.html">Previous</a> | <a href="Scripting.html">Next</a> ]
20
21</body>
22</html>
diff --git a/linden/indra/newview/help/Concepts/Building_in_3D.html b/linden/indra/newview/help/Concepts/Building_in_3D.html
deleted file mode 100644
index 5c2dfe1..0000000
--- a/linden/indra/newview/help/Concepts/Building_in_3D.html
+++ /dev/null
@@ -1,15 +0,0 @@
1<html>
2<head>
3 <title>Building in 3-D</title>
4</head>
5
6<body>
7<br>
8Moving around in 3D can be tricky. Building things in 3D is trickier.<p>
9When you first begin to build and move things around in 3D, it's not uncommon to accidentally bury things in the ground and lose them.<p>
10Yes, it's a bit more complicated than building in 2-D, but the extra flexibility and power is worth the steeper learning curve. Work through the tutorials in the Advanced Skills part of this help system and you'll catch on quickly.
11<p>
12[ <a href="Second_Life_Concepts.html">Concepts Home</a> | <a href="Inventory.html">Previous</a> | <a href="3D_Terminology.html">Next</a> ]
13
14</body>
15</html>
diff --git a/linden/indra/newview/help/Concepts/Different_Views.html b/linden/indra/newview/help/Concepts/Different_Views.html
deleted file mode 100644
index e586450..0000000
--- a/linden/indra/newview/help/Concepts/Different_Views.html
+++ /dev/null
@@ -1,16 +0,0 @@
1<html>
2<head>
3 <title>Different Views</title>
4</head>
5
6<body>
7<br>
8There are different ways to look at the world while exploring Second Life.<p>
9By default, you'll see the world in &quot;Third Person,&quot; looking over your avatar's shoulder as you control it and move it through the world. You can use the scroll wheel on your mouse to zoom closer to or farther away from your avatar. If you zoom all the way in, you'll be in Mouselook.<p>
10Mouselook lets you see through your avatar's eyes, and control where you look with the mouse. It's a good way to take a quick look up, down and around. It's also a great way to do some intricate flying if you move while in Mouselook.<p>
11There are times when you need more control over your view, such as when you want to closely inspect something from different angles, or when you're building something. For this kind of viewing, you can use the Focus tool to take complete control of the &quot;camera,&quot; and move it around and zoom it in and out as much as you want.
12<p>
13[ <a href="Second_Life_Concepts.html">Concepts Home</a> | <a href="Getting_Around.html">Previous</a> | <a href="Inventory.html">Next</a> ]
14
15</body>
16</html>
diff --git a/linden/indra/newview/help/Concepts/Getting_Around.html b/linden/indra/newview/help/Concepts/Getting_Around.html
deleted file mode 100644
index 3ebc2db..0000000
--- a/linden/indra/newview/help/Concepts/Getting_Around.html
+++ /dev/null
@@ -1,15 +0,0 @@
1<html>
2<head>
3 <title>Getting Around in 3D</title>
4</head>
5
6<body>
7<br>
8Second Life is a true 3D world. <p>
9This makes it much more flexible in many ways, but also makes it a little more of a challenge to move around than in a 2D world.<p>
10If you're not already familiar with 3D navigation, just be patient. It gets easy after a little practice.
11<p>
12[ <a href="Second_Life_Concepts.html">Concepts Home</a> | <a href="Ownership_and_Permissions.html">Previous</a> | <a href="Different_Views.html">Next</a> ]
13
14</body>
15</html>
diff --git a/linden/indra/newview/help/Concepts/Hours.html b/linden/indra/newview/help/Concepts/Hours.html
deleted file mode 100644
index df09237..0000000
--- a/linden/indra/newview/help/Concepts/Hours.html
+++ /dev/null
@@ -1,13 +0,0 @@
1<html>
2<head>
3 <title>Hours</title>
4</head>
5
6<body>
7<br>
8Second Life is available 24 hours a day, seven days a week.
9<p>
10[ <a href="Second_Life_Concepts.html">Concepts Home</a> | <a href="Updates.html">Previous</a> | <a href="Things_to_do.html">Next</a> ]
11
12</body>
13</html>
diff --git a/linden/indra/newview/help/Concepts/Inventory.html b/linden/indra/newview/help/Concepts/Inventory.html
deleted file mode 100644
index efcfb72..0000000
--- a/linden/indra/newview/help/Concepts/Inventory.html
+++ /dev/null
@@ -1,17 +0,0 @@
1<html>
2<head>
3 <title>Inventory</title>
4</head>
5
6<body>
7<br>
8As you spend time in Second Life, you'll gather many possessions. These may include objects, textures, sounds, items of clothing, scripts and other things.
9<p>
10You can store, view and access your Inventory at any time.
11<p>
12By collecting and keeping things in your inventory, they'll always be handy when you need them -- and they'll be safe in case the original is deleted by accident. Also, regularly storing versions of things in your Inventory as you build is a good way to &quot;undo&quot; and go back to an earlier version of your project.
13<p>
14[ <a href="Second_Life_Concepts.html">Concepts Home</a> | <a href="Different_Views.html">Previous</a> | <a href="Building_in_3D.html">Next</a> ]
15
16</body>
17</html>
diff --git a/linden/indra/newview/help/Concepts/Many_Ways_to_Get_Help.html b/linden/indra/newview/help/Concepts/Many_Ways_to_Get_Help.html
deleted file mode 100644
index e421fe6..0000000
--- a/linden/indra/newview/help/Concepts/Many_Ways_to_Get_Help.html
+++ /dev/null
@@ -1,20 +0,0 @@
1<html>
2<head>
3 <title>Many Ways to Get Help</title>
4</head>
5
6<body>
7<br>
8There are several ways to learn more about Second Life:<p>
9- This online help system,<br>
10- The online Wiki at <a href="http://secondlife.com/help">http://secondlife.com/help</a>,<br>
11- Downloadable documentation in PDF format,<br>
12- The Second Life Forums<br>
13- In-world classes<p>
14To access the downloadable documentation, go to: http://www.secondlife.com/downloads and choose Guides and Tutorials<p>
15To access the message board, go to http://www.secondlife.com/forums
16<p>
17[ <a href="Second_Life_Concepts.html">Concepts Home</a> | <a href="Scripting.html">Previous</a> | <a href="Reporting_Errors.html">Next</a> ]
18
19</body>
20</html>
diff --git a/linden/indra/newview/help/Concepts/Money.html b/linden/indra/newview/help/Concepts/Money.html
deleted file mode 100644
index 7153fc5..0000000
--- a/linden/indra/newview/help/Concepts/Money.html
+++ /dev/null
@@ -1,19 +0,0 @@
1<html>
2<head>
3 <title>Money</title>
4</head>
5
6<body>
7<br>
8The Second Life economy is based on Linden Dollars. The economy is evolving and will continue to evolve, depending on what Second Life residents want, and what they choose to do.
9<p>
10Everyone is given a basic weekly grant of Linden Dollars to spend any way they want. Residents who receive high ratings from their fellow Resident get a weekly reward. (Be nice and you make more money.)
11<p>
12If you want or need more than your grant, you'll need to find a way to earn more. You might start a business or, if you're skilled at architecture, clothing design, scripting or art creation, you can charge others for your time and skills. You can build an attraction and charge admission. You can give tours. You can invent other ways to earn money. Use your strengths and carve out a niche for yourself.
13<p>
14
15[ <a href="Second_Life_Concepts.html">Concepts Home</a> | <a href="Tips_For_Newbies.html">Previous</a> | <a href="Ownership_and_Permissions.html">Next</a> ]
16
17
18</body>
19</html>
diff --git a/linden/indra/newview/help/Concepts/Other_People.html b/linden/indra/newview/help/Concepts/Other_People.html
deleted file mode 100644
index f31309a..0000000
--- a/linden/indra/newview/help/Concepts/Other_People.html
+++ /dev/null
@@ -1,18 +0,0 @@
1<html>
2<head>
3 <title>Other People: Meeting and Communicating</title>
4</head>
5
6<body>
7<br>
8A big part of the Second Life culture is communicating and sharing with others.
9<p>
10There's an open chat system for communicating with others nearby, and a built-in instant messaging system for private and group conversations.
11<p>
12You can also use sounds, animations and gestures to add to your communications.<p>
13There's also a powerful search tool that lets you find other people or groups with similar interests.
14<p>
15[ <a href="Second_Life_Concepts.html">Concepts Home</a> | <a href="Your_Avatar.html">Previous</a> | <a href="Tips_For_Newbies.html">Next</a> ]
16
17</body>
18</html>
diff --git a/linden/indra/newview/help/Concepts/Ownership_and_Permissions.html b/linden/indra/newview/help/Concepts/Ownership_and_Permissions.html
deleted file mode 100644
index 7e32f14..0000000
--- a/linden/indra/newview/help/Concepts/Ownership_and_Permissions.html
+++ /dev/null
@@ -1,17 +0,0 @@
1<html>
2<head>
3 <title>Ownership and Permissions</title>
4</head>
5
6<body>
7<br>
8Objects can be public or owned by a particular person. When you build something, by default it is your personal property. You have the option to Deed it to a group you belong to if you want.
9<p>
10Ownership of personal property comes with rights, responsibilities, and costs. As the owner, you can set permissions to allow others to move, copy or delete your property -- if you wish. Otherwise nobody but you can mess with your stuff.
11<p>
12You can also set permissions for things you sell or give away. You can determine whether the next owner can copy, modify, or give away your object. Be careful when giving away original copies of your creations... once the object trades hands and the permissions are taken away, they're permanent! You can't reset a no-modify object so you can modify it, even if you give it back to the creator.
13<p>
14[ <a href="Second_Life_Concepts.html">Concepts Home</a> | <a href="Money.html">Previous</a> | <a href="Getting_Around.html">Next</a> ]
15
16</body>
17</html>
diff --git a/linden/indra/newview/help/Concepts/Reporting_Errors.html b/linden/indra/newview/help/Concepts/Reporting_Errors.html
deleted file mode 100644
index 58f9021..0000000
--- a/linden/indra/newview/help/Concepts/Reporting_Errors.html
+++ /dev/null
@@ -1,27 +0,0 @@
1<html>
2<head>
3 <title>Reporting Errors, Problems, and Asking Questions</title>
4</head>
5
6<body>
7<br>
8The software behind Second Life is, as you might imagine, extremely complicated and much of technology is very new and is constantly being improved, updated, and expanded. As a result, it may not work perfectly all the time.
9<p>
10If you have any problems with Second Life, please let us know. Tell us about bugs, problems and anything else that makes Second Life less than wonderful.
11<p>
12If you're having little problems that aren't preventing you from playing Second Life (little things aren't working right), tell us about them using the Bug Reporter tool located under the Help menu at the top of your screen. Bug Reports are always read, and we'll use your report to help make Second Life better. However, you may not receive a response to a Bug Report, so it's not a good choice for a problem you need help with.
13<p>
14If you're having a big problem with Second Life that you need help with, you can contact Support at <a href="mailto:support@secondlife.com">support@secondlife.com</a> or through the phone number listed on our Contact page at secondlife.com.
15<p>
16If you need help with something inworld, you can contact Live Help, a group of volunteer residents who can answer many questions about things in Second Life. Simply open the Help menu and select Live Help, then type your question into the group IM session that opens up. (Be sure to leave the group IM open so you can receive a response!)
17<p>
18Problems can also be discussed in the Second Life Forums. Feature suggestions are welcome, and there's a special discussion board in the Forums for suggesting and discussing new features.
19<p>
20That's it for the Second Life Concepts.
21<p>
22If you're still thirsty for knowledge, you can jump ahead to the <a href="../Advanced/Advanced_Second_Life_Skills.html">Advanced Second Life Skills</a>.
23<p>
24[ <a href="Second_Life_Concepts.html">Concepts Home</a> | <a href="Many_Ways_to_Get_Help.html">Previous</a> ]
25
26</body>
27</html>
diff --git a/linden/indra/newview/help/Concepts/Scripting.html b/linden/indra/newview/help/Concepts/Scripting.html
deleted file mode 100644
index dc41317..0000000
--- a/linden/indra/newview/help/Concepts/Scripting.html
+++ /dev/null
@@ -1,15 +0,0 @@
1<html>
2<head>
3 <title>Scripting</title>
4</head>
5
6<body>
7<br>
8A very powerful feature of Second Life is the ability to add a script, or small program, to an object. Scripts can turn simple objects into interactive experiences that impart information, play sounds, move or ... just about anything.
9<p>
10The scripting language has been designed so even non-programmers can make simple modifications and customizations. (For instance, a door may have a script so it opens with a password. It will be easy to modify the door script to the password of your choice.)
11<p>
12[ <a href="Second_Life_Concepts.html">Concepts Home</a> | <a href="Building_Tools.html">Previous</a> | <a href="Many_Ways_to_Get_Help.html">Next</a> ]
13
14</body>
15</html>
diff --git a/linden/indra/newview/help/Concepts/Second_Life_Concepts.html b/linden/indra/newview/help/Concepts/Second_Life_Concepts.html
deleted file mode 100644
index fee49e0..0000000
--- a/linden/indra/newview/help/Concepts/Second_Life_Concepts.html
+++ /dev/null
@@ -1,33 +0,0 @@
1<html>
2<head>
3 <title>Second Life Concepts</title>
4</head>
5
6<body>
7<br>
8Here are a few basic concepts that will help you understand and get the most out of Second Life.
9<p>
10<a href="World.html">The World, the Play, the Reason for Being</a>
11<br><a href="Strengths.html">Use Your Strengths</a>
12<br><a href="Updates.html">Updates</a>
13<br><a href="Hours.html">Hours</a>
14<br><a href="Things_to_do.html">Things to do in Second Life</a>
15<br><a href="Your_Avatar.html">Your Avatar</a>
16<br><a href="Other_People.html">Other People: Meeting and Communicating</a>
17<br><a href="Tips_For_Newbies.html">Tips For Newbies</a>
18<br><a href="Money.html">Money</a>
19<br><a href="Ownership_and_Permissions.html">Ownership and Permissions</a>
20<br><a href="Getting_Around.html">Getting Around in 3-D</a>
21<br><a href="Different_Views.html">Different Views</a>
22<br><a href="Inventory.html">Inventory</a>
23<br><a href="Building_in_3D.html">Building in 3-D</a>
24<br><a href="3D_Terminology.html">3D Terminology</a>
25<br><a href="Building_Tools.html">Building Tools</a>
26<br><a href="Scripting.html">Scripting</a>
27<br><a href="Many_Ways_to_Get_Help.html">Many Ways to Get Help</a>
28<br><a href="Reporting_Errors.html">Reporting Errors, Problems and Asking Questions</a>
29<p>
30[ <a href="World.html">Next</a> ]
31
32</body>
33</html>
diff --git a/linden/indra/newview/help/Concepts/Strengths.html b/linden/indra/newview/help/Concepts/Strengths.html
deleted file mode 100644
index 738252b..0000000
--- a/linden/indra/newview/help/Concepts/Strengths.html
+++ /dev/null
@@ -1,17 +0,0 @@
1<html>
2<head>
3 <title>Use Your Strengths</title>
4</head>
5
6<body>
7<br>
8Everyone is different. Everyone has their own strengths, skills and creative prowess. Some people excel in architecture. Others in scripting. Others in creating textures. Others in avatar fashion design, sound design, social design (organizing events and throwin' parties) or new areas that we haven't thought of yet.
9<p>
10
11You are a part of the creation of a new world. We value your strengths and personality, and expect them to help us grow and develop Second Life. Stretch a little, challenge yourself and learn new things from the others. But use your own strengths.
12<p>
13[ <a href="Second_Life_Concepts.html">Concepts Home</a> | <a href="World.html">Previous</a> | <a href="Updates.html">Next</a> ]
14
15
16</body>
17</html>
diff --git a/linden/indra/newview/help/Concepts/Things_to_do.html b/linden/indra/newview/help/Concepts/Things_to_do.html
deleted file mode 100644
index 06cc043..0000000
--- a/linden/indra/newview/help/Concepts/Things_to_do.html
+++ /dev/null
@@ -1,26 +0,0 @@
1<html>
2<head>
3 <title>Things to do in Second Life</title>
4</head>
5
6<body>
7<br>
8Right now, when the world is fresh and new the main things to do in Second Life are:
9<p>
10- Explore
11<br>- Meet others with similar (or new) interests, network, make friends
12<br>- Participate in social events
13<br>- Participate in deadly battles in the Jessie or Rausch combat regions
14<br>- Participate in various games and contests
15<br>- Create things and places others will want to explore
16<br>- Experiment with scripting
17<br>- Create textures and sounds out-of-world, and upload them
18<br>- Collaborate with others to build something big
19<br>- Start businesses that charge for products or services
20<br>- Much more that we haven't even thought of yet -- but you will.
21<p>
22[ <a href="Second_Life_Concepts.html">Concepts Home</a> | <a href="Hours.html">Previous</a> | <a href="Your_Avatar.html">Next</a> ]
23
24
25</body>
26</html>
diff --git a/linden/indra/newview/help/Concepts/Tips_For_Newbies.html b/linden/indra/newview/help/Concepts/Tips_For_Newbies.html
deleted file mode 100644
index 3165dc1..0000000
--- a/linden/indra/newview/help/Concepts/Tips_For_Newbies.html
+++ /dev/null
@@ -1,30 +0,0 @@
1<html>
2<head>
3 <title>Tips For Newbies</title>
4</head>
5
6<body>
7<br>
8As with any society, Second Life has it's own set of cultural norms that you should be aware of so you can progress quickly while avoiding making any faux pas and causing yourself or others problems:
9<p>
10<font color="#B00000">1. It's OK to learn by emulation: look at other people's work, copy free textures, analyze others' scripts, etc.</font>
11<p>
12<font color="#B00000">2. Don't litter! Delete your unused objects.</font>
13<p>
14<font color="#B00000">3. Use physics, light, and scripted objects sparingly, they put a heavy toll on processing power and can slow the game for others.</font>
15<p>
16<font color="#B00000">4. Avoid uploading copyrighted textures, graphics, characters or text. (No movie posters, pictures of Elvis, etc.) Second Life Residents favor original content.</font>
17<p>
18<font color="#B00000">5. Don't build malicious objects. Guns and shooting aren't permitted in most areas. (Head to the regions Jessie or Rausch if you're looking for that sort of action.) Objects that follow other people around are cute-but annoying after a while.</font>
19<p>
20<font color="#B00000">6. Use sound sparingly. Don't be the neighbor with the annoying barking dog.</font>
21<p>
22<font color="#B00000">7. Know the difference between public chat and Instant Messaging. Keep private conversations private; don't copy chat and paste it somewhere else. Most of all, don't ever reveal private information (like passwords) to anyone.</font>
23<p>
24<font color="#B00000">8. Use your Inventory to store things you may want later. It doesn't cost anything to store things there, and it's almost unlimited in size.</font>
25<p>
26[ <a href="Second_Life_Concepts.html">Concepts Home</a> | <a href="Other_People.html">Previous</a> | <a href="Money.html">Next</a> ]
27
28
29</body>
30</html>
diff --git a/linden/indra/newview/help/Concepts/Updates.html b/linden/indra/newview/help/Concepts/Updates.html
deleted file mode 100644
index f6bfab8..0000000
--- a/linden/indra/newview/help/Concepts/Updates.html
+++ /dev/null
@@ -1,17 +0,0 @@
1<html>
2<head>
3 <title>Updates</title>
4</head>
5
6<body>
7<br>
8There will occasionally be updates to the viewer program. When there's an update, you'll be notified when you try to log on, and instructed to go to the Second Life Website, sign in and download the latest version of the player.
9<p>
10Your possessions, Inventory, ratings and avatar designs will automatically be updated into the new viewer.
11<p>
12If you have any problems downloading an update, you can always download the latest version of Second Life at <a href="http://secondlife.com/download">http://secondlife.com/download</a>.
13<p>
14[ <a href="Second_Life_Concepts.html">Concepts Home</a> | <a href="Strengths.html">Previous</a> | <a href="Hours.html">Next</a> ]
15
16</body>
17</html>
diff --git a/linden/indra/newview/help/Concepts/World.html b/linden/indra/newview/help/Concepts/World.html
deleted file mode 100644
index f8d105c..0000000
--- a/linden/indra/newview/help/Concepts/World.html
+++ /dev/null
@@ -1,20 +0,0 @@
1<html>
2<head>
3 <title>The World, the Play, the Reason for Being</title>
4</head>
5
6<body>
7<br>
8Second Life is an open-ended world where you can do nearly anything that you can imagine. If you’re thinking about what to do next, here are some suggestions:
9<p>
10<li>Use the “Find people” feature to check who else is online
11<li>Find a game, or somewhere to go shopping.
12<li>Customize your avatar to look like a famous person and see if other Residents can guess who you are
13<li>Visit the Second Life forums at www.secondlife.com and see what people are talking about
14<li>Build a replica of your favorite childhood toy
15<li>Click the Events button at the top of your screen to see what’s going on inworld
16<p>
17[ <a href="Second_Life_Concepts.html">Concepts Home</a> | <a href="Strengths.html">Next</a> ]
18
19</body>
20</html>
diff --git a/linden/indra/newview/help/Concepts/Your_Avatar.html b/linden/indra/newview/help/Concepts/Your_Avatar.html
deleted file mode 100644
index fb35eaa..0000000
--- a/linden/indra/newview/help/Concepts/Your_Avatar.html
+++ /dev/null
@@ -1,20 +0,0 @@
1<html>
2<head>
3 <title>Your Avatar</title>
4</head>
5
6<body>
7<br>
8Your avatar is your representative in Second Life.
9<p>
10Your avatar may be male or female, and you can customize it in almost limitless ways.
11When you see other avatars, their names will appear above their heads. When others see you, they'll see your name above your head.
12<p>
13You can attach things to your avatar, to make it even more original (and functional). The objects that you attach may be scripted, so they can function in different ways, for instance, jet packs for faster travel, guns for games, etc.
14<p>
15Your avatar has a health rating (it will appear, when needed, in the lower left corner of your screen) only while in the Damage Enabled areas where the dangerous games are played. If your health rating reaches 0%, then your avatar is (temporarily) dead, and will be teleported to your home location and healed.
16<p>
17[ <a href="Second_Life_Concepts.html">Concepts Home</a> | <a href="Things_to_do.html">Previous</a> | <a href="Other_People.html">Next</a> ]
18
19</body>
20</html>
diff --git a/linden/indra/newview/help/LL_logo.jpg b/linden/indra/newview/help/LL_logo.jpg
deleted file mode 100644
index 272bd3d..0000000
--- a/linden/indra/newview/help/LL_logo.jpg
+++ /dev/null
Binary files differ
diff --git a/linden/indra/newview/help/MAIN.css b/linden/indra/newview/help/MAIN.css
deleted file mode 100644
index a981505..0000000
--- a/linden/indra/newview/help/MAIN.css
+++ /dev/null
@@ -1,553 +0,0 @@
1/* GLOBAL STYLES: text, links, form elements, etc */
2
3body {
4 margin : 0px;
5 font-family:verdana, helvetica, sans-serif;
6 font-size:11px;
7 background-color: #ffffff;
8 color:#546368;
9 }
10
11.body_community {
12 margin : 0px;
13 font-family:verdana, helvetica, sans-serif;
14 font-size:11px;
15 background-color: #d5e3ec;
16 color:#546368;
17 }
18
19option.sl, input.sl, radio.sl, .S1
20{
21 font-family:verdana, courier, courier new, sans-serif;
22 font-size: 8pt;
23 color: white;
24 background-color: #4378a4;
25 border-color:#bcbbbb;
26 border-top-width: 1px;
27 border-right-width: 1px;
28 border-bottom-width: 1px;
29 border-left-width: 1px;
30}
31
32
33submit.resident
34{
35 font-family:verdana, courier, courier new, sans-serif;
36 font-size: 8pt;
37 border-top-width: 1px;
38 border-right-width: 1px;
39 border-bottom-width: 1px;
40 border-left-width: 1px;
41}
42
43select.resident
44{
45 font-family:verdana, courier, courier new, sans-serif;
46 font-size: 8pt;
47 color: white;
48 background-color: #4378a4;
49 border-color:#bcbbbb;
50 border-top-width: 1px;
51 border-right-width: 1px;
52 border-bottom-width: 1px;
53 border-left-width: 1px;
54}
55
56textarea.resident
57{
58 font-family:verdana, courier, courier new, sans-serif;
59 font-size: 10px;
60 color:white;
61 background-color: #4378a4;
62 border-color:#bcbbbb;
63 border-top-width: 1px;
64 border-right-width: 1px;
65 border-bottom-width: 1px;
66 border-left-width: 1px;
67}
68
69a {color:#4378a4; text-decoration:underline;}
70a:active {color:#50607C; text-decoration:underline;}
71a:hover {color:#ff7900;text-decoration:underline;}
72
73a.promolink {color:#4378a4; text-decoration:none;}
74a.promolink:active {color:#50607C; text-decoration:none;}
75a.promolink:hover {color:#ff7900;text-decoration:none;}
76
77a img {border: 0px #FFFFFF none;}
78a:active img {border: 0px #FFFFFF none;}
79a:hover img {border: 0px #FFFFFF none;}
80
81a.fansite {font-weight:bold;}
82
83.headline {color:#346080; font-size:12px; font-weight:bold;}
84
85.header {color:#346080; font-size:12px; font-weight:bold;}
86
87.subheader {color:#346080; font-size:11px; font-weight:bold;}
88
89.fineprint {color:#346080; font-size:10px;}
90
91.topheader {color:#346080; font-size:13pt; font-weight:bold; font-family:verdana, helvetica, sans-serif;}
92
93.super {font-size: 9px; vertical-align:super;}
94
95.copyright {text-align: right; margin:0px 6px 0px 0px; color:#666666; font-family:verdana, helvetica, sans-serif; font-size:x-small;
96}
97
98
99
100/* DEFAULT TEMPLATE PAGE POSITIONING */
101
102#DEFAULT_container {
103 width:890px;
104 margin:0px 5px 5px 5px;
105 text-align:left;
106 background-color: #ffffff;
107 }
108
109#DEFAULT_container_community {
110 width:900px;
111 margin:0px 5px 5px 5px;
112 text-align:center;
113 background-color: #ffffff;
114
115 }
116
117#DEFAULT_header {
118 width: 890px;
119 height: 85px;
120 background-image: url('header_banner.jpg');
121 background-position: center 50%;
122 background-repeat: no-repeat; margin-left:0px; margin-right:0px; margin-top:0px; margin-bottom:3px
123 }
124
125#DEFAULT_header_nav {
126 left: 0px;
127 top: 87px;
128 width: 890px;
129 height: 23px;
130 z-index: 9001;
131 margin: 0px;
132 }
133
134#DEFAULT_container_mid {
135 position:relative;
136 left:0px;
137 width: 890px;
138 margin: 0px;
139 }
140
141#DEFAULT_left {
142 width: 190px;
143 float:left;
144 margin: 0px;
145 }
146
147#DEFAULT_menu_outside {
148 background-color:#376283;
149 }
150
151#DEFAULT_menu_inside {
152 padding: 1px 6px 10px 6px;
153 }
154
155#DEFAULT_mid_outside {
156 vertical-align: top;
157 float:left;
158 margin: 0px 10px 10px 10px;
159 padding: 0px;
160 }
161
162#DEFAULT_mid_inside {
163 width: 440px;
164 margin: 0px;
165 padding: 0px 0px 1px 0px;
166 }
167
168#DEFAULT_2column {
169 vertical-align: top;
170 float:left;
171 margin: 0px 0px 10px 10px;
172 padding: 0px;
173 overflow:auto;
174 }
175
176#DEFAULT_2column_inside {
177 width: 690px;
178 margin: 0px;
179 padding: 0px 0px 10px 0px;
180 overflow-x:auto;
181 }
182
183#DEFAULT_content_header {
184 padding:10px ;
185 margin: 0px;
186 background-image: url('/_img/backgrounds/bg_skyheader.jpg');
187 background-repeat: no-repeat}
188
189#DEFAULT_content_header_2column {
190 padding:10px ;
191 margin: 0px;
192 background-image: url('/_img/backgrounds/bg_skyheader_2col.jpg');
193 background-repeat: no-repeat
194}
195
196#DEFAULT_content_divider {
197 margin: 0px;
198 background-image: url('/_img/backgrounds/bg_dots_grey.gif');
199 background-repeat: repeat-x
200}
201
202#DEFAULT_right {
203 width: 225px;
204 float:right;
205 margin: 0px;
206 }
207
208#DEFAULT_module {
209 width: 215px;
210 padding: 1px 5px 1px 5px;
211 margin: 0px 0px 0px 0px;
212 }
213
214#DEFAULT_footer {
215 width: 890px;
216 height: 40px;
217 margin: 10px 0px 0px 0px;
218 float: left;
219 }
220
221/* EMBEDDED ALTERATIONS FROM DEFAULT */
222
223#embedded_container_outer {
224 width:640px;
225 margin:0px 5px 5px 5px;
226 text-align:center;
227 background-color: #ffffff;
228
229 }
230
231#embedded_mid_inside {
232 width: 540px;
233 margin: 0px;
234 padding: 0px 0px 1px 0px;
235 }
236
237#embedded_content_header {
238 padding:10px ;
239 margin: 0px;
240 background-image: url('/_img/backgrounds/bg_skyheader.jpg');
241 background-position: right 50%;
242 background-repeat: no-repeat}
243
244
245/* COMMUNITY MAIN PAGE */
246
247#comm_index_container {
248 width: 690px;
249 vertical-align: top;
250 float:left;
251 margin: 0px 0px 0px 10px;
252 padding: 0px;
253 }
254
255#comm_index_top_outside {
256 width: 690px;
257 height: 182px;
258 margin: 0px;
259 padding: 0px;
260 background-image: url('/_img/backgrounds/bg_community.jpg');
261 background-repeat: no-repeat
262 }
263
264#comm_index_top_inside {
265 width: 680px;
266 height: 182px;
267 margin: 0px 0px 0px 0px;
268 padding: 0px;
269 }
270
271#comm_mid_outside {
272 vertical-align: top;
273 float:left;
274 margin: 0px 10px 0px 0px;
275 padding: 10px 0px 0px 0px;
276 }
277
278#comm_mid_inside {
279 width: 430px;
280 margin: 0px 10px 10px 10px;
281 padding: 10px 0px 10px 0px;
282 }
283
284#comm_right {
285 width: 225px;
286 float:right;
287 margin: 0px 0px 0px 0px;
288 }
289
290#comm_promo {
291 width: 225px;
292 height: 85px;
293 margin: 10px 0px 5px 0px;
294 }
295
296#comm_quicklinks_outside {
297 width: 225px;
298 background-color:#376283;
299 }
300
301#comm_quicklinks_inside {
302 margin: 0px 10px 0px 10px;
303 padding: 10px 0px 10px 0px;
304 font-family: Verdana, Arial, Helvetica, sans-serif;
305 font-size: 10px;
306 color: #FFFFFF;
307 }
308
309#comm_quicklinks_inside a {
310 font-size: 11px;
311 font-weight: bold;
312 text-decoration: underline;
313 color: #FFFFFF;
314 }
315#comm_quicklinks_inside a:hover {
316 text-decoration: none;
317 }
318#comm_quicklinks_inside .pad { padding: 5px 0px 5px 0px;}
319
320
321#comm_latest {
322 background-image: url('/_img/backgrounds/bg_topfade.gif');
323 background-position: left top;
324 background-repeat: repeat-x;
325 border-top: 1px solid #CCCCCC;
326 border-bottom: 1px solid #CCCCCC;
327 border-left: 1px solid #CCCCCC;
328 width: 420px;
329 height: 461px;
330 overflow:auto;
331 padding-left:8px; padding-right:3px; padding-top:0px; padding-bottom:3px
332}
333
334
335TBODY.RandomContainer TR.RandomItem {
336 display: none;
337 }
338
339
340
341
342/* LEFT MENU STYLES */
343
344.menu_topsection {
345 font-family: Verdana, Arial, Helvetica, sans-serif;
346 font-size: 11px;
347 font-weight: bold;
348 color: #FFFFFF;
349 background-color:#376283;
350 padding: 3px 5px 3px 5px;
351
352 }
353
354.menu_subsection {
355 font-family: Verdana, Arial, Helvetica, sans-serif;
356 font-size: 11px;
357 background-image: url('/_img/backgrounds/bg_submenu.jpg');
358 padding-left:5px; padding-right:3px; padding-top:3px; padding-bottom:3px
359 }
360
361.menu_toplink {
362 font-family: Verdana, Arial, Helvetica, sans-serif;
363 font-size: 11px;
364 font-weight: bold;
365 color: #FFFFFF;
366 text-decoration: none;
367 }
368
369.menu_sublink {
370 font-family: Verdana, Arial, Helvetica, sans-serif;
371 font-size: 11px;
372 color:#eeeeee;
373 text-decoration: none;
374 }
375
376.menu_toplink:hover {
377 font-family: Verdana, Arial, Helvetica, sans-serif;
378 font-size: 11px;
379 font-weight: bold;
380 color: #e8eff5;
381 text-decoration: underline;
382 }
383
384.menu_sublink:hover {
385 font-family: Verdana, Arial, Helvetica, sans-serif;
386 font-size: 11px;
387 text-decoration: underline;
388 }
389
390.menu_toplink_active {
391 font-family: Verdana, Arial, Helvetica, sans-serif;
392 font-size: 11px;
393 font-weight: bold;
394 color: #ff9933;
395 }
396
397.menu_sublink_active {
398 font-family: Verdana, Arial, Helvetica, sans-serif;
399 font-size: 11px;
400 color: #ff9933;
401 }
402
403
404.menu_border {
405 background-image: url('/_img/backgrounds/bg_dots_white.gif');
406 color: #FFFFFF;
407 margin: 0px
408 }
409
410.menu_border_sublink {
411background-image: url('/_img/backgrounds/bg_submenu_dots_blue.jpg');
412margin: 0px
413}
414
415/* ERROR HANDLING: */
416
417#display_errors {color:#000000; border-style: solid; border-color:#aaaaaa; border-width:1px; padding:5px; background-color:#FEF7D7; margin-right:5px;}
418
419/* END ERROR HANDLING: */
420
421
422/* BOXES: */
423div.box_grey_t {background-image: url('grey_pixel.gif'); background-position: left top; background-repeat: repeat-x}
424div.box_grey_r {background-image: url('grey_pixel.gif'); background-position: right top; background-repeat: repeat-y}
425div.box_grey_b {background-image: url('grey_pixel.gif'); background-position: left bottom; background-repeat: repeat-x}
426div.box_grey_l {background-image: url('grey_pixel.gif'); background-position: left top; background-repeat: repeat-y}
427div.box_grey_tl {background-image: url('grey_corner_tl.gif'); background-position: left top; background-repeat: no-repeat}
428div.box_grey_tr {background-image: url('grey_corner_tr.gif'); background-position: right top; background-repeat: no-repeat}
429div.box_grey_bl {background-image: url('grey_corner_bl.gif'); background-position: left bottom; background-repeat: no-repeat}
430div.box_grey_br {background-image: url('grey_corner_br.gif'); background-position: right bottom; background-repeat: no-repeat}
431
432div.box_light_t {background-image: url('/_img/boxes/white_bdr_top.gif'); background-position: left top; background-repeat: repeat-x}
433div.box_light_r {background-image: url('/_img/boxes/white_bdr_right.gif'); background-position: right top; background-repeat: repeat-y}
434div.box_light_b {background-image: url('/_img/boxes/white_bdr_bot.gif'); background-position: left bottom; background-repeat: repeat-x}
435div.box_light_l {background-image: url('/_img/boxes/white_bdr_left.gif'); background-position: left top; background-repeat: repeat-y}
436div.box_light_tl {background-image: url('/_img/boxes/white_corner_tl.gif'); background-position: left top; background-repeat: no-repeat}
437div.box_light_tr {background-image: url('/_img/boxes/white_corner_tr.gif'); background-position: right top; background-repeat: no-repeat}
438div.box_light_bl {background-image: url('/_img/boxes/white_corner_bl.gif'); background-position: left bottom; background-repeat: no-repeat}
439div.box_light_br {background-image: url('/_img/boxes/white_corner_br.gif'); background-position: right bottom; background-repeat: no-repeat}
440
441div.box_lblue_t {background-image: url('/_img/boxes/grey_pixel.gif'); background-position: left top; background-repeat: repeat-x}
442div.box_lblue_r {background-image: url('/_img/boxes/grey_pixel.gif'); background-position: right top; background-repeat: repeat-y}
443div.box_lblue_b {background-image: url('/_img/boxes/grey_pixel.gif'); background-position: left bottom; background-repeat: repeat-x}
444div.box_lblue_l {background-image: url('/_img/boxes/grey_pixel.gif'); background-position: left top; background-repeat: repeat-y}
445div.box_lblue_tl {background-image: url('/_img/boxes/lblue_corner_tl.gif');background-position: left top; background-repeat: no-repeat}
446div.box_lblue_tr {background-image: url('/_img/boxes/lblue_corner_tr.gif');background-position: right top; background-repeat: no-repeat}
447div.box_lblue_bl {background-image: url('/_img/boxes/lblue_corner_bl.gif');background-position: left bottom; background-repeat: no-repeat}
448div.box_lblue_br {background-image: url('/_img/boxes/lblue_corner_br.gif');background-position: right bottom; background-repeat: no-repeat}
449
450div.box_mblue_t {background-image: url('/_img/boxes/grey_pixel.gif'); background-position: left top; background-repeat: repeat-x}
451div.box_mblue_r {background-image: url('/_img/boxes/grey_pixel.gif'); background-position: right top; background-repeat: repeat-y}
452div.box_mblue_b {background-image: url('/_img/boxes/grey_pixel.gif'); background-position: left bottom; background-repeat: repeat-x}
453div.box_mblue_l {background-image: url('/_img/boxes/grey_pixel.gif'); background-position: left top; background-repeat: repeat-y}
454div.box_mblue_tl {background-image: url('/_img/boxes/mblue_corner_tl.gif');background-position: left top; background-repeat: no-repeat}
455div.box_mblue_tr {background-image: url('/_img/boxes/mblue_corner_tr.gif');background-position: right top; background-repeat: no-repeat}
456div.box_mblue_bl {background-image: url('/_img/boxes/mblue_corner_bl.gif');background-position: left bottom; background-repeat: no-repeat}
457div.box_mblue_br {background-image: url('/_img/boxes/mblue_corner_br.gif');background-position: right bottom; background-repeat: no-repeat}
458
459div.box_dblue_noborder_tl {background-image: url('/_img/boxes/dblue_corner_tl.gif');background-position: left top; background-repeat: no-repeat}
460div.box_dblue_noborder_tr {background-image: url('/_img/boxes/dblue_corner_tr.gif');background-position: right top; background-repeat: no-repeat}
461div.box_dblue_noborder_bl {background-image: url('/_img/boxes/dblue_corner_bl.gif');background-position: left bottom; background-repeat: no-repeat}
462div.box_dblue_noborder_br {background-image: url('/_img/boxes/dblue_corner_br.gif');background-position: right bottom; background-repeat: no-repeat}
463
464div.comm_corner_bl {background-image: url('/_img/boxes/comm_corner_bl.gif'); background-position: left bottom; background-repeat: no-repeat}
465div.comm_corner_br {background-image: url('/_img/boxes/comm_corner_br.gif'); background-position: right bottom; background-repeat: no-repeat}
466
467
468
469#MEDIA_NEWS {background-color:#e9f1f8; background-position: top left;}
470#SL_news {
471 background-image: url('/_img/backgrounds/bg_topfade.gif');
472 background-repeat: repeat-x;
473 text-align:left;
474 font-family:verdana, helvetica, sans-serif;
475 font-size:x-small;
476 border-left: 1px solid #CCCCCC;
477 border-top: 1px solid #CCCCCC;
478 border-bottom: 1px solid #CCCCCC;
479 width: 179px;
480 height: 130px;
481 overflow:auto; background-position-y:50%
482}
483#SL_news .row1 { background-color:#FFFFFF; padding: 5px 5px 5px 5px;}
484#SL_news .row2 { background-color:#e9f1f8; padding: 0px;}
485#SL_news a { font-size:x-small;}
486
487
488/* If we don't explicitly choose a size for H2, H3, Firefox and IE
489 choose sizes that are very different.
490 */
491h2 { font-size: 18px }
492h3 { font-size: 14px; padding:0px; margin: 12px 0 8px 0 }
493
494/* table cells */
495td.heading { border-bottom: 1px dotted black }
496td.title { font-weight: bold }
497td.right { text-align: right }
498td.center { text-align: center }
499td.ledger-shade { background-color: #eeeeee }
500
501/* _COPIED_ "required" over from registration b/c other forms may have required fields */
502.required
503{
504 font-size: 10px;
505 color: #CC0000;
506 background-color: #FFFFCC;
507 font-weight: normal;
508}
509
510/* Known Issues format and display */
511#known_issues {
512 background-image: url('/_img/backgrounds/bg_topfade.gif');
513 background-position: left top;
514 background-repeat: repeat-x;
515 border: 1px solid #CCC;
516 width: 650px;
517 padding-left:8px; padding-right:3px; padding-top:0px; padding-bottom:3px
518}
519
520#bug {
521 border-bottom: 1px dashed #CCC;
522 padding: 12px 0px;
523}
524
525.bugrepro{
526 border: 1px solid #CCC;
527 display: none;
528 height: 300px;
529 width: 600px;
530 overflow: auto;
531 padding: 3px;
532}
533
534.whenupdated {
535 text-align: center;
536 font-weight: bold;
537 font-size: large;
538 padding: 2px;
539}
540
541.key, .buglabel {
542 padding: 0px 4px 0px 0px;
543 font-weight: bold;
544}
545
546.versionlist{
547 padding: 0px 8px 0px 0px;
548 font-style: italic;
549}
550
551.bugsummary{
552 font-weight: bold;
553} \ No newline at end of file
diff --git a/linden/indra/newview/help/basics/basic_skills.html b/linden/indra/newview/help/basics/basic_skills.html
deleted file mode 100644
index 68dcc4e..0000000
--- a/linden/indra/newview/help/basics/basic_skills.html
+++ /dev/null
@@ -1,23 +0,0 @@
1<HTML>
2<HEAD>
3 <TITLE>Basic Second Life Skills</TITLE>
4</HEAD>
5<BODY>
6<br>
7<font color="#006000">WELCOME TO BASIC SECOND LIFE SKILLS</font>
8<P>
9<font color="#006000">TOPICS</font>
10<BR>
11<A HREF="movement.html">Basic Movement</A><BR>
12<A HREF="chat.html">Chat</A><BR>
13<A HREF="im.html">Instant Messaging</A><BR>
14<A HREF="inventory.html">Inventory Basics</A><BR>
15<A HREF="customization.html">Basic Avatar Customization</A><BR>
16<A HREF="profile.html">Your Profile</A><BR>
17<A HREF="shopping.html">Shopping 101</A><BR>
18<A HREF="camera.html">An Introduction to Camera Control</A><BR>
19
20<P>
21[ <A HREF="movement.html">Next</A> ]
22</BODY>
23</HTML>
diff --git a/linden/indra/newview/help/basics/camera.html b/linden/indra/newview/help/basics/camera.html
deleted file mode 100644
index e7a7b1e..0000000
--- a/linden/indra/newview/help/basics/camera.html
+++ /dev/null
@@ -1,50 +0,0 @@
1<HEAD>
2 <TITLE>Camera Control</TITLE>
3</HEAD>
4<BODY>
5<br>
6Get a new perspective on your Second Life.
7<P>
8
9Because Second Life is 3-D, you have total and infinite control over where you place the camera (your eyes).
10<P>
11Camera control is a little tricky to get the hang of, but once you do, you'll really enjoy it.
12<P>
13<font color="#000080">1. Hold down the ALT key to activate Focus mode.</font>
14<P>
15The cursor changes to a magnifying glass.
16<P>
17<font color="#000080">3. With ALT held down, click and release on various spots on the landscape.</font>
18<P>
19Notice that the view re-centers on the place where you clicked.
20<P>
21<font color="#000080">4. Click on your avatar and drag the mouse SLOWLY around.</font>
22<P>
23As you move the mouse forward and backward and side to side, the view zooms in and out and around your avatar.
24<P>
25<font color="#000080">5. Now hold down the ATL and CTRL keys at the same time.</font>
26<p>
27The cursor changes again to indicate Orbit mode.
28<P>
29<font color="#000080">6. With both ALT and CTRL held down, click and drag SLOWLY on the avatar again.</font>
30<P>
31Now, as you move the mouse, the view stays approximately the same distance from your avatar, but the camera orbits around it in all directions.
32<P>
33<font color="#000080">7. Now hold down ALT, CTRL, and Shift at the same time.</font>
34<P>
35The cursor changes to indicate Pan mode.
36<P>
37<font color="#000080">8. Click and drag SLOWLY on the avatar again.</font>
38<P>
39Now, as you move the mouse, the camera slides across the landscape. It looks like you're dragging the ground around.
40<P>
41<font color="#000080">9. Hit the Esc key to return to normal view.</font>
42<P>
43You'll also find a Camera Control panel under the View menu at the top of the screen.
44<p>
45Mastering camera control will take some practice. One you have a feel for it, it's not only fun, but very useful when you start to build things and need to see them from all angles.
46<P>
47[ <a href="basic_skills.html">Basic Skills Home</a> | <A HREF="economy.html">Previous</A> | <A HREF="congratulations.html">Next</A> ]
48</BODY>
49</HTML>
50
diff --git a/linden/indra/newview/help/basics/chat.html b/linden/indra/newview/help/basics/chat.html
deleted file mode 100644
index 59cf64a..0000000
--- a/linden/indra/newview/help/basics/chat.html
+++ /dev/null
@@ -1,20 +0,0 @@
1<HTML>
2<HEAD>
3 <TITLE>Chat</TITLE>
4</HEAD>
5<BODY>
6<br>
7Time to learn how to chat.
8<P>
9The first step is to find someone to chat with. Use the Mini Map or World Map to locate other Second Life Residents.
10<P>
11Once you've located someone to chat with, get only as close to then as you would to chat in real life.
12<P>
13<font color="#000080">1. Press the Enter (or Return) key, type a message, then hit Enter (Return) again to say your message.</font><P>
14Everyone within a certain range will hear you.
15<P>
16<font color="#000080">2. By default, you'll automatically stay in chat mode as long as you're talking. (You can change this later in Preferences.) When you're done with your conversation, hit the ESC key to exit chat mode.</font>
17<P>
18[ <a href="basic_skills.html">Basic Skills Home</a> | <A HREF="landmarks.html">Previous</A> | <A HREF="im.html">Next</A> ]
19</BODY>
20</HTML> \ No newline at end of file
diff --git a/linden/indra/newview/help/basics/congratulations.html b/linden/indra/newview/help/basics/congratulations.html
deleted file mode 100644
index 1ff33bf..0000000
--- a/linden/indra/newview/help/basics/congratulations.html
+++ /dev/null
@@ -1,16 +0,0 @@
1<HTML>
2<HEAD>
3 <TITLE>Congratulations!</TITLE>
4</HEAD>
5<BODY>
6<P>
7When you're ready to learn more, take a quick look through <a href="../Concepts/Second_Life_Concepts.html">Second Life Concepts</a>, where you'll gain some background in how things work around here.
8<p>
9Or, if you prefer, you can jump right into the <a href="../Advanced/Advanced_Second_Life_Skills.html">Advanced Second Life Skills</a>.
10<P>
11
12
13<P>
14[ <A HREF="camera.html">Previous</A> ]
15</BODY>
16</HTML>
diff --git a/linden/indra/newview/help/basics/customization.html b/linden/indra/newview/help/basics/customization.html
deleted file mode 100644
index e3e46af..0000000
--- a/linden/indra/newview/help/basics/customization.html
+++ /dev/null
@@ -1,59 +0,0 @@
1<HTML>
2<HEAD>
3 <TITLE>Basic Avatar Customization</TITLE>
4</HEAD>
5<BODY>
6<br>
7Turn yourself into a work of art.
8<P>
9<font color="#000080">1. Open the Edit menu and select <font color="#B00000">Appearance...</font>.</font>
10<P>
11You'll see a large dialog box and a close-up of your avatar's face.
12<P>
13Along the left side of the dialog are a number of tabs that divide up the job into various body parts or articles of clothing.
14<P>
15<font color="#000080">2. Click on the <font color="#B00000">Shape tab</font> on the left.</font>
16<P>
17You're now ready to change your avatar's shape.
18<P>
19Within the Shape tab are a number of other choices: Face, Torso, Legs and Body. Plus, you can change your avatar's gender with a single click.
20<p>
21<font color="#000080">3. If your avatar is male, click on female. If it's female, click on male.</font>
22<P>
23Your avatar will instantly change from one gender to another. The clothing will stay the same, but there will be a number of easy-to-notice changes. Go back and forth, then pick whichever one you want for now.
24<P>
25<font color="#000080">4. Click on the <font color="#B00000">Face</font> button.</font>
26<P>
27Now it's time to play.
28<P>
29Take your time and go through all the face sliders. Don't be afraid to giggle; you can't hurt your avatar's feelings.
30<P>
31Use the left- and right-arrow keys to rotate your avatar and see it from all sides as you play.
32<P>
33When you've finished with the face:
34<P>
35<font color="#000080">5. Click on the <font color="#B00000">Torso</font> button, and play with the sliders.</font>
36<P>
37<font color="#000080">6. Click on the <font color="#B00000">Legs</font> button, and play with the sliders.</font>
38<P>
39<font color="#000080">7. Click on the <font color="#B00000">Body</font> button, and play with the sliders.</font>
40<P>
41Once you've played with the adjustments for a while and want to keep what you've got:
42<P>
43<font color="#000080">8. Click on <font color="#B00000">Save As...</font>.</font>
44<P>
45A dialog box will open asking you to choose a name for your new shape. It will appear in your Clothing folder of your Inventory.
46<p>
47You can create as many shapes as you want, and instantly change between them just by double-clicking on their name in the Inventory box.
48<P>
49So far, you've only played with the Shape tab. There's a lot more you can do to your avatar on the Skin, Hair and Eyes Tabs -- and even more with the clothing tabs.
50<P>
51If you want, stay and play. Try the other tabs and see what you can come up with.
52
53<p>
54When you're ready to move on, click Next below.
55
56<P>
57[ <a href="basic_skills.html">Basic Skills Home</a> | <A HREF="inventory.html">Previous</A> | <A HREF="profile.html">Next</A> ]
58</BODY>
59</HTML> \ No newline at end of file
diff --git a/linden/indra/newview/help/basics/economy.html b/linden/indra/newview/help/basics/economy.html
deleted file mode 100644
index f68b990..0000000
--- a/linden/indra/newview/help/basics/economy.html
+++ /dev/null
@@ -1,17 +0,0 @@
1<HTML>
2<HEAD>
3 <TITLE>The Second Life Economy</TITLE>
4</HEAD>
5<BODY>
6<br>
7Second Life features a vibrant inworld economy that's a lot different than many other online worlds.
8<P>
9Every week, you'll receive a weekly stipend of ingame currency, or L$. This amount is determined by your membership (Basic or Premium) as well as a bonus amount based on your inworld reputation (as rated by other residents).
10<P>
11There are many ways to make money in Second Life; generally, if it works (and is legal) in the real world, it may be possible in Second Life. You can create objects, clothing, etc. and sell them. If you own land, you can create any number of businesses--dance club, arcade, coffee house, chicken ranch, space station, roller coaster, etc.--and earn rewards for the time other people spend at your build. You can even charge admission. If you're skilled, other residents may hire you to help them with their own builds, businesses, and creations.
12<P>
13If you prefer not to work, or need more cash fast, you can even purchase L$ with USD$ dollars. On the other hand, if you're rolling in the L$ dough, you can sell L$ and make real-world cash! (See <a href="http://secondlife.com/help">http://secondlife.com/help</a> for more information.)
14<P>
15[ <a href="basic_skills.html">Basic Skills Home</a> | <A HREF="shopping.html">Previous</A> | <A HREF="camera.html">Next</A> ]
16</BODY>
17</HTML>
diff --git a/linden/indra/newview/help/basics/im.html b/linden/indra/newview/help/basics/im.html
deleted file mode 100644
index 182bb6a..0000000
--- a/linden/indra/newview/help/basics/im.html
+++ /dev/null
@@ -1,47 +0,0 @@
1<HTML>
2<HEAD>
3 <TITLE>Instant Messaging</TITLE>
4</HEAD>
5<BODY>
6<br>
7Read on to learn how to use Instant Messaging.
8<P>
9
10Instant Messaging is private, and only the Residents you send an Instant Message to can hear it.
11<P>
12Let's take a look at the Instant Messaging box.
13<P>
14<font color="#000080">1. Click on the IM button in the lower-left corner of the screen.</font>
15<P>
16The New Instant Messaging box opens.
17<P>
18Until you meet some people and add them to your Friends list, there won't be anyone listed for Instant Messaging. Instead, you can find someone to IM using the Find menu or Right-Clicking another Resident near you and selecting "Send IM".
19<P>
20Let's send an IM to someone to see how IM works.
21<P>
22<font color="#000080">2. Select a name in the New IM menu (if you've collected any calling cards) or use the Find menu to locate another Resident and select "Send IM".</font>
23<P>
24The IM box changes. The title now says Instant Message with the Resident you selected.
25<P>
26Also, now there are two tabs a the bottom of the box, one to return to New IM (your list of people you can IM), plus one where you're now ready to carry on an IM conversation.
27<P>
28<font color="#000080">3. Type in an appropriate message and press Enter (Return).</font>
29<P>
30Your message will be sent.
31<P>
32IM is a great way to leave messages for others even when they're not in-world. And once you have a number of Friends, you can carry on multiple IM conversations at once.
33<P>
34If you find someone who you want to add to your Friends list:
35<P>
36<font color="#000080">4. Click on their avatar, and from the pie menu, select Add Friend.</font>
37<P>
38They'll get a dialog asking them if they want to accept your offer of Friendship. If they say &quot;no,&quot; then they won't appear on your Friends list..
39<P>
40If someone clicks on your avatar and wants to become your Friend, you'll be given the chance to say yes or no before it happens.
41<P>
42If you decide at a later time that you no longer want to be Friends with a particular person, you can remove them from your Friends list, and you will automatically be removed from theirs.
43
44<P>
45[ <a href="basic_skills.html">Basic Skills Home</a> |<A HREF="chat.html">Previous</A> | <A HREF="inventory.html">Next</A> ]
46</BODY>
47</HTML>
diff --git a/linden/indra/newview/help/basics/inventory.html b/linden/indra/newview/help/basics/inventory.html
deleted file mode 100644
index bcbda45..0000000
--- a/linden/indra/newview/help/basics/inventory.html
+++ /dev/null
@@ -1,49 +0,0 @@
1<HTML>
2<HEAD>
3 <TITLE>Inventory</TITLE>
4</HEAD>
5<BODY>
6<P>
7Your Inventory is your treasure chest. It holds everything that you build, own and need. There's even a Library that contains objects, clothing, outfits, textures, and more for you to use.
8<P>
9Let's take a quick look at it:
10<P>
11<font color="#000080">1. Click on the Inventory button in the lower-right corner of the screen.</font><P>
12The Inventory box is set up like a filing cabinet, with folders and files. You can have folders inside other folders to help organize things as you gather more and more stuff.
13<P>
14Think of your Inventory as a huge electronic closet.
15<P>
16<font color="#000080">2. Look at the name of all the folders in your Inventory, then go ahead and look through them.</font>
17<P>
18<font color="#000080">3. Click on the small &quot;+&quot; next to a folder to open it, then click on the &quot;-&quot; to close it.</font>
19<P>
20The main folders are:
21<P>
22<font color="#006000">Body Parts</font> -- here's a place to store different body parts. The ones that are in bold text are currently worn by your avatar. Double-click on a body part to wear it.
23<P>
24<font color="#006000">Calling Cards</font> -- here's where the calling cards that you gather are stored, plus your own. Double-click on a calling card to find out more information about the person behind the card.
25<P>
26<font color="#006000">Clothing</font> -- this is a folder where you can keep assorted pieces of clothing, plus whole outfits, so you can change your avatar's looks as often as you like. Outfits can even hold body parts and shapes, so when you change, you really change. Clothes that you're currently wearing are shown in bold text.
27<P>
28<font color="#006000">Landmarks</font> -- this folder holds all of your landmarks, including the ones you make yourself.
29<P>
30<font color="#006000">Note Cards</font> -- this folder holds note cards, which are like sticky notes: a place to keep text notes to yourself.
31<P>
32<font color="#006000">Objects</font> -- this is a folder that holds various things that you make or buy in Second Life. They can range from small toys to whole houses.
33<P>
34<font color="#006000">Photo Album</font> -- this is where the screenshots you take are stored. You can take screenshots by selecting <font color="#006000">Take Screenshot</font> in the File menu.
35<P>
36<font color="#006000">Scripts</font> -- this folder holds a number of useful scripts that can be attached to objects to make them more interactive. You can write your own scripts if you choose, or use scripts created by others and just modify them. For instance, you can use a Door script on the door to your house and easily modify the password.
37<P>
38<font color="#006000">Sounds</font> -- this folder holds sounds that you can play or attach to avatar gestures (we'll do this later). You can record your own sounds and upload them into your Inventory.
39<P>
40<font color="#006000">Textures</font> -- this folder is for graphics that you can use to decorate your walls, to add flair to anything you build, and even create new items of clothing.
41<p>
42<font color="#006000">Trash</font> -- this is where everything you delete from your Inventory goes until you empty the trash. It's a safety feature that helps you get back things you may have accidentally deleted.
43<p>
44<font color="#000080">5. Click on the X button to close the Inventory box.</font>
45<P>
46[ <a href="basic_skills.html">Basic Skills Home</a> | <A HREF="im.html">Previous</A> | <A HREF="customization.html">Next</A> ]
47</BODY>
48</HTML>
49
diff --git a/linden/indra/newview/help/basics/keyboard.html b/linden/indra/newview/help/basics/keyboard.html
deleted file mode 100644
index 2963a1b..0000000
--- a/linden/indra/newview/help/basics/keyboard.html
+++ /dev/null
@@ -1,58 +0,0 @@
1<HTML>
2<HEAD>
3 <TITLE>Walking and Flying with the Keyboard</TITLE>
4</HEAD>
5<BODY>
6<br>
7As you learn to move around in Second Life, you may find that you may want to use one hand on the keyboard to move around while you're using the mouse to do other things. As a result, it's easiest to learn how to move with the mouse and keyboard.
8<P>
9Follow the instructions below to learn how to move your avatar with the keyboard.
10<P>
11<font color="#000080">1. Take a look at this chart:</font>
12<P>
13<font color="#B00000">W = Forward<BR>
14S = Backward
15<P>
16A = Left<BR>
17D = Right
18<P>
19E = Fly Up (Jump)<BR>
20C = Fly Down (Duck)
21<P>
22F = Fly toggle</font>
23<P>
24<font color="#000080">2. Play around with these keys and walk around until you get the hang of it.</font>
25<P>
26If your avatar starts typing instead of walking, press ESC a few times to get out of Chat.
27<P>
28Notice that you can press two keys at a time. For instance, while pressing W to move forward, tap on the D or A keys to turn without stopping.
29<P>
30If you'd rather use your right hand, you can also use the arrow keys:
31<P>
32<font color="#B00000">Up Arrow = Forward<BR>
33Down Arrow = Backward
34<P>
35Left Arrow = Left<BR>
36Right Arrow = Right
37<P>
38PageUp = Fly Up (Jump)<BR>
39PageDown = Fly Down (Duck)
40<P>
41Home = Fly toggle</font>
42<P>
43<P>
44<font color="#000080">3. Press the F key.</font>
45<P>
46Your avatar flies.
47<P>
48<font color="#000080">4. Fly around using the keyboard.</font>
49<P>
50Again, take some time to get the hang of it.
51<P>
52<font color="#000080">5. Press the F key to stop flying.</font>
53<P>
54If you were up very high, your landing might not be very pretty, but don't worry ... it won't hurt.
55<P>
56[ <a href="basic_skills.html">Basic Skills Home</a> | <A HREF="movement.html">Previous</A> | <A HREF="landmarks.html">Next</A> ]
57</BODY>
58</HTML> \ No newline at end of file
diff --git a/linden/indra/newview/help/basics/landmarks.html b/linden/indra/newview/help/basics/landmarks.html
deleted file mode 100644
index 5842080..0000000
--- a/linden/indra/newview/help/basics/landmarks.html
+++ /dev/null
@@ -1,43 +0,0 @@
1 <HTML>
2<HEAD>
3 <TITLE>Using Landmarks</TITLE>
4</HEAD>
5<BODY>
6<br>
7Landmarks help you find your way to new places, or find your way back to a place you liked. You have a number of useful, ready-to-use landmarks at your disposal. Later, you'll be making your own.
8<P>
9<font color="#000080">1. Look at the Mini-Map. (Click on the "Mini-Map" button if you don't see it.)</font>
10<P>
11In addition to showing an overview of the world, the Mini-Map also helps you find your way around.
12<P>
13<font color="#000080">2. Click on Mini Map to open the World Map window.</font>
14<P>
15The World Map shows more of the Second Life world. Some extra controls appear on the right side of the map, including a pull-down list of landmarks.
16<P>
17<font color="#000080">3. Click on Landmark pull-down</font>
18<P>
19<font color="#000080">4. Select a Landmark that sounds interesting to you.</font>
20<P>
21Once you select a landmark in this list, a couple of things happen: the landmark appears on the map as a red square, and a large beacon appears in the world at the landmark's location.
22<P>
23You only see beacons while a landmark is selected, and only you can see it. So don't tell someone to go to the big red beacon, because they won't see it unless they have the same landmark selected.
24<P>
25If you've wandered a ways from your starting point, you may not be able to see the landmark on the map. If that's the case:
26<P>
27<font color="#000080">5. Slide the Zoom slider to shrink the map until you can see the red square that marks the landmark.</font>
28<P>
29Once you see the landmark on the map:
30<P>
31<font color="#000080">6. Click the Teleport button on the World Map.</font>
32<P>
33Your avatar will teleport to a Telehub. This is a central teleport location that's close to your landmark. You'll need to fly the rest of the way.
34<P>
35<font color="#000080">7. Use the A and D keys, or left and right arrow keys, to turn your avatar until the red arrow inworld points in front of you (the center of the screen).</font>
36<P>
37At this point, your avatar is facing the landmark. You should be able to see a tall red beacon marking the landmark in-world.
38<P>
39<font color="#000080">8. Go to the landmark.</font>
40<P>
41[ <a href="basic_skills.html">Basic Skills Home</a> | <A HREF="keyboard.html">Previous</A> | <A HREF="chat.html">Next</A> ]
42</BODY>
43</HTML>
diff --git a/linden/indra/newview/help/basics/leading.html b/linden/indra/newview/help/basics/leading.html
deleted file mode 100644
index fc78729..0000000
--- a/linden/indra/newview/help/basics/leading.html
+++ /dev/null
@@ -1,26 +0,0 @@
1<HTML>
2<HEAD>
3 <TITLE>Leading the Avatar</TITLE>
4</HEAD>
5<BODY>
6<br>
7There are multiple ways to move around, but first, we'll learn the basic mouse movement methods. The easiest way to move your avatar is to lead it around by pointing to where you want it to go.
8<p>
9<font color="#000080">1. Right-click on the ground close to the avatar.</font><p>
10A pie menu opens.
11<P>
12<font color="#000080">2. Move the cursor up and click on &quot;Go Here.&quot;</font><P>
13The avatar walks to the place where you clicked.
14<P>
15<font color="#000080">3. Click on the ground far away from the avatar.</font>
16<P>
17<font color="#000080">4. When the pie menu opens, move the cursor up and click on &quot;Go Here.&quot;</font>
18<P>
19If the distance was far enough, your avatar flew to the spot.<BR>
20Take some time now lead your avatar around for a while.
21
22<P>
23[ <a href="basic_skills.html">Basic Skills Home</a> | <A HREF="movement.html">Previous</A> | <A HREF="mouse.html">Next</A> ]
24</BODY>
25</HTML>
26
diff --git a/linden/indra/newview/help/basics/mouse.html b/linden/indra/newview/help/basics/mouse.html
deleted file mode 100644
index aff23a0..0000000
--- a/linden/indra/newview/help/basics/mouse.html
+++ /dev/null
@@ -1,36 +0,0 @@
1<HTML>
2<HEAD>
3 <TITLE>Walking and Flying with the Mouse</TITLE>
4</HEAD>
5<BODY>
6<br>
7The point-and-go method is fine if you know where you want to go, but if you want to just wander around, there's a better way to go.
8<P>
9<font color="#000080">1. Click on your avatar.</font>
10<P>
11<font color="#000080">2. When the pie menu opens, move the cursor up and click on &quot;Go...&quot;.</font><P>
12A small box with arrows in it opens near the bottom of the screen.
13<P>
14<font color="#000080">3. Click (or click and hold) on all of the arrows, one at a time.</font><P>
15If you play with these for a while, you'll get the hang of moving forward and backward, turning left and right, side-walking left and right, and even jumping and crouching.
16<P>
17Now we'll try a shortcut:
18<P>
19<font color="#000080">4. Click and hold on the forward arrow, then, while still holding, slide the cursor out of the box, left and right, forward and backward.</font>
20<P>
21Take some time and practice guiding your avatar around in this way.
22<P>
23<font color="#000080">5. Click on the Fly button.</font>
24<P>
25Your avatar rises into the air.
26<P>
27<font color="#000080">6. Use the arrows as before to fly around. Don't forget to try the up and down arrows.</font>
28<P>
29Take your time and practice a little before you move on.
30<P>
31<font color="#000080">7. Click on the Fly button again to return to the ground.</font>
32<P>
33[ <a href="basic_skills.html">Basic Skills Home</a> | <A HREF="leading.html">Previous</A> | <A HREF="keyboard.html">Next</A> ]
34</BODY>
35</HTML>
36
diff --git a/linden/indra/newview/help/basics/movement.html b/linden/indra/newview/help/basics/movement.html
deleted file mode 100644
index a2d9d06..0000000
--- a/linden/indra/newview/help/basics/movement.html
+++ /dev/null
@@ -1,17 +0,0 @@
1<HTML>
2<HEAD>
3 <TITLE>Basic Movement</TITLE>
4</HEAD>
5<BODY>
6
7<br>
8Click on the first topic below to get moving.
9<P>
10<A HREF="keyboard.html">Walking and Flying with the Keyboard</A><BR>
11<A HREF="landmarks.html">Using Landmarks</A><BR>
12
13<P>
14[ <a href="basic_skills.html">Basic Skills Home</a> | <A HREF="basic_skills.html">Previous</A> | <A HREF="keyboard.html">Next</A> ]
15</BODY>
16</HTML>
17
diff --git a/linden/indra/newview/help/basics/profile.html b/linden/indra/newview/help/basics/profile.html
deleted file mode 100644
index ea08be4..0000000
--- a/linden/indra/newview/help/basics/profile.html
+++ /dev/null
@@ -1,28 +0,0 @@
1<html>
2<head>
3 <title>Your Profile</title>
4</head>
5
6<body>
7
8<br>
9Your avatar's appearance tells people something about you (the person behind the avatar). There's also another way to let others know about yourself: your Profile.
10<P>
11<font color="#000080">1. Click on your avatar.</font>
12<P>
13<font color="#000080">2. From the pie menu, select My Profile ... </font>
14<P>
15Your Profile opens. It has your screen name and some checkboxes and spaces to supply informaiton about yourself. It also shows how others have rated you and how many others you have rated.
16<P>
17There's also a place to put an image. The image can be your (human) picture, your avatar's picture, a logo, or anything else (or nothing) that you want. To change the image, click on it. An Image Picking dialog will open and let you select from all the images at your disposal.
18<P>
19The information in your Profile is public. The Find feature searches through profiles to help you find others with similar interests (and others find you).
20<P>
21<font color="#000080">3. Take some time and tell us about yourself. You can always come back and change or add to this information later.</font>
22<P>
23When you're ready to move on, click Next below.
24
25<P>
26[ <a href="basic_skills.html">Basic Skills Home</a> | <A HREF="customization.html">Previous</A> | <A HREF="shopping.html">Next</A> ]
27</body>
28</html>
diff --git a/linden/indra/newview/help/basics/shopping.html b/linden/indra/newview/help/basics/shopping.html
deleted file mode 100644
index 4e0bbcc..0000000
--- a/linden/indra/newview/help/basics/shopping.html
+++ /dev/null
@@ -1,53 +0,0 @@
1<HTML>
2<HEAD>
3 <TITLE>Shopping 101</TITLE>
4</HEAD>
5<BODY>
6<br>
7Let's go shopping.
8<P>
9In Second Life, there are &quot;official&quot; stores and vending machines where you can buy things, but you can also buy (or take a free copy of) many things that aren't in stores. In fact, you can put a price on anything you build and if people want it, they can buy it and you get the money.
10<P>
11You can use the Find window to look up a variety of places, selling virtually anything imaginable. Whatever your interest, there's probably a store selling it somewhere in Second Life. When you've selected a store in the Find window, you can teleport to it or mark it on your Map.
12<P>
13"Window shopping" in Second Life is actually quite simple.
14<P>
15<font color="#000080">1. Find an object that interests you, and point to it.</font>
16<P>
17After a second or so some information about the object will pop up. The information will include whether it's for sale and how much it costs. If the object is not listed as For Sale, try left-clicking it to see if it's a scripted vendor instead. (If so, it'll tell you in chat how much the item costs.)
18<P>
19Once you find something that interests you:
20<P>
21<font color="#000080">2. Right-click on the object.</font>
22<P>
23A pie menu opens.
24<P>
25<font color="#000080">3. Select Buy on the left of the pie menu.</font>
26<P>
27A confirmation dialog will open giving you the details of the transaction, including the price. If you want it:
28<P>
29<font color="#000080">4. Click on Buy.</font>
30<P>
31If the object's popup doesn't list it as For Sale, but clicking it tells you the price, then the Buy menu choice probably isn't available. In this case, we're going to Pay the vendor, and it'll give us the item:
32<P>
33<font color="#000080">4. Right-click on the vendor and choose Pay. Enter the cost of the item you're trying to buy, and click OK. When a blue box comes up offering you the item you just bought, click Accept.</font>
34<P>
35You've just made your first financial transaction. The object you just bought is placed in your Inventory. Notice that its name may include <b>(no copy)</b>, <b>(no modify)</b>, or <b>(no transfer)</b>; this means that you can't copy the object, can't edit the object, or can't give the object away, respectively.
36<P>
37<font color="#000080">6. If you bought clothing, drag it from Inventory onto your avatar. If you bought an object, drag it from Inventory to some location inworld.</font>
38<P>
39If you bought clothing, your avatar will wear the clothing when you drag it onto yourself. If you bought an object, it'll appear inworld at the place you drop it.
40<P>
41If you thought you bought clothing, but end up with a box on your head when you drag it onto yourself, don't worry! Right-click the box and <b>Detach</b> it, then drag in somewhere else (just like an object). Right-click the box and choose <b>Edit</b>, then click <b>More</b>, then finally choose its <b>Contents</b>. You should find the clothing you bought in there; drag it from the box's Contents into your Inventory. You can then wear your new clothing.
42<P>
43If the object you bought is <b>(no copy)</b>, notice how it disappears from inventory when you bring it inworld. If you lose track of a no-copy object when it's inworld, it may be very hard to find it again! You can right-click your object and choose <b>Take</b> to put it back in your inventory. If the object isn't (no copy), notice how it remains in your Inventory even when you bring it inworld. You'll always have a copy of this object (unless you manually delete the Inventory copy, of course!)
44<P>
45<font color="#000080">7. To take back an object inworld, right-click on the object you created, and choose Take. To delete the object, right-click it, and press the Del key on your keyboard.</font>
46<P>
47You should only delete an object if you still have a copy in Inventory! If you don't have a copy in your Inventory, be sure and Take it instead.
48<P>
49You can go on a shopping binge now, or click Next to move on.
50<P>
51[ <a href="basic_skills.html">Basic Skills Home</a> | <A HREF="customization.html">Previous</A> | <A HREF="economy.html">Next</A> ]
52</BODY>
53</HTML> \ No newline at end of file
diff --git a/linden/indra/newview/help/bg_dots_grey.gif b/linden/indra/newview/help/bg_dots_grey.gif
deleted file mode 100644
index f9ec608..0000000
--- a/linden/indra/newview/help/bg_dots_grey.gif
+++ /dev/null
Binary files differ
diff --git a/linden/indra/newview/help/community_standards.html b/linden/indra/newview/help/community_standards.html
deleted file mode 100644
index cf94cc6..0000000
--- a/linden/indra/newview/help/community_standards.html
+++ /dev/null
@@ -1,52 +0,0 @@
1<html>
2<head>
3 <title>Second Life Community Standards</title>
4</head>
5<body>
6<br>
7<b>Second Life(TM): Community Standards</b><br>
8<br>
9Welcome to Second Life. We hope you'll have a richly rewarding experience, filled with creativity, self expression and fun. The goals of the Community Standards are simple: treat each other with respect and without harassment, adhere to local standards as indicated by simulator ratings, and refrain from any hate activity which slurs a real-world individual or real-world community.
10<p>
11<b>The Big Six</b><br>
12Within Second Life, we want to support Residents in shaping their specific experiences and making their own choices. The Community Standards sets out six behaviors, the "Big Six", that will result in suspension or, with repeated violations, expulsion from the Second Life Community. All Second Life Community Standards apply to all areas of Second Life, the Second Life Forums, and the Second Life Website.
13<p>
14<b>1. Intolerance</b><br>
15Combating intolerance is a cornerstone of Second Life's Community Standards. Actions that marginalize, belittle, or defame individuals or groups inhibit the satisfying exchange of ideas and diminish the Second Life community as whole. The use of derogatory or demeaning language or images in reference to another Resident's race, ethnicity, gender, religion, or sexual preference is never allowed in Second Life.
16<p>
17<b>2. Harassment</b><br>
18Given the myriad capabilities of Second Life, harassment can take many forms. Communicating or behaving in a manner which is offensively coarse, intimidating or threatening, constitutes unwelcome sexual advances or requests for sexual favors, or is otherwise likely to cause annoyance or alarm is Harassment.
19<p>
20<b>3. Assault</b><br>
21Most areas in Second Life are identified as Safe. Assault in Second Life means: shooting, pushing, or shoving another Resident in a Safe Area (see Global Standards below); creating or using scripted objects which singularly or persistently target another Resident in a manner which prevents their enjoyment of Second Life.
22<p>
23<b>4. Disclosure</b><br>
24Residents are entitled to a reasonable level of privacy with regard to their Second Lives. Sharing personal information about a fellow Resident --including gender, religion, age, marital status, race, sexual preference, and real-world location beyond what is provided by the Resident in the First Life page of their Resident profile is a violation of that Resident's privacy. Remotely monitoring conversations, posting conversation logs, or sharing conversation logs without consent are all prohibited in Second Life and on the Second Life Forums.
25<p>
26<b>5. Indecency</b><br>
27Second Life is an adult community, but Mature material is not necessarily appropriate in all areas (see Global Standards below). Content, communication, or behavior which involves intense strong language or expletives, nudity or sexual content, the depiction of sex or strong violence, or anything else broadly offensive must be contained within private land in areas rated Mature (M). Names of Residents, objects, places and groups are broadly viewable in Second Life directories and on the Second Life website, and must adhere to PG guidelines.
28<p>
29<b>6. Disturbing the Peace</b><br>
30Every Resident has a right to live their Second Life. Disrupting scheduled events, repeated transmission of undesired advertising content, the use of repetitive sounds, following or self-spawning items, or other objects that intentionally slow server performance or inhibit another Resident's ability to enjoy Second Life are examples of Disturbing the Peace.
31<p>
32<b>Policies and Policing</b><br>
33<br>
34<b>Global Standards, Local Ratings</b><br>
35All areas of Second Life, including the www.secondlife.com website and the Second Life Forums, adhere to the same Community Standards. Locations within Second Life are noted as Safe or Unsafe and rated Mature (M) or non-Mature (PG), and behavior must conform to the local ratings. Any unrated area of Second Life or the Second Life website should be considered non-Mature (PG).
36<p>
37<b>Warning, Suspension, Banishment</b><br>
38Second Life is a complex society, and it can take some time for new Residents to gain a full understanding of local customs and mores. Generally, violations of the Community Standards will first result in a Warning, followed by Suspension and eventual Banishment from Second Life. In-World Representatives, called Liaisons, may occasionally address disciplinary problems with a temporary removal from Second Life.
39<p>
40<b>Global Attacks</b><br>
41Community Standards violations which broadly interfere with or disrupt the Second Life community, the Second Life servers or other systems related to Second Life cannot be tolerated in any form. Such actions will result in a minimum two-week suspension and a review of your account for probable removal from Second Life.
42<p>
43<b>Alternate Accounts</b><br>
44While Residents may choose to play Second Life with more than one account, specifically or consistently using an alternate account to harass other Residents or violate the Community Standards is not acceptable. Alternate accounts are generally treated as separate from a Resident's principal account, but misuse of alternate accounts can and will result in disciplinary action on the principal account.
45<p>
46<b>Buyer Beware</b><br>
47Linden Lab does not exercise editorial control over the content of Second Life, and will make no specific efforts to review the textures, objects, sounds or other content created within Second Life. Additionally, Linden Lab does not certify or endorse the operation of in-world games, vending machines, or retail locations; refunds must be requested from the owners of these objects.
48<p>
49<b>Reporting Abuse</b><br>
50Residents should report violations of the Community Standards using the Abuse Reporter tool located under the Help menu in the in-world tool bar. Every Abuse Report is individually investigated, and the identity of the reporter is kept strictly confidential. If you need immediate assistance, in-world Liaisons may be available to help. Look for Residents with the last name Linden.
51</body>
52</html>
diff --git a/linden/indra/newview/help/graphics_driver_update.html b/linden/indra/newview/help/graphics_driver_update.html
deleted file mode 100644
index 3a3b25c..0000000
--- a/linden/indra/newview/help/graphics_driver_update.html
+++ /dev/null
@@ -1,12 +0,0 @@
1<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2<html>
3<head>
4 <META HTTP-EQUIV=Refresh CONTENT="2; URL=http://www.secondlife.com/support/">
5 <title>Second Life: Graphics Driver Update</title>
6</head>
7<body bgcolor="white" vlink="blue" alink="blue" link="blue">
8<basefont face="Arial,Helvetica,sans-serif" size="3">
9<p>Taking you to the Second Life Support page at
10<a href="http://www.secondlife.com/support/">http://www.secondlife.com/support/</a>.</p>
11</body>
12</html>
diff --git a/linden/indra/newview/help/grey_corner_bl.gif b/linden/indra/newview/help/grey_corner_bl.gif
deleted file mode 100644
index 14e076a..0000000
--- a/linden/indra/newview/help/grey_corner_bl.gif
+++ /dev/null
Binary files differ
diff --git a/linden/indra/newview/help/grey_corner_br.gif b/linden/indra/newview/help/grey_corner_br.gif
deleted file mode 100644
index f4520fc..0000000
--- a/linden/indra/newview/help/grey_corner_br.gif
+++ /dev/null
Binary files differ
diff --git a/linden/indra/newview/help/grey_corner_tl.gif b/linden/indra/newview/help/grey_corner_tl.gif
deleted file mode 100644
index ef7434d..0000000
--- a/linden/indra/newview/help/grey_corner_tl.gif
+++ /dev/null
Binary files differ
diff --git a/linden/indra/newview/help/grey_corner_tr.gif b/linden/indra/newview/help/grey_corner_tr.gif
deleted file mode 100644
index d53c4d8..0000000
--- a/linden/indra/newview/help/grey_corner_tr.gif
+++ /dev/null
Binary files differ
diff --git a/linden/indra/newview/help/grey_pixel.gif b/linden/indra/newview/help/grey_pixel.gif
deleted file mode 100644
index 491eec6..0000000
--- a/linden/indra/newview/help/grey_pixel.gif
+++ /dev/null
Binary files differ
diff --git a/linden/indra/newview/help/header_banner.jpg b/linden/indra/newview/help/header_banner.jpg
deleted file mode 100644
index 3e37c65..0000000
--- a/linden/indra/newview/help/header_banner.jpg
+++ /dev/null
Binary files differ
diff --git a/linden/indra/newview/help/index.html b/linden/indra/newview/help/index.html
deleted file mode 100644
index 197cbed..0000000
--- a/linden/indra/newview/help/index.html
+++ /dev/null
@@ -1,18 +0,0 @@
1<!-- saved from url=(0022)http://internet.e-mail -->
2<html>
3<head>
4 <title>Second Life Help</title>
5</head>
6<body>
7<br>
8Choose your topic:
9<P>
10<a href="welcome/welcome.html">Welcome to Second Life Orientation</a><br>
11<a href="welcome/welcomeback.html">Welcome Back to Second Life </a><br>
12<a href="basics/basic_skills.html">Basic Second Life Skills</a><br>
13<a href="Concepts/Second_Life_Concepts.html">Second Life Concepts</a><br>
14<a href="Advanced/Advanced_Second_Life_Skills.html">Advanced Second Life Skills</a>
15<p>
16<a href="community_standards.html">Second Life Community Standards</a>
17</body>
18</html>
diff --git a/linden/indra/newview/help/sl_logo.gif b/linden/indra/newview/help/sl_logo.gif
deleted file mode 100644
index 037ec80..0000000
--- a/linden/indra/newview/help/sl_logo.gif
+++ /dev/null
Binary files differ
diff --git a/linden/indra/newview/help/spacer.gif b/linden/indra/newview/help/spacer.gif
deleted file mode 100644
index 35d42e8..0000000
--- a/linden/indra/newview/help/spacer.gif
+++ /dev/null
Binary files differ
diff --git a/linden/indra/newview/help/unable_to_connect.html b/linden/indra/newview/help/unable_to_connect.html
deleted file mode 100644
index a8973a1..0000000
--- a/linden/indra/newview/help/unable_to_connect.html
+++ /dev/null
@@ -1,149 +0,0 @@
1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2<html xmlns="http://www.w3.org/1999/xhtml"><head>
3
4
5<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
6
7<link href="MAIN.css" rel="stylesheet" type="text/css"><title>Second Life | Unable to Connect</title></head><body>
8<table align="center" border="0" cellpadding="0" cellspacing="0">
9 <tbody><tr><td>
10
11 <div id="DEFAULT_container" align="center">
12
13 <div id="DEFAULT_header">
14 <div class="box_grey_r">
15 <div class="box_grey_l">
16 <div class="box_grey_b">
17 <div class="box_grey_bl">
18 <div class="box_grey_br">
19
20 <table border="0" cellpadding="0" cellspacing="0" width="100%">
21 <tbody><tr>
22 <td align="left">
23 <a href="http://secondlife.com/"><img src="spacer.gif" align="left" border="0" height="85" width="230"></a>
24 </td>
25 <td align="right" valign="top">
26 </td>
27 </tr>
28 </tbody></table>
29
30 </div>
31 </div>
32 </div>
33 </div>
34 </div>
35 </div>
36
37
38
39 <table border="0" cellpadding="10" cellspacing="0" width="100%">
40 <tbody><tr>
41 <td>
42 <p>&nbsp;</p>
43
44
45
46
47
48 <h2>Second Life - Unable to Connect to Server.</h2>
49 <table bgcolor="#c9c9c9" border="0" cellpadding="1" cellspacing="0" width="100%">
50 <tbody><tr>
51 <td>
52 <table border="0" cellpadding="8" cellspacing="0" width="100%">
53 <tbody><tr>
54 <td style="color: rgb(51, 51, 51);" bgcolor="#e5e5e5">
55 <blockquote><h5>
56 <p> Second Life has failed to connect to its server. This
57message can appear because you are not connected to the Internet; because
58your router or firewall is blocking Second Life network access; because
59third-party software (such as firewall or internet security software) is
60blocking Second Life; or because the Second Life servers are offline.<br>
61 </p>
62 <p>First, make sure you can reach a common web site like <a
63 href="http://www.google.com/">Google</a>. If you cannot connect to
64Google, the problem is probably with your network or your Internet
65Service Provider.<br>
66 </p>
67 <p>Next, check the <a
68 href="http://www.secondlife.com/status/">Second Life Status</a> web
69page to make sure the servers are up.<br>
70 </p>
71 <p>If the servers are up but you are still having
72problems, please visit Second Life Help for assistance:<br>
73 </p>
74 <p><a href="http://www.secondlife.com/help/">http://www.secondlife.com/help/</a> </p>
75 </blockquote>
76 </h5>
77 </td>
78 </tr>
79 </tbody></table>
80 </td>
81 </tr>
82 </tbody></table>
83 <br>
84 <p>
85 For additional details about system upgrades, maintenance, outages, or other known problems please read
86 the <a style="text-decoration: underline;" href="http://blog.secondlife.com/">Official Linden Blog</a>.
87 </p>
88
89
90
91
92 </td>
93 </tr>
94 </tbody></table>
95
96
97 <div id="DEFAULT_footer" align="center">
98
99
100 <div class="box_grey_t">
101 <div class="box_grey_r">
102 <div class="box_grey_l">
103 <div class="box_grey_b">
104 <div class="box_grey_tl">
105 <div class="box_grey_tr">
106 <div class="box_grey_bl">
107 <div class="box_grey_br">
108
109 <div id="SL_footer">
110 <table border="0" cellpadding="8" cellspacing="0" width="100%">
111 <tbody><tr>
112 <td align="left">
113 <a href="http://secondlife.com/corporate/sysreqs.php">system requirements</a> |
114 <a href="http://secondlife.com/corporate/privacy.php">privacy</a> |
115 <a href="http://secondlife.com/corporate/cs.php">community standards</a> |
116 <a href="http://secondlife.com/corporate/tos.php">terms of service</a> |
117 <a href="http://secondlife.com/corporate/dmca.php">dmca</a> |
118 <!--
119 <a href="/corporate/affiliates.php">affiliates</a> | education | support |
120 -->
121 <a href="http://secondlife.com/status/">grid status</a> |
122 <a href="http://lindenlab.com/employment">jobs</a>
123
124 </td>
125 <td align="right" valign="middle">
126 &nbsp;©2006 Linden Research Inc.
127 </td>
128 <td align="right" valign="middle">
129 <a href="http://lindenlab.com/"><img src="LL_logo.jpg"></a>
130 </td>
131 </tr>
132 </tbody></table>
133 </div>
134
135 </div>
136 </div>
137 </div>
138 </div>
139 </div>
140 </div>
141 </div>
142 </div>
143
144
145 </div>
146
147
148 </div>
149</td></tr></tbody></table></body></html> \ No newline at end of file
diff --git a/linden/indra/newview/help/unsupported_card.html b/linden/indra/newview/help/unsupported_card.html
deleted file mode 100644
index 2d58b75..0000000
--- a/linden/indra/newview/help/unsupported_card.html
+++ /dev/null
@@ -1,58 +0,0 @@
1<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2<html>
3<head>
4 <title>Second Life Error</title>
5</head>
6<body bgcolor="#ffffff" vlink="blue" alink="blue" link="blue">
7<basefont face="Arial,Helvetica,sans-serif" size="3">
8<center>
9<table bgcolor="#000000" width="600" border="0" cellspacing="0"
10 cellpadding="1">
11 <tbody>
12 <tr>
13 <td>
14 <table bgcolor="#ffffff" width="100%" border="0" cellspacing="0"
15 cellpadding="0">
16 <tbody>
17 <tr>
18 <td colspan="2" bgcolor="#30333e">
19 <table border="0" cellpadding="5" cellspacing="0"
20 width="100%">
21 <tbody>
22 <tr>
23 <td align="left"><img width="167" height="68"
24 border="0" src="sl_logo.gif"></td>
25 </tr>
26 </tbody>
27 </table>
28 </td>
29 </tr>
30 <tr>
31 <td> <br>
32 <p align="center"><font size="+1"><b>Unsupported Graphics
33Card</b></font></p>
34 <blockquote>
35 <p>If you are receiving this message, your graphics card may not be compatible with Second Life.
36Attempting to use Second Life with your current system configuration may cause the program to crash
37or become unresponsive. Minimum system requirements are listed on the Second Life Support web site:</p>
38 <p> <a href="http://secondlife.com/support/">http://secondlife.com/support/</a> </p>
39 <p> If you are using a supported video card, contact the
40manufacturer to obtain video driver updates. Video driver
41updates for ATI and Nvidia graphics products are available for download
42from the following web sites: </p>
43 <p> <a href="http://www.ati.com/">http://www.ati.com/</a><br>
44 <a href="http://www.nvidia.com/">http://www.nvidia.com/</a> </p>
45 <p>Finally, try setting your display to "True Color
46(32-bit)" under Control Panels, Display before running Second Life.</p>
47 </blockquote>
48 </td>
49 </tr>
50 </tbody>
51 </table>
52 </td>
53 </tr>
54 </tbody>
55</table>
56</center>
57</body>
58</html>
diff --git a/linden/indra/newview/help/welcome/avatar.html b/linden/indra/newview/help/welcome/avatar.html
deleted file mode 100644
index 2a272eb..0000000
--- a/linden/indra/newview/help/welcome/avatar.html
+++ /dev/null
@@ -1,20 +0,0 @@
1<HTML>
2<HEAD>
3 <TITLE>Your Avatar</TITLE>
4</HEAD>
5<BODY>
6<br>
7Your <font color="#006000">avatar</font> is your representative in Second Life.
8<P>
9It's been randomly created to get you started, but you'll be able to customize it to look almost any way you want -- and you can change it as often as you like.
10<p>
11You can create and save complete outfits consisting of clothing, body shape, attachments and more, and change the total look of your avatar with a simple drag and drop.
12<p>
13Avatars can be male or female, and can be just about any size or shape you can imagine. Avatars can wear layers of clothes, and can have accessories -- ranging from jet packs to jewelry -- attached to a number of places.
14<P>
15All around your avatar is Second Life, filled with hills, valleys, trees, grass, bodies of water, buildings, all sorts of objects, and people. Don't worry, you'll be exploring it soon.
16<P>
17[<a href="welcomeback.html">Welcome Home</a> | <A HREF="screen.html">Previous</A> | <A HREF="menus.html">Next</A> ]
18</BODY>
19</HTML>
20
diff --git a/linden/indra/newview/help/welcome/buttons.html b/linden/indra/newview/help/welcome/buttons.html
deleted file mode 100644
index 7936862..0000000
--- a/linden/indra/newview/help/welcome/buttons.html
+++ /dev/null
@@ -1,33 +0,0 @@
1<HTML>
2<HEAD>
3 <TITLE>The Buttons</TITLE>
4</HEAD>
5<BODY>
6<br>
7Along the bottom of the screen, you'll see a number of buttons.
8<P>
9<font color="#006000">IM</font> lets you Instant Message friends, groups, and people you meet.
10<P>
11<font color="#006000">Chat</font> opens a chat bar you can use to talk to people nearby.
12<P>
13<font color="#006000">Friends</font> pulls up your Friends list, so you can add people you know, view their profile, etc.
14<P>
15<font color="#006000">Fly</font> lets your avatar take flight. (You can also use F or the Home key when you're not chatting.)
16<P>
17<font color="#006000">Snapshot</font> takes a snapshot of the current screen, which you can save to Inventory or disk, or mail as a postcard to someone else.
18<P>
19<font color="#006000">Events</font> allows you to view upcoming events.
20<p>
21<font color="#006000">Find</font> opens a dialog to help you find people, places, groups, events, and other things in Second Life.
22<P>
23<font color="#006000">Mini-Map</font> shows or hides the small map in the upper-right corner of your screen.
24<P>
25<font color="#006000">Map</font> opens the World Map window to give you a bigger picture of where you are.
26<P>
27There's one more button to look at, in the lower-right corner of the screen: Inventory.
28<P>
29<font color="#006000">Inventory</font> opens your Inventory -- your storage "bag" for everything from Friends' contact information, to landmarks, to outfits for your avatar.
30<P>
31[<a href="welcomeback.html">Welcome Home</a> | <A HREF="menus.html">Previous</A> | <A HREF="map.html">Next</A> ]
32</BODY>
33</HTML>
diff --git a/linden/indra/newview/help/welcome/chat.html b/linden/indra/newview/help/welcome/chat.html
deleted file mode 100644
index 5143dc4..0000000
--- a/linden/indra/newview/help/welcome/chat.html
+++ /dev/null
@@ -1,20 +0,0 @@
1<HTML>
2<HEAD>
3 <TITLE>Chat and Instant Messaging</TITLE>
4</HEAD>
5<BODY>
6<br>
7The bottom of the screen is dedicated to communication: <font color="#006000">Chat and Instant Messaging.</font>
8<P>
9<font color="#006000">Chat</font> is the quickest and easiest way to communicate with anyone who's nearby.
10<P>
11<font color="#006000">Instant Messaging</font> is a more private way to talk to people you already know.
12<P>
13<font color="#000080">To chat, hit Enter (Return), type your message, then hit Enter (Return) again.</font>
14<p>
15We'll talk more about <font color="#006000">Instant Messaging</font> soon.
16<P>
17[<a href="welcomeback.html">Welcome Home</a> | <A HREF="map.html">Previous</A> | <A HREF="graduation.html">Next</A> ]
18</BODY>
19</HTML>
20
diff --git a/linden/indra/newview/help/welcome/graduation.html b/linden/indra/newview/help/welcome/graduation.html
deleted file mode 100644
index b7cd673..0000000
--- a/linden/indra/newview/help/welcome/graduation.html
+++ /dev/null
@@ -1,14 +0,0 @@
1<HTML>
2<HEAD>
3 <TITLE>Graduation
4</TITLE>
5</HEAD>
6<BODY>
7<br>
8<font color="#006000">Congratulations! You've finished your first session.</font>
9<P>
10Click <font color="#006000">Next</font> to continue your journey.
11<P>
12[<a href="welcomeback.html">Welcome Home</a> | <A HREF="chat.html">Previous</A> | <A HREF="../basics/basic_skills.html">Next</A> ]
13</BODY>
14</HTML>
diff --git a/linden/indra/newview/help/welcome/map.html b/linden/indra/newview/help/welcome/map.html
deleted file mode 100644
index 2f92870..0000000
--- a/linden/indra/newview/help/welcome/map.html
+++ /dev/null
@@ -1,25 +0,0 @@
1<HTML>
2<HEAD>
3 <TITLE>The Map Window</TITLE>
4</HEAD>
5<BODY>
6<br>
7The <font color="#006000">Mini Map</font> window shows you an overhead view of the part of the world near you. It will help you find people and places, as well as navigate your way around the world.
8<p>
9Each <font color="#006000">Region</font> (a named area also called a "simulator") on the map is shown as a square tile, representing about 16 acres of the world.
10<p>
11The mini-map doesn't display the whole world -- only the nearest few Regions. (<font color="#000080">For a view of the whole world, Click on the Mini Map to view the World Map.</font>) The map moves as you move, with new regions appearing as you approach them.
12<p>
13In both the Mini Map and World Map, water is shown on the map as dark blue, and the ground is green, brown or white, depending on the alitude. Gray blocks indicate buildings or other human-made structures to investigate. Your avatar always appears in the center of the Map window as a white dot, with a faint gray triangle indicating your 3D field of view. Other avatars appear as green dots.
14<p>
15In the World Map, if you select a landmark with the <font color="#006000">Landmark Tracking</font> pull-down, the landmark will be shown on the map as a red dot. (If the landmark isn't within view, a red arrow will point in its direction.) Active landmarks also appear in the world as a red "beacon" that only you can see.
16<p>
17People on your Friends list can be displayed on the map using the <font color="#006000">Resident Tracking</font> pull-down. While you're tracking them, a red "beacon" (that only you can see) will mark their location in the world.
18<p>
19The World Map window can be enlarged, resized and moved. The map itself can be enlarged or shrunk within the window, with the <font color="#006000">Zoom slider</font>.
20<p>
21Finally, the <font color="#006000">Background</font> pull-down menu allows to set the World Map to display terrain, new places, popular places, items for sale, and available land.
22<p>
23[<a href="welcomeback.html">Welcome Home</a> | <A HREF="buttons.html">Previous</A> | <A HREF="chat.html">Next</A> ]
24</BODY>
25</HTML>
diff --git a/linden/indra/newview/help/welcome/menus.html b/linden/indra/newview/help/welcome/menus.html
deleted file mode 100644
index b9def09..0000000
--- a/linden/indra/newview/help/welcome/menus.html
+++ /dev/null
@@ -1,21 +0,0 @@
1<HTML>
2<HEAD>
3 <TITLE>The Menus</TITLE>
4</HEAD>
5<BODY>
6<br>
7The menus along the top of the screen work like menus in most programs: <font color="#00080">Click on a menu to open it, then click on the menu item to select it.</font>
8<P>
9Open each menu and look over the different menu items as you read the descriptions.
10<P>
11- The <font color="#006000">File</font> menu handles uploading audio clips and textures, taking screenshots and quitting.<BR>
12- The <font color="#006000">Edit</font> menu lets you do the usual Edit menu tasks like cut, copy, paste and find, plus edit some Second Life specific things, like your avatar, groups and preferences. <BR>
13- The <font color="#006000">View</font> menu handles what you see on your screen, and lets you display things like flying controls and your Linden Dollar account history.<BR>
14- The <font color="#006000">World</font> menu creates landmarks, lets you set your home location and enables you to teleport home.<BR>
15- The <font color="#006000">Tools</font> menu provides access to many of the advanced creation tools that you can use to build your own objects -- or even a home.<BR>
16- The <font color="#006000">Help</font> menu lets you access this and other help screens.
17<p>
18[<a href="welcomeback.html">Welcome Home</a> | <A HREF="avatar.html">Previous</A> | <A HREF="buttons.html">Next</A> ]
19</BODY>
20</HTML>
21
diff --git a/linden/indra/newview/help/welcome/screen.html b/linden/indra/newview/help/welcome/screen.html
deleted file mode 100644
index 5d931a8..0000000
--- a/linden/indra/newview/help/welcome/screen.html
+++ /dev/null
@@ -1,19 +0,0 @@
1<HTML>
2<HEAD>
3 <TITLE>The Screen</TITLE>
4</HEAD>
5<BODY>
6<br>
7When you first enter Second Life you see a few things:
8<P>
9- <font color="#006000">You</font>, standing in your Second Life.<BR>
10- This <font color="#006000">Help window</font>.<BR>
11- A <font color="#006000">Menu bar</font> at the top of the screen on the left.<BR>
12- Some <font color="#006000">buttons</font> across the bottom of the screen.<BR>
13- The <font color="#006000">Mini Map window</font> near the upper-right corner of the screen.<BR>
14- <font color="#006000">Chat</font> and <font color="#006000">Instant Messaging</font> along the bottom of the screen.<BR>
15- Your bank <font color="#006000">account balance</font> upper-right corner.
16<P>
17[<a href="welcomeback.html">Welcome Home</a> | <A HREF="welcome.html">Previous</A> | <A HREF="avatar.html">Next</A> ]
18</BODY>
19</HTML>
diff --git a/linden/indra/newview/help/welcome/welcome.html b/linden/indra/newview/help/welcome/welcome.html
deleted file mode 100644
index 2632f0a..0000000
--- a/linden/indra/newview/help/welcome/welcome.html
+++ /dev/null
@@ -1,31 +0,0 @@
1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2<html>
3<head>
4 <title>Welcome</title>
5</head>
6<body>
7<br>
8<font color="#006000">WELCOME TO SECOND LIFE ORIENTATION ISLAND</font>
9<p>You are in a safe, protected place where you can explore, learn and
10progress at your own pace.
11</p>
12<p><font color="#000080">Press the arrow keys on your keyboard to walk
13and look around.</font>
14</p>
15<p><font color="#000080">Follow the path to the help stations.&nbsp; At
16each station, click on the spinning Second Life hand to learn what to
17do.<br>
18</font></p>
19<p>The person you see in front of you is your avatar -- your
20representative in Second Life. You'll be able to change how it looks
21soon.
22</p>
23<p>You can close this help window now to unclutter your view. You can
24always bring it back by hitting F1 or selecting Basic Help in the Help
25menu.
26</p>
27<p>If you've already finished your orientation and moved on to the
28mainland, <a href="welcomeback.html">click here</a>.
29</p>
30</body>
31</html>
diff --git a/linden/indra/newview/help/welcome/welcomeback.html b/linden/indra/newview/help/welcome/welcomeback.html
deleted file mode 100644
index 1a674b4..0000000
--- a/linden/indra/newview/help/welcome/welcomeback.html
+++ /dev/null
@@ -1,32 +0,0 @@
1<HTML>
2<HEAD>
3 <TITLE>Welcome Back!</TITLE>
4</HEAD>
5<BODY>
6
7<br>
8<font color="#006000">WELCOME BACK TO SECOND LIFE</font>
9<p>
10If you haven't finished your orientation yet, then <a href="welcome.html">click here</a>.
11<p>
12If you have finished your orientation and are now on the Second Life mainland, you're ready to explore a whole new world.
13<p>
14This help system will walk you through a series of topics that will build on your orientation experience and teach you everything you need to begin your Second Life.
15<p>
16You don't have to plow through the whole thing in one sitting -- you can close the help system and return to it at any time. Just hit F1 or select Basic Help from the Help menu.
17<p>
18<font color="#000080">Click on the first topic below to get started.</font>
19<P>
20<font color="#006000">TOPICS</font><BR>
21<A HREF="screen.html">The Screen</A><BR>
22<A HREF="avatar.html">Your Avatar and the World</A><BR>
23<A HREF="menus.html">The Menus</A><BR>
24<A HREF="buttons.html">The Buttons</A><BR>
25<A HREF="map.html">The Map Window</A><BR>
26<A HREF="chat.html">Chat and Instant Messaging</A>
27<P>
28[ <A HREF="screen.html">Next</A> ]
29</BODY>
30</HTML>
31
32
diff --git a/linden/indra/newview/help/window_creation_error.html b/linden/indra/newview/help/window_creation_error.html
deleted file mode 100644
index e6d155e..0000000
--- a/linden/indra/newview/help/window_creation_error.html
+++ /dev/null
@@ -1,73 +0,0 @@
1<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2<html>
3<head>
4 <title>Second Life Error</title>
5</head>
6<body bgcolor="white" vlink="blue" alink="blue" link="blue">
7<basefont face="Arial,Helvetica,sans-serif" size="3">
8<center>
9<table bgcolor="#000000" width="600" border="0" cellspacing="0"
10 cellpadding="1">
11 <tbody>
12 <tr>
13 <td>
14 <table bgcolor="#dcdcdc" width="100%" border="0" cellspacing="0"
15 cellpadding="0">
16 <tbody>
17 <tr>
18 <td colspan="2" bgcolor="#30333e">
19 <table border="0" cellpadding="5" cellspacing="0"
20 width="100%">
21 <tbody>
22 <tr>
23 <td align="left"><img width="167" height="68"
24 border="0" src="sl_logo.gif"></td>
25 </tr>
26 </tbody>
27 </table>
28 </td>
29 </tr>
30 <tr>
31 <td> <br>
32 <p align="center"><font size="+1"><b>Unable to Configure
33Display</b></font></p>
34 <blockquote>
35 <p>Second Life tries to create a display window at a resolution of 1024x768 pixels at a color depth of 32-bit. This
36message indicates that Windows is unable to create that window. This message often appears when your graphics hardware does not meet Second Life's Minimum System Requirements; however, it may also appear if your current Windows display settings aren't high enough.</p>
37 <p> Suggestions:<br>
38Set your monitor to True Color (32-bit). <font
39 size="2">
40 <ol>
41 <li>Click <b>Start</b>, point to <b>Settings</b>,
42click <b>Control Panel</b> </li>
43 <li>Click <b>Display</b> </li>
44 <li>On the <b>Settings</b> tab, under <b>Color Quality</b>,
45select <b>Highest (32 bit)</b>. </li>
46 <li>Make sure the display resolution is <b>1024x768</b> or higher.</li>
47 <li>Click <b>OK</b></li>
48 <li>When you are prompted to keep this setting, click <b>Yes</b>.</li>
49 </ol>
50 </font> </p>
51 <p> If the problem continues, contact your video card
52manufacturer to obtain video driver updates. Video driver
53updates for ATI and Nvidia graphics products are available for download
54from the following websites: </p>
55 <p> <a href="http://www.ati.com/support/driver.html">http://www.ati.com/support/driver.html</a><br>
56 <a
57 href="http://www.nvidia.com/content/drivers/drivers.asp">http://www.nvidia.com/content/drivers/drivers.asp</a> </p>
58 <p> For help with identifying supported video cards,
59please visit Second Life Help:<br>
60 </p>
61 <p> <a href="http://www.secondlife.com/help/">http://www.secondlife.com/help/</a> </p>
62 </blockquote>
63 </td>
64 </tr>
65 </tbody>
66 </table>
67 </td>
68 </tr>
69 </tbody>
70</table>
71</center>
72</body>
73</html>
diff --git a/linden/indra/newview/installer.vcproj b/linden/indra/newview/installer.vcproj
deleted file mode 100644
index 86bac7d..0000000
--- a/linden/indra/newview/installer.vcproj
+++ /dev/null
@@ -1,184 +0,0 @@
1<?xml version="1.0" encoding="Windows-1252"?>
2<VisualStudioProject
3 ProjectType="Visual C++"
4 Version="7.10"
5 Name="installer"
6 ProjectGUID="{DEB7B859-BA03-4B8E-AEC6-327E6FB5D957}"
7 RootNamespace="installer"
8 Keyword="ManagedCProj">
9 <Platforms>
10 <Platform
11 Name="Win32"/>
12 </Platforms>
13 <Configurations>
14 <Configuration
15 Name="ADITI|Win32"
16 OutputDirectory="."
17 IntermediateDirectory="."
18 ConfigurationType="10"
19 CharacterSet="1"
20 DeleteExtensionsOnClean="">
21 <Tool
22 Name="VCCustomBuildTool"/>
23 <Tool
24 Name="VCMIDLTool"/>
25 <Tool
26 Name="VCPostBuildEventTool"/>
27 <Tool
28 Name="VCPreBuildEventTool"/>
29 </Configuration>
30 <Configuration
31 Name="DMZ|Win32"
32 OutputDirectory="."
33 IntermediateDirectory="."
34 ConfigurationType="10"
35 CharacterSet="1"
36 DeleteExtensionsOnClean="">
37 <Tool
38 Name="VCCustomBuildTool"/>
39 <Tool
40 Name="VCMIDLTool"/>
41 <Tool
42 Name="VCPostBuildEventTool"/>
43 <Tool
44 Name="VCPreBuildEventTool"/>
45 </Configuration>
46 <Configuration
47 Name="MUSEUM|Win32"
48 OutputDirectory="."
49 IntermediateDirectory="."
50 ConfigurationType="10"
51 CharacterSet="1"
52 DeleteExtensionsOnClean="">
53 <Tool
54 Name="VCCustomBuildTool"/>
55 <Tool
56 Name="VCMIDLTool"/>
57 <Tool
58 Name="VCPostBuildEventTool"/>
59 <Tool
60 Name="VCPreBuildEventTool"/>
61 </Configuration>
62 <Configuration
63 Name="AGNI|Win32"
64 OutputDirectory="."
65 IntermediateDirectory="."
66 ConfigurationType="10"
67 CharacterSet="1"
68 DeleteExtensionsOnClean="">
69 <Tool
70 Name="VCCustomBuildTool"/>
71 <Tool
72 Name="VCMIDLTool"/>
73 <Tool
74 Name="VCPostBuildEventTool"/>
75 <Tool
76 Name="VCPreBuildEventTool"/>
77 </Configuration>
78 <Configuration
79 Name="UPDATE|Win32"
80 OutputDirectory="$(SolutionDir)$(ConfigurationName)"
81 IntermediateDirectory="$(ConfigurationName)"
82 ConfigurationType="1"
83 CharacterSet="1">
84 <Tool
85 Name="VCCLCompilerTool"/>
86 <Tool
87 Name="VCCustomBuildTool"/>
88 <Tool
89 Name="VCLinkerTool"/>
90 <Tool
91 Name="VCMIDLTool"/>
92 <Tool
93 Name="VCPostBuildEventTool"/>
94 <Tool
95 Name="VCPreBuildEventTool"/>
96 <Tool
97 Name="VCPreLinkEventTool"/>
98 <Tool
99 Name="VCResourceCompilerTool"/>
100 <Tool
101 Name="VCWebServiceProxyGeneratorTool"/>
102 <Tool
103 Name="VCXMLDataGeneratorTool"/>
104 <Tool
105 Name="VCWebDeploymentTool"/>
106 <Tool
107 Name="VCManagedWrapperGeneratorTool"/>
108 <Tool
109 Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
110 </Configuration>
111 </Configurations>
112 <References>
113 </References>
114 <Files>
115 <Filter
116 Name="Source Files"
117 Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
118 UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
119 </Filter>
120 <Filter
121 Name="Header Files"
122 Filter="h;hpp;hxx;hm;inl;inc;xsd"
123 UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
124 </Filter>
125 <Filter
126 Name="Resource Files"
127 Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
128 UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
129 </Filter>
130 <File
131 RelativePath=".\secondlife setup.nsi">
132 <FileConfiguration
133 Name="ADITI|Win32">
134 <Tool
135 Name="VCCustomBuildTool"
136 Description="Creating $(ConfigurationName) install file..."
137 CommandLine="C:\Program Files\NSIS\makensis /D$(ConfigurationName) $(InputFileName)
138"
139 Outputs="$(ProjectDir)Second Life Preview Setup.exe"/>
140 </FileConfiguration>
141 <FileConfiguration
142 Name="DMZ|Win32">
143 <Tool
144 Name="VCCustomBuildTool"
145 Description="Creating $(ConfigurationName) install file..."
146 CommandLine="C:\Program Files\NSIS\makensis /D$(ConfigurationName) $(InputFileName)
147"
148 Outputs="$(ProjectDir)Second Life DMZ Setup.exe"/>
149 </FileConfiguration>
150 <FileConfiguration
151 Name="MUSEUM|Win32">
152 <Tool
153 Name="VCCustomBuildTool"
154 Description="Creating $(ConfigurationName) install file..."
155 CommandLine="C:\Program Files\NSIS\makensis /D$(ConfigurationName) $(InputFileName)
156"
157 Outputs="$(ProjectDir)Second Life 1-5-7 Setup.exe"/>
158 </FileConfiguration>
159 <FileConfiguration
160 Name="AGNI|Win32">
161 <Tool
162 Name="VCCustomBuildTool"
163 Description="Creating $(ConfigurationName) install file..."
164 CommandLine="C:\Program Files\NSIS\makensis /D$(ConfigurationName) $(InputFileName)
165"
166 Outputs="$(ProjectDir)Second Life 1-5-7 Setup.exe"/>
167 </FileConfiguration>
168 <FileConfiguration
169 Name="UPDATE|Win32">
170 <Tool
171 Name="VCCustomBuildTool"
172 Description="Creating $(ConfigurationName) install file..."
173 CommandLine="C:\Program Files\NSIS\makensis /D$(ConfigurationName) $(InputFileName)
174"
175 Outputs="$(ProjectDir)Second Life 1-5-7 Update.exe"/>
176 </FileConfiguration>
177 </File>
178 </Files>
179 <Globals>
180 <Global
181 Name="Foo"
182 Value="Bar"/>
183 </Globals>
184</VisualStudioProject>
diff --git a/linden/indra/newview/installers/darwin/mac_image_DS_Store b/linden/indra/newview/installers/darwin/mac_image_DS_Store
new file mode 100644
index 0000000..ac44787
--- /dev/null
+++ b/linden/indra/newview/installers/darwin/mac_image_DS_Store
Binary files differ
diff --git a/linden/indra/newview/installers/darwin/mac_image_background.tga b/linden/indra/newview/installers/darwin/mac_image_background.tga
new file mode 100644
index 0000000..2539366
--- /dev/null
+++ b/linden/indra/newview/installers/darwin/mac_image_background.tga
Binary files differ
diff --git a/linden/indra/newview/installers/darwin/mac_image_hidden b/linden/indra/newview/installers/darwin/mac_image_hidden
new file mode 100644
index 0000000..a39bde4
--- /dev/null
+++ b/linden/indra/newview/installers/darwin/mac_image_hidden
@@ -0,0 +1 @@
background.tga
diff --git a/linden/indra/newview/installers/windows/installer_template.nsi b/linden/indra/newview/installers/windows/installer_template.nsi
new file mode 100644
index 0000000..8ab7c4f
--- /dev/null
+++ b/linden/indra/newview/installers/windows/installer_template.nsi
@@ -0,0 +1,862 @@
1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2;;; @file viewer_manifest.py
3;;; @author James Cook, Don Kjer
4;;; @brief NSIS script for creating a Windows installer.
5;;; This file has variables expanded by viewer_manifest.py
6;;; to produce the complete nsi script file.
7;;; For info, see http://www.nullsoft.com/free/nsis/
8;;; NSIS 2.02 or higher required
9;;;
10;;; Copyright (c) 2006-$CurrentYear$, Linden Research, Inc.
11;;; $License$
12;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
13
14;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
15;;; Compiler flags
16;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
17
18;;; Detect NSIS compiler version
19!define "NSIS${NSIS_VERSION}"
20!ifdef "NSISv2.02" | "NSISv2.03" | "NSISv2.04" | "NSISv2.05" | "NSISv2.06"
21 ;;; before 2.07 defaulted lzma to solid (whole file)
22 SetCompressor lzma
23!else
24 ;;; after 2.07 required /solid for whole file compression
25 SetCompressor /solid lzma
26!endif
27
28SetOverwrite on ; overwrite files
29SetCompress auto ; compress iff saves space
30SetDatablockOptimize off ; only saves us 0.1%, not worth it
31XPStyle on ; add an XP manifest to the installer
32
33;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
34;;; Project flags
35;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
36
37%%VERSION%%
38
39;;; Tweak for different servers/builds (this placeholder is replaced by viewer_manifest.py)
40%%GRID_VARS%%
41
42Name ${INSTNAME}
43
44SubCaption 0 " Setup" ; override "license agreement" text
45
46BrandingText " " ; bottom of window text
47Icon res\install_icon.ico ; our custom icon
48UninstallIcon res\uninstall_icon.ico ; our custom icon
49WindowIcon on ; show our icon in left corner
50BGGradient off ; no big background window
51CRCCheck on ; make sure CRC is OK
52InstProgressFlags smooth colored ; new colored smooth look
53ShowInstDetails nevershow ; no details, no "show" button
54SetOverwrite on ; stomp files by default
55AutoCloseWindow true ; after all files install, close window
56
57!ifdef UPDATE
58LicenseText "This package will update Second Life to version ${VERSION_LONG}." "Next >"
59!else
60LicenseText "This package will install Second Life on your computer." "Next >"
61!endif
62
63LicenseData "releasenotes.txt"
64
65InstallDir "$PROGRAMFILES\${INSTNAME}"
66InstallDirRegKey HKEY_LOCAL_MACHINE "SOFTWARE\Linden Research, Inc.\${INSTNAME}" ""
67!ifdef UPDATE
68DirText "Installation Directory" "Select the Second Life directory to update:"
69!else
70DirText "Installation Directory" "Select the directory to install Second Life in:"
71!endif
72
73;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
74;;; Variables
75;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
76Var INSTPROG
77Var INSTEXE
78Var INSTFLAGS
79Var INSTSHORTCUT
80
81;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
82;;; Sections
83;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
84
85Section "" ; (default section)
86
87SetShellVarContext all ; install for all users (if you change this, change it in the uninstall as well)
88
89
90; Start with some default values.
91StrCpy $INSTFLAGS "${INSTFLAGS}"
92StrCpy $INSTPROG "${INSTNAME}"
93StrCpy $INSTEXE "${INSTEXE}"
94StrCpy $INSTSHORTCUT "${SHORTCUT}"
95
96IfSilent +2
97Goto NOT_SILENT
98 Call CheckStartupParams ; Figure out where, what and how to install.
99NOT_SILENT:
100Call CheckWindowsVersion ; warn if on Windows 98/ME
101Call CheckIfAdministrator ; Make sure the user can install/uninstall
102Call CheckIfAlreadyCurrent ; Make sure that we haven't already installed this version
103Call CloseSecondLife ; Make sure we're not running
104Call RemoveNSIS ; Check for old NSIS install to remove
105
106;;; Don't remove cache files during a regular install, removing the inventory cache on upgrades results in lots of damage to the servers.
107;Call RemoveCacheFiles ; Installing over removes potentially corrupted
108 ; VFS and cache files.
109
110
111;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
112;;; Files
113;;;
114;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
115;; This placeholder is replaced by the complete list of all the files in the installer, by viewer_manifest.py
116%%INSTALL_FILES%%
117
118; If this is a silent update, we don't need to re-create these shortcuts or registry entries.
119IfSilent POST_INSTALL
120
121; Shortcuts in start menu
122CreateDirectory "$SMPROGRAMS\$INSTSHORTCUT"
123SetOutPath "$INSTDIR"
124CreateShortCut "$SMPROGRAMS\$INSTSHORTCUT\$INSTSHORTCUT.lnk" \
125 "$INSTDIR\$INSTEXE" "$INSTFLAGS"
126
127!ifdef MUSEUM
128CreateShortCut "$SMPROGRAMS\$INSTSHORTCUT\$INSTSHORTCUT Museum.lnk" \
129
130 "$INSTDIR\$INSTEXE" "$INSTFLAGS -simple"
131CreateShortCut "$SMPROGRAMS\$INSTSHORTCUT\$INSTSHORTCUT Museum Spanish.lnk" \
132
133 "$INSTDIR\$INSTEXE" "$INSTFLAGS -simple -spanish"
134!endif
135
136WriteINIStr "$SMPROGRAMS\$INSTSHORTCUT\SL Create Trial Account.url" \
137 "InternetShortcut" "URL" \
138 "http://www.secondlife.com/registration/"
139WriteINIStr "$SMPROGRAMS\$INSTSHORTCUT\SL Your Account.url" \
140 "InternetShortcut" "URL" \
141 "http://www.secondlife.com/account/"
142CreateShortCut "$SMPROGRAMS\$INSTSHORTCUT\SL Release Notes.lnk" \
143 "$INSTDIR\releasenotes.txt"
144CreateShortCut "$SMPROGRAMS\$INSTSHORTCUT\SL Scripting Language Help.lnk" \
145 "$INSTDIR\lsl_guide.html"
146CreateShortCut "$SMPROGRAMS\$INSTSHORTCUT\Uninstall $INSTSHORTCUT.lnk" \
147 '"$INSTDIR\uninst.exe"' '/P="$INSTPROG"'
148
149; Other shortcuts
150SetOutPath "$INSTDIR"
151CreateShortCut "$DESKTOP\$INSTSHORTCUT.lnk" "$INSTDIR\$INSTEXE" "$INSTFLAGS"
152CreateShortCut "$INSTDIR\$INSTSHORTCUT.lnk" "$INSTDIR\$INSTEXE" "$INSTFLAGS"
153CreateShortCut "$INSTDIR\Uninstall $INSTSHORTCUT.lnk" \
154 '"$INSTDIR\uninst.exe"' '/P="$INSTPROG"'
155
156!ifdef MUSEUM
157CreateShortCut "$DESKTOP\$INSTSHORTCUT Museum.lnk" "$INSTDIR\$INSTEXE" "$INSTFLAGS -simple"
158
159CreateShortCut "$DESKTOP\$INSTSHORTCUT Museum Spanish.lnk" "$INSTDIR\$INSTEXE" "$INSTFLAGS -simple -spanish"
160
161CreateShortCut "$INSTDIR\$INSTSHORTCUT Museum.lnk" "$INSTDIR\$INSTEXE" "$INSTFLAGS -simple"
162
163CreateShortCut "$INSTDIR\$INSTSHORTCUT Museum Spanish.lnk" "$INSTDIR\$INSTEXE" "$INSTFLAGS -simple -spanish"
164
165!endif
166
167; Write registry
168WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Linden Research, Inc.\$INSTPROG" "" "$INSTDIR"
169WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Linden Research, Inc.\$INSTPROG" "Version" "${VERSION_LONG}"
170WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Linden Research, Inc.\$INSTPROG" "Flags" "$INSTFLAGS"
171WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Linden Research, Inc.\$INSTPROG" "Shortcut" "$INSTSHORTCUT"
172WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Linden Research, Inc.\$INSTPROG" "Exe" "$INSTEXE"
173WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\$INSTPROG" "DisplayName" "$INSTPROG (remove only)"
174WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\$INSTPROG" "UninstallString" '"$INSTDIR\uninst.exe" /P="$INSTPROG"'
175
176; Write URL registry info
177WriteRegStr HKEY_CLASSES_ROOT "${URLNAME}" "(default)" "URL:Second Life"
178WriteRegStr HKEY_CLASSES_ROOT "${URLNAME}" "URL Protocol" ""
179WriteRegStr HKEY_CLASSES_ROOT "${URLNAME}\DefaultIcon" "" '"$INSTDIR\$INSTEXE"'
180WriteRegExpandStr HKEY_CLASSES_ROOT "${URLNAME}\shell\open\command" "" '"$INSTDIR\$INSTEXE" $INSTFLAGS -url "%1"'
181
182Goto WRITE_UNINST
183
184POST_INSTALL:
185; Run a post-executable script if necessary.
186Call PostInstallExe
187
188WRITE_UNINST:
189; write out uninstaller
190WriteUninstaller "$INSTDIR\uninst.exe"
191
192; end of default section
193SectionEnd
194
195;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
196; PostInstallExe
197; This just runs any post installation scripts.
198;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
199Function PostInstallExe
200push $0
201 ReadRegStr $0 HKEY_LOCAL_MACHINE "SOFTWARE\Linden Research, Inc.\$INSTPROG" "PostInstallExe"
202 ;MessageBox MB_OK '$0'
203 ExecWait '$0'
204pop $0
205FunctionEnd
206
207
208;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
209; CheckStartupParameters
210; Sets INSTFLAGS, INSTPROG, and INSTEXE.
211;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
212Function CheckStartupParams
213push $0
214push $R0
215
216 ; Look for a registry entry with info about where to update.
217 Call GetProgramName
218 pop $R0
219 StrCpy $INSTPROG "$R0"
220 StrCpy $INSTEXE "$R0.exe"
221
222 ReadRegStr $0 HKEY_LOCAL_MACHINE "SOFTWARE\Linden Research, Inc.\$INSTPROG" ""
223 ; If key doesn't exist, skip install
224 IfErrors ABORT
225 StrCpy $INSTDIR "$0"
226
227 ; We now have a directory to install to. Get the startup parameters and shortcut as well.
228 ReadRegStr $0 HKEY_LOCAL_MACHINE "SOFTWARE\Linden Research, Inc.\$INSTPROG" "Flags"
229 IfErrors +2
230 StrCpy $INSTFLAGS "$0"
231 ReadRegStr $0 HKEY_LOCAL_MACHINE "SOFTWARE\Linden Research, Inc.\$INSTPROG" "Shortcut"
232 IfErrors +2
233 StrCpy $INSTSHORTCUT "$0"
234 ReadRegStr $0 HKEY_LOCAL_MACHINE "SOFTWARE\Linden Research, Inc.\$INSTPROG" "Exe"
235 IfErrors +2
236 StrCpy $INSTEXE "$0"
237 Goto FINISHED
238
239ABORT:
240 MessageBox MB_OK "Could not find the program '$INSTPROG'. Silent update failed."
241 Quit
242
243FINISHED:
244 ;MessageBox MB_OK "INSTPROG: $INSTPROG, INSTEXE: $INSTEXE, INSTFLAGS: $INSTFLAGS"
245pop $R0
246pop $0
247FunctionEnd
248
249Function un.CheckStartupParams
250push $0
251push $R0
252
253 ; Look for a registry entry with info about where to update.
254 Call un.GetProgramName
255 pop $R0
256 StrCpy $INSTPROG "$R0"
257 StrCpy $INSTEXE "$R0.exe"
258
259 ReadRegStr $0 HKEY_LOCAL_MACHINE "SOFTWARE\Linden Research, Inc.\$INSTPROG" ""
260 ; If key doesn't exist, skip install
261 IfErrors ABORT
262 StrCpy $INSTDIR "$0"
263
264 ; We now have a directory to install to. Get the startup parameters and shortcut as well.
265 ReadRegStr $0 HKEY_LOCAL_MACHINE "SOFTWARE\Linden Research, Inc.\$INSTPROG" "Flags"
266 IfErrors +2
267 StrCpy $INSTFLAGS "$0"
268 ReadRegStr $0 HKEY_LOCAL_MACHINE "SOFTWARE\Linden Research, Inc.\$INSTPROG" "Shortcut"
269 IfErrors +2
270 StrCpy $INSTSHORTCUT "$0"
271 ReadRegStr $0 HKEY_LOCAL_MACHINE "SOFTWARE\Linden Research, Inc.\$INSTPROG" "Exe"
272 IfErrors +2
273 StrCpy $INSTEXE "$0"
274 Goto FINISHED
275
276ABORT:
277 MessageBox MB_OK "Could not find the program '$INSTPROG'. Silent update failed."
278 Quit
279
280FINISHED:
281 ;MessageBox MB_OK "INSTPROG: $INSTPROG, INSTEXE: $INSTEXE, INSTFLAGS: $INSTFLAGS"
282pop $R0
283pop $0
284FunctionEnd
285
286;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
287;;; After install completes, offer readme file
288;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
289Function .onInstSuccess
290 MessageBox MB_YESNO \
291 "Start Second Life now?" /SD IDYES IDNO NoReadme
292 ; Assumes SetOutPath $INSTDIR
293 Exec '"$INSTDIR\$INSTEXE" $INSTFLAGS'
294 NoReadme:
295FunctionEnd
296
297;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
298; Remove old NSIS version. Modifies no variables.
299; Does NOT delete the LindenWorld directory, or any
300; user files in that directory.
301;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
302Function RemoveNSIS
303 Push $0
304 ; Grab the installation directory of the old version
305 DetailPrint "Checking for old version..."
306 ReadRegStr $0 HKEY_LOCAL_MACHINE "SOFTWARE\Linden Research, Inc.\$INSTPROG" ""
307
308 ; If key doesn't exist, skip uninstall
309 IfErrors NO_NSIS
310
311 ; Clean up legacy beta shortcuts
312 Delete "$SMPROGRAMS\Second Life Beta.lnk"
313 Delete "$DESKTOP\Second Life Beta.lnk"
314 Delete "$SMPROGRAMS\Second Life.lnk"
315
316 ; Clean up old newview.exe file
317 Delete "$INSTDIR\newview.exe"
318
319 ; Intentionally don't delete the stuff in
320 ; Documents and Settings, so we keep the user's settings
321
322 NO_NSIS:
323 Pop $0
324FunctionEnd
325
326;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
327; Make sure we're not on Windows 98 / ME
328;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
329Function CheckWindowsVersion
330 DetailPrint "Checking Windows version..."
331 Call GetWindowsVersion
332 Pop $R0
333 ; Just get first two characters, ignore 4.0 part of "NT 4.0"
334 StrCpy $R0 $R0 2
335 ; Blacklist certain OS versions
336 StrCmp $R0 "95" win_ver_bad
337 StrCmp $R0 "98" win_ver_bad
338 StrCmp $R0 "ME" win_ver_bad
339 StrCmp $R0 "NT" win_ver_bad
340 Return
341win_ver_bad:
342 MessageBox MB_YESNO 'Second Life only supports Windows XP, Windows 2000, and Mac OS X.$\n$\nAttempting to install on Windows $R0 can result in crashes and data loss.$\n$\nInstall anyway?' IDNO win_ver_abort
343 Return
344win_ver_abort:
345 Quit
346FunctionEnd
347
348;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
349; Make sure the user can install/uninstall
350;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
351Function CheckIfAdministrator
352 DetailPrint "Checking for permission to install..."
353 UserInfo::GetAccountType
354 Pop $R0
355 StrCmp $R0 "Admin" is_admin
356 MessageBox MB_OK 'You appear to be using a "limited" account.$\nYou must be an "administrator" to install Second Life.'
357 Quit
358is_admin:
359 Return
360FunctionEnd
361
362Function un.CheckIfAdministrator
363 DetailPrint "Checking for permission to uninstall..."
364 UserInfo::GetAccountType
365 Pop $R0
366 StrCmp $R0 "Admin" is_admin
367 MessageBox MB_OK 'You appear to be using a "limited" account.$\nYou must be an "administrator" to uninstall Second Life.'
368 Quit
369is_admin:
370 Return
371FunctionEnd
372
373;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
374; Checks to see if the current version has already been installed (according to the registry).
375; If it has, allow user to bail out of install process.
376;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
377Function CheckIfAlreadyCurrent
378 Push $0
379 ReadRegStr $0 HKEY_LOCAL_MACHINE "SOFTWARE\Linden Research, Inc.\$INSTPROG" "Version"
380 StrCmp $0 ${VERSION_LONG} 0 DONE
381 MessageBox MB_OKCANCEL "It appears that Second Life ${VERSION_LONG} is already installed.$\n$\nWould you like to install it again?" /SD IDOK IDOK DONE
382 Quit
383
384 DONE:
385 Pop $0
386 Return
387FunctionEnd
388
389
390;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
391; Close the program, if running. Modifies no variables.
392; Allows user to bail out of install process.
393;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
394Function CloseSecondLife
395 Push $0
396 FindWindow $0 "Second Life" ""
397 IntCmp $0 0 DONE
398 MessageBox MB_OKCANCEL "Second Life can't be installed while it is already running.$\n$\nFinish what you're doing then select OK to close Second Life and continue.$\nSelect CANCEL to cancel installation." IDOK CLOSE IDCANCEL CANCEL_INSTALL
399
400 CANCEL_INSTALL:
401 Quit
402
403 CLOSE:
404 DetailPrint "Waiting for Second Life to shut down..."
405 SendMessage $0 16 0 0
406
407 LOOP:
408 FindWindow $0 "Second Life" ""
409 IntCmp $0 0 DONE
410 Sleep 500
411 Goto LOOP
412
413 DONE:
414 Pop $0
415 Return
416FunctionEnd
417
418
419;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
420; Delete files in Documents and Settings\<user>\SecondLife\cache
421; Delete files in Documents and Settings\All Users\SecondLife\cache
422;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
423Function RemoveCacheFiles
424
425; Delete files in Documents and Settings\<user>\SecondLife
426Push $0
427Push $1
428Push $2
429 DetailPrint "Deleting cache files in Documents and Settings folder"
430
431 StrCpy $0 0 ; Index number used to iterate via EnumRegKey
432
433 LOOP:
434 EnumRegKey $1 HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList" $0
435 StrCmp $1 "" DONE ; no more users
436
437 ReadRegStr $2 HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\$1" "ProfileImagePath"
438 StrCmp $2 "" CONTINUE 0 ; "ProfileImagePath" value is missing
439
440 ; Required since ProfileImagePath is of type REG_EXPAND_SZ
441 ExpandEnvStrings $2 $2
442
443 ; When explicitly uninstalling, everything goes away
444 RMDir /r "$2\Application Data\SecondLife\cache"
445
446 CONTINUE:
447 IntOp $0 $0 + 1
448 Goto LOOP
449 DONE:
450Pop $2
451Pop $1
452Pop $0
453
454; Delete files in Documents and Settings\All Users\SecondLife
455Push $0
456 ReadRegStr $0 HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" "Common AppData"
457 StrCmp $0 "" +2
458 RMDir /r "$0\SecondLife\cache"
459Pop $0
460
461; Delete filse in C:\Windows\Application Data\SecondLife
462; If the user is running on a pre-NT system, Application Data lives here instead of
463; in Documents and Settings.
464RMDir /r "$WINDIR\Application Data\SecondLife\cache"
465
466FunctionEnd
467
468;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
469; Delete files in Documents and Settings\<user>\SecondLife
470; Delete files in Documents and Settings\All Users\SecondLife
471;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
472Function un.DocumentsAndSettingsFolder
473
474; Delete files in Documents and Settings\<user>\SecondLife
475Push $0
476Push $1
477Push $2
478
479 DetailPrint "Deleting files in Documents and Settings folder"
480
481 StrCpy $0 0 ; Index number used to iterate via EnumRegKey
482
483 LOOP:
484 EnumRegKey $1 HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList" $0
485 StrCmp $1 "" DONE ; no more users
486
487 ReadRegStr $2 HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\$1" "ProfileImagePath"
488 StrCmp $2 "" CONTINUE 0 ; "ProfileImagePath" value is missing
489
490 ; Required since ProfileImagePath is of type REG_EXPAND_SZ
491 ExpandEnvStrings $2 $2
492
493 ; If uninstalling a normal install remove everything
494 ; Otherwise (preview/dmz etc) just remove cache
495 StrCmp $INSTFLAGS "" RM_ALL RM_CACHE
496 RM_ALL:
497 RMDir /r "$2\Application Data\SecondLife"
498 GoTo CONTINUE
499 RM_CACHE:
500 RMDir /r "$2\Application Data\SecondLife\Cache"
501
502 CONTINUE:
503 IntOp $0 $0 + 1
504 Goto LOOP
505 DONE:
506
507Pop $2
508Pop $1
509Pop $0
510
511; Delete files in Documents and Settings\All Users\SecondLife
512Push $0
513 ReadRegStr $0 HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" "Common AppData"
514 StrCmp $0 "" +2
515 RMDir /r "$0\SecondLife"
516Pop $0
517
518; Delete filse in C:\Windows\Application Data\SecondLife
519; If the user is running on a pre-NT system, Application Data lives here instead of
520; in Documents and Settings.
521RMDir /r "$WINDIR\Application Data\SecondLife"
522
523FunctionEnd
524
525;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
526; Close the program, if running. Modifies no variables.
527; Allows user to bail out of uninstall process.
528;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
529Function un.CloseSecondLife
530 Push $0
531 FindWindow $0 "Second Life" ""
532 IntCmp $0 0 DONE
533 MessageBox MB_OKCANCEL "Second Life can't be uninstalled while it is already running.$\n$\nFinish what you're doing then select OK to close Second Life and continue.$\nSelect CANCEL to cancel installation." IDOK CLOSE IDCANCEL CANCEL_UNINSTALL
534
535 CANCEL_UNINSTALL:
536 Quit
537
538 CLOSE:
539 DetailPrint "Waiting for Second Life to shut down..."
540 SendMessage $0 16 0 0
541
542 LOOP:
543 FindWindow $0 "Second Life" ""
544 IntCmp $0 0 DONE
545 Sleep 500
546 Goto LOOP
547
548 DONE:
549 Pop $0
550 Return
551FunctionEnd
552
553;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
554;;; Delete the installed files
555;;; This deletes the uninstall executable, but it works
556;;; because it is copied to temp directory before running
557;;;
558;;; Note: You must list all files here, because we only
559;;; want to delete our files, not things users left in the
560;;; application directories.
561;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
562Function un.ProgramFiles
563
564;; Remove mozilla file first so recursive directory deletion doesn't get hung up
565Delete "$INSTDIR\app_settings\mozilla\components"
566
567;; This placeholder is replaced by the complete list of files to uninstall by viewer_manifest.py
568%%DELETE_FILES%%
569
570;; Optional/obsolete files. Delete won't fail if they don't exist.
571Delete "$INSTDIR\dronesettings.ini"
572Delete "$INSTDIR\message_template.msg"
573Delete "$INSTDIR\newview.pdb"
574Delete "$INSTDIR\newview.map"
575Delete "$INSTDIR\SecondLife.pdb"
576Delete "$INSTDIR\SecondLife.map"
577Delete "$INSTDIR\comm.dat"
578Delete "$INSTDIR\*.glsl"
579Delete "$INSTDIR\motions\*.lla"
580Delete "$INSTDIR\trial\*.html"
581Delete "$INSTDIR\newview.exe"
582;; Remove entire help directory
583Delete "$INSTDIR\help\Advanced\*"
584RMDir "$INSTDIR\help\Advanced"
585Delete "$INSTDIR\help\basics\*"
586RMDir "$INSTDIR\help\basics"
587Delete "$INSTDIR\help\Concepts\*"
588RMDir "$INSTDIR\help\Concepts"
589Delete "$INSTDIR\help\welcome\*"
590RMDir "$INSTDIR\help\welcome"
591Delete "$INSTDIR\help\*"
592RMDir "$INSTDIR\help"
593
594Delete "$INSTDIR\uninst.exe"
595RMDir "$INSTDIR"
596
597IfFileExists "$INSTDIR" FOLDERFOUND NOFOLDER
598
599FOLDERFOUND:
600 MessageBox MB_YESNO "There are still files in your SecondLife program directory.$\n$\nThese are possibly files you created or moved to:$\n$INSTDIR$\n$\nDo you want to remove them?" IDNO NOFOLDER
601 RMDir /r "$INSTDIR"
602
603NOFOLDER:
604
605FunctionEnd
606
607;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
608;;; Uninstall settings
609;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
610UninstallText "This will uninstall Second Life ${VERSION_LONG} from your system."
611ShowUninstDetails show
612
613;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
614;;; Uninstall section
615;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
616Section Uninstall
617
618; Start with some default values.
619StrCpy $INSTFLAGS "${INSTFLAGS}"
620StrCpy $INSTPROG "${INSTNAME}"
621StrCpy $INSTEXE "${INSTEXE}"
622StrCpy $INSTSHORTCUT "${SHORTCUT}"
623Call un.CheckStartupParams ; Figure out where, what and how to uninstall.
624Call un.CheckIfAdministrator ; Make sure the user can install/uninstall
625
626; uninstall for all users (if you change this, change it in the install as well)
627SetShellVarContext all
628
629; Make sure we're not running
630Call un.CloseSecondLife
631
632; Clean up registry keys
633DeleteRegKey HKEY_LOCAL_MACHINE "SOFTWARE\Linden Research, Inc.\$INSTPROG"
634DeleteRegKey HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$INSTPROG"
635
636; Clean up shortcuts
637Delete "$SMPROGRAMS\$INSTSHORTCUT\*.*"
638RMDir "$SMPROGRAMS\$INSTSHORTCUT"
639
640Delete "$DESKTOP\$INSTSHORTCUT.lnk"
641Delete "$INSTDIR\$INSTSHORTCUT.lnk"
642Delete "$INSTDIR\Uninstall $INSTSHORTCUT.lnk"
643
644; Clean up cache and log files.
645; Leave them in-place for non AGNI installs.
646
647!ifdef UNINSTALL_SETTINGS
648Call un.DocumentsAndSettingsFolder
649!endif
650
651Call un.ProgramFiles
652
653SectionEnd ; end of uninstall section
654
655;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
656; (From the NSIS wiki, DK)
657; GetParameterValue
658;
659; Usage:
660; !insertmacro GetParameterValue "/L=" "1033"
661; pop $R0
662;
663; Returns on top of stack
664;
665; Example command lines:
666; foo.exe /S /L=1033 /D=C:\Program Files\Foo
667; or:
668; foo.exe /S "/L=1033" /D="C:\Program Files\Foo"
669; gpv "/L=" "1033"
670;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
671
672 !macro GetParameterValue SWITCH DEFAULT
673 Push $0
674 Push $1
675 Push $2
676 Push $3
677 Push $4
678
679 ;$CMDLINE='"My Setup\Setup.exe" /L=1033 /S'
680 Push "$CMDLINE"
681 Push '${SWITCH}"'
682 !insertmacro StrStr
683 Pop $0
684 StrCmp "$0" "" gpv_notquoted
685 ;$0='/L="1033" /S'
686 StrLen $2 "$0"
687 Strlen $1 "${SWITCH}"
688 IntOp $1 $1 + 1
689 StrCpy $0 "$0" $2 $1
690 ;$0='1033" /S'
691 Push "$0"
692 Push '"'
693 !insertmacro StrStr
694 Pop $1
695 StrLen $2 "$0"
696 StrLen $3 "$1"
697 IntOp $4 $2 - $3
698 StrCpy $0 $0 $4 0
699 Goto gpv_done
700
701 gpv_notquoted:
702 Push "$CMDLINE"
703 Push "${SWITCH}"
704 !insertmacro StrStr
705 Pop $0
706 StrCmp "$0" "" gpv_done
707 ;$0='/L="1033" /S'
708 StrLen $2 "$0"
709 Strlen $1 "${SWITCH}"
710 StrCpy $0 "$0" $2 $1
711 ;$0=1033 /S'
712 Push "$0"
713 Push ' '
714 !insertmacro StrStr
715 Pop $1
716 StrLen $2 "$0"
717 StrLen $3 "$1"
718 IntOp $4 $2 - $3
719 StrCpy $0 $0 $4 0
720 Goto gpv_done
721
722 gpv_done:
723 StrCmp "$0" "" 0 +2
724 StrCpy $0 "${DEFAULT}"
725
726 Pop $4
727 Pop $3
728 Pop $2
729 Pop $1
730 Exch $0
731 !macroend
732
733; And I had to modify StrStr a tiny bit.
734; Possible upgrade switch the goto's to use ${__LINE__}
735
736!macro STRSTR
737 Exch $R1 ; st=haystack,old$R1, $R1=needle
738 Exch ; st=old$R1,haystack
739 Exch $R2 ; st=old$R1,old$R2, $R2=haystack
740 Push $R3
741 Push $R4
742 Push $R5
743 StrLen $R3 $R1
744 StrCpy $R4 0
745 ; $R1=needle
746 ; $R2=haystack
747 ; $R3=len(needle)
748 ; $R4=cnt
749 ; $R5=tmp
750 ; loop;
751 StrCpy $R5 $R2 $R3 $R4
752 StrCmp $R5 $R1 +4
753 StrCmp $R5 "" +3
754 IntOp $R4 $R4 + 1
755 Goto -4
756 ; done;
757 StrCpy $R1 $R2 "" $R4
758 Pop $R5
759 Pop $R4
760 Pop $R3
761 Pop $R2
762 Exch $R1
763!macroend
764
765Function GetProgramName
766 !insertmacro GetParameterValue "/P=" "SecondLife"
767FunctionEnd
768
769Function un.GetProgramName
770 !insertmacro GetParameterValue "/P=" "SecondLife"
771FunctionEnd
772
773;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
774; (From the NSIS documentation, JC)
775; GetWindowsVersion
776;
777; Based on Yazno's function, http://yazno.tripod.com/powerpimpit/
778; Updated by Joost Verburg
779;
780; Returns on top of stack
781;
782; Windows Version (95, 98, ME, NT x.x, 2000, XP, 2003)
783; or
784; '' (Unknown Windows Version)
785;
786; Usage:
787; Call GetWindowsVersion
788; Pop $R0
789; ; at this point $R0 is "NT 4.0" or whatnot
790;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
791
792Function GetWindowsVersion
793
794 Push $R0
795 Push $R1
796
797 ReadRegStr $R0 HKLM \
798 "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion
799
800 IfErrors 0 lbl_winnt
801
802 ; we are not NT
803 ReadRegStr $R0 HKLM \
804 "SOFTWARE\Microsoft\Windows\CurrentVersion" VersionNumber
805
806 StrCpy $R1 $R0 1
807 StrCmp $R1 '4' 0 lbl_error
808
809 StrCpy $R1 $R0 3
810
811 StrCmp $R1 '4.0' lbl_win32_95
812 StrCmp $R1 '4.9' lbl_win32_ME lbl_win32_98
813
814 lbl_win32_95:
815 StrCpy $R0 '95'
816 Goto lbl_done
817
818 lbl_win32_98:
819 StrCpy $R0 '98'
820 Goto lbl_done
821
822 lbl_win32_ME:
823 StrCpy $R0 'ME'
824 Goto lbl_done
825
826 lbl_winnt:
827
828 StrCpy $R1 $R0 1
829
830 StrCmp $R1 '3' lbl_winnt_x
831 StrCmp $R1 '4' lbl_winnt_x
832
833 StrCpy $R1 $R0 3
834
835 StrCmp $R1 '5.0' lbl_winnt_2000
836 StrCmp $R1 '5.1' lbl_winnt_XP
837 StrCmp $R1 '5.2' lbl_winnt_2003 lbl_error
838
839 lbl_winnt_x:
840 StrCpy $R0 "NT $R0" 6
841 Goto lbl_done
842
843 lbl_winnt_2000:
844 Strcpy $R0 '2000'
845 Goto lbl_done
846
847 lbl_winnt_XP:
848 Strcpy $R0 'XP'
849 Goto lbl_done
850
851 lbl_winnt_2003:
852 Strcpy $R0 '2003'
853 Goto lbl_done
854
855 lbl_error:
856 Strcpy $R0 ''
857 lbl_done:
858
859 Pop $R1
860 Exch $R0
861
862FunctionEnd
diff --git a/linden/indra/newview/licenses-linux.txt b/linden/indra/newview/licenses-linux.txt
index f7ccf27..20b76c8 100644
--- a/linden/indra/newview/licenses-linux.txt
+++ b/linden/indra/newview/licenses-linux.txt
@@ -16,6 +16,38 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16See the License for the specific language governing permissions and 16See the License for the specific language governing permissions and
17limitations under the License. 17limitations under the License.
18 18
19==============
20Base32 License
21==============
22
23 * Copyright (c) 2006 Christian Biere <christianbiere@gmx.de>
24 * All rights reserved.
25 *
26 * Redistribution and use in source and binary forms, with or without
27 * modification, are permitted provided that the following conditions
28 * are met:
29 *
30 * 1. Redistributions of source code must retain the above copyright
31 * notice, this list of conditions and the following disclaimer.
32 * 2. Redistributions in binary form must reproduce the above copyright
33 * notice, this list of conditions and the following disclaimer in the
34 * documentation and/or other materials provided with the distribution.
35 * 3. Neither the name of the authors nor the names of its contributors
36 * may be used to endorse or promote products derived from this software
37 * without specific prior written permission.
38 *
39 * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
40 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
41 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
42 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
43 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
44 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
45 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
46 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
47 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
48 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
49 * SUCH DAMAGE.
50
19========== 51==========
20Cg License 52Cg License
21========== 53==========
@@ -404,6 +436,39 @@ Subject to the following 3 conditions, Epinions, Inc. permits you, free of charg
4043) IN NO EVENT SHALL EPINIONS, INC. BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES OR LOST PROFITS ARISING OUT OF OR IN CONNECTION WITH THE SOFTWARE (HOWEVER ARISING, INCLUDING NEGLIGENCE), EVEN IF EPINIONS, INC. IS AWARE OF THE POSSIBILITY OF SUCH DAMAGES. 4363) IN NO EVENT SHALL EPINIONS, INC. BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES OR LOST PROFITS ARISING OUT OF OR IN CONNECTION WITH THE SOFTWARE (HOWEVER ARISING, INCLUDING NEGLIGENCE), EVEN IF EPINIONS, INC. IS AWARE OF THE POSSIBILITY OF SUCH DAMAGES.
405 437
406 438
439===============
440libuuid License
441===============
442
443Copyright (C) 1999, 2000, 2003, 2004 by Theodore Ts'o
444
445Redistribution and use in source and binary forms, with or without
446modification, are permitted provided that the following conditions
447are met:
4481. Redistributions of source code must retain the above copyright
449 notice, and the entire permission notice in its entirety,
450 including the disclaimer of warranties.
4512. Redistributions in binary form must reproduce the above copyright
452 notice, this list of conditions and the following disclaimer in the
453 documentation and/or other materials provided with the distribution.
4543. The name of the author may not be used to endorse or promote
455 products derived from this software without specific prior
456 written permission.
457
458THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
459WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
460OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ALL OF
461WHICH ARE HEREBY DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE
462LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
463CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
464OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
465BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
466LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
467(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
468USE OF THIS SOFTWARE, EVEN IF NOT ADVISED OF THE POSSIBILITY OF SUCH
469DAMAGE.
470
471
407============ 472============
408zlib License 473zlib License
409============ 474============
diff --git a/linden/indra/newview/licenses-mac.txt b/linden/indra/newview/licenses-mac.txt
index f761ed6..77541ba 100644
--- a/linden/indra/newview/licenses-mac.txt
+++ b/linden/indra/newview/licenses-mac.txt
@@ -16,6 +16,38 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16See the License for the specific language governing permissions and 16See the License for the specific language governing permissions and
17limitations under the License. 17limitations under the License.
18 18
19==============
20Base32 License
21==============
22
23 * Copyright (c) 2006 Christian Biere <christianbiere@gmx.de>
24 * All rights reserved.
25 *
26 * Redistribution and use in source and binary forms, with or without
27 * modification, are permitted provided that the following conditions
28 * are met:
29 *
30 * 1. Redistributions of source code must retain the above copyright
31 * notice, this list of conditions and the following disclaimer.
32 * 2. Redistributions in binary form must reproduce the above copyright
33 * notice, this list of conditions and the following disclaimer in the
34 * documentation and/or other materials provided with the distribution.
35 * 3. Neither the name of the authors nor the names of its contributors
36 * may be used to endorse or promote products derived from this software
37 * without specific prior written permission.
38 *
39 * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
40 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
41 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
42 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
43 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
44 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
45 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
46 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
47 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
48 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
49 * SUCH DAMAGE.
50
19========== 51==========
20Cg License 52Cg License
21========== 53==========
diff --git a/linden/indra/newview/licenses-win32.txt b/linden/indra/newview/licenses-win32.txt
index f761ed6..77541ba 100644
--- a/linden/indra/newview/licenses-win32.txt
+++ b/linden/indra/newview/licenses-win32.txt
@@ -16,6 +16,38 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16See the License for the specific language governing permissions and 16See the License for the specific language governing permissions and
17limitations under the License. 17limitations under the License.
18 18
19==============
20Base32 License
21==============
22
23 * Copyright (c) 2006 Christian Biere <christianbiere@gmx.de>
24 * All rights reserved.
25 *
26 * Redistribution and use in source and binary forms, with or without
27 * modification, are permitted provided that the following conditions
28 * are met:
29 *
30 * 1. Redistributions of source code must retain the above copyright
31 * notice, this list of conditions and the following disclaimer.
32 * 2. Redistributions in binary form must reproduce the above copyright
33 * notice, this list of conditions and the following disclaimer in the
34 * documentation and/or other materials provided with the distribution.
35 * 3. Neither the name of the authors nor the names of its contributors
36 * may be used to endorse or promote products derived from this software
37 * without specific prior written permission.
38 *
39 * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
40 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
41 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
42 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
43 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
44 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
45 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
46 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
47 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
48 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
49 * SUCH DAMAGE.
50
19========== 51==========
20Cg License 52Cg License
21========== 53==========
diff --git a/linden/indra/newview/linux_tools/client-manifest-i686 b/linden/indra/newview/linux_tools/client-manifest-i686
deleted file mode 100644
index 04ab1f6..0000000
--- a/linden/indra/newview/linux_tools/client-manifest-i686
+++ /dev/null
@@ -1,48 +0,0 @@
1# This file defines which files to include in the linux tarball.
2# Each line is a comma-separated definition of source,destination
3# pairs. The packaging script will read all source files
4# from indra/newview/<source>, and place them in the package
5# located at <Package_dir>/<dest>.
6#
7# If no comma is used, the destination name is assumed to be
8# the same as the source name.
9#
10# A 'file' ending with a '/' defines an empty directory to create.
11# A '*' wildcard in the source will recursively copy everything
12# in that directory (except CVS directories)
13
14featuretable.txt
15licenses-linux.txt,licenses.txt
16releasenotes.txt
17lsl_guide.html
18gpu_table.txt
19res/ll_icon.ico,secondlife.ico
20linux_tools/client-readme.txt,README-linux.txt
21linux_tools/wrapper.sh,secondlife
22secondlife-i686-bin-stripped,bin/do-not-directly-run-secondlife-bin
23#../../libraries/i686-linux/lib_release_client/libllkdu.so,bin/libllkdu.so
24#../linux_crash_logger/linux-crash-logger-i686-bin-stripped,linux-crash-logger.bin
25linux_tools/unicode.ttf,unicode.ttf
26linux_tools/launch_url.sh,launch_url.sh
27app_settings/*
28character/*
29fonts/*
30help/*
31skins/*
32res-sdl/*
33../../scripts/messages/message_template.msg,app_settings/message_template.msg
34#../../libraries/i686-linux/lib_release_client/libkdu_v42R.so,lib/libkdu_v42R.so
35../../libraries/i686-linux/lib_release_client/libfmod-3.75.so,lib/libfmod-3.75.so
36../../libraries/i686-linux/lib_release_client/libapr-1.so.0,lib/libapr-1.so.0
37../../libraries/i686-linux/lib_release_client/libaprutil-1.so.0,lib/libaprutil-1.so.0
38../../libraries/i686-linux/lib_release_client/libdb-4.2.so,lib/libdb-4.2.so
39../../libraries/i686-linux/lib_release_client/libogg.so.0,lib/libogg.so.0
40../../libraries/i686-linux/lib_release_client/libvorbis.so.0,lib/libvorbis.so.0
41../../libraries/i686-linux/lib_release_client/libvorbisfile.so.0,lib/libvorbisfile.so.0
42../../libraries/i686-linux/lib_release_client/libvorbisenc.so.0,lib/libvorbisenc.so.0
43../../libraries/i686-linux/lib_release_client/libcurl.so.3,lib/libcurl.so.3
44../../libraries/i686-linux/lib_release_client/libcrypto.so.0.9.7,lib/libcrypto.so.0.9.7
45../../libraries/i686-linux/lib_release_client/libssl.so.0.9.7,lib/libssl.so.0.9.7
46../../libraries/i686-linux/lib_release_client/libexpat.so.1,lib/libexpat.so.1
47#../../libraries/i686-linux/lib_release_client/libstdc++.so.6,lib/libstdc++.so.6
48../../libraries/i686-linux/lib_release_client/libelfio.so,lib/libelfio.so
diff --git a/linden/indra/newview/linux_tools/client-readme.txt b/linden/indra/newview/linux_tools/client-readme.txt
index 4748eaf..7c972bb 100644
--- a/linden/indra/newview/linux_tools/client-readme.txt
+++ b/linden/indra/newview/linux_tools/client-readme.txt
@@ -71,29 +71,31 @@ you wish.
714. KNOWN ISSUES 714. KNOWN ISSUES
72-=-=-=-=-=-=-=- 72-=-=-=-=-=-=-=-
73 73
74The following user-visible features are currently not fully implemented on 74These are the most commonly-encountered known issues which are specific to
75the Linux client and are therefore known not to work properly: 75the Alpha release of the Linux client.
76
77* VISUAL EFFECTS AND PERFORMANCE - many Linux graphics drivers are not as
78 robust as their counterparts for other operating systems, so some advanced
79 Second Life graphical features have been DISABLED by default to aid
80 stability. See PROBLEM 3 in the TROUBLESHOOTING section if you wish to
81 turn these on to possibly enhance your experience.
82
83* MISC - The following user-visible features are not currently fully
84 implemented on the Linux client and are therefore known not to work properly
85 at this time:
76 * QuickTime movie playback and movie recording 86 * QuickTime movie playback and movie recording
77 * F1 Help
78 * Embedded Web Profiles and HTML Login Screen
79 * Video memory detection 87 * Video memory detection
80 * Full Unicode font rendering 88 * Full Unicode font rendering
81 * Auto-updater 89 * Auto-updater
82 90
91* UPLOAD / SAVE / COLOR-PICKER DIALOGS - These only appear when the client
92 is in 'windowed' mode, not 'fullscreen' mode.
93
83* UPDATING - when the client detects that a new version of Second Life 94* UPDATING - when the client detects that a new version of Second Life
84 is available, it will ask you if you wish to download the new version. 95 is available, it will ask you if you wish to download the new version.
85 This option is not implemented; to upgrade, you should manually download a 96 This option is not implemented; to upgrade, you should manually download a
86 new version from the Second Life web site, <http://www.secondlife.com/>. 97 new version from the Second Life web site, <http://www.secondlife.com/>.
87 98
88* UPLOAD / SAVE / COLOR-PICKER DIALOGS - These only function when the client
89 is in 'windowed' mode, not 'fullscreen' mode.
90
91* GRAPHICAL SPEED/QUALITY - as many Linux graphics drivers are not as robust
92 as their counterparts for some other operating systems, advanced Second Life
93 graphical features have been disabled to aid stability. See PROBLEM 3 in the
94 TROUBLESHOOTING section if you wish to turn these on to enhance your
95 experience.
96
97 99
985. TROUBLESHOOTING 1005. TROUBLESHOOTING
99-=-=-=-=-=-=-=-=-= 101-=-=-=-=-=-=-=-=-=
@@ -132,8 +134,8 @@ SOLUTION:- As a last resort, you can disable most of Second Life's advanced
132 from the line which reads '#export LL_GL_NOEXT=x' 134 from the line which reads '#export LL_GL_NOEXT=x'
133 135
134PROBLEM 3:- Performance or graphical quality are not as high as I expect. 136PROBLEM 3:- Performance or graphical quality are not as high as I expect.
137PROBLEM:- 'SHINY' doesn't work.
135PROBLEM:- I can't turn on Anisotropic Filtering, Ripple Water, or AGP. 138PROBLEM:- I can't turn on Anisotropic Filtering, Ripple Water, or AGP.
136PROBLEM:- 'Shiny' doesn't work.
137SOLUTION:- Some graphics performance features in Second Life are disabled 139SOLUTION:- Some graphics performance features in Second Life are disabled
138 by default for the Linux version due to stability issues with some common 140 by default for the Linux version due to stability issues with some common
139 Linux graphic drivers. You can re-enable these features at the slight 141 Linux graphic drivers. You can re-enable these features at the slight
diff --git a/linden/indra/newview/linux_tools/package-client.sh b/linden/indra/newview/linux_tools/package-client.sh
deleted file mode 100755
index b054386..0000000
--- a/linden/indra/newview/linux_tools/package-client.sh
+++ /dev/null
@@ -1,133 +0,0 @@
1#!/bin/sh
2MANIFEST=$1
3PACKAGE_NAME=$2
4GRID=$3
5
6# Check that the entire client manifest is there.
7cd newview
8echo Checking manifest...
9
10# Strip out comment lines and empty lines
11# Replace anything with a source,dest pairs with just source filename
12if ! ls -d `cat "$MANIFEST" | \
13 grep -v ^# | grep -v ^$ | \
14 sed 's/,.*//'` 1>/dev/null
15then
16 echo Client manifest defined in newview/$MANIFEST is not complete.
17 exit 1
18fi
19echo "Done."
20
21# See if the package already exists.
22BUILD_PACKAGE=YES
23if [ -a $PACKAGE_NAME ]
24then
25 echo The directory "newview/$PACKAGE_NAME" already exists.
26 echo Checking for complete client manifest...
27
28 cd $PACKAGE_NAME
29
30 # Strip out comment lines and empty lines
31 # Replace source,dest pairs with just dest filename
32 if ls -d `cat "../$MANIFEST" | \
33 grep -v ^# | grep -v ^$ | \
34 sed 's/.*,\(.*\)/\1/'` 1>/dev/null
35 then
36 echo "Done."
37 echo Package at "newview/$PACKAGE_NAME" looks complete.
38 cd ..
39 BUILD_PACKAGE=NO
40 else
41 echo Incomplete package at "newview/$PACKAGE_NAME"!
42 echo Removing corrupt package...
43 cd ..
44 rm -rf $PACKAGE_NAME
45 echo Done.
46 fi
47fi
48
49echo Building newview/$PACKAGE_NAME directory...
50## First read all directories mentioned in the manifest, and create a package skeleton.
51
52# Strip out comment lines and empty lines
53# Replace source,dest pairs with just dest filename
54# Strip out and line that does not include a directory in its path (ie contains a '/')
55# Extract everything up to the last '/' and prefix with $PACKAGE_NAME
56# Print out just the unique directores, and make them.
57mkdir -p `cat $MANIFEST | \
58 grep -v ^# | \
59 grep -v ^$ | \
60 sed 's/.*,\(.*\)/\1/' | \
61 grep \/ | \
62 sed "s/\(^.*\)\/[^\/]*/$PACKAGE_NAME\/\1/" | \
63 sort | uniq`
64
65## Copy the manifest.
66
67# Strip out comment lines and empty lines
68# Strip out empty directories
69# Replace any line without a ',' with 'line,line'
70for pair in `cat $MANIFEST | \
71 grep -v ^# | \
72 grep -v ^$ | \
73 grep -v \/$ | \
74 sed 's/\(^[^,]*$\)/\1,\1/' `
75do
76 # $pair is 'source,dest' ... split it up
77 SOURCE=`echo "$pair" | awk -F, '{ print $1; }'`
78 DEST=`echo "$pair" | awk -F, '{ print $2; }'`
79 # If this is a wildcard copy (pair contains a '*'), then remove the wildcard from $DEST
80 # and make the copy recursive
81 RECURSE=""
82 if [ ! x == x`echo "$SOURCE" | grep \*$` ]
83 then
84 DEST=`echo "$DEST" | sed 's/\*$//'`
85 RECURSE="-R"
86 fi
87 # The -a makes us copy links as links, plus timestamps etc.
88 cp -a $RECURSE $SOURCE "$PACKAGE_NAME/$DEST"
89done
90
91echo Done.
92
93## Clean up any CVS directories that might have been recursively included.
94echo Pruning CVS directories from newview/$PACKAGE_NAME directory...
95find $PACKAGE_NAME -type d -name CVS -exec rm -rf {} \; 2>/dev/null
96echo "Done removing CVS directories."
97
98## Clean up any SVN directories that might have been recursively included.
99echo Pruning .svn directories from newview/$PACKAGE_NAME directory...
100find $PACKAGE_NAME -type d -name \.svn -exec rm -rf {} \; 2>/dev/null
101echo "Done removing .svn directories."
102
103# Create an appropriate gridargs.dat for this package, denoting required grid.
104if [ X$GRID == X'default' ]
105then
106 echo 'Default grid - creating empty gridargs.dat'
107 echo " " > $PACKAGE_NAME/gridargs.dat
108else
109 if [ X$GRID == X'firstlook' ]
110 then
111 # firstlook is a special case... it's not really a grid.
112 echo "Creating gridargs.dat for firstlook"
113 echo "-settings settings_firstlook.xml" > $PACKAGE_NAME/gridargs.dat
114 else
115 echo "Creating gridargs.dat for package, grid $GRID"
116 echo "-settings settings_beta.xml --${GRID} -helperuri http://preview-${GRID}.secondlife.com/helpers/" > $PACKAGE_NAME/gridargs.dat
117 fi
118fi
119
120TARBALL=$PACKAGE_NAME.tar.bz2
121
122# See if the tarball already exists.
123if [ -a $TARBALL ]
124then
125 echo Tarball "newview/$TARBALL" already exists. Skipping tarball creation.
126 exit 0
127fi
128
129echo Creating tarball "newview/$TARBALL"...
130# --numeric-owner hides the username of the builder for security etc.
131tar --numeric-owner -cjf $TARBALL $PACKAGE_NAME
132echo Done.
133
diff --git a/linden/indra/newview/linux_tools/wrapper.sh b/linden/indra/newview/linux_tools/wrapper.sh
index 222ce98..cdc36a8 100755
--- a/linden/indra/newview/linux_tools/wrapper.sh
+++ b/linden/indra/newview/linux_tools/wrapper.sh
@@ -13,8 +13,9 @@
13#export LL_BAD_ALSA=x 13#export LL_BAD_ALSA=x
14 14
15## - Avoids the optional OpenGL extensions which have proven most problematic 15## - Avoids the optional OpenGL extensions which have proven most problematic
16## on some hardware. Disabling this option may cause crashes and hangs on 16## on some hardware. Disabling this option may cause BETTER PERFORMANCE but
17## some unstable combinations of drivers and hardware. 17## may also cause CRASHES and hangs on some unstable combinations of drivers
18## and hardware.
18export LL_GL_BASICEXT=x 19export LL_GL_BASICEXT=x
19 20
20## - Avoids *all* optional OpenGL extensions. This is the safest and least- 21## - Avoids *all* optional OpenGL extensions. This is the safest and least-
@@ -38,7 +39,7 @@ export SDL_VIDEO_X11_DGAMOUSE=0
38 39
39RUN_PATH=`dirname "$0" || echo .` 40RUN_PATH=`dirname "$0" || echo .`
40cd "${RUN_PATH}" 41cd "${RUN_PATH}"
41LD_LIBRARY_PATH="`pwd`"/lib:"${LD_LIBRARY_PATH}" bin/do-not-directly-run-secondlife-bin `cat gridargs.dat` $@ | cat 42LD_LIBRARY_PATH="`pwd`"/lib:"`pwd`"/app_settings/mozilla-runtime-linux-i686:"${LD_LIBRARY_PATH}" bin/do-not-directly-run-secondlife-bin `cat gridargs.dat` $@ | cat
42 43
43echo 44echo
44echo '*********************************************************' 45echo '*********************************************************'
diff --git a/linden/indra/newview/llagent.cpp b/linden/indra/newview/llagent.cpp
index 6d9137d..a6ec948 100644
--- a/linden/indra/newview/llagent.cpp
+++ b/linden/indra/newview/llagent.cpp
@@ -122,7 +122,6 @@
122// end Ventrella 122// end Ventrella
123 123
124extern LLMenuBarGL* gMenuBarView; 124extern LLMenuBarGL* gMenuBarView;
125extern F32 gMinObjectDistance;
126extern U8 gLastPickAlpha; 125extern U8 gLastPickAlpha;
127extern F32 gFrameDTClamped; 126extern F32 gFrameDTClamped;
128 127
@@ -481,17 +480,20 @@ void LLAgent::resetView(BOOL reset_camera)
481 480
482 if (!gNoRender) 481 if (!gNoRender)
483 { 482 {
484 gSelectMgr->deselectAll();
485 gSelectMgr->unhighlightAll(); 483 gSelectMgr->unhighlightAll();
486 484
487 // By popular request, keep land selection while walking around. JC 485 // By popular request, keep land selection while walking around. JC
488 // gParcelMgr->deselectLand(); 486 // gParcelMgr->deselectLand();
489 487
488 // force deselect when walking and attachment is selected
489 // this is so people don't wig out when their avatar moves without animating
490 if (gSelectMgr->getSelection()->isAttachment())
491 {
492 gSelectMgr->deselectAll();
493 }
494
490 // Hide all popup menus 495 // Hide all popup menus
491 gPieSelf->hide(FALSE); 496 gMenuHolder->hideMenus();
492 gPieAvatar->hide(FALSE);
493 gPieObject->hide(FALSE);
494 gPieLand->hide(FALSE);
495 } 497 }
496 498
497 if (reset_camera && !gSavedSettings.getBOOL("FreezeTime")) 499 if (reset_camera && !gSavedSettings.getBOOL("FreezeTime"))
@@ -787,7 +789,7 @@ void LLAgent::setRegion(LLViewerRegion *regionp)
787 // char host_name[MAX_STRING]; 789 // char host_name[MAX_STRING];
788 // regionp->getHost().getHostName(host_name, MAX_STRING); 790 // regionp->getHost().getHostName(host_name, MAX_STRING);
789 791
790 char ip[MAX_STRING]; 792 char ip[MAX_STRING]; /*Flawfinder: ignore*/
791 regionp->getHost().getString(ip, MAX_STRING); 793 regionp->getHost().getString(ip, MAX_STRING);
792 llinfos << "Moving agent into region: " << regionp->getName() 794 llinfos << "Moving agent into region: " << regionp->getName()
793 << " located at " << ip << llendl; 795 << " located at " << ip << llendl;
@@ -850,6 +852,8 @@ void LLAgent::setRegion(LLViewerRegion *regionp)
850 // we could trake this at the dataserver side, but that's harder 852 // we could trake this at the dataserver side, but that's harder
851 U64 handle = regionp->getHandle(); 853 U64 handle = regionp->getHandle();
852 mRegionsVisited.insert(handle); 854 mRegionsVisited.insert(handle);
855
856 gSelectMgr->updateSelectionCenter();
853} 857}
854 858
855 859
@@ -1584,7 +1588,8 @@ F32 LLAgent::getCameraZoomFraction()
1584{ 1588{
1585 // 0.f -> camera zoomed all the way out 1589 // 0.f -> camera zoomed all the way out
1586 // 1.f -> camera zoomed all the way in 1590 // 1.f -> camera zoomed all the way in
1587 if (gSelectMgr->getObjectCount() && gSelectMgr->getSelectType() == SELECT_TYPE_HUD) 1591 LLObjectSelectionHandle selection = gSelectMgr->getSelection();
1592 if (selection->getObjectCount() && selection->getSelectType() == SELECT_TYPE_HUD)
1588 { 1593 {
1589 // already [0,1] 1594 // already [0,1]
1590 return mAvatarObject->mHUDTargetZoom; 1595 return mAvatarObject->mHUDTargetZoom;
@@ -1631,7 +1636,9 @@ void LLAgent::setCameraZoomFraction(F32 fraction)
1631{ 1636{
1632 // 0.f -> camera zoomed all the way out 1637 // 0.f -> camera zoomed all the way out
1633 // 1.f -> camera zoomed all the way in 1638 // 1.f -> camera zoomed all the way in
1634 if (gSelectMgr->getObjectCount() && gSelectMgr->getSelectType() == SELECT_TYPE_HUD) 1639 LLObjectSelectionHandle selection = gSelectMgr->getSelection();
1640
1641 if (selection->getObjectCount() && selection->getSelectType() == SELECT_TYPE_HUD)
1635 { 1642 {
1636 mAvatarObject->mHUDTargetZoom = fraction; 1643 mAvatarObject->mHUDTargetZoom = fraction;
1637 } 1644 }
@@ -1681,7 +1688,8 @@ void LLAgent::setCameraZoomFraction(F32 fraction)
1681//----------------------------------------------------------------------------- 1688//-----------------------------------------------------------------------------
1682void LLAgent::cameraOrbitAround(const F32 radians) 1689void LLAgent::cameraOrbitAround(const F32 radians)
1683{ 1690{
1684 if (gSelectMgr->getObjectCount() && gSelectMgr->getSelectType() == SELECT_TYPE_HUD) 1691 LLObjectSelectionHandle selection = gSelectMgr->getSelection();
1692 if (selection->getObjectCount() && selection->getSelectType() == SELECT_TYPE_HUD)
1685 { 1693 {
1686 // do nothing for hud selection 1694 // do nothing for hud selection
1687 } 1695 }
@@ -1703,7 +1711,8 @@ void LLAgent::cameraOrbitAround(const F32 radians)
1703//----------------------------------------------------------------------------- 1711//-----------------------------------------------------------------------------
1704void LLAgent::cameraOrbitOver(const F32 angle) 1712void LLAgent::cameraOrbitOver(const F32 angle)
1705{ 1713{
1706 if (gSelectMgr->getObjectCount() && gSelectMgr->getSelectType() == SELECT_TYPE_HUD) 1714 LLObjectSelectionHandle selection = gSelectMgr->getSelection();
1715 if (selection->getObjectCount() && selection->getSelectType() == SELECT_TYPE_HUD)
1707 { 1716 {
1708 // do nothing for hud selection 1717 // do nothing for hud selection
1709 } 1718 }
@@ -1737,7 +1746,8 @@ void LLAgent::cameraZoomIn(const F32 fraction)
1737 return; 1746 return;
1738 } 1747 }
1739 1748
1740 if (gSelectMgr->getObjectCount() && gSelectMgr->getSelectType() == SELECT_TYPE_HUD) 1749 LLObjectSelectionHandle selection = gSelectMgr->getSelection();
1750 if (selection->getObjectCount() && selection->getSelectType() == SELECT_TYPE_HUD)
1741 { 1751 {
1742 // just update hud zoom level 1752 // just update hud zoom level
1743 mAvatarObject->mHUDTargetZoom /= fraction; 1753 mAvatarObject->mHUDTargetZoom /= fraction;
@@ -2256,11 +2266,9 @@ void LLAgent::stopAutoPilot(BOOL user_cancel)
2256 resetAxes(mAutoPilotTargetFacing); 2266 resetAxes(mAutoPilotTargetFacing);
2257 } 2267 }
2258 //NB: auto pilot can terminate for a reason other than reaching the destination 2268 //NB: auto pilot can terminate for a reason other than reaching the destination
2259 //TODO: enforce rotation constraint here as well 2269 if (mAutoPilotFinishedCallback)
2260 if (mAutoPilotFinishedCallback &&
2261 ((mAutoPilotTargetDist < mAutoPilotStopDistance) || (mAutoPilotNoProgressFrameCount > AUTOPILOT_MAX_TIME_NO_PROGRESS * gFPSClamped)))
2262 { 2270 {
2263 mAutoPilotFinishedCallback(!user_cancel && dist_vec(gAgent.getPositionGlobal(), mAutoPilotTargetGlobal) < mAutoPilotTargetDist, mAutoPilotCallbackData); 2271 mAutoPilotFinishedCallback(!user_cancel && dist_vec(gAgent.getPositionGlobal(), mAutoPilotTargetGlobal) < mAutoPilotStopDistance, mAutoPilotCallbackData);
2264 } 2272 }
2265 mLeaderID = LLUUID::null; 2273 mLeaderID = LLUUID::null;
2266 2274
@@ -2731,8 +2739,8 @@ U8 LLAgent::getRenderState()
2731 stopTyping(); 2739 stopTyping();
2732 } 2740 }
2733 2741
2734 if ((!gSelectMgr->isEmpty() && gSelectMgr->shouldShowSelection()) 2742 if ((!gSelectMgr->getSelection()->isEmpty() && gSelectMgr->shouldShowSelection())
2735 || gToolMgr->getCurrentTool( gKeyboard->currentMask(TRUE) )->isEditing() ) 2743 || gToolMgr->getCurrentTool()->isEditing() )
2736 { 2744 {
2737 setRenderState(AGENT_STATE_EDITING); 2745 setRenderState(AGENT_STATE_EDITING);
2738 } 2746 }
@@ -2774,8 +2782,7 @@ void LLAgent::endAnimationUpdateUI()
2774 gMenuBarView->setVisible(TRUE); 2782 gMenuBarView->setVisible(TRUE);
2775 gStatusBar->setVisibleForMouselook(true); 2783 gStatusBar->setVisibleForMouselook(true);
2776 2784
2777 gCurrentToolset = gBasicToolset; 2785 gToolMgr->setCurrentToolset(gBasicToolset);
2778 gToolMgr->useSelectedTool( gCurrentToolset );
2779 2786
2780 // Only pop if we have pushed... 2787 // Only pop if we have pushed...
2781 if (TRUE == mViewsPushed) 2788 if (TRUE == mViewsPushed)
@@ -2823,8 +2830,7 @@ void LLAgent::endAnimationUpdateUI()
2823 { 2830 {
2824 // make sure we ask to save changes 2831 // make sure we ask to save changes
2825 2832
2826 gCurrentToolset = gBasicToolset; 2833 gToolMgr->setCurrentToolset(gBasicToolset);
2827 gToolMgr->useSelectedTool( gCurrentToolset );
2828 2834
2829 // HACK: If we're quitting, and we were in customize avatar, don't 2835 // HACK: If we're quitting, and we were in customize avatar, don't
2830 // let the mini-map go visible again. JC 2836 // let the mini-map go visible again. JC
@@ -2861,8 +2867,7 @@ void LLAgent::endAnimationUpdateUI()
2861 // JC - Added for always chat in third person option 2867 // JC - Added for always chat in third person option
2862 gFocusMgr.setKeyboardFocus(NULL, NULL); 2868 gFocusMgr.setKeyboardFocus(NULL, NULL);
2863 2869
2864 gCurrentToolset = gMouselookToolset; 2870 gToolMgr->setCurrentToolset(gMouselookToolset);
2865 gToolMgr->useSelectedTool( gMouselookToolset );
2866 2871
2867 mViewsPushed = TRUE; 2872 mViewsPushed = TRUE;
2868 2873
@@ -2920,8 +2925,7 @@ void LLAgent::endAnimationUpdateUI()
2920 } 2925 }
2921 else if (mCameraMode == CAMERA_MODE_CUSTOMIZE_AVATAR) 2926 else if (mCameraMode == CAMERA_MODE_CUSTOMIZE_AVATAR)
2922 { 2927 {
2923 gCurrentToolset = gFaceEditToolset; 2928 gToolMgr->setCurrentToolset(gFaceEditToolset);
2924 gToolMgr->useSelectedTool( gFaceEditToolset );
2925 2929
2926 gFloaterMap->pushVisible(FALSE); 2930 gFloaterMap->pushVisible(FALSE);
2927 /* 2931 /*
@@ -3336,7 +3340,7 @@ void LLAgent::updateCamera()
3336 attachment; 3340 attachment;
3337 attachment = mAvatarObject->mAttachmentPoints.getNextData()) 3341 attachment = mAvatarObject->mAttachmentPoints.getNextData())
3338 { 3342 {
3339 LLViewerObject *attached_object = attachment->getObject(0); 3343 LLViewerObject *attached_object = attachment->getObject();
3340 if (attached_object && !attached_object->isDead() && attached_object->mDrawable.notNull()) 3344 if (attached_object && !attached_object->isDead() && attached_object->mDrawable.notNull())
3341 { 3345 {
3342 // clear any existing "early" movements of attachment 3346 // clear any existing "early" movements of attachment
@@ -3446,21 +3450,26 @@ LLVector3d LLAgent::calcFocusPositionTargetGlobal()
3446 { 3450 {
3447 LLDrawable* drawablep = mFocusObject->mDrawable; 3451 LLDrawable* drawablep = mFocusObject->mDrawable;
3448 3452
3449 if (mTrackFocusObject && drawablep && drawablep->isActive()) 3453 if (mTrackFocusObject &&
3454 drawablep &&
3455 drawablep->isActive())
3450 { 3456 {
3451 if (mFocusObject->isSelected()) 3457 if (!mFocusObject->isAvatar())
3452 { 3458 {
3453 gPipeline.updateMoveNormalAsync(drawablep); 3459 if (mFocusObject->isSelected())
3454 }
3455 else
3456 {
3457 if (drawablep->isState(LLDrawable::MOVE_UNDAMPED))
3458 { 3460 {
3459 gPipeline.updateMoveNormalAsync(drawablep); 3461 gPipeline.updateMoveNormalAsync(drawablep);
3460 } 3462 }
3461 else 3463 else
3462 { 3464 {
3463 gPipeline.updateMoveDampedAsync(drawablep); 3465 if (drawablep->isState(LLDrawable::MOVE_UNDAMPED))
3466 {
3467 gPipeline.updateMoveNormalAsync(drawablep);
3468 }
3469 else
3470 {
3471 gPipeline.updateMoveDampedAsync(drawablep);
3472 }
3464 } 3473 }
3465 } 3474 }
3466 } 3475 }
@@ -3471,11 +3480,6 @@ LLVector3d LLAgent::calcFocusPositionTargetGlobal()
3471 } 3480 }
3472 LLVector3 focus_agent = mFocusObject->getRenderPosition() + mFocusObjectOffset; 3481 LLVector3 focus_agent = mFocusObject->getRenderPosition() + mFocusObjectOffset;
3473 mFocusTargetGlobal.setVec(getPosGlobalFromAgent(focus_agent)); 3482 mFocusTargetGlobal.setVec(getPosGlobalFromAgent(focus_agent));
3474 // *FIX: get camera pointat behavior working
3475 //if (mTrackFocusObject)
3476 //{
3477 // mCameraFocusOffset = gAgent.getPosGlobalFromAgent(gCamera->getOrigin()) - mFocusTargetGlobal;
3478 //}
3479 } 3483 }
3480 return mFocusTargetGlobal; 3484 return mFocusTargetGlobal;
3481 } 3485 }
@@ -3840,8 +3844,6 @@ LLVector3d LLAgent::calcCameraPositionTargetGlobal(BOOL *hit_limit)
3840 if (camera_position_global.mdV[VZ] < camera_land_height + camera_min_off_ground) 3844 if (camera_position_global.mdV[VZ] < camera_land_height + camera_min_off_ground)
3841 { 3845 {
3842 camera_position_global.mdV[VZ] = camera_land_height + camera_min_off_ground; 3846 camera_position_global.mdV[VZ] = camera_land_height + camera_min_off_ground;
3843
3844 gMinObjectDistance = MIN_NEAR_PLANE;
3845 isConstrained = TRUE; 3847 isConstrained = TRUE;
3846 } 3848 }
3847 3849
@@ -3873,6 +3875,7 @@ void LLAgent::handleScrollWheel(S32 clicks)
3873 } 3875 }
3874 else 3876 else
3875 { 3877 {
3878 LLObjectSelectionHandle selection = gSelectMgr->getSelection();
3876 const F32 ROOT_ROOT_TWO = sqrt(F_SQRT2); 3879 const F32 ROOT_ROOT_TWO = sqrt(F_SQRT2);
3877 3880
3878 // Block if camera is animating 3881 // Block if camera is animating
@@ -3881,7 +3884,7 @@ void LLAgent::handleScrollWheel(S32 clicks)
3881 return; 3884 return;
3882 } 3885 }
3883 3886
3884 if (gSelectMgr->getObjectCount() && gSelectMgr->getSelectType() == SELECT_TYPE_HUD) 3887 if (selection->getObjectCount() && selection->getSelectType() == SELECT_TYPE_HUD)
3885 { 3888 {
3886 F32 zoom_factor = (F32)pow(0.8, -clicks); 3889 F32 zoom_factor = (F32)pow(0.8, -clicks);
3887 cameraZoomIn(zoom_factor); 3890 cameraZoomIn(zoom_factor);
@@ -3952,9 +3955,7 @@ void LLAgent::changeCameraToMouselook(BOOL animate)
3952 // unpause avatar animation 3955 // unpause avatar animation
3953 mPauseRequest = NULL; 3956 mPauseRequest = NULL;
3954 3957
3955 gCurrentToolset = gMouselookToolset; 3958 gToolMgr->setCurrentToolset(gMouselookToolset);
3956 gCurrentToolset->selectFirstTool();
3957 gToolMgr->useSelectedTool( gCurrentToolset );
3958 3959
3959 gSavedSettings.setBOOL("FirstPersonBtnState", FALSE); 3960 gSavedSettings.setBOOL("FirstPersonBtnState", FALSE);
3960 gSavedSettings.setBOOL("MouselookBtnState", TRUE); 3961 gSavedSettings.setBOOL("MouselookBtnState", TRUE);
@@ -4036,9 +4037,7 @@ void LLAgent::changeCameraToFollow(BOOL animate)
4036 4037
4037 if (gBasicToolset) 4038 if (gBasicToolset)
4038 { 4039 {
4039 gCurrentToolset = gBasicToolset; 4040 gToolMgr->setCurrentToolset(gBasicToolset);
4040 gCurrentToolset->selectFirstTool();
4041 gToolMgr->useSelectedTool( gCurrentToolset );
4042 } 4041 }
4043 4042
4044 if (mAvatarObject) 4043 if (mAvatarObject)
@@ -4111,9 +4110,7 @@ void LLAgent::changeCameraToThirdPerson(BOOL animate)
4111 { 4110 {
4112 if (gBasicToolset) 4111 if (gBasicToolset)
4113 { 4112 {
4114 gCurrentToolset = gBasicToolset; 4113 gToolMgr->setCurrentToolset(gBasicToolset);
4115 gCurrentToolset->selectFirstTool();
4116 gToolMgr->useSelectedTool( gCurrentToolset );
4117 } 4114 }
4118 4115
4119 mCameraLag.clearVec(); 4116 mCameraLag.clearVec();
@@ -4176,9 +4173,7 @@ void LLAgent::changeCameraToCustomizeAvatar(BOOL animate)
4176 4173
4177 if (gFaceEditToolset) 4174 if (gFaceEditToolset)
4178 { 4175 {
4179 gCurrentToolset = gFaceEditToolset; 4176 gToolMgr->setCurrentToolset(gFaceEditToolset);
4180 gCurrentToolset->selectFirstTool();
4181 gToolMgr->useSelectedTool( gCurrentToolset );
4182 } 4177 }
4183 4178
4184 gSavedSettings.setBOOL("FirstPersonBtnState", FALSE); 4179 gSavedSettings.setBOOL("FirstPersonBtnState", FALSE);
@@ -4673,14 +4668,26 @@ void LLAgent::requestStopMotion( LLMotion* motion )
4673 // Notify all avatars that a motion has stopped. 4668 // Notify all avatars that a motion has stopped.
4674 // This is needed to clear the animation state bits 4669 // This is needed to clear the animation state bits
4675 LLUUID anim_state = motion->getID(); 4670 LLUUID anim_state = motion->getID();
4671 onAnimStop(motion->getID());
4676 4672
4677 // if motion is not looping, it could have stopped by running out of time 4673 // if motion is not looping, it could have stopped by running out of time
4678 // so we need to tell the server this 4674 // so we need to tell the server this
4679// llinfos << "Sending stop for motion " << motion->getName() << llendl; 4675// llinfos << "Sending stop for motion " << motion->getName() << llendl;
4680 sendAnimationRequest( anim_state, ANIM_REQUEST_STOP ); 4676 sendAnimationRequest( anim_state, ANIM_REQUEST_STOP );
4677}
4681 4678
4679void LLAgent::onAnimStop(const LLUUID& id)
4680{
4682 // handle automatic state transitions (based on completion of animation playback) 4681 // handle automatic state transitions (based on completion of animation playback)
4683 if (anim_state == ANIM_AGENT_STANDUP) 4682 if (id == ANIM_AGENT_STAND)
4683 {
4684 stopFidget();
4685 }
4686 else if (id == ANIM_AGENT_AWAY)
4687 {
4688 clearAFK();
4689 }
4690 else if (id == ANIM_AGENT_STANDUP)
4684 { 4691 {
4685 // send stand up command 4692 // send stand up command
4686 setControlFlags(AGENT_CONTROL_FINISH_ANIM); 4693 setControlFlags(AGENT_CONTROL_FINISH_ANIM);
@@ -4689,7 +4696,7 @@ void LLAgent::requestStopMotion( LLMotion* motion )
4689 if (mAvatarObject.notNull() && !mAvatarObject->mBelowWater && rand() % 3 == 0) 4696 if (mAvatarObject.notNull() && !mAvatarObject->mBelowWater && rand() % 3 == 0)
4690 sendAnimationRequest( ANIM_AGENT_BRUSH, ANIM_REQUEST_START ); 4697 sendAnimationRequest( ANIM_AGENT_BRUSH, ANIM_REQUEST_START );
4691 } 4698 }
4692 else if (anim_state == ANIM_AGENT_PRE_JUMP || anim_state == ANIM_AGENT_LAND || anim_state == ANIM_AGENT_MEDIUM_LAND) 4699 else if (id == ANIM_AGENT_PRE_JUMP || id == ANIM_AGENT_LAND || id == ANIM_AGENT_MEDIUM_LAND)
4693 { 4700 {
4694 setControlFlags(AGENT_CONTROL_FINISH_ANIM); 4701 setControlFlags(AGENT_CONTROL_FINISH_ANIM);
4695 } 4702 }
@@ -5184,7 +5191,7 @@ void LLAgent::processAgentGroupDataUpdate(LLMessageSystem *msg, void **)
5184 LLGroupData group; 5191 LLGroupData group;
5185 S32 index = -1; 5192 S32 index = -1;
5186 bool need_floater_update = false; 5193 bool need_floater_update = false;
5187 char group_name[DB_GROUP_NAME_BUF_SIZE]; 5194 char group_name[DB_GROUP_NAME_BUF_SIZE]; /*Flawfinder: ignore*/
5188 for(S32 i = 0; i < count; ++i) 5195 for(S32 i = 0; i < count; ++i)
5189 { 5196 {
5190 msg->getUUIDFast(_PREHASH_GroupData, _PREHASH_GroupID, group.mID, i); 5197 msg->getUUIDFast(_PREHASH_GroupData, _PREHASH_GroupID, group.mID, i);
@@ -6593,7 +6600,7 @@ void LLAgent::makeNewOutfit(
6593 S32 attachment_pt = attachments_to_include[i]; 6600 S32 attachment_pt = attachments_to_include[i];
6594 LLViewerJointAttachment* attachment = mAvatarObject->mAttachmentPoints.getIfThere( attachment_pt ); 6601 LLViewerJointAttachment* attachment = mAvatarObject->mAttachmentPoints.getIfThere( attachment_pt );
6595 if(!attachment) continue; 6602 if(!attachment) continue;
6596 LLViewerObject* attached_object = attachment->getObject(0); 6603 LLViewerObject* attached_object = attachment->getObject();
6597 if(!attached_object) continue; 6604 if(!attached_object) continue;
6598 const LLUUID& item_id = attachment->getItemID(); 6605 const LLUUID& item_id = attachment->getItemID();
6599 if(item_id.isNull()) continue; 6606 if(item_id.isNull()) continue;
@@ -7216,7 +7223,7 @@ void LLAgent::userRemoveAllAttachments( void* userdata )
7216 attachment; 7223 attachment;
7217 attachment = avatarp->mAttachmentPoints.getNextData()) 7224 attachment = avatarp->mAttachmentPoints.getNextData())
7218 { 7225 {
7219 LLViewerObject* objectp = attachment->getObject(0); 7226 LLViewerObject* objectp = attachment->getObject();
7220 if (objectp) 7227 if (objectp)
7221 { 7228 {
7222 gMessageSystem->nextBlockFast(_PREHASH_ObjectData); 7229 gMessageSystem->nextBlockFast(_PREHASH_ObjectData);
diff --git a/linden/indra/newview/llagent.h b/linden/indra/newview/llagent.h
index b86ab69..faf94ab 100644
--- a/linden/indra/newview/llagent.h
+++ b/linden/indra/newview/llagent.h
@@ -350,6 +350,7 @@ public:
350 350
351 // Animation functions 351 // Animation functions
352 void requestStopMotion( LLMotion* motion ); 352 void requestStopMotion( LLMotion* motion );
353 void onAnimStop(const LLUUID& id);
353 354
354 void sendAnimationRequests(LLDynamicArray<LLUUID> &anim_ids, EAnimRequest request); 355 void sendAnimationRequests(LLDynamicArray<LLUUID> &anim_ids, EAnimRequest request);
355 void sendAnimationRequest(const LLUUID &anim_id, EAnimRequest request); 356 void sendAnimationRequest(const LLUUID &anim_id, EAnimRequest request);
@@ -667,8 +668,8 @@ public:
667 U8 mAccess; // SIM_ACCESS_MATURE or SIM_ACCESS_PG 668 U8 mAccess; // SIM_ACCESS_MATURE or SIM_ACCESS_PG
668 U64 mGroupPowers; 669 U64 mGroupPowers;
669 BOOL mHideGroupTitle; 670 BOOL mHideGroupTitle;
670 char mGroupTitle[DB_GROUP_TITLE_BUF_SIZE]; // honorific, like "Sir" 671 char mGroupTitle[DB_GROUP_TITLE_BUF_SIZE]; /*Flawfinder: ignore*/ // honorific, like "Sir"
671 char mGroupName[DB_GROUP_NAME_BUF_SIZE]; 672 char mGroupName[DB_GROUP_NAME_BUF_SIZE]; /*Flawfinder: ignore*/
672 LLUUID mGroupID; 673 LLUUID mGroupID;
673 //LLUUID mGroupInsigniaID; 674 //LLUUID mGroupInsigniaID;
674 LLUUID mInventoryRootID; 675 LLUUID mInventoryRootID;
diff --git a/linden/indra/newview/llagentpilot.cpp b/linden/indra/newview/llagentpilot.cpp
index 45c1770..45d29cc 100644
--- a/linden/indra/newview/llagentpilot.cpp
+++ b/linden/indra/newview/llagentpilot.cpp
@@ -55,13 +55,14 @@ LLAgentPilot::~LLAgentPilot()
55 55
56void LLAgentPilot::load(const char *filename) 56void LLAgentPilot::load(const char *filename)
57{ 57{
58 llifstream file; 58 if(!filename) return;
59 59
60 file.open(filename); 60 llifstream file(filename);
61 61
62 if (!file) 62 if (!file)
63 { 63 {
64 llinfos << "Couldn't open " << filename << ", aborting agentpilot load!" << llendl; 64 lldebugs << "Couldn't open " << filename
65 << ", aborting agentpilot load!" << llendl;
65 return; 66 return;
66 } 67 }
67 else 68 else
@@ -90,7 +91,7 @@ void LLAgentPilot::load(const char *filename)
90void LLAgentPilot::save(const char *filename) 91void LLAgentPilot::save(const char *filename)
91{ 92{
92 llofstream file; 93 llofstream file;
93 file.open(filename); 94 file.open(filename); /*Flawfinder: ignore*/
94 95
95 if (!file) 96 if (!file)
96 { 97 {
diff --git a/linden/indra/newview/llagparray.h b/linden/indra/newview/llagparray.h
deleted file mode 100644
index 2569d95..0000000
--- a/linden/indra/newview/llagparray.h
+++ /dev/null
@@ -1,215 +0,0 @@
1/**
2 * @file llagparray.h
3 * @brief LLAGPArray - arrays used for rendering w/ AGP memory (if on)
4 *
5 * Copyright (c) 2001-2007, Linden Research, Inc.
6 *
7 * The source code in this file ("Source Code") is provided by Linden Lab
8 * to you under the terms of the GNU General Public License, version 2.0
9 * ("GPL"), unless you have obtained a separate licensing agreement
10 * ("Other License"), formally executed by you and Linden Lab. Terms of
11 * the GPL can be found in doc/GPL-license.txt in this distribution, or
12 * online at http://secondlife.com/developers/opensource/gplv2
13 *
14 * There are special exceptions to the terms and conditions of the GPL as
15 * it is applied to this Source Code. View the full text of the exception
16 * in the file doc/FLOSS-exception.txt in this software distribution, or
17 * online at http://secondlife.com/developers/opensource/flossexception
18 *
19 * By copying, modifying or distributing this software, you acknowledge
20 * that you have read and understood your obligations described above,
21 * and agree to abide by those obligations.
22 *
23 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
24 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
25 * COMPLETENESS OR PERFORMANCE.
26 */
27
28#ifndef LL_LLAGPARRAY_H
29#define LL_LLAGPARRAY_H
30
31#include <stdlib.h>
32#include "llagpmempool.h"
33
34class LLAGPMemBlock;
35
36template <class Type> class LLAGPArray
37{
38public:
39 enum
40 {
41 OKAY = 0,
42 FAIL = -1
43 };
44
45 inline LLAGPArray(const S32 size=0, const U32 target=0);
46 inline ~LLAGPArray();
47
48 inline void init();
49 inline void destroy();
50
51 inline void flushAGP();
52 inline void setDirty() { mDirty = TRUE; }
53 inline BOOL isDirty() const { return mDirty; }
54
55 inline BOOL setUseAGP(const BOOL on = TRUE); // Returns false if AGP memory is not available
56 inline BOOL isAGP() const { return mAGPp ? TRUE : FALSE; }
57 LLAGPMemBlock *getAGPMemBlock() const { return mAGPp; }
58
59 inline BOOL realloc(U32 newsize);
60 inline S32 getMax() const { return mMaxObj; }
61 inline S32 count() const;
62 inline S32 shrinkTo(S32 newcount);
63 inline void reset(S32 reserve_count);
64
65 inline S32 find (const Type &obj) const;
66 inline S32 fastRemove(const S32 i);
67 inline S32 safeRemove(const S32 r);
68 inline S32 remove (const S32 i);
69 inline S32 removeObj (const Type &obj);
70 inline S32 removeLast() { return (mNumObj > 0 ? mNumObj-- : 0); }
71
72 inline Type* reserve_block(const U32 num);
73
74 inline S32 put(const Type &obj);
75 inline const Type& get(const S32 i) const;
76 inline Type& get(const S32 i);
77
78 inline BOOL sync ();
79 inline BOOL syncColor();
80
81 inline const Type* getMem () const;
82 inline const S32 getIndex(const Type *objp) const { return objp - mMemp; }
83 inline const Type& operator[](const S32 i) const;
84 inline Type& operator[](const S32 i);
85
86 void bindGLVertexPointer(const U32 stride, const U32 offset);
87 void bindGLTexCoordPointer(const U32 stride, const U32 offset);
88 void bindGLNormalPointer(const U32 stride, const U32 offset);
89 void bindGLBinormalPointer(const S32 index, const U32 stride, const U32 offset);
90 void bindGLColorPointer(const U32 stride, const U32 offset);
91 void bindGLVertexWeightPointer(const S32 index, const U32 stride, const U32 offset);
92 void bindGLVertexClothingWeightPointer(const S32 index, const U32 stride, const U32 offset);
93
94 void copyToMem(const S32 offset, const U8 *source, const S32 size);
95
96 U8* getScratchMemory();
97
98 U32 createFence() { return (mAGPp ? mAGPp->createFence() : 0); }
99 void deleteFence(const U32 fence) { if (mAGPp) { mAGPp->deleteFence(fence); } }
100 void sendFence(U32 fence) { if (mAGPp) mAGPp->sendFence(fence); }
101 void waitFence(U32 fence) { if (mAGPp) mAGPp->waitFence(fence); }
102
103 S32 getSysMemUsage() { return sizeof(Type)*mMaxObj; }
104
105protected:
106 BOOL mDirty;
107 BOOL mUseAGP;
108 U32 mNumObj;
109 U32 mMaxObj;
110 U8 *mUnalignedMemp;
111 Type *mMemp;
112 U32 mTarget; //for VBO implementations of this class, store the type of buffer this is
113
114 LLAGPMemBlock *mAGPp;
115
116public:
117 BOOL mSynced; // for graph only -- not critical
118
119public:
120 static S32 sNumRealloced;
121 static S32 sBytesRealloced;
122 static char* sTypeName;
123};
124
125template <class Type> S32 LLAGPArray<Type>::sNumRealloced = 0;
126template <class Type> S32 LLAGPArray<Type>::sBytesRealloced = 0;
127
128// constructor is in .inl file because it calls realloc()
129// which access gPipeline (yuck!)
130
131template <class Type>
132LLAGPArray<Type>::~LLAGPArray()
133{
134 destroy();
135}
136
137template <class Type> void
138LLAGPArray<Type>::destroy()
139{
140 realloc(0);
141 delete mAGPp;
142 mAGPp = NULL;
143}
144
145template <class Type>
146const Type *LLAGPArray<Type>::getMem() const
147{
148 return mMemp;
149}
150
151template <class Type>
152const Type& LLAGPArray<Type>::get(const S32 i) const
153{
154 llassert(i < (S32)mNumObj);
155 return mMemp[i];
156}
157
158template <class Type>
159Type& LLAGPArray<Type>::get(const S32 i)
160{
161 setDirty();
162 llassert(i < (S32)mNumObj);
163 return mMemp[i];
164}
165
166template <class Type>
167const Type& LLAGPArray<Type>::operator[](const S32 i) const
168{
169 return get(i);
170}
171
172template <class Type>
173Type& LLAGPArray<Type>::operator[](const S32 i)
174{
175 return get(i);
176}
177
178template <class Type>
179S32 LLAGPArray<Type>::fastRemove(const S32 i)
180{
181 if (i < 0 || mNumObj <= 0) return FAIL;
182 setDirty();
183 mMemp[i] = mMemp[--mNumObj];
184
185 return OKAY;
186}
187
188template <class Type>
189S32 LLAGPArray<Type>::remove(const S32 i)
190{
191 setDirty();
192 return fastRemove(i);
193}
194
195template <class Type>
196S32 LLAGPArray<Type>::removeObj(const Type& obj)
197{
198 setDirty();
199
200 S32 ind = find(obj);
201 if (ind >= 0)
202 {
203 return fastRemove(ind);
204 }
205 return FAIL;
206}
207
208template <class Type>
209S32 LLAGPArray<Type>::count() const
210{
211 return mNumObj;
212}
213
214
215#endif // LL_LLAGPARRAY_H
diff --git a/linden/indra/newview/llagparray.inl b/linden/indra/newview/llagparray.inl
deleted file mode 100644
index 418f7d9..0000000
--- a/linden/indra/newview/llagparray.inl
+++ /dev/null
@@ -1,519 +0,0 @@
1/**
2 * @file llagparray.inl
3 * @brief LLAGPArray - arrays used for rendering w/ AGP memory (if on)
4 *
5 * Copyright (c) 2001-2007, Linden Research, Inc.
6 *
7 * The source code in this file ("Source Code") is provided by Linden Lab
8 * to you under the terms of the GNU General Public License, version 2.0
9 * ("GPL"), unless you have obtained a separate licensing agreement
10 * ("Other License"), formally executed by you and Linden Lab. Terms of
11 * the GPL can be found in doc/GPL-license.txt in this distribution, or
12 * online at http://secondlife.com/developers/opensource/gplv2
13 *
14 * There are special exceptions to the terms and conditions of the GPL as
15 * it is applied to this Source Code. View the full text of the exception
16 * in the file doc/FLOSS-exception.txt in this software distribution, or
17 * online at http://secondlife.com/developers/opensource/flossexception
18 *
19 * By copying, modifying or distributing this software, you acknowledge
20 * that you have read and understood your obligations described above,
21 * and agree to abide by those obligations.
22 *
23 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
24 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
25 * COMPLETENESS OR PERFORMANCE.
26 */
27
28#include "llagpmempool.h"
29#include "llglheaders.h"
30#include "pipeline.h" // for gPipeline
31#include "v4math.h"
32
33template <class Type>
34void LLAGPArray<Type>::flushAGP()
35{
36 delete mAGPp;
37 mAGPp = NULL;
38
39 setDirty();
40}
41
42template <class Type>
43void LLAGPArray<Type>::reset(S32 reserve_count)
44{
45 mNumObj = 0;
46 realloc(reserve_count);
47 setDirty();
48}
49
50template <class Type>
51S32 LLAGPArray<Type>::find(const Type &obj) const
52{
53 for ( S32 i = 0; i < (S32)mNumObj; i++ )
54 {
55 if (mMemp[i] == obj)
56 {
57 return i;
58 }
59 }
60 return FAIL;
61}
62
63template <class Type>
64Type* LLAGPArray<Type>::reserve_block(const U32 num)
65{
66 if (!num)
67 {
68 return NULL;
69 }
70
71 setDirty();
72
73 U32 new_count = mNumObj + num;
74 if (new_count >= mMaxObj)
75 {
76 if (!realloc(new_count))
77 {
78 llwarns << "Unable to realloc " << num << " objects in LLAGPArray!" << llendl;
79 return NULL;
80 }
81 }
82
83 if (mMemp)
84 {
85 Type *ret = &mMemp[mNumObj];
86 mNumObj += num;
87 return ret;
88 }
89
90 return NULL;
91}
92
93template <class Type>
94S32 LLAGPArray<Type>::put(const Type &obj)
95{
96 if (mNumObj >= mMaxObj)
97 {
98 if (!mMaxObj)
99 {
100 mMaxObj = 1;
101 }
102 if (!realloc(mMaxObj*2))
103 {
104 llwarns << "Unable to put in AGPArray due to realloc!" << llendl;
105 return FAIL;
106 }
107 }
108
109 mMemp[mNumObj] = obj;
110 mNumObj++;
111 setDirty();
112 return OKAY;
113}
114
115template <class Type>
116S32 LLAGPArray<Type>::shrinkTo(S32 newcount)
117{
118 mNumObj = newcount;
119 return mNumObj;
120}
121
122template <class Type>
123LLAGPArray<Type>::LLAGPArray(const S32 size, const U32 target)
124{
125 if (!target)
126 {
127 mTarget = GL_ARRAY_BUFFER_ARB;
128 }
129 else
130 {
131 mTarget = target;
132 }
133
134 mSynced = FALSE;
135 mMaxObj = 0;
136 mNumObj = 0;
137 mMemp = NULL;
138 mUnalignedMemp = NULL;
139 mUseAGP = FALSE;
140 mAGPp = NULL;
141 mDirty = TRUE;
142
143 if (size)
144 {
145 if (!realloc(size))
146 {
147 llerrs << "Unable to allocate AGP array of size: " << size << llendl;
148 }
149 }
150}
151
152template <class Type>
153BOOL LLAGPArray<Type>::realloc(U32 new_count)
154{
155 const U32 min_count = 1024;
156 U32 max_count = llmax(min_count, mMaxObj);
157 if (new_count == 0)
158 {
159 delete[] mUnalignedMemp;
160 mUnalignedMemp = NULL;
161 mMemp = NULL;
162
163 delete mAGPp;
164 mAGPp = NULL;
165
166 mNumObj = 0;
167 mMaxObj = 0;
168
169 return TRUE;
170 }
171 if (new_count < min_count)
172 {
173 new_count = min_count;
174 }
175 else if (new_count < max_count>>1)
176 {
177 new_count = new_count + (new_count>>1);
178 }
179 else
180 {
181 while (max_count < new_count)
182 {
183 max_count += max_count>>1;
184 }
185 new_count = max_count;
186 }
187 if (new_count != mMaxObj)
188 {
189 //Type *new_obj_array = new Type[new_count];
190 const size_t ALIGN_BYTES = 64;
191 U8* new_unaligned_obj_array = new U8[ sizeof(Type) * new_count + ALIGN_BYTES - 1];
192 if (!new_unaligned_obj_array)
193 {
194 llerrs << "Out of system memory in LLAGPArray::realloc - tried to alloc " << new_count << llendl;
195 return FALSE;
196 }
197
198 Type* new_obj_array;
199 // Use size_t to avoid warning -- size_t should be the same size as a pointer
200 // for 32 and 64 bit architectures. JC
201 size_t offset = (size_t)new_unaligned_obj_array;
202 S32 skip_bytes = (S32)(offset % ALIGN_BYTES);
203 if( skip_bytes )
204 {
205 new_obj_array = (Type*) (new_unaligned_obj_array + ALIGN_BYTES - skip_bytes);
206 }
207 else
208 {
209 new_obj_array = (Type*) new_unaligned_obj_array;
210 }
211
212 delete mAGPp;
213 mAGPp = NULL;
214
215 if (mUseAGP)
216 {
217 mAGPp = gPipeline.allocAGPFromPool(new_count * sizeof(Type), mTarget);
218 setDirty();
219 }
220
221 if (!mAGPp && mUseAGP)
222 {
223#ifdef DEBUG_AGP
224 llwarns << "Failed AGP allocation in realloc!" << llendl;
225#endif
226 }
227
228 // Copying data from previous array to new array.
229 if (new_count < mNumObj)
230 {
231 mNumObj = new_count;
232 }
233
234 if (mNumObj > 0 && mMemp)
235 {
236 memcpy(new_obj_array, mMemp, mNumObj*sizeof(Type));
237 }
238
239 delete[] mUnalignedMemp;
240 mUnalignedMemp = new_unaligned_obj_array;
241 mMemp = new_obj_array;
242
243 mMaxObj = new_count;
244 }
245
246 return TRUE;
247}
248
249template <class Type>
250void LLAGPArray<Type>::copyToMem(const S32 offset, const U8 *source, const S32 size)
251{
252 llassert(mMemp);
253 memcpy((mMemp + offset), source, size*sizeof(Type));
254}
255
256template <class Type>
257BOOL LLAGPArray<Type>::sync()
258{
259 if (mUseAGP && !mAGPp && !mDirty)
260 {
261 llwarns << "No AGP, yet not dirty!" << llendl;
262 }
263
264 if (mUseAGP && mDirty && mNumObj)
265 {
266 if (!mAGPp)
267 {
268 mAGPp = gPipeline.allocAGPFromPool(mMaxObj * sizeof(Type), mTarget);
269 if (!mAGPp)
270 {
271#ifdef DEBUG_AGP
272 llwarns << "Failure to allocate AGP in sync!" << llendl;
273#endif
274 mUseAGP = FALSE;
275 }
276 else
277 {
278 mAGPp->copy(mMemp, mNumObj * sizeof(Type));
279 }
280 }
281 else
282 {
283 mAGPp->copy(mMemp, mNumObj * sizeof(Type));
284 }
285 mSynced = TRUE;
286 }
287 mDirty = FALSE;
288 return mSynced;
289}
290
291template <class Type>
292BOOL LLAGPArray<Type>::syncColor()
293{
294 if (mUseAGP && mDirty && mNumObj)
295 {
296 if (!mAGPp)
297 {
298 mAGPp = gPipeline.allocAGPFromPool(mMaxObj * sizeof(Type), mTarget);
299 if (!mAGPp)
300 {
301#ifdef DEBUG_AGP
302 llwarns << "Failure to allocate AGP in synccolor!" << llendl;
303#endif
304 mUseAGP = FALSE;
305 }
306 else
307 {
308 mAGPp->copyColor(mMemp, mNumObj * sizeof(Type));
309 }
310 }
311 else
312 {
313 mAGPp->copyColor(mMemp, mNumObj * sizeof(Type));
314 }
315 mSynced = TRUE;
316 }
317 mDirty = FALSE;
318 return mSynced;
319}
320
321template <class Type>
322BOOL LLAGPArray<Type>::setUseAGP(const BOOL on)
323{
324 if (on == mUseAGP)
325 {
326 return TRUE;
327 }
328
329 mUseAGP = on;
330 if (!on)
331 {
332 delete mAGPp;
333 mAGPp = NULL;
334 }
335 else if (on)
336 {
337 mAGPp = gPipeline.allocAGPFromPool(mMaxObj * sizeof(Type), mTarget);
338 setDirty();
339 if (!mAGPp)
340 {
341#ifdef DEBUG_AGP
342 llwarns << "Failure to allocate AGP in setUseAGP! Block size = " << (mMaxObj * sizeof(Type)) << llendl;
343#endif
344 mUseAGP = FALSE;
345 return FALSE;
346 }
347 }
348 return TRUE;
349}
350
351extern U8* gAGPVertices;
352extern U8* gAGPNormals;
353
354template <class Type>
355U8* LLAGPArray<Type>::getScratchMemory()
356{
357 U8* memp = NULL;
358
359 if (mAGPp && gPipeline.isAGPBound())
360 {
361 memp = mAGPp->getMappedMem();
362 }
363 if (!memp)
364 {
365 memp = ((U8*)mMemp);
366 }
367
368 return memp;
369}
370
371template <class Type>
372void LLAGPArray<Type>::bindGLVertexPointer(const U32 stride, const U32 offset)
373{
374 if (mAGPp && gPipeline.isAGPBound())
375 {
376 mAGPp->bindGLVertexPointer(stride, offset);
377 }
378 else
379 {
380 if (gPipeline.isAGPBound())
381 {
382 llerrs << "Binding non-AGP vertex pointer when AGP enabled" << llendl;
383 }
384 if (!mMemp)
385 {
386 llerrs << "Binding empty vertex array" << llendl;
387 }
388 llassert(mMemp);
389 glVertexPointer(3, GL_FLOAT, stride, ((U8 *)mMemp) + offset);
390 }
391}
392
393template <class Type>
394void LLAGPArray<Type>::bindGLTexCoordPointer(const U32 stride, const U32 offset)
395{
396 if (mAGPp && gPipeline.isAGPBound())
397 {
398 mAGPp->bindGLTexCoordPointer(stride, offset);
399 }
400 else
401 {
402 if (gPipeline.isAGPBound())
403 {
404 llwarns << "Binding non-AGP texture coords pointer when AGP enabled" << llendl;
405 }
406 if (!mMemp)
407 {
408 llerrs << "Binding empty tex coord array" << llendl;
409 }
410 glTexCoordPointer(2, GL_FLOAT, stride, ((U8 *)mMemp) + offset);
411 }
412}
413
414template <class Type>
415void LLAGPArray<Type>::bindGLNormalPointer(const U32 stride, const U32 offset)
416{
417 if (mAGPp && gPipeline.isAGPBound())
418 {
419 mAGPp->bindGLNormalPointer(stride, offset);
420 }
421 else
422 {
423 if (gPipeline.isAGPBound())
424 {
425 llwarns << "Binding non-AGP normals pointer when AGP enabled" << llendl;
426 }
427 if (!mMemp)
428 {
429 llerrs << "Binding empty normal array" << llendl;
430 }
431 glNormalPointer(GL_FLOAT, stride, ((U8 *)mMemp) + offset);
432 }
433}
434
435template <class Type>
436void LLAGPArray<Type>::bindGLBinormalPointer(const S32 index, const U32 stride, const U32 offset)
437{
438 if (mAGPp && gPipeline.isAGPBound())
439 {
440 mAGPp->bindGLBinormalPointer(index, stride, offset);
441 }
442 else
443 {
444 if (gPipeline.isAGPBound())
445 {
446 llwarns << "Binding non-AGP binormal pointer when AGP enabled" << llendl;
447 }
448 if (!mMemp)
449 {
450 llerrs << "Binding empty binormal array" << llendl;
451 }
452 set_binormals(index, stride, (LLVector3 *)(((U8 *)mMemp) + offset));
453 }
454}
455
456
457template <class Type>
458void LLAGPArray<Type>::bindGLColorPointer(const U32 stride, const U32 offset)
459{
460 if (mAGPp && gPipeline.isAGPBound())
461 {
462 mAGPp->bindGLColorPointer(stride, offset);
463 }
464 else
465 {
466 if (gPipeline.isAGPBound())
467 {
468 llwarns << "Binding non-AGP color pointer when AGP enabled" << llendl;
469 }
470 if (!mMemp)
471 {
472 llerrs << "Binding empty color array" << llendl;
473 }
474 glColorPointer(4, GL_UNSIGNED_BYTE, stride, ((U8 *)mMemp) + offset);
475 }
476}
477
478template <class Type>
479void LLAGPArray<Type>::bindGLVertexWeightPointer(const S32 index, const U32 stride, const U32 offset)
480{
481 if (mAGPp && gPipeline.isAGPBound())
482 {
483 mAGPp->bindGLVertexWeightPointer(index, stride, offset);
484 }
485 else
486 {
487 if (gPipeline.isAGPBound())
488 {
489 llwarns << "Binding non-AGP vertex weight pointer when AGP enabled" << llendl;
490 }
491 if (!mMemp)
492 {
493 llerrs << "Binding empty vertex weight array" << llendl;
494 }
495 set_vertex_weights(index, (F32 *)(((U8 *)mMemp) + offset));
496 }
497}
498
499template <class Type>
500void LLAGPArray<Type>::bindGLVertexClothingWeightPointer(const S32 index, const U32 stride, const U32 offset)
501{
502 if (mAGPp && gPipeline.isAGPBound())
503 {
504 mAGPp->bindGLVertexClothingWeightPointer(index, stride, offset);
505 }
506 else
507 {
508 if (gPipeline.isAGPBound())
509 {
510 llwarns << "Binding non-AGP vertex weight pointer when AGP enabled" << llendl;
511 }
512 if (!mMemp)
513 {
514 llerrs << "Binding empty vertex weight array" << llendl;
515 }
516 set_vertex_clothing_weights(index, stride, (LLVector4 *)(((U8 *)mMemp) + offset));
517 }
518}
519
diff --git a/linden/indra/newview/llassetuploadresponders.cpp b/linden/indra/newview/llassetuploadresponders.cpp
index 1c094bb..7c615dd 100644
--- a/linden/indra/newview/llassetuploadresponders.cpp
+++ b/linden/indra/newview/llassetuploadresponders.cpp
@@ -1,29 +1,6 @@
1/** 1// llassetuploadresponders.cpp
2 * @file llmapresponders.h 2// Copyright 2006, Linden Research, Inc.
3 * @brief Processes responses received for asset upload requests. 3// Processes responses received for asset upload requests.
4 *
5 * Copyright (c) 2006-2007, Linden Research, Inc.
6 *
7 * The source code in this file ("Source Code") is provided by Linden Lab
8 * to you under the terms of the GNU General Public License, version 2.0
9 * ("GPL"), unless you have obtained a separate licensing agreement
10 * ("Other License"), formally executed by you and Linden Lab. Terms of
11 * the GPL can be found in doc/GPL-license.txt in this distribution, or
12 * online at http://secondlife.com/developers/opensource/gplv2
13 *
14 * There are special exceptions to the terms and conditions of the GPL as
15 * it is applied to this Source Code. View the full text of the exception
16 * in the file doc/FLOSS-exception.txt in this software distribution, or
17 * online at http://secondlife.com/developers/opensource/flossexception
18 *
19 * By copying, modifying or distributing this software, you acknowledge
20 * that you have read and understood your obligations described above,
21 * and agree to abide by those obligations.
22 *
23 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
24 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
25 * COMPLETENESS OR PERFORMANCE.
26 */
27 4
28#include "llviewerprecompiledheaders.h" 5#include "llviewerprecompiledheaders.h"
29 6
@@ -38,39 +15,71 @@
38#include "llinventorymodel.h" 15#include "llinventorymodel.h"
39#include "llinventoryview.h" 16#include "llinventoryview.h"
40#include "llpermissionsflags.h" 17#include "llpermissionsflags.h"
18#include "llpreviewnotecard.h"
19#include "llpreviewscript.h"
20#include "llscrolllistctrl.h"
41#include "lluploaddialog.h" 21#include "lluploaddialog.h"
42#include "llviewermenu.h" // for upload_new_resource() 22#include "llviewerobject.h"
23#include "llviewerobjectlist.h"
24#include "llviewermenu.h"
43#include "llviewerwindow.h" 25#include "llviewerwindow.h"
44#include "viewer.h" 26#include "viewer.h"
45 27
46LLNewAgentInventoryResponder::LLNewAgentInventoryResponder(const LLUUID& uuid, 28void dialog_refresh_all();
47 const LLSD &post_data) 29
48 : LLHTTPClient::Responder() 30LLAssetUploadResponder::LLAssetUploadResponder(const LLSD &post_data,
31 const LLUUID& vfile_id,
32 LLAssetType::EType asset_type)
33 : LLHTTPClient::Responder(),
34 mPostData(post_data),
35 mVFileID(vfile_id),
36 mAssetType(asset_type)
37{
38 if (!gVFS->getExists(vfile_id, asset_type))
39 {
40 llwarns << "LLAssetUploadResponder called with nonexistant vfile_id" << llendl;
41 mVFileID.setNull();
42 mAssetType = LLAssetType::AT_NONE;
43 return;
44 }
45}
46
47LLAssetUploadResponder::LLAssetUploadResponder(const LLSD &post_data,
48 const std::string& file_name)
49 : LLHTTPClient::Responder(),
50 mPostData(post_data),
51 mFileName(file_name)
52{
53}
54
55LLAssetUploadResponder::~LLAssetUploadResponder()
49{ 56{
50 mUUID = uuid; 57 if (!mFileName.empty())
51 mPostData = post_data; 58 {
59 // Delete temp file
60 LLFile::remove(mFileName.c_str());
61 }
52} 62}
53 63
54// virtual 64// virtual
55void LLNewAgentInventoryResponder::error(U32 statusNum, const std::string& reason) 65void LLAssetUploadResponder::error(U32 statusNum, const std::string& reason)
56{ 66{
57 llinfos << "LLNewAgentInventoryResponder::error " << statusNum << llendl; 67 llinfos << "LLAssetUploadResponder::error " << statusNum
68 << " reason: " << reason << llendl;
58 LLStringBase<char>::format_map_t args; 69 LLStringBase<char>::format_map_t args;
59 switch(statusNum) 70 switch(statusNum)
60 { 71 {
61 case 400: 72 case 400:
62 args["[FILE]"] = mPostData["inventory_type"].asString(); 73 args["[FILE]"] = (mFileName.empty() ? mVFileID.asString() : mFileName);
63 args["[REASON]"] = "invalid parameters in upload request"; 74 args["[REASON]"] = "Error in upload request. Please contact "
75 "support@lindenlab.com for help fixing this problem.";
64 gViewerWindow->alertXml("CannotUploadReason", args); 76 gViewerWindow->alertXml("CannotUploadReason", args);
65 break; 77 break;
66 case 402:
67 //(result["message"].asString() == "insufficient funds")
68 LLFloaterBuyCurrency::buyCurrency("Uploading costs", gGlobalEconomy->getPriceUpload());
69 break;
70 case 500: 78 case 500:
71 default: 79 default:
72 args["[FILE]"] = mPostData["inventory_type"].asString(); 80 args["[FILE]"] = (mFileName.empty() ? mVFileID.asString() : mFileName);
73 args["[REASON]"] = "the server is experiencing unexpected difficulties"; 81 args["[REASON]"] = "The server is experiencing unexpected "
82 "difficulties. Please try again later.";
74 gViewerWindow->alertXml("CannotUploadReason", args); 83 gViewerWindow->alertXml("CannotUploadReason", args);
75 break; 84 break;
76 } 85 }
@@ -78,139 +87,373 @@ void LLNewAgentInventoryResponder::error(U32 statusNum, const std::string& reaso
78} 87}
79 88
80//virtual 89//virtual
81void LLNewAgentInventoryResponder::result(const LLSD& result) 90void LLAssetUploadResponder::result(const LLSD& content)
82{ 91{
83 lldebugs << "LLNewAgentInventoryResponder::result from capabilities" << llendl; 92 lldebugs << "LLAssetUploadResponder::result from capabilities" << llendl;
84 93
85 if (!result["success"]) 94 std::string state = content["state"];
95 if (state == "upload")
96 {
97 uploadUpload(content);
98 }
99 else if (state == "complete")
100 {
101 // rename file in VFS with new asset id
102 if (mFileName.empty())
103 {
104 // rename the file in the VFS to the actual asset id
105 gVFS->renameFile(mVFileID, mAssetType, content["new_asset"].asUUID(), mAssetType);
106 }
107 uploadComplete(content);
108 }
109 else
110 {
111 uploadFailure(content);
112 }
113}
114
115void LLAssetUploadResponder::uploadUpload(const LLSD& content)
116{
117 std::string uploader = content["uploader"];
118 if (mFileName.empty())
119 {
120 LLHTTPClient::postFile(uploader, mVFileID, mAssetType, this);
121 }
122 else
123 {
124 LLHTTPClient::postFile(uploader, mFileName, this);
125 }
126}
127
128void LLAssetUploadResponder::uploadFailure(const LLSD& content)
129{
130 std::string reason = content["state"];
131 // deal with money errors
132 if (reason == "insufficient funds")
133 {
134 LLFloaterBuyCurrency::buyCurrency("Uploading costs", gGlobalEconomy->getPriceUpload());
135 }
136 else
86 { 137 {
87 LLStringBase<char>::format_map_t args; 138 LLStringBase<char>::format_map_t args;
88 args["[FILE]"] = mPostData["inventory_type"].asString(); 139 args["[FILE]"] = (mFileName.empty() ? mVFileID.asString() : mFileName);
89 args["[REASON]"] = "the server is experiencing unexpected difficulties"; 140 args["[REASON]"] = content["message"].asString();
90 gViewerWindow->alertXml("CannotUploadReason", args); 141 gViewerWindow->alertXml("CannotUploadReason", args);
91 return;
92 } 142 }
143}
144
145void LLAssetUploadResponder::uploadComplete(const LLSD& content)
146{
147}
148
149LLNewAgentInventoryResponder::LLNewAgentInventoryResponder(const LLSD& post_data,
150 const LLUUID& vfile_id,
151 LLAssetType::EType asset_type)
152: LLAssetUploadResponder(post_data, vfile_id, asset_type)
153{
154}
155
156LLNewAgentInventoryResponder::LLNewAgentInventoryResponder(const LLSD& post_data, const std::string& file_name)
157: LLAssetUploadResponder(post_data, file_name)
158{
159}
160
161//virtual
162void LLNewAgentInventoryResponder::uploadComplete(const LLSD& content)
163{
164 lldebugs << "LLNewAgentInventoryResponder::result from capabilities" << llendl;
93 165
94 std::string uploader = result["uploader"];
95 LLAssetType::EType asset_type = LLAssetType::lookup(mPostData["asset_type"].asString().c_str()); 166 LLAssetType::EType asset_type = LLAssetType::lookup(mPostData["asset_type"].asString().c_str());
96 LLInventoryType::EType inventory_type = LLInventoryType::lookup(mPostData["inventory_type"].asString().c_str()); 167 LLInventoryType::EType inventory_type = LLInventoryType::lookup(mPostData["inventory_type"].asString().c_str());
97 // request succeeded 168
98 if (!uploader.empty()) 169 // Update money and ownership credit information
170 // since it probably changed on the server
171 if (asset_type == LLAssetType::AT_TEXTURE ||
172 asset_type == LLAssetType::AT_SOUND ||
173 asset_type == LLAssetType::AT_ANIMATION)
99 { 174 {
100 LLHTTPClient::postFile(uploader, mUUID, asset_type, this); 175 gMessageSystem->newMessageFast(_PREHASH_MoneyBalanceRequest);
176 gMessageSystem->nextBlockFast(_PREHASH_AgentData);
177 gMessageSystem->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
178 gMessageSystem->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
179 gMessageSystem->nextBlockFast(_PREHASH_MoneyData);
180 gMessageSystem->addUUIDFast(_PREHASH_TransactionID, LLUUID::null );
181 gAgent.sendReliableMessage();
182
183 LLString::format_map_t args;
184 args["[AMOUNT]"] = llformat("%d",gGlobalEconomy->getPriceUpload());
185 LLNotifyBox::showXml("UploadPayment", args);
101 } 186 }
102 // upload succeeded
103 else
104 {
105 // rename the file in the VFS to the actual asset id
106 gVFS->renameFile(mUUID, asset_type, result["new_asset"].asUUID(), asset_type);
107 187
108 // TODO: only request for textures, sound, and animation uploads 188 // Actually add the upload to viewer inventory
109 // Update money and ownership credit information 189 llinfos << "Adding " << content["new_inventory_item"].asUUID() << " "
110 // since it probably changed on the server 190 << content["new_asset"].asUUID() << " to inventory." << llendl;
111 if (mPostData["asset_type"].asString() == "texture" || 191 if(mPostData["folder_id"].asUUID().notNull())
112 mPostData["asset_type"].asString() == "sound" || 192 {
113 mPostData["asset_type"].asString() == "animatn") 193 LLPermissions perm;
194 U32 next_owner_perm;
195 perm.init(gAgent.getID(), gAgent.getID(), LLUUID::null, LLUUID::null);
196 if (mPostData["inventory_type"].asString() == "snapshot")
114 { 197 {
115 gMessageSystem->newMessageFast(_PREHASH_MoneyBalanceRequest); 198 next_owner_perm = PERM_ALL;
116 gMessageSystem->nextBlockFast(_PREHASH_AgentData);
117 gMessageSystem->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
118 gMessageSystem->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
119 gMessageSystem->nextBlockFast(_PREHASH_MoneyData);
120 gMessageSystem->addUUIDFast(_PREHASH_TransactionID, LLUUID::null );
121 gAgent.sendReliableMessage();
122
123 LLString::format_map_t args;
124 args["[AMOUNT]"] = llformat("%d",gGlobalEconomy->getPriceUpload());
125 LLNotifyBox::showXml("UploadPayment", args);
126 } 199 }
127 // Actually add the upload to viewer inventory 200 else
128 llinfos << "Adding " << result["new_inventory_item"].asUUID() << " "
129 << result["new_asset"].asUUID() << " to inventory." << llendl;
130 if(mPostData["folder_id"].asUUID().notNull())
131 { 201 {
132 LLPermissions perm; 202 next_owner_perm = PERM_MOVE | PERM_TRANSFER;
133 U32 next_owner_perm; 203 }
134 perm.init(gAgent.getID(), gAgent.getID(), LLUUID::null, LLUUID::null); 204 perm.initMasks(PERM_ALL, PERM_ALL, PERM_NONE, PERM_NONE, next_owner_perm);
135 if (mPostData["inventory_type"].asString() == "snapshot") 205 S32 creation_date_now = time_corrected();
206 LLPointer<LLViewerInventoryItem> item
207 = new LLViewerInventoryItem(content["new_inventory_item"].asUUID(),
208 mPostData["folder_id"].asUUID(),
209 perm,
210 content["new_asset"].asUUID(),
211 asset_type,
212 inventory_type,
213 mPostData["name"].asString(),
214 mPostData["description"].asString(),
215 LLSaleInfo::DEFAULT,
216 LLInventoryItem::II_FLAGS_NONE,
217 creation_date_now);
218 gInventory.updateItem(item);
219 gInventory.notifyObservers();
220
221 // Show the preview panel for textures and sounds to let
222 // user know that the image (or snapshot) arrived intact.
223 LLInventoryView* view = LLInventoryView::getActiveInventory();
224 if(view)
225 {
226 LLUICtrl* focus_ctrl = gFocusMgr.getKeyboardFocus();
227 LLFocusMgr::FocusLostCallback callback = gFocusMgr.getFocusCallback();
228
229 view->getPanel()->setSelection(content["new_inventory_item"].asUUID(), TAKE_FOCUS_NO);
230 if((LLAssetType::AT_TEXTURE == asset_type)
231 || (LLAssetType::AT_SOUND == asset_type))
136 { 232 {
137 next_owner_perm = PERM_ALL; 233 view->getPanel()->openSelected();
138 } 234 }
139 else 235 //LLInventoryView::dumpSelectionInformation((void*)view);
236 // restore keyboard focus
237 gFocusMgr.setKeyboardFocus(focus_ctrl, callback);
238 }
239 }
240 else
241 {
242 llwarns << "Can't find a folder to put it in" << llendl;
243 }
244
245 // remove the "Uploading..." message
246 LLUploadDialog::modalUploadFinished();
247
248 // *FIX: This is a pretty big hack. What this does is check the
249 // file picker if there are any more pending uploads. If so,
250 // upload that file.
251 const char* next_file = LLFilePicker::instance().getNextFile();
252 if(next_file)
253 {
254 const char* name = LLFilePicker::instance().getDirname();
255
256 LLString asset_name = name;
257 LLString::replaceNonstandardASCII( asset_name, '?' );
258 LLString::replaceChar(asset_name, '|', '?');
259 LLString::stripNonprintable(asset_name);
260 LLString::trim(asset_name);
261
262 char* asset_name_str = (char*)asset_name.c_str();
263 char* end_p = strrchr(asset_name_str, '.'); // strip extension if exists
264 if( !end_p )
265 {
266 end_p = asset_name_str + strlen( asset_name_str ); /*Flawfinder: ignore*/
267 }
268
269 S32 len = llmin( (S32) (DB_INV_ITEM_NAME_STR_LEN), (S32) (end_p - asset_name_str) );
270
271 asset_name = asset_name.substr( 0, len );
272
273 upload_new_resource(next_file, asset_name, asset_name,
274 0, LLAssetType::AT_NONE, LLInventoryType::IT_NONE);
275 }
276}
277
278
279LLUpdateAgentInventoryResponder::LLUpdateAgentInventoryResponder(const LLSD& post_data,
280 const LLUUID& vfile_id,
281 LLAssetType::EType asset_type)
282: LLAssetUploadResponder(post_data, vfile_id, asset_type)
283{
284}
285
286LLUpdateAgentInventoryResponder::LLUpdateAgentInventoryResponder(const LLSD& post_data,
287 const std::string& file_name)
288: LLAssetUploadResponder(post_data, file_name)
289{
290}
291
292//virtual
293void LLUpdateAgentInventoryResponder::uploadComplete(const LLSD& content)
294{
295 llinfos << "LLUpdateAgentInventoryResponder::result from capabilities" << llendl;
296 LLUUID item_id = mPostData["item_id"];
297
298 LLViewerInventoryItem* item = (LLViewerInventoryItem*)gInventory.getItem(item_id);
299 if(!item)
300 {
301 llwarns << "Inventory item for " << mVFileID
302 << " is no longer in agent inventory." << llendl;
303 return;
304 }
305
306 // Update viewer inventory item
307 LLPointer<LLViewerInventoryItem> new_item = new LLViewerInventoryItem(item);
308 new_item->setAssetUUID(content["new_asset"].asUUID());
309 gInventory.updateItem(new_item);
310 gInventory.notifyObservers();
311
312 llinfos << "Inventory item " << item->getName() << " saved into "
313 << content["new_asset"].asString() << llendl;
314
315 LLInventoryType::EType inventory_type = new_item->getInventoryType();
316 switch(inventory_type)
317 {
318 case LLInventoryType::IT_NOTECARD:
140 { 319 {
141 next_owner_perm = PERM_MOVE | PERM_TRANSFER; 320
321 // Update the UI with the new asset.
322 LLPreviewNotecard* nc;
323 nc = (LLPreviewNotecard*)LLPreview::find(new_item->getUUID());
324 if(nc)
325 {
326 // *HACK: we have to delete the asset in the VFS so
327 // that the viewer will redownload it. This is only
328 // really necessary if the asset had to be modified by
329 // the uploader, so this can be optimized away in some
330 // cases. A better design is to have a new uuid if the
331 // script actually changed the asset.
332 if(nc->hasEmbeddedInventory())
333 {
334 gVFS->removeFile(
335 content["new_asset"].asUUID(),
336 LLAssetType::AT_NOTECARD);
337 }
338 nc->refreshFromInventory();
339 }
142 } 340 }
143 perm.initMasks(PERM_ALL, PERM_ALL, PERM_NONE, PERM_NONE, next_owner_perm); 341 break;
144 S32 creation_date_now = time_corrected(); 342 case LLInventoryType::IT_LSL:
145 LLPointer<LLViewerInventoryItem> item
146 = new LLViewerInventoryItem(result["new_inventory_item"].asUUID(),
147 mPostData["folder_id"].asUUID(),
148 perm,
149 result["new_asset"].asUUID(),
150 asset_type,
151 inventory_type,
152 mPostData["name"].asString(),
153 mPostData["description"].asString(),
154 LLSaleInfo::DEFAULT,
155 LLInventoryItem::II_FLAGS_NONE,
156 creation_date_now);
157 gInventory.updateItem(item);
158 gInventory.notifyObservers();
159
160 // Show the preview panel for textures and sounds to let
161 // user know that the image (or snapshot) arrived intact.
162 LLInventoryView* view = LLInventoryView::getActiveInventory();
163 if(view)
164 { 343 {
165 LLUICtrl* focus_ctrl = gFocusMgr.getKeyboardFocus(); 344 // Find our window and close it if requested.
166 LLFocusMgr::FocusLostCallback callback = gFocusMgr.getFocusCallback(); 345 LLPreviewLSL* preview = (LLPreviewLSL*)LLPreview::find(item_id);
167 346 if (preview)
168 view->getPanel()->setSelection(result["new_inventory_item"].asUUID(), TAKE_FOCUS_NO);
169 if((LLAssetType::AT_TEXTURE == asset_type)
170 || (LLAssetType::AT_SOUND == asset_type))
171 { 347 {
172 view->getPanel()->openSelected(); 348 // Bytecode save completed
349 if (content["compiled"])
350 {
351 preview->callbackLSLCompileSucceeded();
352 }
353 else
354 {
355 preview->callbackLSLCompileFailed(content["errors"]);
356 }
173 } 357 }
174 //LLInventoryView::dumpSelectionInformation((void*)view);
175 // restore keyboard focus
176 gFocusMgr.setKeyboardFocus(focus_ctrl, callback);
177 } 358 }
178 } 359 break;
179 else 360 case LLInventoryType::IT_WEARABLE:
180 { 361 default:
181 llwarns << "Can't find a folder to put it in" << llendl; 362 break;
182 } 363 }
364}
183 365
184 // remove the "Uploading..." message
185 LLUploadDialog::modalUploadFinished();
186
187 // *NOTE: This is a pretty big hack. What this does is check
188 // the file picker if there are any more pending uploads. If
189 // so, upload that file.
190 const char* next_file = LLFilePicker::instance().getNextFile();
191 if(next_file)
192 {
193 const char* name = LLFilePicker::instance().getDirname();
194 366
195 LLString asset_name = name; 367LLUpdateTaskInventoryResponder::LLUpdateTaskInventoryResponder(const LLSD& post_data,
196 LLString::replaceNonstandardASCII( asset_name, '?' ); 368 const LLUUID& vfile_id,
197 LLString::replaceChar(asset_name, '|', '?'); 369 LLAssetType::EType asset_type)
198 LLString::stripNonprintable(asset_name); 370: LLAssetUploadResponder(post_data, vfile_id, asset_type)
199 LLString::trim(asset_name); 371{
372}
200 373
201 char* asset_name_str = (char*)asset_name.c_str(); 374LLUpdateTaskInventoryResponder::LLUpdateTaskInventoryResponder(const LLSD& post_data,
202 char* end_p = strrchr(asset_name_str, '.'); // strip extension if exists 375 const std::string& file_name)
203 if( !end_p ) 376: LLAssetUploadResponder(post_data, file_name)
377{
378}
379
380//virtual
381void LLUpdateTaskInventoryResponder::uploadComplete(const LLSD& content)
382{
383 llinfos << "LLUpdateTaskInventoryResponder::result from capabilities" << llendl;
384 LLUUID item_id = mPostData["item_id"];
385 LLUUID task_id = mPostData["task_id"];
386
387 LLViewerObject* object = gObjectList.findObject(task_id);
388 if (!object)
389 {
390 llwarns << "LLUpdateTaskInventoryResponder::uploadComplete task " << task_id
391 << " no longer exist." << llendl;
392 return;
393 }
394 LLViewerInventoryItem* item = (LLViewerInventoryItem*)object->getInventoryObject(item_id);
395 if (!item)
396 {
397 llwarns << "LLUpdateTaskInventoryResponder::uploadComplete item "
398 << item_id << " is no longer in task " << task_id
399 << "'s inventory." << llendl;
400 return;
401 }
402 LLPointer<LLViewerInventoryItem> new_item = new LLViewerInventoryItem(item);
403 // Update Viewer inventory
404 object->updateViewerInventoryAsset(new_item, content["new_asset"]);
405 dialog_refresh_all();
406
407 LLInventoryType::EType inventory_type = new_item->getInventoryType();
408 switch(inventory_type)
409 {
410 case LLInventoryType::IT_NOTECARD:
204 { 411 {
205 end_p = asset_name_str + strlen( asset_name_str );
206 }
207
208 S32 len = llmin( (S32) (DB_INV_ITEM_NAME_STR_LEN), (S32) (end_p - asset_name_str) );
209 412
210 asset_name = asset_name.substr( 0, len ); 413 // Update the UI with the new asset.
414 LLPreviewNotecard* nc;
415 nc = (LLPreviewNotecard*)LLPreview::find(new_item->getUUID());
416 if(nc)
417 {
418 // *HACK: we have to delete the asset in the VFS so
419 // that the viewer will redownload it. This is only
420 // really necessary if the asset had to be modified by
421 // the uploader, so this can be optimized away in some
422 // cases. A better design is to have a new uuid if the
423 // script actually changed the asset.
424 if(nc->hasEmbeddedInventory())
425 {
426 gVFS->removeFile(
427 content["new_asset"].asUUID(),
428 LLAssetType::AT_NOTECARD);
429 }
211 430
212 upload_new_resource(next_file, asset_name, asset_name, 431 nc->refreshFromInventory();
213 0, LLAssetType::AT_NONE, LLInventoryType::IT_NONE); 432 }
214 } 433 }
434 break;
435 case LLInventoryType::IT_LSL:
436 {
437 LLLiveLSLEditor* preview = LLLiveLSLEditor::find(item_id, task_id);
438 if (preview)
439 {
440 // Bytecode save completed
441 if (content["compiled"])
442 {
443 preview->callbackLSLCompileSucceeded(
444 task_id,
445 item_id,
446 mPostData["is_script_running"]);
447 }
448 else
449 {
450 preview->callbackLSLCompileFailed(content["errors"]);
451 }
452 }
453 }
454 break;
455 case LLInventoryType::IT_WEARABLE:
456 default:
457 break;
215 } 458 }
216} 459}
diff --git a/linden/indra/newview/llassetuploadresponders.h b/linden/indra/newview/llassetuploadresponders.h
index 13d535e..ef8cd38 100644
--- a/linden/indra/newview/llassetuploadresponders.h
+++ b/linden/indra/newview/llassetuploadresponders.h
@@ -1,45 +1,65 @@
1/** 1// llassetuploadresponders.h
2 * @file llmapresponders.h 2// Copyright 2006, Linden Research, Inc.
3 * @brief Processes responses received for asset upload requests. 3// Processes responses received for asset upload requests.
4 * 4
5 * Copyright (c) 2006-2007, Linden Research, Inc. 5#ifndef LL_LLASSETUPLOADRESPONDER_H
6 * 6#define LL_LLASSETUPLOADRESPONDER_H
7 * The source code in this file ("Source Code") is provided by Linden Lab
8 * to you under the terms of the GNU General Public License, version 2.0
9 * ("GPL"), unless you have obtained a separate licensing agreement
10 * ("Other License"), formally executed by you and Linden Lab. Terms of
11 * the GPL can be found in doc/GPL-license.txt in this distribution, or
12 * online at http://secondlife.com/developers/opensource/gplv2
13 *
14 * There are special exceptions to the terms and conditions of the GPL as
15 * it is applied to this Source Code. View the full text of the exception
16 * in the file doc/FLOSS-exception.txt in this software distribution, or
17 * online at http://secondlife.com/developers/opensource/flossexception
18 *
19 * By copying, modifying or distributing this software, you acknowledge
20 * that you have read and understood your obligations described above,
21 * and agree to abide by those obligations.
22 *
23 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
24 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
25 * COMPLETENESS OR PERFORMANCE.
26 */
27
28#ifndef LL_LLNEWAGENTINVENTORYRESPONDER_H
29#define LL_LLNEWAGENTINVENTORYRESPONDER_H
30 7
31#include "llhttpclient.h" 8#include "llhttpclient.h"
32 9
33class LLNewAgentInventoryResponder : public LLHTTPClient::Responder 10// Abstract class for supporting asset upload
11// via capabilities
12class LLAssetUploadResponder : public LLHTTPClient::Responder
34{ 13{
35public: 14public:
36 LLNewAgentInventoryResponder(const LLUUID& uuid, const LLSD& post_data); 15 LLAssetUploadResponder(const LLSD& post_data,
37 void error(U32 statusNum, const std::string& reason); 16 const LLUUID& vfile_id,
17 LLAssetType::EType asset_type);
18 LLAssetUploadResponder(const LLSD& post_data, const std::string& file_name);
19 ~LLAssetUploadResponder();
20 virtual void error(U32 statusNum, const std::string& reason);
38 virtual void result(const LLSD& content); 21 virtual void result(const LLSD& content);
22 virtual void uploadUpload(const LLSD& content);
23 virtual void uploadComplete(const LLSD& content);
24 virtual void uploadFailure(const LLSD& content);
39 25
40private: 26protected:
41 LLUUID mUUID;
42 LLSD mPostData; 27 LLSD mPostData;
28 LLUUID mVFileID;
29 LLAssetType::EType mAssetType;
30 std::string mFileName;
31};
32
33class LLNewAgentInventoryResponder : public LLAssetUploadResponder
34{
35public:
36 LLNewAgentInventoryResponder(const LLSD& post_data,
37 const LLUUID& vfile_id,
38 LLAssetType::EType asset_type);
39 LLNewAgentInventoryResponder(const LLSD& post_data, const std::string& file_name);
40 virtual void uploadComplete(const LLSD& content);
41};
42
43class LLUpdateAgentInventoryResponder : public LLAssetUploadResponder
44{
45public:
46 LLUpdateAgentInventoryResponder(const LLSD& post_data,
47 const LLUUID& vfile_id,
48 LLAssetType::EType asset_type);
49 LLUpdateAgentInventoryResponder(const LLSD& post_data,
50 const std::string& file_name);
51 virtual void uploadComplete(const LLSD& content);
52};
53
54class LLUpdateTaskInventoryResponder : public LLAssetUploadResponder
55{
56public:
57 LLUpdateTaskInventoryResponder(const LLSD& post_data,
58 const LLUUID& vfile_id,
59 LLAssetType::EType asset_type);
60 LLUpdateTaskInventoryResponder(const LLSD& post_data,
61 const std::string& file_name);
62 virtual void uploadComplete(const LLSD& content);
43}; 63};
44 64
45#endif // LL_LLNEWAGENTINVENTORYRESPONDER_H 65#endif // LL_LLASSETUPLOADRESPONDER_H
diff --git a/linden/indra/newview/llasynchostbyname.h b/linden/indra/newview/llasynchostbyname.h
index 39f1b82..351fc2a 100644
--- a/linden/indra/newview/llasynchostbyname.h
+++ b/linden/indra/newview/llasynchostbyname.h
@@ -52,7 +52,7 @@ public:
52 static void handleMessageCallback(const MSG& msg); 52 static void handleMessageCallback(const MSG& msg);
53private: 53private:
54 HANDLE mRequestHandle; 54 HANDLE mRequestHandle;
55 char mOutputBuffer[ MAXGETHOSTSTRUCT ]; 55 char mOutputBuffer[ MAXGETHOSTSTRUCT ]; /*Flawfinder: ignore*/
56 56
57 LLAsyncHostByNameCallback mCallback; 57 LLAsyncHostByNameCallback mCallback;
58 void* mUserdata; 58 void* mUserdata;
diff --git a/linden/indra/newview/llcallingcard.cpp b/linden/indra/newview/llcallingcard.cpp
index 83a5fac..d1fdda6 100644
--- a/linden/indra/newview/llcallingcard.cpp
+++ b/linden/indra/newview/llcallingcard.cpp
@@ -262,8 +262,8 @@ S32 LLAvatarTracker::addBuddyList(const LLAvatarTracker::buddy_map_t& buds)
262 using namespace std; 262 using namespace std;
263 263
264 U32 new_buddy_count = 0; 264 U32 new_buddy_count = 0;
265 char first[DB_FIRST_NAME_BUF_SIZE]; 265 char first[DB_FIRST_NAME_BUF_SIZE]; /*Flawfinder: ignore*/
266 char last[DB_LAST_NAME_BUF_SIZE]; 266 char last[DB_LAST_NAME_BUF_SIZE]; /*Flawfinder: ignore*/
267 LLUUID agent_id; 267 LLUUID agent_id;
268 for(buddy_map_t::const_iterator itr = buds.begin(); itr != buds.end(); ++itr) 268 for(buddy_map_t::const_iterator itr = buds.begin(); itr != buds.end(); ++itr)
269 { 269 {
@@ -560,8 +560,8 @@ void LLAvatarTracker::processChange(LLMessageSystem* msg)
560 { 560 {
561 if((mBuddyInfo[agent_id]->getRightsGrantedFrom() ^ new_rights) & LLRelationship::GRANT_MODIFY_OBJECTS) 561 if((mBuddyInfo[agent_id]->getRightsGrantedFrom() ^ new_rights) & LLRelationship::GRANT_MODIFY_OBJECTS)
562 { 562 {
563 char first[DB_FIRST_NAME_BUF_SIZE]; 563 char first[DB_FIRST_NAME_BUF_SIZE]; /*Flawfinder: ignore*/
564 char last[DB_LAST_NAME_BUF_SIZE]; 564 char last[DB_LAST_NAME_BUF_SIZE]; /*Flawfinder: ignore*/
565 LLStringBase<char>::format_map_t args; 565 LLStringBase<char>::format_map_t args;
566 if(gCacheName->getName(agent_id, first, last)) 566 if(gCacheName->getName(agent_id, first, last))
567 { 567 {
@@ -617,8 +617,8 @@ void LLAvatarTracker::processNotify(LLMessageSystem* msg, bool online)
617 setBuddyOnline(agent_id,online); 617 setBuddyOnline(agent_id,online);
618 if(chat_notify) 618 if(chat_notify)
619 { 619 {
620 char first[DB_FIRST_NAME_BUF_SIZE]; 620 char first[DB_FIRST_NAME_BUF_SIZE]; /*Flawfinder: ignore*/
621 char last[DB_LAST_NAME_BUF_SIZE]; 621 char last[DB_LAST_NAME_BUF_SIZE]; /*Flawfinder: ignore*/
622 if(gCacheName->getName(agent_id, first, last)) 622 if(gCacheName->getName(agent_id, first, last))
623 { 623 {
624 notify = TRUE; 624 notify = TRUE;
diff --git a/linden/indra/newview/llcallingcard.h b/linden/indra/newview/llcallingcard.h
index 75d06ee..1b2a643 100644
--- a/linden/indra/newview/llcallingcard.h
+++ b/linden/indra/newview/llcallingcard.h
@@ -208,8 +208,8 @@ public:
208 virtual bool operator()(const LLUUID& buddy_id, LLRelationship* buddy); 208 virtual bool operator()(const LLUUID& buddy_id, LLRelationship* buddy);
209 typedef std::map<std::string, LLUUID, LLDictionaryLess> buddy_map_t; 209 typedef std::map<std::string, LLUUID, LLDictionaryLess> buddy_map_t;
210 buddy_map_t mMappable; 210 buddy_map_t mMappable;
211 char mFirst[DB_FIRST_NAME_BUF_SIZE]; 211 char mFirst[DB_FIRST_NAME_BUF_SIZE]; /* Flawfinder: ignore */
212 char mLast[DB_LAST_NAME_BUF_SIZE]; 212 char mLast[DB_LAST_NAME_BUF_SIZE]; /* Flawfinder: ignore */
213}; 213};
214 214
215// collect dictionary sorted map of name -> agent_id for every online buddy 215// collect dictionary sorted map of name -> agent_id for every online buddy
@@ -221,8 +221,8 @@ public:
221 virtual bool operator()(const LLUUID& buddy_id, LLRelationship* buddy); 221 virtual bool operator()(const LLUUID& buddy_id, LLRelationship* buddy);
222 typedef std::map<std::string, LLUUID, LLDictionaryLess> buddy_map_t; 222 typedef std::map<std::string, LLUUID, LLDictionaryLess> buddy_map_t;
223 buddy_map_t mOnline; 223 buddy_map_t mOnline;
224 char mFirst[DB_FIRST_NAME_BUF_SIZE]; 224 char mFirst[DB_FIRST_NAME_BUF_SIZE]; /*Flawfinder: ignore*/
225 char mLast[DB_LAST_NAME_BUF_SIZE]; 225 char mLast[DB_LAST_NAME_BUF_SIZE]; /*Flawfinder: ignore*/
226}; 226};
227 227
228// collect dictionary sorted map of name -> agent_id for every buddy, 228// collect dictionary sorted map of name -> agent_id for every buddy,
@@ -236,8 +236,8 @@ public:
236 typedef std::map<std::string, LLUUID, LLDictionaryLess> buddy_map_t; 236 typedef std::map<std::string, LLUUID, LLDictionaryLess> buddy_map_t;
237 buddy_map_t mOnline; 237 buddy_map_t mOnline;
238 buddy_map_t mOffline; 238 buddy_map_t mOffline;
239 char mFirst[DB_FIRST_NAME_BUF_SIZE]; 239 char mFirst[DB_FIRST_NAME_BUF_SIZE]; /*Flawfinder: ignore*/
240 char mLast[DB_LAST_NAME_BUF_SIZE]; 240 char mLast[DB_LAST_NAME_BUF_SIZE]; /*Flawfinder: ignore*/
241}; 241};
242 242
243#endif // LL_LLCALLINGCARD_H 243#endif // LL_LLCALLINGCARD_H
diff --git a/linden/indra/newview/llcameraview.cpp b/linden/indra/newview/llcameraview.cpp
index c510823..6c63359 100644
--- a/linden/indra/newview/llcameraview.cpp
+++ b/linden/indra/newview/llcameraview.cpp
@@ -124,17 +124,11 @@ void LLFloaterCamera::onClose(bool app_quitting)
124// static 124// static
125void LLFloaterCamera::show(void*) 125void LLFloaterCamera::show(void*)
126{ 126{
127 if (gFloaterCamera) 127 if(!gFloaterCamera)
128 {
129 gFloaterCamera->open();
130 }
131 else
132 { 128 {
133 gFloaterCamera = new LLFloaterCamera("camera floater"); 129 gFloaterCamera = new LLFloaterCamera("camera floater");
134
135 gFloaterCamera->open();
136 } 130 }
137 131 gFloaterCamera->open(); /* Flawfinder: ignore */
138 gSavedSettings.setBOOL("ShowCameraControls", TRUE); 132 gSavedSettings.setBOOL("ShowCameraControls", TRUE);
139} 133}
140 134
diff --git a/linden/indra/newview/llchatbar.cpp b/linden/indra/newview/llchatbar.cpp
index e62e0cb..394399e 100644
--- a/linden/indra/newview/llchatbar.cpp
+++ b/linden/indra/newview/llchatbar.cpp
@@ -599,8 +599,6 @@ void LLChatBar::onInputEditorKeystroke( LLLineEditor* caller, void* userdata )
599 // << " outlen " << out_str.getLength() 599 // << " outlen " << out_str.getLength()
600 // << llendl; 600 // << llendl;
601 } 601 }
602 // make sure we don't do UI-only render as it is apparent avatar isn't animating
603 gViewerWindow->finishFastFrame();
604} 602}
605 603
606// static 604// static
diff --git a/linden/indra/newview/llcloud.cpp b/linden/indra/newview/llcloud.cpp
index ca05562..b14f6d5 100644
--- a/linden/indra/newview/llcloud.cpp
+++ b/linden/indra/newview/llcloud.cpp
@@ -116,16 +116,14 @@ void LLCloudGroup::updatePuffs(const F32 dt)
116 mVOCloudsp->setPositionRegion(mCenterRegion); 116 mVOCloudsp->setPositionRegion(mCenterRegion);
117 mVOCloudsp->setScale(LLVector3(256.f/CLOUD_GROUPS_PER_EDGE + CLOUD_PUFF_WIDTH, 117 mVOCloudsp->setScale(LLVector3(256.f/CLOUD_GROUPS_PER_EDGE + CLOUD_PUFF_WIDTH,
118 256.f/CLOUD_GROUPS_PER_EDGE + CLOUD_PUFF_WIDTH, 118 256.f/CLOUD_GROUPS_PER_EDGE + CLOUD_PUFF_WIDTH,
119 CLOUD_HEIGHT_RANGE + CLOUD_PUFF_HEIGHT)); 119 CLOUD_HEIGHT_RANGE + CLOUD_PUFF_HEIGHT)*0.5f);
120 gPipeline.addObject(mVOCloudsp); 120 gPipeline.addObject(mVOCloudsp);
121 } 121 }
122 122
123 S32 i;
124
125 LLVector3 velocity; 123 LLVector3 velocity;
126 LLVector3d vel_d; 124 LLVector3d vel_d;
127 // Update the positions of all of the clouds 125 // Update the positions of all of the clouds
128 for (i = 0; i < mCloudPuffs.count(); i++) 126 for (U32 i = 0; i < mCloudPuffs.size(); i++)
129 { 127 {
130 LLCloudPuff &puff = mCloudPuffs[i]; 128 LLCloudPuff &puff = mCloudPuffs[i];
131 velocity = mCloudLayerp->getRegion()->mWind.getCloudVelocity(mCloudLayerp->getRegion()->getPosRegionFromGlobal(puff.mPositionGlobal)); 129 velocity = mCloudLayerp->getRegion()->mWind.getCloudVelocity(mCloudLayerp->getRegion()->getPosRegionFromGlobal(puff.mPositionGlobal));
@@ -140,8 +138,8 @@ void LLCloudGroup::updatePuffs(const F32 dt)
140 138
141void LLCloudGroup::updatePuffOwnership() 139void LLCloudGroup::updatePuffOwnership()
142{ 140{
143 S32 i = 0; 141 U32 i = 0;
144 while (i < mCloudPuffs.count()) 142 while (i < mCloudPuffs.size())
145 { 143 {
146 if (mCloudPuffs[i].getLifeState() == LL_PUFF_DYING) 144 if (mCloudPuffs[i].getLifeState() == LL_PUFF_DYING)
147 { 145 {
@@ -165,10 +163,11 @@ void LLCloudGroup::updatePuffOwnership()
165 continue; 163 continue;
166 } 164 }
167 //llinfos << "Puff handed off!" << llendl; 165 //llinfos << "Puff handed off!" << llendl;
168 LLCloudPuff *puffp = new_cgp->mCloudPuffs.reserve_block(1); 166 LLCloudPuff puff;
169 puffp->mPositionGlobal = mCloudPuffs[i].mPositionGlobal; 167 puff.mPositionGlobal = mCloudPuffs[i].mPositionGlobal;
170 puffp->mAlpha = mCloudPuffs[i].mAlpha; 168 puff.mAlpha = mCloudPuffs[i].mAlpha;
171 mCloudPuffs.remove(i); 169 mCloudPuffs.erase(mCloudPuffs.begin() + i);
170 new_cgp->mCloudPuffs.push_back(puff);
172 } 171 }
173 172
174 //llinfos << "Puff count: " << LLCloudPuff::sPuffCount << llendl; 173 //llinfos << "Puff count: " << LLCloudPuff::sPuffCount << llendl;
@@ -184,7 +183,7 @@ void LLCloudGroup::updatePuffCount()
184 S32 target_puff_count = llround(CLOUD_DENSITY * mDensity); 183 S32 target_puff_count = llround(CLOUD_DENSITY * mDensity);
185 target_puff_count = llmax(0, target_puff_count); 184 target_puff_count = llmax(0, target_puff_count);
186 target_puff_count = llmin(CLOUD_COUNT_MAX, target_puff_count); 185 target_puff_count = llmin(CLOUD_COUNT_MAX, target_puff_count);
187 S32 current_puff_count = mCloudPuffs.count(); 186 S32 current_puff_count = (S32) mCloudPuffs.size();
188 // Create a new cloud if we need one 187 // Create a new cloud if we need one
189 if (current_puff_count < target_puff_count) 188 if (current_puff_count < target_puff_count)
190 { 189 {
@@ -205,7 +204,7 @@ void LLCloudGroup::updatePuffCount()
205 204
206 // Count the number of live puffs 205 // Count the number of live puffs
207 S32 live_puff_count = 0; 206 S32 live_puff_count = 0;
208 for (i = 0; i < mCloudPuffs.count(); i++) 207 for (i = 0; i < (S32) mCloudPuffs.size(); i++)
209 { 208 {
210 if (mCloudPuffs[i].getLifeState() != LL_PUFF_DYING) 209 if (mCloudPuffs[i].getLifeState() != LL_PUFF_DYING)
211 { 210 {
@@ -231,12 +230,12 @@ void LLCloudGroup::updatePuffCount()
231 230
232 // Remove fully dead puffs 231 // Remove fully dead puffs
233 i = 0; 232 i = 0;
234 while (i < mCloudPuffs.count()) 233 while (i < (S32) mCloudPuffs.size())
235 { 234 {
236 if (mCloudPuffs[i].isDead()) 235 if (mCloudPuffs[i].isDead())
237 { 236 {
238 //llinfos << "Removing dead puff!" << llendl; 237 //llinfos << "Removing dead puff!" << llendl;
239 mCloudPuffs.remove(i); 238 mCloudPuffs.erase(mCloudPuffs.begin() + i);
240 LLCloudPuff::sPuffCount--; 239 LLCloudPuff::sPuffCount--;
241 } 240 }
242 else 241 else
diff --git a/linden/indra/newview/llcloud.h b/linden/indra/newview/llcloud.h
index 8567792..0b670ee 100644
--- a/linden/indra/newview/llcloud.h
+++ b/linden/indra/newview/llcloud.h
@@ -129,7 +129,7 @@ public:
129 BOOL inGroup(const LLCloudPuff &puff) const; 129 BOOL inGroup(const LLCloudPuff &puff) const;
130 130
131 F32 getDensity() const { return mDensity; } 131 F32 getDensity() const { return mDensity; }
132 S32 getNumPuffs() const { return mCloudPuffs.count(); } 132 S32 getNumPuffs() const { return (S32) mCloudPuffs.size(); }
133 const LLCloudPuff &getPuff(const S32 i) { return mCloudPuffs[i]; } 133 const LLCloudPuff &getPuff(const S32 i) { return mCloudPuffs[i]; }
134protected: 134protected:
135 LLCloudLayer *mCloudLayerp; 135 LLCloudLayer *mCloudLayerp;
@@ -137,7 +137,7 @@ protected:
137 F32 mDensity; 137 F32 mDensity;
138 S32 mTargetPuffCount; 138 S32 mTargetPuffCount;
139 139
140 LLDynamicArray<LLCloudPuff> mCloudPuffs; 140 std::vector<LLCloudPuff> mCloudPuffs;
141 LLPointer<LLVOClouds> mVOCloudsp; 141 LLPointer<LLVOClouds> mVOCloudsp;
142}; 142};
143 143
diff --git a/linden/indra/newview/llcolorswatch.h b/linden/indra/newview/llcolorswatch.h
index 98bc85e..b52d6ac 100644
--- a/linden/indra/newview/llcolorswatch.h
+++ b/linden/indra/newview/llcolorswatch.h
@@ -31,6 +31,7 @@
31#include "lluictrl.h" 31#include "lluictrl.h"
32#include "v4color.h" 32#include "v4color.h"
33#include "llfloater.h" 33#include "llfloater.h"
34#include "llviewerimage.h"
34 35
35// 36//
36// Classes 37// Classes
diff --git a/linden/indra/newview/llcompilequeue.cpp b/linden/indra/newview/llcompilequeue.cpp
index e42677d..c5ad2b9 100644
--- a/linden/indra/newview/llcompilequeue.cpp
+++ b/linden/indra/newview/llcompilequeue.cpp
@@ -197,8 +197,8 @@ void LLFloaterScriptQueue::addObject(const LLUUID& id)
197BOOL LLFloaterScriptQueue::start() 197BOOL LLFloaterScriptQueue::start()
198{ 198{
199 //llinfos << "LLFloaterCompileQueue::start()" << llendl; 199 //llinfos << "LLFloaterCompileQueue::start()" << llendl;
200 char buffer[MAX_STRING]; 200 char buffer[MAX_STRING]; /*Flawfinder: ignore*/
201 sprintf(buffer, "Starting %s of %d items.", mStartString, mObjectIDs.count()); 201 snprintf(buffer, sizeof(buffer), "Starting %s of %d items.", mStartString, mObjectIDs.count()); /*Flawfinder: ignore*/
202 202
203 LLScrollListCtrl* list = LLUICtrlFactory::getScrollListByName(this, "queue output"); 203 LLScrollListCtrl* list = LLUICtrlFactory::getScrollListByName(this, "queue output");
204 list->addSimpleItem(buffer); 204 list->addSimpleItem(buffer);
@@ -237,8 +237,8 @@ BOOL LLFloaterScriptQueue::nextObject()
237 LLScrollListCtrl* list = LLUICtrlFactory::getScrollListByName(this, "queue output"); 237 LLScrollListCtrl* list = LLUICtrlFactory::getScrollListByName(this, "queue output");
238 238
239 mDone = TRUE; 239 mDone = TRUE;
240 char buffer[MAX_STRING]; 240 char buffer[MAX_STRING]; /*Flawfinder: ignore*/
241 sprintf(buffer, "Done."); 241 snprintf(buffer, sizeof(buffer), "Done."); /*Flawfinder: ignore*/
242 list->addSimpleItem(buffer); 242 list->addSimpleItem(buffer);
243 childSetEnabled("close",TRUE); 243 childSetEnabled("close",TRUE);
244 } 244 }
@@ -287,7 +287,7 @@ LLFloaterCompileQueue* LLFloaterCompileQueue::create()
287 rect.translate(left - rect.mLeft, top - rect.mTop); 287 rect.translate(left - rect.mLeft, top - rect.mTop);
288 LLFloaterCompileQueue* new_queue = new LLFloaterCompileQueue("queue", 288 LLFloaterCompileQueue* new_queue = new LLFloaterCompileQueue("queue",
289 rect); 289 rect);
290 new_queue->open(); 290 new_queue->open(); /*Flawfinder: ignore*/
291 return new_queue; 291 return new_queue;
292} 292}
293 293
@@ -372,25 +372,25 @@ void LLFloaterCompileQueue::scriptArrived(LLVFS *vfs, const LLUUID& asset_id,
372 if(!data) return; 372 if(!data) return;
373 LLFloaterCompileQueue* queue = static_cast<LLFloaterCompileQueue*> 373 LLFloaterCompileQueue* queue = static_cast<LLFloaterCompileQueue*>
374 (LLFloaterScriptQueue::findInstance(data->mQueueID)); 374 (LLFloaterScriptQueue::findInstance(data->mQueueID));
375 char buffer[MAX_STRING]; 375 char buffer[MAX_STRING]; /*Flawfinder: ignore*/
376 buffer[0] = '\0'; 376 buffer[0] = '\0';
377 if(queue && (0 == status)) 377 if(queue && (0 == status))
378 { 378 {
379 //llinfos << "ITEM NAME 3: " << data->mScriptName << llendl; 379 //llinfos << "ITEM NAME 3: " << data->mScriptName << llendl;
380 380
381 // Dump this into a file on the local disk so we can compile it. 381 // Dump this into a file on the local disk so we can compile it.
382 char filename[LL_MAX_PATH] = ""; 382 char filename[LL_MAX_PATH] = ""; /*Flawfinder: ignore*/
383 LLVFile file(vfs, asset_id, type); 383 LLVFile file(vfs, asset_id, type);
384 char uuid_str[UUID_STR_LENGTH]; 384 char uuid_str[UUID_STR_LENGTH]; /*Flawfinder: ignore*/
385 asset_id.toString(uuid_str); 385 asset_id.toString(uuid_str);
386 sprintf(filename,"%s.%s",gDirUtilp->getExpandedFilename(LL_PATH_CACHE,uuid_str).c_str(),LLAssetType::lookup(type)); 386 snprintf(filename, sizeof(filename), "%s.%s",gDirUtilp->getExpandedFilename(LL_PATH_CACHE,uuid_str).c_str(),LLAssetType::lookup(type)); /*Flawfinder: ignore*/
387 387
388 FILE *fp = LLFile::fopen(filename, "wb"); 388 FILE *fp = LLFile::fopen(filename, "wb"); /*Flawfinder: ignore*/
389 if (fp) 389 if (fp)
390 { 390 {
391 const S32 buf_size = 65536; 391 const S32 buf_size = 65536;
392 U8 copy_buf[buf_size]; 392 U8 copy_buf[buf_size];
393 while (file.read(copy_buf, buf_size)) 393 while (file.read(copy_buf, buf_size)) /*Flawfinder: ignore*/
394 { 394 {
395 if (fwrite(copy_buf, file.getLastBytesRead(), 1, fp) < 1) 395 if (fwrite(copy_buf, file.getLastBytesRead(), 1, fp) < 1)
396 { 396 {
@@ -403,7 +403,7 @@ void LLFloaterCompileQueue::scriptArrived(LLVFS *vfs, const LLUUID& asset_id,
403 } 403 }
404 404
405 // It's now in the file, now compile it. 405 // It's now in the file, now compile it.
406 sprintf(buffer, "Downloaded, now compiling '%s'.", data->mScriptName.c_str()); 406 snprintf(buffer, sizeof(buffer), "Downloaded, now compiling '%s'.", data->mScriptName.c_str()); /*Flawfinder: ignore*/
407 queue->compile(filename, asset_id); 407 queue->compile(filename, asset_id);
408 408
409 // Delete it after we're done compiling? 409 // Delete it after we're done compiling?
@@ -420,19 +420,19 @@ void LLFloaterCompileQueue::scriptArrived(LLVFS *vfs, const LLUUID& asset_id,
420 { 420 {
421 LLChat chat("Script not found on server."); 421 LLChat chat("Script not found on server.");
422 LLFloaterChat::addChat(chat); 422 LLFloaterChat::addChat(chat);
423 sprintf(buffer, "Problem downloading %s.", 423 snprintf(buffer, sizeof(buffer), "Problem downloading %s.", /*Flawfinder: ignore*/
424 data->mScriptName.c_str()); 424 data->mScriptName.c_str());
425 } 425 }
426 else if (LL_ERR_INSUFFICIENT_PERMISSIONS == status) 426 else if (LL_ERR_INSUFFICIENT_PERMISSIONS == status)
427 { 427 {
428 LLChat chat("Insufficient permissions to download a script."); 428 LLChat chat("Insufficient permissions to download a script.");
429 LLFloaterChat::addChat(chat); 429 LLFloaterChat::addChat(chat);
430 sprintf(buffer, "Insufficient permissions for '%s'.", 430 snprintf(buffer, sizeof(buffer), "Insufficient permissions for '%s'.", /*Flawfinder: ignore*/
431 data->mScriptName.c_str()); 431 data->mScriptName.c_str());
432 } 432 }
433 else 433 else
434 { 434 {
435 sprintf(buffer, "Unknown failure to download %s.", 435 snprintf(buffer, sizeof(buffer), "Unknown failure to download %s.", /*Flawfinder: ignore*/
436 data->mScriptName.c_str()); 436 data->mScriptName.c_str());
437 } 437 }
438 438
@@ -493,12 +493,12 @@ void LLFloaterCompileQueue::compile(const char* filename,
493 tid.generate(); 493 tid.generate();
494 new_asset_id = tid.makeAssetID(gAgent.getSecureSessionID()); 494 new_asset_id = tid.makeAssetID(gAgent.getSecureSessionID());
495 495
496 char uuid_string[UUID_STR_LENGTH]; 496 char uuid_string[UUID_STR_LENGTH]; /*Flawfinder: ignore*/
497 new_asset_id.toString(uuid_string); 497 new_asset_id.toString(uuid_string);
498 char dst_filename[LL_MAX_PATH]; 498 char dst_filename[LL_MAX_PATH]; /*Flawfinder: ignore*/
499 sprintf(dst_filename, "%s.lso", gDirUtilp->getExpandedFilename(LL_PATH_CACHE,uuid_string).c_str()); 499 snprintf(dst_filename, sizeof(dst_filename), "%s.lso", gDirUtilp->getExpandedFilename(LL_PATH_CACHE,uuid_string).c_str()); /*Flawfinder: ignore*/
500 char err_filename[LL_MAX_PATH]; 500 char err_filename[LL_MAX_PATH]; /*Flawfinder: ignore*/
501 sprintf(err_filename, "%s.out", gDirUtilp->getExpandedFilename(LL_PATH_CACHE,uuid_string).c_str()); 501 snprintf(err_filename, sizeof(err_filename), "%s.out", gDirUtilp->getExpandedFilename(LL_PATH_CACHE,uuid_string).c_str()); /*Flawfinder: ignore*/
502 502
503 gAssetStorage->storeAssetData(filename, tid, 503 gAssetStorage->storeAssetData(filename, tid,
504 LLAssetType::AT_LSL_TEXT, 504 LLAssetType::AT_LSL_TEXT,
@@ -590,7 +590,7 @@ LLFloaterResetQueue* LLFloaterResetQueue::create()
590 rect.translate(left - rect.mLeft, top - rect.mTop); 590 rect.translate(left - rect.mLeft, top - rect.mTop);
591 LLFloaterResetQueue* new_queue = new LLFloaterResetQueue("queue", 591 LLFloaterResetQueue* new_queue = new LLFloaterResetQueue("queue",
592 rect); 592 rect);
593 new_queue->open(); 593 new_queue->open(); /*Flawfinder: ignore*/
594 return new_queue; 594 return new_queue;
595} 595}
596 596
@@ -621,8 +621,8 @@ void LLFloaterResetQueue::handleInventory(LLViewerObject* viewer_obj,
621 { 621 {
622 LLInventoryItem* item = (LLInventoryItem*)((LLInventoryObject*)(*it)); 622 LLInventoryItem* item = (LLInventoryItem*)((LLInventoryObject*)(*it));
623 LLScrollListCtrl* list = LLUICtrlFactory::getScrollListByName(this, "queue output"); 623 LLScrollListCtrl* list = LLUICtrlFactory::getScrollListByName(this, "queue output");
624 char buffer[MAX_STRING]; 624 char buffer[MAX_STRING]; /*Flawfinder: ignore*/
625 sprintf(buffer, "Resetting '%s'.", item->getName().c_str()); 625 snprintf(buffer, sizeof(buffer), "Resetting '%s'.", item->getName().c_str()); /*Flawfinder: ignore*/
626 list->addSimpleItem(buffer); 626 list->addSimpleItem(buffer);
627 LLMessageSystem* msg = gMessageSystem; 627 LLMessageSystem* msg = gMessageSystem;
628 msg->newMessageFast(_PREHASH_ScriptReset); 628 msg->newMessageFast(_PREHASH_ScriptReset);
@@ -653,7 +653,7 @@ LLFloaterRunQueue* LLFloaterRunQueue::create()
653 rect.translate(left - rect.mLeft, top - rect.mTop); 653 rect.translate(left - rect.mLeft, top - rect.mTop);
654 LLFloaterRunQueue* new_queue = new LLFloaterRunQueue("queue", 654 LLFloaterRunQueue* new_queue = new LLFloaterRunQueue("queue",
655 rect); 655 rect);
656 new_queue->open(); 656 new_queue->open(); /*Flawfinder: ignore*/
657 return new_queue; 657 return new_queue;
658} 658}
659 659
@@ -684,8 +684,8 @@ void LLFloaterRunQueue::handleInventory(LLViewerObject* viewer_obj,
684 { 684 {
685 LLInventoryItem* item = (LLInventoryItem*)((LLInventoryObject*)(*it)); 685 LLInventoryItem* item = (LLInventoryItem*)((LLInventoryObject*)(*it));
686 LLScrollListCtrl* list = LLUICtrlFactory::getScrollListByName(this, "queue output"); 686 LLScrollListCtrl* list = LLUICtrlFactory::getScrollListByName(this, "queue output");
687 char buffer[MAX_STRING]; 687 char buffer[MAX_STRING]; /*Flawfinder: ignore*/
688 sprintf(buffer, "Running '%s'.", item->getName().c_str()); 688 snprintf(buffer, sizeof(buffer), "Running '%s'.", item->getName().c_str()); /*Flawfinder: ignore*/
689 list->addSimpleItem(buffer); 689 list->addSimpleItem(buffer);
690 690
691 LLMessageSystem* msg = gMessageSystem; 691 LLMessageSystem* msg = gMessageSystem;
@@ -718,7 +718,7 @@ LLFloaterNotRunQueue* LLFloaterNotRunQueue::create()
718 rect.translate(left - rect.mLeft, top - rect.mTop); 718 rect.translate(left - rect.mLeft, top - rect.mTop);
719 LLFloaterNotRunQueue* new_queue = new LLFloaterNotRunQueue("queue", 719 LLFloaterNotRunQueue* new_queue = new LLFloaterNotRunQueue("queue",
720 rect); 720 rect);
721 new_queue->open(); 721 new_queue->open(); /*Flawfinder: ignore*/
722 return new_queue; 722 return new_queue;
723} 723}
724 724
@@ -749,8 +749,8 @@ void LLFloaterNotRunQueue::handleInventory(LLViewerObject* viewer_obj,
749 { 749 {
750 LLInventoryItem* item = (LLInventoryItem*)((LLInventoryObject*)(*it)); 750 LLInventoryItem* item = (LLInventoryItem*)((LLInventoryObject*)(*it));
751 LLScrollListCtrl* list = LLUICtrlFactory::getScrollListByName(this, "queue output"); 751 LLScrollListCtrl* list = LLUICtrlFactory::getScrollListByName(this, "queue output");
752 char buffer[MAX_STRING]; 752 char buffer[MAX_STRING]; /*Flawfinder: ignore*/
753 sprintf(buffer, "Not running '%s'.", item->getName().c_str()); 753 snprintf(buffer, sizeof(buffer), "Not running '%s'.", item->getName().c_str()); /*Flawfinder: ignore*/
754 list->addSimpleItem(buffer); 754 list->addSimpleItem(buffer);
755 755
756 LLMessageSystem* msg = gMessageSystem; 756 LLMessageSystem* msg = gMessageSystem;
diff --git a/linden/indra/newview/llconsole.cpp b/linden/indra/newview/llconsole.cpp
index 1ed0e17..ce092a7 100644
--- a/linden/indra/newview/llconsole.cpp
+++ b/linden/indra/newview/llconsole.cpp
@@ -118,6 +118,8 @@ void LLConsole::draw()
118{ 118{
119 LLGLSUIDefault gls_ui; 119 LLGLSUIDefault gls_ui;
120 120
121 addQueuedLines();
122
121 // skip lines added more than mLinePersistTime ago 123 // skip lines added more than mLinePersistTime ago
122 F32 cur_time = mTimer.getElapsedTimeF32(); 124 F32 cur_time = mTimer.getElapsedTimeF32();
123 125
@@ -243,38 +245,57 @@ void LLConsole::addLine(const LLString& utf8line, F32 size, const LLColor4 &colo
243 245
244void LLConsole::addLine(const LLWString& wline, F32 size, const LLColor4 &color) 246void LLConsole::addLine(const LLWString& wline, F32 size, const LLColor4 &color)
245{ 247{
246 if (!wline.empty() && mFont != NULL) 248 while (mLineQueue.size() >= mMaxLines)
249 {
250 mLineQueue.pop_front();
251 }
252 mLineQueue.push_back(LineInfo(wline, size, color, mTimer.getElapsedTimeF32()));
253}
254
255void LLConsole::addQueuedLines()
256{
257 for (line_queue_t::iterator iter = mLineQueue.begin();
258 iter != mLineQueue.end(); ++iter)
247 { 259 {
248 // Wrap lines that are longer than the view is wide. 260 LineInfo& line_info = *iter;
249 S32 offset = 0; 261 LLWString wline = line_info.wline;
250 while( offset < (S32)wline.length() ) 262 //F32 size = line_info.size;
263 LLColor4 color = line_info.color;
264 if (!wline.empty() && mFont != NULL)
251 { 265 {
252 S32 skip_chars; // skip '\n' 266 // Wrap lines that are longer than the view is wide.
253 // Figure out if a word-wrapped line fits here. 267 S32 offset = 0;
254 LLWString::size_type line_end = wline.find_first_of(llwchar('\n'), offset); 268 while( offset < (S32)wline.length() )
255 if (line_end != LLWString::npos)
256 {
257 skip_chars = 1; // skip '\n'
258 }
259 else
260 {
261 line_end = wline.size();
262 skip_chars = 0;
263 }
264 U32 drawable = mFont->maxDrawableChars(wline.c_str()+offset, (F32)mRect.getWidth(), line_end-offset, TRUE);
265 if (drawable != 0)
266 {
267 LLFixedBuffer::addLine(wline.substr(offset, drawable));
268 }
269 else
270 { 269 {
271 // force a blank line 270 S32 skip_chars; // skip '\n'
272 LLFixedBuffer::addLine(" "); 271 // Figure out if a word-wrapped line fits here.
272 LLWString::size_type line_end = wline.find_first_of(llwchar('\n'), offset);
273 if (line_end != LLWString::npos)
274 {
275 skip_chars = 1; // skip '\n'
276 }
277 else
278 {
279 line_end = wline.size();
280 skip_chars = 0;
281 }
282 U32 drawable = mFont->maxDrawableChars(wline.c_str()+offset, (F32)mRect.getWidth(), line_end-offset, TRUE);
283 if (drawable != 0)
284 {
285 LLFixedBuffer::addLine(wline.substr(offset, drawable));
286 mAddTimes[mAddTimes.size()-1] = line_info.add_time;
287 }
288 else
289 {
290 // force a blank line
291 LLFixedBuffer::addLine(" ");
292 }
293 mColors.push_back(color);
294 offset += (drawable + skip_chars);
273 } 295 }
274 mColors.push_back(color);
275 offset += (drawable + skip_chars);
276 } 296 }
277 } 297 }
298 mLineQueue.clear();
278} 299}
279 300
280void LLConsole::removeExtraLines() 301void LLConsole::removeExtraLines()
diff --git a/linden/indra/newview/llconsole.h b/linden/indra/newview/llconsole.h
index 2a072f9..525cab3 100644
--- a/linden/indra/newview/llconsole.h
+++ b/linden/indra/newview/llconsole.h
@@ -45,6 +45,21 @@ private:
45 S32 mLastBoxHeight; 45 S32 mLastBoxHeight;
46 S32 mLastBoxWidth; 46 S32 mLastBoxWidth;
47 47
48 struct LineInfo
49 {
50 LineInfo(const LLWString &wln, F32 sz, const LLColor4& clr, F32 time)
51 : wline(wln), size(sz), color(clr), add_time(time)
52 {
53
54 }
55 LLWString wline;
56 F32 size;
57 LLColor4 color;
58 F32 add_time;
59 };
60 typedef std::list<LineInfo> line_queue_t;
61 line_queue_t mLineQueue;
62
48public: 63public:
49 // Font size: 64 // Font size:
50 // -1 = monospace, 0 means small, font size = 1 means big 65 // -1 = monospace, 0 means small, font size = 1 means big
@@ -65,7 +80,8 @@ public:
65 80
66 void addLine(const LLString& utf8line, F32 size, const LLColor4 &color); 81 void addLine(const LLString& utf8line, F32 size, const LLColor4 &color);
67 void addLine(const LLWString& wline, F32 size, const LLColor4 &color); 82 void addLine(const LLWString& wline, F32 size, const LLColor4 &color);
68 83 void addQueuedLines();
84
69 // Overrides 85 // Overrides
70 /*virtual*/ void draw(); 86 /*virtual*/ void draw();
71 /*virtual*/ void addLine(const LLString& utf8line); 87 /*virtual*/ void addLine(const LLString& utf8line);
diff --git a/linden/indra/newview/llcontroldef.cpp b/linden/indra/newview/llcontroldef.cpp
index 850b5bf..cd4cf4d 100644
--- a/linden/indra/newview/llcontroldef.cpp
+++ b/linden/indra/newview/llcontroldef.cpp
@@ -186,7 +186,12 @@ void declare_settings()
186 gSavedSettings.declareString("FontMonospace", "profontwindows.ttf", "Name of monospace font (Truetype file name)"); 186 gSavedSettings.declareString("FontMonospace", "profontwindows.ttf", "Name of monospace font (Truetype file name)");
187 gSavedSettings.declareString("FontSansSerif", "MtBkLfRg.ttf", "Name of san-serif font (Truetype file name)"); 187 gSavedSettings.declareString("FontSansSerif", "MtBkLfRg.ttf", "Name of san-serif font (Truetype file name)");
188#if LL_WINDOWS 188#if LL_WINDOWS
189 gSavedSettings.declareString("FontSansSerifFallback", "ArialUni.ttf", "Name of fallback san-serif font (Truetype file name)"); 189 // Lists Japanese, Korean, and Chinese sanserif fonts available in
190 // Windows XP and Vista, as well as "Arial Unicode MS".
191 gSavedSettings.declareString(
192 "FontSansSerifFallback",
193 "MSGOTHIC.TTC;gulim.ttc;simhei.ttf;ArialUni.ttf",
194 "Name of fallback san-serif font (Truetype file name)");
190#elif LL_DARWIN 195#elif LL_DARWIN
191 // This is a fairly complete Japanese font that ships with Mac OS X. 196 // This is a fairly complete Japanese font that ships with Mac OS X.
192 // The first filename is in UTF8, but it shows up in the font menu as "Hiragino Kaku Gothic Pro W3". 197 // The first filename is in UTF8, but it shows up in the font menu as "Hiragino Kaku Gothic Pro W3".
@@ -654,7 +659,6 @@ void declare_settings()
654 gSavedSettings.declareF32( "RenderFarClip", 256.f, "Distance of far clip plane from camera (meters)" ); 659 gSavedSettings.declareF32( "RenderFarClip", 256.f, "Distance of far clip plane from camera (meters)" );
655 gSavedSettings.declareF32( "RenderFogRatio", 2.0f, "Distance from camera where fog reaches maximum density (fraction or multiple of far clip distance)"); 660 gSavedSettings.declareF32( "RenderFogRatio", 2.0f, "Distance from camera where fog reaches maximum density (fraction or multiple of far clip distance)");
656 gSavedSettings.declareBOOL("RenderAnisotropic", FALSE, "Render textures using anisotropic filtering" ); 661 gSavedSettings.declareBOOL("RenderAnisotropic", FALSE, "Render textures using anisotropic filtering" );
657 gSavedSettings.declareBOOL("RenderLightGlows", FALSE, "Render glow sprites on top of light sources" );
658 gSavedSettings.declareBOOL("ShowXUINames", FALSE, "Display XUI Names as Tooltips" ); 662 gSavedSettings.declareBOOL("ShowXUINames", FALSE, "Display XUI Names as Tooltips" );
659 gSavedSettings.declareS32("RenderLightingDetail", 1, "Amount of detail for lighting objects/avatars/terrain (0=sun/moon only, 1=enable local lights)" ); 663 gSavedSettings.declareS32("RenderLightingDetail", 1, "Amount of detail for lighting objects/avatars/terrain (0=sun/moon only, 1=enable local lights)" );
660 gSavedSettings.declareS32("RenderTerrainDetail", 2, "Detail applied to terrain texturing (0 = none, 1 or 2 = full)" ); 664 gSavedSettings.declareS32("RenderTerrainDetail", 2, "Detail applied to terrain texturing (0 = none, 1 or 2 = full)" );
@@ -664,13 +668,13 @@ void declare_settings()
664 gSavedSettings.declareF32( "RenderAvatarLODFactor", 0.5f, "Controls level of detail of avatars (multiplier for current screen area when calculated level of detail)" ); 668 gSavedSettings.declareF32( "RenderAvatarLODFactor", 0.5f, "Controls level of detail of avatars (multiplier for current screen area when calculated level of detail)" );
665 gSavedSettings.declareF32( "RenderBumpmapMinDistanceSquared", 100.f, "Maximum distance at which to render bumpmapped primitives (distance in meters, squared)" ); 669 gSavedSettings.declareF32( "RenderBumpmapMinDistanceSquared", 100.f, "Maximum distance at which to render bumpmapped primitives (distance in meters, squared)" );
666 gSavedSettings.declareS32( "RenderMaxPartCount", 4096, "Maximum number of particles to display on screen"); 670 gSavedSettings.declareS32( "RenderMaxPartCount", 4096, "Maximum number of particles to display on screen");
667 gSavedSettings.declareBOOL("RenderUseAGP", TRUE, "Used AGP for fast transfer of data to graphics card" ); 671 gSavedSettings.declareBOOL("RenderVBOEnable", TRUE, "Use GL Vertex Buffer Objects" );
668 gSavedSettings.declareBOOL("RenderUseVBO", FALSE, "Use GL Vertex Buffer Objects" );
669 //gSavedSettings.declareBOOL("RenderUseTriStrips", FALSE, "[NOT USED]"); 672 //gSavedSettings.declareBOOL("RenderUseTriStrips", FALSE, "[NOT USED]");
670 //gSavedSettings.declareBOOL("RenderCullBySize", FALSE, "[NOT USED]" ); 673 //gSavedSettings.declareBOOL("RenderCullBySize", FALSE, "[NOT USED]" );
671 gSavedSettings.declareF32("RenderTerrainScale", 12.f, "Terrain detail texture scale"); 674 gSavedSettings.declareF32("RenderTerrainScale", 12.f, "Terrain detail texture scale");
672 gSavedSettings.declareBOOL("VertexShaderEnable", FALSE, "Enable/disable all GLSL shaders (debug)"); 675 gSavedSettings.declareBOOL("VertexShaderEnable", FALSE, "Enable/disable all GLSL shaders (debug)");
673 gSavedSettings.declareBOOL("RenderRippleWater", FALSE, "Display more realistic water, with refraction (requires pixel shader support on your video card)"); 676 gSavedSettings.declareBOOL("RenderRippleWater", FALSE, "Display more realistic water, with refraction (requires pixel shader support on your video card)");
677 gSavedSettings.declareBOOL("RenderDynamicReflections", FALSE, "Generate a dynamic cube map for reflections (objects reflect their environment, experimental).");
674 gSavedSettings.declareBOOL("RenderObjectBump", TRUE, "Show bumpmapping on primitives"); 678 gSavedSettings.declareBOOL("RenderObjectBump", TRUE, "Show bumpmapping on primitives");
675 gSavedSettings.declareS32("RenderAvatarMode", 1, "Controls how avatars are rendered (0 = normal, 1 = bump mapped, 2 = bump mapped and wavy cloth)"); 679 gSavedSettings.declareS32("RenderAvatarMode", 1, "Controls how avatars are rendered (0 = normal, 1 = bump mapped, 2 = bump mapped and wavy cloth)");
676 gSavedSettings.declareBOOL("RenderAvatarVP", TRUE, "Use vertex programs to perform hardware skinning of avatar"); 680 gSavedSettings.declareBOOL("RenderAvatarVP", TRUE, "Use vertex programs to perform hardware skinning of avatar");
@@ -683,6 +687,7 @@ void declare_settings()
683 gSavedSettings.declareBOOL("RenderUIInSnapshot", FALSE, "Display user interface in snapshot" ); 687 gSavedSettings.declareBOOL("RenderUIInSnapshot", FALSE, "Display user interface in snapshot" );
684 gSavedSettings.declareBOOL("RenderHUDInSnapshot", FALSE, "Display HUD attachments in snapshot" ); 688 gSavedSettings.declareBOOL("RenderHUDInSnapshot", FALSE, "Display HUD attachments in snapshot" );
685 gSavedSettings.declareBOOL("HighResSnapshot", FALSE, "Double resolution of snapshot from current window resolution" ); 689 gSavedSettings.declareBOOL("HighResSnapshot", FALSE, "Double resolution of snapshot from current window resolution" );
690 gSavedSettings.declareBOOL("CompressSnapshotsToDisk", FALSE, "Compress snapshots saved to disk (Using JPEG 2000)" );
686 gSavedSettings.declareBOOL("FreezeTime", FALSE, "", FALSE ); 691 gSavedSettings.declareBOOL("FreezeTime", FALSE, "", FALSE );
687 gSavedSettings.declareBOOL("UseFreezeFrame", FALSE, "Freeze time when taking snapshots."); 692 gSavedSettings.declareBOOL("UseFreezeFrame", FALSE, "Freeze time when taking snapshots.");
688 gSavedSettings.declareBOOL("CloseSnapshotOnKeep", TRUE, "Close snapshot window after saving snapshot" ); 693 gSavedSettings.declareBOOL("CloseSnapshotOnKeep", TRUE, "Close snapshot window after saving snapshot" );
@@ -711,6 +716,10 @@ void declare_settings()
711 //gSavedSettings.declareS32("ImageRadioTexMem", 0, "Texture memory allocation (0 = <512 megabytes system RAM, 1 = >512 megabytes system RAM)"); 716 //gSavedSettings.declareS32("ImageRadioTexMem", 0, "Texture memory allocation (0 = <512 megabytes system RAM, 1 = >512 megabytes system RAM)");
712 //gSavedSettings.declareS32("ImageRadioVidCardMem", 1, "Video card onboard memory (0 = 16MB, 1 = 32MB, 2 = 64MB, 3 = 128MB, 4 = 256MB, 5 = 512MB)"); 717 //gSavedSettings.declareS32("ImageRadioVidCardMem", 1, "Video card onboard memory (0 = 16MB, 1 = 32MB, 2 = 64MB, 3 = 128MB, 4 = 256MB, 5 = 512MB)");
713 //gSavedSettings.declareU32("LastRAMDetected", 0, "[DO NOT MODIFY] Detected system memory (bytes)"); // used to detect RAM changes 718 //gSavedSettings.declareU32("LastRAMDetected", 0, "[DO NOT MODIFY] Detected system memory (bytes)"); // used to detect RAM changes
719 gSavedSettings.declareBOOL("ImagePipelineUseHTTP", FALSE, "If TRUE use HTTP GET to fetch textures from the server");
720
721 // Threading
722 gSavedSettings.declareBOOL("RunMultipleThreads", FALSE, "If TRUE keep background threads active during render");
714 723
715 // Camera control 724 // Camera control
716 gSavedSettings.declareBOOL("AutoPilotLocksCamera", FALSE, "Keep camera position locked when avatar walks to selected position"); 725 gSavedSettings.declareBOOL("AutoPilotLocksCamera", FALSE, "Keep camera position locked when avatar walks to selected position");
@@ -746,6 +755,9 @@ void declare_settings()
746 // Currently matches BW_PRESET_300 755 // Currently matches BW_PRESET_300
747 gSavedSettings.declareF32("ThrottleBandwidthKBPS", 500.f, "Maximum allowable downstream bandwidth (kilo bits per second)"); 756 gSavedSettings.declareF32("ThrottleBandwidthKBPS", 500.f, "Maximum allowable downstream bandwidth (kilo bits per second)");
748 757
758 gSavedSettings.declareBOOL("ConnectionPortEnabled", FALSE, "Use the custom connection port?");
759 gSavedSettings.declareU32("ConnectionPort", 13000, "Custom connection port number");
760
749 // File xfer throttle 761 // File xfer throttle
750 gSavedSettings.declareF32("XferThrottle", 150000.f, "Maximum allowable downstream bandwidth for asset transfers (bits per second)"); 762 gSavedSettings.declareF32("XferThrottle", 150000.f, "Maximum allowable downstream bandwidth for asset transfers (bits per second)");
751 763
@@ -884,6 +896,8 @@ void declare_settings()
884 gSavedSettings.declareF32 ("GridDrawSize", 12.0f, "Visible extent of 2D snap grid (meters)"); 896 gSavedSettings.declareF32 ("GridDrawSize", 12.0f, "Visible extent of 2D snap grid (meters)");
885 gSavedSettings.declareBOOL("GridSubUnit", FALSE, "Display fractional grid steps, relative to grid size"); 897 gSavedSettings.declareBOOL("GridSubUnit", FALSE, "Display fractional grid steps, relative to grid size");
886 gSavedSettings.declareF32("GridOpacity", 0.7f, "Grid line opacity (0.0 = completely transparent, 1.0 = completely opaque)"); 898 gSavedSettings.declareF32("GridOpacity", 0.7f, "Grid line opacity (0.0 = completely transparent, 1.0 = completely opaque)");
899 gSavedSettings.declareBOOL("GridCrossSections", FALSE, "Highlight cross sections of prims with grid manipulation plane.");
900
887 gSavedSettings.declareS32("GridMode", 0, "Snap grid reference frame (0 = world, 1 = local, 2 = reference object)"); 901 gSavedSettings.declareS32("GridMode", 0, "Snap grid reference frame (0 = world, 1 = local, 2 = reference object)");
888 //gSavedSettings.declareBOOL("GridIsLocal", FALSE, "[NOT USED]"); 902 //gSavedSettings.declareBOOL("GridIsLocal", FALSE, "[NOT USED]");
889 gSavedSettings.declareS32("GridSubdivision", 32, "Maximum number of times to divide single snap grid unit when GridSubUnit is true"); 903 gSavedSettings.declareS32("GridSubdivision", 32, "Maximum number of times to divide single snap grid unit when GridSubUnit is true");
@@ -1027,10 +1041,17 @@ void declare_settings()
1027 gSavedSettings.declareColor3("SkyNightColorShift", LLColor3(0.7f, 0.7f, 1.0f), "Controls moonlight color (base color applied to moon as light source)"); 1041 gSavedSettings.declareColor3("SkyNightColorShift", LLColor3(0.7f, 0.7f, 1.0f), "Controls moonlight color (base color applied to moon as light source)");
1028 gSavedSettings.declareBOOL("FixedWeather", FALSE, "Weather effects do not change over time"); 1042 gSavedSettings.declareBOOL("FixedWeather", FALSE, "Weather effects do not change over time");
1029 1043
1030 // VFS stuff 1044 // Cache Stuff
1031 gSavedSettings.declareU32("VFSSalt", 1, "[DO NOT MODIFY] Controls local file caching behavior"); 1045 gSavedSettings.declareU32("VFSSalt", 1, "[DO NOT MODIFY] Controls local file caching behavior");
1032 gSavedSettings.declareU32("VFSOldSize", 2, "[DO NOT MODIFY] Controls resizing of local file cache"); 1046 gSavedSettings.declareU32("VFSOldSize", 0, "[DO NOT MODIFY] Controls resizing of local file cache");
1033 gSavedSettings.declareU32("VFSSize", 2, "Controls amount of hard drive space reserved for local file caching (0 = 50MB, 1 = 200MB, 2 = 500MB, 3 = 1000MB)"); 1047// gSavedSettings.declareU32("VFSSize", 2, "Controls amount of hard drive space reserved for local file caching (0 = 50MB, 1 = 200MB, 2 = 500MB, 3 = 1000MB)");
1048 gSavedSettings.declareU32("CacheSize", 500, "Controls amount of hard drive space reserved for local file caching in MB");
1049 gSavedSettings.declareString("CacheLocation", "", "Controls the location of the local disk cache");
1050 gSavedSettings.declareString("NewCacheLocation", "", "Change the location of the local disk cache to this");
1051 gSavedSettings.declareU32("CacheValidateCounter", 0, "Used to distribute cache validation");
1052 // Delete all files in cache directory on startup
1053 gSavedSettings.declareBOOL("PurgeCacheOnStartup", FALSE, "Clear local file cache every time viewer is run");
1054 gSavedSettings.declareBOOL("PurgeCacheOnNextStartup", FALSE, "Clear local file cache next time viewer is run");
1034 1055
1035 // Used for special titles such as "Second Life - Special E3 2003 Beta" 1056 // Used for special titles such as "Second Life - Special E3 2003 Beta"
1036 gSavedSettings.declareBOOL("ShowOverlayTitle", FALSE, "Prints watermark text message on screen"); 1057 gSavedSettings.declareBOOL("ShowOverlayTitle", FALSE, "Prints watermark text message on screen");
@@ -1060,6 +1081,8 @@ void declare_settings()
1060 // The last version that was run with this prefs file. Default to a version that will never be current, 1081 // The last version that was run with this prefs file. Default to a version that will never be current,
1061 // and update after the setting is used in the startup sequence. 1082 // and update after the setting is used in the startup sequence.
1062 gSavedSettings.declareString("LastRunVersion", "0.0.0", "Version number of last instance of the viewer that you ran"); 1083 gSavedSettings.declareString("LastRunVersion", "0.0.0", "Version number of last instance of the viewer that you ran");
1084 // Local cache version (change if format changes)
1085 gSavedSettings.declareS32("LocalCacheVersion", 0, "Version number of cache");
1063 1086
1064 // cached mean collision values 1087 // cached mean collision values
1065 gSavedSettings.declareBOOL("MeanCollisionBump", FALSE, "You have experienced an abuse of being bumped by an object or avatar" ); 1088 gSavedSettings.declareBOOL("MeanCollisionBump", FALSE, "You have experienced an abuse of being bumped by an object or avatar" );
@@ -1072,7 +1095,7 @@ void declare_settings()
1072 gSavedSettings.declareBOOL("LeftClickShowMenu", FALSE, "Left click opens pie menu (FALSE = left click touches or grabs object)"); 1095 gSavedSettings.declareBOOL("LeftClickShowMenu", FALSE, "Left click opens pie menu (FALSE = left click touches or grabs object)");
1073 1096
1074 gSavedSettings.declareF32("MouseSensitivity", 3.f, "Controls responsiveness of mouse when in mouselook mode (fraction or multiple of default mouse sensitivity)"); 1097 gSavedSettings.declareF32("MouseSensitivity", 3.f, "Controls responsiveness of mouse when in mouselook mode (fraction or multiple of default mouse sensitivity)");
1075 1098 gSavedSettings.declareBOOL("MouseSmooth", FALSE, "Smooths out motion of mouse when in mouselook mode.");
1076 gSavedSettings.declareBOOL("InvertMouse", FALSE, "When in mouselook, moving mouse up looks down and vice verse (FALSE = moving up looks up)"); 1099 gSavedSettings.declareBOOL("InvertMouse", FALSE, "When in mouselook, moving mouse up looks down and vice verse (FALSE = moving up looks up)");
1077 1100
1078 gSavedSettings.declareBOOL("EditCameraMovement", FALSE, "When entering build mode, camera moves up above avatar"); 1101 gSavedSettings.declareBOOL("EditCameraMovement", FALSE, "When entering build mode, camera moves up above avatar");
@@ -1145,8 +1168,8 @@ void declare_settings()
1145 1168
1146 // Checkboxes in Find -> Popular 1169 // Checkboxes in Find -> Popular
1147 // Should these all be the same? I imagine we might want a single "show mature." - bbc 1170 // Should these all be the same? I imagine we might want a single "show mature." - bbc
1148 gSavedSettings.declareBOOL("ShowMatureFindAll",TRUE, "Display results of find all that are in mature sims"); 1171 gSavedSettings.declareBOOL("ShowMatureFindAll",FALSE, "Display results of find all that are in mature sims");
1149 gSavedSettings.declareBOOL("ShowMatureSims", TRUE, "Display results of find places or find popular that are in mature sims"); 1172 gSavedSettings.declareBOOL("ShowMatureSims", FALSE, "Display results of find places or find popular that are in mature sims");
1150 gSavedSettings.declareBOOL("ShowMatureEvents", FALSE, "Display results of find events that are flagged as mature"); 1173 gSavedSettings.declareBOOL("ShowMatureEvents", FALSE, "Display results of find events that are flagged as mature");
1151 gSavedSettings.declareBOOL("ShowMatureClassifieds", FALSE, "Display results of find classifieds that are flagged as mature"); 1174 gSavedSettings.declareBOOL("ShowMatureClassifieds", FALSE, "Display results of find classifieds that are flagged as mature");
1152 1175
@@ -1185,10 +1208,6 @@ void declare_settings()
1185 gSavedSettings.declareBOOL("ShowLandHoverTip", FALSE, "Show descriptive tooltip when mouse hovers over land"); 1208 gSavedSettings.declareBOOL("ShowLandHoverTip", FALSE, "Show descriptive tooltip when mouse hovers over land");
1186 gSavedSettings.declareBOOL("ShowAllObjectHoverTip", FALSE, "Show descriptive tooltip when mouse hovers over non-interactive and interactive objects."); 1209 gSavedSettings.declareBOOL("ShowAllObjectHoverTip", FALSE, "Show descriptive tooltip when mouse hovers over non-interactive and interactive objects.");
1187 1210
1188 // Delete all files in cache directory on startup
1189 gSavedSettings.declareBOOL("PurgeCacheOnStartup", FALSE, "Clear local file cache every time viewer is run");
1190 gSavedSettings.declareBOOL("PurgeCacheOnNextStartup", FALSE, "Clear local file cache next time viewer is run");
1191
1192 // Use an external web browser (Firefox, Internet Explorer) 1211 // Use an external web browser (Firefox, Internet Explorer)
1193 // CP: making this TRUE by default since there is no internal Web browser 1212 // CP: making this TRUE by default since there is no internal Web browser
1194 // now and other components may interrogate this setting 1213 // now and other components may interrogate this setting
@@ -1223,3 +1242,15 @@ void declare_settings()
1223 gCrashSettings.declareS32(CRASH_BEHAVIOR_SETTING, CRASH_BEHAVIOR_ASK, "Controls behavior when viewer crashes " 1242 gCrashSettings.declareS32(CRASH_BEHAVIOR_SETTING, CRASH_BEHAVIOR_ASK, "Controls behavior when viewer crashes "
1224 "(0 = ask before sending crash report, 1 = always send crash report, 2 = never send crash report)"); 1243 "(0 = ask before sending crash report, 1 = always send crash report, 2 = never send crash report)");
1225} 1244}
1245
1246void settings_version_fixup()
1247{
1248#if LL_RELEASE_FOR_DOWNLOAD
1249 if (gCurrentVersion == "1.13.3" || gCurrentVersion == "1.13.4")
1250 {
1251 // In case these were set to true in an early 'First Look' version:
1252 gSavedSettings.setBOOL("RenderDynamicReflections", FALSE);
1253 gSavedSettings.setBOOL("ImagePipelineUseHTTP", FALSE);
1254 }
1255#endif
1256}
diff --git a/linden/indra/newview/llcubemap.cpp b/linden/indra/newview/llcubemap.cpp
index 4406bc8..415b849 100644
--- a/linden/indra/newview/llcubemap.cpp
+++ b/linden/indra/newview/llcubemap.cpp
@@ -176,8 +176,6 @@ void LLCubeMap::bind()
176 176
177 glTexParameteri(GL_TEXTURE_CUBE_MAP_ARB, GL_TEXTURE_MAG_FILTER, GL_LINEAR); 177 glTexParameteri(GL_TEXTURE_CUBE_MAP_ARB, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
178 glTexParameteri(GL_TEXTURE_CUBE_MAP_ARB, GL_TEXTURE_MIN_FILTER, (use_cube_mipmaps? GL_LINEAR_MIPMAP_LINEAR : GL_LINEAR)); 178 glTexParameteri(GL_TEXTURE_CUBE_MAP_ARB, GL_TEXTURE_MIN_FILTER, (use_cube_mipmaps? GL_LINEAR_MIPMAP_LINEAR : GL_LINEAR));
179
180 glTexEnvi (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
181 } 179 }
182 else 180 else
183 { 181 {
@@ -220,11 +218,23 @@ void LLCubeMap::setMatrix(S32 stage)
220{ 218{
221 mMatrixStage = stage; 219 mMatrixStage = stage;
222 glActiveTextureARB(GL_TEXTURE0_ARB+stage); 220 glActiveTextureARB(GL_TEXTURE0_ARB+stage);
221
222 F32 mat[16];
223
224 glGetFloatv(GL_MODELVIEW_MATRIX, mat);
225
226 LLVector3 x(mat);
227 LLVector3 y(mat+4);
228 LLVector3 z(mat+8);
229
230 LLMatrix3 mat3;
231 mat3.setRows(x,y,z);
232 LLMatrix4 trans(mat3);
233 trans.transpose();
234
223 glMatrixMode(GL_TEXTURE); 235 glMatrixMode(GL_TEXTURE);
224 glPushMatrix(); 236 glPushMatrix();
225 LLMatrix4 tmat; 237 glLoadMatrixf((F32 *)trans.mMatrix);
226 gCamera->getRotMatrixToParent(tmat);
227 glLoadMatrixf((F32 *)tmat.mMatrix);
228 glMatrixMode(GL_MODELVIEW); 238 glMatrixMode(GL_MODELVIEW);
229} 239}
230 240
diff --git a/linden/indra/newview/llcubemap.h b/linden/indra/newview/llcubemap.h
index 6596257..7be6706 100644
--- a/linden/indra/newview/llcubemap.h
+++ b/linden/indra/newview/llcubemap.h
@@ -36,7 +36,7 @@
36class LLVector3; 36class LLVector3;
37 37
38// Environment map hack! 38// Environment map hack!
39class LLCubeMap 39class LLCubeMap : public LLRefCount
40{ 40{
41public: 41public:
42 LLCubeMap(); 42 LLCubeMap();
diff --git a/linden/indra/newview/llcurrencyuimanager.cpp b/linden/indra/newview/llcurrencyuimanager.cpp
index 5893836..615d9fb 100644
--- a/linden/indra/newview/llcurrencyuimanager.cpp
+++ b/linden/indra/newview/llcurrencyuimanager.cpp
@@ -144,10 +144,10 @@ void LLCurrencyUIManager::Impl::updateCurrencyInfo()
144 } 144 }
145 145
146 LLXMLRPCValue keywordArgs = LLXMLRPCValue::createStruct(); 146 LLXMLRPCValue keywordArgs = LLXMLRPCValue::createStruct();
147 keywordArgs.appendString("agentId", 147 keywordArgs.appendString("agentId", gAgent.getID().asString());
148 gAgent.getID().getString()); 148 keywordArgs.appendString(
149 keywordArgs.appendString("secureSessionId", 149 "secureSessionId",
150 gAgent.getSecureSessionID().getString()); 150 gAgent.getSecureSessionID().asString());
151 keywordArgs.appendInt("currencyBuy", mUserCurrencyBuy); 151 keywordArgs.appendInt("currencyBuy", mUserCurrencyBuy);
152 152
153 LLXMLRPCValue params = LLXMLRPCValue::createArray(); 153 LLXMLRPCValue params = LLXMLRPCValue::createArray();
@@ -191,10 +191,10 @@ void LLCurrencyUIManager::Impl::startCurrencyBuy(const std::string& password)
191 mCurrencyChanged = false; 191 mCurrencyChanged = false;
192 192
193 LLXMLRPCValue keywordArgs = LLXMLRPCValue::createStruct(); 193 LLXMLRPCValue keywordArgs = LLXMLRPCValue::createStruct();
194 keywordArgs.appendString("agentId", 194 keywordArgs.appendString("agentId", gAgent.getID().asString());
195 gAgent.getID().getString()); 195 keywordArgs.appendString(
196 keywordArgs.appendString("secureSessionId", 196 "secureSessionId",
197 gAgent.getSecureSessionID().getString()); 197 gAgent.getSecureSessionID().asString());
198 keywordArgs.appendInt("currencyBuy", mUserCurrencyBuy); 198 keywordArgs.appendInt("currencyBuy", mUserCurrencyBuy);
199 keywordArgs.appendInt("estimatedCost", mSiteCurrencyEstimatedCost); 199 keywordArgs.appendInt("estimatedCost", mSiteCurrencyEstimatedCost);
200 keywordArgs.appendString("confirm", mSiteConfirm); 200 keywordArgs.appendString("confirm", mSiteConfirm);
diff --git a/linden/indra/newview/llcylinder.cpp b/linden/indra/newview/llcylinder.cpp
index b3eaa44..9f76648 100644
--- a/linden/indra/newview/llcylinder.cpp
+++ b/linden/indra/newview/llcylinder.cpp
@@ -34,7 +34,7 @@
34#include "llmath.h" 34#include "llmath.h"
35#include "noise.h" 35#include "noise.h"
36#include "v3math.h" 36#include "v3math.h"
37 37#include "llvertexbuffer.h"
38#include "llgl.h" 38#include "llgl.h"
39#include "llglheaders.h" 39#include "llglheaders.h"
40 40
@@ -43,6 +43,10 @@ LLCone gCone;
43 43
44GLUquadricObj* gQuadObj = NULL; 44GLUquadricObj* gQuadObj = NULL;
45 45
46static const GLint SLICES[] = { 30, 20, 12, 6 }; // same as sphere slices
47static const GLint STACKS = 2;
48static const GLfloat RADIUS = 0.5f;
49
46// draws a cylinder or cone 50// draws a cylinder or cone
47// returns approximate number of triangles required 51// returns approximate number of triangles required
48U32 draw_cylinder_side(GLint slices, GLint stacks, GLfloat base_radius, GLfloat top_radius) 52U32 draw_cylinder_side(GLint slices, GLint stacks, GLfloat base_radius, GLfloat top_radius)
@@ -106,46 +110,27 @@ U32 draw_cylinder_cap(GLint slices, GLfloat base_radius, BOOL is_top)
106 return triangles; 110 return triangles;
107} 111}
108 112
113void LLCylinder::drawSide(S32 detail)
114{
115 draw_cylinder_side(SLICES[detail], STACKS, RADIUS, RADIUS);
116}
109 117
110void LLCylinder::prerender() 118void LLCylinder::drawTop(S32 detail)
111{ 119{
112 GLint stacks = 2; 120 draw_cylinder_cap(SLICES[detail], RADIUS, TOP);
113 GLfloat radius = 0.5f; 121}
114 GLint slices[CYLINDER_LEVELS_OF_DETAIL] = { 30, 20, 12, 6 }; // same as sphere slices
115 122
116 for (S32 detail = 0; detail < CYLINDER_LEVELS_OF_DETAIL; detail++) 123void LLCylinder::drawBottom(S32 detail)
117 { 124{
118 mTriangleCount[detail] = 0; 125 draw_cylinder_cap(SLICES[detail], RADIUS, BOTTOM);
119
120 mDisplayListSide[detail] = glGenLists(1);
121 glNewList(mDisplayListSide[detail], GL_COMPILE);
122 mTriangleCount[detail] += draw_cylinder_side( slices[detail], stacks, radius, radius );
123 glEndList();
124
125 mDisplayListTop[detail] = glGenLists(1);
126 glNewList( mDisplayListTop[detail], GL_COMPILE);
127 mTriangleCount[detail] += draw_cylinder_cap( slices[detail], radius, TOP );
128 glEndList();
129
130 mDisplayListBottom[detail] = glGenLists(1);
131 glNewList( mDisplayListBottom[detail], GL_COMPILE);
132 mTriangleCount[detail] += draw_cylinder_cap( slices[detail], radius, BOTTOM );
133 glEndList();
134 }
135} 126}
136 127
137void LLCylinder::cleanupGL() 128void LLCylinder::prerender()
138{ 129{
139 for (S32 detail = 0; detail < CYLINDER_LEVELS_OF_DETAIL; detail++) 130}
140 {
141 glDeleteLists(mDisplayListSide[detail], 1);
142 mDisplayListSide[detail] = 0;
143 glDeleteLists(mDisplayListTop[detail], 1);
144 mDisplayListTop[detail] = 0;
145 glDeleteLists(mDisplayListBottom[detail], 1);
146 mDisplayListBottom[detail] = 0;
147 }
148 131
132void LLCylinder::cleanupGL()
133{
149 if (gQuadObj) 134 if (gQuadObj)
150 { 135 {
151 gluDeleteQuadric(gQuadObj); 136 gluDeleteQuadric(gQuadObj);
@@ -197,19 +182,21 @@ void LLCylinder::renderface(F32 pixel_area, S32 face)
197 return; 182 return;
198 } 183 }
199 184
185 LLVertexBuffer::unbind();
186
200 switch(face) 187 switch(face)
201 { 188 {
202 case 0: 189 case 0:
203 glTranslatef(0.f, 0.f, -0.5f); 190 glTranslatef(0.f, 0.f, -0.5f);
204 glCallList(mDisplayListSide[level_of_detail]); 191 drawSide(level_of_detail);
205 break; 192 break;
206 case 1: 193 case 1:
207 glTranslatef(0.0f, 0.f, 0.5f); 194 glTranslatef(0.0f, 0.f, 0.5f);
208 glCallList(mDisplayListTop[level_of_detail]); 195 drawTop(level_of_detail);
209 break; 196 break;
210 case 2: 197 case 2:
211 glTranslatef(0.0f, 0.f, -0.5f); 198 glTranslatef(0.0f, 0.f, -0.5f);
212 glCallList(mDisplayListBottom[level_of_detail]); 199 drawBottom(level_of_detail);
213 break; 200 break;
214 default: 201 default:
215 llerror("LLCylinder::renderface() fell out of switch", 0); 202 llerror("LLCylinder::renderface() fell out of switch", 0);
@@ -227,37 +214,10 @@ void LLCylinder::renderface(F32 pixel_area, S32 face)
227 214
228void LLCone::prerender() 215void LLCone::prerender()
229{ 216{
230 GLint stacks = 2;
231 GLfloat radius = 0.5f;
232 GLint slices[CONE_LEVELS_OF_DETAIL] = { 32, 18, 12, 6 };
233
234 for (S32 detail = 0; detail < CONE_LEVELS_OF_DETAIL; detail++)
235 {
236 mTriangleCount[detail] = 0;
237
238 mDisplayListSide[detail] = glGenLists(1);
239 glNewList(mDisplayListSide[detail], GL_COMPILE);
240 mTriangleCount[detail] += draw_cylinder_side( slices[detail], stacks, radius, 0.f );
241 glEndList();
242
243 mDisplayListBottom[detail] = glGenLists(1);
244 glNewList( mDisplayListBottom[detail], GL_COMPILE);
245 mTriangleCount[detail] += draw_cylinder_cap( slices[detail], radius, BOTTOM );
246 glEndList();
247 }
248} 217}
249 218
250void LLCone::cleanupGL() 219void LLCone::cleanupGL()
251{ 220{
252 for (S32 detail = 0; detail < CYLINDER_LEVELS_OF_DETAIL; detail++)
253 {
254 glDeleteLists(mDisplayListSide[detail], 1);
255 mDisplayListSide[detail] = 0;
256
257 glDeleteLists(mDisplayListBottom[detail], 1);
258 mDisplayListBottom[detail] = 0;
259 }
260
261 if (gQuadObj) 221 if (gQuadObj)
262 { 222 {
263 gluDeleteQuadric(gQuadObj); 223 gluDeleteQuadric(gQuadObj);
@@ -265,6 +225,15 @@ void LLCone::cleanupGL()
265 } 225 }
266} 226}
267 227
228void LLCone::drawSide(S32 detail)
229{
230 draw_cylinder_side( SLICES[detail], STACKS, RADIUS, 0.f );
231}
232
233void LLCone::drawBottom(S32 detail)
234{
235 draw_cylinder_cap( SLICES[detail], RADIUS, BOTTOM );
236}
268 237
269void LLCone::render(S32 level_of_detail) 238void LLCone::render(S32 level_of_detail)
270{ 239{
@@ -282,8 +251,9 @@ void LLCone::render(S32 level_of_detail)
282 // center object at 0 251 // center object at 0
283 glTranslatef(0.f, 0.f, - height / 2.0f); 252 glTranslatef(0.f, 0.f, - height / 2.0f);
284 253
285 glCallList(mDisplayListSide[level_of_detail]); 254 LLVertexBuffer::unbind();
286 glCallList(mDisplayListBottom[level_of_detail]); 255 drawSide(level_of_detail);
256 drawBottom(level_of_detail);
287 257
288 glMatrixMode(GL_MODELVIEW); 258 glMatrixMode(GL_MODELVIEW);
289 glPopMatrix(); 259 glPopMatrix();
@@ -307,15 +277,17 @@ void LLCone::renderface(S32 level_of_detail, S32 face)
307 glMatrixMode(GL_MODELVIEW); 277 glMatrixMode(GL_MODELVIEW);
308 glPushMatrix(); 278 glPushMatrix();
309 279
280 LLVertexBuffer::unbind();
281
310 switch(face) 282 switch(face)
311 { 283 {
312 case 0: 284 case 0:
313 glTranslatef(0.f, 0.f, -0.5f); 285 glTranslatef(0.f, 0.f, -0.5f);
314 glCallList(mDisplayListSide[level_of_detail]); 286 drawSide(level_of_detail);
315 break; 287 break;
316 case 1: 288 case 1:
317 glTranslatef(0.f, 0.f, -0.5f); 289 glTranslatef(0.f, 0.f, -0.5f);
318 glCallList(mDisplayListBottom[level_of_detail]); 290 drawBottom(level_of_detail);
319 break; 291 break;
320 default: 292 default:
321 llerror("LLCylinder::renderface() fell out of switch", 0); 293 llerror("LLCylinder::renderface() fell out of switch", 0);
diff --git a/linden/indra/newview/llcylinder.h b/linden/indra/newview/llcylinder.h
index b9e0a0e..fbd1298 100644
--- a/linden/indra/newview/llcylinder.h
+++ b/linden/indra/newview/llcylinder.h
@@ -39,20 +39,15 @@ const S32 CYLINDER_FACES = 3;
39 39
40class LLCylinder 40class LLCylinder
41{ 41{
42protected:
43 U32 mDisplayListSide[CYLINDER_LEVELS_OF_DETAIL];
44 U32 mDisplayListTop[CYLINDER_LEVELS_OF_DETAIL];
45 U32 mDisplayListBottom[CYLINDER_LEVELS_OF_DETAIL];
46 U32 mTriangleCount[CYLINDER_LEVELS_OF_DETAIL];
47
48public: 42public:
49 void prerender(); 43 void prerender();
44 void drawTop(S32 detail);
45 void drawSide(S32 detail);
46 void drawBottom(S32 detail);
50 void cleanupGL(); 47 void cleanupGL();
51 48
52 void render(F32 pixel_area); 49 void render(F32 pixel_area);
53 void renderface(F32 pixel_area, S32 face); 50 void renderface(F32 pixel_area, S32 face);
54
55 U32 getTriangleCount(S32 level_of_detail) { return mTriangleCount[level_of_detail]; }
56}; 51};
57 52
58 53
@@ -65,20 +60,14 @@ const S32 CONE_LEVELS_OF_DETAIL = 4;
65const S32 CONE_FACES = 2; 60const S32 CONE_FACES = 2;
66 61
67class LLCone 62class LLCone
68{ 63{
69protected:
70 U32 mDisplayListSide[CONE_LEVELS_OF_DETAIL];
71 U32 mDisplayListBottom[CONE_LEVELS_OF_DETAIL];
72 U32 mTriangleCount[CONE_LEVELS_OF_DETAIL];
73
74public: 64public:
75 void prerender(); 65 void prerender();
76 void cleanupGL(); 66 void cleanupGL();
77 67 void drawSide(S32 detail);
68 void drawBottom(S32 detail);
78 void render(S32 level_of_detail); 69 void render(S32 level_of_detail);
79 void renderface(S32 level_of_detail, S32 face); 70 void renderface(S32 level_of_detail, S32 face);
80
81 U32 getTriangleCount(S32 level_of_detail) { return mTriangleCount[level_of_detail]; }
82}; 71};
83 72
84extern LLCylinder gCylinder; 73extern LLCylinder gCylinder;
diff --git a/linden/indra/newview/lldebugmessagebox.cpp b/linden/indra/newview/lldebugmessagebox.cpp
index 46dffdf..e6c1bf1 100644
--- a/linden/indra/newview/lldebugmessagebox.cpp
+++ b/linden/indra/newview/lldebugmessagebox.cpp
@@ -163,7 +163,7 @@ LLDebugVarMessageBox* LLDebugVarMessageBox::show(const std::string& title, EDebu
163 sInstances[title_string] = box; 163 sInstances[title_string] = box;
164 gFloaterView->addChild(box); 164 gFloaterView->addChild(box);
165 box->reshape(200,150); 165 box->reshape(200,150);
166 box->open(); 166 box->open(); /*Flawfinder: ignore*/
167 box->mTitle = title_string; 167 box->mTitle = title_string;
168 } 168 }
169 169
@@ -206,18 +206,18 @@ void LLDebugVarMessageBox::onClose(bool app_quitting)
206 206
207void LLDebugVarMessageBox::draw() 207void LLDebugVarMessageBox::draw()
208{ 208{
209 char text[128]; 209 char text[128]; /*Flawfinder: ignore*/
210 switch(mVarType) 210 switch(mVarType)
211 { 211 {
212 case VAR_TYPE_F32: 212 case VAR_TYPE_F32:
213 sprintf(text, "%.3f", *((F32*)mVarData)); 213 snprintf(text, sizeof(text), "%.3f", *((F32*)mVarData)); /*Flawfinder: ignore*/
214 break; 214 break;
215 case VAR_TYPE_S32: 215 case VAR_TYPE_S32:
216 sprintf(text, "%d", *((S32*)mVarData)); 216 snprintf(text, sizeof(text), "%d", *((S32*)mVarData)); /*Flawfinder: ignore*/
217 break; 217 break;
218 case VAR_TYPE_VEC3: 218 case VAR_TYPE_VEC3:
219 LLVector3* vec_p = (LLVector3*)mVarData; 219 LLVector3* vec_p = (LLVector3*)mVarData;
220 sprintf(text, "%.3f %.3f %.3f", vec_p->mV[VX], vec_p->mV[VY], vec_p->mV[VZ]); 220 snprintf(text, sizeof(text), "%.3f %.3f %.3f", vec_p->mV[VX], vec_p->mV[VY], vec_p->mV[VZ]); /*Flawfinder: ignore*/
221 break; 221 break;
222 } 222 }
223 mText->setText(text); 223 mText->setText(text);
diff --git a/linden/indra/newview/lldirpicker.cpp b/linden/indra/newview/lldirpicker.cpp
index 38a008c..75f8056 100644
--- a/linden/indra/newview/lldirpicker.cpp
+++ b/linden/indra/newview/lldirpicker.cpp
@@ -203,7 +203,7 @@ OSStatus LLDirPicker::doNavChooseDialog()
203 AEKeyword theAEKeyword; 203 AEKeyword theAEKeyword;
204 DescType typeCode; 204 DescType typeCode;
205 Size actualSize = 0; 205 Size actualSize = 0;
206 char path[LL_MAX_PATH]; 206 char path[LL_MAX_PATH]; /*Flawfinder: ignore*/
207 207
208 memset(&fsRef, 0, sizeof(fsRef)); 208 memset(&fsRef, 0, sizeof(fsRef));
209 error = AEGetNthPtr(&navReply.selection, 1, typeFSRef, &theAEKeyword, &typeCode, &fsRef, sizeof(fsRef), &actualSize); 209 error = AEGetNthPtr(&navReply.selection, 1, typeFSRef, &theAEKeyword, &typeCode, &fsRef, sizeof(fsRef), &actualSize);
diff --git a/linden/indra/newview/lldirpicker.h b/linden/indra/newview/lldirpicker.h
index 72b5675..71a65fd 100644
--- a/linden/indra/newview/lldirpicker.h
+++ b/linden/indra/newview/lldirpicker.h
@@ -83,7 +83,7 @@ private:
83 83
84#endif 84#endif
85 85
86 char mDirs[DIRNAME_BUFFER_SIZE]; 86 char mDirs[DIRNAME_BUFFER_SIZE]; /*Flawfinder: ignore*/
87 LLString* mFileName; 87 LLString* mFileName;
88 LLString mDir; 88 LLString mDir;
89 BOOL mLocked; 89 BOOL mLocked;
diff --git a/linden/indra/newview/lldrawable.cpp b/linden/indra/newview/lldrawable.cpp
index af4f205..4d9083e 100644
--- a/linden/indra/newview/lldrawable.cpp
+++ b/linden/indra/newview/lldrawable.cpp
@@ -33,8 +33,6 @@
33#include "material_codes.h" 33#include "material_codes.h"
34 34
35// viewer includes 35// viewer includes
36#include "llagparray.h"
37#include "llagparray.inl"
38#include "llcriticaldamp.h" 36#include "llcriticaldamp.h"
39#include "llface.h" 37#include "llface.h"
40#include "lllightconstants.h" 38#include "lllightconstants.h"
@@ -77,6 +75,8 @@ U32 LLDrawable::sNumZombieDrawables = 0;
77F32 LLDrawable::sCurPixelAngle = 0; 75F32 LLDrawable::sCurPixelAngle = 0;
78LLDynamicArrayPtr<LLPointer<LLDrawable> > LLDrawable::sDeadList; 76LLDynamicArrayPtr<LLPointer<LLDrawable> > LLDrawable::sDeadList;
79 77
78#define FORCE_INVISIBLE_AREA 16.f
79
80// static 80// static
81void LLDrawable::incrementVisible() 81void LLDrawable::incrementVisible()
82{ 82{
@@ -127,12 +127,11 @@ void LLDrawable::destroy()
127 std::for_each(mFaces.begin(), mFaces.end(), DeletePointer()); 127 std::for_each(mFaces.begin(), mFaces.end(), DeletePointer());
128 mFaces.clear(); 128 mFaces.clear();
129 129
130 /* 130
131 if (!(sNumZombieDrawables % 10)) 131 /*if (!(sNumZombieDrawables % 10))
132 { 132 {
133 llinfos << "- Zombie drawables: " << sNumZombieDrawables << llendl; 133 llinfos << "- Zombie drawables: " << sNumZombieDrawables << llendl;
134 } 134 }*/
135 */
136} 135}
137 136
138void LLDrawable::markDead() 137void LLDrawable::markDead()
@@ -269,7 +268,7 @@ void LLDrawable::removeFace(const S32 i)
269} 268}
270#endif 269#endif
271 270
272LLFace* LLDrawable::addFace(LLDrawPool *poolp, LLViewerImage *texturep, const BOOL shared_geom) 271LLFace* LLDrawable::addFace(LLFacePool *poolp, LLViewerImage *texturep)
273{ 272{
274 LLMemType mt(LLMemType::MTYPE_DRAWABLE); 273 LLMemType mt(LLMemType::MTYPE_DRAWABLE);
275 274
@@ -278,16 +277,12 @@ LLFace* LLDrawable::addFace(LLDrawPool *poolp, LLViewerImage *texturep, const BO
278 if (face) 277 if (face)
279 { 278 {
280 mFaces.push_back(face); 279 mFaces.push_back(face);
281 face->setPool(poolp, texturep);
282 280
283 if (shared_geom) 281 if (poolp)
284 { 282 {
285 face->setState(LLFace::SHARED_GEOM); 283 face->setPool(poolp, texturep);
286 }
287 else if (!isVisible())
288 {
289 face->setState(LLFace::BACKLIST);
290 } 284 }
285
291 if (isState(UNLIT)) 286 if (isState(UNLIT))
292 { 287 {
293 face->setState(LLFace::FULLBRIGHT); 288 face->setState(LLFace::FULLBRIGHT);
@@ -296,7 +291,27 @@ LLFace* LLDrawable::addFace(LLDrawPool *poolp, LLViewerImage *texturep, const BO
296 return face; 291 return face;
297} 292}
298 293
299void LLDrawable::setNumFaces(const S32 newFaces, LLDrawPool *poolp, LLViewerImage *texturep) 294LLFace* LLDrawable::addFace(const LLTextureEntry *te, LLViewerImage *texturep)
295{
296 LLMemType mt(LLMemType::MTYPE_DRAWABLE);
297
298 LLFace *face = new LLFace(this, mVObjp);
299
300 face->setTEOffset(mFaces.size());
301 face->setTexture(texturep);
302 face->setPoolType(gPipeline.getPoolTypeFromTE(te, texturep));
303 mFaces.push_back(face);
304
305 if (isState(UNLIT))
306 {
307 face->setState(LLFace::FULLBRIGHT);
308 }
309
310 return face;
311
312}
313
314void LLDrawable::setNumFaces(const S32 newFaces, LLFacePool *poolp, LLViewerImage *texturep)
300{ 315{
301 if (newFaces == (S32)mFaces.size()) 316 if (newFaces == (S32)mFaces.size())
302 { 317 {
@@ -317,7 +332,7 @@ void LLDrawable::setNumFaces(const S32 newFaces, LLDrawPool *poolp, LLViewerImag
317 } 332 }
318} 333}
319 334
320void LLDrawable::setNumFacesFast(const S32 newFaces, LLDrawPool *poolp, LLViewerImage *texturep) 335void LLDrawable::setNumFacesFast(const S32 newFaces, LLFacePool *poolp, LLViewerImage *texturep)
321{ 336{
322 if (newFaces <= (S32)mFaces.size() && newFaces >= (S32)mFaces.size()/2) 337 if (newFaces <= (S32)mFaces.size() && newFaces >= (S32)mFaces.size()/2)
323 { 338 {
@@ -372,21 +387,43 @@ void LLDrawable::updateMaterial()
372 387
373void LLDrawable::makeActive() 388void LLDrawable::makeActive()
374{ 389{
390#if !LL_RELEASE_FOR_DOWNLOAD
391 if (mVObjp.notNull())
392 {
393 U32 pcode = mVObjp->getPCode();
394 if (pcode == LLViewerObject::LL_VO_WATER ||
395 pcode == LLViewerObject::LL_VO_SURFACE_PATCH ||
396 pcode == LLViewerObject::LL_VO_PART_GROUP ||
397 pcode == LLViewerObject::LL_VO_CLOUDS ||
398 pcode == LLViewerObject::LL_VO_STARS ||
399 pcode == LLViewerObject::LL_VO_GROUND ||
400 pcode == LLViewerObject::LL_VO_SKY)
401 {
402 llerrs << "Static viewer object has active drawable!" << llendl;
403 }
404 }
405#endif
406
375 if (!isState(ACTIVE)) // && mGeneration > 0) 407 if (!isState(ACTIVE)) // && mGeneration > 0)
376 { 408 {
377 setState(ACTIVE); 409 setState(ACTIVE);
378 410
411 //parent must be made active first
379 if (!isRoot() && !mParent->isActive()) 412 if (!isRoot() && !mParent->isActive())
380 { 413 {
381 mParent->makeActive(); 414 mParent->makeActive();
382 } 415 }
383 416
384 gPipeline.setActive(this, TRUE); 417 gPipeline.setActive(this, TRUE);
385 418
386 //all child objects must also be active 419 //all child objects must also be active
387 for (U32 i = 0; i < getChildCount(); i++) 420 for (U32 i = 0; i < getChildCount(); i++)
388 { 421 {
389 getChild(i)->makeActive(); 422 LLDrawable* drawable = getChild(i);
423 if (drawable)
424 {
425 drawable->makeActive();
426 }
390 } 427 }
391 428
392 if (mVObjp->getPCode() == LL_PCODE_VOLUME) 429 if (mVObjp->getPCode() == LL_PCODE_VOLUME)
@@ -403,7 +440,15 @@ void LLDrawable::makeActive()
403 gPipeline.markRebuild(this, LLDrawable::REBUILD_VOLUME, TRUE); 440 gPipeline.markRebuild(this, LLDrawable::REBUILD_VOLUME, TRUE);
404 } 441 }
405 } 442 }
406 mQuietCount = 0; 443 updatePartition();
444 if (isRoot())
445 {
446 mQuietCount = 0;
447 }
448 else
449 {
450 getParent()->mQuietCount = 0;
451 }
407} 452}
408 453
409 454
@@ -416,7 +461,7 @@ void LLDrawable::makeStatic()
416 461
417 if (mParent.notNull() && mParent->isActive()) 462 if (mParent.notNull() && mParent->isActive())
418 { 463 {
419 llerrs << "Drawable became static with active parent!" << llendl; 464 llwarns << "Drawable becamse static with active parent!" << llendl;
420 } 465 }
421 466
422 S32 child_count = mVObjp->mChildList.size(); 467 S32 child_count = mVObjp->mChildList.size();
@@ -425,6 +470,10 @@ void LLDrawable::makeStatic()
425 LLDrawable* child_drawable = mVObjp->mChildList[child_num]->mDrawable; 470 LLDrawable* child_drawable = mVObjp->mChildList[child_num]->mDrawable;
426 if (child_drawable) 471 if (child_drawable)
427 { 472 {
473 if (child_drawable->getParent() != this)
474 {
475 llwarns << "Child drawable has unknown parent." << llendl;
476 }
428 child_drawable->makeStatic(); 477 child_drawable->makeStatic();
429 } 478 }
430 } 479 }
@@ -441,6 +490,7 @@ void LLDrawable::makeStatic()
441 setSpatialBridge(NULL); 490 setSpatialBridge(NULL);
442 } 491 }
443 } 492 }
493 updatePartition();
444} 494}
445 495
446// Returns "distance" between target destination and resulting xfrom 496// Returns "distance" between target destination and resulting xfrom
@@ -499,9 +549,8 @@ F32 LLDrawable::updateXform(BOOL undamped)
499 if (scaled >= MIN_INTERPOLATE_DISTANCE_SQUARED) 549 if (scaled >= MIN_INTERPOLATE_DISTANCE_SQUARED)
500 { 550 {
501 //scaling requires an immediate rebuild 551 //scaling requires an immediate rebuild
502 gPipeline.markRebuild(this, LLDrawable::REBUILD_VOLUME, TRUE); 552 gPipeline.markRebuild(this, LLDrawable::REBUILD_POSITION, TRUE);
503 } 553 }
504
505 } 554 }
506 else 555 else
507 { 556 {
@@ -517,20 +566,6 @@ F32 LLDrawable::updateXform(BOOL undamped)
517 mXform.updateMatrix(); 566 mXform.updateMatrix();
518 567
519 mCurrentScale = target_scale; 568 mCurrentScale = target_scale;
520
521 if (!getVOVolume())
522 {
523 movePartition();
524 }
525 else if (mSpatialBridge)
526 {
527 gPipeline.markMoved(mSpatialBridge, FALSE);
528 }
529 else
530 {
531 //a child prim moved and needs its verts regenerated
532 gPipeline.markRebuild(this, LLDrawable::REBUILD_VOLUME, TRUE);
533 }
534 569
535 return dist_squared; 570 return dist_squared;
536} 571}
@@ -540,11 +575,6 @@ void LLDrawable::setRadius(F32 radius)
540 if (mRadius != radius) 575 if (mRadius != radius)
541 { 576 {
542 mRadius = radius; 577 mRadius = radius;
543 updateBinRadius();
544 if (!getVOVolume())
545 {
546 movePartition();
547 }
548 } 578 }
549} 579}
550 580
@@ -573,13 +603,10 @@ void LLDrawable::moveUpdatePipeline(BOOL moved)
573 603
574void LLDrawable::movePartition() 604void LLDrawable::movePartition()
575{ 605{
576 if (getSpatialGroup() || getVOVolume()) 606 LLSpatialPartition* part = getSpatialPartition();
607 if (part)
577 { 608 {
578 LLSpatialPartition* part = getSpatialPartition(); 609 part->move(this, getSpatialGroup());
579 if (part)
580 {
581 part->move(this, getSpatialGroup());
582 }
583 } 610 }
584} 611}
585 612
@@ -625,10 +652,27 @@ BOOL LLDrawable::updateMoveUndamped()
625 } 652 }
626 653
627 mVObjp->clearChanged(LLXform::MOVED); 654 mVObjp->clearChanged(LLXform::MOVED);
628 655
629 return TRUE; 656 return TRUE;
630} 657}
631 658
659void LLDrawable::updatePartition()
660{
661 if (!getVOVolume())
662 {
663 movePartition();
664 }
665 else if (mSpatialBridge)
666 {
667 gPipeline.markMoved(mSpatialBridge, FALSE);
668 }
669 else
670 {
671 //a child prim moved and needs its verts regenerated
672 gPipeline.markRebuild(this, LLDrawable::REBUILD_POSITION, TRUE);
673 }
674}
675
632BOOL LLDrawable::updateMoveDamped() 676BOOL LLDrawable::updateMoveDamped()
633{ 677{
634 F32 dist_squared = updateXform(FALSE); 678 F32 dist_squared = updateXform(FALSE);
@@ -654,25 +698,42 @@ BOOL LLDrawable::updateMoveDamped()
654 698
655void LLDrawable::updateDistance(LLCamera& camera) 699void LLDrawable::updateDistance(LLCamera& camera)
656{ 700{
657 if (mVObjp->isHUDAttachment())
658 {
659 mDistanceWRTCamera = 1.0f;
660 if (sCurVisible % 16 == 0)
661 {
662 mVObjp->updateLOD();
663 }
664 return;
665 }
666
667 LLVector3 pos(getPositionGroup());
668
669 pos -= camera.getOrigin();
670 mDistanceWRTCamera = pos.magVec();
671
672 //switch LOD with the spatial group to avoid artifacts 701 //switch LOD with the spatial group to avoid artifacts
673 LLSpatialGroup* sg = getSpatialGroup(); 702 LLSpatialGroup* sg = getSpatialGroup();
703
704 LLVector3 pos;
705
674 if (!sg || sg->changeLOD()) 706 if (!sg || sg->changeLOD())
675 { 707 {
708 LLVOVolume* volume = getVOVolume();
709 if (volume)
710 {
711 volume->updateRelativeXform();
712 pos = LLVector3(0,0,0) * volume->getRelativeXform();
713
714 for (S32 i = 0; i < getNumFaces(); i++)
715 {
716 LLFace* facep = getFace(i);
717 if (facep->getPoolType() == LLDrawPool::POOL_ALPHA)
718 {
719 LLVector3 box = (facep->mExtents[1] - facep->mExtents[0]) * 0.25f;
720 LLVector3 v = (facep->mCenterLocal-camera.getOrigin());
721 LLVector3 at = camera.getAtAxis();
722 for (U32 j = 0; j < 3; j++)
723 {
724 v.mV[j] -= box.mV[j] * at.mV[j];
725 }
726 facep->mDistance = v * camera.getAtAxis();
727 }
728 }
729 }
730 else
731 {
732 pos = LLVector3(getPositionGroup());
733 }
734
735 pos -= camera.getOrigin();
736 mDistanceWRTCamera = llround(pos.magVec(), 0.01f);
676 mVObjp->updateLOD(); 737 mVObjp->updateLOD();
677 } 738 }
678} 739}
@@ -687,67 +748,33 @@ void LLDrawable::updateTexture()
687 return; 748 return;
688 } 749 }
689 750
690 // *FIX: this updates textures on all faces in this drawable, not 751 if (getNumFaces() != mVObjp->getNumTEs())
691 // just the viewer object we care about 752 { //drawable is transitioning its face count
692 if (mVObjp->getNumTEs()) 753 return;
754 }
755
756 if (getVOVolume())
693 { 757 {
694 // For each face in this drawable, change the drawpool if necessary. 758 if (!isActive())
695 for (S32 i = 0; i < getNumFaces(); i++) 759 {
760 gPipeline.markMoved(this);
761 }
762 else
696 { 763 {
697 LLFace *facep = mFaces[i]; 764 if (isRoot())
698 U32 pool_type = facep->getPool()->getType();
699
700 if ((pool_type == LLDrawPool::POOL_SIMPLE) ||
701 (pool_type == LLDrawPool::POOL_ALPHA) ||
702 (pool_type == LLDrawPool::POOL_HUD) ||
703 (pool_type == LLDrawPool::POOL_MEDIA) ||
704 (pool_type == LLDrawPool::POOL_BUMP))
705 { 765 {
706 LLViewerObject* objp = facep->getViewerObject(); 766 mQuietCount = 0;
707 S32 te_offset = facep->getTEOffset(); 767 }
708 768 else
709 if (te_offset >= objp->getNumTEs()) // Shouldn't happen 769 {
710 { 770 getParent()->mQuietCount = 0;
711 llwarns << "TE offsets don't match!" << llendl;
712 facep->setTEOffset(-1);
713 continue;
714 }
715
716 LLDrawPool* poolp = NULL;
717 LLViewerImage* imagep = (te_offset >= 0) ? objp->getTEImage(te_offset) : facep->getTexture();
718 if (facep->isState(LLFace::HUD_RENDER))
719 {
720 poolp = gPipeline.getPool(LLDrawPool::POOL_HUD);
721 }
722 else if (te_offset >= 0)
723 {
724 // This face actually uses texture entries...
725 const LLTextureEntry* te = facep->getTextureEntry();
726 poolp = LLPipeline::getPoolFromTE(te, imagep);
727 }
728 else
729 {
730 // No texture entry for this face.
731 if (!imagep)
732 {
733 poolp = gPipeline.getPool(LLDrawPool::POOL_SIMPLE, NULL);
734 }
735 else if ((imagep->getComponents() == 4) || (imagep->getComponents() == 2))
736 {
737 poolp = gPipeline.getPool(LLDrawPool::POOL_ALPHA);
738 }
739 else
740 {
741 poolp = gPipeline.getPool(LLDrawPool::POOL_SIMPLE, imagep);
742 }
743 }
744 facep->setPool(poolp, imagep);
745 } 771 }
746 } 772 }
773
774 gPipeline.markRebuild(this, LLDrawable::REBUILD_MATERIAL, TRUE);
747 } 775 }
748} 776}
749 777
750
751BOOL LLDrawable::updateGeometry(BOOL priority) 778BOOL LLDrawable::updateGeometry(BOOL priority)
752{ 779{
753 llassert(mVObjp.notNull()); 780 llassert(mVObjp.notNull());
@@ -788,12 +815,9 @@ void LLDrawable::shiftPos(const LLVector3 &shift_vector)
788 mXform.setScale(1,1,1); 815 mXform.setScale(1,1,1);
789 mXform.updateMatrix(); 816 mXform.updateMatrix();
790 817
791 if (isStatic() || // *FIX: don't know why this is happening, but 818 if (isStatic())
792 // some terrain patches are becoming active
793 // (earth quake, maybe?) DP
794 getRenderType() == LLPipeline::RENDER_TYPE_TERRAIN)
795 { 819 {
796 LLStrider<LLVector3> verticesp; 820 gPipeline.markRebuild(this, LLDrawable::REBUILD_GEOMETRY, TRUE);
797 821
798 for (S32 i = 0; i < getNumFaces(); i++) 822 for (S32 i = 0; i < getNumFaces(); i++)
799 { 823 {
@@ -802,34 +826,13 @@ void LLDrawable::shiftPos(const LLVector3 &shift_vector)
802 facep->mExtents[0] += shift_vector; 826 facep->mExtents[0] += shift_vector;
803 facep->mExtents[1] += shift_vector; 827 facep->mExtents[1] += shift_vector;
804 828
805 if (facep->hasGeometry() && !facep->isState(LLFace::SHARED_GEOM)) 829 if (facep->hasGeometry())
806 { 830 {
807 S32 index = facep->getVertices(verticesp); 831 facep->mVertexBuffer = NULL;
808 if (index >= 0) 832 facep->mLastVertexBuffer = NULL;
809 {
810 S32 vertex_count = facep->getGeomCount();
811 for (S32 j = 0; j < vertex_count; j++)
812 {
813 *verticesp += shift_vector;
814 verticesp++;
815 }
816 }
817 } 833 }
818 } 834 }
819 } 835
820 else
821 {
822 // Update the face centers.
823 for (S32 i = 0; i < getNumFaces(); i++)
824 {
825 LLFace *facep = getFace(i);
826 facep->mCenterAgent += shift_vector;
827 }
828 }
829
830 //update spatial extents
831 if (!getVOVolume() || isStatic())
832 {
833 mExtents[0] += shift_vector; 836 mExtents[0] += shift_vector;
834 mExtents[1] += shift_vector; 837 mExtents[1] += shift_vector;
835 mPositionGroup += LLVector3d(shift_vector); 838 mPositionGroup += LLVector3d(shift_vector);
@@ -874,6 +877,8 @@ void LLDrawable::updateSpatialExtents()
874 mVObjp->updateSpatialExtents(mExtents[0], mExtents[1]); 877 mVObjp->updateSpatialExtents(mExtents[0], mExtents[1]);
875 } 878 }
876 879
880 updateBinRadius();
881
877 if (mSpatialBridge.notNull()) 882 if (mSpatialBridge.notNull())
878 { 883 {
879 mPositionGroup.setVec(0,0,0); 884 mPositionGroup.setVec(0,0,0);
@@ -883,11 +888,14 @@ void LLDrawable::updateSpatialExtents()
883 888
884void LLDrawable::updateBinRadius() 889void LLDrawable::updateBinRadius()
885{ 890{
886 S32 binLOD = mVObjp ? mVObjp->getLOD() : 2; 891 if (mVObjp.notNull())
887 static F64 detail_bins[] = { 8, 4, 2, 1 }; 892 {
888 F32 radius = getVOVolume() && isStatic() ? 893 mBinRadius = mVObjp->getBinRadius();
889 (mExtents[1]-mExtents[0]).magVec() : getRadius(); 894 }
890 mBinRadius = detail_bins[binLOD] * llmax((F64) radius, (3-binLOD)*0.25); 895 else
896 {
897 mBinRadius = getRadius()*4.f;
898 }
891} 899}
892 900
893void LLDrawable::updateLightSet() 901void LLDrawable::updateLightSet()
@@ -898,6 +906,7 @@ void LLDrawable::updateLightSet()
898 return; 906 return;
899 } 907 }
900 908
909 LLSpatialPartition* part = gPipeline.getSpatialPartition(LLPipeline::PARTITION_VOLUME);
901 LLVOVolume* light = getVOVolume(); 910 LLVOVolume* light = getVOVolume();
902 if (isLight() && light) 911 if (isLight() && light)
903 { 912 {
@@ -907,7 +916,7 @@ void LLDrawable::updateLightSet()
907 gPipeline.markRelight(*iter); 916 gPipeline.markRelight(*iter);
908 } 917 }
909 mLightSet.clear(); 918 mLightSet.clear();
910 gPipeline.mObjectPartition->getObjects(getPositionAgent(), light->getLightRadius(), mLightSet); 919 part->getObjects(getPositionAgent(), light->getLightRadius(), mLightSet);
911 for (drawable_set_t::iterator iter = mLightSet.begin(); iter != mLightSet.end(); iter++) 920 for (drawable_set_t::iterator iter = mLightSet.begin(); iter != mLightSet.end(); iter++)
912 { 921 {
913 gPipeline.markRelight(*iter); 922 gPipeline.markRelight(*iter);
@@ -917,9 +926,9 @@ void LLDrawable::updateLightSet()
917 { 926 {
918 // mLightSet points to nearby lights 927 // mLightSet points to nearby lights
919 mLightSet.clear(); 928 mLightSet.clear();
920 gPipeline.mObjectPartition->getLights(getPositionAgent(), getRadius(), mLightSet); 929 part->getLights(getPositionAgent(), getRadius(), mLightSet);
921 const U32 max_lights = 16; 930 const drawable_set_t::size_type MAX_LIGHTS = 16;
922 if (mLightSet.size() > max_lights) 931 if (mLightSet.size() > MAX_LIGHTS)
923 { 932 {
924 typedef std::set<std::pair<F32,LLPointer<LLDrawable> > > sorted_pair_set_t; 933 typedef std::set<std::pair<F32,LLPointer<LLDrawable> > > sorted_pair_set_t;
925 sorted_pair_set_t sorted_set; 934 sorted_pair_set_t sorted_set;
@@ -1053,28 +1062,28 @@ LLSpatialPartition* LLDrawable::getSpatialPartition()
1053{ 1062{
1054 LLSpatialPartition* retval = NULL; 1063 LLSpatialPartition* retval = NULL;
1055 1064
1056 if (mVObjp->isHUDAttachment())
1057 { //HUD attachments don't get space partitioned
1058 return NULL;
1059 }
1060
1061 if (!mVObjp || 1065 if (!mVObjp ||
1062 !getVOVolume() || 1066 !getVOVolume() ||
1063 isStatic()) 1067 isStatic())
1064 { 1068 {
1065 retval = gPipeline.mObjectPartition; 1069 retval = gPipeline.getSpatialPartition((LLViewerObject*) mVObjp);
1066 } 1070 }
1067 1071 else if (isRoot())
1068 //must be an active volume 1072 { //must be an active volume
1069 if (!retval && isRoot())
1070 {
1071 if (!mSpatialBridge) 1073 if (!mSpatialBridge)
1072 { 1074 {
1073 setSpatialBridge(new LLSpatialBridge(this)); 1075 if (mVObjp->isHUDAttachment())
1076 {
1077 setSpatialBridge(new LLHUDBridge(this));
1078 }
1079 else
1080 {
1081 setSpatialBridge(new LLVolumeBridge(this));
1082 }
1074 } 1083 }
1075 return mSpatialBridge->asPartition(); 1084 return mSpatialBridge->asPartition();
1076 } 1085 }
1077 else if (!retval) 1086 else
1078 { 1087 {
1079 retval = getParent()->getSpatialPartition(); 1088 retval = getParent()->getSpatialPartition();
1080 } 1089 }
@@ -1088,27 +1097,73 @@ LLSpatialPartition* LLDrawable::getSpatialPartition()
1088 return retval; 1097 return retval;
1089} 1098}
1090 1099
1100
1101BOOL LLDrawable::isVisible() const
1102{
1103 if (mVisible == sCurVisible)
1104 {
1105 return TRUE;
1106 }
1107
1108 if (isActive())
1109 {
1110 if (isRoot())
1111 {
1112 LLSpatialGroup* group = mSpatialBridge.notNull() ? mSpatialBridge->getSpatialGroup() :
1113 getSpatialGroup();
1114 if (!group || group->isVisible())
1115 {
1116 mVisible = sCurVisible;
1117 return TRUE;
1118 }
1119 }
1120 else
1121 {
1122 if (getParent()->isVisible())
1123 {
1124 mVisible = sCurVisible;
1125 return TRUE;
1126 }
1127 }
1128 }
1129 else
1130 {
1131 LLSpatialGroup* group = getSpatialGroup();
1132 if (!group || group->isVisible())
1133 {
1134 mVisible = sCurVisible;
1135 return TRUE;
1136 }
1137 }
1138
1139 return FALSE;
1140}
1141
1091//======================================= 1142//=======================================
1092// Spatial Partition Bridging Drawable 1143// Spatial Partition Bridging Drawable
1093//======================================= 1144//=======================================
1094 1145
1095LLSpatialBridge::LLSpatialBridge(LLDrawable* root) 1146LLSpatialBridge::LLSpatialBridge(LLDrawable* root, U32 data_mask)
1147: LLSpatialPartition(data_mask, FALSE)
1096{ 1148{
1097 mDrawable = root; 1149 mDrawable = root;
1098 root->setSpatialBridge(this); 1150 root->setSpatialBridge(this);
1099 1151
1100 mRenderType = mDrawable->mRenderType; //w00! magic! 1152 mRenderType = mDrawable->mRenderType;
1101 1153 mDrawableType = mDrawable->mRenderType;
1154
1155 mPartitionType = LLPipeline::PARTITION_VOLUME;
1156
1102 mOctree->balance(); 1157 mOctree->balance();
1103 1158
1104 gPipeline.mObjectPartition->put(this); 1159 gPipeline.getSpatialPartition(mPartitionType)->put(this);
1105} 1160}
1106 1161
1107LLSpatialBridge::~LLSpatialBridge() 1162LLSpatialBridge::~LLSpatialBridge()
1108{ 1163{
1109 if (getSpatialGroup()) 1164 if (getSpatialGroup())
1110 { 1165 {
1111 gPipeline.mObjectPartition->remove(this, getSpatialGroup()); 1166 gPipeline.getSpatialPartition(mPartitionType)->remove(this, getSpatialGroup());
1112 } 1167 }
1113} 1168}
1114 1169
@@ -1116,7 +1171,6 @@ void LLSpatialBridge::updateSpatialExtents()
1116{ 1171{
1117 LLSpatialGroup* root = (LLSpatialGroup*) mOctree->getListener(0); 1172 LLSpatialGroup* root = (LLSpatialGroup*) mOctree->getListener(0);
1118 1173
1119 if (mOctree->getChildCount() > 0)
1120 { 1174 {
1121 LLFastTimer ftm(LLFastTimer::FTM_CULL_REBOUND); 1175 LLFastTimer ftm(LLFastTimer::FTM_CULL_REBOUND);
1122 root->rebound(); 1176 root->rebound();
@@ -1164,6 +1218,9 @@ void LLSpatialBridge::updateSpatialExtents()
1164 } 1218 }
1165 } 1219 }
1166 } 1220 }
1221
1222 LLVector3 diagonal = newMax - newMin;
1223 mRadius = diagonal.magVec() * 0.5f;
1167 1224
1168 mPositionGroup.setVec((newMin + newMax) * 0.5f); 1225 mPositionGroup.setVec((newMin + newMax) * 0.5f);
1169 updateBinRadius(); 1226 updateBinRadius();
@@ -1171,9 +1228,7 @@ void LLSpatialBridge::updateSpatialExtents()
1171 1228
1172void LLSpatialBridge::updateBinRadius() 1229void LLSpatialBridge::updateBinRadius()
1173{ 1230{
1174 F32 rad = ((mExtents[1]-mExtents[0])*0.5f).magVec(); 1231 mBinRadius = llmin((F32) mOctree->getSize().mdV[0]*0.5f, 256.f);
1175 mBinRadius = llmax(rad, 2.f);
1176 mRadius = rad;
1177} 1232}
1178 1233
1179LLCamera LLSpatialBridge::transformCamera(LLCamera& camera) 1234LLCamera LLSpatialBridge::transformCamera(LLCamera& camera)
@@ -1181,39 +1236,123 @@ LLCamera LLSpatialBridge::transformCamera(LLCamera& camera)
1181 LLCamera ret = camera; 1236 LLCamera ret = camera;
1182 LLXformMatrix* mat = mDrawable->getXform(); 1237 LLXformMatrix* mat = mDrawable->getXform();
1183 LLVector3 center = LLVector3(0,0,0) * mat->getWorldMatrix(); 1238 LLVector3 center = LLVector3(0,0,0) * mat->getWorldMatrix();
1184 //LLQuaternion rotation = LLQuaternion(mat->getWorldMatrix()); 1239 LLQuaternion rotation = LLQuaternion(mat->getWorldMatrix());
1185 1240
1186 //ret.rotate(~mat->getRotation());
1187 LLVector3 delta = ret.getOrigin() - center; 1241 LLVector3 delta = ret.getOrigin() - center;
1188 delta *= ~mat->getRotation(); 1242 LLQuaternion rot = ~mat->getRotation();
1189 ret.setOrigin(delta); 1243
1244 delta *= rot;
1245 LLVector3 lookAt = ret.getAtAxis();
1246 LLVector3 up_axis = ret.getUpAxis();
1247 LLVector3 left_axis = ret.getLeftAxis();
1190 1248
1249 lookAt *= rot;
1250 up_axis *= rot;
1251 left_axis *= rot;
1252
1253 ret.setOrigin(delta);
1254 ret.setAxes(lookAt, left_axis, up_axis);
1255
1191 return ret; 1256 return ret;
1192} 1257}
1193 1258
1194void LLDrawable::setVisible(LLCamera& camera, std::vector<LLDrawable*>* results, BOOL for_select) 1259void LLDrawable::setVisible(LLCamera& camera, std::vector<LLDrawable*>* results, BOOL for_select)
1195{ 1260{
1196 mVisible = sCurVisible; 1261 mVisible = sCurVisible;
1262
1263#if 0 && !LL_RELEASE_FOR_DOWNLOAD
1264 //crazy paranoid rules checking
1265 if (getVOVolume())
1266 {
1267 if (!isRoot())
1268 {
1269 if (isActive() && !mParent->isActive())
1270 {
1271 llerrs << "Active drawable has static parent!" << llendl;
1272 }
1273
1274 if (isStatic() && !mParent->isStatic())
1275 {
1276 llerrs << "Static drawable has active parent!" << llendl;
1277 }
1278
1279 if (mSpatialBridge)
1280 {
1281 llerrs << "Child drawable has spatial bridge!" << llendl;
1282 }
1283 }
1284 else if (isActive() && !mSpatialBridge)
1285 {
1286 llerrs << "Active root drawable has no spatial bridge!" << llendl;
1287 }
1288 else if (isStatic() && mSpatialBridge.notNull())
1289 {
1290 llerrs << "Static drawable has spatial bridge!" << llendl;
1291 }
1292 }
1293#endif
1197} 1294}
1198 1295
1296class LLOctreeMarkNotCulled: public LLOctreeTraveler<LLDrawable>
1297{
1298public:
1299 LLCamera* mCamera;
1300
1301 LLOctreeMarkNotCulled(LLCamera* camera_in) : mCamera(camera_in) { }
1302
1303 virtual void traverse(const LLOctreeNode<LLDrawable>* node)
1304 {
1305 LLSpatialGroup* group = (LLSpatialGroup*) node->getListener(0);
1306 group->clearState(LLSpatialGroup::OCCLUDED | LLSpatialGroup::CULLED);
1307 LLOctreeTraveler<LLDrawable>::traverse(node);
1308 }
1309
1310 void visit(const LLOctreeState<LLDrawable>* branch)
1311 {
1312 gPipeline.markNotCulled((LLSpatialGroup*) branch->getListener(0), *mCamera, TRUE);
1313 }
1314};
1315
1199void LLSpatialBridge::setVisible(LLCamera& camera_in, std::vector<LLDrawable*>* results, BOOL for_select) 1316void LLSpatialBridge::setVisible(LLCamera& camera_in, std::vector<LLDrawable*>* results, BOOL for_select)
1200{ 1317{
1318 if (!gPipeline.hasRenderType(mDrawableType))
1319 {
1320 return;
1321 }
1322
1323 LLViewerObject *vobj = mDrawable->getVObj();
1324 if (vobj && vobj->isAttachment() && !vobj->isHUDAttachment())
1325 {
1326 LLVOAvatar* av;
1327 LLDrawable* parent = mDrawable->getParent();
1328
1329 if (parent)
1330 {
1331 av = (LLVOAvatar*) parent->getVObj();
1332
1333 if (!av->isVisible())
1334 {
1335 return;
1336 }
1337 }
1338 }
1339
1340
1341 LLSpatialGroup* group = (LLSpatialGroup*) mOctree->getListener(0);
1342 group->rebound();
1343
1201 LLVector3 center = (mExtents[0] + mExtents[1]) * 0.5f; 1344 LLVector3 center = (mExtents[0] + mExtents[1]) * 0.5f;
1202 LLVector3 size = (mExtents[1]-mExtents[0]) * 0.5f; 1345 LLVector3 size = (mExtents[1]-mExtents[0]) * 0.5f;
1203 1346
1204 if (camera_in.AABBInFrustum(center, size)) 1347 if (camera_in.AABBInFrustum(center, size))
1205 { 1348 {
1206 LLVector3 lookAt = center - camera_in.getOrigin(); 1349 if (LLPipeline::calcPixelArea(center, size, camera_in) < FORCE_INVISIBLE_AREA)
1207 F32 distSqr = lookAt.magVecSquared();
1208 F32 objRad = size.magVecSquared();
1209
1210 if (objRad/distSqr < SG_MIN_DIST_RATIO*4)
1211 { 1350 {
1212 return; 1351 return;
1213 } 1352 }
1214 1353
1215 LLDrawable::setVisible(camera_in); 1354 LLDrawable::setVisible(camera_in);
1216 1355
1217 if (for_select) 1356 if (for_select)
1218 { 1357 {
1219 results->push_back(mDrawable); 1358 results->push_back(mDrawable);
@@ -1222,42 +1361,36 @@ void LLSpatialBridge::setVisible(LLCamera& camera_in, std::vector<LLDrawable*>*
1222 results->push_back(mDrawable->getChild(i)); 1361 results->push_back(mDrawable->getChild(i));
1223 } 1362 }
1224 } 1363 }
1225 else 1364 else
1226 { 1365 {
1227 const LLVector3* extents = mDrawable->getSpatialExtents(); 1366 LLCamera trans_camera = transformCamera(camera_in);
1228 objRad = mDrawable->getRadius(); 1367 LLOctreeMarkNotCulled culler(&trans_camera);
1229 objRad *= objRad; 1368 culler.traverse(mOctree);
1230 1369 }
1231 if (objRad/distSqr > SG_MIN_DIST_RATIO)
1232 {
1233 gPipeline.markNotCulled(mDrawable, camera_in);
1234 }
1235
1236 for (U32 i = 0; i < mDrawable->getChildCount(); i++)
1237 {
1238 LLDrawable* child = mDrawable->getChild(i);
1239 extents = child->getSpatialExtents();
1240 objRad = child->getRadius();
1241 objRad *= objRad;
1242
1243 if (objRad/distSqr > SG_MIN_DIST_RATIO)
1244 {
1245 gPipeline.markNotCulled(mDrawable->getChild(i), camera_in);
1246 }
1247 }
1248 }
1249 } 1370 }
1250} 1371}
1251 1372
1252void LLSpatialBridge::updateDistance(LLCamera& camera_in) 1373void LLSpatialBridge::updateDistance(LLCamera& camera_in)
1253{ 1374{
1375 if (mDrawable == NULL)
1376 {
1377 markDead();
1378 return;
1379 }
1380
1254 LLCamera camera = transformCamera(camera_in); 1381 LLCamera camera = transformCamera(camera_in);
1255 1382
1256 mDrawable->updateDistance(camera); 1383 mDrawable->updateDistance(camera);
1257 1384
1258 for (U32 i = 0; i < mDrawable->getChildCount(); ++i) 1385 for (U32 i = 0; i < mDrawable->getChildCount(); ++i)
1259 { 1386 {
1260 mDrawable->getChild(i)->updateDistance(camera); 1387 LLDrawable* child = mDrawable->getChild(i);
1388 if (!child)
1389 {
1390 llwarns << "Corrupt drawable found while updating spatial bridge distance." << llendl;
1391 continue;
1392 }
1393 child->updateDistance(camera);
1261 } 1394 }
1262} 1395}
1263 1396
@@ -1280,7 +1413,7 @@ void LLSpatialBridge::move(LLDrawable *drawablep, LLSpatialGroup *curp, BOOL imm
1280BOOL LLSpatialBridge::updateMove() 1413BOOL LLSpatialBridge::updateMove()
1281{ 1414{
1282 mOctree->balance(); 1415 mOctree->balance();
1283 gPipeline.mObjectPartition->move(this, getSpatialGroup(), TRUE); 1416 gPipeline.getSpatialPartition(mPartitionType)->move(this, getSpatialGroup(), TRUE);
1284 return TRUE; 1417 return TRUE;
1285} 1418}
1286 1419
@@ -1338,3 +1471,81 @@ const LLVector3 LLDrawable::getPositionAgent() const
1338 } 1471 }
1339} 1472}
1340 1473
1474BOOL LLDrawable::isAnimating() const
1475{
1476 if (!getVObj())
1477 {
1478 return TRUE;
1479 }
1480
1481 if (getScale() != mVObjp->getScale())
1482 {
1483 return TRUE;
1484 }
1485
1486 if (mVObjp->isFlexible())
1487 {
1488 return TRUE;
1489 }
1490
1491 if (mVObjp->getPCode() == LLViewerObject::LL_VO_PART_GROUP)
1492 {
1493 return TRUE;
1494 }
1495
1496 if (mVObjp->getPCode() == LLViewerObject::LL_VO_CLOUDS)
1497 {
1498 return TRUE;
1499 }
1500
1501 LLVOVolume* vol = getVOVolume();
1502 if (vol && vol->mTextureAnimp)
1503 {
1504 return TRUE;
1505 }
1506
1507 if (!isRoot() && !mVObjp->getAngularVelocity().isExactlyZero())
1508 {
1509 return TRUE;
1510 }
1511
1512 return FALSE;
1513}
1514
1515void LLDrawable::updateFaceSize(S32 idx)
1516{
1517 if (mVObjp.notNull())
1518 {
1519 mVObjp->updateFaceSize(idx);
1520 }
1521}
1522
1523LLBridgePartition::LLBridgePartition()
1524: LLSpatialPartition(0, TRUE)
1525{
1526 mRenderByGroup = FALSE;
1527 mDrawableType = LLPipeline::RENDER_TYPE_AVATAR;
1528 mPartitionType = LLPipeline::PARTITION_BRIDGE;
1529 mLODPeriod = 1;
1530 mSlopRatio = 0.f;
1531}
1532
1533LLHUDBridge::LLHUDBridge(LLDrawable* drawablep)
1534: LLVolumeBridge(drawablep)
1535{
1536 mDrawableType = LLPipeline::RENDER_TYPE_HUD;
1537 mPartitionType = LLPipeline::PARTITION_HUD;
1538 mSlopRatio = 0.0f;
1539}
1540
1541F32 LLHUDBridge::calcPixelArea(LLSpatialGroup* group, LLCamera& camera)
1542{
1543 return 1024.f;
1544}
1545
1546
1547void LLHUDBridge::shiftPos(const LLVector3& vec)
1548{
1549 //don't shift hud bridges on region crossing
1550}
1551
diff --git a/linden/indra/newview/lldrawable.h b/linden/indra/newview/lldrawable.h
index 062427e..6ff4d1e 100644
--- a/linden/indra/newview/lldrawable.h
+++ b/linden/indra/newview/lldrawable.h
@@ -38,8 +38,8 @@
38#include "v4coloru.h" 38#include "v4coloru.h"
39#include "llquaternion.h" 39#include "llquaternion.h"
40#include "xform.h" 40#include "xform.h"
41#include "llmemtype.h"
41#include "llprimitive.h" 42#include "llprimitive.h"
42#include "llviewerimage.h"
43#include "lldarray.h" 43#include "lldarray.h"
44#include "llstat.h" 44#include "llstat.h"
45#include "llviewerobject.h" 45#include "llviewerobject.h"
@@ -52,6 +52,7 @@ class LLSpatialGroup;
52class LLSpatialBridge; 52class LLSpatialBridge;
53class LLSpatialPartition; 53class LLSpatialPartition;
54class LLVOVolume; 54class LLVOVolume;
55class LLViewerImage;
55 56
56extern F32 gFrameTimeSeconds; 57extern F32 gFrameTimeSeconds;
57 58
@@ -74,7 +75,7 @@ public:
74 75
75 BOOL isLight() const; 76 BOOL isLight() const;
76 77
77 BOOL isVisible() const { return (mVisible == sCurVisible); } 78 BOOL isVisible() const;
78 virtual void setVisible(LLCamera& camera_in, std::vector<LLDrawable*>* results = NULL, BOOL for_select = FALSE); 79 virtual void setVisible(LLCamera& camera_in, std::vector<LLDrawable*>* results = NULL, BOOL for_select = FALSE);
79 80
80 81
@@ -121,10 +122,11 @@ public:
121 inline S32 getNumFaces() const; 122 inline S32 getNumFaces() const;
122 123
123 //void removeFace(const S32 i); // SJB: Avoid using this, it's slow 124 //void removeFace(const S32 i); // SJB: Avoid using this, it's slow
124 LLFace* addFace(LLDrawPool *poolp, LLViewerImage *texturep, const BOOL shared_geom = FALSE); 125 LLFace* addFace(LLFacePool *poolp, LLViewerImage *texturep);
126 LLFace* addFace(const LLTextureEntry *te, LLViewerImage *texturep);
125 void deleteFaces(S32 offset, S32 count); 127 void deleteFaces(S32 offset, S32 count);
126 void setNumFaces(const S32 numFaces, LLDrawPool *poolp, LLViewerImage *texturep); 128 void setNumFaces(const S32 numFaces, LLFacePool *poolp, LLViewerImage *texturep);
127 void setNumFacesFast(const S32 numFaces, LLDrawPool *poolp, LLViewerImage *texturep); 129 void setNumFacesFast(const S32 numFaces, LLFacePool *poolp, LLViewerImage *texturep);
128 void mergeFaces(LLDrawable* src); 130 void mergeFaces(LLDrawable* src);
129 131
130 void init(); 132 void init();
@@ -138,6 +140,8 @@ public:
138 140
139 BOOL isActive() const { return isState(ACTIVE); } 141 BOOL isActive() const { return isState(ACTIVE); }
140 BOOL isStatic() const { return !isActive(); } 142 BOOL isStatic() const { return !isActive(); }
143 BOOL isAnimating() const;
144
141 virtual BOOL updateMove(); 145 virtual BOOL updateMove();
142 virtual void movePartition(); 146 virtual void movePartition();
143 147
@@ -146,6 +150,7 @@ public:
146 virtual void updateDistance(LLCamera& camera); 150 virtual void updateDistance(LLCamera& camera);
147 BOOL updateGeometry(BOOL priority); 151 BOOL updateGeometry(BOOL priority);
148 BOOL updateLighting(BOOL priority); 152 BOOL updateLighting(BOOL priority);
153 void updateFaceSize(S32 idx);
149 void updateLightSet(); 154 void updateLightSet();
150 155
151 F32 getSunShadowFactor() const { return mSunShadowFactor; } 156 F32 getSunShadowFactor() const { return mSunShadowFactor; }
@@ -195,6 +200,7 @@ public:
195protected: 200protected:
196 virtual ~LLDrawable() { destroy(); } 201 virtual ~LLDrawable() { destroy(); }
197 void moveUpdatePipeline(BOOL moved); 202 void moveUpdatePipeline(BOOL moved);
203 void updatePartition();
198 BOOL updateMoveDamped(); 204 BOOL updateMoveDamped();
199 BOOL updateMoveUndamped(); 205 BOOL updateMoveUndamped();
200 206
@@ -206,6 +212,7 @@ public:
206 typedef std::set<LLPointer<LLDrawable> > drawable_set_t; 212 typedef std::set<LLPointer<LLDrawable> > drawable_set_t;
207 typedef std::vector<LLPointer<LLDrawable> > drawable_vector_t; 213 typedef std::vector<LLPointer<LLDrawable> > drawable_vector_t;
208 typedef std::list<LLPointer<LLDrawable> > drawable_list_t; 214 typedef std::list<LLPointer<LLDrawable> > drawable_list_t;
215 typedef std::queue<LLPointer<LLDrawable> > drawable_queue_t;
209 216
210 struct CompareDistanceGreater 217 struct CompareDistanceGreater
211 { 218 {
@@ -246,11 +253,14 @@ public:
246 UNLIT = 0x00000200, 253 UNLIT = 0x00000200,
247 LIGHT = 0x00000400, 254 LIGHT = 0x00000400,
248 LIGHTING_BUILT = 0x00000800, 255 LIGHTING_BUILT = 0x00000800,
249 REBUILD_VOLUME = 0x00001000, 256 REBUILD_VOLUME = 0x00001000, //volume changed LOD or parameters, or vertex buffer changed
250 REBUILD_TCOORD = 0x00002000, 257 REBUILD_TCOORD = 0x00002000, //texture coordinates changed
251 REBUILD_GEOMETRY= REBUILD_VOLUME|REBUILD_TCOORD, 258 REBUILD_COLOR = 0x00004000, //color changed
252 REBUILD_LIGHTING= 0x00008000, 259 REBUILD_LIGHTING= 0x00008000, //lighting information changed
253 REBUILD_ALL = REBUILD_GEOMETRY|REBUILD_LIGHTING, 260 REBUILD_POSITION= 0x00010000, //vertex positions/normals changed
261 REBUILD_GEOMETRY= REBUILD_POSITION|REBUILD_TCOORD|REBUILD_COLOR,
262 REBUILD_MATERIAL= REBUILD_TCOORD|REBUILD_COLOR,
263 REBUILD_ALL = REBUILD_GEOMETRY|REBUILD_LIGHTING|REBUILD_VOLUME,
254 ON_SHIFT_LIST = 0x00100000, 264 ON_SHIFT_LIST = 0x00100000,
255// NO_INTERP_COLOR = 0x00200000, 265// NO_INTERP_COLOR = 0x00200000,
256 BLOCKER = 0x00400000, 266 BLOCKER = 0x00400000,
@@ -285,6 +295,8 @@ public:
285 void setSpatialBridge(LLSpatialBridge* bridge) { mSpatialBridge = (LLDrawable*) bridge; } 295 void setSpatialBridge(LLSpatialBridge* bridge) { mSpatialBridge = (LLDrawable*) bridge; }
286 LLSpatialBridge* getSpatialBridge() { return (LLSpatialBridge*) (LLDrawable*) mSpatialBridge; } 296 LLSpatialBridge* getSpatialBridge() { return (LLSpatialBridge*) (LLDrawable*) mSpatialBridge; }
287 297
298 static F32 sCurPixelAngle; //current pixels per radian
299
288protected: 300protected:
289 typedef std::vector<LLFace*> face_list_t; 301 typedef std::vector<LLFace*> face_list_t;
290 302
@@ -296,7 +308,7 @@ protected:
296 LLPointer<LLDrawable> mSpatialBridge; 308 LLPointer<LLDrawable> mSpatialBridge;
297 S32 mSpatialGroupOffset; 309 S32 mSpatialGroupOffset;
298 310
299 U32 mVisible; 311 mutable U32 mVisible;
300 F32 mRadius; 312 F32 mRadius;
301 LLVector3 mExtents[2]; 313 LLVector3 mExtents[2];
302 LLVector3d mPositionGroup; 314 LLVector3d mPositionGroup;
@@ -308,7 +320,6 @@ protected:
308 LLVector3 mCurrentScale; 320 LLVector3 mCurrentScale;
309 321
310 static U32 sCurVisible; // Counter for what value of mVisible means currently visible 322 static U32 sCurVisible; // Counter for what value of mVisible means currently visible
311 static F32 sCurPixelAngle; //current pixels per radian
312 323
313 static U32 sNumZombieDrawables; 324 static U32 sNumZombieDrawables;
314 static LLDynamicArrayPtr<LLPointer<LLDrawable> > sDeadList; 325 static LLDynamicArrayPtr<LLPointer<LLDrawable> > sDeadList;
@@ -318,6 +329,7 @@ protected:
318inline LLFace* LLDrawable::getFace(const S32 i) const 329inline LLFace* LLDrawable::getFace(const S32 i) const
319{ 330{
320 llassert((U32)i < mFaces.size()); 331 llassert((U32)i < mFaces.size());
332 llassert(mFaces[i]);
321 return mFaces[i]; 333 return mFaces[i];
322} 334}
323 335
diff --git a/linden/indra/newview/lldrawpool.cpp b/linden/indra/newview/lldrawpool.cpp
index 18d6000..dc2e6ba 100644
--- a/linden/indra/newview/lldrawpool.cpp
+++ b/linden/indra/newview/lldrawpool.cpp
@@ -32,7 +32,6 @@
32#include "llfasttimer.h" 32#include "llfasttimer.h"
33#include "llviewercontrol.h" 33#include "llviewercontrol.h"
34 34
35#include "llagparray.h"
36#include "lldrawable.h" 35#include "lldrawable.h"
37#include "lldrawpoolalpha.h" 36#include "lldrawpoolalpha.h"
38#include "lldrawpoolavatar.h" 37#include "lldrawpoolavatar.h"
@@ -43,53 +42,38 @@
43#include "lldrawpoolsky.h" 42#include "lldrawpoolsky.h"
44#include "lldrawpoolstars.h" 43#include "lldrawpoolstars.h"
45#include "lldrawpooltree.h" 44#include "lldrawpooltree.h"
46#include "lldrawpooltreenew.h"
47#include "lldrawpoolterrain.h" 45#include "lldrawpoolterrain.h"
48#include "lldrawpoolwater.h" 46#include "lldrawpoolwater.h"
49#include "lldrawpoolhud.h"
50#include "llface.h" 47#include "llface.h"
51#include "llviewerobjectlist.h" // For debug listing. 48#include "llviewerobjectlist.h" // For debug listing.
52#include "llvotreenew.h"
53#include "pipeline.h" 49#include "pipeline.h"
54 50
55#include "llagparray.inl"
56
57U32 LLDrawPool::sDataSizes[LLDrawPool::DATA_MAX_TYPES] =
58{
59 12, // DATA_VERTICES
60 8, // DATA_TEX_COORDS0
61 8, // DATA_TEX_COORDS1
62 8, // DATA_TEX_COORDS2
63 8, // DATA_TEX_COORDS3
64 12, // DATA_NORMALS
65 4, // DATA_VERTEX_WEIGHTS,
66 16, // DATA_CLOTHING_WEIGHTS
67 12, // DATA_BINORMALS
68 4, // DATA_COLORS
69};
70
71S32 LLDrawPool::sNumDrawPools = 0; 51S32 LLDrawPool::sNumDrawPools = 0;
72 52
53
54//=============================
55// Draw Pool Implementation
56//=============================
73LLDrawPool *LLDrawPool::createPool(const U32 type, LLViewerImage *tex0) 57LLDrawPool *LLDrawPool::createPool(const U32 type, LLViewerImage *tex0)
74{ 58{
75 LLDrawPool *poolp = NULL; 59 LLDrawPool *poolp = NULL;
76 switch (type) 60 switch (type)
77 { 61 {
78 case POOL_SIMPLE: 62 case POOL_SIMPLE:
79 poolp = new LLDrawPoolSimple(tex0); 63 poolp = new LLDrawPoolSimple();
80 break; 64 break;
81 case POOL_ALPHA: 65 case POOL_ALPHA:
82 poolp = new LLDrawPoolAlpha(); 66 poolp = new LLDrawPoolAlpha();
83 break; 67 break;
68 case POOL_ALPHA_POST_WATER:
69 poolp = new LLDrawPoolAlphaPostWater();
70 break;
84 case POOL_AVATAR: 71 case POOL_AVATAR:
85 poolp = new LLDrawPoolAvatar(); 72 poolp = new LLDrawPoolAvatar();
86 break; 73 break;
87 case POOL_TREE: 74 case POOL_TREE:
88 poolp = new LLDrawPoolTree(tex0); 75 poolp = new LLDrawPoolTree(tex0);
89 break; 76 break;
90 case POOL_TREE_NEW:
91 poolp = new LLDrawPoolTreeNew(tex0);
92 break;
93 case POOL_TERRAIN: 77 case POOL_TERRAIN:
94 poolp = new LLDrawPoolTerrain(tex0); 78 poolp = new LLDrawPoolTerrain(tex0);
95 break; 79 break;
@@ -99,9 +83,6 @@ LLDrawPool *LLDrawPool::createPool(const U32 type, LLViewerImage *tex0)
99 case POOL_STARS: 83 case POOL_STARS:
100 poolp = new LLDrawPoolStars(); 84 poolp = new LLDrawPoolStars();
101 break; 85 break;
102 case POOL_CLOUDS:
103 poolp = new LLDrawPoolClouds();
104 break;
105 case POOL_WATER: 86 case POOL_WATER:
106 poolp = new LLDrawPoolWater(); 87 poolp = new LLDrawPoolWater();
107 break; 88 break;
@@ -109,10 +90,7 @@ LLDrawPool *LLDrawPool::createPool(const U32 type, LLViewerImage *tex0)
109 poolp = new LLDrawPoolGround(); 90 poolp = new LLDrawPoolGround();
110 break; 91 break;
111 case POOL_BUMP: 92 case POOL_BUMP:
112 poolp = new LLDrawPoolBump(tex0); 93 poolp = new LLDrawPoolBump();
113 break;
114 case POOL_HUD:
115 poolp = new LLDrawPoolHUD();
116 break; 94 break;
117 default: 95 default:
118 llerrs << "Unknown draw pool type!" << llendl; 96 llerrs << "Unknown draw pool type!" << llendl;
@@ -123,183 +101,86 @@ LLDrawPool *LLDrawPool::createPool(const U32 type, LLViewerImage *tex0)
123 return poolp; 101 return poolp;
124} 102}
125 103
126LLDrawPool::LLDrawPool(const U32 type, const U32 data_mask_il, const U32 data_mask_nil) 104LLDrawPool::LLDrawPool(const U32 type)
127{ 105{
128 llassert(data_mask_il & DATA_VERTICES_MASK);
129 S32 i;
130 mType = type; 106 mType = type;
131 sNumDrawPools++; 107 sNumDrawPools++;
132 mId = sNumDrawPools; 108 mId = sNumDrawPools;
133 109 mVertexShaderLevel = 0;
134 mDataMaskIL = data_mask_il;
135 mDataMaskNIL = data_mask_nil;
136
137 U32 cur_mask = 0x01;
138 U32 cur_offset = 0;
139 for (i = 0; i < DATA_MAX_TYPES; i++)
140 {
141 mDataOffsets[i] = cur_offset;
142 if (cur_mask & mDataMaskIL)
143 {
144 cur_offset += sDataSizes[i];
145 }
146 cur_mask <<= 1;
147 }
148
149 mStride = cur_offset;
150
151 mCleanupUnused = FALSE;
152 mIndicesDrawn = 0; 110 mIndicesDrawn = 0;
153 mRebuildFreq = 128 + rand() % 5; 111}
154 mRebuildTime = 0;
155 mGeneration = 1;
156 mSkippedVertices = 0;
157
158 resetDrawOrders();
159 resetVertexData(0);
160
161 if (gGLManager.mHasATIVAO && !gGLManager.mIsRadeon9700)
162 {
163 // ATI 8500 doesn't like indices > 15 bit.
164 mMaxVertices = DEFAULT_MAX_VERTICES/2;
165 }
166 else
167 {
168 mMaxVertices = DEFAULT_MAX_VERTICES;
169 }
170 112
171 // JC: This must happen last, as setUseAGP reads many of the 113LLDrawPool::~LLDrawPool()
172 // above variables. 114{
173 mUseAGP = FALSE;
174 setUseAGP(gPipeline.usingAGP());
175 115
176 for (i=0; i<NUM_BUCKETS; i++)
177 {
178 mFreeListGeomHead[i] = -1;
179 mFreeListIndHead[i] = -1;
180 }
181 mVertexShaderLevel = 0;
182} 116}
183 117
184void LLDrawPool::destroy() 118LLViewerImage *LLDrawPool::getDebugTexture()
185{ 119{
186 if (!mReferences.empty()) 120 return NULL;
187 {
188 llinfos << mReferences.size() << " references left on deletion of draw pool!" << llendl;
189 }
190} 121}
191 122
192 123//virtual
193LLDrawPool::~LLDrawPool() 124void LLDrawPool::beginRenderPass( S32 pass )
194{ 125{
195 destroy();
196
197 llassert( gPipeline.findPool( getType(), getTexture() ) == NULL );
198} 126}
199 127
200BOOL LLDrawPool::setUseAGP(BOOL use_agp) 128//virtual
129void LLDrawPool::endRenderPass( S32 pass )
201{ 130{
202 BOOL ok = TRUE; 131 glDisableClientState ( GL_TEXTURE_COORD_ARRAY );
203 S32 vertex_count = mMemory.count() / mStride; 132 glDisableClientState ( GL_COLOR_ARRAY );
204 if (vertex_count > mMaxVertices && use_agp) 133 glDisableClientState ( GL_NORMAL_ARRAY );
205 {
206#ifdef DEBUG_AGP
207 llwarns << "Allocating " << vertex_count << " vertices in pool type " << getType() << ", disabling AGP!" << llendl
208#endif
209 use_agp = FALSE;
210 ok = FALSE;
211 }
212
213 if (mUseAGP != use_agp)
214 {
215 mUseAGP = use_agp;
216
217 BOOL ok = TRUE;
218 ok &= mMemory.setUseAGP(use_agp);
219
220 if (mDataMaskNIL & DATA_VERTEX_WEIGHTS_MASK)
221 {
222 ok &= mWeights.setUseAGP(use_agp);
223 }
224 if (mDataMaskNIL & DATA_CLOTHING_WEIGHTS_MASK)
225 {
226 ok &= mClothingWeights.setUseAGP(use_agp);
227 }
228
229 if (!ok)
230 {
231 // Disable AGP if any one of these doesn't have AGP, we don't want to try
232 // mixing AGP and non-agp arrays in a single pool.
233#ifdef DEBUG_AGP
234 llinfos << "Aborting using AGP because set failed on a mem block!" << llendl;
235#endif
236 setUseAGP(FALSE);
237 ok = FALSE;
238 }
239 }
240 return ok;
241} 134}
242 135
243void LLDrawPool::flushAGP() 136U32 LLDrawPool::getTrianglesDrawn() const
244{ 137{
245 mMemory.flushAGP(); 138 return mIndicesDrawn / 3;
246
247 if (mDataMaskNIL & DATA_VERTEX_WEIGHTS_MASK)
248 {
249 mWeights.flushAGP();
250 }
251 if (mDataMaskNIL & DATA_CLOTHING_WEIGHTS_MASK)
252 {
253 mClothingWeights.flushAGP();
254 }
255} 139}
256 140
257void LLDrawPool::syncAGP() 141void LLDrawPool::resetTrianglesDrawn()
258{ 142{
259 if (!getVertexCount()) 143 mIndicesDrawn = 0;
260 { 144}
261 return;
262 }
263 setUseAGP(gPipeline.usingAGP());
264 145
265 BOOL all_agp_on = TRUE; 146void LLDrawPool::addIndicesDrawn(const U32 indices)
266 mMemory.sync(); 147{
267 all_agp_on &= mMemory.isAGP(); 148 mIndicesDrawn += indices;
149}
268 150
269 if (mDataMaskNIL & DATA_VERTEX_WEIGHTS_MASK) 151//=============================
270 { 152// Face Pool Implementation
271 mWeights.sync(); 153//=============================
272 all_agp_on &= mWeights.isAGP(); 154LLFacePool::LLFacePool(const U32 type)
273 } 155: LLDrawPool(type)
156{
157 resetDrawOrders();
158}
274 159
275 if (mDataMaskNIL & DATA_CLOTHING_WEIGHTS_MASK) 160LLFacePool::~LLFacePool()
276 { 161{
277 mClothingWeights.sync(); 162 destroy();
278 all_agp_on &= mClothingWeights.isAGP(); 163}
279 }
280 164
281 // Since sometimes AGP allocation is done during syncs, we need 165void LLFacePool::destroy()
282 // to make sure that if AGP allocation fails, we fallback to non-agp. 166{
283 if (mUseAGP && !all_agp_on) 167 if (!mReferences.empty())
284 { 168 {
285#ifdef DEBUG_AGP 169 llinfos << mReferences.size() << " references left on deletion of draw pool!" << llendl;
286 llinfos << "setUseAGP false because of AGP sync failure!" << llendl;
287#endif
288 setUseAGP(FALSE);
289 } 170 }
290} 171}
291 172
292void LLDrawPool::dirtyTexture(const LLViewerImage *imagep) 173void LLFacePool::dirtyTextures(const std::set<LLViewerImage*>& textures)
293{ 174{
294} 175}
295 176
296BOOL LLDrawPool::moveFace(LLFace *face, LLDrawPool *poolp, BOOL copy_data) 177BOOL LLFacePool::moveFace(LLFace *face, LLDrawPool *poolp, BOOL copy_data)
297{ 178{
298 return TRUE; 179 return TRUE;
299} 180}
300 181
301// static 182// static
302S32 LLDrawPool::drawLoop(face_array_t& face_list, const U32* index_array) 183S32 LLFacePool::drawLoop(face_array_t& face_list)
303{ 184{
304 S32 res = 0; 185 S32 res = 0;
305 if (!face_list.empty()) 186 if (!face_list.empty())
@@ -308,19 +189,15 @@ S32 LLDrawPool::drawLoop(face_array_t& face_list, const U32* index_array)
308 iter != face_list.end(); iter++) 189 iter != face_list.end(); iter++)
309 { 190 {
310 LLFace *facep = *iter; 191 LLFace *facep = *iter;
311 if (facep->mSkipRender) 192 //facep->enableLights();
312 { 193 res += facep->renderIndexed();
313 continue;
314 }
315 facep->enableLights();
316 res += facep->renderIndexed(index_array);
317 } 194 }
318 } 195 }
319 return res; 196 return res;
320} 197}
321 198
322// static 199// static
323S32 LLDrawPool::drawLoopSetTex(face_array_t& face_list, const U32* index_array, S32 stage) 200S32 LLFacePool::drawLoopSetTex(face_array_t& face_list, S32 stage)
324{ 201{
325 S32 res = 0; 202 S32 res = 0;
326 if (!face_list.empty()) 203 if (!face_list.empty())
@@ -329,117 +206,30 @@ S32 LLDrawPool::drawLoopSetTex(face_array_t& face_list, const U32* index_array,
329 iter != face_list.end(); iter++) 206 iter != face_list.end(); iter++)
330 { 207 {
331 LLFace *facep = *iter; 208 LLFace *facep = *iter;
332 if (facep->mSkipRender)
333 {
334 continue;
335 }
336 facep->bindTexture(stage); 209 facep->bindTexture(stage);
337 facep->enableLights(); 210 facep->enableLights();
338 res += facep->renderIndexed(index_array); 211 res += facep->renderIndexed();
339 } 212 }
340 } 213 }
341 return res; 214 return res;
342} 215}
343 216
344void LLDrawPool::drawLoop() 217void LLFacePool::drawLoop()
345{ 218{
346 const U32* index_array = getRawIndices();
347 if (!mDrawFace.empty()) 219 if (!mDrawFace.empty())
348 { 220 {
349 mIndicesDrawn += drawLoop(mDrawFace, index_array); 221 mIndicesDrawn += drawLoop(mDrawFace);
350 } 222 }
351} 223}
352 224
353BOOL LLDrawPool::getVertexStrider(LLStrider<LLVector3> &vertices, const U32 index) 225void LLFacePool::renderFaceSelected(LLFace *facep,
354{
355 llassert(mDataMaskIL & LLDrawPool::DATA_VERTICES_MASK);
356 vertices = (LLVector3*)(mMemory.getMem() + mDataOffsets[DATA_VERTICES] + index * mStride);
357 vertices.setStride(mStride);
358 return TRUE;
359}
360
361BOOL LLDrawPool::getTexCoordStrider(LLStrider<LLVector2> &tex_coords, const U32 index, const U32 pass)
362{
363 llassert(mDataMaskIL & (LLDrawPool::DATA_TEX_COORDS0_MASK << pass));
364 tex_coords = (LLVector2*)(mMemory.getMem() + mDataOffsets[DATA_TEX_COORDS0 + pass] + index * mStride);
365 tex_coords.setStride(mStride);
366 return TRUE;
367}
368
369
370BOOL LLDrawPool::getVertexWeightStrider(LLStrider<F32> &vertex_weights, const U32 index)
371{
372 llassert(mDataMaskNIL & LLDrawPool::DATA_VERTEX_WEIGHTS_MASK);
373
374 vertex_weights = &mWeights[index];
375 vertex_weights.setStride( 0 );
376 return TRUE;
377}
378
379BOOL LLDrawPool::getClothingWeightStrider(LLStrider<LLVector4> &clothing_weights, const U32 index)
380{
381 llassert(mDataMaskNIL & LLDrawPool::DATA_CLOTHING_WEIGHTS_MASK);
382
383 clothing_weights= &mClothingWeights[index];
384 clothing_weights.setStride( 0 );
385
386 return TRUE;
387}
388
389BOOL LLDrawPool::getNormalStrider(LLStrider<LLVector3> &normals, const U32 index)
390{
391 llassert((mDataMaskIL) & LLDrawPool::DATA_NORMALS_MASK);
392
393 normals = (LLVector3*)(mMemory.getMem() + mDataOffsets[DATA_NORMALS] + index * mStride);
394
395 normals.setStride( mStride );
396
397 return TRUE;
398}
399
400
401BOOL LLDrawPool::getBinormalStrider(LLStrider<LLVector3> &binormals, const U32 index)
402{
403 llassert((mDataMaskIL) & LLDrawPool::DATA_BINORMALS_MASK);
404
405 binormals = (LLVector3*)(mMemory.getMem() + mDataOffsets[DATA_BINORMALS] + index * mStride);
406
407 binormals.setStride( mStride );
408
409 return TRUE;
410}
411
412BOOL LLDrawPool::getColorStrider(LLStrider<LLColor4U> &colors, const U32 index)
413{
414 llassert((mDataMaskIL) & LLDrawPool::DATA_COLORS_MASK);
415
416 colors = (LLColor4U*)(mMemory.getMem() + mDataOffsets[DATA_COLORS] + index * mStride);
417
418 colors.setStride( mStride );
419
420 return TRUE;
421}
422
423//virtual
424void LLDrawPool::beginRenderPass( S32 pass )
425{
426}
427
428//virtual
429void LLDrawPool::endRenderPass( S32 pass )
430{
431 glDisableClientState ( GL_TEXTURE_COORD_ARRAY );
432 glDisableClientState ( GL_COLOR_ARRAY );
433 glDisableClientState ( GL_NORMAL_ARRAY );
434}
435void LLDrawPool::renderFaceSelected(LLFace *facep,
436 LLImageGL *image, 226 LLImageGL *image,
437 const LLColor4 &color, 227 const LLColor4 &color,
438 const S32 index_offset, const S32 index_count) 228 const S32 index_offset, const S32 index_count)
439{ 229{
440} 230}
441 231
442void LLDrawPool::renderVisibility() 232void LLFacePool::renderVisibility()
443{ 233{
444 if (mDrawFace.empty()) 234 if (mDrawFace.empty())
445 { 235 {
@@ -525,893 +315,284 @@ void LLDrawPool::renderVisibility()
525 315
526} 316}
527 317
528void LLDrawPool::enqueue(LLFace* facep) 318void LLFacePool::enqueue(LLFace* facep)
529{
530 if (facep->isState(LLFace::BACKLIST))
531 {
532 mMoveFace.put(facep);
533 }
534 else
535 {
536#if ENABLE_FACE_LINKING
537 facep->mSkipRender = FALSE;
538 facep->mNextFace = NULL;
539
540 if (mDrawFace.size() > 0)
541 {
542 LLFace* last_face = mDrawFace[mDrawFace.size()-1];
543 if (match(last_face, facep))
544 {
545 last_face->link(facep);
546 }
547 }
548#endif
549 mDrawFace.put(facep);
550 }
551}
552
553void LLDrawPool::bindGLVertexPointer()
554{
555 mMemory.bindGLVertexPointer(getStride(DATA_VERTICES), mDataOffsets[DATA_VERTICES]);
556}
557
558void LLDrawPool::bindGLTexCoordPointer(const U32 pass)
559{
560 mMemory.bindGLTexCoordPointer(getStride(DATA_TEX_COORDS0+pass), mDataOffsets[DATA_TEX_COORDS0+pass]);
561}
562
563void LLDrawPool::bindGLNormalPointer()
564{
565 mMemory.bindGLNormalPointer(getStride(DATA_NORMALS), mDataOffsets[DATA_NORMALS]);
566}
567
568void LLDrawPool::bindGLBinormalPointer(S32 index)
569{
570 mMemory.bindGLBinormalPointer(index, getStride(DATA_BINORMALS), mDataOffsets[DATA_BINORMALS]);
571}
572
573void LLDrawPool::bindGLColorPointer()
574{ 319{
575 mMemory.bindGLColorPointer(getStride(DATA_COLORS), mDataOffsets[DATA_COLORS]); 320 mDrawFace.push_back(facep);
576} 321}
577 322
578void LLDrawPool::bindGLVertexWeightPointer(S32 index) 323// virtual
579{ 324BOOL LLFacePool::addFace(LLFace *facep)
580 mWeights.bindGLVertexWeightPointer(index, 0, 0);
581}
582
583void LLDrawPool::bindGLVertexClothingWeightPointer(S32 index)
584{
585 mClothingWeights.bindGLVertexClothingWeightPointer(index, 0, 0);
586}
587
588
589U32* LLDrawPool::getIndices(S32 index)
590{
591 return &mIndices[index];
592}
593
594const LLVector3& LLDrawPool::getVertex(const S32 index)
595{
596 llassert(mDataMaskIL & DATA_VERTICES_MASK);
597 llassert(index < mMemory.count());
598 llassert(mMemory.getMem());
599 return *(LLVector3*)(mMemory.getMem() + mDataOffsets[DATA_VERTICES] + index * mStride);
600}
601
602const LLVector2& LLDrawPool::getTexCoord(const S32 index, const U32 pass)
603{ 325{
604 llassert(mDataMaskIL & (LLDrawPool::DATA_TEX_COORDS0_MASK << pass)); 326 addFaceReference(facep);
605 llassert(index < mMemory.count()); 327 return TRUE;
606 return *(LLVector2*)(mMemory.getMem() + mDataOffsets[DATA_TEX_COORDS0 + pass] + index * mStride);
607} 328}
608 329
609const LLVector3& LLDrawPool::getNormal(const S32 index) 330// virtual
331BOOL LLFacePool::removeFace(LLFace *facep)
610{ 332{
611 llassert(mDataMaskIL & DATA_NORMALS_MASK); 333 removeFaceReference(facep);
612 llassert(index < mMemory.count());
613 return *(LLVector3*)(mMemory.getMem() + mDataOffsets[DATA_NORMALS] + index * mStride);
614}
615 334
616const LLVector3& LLDrawPool::getBinormal(const S32 index) 335 vector_replace_with_last(mDrawFace, facep);
617{
618 llassert(mDataMaskIL & DATA_BINORMALS_MASK);
619 llassert(index < mMemory.count());
620 return *(LLVector3*)(mMemory.getMem() + mDataOffsets[DATA_BINORMALS] + index * mStride);
621}
622 336
623const LLColor4U& LLDrawPool::getColor(const S32 index) 337 return TRUE;
624{
625 llassert(mDataMaskIL & DATA_COLORS_MASK);
626 llassert(index < mMemory.count());
627 return *(LLColor4U*)(mMemory.getMem() + mDataOffsets[DATA_COLORS] + index * mStride);
628} 338}
629 339
630const F32& LLDrawPool::getVertexWeight(const S32 index) 340// Not absolutely sure if we should be resetting all of the chained pools as well - djs
341void LLFacePool::resetDrawOrders()
631{ 342{
632 llassert(mDataMaskNIL & DATA_VERTEX_WEIGHTS_MASK); 343 mDrawFace.resize(0);
633 llassert(index < mWeights.count());
634 llassert(mWeights.getMem());
635 return mWeights[index];
636} 344}
637 345
638const LLVector4& LLDrawPool::getClothingWeight(const S32 index) 346LLViewerImage *LLFacePool::getTexture()
639{ 347{
640 llassert(mDataMaskNIL & DATA_CLOTHING_WEIGHTS_MASK); 348 return NULL;
641 llassert(index < mClothingWeights.count());
642 llassert(mClothingWeights.getMem());
643 return mClothingWeights[index];
644} 349}
645 350
646////////////////////////////////////////////////////////////////////////////// 351void LLFacePool::removeFaceReference(LLFace *facep)
647
648#define USE_FREE_LIST 0
649#define DEBUG_FREELIST 0
650
651struct tFreeListNode
652{ 352{
653 U32 count; 353 if (facep->getReferenceIndex() != -1)
654 S32 next;
655};
656
657#if DEBUG_FREELIST
658static void check_list(U8 *pool, S32 stride, S32 head, S32 max)
659{
660 int count = 0;
661
662 while (head >= 0)
663 { 354 {
664 tFreeListNode *node = (tFreeListNode *)(pool + head*stride); 355 if (facep->getReferenceIndex() != (S32)mReferences.size())
665 count++; 356 {
666 if ((count > max) || ((node->count>>20) != 0xabc) || ((node->count&0xfffff) < 2)) 357 LLFace *back = mReferences.back();
667 llerrs << "Bad Ind List" << llendl; 358 mReferences[facep->getReferenceIndex()] = back;
668 head = node->next; 359 back->setReferenceIndex(facep->getReferenceIndex());
360 }
361 mReferences.pop_back();
669 } 362 }
363 facep->setReferenceIndex(-1);
670} 364}
671#define CHECK_LIST(x) check_list##x
672#else
673#define CHECK_LIST(x)
674#endif
675 365
676// DEBUG! 366void LLFacePool::addFaceReference(LLFace *facep)
677void LLDrawPool::CheckIntegrity()
678{ 367{
679#if DEBUG_FREELIST 368 if (-1 == facep->getReferenceIndex())
680 int bucket;
681 for (bucket=0; bucket<NUM_BUCKETS; bucket++)
682 { 369 {
683 CHECK_LIST(((U8 *)mMemory.getMem(), mStride, mFreeListGeomHead[bucket], mMemory.count() / mStride)); 370 facep->setReferenceIndex(mReferences.size());
684 CHECK_LIST(((U8 *)mIndices.getMem(), 4, mFreeListIndHead[bucket], mIndices.count())); 371 mReferences.push_back(facep);
685 } 372 }
686#endif
687} 373}
688 374
689int LLDrawPool::freeListBucket(U32 count) 375BOOL LLFacePool::verify() const
690{ 376{
691 int bucket; 377 BOOL ok = TRUE;
692
693 // llassert(NUM_BUCKETS == 8)
694 378
695 if (count & ~511) // >= 512 379 for (std::vector<LLFace*>::const_iterator iter = mDrawFace.begin();
696 bucket = 7; 380 iter != mDrawFace.end(); iter++)
697 else if (count & 256) // 256-511
698 bucket = 6;
699 else if (count & 128)
700 bucket = 5;
701 else if (count & 64)
702 bucket = 4;
703 else if (count & 32)
704 bucket = 3;
705 else if (count & 16)
706 bucket = 2;
707 else if (count & 8) // 8-15
708 bucket = 1;
709 else // 0-7
710 bucket = 0;
711 return bucket;
712}
713
714void remove_node(int nodeidx, int pidx, U8 *membase, int stride, int *head)
715{
716 LLDrawPool::FreeListNode *node = (LLDrawPool::FreeListNode *)(membase + nodeidx*stride);
717 if (pidx >= 0)
718 {
719 LLDrawPool::FreeListNode *pnode = (LLDrawPool::FreeListNode *)(membase + pidx*stride);
720 pnode->next = node->next;
721 }
722 else
723 {
724 *head = node->next;
725 }
726}
727
728void LLDrawPool::freeListAddGeom(S32 index, U32 count)
729{
730#if USE_FREE_LIST
731 int i;
732 U8 *membase = (U8*)mMemory.getMem();
733 // See if next block or previous block is free, if so combine them
734 for (i=0; i<NUM_BUCKETS; i++)
735 {
736 int pidx = -1;
737 int nodeidx = mFreeListGeomHead[i];
738 while(nodeidx >= 0)
739 {
740 int change = 0;
741 FreeListNode *node = (FreeListNode *)(membase + nodeidx*mStride);
742 int nodecount = node->count & 0xffff;
743 // Check for prev block
744 if (nodeidx + nodecount == index)
745 {
746 remove_node(nodeidx, pidx, membase, mStride, &mFreeListGeomHead[i]);
747 // Combine nodes
748 index = nodeidx;
749 count += nodecount;
750 i = 0; // start over ; i = NUM_BUCKETS // done
751 change = 1;
752 //break;
753 }
754 // Check for next block
755 if (nodeidx == index + count)
756 {
757 remove_node(nodeidx, pidx, membase, mStride, &mFreeListGeomHead[i]);
758 // Combine nodes
759 count += nodecount;
760 i = 0; // start over ; i = NUM_BUCKETS // done
761 change = 1;
762 //break;
763 }
764 if (change)
765 break;
766 pidx = nodeidx;
767 nodeidx = node->next;
768 }
769 }
770 // Add (extended) block to free list
771 if (count >= 2) // need 2 words to store free list (theoreticly mStride could = 4)
772 { 381 {
773 CheckIntegrity(); 382 const LLFace* facep = *iter;
774 if ((index + count)*mStride >= mMemory.count()) 383 if (facep->getPool() != this)
775 { 384 {
776 mMemory.shrinkTo(index*mStride); 385 llinfos << "Face in wrong pool!" << llendl;
386 facep->printDebugInfo();
387 ok = FALSE;
777 } 388 }
778 else 389 else if (!facep->verify())
779 { 390 {
780 int bucket = freeListBucket(count); 391 ok = FALSE;
781 FreeListNode *node = (FreeListNode *)(membase + index*mStride);
782 node->count = count | (0xabc<<20);
783 node->next = mFreeListGeomHead[bucket];
784 mFreeListGeomHead[bucket] = index;
785 } 392 }
786 CheckIntegrity();
787 } 393 }
788#endif
789}
790 394
791void LLDrawPool::freeListAddInd(S32 index, U32 count) 395 return ok;
792{
793#if USE_FREE_LIST
794 int i;
795 const U32 *membase = mIndices.getMem();
796 // See if next block or previous block is free, if so combine them
797 for (i=0; i<NUM_BUCKETS; i++)
798 {
799 int pidx = -1;
800 int nodeidx = mFreeListIndHead[i];
801 while(nodeidx >= 0)
802 {
803 int change = 0;
804 FreeListNode *node = (FreeListNode *)(membase + nodeidx);
805 int nodecount = node->count & 0xffff;
806 // Check for prev block
807 if (nodeidx + nodecount == index)
808 {
809 remove_node(nodeidx, pidx, (U8*)membase, 4, &mFreeListIndHead[i]);
810 // Combine nodes
811 index = nodeidx;
812 count += nodecount;
813 i = 0; // start over ; i = NUM_BUCKETS // done
814 change = 1;
815 //break;
816 }
817 // Check for next block
818 if (nodeidx == index + count)
819 {
820 remove_node(nodeidx, pidx, (U8*)membase, 4, &mFreeListIndHead[i]);
821 // Combine nodes
822 count += nodecount;
823 i = 0; // start over ; i = NUM_BUCKETS // done
824 change = 1;
825 //break;
826 }
827 if (change)
828 break;
829 pidx = nodeidx;
830 nodeidx = node->next;
831 }
832 }
833 // Add (extended) block to free list
834 if (count >= 2) // need 2 words to store free list
835 {
836 CheckIntegrity();
837 if (index + count >= mIndices.count())
838 {
839 mIndices.shrinkTo(index);
840 }
841 else
842 {
843 int bucket = freeListBucket(count);
844 FreeListNode *node = (FreeListNode *)(membase + index);
845 node->count = count | (0xabc<<20);
846 node->next = mFreeListIndHead[bucket];
847 mFreeListIndHead[bucket] = index;
848 }
849 CheckIntegrity();
850 }
851#endif
852} 396}
853 397
854S32 LLDrawPool::freeListFindGeom(U32 count) 398void LLFacePool::printDebugInfo() const
855{ 399{
856#if USE_FREE_LIST 400 llinfos << "Pool " << this << " Type: " << getType() << llendl;
857 int i, nodeidx, pidx;
858 int firstbucket = freeListBucket(count);
859 U8 *membase = (U8*)mMemory.getMem();
860 for (i=firstbucket; i<NUM_BUCKETS; i++)
861 {
862 pidx = -1;
863 nodeidx = mFreeListGeomHead[i];
864 CHECK_LIST(((U8 *)mMemory.getMem(), mStride, mFreeListGeomHead[i], mMemory.count() / mStride));
865 while(nodeidx >= 0)
866 {
867 FreeListNode *node = (FreeListNode *)(membase + nodeidx*mStride);
868 int nodecount = node->count & 0xffff;
869 llassert((node->count>>20) == 0xabc);
870 if (nodecount >= count)
871 {
872 remove_node(nodeidx, pidx, membase, mStride, &mFreeListGeomHead[i]);
873#if 1
874 if (nodecount > count)
875 {
876 int leftover = nodecount - count;
877 freeListAddGeom(nodeidx + count, leftover);
878 }
879#endif
880 return nodeidx;
881 }
882 pidx = nodeidx;
883 nodeidx = node->next;
884 }
885 }
886#endif // USE_FREE_LIST
887 return -1;
888} 401}
889 402
890S32 LLDrawPool::freeListFindInd(U32 count) 403BOOL LLFacePool::LLOverrideFaceColor::sOverrideFaceColor = FALSE;
404
405void LLFacePool::LLOverrideFaceColor::setColor(const LLColor4& color)
891{ 406{
892#if USE_FREE_LIST 407 if (mPool->getVertexShaderLevel() > 0 && mPool->getMaterialAttribIndex() > 0)
893 int i, nodeidx, pidx;
894 int firstbucket = freeListBucket(count);
895 U32 *membase = (U32 *)mIndices.getMem();
896 for (i=firstbucket; i<NUM_BUCKETS; i++)
897 { 408 {
898 pidx = -1; 409 glVertexAttrib4fvARB(mPool->getMaterialAttribIndex(), color.mV);
899 nodeidx = mFreeListIndHead[i];
900 CHECK_LIST(((U8 *)mIndices.getMem(), 4, mFreeListIndHead[i], mIndices.count()));
901 while(nodeidx >= 0)
902 {
903 FreeListNode *node = (FreeListNode *)(membase + nodeidx);
904 int nodecount = node->count & 0xffff;
905 llassert((node->count>>20) == 0xabc);
906 if (nodecount >= count)
907 {
908 remove_node(nodeidx, pidx, (U8*)membase, 4, &mFreeListIndHead[i]);
909#if 1
910 if (nodecount > count)
911 {
912 int leftover = nodecount - count;
913 freeListAddInd(nodeidx + count, leftover);
914 }
915#endif
916 return nodeidx;
917 }
918 pidx = nodeidx;
919 nodeidx = node->next;
920 }
921 } 410 }
922#endif // USE_FREE_LIST 411 else
923 return -1;
924}
925
926//////////////////////////////////////////////////////////////////////////////
927
928S32 LLDrawPool::reserveGeom(const U32 geom_count)
929{
930 LLFastTimer t(LLFastTimer::FTM_GEO_RESERVE);
931
932 S32 index;
933 index = freeListFindGeom(geom_count);
934 if (index < 0)
935 { 412 {
936 index = mMemory.count() / mStride; 413 glColor4fv(color.mV);
937 if (!geom_count)
938 {
939 llwarns << "Attempting to reserve zero bytes!" << llendl;
940 return index;
941 }
942
943 S32 bytes = geom_count * mStride;
944
945 if ((index + (S32)geom_count) > (S32)mMaxVertices)
946 {
947 //
948 // Various drivers have issues with the number of indices being greater than a certain number.
949 // if you're using AGP. Disable AGP if we've got more vertices than in the pool.
950 //
951#ifdef DEBUG_AGP
952 llinfos << "setUseAGP false because of large vertex count in reserveGeom" << llendl;
953#endif
954 setUseAGP(FALSE);
955 }
956
957 mMemory.reserve_block(bytes);
958 if (mDataMaskNIL & DATA_VERTEX_WEIGHTS_MASK)
959 {
960 mWeights.reserve_block(geom_count);
961 }
962 if (mDataMaskNIL & DATA_CLOTHING_WEIGHTS_MASK)
963 {
964 mClothingWeights.reserve_block(geom_count);
965 }
966 } 414 }
967 CHECK_LIST(((U8 *)mMemory.getMem(), mStride, mFreeListGeomHead[0], mMemory.count() / mStride));
968 return index;
969} 415}
970 416
971S32 LLDrawPool::reserveInd(U32 indCount) 417void LLFacePool::LLOverrideFaceColor::setColor(const LLColor4U& color)
972{ 418{
973 S32 index; 419 if (mPool->getVertexShaderLevel() > 0 && mPool->getMaterialAttribIndex() > 0)
974 index = freeListFindInd(indCount);
975 if (index < 0)
976 { 420 {
977 index = mIndices.count(); 421 glVertexAttrib4ubvARB(mPool->getMaterialAttribIndex(), color.mV);
978
979 if (indCount)
980 {
981 mIndices.reserve_block(indCount);
982 }
983 } 422 }
984 for (U32 i=0;i<indCount;i++) 423 else
985 { 424 {
986 mIndices[index+i]=0; 425 glColor4ubv(color.mV);
987 } 426 }
988 CHECK_LIST(((U8 *)mIndices.getMem(), 4, mFreeListIndHead[0], mIndices.count()));
989 return index;
990} 427}
991 428
992S32 LLDrawPool::unReserveGeom(const S32 index, const U32 count) 429void LLFacePool::LLOverrideFaceColor::setColor(F32 r, F32 g, F32 b, F32 a)
993{ 430{
994 if (index < 0 || count == 0) 431 if (mPool->getVertexShaderLevel() > 0 && mPool->getMaterialAttribIndex() > 0)
995 return -1;
996
997 freeListAddGeom(index, count);
998
999#if 0
1000 int i;
1001 S32 bytes,words;
1002 U32 *memp;
1003 // Fill mem with bad data (for testing only)
1004 bytes = count * mStride;
1005 bytes -= sizeof(FreeListNode);
1006 memp = (U32*)(mMemory.getMem() + index * mStride);
1007 memp += sizeof(FreeListNode)>>2;
1008 words = bytes >> 2;
1009 for (i=0; i<words; i++)
1010 *memp++ = 0xffffffff;
1011
1012 words = count; // (sizeof each array is a word)
1013 if (mDataMaskNIL & DATA_VERTEX_WEIGHTS_MASK)
1014 { 432 {
1015 memp = (U32*)(&mWeights[index]); 433 glVertexAttrib4fARB(mPool->getMaterialAttribIndex(), r,g,b,a);
1016 for (i=0; i<words; i++)
1017 *memp++ = 0xffffffff;
1018 } 434 }
1019 if (mDataMaskNIL & DATA_CLOTHING_WEIGHTS_MASK) 435 else
1020 { 436 {
1021 memp = (U32*)(&mClothingWeights[index]); 437 glColor4f(r,g,b,a);
1022 for (i=0; i<count; i++)
1023 *memp++ = 0xffffffff;
1024 } 438 }
1025#endif
1026 return -1;
1027} 439}
1028 440
1029S32 LLDrawPool::unReserveInd(const S32 index, const U32 count)
1030{
1031 if (index < 0 || count == 0)
1032 return -1;
1033 441
1034 freeListAddInd(index, count); 442//=============================
1035 443// Render Pass Implementation
1036#if 0 444//=============================
1037 int i; 445LLRenderPass::LLRenderPass(const U32 type)
1038 U32 *memp = &mIndices[index]; 446: LLDrawPool(type)
1039 for (i=0; i<count; i++)
1040 *memp++ = 0xffffffff;
1041#endif
1042 return -1;
1043}
1044
1045//////////////////////////////////////////////////////////////////////////////
1046
1047const U32 LLDrawPool::getIndexCount() const
1048{ 447{
1049 return mIndices.count();
1050}
1051 448
1052const U32 LLDrawPool::getVertexCount() const
1053{
1054 return mMemory.count() / mStride;
1055} 449}
1056 450
1057const U32 LLDrawPool::getTexCoordCount(U32 pass) const 451LLRenderPass::~LLRenderPass()
1058{ 452{
1059 return mMemory.count() / mStride;
1060}
1061 453
1062
1063const U32 LLDrawPool::getNormalCount() const
1064{
1065 return mMemory.count() / mStride;
1066} 454}
1067 455
1068 456LLDrawPool* LLRenderPass::instancePool()
1069const U32 LLDrawPool::getBinormalCount() const
1070{ 457{
1071 return mMemory.count() / mStride; 458#if LL_RELEASE_FOR_DOWNLOAD
1072} 459 llwarns << "Attempting to instance a render pass. Invalid operation." << llendl;
1073 460#else
1074const U32 LLDrawPool::getColorCount() const 461 llerrs << "Attempting to instance a render pass. Invalid operation." << llendl;
1075{ 462#endif
1076 return mMemory.count() / mStride; 463 return NULL;
1077}
1078
1079const U32 LLDrawPool::getVertexWeightCount() const
1080{
1081 return mWeights.count();
1082} 464}
1083 465
1084// virtual 466void LLRenderPass::renderGroup(LLSpatialGroup* group, U32 type, U32 mask, BOOL texture)
1085BOOL LLDrawPool::addFace(LLFace *facep) 467{
1086{ 468 std::vector<LLDrawInfo*>& draw_info = group->mDrawMap[type];
1087 addFaceReference(facep); 469
1088 return TRUE; 470 for (std::vector<LLDrawInfo*>::const_iterator k = draw_info.begin(); k != draw_info.end(); ++k)
471 {
472 LLDrawInfo& params = **k;
473 pushBatch(params, mask, texture);
474 }
1089} 475}
1090 476
1091// virtual 477void LLRenderPass::renderInvisible(U32 mask)
1092BOOL LLDrawPool::removeFace(LLFace *facep)
1093{ 478{
1094 removeFaceReference(facep); 479#if !LL_RELEASE_FOR_DOWNLOAD
1095 480 LLGLState::checkClientArrays(mask);
1096 vector_replace_with_last(mDrawFace, facep); 481#endif
1097
1098 facep->unReserve();
1099 482
1100 return TRUE; 483 std::vector<LLDrawInfo*>& draw_info = gPipeline.mRenderMap[LLRenderPass::PASS_INVISIBLE];
1101}
1102 484
1103// Not absolutely sure if we should be resetting all of the chained pools as well - djs 485 U32* indices_pointer = NULL;
1104void LLDrawPool::resetDrawOrders() 486 for (std::vector<LLDrawInfo*>::iterator i = draw_info.begin(); i != draw_info.end(); ++i)
1105{ 487 {
1106 mDrawFace.resize(0); 488 LLDrawInfo& params = **i;
489 params.mVertexBuffer->setBuffer(mask);
490 indices_pointer = (U32*) params.mVertexBuffer->getIndicesPointer();
491 glDrawRangeElements(GL_TRIANGLES, params.mStart, params.mEnd, params.mCount,
492 GL_UNSIGNED_INT, indices_pointer+params.mOffset);
493 gPipeline.mTrianglesDrawn += params.mCount/3;
494 }
1107} 495}
1108 496
1109void LLDrawPool::resetIndices(S32 indices_count) 497void LLRenderPass::renderTexture(U32 type, U32 mask)
1110{ 498{
1111 mIndices.reset(indices_count); 499#if !LL_RELEASE_FOR_DOWNLOAD
1112 for (S32 i=0; i<NUM_BUCKETS; i++) 500 LLGLState::checkClientArrays(mask);
1113 mFreeListIndHead[i] = -1; 501#endif
1114}
1115 502
1116void LLDrawPool::resetVertexData(S32 reserve_count) 503 std::vector<LLDrawInfo*>& draw_info = gPipeline.mRenderMap[type];
1117{
1118 mMemory.reset(reserve_count*mStride);
1119
1120 for (S32 i=0; i<NUM_BUCKETS; i++)
1121 {
1122 mFreeListGeomHead[i] = -1;
1123 }
1124 if (mDataMaskNIL & DATA_VERTEX_WEIGHTS_MASK)
1125 {
1126 mWeights.reset(reserve_count);
1127 }
1128 504
1129 if (mDataMaskNIL & DATA_CLOTHING_WEIGHTS_MASK) 505 for (std::vector<LLDrawInfo*>::iterator i = draw_info.begin(); i != draw_info.end(); ++i)
1130 { 506 {
1131 mClothingWeights.reset(reserve_count); 507 LLDrawInfo& params = **i;
508 pushBatch(params, mask, TRUE);
1132 } 509 }
1133} 510}
1134 511
1135void LLDrawPool::resetAll() 512void LLRenderPass::pushBatch(LLDrawInfo& params, U32 mask, BOOL texture)
1136{
1137 resetDrawOrders();
1138 resetVertexData(0);
1139 mGeneration++;
1140
1141}
1142
1143S32 LLDrawPool::rebuild()
1144{ 513{
1145 mRebuildTime++; 514 if (params.mVertexBuffer.isNull())
1146
1147 BOOL needs_rebuild = FALSE;
1148 S32 rebuild_cost = 0;
1149
1150 if (mUseAGP)
1151 {
1152 if (getVertexCount() > 0.75f*DEFAULT_MAX_VERTICES)
1153 {
1154 if (mRebuildTime > 8)
1155 {
1156 needs_rebuild = TRUE;
1157 }
1158#ifdef DEBUG_AGP
1159 llwarns << "More than " << DEFAULT_MAX_VERTICES << " in pool type " << (S32)mType << " at rebuild!" << llendl;
1160#endif
1161 }
1162 }
1163
1164 // rebuild de-allocates 'stale' objects, so we still need to do a rebuild periodically
1165 if (mRebuildFreq > 0 && mRebuildTime >= mRebuildFreq)
1166 { 515 {
1167 needs_rebuild = TRUE; 516 return;
1168 } 517 }
1169 518
1170 if (needs_rebuild) 519 if (texture)
1171 { 520 {
1172 mGeneration++; 521 if (params.mTexture.notNull())
1173
1174 if (mReferences.empty())
1175 { 522 {
1176 resetIndices(0); 523 params.mTexture->bind();
1177 resetVertexData(0); 524 if (params.mTextureMatrix)
1178 }
1179 else
1180 {
1181 for (std::vector<LLFace*>::iterator iter = mReferences.begin();
1182 iter != mReferences.end(); iter++)
1183 {
1184 LLFace *facep = *iter;
1185 if (facep->hasGeometry() && !facep->isState(LLFace::BACKLIST | LLFace::SHARED_GEOM))
1186 {
1187 facep->backup();
1188 }
1189 }
1190 S32 tot_verts = 0;
1191 S32 tot_indices = 0;
1192 for (std::vector<LLFace*>::iterator iter = mDrawFace.begin();
1193 iter != mDrawFace.end(); iter++)
1194 {
1195 LLFace *facep = *iter;
1196 if (facep->isState(LLFace::BACKLIST))
1197 {
1198 tot_verts += facep->getGeomCount();
1199 tot_indices += facep->getIndicesCount();
1200 }
1201 }
1202 for (std::vector<LLFace*>::iterator iter = mMoveFace.begin();
1203 iter != mMoveFace.end(); iter++)
1204 { 525 {
1205 LLFace *facep = *iter; 526 glMatrixMode(GL_TEXTURE);
1206 if (facep->isState(LLFace::BACKLIST)) 527 glLoadMatrixf((GLfloat*) params.mTextureMatrix->mMatrix);
1207 {
1208 tot_verts += facep->getGeomCount();
1209 tot_indices += facep->getIndicesCount();
1210 }
1211 }
1212
1213 resetIndices(tot_indices);
1214 flushAGP();
1215 resetVertexData(tot_verts);
1216
1217 for (std::vector<LLFace*>::iterator iter = mDrawFace.begin();
1218 iter != mDrawFace.end(); iter++)
1219 {
1220 LLFace *facep = *iter;
1221 llassert(facep->getPool() == this);
1222 facep->restore();
1223 } 528 }
529 params.mTexture->addTextureStats(params.mVSize);
1224 } 530 }
1225 mRebuildTime = 0; 531 else
1226 setDirty();
1227 }
1228
1229 if (!mMoveFace.empty())
1230 {
1231 for (std::vector<LLFace*>::iterator iter = mMoveFace.begin();
1232 iter != mMoveFace.end(); iter++)
1233 {
1234 LLFace *facep = *iter;
1235 facep->restore();
1236 enqueue(facep);
1237 }
1238 setDirty();
1239 mMoveFace.reset();
1240 rebuild_cost++;
1241 }
1242 return rebuild_cost;
1243}
1244
1245LLViewerImage *LLDrawPool::getTexture()
1246{
1247 return NULL;
1248}
1249
1250LLViewerImage *LLDrawPool::getDebugTexture()
1251{
1252 return NULL;
1253}
1254
1255void LLDrawPool::removeFaceReference(LLFace *facep)
1256{
1257 if (facep->getReferenceIndex() != -1)
1258 {
1259 if (facep->getReferenceIndex() != (S32)mReferences.size())
1260 { 532 {
1261 LLFace *back = mReferences.back(); 533 LLImageGL::unbindTexture(0);
1262 mReferences[facep->getReferenceIndex()] = back;
1263 back->setReferenceIndex(facep->getReferenceIndex());
1264 } 534 }
1265 mReferences.pop_back();
1266 } 535 }
1267 facep->setReferenceIndex(-1); 536
1268} 537 params.mVertexBuffer->setBuffer(mask);
538 U32* indices_pointer = (U32*) params.mVertexBuffer->getIndicesPointer();
539 glDrawRangeElements(GL_TRIANGLES, params.mStart, params.mEnd, params.mCount,
540 GL_UNSIGNED_INT, indices_pointer+params.mOffset);
541 gPipeline.mTrianglesDrawn += params.mCount/3;
1269 542
1270void LLDrawPool::addFaceReference(LLFace *facep) 543 if (params.mTextureMatrix && texture && params.mTexture.notNull())
1271{
1272 if (-1 == facep->getReferenceIndex())
1273 { 544 {
1274 facep->setReferenceIndex(mReferences.size()); 545 glLoadIdentity();
1275 mReferences.push_back(facep); 546 glMatrixMode(GL_MODELVIEW);
1276 } 547 }
1277} 548}
1278 549
1279U32 LLDrawPool::getTrianglesDrawn() const 550void LLRenderPass::renderActive(U32 type, U32 mask, BOOL texture)
1280{ 551{
1281 return mIndicesDrawn / 3; 552#if !LL_RELEASE_FOR_DOWNLOAD
1282} 553 LLGLState::checkClientArrays(mask);
1283 554#endif
1284void LLDrawPool::resetTrianglesDrawn()
1285{
1286 mIndicesDrawn = 0;
1287}
1288
1289void LLDrawPool::addIndicesDrawn(const U32 indices)
1290{
1291 mIndicesDrawn += indices;
1292}
1293 555
1294BOOL LLDrawPool::verify() const 556 LLSpatialBridge* last_bridge = NULL;
1295{ 557 glPushMatrix();
1296 BOOL ok = TRUE; 558
1297 // Verify all indices in the pool are in the right range 559 for (LLSpatialGroup::sg_vector_t::iterator i = gPipeline.mActiveGroups.begin(); i != gPipeline.mActiveGroups.end(); ++i)
1298 const U32 *indicesp = getRawIndices();
1299 for (U32 i = 0; i < getIndexCount(); i++)
1300 { 560 {
1301 if (indicesp[i] > getVertexCount()) 561 LLSpatialGroup* group = *i;
562 if (!group->isDead() &&
563 gPipeline.hasRenderType(group->mSpatialPartition->mDrawableType) &&
564 group->mDrawMap.find(type) != group->mDrawMap.end())
1302 { 565 {
1303 ok = FALSE; 566 LLSpatialBridge* bridge = (LLSpatialBridge*) group->mSpatialPartition;
1304 llinfos << "Bad index in tree pool!" << llendl; 567 if (bridge != last_bridge)
1305 } 568 {
1306 } 569 glPopMatrix();
570 glPushMatrix();
571 glMultMatrixf((F32*) bridge->mDrawable->getRenderMatrix().mMatrix);
572 last_bridge = bridge;
573 }
1307 574
1308 for (std::vector<LLFace*>::const_iterator iter = mDrawFace.begin(); 575 renderGroup(group,type,mask,texture);
1309 iter != mDrawFace.end(); iter++)
1310 {
1311 const LLFace* facep = *iter;
1312 if (facep->getPool() != this)
1313 {
1314 llinfos << "Face in wrong pool!" << llendl;
1315 facep->printDebugInfo();
1316 ok = FALSE;
1317 }
1318 else if (!facep->verify())
1319 {
1320 ok = FALSE;
1321 } 576 }
1322 } 577 }
1323 578
1324 return ok; 579 glPopMatrix();
1325}
1326
1327void LLDrawPool::printDebugInfo() const
1328{
1329 llinfos << "Pool " << this << " Type: " << getType() << llendl;
1330 llinfos << "--------------------" << llendl;
1331 llinfos << "Vertex count: " << getVertexCount() << llendl;
1332 llinfos << "Normal count: " << getNormalCount() << llendl;
1333 llinfos << "Indices count: " << getIndexCount() << llendl;
1334 llinfos << llendl;
1335}
1336
1337
1338S32 LLDrawPool::getMemUsage(const BOOL print)
1339{
1340 S32 mem_usage = 0;
1341
1342 mem_usage += sizeof(this);
1343
1344 // Usage beyond the pipeline allocated data (color and mMemory)
1345 mem_usage += mIndices.getMax() * sizeof(U32);
1346 mem_usage += mDrawFace.capacity() * sizeof(LLFace *);
1347 mem_usage += mMoveFace.capacity() * sizeof(LLFace *);
1348 mem_usage += mReferences.capacity() * sizeof(LLFace *);
1349
1350 mem_usage += mMemory.getSysMemUsage();
1351 mem_usage += mWeights.getSysMemUsage();
1352 mem_usage += mClothingWeights.getSysMemUsage();
1353
1354 return mem_usage;
1355}
1356
1357LLColor3 LLDrawPool::getDebugColor() const
1358{
1359 return LLColor3(0.f, 0.f, 0.f);
1360}
1361
1362void LLDrawPool::setDirty()
1363{
1364 mMemory.setDirty();
1365 mWeights.setDirty();
1366 mClothingWeights.setDirty();
1367}
1368
1369BOOL LLDrawPool::LLOverrideFaceColor::sOverrideFaceColor = FALSE;
1370
1371void LLDrawPool::LLOverrideFaceColor::setColor(const LLColor4& color)
1372{
1373 if (mPool->mVertexShaderLevel > 0 && mPool->getMaterialAttribIndex() > 0)
1374 {
1375 glVertexAttrib4fvARB(mPool->getMaterialAttribIndex(), color.mV);
1376 }
1377 else
1378 {
1379 glColor4fv(color.mV);
1380 }
1381} 580}
1382 581
1383void LLDrawPool::LLOverrideFaceColor::setColor(const LLColor4U& color) 582void LLRenderPass::renderStatic(U32 type, U32 mask, BOOL texture)
1384{ 583{
1385 if (mPool->mVertexShaderLevel > 0 && mPool->getMaterialAttribIndex() > 0) 584#if !LL_RELEASE_FOR_DOWNLOAD
1386 { 585 LLGLState::checkClientArrays(mask);
1387 glVertexAttrib4ubvARB(mPool->getMaterialAttribIndex(), color.mV); 586#endif
1388 }
1389 else
1390 {
1391 glColor4ubv(color.mV);
1392 }
1393}
1394 587
1395void LLDrawPool::LLOverrideFaceColor::setColor(F32 r, F32 g, F32 b, F32 a) 588 for (LLSpatialGroup::sg_vector_t::iterator i = gPipeline.mVisibleGroups.begin(); i != gPipeline.mVisibleGroups.end(); ++i)
1396{
1397 if (mPool->mVertexShaderLevel > 0 && mPool->getMaterialAttribIndex() > 0)
1398 {
1399 glVertexAttrib4fARB(mPool->getMaterialAttribIndex(), r,g,b,a);
1400 }
1401 else
1402 { 589 {
1403 glColor4f(r,g,b,a); 590 LLSpatialGroup* group = *i;
591 if (!group->isDead() &&
592 gPipeline.hasRenderType(group->mSpatialPartition->mDrawableType) &&
593 group->mDrawMap.find(type) != group->mDrawMap.end())
594 {
595 renderGroup(group,type,mask,texture);
596 }
1404 } 597 }
1405} 598}
1406
1407// virtual
1408void LLDrawPool::enableShade()
1409{ }
1410
1411// virtual
1412void LLDrawPool::disableShade()
1413{ }
1414
1415// virtual
1416void LLDrawPool::setShade(F32 shade)
1417{ }
diff --git a/linden/indra/newview/lldrawpool.h b/linden/indra/newview/lldrawpool.h
index 2ce13fb..6cd5f8e 100644
--- a/linden/indra/newview/lldrawpool.h
+++ b/linden/indra/newview/lldrawpool.h
@@ -28,270 +28,168 @@
28#ifndef LL_LLDRAWPOOL_H 28#ifndef LL_LLDRAWPOOL_H
29#define LL_LLDRAWPOOL_H 29#define LL_LLDRAWPOOL_H
30 30
31#include "llagparray.h"
32#include "lldarray.h"
33#include "lldlinked.h"
34#include "llstrider.h"
35#include "llviewerimage.h"
36#include "v4coloru.h" 31#include "v4coloru.h"
37#include "v2math.h" 32#include "v2math.h"
38#include "v3math.h" 33#include "v3math.h"
39#include "llstrider.h" 34#include "llvertexbuffer.h"
40 35
41class LLFace; 36class LLFace;
42class LLImageGL; 37class LLImageGL;
43class LLViewerImage; 38class LLViewerImage;
39class LLSpatialGroup;
40class LLDrawInfo;
44 41
45#define DEFAULT_MAX_VERTICES 65535 42#define DEFAULT_MAX_VERTICES 65535
46 43
47class LLDrawPool 44class LLDrawPool
48{ 45{
49public: 46public:
50 typedef LLDynamicArray<LLFace*, 128> face_array_t; 47 static S32 sNumDrawPools;
51 48
52 enum 49 enum
53 { 50 {
54 SHADER_LEVEL_SCATTERING = 2 51 // Correspond to LLPipeline render type
52 POOL_SKY = 1,
53 POOL_STARS,
54 POOL_GROUND,
55 POOL_TERRAIN,
56 POOL_SIMPLE,
57 POOL_BUMP,
58 POOL_AVATAR,
59 POOL_TREE,
60 POOL_ALPHA,
61 POOL_WATER,
62 POOL_ALPHA_POST_WATER,
63 NUM_POOL_TYPES,
55 }; 64 };
56 65
57public: 66 LLDrawPool(const U32 type);
58 LLDrawPool(const U32 type, const U32 data_mask_il, const U32 data_mask_nil);
59 virtual ~LLDrawPool(); 67 virtual ~LLDrawPool();
60 68
61 static LLDrawPool* createPool(const U32 type, LLViewerImage *tex0 = NULL); 69 virtual BOOL isDead() = 0;
62 70
63 void flushAGP(); // Flush the AGP buffers so they can be repacked and reallocated. 71 S32 getId() const { return mId; }
64 void syncAGP(); 72 U32 getType() const { return mType; }
65 73
66 virtual LLDrawPool *instancePool() = 0; // Create an empty new instance of the pool. 74 virtual LLViewerImage *getDebugTexture();
67 virtual void beginRenderPass( S32 pass ); 75 virtual void beginRenderPass( S32 pass );
68 virtual void endRenderPass( S32 pass ); 76 virtual void endRenderPass( S32 pass );
69 virtual S32 getNumPasses() { return 1; } 77 virtual S32 getNumPasses() { return 1; }
70 virtual void render(S32 pass = 0) = 0; 78 virtual void render(S32 pass = 0) = 0;
79 virtual void prerender() = 0;
80 virtual S32 getMaterialAttribIndex() = 0;
81 virtual U32 getVertexDataMask() = 0;
82 virtual BOOL verify() const { return TRUE; } // Verify that all data in the draw pool is correct!
83 virtual S32 getVertexShaderLevel() const { return mVertexShaderLevel; }
84
85 static LLDrawPool* createPool(const U32 type, LLViewerImage *tex0 = NULL);
86 virtual LLDrawPool *instancePool() = 0; // Create an empty new instance of the pool.
87 virtual LLViewerImage* getTexture() = 0;
88 virtual BOOL isFacePool() { return FALSE; }
89 virtual void resetDrawOrders() = 0;
90
91 U32 getTrianglesDrawn() const;
92 void resetTrianglesDrawn();
93 void addIndicesDrawn(const U32 indices);
94
95protected:
96 S32 mVertexShaderLevel;
97 S32 mId;
98 U32 mType; // Type of draw pool
99 S32 mIndicesDrawn;
100};
101
102class LLRenderPass : public LLDrawPool
103{
104public:
105 enum
106 {
107 PASS_SIMPLE = NUM_POOL_TYPES,
108 PASS_FULLBRIGHT,
109 PASS_GLOW,
110 PASS_INVISIBLE,
111 PASS_SHINY,
112 PASS_BUMP,
113 PASS_GRASS,
114 PASS_ALPHA,
115 NUM_RENDER_TYPES,
116 };
117
118 LLRenderPass(const U32 type);
119 virtual ~LLRenderPass();
120 /*virtual*/ LLDrawPool* instancePool();
121 /*vritual*/ S32 getMaterialAttribIndex() { return -1; }
122 /*virtual*/ LLViewerImage* getDebugTexture() { return NULL; }
123 LLViewerImage* getTexture() { return NULL; }
124 BOOL isDead() { return FALSE; }
125 void resetDrawOrders() { }
126
127 virtual void pushBatch(LLDrawInfo& params, U32 mask, BOOL texture);
128 virtual void renderGroup(LLSpatialGroup* group, U32 type, U32 mask, BOOL texture = TRUE);
129 virtual void renderStatic(U32 type, U32 mask, BOOL texture = TRUE);
130 virtual void renderActive(U32 type, U32 mask, BOOL texture = TRUE);
131 virtual void renderInvisible(U32 mask);
132 virtual void renderTexture(U32 type, U32 mask);
133
134};
135
136class LLFacePool : public LLDrawPool
137{
138public:
139 typedef std::vector<LLFace*> face_array_t;
140
141 enum
142 {
143 SHADER_LEVEL_SCATTERING = 2
144 };
145
146public:
147 LLFacePool(const U32 type);
148 virtual ~LLFacePool();
149
71 virtual void renderForSelect() = 0; 150 virtual void renderForSelect() = 0;
72 virtual BOOL match(LLFace* last_face, LLFace* facep) { return FALSE; } 151 BOOL isDead() { return mReferences.empty(); }
73 virtual void renderFaceSelected(LLFace *facep, LLImageGL *image, const LLColor4 &color, 152 virtual void renderFaceSelected(LLFace *facep, LLImageGL *image, const LLColor4 &color,
74 const S32 index_offset = 0, const S32 index_count = 0); 153 const S32 index_offset = 0, const S32 index_count = 0);
75 154
76 virtual void prerender() = 0;
77 virtual S32 rebuild();
78
79 virtual S32 getMaterialAttribIndex() = 0;
80
81 virtual LLViewerImage *getTexture(); 155 virtual LLViewerImage *getTexture();
82 virtual LLViewerImage *getDebugTexture(); 156 virtual void dirtyTextures(const std::set<LLViewerImage*>& textures);
83 virtual void dirtyTexture(const LLViewerImage* texturep);
84 157
85 virtual void enqueue(LLFace *face); 158 virtual void enqueue(LLFace *face);
86 virtual BOOL addFace(LLFace *face); 159 virtual BOOL addFace(LLFace *face);
87 virtual BOOL removeFace(LLFace *face); 160 virtual BOOL removeFace(LLFace *face);
88 161
89 virtual BOOL verify() const; // Verify that all data in the draw pool is correct! 162 virtual BOOL verify() const; // Verify that all data in the draw pool is correct!
90 virtual LLColor3 getDebugColor() const; // For AGP debug display 163
91
92 virtual void resetDrawOrders(); 164 virtual void resetDrawOrders();
93 virtual void resetVertexData(S32 reserve_count);
94 virtual void resetIndices(S32 num_indices);
95 void resetAll(); 165 void resetAll();
96 166
97 BOOL moveFace(LLFace *face, LLDrawPool *poolp, BOOL copy_data = FALSE); 167 BOOL moveFace(LLFace *face, LLDrawPool *poolp, BOOL copy_data = FALSE);
98 168
99
100 S32 getId() const { return mId; }
101 U32 getType() const { return mType; }
102
103 const U32 getStride() const;
104 inline const U32 getStride(const U32 data_type) const;
105 inline const U32 getOffset(const U32 data_type) const;
106
107 S32 reserveGeom(U32 count);
108 S32 reserveInd (U32 count);
109 S32 unReserveGeom(const S32 index, const U32 count);
110 S32 unReserveInd(const S32 index, const U32 count);
111
112 void bindGLVertexPointer();
113 void bindGLTexCoordPointer(const U32 pass=0);
114 void bindGLNormalPointer();
115 void bindGLBinormalPointer(S32 index);
116 void bindGLColorPointer();
117 void bindGLVertexWeightPointer(S32 index);
118 void bindGLVertexClothingWeightPointer(S32 index);
119
120 const U32 getIndexCount() const;
121 const U32 getTexCoordCount(const U32 pass=0) const;
122 const U32 getVertexCount() const;
123 const U32 getNormalCount() const;
124 const U32 getBinormalCount() const;
125 const U32 getColorCount() const;
126 const U32 getVertexWeightCount() const;
127
128 void setDirty();
129 void setDirtyMemory() { mMemory.setDirty(); }
130 void setDirtyWeights() { mWeights.setDirty(); }
131
132 const U32* getRawIndices() const { return mIndices.getMem(); }
133
134 U32 getIndex(const S32 index) { return mIndices[index]; } // Use to get one index
135 U32 *getIndices(const S32 index); // Used to get an array of indices for reading/writing
136 void CheckIntegrity(); // DEBUG
137
138 const LLVector3& getVertex(const S32 index);
139 const LLVector2& getTexCoord(const S32 index, const U32 pass);
140 const LLVector3& getNormal(const S32 index);
141 const LLVector3& getBinormal(const S32 index);
142 const LLColor4U& getColor(const S32 index);
143 const F32& getVertexWeight(const S32 index);
144 const LLVector4& getClothingWeight(const S32 index);
145
146 void setRebuild(const BOOL rebuild);
147
148 void destroy(); 169 void destroy();
149 170
150 void buildEdges(); 171 void buildEdges();
151 172
152 static S32 drawLoop(face_array_t& face_list, const U32* index_array); 173 static S32 drawLoop(face_array_t& face_list);
153 static S32 drawLoopSetTex(face_array_t& face_list, const U32* index_array, S32 stage); 174 static S32 drawLoopSetTex(face_array_t& face_list, S32 stage);
154 void drawLoop(); 175 void drawLoop();
155 176
156 void renderVisibility(); 177 void renderVisibility();
157 178
158 void addFaceReference(LLFace *facep); 179 void addFaceReference(LLFace *facep);
159 void removeFaceReference(LLFace *facep); 180 void removeFaceReference(LLFace *facep);
160 U32 getTrianglesDrawn() const;
161 void resetTrianglesDrawn();
162 void addIndicesDrawn(const U32 indices);
163 181
164 void printDebugInfo() const; 182 void printDebugInfo() const;
165 S32 getMemUsage(const BOOL print = FALSE);
166 183
167 BOOL setUseAGP(BOOL use_agp); 184 BOOL isFacePool() { return TRUE; }
168 BOOL canUseAGP() const { return mMemory.isAGP(); } // Return TRUE if this pool can use AGP
169 185
170 S32 getMaxVertices() const { return mMaxVertices; }
171 S32 getVertexShaderLevel() const { return mVertexShaderLevel; }
172
173 friend class LLFace; 186 friend class LLFace;
174 friend class LLPipeline; 187 friend class LLPipeline;
175public: 188public:
176
177 enum
178 {
179 // Correspond to LLPipeline render type
180 POOL_SKY = 1,
181 POOL_STARS,
182 POOL_GROUND,
183 POOL_TERRAIN,
184 POOL_SIMPLE,
185 POOL_MEDIA, // unused
186 POOL_BUMP,
187 POOL_AVATAR,
188 POOL_TREE,
189 POOL_TREE_NEW,
190 POOL_WATER,
191 POOL_CLOUDS,
192 POOL_ALPHA,
193 POOL_HUD,
194 };
195
196
197 // If you change the order or add params to these, you also need to adjust the sizes in the
198 // mDataSizes array defined in lldrawpool.cpp
199 typedef enum e_data_type
200 {
201 DATA_VERTICES = 0,
202 DATA_TEX_COORDS0 = 1,
203 DATA_TEX_COORDS1 = 2,
204 DATA_TEX_COORDS2 = 3,
205 DATA_TEX_COORDS3 = 4,
206 DATA_NORMALS = 5,
207 DATA_VERTEX_WEIGHTS = 6,
208 DATA_CLOTHING_WEIGHTS = 7,
209 DATA_BINORMALS = 8,
210 DATA_COLORS = 9,
211 DATA_MAX_TYPES = 10
212 } EDataType;
213
214 typedef enum e_data_mask
215 {
216 DATA_VERTICES_MASK = 1 << DATA_VERTICES,
217 DATA_TEX_COORDS0_MASK = 1 << DATA_TEX_COORDS0,
218 DATA_TEX_COORDS1_MASK = 1 << DATA_TEX_COORDS1,
219 DATA_TEX_COORDS2_MASK = 1 << DATA_TEX_COORDS2,
220 DATA_TEX_COORDS3_MASK = 1 << DATA_TEX_COORDS3,
221 DATA_NORMALS_MASK = 1 << DATA_NORMALS,
222 DATA_VERTEX_WEIGHTS_MASK = 1 << DATA_VERTEX_WEIGHTS,
223 DATA_CLOTHING_WEIGHTS_MASK = 1 << DATA_CLOTHING_WEIGHTS,
224 DATA_BINORMALS_MASK = 1 << DATA_BINORMALS,
225 DATA_COLORS_MASK = 1 << DATA_COLORS,
226
227 // Masks for standard types.
228 // IL for interleaved, NIL for non-interleaved.
229 DATA_SIMPLE_IL_MASK = DATA_VERTICES_MASK | DATA_TEX_COORDS0_MASK | DATA_NORMALS_MASK,
230 DATA_SIMPLE_NIL_MASK = 0,
231 DATA_BUMP_IL_MASK = DATA_SIMPLE_IL_MASK | DATA_BINORMALS_MASK | DATA_TEX_COORDS1_MASK,
232 } EDataMask;
233
234 face_array_t mDrawFace; 189 face_array_t mDrawFace;
235 face_array_t mMoveFace; 190 face_array_t mMoveFace;
236 face_array_t mReferences; 191 face_array_t mReferences;
237 192
238 U32 mDataMaskIL; // Interleaved data
239 U32 mDataMaskNIL; // Non-interleaved data
240 U32 mDataOffsets[DATA_MAX_TYPES];
241 S32 mStride;
242
243 S32 mRebuildFreq;
244 S32 mRebuildTime;
245 S32 mGeneration;
246
247
248 S32 mSkippedVertices;
249
250 static U32 sDataSizes[DATA_MAX_TYPES];
251 static S32 sNumDrawPools;
252
253protected:
254 LLAGPArray<U8> mMemory;
255 LLAGPArray<F32> mWeights;
256 LLAGPArray<LLVector4> mClothingWeights;
257 LLAGPArray<U32> mIndices;
258
259public:
260
261 BOOL getVertexStrider (LLStrider<LLVector3> &vertices, const U32 index = 0);
262 BOOL getTexCoordStrider (LLStrider<LLVector2> &tex_coords, const U32 index = 0, const U32 pass=0);
263 BOOL getNormalStrider (LLStrider<LLVector3> &normals, const U32 index = 0);
264 BOOL getBinormalStrider (LLStrider<LLVector3> &binormals, const U32 index = 0);
265 BOOL getColorStrider (LLStrider<LLColor4U> &colors, const U32 index = 0);
266 BOOL getVertexWeightStrider(LLStrider<F32> &vertex_weights, const U32 index = 0);
267 BOOL getClothingWeightStrider(LLStrider<LLVector4> &clothing_weights, const U32 index = 0);
268
269public:
270 enum { NUM_BUCKETS = 8 }; // Need to change freeListBucket() if NUM_BUCKETS changes
271 struct FreeListNode
272 {
273 U32 count;
274 S32 next;
275 };
276protected:
277 int freeListBucket(U32 count);
278 void freeListAddGeom(S32 index, U32 count);
279 void freeListAddInd(S32 index, U32 count);
280 S32 freeListFindGeom(U32 count);
281 S32 freeListFindInd(U32 count);
282
283protected:
284 BOOL mUseAGP;
285 S32 mVertexShaderLevel;
286 S32 mId;
287 U32 mType; // Type of draw pool
288 S32 mMaxVertices;
289 S32 mIndicesDrawn;
290 BOOL mCleanupUnused; // Cleanup unused data when too full
291
292 S32 mFreeListGeomHead[8];
293 S32 mFreeListIndHead[8];
294
295public: 193public:
296 class LLOverrideFaceColor 194 class LLOverrideFaceColor
297 { 195 {
@@ -330,38 +228,6 @@ public:
330 LLDrawPool* mPool; 228 LLDrawPool* mPool;
331 static BOOL sOverrideFaceColor; 229 static BOOL sOverrideFaceColor;
332 }; 230 };
333
334 virtual void enableShade();
335 virtual void disableShade();
336 virtual void setShade(F32 shade);
337
338}; 231};
339 232
340inline const U32 LLDrawPool::getStride() const
341{
342 return mStride;
343}
344
345inline const U32 LLDrawPool::getOffset(const U32 data_type) const
346{
347 return mDataOffsets[data_type];
348}
349
350inline const U32 LLDrawPool::getStride(const U32 data_type) const
351{
352 if (mDataMaskIL & (1 << data_type))
353 {
354 return mStride;
355 }
356 else if (mDataMaskNIL & (1 << data_type))
357 {
358 return 0;
359 }
360 else
361 {
362 llerrs << "Getting stride for unsupported data type " << data_type << llendl;
363 return 0;
364 }
365}
366
367#endif //LL_LLDRAWPOOL_H 233#endif //LL_LLDRAWPOOL_H
diff --git a/linden/indra/newview/lldrawpoolalpha.cpp b/linden/indra/newview/lldrawpoolalpha.cpp
index c62db17..b50be95 100644
--- a/linden/indra/newview/lldrawpoolalpha.cpp
+++ b/linden/indra/newview/lldrawpoolalpha.cpp
@@ -29,11 +29,11 @@
29 29
30#include "lldrawpoolalpha.h" 30#include "lldrawpoolalpha.h"
31 31
32#include "llglheaders.h"
32#include "llviewercontrol.h" 33#include "llviewercontrol.h"
33#include "llcriticaldamp.h" 34#include "llcriticaldamp.h"
34#include "llfasttimer.h" 35#include "llfasttimer.h"
35 36
36#include "llagparray.h"
37#include "llcubemap.h" 37#include "llcubemap.h"
38#include "llsky.h" 38#include "llsky.h"
39#include "llagent.h" 39#include "llagent.h"
@@ -44,104 +44,25 @@
44#include "llviewerobjectlist.h" // For debugging 44#include "llviewerobjectlist.h" // For debugging
45#include "llviewerwindow.h" 45#include "llviewerwindow.h"
46#include "pipeline.h" 46#include "pipeline.h"
47 47#include "llviewerregion.h"
48const F32 MAX_DIST = 512.f;
49const F32 ALPHA_FALLOFF_START_DISTANCE = 0.8f;
50 48
51BOOL LLDrawPoolAlpha::sShowDebugAlpha = FALSE; 49BOOL LLDrawPoolAlpha::sShowDebugAlpha = FALSE;
52 50
53LLDrawPoolAlpha::LLDrawPoolAlpha() : 51LLDrawPoolAlpha::LLDrawPoolAlpha(U32 type) :
54 LLDrawPool(POOL_ALPHA, 52 LLRenderPass(type)
55 DATA_SIMPLE_IL_MASK | DATA_COLORS_MASK,
56 DATA_SIMPLE_NIL_MASK)
57{ 53{
58 mRebuiltLastFrame = FALSE;
59 mMinDistance = 0.f;
60 mMaxDistance = MAX_DIST;
61 mInvBinSize = NUM_ALPHA_BINS/(mMaxDistance - mMinDistance);
62 mCleanupUnused = TRUE;
63 //mRebuildFreq = -1 ; // Only rebuild if nearly full
64
65// for (S32 i = 0; i < NUM_ALPHA_BINS; i++)
66// {
67// mDistanceBins[i].realloc(200);
68// }
69}
70 54
71LLDrawPoolAlpha::~LLDrawPoolAlpha()
72{
73} 55}
74 56
75LLDrawPool *LLDrawPoolAlpha::instancePool() 57LLDrawPoolAlphaPostWater::LLDrawPoolAlphaPostWater()
58: LLDrawPoolAlpha(POOL_ALPHA_POST_WATER)
76{ 59{
77 llerrs << "Should never be calling instancePool on an alpha pool!" << llendl;
78 return NULL;
79} 60}
80 61
81void LLDrawPoolAlpha::enqueue(LLFace *facep) 62LLDrawPoolAlpha::~LLDrawPoolAlpha()
82{ 63{
83 if (!facep->isState(LLFace::GLOBAL))
84 {
85 facep->mCenterAgent = facep->mCenterLocal * facep->getRenderMatrix();
86 }
87 facep->mDistance = (facep->mCenterAgent - gCamera->getOrigin()) * gCamera->getAtAxis();
88
89 if (facep->isState(LLFace::BACKLIST))
90 {
91 mMoveFace.put(facep);
92 }
93 else
94 {
95 mDrawFace.put(facep);
96 }
97
98 {
99 S32 dist_bin = lltrunc( (mMaxDistance - (facep->mDistance+32))*mInvBinSize );
100
101 if (dist_bin >= NUM_ALPHA_BINS)
102 {
103 mDistanceBins[NUM_ALPHA_BINS-1].put(facep);
104 //mDistanceBins[NUM_ALPHA_BINS-1].push(facep, (U32)(void*)facep->getTexture());
105 }
106 else if (dist_bin > 0)
107 {
108 mDistanceBins[dist_bin].put(facep);
109 //mDistanceBins[dist_bin].push(facep, (U32)(void*)facep->getTexture());
110 }
111 else
112 {
113 mDistanceBins[0].put(facep);
114 //mDistanceBins[0].push(facep, (U32)(void*)facep->getTexture());
115 }
116 }
117} 64}
118 65
119BOOL LLDrawPoolAlpha::removeFace(LLFace *facep)
120{
121 BOOL removed = FALSE;
122
123 LLDrawPool::removeFace(facep);
124
125 {
126 for (S32 i = 0; i < NUM_ALPHA_BINS; i++)
127 {
128 if (mDistanceBins[i].removeObj(facep) != -1)
129 {
130 if (removed)
131 {
132 llerrs << "Warning! " << "Face in multiple distance bins on removal" << llendl;
133 }
134 removed = TRUE;
135 }
136 }
137 }
138 if (removed)
139 {
140 return TRUE;
141 }
142
143 return FALSE;
144}
145 66
146void LLDrawPoolAlpha::prerender() 67void LLDrawPoolAlpha::prerender()
147{ 68{
@@ -150,454 +71,270 @@ void LLDrawPoolAlpha::prerender()
150 71
151void LLDrawPoolAlpha::beginRenderPass(S32 pass) 72void LLDrawPoolAlpha::beginRenderPass(S32 pass)
152{ 73{
153 if (mDrawFace.empty())
154 {
155 // No alpha objects, early exit.
156 return;
157 }
158
159 glEnableClientState(GL_TEXTURE_COORD_ARRAY); 74 glEnableClientState(GL_TEXTURE_COORD_ARRAY);
160 glEnableClientState(GL_VERTEX_ARRAY);
161 glEnableClientState(GL_NORMAL_ARRAY); 75 glEnableClientState(GL_NORMAL_ARRAY);
162 if (gPipeline.getLightingDetail() >= 2) 76 glEnableClientState(GL_COLOR_ARRAY);
163 {
164 glEnableClientState(GL_COLOR_ARRAY);
165 }
166} 77}
167 78
168 79void setup_clip_plane(BOOL pre_water)
169void LLDrawPoolAlpha::render(S32 pass)
170{ 80{
171 LLFastTimer t(LLFastTimer::FTM_RENDER_ALPHA); 81 F32 height = gAgent.getRegion()->getWaterHeight();
82 BOOL above = gCamera->getOrigin().mV[2] > height ? TRUE : FALSE;
172 83
173 if (mDrawFace.empty()) 84 F64 plane[4];
174 { 85
175 // No alpha objects, early exit. 86 plane[0] = 0;
176 return; 87 plane[1] = 0;
177 } 88 plane[2] = above == pre_water ? -1.0 : 1.0;
178 89 plane[3] = -plane[2] * height;
179 GLfloat shiny[4] = 90
180 { 91 glClipPlane(GL_CLIP_PLANE0, plane);
181 0.00f, 92}
182 0.25f,
183 0.5f,
184 0.75f
185 };
186
187 GLint specularIndex = (mVertexShaderLevel > 0) ?
188 gPipeline.mObjectAlphaProgram.mAttribute[LLPipeline::GLSL_SPECULAR_COLOR] : 0;
189 93
190 S32 diffTex = 0; 94void LLDrawPoolAlphaPostWater::render(S32 pass)
191 S32 envTex = -1; 95{
96 LLFastTimer t(LLFastTimer::FTM_RENDER_ALPHA);
192 97
193 if (mVertexShaderLevel > 0) //alpha pass uses same shader as shiny/bump 98 if (gPipeline.hasRenderType(LLDrawPool::POOL_ALPHA))
194 { 99 {
195 envTex = gPipeline.mObjectAlphaProgram.enableTexture(LLPipeline::GLSL_ENVIRONMENT_MAP, GL_TEXTURE_CUBE_MAP_ARB); 100 LLGLEnable clip(GL_CLIP_PLANE0);
196 LLCubeMap* cube_map = gSky.mVOSkyp->getCubeMap(); 101 setup_clip_plane(FALSE);
197 if (envTex >= 0 && cube_map) 102 LLDrawPoolAlpha::render(gPipeline.mAlphaGroupsPostWater);
198 {
199 cube_map->bind();
200 cube_map->setMatrix(1);
201 }
202
203 if (specularIndex > 0)
204 {
205 glVertexAttrib4fARB(specularIndex, 0, 0, 0, 0);
206 }
207
208 S32 scatterTex = gPipeline.mObjectAlphaProgram.enableTexture(LLPipeline::GLSL_SCATTER_MAP);
209 LLViewerImage::bindTexture(gSky.mVOSkyp->getScatterMap(), scatterTex);
210
211 diffTex = gPipeline.mObjectAlphaProgram.enableTexture(LLPipeline::GLSL_DIFFUSE_MAP);
212 } 103 }
213 104 else
214 bindGLVertexPointer();
215 bindGLTexCoordPointer();
216 bindGLNormalPointer();
217 if (gPipeline.getLightingDetail() >= 2)
218 { 105 {
219 bindGLColorPointer(); 106 LLDrawPoolAlpha::render(gPipeline.mAlphaGroupsPostWater);
220 } 107 }
108}
221 109
222 S32 i, j; 110void LLDrawPoolAlpha::render(S32 pass)
223 glAlphaFunc(GL_GREATER,0.01f); 111{
224 // This needs to be turned off or there will be lots of artifacting with the clouds - djs 112 LLFastTimer t(LLFastTimer::FTM_RENDER_ALPHA);
225 LLGLDepthTest gls_depth(GL_TRUE, GL_FALSE); 113
114 LLGLEnable clip(GL_CLIP_PLANE0);
115 setup_clip_plane(TRUE);
116 render(gPipeline.mAlphaGroups);
117}
226 118
119void LLDrawPoolAlpha::render(std::vector<LLSpatialGroup*>& groups)
120{
121 LLGLDepthTest gls_depth(GL_TRUE);
227 LLGLSPipelineAlpha gls_pipeline_alpha; 122 LLGLSPipelineAlpha gls_pipeline_alpha;
228 123
229 LLDynamicArray<LLFace*>* distance_bins; 124 gPipeline.enableLightsDynamic(1.f);
230 distance_bins = mDistanceBins; 125 renderAlpha(getVertexDataMask(), groups);
231
232 S32 num_bins_no_alpha_test = ((gPickAlphaThreshold != 0.f) && gUsePickAlpha) ?
233 (NUM_ALPHA_BINS - llmax(2, (S32)(ALPHA_FALLOFF_START_DISTANCE * mInvBinSize))) :
234 NUM_ALPHA_BINS;
235
236 typedef std::vector<LLFace*> face_list_t;
237 126
238 for (i = 0; i < num_bins_no_alpha_test; i++) 127 if (sShowDebugAlpha)
239 { 128 {
240 S32 obj_count = distance_bins[i].count(); 129 glDisableClientState(GL_NORMAL_ARRAY);
241 130 glDisableClientState(GL_COLOR_ARRAY);
242 if (!obj_count) 131 gPipeline.enableLightsFullbright(LLColor4(1,1,1,1));
243 { 132 glColor4f(1,0,0,1);
244 continue; 133 LLViewerImage::sSmokeImagep->addTextureStats(1024.f*1024.f);
245 } 134 LLViewerImage::sSmokeImagep->bind();
246 else if (i > (NUM_ALPHA_BINS / 2) && obj_count < 100) 135 renderAlphaHighlight(LLVertexBuffer::MAP_VERTEX |
247 { 136 LLVertexBuffer::MAP_TEXCOORD, groups);
248 face_list_t pri_queue;
249 pri_queue.reserve(distance_bins[i].count());
250 for (j = 0; j < distance_bins[i].count(); j++)
251 {
252 pri_queue.push_back(distance_bins[i][j]);
253 }
254 std::sort(pri_queue.begin(), pri_queue.end(), LLFace::CompareDistanceGreater());
255
256 for (face_list_t::iterator iter = pri_queue.begin(); iter != pri_queue.end(); iter++)
257 {
258 const LLFace &face = *(*iter);
259 face.enableLights();
260 face.bindTexture(diffTex);
261 if ((mVertexShaderLevel > 0) && face.getTextureEntry() && specularIndex > 0)
262 {
263 U8 s = face.getTextureEntry()->getShiny();
264 glVertexAttrib4fARB(specularIndex, shiny[s], shiny[s], shiny[s], shiny[s]);
265 }
266 face.renderIndexed(getRawIndices());
267 mIndicesDrawn += face.getIndicesCount();
268 }
269 }
270 else
271 {
272 S32 count = distance_bins[i].count();
273 for (j = 0; j < count; j++)
274 {
275 const LLFace &face = *distance_bins[i][j];
276 face.enableLights();
277 face.bindTexture(diffTex);
278 if ((mVertexShaderLevel > 0) && face.getTextureEntry() && specularIndex > 0)
279 {
280 U8 s = face.getTextureEntry()->getShiny();
281 glVertexAttrib4fARB(specularIndex, shiny[s], shiny[s], shiny[s], shiny[s]);
282 }
283 face.renderIndexed(getRawIndices());
284 mIndicesDrawn += face.getIndicesCount();
285 }
286 }
287 } 137 }
138}
288 139
289 GLfloat ogl_matrix[16]; 140void LLDrawPoolAlpha::renderAlpha(U32 mask, std::vector<LLSpatialGroup*>& groups)
290 gCamera->getOpenGLTransform(ogl_matrix); 141{
142#if !LL_RELEASE_FOR_DOWNLOAD
143 LLGLState::checkClientArrays(mask);
144#endif
291 145
292 for (i = num_bins_no_alpha_test; i < NUM_ALPHA_BINS; i++) 146 LLSpatialBridge* last_bridge = NULL;
293 { 147 LLSpatialPartition* last_part = NULL;
294 BOOL use_pri_queue = distance_bins[i].count() < 100; 148 glPushMatrix();
149 LLGLDepthTest depth(GL_TRUE, GL_FALSE);
295 150
296 face_list_t pri_queue; 151 for (std::vector<LLSpatialGroup*>::iterator i = groups.begin(); i != groups.end(); ++i)
297 152 {
298 if (use_pri_queue) 153 LLSpatialGroup* group = *i;
299 { 154 if (group->mSpatialPartition->mRenderByGroup &&
300 pri_queue.reserve(distance_bins[i].count()); 155 !group->isDead())
301 for (j = 0; j < distance_bins[i].count(); j++)
302 {
303 pri_queue.push_back(distance_bins[i][j]);
304 }
305 std::sort(pri_queue.begin(), pri_queue.end(), LLFace::CompareDistanceGreater());
306 }
307
308 S32 count = distance_bins[i].count();
309 for (j = 0; j < count; j++)
310 { 156 {
311 const LLFace &face = use_pri_queue ? *pri_queue[j] : *distance_bins[i][j]; 157 LLSpatialPartition* part = group->mSpatialPartition;
312 F32 fade_value = face.mAlphaFade * gPickAlphaThreshold; 158 if (part != last_part)
313
314 face.enableLights();
315
316 if (fade_value < 1.f)
317 { 159 {
160 LLSpatialBridge* bridge = part->asBridge();
161 if (bridge != last_bridge)
318 { 162 {
319 LLGLDepthTest gls_depth(GL_TRUE, GL_TRUE); 163 glPopMatrix();
320 glAlphaFunc(GL_LESS, fade_value); 164 glPushMatrix();
321 glBlendFunc(GL_ZERO, GL_ONE); 165 if (bridge)
322 LLViewerImage::bindTexture(gPipeline.mAlphaSizzleImagep, diffTex);
323 LLVector4 s_params(ogl_matrix[2], ogl_matrix[6], ogl_matrix[10], ogl_matrix[14]);
324 LLVector4 t_params(ogl_matrix[1], ogl_matrix[5], ogl_matrix[9], ogl_matrix[13]);
325
326 LLGLEnable gls_texgen_s(GL_TEXTURE_GEN_S);
327 LLGLEnable gls_texgen_t(GL_TEXTURE_GEN_T);
328 glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR);
329 glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR);
330 glTexGenfv(GL_S, GL_OBJECT_PLANE, s_params.mV);
331 glTexGenfv(GL_T, GL_OBJECT_PLANE, t_params.mV);
332 if ((mVertexShaderLevel > 0) && face.getTextureEntry() && specularIndex > 0)
333 { 166 {
334 U8 s = face.getTextureEntry()->getShiny(); 167 glMultMatrixf((F32*) bridge->mDrawable->getRenderMatrix().mMatrix);
335 glVertexAttrib4fARB(specularIndex, shiny[s], shiny[s], shiny[s], shiny[s]);
336 } 168 }
337 face.renderIndexed(getRawIndices()); 169 last_bridge = bridge;
338 } 170 }
339 171
340 { 172// if (!last_part || part->mDepthMask != last_part->mDepthMask)
341 // should get GL_GREATER to work, as it's faster 173// {
342 LLGLDepthTest gls_depth(GL_TRUE, GL_FALSE, GL_LESS); 174// glDepthMask(part->mDepthMask);
343 glAlphaFunc(GL_GEQUAL, fade_value); 175// }
344 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); 176 last_part = part;
345 face.bindTexture(diffTex);
346 if ((mVertexShaderLevel > 0) && face.getTextureEntry() && specularIndex > 0)
347 {
348 U8 s = face.getTextureEntry()->getShiny();
349 glVertexAttrib4fARB(specularIndex, shiny[s], shiny[s], shiny[s], shiny[s]);
350 }
351 face.renderIndexed(getRawIndices());
352 }
353 } 177 }
354 178
355 // render opaque portion of actual texture 179 renderGroupAlpha(group,LLRenderPass::PASS_ALPHA,mask,TRUE);
356 glAlphaFunc(GL_GREATER, 0.98f);
357
358 face.bindTexture(diffTex);
359 face.renderIndexed(getRawIndices());
360
361 glAlphaFunc(GL_GREATER, 0.01f);
362
363 mIndicesDrawn += face.getIndicesCount();
364 } 180 }
365 } 181 }
182
183 glPopMatrix();
184}
366 185
367 if (mVertexShaderLevel > 0) //single pass shader driven shiny/bump 186void LLDrawPoolAlpha::renderAlphaHighlight(U32 mask, std::vector<LLSpatialGroup*>& groups)
368 { 187{
369 gPipeline.mObjectAlphaProgram.disableTexture(LLPipeline::GLSL_ENVIRONMENT_MAP, GL_TEXTURE_CUBE_MAP_ARB); 188#if !LL_RELEASE_FOR_DOWNLOAD
370 LLCubeMap* cube_map = gSky.mVOSkyp->getCubeMap(); 189 LLGLState::checkClientArrays(mask);
371 if (envTex >= 0 && cube_map) 190#endif
372 {
373 cube_map->restoreMatrix();
374 }
375 gPipeline.mObjectAlphaProgram.disableTexture(LLPipeline::GLSL_SCATTER_MAP);
376 gPipeline.mObjectAlphaProgram.disableTexture(LLPipeline::GLSL_DIFFUSE_MAP);
377
378 glClientActiveTextureARB(GL_TEXTURE0_ARB);
379 glActiveTextureARB(GL_TEXTURE0_ARB);
380 glEnable(GL_TEXTURE_2D);
381 }
382 191
383 if (sShowDebugAlpha) 192 LLSpatialBridge* last_bridge = NULL;
193 LLSpatialPartition* last_part = NULL;
194 glPushMatrix();
195
196 for (std::vector<LLSpatialGroup*>::iterator i = groups.begin(); i != groups.end(); ++i)
384 { 197 {
385 gPipeline.disableLights(); 198 LLSpatialGroup* group = *i;
386 if ((mVertexShaderLevel > 0)) 199 if (group->mSpatialPartition->mRenderByGroup &&
200 !group->isDead())
387 { 201 {
388 gPipeline.mHighlightProgram.bind(); 202 LLSpatialPartition* part = group->mSpatialPartition;
389 } 203 if (part != last_part)
390
391 LLViewerImage::sSmokeImagep->bind();
392 LLOverrideFaceColor override_color(this, 1.f, 0.f, 0.f, 1.f);
393 glColor4f(1.f, 0.f, 0.f, 1.f); // in case vertex shaders are enabled
394 glDisableClientState(GL_COLOR_ARRAY);
395
396 for (S32 i = 0; i < NUM_ALPHA_BINS; i++)
397 {
398 if (distance_bins[i].count() < 100)
399 { 204 {
400 face_list_t pri_queue; 205 LLSpatialBridge* bridge = part->asBridge();
401 pri_queue.reserve(distance_bins[i].count()); 206 if (bridge != last_bridge)
402 for (j = 0; j < distance_bins[i].count(); j++)
403 { 207 {
404 pri_queue.push_back(distance_bins[i][j]); 208 glPopMatrix();
405 } 209 glPushMatrix();
406 std::sort(pri_queue.begin(), pri_queue.end(), LLFace::CompareDistanceGreater()); 210 if (bridge)
407 211 {
408 for (face_list_t::iterator iter = pri_queue.begin(); iter != pri_queue.end(); iter++) 212 glMultMatrixf((F32*) bridge->mDrawable->getRenderMatrix().mMatrix);
409 { 213 }
410 const LLFace &face = *(*iter); 214 last_bridge = bridge;
411 face.renderIndexed(getRawIndices());
412 mIndicesDrawn += face.getIndicesCount();
413 } 215 }
216
217 last_part = part;
414 } 218 }
415 else 219
220 std::vector<LLDrawInfo*>& draw_info = group->mDrawMap[LLRenderPass::PASS_ALPHA];
221
222 for (std::vector<LLDrawInfo*>::const_iterator k = draw_info.begin(); k != draw_info.end(); ++k)
416 { 223 {
417 for (j = 0; j < distance_bins[i].count(); j++) 224 LLDrawInfo& params = **k;
225
226 if (params.mParticle)
418 { 227 {
419 const LLFace &face = *distance_bins[i][j]; 228 continue;
420 face.renderIndexed(getRawIndices());
421 mIndicesDrawn += face.getIndicesCount();
422 } 229 }
230 params.mVertexBuffer->setBuffer(mask);
231 U32* indices_pointer = (U32*) params.mVertexBuffer->getIndicesPointer();
232 glDrawRangeElements(GL_TRIANGLES, params.mStart, params.mEnd, params.mCount,
233 GL_UNSIGNED_INT, indices_pointer+params.mOffset);
234
235 addIndicesDrawn(params.mCount);
423 } 236 }
424 } 237 }
238 }
239 glPopMatrix();
240}
425 241
426 if ((mVertexShaderLevel > 0)) 242void LLDrawPoolAlpha::renderGroupAlpha(LLSpatialGroup* group, U32 type, U32 mask, BOOL texture)
427 { 243{
428 gPipeline.mHighlightProgram.unbind(); 244 BOOL light_enabled = TRUE;
429 }
430 245
431 } 246 std::vector<LLDrawInfo*>& draw_info = group->mDrawMap[type];
247
248 U32 prim_type = GL_TRIANGLES;
432 249
433} 250 //F32 width = (F32) gViewerWindow->getWindowDisplayWidth();
434 251
435void LLDrawPoolAlpha::renderForSelect() 252 //F32 view = gCamera->getView();
436{ 253
437 if (mDrawFace.empty() || !mMemory.count()) 254 if (group->mSpatialPartition->mDrawableType == LLPipeline::RENDER_TYPE_CLOUDS)
438 { 255 {
439 return; 256 glAlphaFunc(GL_GREATER, 0.f);
440 } 257 }
441 258 else
442 // force faces on focus object to proper alpha cutoff based on object bbox distance
443 if (gAgent.getFocusObject())
444 { 259 {
445 LLDrawable* drawablep = gAgent.getFocusObject()->mDrawable; 260 glAlphaFunc(GL_GREATER, 0.01f);
446
447 if (drawablep)
448 {
449 const S32 num_faces = drawablep->getNumFaces();
450
451 for (S32 f = 0; f < num_faces; f++)
452 {
453 LLFace* facep = drawablep->getFace(f);
454 facep->mDistance = gAgent.getFocusObjectDist();
455 }
456 }
457 } 261 }
458 262
459 glEnableClientState (GL_VERTEX_ARRAY); 263 /*LLGLEnable point_sprite(GL_POINT_SPRITE_ARB);
460 glEnableClientState (GL_TEXTURE_COORD_ARRAY);
461
462 LLGLSObjectSelectAlpha gls_alpha;
463
464 glBlendFunc(GL_ONE, GL_ZERO);
465 glAlphaFunc(gPickTransparent ? GL_GEQUAL : GL_GREATER, 0.f);
466
467 bindGLVertexPointer();
468 bindGLTexCoordPointer();
469 264
470 glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_ARB); 265 if (gGLManager.mHasPointParameters)
471 glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_RGB_ARB, GL_REPLACE); 266 {
472 glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_ALPHA_ARB, GL_MODULATE); 267 glTexEnvi(GL_POINT_SPRITE_ARB, GL_COORD_REPLACE_ARB, TRUE);
473 268 glPointParameterfARB(GL_POINT_SIZE_MIN_ARB, 0.f);
474 glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_RGB_ARB, GL_PREVIOUS); 269 glPointParameterfARB(GL_POINT_SIZE_MAX_ARB, width*16.f);
475 glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_RGB_ARB, GL_SRC_COLOR); 270 glPointSize(width/(view*view));
476 271 }*/
477 glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_ALPHA_ARB, GL_TEXTURE);
478 glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_ALPHA_ARB, GL_SRC_ALPHA);
479
480 glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE1_ALPHA_ARB, GL_PRIMARY_COLOR_ARB);
481 glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND1_ALPHA_ARB, GL_SRC_ALPHA);
482
483 LLDynamicArray<LLFace*>* distance_bins;
484 distance_bins = mDistanceBins;
485
486 S32 j;
487 S32 num_bins_no_alpha_test = (gPickAlphaThreshold != 0.f) ?
488 (NUM_ALPHA_BINS - llmax(2, (S32)(ALPHA_FALLOFF_START_DISTANCE * mInvBinSize))) :
489 NUM_ALPHA_BINS;
490 272
491 S32 i; 273 for (std::vector<LLDrawInfo*>::const_iterator k = draw_info.begin(); k != draw_info.end(); ++k)
492 for (i = 0; i < num_bins_no_alpha_test; i++)
493 { 274 {
494 S32 distance_bin_size = distance_bins[i].count(); 275 LLDrawInfo& params = **k;
495 for (j = 0; j < distance_bin_size; j++) 276 if (texture && params.mTexture.notNull())
496 { 277 {
497 const LLFace &face = *distance_bins[i][j]; 278 params.mTexture->bind();
498 if (face.getDrawable() && !face.getDrawable()->isDead() && (face.getViewerObject()->mGLName)) 279 params.mTexture->addTextureStats(params.mVSize);
280 if (params.mTextureMatrix)
499 { 281 {
500 face.bindTexture(); 282 glMatrixMode(GL_TEXTURE);
501 face.renderForSelect(); 283 glLoadMatrixf((GLfloat*) params.mTextureMatrix->mMatrix);
502 } 284 }
503 } 285 }
504 } 286
505 287 if (params.mFullbright)
506 for (i = num_bins_no_alpha_test; i < NUM_ALPHA_BINS; i++)
507 {
508 S32 distance_bin_size = distance_bins[i].count();
509 if (distance_bin_size)
510 { 288 {
511 for (j = 0; j < distance_bin_size; j++) 289 if (light_enabled)
512 { 290 {
513 const LLFace &face = *distance_bins[i][j]; 291 gPipeline.enableLightsFullbright(LLColor4(1,1,1,1));
514 292 light_enabled = FALSE;
515 glAlphaFunc(GL_GEQUAL, face.mAlphaFade * gPickAlphaTargetThreshold);
516
517 if (face.getDrawable() && !face.getDrawable()->isDead() && (face.getViewerObject()->mGLName))
518 {
519 face.bindTexture();
520 face.renderForSelect();
521 }
522 } 293 }
523 } 294 }
524 } 295 else if (!light_enabled)
525 296 {
526 glAlphaFunc(GL_GREATER, 0.01f); 297 gPipeline.enableLightsDynamic(1.f);
527 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); 298 light_enabled = TRUE;
528 glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); 299 }
529 glDisableClientState (GL_TEXTURE_COORD_ARRAY);
530}
531
532
533void LLDrawPoolAlpha::renderFaceSelected(LLFace *facep,
534 LLImageGL *image,
535 const LLColor4 &color,
536 const S32 index_offset, const S32 index_count)
537{
538 facep->renderSelected(image, color, index_offset, index_count);
539}
540
541 300
542void LLDrawPoolAlpha::resetDrawOrders() 301 /*if (params.mParticle)
543{ 302 {
544 LLDrawPool::resetDrawOrders(); 303 F32 size = params.mPartSize;
304 size *= size;
305 float param[] = { 0, 0, 0.01f/size*view*view };
306 prim_type = GL_POINTS;
307 glPointParameterfvARB(GL_POINT_DISTANCE_ATTENUATION_ARB, param);
308 }
309 else*/
310 {
311 prim_type = GL_TRIANGLES;
312 }
545 313
546 for (S32 i = 0; i < NUM_ALPHA_BINS; i++) 314 params.mVertexBuffer->setBuffer(mask);
547 { 315 U32* indices_pointer = (U32*) params.mVertexBuffer->getIndicesPointer();
548 mDistanceBins[i].resize(0); 316 glDrawRangeElements(prim_type, params.mStart, params.mEnd, params.mCount,
549 } 317 GL_UNSIGNED_INT, indices_pointer+params.mOffset);
550} 318
319 addIndicesDrawn(params.mCount);
551 320
552BOOL LLDrawPoolAlpha::verify() const 321 if (params.mTextureMatrix && texture && params.mTexture.notNull())
553{
554 S32 i, j;
555 BOOL ok;
556 ok = LLDrawPool::verify();
557 for (i = 0; i < NUM_ALPHA_BINS; i++)
558 {
559 for (j = 0; j < mDistanceBins[i].count(); j++)
560 { 322 {
561 const LLFace &face = *mDistanceBins[i][j]; 323 glLoadIdentity();
562 if (!face.verify()) 324 glMatrixMode(GL_MODELVIEW);
563 {
564 ok = FALSE;
565 }
566 } 325 }
567 } 326 }
568 return ok;
569}
570
571LLViewerImage *LLDrawPoolAlpha::getDebugTexture()
572{
573 return LLViewerImage::sSmokeImagep;
574}
575
576
577LLColor3 LLDrawPoolAlpha::getDebugColor() const
578{
579 return LLColor3(1.f, 0.f, 0.f);
580}
581 327
582S32 LLDrawPoolAlpha::getMaterialAttribIndex() 328 if (!light_enabled)
583{ 329 {
584 return gPipeline.mObjectAlphaProgram.mAttribute[LLPipeline::GLSL_MATERIAL_COLOR]; 330 gPipeline.enableLightsDynamic(1.f);
585} 331 }
586 332
587// virtual 333 /*glPointSize(1.f);
588void LLDrawPoolAlpha::enableShade()
589{
590 glDisableClientState(GL_COLOR_ARRAY);
591}
592 334
593// virtual 335 if (gGLManager.mHasPointParameters)
594void LLDrawPoolAlpha::disableShade() 336 {
595{ 337 float param[] = {1, 0, 0 };
596 glEnableClientState(GL_COLOR_ARRAY); 338 glPointParameterfvARB(GL_POINT_DISTANCE_ATTENUATION_ARB, param);
597} 339 }*/
598 340}
599// virtual
600void LLDrawPoolAlpha::setShade(F32 shade)
601{
602 glColor4f(0,0,0,shade);
603}
diff --git a/linden/indra/newview/lldrawpoolalpha.h b/linden/indra/newview/lldrawpoolalpha.h
index ba58a7f..f7012d6 100644
--- a/linden/indra/newview/lldrawpoolalpha.h
+++ b/linden/indra/newview/lldrawpoolalpha.h
@@ -29,55 +29,43 @@
29#define LL_LLDRAWPOOLALPHA_H 29#define LL_LLDRAWPOOLALPHA_H
30 30
31#include "lldrawpool.h" 31#include "lldrawpool.h"
32#include "llviewerimage.h"
33#include "llframetimer.h" 32#include "llframetimer.h"
34 33
35class LLFace; 34class LLFace;
36class LLColor4; 35class LLColor4;
37 36
38class LLDrawPoolAlpha: public LLDrawPool 37class LLDrawPoolAlpha: public LLRenderPass
39{ 38{
40public: 39public:
41 LLDrawPoolAlpha();
42 /*virtual*/ ~LLDrawPoolAlpha();
43
44 /*virtual*/ LLDrawPool *instancePool();
45
46 /*virtual*/ void beginRenderPass(S32 pass = 0);
47 /*virtual*/ void render(S32 pass = 0);
48 /*virtual*/ void renderFaceSelected(LLFace *facep, LLImageGL *image, const LLColor4 &color,
49 const S32 index_offset = 0, const S32 index_count = 0);
50 /*virtual*/ void prerender();
51 /*virtual*/ void renderForSelect();
52
53 /*virtual*/ void enqueue(LLFace *face);
54 /*virtual*/ BOOL removeFace(LLFace *face);
55 /*virtual*/ void resetDrawOrders();
56
57 /*virtual*/ void enableShade();
58 /*virtual*/ void disableShade();
59 /*virtual*/ void setShade(F32 shade);
60
61
62 virtual S32 getMaterialAttribIndex();
63
64 BOOL mRebuiltLastFrame;
65 enum 40 enum
66 { 41 {
67 NUM_ALPHA_BINS = 1024 42 VERTEX_DATA_MASK = LLVertexBuffer::MAP_VERTEX |
43 LLVertexBuffer::MAP_NORMAL |
44 LLVertexBuffer::MAP_COLOR |
45 LLVertexBuffer::MAP_TEXCOORD
68 }; 46 };
47 virtual U32 getVertexDataMask() { return VERTEX_DATA_MASK; }
48
49 LLDrawPoolAlpha(U32 type = LLDrawPool::POOL_ALPHA);
50 /*virtual*/ ~LLDrawPoolAlpha();
69 51
70 /*virtual*/ BOOL verify() const; 52 /*virtual*/ void beginRenderPass(S32 pass = 0);
71 /*virtual*/ LLViewerImage *getDebugTexture(); 53 virtual void render(S32 pass = 0);
72 /*virtual*/ LLColor3 getDebugColor() const; // For AGP debug display 54 void render(std::vector<LLSpatialGroup*>& groups);
55 /*virtual*/ void prerender();
73 56
57 void renderGroupAlpha(LLSpatialGroup* group, U32 type, U32 mask, BOOL texture = TRUE);
58 void renderAlpha(U32 mask, std::vector<LLSpatialGroup*>& groups);
59 void renderAlphaHighlight(U32 mask, std::vector<LLSpatialGroup*>& groups);
60
74 static BOOL sShowDebugAlpha; 61 static BOOL sShowDebugAlpha;
75protected: 62};
76 F32 mMinDistance;
77 F32 mMaxDistance;
78 F32 mInvBinSize;
79 63
80 LLDynamicArray<LLFace*> mDistanceBins[NUM_ALPHA_BINS]; 64class LLDrawPoolAlphaPostWater : public LLDrawPoolAlpha
65{
66public:
67 LLDrawPoolAlphaPostWater();
68 virtual void render(S32 pass = 0);
81}; 69};
82 70
83#endif // LL_LLDRAWPOOLALPHA_H 71#endif // LL_LLDRAWPOOLALPHA_H
diff --git a/linden/indra/newview/lldrawpoolavatar.cpp b/linden/indra/newview/lldrawpoolavatar.cpp
index abf154c..fc4f64b 100644
--- a/linden/indra/newview/lldrawpoolavatar.cpp
+++ b/linden/indra/newview/lldrawpoolavatar.cpp
@@ -32,7 +32,6 @@
32#include "llvoavatar.h" 32#include "llvoavatar.h"
33#include "m3math.h" 33#include "m3math.h"
34 34
35#include "llagparray.h"
36#include "llagent.h" 35#include "llagent.h"
37#include "lldrawable.h" 36#include "lldrawable.h"
38#include "llface.h" 37#include "llface.h"
@@ -42,6 +41,11 @@
42#include "noise.h" 41#include "noise.h"
43#include "pipeline.h" 42#include "pipeline.h"
44 43
44static U32 sDataMask = LLDrawPoolAvatar::VERTEX_DATA_MASK;
45static U32 sBufferUsage = GL_STREAM_DRAW_ARB;
46static U32 sShaderLevel = 0;
47static LLGLSLShader* sVertexProgram = NULL;
48
45extern F32 gFrameDTClamped; 49extern F32 gFrameDTClamped;
46extern BOOL gUseGLPick; 50extern BOOL gUseGLPick;
47 51
@@ -75,53 +79,13 @@ S32 AVATAR_VERTEX_BYTES = 48;
75 79
76 80
77BOOL gAvatarEmbossBumpMap = FALSE; 81BOOL gAvatarEmbossBumpMap = FALSE;
82static BOOL sRenderingSkinned = FALSE;
78 83
79LLDrawPoolAvatar::LLDrawPoolAvatar() : 84LLDrawPoolAvatar::LLDrawPoolAvatar() :
80LLDrawPool(POOL_AVATAR, 85LLFacePool(POOL_AVATAR)
81 DATA_SIMPLE_IL_MASK,
82 DATA_VERTEX_WEIGHTS_MASK | DATA_CLOTHING_WEIGHTS_MASK )
83{ 86{
84 mCleanupUnused = FALSE;
85
86 // Overide the data layout
87 mDataMaskIL = 0;
88 mStride = 0;
89 for (S32 i = 0; i < DATA_MAX_TYPES; i++)
90 {
91 mDataOffsets[i] = 0;
92 }
93
94 // Note: padding is to speed up SSE code
95 mDataMaskIL |= DATA_VERTICES_MASK;
96 mDataOffsets[DATA_VERTICES] = mStride;
97 mStride += sDataSizes[DATA_VERTICES];
98
99 mStride += 4;
100
101 mDataMaskIL |= DATA_NORMALS_MASK;
102 mDataOffsets[DATA_NORMALS] = mStride;
103 mStride += sDataSizes[DATA_NORMALS];
104
105 mStride += 4;
106
107 // Note: binormals are stripped off in software blending
108 mDataMaskIL |= DATA_BINORMALS_MASK;
109 mDataOffsets[DATA_BINORMALS] = mStride;
110 mStride += sDataSizes[DATA_BINORMALS];
111
112 mStride += 4; // To keep the structure 16-byte aligned (for SSE happiness)
113
114 mDataMaskIL |= DATA_TEX_COORDS0_MASK;
115 mDataOffsets[DATA_TEX_COORDS0] = mStride;
116 mStride += sDataSizes[DATA_TEX_COORDS0];
117
118 mDataMaskIL |= DATA_TEX_COORDS1_MASK;
119 mDataOffsets[DATA_TEX_COORDS1] = mStride;
120 mStride += sDataSizes[DATA_TEX_COORDS1];
121
122 //LLDebugVarMessageBox::show("acceleration", &CLOTHING_ACCEL_FORCE_FACTOR, 10.f, 0.1f); 87 //LLDebugVarMessageBox::show("acceleration", &CLOTHING_ACCEL_FORCE_FACTOR, 10.f, 0.1f);
123 //LLDebugVarMessageBox::show("gravity", &CLOTHING_GRAVITY_EFFECT, 10.f, 0.1f); 88 //LLDebugVarMessageBox::show("gravity", &CLOTHING_GRAVITY_EFFECT, 10.f, 0.1f);
124
125} 89}
126 90
127//----------------------------------------------------------------------------- 91//-----------------------------------------------------------------------------
@@ -132,41 +96,194 @@ LLDrawPool *LLDrawPoolAvatar::instancePool()
132 return new LLDrawPoolAvatar(); 96 return new LLDrawPoolAvatar();
133} 97}
134 98
99BOOL gRenderAvatar = TRUE;
100static LLMatrix4 sModelViewMatrix = LLMatrix4();
135 101
136S32 LLDrawPoolAvatar::rebuild() 102S32 LLDrawPoolAvatar::getVertexShaderLevel() const
137{ 103{
138 mRebuildTime++; 104 return (S32) gPipeline.getVertexShaderLevel(LLPipeline::SHADER_AVATAR);
139 if (mRebuildTime > mRebuildFreq)
140 {
141 flushAGP();
142
143 mRebuildTime = 0;
144 }
145
146 return 0;
147} 105}
148 106
149BOOL gRenderAvatar = TRUE;
150
151void LLDrawPoolAvatar::prerender() 107void LLDrawPoolAvatar::prerender()
152{ 108{
153 mVertexShaderLevel = gPipeline.getVertexShaderLevel(LLPipeline::SHADER_AVATAR); 109 mVertexShaderLevel = gPipeline.getVertexShaderLevel(LLPipeline::SHADER_AVATAR);
110 sShaderLevel = mVertexShaderLevel;
111
112 if (sShaderLevel > 0)
113 {
114 sBufferUsage = GL_STATIC_DRAW_ARB;
115 }
116 else
117 {
118 sBufferUsage = GL_STREAM_DRAW_ARB;
119 }
120}
121
122LLMatrix4& LLDrawPoolAvatar::getModelView()
123{
124 return sModelViewMatrix;
154} 125}
155 126
156//----------------------------------------------------------------------------- 127//-----------------------------------------------------------------------------
157// render() 128// render()
158//----------------------------------------------------------------------------- 129//-----------------------------------------------------------------------------
130
131S32 LLDrawPoolAvatar::getNumPasses()
132{
133 return 3;
134}
135
159void LLDrawPoolAvatar::render(S32 pass) 136void LLDrawPoolAvatar::render(S32 pass)
160{ 137{
161 LLFastTimer t(LLFastTimer::FTM_RENDER_CHARACTERS); 138 LLFastTimer t(LLFastTimer::FTM_RENDER_CHARACTERS);
162 renderAvatars(NULL); // render all avatars 139 renderAvatars(NULL, pass); // render all avatars
140}
141
142void LLDrawPoolAvatar::beginRenderPass(S32 pass)
143{
144 //reset vertex buffer mappings
145 LLVertexBuffer::unbind();
146
147 switch (pass)
148 {
149 case 0:
150 beginFootShadow();
151 break;
152 case 1:
153 glGetFloatv(GL_MODELVIEW_MATRIX, (F32*) sModelViewMatrix.mMatrix);
154 beginRigid();
155 break;
156 case 2:
157 beginSkinned();
158 break;
159 }
160}
161
162void LLDrawPoolAvatar::endRenderPass(S32 pass)
163{
164 switch (pass)
165 {
166 case 0:
167 endFootShadow();
168 break;
169 case 1:
170 endRigid();
171 break;
172 case 2:
173 endSkinned();
174 }
175}
176
177void LLDrawPoolAvatar::beginFootShadow()
178{
179 glDepthMask(GL_FALSE);
180 gPipeline.enableLightsFullbright(LLColor4(1,1,1,1));
181 glEnableClientState(GL_TEXTURE_COORD_ARRAY);
182}
183
184void LLDrawPoolAvatar::endFootShadow()
185{
186 gPipeline.enableLightsDynamic(1.f);
187 glDepthMask(GL_TRUE);
188 glDisableClientState(GL_TEXTURE_COORD_ARRAY);
189}
190
191void LLDrawPoolAvatar::beginRigid()
192{
193 sVertexProgram = &gPipeline.mAvatarEyeballProgram;
194 glEnableClientState(GL_NORMAL_ARRAY);
195 glEnableClientState(GL_TEXTURE_COORD_ARRAY);
196
197 if (sShaderLevel > 0)
198 { //eyeballs render with the specular shader
199 gPipeline.mAvatarEyeballProgram.bind();
200 gPipeline.mMaterialIndex = gPipeline.mAvatarEyeballProgram.mAttribute[LLPipeline::GLSL_MATERIAL_COLOR];
201 gPipeline.mSpecularIndex = gPipeline.mAvatarEyeballProgram.mAttribute[LLPipeline::GLSL_SPECULAR_COLOR];
202 }
203}
204
205void LLDrawPoolAvatar::endRigid()
206{
207 glDisableClientState(GL_NORMAL_ARRAY);
208 glDisableClientState(GL_TEXTURE_COORD_ARRAY);
209}
210
211void LLDrawPoolAvatar::beginSkinned()
212{
213 glEnableClientState(GL_NORMAL_ARRAY);
214 glEnableClientState(GL_TEXTURE_COORD_ARRAY);
215
216 sVertexProgram = &gPipeline.mAvatarProgram;
217
218 if (sShaderLevel > 0) // for hardware blending
219 {
220 sRenderingSkinned = TRUE;
221 glClientActiveTextureARB(GL_TEXTURE1_ARB);
222 if (sShaderLevel >= SHADER_LEVEL_BUMP)
223 {
224 gPipeline.mMaterialIndex = sVertexProgram->mAttribute[LLPipeline::GLSL_MATERIAL_COLOR];
225 gPipeline.mSpecularIndex = sVertexProgram->mAttribute[LLPipeline::GLSL_SPECULAR_COLOR];
226 }
227 sVertexProgram->bind();
228 if (sShaderLevel >= SHADER_LEVEL_CLOTH)
229 {
230 enable_cloth_weights(sVertexProgram->mAttribute[LLPipeline::GLSL_AVATAR_CLOTHING]);
231 }
232 enable_vertex_weighting(sVertexProgram->mAttribute[LLPipeline::GLSL_AVATAR_WEIGHT]);
233
234 if (sShaderLevel >= SHADER_LEVEL_BUMP)
235 {
236 enable_binormals(sVertexProgram->mAttribute[LLPipeline::GLSL_BINORMAL]);
237 }
238
239 sVertexProgram->enableTexture(LLPipeline::GLSL_BUMP_MAP);
240 glActiveTextureARB(GL_TEXTURE0_ARB);
241 }
163} 242}
164 243
165void LLDrawPoolAvatar::renderAvatars(LLVOAvatar* single_avatar, BOOL no_shaders) 244void LLDrawPoolAvatar::endSkinned()
166{ 245{
167 if (no_shaders) 246 // if we're in software-blending, remember to set the fence _after_ we draw so we wait till this rendering is done
247 if (sShaderLevel > 0)
168 { 248 {
169 mVertexShaderLevel = 0; 249 sRenderingSkinned = FALSE;
250 sVertexProgram->disableTexture(LLPipeline::GLSL_BUMP_MAP);
251 glActiveTextureARB(GL_TEXTURE0_ARB);
252 glClientActiveTextureARB(GL_TEXTURE0_ARB);
253 disable_vertex_weighting(sVertexProgram->mAttribute[LLPipeline::GLSL_AVATAR_WEIGHT]);
254 if (sShaderLevel >= SHADER_LEVEL_BUMP)
255 {
256 disable_binormals(sVertexProgram->mAttribute[LLPipeline::GLSL_BINORMAL]);
257 }
258 if ((sShaderLevel >= SHADER_LEVEL_CLOTH))
259 {
260 disable_cloth_weights(sVertexProgram->mAttribute[LLPipeline::GLSL_AVATAR_CLOTHING]);
261 }
262
263 sVertexProgram->unbind();
264 }
265
266 glActiveTextureARB(GL_TEXTURE0_ARB);
267 glClientActiveTextureARB(GL_TEXTURE0_ARB);
268
269 glDisableClientState(GL_NORMAL_ARRAY);
270 glDisableClientState(GL_TEXTURE_COORD_ARRAY);
271}
272
273
274void LLDrawPoolAvatar::renderAvatars(LLVOAvatar* single_avatar, S32 pass)
275{
276 if (pass == -1)
277 {
278 for (S32 i = 1; i < getNumPasses(); i++)
279 { //skip foot shadows
280 prerender();
281 beginRenderPass(i);
282 renderAvatars(single_avatar, i);
283 endRenderPass(i);
284 }
285
286 return;
170 } 287 }
171 288
172 if (!gRenderAvatar) 289 if (!gRenderAvatar)
@@ -195,13 +312,95 @@ void LLDrawPoolAvatar::renderAvatars(LLVOAvatar* single_avatar, BOOL no_shaders)
195 avatarp = (LLVOAvatar *)(facep->getDrawable()->getVObj()); 312 avatarp = (LLVOAvatar *)(facep->getDrawable()->getVObj());
196 } 313 }
197 314
198 if (avatarp->isDead() || avatarp->mDrawable.isNull()) 315 if (avatarp->isDead() || avatarp->mDrawable.isNull())
199 { 316 {
200 return; 317 return;
201 } 318 }
202 319
203 LLOverrideFaceColor color(this, 1.0f, 1.0f, 1.0f, 1.0f); 320 LLOverrideFaceColor color(this, 1.0f, 1.0f, 1.0f, 1.0f);
204 321
322 if (pass == 0)
323 {
324 if (gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_FOOT_SHADOWS))
325 {
326 mIndicesDrawn += avatarp->renderFootShadows();
327 }
328 return;
329 }
330
331 if (avatarp->mSpecialRenderMode == 0) // normal
332 {
333 gPipeline.enableLightsAvatar(avatarp->mDrawable->getSunShadowFactor());
334 }
335 else if (avatarp->mSpecialRenderMode == 1) // anim preview
336 {
337 gPipeline.enableLightsAvatarEdit(LLColor4(0.7f, 0.6f, 0.3f, 1.f));
338 }
339 else // 2=image preview, 3=morph view
340 {
341 gPipeline.enableLightsAvatarEdit(LLColor4(.5f, .5f, .5f, 1.f));
342 }
343
344 if (pass == 1)
345 {
346 // render rigid meshes (eyeballs) first
347 mIndicesDrawn += avatarp->renderRigid();
348
349 if (!gRenderForSelect && avatarp->mIsSelf && LLVOAvatar::sAvatarLoadTest)
350 {
351 LLVector3 orig_pos_root = avatarp->mRoot.getPosition();
352 LLVector3 next_pos_root = orig_pos_root;
353 for (S32 i = 0; i < NUM_TEST_AVATARS; i++)
354 {
355 next_pos_root.mV[VX] += 1.f;
356 if (i % 5 == 0)
357 {
358 next_pos_root.mV[VY] += 1.f;
359 next_pos_root.mV[VX] = orig_pos_root.mV[VX];
360 }
361
362 avatarp->mRoot.setPosition(next_pos_root); // avatar load test
363 avatarp->mRoot.updateWorldMatrixChildren(); // avatar load test
364
365 mIndicesDrawn += avatarp->renderRigid();
366 }
367 avatarp->mRoot.setPosition(orig_pos_root); // avatar load test
368 avatarp->mRoot.updateWorldMatrixChildren(); // avatar load test
369 }
370 return;
371 }
372
373
374 if (sShaderLevel > 0)
375 {
376 gPipeline.mAvatarMatrixParam = sVertexProgram->mUniform[LLPipeline::GLSL_AVATAR_MATRIX];
377 }
378
379 if ((sShaderLevel >= SHADER_LEVEL_CLOTH))
380 {
381 LLMatrix4 rot_mat;
382 gCamera->getMatrixToLocal(rot_mat);
383 LLMatrix4 cfr(OGL_TO_CFR_ROTATION);
384 rot_mat *= cfr;
385
386 LLVector4 wind;
387 wind.setVec(avatarp->mWindVec);
388 wind.mV[VW] = 0;
389 wind = wind * rot_mat;
390 wind.mV[VW] = avatarp->mWindVec.mV[VW];
391
392 sVertexProgram->vertexAttrib4fv(LLPipeline::GLSL_AVATAR_WIND, wind.mV);
393 F32 phase = -1.f * (avatarp->mRipplePhase);
394
395 F32 freq = 7.f + (noise1(avatarp->mRipplePhase) * 2.f);
396 LLVector4 sin_params(freq, freq, freq, phase);
397 sVertexProgram->vertexAttrib4fv(LLPipeline::GLSL_AVATAR_SINWAVE, sin_params.mV);
398
399 LLVector4 gravity(0.f, 0.f, -CLOTHING_GRAVITY_EFFECT, 0.f);
400 gravity = gravity * rot_mat;
401 sVertexProgram->vertexAttrib4fv(LLPipeline::GLSL_AVATAR_GRAVITY, gravity.mV);
402 }
403
205 if( !single_avatar || (avatarp == single_avatar) ) 404 if( !single_avatar || (avatarp == single_avatar) )
206 { 405 {
207 if (LLVOAvatar::sShowCollisionVolumes) 406 if (LLVOAvatar::sShowCollisionVolumes)
@@ -210,8 +409,6 @@ void LLDrawPoolAvatar::renderAvatars(LLVOAvatar* single_avatar, BOOL no_shaders)
210 avatarp->renderCollisionVolumes(); 409 avatarp->renderCollisionVolumes();
211 } 410 }
212 411
213 LLGLEnable normalize(GL_NORMALIZE);
214
215 if (avatarp->mIsSelf && LLAgent::sDebugDisplayTarget) 412 if (avatarp->mIsSelf && LLAgent::sDebugDisplayTarget)
216 { 413 {
217 LLGLSNoTexture gls_no_texture; 414 LLGLSNoTexture gls_no_texture;
@@ -267,171 +464,8 @@ void LLDrawPoolAvatar::renderAvatars(LLVOAvatar* single_avatar, BOOL no_shaders)
267 color.setColor(1.0f, 1.0f, 1.0f, 1.0f); 464 color.setColor(1.0f, 1.0f, 1.0f, 1.0f);
268 } 465 }
269 466
270 glEnableClientState(GL_VERTEX_ARRAY);
271 glEnableClientState(GL_NORMAL_ARRAY);
272 glEnableClientState(GL_TEXTURE_COORD_ARRAY);
273
274 LLGLSLShader* vertex_program = &gPipeline.mAvatarProgram;
275 if (mVertexShaderLevel > 0)
276 {
277 gPipeline.mAvatarMatrixParam = vertex_program->mUniform[LLPipeline::GLSL_AVATAR_MATRIX];
278 }
279
280 //--------------------------------------------------------------------------------
281 // this is where we first hit the software blending path
282 // if enabled, we need to set up the proper buffers and avoid setting other state
283 //--------------------------------------------------------------------------------
284 if (!(mVertexShaderLevel > 0))
285 {
286
287 // performance could be increased by better utilizing the buffers, for example, only using 1k buffers for lo-res
288 // avatars. But the only problem with using fewer buffers is that we're more likely to wait for a fence to complete
289
290 // vertex format:
291 // vertices 12
292 // texcoords 8
293 // normals 12
294 // binormals 12
295 // padding 4
296 // total 48
297
298 // Rotate to the next buffer, round-robin.
299 gPipeline.bufferRotate();
300
301 // Wait until the hardware is done reading the last set of vertices from the buffer before writing the next set.
302 gPipeline.bufferWaitFence();
303
304 // Need to do this because we may be rendering without AGP even in AGP mode
305 U8* buffer_offset_start = gPipeline.bufferGetScratchMemory();
306 glVertexPointer( 3, GL_FLOAT, AVATAR_VERTEX_BYTES, buffer_offset_start + AVATAR_OFFSET_POS);
307 glTexCoordPointer(2, GL_FLOAT, AVATAR_VERTEX_BYTES, buffer_offset_start + AVATAR_OFFSET_TEX0);
308 glNormalPointer( GL_FLOAT, AVATAR_VERTEX_BYTES, buffer_offset_start + AVATAR_OFFSET_NORMAL);
309
310 }
311
312 if ((mVertexShaderLevel > 0)) // for hardware blending
313 {
314 bindGLVertexPointer();
315 bindGLNormalPointer();
316 bindGLTexCoordPointer(0);
317 }
318
319 if ((mVertexShaderLevel > 0))
320 { //eyeballs render with the specular shader
321 gPipeline.mAvatarEyeballProgram.bind();
322 gPipeline.mMaterialIndex = gPipeline.mAvatarEyeballProgram.mAttribute[LLPipeline::GLSL_MATERIAL_COLOR];
323 gPipeline.mSpecularIndex = gPipeline.mAvatarEyeballProgram.mAttribute[LLPipeline::GLSL_SPECULAR_COLOR];
324
325 S32 index = gPipeline.mAvatarEyeballProgram.enableTexture(LLPipeline::GLSL_SCATTER_MAP);
326 gSky.mVOSkyp->getScatterMap()->bind(index);
327
328 glActiveTextureARB(GL_TEXTURE0_ARB);
329 }
330
331 if (avatarp->mSpecialRenderMode == 0) // normal
332 {
333 gPipeline.enableLightsAvatar(avatarp->mDrawable->getSunShadowFactor());
334 }
335 else if (avatarp->mSpecialRenderMode == 1) // anim preview
336 {
337 gPipeline.enableLightsAvatarEdit(LLColor4(0.7f, 0.6f, 0.3f, 1.f));
338 }
339 else // 2=image preview, 3=morph view
340 {
341 gPipeline.enableLightsAvatarEdit(LLColor4(.5f, .5f, .5f, 1.f));
342 }
343
344 // render rigid meshes (eyeballs) first
345 mIndicesDrawn += avatarp->renderRigid();
346
347 if ((mVertexShaderLevel > 0))
348 {
349 gPipeline.mAvatarEyeballProgram.disableTexture(LLPipeline::GLSL_SCATTER_MAP);
350 glActiveTextureARB(GL_TEXTURE0_ARB);
351 }
352
353 if (!gRenderForSelect && avatarp->mIsSelf && LLVOAvatar::sAvatarLoadTest)
354 {
355 LLVector3 orig_pos_root = avatarp->mRoot.getPosition();
356 LLVector3 next_pos_root = orig_pos_root;
357 for (S32 i = 0; i < NUM_TEST_AVATARS; i++)
358 {
359 next_pos_root.mV[VX] += 1.f;
360 if (i % 5 == 0)
361 {
362 next_pos_root.mV[VY] += 1.f;
363 next_pos_root.mV[VX] = orig_pos_root.mV[VX];
364 }
365
366 avatarp->mRoot.setPosition(next_pos_root); // avatar load test
367 avatarp->mRoot.updateWorldMatrixChildren(); // avatar load test
368
369 mIndicesDrawn += avatarp->renderRigid();
370 }
371 avatarp->mRoot.setPosition(orig_pos_root); // avatar load test
372 avatarp->mRoot.updateWorldMatrixChildren(); // avatar load test
373 }
374
375 if ((mVertexShaderLevel > 0)) // for hardware blending
376 {
377 glClientActiveTextureARB(GL_TEXTURE1_ARB);
378 if ((mVertexShaderLevel >= SHADER_LEVEL_BUMP))
379 {
380 bindGLTexCoordPointer(1);
381
382 bindGLBinormalPointer(vertex_program->mAttribute[LLPipeline::GLSL_BINORMAL]);
383 gPipeline.mMaterialIndex = vertex_program->mAttribute[LLPipeline::GLSL_MATERIAL_COLOR];
384 gPipeline.mSpecularIndex = vertex_program->mAttribute[LLPipeline::GLSL_SPECULAR_COLOR];
385 }
386 glClientActiveTextureARB(GL_TEXTURE0_ARB);
387 bindGLTexCoordPointer(0);
388 vertex_program->bind();
389 bindGLVertexWeightPointer(vertex_program->mAttribute[LLPipeline::GLSL_AVATAR_WEIGHT]);
390 if ((mVertexShaderLevel >= SHADER_LEVEL_CLOTH))
391 {
392 bindGLVertexClothingWeightPointer(vertex_program->mAttribute[LLPipeline::GLSL_AVATAR_CLOTHING]);
393 enable_cloth_weights(vertex_program->mAttribute[LLPipeline::GLSL_AVATAR_CLOTHING]);
394 }
395 enable_vertex_weighting(vertex_program->mAttribute[LLPipeline::GLSL_AVATAR_WEIGHT]);
396
397 if ((mVertexShaderLevel >= SHADER_LEVEL_BUMP))
398 {
399 enable_binormals(vertex_program->mAttribute[LLPipeline::GLSL_BINORMAL]);
400 }
401
402 vertex_program->enableTexture(LLPipeline::GLSL_BUMP_MAP);
403 S32 index = vertex_program->enableTexture(LLPipeline::GLSL_SCATTER_MAP);
404 gSky.mVOSkyp->getScatterMap()->bind(index);
405 glActiveTextureARB(GL_TEXTURE0_ARB);
406 }
407
408 if ((mVertexShaderLevel >= SHADER_LEVEL_CLOTH))
409 {
410 LLMatrix4 rot_mat;
411 gCamera->getMatrixToLocal(rot_mat);
412 LLMatrix4 cfr(OGL_TO_CFR_ROTATION);
413 rot_mat *= cfr;
414
415 LLVector4 wind;
416 wind.setVec(avatarp->mWindVec);
417 wind.mV[VW] = 0;
418 wind = wind * rot_mat;
419 wind.mV[VW] = avatarp->mWindVec.mV[VW];
420
421 vertex_program->vertexAttrib4fv(LLPipeline::GLSL_AVATAR_WIND, wind.mV);
422 F32 phase = -1.f * (avatarp->mRipplePhase);
423
424 F32 freq = 7.f + (noise1(avatarp->mRipplePhase) * 2.f);
425 LLVector4 sin_params(freq, freq, freq, phase);
426 vertex_program->vertexAttrib4fv(LLPipeline::GLSL_AVATAR_SINWAVE, sin_params.mV);
427
428 LLVector4 gravity(0.f, 0.f, -CLOTHING_GRAVITY_EFFECT, 0.f);
429 gravity = gravity * rot_mat;
430 vertex_program->vertexAttrib4fv(LLPipeline::GLSL_AVATAR_GRAVITY, gravity.mV);
431 }
432
433 mIndicesDrawn += avatarp->renderSkinned(AVATAR_RENDER_PASS_SINGLE); 467 mIndicesDrawn += avatarp->renderSkinned(AVATAR_RENDER_PASS_SINGLE);
434 468
435 if (!gRenderForSelect && avatarp->mIsSelf && LLVOAvatar::sAvatarLoadTest) 469 if (!gRenderForSelect && avatarp->mIsSelf && LLVOAvatar::sAvatarLoadTest)
436 { 470 {
437 LLVector3 orig_pos_root = avatarp->mRoot.getPosition(); 471 LLVector3 orig_pos_root = avatarp->mRoot.getPosition();
@@ -453,31 +487,6 @@ void LLDrawPoolAvatar::renderAvatars(LLVOAvatar* single_avatar, BOOL no_shaders)
453 avatarp->mRoot.setPosition(orig_pos_root); // avatar load test 487 avatarp->mRoot.setPosition(orig_pos_root); // avatar load test
454 avatarp->mRoot.updateWorldMatrixChildren(); // avatar load test 488 avatarp->mRoot.updateWorldMatrixChildren(); // avatar load test
455 } 489 }
456
457 // if we're in software-blending, remember to set the fence _after_ we draw so we wait till this rendering is done
458 if (!(mVertexShaderLevel > 0))
459 {
460 // want for the previously bound fence to finish
461 gPipeline.bufferSendFence();
462 }
463 else
464 {
465 vertex_program->disableTexture(LLPipeline::GLSL_BUMP_MAP);
466 vertex_program->disableTexture(LLPipeline::GLSL_SCATTER_MAP);
467 glActiveTextureARB(GL_TEXTURE0_ARB);
468 glClientActiveTextureARB(GL_TEXTURE0_ARB);
469 disable_vertex_weighting(vertex_program->mAttribute[LLPipeline::GLSL_AVATAR_WEIGHT]);
470 if ((mVertexShaderLevel >= SHADER_LEVEL_BUMP))
471 {
472 disable_binormals(vertex_program->mAttribute[LLPipeline::GLSL_BINORMAL]);
473 }
474 if ((mVertexShaderLevel >= SHADER_LEVEL_CLOTH))
475 {
476 disable_cloth_weights(vertex_program->mAttribute[LLPipeline::GLSL_AVATAR_CLOTHING]);
477 }
478
479 vertex_program->unbind();
480 }
481 } 490 }
482} 491}
483 492
@@ -490,14 +499,13 @@ void LLDrawPoolAvatar::renderForSelect()
490 { 499 {
491 return; 500 return;
492 } 501 }
493 //gGLSObjectSelectDepthAlpha.set(); 502
494
495 if (!gRenderAvatar) 503 if (!gRenderAvatar)
496 { 504 {
497 return; 505 return;
498 } 506 }
499 507
500 if (mDrawFace.empty() || !mMemory.count()) 508 if (mDrawFace.empty())
501 { 509 {
502 return; 510 return;
503 } 511 }
@@ -517,80 +525,38 @@ void LLDrawPoolAvatar::renderForSelect()
517 glEnableClientState(GL_VERTEX_ARRAY); 525 glEnableClientState(GL_VERTEX_ARRAY);
518 glEnableClientState(GL_NORMAL_ARRAY); 526 glEnableClientState(GL_NORMAL_ARRAY);
519 glEnableClientState(GL_TEXTURE_COORD_ARRAY); 527 glEnableClientState(GL_TEXTURE_COORD_ARRAY);
520 528 glGetFloatv(GL_MODELVIEW_MATRIX, (F32*) sModelViewMatrix.mMatrix);
521 LLGLSLShader* vertex_program = &gPipeline.mAvatarPickProgram; 529 sVertexProgram = &gPipeline.mAvatarPickProgram;
522 if (mVertexShaderLevel > 0) 530 if (sShaderLevel > 0)
523 { 531 {
524 gPipeline.mAvatarMatrixParam = vertex_program->mUniform[LLPipeline::GLSL_AVATAR_MATRIX]; 532 gPipeline.mAvatarMatrixParam = sVertexProgram->mUniform[LLPipeline::GLSL_AVATAR_MATRIX];
525 } 533 }
526 glAlphaFunc(GL_GEQUAL, 0.2f); 534 glAlphaFunc(GL_GEQUAL, 0.2f);
527 glBlendFunc(GL_ONE, GL_ZERO); 535 glBlendFunc(GL_ONE, GL_ZERO);
528 536
529 //--------------------------------------------------------------------------------
530 // this is where we first hit the software blending path
531 // if enabled, we need to set up the proper buffers and avoid setting other state
532 //--------------------------------------------------------------------------------
533 if (!(mVertexShaderLevel > 0) || gUseGLPick)
534 {
535
536 // Rotate to the next buffer, round-robin.
537 gPipeline.bufferRotate();
538
539 // Wait until the hardware is done reading the last set of vertices from the buffer before writing the next set.
540 gPipeline.bufferWaitFence();
541
542 // Need to do this because we may be rendering without AGP even in AGP mode
543 U8* buffer_offset_start = gPipeline.bufferGetScratchMemory();
544 glVertexPointer( 3, GL_FLOAT, AVATAR_VERTEX_BYTES, buffer_offset_start + AVATAR_OFFSET_POS);
545 glTexCoordPointer(2, GL_FLOAT, AVATAR_VERTEX_BYTES, buffer_offset_start + AVATAR_OFFSET_TEX0);
546 glNormalPointer( GL_FLOAT, AVATAR_VERTEX_BYTES, buffer_offset_start + AVATAR_OFFSET_NORMAL);
547 }
548
549 S32 name = avatarp->mDrawable->getVObj()->mGLName; 537 S32 name = avatarp->mDrawable->getVObj()->mGLName;
550 LLColor4U color((U8)(name >> 16), (U8)(name >> 8), (U8)name); 538 LLColor4U color((U8)(name >> 16), (U8)(name >> 8), (U8)name);
551 glColor4ubv(color.mV); 539 glColor4ubv(color.mV);
552 540
553 if ((mVertexShaderLevel > 0) && !gUseGLPick) // for hardware blending
554 {
555 bindGLVertexPointer();
556 bindGLNormalPointer();
557 bindGLTexCoordPointer(0);
558 }
559
560 // render rigid meshes (eyeballs) first 541 // render rigid meshes (eyeballs) first
561 mIndicesDrawn += avatarp->renderRigid(); 542 //mIndicesDrawn += avatarp->renderRigid();
562 543
563 if ((mVertexShaderLevel > 0) && !gUseGLPick) // for hardware blending 544 if ((sShaderLevel > 0) && !gUseGLPick) // for hardware blending
564 { 545 {
565 glClientActiveTextureARB(GL_TEXTURE0_ARB); 546 glClientActiveTextureARB(GL_TEXTURE0_ARB);
566 bindGLTexCoordPointer(0); 547 sRenderingSkinned = TRUE;
567 vertex_program->bind(); 548 sVertexProgram->bind();
568 bindGLVertexWeightPointer(vertex_program->mAttribute[LLPipeline::GLSL_AVATAR_WEIGHT]); 549 enable_vertex_weighting(sVertexProgram->mAttribute[LLPipeline::GLSL_AVATAR_WEIGHT]);
569 /*if ((mVertexShaderLevel >= SHADER_LEVEL_CLOTH))
570 {
571 bindGLVertexClothingWeightPointer();
572 enable_cloth_weights();
573 }*/
574 enable_vertex_weighting(vertex_program->mAttribute[LLPipeline::GLSL_AVATAR_WEIGHT]);
575 } 550 }
576 551
577 mIndicesDrawn += avatarp->renderSkinned(AVATAR_RENDER_PASS_SINGLE); 552 mIndicesDrawn += avatarp->renderSkinned(AVATAR_RENDER_PASS_SINGLE);
578 553
579 // if we're in software-blending, remember to set the fence _after_ we draw so we wait till this rendering is done 554 // if we're in software-blending, remember to set the fence _after_ we draw so we wait till this rendering is done
580 if (!(mVertexShaderLevel > 0) || gUseGLPick) 555 if ((sShaderLevel > 0) && !gUseGLPick)
581 { 556 {
582 // want for the previously bound fence to finish 557 sRenderingSkinned = FALSE;
583 gPipeline.bufferSendFence(); 558 sVertexProgram->unbind();
584 } 559 disable_vertex_weighting(sVertexProgram->mAttribute[LLPipeline::GLSL_AVATAR_WEIGHT]);
585 else
586 {
587 vertex_program->unbind();
588 disable_vertex_weighting(vertex_program->mAttribute[LLPipeline::GLSL_AVATAR_WEIGHT]);
589
590 /*if ((mVertexShaderLevel >= SHADER_LEVEL_CLOTH))
591 {
592 disable_cloth_weights();
593 }*/
594 } 560 }
595 561
596 glAlphaFunc(GL_GREATER, 0.01f); 562 glAlphaFunc(GL_GREATER, 0.01f);
@@ -627,3 +593,46 @@ LLColor3 LLDrawPoolAvatar::getDebugColor() const
627{ 593{
628 return LLColor3(0.f, 1.f, 0.f); 594 return LLColor3(0.f, 1.f, 0.f);
629} 595}
596
597LLVertexBufferAvatar::LLVertexBufferAvatar()
598: LLVertexBuffer(sDataMask,
599 gPipeline.getVertexShaderLevel(LLPipeline::SHADER_AVATAR) > 0 ?
600 GL_STATIC_DRAW_ARB :
601 GL_STREAM_DRAW_ARB)
602{
603
604}
605
606
607void LLVertexBufferAvatar::setupVertexBuffer(U32 data_mask) const
608{
609 if (sRenderingSkinned)
610 {
611 U8* base = useVBOs() ? NULL : mMappedData;
612
613 glVertexPointer(3,GL_FLOAT, mStride, (void*)(base + 0));
614 glNormalPointer(GL_FLOAT, mStride, (void*)(base + mOffsets[TYPE_NORMAL]));
615
616 glClientActiveTextureARB(GL_TEXTURE1_ARB);
617 glTexCoordPointer(2,GL_FLOAT, mStride, (void*)(base + mOffsets[TYPE_TEXCOORD2]));
618 glClientActiveTextureARB(GL_TEXTURE0_ARB);
619 glTexCoordPointer(2,GL_FLOAT, mStride, (void*)(base + mOffsets[TYPE_TEXCOORD]));
620
621 set_vertex_weights(sVertexProgram->mAttribute[LLPipeline::GLSL_AVATAR_WEIGHT], mStride, (F32*)(base + mOffsets[TYPE_WEIGHT]));
622
623 if (sShaderLevel >= LLDrawPoolAvatar::SHADER_LEVEL_BUMP)
624 {
625 set_binormals(sVertexProgram->mAttribute[LLPipeline::GLSL_BINORMAL], mStride, (LLVector3*)(base + mOffsets[TYPE_BINORMAL]));
626 }
627
628 if (sShaderLevel >= LLDrawPoolAvatar::SHADER_LEVEL_CLOTH)
629 {
630 set_vertex_clothing_weights(sVertexProgram->mAttribute[LLPipeline::GLSL_AVATAR_CLOTHING], mStride, (LLVector4*)(base + mOffsets[TYPE_CLOTHWEIGHT]));
631 }
632 }
633 else
634 {
635 LLVertexBuffer::setupVertexBuffer(data_mask);
636 }
637}
638
diff --git a/linden/indra/newview/lldrawpoolavatar.h b/linden/indra/newview/lldrawpoolavatar.h
index 52a7fe4..32c02b5 100644
--- a/linden/indra/newview/lldrawpoolavatar.h
+++ b/linden/indra/newview/lldrawpoolavatar.h
@@ -32,7 +32,7 @@
32 32
33class LLVOAvatar; 33class LLVOAvatar;
34 34
35class LLDrawPoolAvatar : public LLDrawPool 35class LLDrawPoolAvatar : public LLFacePool
36{ 36{
37protected: 37protected:
38 S32 mNumFaces; 38 S32 mNumFaces;
@@ -43,21 +43,48 @@ public:
43 SHADER_LEVEL_CLOTH = 3 43 SHADER_LEVEL_CLOTH = 3
44 }; 44 };
45 45
46 enum
47 {
48 VERTEX_DATA_MASK = LLVertexBuffer::MAP_VERTEX |
49 LLVertexBuffer::MAP_NORMAL |
50 LLVertexBuffer::MAP_TEXCOORD |
51 LLVertexBuffer::MAP_WEIGHT |
52 LLVertexBuffer::MAP_CLOTHWEIGHT |
53 LLVertexBuffer::MAP_BINORMAL
54
55 };
56
57 virtual U32 getVertexDataMask() { return VERTEX_DATA_MASK; }
58
59 virtual S32 getVertexShaderLevel() const;
60
46 LLDrawPoolAvatar(); 61 LLDrawPoolAvatar();
47 62
63 static LLMatrix4& getModelView();
64
48 /*virtual*/ LLDrawPool *instancePool(); 65 /*virtual*/ LLDrawPool *instancePool();
49 66
67 /*virtual*/ S32 getNumPasses();
68 /*virtual*/ void beginRenderPass(S32 pass);
69 /*virtual*/ void endRenderPass(S32 pass);
50 /*virtual*/ void prerender(); 70 /*virtual*/ void prerender();
51 /*virtual*/ void render(S32 pass = 0); 71 /*virtual*/ void render(S32 pass = 0);
52 /*virtual*/ void renderForSelect(); 72 /*virtual*/ void renderForSelect();
53 /*virtual*/ S32 rebuild();
54 73
74 void beginRigid();
75 void beginFootShadow();
76 void beginSkinned();
77
78 void endRigid();
79 void endFootShadow();
80 void endSkinned();
81
55 /*virtual*/ LLViewerImage *getDebugTexture(); 82 /*virtual*/ LLViewerImage *getDebugTexture();
56 /*virtual*/ LLColor3 getDebugColor() const; // For AGP debug display 83 /*virtual*/ LLColor3 getDebugColor() const; // For AGP debug display
57 84
58 virtual S32 getMaterialAttribIndex() { return 0; } 85 virtual S32 getMaterialAttribIndex() { return 0; }
59 86
60 void renderAvatars(LLVOAvatar *single_avatar, BOOL no_shaders = FALSE); // renders only one avatar if single_avatar is not null. 87 void renderAvatars(LLVOAvatar *single_avatar, S32 pass = -1); // renders only one avatar if single_avatar is not null.
61}; 88};
62 89
63 90
diff --git a/linden/indra/newview/lldrawpoolbump.cpp b/linden/indra/newview/lldrawpoolbump.cpp
index befcc70..916454c 100644
--- a/linden/indra/newview/lldrawpoolbump.cpp
+++ b/linden/indra/newview/lldrawpoolbump.cpp
@@ -37,12 +37,10 @@
37#include "m4math.h" 37#include "m4math.h"
38 38
39#include "llagent.h" 39#include "llagent.h"
40#include "llagparray.h"
41#include "llcubemap.h" 40#include "llcubemap.h"
42#include "lldrawable.h" 41#include "lldrawable.h"
43#include "lldrawpoolsimple.h" 42#include "lldrawpoolsimple.h"
44#include "llface.h" 43#include "llface.h"
45#include "llgl.h"
46#include "llsky.h" 44#include "llsky.h"
47#include "lltextureentry.h" 45#include "lltextureentry.h"
48#include "llviewercamera.h" 46#include "llviewercamera.h"
@@ -64,9 +62,11 @@ LLBumpImageList gBumpImageList;
64 62
65const S32 STD_BUMP_LATEST_FILE_VERSION = 1; 63const S32 STD_BUMP_LATEST_FILE_VERSION = 1;
66 64
67S32 LLDrawPoolBump::sBumpTex = -1; 65const U32 VERTEX_MASK_SHINY = LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_NORMAL | LLVertexBuffer::MAP_COLOR;
68S32 LLDrawPoolBump::sDiffTex = -1; 66const U32 VERTEX_MASK_BUMP = LLVertexBuffer::MAP_VERTEX |LLVertexBuffer::MAP_TEXCOORD | LLVertexBuffer::MAP_TEXCOORD2;
69S32 LLDrawPoolBump::sEnvTex = -1; 67
68U32 LLDrawPoolBump::sVertexMask = VERTEX_MASK_SHINY;
69static LLCubeMap* sCubeMap = NULL;
70 70
71// static 71// static
72void LLStandardBumpmap::init() 72void LLStandardBumpmap::init()
@@ -89,7 +89,7 @@ void LLStandardBumpmap::restoreGL()
89 gStandardBumpmapList[LLStandardBumpmap::sStandardBumpmapCount++] = LLStandardBumpmap("Darkness"); // BE_DARKNESS 89 gStandardBumpmapList[LLStandardBumpmap::sStandardBumpmapCount++] = LLStandardBumpmap("Darkness"); // BE_DARKNESS
90 90
91 std::string file_name = gDirUtilp->getExpandedFilename( LL_PATH_APP_SETTINGS, "std_bump.ini" ); 91 std::string file_name = gDirUtilp->getExpandedFilename( LL_PATH_APP_SETTINGS, "std_bump.ini" );
92 FILE* file = LLFile::fopen( file_name.c_str(), "rt" ); 92 FILE* file = LLFile::fopen( file_name.c_str(), "rt" ); /*Flawfinder: ignore*/
93 if( !file ) 93 if( !file )
94 { 94 {
95 llwarns << "Could not open std_bump <" << file_name << ">" << llendl; 95 llwarns << "Could not open std_bump <" << file_name << ">" << llendl;
@@ -114,9 +114,10 @@ void LLStandardBumpmap::restoreGL()
114 while( !feof(file) && (LLStandardBumpmap::sStandardBumpmapCount < (U32)TEM_BUMPMAP_COUNT) ) 114 while( !feof(file) && (LLStandardBumpmap::sStandardBumpmapCount < (U32)TEM_BUMPMAP_COUNT) )
115 { 115 {
116 // *NOTE: This buffer size is hard coded into scanf() below. 116 // *NOTE: This buffer size is hard coded into scanf() below.
117 char label[2048] = ""; 117 char label[2048] = ""; /* Flawfinder: ignore */
118 char bump_file[2048] = ""; 118 char bump_file[2048] = ""; /* Flawfinder: ignore */
119 fields_read = fscanf( file, "\n%2047s %2047s", label, bump_file); 119 fields_read = fscanf( /* Flawfinder: ignore */
120 file, "\n%2047s %2047s", label, bump_file);
120 if( EOF == fields_read ) 121 if( EOF == fields_read )
121 { 122 {
122 break; 123 break;
@@ -127,7 +128,7 @@ void LLStandardBumpmap::restoreGL()
127 return; 128 return;
128 } 129 }
129 130
130 llinfos << "Loading bumpmap: " << bump_file << " from viewerart" << llendl; 131// llinfos << "Loading bumpmap: " << bump_file << " from viewerart" << llendl;
131 gStandardBumpmapList[LLStandardBumpmap::sStandardBumpmapCount].mLabel = label; 132 gStandardBumpmapList[LLStandardBumpmap::sStandardBumpmapCount].mLabel = label;
132 gStandardBumpmapList[LLStandardBumpmap::sStandardBumpmapCount].mImage = gImageList.getImage( LLUUID(gViewerArt.getString(bump_file)) ); 133 gStandardBumpmapList[LLStandardBumpmap::sStandardBumpmapCount].mImage = gImageList.getImage( LLUUID(gViewerArt.getString(bump_file)) );
133 LLStandardBumpmap::sStandardBumpmapCount++; 134 LLStandardBumpmap::sStandardBumpmapCount++;
@@ -151,15 +152,9 @@ void LLStandardBumpmap::destroyGL()
151 152
152//////////////////////////////////////////////////////////////// 153////////////////////////////////////////////////////////////////
153 154
154LLDrawPoolBump::LLDrawPoolBump(LLViewerImage *texturep) : 155LLDrawPoolBump::LLDrawPoolBump()
155 LLDrawPool(POOL_BUMP, DATA_BUMP_IL_MASK | DATA_COLORS_MASK, DATA_SIMPLE_NIL_MASK), 156: LLRenderPass(LLDrawPool::POOL_BUMP)
156 mTexturep(texturep)
157{
158}
159
160LLDrawPool *LLDrawPoolBump::instancePool()
161{ 157{
162 return new LLDrawPoolBump(mTexturep);
163} 158}
164 159
165 160
@@ -168,51 +163,16 @@ void LLDrawPoolBump::prerender()
168 mVertexShaderLevel = gPipeline.getVertexShaderLevel(LLPipeline::SHADER_OBJECT); 163 mVertexShaderLevel = gPipeline.getVertexShaderLevel(LLPipeline::SHADER_OBJECT);
169} 164}
170 165
171BOOL LLDrawPoolBump::match(LLFace* last_face, LLFace* facep)
172{
173 if (gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_CHAIN_FACES) &&
174 !last_face->isState(LLFace::LIGHT | LLFace::FULLBRIGHT) &&
175 !facep->isState(LLFace::LIGHT | LLFace::FULLBRIGHT) &&
176 facep->getIndicesStart() == last_face->getIndicesStart()+last_face->getIndicesCount() &&
177 facep->getRenderColor() == last_face->getRenderColor() &&
178 facep->getTextureEntry()->getShiny() == last_face->getTextureEntry()->getShiny() &&
179 facep->getTextureEntry()->getBumpmap() == last_face->getTextureEntry()->getBumpmap())
180 {
181 if (facep->isState(LLFace::GLOBAL))
182 {
183 if (last_face->isState(LLFace::GLOBAL))
184 {
185 return TRUE;
186 }
187 }
188 else
189 {
190 if (!last_face->isState(LLFace::GLOBAL))
191 {
192 if (last_face->getRenderMatrix() == facep->getRenderMatrix())
193 {
194 return TRUE;
195 }
196 }
197 }
198 }
199
200 return FALSE;
201}
202
203// static 166// static
204S32 LLDrawPoolBump::numBumpPasses() 167S32 LLDrawPoolBump::numBumpPasses()
205{ 168{
206 if (gPipeline.getVertexShaderLevel(LLPipeline::SHADER_OBJECT) > 0) 169 if (gSavedSettings.getBOOL("RenderObjectBump"))
207 { 170 {
208 return 1; // single pass for shaders 171 return 2;
209 } 172 }
210 else 173 else
211 { 174 {
212 if (gSavedSettings.getBOOL("RenderObjectBump")) 175 return 0;
213 return 3;
214 else
215 return 1;
216 } 176 }
217} 177}
218 178
@@ -226,13 +186,10 @@ void LLDrawPoolBump::beginRenderPass(S32 pass)
226 switch( pass ) 186 switch( pass )
227 { 187 {
228 case 0: 188 case 0:
229 beginPass0(this); 189 beginShiny();
230 break; 190 break;
231 case 1: 191 case 1:
232 beginPass1(); 192 beginBump();
233 break;
234 case 2:
235 beginPass2();
236 break; 193 break;
237 default: 194 default:
238 llassert(0); 195 llassert(0);
@@ -243,66 +200,17 @@ void LLDrawPoolBump::beginRenderPass(S32 pass)
243void LLDrawPoolBump::render(S32 pass) 200void LLDrawPoolBump::render(S32 pass)
244{ 201{
245 LLFastTimer t(LLFastTimer::FTM_RENDER_BUMP); 202 LLFastTimer t(LLFastTimer::FTM_RENDER_BUMP);
246 if (!mTexturep)
247 {
248 return;
249 }
250
251 if (mDrawFace.empty())
252 {
253 return;
254 }
255
256 const U32* index_array = getRawIndices();
257 203
258 S32 indices = 0;
259 switch( pass ) 204 switch( pass )
260 { 205 {
261 case 0: 206 case 0:
262 { 207 {
263 stop_glerror(); 208 renderShiny();
264
265 bindGLVertexPointer();
266 bindGLTexCoordPointer();
267 bindGLNormalPointer();
268 if (gPipeline.getLightingDetail() >= 2)
269 {
270 bindGLColorPointer();
271 }
272
273 stop_glerror();
274
275 LLGLState alpha_test(GL_ALPHA_TEST, FALSE);
276 LLGLState blend(GL_BLEND, FALSE);
277 LLViewerImage* tex = getTexture();
278 if (tex && tex->getPrimaryFormat() == GL_ALPHA)
279 {
280 // Enable Invisibility Hack
281 alpha_test.enable();
282 blend.enable();
283 }
284 indices += renderPass0(this, mDrawFace, index_array, mTexturep);
285 break; 209 break;
286 } 210 }
287 case 1: 211 case 1:
288 { 212 {
289 bindGLVertexPointer(); 213 renderBump();
290 bindGLNormalPointer();
291 indices += renderPass1(mDrawFace, index_array, mTexturep);
292 break;
293 }
294 case 2:
295 {
296 bindGLVertexPointer();
297 // Texture unit 0
298 glActiveTextureARB(GL_TEXTURE0_ARB);
299 glClientActiveTextureARB(GL_TEXTURE0_ARB);
300 bindGLTexCoordPointer();
301 // Texture unit 1
302 glActiveTextureARB(GL_TEXTURE1_ARB);
303 glClientActiveTextureARB(GL_TEXTURE1_ARB);
304 bindGLTexCoordPointer(1);
305 indices += renderPass2(mDrawFace, index_array, mTexturep);
306 break; 214 break;
307 } 215 }
308 default: 216 default:
@@ -311,7 +219,6 @@ void LLDrawPoolBump::render(S32 pass)
311 break; 219 break;
312 } 220 }
313 } 221 }
314 mIndicesDrawn += indices;
315} 222}
316 223
317void LLDrawPoolBump::endRenderPass(S32 pass) 224void LLDrawPoolBump::endRenderPass(S32 pass)
@@ -319,13 +226,10 @@ void LLDrawPoolBump::endRenderPass(S32 pass)
319 switch( pass ) 226 switch( pass )
320 { 227 {
321 case 0: 228 case 0:
322 endPass0(this); 229 endShiny();
323 break; 230 break;
324 case 1: 231 case 1:
325 endPass1(); 232 endBump();
326 break;
327 case 2:
328 endPass2();
329 break; 233 break;
330 default: 234 default:
331 llassert(0); 235 llassert(0);
@@ -334,252 +238,171 @@ void LLDrawPoolBump::endRenderPass(S32 pass)
334} 238}
335 239
336//static 240//static
337void LLDrawPoolBump::beginPass0(LLDrawPool* pool) 241void LLDrawPoolBump::beginShiny()
338{ 242{
339 stop_glerror(); 243 sVertexMask = VERTEX_MASK_SHINY;
340 glEnableClientState(GL_TEXTURE_COORD_ARRAY); 244 // Second pass: environment map
341 glEnableClientState(GL_VERTEX_ARRAY); 245 glEnableClientState(GL_VERTEX_ARRAY);
342 glEnableClientState(GL_NORMAL_ARRAY); 246 glEnableClientState(GL_NORMAL_ARRAY);
343 if (gPipeline.getLightingDetail() >= 2) 247 glEnableClientState(GL_COLOR_ARRAY);
344 {
345 glEnableClientState(GL_COLOR_ARRAY);
346 }
347 248
348 if (pool->getVertexShaderLevel() > 0) 249 LLCubeMap* cube_map = gSky.mVOSkyp->getCubeMap();
250 if( cube_map )
349 { 251 {
350 enable_binormals(gPipeline.mObjectBumpProgram.mAttribute[LLPipeline::GLSL_BINORMAL]); 252 cube_map->enable(0);
253 cube_map->setMatrix(0);
254 cube_map->bind();
351 255
352 sEnvTex = gPipeline.mObjectBumpProgram.enableTexture(LLPipeline::GLSL_ENVIRONMENT_MAP, GL_TEXTURE_CUBE_MAP_ARB); 256 if (gPipeline.getVertexShaderLevel(LLPipeline::SHADER_OBJECT) > 0)
353 LLCubeMap* cube_map = gSky.mVOSkyp->getCubeMap();
354 if (sEnvTex >= 0 && cube_map)
355 { 257 {
356 cube_map->bind(); 258 LLMatrix4 mat;
357 cube_map->setMatrix(1); 259 glGetFloatv(GL_MODELVIEW_MATRIX, (F32*) mat.mMatrix);
260 gPipeline.mObjectShinyProgram.bind();
261 LLVector3 vec = LLVector3(gPipeline.mShinyOrigin) * mat;
262 LLVector4 vec4(vec, gPipeline.mShinyOrigin.mV[3]);
263 glUniform4fvARB(gPipeline.mObjectShinyProgram.mUniform[LLPipeline::GLSL_SHINY_ORIGIN], 1,
264 vec4.mV);
265 }
266 else
267 {
268 glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_ARB);
269
270 //use RGB from texture
271 glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_RGB_ARB, GL_REPLACE);
272 glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_RGB_ARB, GL_TEXTURE);
273 glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_RGB_ARB, GL_SRC_COLOR);
274
275 // use alpha from color
276 glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_ALPHA_ARB, GL_REPLACE);
277 glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_ALPHA_ARB, GL_PRIMARY_COLOR);
278 glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_ALPHA_ARB, GL_SRC_ALPHA);
358 } 279 }
359
360 sBumpTex = gPipeline.mObjectBumpProgram.enableTexture(LLPipeline::GLSL_BUMP_MAP);
361 sDiffTex = gPipeline.mObjectBumpProgram.enableTexture(LLPipeline::GLSL_DIFFUSE_MAP);
362 S32 scatterTex = gPipeline.mObjectBumpProgram.enableTexture(LLPipeline::GLSL_SCATTER_MAP);
363 LLViewerImage::bindTexture(gSky.mVOSkyp->getScatterMap(), scatterTex);
364 } 280 }
365 stop_glerror();
366} 281}
367 282
368//static 283void LLDrawPoolBump::renderShiny()
369S32 LLDrawPoolBump::renderPass0(LLDrawPool* pool, face_array_t& face_list, const U32* index_array, LLViewerImage* tex)
370{ 284{
371 if (!tex) 285 LLFastTimer t(LLFastTimer::FTM_RENDER_SHINY);
372 {
373 return 0;
374 }
375 286
376 if (face_list.empty()) 287 sCubeMap = NULL;
288
289 if( gSky.mVOSkyp->getCubeMap() )
377 { 290 {
378 return 0; 291 LLGLEnable blend_enable(GL_BLEND);
292 renderStatic(LLRenderPass::PASS_SHINY, sVertexMask);
293 renderActive(LLRenderPass::PASS_SHINY, sVertexMask);
379 } 294 }
295}
380 296
381 stop_glerror(); 297void LLDrawPoolBump::renderActive(U32 type, U32 mask, BOOL texture)
298{
299#if !LL_RELEASE_FOR_DOWNLOAD
300 LLGLState::checkClientArrays(mask);
301#endif
382 302
383 S32 res = 0; 303 LLSpatialBridge* last_bridge = NULL;
384 if (pool->getVertexShaderLevel() > 0) 304 glPushMatrix();
305
306 for (LLSpatialGroup::sg_vector_t::iterator i = gPipeline.mActiveGroups.begin(); i != gPipeline.mActiveGroups.end(); ++i)
385 { 307 {
386 LLFastTimer t(LLFastTimer::FTM_RENDER_BUMP); 308 LLSpatialGroup* group = *i;
387 pool->bindGLBinormalPointer(gPipeline.mObjectBumpProgram.mAttribute[LLPipeline::GLSL_BINORMAL]); 309 if (!group->isDead() &&
388 310 gPipeline.hasRenderType(group->mSpatialPartition->mDrawableType) &&
389 LLViewerImage::bindTexture(tex, sDiffTex); 311 group->mDrawMap.find(type) != group->mDrawMap.end())
390
391 //single pass shader driven shiny/bump
392 LLGLDisable(GL_ALPHA_TEST);
393
394 LLViewerImage::sWhiteImagep->bind(sBumpTex);
395
396 GLfloat alpha[4] =
397 { 312 {
398 0.00f, 313 LLSpatialBridge* bridge = (LLSpatialBridge*) group->mSpatialPartition;
399 0.25f, 314 if (bridge != last_bridge)
400 0.5f,
401 0.75f
402 };
403
404 LLImageGL* last_bump = NULL;
405
406 for (std::vector<LLFace*>::iterator iter = face_list.begin();
407 iter != face_list.end(); iter++)
408 {
409 LLFace *facep = *iter;
410 if (facep->mSkipRender)
411 {
412 continue;
413 }
414
415 const LLTextureEntry* te = facep->getTextureEntry();
416 if (te)
417 { 315 {
418 U8 index = te->getShiny(); 316 glPopMatrix();
419 LLColor4 col = te->getColor(); 317 glPushMatrix();
420 318 glMultMatrixf((F32*) bridge->mDrawable->getRenderMatrix().mMatrix);
421 gPipeline.mObjectBumpProgram.vertexAttrib4f(LLPipeline::GLSL_MATERIAL_COLOR, 319 last_bridge = bridge;
422 col.mV[0], col.mV[1], col.mV[2], alpha[index]); 320
423 gPipeline.mObjectBumpProgram.vertexAttrib4f(LLPipeline::GLSL_SPECULAR_COLOR, 321 if (LLPipeline::sDynamicReflections)
424 alpha[index], alpha[index], alpha[index], alpha[index]);
425
426 LLImageGL* bump = getBumpMap(te, tex);
427 if (bump != last_bump)
428 { 322 {
429 if (bump) 323 LLSpatialPartition* part = gPipeline.getSpatialPartition(LLPipeline::PARTITION_VOLUME);
324 LLSpatialGroup::OctreeNode* node = part->mOctree->getNodeAt(LLVector3d(bridge->mDrawable->getPositionAgent()), 32.0);
325 if (node)
430 { 326 {
431 bump->bind(sBumpTex); 327 sCubeMap = ((LLSpatialGroup*) node->getListener(0))->mReflectionMap;
432 }
433 else
434 {
435 LLViewerImage::sWhiteImagep->bind(sBumpTex);
436 } 328 }
437 } 329 }
438 last_bump = bump;
439
440 // Draw the geometry
441 facep->enableLights();
442 res += facep->renderIndexed(index_array);
443 stop_glerror();
444 }
445 else
446 {
447 llwarns << "DrawPoolBump has face with invalid texture entry." << llendl;
448 } 330 }
449 }
450 }
451 else
452 {
453 LLFastTimer t(LLFastTimer::FTM_RENDER_SIMPLE);
454 LLViewerImage::bindTexture(tex);
455 res = LLDrawPool::drawLoop(face_list, index_array);
456 }
457 return res;
458}
459
460//static
461void LLDrawPoolBump::endPass0(LLDrawPool* pool)
462{
463 glDisableClientState(GL_TEXTURE_COORD_ARRAY);
464 glDisableClientState(GL_NORMAL_ARRAY);
465 glDisableClientState(GL_COLOR_ARRAY);
466 331
467 if (pool->getVertexShaderLevel() > 0) 332 renderGroup(group,type,mask,texture);
468 {
469 gPipeline.mObjectBumpProgram.disableTexture(LLPipeline::GLSL_ENVIRONMENT_MAP, GL_TEXTURE_CUBE_MAP_ARB);
470 LLCubeMap* cube_map = gSky.mVOSkyp->getCubeMap();
471 if (sEnvTex >= 0 && cube_map)
472 {
473 cube_map->restoreMatrix();
474 } 333 }
475
476 gPipeline.mObjectBumpProgram.disableTexture(LLPipeline::GLSL_SCATTER_MAP);
477 gPipeline.mObjectBumpProgram.disableTexture(LLPipeline::GLSL_BUMP_MAP);
478 gPipeline.mObjectBumpProgram.disableTexture(LLPipeline::GLSL_DIFFUSE_MAP);
479
480 disable_binormals(gPipeline.mObjectBumpProgram.mAttribute[LLPipeline::GLSL_BINORMAL]);
481
482 glActiveTextureARB(GL_TEXTURE0_ARB);
483 glEnable(GL_TEXTURE_2D);
484 } 334 }
335
336 glPopMatrix();
485} 337}
486 338
487 339
488//static
489void LLDrawPoolBump::beginPass1()
490{
491 // Second pass: environment map
492 glEnableClientState(GL_VERTEX_ARRAY);
493 glEnableClientState(GL_NORMAL_ARRAY);
494 340
495 LLCubeMap* cube_map = gSky.mVOSkyp->getCubeMap(); 341void LLDrawPoolBump::renderGroup(LLSpatialGroup* group, U32 type, U32 mask, BOOL texture = TRUE)
496 if( cube_map ) 342{
497 { 343 std::vector<LLDrawInfo*>& draw_info = group->mDrawMap[type];
498 cube_map->enable(0); 344
499 cube_map->setMatrix(0); 345 for (std::vector<LLDrawInfo*>::const_iterator k = draw_info.begin(); k != draw_info.end(); ++k)
500 cube_map->bind();
501 }
502}
503
504//static
505S32 LLDrawPoolBump::renderPass1(face_array_t& face_list, const U32* index_array, LLViewerImage* tex)
506{
507 LLFastTimer t(LLFastTimer::FTM_RENDER_SHINY);
508 if (gPipeline.getVertexShaderLevel(LLPipeline::SHADER_OBJECT) > 0) //everything happens in pass0
509 {
510 return 0;
511 }
512
513 S32 res = 0;
514 if( gSky.mVOSkyp->getCubeMap() )
515 { 346 {
516 //LLGLSPipelineAlpha gls; 347 LLDrawInfo& params = **k;
517 //LLGLDepthTest gls_depth(GL_TRUE, GL_FALSE, GL_EQUAL); 348 if (LLPipeline::sDynamicReflections)
518 LLGLEnable blend_enable(GL_BLEND);
519
520 GLfloat alpha[4] =
521 { 349 {
522 0.00f, 350 if (params.mReflectionMap.notNull())
523 0.25f,
524 0.5f,
525 0.75f
526 };
527
528 for (std::vector<LLFace*>::iterator iter = face_list.begin();
529 iter != face_list.end(); iter++)
530 {
531 LLFace *facep = *iter;
532 if (facep->mSkipRender)
533 { 351 {
534 continue; 352 params.mReflectionMap->bind();
535 } 353 }
536 354 else
537 const LLTextureEntry* te = facep->getTextureEntry();
538 if (te)
539 { 355 {
540 U8 index = te->getShiny(); 356 if (sCubeMap)
541 if( index > 0 )
542 { 357 {
543 LLOverrideFaceColor override_color(facep->getPool(), 1, 1, 1, alpha[index]); 358 sCubeMap->bind();
544 359 }
545 // Draw the geometry 360 else
546 facep->enableLights(); 361 {
547 res += facep->renderIndexed(index_array); 362 gSky.mVOSkyp->getCubeMap()->bind();
548 stop_glerror();
549 } 363 }
550 }
551 else
552 {
553 llwarns << "DrawPoolBump has face with invalid texture entry." << llendl;
554 } 364 }
555 } 365 }
366
367 params.mVertexBuffer->setBuffer(mask);
368 U32* indices_pointer = (U32*) params.mVertexBuffer->getIndicesPointer();
369 glDrawRangeElements(GL_TRIANGLES, params.mStart, params.mEnd, params.mCount,
370 GL_UNSIGNED_INT, indices_pointer+params.mOffset);
371 gPipeline.mTrianglesDrawn += params.mCount/3;
556 } 372 }
557 return res;
558} 373}
559 374
560//static 375void LLDrawPoolBump::endShiny()
561void LLDrawPoolBump::endPass1()
562{ 376{
563 LLCubeMap* cube_map = gSky.mVOSkyp->getCubeMap(); 377 LLCubeMap* cube_map = gSky.mVOSkyp->getCubeMap();
564 if( cube_map ) 378 if( cube_map )
565 { 379 {
566 cube_map->disable(); 380 cube_map->disable();
567 cube_map->restoreMatrix(); 381 cube_map->restoreMatrix();
382
383 if (gPipeline.getVertexShaderLevel(LLPipeline::SHADER_OBJECT) > 0)
384 {
385 gPipeline.mObjectShinyProgram.unbind();
386 }
387
568 glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); 388 glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
569 } 389 }
570 390
571 LLImageGL::unbindTexture(0, GL_TEXTURE_2D); 391 LLImageGL::unbindTexture(0, GL_TEXTURE_2D);
572 392 glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
573 glDisableClientState(GL_NORMAL_ARRAY); 393 glDisableClientState(GL_NORMAL_ARRAY);
394 glDisableClientState(GL_COLOR_ARRAY);
574} 395}
575 396
576 397
577// static 398// static
578LLImageGL* LLDrawPoolBump::getBumpMap(const LLTextureEntry* te, LLViewerImage* tex) 399BOOL LLDrawPoolBump::bindBumpMap(LLDrawInfo& params)
579{ 400{
580 U32 bump_code = te->getBumpmap();
581 LLImageGL* bump = NULL; 401 LLImageGL* bump = NULL;
582 402
403 U8 bump_code = params.mBump;
404 LLViewerImage* tex = params.mTexture;
405
583 switch( bump_code ) 406 switch( bump_code )
584 { 407 {
585 case BE_NO_BUMP: 408 case BE_NO_BUMP:
@@ -597,28 +420,33 @@ LLImageGL* LLDrawPoolBump::getBumpMap(const LLTextureEntry* te, LLViewerImage* t
597 if( bump_code < LLStandardBumpmap::sStandardBumpmapCount ) 420 if( bump_code < LLStandardBumpmap::sStandardBumpmapCount )
598 { 421 {
599 bump = gStandardBumpmapList[bump_code].mImage; 422 bump = gStandardBumpmapList[bump_code].mImage;
423 gBumpImageList.addTextureStats(bump_code, tex->getID(), params.mVSize, 1, 1);
600 } 424 }
601 break; 425 break;
602 } 426 }
603 427
604 return bump; 428 if (bump)
429 {
430 bump->bind(1);
431 bump->bind(0);
432 return TRUE;
433 }
434 return FALSE;
605} 435}
606 436
607//static 437//static
608void LLDrawPoolBump::beginPass2() 438void LLDrawPoolBump::beginBump()
609{ 439{
440 sVertexMask = VERTEX_MASK_BUMP;
610 LLFastTimer t(LLFastTimer::FTM_RENDER_BUMP); 441 LLFastTimer t(LLFastTimer::FTM_RENDER_BUMP);
611 // Optional third pass: emboss bump map 442 // Optional second pass: emboss bump map
612 stop_glerror(); 443 stop_glerror();
613 444
614 // TEXTURE UNIT 0 445 // TEXTURE UNIT 0
615 // Output.rgb = texture at texture coord 0 446 // Output.rgb = texture at texture coord 0
616 glActiveTextureARB(GL_TEXTURE0_ARB); 447 glActiveTextureARB(GL_TEXTURE0_ARB);
617 glClientActiveTextureARB(GL_TEXTURE0_ARB); 448 glClientActiveTextureARB(GL_TEXTURE0_ARB);
618
619 glEnableClientState(GL_VERTEX_ARRAY);
620 glEnableClientState(GL_TEXTURE_COORD_ARRAY); 449 glEnableClientState(GL_TEXTURE_COORD_ARRAY);
621 glDisableClientState(GL_NORMAL_ARRAY);
622 450
623 glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_ARB); 451 glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_ARB);
624 glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_RGB_ARB, GL_REPLACE); 452 glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_RGB_ARB, GL_REPLACE);
@@ -631,14 +459,10 @@ void LLDrawPoolBump::beginPass2()
631 glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_ALPHA_ARB, GL_TEXTURE); 459 glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_ALPHA_ARB, GL_TEXTURE);
632 glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_ALPHA_ARB, GL_SRC_ALPHA); 460 glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_ALPHA_ARB, GL_SRC_ALPHA);
633 461
634
635 // TEXTURE UNIT 1 462 // TEXTURE UNIT 1
636 glActiveTextureARB(GL_TEXTURE1_ARB); 463 glActiveTextureARB(GL_TEXTURE1_ARB);
637 glClientActiveTextureARB(GL_TEXTURE1_ARB); 464 glClientActiveTextureARB(GL_TEXTURE1_ARB);
638
639 glEnableClientState(GL_VERTEX_ARRAY);
640 glEnableClientState(GL_TEXTURE_COORD_ARRAY); 465 glEnableClientState(GL_TEXTURE_COORD_ARRAY);
641 glDisableClientState(GL_NORMAL_ARRAY);
642 466
643 glEnable(GL_TEXTURE_2D); // Texture unit 1 467 glEnable(GL_TEXTURE_2D); // Texture unit 1
644 468
@@ -668,68 +492,25 @@ void LLDrawPoolBump::beginPass2()
668 // = dst.rgb + dst.rgb * (bump0 - bump1) 492 // = dst.rgb + dst.rgb * (bump0 - bump1)
669 glBlendFunc(GL_DST_COLOR, GL_SRC_COLOR); 493 glBlendFunc(GL_DST_COLOR, GL_SRC_COLOR);
670// glBlendFunc(GL_ONE, GL_ZERO); // temp 494// glBlendFunc(GL_ONE, GL_ZERO); // temp
671 495 glActiveTextureARB(GL_TEXTURE0_ARB);
672 stop_glerror(); 496 stop_glerror();
673} 497}
674 498
675//static 499//static
676S32 LLDrawPoolBump::renderPass2(face_array_t& face_list, const U32* index_array, LLViewerImage* tex) 500void LLDrawPoolBump::renderBump()
677{ 501{
678 if (gPipeline.getVertexShaderLevel(LLPipeline::SHADER_OBJECT) > 0) //everything happens in pass0 502 LLFastTimer ftm(LLFastTimer::FTM_RENDER_BUMP);
679 {
680 return 0;
681 }
682
683 LLGLDisable fog(GL_FOG); 503 LLGLDisable fog(GL_FOG);
684 LLGLDepthTest gls_depth(GL_TRUE, GL_FALSE, GL_EQUAL); 504 LLGLDepthTest gls_depth(GL_TRUE, GL_FALSE, GL_EQUAL);
685 LLGLEnable tex2d(GL_TEXTURE_2D); 505 LLGLEnable tex2d(GL_TEXTURE_2D);
686 LLGLEnable blend(GL_BLEND); 506 LLGLEnable blend(GL_BLEND);
687 S32 res = 0; 507 glColor4f(1,1,1,1);
688 508 renderBump(LLRenderPass::PASS_BUMP, sVertexMask);
689 LLImageGL* last_bump = NULL; 509 renderBumpActive(LLRenderPass::PASS_BUMP, sVertexMask);
690
691 for (std::vector<LLFace*>::iterator iter = face_list.begin();
692 iter != face_list.end(); iter++)
693 {
694 LLFace *facep = *iter;
695 if (facep->mSkipRender)
696 {
697 continue;
698 }
699 LLOverrideFaceColor override_color(facep->getPool(), 1,1,1,1);
700
701 const LLTextureEntry* te = facep->getTextureEntry();
702 LLImageGL* bump = getBumpMap(te, tex);
703
704 if( bump )
705 {
706 if( bump != last_bump )
707 {
708 last_bump = bump;
709
710 // Texture unit 0
711 bump->bind(0);
712 stop_glerror();
713
714 // Texture unit 1
715 bump->bind(1);
716 stop_glerror();
717 }
718
719 // Draw the geometry
720 res += facep->renderIndexed(index_array);
721 stop_glerror();
722 }
723 else
724 {
725// llwarns << "Skipping invalid bump code " << (S32) te->getBumpmap() << llendl;
726 }
727 }
728 return res;
729} 510}
730 511
731//static 512//static
732void LLDrawPoolBump::endPass2() 513void LLDrawPoolBump::endBump()
733{ 514{
734 // Disable texture unit 1 515 // Disable texture unit 1
735 glActiveTextureARB(GL_TEXTURE1_ARB); 516 glActiveTextureARB(GL_TEXTURE1_ARB);
@@ -747,67 +528,6 @@ void LLDrawPoolBump::endPass2()
747 glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA ); 528 glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA );
748} 529}
749 530
750
751void LLDrawPoolBump::renderForSelect()
752{
753 if (mDrawFace.empty() || !mMemory.count())
754 {
755 return;
756 }
757
758 glEnableClientState ( GL_VERTEX_ARRAY );
759
760 bindGLVertexPointer();
761
762 for (std::vector<LLFace*>::iterator iter = mDrawFace.begin();
763 iter != mDrawFace.end(); iter++)
764 {
765 LLFace *facep = *iter;
766 if (facep->getDrawable() && !facep->getDrawable()->isDead() && (facep->getViewerObject()->mGLName))
767 {
768 facep->renderForSelect();
769 }
770 }
771}
772
773
774void LLDrawPoolBump::renderFaceSelected(LLFace *facep,
775 LLImageGL *image,
776 const LLColor4 &color,
777 const S32 index_offset, const S32 index_count)
778{
779 facep->renderSelected(image, color, index_offset, index_count);
780}
781
782
783void LLDrawPoolBump::dirtyTexture(const LLViewerImage *texturep)
784{
785 if (mTexturep == texturep)
786 {
787 for (std::vector<LLFace*>::iterator iter = mReferences.begin();
788 iter != mReferences.end(); iter++)
789 {
790 LLFace *facep = *iter;
791 gPipeline.markTextured(facep->getDrawable());
792 }
793 }
794}
795
796LLViewerImage *LLDrawPoolBump::getTexture()
797{
798 return mTexturep;
799}
800
801LLViewerImage *LLDrawPoolBump::getDebugTexture()
802{
803 return mTexturep;
804}
805
806LLColor3 LLDrawPoolBump::getDebugColor() const
807{
808 return LLColor3(1.f, 1.f, 0.f);
809}
810
811//////////////////////////////////////////////////////////////// 531////////////////////////////////////////////////////////////////
812// List of one-component bump-maps created from other texures. 532// List of one-component bump-maps created from other texures.
813 533
@@ -1131,25 +851,93 @@ void LLBumpImageList::onSourceLoaded( BOOL success, LLViewerImage *src_vi, LLIma
1131 } 851 }
1132} 852}
1133 853
1134S32 LLDrawPoolBump::getMaterialAttribIndex() 854void LLDrawPoolBump::renderBumpActive(U32 type, U32 mask)
1135{ 855{
1136 return gPipeline.mObjectBumpProgram.mAttribute[LLPipeline::GLSL_MATERIAL_COLOR]; 856#if !LL_RELEASE_FOR_DOWNLOAD
857 LLGLState::checkClientArrays(mask);
858#endif
859
860 LLSpatialBridge* last_bridge = NULL;
861 glPushMatrix();
862
863 for (LLSpatialGroup::sg_vector_t::iterator i = gPipeline.mActiveGroups.begin(); i != gPipeline.mActiveGroups.end(); ++i)
864 {
865 LLSpatialGroup* group = *i;
866 if (!group->isDead() &&
867 group->mSpatialPartition->mRenderByGroup &&
868 group->mDrawMap.find(type) != group->mDrawMap.end())
869 {
870 LLSpatialBridge* bridge = (LLSpatialBridge*) group->mSpatialPartition;
871 if (bridge != last_bridge)
872 {
873 glPopMatrix();
874 glPushMatrix();
875 glMultMatrixf((F32*) bridge->mDrawable->getRenderMatrix().mMatrix);
876 last_bridge = bridge;
877 }
878
879 renderGroupBump(group,type,mask);
880 }
881 }
882
883 glPopMatrix();
1137} 884}
1138 885
1139// virtual 886void LLDrawPoolBump::renderBump(U32 type, U32 mask)
1140void LLDrawPoolBump::enableShade() 887{
1141{ 888#if !LL_RELEASE_FOR_DOWNLOAD
1142 glDisableClientState(GL_COLOR_ARRAY); 889 LLGLState::checkClientArrays(mask);
890#endif
891
892 std::vector<LLDrawInfo*>& draw_info = gPipeline.mRenderMap[type];
893
894 for (std::vector<LLDrawInfo*>::iterator i = draw_info.begin(); i != draw_info.end(); ++i)
895 {
896 LLDrawInfo& params = **i;
897
898 if (LLDrawPoolBump::bindBumpMap(params))
899 {
900 pushBatch(params, mask, FALSE);
901 }
902 }
1143} 903}
1144 904
1145// virtual 905void LLDrawPoolBump::renderGroupBump(LLSpatialGroup* group, U32 type, U32 mask)
1146void LLDrawPoolBump::disableShade() 906{
1147{ 907 const std::vector<LLDrawInfo*>& draw_info = group->mDrawMap[type];
1148 glEnableClientState(GL_COLOR_ARRAY); 908
909 for (std::vector<LLDrawInfo*>::const_iterator k = draw_info.begin(); k != draw_info.end(); ++k)
910 {
911 LLDrawInfo& params = **k;
912
913 if (LLDrawPoolBump::bindBumpMap(params))
914 {
915 pushBatch(params, mask, FALSE);
916 }
917 }
1149} 918}
1150 919
1151// virtual 920void LLDrawPoolBump::pushBatch(LLDrawInfo& params, U32 mask, BOOL texture)
1152void LLDrawPoolBump::setShade(F32 shade)
1153{ 921{
1154 glColor4f(0,0,0,shade); 922 if (params.mTextureMatrix)
923 {
924 glActiveTextureARB(GL_TEXTURE1_ARB);
925 glMatrixMode(GL_TEXTURE);
926 glLoadMatrixf((GLfloat*) params.mTextureMatrix->mMatrix);
927 glActiveTextureARB(GL_TEXTURE0_ARB);
928 glLoadMatrixf((GLfloat*) params.mTextureMatrix->mMatrix);
929 }
930 params.mVertexBuffer->setBuffer(mask);
931 U32* indices_pointer = (U32*) params.mVertexBuffer->getIndicesPointer();
932 glDrawRangeElements(GL_TRIANGLES, params.mStart, params.mEnd, params.mCount,
933 GL_UNSIGNED_INT, indices_pointer+params.mOffset);
934 gPipeline.mTrianglesDrawn += params.mCount/3;
935 if (params.mTextureMatrix)
936 {
937 glActiveTextureARB(GL_TEXTURE1_ARB);
938 glLoadIdentity();
939 glActiveTextureARB(GL_TEXTURE0_ARB);
940 glLoadIdentity();
941 glMatrixMode(GL_MODELVIEW);
942 }
1155} 943}
diff --git a/linden/indra/newview/lldrawpoolbump.h b/linden/indra/newview/lldrawpoolbump.h
index 4f181bc..bb8de40 100644
--- a/linden/indra/newview/lldrawpoolbump.h
+++ b/linden/indra/newview/lldrawpoolbump.h
@@ -34,57 +34,41 @@
34#include "lluuid.h" 34#include "lluuid.h"
35 35
36class LLImageRaw; 36class LLImageRaw;
37class LLSpatialGroup;
38class LLDrawInfo;
37 39
38class LLDrawPoolBump : public LLDrawPool 40class LLDrawPoolBump : public LLRenderPass
39{ 41{
40protected:
41 LLPointer<LLViewerImage> mTexturep; // The primary texture, not the bump texture
42
43public: 42public:
44 LLDrawPoolBump(LLViewerImage *texturep); 43 static U32 sVertexMask;
44
45 virtual U32 getVertexDataMask() { return sVertexMask; }
45 46
46 /*virtual*/ LLDrawPool *instancePool(); 47 LLDrawPoolBump();
47 48
48 /*virtual*/ void render(S32 pass = 0); 49 /*virtual*/ void render(S32 pass = 0);
49 /*virtual*/ void beginRenderPass( S32 pass ); 50 /*virtual*/ void beginRenderPass( S32 pass );
50 /*virtual*/ void endRenderPass( S32 pass ); 51 /*virtual*/ void endRenderPass( S32 pass );
51 /*virtual*/ S32 getNumPasses(); 52 /*virtual*/ S32 getNumPasses();
52 /*virtual*/ void renderFaceSelected(LLFace *facep, LLImageGL *image, const LLColor4 &color,
53 const S32 index_offset = 0, const S32 index_count = 0);
54 /*virtual*/ void prerender(); 53 /*virtual*/ void prerender();
55 /*virtual*/ void renderForSelect(); 54 /*virtual*/ void pushBatch(LLDrawInfo& params, U32 mask, BOOL texture);
56 /*virtual*/ void dirtyTexture(const LLViewerImage *texturep); 55
57 /*virtual*/ LLViewerImage *getTexture(); 56 void renderBump(U32 type, U32 mask);
58 /*virtual*/ LLViewerImage *getDebugTexture(); 57 void renderBumpActive(U32 type, U32 mask);
59 /*virtual*/ LLColor3 getDebugColor() const; // For AGP debug display 58 void renderGroup(LLSpatialGroup* group, U32 type, U32 mask, BOOL texture);
60 /*virtual*/ BOOL match(LLFace* last_face, LLFace* facep); 59 void renderGroupBump(LLSpatialGroup* group, U32 type, U32 mask);
61 60
62 virtual S32 getMaterialAttribIndex(); 61 S32 numBumpPasses();
63 static S32 numBumpPasses();
64 62
65 static void beginPass0(LLDrawPool* pool); 63 void beginShiny();
66 static S32 renderPass0(LLDrawPool* pool, face_array_t& face_list, const U32* index_array, LLViewerImage* tex); 64 void renderShiny();
67 static void endPass0(LLDrawPool* pool); 65 void endShiny();
68 66 void renderActive(U32 type, U32 mask, BOOL texture = TRUE);
69 static void beginPass1(); 67
70 static S32 renderPass1(face_array_t& face_list, const U32* index_array, LLViewerImage* tex); 68 void beginBump();
71 static void endPass1(); 69 void renderBump();
72 70 void endBump();
73 static void beginPass2(); 71 BOOL bindBumpMap(LLDrawInfo& params);
74 static S32 renderPass2(face_array_t& face_list, const U32* index_array, LLViewerImage* tex);
75 static void endPass2();
76
77 /*virtual*/ void enableShade();
78 /*virtual*/ void disableShade();
79 /*virtual*/ void setShade(F32 shade);
80
81protected:
82 static LLImageGL* getBumpMap(const LLTextureEntry* te, LLViewerImage* tex);
83
84public:
85 static S32 sBumpTex;
86 static S32 sDiffTex;
87 static S32 sEnvTex;
88}; 72};
89 73
90enum EBumpEffect 74enum EBumpEffect
diff --git a/linden/indra/newview/lldrawpoolclouds.cpp b/linden/indra/newview/lldrawpoolclouds.cpp
index 7d877ee..83ef2b3 100644
--- a/linden/indra/newview/lldrawpoolclouds.cpp
+++ b/linden/indra/newview/lldrawpoolclouds.cpp
@@ -36,7 +36,7 @@
36#include "pipeline.h" 36#include "pipeline.h"
37 37
38LLDrawPoolClouds::LLDrawPoolClouds() : 38LLDrawPoolClouds::LLDrawPoolClouds() :
39 LLDrawPool(POOL_CLOUDS, DATA_SIMPLE_IL_MASK, 0) 39 LLDrawPool(POOL_CLOUDS)
40{ 40{
41} 41}
42 42
@@ -45,16 +45,15 @@ LLDrawPool *LLDrawPoolClouds::instancePool()
45 return new LLDrawPoolClouds(); 45 return new LLDrawPoolClouds();
46} 46}
47 47
48BOOL LLDrawPoolClouds::addFace(LLFace* face)
49{
50 llerrs << "WTF?" << llendl;
51 return FALSE;
52}
53
48void LLDrawPoolClouds::enqueue(LLFace *facep) 54void LLDrawPoolClouds::enqueue(LLFace *facep)
49{ 55{
50 if (facep->isState(LLFace::BACKLIST)) 56 mDrawFace.push_back(facep);
51 {
52 mMoveFace.put(facep);
53 }
54 else
55 {
56 mDrawFace.push_back(facep);
57 }
58 facep->mDistance = (facep->mCenterAgent - gCamera->getOrigin()) * gCamera->getAtAxis(); 57 facep->mDistance = (facep->mCenterAgent - gCamera->getOrigin()) * gCamera->getAtAxis();
59} 58}
60 59
@@ -90,10 +89,6 @@ void LLDrawPoolClouds::render(S32 pass)
90 gPipeline.enableLightsFullbright(LLColor4(1.f,1.f,1.f)); 89 gPipeline.enableLightsFullbright(LLColor4(1.f,1.f,1.f));
91 90
92 mDrawFace[0]->bindTexture(); 91 mDrawFace[0]->bindTexture();
93
94 bindGLVertexPointer();
95 bindGLTexCoordPointer();
96 bindGLNormalPointer();
97 92
98 std::sort(mDrawFace.begin(), mDrawFace.end(), LLFace::CompareDistanceGreater()); 93 std::sort(mDrawFace.begin(), mDrawFace.end(), LLFace::CompareDistanceGreater());
99 94
diff --git a/linden/indra/newview/lldrawpoolclouds.h b/linden/indra/newview/lldrawpoolclouds.h
index e47f66d..795b0a6 100644
--- a/linden/indra/newview/lldrawpoolclouds.h
+++ b/linden/indra/newview/lldrawpoolclouds.h
@@ -33,6 +33,16 @@
33class LLDrawPoolClouds : public LLDrawPool 33class LLDrawPoolClouds : public LLDrawPool
34{ 34{
35public: 35public:
36 enum
37 {
38 VERTEX_DATA_MASK = LLVertexBuffer::MAP_VERTEX |
39 LLVertexBuffer::MAP_NORMAL |
40 LLVertexBuffer::MAP_TEXCOORD
41 };
42
43 BOOL addFace(LLFace* face);
44 virtual U32 getVertexDataMask() { return VERTEX_DATA_MASK; }
45
36 LLDrawPoolClouds(); 46 LLDrawPoolClouds();
37 47
38 /*virtual*/ void prerender(); 48 /*virtual*/ void prerender();
diff --git a/linden/indra/newview/lldrawpoolground.cpp b/linden/indra/newview/lldrawpoolground.cpp
index f2f2002..bc66757 100644
--- a/linden/indra/newview/lldrawpoolground.cpp
+++ b/linden/indra/newview/lldrawpoolground.cpp
@@ -31,7 +31,6 @@
31 31
32#include "llviewercontrol.h" 32#include "llviewercontrol.h"
33 33
34#include "llagparray.h"
35#include "lldrawable.h" 34#include "lldrawable.h"
36#include "llface.h" 35#include "llface.h"
37#include "llsky.h" 36#include "llsky.h"
@@ -39,9 +38,11 @@
39#include "llviewerwindow.h" 38#include "llviewerwindow.h"
40#include "llworld.h" 39#include "llworld.h"
41#include "pipeline.h" 40#include "pipeline.h"
41#include "llagent.h"
42#include "llviewerregion.h"
42 43
43LLDrawPoolGround::LLDrawPoolGround() : 44LLDrawPoolGround::LLDrawPoolGround() :
44 LLDrawPool(POOL_GROUND, DATA_SIMPLE_IL_MASK, DATA_SIMPLE_NIL_MASK) 45 LLFacePool(POOL_GROUND)
45{ 46{
46} 47}
47 48
@@ -60,42 +61,38 @@ void LLDrawPoolGround::render(S32 pass)
60 if (mDrawFace.empty()) 61 if (mDrawFace.empty())
61 { 62 {
62 return; 63 return;
63 } 64 }
64 65
65 glEnableClientState(GL_TEXTURE_COORD_ARRAY); 66 glEnableClientState(GL_TEXTURE_COORD_ARRAY);
66 glEnableClientState(GL_VERTEX_ARRAY); 67 glEnableClientState(GL_VERTEX_ARRAY);
67 glDisableClientState(GL_NORMAL_ARRAY);
68
69 bindGLVertexPointer();
70 bindGLTexCoordPointer();
71 68
72 LLGLSPipelineSkyBox gls_skybox; 69 LLGLSPipelineSkyBox gls_skybox;
70 LLGLDisable tex(GL_TEXTURE_2D);
73 LLGLDepthTest gls_depth(GL_FALSE, GL_FALSE); 71 LLGLDepthTest gls_depth(GL_FALSE, GL_FALSE);
74 72
75 glMatrixMode( GL_PROJECTION ); 73 glMatrixMode( GL_PROJECTION );
76 74
77 glPushMatrix(); 75 glPushMatrix();
78 gViewerWindow->setup3DRender(); 76 //gViewerWindow->setup3DRender();
79 77
80 glMatrixMode(GL_MODELVIEW); 78 glMatrixMode(GL_MODELVIEW);
81 79
82 LLGLState tex2d(GL_TEXTURE_2D, (mVertexShaderLevel > 0) ? TRUE : FALSE); 80 F32 water_height = gAgent.getRegion()->getWaterHeight();
83 LLViewerImage::bindTexture(gSky.mVOSkyp->getScatterMap(), 0); 81 glPushMatrix();
82 LLVector3 origin = gCamera->getOrigin();
83 glTranslatef(origin.mV[0], origin.mV[1], llmax(origin.mV[2], water_height));
84 84
85 LLFace *facep = mDrawFace[0]; 85 LLFace *facep = mDrawFace[0];
86 86
87 if (!(mVertexShaderLevel > 0)) 87 gPipeline.disableLights();
88 {
89 gPipeline.disableLights();
90 }
91
92 glColor4fv(facep->getFaceColor().mV);
93 88
94 facep->renderIndexed(getRawIndices()); 89 LLOverrideFaceColor col(this, gSky.mVOSkyp->getGLFogColor());
90 facep->renderIndexed();
95 91
96 glMatrixMode( GL_PROJECTION ); 92 glMatrixMode( GL_PROJECTION );
97 glPopMatrix(); 93 glPopMatrix();
98 glMatrixMode( GL_MODELVIEW ); 94 glMatrixMode( GL_MODELVIEW );
95 glPopMatrix();
99} 96}
100 97
101void LLDrawPoolGround::renderForSelect() 98void LLDrawPoolGround::renderForSelect()
diff --git a/linden/indra/newview/lldrawpoolground.h b/linden/indra/newview/lldrawpoolground.h
index 1866746..6bf358e 100644
--- a/linden/indra/newview/lldrawpoolground.h
+++ b/linden/indra/newview/lldrawpoolground.h
@@ -31,9 +31,17 @@
31#include "lldrawpool.h" 31#include "lldrawpool.h"
32 32
33 33
34class LLDrawPoolGround : public LLDrawPool 34class LLDrawPoolGround : public LLFacePool
35{ 35{
36public: 36public:
37 enum
38 {
39 VERTEX_DATA_MASK = LLVertexBuffer::MAP_VERTEX |
40 LLVertexBuffer::MAP_TEXCOORD
41 };
42
43 virtual U32 getVertexDataMask() { return VERTEX_DATA_MASK; }
44
37 LLDrawPoolGround(); 45 LLDrawPoolGround();
38 46
39 /*virtual*/ LLDrawPool *instancePool(); 47 /*virtual*/ LLDrawPool *instancePool();
diff --git a/linden/indra/newview/lldrawpoolhud.cpp b/linden/indra/newview/lldrawpoolhud.cpp
deleted file mode 100644
index e2bb1bf..0000000
--- a/linden/indra/newview/lldrawpoolhud.cpp
+++ /dev/null
@@ -1,565 +0,0 @@
1/**
2 * @file lldrawpoolhud.cpp
3 * @brief LLDrawPoolHUD class implementation
4 *
5 * Copyright (c) 2006-2007, Linden Research, Inc.
6 *
7 * The source code in this file ("Source Code") is provided by Linden Lab
8 * to you under the terms of the GNU General Public License, version 2.0
9 * ("GPL"), unless you have obtained a separate licensing agreement
10 * ("Other License"), formally executed by you and Linden Lab. Terms of
11 * the GPL can be found in doc/GPL-license.txt in this distribution, or
12 * online at http://secondlife.com/developers/opensource/gplv2
13 *
14 * There are special exceptions to the terms and conditions of the GPL as
15 * it is applied to this Source Code. View the full text of the exception
16 * in the file doc/FLOSS-exception.txt in this software distribution, or
17 * online at http://secondlife.com/developers/opensource/flossexception
18 *
19 * By copying, modifying or distributing this software, you acknowledge
20 * that you have read and understood your obligations described above,
21 * and agree to abide by those obligations.
22 *
23 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
24 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
25 * COMPLETENESS OR PERFORMANCE.
26 */
27
28#include "llviewerprecompiledheaders.h"
29
30#include "lldrawpoolhud.h"
31
32#include "llagparray.h"
33#include "llagent.h"
34#include "llbbox.h"
35#include "llcubemap.h"
36#include "lldrawable.h"
37#include "lldrawpoolalpha.h"
38#include "lldrawpoolbump.h"
39#include "llface.h"
40#include "llhudtext.h"
41#include "llsky.h"
42#include "lltoolmgr.h"
43#include "llvoavatar.h"
44#include "llviewercamera.h"
45#include "llviewerobjectlist.h"
46#include "llviewerwindow.h"
47#include "pipeline.h"
48
49BOOL LLDrawPoolHUD::sShowHUDAttachments = TRUE;
50
51LLDrawPoolHUD::LLDrawPoolHUD() :
52 LLDrawPool(POOL_HUD,
53 DATA_BUMP_IL_MASK | DATA_COLORS_MASK, // HUD objects may be bumpmapped
54 DATA_SIMPLE_NIL_MASK),
55 mRenderMode(POOL_SIMPLE)
56{
57}
58
59LLDrawPool* LLDrawPoolHUD::instancePool()
60{
61 return new LLDrawPoolHUD();
62}
63
64
65void LLDrawPoolHUD::prerender()
66{
67 mVertexShaderLevel = gPipeline.getVertexShaderLevel(LLPipeline::SHADER_OBJECT);
68}
69
70void LLDrawPoolHUD::beginRenderPass(S32 pass)
71{
72}
73
74static BOOL setup_matrices(BOOL for_select)
75{
76 LLVOAvatar* my_avatarp = gAgent.getAvatarObject();
77 if (my_avatarp && my_avatarp->hasHUDAttachment())
78 {
79 if (!for_select)
80 {
81 // clamp target zoom level to reasonable values
82 my_avatarp->mHUDTargetZoom = llclamp(my_avatarp->mHUDTargetZoom, 0.1f, 1.f);
83 // smoothly interpolate current zoom level
84 my_avatarp->mHUDCurZoom = lerp(my_avatarp->mHUDCurZoom, my_avatarp->mHUDTargetZoom, LLCriticalDamp::getInterpolant(0.03f));
85 }
86
87 F32 zoom_level = my_avatarp->mHUDCurZoom;
88 // clear z buffer and set up transform for hud
89 if (!for_select)
90 {
91 glClear(GL_DEPTH_BUFFER_BIT);
92 }
93 LLBBox hud_bbox = my_avatarp->getHUDBBox();
94
95 // set up transform to encompass bounding box of HUD
96 glMatrixMode(GL_PROJECTION);
97 glPushMatrix();
98 glLoadIdentity();
99 F32 hud_depth = llmax(1.f, hud_bbox.getExtentLocal().mV[VX] * 1.1f);
100 if (for_select)
101 {
102 //RN: reset viewport to window extents so ortho screen is calculated with proper reference frame
103 gViewerWindow->setupViewport();
104 }
105 glOrtho(-0.5f * gCamera->getAspect(), 0.5f * gCamera->getAspect(), -0.5f, 0.5f, 0.f, hud_depth);
106
107 // apply camera zoom transform (for high res screenshots)
108 F32 zoom_factor = gCamera->getZoomFactor();
109 S16 sub_region = gCamera->getZoomSubRegion();
110 if (zoom_factor > 1.f)
111 {
112 float offset = zoom_factor - 1.f;
113 int pos_y = sub_region / llceil(zoom_factor);
114 int pos_x = sub_region - (pos_y*llceil(zoom_factor));
115 glTranslatef(gCamera->getAspect() * 0.5f * (offset - (F32)pos_x * 2.f), 0.5f * (offset - (F32)pos_y * 2.f), 0.f);
116 glScalef(zoom_factor, zoom_factor, 1.f);
117 }
118
119 glMatrixMode(GL_MODELVIEW);
120 glPushMatrix();
121 glLoadIdentity();
122 glLoadMatrixf(OGL_TO_CFR_ROTATION); // Load Cory's favorite reference frame
123 glTranslatef(-hud_bbox.getCenterLocal().mV[VX] + (hud_depth * 0.5f), 0.f, 0.f);
124 glScalef(zoom_level, zoom_level, zoom_level);
125
126 return TRUE;
127 }
128 else
129 {
130 return FALSE;
131 }
132}
133
134static void restore_matrices()
135{
136 glMatrixMode(GL_PROJECTION);
137 glPopMatrix();
138
139 glMatrixMode(GL_MODELVIEW);
140 glPopMatrix();
141}
142
143
144void LLDrawPoolHUD::render(S32 pass)
145{
146 LLFastTimer ftm(LLFastTimer::FTM_RENDER_HUD);
147 if (!sShowHUDAttachments)
148 {
149 return;
150 }
151
152 if (mDrawFace.empty() && mAlphaFace.empty() && mBumpFaces.empty())
153 {
154 return;
155 }
156
157 if (!setup_matrices(FALSE))
158 {
159 return;
160 }
161
162 const U32* index_array = getRawIndices();
163
164 bindGLVertexPointer();
165 bindGLNormalPointer();
166 bindGLTexCoordPointer();
167
168 S32 diffTex = 0;
169 S32 envTex = -1;
170 // Non alpha faces
171 if (!mDrawFace.empty())
172 {
173 mRenderMode = POOL_SIMPLE;
174 if (mVertexShaderLevel > 0)
175 {
176 gPipeline.mObjectSimpleProgram.bind();
177 S32 scatterTex = gPipeline.mObjectSimpleProgram.enableTexture(LLPipeline::GLSL_SCATTER_MAP);
178 LLViewerImage::bindTexture(gSky.mVOSkyp->getScatterMap(), scatterTex);
179 diffTex = gPipeline.mObjectSimpleProgram.enableTexture(LLPipeline::GLSL_DIFFUSE_MAP);
180 }
181
182 LLGLEnable blend(GL_BLEND); // for invisi-prim hack, I think
183
184 glEnableClientState(GL_VERTEX_ARRAY);
185 glEnableClientState(GL_NORMAL_ARRAY);
186 glActiveTextureARB(GL_TEXTURE0_ARB);
187 glClientActiveTextureARB(GL_TEXTURE0_ARB);
188 glEnableClientState(GL_TEXTURE_COORD_ARRAY);
189
190 // Render
191 mIndicesDrawn += drawLoopSetTex(mDrawFace, index_array, diffTex);
192
193 if (mVertexShaderLevel > 0)
194 {
195 gPipeline.mObjectSimpleProgram.disableTexture(LLPipeline::GLSL_SCATTER_MAP);
196 gPipeline.mObjectSimpleProgram.disableTexture(LLPipeline::GLSL_DIFFUSE_MAP);
197 }
198 }
199
200 // Bump Mapped Faces
201 if (!mBumpFaces.empty())
202 {
203 mRenderMode = POOL_BUMP;
204 if (mVertexShaderLevel > 0)
205 {
206 gPipeline.mObjectBumpProgram.bind();
207 }
208
209 S32 bump_passes = LLDrawPoolBump::numBumpPasses();
210 if (bump_passes >= 1)
211 {
212 // Texture unit 0
213 LLDrawPoolBump::beginPass0(this);
214 for (bump_face_map_t::iterator iter = mBumpFaces.begin();
215 iter != mBumpFaces.end(); iter++)
216 {
217 LLViewerImage* tex = iter->first;
218 face_array_t& faces = iter->second;
219 mIndicesDrawn += LLDrawPoolBump::renderPass0(this, faces, index_array, tex);
220 }
221 LLDrawPoolBump::endPass0(this);
222 }
223
224 if (bump_passes >= 2)
225 {
226 LLDrawPoolBump::beginPass1();
227 for (bump_face_map_t::iterator iter = mBumpFaces.begin();
228 iter != mBumpFaces.end(); iter++)
229 {
230 LLViewerImage* tex = iter->first;
231 face_array_t& faces = iter->second;
232 mIndicesDrawn += LLDrawPoolBump::renderPass1(faces, index_array, tex);
233 }
234 LLDrawPoolBump::endPass1();
235 }
236
237 if (bump_passes >= 3)
238 {
239 bindGLVertexPointer();
240 // Texture unit 0
241 glActiveTextureARB(GL_TEXTURE0_ARB);
242 glClientActiveTextureARB(GL_TEXTURE0_ARB);
243 bindGLTexCoordPointer();
244 // Texture unit 1
245 glActiveTextureARB(GL_TEXTURE1_ARB);
246 glClientActiveTextureARB(GL_TEXTURE1_ARB);
247 bindGLTexCoordPointer(1);
248 LLDrawPoolBump::beginPass2();
249 for (bump_face_map_t::iterator iter = mBumpFaces.begin();
250 iter != mBumpFaces.end(); iter++)
251 {
252 LLViewerImage* tex = iter->first;
253 face_array_t& faces = iter->second;
254 mIndicesDrawn += LLDrawPoolBump::renderPass2(faces, index_array, tex);
255 }
256 LLDrawPoolBump::endPass2();
257 }
258 }
259
260 // Alpha faces
261 if (!mAlphaFace.empty())
262 {
263 // Sort
264 std::sort(mAlphaFace.begin(), mAlphaFace.end(), LLFace::CompareDistanceGreater());
265
266 // Render
267 mRenderMode = POOL_ALPHA;
268
269 glEnableClientState(GL_VERTEX_ARRAY);
270 glEnableClientState(GL_NORMAL_ARRAY);
271 glActiveTextureARB(GL_TEXTURE0_ARB);
272 glClientActiveTextureARB(GL_TEXTURE0_ARB);
273 glEnableClientState(GL_TEXTURE_COORD_ARRAY);
274
275 if (mVertexShaderLevel > 0)
276 {
277 gPipeline.mObjectAlphaProgram.bind();
278 envTex = gPipeline.mObjectAlphaProgram.enableTexture(LLPipeline::GLSL_ENVIRONMENT_MAP, GL_TEXTURE_CUBE_MAP_ARB);
279 LLCubeMap* cube_map = gSky.mVOSkyp->getCubeMap();
280 if (envTex >= 0 && cube_map)
281 {
282 cube_map->bind();
283 cube_map->setMatrix(1);
284 }
285
286 GLint specularIndex = gPipeline.mObjectAlphaProgram.mAttribute[LLPipeline::GLSL_SPECULAR_COLOR];
287 if (specularIndex > 0)
288 {
289 glVertexAttrib4fARB(specularIndex, 0, 0, 0, 0);
290 }
291
292 S32 scatterTex = gPipeline.mObjectAlphaProgram.enableTexture(LLPipeline::GLSL_SCATTER_MAP);
293 LLViewerImage::bindTexture(gSky.mVOSkyp->getScatterMap(), scatterTex);
294
295 diffTex = gPipeline.mObjectAlphaProgram.enableTexture(LLPipeline::GLSL_DIFFUSE_MAP);
296 }
297
298 LLGLEnable blend(GL_BLEND);
299 LLGLSPipelineAlpha alphastate;
300 mIndicesDrawn += drawLoopSetTex(mAlphaFace, index_array, diffTex);
301 if (mVertexShaderLevel > 0)
302 {
303 gPipeline.mObjectAlphaProgram.disableTexture(LLPipeline::GLSL_ENVIRONMENT_MAP, GL_TEXTURE_CUBE_MAP_ARB);
304 LLCubeMap* cube_map = gSky.mVOSkyp->getCubeMap();
305 if (envTex >= 0 && cube_map)
306 {
307 cube_map->restoreMatrix();
308 }
309
310 gPipeline.mObjectAlphaProgram.disableTexture(LLPipeline::GLSL_SCATTER_MAP);
311 gPipeline.mObjectAlphaProgram.disableTexture(LLPipeline::GLSL_DIFFUSE_MAP);
312
313 glClientActiveTextureARB(GL_TEXTURE0_ARB);
314 glActiveTextureARB(GL_TEXTURE0_ARB);
315 glEnable(GL_TEXTURE_2D);
316 }
317
318 if (LLDrawPoolAlpha::sShowDebugAlpha)
319 {
320 gPipeline.disableLights();
321 if ((mVertexShaderLevel > 0))
322 {
323 gPipeline.mHighlightProgram.bind();
324 gPipeline.mHighlightProgram.vertexAttrib4f(LLPipeline::GLSL_MATERIAL_COLOR,1,0,0,1);
325 }
326
327 LLViewerImage::sSmokeImagep->bind();
328 LLOverrideFaceColor override_color(this, 1.f, 0.f, 0.f, 1.f);
329 glDisableClientState(GL_COLOR_ARRAY);
330
331 for (std::vector<LLFace*>::iterator iter = mAlphaFace.begin();
332 iter != mAlphaFace.end(); iter++)
333 {
334 LLFace *facep = *iter;
335 facep->renderIndexed(index_array);
336 }
337
338 if ((mVertexShaderLevel > 0))
339 {
340 gPipeline.mHighlightProgram.unbind();
341 }
342 }
343 }
344
345 glDisableClientState(GL_NORMAL_ARRAY);
346 glActiveTextureARB(GL_TEXTURE0_ARB);
347 glEnable(GL_TEXTURE_2D);
348 glClientActiveTextureARB(GL_TEXTURE0_ARB);
349 glDisableClientState(GL_TEXTURE_COORD_ARRAY);
350
351 if ((mVertexShaderLevel > 0))
352 {
353 glUseProgramObjectARB(0);
354 }
355
356 LLHUDText::renderAllHUD();
357 restore_matrices();
358}
359
360void LLDrawPoolHUD::endRenderPass(S32 pass)
361{
362}
363
364void LLDrawPoolHUD::renderForSelect()
365{
366 if (!sShowHUDAttachments)
367 {
368 return;
369 }
370
371 if (!gToolMgr->inEdit() && (gKeyboard->currentMask(TRUE) & MASK_ALT))
372 {
373 return;
374 }
375
376 if ((mDrawFace.empty() && mAlphaFace.empty() && mBumpFaces.empty()) || !mMemory.count())
377 {
378 return;
379 }
380
381 if (!setup_matrices(TRUE))
382 {
383 return;
384 }
385
386 glEnableClientState ( GL_VERTEX_ARRAY );
387 glDisableClientState(GL_TEXTURE_COORD_ARRAY);
388
389 bindGLVertexPointer();
390
391 LLGLSObjectSelect gls_objectselect;
392 LLGLDepthTest gls_depth(GL_TRUE);
393
394 for (std::vector<LLFace*>::iterator iter = mDrawFace.begin();
395 iter != mDrawFace.end(); iter++)
396 {
397 LLFace *facep = *iter;
398 LLDrawable *drawable = facep->getDrawable();
399 if (drawable && !drawable->isDead() && facep->getViewerObject() && facep->getViewerObject()->mGLName)
400 {
401 facep->renderForSelect();
402 }
403 }
404
405 for (bump_face_map_t::iterator iter = mBumpFaces.begin();
406 iter != mBumpFaces.end(); iter++)
407 {
408 face_array_t& faces = iter->second;
409 for (std::vector<LLFace*>::iterator iter = faces.begin();
410 iter != faces.end(); iter++)
411 {
412 LLFace *facep = *iter;
413 LLDrawable *drawable = facep->getDrawable();
414 if (drawable && !drawable->isDead() && facep->getViewerObject() && facep->getViewerObject()->mGLName)
415 {
416 facep->renderForSelect();
417 }
418 }
419 }
420
421 // ALPHA
422 {
423 glEnableClientState (GL_VERTEX_ARRAY);
424 glEnableClientState (GL_TEXTURE_COORD_ARRAY);
425
426 LLGLSObjectSelectAlpha* gls_selectalpha = NULL;
427 if (!LLDrawPoolAlpha::sShowDebugAlpha)
428 {
429 gls_selectalpha = new LLGLSObjectSelectAlpha;
430 }
431
432 glBlendFunc(GL_ONE, GL_ZERO);
433 glAlphaFunc(gPickTransparent ? GL_GEQUAL : GL_GREATER, 0.0f);
434
435 bindGLVertexPointer();
436 bindGLTexCoordPointer();
437
438 glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_ARB);
439 glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_RGB_ARB, GL_REPLACE);
440 glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_ALPHA_ARB, GL_MODULATE);
441
442 glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_RGB_ARB, GL_PREVIOUS);
443 glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_RGB_ARB, GL_SRC_COLOR);
444
445 glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_ALPHA_ARB, GL_TEXTURE);
446 glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_ALPHA_ARB, GL_SRC_ALPHA);
447
448 glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE1_ALPHA_ARB, GL_PREVIOUS);
449 glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND1_ALPHA_ARB, GL_SRC_ALPHA);
450
451 for (std::vector<LLFace*>::iterator iter = mAlphaFace.begin();
452 iter != mAlphaFace.end(); iter++)
453 {
454 LLFace *facep = *iter;
455 LLDrawable *drawable = facep->getDrawable();
456 if (drawable && !drawable->isDead() && facep->getViewerObject() && facep->getViewerObject()->mGLName)
457 {
458 facep->bindTexture();
459 facep->renderForSelect();
460 }
461 }
462
463 glAlphaFunc(GL_GREATER, 0.01f);
464 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
465
466 glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
467
468 glDisableClientState (GL_VERTEX_ARRAY);
469 glDisableClientState (GL_TEXTURE_COORD_ARRAY);
470
471 delete gls_selectalpha;
472 }
473
474 restore_matrices();
475}
476
477
478void LLDrawPoolHUD::renderFaceSelected(LLFace *facep, LLImageGL *image, const LLColor4 &color,
479 const S32 index_offset, const S32 index_count)
480{
481 facep->renderSelected(image, color, index_offset, index_count);
482}
483
484void LLDrawPoolHUD::resetDrawOrders()
485{
486 LLDrawPool::resetDrawOrders();
487 mBumpFaces.clear();
488 mAlphaFace.clear();
489}
490
491void LLDrawPoolHUD::dirtyTexture(const LLViewerImage *texturep)
492{
493 for (std::vector<LLFace*>::iterator iter = mReferences.begin();
494 iter != mReferences.end(); iter++)
495 {
496 LLFace *facep = *iter;
497 if (facep->getTexture() == texturep)
498 {
499 gPipeline.markTextured(facep->getDrawable());
500 }
501 }
502}
503
504void LLDrawPoolHUD::enqueue(LLFace *facep)
505{
506 if (facep->isState(LLFace::BACKLIST))
507 {
508 mMoveFace.put(facep);
509 }
510 else
511 {
512 const LLTextureEntry* te = facep->getTextureEntry();
513 LLViewerImage* imagep = facep->getTexture();
514 bool alpha = te->getColor().mV[3] < 0.999f;
515 alpha = alpha || (imagep->getComponents() == 4) || (imagep->getComponents() == 2);
516 if (alpha)
517 {
518 mAlphaFace.push_back(facep);
519 }
520 else if ((te->getBumpmap() || te->getShiny()))
521 {
522 mBumpFaces[imagep].push_back(facep);
523 }
524 else
525 {
526 mDrawFace.push_back(facep);
527 }
528 }
529 facep->mDistance = facep->mCenterAgent[VX];
530}
531
532// virtual
533BOOL LLDrawPoolHUD::addFace(LLFace *facep)
534{
535 facep->setState(LLFace::HUD_RENDER);
536 return LLDrawPool::addFace(facep);
537}
538
539// virtual
540BOOL LLDrawPoolHUD::removeFace(LLFace *facep)
541{
542 facep->clearState(LLFace::HUD_RENDER);
543 return LLDrawPool::removeFace(facep);
544}
545
546LLColor3 LLDrawPoolHUD::getDebugColor() const
547{
548 return LLColor3(1.f, 0.5f, 0.5f);
549}
550
551S32 LLDrawPoolHUD::getMaterialAttribIndex()
552{
553 switch (mRenderMode)
554 {
555 case POOL_BUMP:
556 return gPipeline.mObjectBumpProgram.mAttribute[LLPipeline::GLSL_MATERIAL_COLOR];
557 case POOL_ALPHA:
558 return gPipeline.mObjectAlphaProgram.mAttribute[LLPipeline::GLSL_MATERIAL_COLOR];
559 case POOL_SIMPLE:
560 return gPipeline.mObjectSimpleProgram.mAttribute[LLPipeline::GLSL_MATERIAL_COLOR];
561 default:
562 return 0;
563 break;
564 }
565}
diff --git a/linden/indra/newview/lldrawpoolhud.h b/linden/indra/newview/lldrawpoolhud.h
deleted file mode 100644
index 3f57bf7..0000000
--- a/linden/indra/newview/lldrawpoolhud.h
+++ /dev/null
@@ -1,75 +0,0 @@
1/**
2 * @file lldrawpoolhud.h
3 * @brief LLDrawPoolHUD class definition
4 *
5 * Copyright (c) 2006-2007, Linden Research, Inc.
6 *
7 * The source code in this file ("Source Code") is provided by Linden Lab
8 * to you under the terms of the GNU General Public License, version 2.0
9 * ("GPL"), unless you have obtained a separate licensing agreement
10 * ("Other License"), formally executed by you and Linden Lab. Terms of
11 * the GPL can be found in doc/GPL-license.txt in this distribution, or
12 * online at http://secondlife.com/developers/opensource/gplv2
13 *
14 * There are special exceptions to the terms and conditions of the GPL as
15 * it is applied to this Source Code. View the full text of the exception
16 * in the file doc/FLOSS-exception.txt in this software distribution, or
17 * online at http://secondlife.com/developers/opensource/flossexception
18 *
19 * By copying, modifying or distributing this software, you acknowledge
20 * that you have read and understood your obligations described above,
21 * and agree to abide by those obligations.
22 *
23 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
24 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
25 * COMPLETENESS OR PERFORMANCE.
26 */
27
28#ifndef LL_LLDRAWPOOLHUD_H
29#define LL_LLDRAWPOOLHUD_H
30
31#include "lldrawpool.h"
32
33class LLDrawPoolHUD : public LLDrawPool
34{
35public:
36 LLDrawPoolHUD();
37// /*virtual*/ ~LLDrawPoolHUD();
38
39 /*virtual*/ LLDrawPool *instancePool();
40
41 /*virtual*/ void prerender();
42 /*virtual*/ void beginRenderPass(S32 pass);
43 /*virtual*/ void render(S32 pass = 0);
44 /*virtual*/ void endRenderPass( S32 pass );
45 /*virtual*/ void renderForSelect();
46 /*virtual*/ void renderFaceSelected(LLFace* facep, LLImageGL* image, const LLColor4& color,
47 const S32 index_offset = 0, const S32 index_count = 0);
48// /*virtual*/ S32 rebuild();
49
50// /*virtual*/ LLViewerImage *getTexture();
51// /*virtual*/ LLViewerImage *getDebugTexture();
52 /*virtual*/ void dirtyTexture(const LLViewerImage *texturep);
53
54 /*virtual*/ void resetDrawOrders();
55
56 /*virtual*/ void enqueue(LLFace *face);
57 /*virtual*/ BOOL addFace(LLFace *face);
58 /*virtual*/ BOOL removeFace(LLFace *face);
59
60 virtual S32 getMaterialAttribIndex();
61
62// /*virtual*/ BOOL verify() const; // Verify that all data in the draw pool is correct!
63 /*virtual*/ LLColor3 getDebugColor() const; // For AGP debug display
64
65public:
66 static BOOL sShowHUDAttachments;
67
68protected:
69 typedef std::map<LLViewerImage*, face_array_t> bump_face_map_t;
70 bump_face_map_t mBumpFaces;
71 face_array_t mAlphaFace;
72 S32 mRenderMode; // RENDER_TYPE_VOLUME, RENDER_TYPE_BUMP, or RENDER_TYPE_ALPHA
73};
74
75#endif // LL_LLDRAWPOOLHUD_H
diff --git a/linden/indra/newview/lldrawpoolsimple.cpp b/linden/indra/newview/lldrawpoolsimple.cpp
index 031c170..ec8929e 100644
--- a/linden/indra/newview/lldrawpoolsimple.cpp
+++ b/linden/indra/newview/lldrawpoolsimple.cpp
@@ -30,55 +30,45 @@
30#include "lldrawpoolsimple.h" 30#include "lldrawpoolsimple.h"
31 31
32#include "llagent.h" 32#include "llagent.h"
33#include "llagparray.h"
34#include "lldrawable.h" 33#include "lldrawable.h"
35#include "llface.h" 34#include "llface.h"
36#include "llsky.h" 35#include "llsky.h"
37#include "pipeline.h" 36#include "pipeline.h"
38 37
39S32 LLDrawPoolSimple::sDiffTex = 0; 38class LLRenderPassGlow : public LLRenderPass
40
41LLDrawPoolSimple::LLDrawPoolSimple(LLViewerImage *texturep) :
42 LLDrawPool(POOL_SIMPLE,
43 DATA_SIMPLE_IL_MASK | DATA_COLORS_MASK,
44 DATA_SIMPLE_NIL_MASK), // ady temp
45 mTexturep(texturep)
46{ 39{
47} 40public:
41 LLRenderPassGlow(): LLRenderPass(LLRenderPass::PASS_GLOW) { }
42
43 enum
44 {
45 VERTEX_DATA_MASK = LLVertexBuffer::MAP_VERTEX |
46 LLVertexBuffer::MAP_TEXCOORD
47 };
48 48
49LLDrawPool *LLDrawPoolSimple::instancePool() 49 virtual U32 getVertexDataMask() { return VERTEX_DATA_MASK; }
50{
51 return new LLDrawPoolSimple(mTexturep);
52}
53 50
54BOOL LLDrawPoolSimple::match(LLFace* last_face, LLFace* facep) 51 virtual void prerender() { }
55{ 52
56 if (gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_CHAIN_FACES) && 53 void render(S32 pass = 0)
57 !last_face->isState(LLFace::LIGHT | LLFace::FULLBRIGHT) &&
58 !facep->isState(LLFace::LIGHT | LLFace::FULLBRIGHT) &&
59 facep->getIndicesStart() == last_face->getIndicesStart()+last_face->getIndicesCount() &&
60 facep->getRenderColor() == last_face->getRenderColor())
61 { 54 {
62 if (facep->isState(LLFace::GLOBAL)) 55 LLGLEnable blend(GL_BLEND);
63 { 56 glBlendFunc(GL_SRC_ALPHA, GL_ONE);
64 if (last_face->isState(LLFace::GLOBAL)) 57 renderTexture(LLRenderPass::PASS_GLOW, getVertexDataMask());
65 { 58 renderActive(LLRenderPass::PASS_GLOW, getVertexDataMask());
66 return TRUE; 59 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
67 }
68 }
69 else
70 {
71 if (!last_face->isState(LLFace::GLOBAL))
72 {
73 if (last_face->getRenderMatrix() == facep->getRenderMatrix())
74 {
75 return TRUE;
76 }
77 }
78 }
79 } 60 }
80 61
81 return FALSE; 62 void pushBatch(LLDrawInfo& params, U32 mask, BOOL texture = TRUE)
63 {
64 glColor4ubv(params.mGlowColor.mV);
65 LLRenderPass::pushBatch(params, mask, texture);
66 }
67};
68
69LLDrawPoolSimple::LLDrawPoolSimple() :
70 LLRenderPass(POOL_SIMPLE)
71{
82} 72}
83 73
84void LLDrawPoolSimple::prerender() 74void LLDrawPoolSimple::prerender()
@@ -91,156 +81,56 @@ void LLDrawPoolSimple::beginRenderPass(S32 pass)
91 glEnableClientState(GL_VERTEX_ARRAY); 81 glEnableClientState(GL_VERTEX_ARRAY);
92 glEnableClientState(GL_TEXTURE_COORD_ARRAY); 82 glEnableClientState(GL_TEXTURE_COORD_ARRAY);
93 glEnableClientState(GL_NORMAL_ARRAY); 83 glEnableClientState(GL_NORMAL_ARRAY);
94 if (gPipeline.getLightingDetail() >= 2) 84 glEnableClientState(GL_COLOR_ARRAY);
95 {
96 glEnableClientState(GL_COLOR_ARRAY);
97 }
98
99 if (mVertexShaderLevel > 0)
100 {
101 S32 scatterTex = gPipeline.mObjectSimpleProgram.enableTexture(LLPipeline::GLSL_SCATTER_MAP);
102 LLViewerImage::bindTexture(gSky.mVOSkyp->getScatterMap(), scatterTex);
103 sDiffTex = gPipeline.mObjectSimpleProgram.enableTexture(LLPipeline::GLSL_DIFFUSE_MAP);
104 }
105} 85}
106 86
107
108void LLDrawPoolSimple::render(S32 pass) 87void LLDrawPoolSimple::render(S32 pass)
109{ 88{
110 LLFastTimer t(LLFastTimer::FTM_RENDER_SIMPLE); 89 LLGLDisable blend(GL_BLEND);
111 if (mDrawFace.empty()) 90 LLGLDisable alpha_test(GL_ALPHA_TEST);
112 { 91
113 return;
114 }
115
116 bindGLVertexPointer();
117 bindGLTexCoordPointer();
118 bindGLNormalPointer();
119 if (gPipeline.getLightingDetail() >= 2)
120 { 92 {
121 bindGLColorPointer(); 93 LLFastTimer t(LLFastTimer::FTM_RENDER_SIMPLE);
94 gPipeline.enableLightsDynamic(1.f);
95 renderTexture(LLRenderPass::PASS_SIMPLE, getVertexDataMask());
96 renderActive(LLRenderPass::PASS_SIMPLE, getVertexDataMask());
122 } 97 }
123 98
124 LLViewerImage* tex = getTexture();
125 LLGLState alpha_test(GL_ALPHA_TEST, FALSE);
126 LLGLState blend(GL_BLEND, FALSE);
127
128 if (tex)
129 { 99 {
130 LLViewerImage::bindTexture(tex,sDiffTex); 100 LLFastTimer t(LLFastTimer::FTM_RENDER_GRASS);
131 if (tex->getPrimaryFormat() == GL_ALPHA) 101 LLGLEnable blend(GL_BLEND);
132 { 102 LLGLEnable alpha_test(GL_ALPHA_TEST);
133 // Enable Invisibility Hack 103 glAlphaFunc(GL_GREATER, 0.5f);
134 alpha_test.enable(); 104 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
135 blend.enable(); 105 //render grass
136 } 106 LLRenderPass::renderTexture(LLRenderPass::PASS_GRASS, getVertexDataMask());
107 glAlphaFunc(GL_GREATER, 0.01f);
137 } 108 }
138 else 109
139 { 110 {
140 LLImageGL::unbindTexture(sDiffTex, GL_TEXTURE_2D); 111 LLFastTimer t(LLFastTimer::FTM_RENDER_FULLBRIGHT);
112 U32 fullbright_mask = LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_TEXCOORD | LLVertexBuffer::MAP_COLOR;
113 gPipeline.enableLightsFullbright(LLColor4(1,1,1,1));
114 glDisableClientState(GL_NORMAL_ARRAY);
115 renderTexture(LLRenderPass::PASS_FULLBRIGHT, fullbright_mask);
116 renderActive(LLRenderPass::PASS_FULLBRIGHT, fullbright_mask);
141 } 117 }
142 118
143 drawLoop();
144}
145
146void LLDrawPoolSimple::endRenderPass(S32 pass)
147{
148 if (mVertexShaderLevel > 0)
149 {
150 gPipeline.mObjectSimpleProgram.disableTexture(LLPipeline::GLSL_SCATTER_MAP);
151 gPipeline.mObjectSimpleProgram.disableTexture(LLPipeline::GLSL_DIFFUSE_MAP);
152 glActiveTextureARB(GL_TEXTURE0_ARB);
153 glEnable(GL_TEXTURE_2D);
154 }
155
156 glDisableClientState(GL_TEXTURE_COORD_ARRAY);
157 glDisableClientState(GL_NORMAL_ARRAY);
158 if (gPipeline.getLightingDetail() >= 2)
159 { 119 {
120 LLFastTimer t(LLFastTimer::FTM_RENDER_GLOW);
160 glDisableClientState(GL_COLOR_ARRAY); 121 glDisableClientState(GL_COLOR_ARRAY);
122 LLRenderPassGlow glow;
123 glow.render();
161 } 124 }
162}
163
164void LLDrawPoolSimple::renderForSelect()
165{
166 if (mDrawFace.empty() || !mMemory.count())
167 {
168 return;
169 }
170
171 glEnableClientState ( GL_VERTEX_ARRAY );
172
173 bindGLVertexPointer();
174
175 for (std::vector<LLFace*>::iterator iter = mDrawFace.begin();
176 iter != mDrawFace.end(); iter++)
177 {
178 LLFace *facep = *iter;
179 LLDrawable *drawable = facep->getDrawable();
180 if (drawable && !drawable->isDead() && (facep->getViewerObject()->mGLName))
181 {
182 facep->renderForSelect();
183 }
184 }
185}
186
187 125
188void LLDrawPoolSimple::renderFaceSelected(LLFace *facep,
189 LLImageGL *image,
190 const LLColor4 &color,
191 const S32 index_offset, const S32 index_count)
192{
193 facep->renderSelected(image, color, index_offset, index_count);
194}
195
196
197void LLDrawPoolSimple::dirtyTexture(const LLViewerImage *texturep)
198{
199 if (mTexturep == texturep)
200 { 126 {
201 for (std::vector<LLFace*>::iterator iter = mReferences.begin(); 127 LLFastTimer t(LLFastTimer::FTM_RENDER_INVISIBLE);
202 iter != mReferences.end(); iter++) 128 U32 invisi_mask = LLVertexBuffer::MAP_VERTEX;
203 { 129 glDisableClientState(GL_TEXTURE_COORD_ARRAY);
204 LLFace *facep = *iter; 130 glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE);
205 gPipeline.markTextured(facep->getDrawable()); 131 renderInvisible(invisi_mask);
206 } 132 renderActive(LLRenderPass::PASS_INVISIBLE, invisi_mask);
133 glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
207 } 134 }
208} 135}
209 136
210LLViewerImage *LLDrawPoolSimple::getTexture()
211{
212 return mTexturep;
213}
214
215LLViewerImage *LLDrawPoolSimple::getDebugTexture()
216{
217 return mTexturep;
218}
219
220LLColor3 LLDrawPoolSimple::getDebugColor() const
221{
222 return LLColor3(1.f, 1.f, 1.f);
223}
224
225S32 LLDrawPoolSimple::getMaterialAttribIndex()
226{
227 return gPipeline.mObjectSimpleProgram.mAttribute[LLPipeline::GLSL_MATERIAL_COLOR];
228}
229
230// virtual
231void LLDrawPoolSimple::enableShade()
232{
233 glDisableClientState(GL_COLOR_ARRAY);
234}
235
236// virtual
237void LLDrawPoolSimple::disableShade()
238{
239 glEnableClientState(GL_COLOR_ARRAY);
240}
241
242// virtual
243void LLDrawPoolSimple::setShade(F32 shade)
244{
245 glColor4f(0,0,0,shade);
246}
diff --git a/linden/indra/newview/lldrawpoolsimple.h b/linden/indra/newview/lldrawpoolsimple.h
index 32fd320..85dcacf 100644
--- a/linden/indra/newview/lldrawpoolsimple.h
+++ b/linden/indra/newview/lldrawpoolsimple.h
@@ -30,64 +30,24 @@
30 30
31#include "lldrawpool.h" 31#include "lldrawpool.h"
32 32
33class LLFRInfo 33class LLDrawPoolSimple : public LLRenderPass
34{ 34{
35public: 35public:
36 U32 mPrimType;
37 U32 mGeomIndex;
38 U32 mGeomIndexEnd;
39 U32 mNumIndices;
40 U32 mIndicesStart;
41
42 LLFRInfo()
43 {
44 }
45
46 LLFRInfo(const U32 pt, const U32 gi, const U32 gc, const U32 ni, const U32 is) :
47 mPrimType(pt),
48 mGeomIndex(gi),
49 mGeomIndexEnd(gi+gc),
50 mNumIndices(ni),
51 mIndicesStart(is)
52 {
53 }
54};
55
56class LLDrawPoolSimple : public LLDrawPool
57{
58 LLPointer<LLViewerImage> mTexturep;
59public:
60 enum 36 enum
61 { 37 {
62 SHADER_LEVEL_LOCAL_LIGHTS = 2 38 VERTEX_DATA_MASK = LLVertexBuffer::MAP_VERTEX |
39 LLVertexBuffer::MAP_NORMAL |
40 LLVertexBuffer::MAP_TEXCOORD |
41 LLVertexBuffer::MAP_COLOR
63 }; 42 };
64 43 virtual U32 getVertexDataMask() { return VERTEX_DATA_MASK; }
65 LLDrawPoolSimple(LLViewerImage *texturep);
66
67 /*virtual*/ LLDrawPool *instancePool();
68 44
45 LLDrawPoolSimple();
46
69 /*virtual*/ void beginRenderPass(S32 pass); 47 /*virtual*/ void beginRenderPass(S32 pass);
70 /*virtual*/ void endRenderPass(S32 pass);
71 /*virtual*/ void render(S32 pass = 0); 48 /*virtual*/ void render(S32 pass = 0);
72 /*virtual*/ void renderFaceSelected(LLFace *facep,
73 LLImageGL *image,
74 const LLColor4 &color,
75 const S32 index_offset = 0, const S32 index_count = 0);
76 /*virtual*/ void prerender(); 49 /*virtual*/ void prerender();
77 /*virtual*/ void renderForSelect();
78 /*virtual*/ void dirtyTexture(const LLViewerImage *texturep);
79 /*virtual*/ LLViewerImage *getTexture();
80 /*virtual*/ LLViewerImage *getDebugTexture();
81 /*virtual*/ LLColor3 getDebugColor() const; // For AGP debug display
82 /*virtual*/ BOOL match(LLFace* last_face, LLFace* facep);
83
84 /*virtual*/ void enableShade();
85 /*virtual*/ void disableShade();
86 /*virtual*/ void setShade(F32 shade);
87
88 virtual S32 getMaterialAttribIndex();
89 50
90 static S32 sDiffTex;
91}; 51};
92 52
93#endif // LL_LLDRAWPOOLSIMPLE_H 53#endif // LL_LLDRAWPOOLSIMPLE_H
diff --git a/linden/indra/newview/lldrawpoolsky.cpp b/linden/indra/newview/lldrawpoolsky.cpp
index 52f9f16..8266892 100644
--- a/linden/indra/newview/lldrawpoolsky.cpp
+++ b/linden/indra/newview/lldrawpoolsky.cpp
@@ -31,7 +31,6 @@
31 31
32#include "imageids.h" 32#include "imageids.h"
33 33
34#include "llagparray.h"
35#include "llagent.h" 34#include "llagent.h"
36#include "lldrawable.h" 35#include "lldrawable.h"
37#include "llface.h" 36#include "llface.h"
@@ -45,7 +44,7 @@
45#include "pipeline.h" 44#include "pipeline.h"
46 45
47LLDrawPoolSky::LLDrawPoolSky() : 46LLDrawPoolSky::LLDrawPoolSky() :
48 LLDrawPool(POOL_SKY, DATA_SIMPLE_IL_MASK, DATA_SIMPLE_NIL_MASK) 47 LLFacePool(POOL_SKY)
49{ 48{
50} 49}
51 50
@@ -81,15 +80,17 @@ void LLDrawPoolSky::render(S32 pass)
81 glMatrixMode( GL_PROJECTION ); 80 glMatrixMode( GL_PROJECTION );
82 81
83 glPushMatrix(); 82 glPushMatrix();
84 gViewerWindow->setup3DRender(); 83 //gViewerWindow->setup3DRender();
84
85 glMatrixMode(GL_MODELVIEW);
86 glPushMatrix();
87 LLVector3 origin = gCamera->getOrigin();
88 glTranslatef(origin.mV[0], origin.mV[1], origin.mV[2]);
85 89
86 glEnableClientState(GL_VERTEX_ARRAY); 90 glEnableClientState(GL_VERTEX_ARRAY);
87 glEnableClientState(GL_TEXTURE_COORD_ARRAY); 91 glEnableClientState(GL_TEXTURE_COORD_ARRAY);
88 glDisableClientState(GL_NORMAL_ARRAY); 92 glDisableClientState(GL_NORMAL_ARRAY);
89 93
90 bindGLVertexPointer();
91 bindGLTexCoordPointer();
92
93 S32 face_count = (S32)mDrawFace.size(); 94 S32 face_count = (S32)mDrawFace.size();
94 95
95 for (S32 i = 0; i < llmin(6, face_count); ++i) 96 for (S32 i = 0; i < llmin(6, face_count); ++i)
@@ -97,13 +98,13 @@ void LLDrawPoolSky::render(S32 pass)
97 renderSkyCubeFace(i); 98 renderSkyCubeFace(i);
98 } 99 }
99 100
100 const LLFace *hbfaces[3]; 101 LLFace *hbfaces[3];
101 hbfaces[0] = NULL; 102 hbfaces[0] = NULL;
102 hbfaces[1] = NULL; 103 hbfaces[1] = NULL;
103 hbfaces[2] = NULL; 104 hbfaces[2] = NULL;
104 for (S32 curr_face = 0; curr_face < face_count; curr_face++) 105 for (S32 curr_face = 0; curr_face < face_count; curr_face++)
105 { 106 {
106 const LLFace* facep = mDrawFace[curr_face]; 107 LLFace* facep = mDrawFace[curr_face];
107 if (voskyp->isSameFace(LLVOSky::FACE_SUN, facep)) 108 if (voskyp->isSameFace(LLVOSky::FACE_SUN, facep))
108 { 109 {
109 hbfaces[0] = facep; 110 hbfaces[0] = facep;
@@ -137,11 +138,12 @@ void LLDrawPoolSky::render(S32 pass)
137 glMatrixMode( GL_PROJECTION ); 138 glMatrixMode( GL_PROJECTION );
138 glPopMatrix(); 139 glPopMatrix();
139 glMatrixMode( GL_MODELVIEW ); 140 glMatrixMode( GL_MODELVIEW );
141 glPopMatrix();
140} 142}
141 143
142void LLDrawPoolSky::renderSkyCubeFace(U8 side) 144void LLDrawPoolSky::renderSkyCubeFace(U8 side)
143{ 145{
144 const LLFace &face = *mDrawFace[LLVOSky::FACE_SIDE0 + side]; 146 LLFace &face = *mDrawFace[LLVOSky::FACE_SIDE0 + side];
145 if (!face.getGeomCount()) 147 if (!face.getGeomCount())
146 { 148 {
147 return; 149 return;
@@ -149,20 +151,20 @@ void LLDrawPoolSky::renderSkyCubeFace(U8 side)
149 151
150 mSkyTex[side].bindTexture(TRUE); 152 mSkyTex[side].bindTexture(TRUE);
151 153
152 face.renderIndexed(getRawIndices()); 154 face.renderIndexed();
153 155
154 if (LLSkyTex::doInterpolate()) 156 if (LLSkyTex::doInterpolate())
155 { 157 {
156 LLGLEnable blend(GL_BLEND); 158 LLGLEnable blend(GL_BLEND);
157 mSkyTex[side].bindTexture(FALSE); 159 mSkyTex[side].bindTexture(FALSE);
158 glColor4f(1, 1, 1, LLSkyTex::getInterpVal()); // lighting is disabled 160 glColor4f(1, 1, 1, LLSkyTex::getInterpVal()); // lighting is disabled
159 face.renderIndexed(getRawIndices()); 161 face.renderIndexed();
160 } 162 }
161 163
162 mIndicesDrawn += face.getIndicesCount(); 164 mIndicesDrawn += face.getIndicesCount();
163} 165}
164 166
165void LLDrawPoolSky::renderHeavenlyBody(U8 hb, const LLFace* face) 167void LLDrawPoolSky::renderHeavenlyBody(U8 hb, LLFace* face)
166{ 168{
167 if ( !mHB[hb]->getDraw() ) return; 169 if ( !mHB[hb]->getDraw() ) return;
168 if (! face->getGeomCount()) return; 170 if (! face->getGeomCount()) return;
@@ -171,13 +173,13 @@ void LLDrawPoolSky::renderHeavenlyBody(U8 hb, const LLFace* face)
171 tex->bind(); 173 tex->bind();
172 LLColor4 color(mHB[hb]->getInterpColor()); 174 LLColor4 color(mHB[hb]->getInterpColor());
173 LLOverrideFaceColor override(this, color); 175 LLOverrideFaceColor override(this, color);
174 face->renderIndexed(getRawIndices()); 176 face->renderIndexed();
175 mIndicesDrawn += face->getIndicesCount(); 177 mIndicesDrawn += face->getIndicesCount();
176} 178}
177 179
178 180
179 181
180void LLDrawPoolSky::renderSunHalo(const LLFace* face) 182void LLDrawPoolSky::renderSunHalo(LLFace* face)
181{ 183{
182 if (! mHB[0]->getDraw()) return; 184 if (! mHB[0]->getDraw()) return;
183 if (! face->getGeomCount()) return; 185 if (! face->getGeomCount()) return;
@@ -188,7 +190,7 @@ void LLDrawPoolSky::renderSunHalo(const LLFace* face)
188 color.mV[3] = llclamp(mHB[0]->getHaloBrighness(), 0.f, 1.f); 190 color.mV[3] = llclamp(mHB[0]->getHaloBrighness(), 0.f, 1.f);
189 191
190 LLOverrideFaceColor override(this, color); 192 LLOverrideFaceColor override(this, color);
191 face->renderIndexed(getRawIndices()); 193 face->renderIndexed();
192 mIndicesDrawn += face->getIndicesCount(); 194 mIndicesDrawn += face->getIndicesCount();
193} 195}
194 196
diff --git a/linden/indra/newview/lldrawpoolsky.h b/linden/indra/newview/lldrawpoolsky.h
index d65fc9f..b9c1dda 100644
--- a/linden/indra/newview/lldrawpoolsky.h
+++ b/linden/indra/newview/lldrawpoolsky.h
@@ -33,13 +33,21 @@
33class LLSkyTex; 33class LLSkyTex;
34class LLHeavenBody; 34class LLHeavenBody;
35 35
36class LLDrawPoolSky : public LLDrawPool 36class LLDrawPoolSky : public LLFacePool
37{ 37{
38private: 38private:
39 LLSkyTex *mSkyTex; 39 LLSkyTex *mSkyTex;
40 LLHeavenBody *mHB[2]; // Sun and Moon 40 LLHeavenBody *mHB[2]; // Sun and Moon
41 41
42public: 42public:
43 enum
44 {
45 VERTEX_DATA_MASK = LLVertexBuffer::MAP_VERTEX |
46 LLVertexBuffer::MAP_TEXCOORD
47 };
48
49 virtual U32 getVertexDataMask() { return VERTEX_DATA_MASK; }
50
43 LLDrawPoolSky(); 51 LLDrawPoolSky();
44 52
45 /*virtual*/ LLDrawPool *instancePool(); 53 /*virtual*/ LLDrawPool *instancePool();
@@ -52,8 +60,8 @@ public:
52 void setMoon(LLHeavenBody* moon) { mHB[1] = moon; } 60 void setMoon(LLHeavenBody* moon) { mHB[1] = moon; }
53 61
54 void renderSkyCubeFace(U8 side); 62 void renderSkyCubeFace(U8 side);
55 void renderHeavenlyBody(U8 hb, const LLFace* face); 63 void renderHeavenlyBody(U8 hb, LLFace* face);
56 void renderSunHalo(const LLFace* face); 64 void renderSunHalo(LLFace* face);
57 65
58 virtual S32 getMaterialAttribIndex() { return 0; } 66 virtual S32 getMaterialAttribIndex() { return 0; }
59}; 67};
diff --git a/linden/indra/newview/lldrawpoolstars.cpp b/linden/indra/newview/lldrawpoolstars.cpp
index a0eedb8..3d4eebb 100644
--- a/linden/indra/newview/lldrawpoolstars.cpp
+++ b/linden/indra/newview/lldrawpoolstars.cpp
@@ -33,9 +33,10 @@
33#include "llsky.h" 33#include "llsky.h"
34#include "llvostars.h" 34#include "llvostars.h"
35#include "pipeline.h" 35#include "pipeline.h"
36#include "llviewercamera.h"
36 37
37LLDrawPoolStars::LLDrawPoolStars() : 38LLDrawPoolStars::LLDrawPoolStars() :
38 LLDrawPool(POOL_STARS, DATA_VERTICES_MASK | DATA_COLORS_MASK, 0) 39 LLFacePool(POOL_STARS)
39{ 40{
40} 41}
41 42
@@ -72,28 +73,42 @@ void LLDrawPoolStars::render(S32 pass)
72 73
73 gPipeline.disableLights(); 74 gPipeline.disableLights();
74 75
75 glPointSize(2.0); 76 GLint viewport[4];
76 77
77 bindGLVertexPointer(); 78 glGetIntegerv(GL_VIEWPORT, viewport);
79
80 if (viewport[2] > 512 && viewport[3] > 512)
81 {
82 glPointSize(2.f);
83 }
84
85 LLVector3 origin = gCamera->getOrigin();
86 glPushMatrix();
87 glTranslatef(origin.mV[0], origin.mV[1], origin.mV[2]);
78 88
79 glEnableClientState(GL_COLOR_ARRAY); 89 glEnableClientState(GL_COLOR_ARRAY);
80 bindGLColorPointer();
81 90
82 S32 face_count = (S32)mDrawFace.size(); 91 S32 face_count = (S32)mDrawFace.size();
83 for (S32 curr_face = 0; curr_face < face_count; curr_face++) 92 for (S32 curr_face = 0; curr_face < face_count; curr_face++)
84 { 93 {
85 const LLFace* face = mDrawFace[curr_face]; 94 LLFace* face = mDrawFace[curr_face];
86 if (!face->getGeomCount()) 95 if (!face->getGeomCount())
87 { 96 {
88 continue; 97 continue;
89 } 98 }
90 99
91 // render the stars as a sphere centered at viewer camera 100 // render the stars as a sphere centered at viewer camera
92 101 if (face->mVertexBuffer.notNull())
93 face->renderIndexed(getRawIndices()); 102 {
94 mIndicesDrawn += face->getIndicesCount(); 103 face->mVertexBuffer->setBuffer(getVertexDataMask());
104 U32* indicesp = (U32*) face->mVertexBuffer->getIndicesPointer();
105 glDrawElements(GL_POINTS, face->getIndicesCount(), GL_UNSIGNED_INT, indicesp);
106 mIndicesDrawn += face->getIndicesCount();
107 }
95 } 108 }
96 glDisableClientState(GL_COLOR_ARRAY); 109 glDisableClientState(GL_COLOR_ARRAY);
110 glPointSize(1.f);
111 glPopMatrix();
97} 112}
98 113
99 114
diff --git a/linden/indra/newview/lldrawpoolstars.h b/linden/indra/newview/lldrawpoolstars.h
index 6343a93..1eade29 100644
--- a/linden/indra/newview/lldrawpoolstars.h
+++ b/linden/indra/newview/lldrawpoolstars.h
@@ -30,9 +30,17 @@
30 30
31#include "lldrawpool.h" 31#include "lldrawpool.h"
32 32
33class LLDrawPoolStars : public LLDrawPool 33class LLDrawPoolStars : public LLFacePool
34{ 34{
35public: 35public:
36 enum
37 {
38 VERTEX_DATA_MASK = LLVertexBuffer::MAP_VERTEX |
39 LLVertexBuffer::MAP_COLOR
40 };
41
42 virtual U32 getVertexDataMask() { return VERTEX_DATA_MASK; }
43
36 LLDrawPoolStars(); 44 LLDrawPoolStars();
37 45
38 /*virtual*/ LLDrawPool *instancePool(); 46 /*virtual*/ LLDrawPool *instancePool();
diff --git a/linden/indra/newview/lldrawpoolterrain.cpp b/linden/indra/newview/lldrawpoolterrain.cpp
index 1390fc9..8ac053c 100644
--- a/linden/indra/newview/lldrawpoolterrain.cpp
+++ b/linden/indra/newview/lldrawpoolterrain.cpp
@@ -32,7 +32,6 @@
32#include "llfasttimer.h" 32#include "llfasttimer.h"
33 33
34#include "llagent.h" 34#include "llagent.h"
35#include "llagparray.h"
36#include "llviewercontrol.h" 35#include "llviewercontrol.h"
37#include "lldrawable.h" 36#include "lldrawable.h"
38#include "llface.h" 37#include "llface.h"
@@ -56,7 +55,7 @@ S32 LLDrawPoolTerrain::sDetailMode = 1;
56F32 LLDrawPoolTerrain::sDetailScale = DETAIL_SCALE; 55F32 LLDrawPoolTerrain::sDetailScale = DETAIL_SCALE;
57 56
58LLDrawPoolTerrain::LLDrawPoolTerrain(LLViewerImage *texturep) : 57LLDrawPoolTerrain::LLDrawPoolTerrain(LLViewerImage *texturep) :
59 LLDrawPool(POOL_TERRAIN, DATA_SIMPLE_IL_MASK | DATA_COLORS_MASK | DATA_TEX_COORDS1_MASK, DATA_SIMPLE_NIL_MASK), 58 LLFacePool(POOL_TERRAIN),
60 mTexturep(texturep) 59 mTexturep(texturep)
61{ 60{
62 // Hack! 61 // Hack!
@@ -94,6 +93,13 @@ void LLDrawPoolTerrain::prerender()
94#if 0 // 1.9.2 93#if 0 // 1.9.2
95 mVertexShaderLevel = gPipeline.getVertexShaderLevel(LLPipeline::SHADER_ENVIRONMENT); 94 mVertexShaderLevel = gPipeline.getVertexShaderLevel(LLPipeline::SHADER_ENVIRONMENT);
96#endif 95#endif
96 sDetailMode = gSavedSettings.getS32("RenderTerrainDetail");
97}
98
99//static
100S32 LLDrawPoolTerrain::getDetailMode()
101{
102 return sDetailMode;
97} 103}
98 104
99void LLDrawPoolTerrain::render(S32 pass) 105void LLDrawPoolTerrain::render(S32 pass)
@@ -105,6 +111,15 @@ void LLDrawPoolTerrain::render(S32 pass)
105 return; 111 return;
106 } 112 }
107 113
114 // Hack! Get the region that this draw pool is rendering from!
115 LLViewerRegion *regionp = mDrawFace[0]->getDrawable()->getVObj()->getRegion();
116 LLVLComposition *compp = regionp->getComposition();
117 for (S32 i = 0; i < 4; i++)
118 {
119 compp->mDetailTextures[i]->setBoostLevel(LLViewerImage::BOOST_TERRAIN);
120 compp->mDetailTextures[i]->addTextureStats(1024.f*1024.f); // assume large pixel area
121 }
122
108 if (!gGLManager.mHasMultitexture) 123 if (!gGLManager.mHasMultitexture)
109 { 124 {
110 // No mulititexture, render simple land. 125 // No mulititexture, render simple land.
@@ -171,25 +186,16 @@ void LLDrawPoolTerrain::renderFull4TUShader()
171 glEnableClientState(GL_VERTEX_ARRAY); 186 glEnableClientState(GL_VERTEX_ARRAY);
172 glEnableClientState(GL_NORMAL_ARRAY); 187 glEnableClientState(GL_NORMAL_ARRAY);
173 188
174 bindGLVertexPointer();
175 bindGLNormalPointer();
176 if (gPipeline.getLightingDetail() >= 2) 189 if (gPipeline.getLightingDetail() >= 2)
177 { 190 {
178 glEnableClientState(GL_COLOR_ARRAY); 191 glEnableClientState(GL_COLOR_ARRAY);
179 bindGLColorPointer();
180 } 192 }
181 193
182 glBlendFunc(GL_ONE_MINUS_SRC_ALPHA, GL_SRC_ALPHA); 194 glBlendFunc(GL_ONE_MINUS_SRC_ALPHA, GL_SRC_ALPHA);
183 195
184 // Hack! Get the region that this draw pool is rendering from! 196 // Hack! Get the region that this draw pool is rendering from!
185 LLViewerRegion *regionp = mDrawFace[0]->getDrawable()->getVObj()->getRegion(); 197 LLViewerRegion *regionp = mDrawFace[0]->getDrawable()->getVObj()->getRegion();
186 LLVLComposition *compp = regionp->getComposition(); 198 LLVLComposition *compp = regionp->getComposition();
187 for (S32 i = 0; i < 4; i++)
188 {
189 compp->mDetailTextures[i]->setBoostLevel(LLViewerImage::BOOST_TERRAIN);
190 compp->mDetailTextures[i]->addTextureStats(1024.f*1024.f); // assume large pixel area
191 }
192
193 LLViewerImage *detail_texture0p = compp->mDetailTextures[0]; 199 LLViewerImage *detail_texture0p = compp->mDetailTextures[0];
194 LLViewerImage *detail_texture1p = compp->mDetailTextures[1]; 200 LLViewerImage *detail_texture1p = compp->mDetailTextures[1];
195 LLViewerImage *detail_texture2p = compp->mDetailTextures[2]; 201 LLViewerImage *detail_texture2p = compp->mDetailTextures[2];
@@ -219,8 +225,7 @@ void LLDrawPoolTerrain::renderFull4TUShader()
219 S32 detailTex0 = gPipeline.mTerrainProgram.enableTexture(LLPipeline::GLSL_TERRAIN_DETAIL0); 225 S32 detailTex0 = gPipeline.mTerrainProgram.enableTexture(LLPipeline::GLSL_TERRAIN_DETAIL0);
220 S32 detailTex1 = gPipeline.mTerrainProgram.enableTexture(LLPipeline::GLSL_TERRAIN_DETAIL1); 226 S32 detailTex1 = gPipeline.mTerrainProgram.enableTexture(LLPipeline::GLSL_TERRAIN_DETAIL1);
221 S32 rampTex = gPipeline.mTerrainProgram.enableTexture(LLPipeline::GLSL_TERRAIN_ALPHARAMP); 227 S32 rampTex = gPipeline.mTerrainProgram.enableTexture(LLPipeline::GLSL_TERRAIN_ALPHARAMP);
222 S32 scatterTex = gPipeline.mTerrainProgram.enableTexture(LLPipeline::GLSL_SCATTER_MAP); 228
223
224 LLViewerImage::bindTexture(detail_texture0p,detailTex0); 229 LLViewerImage::bindTexture(detail_texture0p,detailTex0);
225 230
226 glClientActiveTextureARB(GL_TEXTURE0_ARB); 231 glClientActiveTextureARB(GL_TEXTURE0_ARB);
@@ -241,7 +246,6 @@ void LLDrawPoolTerrain::renderFull4TUShader()
241 246
242 glClientActiveTextureARB(GL_TEXTURE1_ARB); 247 glClientActiveTextureARB(GL_TEXTURE1_ARB);
243 glEnableClientState(GL_TEXTURE_COORD_ARRAY); 248 glEnableClientState(GL_TEXTURE_COORD_ARRAY);
244 bindGLTexCoordPointer(1);
245 249
246 // 250 //
247 // Stage 2: Interpolate detail1 with existing based on ramp 251 // Stage 2: Interpolate detail1 with existing based on ramp
@@ -258,9 +262,6 @@ void LLDrawPoolTerrain::renderFull4TUShader()
258 glTexGenfv(GL_S, GL_OBJECT_PLANE, tp0.mV); 262 glTexGenfv(GL_S, GL_OBJECT_PLANE, tp0.mV);
259 glTexGenfv(GL_T, GL_OBJECT_PLANE, tp1.mV); 263 glTexGenfv(GL_T, GL_OBJECT_PLANE, tp1.mV);
260 264
261 // Stage 4: Haze
262 LLViewerImage::bindTexture(gSky.mVOSkyp->getScatterMap(), scatterTex);
263
264 // 265 //
265 // Stage 3: Modulate with primary color for lighting 266 // Stage 3: Modulate with primary color for lighting
266 // 267 //
@@ -297,7 +298,6 @@ void LLDrawPoolTerrain::renderFull4TUShader()
297 glClientActiveTextureARB(GL_TEXTURE1_ARB); 298 glClientActiveTextureARB(GL_TEXTURE1_ARB);
298 glEnableClientState(GL_TEXTURE_COORD_ARRAY); 299 glEnableClientState(GL_TEXTURE_COORD_ARRAY);
299 glActiveTextureARB(GL_TEXTURE1_ARB); 300 glActiveTextureARB(GL_TEXTURE1_ARB);
300 bindGLTexCoordPointer(1);
301 301
302 // Set the texture matrix 302 // Set the texture matrix
303 glMatrixMode(GL_TEXTURE); 303 glMatrixMode(GL_TEXTURE);
@@ -329,7 +329,6 @@ void LLDrawPoolTerrain::renderFull4TUShader()
329 glClientActiveTextureARB(GL_TEXTURE3_ARB); 329 glClientActiveTextureARB(GL_TEXTURE3_ARB);
330 glActiveTextureARB(GL_TEXTURE3_ARB); 330 glActiveTextureARB(GL_TEXTURE3_ARB);
331 glEnableClientState(GL_TEXTURE_COORD_ARRAY); 331 glEnableClientState(GL_TEXTURE_COORD_ARRAY);
332 bindGLTexCoordPointer(1);
333 332
334 // Set the texture matrix 333 // Set the texture matrix
335 glMatrixMode(GL_TEXTURE); 334 glMatrixMode(GL_TEXTURE);
@@ -342,7 +341,6 @@ void LLDrawPoolTerrain::renderFull4TUShader()
342 } 341 }
343 342
344 // Disable multitexture 343 // Disable multitexture
345 gPipeline.mTerrainProgram.disableTexture(LLPipeline::GLSL_SCATTER_MAP);
346 gPipeline.mTerrainProgram.disableTexture(LLPipeline::GLSL_TERRAIN_ALPHARAMP); 344 gPipeline.mTerrainProgram.disableTexture(LLPipeline::GLSL_TERRAIN_ALPHARAMP);
347 gPipeline.mTerrainProgram.disableTexture(LLPipeline::GLSL_TERRAIN_DETAIL0); 345 gPipeline.mTerrainProgram.disableTexture(LLPipeline::GLSL_TERRAIN_DETAIL0);
348 gPipeline.mTerrainProgram.disableTexture(LLPipeline::GLSL_TERRAIN_DETAIL1); 346 gPipeline.mTerrainProgram.disableTexture(LLPipeline::GLSL_TERRAIN_DETAIL1);
@@ -396,18 +394,9 @@ void LLDrawPoolTerrain::renderFull4TU()
396 glEnableClientState(GL_VERTEX_ARRAY); 394 glEnableClientState(GL_VERTEX_ARRAY);
397 glEnableClientState(GL_NORMAL_ARRAY); 395 glEnableClientState(GL_NORMAL_ARRAY);
398 396
399 bindGLVertexPointer();
400 bindGLNormalPointer();
401
402 // Hack! Get the region that this draw pool is rendering from! 397 // Hack! Get the region that this draw pool is rendering from!
403 LLViewerRegion *regionp = mDrawFace[0]->getDrawable()->getVObj()->getRegion(); 398 LLViewerRegion *regionp = mDrawFace[0]->getDrawable()->getVObj()->getRegion();
404 LLVLComposition *compp = regionp->getComposition(); 399 LLVLComposition *compp = regionp->getComposition();
405 for (S32 i = 0; i < 4; i++)
406 {
407 compp->mDetailTextures[i]->setBoostLevel(LLViewerImage::BOOST_TERRAIN);
408 compp->mDetailTextures[i]->addTextureStats(1024.f*1024.f); // assume large pixel area
409 }
410
411 LLViewerImage *detail_texture0p = compp->mDetailTextures[0]; 400 LLViewerImage *detail_texture0p = compp->mDetailTextures[0];
412 LLViewerImage *detail_texture1p = compp->mDetailTextures[1]; 401 LLViewerImage *detail_texture1p = compp->mDetailTextures[1];
413 LLViewerImage *detail_texture2p = compp->mDetailTextures[2]; 402 LLViewerImage *detail_texture2p = compp->mDetailTextures[2];
@@ -430,6 +419,7 @@ void LLDrawPoolTerrain::renderFull4TU()
430 // 419 //
431 // Stage 0: detail texture 0 420 // Stage 0: detail texture 0
432 // 421 //
422 glActiveTextureARB(GL_TEXTURE0_ARB);
433 LLViewerImage::bindTexture(detail_texture0p,0); 423 LLViewerImage::bindTexture(detail_texture0p,0);
434 glClientActiveTextureARB(GL_TEXTURE0_ARB); 424 glClientActiveTextureARB(GL_TEXTURE0_ARB);
435 425
@@ -451,12 +441,12 @@ void LLDrawPoolTerrain::renderFull4TU()
451 // 441 //
452 // Stage 1: Generate alpha ramp for detail0/detail1 transition 442 // Stage 1: Generate alpha ramp for detail0/detail1 transition
453 // 443 //
444 glActiveTextureARB(GL_TEXTURE1_ARB);
454 LLViewerImage::bindTexture(m2DAlphaRampImagep,1); 445 LLViewerImage::bindTexture(m2DAlphaRampImagep,1);
455 446
456 glEnable(GL_TEXTURE_2D); // Texture unit 1 447 glEnable(GL_TEXTURE_2D); // Texture unit 1
457 glClientActiveTextureARB(GL_TEXTURE1_ARB); 448 glClientActiveTextureARB(GL_TEXTURE1_ARB);
458 glEnableClientState(GL_TEXTURE_COORD_ARRAY); 449 glEnableClientState(GL_TEXTURE_COORD_ARRAY);
459 bindGLTexCoordPointer(1);
460 450
461 // Care about alpha only 451 // Care about alpha only
462 glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_ARB); 452 glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_ARB);
@@ -471,6 +461,7 @@ void LLDrawPoolTerrain::renderFull4TU()
471 // 461 //
472 // Stage 2: Interpolate detail1 with existing based on ramp 462 // Stage 2: Interpolate detail1 with existing based on ramp
473 // 463 //
464 glActiveTextureARB(GL_TEXTURE2_ARB);
474 LLViewerImage::bindTexture(detail_texture1p,2); 465 LLViewerImage::bindTexture(detail_texture1p,2);
475 glEnable(GL_TEXTURE_2D); // Texture unit 2 466 glEnable(GL_TEXTURE_2D); // Texture unit 2
476 glClientActiveTextureARB(GL_TEXTURE2_ARB); 467 glClientActiveTextureARB(GL_TEXTURE2_ARB);
@@ -496,6 +487,7 @@ void LLDrawPoolTerrain::renderFull4TU()
496 // 487 //
497 // Stage 3: Modulate with primary (vertex) color for lighting 488 // Stage 3: Modulate with primary (vertex) color for lighting
498 // 489 //
490 glActiveTextureARB(GL_TEXTURE3_ARB);
499 LLViewerImage::bindTexture(detail_texture1p,3); // bind any texture 491 LLViewerImage::bindTexture(detail_texture1p,3); // bind any texture
500 glEnable(GL_TEXTURE_2D); // Texture unit 3 492 glEnable(GL_TEXTURE_2D); // Texture unit 3
501 glClientActiveTextureARB(GL_TEXTURE3_ARB); 493 glClientActiveTextureARB(GL_TEXTURE3_ARB);
@@ -517,6 +509,7 @@ void LLDrawPoolTerrain::renderFull4TU()
517 509
518 // Stage 0: Write detail3 into base 510 // Stage 0: Write detail3 into base
519 // 511 //
512 glActiveTextureARB(GL_TEXTURE0_ARB);
520 LLViewerImage::bindTexture(detail_texture3p,0); 513 LLViewerImage::bindTexture(detail_texture3p,0);
521 glClientActiveTextureARB(GL_TEXTURE0_ARB); 514 glClientActiveTextureARB(GL_TEXTURE0_ARB);
522 515
@@ -538,14 +531,13 @@ void LLDrawPoolTerrain::renderFull4TU()
538 // 531 //
539 // Stage 1: Generate alpha ramp for detail2/detail3 transition 532 // Stage 1: Generate alpha ramp for detail2/detail3 transition
540 // 533 //
534 glActiveTextureARB(GL_TEXTURE1_ARB);
541 LLViewerImage::bindTexture(m2DAlphaRampImagep,1); 535 LLViewerImage::bindTexture(m2DAlphaRampImagep,1);
542 536
543 glEnable(GL_TEXTURE_2D); // Texture unit 1 537 glEnable(GL_TEXTURE_2D); // Texture unit 1
544 glClientActiveTextureARB(GL_TEXTURE1_ARB); 538 glClientActiveTextureARB(GL_TEXTURE1_ARB);
545 539
546 glEnableClientState(GL_TEXTURE_COORD_ARRAY); 540 glEnableClientState(GL_TEXTURE_COORD_ARRAY);
547 bindGLTexCoordPointer(1);
548
549 541
550 // Set the texture matrix 542 // Set the texture matrix
551 glMatrixMode(GL_TEXTURE); 543 glMatrixMode(GL_TEXTURE);
@@ -566,6 +558,7 @@ void LLDrawPoolTerrain::renderFull4TU()
566 // 558 //
567 // Stage 2: Interpolate detail2 with existing based on ramp 559 // Stage 2: Interpolate detail2 with existing based on ramp
568 // 560 //
561 glActiveTextureARB(GL_TEXTURE2_ARB);
569 LLViewerImage::bindTexture(detail_texture2p,2); 562 LLViewerImage::bindTexture(detail_texture2p,2);
570 glEnable(GL_TEXTURE_2D); // Texture unit 2 563 glEnable(GL_TEXTURE_2D); // Texture unit 2
571 glClientActiveTextureARB(GL_TEXTURE2_ARB); 564 glClientActiveTextureARB(GL_TEXTURE2_ARB);
@@ -592,19 +585,19 @@ void LLDrawPoolTerrain::renderFull4TU()
592 // 585 //
593 // Stage 3: Generate alpha ramp for detail1/detail2 transition 586 // Stage 3: Generate alpha ramp for detail1/detail2 transition
594 // 587 //
588 glActiveTextureARB(GL_TEXTURE3_ARB);
595 LLViewerImage::bindTexture(m2DAlphaRampImagep,3); 589 LLViewerImage::bindTexture(m2DAlphaRampImagep,3);
596 590
597 glEnable(GL_TEXTURE_2D); // Texture unit 3 591 glEnable(GL_TEXTURE_2D); // Texture unit 3
598 glClientActiveTextureARB(GL_TEXTURE3_ARB); 592 glClientActiveTextureARB(GL_TEXTURE3_ARB);
599 593
600 glEnableClientState(GL_TEXTURE_COORD_ARRAY); 594 glEnableClientState(GL_TEXTURE_COORD_ARRAY);
601 bindGLTexCoordPointer(1);
602 595
603 // Set the texture matrix 596 // Set the texture matrix
604 glMatrixMode(GL_TEXTURE); 597 glMatrixMode(GL_TEXTURE);
605 glLoadIdentity(); 598 glLoadIdentity();
606 glTranslatef(-1.f, 0.f, 0.f); 599 glTranslatef(-1.f, 0.f, 0.f);
607 600
608 // Set alpha texture and do lighting modulation 601 // Set alpha texture and do lighting modulation
609 glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_ARB); 602 glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_ARB);
610 glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_RGB_ARB, GL_MODULATE); 603 glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_RGB_ARB, GL_MODULATE);
@@ -675,18 +668,9 @@ void LLDrawPoolTerrain::renderFull2TU()
675 glEnableClientState(GL_VERTEX_ARRAY); 668 glEnableClientState(GL_VERTEX_ARRAY);
676 glEnableClientState(GL_NORMAL_ARRAY); 669 glEnableClientState(GL_NORMAL_ARRAY);
677 670
678 bindGLVertexPointer();
679 bindGLNormalPointer();
680
681 // Hack! Get the region that this draw pool is rendering from! 671 // Hack! Get the region that this draw pool is rendering from!
682 LLViewerRegion *regionp = mDrawFace[0]->getDrawable()->getVObj()->getRegion(); 672 LLViewerRegion *regionp = mDrawFace[0]->getDrawable()->getVObj()->getRegion();
683 LLVLComposition *compp = regionp->getComposition(); 673 LLVLComposition *compp = regionp->getComposition();
684 for (S32 i = 0; i < 4; i++)
685 {
686 compp->mDetailTextures[i]->setBoostLevel(LLViewerImage::BOOST_TERRAIN);
687 compp->mDetailTextures[i]->addTextureStats(1024.f*1024.f); // assume large pixel area
688 }
689
690 LLViewerImage *detail_texture0p = compp->mDetailTextures[0]; 674 LLViewerImage *detail_texture0p = compp->mDetailTextures[0];
691 LLViewerImage *detail_texture1p = compp->mDetailTextures[1]; 675 LLViewerImage *detail_texture1p = compp->mDetailTextures[1];
692 LLViewerImage *detail_texture2p = compp->mDetailTextures[2]; 676 LLViewerImage *detail_texture2p = compp->mDetailTextures[2];
@@ -743,7 +727,6 @@ void LLDrawPoolTerrain::renderFull2TU()
743 glDisable(GL_TEXTURE_GEN_S); 727 glDisable(GL_TEXTURE_GEN_S);
744 glDisable(GL_TEXTURE_GEN_T); 728 glDisable(GL_TEXTURE_GEN_T);
745 glEnableClientState(GL_TEXTURE_COORD_ARRAY); 729 glEnableClientState(GL_TEXTURE_COORD_ARRAY);
746 bindGLTexCoordPointer(1);
747 730
748 // Care about alpha only 731 // Care about alpha only
749 glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_ARB); 732 glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_ARB);
@@ -800,7 +783,6 @@ void LLDrawPoolTerrain::renderFull2TU()
800 glTranslatef(-1.f, 0.f, 0.f); 783 glTranslatef(-1.f, 0.f, 0.f);
801 784
802 glEnableClientState(GL_TEXTURE_COORD_ARRAY); 785 glEnableClientState(GL_TEXTURE_COORD_ARRAY);
803 bindGLTexCoordPointer(1);
804 786
805 // Care about alpha only 787 // Care about alpha only
806 glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_ARB); 788 glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_ARB);
@@ -858,7 +840,6 @@ void LLDrawPoolTerrain::renderFull2TU()
858 glTranslatef(-2.f, 0.f, 0.f); 840 glTranslatef(-2.f, 0.f, 0.f);
859 841
860 glEnableClientState(GL_TEXTURE_COORD_ARRAY); 842 glEnableClientState(GL_TEXTURE_COORD_ARRAY);
861 bindGLTexCoordPointer(1);
862 843
863 // Care about alpha only 844 // Care about alpha only
864 glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_ARB); 845 glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_ARB);
@@ -938,9 +919,6 @@ void LLDrawPoolTerrain::renderSimple()
938 glEnableClientState(GL_VERTEX_ARRAY); 919 glEnableClientState(GL_VERTEX_ARRAY);
939 glEnableClientState(GL_NORMAL_ARRAY); 920 glEnableClientState(GL_NORMAL_ARRAY);
940 921
941 bindGLVertexPointer();
942 bindGLNormalPointer();
943
944 LLVector4 tp0, tp1; 922 LLVector4 tp0, tp1;
945 923
946 //---------------------------------------------------------------------------- 924 //----------------------------------------------------------------------------
@@ -1018,9 +996,6 @@ void LLDrawPoolTerrain::renderOwnership()
1018 glEnableClientState(GL_VERTEX_ARRAY); 996 glEnableClientState(GL_VERTEX_ARRAY);
1019 glDisableClientState(GL_NORMAL_ARRAY); 997 glDisableClientState(GL_NORMAL_ARRAY);
1020 998
1021 bindGLVertexPointer();
1022 bindGLTexCoordPointer(0);
1023
1024 LLViewerImage::bindTexture(texturep); 999 LLViewerImage::bindTexture(texturep);
1025 1000
1026 glClientActiveTextureARB(GL_TEXTURE0_ARB); 1001 glClientActiveTextureARB(GL_TEXTURE0_ARB);
@@ -1036,12 +1011,12 @@ void LLDrawPoolTerrain::renderOwnership()
1036 const F32 TEXTURE_FUDGE = 257.f / 256.f; 1011 const F32 TEXTURE_FUDGE = 257.f / 256.f;
1037 glScalef( TEXTURE_FUDGE, TEXTURE_FUDGE, 1.f ); 1012 glScalef( TEXTURE_FUDGE, TEXTURE_FUDGE, 1.f );
1038 1013
1039 const U32* index_array = getRawIndices();
1040 for (std::vector<LLFace*>::iterator iter = mDrawFace.begin(); 1014 for (std::vector<LLFace*>::iterator iter = mDrawFace.begin();
1041 iter != mDrawFace.end(); iter++) 1015 iter != mDrawFace.end(); iter++)
1042 { 1016 {
1043 LLFace *facep = *iter; 1017 LLFace *facep = *iter;
1044 facep->renderIndexed(index_array); 1018 facep->renderIndexed(LLVertexBuffer::MAP_VERTEX |
1019 LLVertexBuffer::MAP_TEXCOORD);
1045 } 1020 }
1046 1021
1047 glMatrixMode(GL_TEXTURE); 1022 glMatrixMode(GL_TEXTURE);
@@ -1055,14 +1030,13 @@ void LLDrawPoolTerrain::renderOwnership()
1055 1030
1056void LLDrawPoolTerrain::renderForSelect() 1031void LLDrawPoolTerrain::renderForSelect()
1057{ 1032{
1058 if (mDrawFace.empty() || !mMemory.count()) 1033 if (mDrawFace.empty())
1059 { 1034 {
1060 return; 1035 return;
1061 } 1036 }
1062 1037
1063 glEnableClientState ( GL_VERTEX_ARRAY ); 1038
1064 1039 LLImageGL::unbindTexture(0);
1065 bindGLVertexPointer();
1066 1040
1067 for (std::vector<LLFace*>::iterator iter = mDrawFace.begin(); 1041 for (std::vector<LLFace*>::iterator iter = mDrawFace.begin();
1068 iter != mDrawFace.end(); iter++) 1042 iter != mDrawFace.end(); iter++)
@@ -1070,14 +1044,14 @@ void LLDrawPoolTerrain::renderForSelect()
1070 LLFace *facep = *iter; 1044 LLFace *facep = *iter;
1071 if (!facep->getDrawable()->isDead() && (facep->getDrawable()->getVObj()->mGLName)) 1045 if (!facep->getDrawable()->isDead() && (facep->getDrawable()->getVObj()->mGLName))
1072 { 1046 {
1073 facep->renderForSelect(); 1047 facep->renderForSelect(LLVertexBuffer::MAP_VERTEX);
1074 } 1048 }
1075 } 1049 }
1076} 1050}
1077 1051
1078void LLDrawPoolTerrain::dirtyTexture(const LLViewerImage *texturep) 1052void LLDrawPoolTerrain::dirtyTextures(const std::set<LLViewerImage*>& textures)
1079{ 1053{
1080 if (mTexturep == texturep) 1054 if (textures.find(mTexturep) != textures.end())
1081 { 1055 {
1082 for (std::vector<LLFace*>::iterator iter = mReferences.begin(); 1056 for (std::vector<LLFace*>::iterator iter = mReferences.begin();
1083 iter != mReferences.end(); iter++) 1057 iter != mReferences.end(); iter++)
diff --git a/linden/indra/newview/lldrawpoolterrain.h b/linden/indra/newview/lldrawpoolterrain.h
index b75d7cf..57fab9e 100644
--- a/linden/indra/newview/lldrawpoolterrain.h
+++ b/linden/indra/newview/lldrawpoolterrain.h
@@ -30,10 +30,22 @@
30 30
31#include "lldrawpool.h" 31#include "lldrawpool.h"
32 32
33class LLDrawPoolTerrain : public LLDrawPool 33class LLDrawPoolTerrain : public LLFacePool
34{ 34{
35 LLPointer<LLViewerImage> mTexturep; 35 LLPointer<LLViewerImage> mTexturep;
36public: 36public:
37 enum
38 {
39 VERTEX_DATA_MASK = LLVertexBuffer::MAP_VERTEX |
40 LLVertexBuffer::MAP_NORMAL |
41 LLVertexBuffer::MAP_TEXCOORD |
42 LLVertexBuffer::MAP_TEXCOORD2 |
43 LLVertexBuffer::MAP_COLOR
44 };
45
46 virtual U32 getVertexDataMask() { return VERTEX_DATA_MASK; }
47 static S32 getDetailMode();
48
37 LLDrawPoolTerrain(LLViewerImage *texturep); 49 LLDrawPoolTerrain(LLViewerImage *texturep);
38 virtual ~LLDrawPoolTerrain(); 50 virtual ~LLDrawPoolTerrain();
39 51
@@ -43,7 +55,7 @@ public:
43 /*virtual*/ void render(S32 pass = 0); 55 /*virtual*/ void render(S32 pass = 0);
44 /*virtual*/ void prerender(); 56 /*virtual*/ void prerender();
45 /*virtual*/ void renderForSelect(); 57 /*virtual*/ void renderForSelect();
46 /*virtual*/ void dirtyTexture(const LLViewerImage *texturep); 58 /*virtual*/ void dirtyTextures(const std::set<LLViewerImage*>& textures);
47 /*virtual*/ LLViewerImage *getTexture(); 59 /*virtual*/ LLViewerImage *getTexture();
48 /*virtual*/ LLViewerImage *getDebugTexture(); 60 /*virtual*/ LLViewerImage *getDebugTexture();
49 /*virtual*/ LLColor3 getDebugColor() const; // For AGP debug display 61 /*virtual*/ LLColor3 getDebugColor() const; // For AGP debug display
diff --git a/linden/indra/newview/lldrawpooltree.cpp b/linden/indra/newview/lldrawpooltree.cpp
index ad05d9a..36a4393 100644
--- a/linden/indra/newview/lldrawpooltree.cpp
+++ b/linden/indra/newview/lldrawpooltree.cpp
@@ -29,7 +29,6 @@
29 29
30#include "lldrawpooltree.h" 30#include "lldrawpooltree.h"
31 31
32#include "llagparray.h"
33#include "lldrawable.h" 32#include "lldrawable.h"
34#include "llface.h" 33#include "llface.h"
35#include "llsky.h" 34#include "llsky.h"
@@ -41,7 +40,7 @@
41S32 LLDrawPoolTree::sDiffTex = 0; 40S32 LLDrawPoolTree::sDiffTex = 0;
42 41
43LLDrawPoolTree::LLDrawPoolTree(LLViewerImage *texturep) : 42LLDrawPoolTree::LLDrawPoolTree(LLViewerImage *texturep) :
44 LLDrawPool(POOL_TREE, DATA_SIMPLE_IL_MASK, 0), 43 LLFacePool(POOL_TREE),
45 mTexturep(texturep) 44 mTexturep(texturep)
46{ 45{
47 mTexturep->bind(0); 46 mTexturep->bind(0);
@@ -55,7 +54,7 @@ LLDrawPool *LLDrawPoolTree::instancePool()
55 54
56void LLDrawPoolTree::prerender() 55void LLDrawPoolTree::prerender()
57{ 56{
58 mVertexShaderLevel = gPipeline.getVertexShaderLevel(LLPipeline::SHADER_OBJECT); 57 mVertexShaderLevel = 0;
59} 58}
60 59
61void LLDrawPoolTree::beginRenderPass(S32 pass) 60void LLDrawPoolTree::beginRenderPass(S32 pass)
@@ -63,13 +62,7 @@ void LLDrawPoolTree::beginRenderPass(S32 pass)
63 glEnableClientState(GL_VERTEX_ARRAY); 62 glEnableClientState(GL_VERTEX_ARRAY);
64 glEnableClientState(GL_NORMAL_ARRAY); 63 glEnableClientState(GL_NORMAL_ARRAY);
65 glEnableClientState(GL_TEXTURE_COORD_ARRAY); 64 glEnableClientState(GL_TEXTURE_COORD_ARRAY);
66 65 glAlphaFunc(GL_GREATER, 0.5f);
67 if ((mVertexShaderLevel > 0))
68 {
69 S32 scatterTex = gPipeline.mObjectSimpleProgram.enableTexture(LLPipeline::GLSL_SCATTER_MAP);
70 LLViewerImage::bindTexture(gSky.mVOSkyp->getScatterMap(), scatterTex);
71 sDiffTex = gPipeline.mObjectSimpleProgram.enableTexture(LLPipeline::GLSL_DIFFUSE_MAP);
72 }
73} 66}
74 67
75void LLDrawPoolTree::render(S32 pass) 68void LLDrawPoolTree::render(S32 pass)
@@ -83,34 +76,21 @@ void LLDrawPoolTree::render(S32 pass)
83 76
84 gPipeline.enableLightsDynamic(1.f); 77 gPipeline.enableLightsDynamic(1.f);
85 LLGLSPipelineAlpha gls_pipeline_alpha; 78 LLGLSPipelineAlpha gls_pipeline_alpha;
86
87 bindGLVertexPointer();
88 bindGLTexCoordPointer();
89 bindGLNormalPointer();
90
91 LLOverrideFaceColor color(this, 1.f, 1.f, 1.f, 1.f); 79 LLOverrideFaceColor color(this, 1.f, 1.f, 1.f, 1.f);
92 80
93 renderTree(); 81 renderTree();
94
95} 82}
96 83
97void LLDrawPoolTree::endRenderPass(S32 pass) 84void LLDrawPoolTree::endRenderPass(S32 pass)
98{ 85{
99 if ((mVertexShaderLevel > 0)) 86 glAlphaFunc(GL_GREATER, 0.01f);
100 {
101 gPipeline.mObjectSimpleProgram.disableTexture(LLPipeline::GLSL_SCATTER_MAP);
102 gPipeline.mObjectSimpleProgram.disableTexture(LLPipeline::GLSL_DIFFUSE_MAP);
103 glActiveTextureARB(GL_TEXTURE0_ARB);
104 glEnable(GL_TEXTURE_2D);
105 }
106
107 glDisableClientState(GL_NORMAL_ARRAY); 87 glDisableClientState(GL_NORMAL_ARRAY);
108 glDisableClientState(GL_TEXTURE_COORD_ARRAY); 88 glDisableClientState(GL_TEXTURE_COORD_ARRAY);
109} 89}
110 90
111void LLDrawPoolTree::renderForSelect() 91void LLDrawPoolTree::renderForSelect()
112{ 92{
113 if (mDrawFace.empty() || !mMemory.count()) 93 if (mDrawFace.empty())
114 { 94 {
115 return; 95 return;
116 } 96 }
@@ -123,10 +103,7 @@ void LLDrawPoolTree::renderForSelect()
123 LLGLSObjectSelectAlpha gls_alpha; 103 LLGLSObjectSelectAlpha gls_alpha;
124 104
125 glBlendFunc(GL_ONE, GL_ZERO); 105 glBlendFunc(GL_ONE, GL_ZERO);
126 glAlphaFunc(gPickTransparent ? GL_GEQUAL : GL_GREATER, 0.f); 106 glAlphaFunc(GL_GREATER, 0.5f);
127
128 bindGLVertexPointer();
129 bindGLTexCoordPointer();
130 107
131 glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_ARB); 108 glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_ARB);
132 glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_RGB_ARB, GL_REPLACE); 109 glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_RGB_ARB, GL_REPLACE);
@@ -166,6 +143,8 @@ void LLDrawPoolTree::renderTree(BOOL selecting)
166 } 143 }
167 } 144 }
168 145
146 U32 indices_drawn = 0;
147
169 glMatrixMode(GL_MODELVIEW); 148 glMatrixMode(GL_MODELVIEW);
170 149
171 for (std::vector<LLFace*>::iterator iter = mDrawFace.begin(); 150 for (std::vector<LLFace*>::iterator iter = mDrawFace.begin();
@@ -174,11 +153,14 @@ void LLDrawPoolTree::renderTree(BOOL selecting)
174 LLFace *face = *iter; 153 LLFace *face = *iter;
175 LLDrawable *drawablep = face->getDrawable(); 154 LLDrawable *drawablep = face->getDrawable();
176 155
177 if (drawablep->isDead()) 156 if (drawablep->isDead() || face->mVertexBuffer.isNull())
178 { 157 {
179 continue; 158 continue;
180 } 159 }
181 160
161 face->mVertexBuffer->setBuffer(LLDrawPoolTree::VERTEX_DATA_MASK);
162 U32* indicesp = (U32*) face->mVertexBuffer->getIndicesPointer();
163
182 // Render each of the trees 164 // Render each of the trees
183 LLVOTree *treep = (LLVOTree *)drawablep->getVObj(); 165 LLVOTree *treep = (LLVOTree *)drawablep->getVObj();
184 166
@@ -236,55 +218,26 @@ void LLDrawPoolTree::renderTree(BOOL selecting)
236 } 218 }
237 } 219 }
238 220
239 if (app_angle > (THRESH_ANGLE_FOR_BILLBOARD + BLEND_RANGE_FOR_BILLBOARD)) 221 if (app_angle < (THRESH_ANGLE_FOR_BILLBOARD - BLEND_RANGE_FOR_BILLBOARD))
240 {
241 //
242 // Draw only the full geometry tree
243 //
244 //stop_depth = (app_angle < THRESH_ANGLE_FOR_RECURSION_REDUCTION);
245 glAlphaFunc(GL_GREATER, 0.5f);
246 LLDrawPool::LLOverrideFaceColor clr(this, color);
247 treep->drawBranchPipeline(this, trunk_LOD, stop_depth, treep->mDepth, treep->mTrunkDepth, 1.0, treep->mTwist, droop, treep->mBranches, alpha);
248 }
249 else if (app_angle < (THRESH_ANGLE_FOR_BILLBOARD - BLEND_RANGE_FOR_BILLBOARD))
250 { 222 {
251 // 223 //
252 // Draw only the billboard 224 // Draw only the billboard
253 // 225 //
254 // Only the billboard, can use closer to normal alpha func. 226 // Only the billboard, can use closer to normal alpha func.
255 stop_depth = -1; 227 stop_depth = -1;
256 glAlphaFunc(GL_GREATER, 0.4f); 228 LLFacePool::LLOverrideFaceColor clr(this, color);
257 LLDrawPool::LLOverrideFaceColor clr(this, color); 229 indices_drawn += treep->drawBranchPipeline(indicesp, trunk_LOD, stop_depth, treep->mDepth, treep->mTrunkDepth, 1.0, treep->mTwist, droop, treep->mBranches, alpha);
258 treep->drawBranchPipeline(this, trunk_LOD, stop_depth, treep->mDepth, treep->mTrunkDepth, 1.0, treep->mTwist, droop, treep->mBranches, alpha);
259 } 230 }
260 else 231 else // if (app_angle > (THRESH_ANGLE_FOR_BILLBOARD + BLEND_RANGE_FOR_BILLBOARD))
261 { 232 {
262 // 233 //
263 // Draw a blended version including both billboard and full tree 234 // Draw only the full geometry tree
264 // 235 //
265 alpha = (app_angle - THRESH_ANGLE_FOR_BILLBOARD)/BLEND_RANGE_FOR_BILLBOARD; 236 //stop_depth = (app_angle < THRESH_ANGLE_FOR_RECURSION_REDUCTION);
266 BOOL billboard_depth = TRUE; // billboard gets alpha 237 LLFacePool::LLOverrideFaceColor clr(this, color);
267 if (alpha > 0.5f) 238 indices_drawn += treep->drawBranchPipeline(indicesp, trunk_LOD, stop_depth, treep->mDepth, treep->mTrunkDepth, 1.0, treep->mTwist, droop, treep->mBranches, alpha);
268 {
269 billboard_depth = FALSE;
270 }
271 alpha = alpha/2.f + 0.5f;
272
273 glAlphaFunc(GL_GREATER, alpha*0.5f);
274 {
275 LLGLDepthTest gls_depth(GL_TRUE, billboard_depth ? GL_FALSE : GL_TRUE);
276 color.mV[3] = (U8) (llclamp(alpha, 0.0f, 1.0f) * 255);
277 LLDrawPool::LLOverrideFaceColor clr(this, color);
278 treep->drawBranchPipeline(this, trunk_LOD, 0, treep->mDepth, treep->mTrunkDepth, 1.0, treep->mTwist, droop, treep->mBranches, alpha);
279 }
280 {
281 LLGLDepthTest gls_depth(GL_TRUE, billboard_depth ? GL_TRUE : GL_FALSE);
282 glAlphaFunc(GL_GREATER, (1.f - alpha)*0.1f);
283 color.mV[3] = (U8) (llclamp(1.f-alpha, 0.0f, 1.0f) * 255);
284 LLDrawPool::LLOverrideFaceColor clr(this, color);
285 treep->drawBranchPipeline(this, trunk_LOD, -1, treep->mDepth, treep->mTrunkDepth, 1.0, treep->mTwist, droop, treep->mBranches, 1.f - alpha);
286 }
287 } 239 }
240
288 glPopMatrix(); 241 glPopMatrix();
289 } 242 }
290 } 243 }
@@ -298,45 +251,21 @@ void LLDrawPoolTree::renderTree(BOOL selecting)
298 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); 251 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
299 } 252 }
300 } 253 }
301 glAlphaFunc(GL_GREATER, 0.01f);
302}
303
304
305S32 LLDrawPoolTree::rebuild()
306{
307 mRebuildTime++;
308 if (mRebuildTime > mRebuildFreq)
309 {
310 // Flush AGP to force an AGP realloc and reduce AGP fragmentation
311 flushAGP();
312 mRebuildTime = 0;
313 }
314 254
315 return 0; 255 addIndicesDrawn(indices_drawn);
316} 256}
317 257
318BOOL LLDrawPoolTree::verify() const 258BOOL LLDrawPoolTree::verify() const
319{ 259{
320 BOOL ok = TRUE; 260/* BOOL ok = TRUE;
321
322 // shared geometry. Just verify that it's there and correct.
323 261
324 // Verify all indices in the pool are in the right range
325 const U32 *indicesp = getRawIndices();
326 for (U32 i = 0; i < getIndexCount(); i++)
327 {
328 if (indicesp[i] > getVertexCount())
329 {
330 ok = FALSE;
331 llinfos << "Bad index in tree pool!" << llendl;
332 }
333 }
334
335 if (!ok) 262 if (!ok)
336 { 263 {
337 printDebugInfo(); 264 printDebugInfo();
338 } 265 }
339 return ok; 266 return ok;*/
267
268 return TRUE;
340} 269}
341 270
342LLViewerImage *LLDrawPoolTree::getTexture() 271LLViewerImage *LLDrawPoolTree::getTexture()
diff --git a/linden/indra/newview/lldrawpooltree.h b/linden/indra/newview/lldrawpooltree.h
index 5b4eb67..6e00460 100644
--- a/linden/indra/newview/lldrawpooltree.h
+++ b/linden/indra/newview/lldrawpooltree.h
@@ -30,10 +30,19 @@
30 30
31#include "lldrawpool.h" 31#include "lldrawpool.h"
32 32
33class LLDrawPoolTree : public LLDrawPool 33class LLDrawPoolTree : public LLFacePool
34{ 34{
35 LLPointer<LLViewerImage> mTexturep; 35 LLPointer<LLViewerImage> mTexturep;
36public: 36public:
37 enum
38 {
39 VERTEX_DATA_MASK = LLVertexBuffer::MAP_VERTEX |
40 LLVertexBuffer::MAP_NORMAL |
41 LLVertexBuffer::MAP_TEXCOORD
42 };
43
44 virtual U32 getVertexDataMask() { return VERTEX_DATA_MASK; }
45
37 LLDrawPoolTree(LLViewerImage *texturep); 46 LLDrawPoolTree(LLViewerImage *texturep);
38 47
39 /*virtual*/ LLDrawPool *instancePool(); 48 /*virtual*/ LLDrawPool *instancePool();
@@ -43,7 +52,6 @@ public:
43 /*virtual*/ void render(S32 pass = 0); 52 /*virtual*/ void render(S32 pass = 0);
44 /*virtual*/ void endRenderPass( S32 pass ); 53 /*virtual*/ void endRenderPass( S32 pass );
45 /*virtual*/ void renderForSelect(); 54 /*virtual*/ void renderForSelect();
46 /*virtual*/ S32 rebuild();
47 /*virtual*/ BOOL verify() const; 55 /*virtual*/ BOOL verify() const;
48 /*virtual*/ LLViewerImage *getTexture(); 56 /*virtual*/ LLViewerImage *getTexture();
49 /*virtual*/ LLViewerImage *getDebugTexture(); 57 /*virtual*/ LLViewerImage *getDebugTexture();
diff --git a/linden/indra/newview/lldrawpooltreenew.cpp b/linden/indra/newview/lldrawpooltreenew.cpp
deleted file mode 100644
index 326ab5f..0000000
--- a/linden/indra/newview/lldrawpooltreenew.cpp
+++ /dev/null
@@ -1,200 +0,0 @@
1/**
2 * @file lldrawpooltreenew.cpp
3 * @brief LLDrawPoolTreeNew class implementation
4 *
5 * Copyright (c) 2003-2007, Linden Research, Inc.
6 *
7 * The source code in this file ("Source Code") is provided by Linden Lab
8 * to you under the terms of the GNU General Public License, version 2.0
9 * ("GPL"), unless you have obtained a separate licensing agreement
10 * ("Other License"), formally executed by you and Linden Lab. Terms of
11 * the GPL can be found in doc/GPL-license.txt in this distribution, or
12 * online at http://secondlife.com/developers/opensource/gplv2
13 *
14 * There are special exceptions to the terms and conditions of the GPL as
15 * it is applied to this Source Code. View the full text of the exception
16 * in the file doc/FLOSS-exception.txt in this software distribution, or
17 * online at http://secondlife.com/developers/opensource/flossexception
18 *
19 * By copying, modifying or distributing this software, you acknowledge
20 * that you have read and understood your obligations described above,
21 * and agree to abide by those obligations.
22 *
23 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
24 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
25 * COMPLETENESS OR PERFORMANCE.
26 */
27
28#include "llviewerprecompiledheaders.h"
29
30#include "lldrawpooltreenew.h"
31
32#include "llagparray.h"
33#include "lldrawable.h"
34#include "llface.h"
35#include "llsky.h"
36#include "llvotreenew.h"
37#include "pipeline.h"
38
39LLDrawPoolTreeNew::LLDrawPoolTreeNew(LLViewerImage *texturep) :
40 LLDrawPool(POOL_TREE_NEW,
41 DATA_VERTICES_MASK | DATA_TEX_COORDS0_MASK | DATA_NORMALS_MASK,
42 0),
43 mTexturep(texturep)
44{
45}
46
47LLDrawPool *LLDrawPoolTreeNew::instancePool()
48{
49 return new LLDrawPoolTreeNew(mTexturep);
50}
51
52
53void LLDrawPoolTreeNew::prerender()
54{
55 mVertexShaderLevel = gPipeline.getVertexShaderLevel(LLPipeline::SHADER_OBJECT);
56}
57
58void LLDrawPoolTreeNew::render( S32 pass )
59{
60 if (mDrawFace.empty())
61 {
62 return;
63 }
64
65 LLGLSPipelineAlpha gls_pipeline_alpha;
66
67 glEnableClientState(GL_VERTEX_ARRAY);
68 glEnableClientState(GL_TEXTURE_COORD_ARRAY);
69 glEnableClientState(GL_NORMAL_ARRAY);
70
71 bindGLVertexPointer();
72 bindGLTexCoordPointer();
73 bindGLNormalPointer();
74
75 LLOverrideFaceColor color(this, 1.f, 1.f, 1.f, 1.f);
76
77 renderTree();
78}
79
80
81void LLDrawPoolTreeNew::renderForSelect()
82{
83 if (mDrawFace.empty())
84 {
85 return;
86 }
87
88 LLGLSPipelineAlpha gls_pipeline_alpha;
89
90 glEnableClientState(GL_VERTEX_ARRAY);
91 glDisableClientState(GL_TEXTURE_COORD_ARRAY);
92 glDisableClientState(GL_NORMAL_ARRAY);
93
94 bindGLVertexPointer();
95
96 renderTree(TRUE);
97
98 glDisableClientState(GL_VERTEX_ARRAY);
99
100}
101
102
103
104
105void LLDrawPoolTreeNew::renderTree(BOOL selecting)
106{
107
108 // Bind the texture for this tree.
109 LLViewerImage::bindTexture(mTexturep);
110
111 glMatrixMode(GL_MODELVIEW);
112 for (std::vector<LLFace*>::iterator iter = mDrawFace.begin();
113 iter != mDrawFace.end(); iter++)
114 {
115 LLFace *face = *iter;
116 LLDrawable *drawablep = face->getDrawable();
117
118 if (drawablep->isDead())
119 {
120 continue;
121 }
122 // Render each of the trees
123 LLVOTreeNew *treep = (LLVOTreeNew *)drawablep->getVObj();
124 if (!selecting || treep->mGLName != 0)
125 {
126 glPushMatrix();
127
128 // Translate to tree base HACK - adjustment in Z plants tree underground
129 const LLVector3 &pos_agent = treep->getPositionAgent();
130 glTranslatef(pos_agent.mV[VX], pos_agent.mV[VY], pos_agent.mV[VZ] - 0.1f);
131
132 // Rotate to tree position
133 F32 angle_radians, x, y, z;
134 treep->getRotation().getAngleAxis(&angle_radians, &x, &y, &z);
135 glRotatef(angle_radians * RAD_TO_DEG, x, y, z);
136
137 //glAlphaFunc(GL_GREATER, 0.5f);
138
139 treep->drawTree(*this);
140 glPopMatrix();
141 }
142 }
143
144 glAlphaFunc(GL_GREATER, 0.01f);
145}
146
147
148S32 LLDrawPoolTreeNew::rebuild()
149{
150 mRebuildTime++;
151 if (mRebuildTime > mRebuildFreq)
152 {
153 // Flush AGP to force an AGP realloc and reduce AGP fragmentation
154 flushAGP();
155 mRebuildTime = 0;
156 }
157
158 return 0;
159}
160
161BOOL LLDrawPoolTreeNew::verify() const
162{
163 BOOL ok = TRUE;
164
165 // shared geometry. Just verify that it's there and correct.
166
167 // Verify all indices in the pool are in the right range
168 const U32 *indicesp = getRawIndices();
169 U32 i;
170 for (i = 0; i < getIndexCount(); i++)
171 {
172 if (indicesp[i] > getVertexCount())
173 {
174 ok = FALSE;
175 llinfos << "Bad index in tree pool!" << llendl;
176 }
177 }
178
179 if (!ok)
180 {
181 printDebugInfo();
182 }
183 return ok;
184}
185
186LLViewerImage *LLDrawPoolTreeNew::getTexture()
187{
188 return mTexturep;
189}
190
191LLViewerImage *LLDrawPoolTreeNew::getDebugTexture()
192{
193 return mTexturep;
194}
195
196
197LLColor3 LLDrawPoolTreeNew::getDebugColor() const
198{
199 return LLColor3(1.f, 0.f, 1.f);
200}
diff --git a/linden/indra/newview/lldrawpoolwater.cpp b/linden/indra/newview/lldrawpoolwater.cpp
index e3802a1..cd2a615 100644
--- a/linden/indra/newview/lldrawpoolwater.cpp
+++ b/linden/indra/newview/lldrawpoolwater.cpp
@@ -35,7 +35,6 @@
35#include "m3math.h" 35#include "m3math.h"
36 36
37#include "llagent.h" // for gAgent for getRegion for getWaterHeight 37#include "llagent.h" // for gAgent for getRegion for getWaterHeight
38#include "llagparray.h"
39#include "llcubemap.h" 38#include "llcubemap.h"
40#include "lldrawable.h" 39#include "lldrawable.h"
41#include "llface.h" 40#include "llface.h"
@@ -63,11 +62,11 @@ int nhpo2(int v)
63} 62}
64 63
65static GLuint sScreenTex = 0; 64static GLuint sScreenTex = 0;
65BOOL LLDrawPoolWater::sSkipScreenCopy = FALSE;
66 66
67LLDrawPoolWater::LLDrawPoolWater() : 67LLDrawPoolWater::LLDrawPoolWater() :
68 LLDrawPool(POOL_WATER, DATA_SIMPLE_IL_MASK, DATA_SIMPLE_NIL_MASK) 68 LLFacePool(POOL_WATER)
69{ 69{
70 mCleanupUnused = TRUE;
71 mHBTex[0] = gImageList.getImage(gSunTextureID, TRUE, TRUE); 70 mHBTex[0] = gImageList.getImage(gSunTextureID, TRUE, TRUE);
72 mHBTex[0]->bind(); 71 mHBTex[0]->bind();
73 mHBTex[0]->setClamp(TRUE, TRUE); 72 mHBTex[0]->setClamp(TRUE, TRUE);
@@ -135,11 +134,21 @@ extern LLColor4U MAX_WATER_COLOR;
135void LLDrawPoolWater::render(S32 pass) 134void LLDrawPoolWater::render(S32 pass)
136{ 135{
137 LLFastTimer ftm(LLFastTimer::FTM_RENDER_WATER); 136 LLFastTimer ftm(LLFastTimer::FTM_RENDER_WATER);
138 if (mDrawFace.empty()) 137 if (mDrawFace.empty() || LLDrawable::getCurrentFrame() <= 1)
139 { 138 {
140 return; 139 return;
141 } 140 }
142 141
142 //do a quick 'n dirty depth sort
143 for (std::vector<LLFace*>::iterator iter = mDrawFace.begin();
144 iter != mDrawFace.end(); iter++)
145 {
146 LLFace* facep = *iter;
147 facep->mDistance = -facep->mCenterLocal.mV[2];
148 }
149
150 std::sort(mDrawFace.begin(), mDrawFace.end(), LLFace::CompareDistanceGreater());
151
143 LLGLSPipelineAlpha alphaState; 152 LLGLSPipelineAlpha alphaState;
144 153
145 if ((mVertexShaderLevel >= SHADER_LEVEL_RIPPLE)) 154 if ((mVertexShaderLevel >= SHADER_LEVEL_RIPPLE))
@@ -164,7 +173,7 @@ void LLDrawPoolWater::render(S32 pass)
164 return; 173 return;
165 } 174 }
166 175
167 const LLFace* refl_face = voskyp->getReflFace(); 176 LLFace* refl_face = voskyp->getReflFace();
168 177
169 gPipeline.disableLights(); 178 gPipeline.disableLights();
170 179
@@ -176,10 +185,6 @@ void LLDrawPoolWater::render(S32 pass)
176 glEnableClientState(GL_VERTEX_ARRAY); 185 glEnableClientState(GL_VERTEX_ARRAY);
177 glEnableClientState(GL_NORMAL_ARRAY); 186 glEnableClientState(GL_NORMAL_ARRAY);
178 187
179 bindGLVertexPointer();
180 bindGLNormalPointer();
181 bindGLTexCoordPointer();
182
183 // Set up second pass first 188 // Set up second pass first
184 glActiveTextureARB(GL_TEXTURE1_ARB); 189 glActiveTextureARB(GL_TEXTURE1_ARB);
185 mWaterImagep->addTextureStats(1024.f*1024.f); 190 mWaterImagep->addTextureStats(1024.f*1024.f);
@@ -246,7 +251,7 @@ void LLDrawPoolWater::render(S32 pass)
246 continue; 251 continue;
247 } 252 }
248 face->bindTexture(); 253 face->bindTexture();
249 face->renderIndexed(getRawIndices()); 254 face->renderIndexed();
250 mIndicesDrawn += face->getIndicesCount(); 255 mIndicesDrawn += face->getIndicesCount();
251 } 256 }
252 257
@@ -307,7 +312,7 @@ void LLDrawPoolWater::render(S32 pass)
307 312
308 if (face->getGeomCount() > 0) 313 if (face->getGeomCount() > 0)
309 { 314 {
310 face->renderIndexed(getRawIndices()); 315 face->renderIndexed();
311 mIndicesDrawn += face->getIndicesCount(); 316 mIndicesDrawn += face->getIndicesCount();
312 } 317 }
313 } 318 }
@@ -354,7 +359,7 @@ void LLDrawPoolWater::renderShaderSimple()
354 return; 359 return;
355 } 360 }
356 361
357 const LLFace* refl_face = voskyp->getReflFace(); 362 LLFace* refl_face = voskyp->getReflFace();
358 363
359 LLGLDepthTest gls_depth(GL_TRUE, GL_FALSE); 364 LLGLDepthTest gls_depth(GL_TRUE, GL_FALSE);
360 365
@@ -364,10 +369,6 @@ void LLDrawPoolWater::renderShaderSimple()
364 glEnableClientState(GL_VERTEX_ARRAY); 369 glEnableClientState(GL_VERTEX_ARRAY);
365 glEnableClientState(GL_NORMAL_ARRAY); 370 glEnableClientState(GL_NORMAL_ARRAY);
366 371
367 bindGLVertexPointer();
368 bindGLNormalPointer();
369 bindGLTexCoordPointer();
370
371 // Set up second pass first 372 // Set up second pass first
372 S32 bumpTex = gPipeline.mWaterProgram.enableTexture(LLPipeline::GLSL_BUMP_MAP); 373 S32 bumpTex = gPipeline.mWaterProgram.enableTexture(LLPipeline::GLSL_BUMP_MAP);
373 mWaterImagep->addTextureStats(1024.f*1024.f); 374 mWaterImagep->addTextureStats(1024.f*1024.f);
@@ -432,9 +433,6 @@ void LLDrawPoolWater::renderShaderSimple()
432 glMatrixMode(GL_MODELVIEW); 433 glMatrixMode(GL_MODELVIEW);
433 } 434 }
434 435
435 S32 scatterTex = gPipeline.mWaterProgram.enableTexture(LLPipeline::GLSL_SCATTER_MAP);
436 LLViewerImage::bindTexture(gSky.mVOSkyp->getScatterMap(), scatterTex);
437
438 S32 diffTex = gPipeline.mWaterProgram.enableTexture(LLPipeline::GLSL_DIFFUSE_MAP); 436 S32 diffTex = gPipeline.mWaterProgram.enableTexture(LLPipeline::GLSL_DIFFUSE_MAP);
439 437
440 gPipeline.mWaterProgram.bind(); 438 gPipeline.mWaterProgram.bind();
@@ -448,7 +446,7 @@ void LLDrawPoolWater::renderShaderSimple()
448 continue; 446 continue;
449 } 447 }
450 face->bindTexture(diffTex); 448 face->bindTexture(diffTex);
451 face->renderIndexed(getRawIndices()); 449 face->renderIndexed();
452 mIndicesDrawn += face->getIndicesCount(); 450 mIndicesDrawn += face->getIndicesCount();
453 } 451 }
454 452
@@ -469,8 +467,7 @@ void LLDrawPoolWater::renderShaderSimple()
469 glDisable(GL_TEXTURE_GEN_T); //texture unit 1 467 glDisable(GL_TEXTURE_GEN_T); //texture unit 1
470 468
471 gPipeline.mWaterProgram.disableTexture(LLPipeline::GLSL_DIFFUSE_MAP); 469 gPipeline.mWaterProgram.disableTexture(LLPipeline::GLSL_DIFFUSE_MAP);
472 gPipeline.mWaterProgram.disableTexture(LLPipeline::GLSL_SCATTER_MAP); 470
473
474 // Disable texture coordinate and color arrays 471 // Disable texture coordinate and color arrays
475 LLImageGL::unbindTexture(diffTex, GL_TEXTURE_2D); 472 LLImageGL::unbindTexture(diffTex, GL_TEXTURE_2D);
476 473
@@ -496,7 +493,7 @@ void LLDrawPoolWater::renderShaderSimple()
496 glDisableClientState(GL_NORMAL_ARRAY); 493 glDisableClientState(GL_NORMAL_ARRAY);
497} 494}
498 495
499void LLDrawPoolWater::renderReflection(const LLFace* face) 496void LLDrawPoolWater::renderReflection(LLFace* face)
500{ 497{
501 LLVOSky *voskyp = gSky.mVOSkyp; 498 LLVOSky *voskyp = gSky.mVOSkyp;
502 499
@@ -524,7 +521,7 @@ void LLDrawPoolWater::renderReflection(const LLFace* face)
524 LLViewerImage::bindTexture(mHBTex[dr]); 521 LLViewerImage::bindTexture(mHBTex[dr]);
525 522
526 LLOverrideFaceColor override(this, face->getFaceColor().mV); 523 LLOverrideFaceColor override(this, face->getFaceColor().mV);
527 face->renderIndexed(getRawIndices()); 524 face->renderIndexed();
528 mIndicesDrawn += face->getIndicesCount(); 525 mIndicesDrawn += face->getIndicesCount();
529 526
530 glDisableClientState(GL_TEXTURE_COORD_ARRAY); 527 glDisableClientState(GL_TEXTURE_COORD_ARRAY);
@@ -532,36 +529,44 @@ void LLDrawPoolWater::renderReflection(const LLFace* face)
532 529
533void bindScreenToTexture() 530void bindScreenToTexture()
534{ 531{
535 GLint viewport[4]; 532 if (LLDrawPoolWater::sSkipScreenCopy)
536 glGetIntegerv(GL_VIEWPORT, viewport);
537 GLuint resX = nhpo2(viewport[2]);
538 GLuint resY = nhpo2(viewport[3]);
539
540 glBindTexture(GL_TEXTURE_2D, sScreenTex);
541 GLint cResX;
542 GLint cResY;
543 glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_WIDTH, &cResX);
544 glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_HEIGHT, &cResY);
545
546 if (cResX != (GLint)resX || cResY != (GLint)resY)
547 { 533 {
548 glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, resX, resY, 0, GL_RGB, GL_FLOAT, NULL); 534 glBindTexture(GL_TEXTURE_2D, 0);
549 gImageList.updateMaxResidentTexMem(-1, resX*resY*3);
550 } 535 }
536 else
537 {
551 538
552 glCopyTexSubImage2D(GL_TEXTURE_2D, 0, viewport[0], viewport[1], 0, 0, viewport[2], viewport[3]); 539 GLint viewport[4];
540 glGetIntegerv(GL_VIEWPORT, viewport);
541 GLuint resX = nhpo2(viewport[2]);
542 GLuint resY = nhpo2(viewport[3]);
553 543
554 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); 544 glBindTexture(GL_TEXTURE_2D, sScreenTex);
555 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); 545 GLint cResX;
556 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); 546 GLint cResY;
557 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); 547 glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_WIDTH, &cResX);
548 glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_HEIGHT, &cResY);
549
550 if (cResX != (GLint)resX || cResY != (GLint)resY)
551 {
552 glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, resX, resY, 0, GL_RGB, GL_FLOAT, NULL);
553 gImageList.updateMaxResidentTexMem(-1, resX*resY*3);
554 }
558 555
559 float scale[2]; 556 glCopyTexSubImage2D(GL_TEXTURE_2D, 0, viewport[0], viewport[1], 0, 0, viewport[2], viewport[3]);
560 scale[0] = (float) viewport[2]/resX;
561 scale[1] = (float) viewport[3]/resY;
562 glUniform2fvARB(gPipeline.mWaterProgram.mUniform[LLPipeline::GLSL_WATER_FBSCALE], 1, scale);
563 557
564 LLImageGL::sBoundTextureMemory += resX * resY * 3; 558 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
559 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
560 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
561 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
562
563 float scale[2];
564 scale[0] = (float) viewport[2]/resX;
565 scale[1] = (float) viewport[3]/resY;
566 glUniform2fvARB(gPipeline.mWaterProgram.mUniform[LLPipeline::GLSL_WATER_FBSCALE], 1, scale);
567
568 LLImageGL::sBoundTextureMemory += resX * resY * 3;
569 }
565} 570}
566 571
567void LLDrawPoolWater::shade() 572void LLDrawPoolWater::shade()
@@ -596,9 +601,6 @@ void LLDrawPoolWater::shade()
596 glEnableClientState(GL_VERTEX_ARRAY); 601 glEnableClientState(GL_VERTEX_ARRAY);
597 glEnableClientState(GL_NORMAL_ARRAY); 602 glEnableClientState(GL_NORMAL_ARRAY);
598 LLGLDisable blend(GL_BLEND); 603 LLGLDisable blend(GL_BLEND);
599 bindGLVertexPointer();
600 bindGLNormalPointer();
601 bindGLTexCoordPointer();
602 604
603 LLColor3 light_diffuse(0,0,0); 605 LLColor3 light_diffuse(0,0,0);
604 F32 light_exp = 0.0f; 606 F32 light_exp = 0.0f;
@@ -649,9 +651,6 @@ void LLDrawPoolWater::shade()
649 651
650 bindScreenToTexture(); 652 bindScreenToTexture();
651 653
652 S32 scatterTex = gPipeline.mWaterProgram.enableTexture(LLPipeline::GLSL_SCATTER_MAP);
653 LLViewerImage::bindTexture(gSky.mVOSkyp->getScatterMap(), scatterTex);
654
655 S32 diffTex = gPipeline.mWaterProgram.enableTexture(LLPipeline::GLSL_DIFFUSE_MAP); 654 S32 diffTex = gPipeline.mWaterProgram.enableTexture(LLPipeline::GLSL_DIFFUSE_MAP);
656 655
657 LLGLDepthTest gls_depth(GL_TRUE, GL_FALSE); 656 LLGLDepthTest gls_depth(GL_TRUE, GL_FALSE);
@@ -697,7 +696,7 @@ void LLDrawPoolWater::shade()
697 } 696 }
698 697
699 face->bindTexture(diffTex); 698 face->bindTexture(diffTex);
700 face->renderIndexed(getRawIndices()); 699 face->renderIndexed();
701 mIndicesDrawn += face->getIndicesCount(); 700 mIndicesDrawn += face->getIndicesCount();
702 } 701 }
703 } 702 }
@@ -705,7 +704,6 @@ void LLDrawPoolWater::shade()
705 gPipeline.mWaterProgram.disableTexture(LLPipeline::GLSL_ENVIRONMENT_MAP, GL_TEXTURE_CUBE_MAP_ARB); 704 gPipeline.mWaterProgram.disableTexture(LLPipeline::GLSL_ENVIRONMENT_MAP, GL_TEXTURE_CUBE_MAP_ARB);
706 gPipeline.mWaterProgram.disableTexture(LLPipeline::GLSL_WATER_SCREENTEX); 705 gPipeline.mWaterProgram.disableTexture(LLPipeline::GLSL_WATER_SCREENTEX);
707 gPipeline.mWaterProgram.disableTexture(LLPipeline::GLSL_BUMP_MAP); 706 gPipeline.mWaterProgram.disableTexture(LLPipeline::GLSL_BUMP_MAP);
708 gPipeline.mWaterProgram.disableTexture(LLPipeline::GLSL_SCATTER_MAP);
709 gPipeline.mWaterProgram.disableTexture(LLPipeline::GLSL_DIFFUSE_MAP); 707 gPipeline.mWaterProgram.disableTexture(LLPipeline::GLSL_DIFFUSE_MAP);
710 708
711 glActiveTextureARB(GL_TEXTURE0_ARB); 709 glActiveTextureARB(GL_TEXTURE0_ARB);
@@ -714,10 +712,6 @@ void LLDrawPoolWater::shade()
714 712
715 glClientActiveTextureARB(GL_TEXTURE0_ARB); 713 glClientActiveTextureARB(GL_TEXTURE0_ARB);
716 glDisableClientState(GL_TEXTURE_COORD_ARRAY); 714 glDisableClientState(GL_TEXTURE_COORD_ARRAY);
717
718 /*glDisableClientState(GL_TEXTURE_COORD_ARRAY);
719 glDisableClientState(GL_VERTEX_ARRAY);
720 glDisableClientState(GL_NORMAL_ARRAY);*/
721} 715}
722 716
723void LLDrawPoolWater::renderForSelect() 717void LLDrawPoolWater::renderForSelect()
diff --git a/linden/indra/newview/lldrawpoolwater.h b/linden/indra/newview/lldrawpoolwater.h
index 38bf6cf..2e45868 100644
--- a/linden/indra/newview/lldrawpoolwater.h
+++ b/linden/indra/newview/lldrawpoolwater.h
@@ -35,7 +35,7 @@ class LLFace;
35class LLHeavenBody; 35class LLHeavenBody;
36class LLWaterSurface; 36class LLWaterSurface;
37 37
38class LLDrawPoolWater: public LLDrawPool 38class LLDrawPoolWater: public LLFacePool
39{ 39{
40protected: 40protected:
41 LLPointer<LLViewerImage> mHBTex[2]; 41 LLPointer<LLViewerImage> mHBTex[2];
@@ -44,6 +44,16 @@ protected:
44 44
45 const LLWaterSurface *mWaterSurface; 45 const LLWaterSurface *mWaterSurface;
46public: 46public:
47 static BOOL sSkipScreenCopy;
48 enum
49 {
50 VERTEX_DATA_MASK = LLVertexBuffer::MAP_VERTEX |
51 LLVertexBuffer::MAP_NORMAL |
52 LLVertexBuffer::MAP_TEXCOORD
53 };
54
55 virtual U32 getVertexDataMask() { return VERTEX_DATA_MASK; }
56
47 enum 57 enum
48 { 58 {
49 SHADER_LEVEL_RIPPLE = 2, 59 SHADER_LEVEL_RIPPLE = 2,
@@ -64,7 +74,7 @@ public:
64 /*virtual*/ LLViewerImage *getDebugTexture(); 74 /*virtual*/ LLViewerImage *getDebugTexture();
65 /*virtual*/ LLColor3 getDebugColor() const; // For AGP debug display 75 /*virtual*/ LLColor3 getDebugColor() const; // For AGP debug display
66 76
67 void renderReflection(const LLFace* face); 77 void renderReflection(LLFace* face);
68 void shade(); 78 void shade();
69 void renderShaderSimple(); 79 void renderShaderSimple();
70 80
diff --git a/linden/indra/newview/lldynamictexture.cpp b/linden/indra/newview/lldynamictexture.cpp
index 6111e36..90ebd74 100644
--- a/linden/indra/newview/lldynamictexture.cpp
+++ b/linden/indra/newview/lldynamictexture.cpp
@@ -35,6 +35,8 @@
35#include "llviewercamera.h" 35#include "llviewercamera.h"
36#include "llviewercontrol.h" 36#include "llviewercontrol.h"
37#include "llviewerimage.h" 37#include "llviewerimage.h"
38#include "llvertexbuffer.h"
39
38 40
39// static 41// static
40LLLinkedList<LLDynamicTexture> LLDynamicTexture::sInstances[ LLDynamicTexture::ORDER_COUNT ]; 42LLLinkedList<LLDynamicTexture> LLDynamicTexture::sInstances[ LLDynamicTexture::ORDER_COUNT ];
@@ -64,6 +66,7 @@ LLDynamicTexture::LLDynamicTexture(S32 width, S32 height, S32 components, EOrder
64//----------------------------------------------------------------------------- 66//-----------------------------------------------------------------------------
65LLDynamicTexture::~LLDynamicTexture() 67LLDynamicTexture::~LLDynamicTexture()
66{ 68{
69 releaseGLTexture();
67 for( S32 order = 0; order < ORDER_COUNT; order++ ) 70 for( S32 order = 0; order < ORDER_COUNT; order++ )
68 { 71 {
69 LLDynamicTexture::sInstances[order].removeData(this); // will fail in all but one case. 72 LLDynamicTexture::sInstances[order].removeData(this); // will fail in all but one case.
@@ -71,19 +74,23 @@ LLDynamicTexture::~LLDynamicTexture()
71} 74}
72 75
73//----------------------------------------------------------------------------- 76//-----------------------------------------------------------------------------
74// generateGLTexture() 77// releaseGLTexture()
75//----------------------------------------------------------------------------- 78//-----------------------------------------------------------------------------
76void LLDynamicTexture::generateGLTexture() 79void LLDynamicTexture::releaseGLTexture()
77{ 80{
78 if (mComponents < 1 || mComponents > 4) 81 if (mTexture.notNull())
79 { 82 {
80 llerrs << "Bad number of components in dynamic texture: " << mComponents << llendl; 83// llinfos << "RELEASING " << (mWidth*mHeight*mComponents)/1024 << "K" << llendl;
84 mTexture = NULL;
81 } 85 }
86}
82 87
83 LLPointer<LLImageRaw> raw_image = new LLImageRaw(mWidth, mHeight, mComponents); 88//-----------------------------------------------------------------------------
84 mTexture = new LLImageGL(mWidth, mHeight, mComponents, FALSE); 89// generateGLTexture()
85 mTexture->createGLTexture(0, raw_image); 90//-----------------------------------------------------------------------------
86 mTexture->setClamp(mClamp, mClamp); 91void LLDynamicTexture::generateGLTexture()
92{
93 generateGLTexture(-1, 0, 0, FALSE);
87} 94}
88 95
89void LLDynamicTexture::generateGLTexture(LLGLint internal_format, LLGLenum primary_format, LLGLenum type_format, BOOL swap_bytes) 96void LLDynamicTexture::generateGLTexture(LLGLint internal_format, LLGLenum primary_format, LLGLenum type_format, BOOL swap_bytes)
@@ -92,10 +99,14 @@ void LLDynamicTexture::generateGLTexture(LLGLint internal_format, LLGLenum prima
92 { 99 {
93 llerrs << "Bad number of components in dynamic texture: " << mComponents << llendl; 100 llerrs << "Bad number of components in dynamic texture: " << mComponents << llendl;
94 } 101 }
95 102 releaseGLTexture();
96 LLPointer<LLImageRaw> raw_image = new LLImageRaw(mWidth, mHeight, mComponents); 103 LLPointer<LLImageRaw> raw_image = new LLImageRaw(mWidth, mHeight, mComponents);
97 mTexture = new LLImageGL(mWidth, mHeight, mComponents, FALSE); 104 mTexture = new LLImageGL(mWidth, mHeight, mComponents, FALSE);
98 mTexture->setExplicitFormat(internal_format, primary_format, type_format, swap_bytes); 105 if (internal_format >= 0)
106 {
107 mTexture->setExplicitFormat(internal_format, primary_format, type_format, swap_bytes);
108 }
109// llinfos << "ALLOCATING " << (mWidth*mHeight*mComponents)/1024 << "K" << llendl;
99 mTexture->createGLTexture(0, raw_image); 110 mTexture->createGLTexture(0, raw_image);
100 mTexture->setClamp(mClamp, mClamp); 111 mTexture->setClamp(mClamp, mClamp);
101} 112}
@@ -193,6 +204,8 @@ BOOL LLDynamicTexture::updateAllInstances()
193 return TRUE; 204 return TRUE;
194 } 205 }
195 206
207 BOOL started = FALSE;
208
196 BOOL result = FALSE; 209 BOOL result = FALSE;
197 for( S32 order = 0; order < ORDER_COUNT; order++ ) 210 for( S32 order = 0; order < ORDER_COUNT; order++ )
198 { 211 {
@@ -202,11 +215,16 @@ BOOL LLDynamicTexture::updateAllInstances()
202 { 215 {
203 if (dynamicTexture->needsRender()) 216 if (dynamicTexture->needsRender())
204 { 217 {
218 if (!started)
219 {
220 started = TRUE;
221 LLVertexBuffer::startRender();
222 }
223
205 dynamicTexture->preRender(); 224 dynamicTexture->preRender();
206 if (dynamicTexture->render()) 225 if (dynamicTexture->render())
207 { 226 {
208 result = TRUE; 227 result = TRUE;
209 gViewerWindow->finishFastFrame();
210 sNumRenders++; 228 sNumRenders++;
211 } 229 }
212 dynamicTexture->postRender(result); 230 dynamicTexture->postRender(result);
@@ -214,6 +232,11 @@ BOOL LLDynamicTexture::updateAllInstances()
214 } 232 }
215 } 233 }
216 234
235 if (started)
236 {
237 LLVertexBuffer::stopRender();
238 }
239
217 return result; 240 return result;
218} 241}
219 242
diff --git a/linden/indra/newview/lldynamictexture.h b/linden/indra/newview/lldynamictexture.h
index fda424c..b11bed3 100644
--- a/linden/indra/newview/lldynamictexture.h
+++ b/linden/indra/newview/lldynamictexture.h
@@ -66,6 +66,7 @@ public:
66 static void restoreGL(); 66 static void restoreGL();
67 67
68protected: 68protected:
69 void releaseGLTexture();
69 void generateGLTexture(); 70 void generateGLTexture();
70 void generateGLTexture(LLGLint internal_format, LLGLenum primary_format, LLGLenum type_format, BOOL swap_bytes = FALSE); 71 void generateGLTexture(LLGLint internal_format, LLGLenum primary_format, LLGLenum type_format, BOOL swap_bytes = FALSE);
71 72
diff --git a/linden/indra/newview/lleventinfo.cpp b/linden/indra/newview/lleventinfo.cpp
index 02ac3ed..103450e 100644
--- a/linden/indra/newview/lleventinfo.cpp
+++ b/linden/indra/newview/lleventinfo.cpp
@@ -71,7 +71,7 @@ void LLEventInfo::unpack(LLMessageSystem *msg)
71 msg->getU32("EventData", "EventID", event_id); 71 msg->getU32("EventData", "EventID", event_id);
72 mID = event_id; 72 mID = event_id;
73 73
74 char buffer[MAX_DESC_LENGTH]; 74 char buffer[MAX_DESC_LENGTH]; /*Flawfinder: ignore*/
75 msg->getString("EventData", "Name", MAX_DESC_LENGTH, buffer); 75 msg->getString("EventData", "Name", MAX_DESC_LENGTH, buffer);
76 mName = buffer; 76 mName = buffer;
77 77
@@ -106,7 +106,7 @@ void LLEventInfo::unpack(LLMessageSystem *msg)
106 mCover = cover; 106 mCover = cover;
107 } 107 }
108 108
109 char sim_name[256]; 109 char sim_name[256]; /*Flawfinder: ignore*/
110 msg->getString("EventData", "SimName", 256, sim_name); 110 msg->getString("EventData", "SimName", 256, sim_name);
111 mSimName.assign(sim_name); 111 mSimName.assign(sim_name);
112 112
diff --git a/linden/indra/newview/llface.cpp b/linden/indra/newview/llface.cpp
index a6de94b..e46fcd3 100644
--- a/linden/indra/newview/llface.cpp
+++ b/linden/indra/newview/llface.cpp
@@ -29,13 +29,13 @@
29 29
30#include "lldrawable.h" // lldrawable needs to be included before llface 30#include "lldrawable.h" // lldrawable needs to be included before llface
31#include "llface.h" 31#include "llface.h"
32#include "llviewertextureanim.h"
32 33
33#include "llviewercontrol.h" 34#include "llviewercontrol.h"
34#include "llvolume.h" 35#include "llvolume.h"
35#include "m3math.h" 36#include "m3math.h"
36#include "v3color.h" 37#include "v3color.h"
37 38
38#include "llagparray.h"
39#include "lldrawpoolsimple.h" 39#include "lldrawpoolsimple.h"
40#include "lldrawpoolbump.h" 40#include "lldrawpoolbump.h"
41#include "llgl.h" 41#include "llgl.h"
@@ -47,8 +47,6 @@
47#include "llvovolume.h" 47#include "llvovolume.h"
48#include "pipeline.h" 48#include "pipeline.h"
49 49
50#include "llagparray.inl"
51
52#define LL_MAX_INDICES_COUNT 1000000 50#define LL_MAX_INDICES_COUNT 1000000
53 51
54extern BOOL gPickFaces; 52extern BOOL gPickFaces;
@@ -137,25 +135,23 @@ void cylindricalProjection(LLVector2 &tc, const LLVolumeFace::VertexData &vd, co
137 135
138void LLFace::init(LLDrawable* drawablep, LLViewerObject* objp) 136void LLFace::init(LLDrawable* drawablep, LLViewerObject* objp)
139{ 137{
140 mGeneration = DIRTY; 138 mLastUpdateTime = gFrameTimeSeconds;
139 mVSize = 0.f;
140 mPixelArea = 1024.f;
141 mState = GLOBAL; 141 mState = GLOBAL;
142 mDrawPoolp = NULL; 142 mDrawPoolp = NULL;
143 mPoolType = 0;
143 mGeomIndex = -1; 144 mGeomIndex = -1;
144 mSkipRender = FALSE;
145 mNextFace = NULL;
146 // mCenterLocal 145 // mCenterLocal
147 // mCenterAgent 146 // mCenterAgent
148 mDistance = 0.f; 147 mDistance = 0.f;
149 148
150 mPrimType = LLTriangles;
151 mGeomCount = 0; 149 mGeomCount = 0;
152 mIndicesCount = 0; 150 mIndicesCount = 0;
153 mIndicesIndex = -1; 151 mIndicesIndex = -1;
154 mTexture = NULL; 152 mTexture = NULL;
155 mTEOffset = -1; 153 mTEOffset = -1;
156 154
157 mBackupMem = NULL;
158
159 setDrawable(drawablep); 155 setDrawable(drawablep);
160 mVObjp = objp; 156 mVObjp = objp;
161 157
@@ -163,6 +159,12 @@ void LLFace::init(LLDrawable* drawablep, LLViewerObject* objp)
163 mAlphaFade = 0.f; 159 mAlphaFade = 0.f;
164 160
165 mFaceColor = LLColor4(1,0,0,1); 161 mFaceColor = LLColor4(1,0,0,1);
162
163 mLastVertexBuffer = mVertexBuffer;
164 mLastGeomCount = mGeomCount;
165 mLastGeomIndex = mGeomIndex;
166 mLastIndicesCount = mIndicesCount;
167 mLastIndicesIndex = mIndicesIndex;
166} 168}
167 169
168 170
@@ -176,11 +178,6 @@ void LLFace::destroy()
176 mDrawPoolp->removeFace(this); 178 mDrawPoolp->removeFace(this);
177 mDrawPoolp = NULL; 179 mDrawPoolp = NULL;
178 } 180 }
179
180 // Remove light and blocker list references
181
182 delete[] mBackupMem;
183 mBackupMem = NULL;
184} 181}
185 182
186 183
@@ -194,13 +191,7 @@ void LLFace::setWorldMatrix(const LLMatrix4 &mat)
194 llerrs << "Faces on this drawable are not independently modifiable\n" << llendl; 191 llerrs << "Faces on this drawable are not independently modifiable\n" << llendl;
195} 192}
196 193
197 194void LLFace::setPool(LLFacePool* new_pool, LLViewerImage *texturep)
198void LLFace::setDirty()
199{
200 mGeneration = DIRTY;
201}
202
203void LLFace::setPool(LLDrawPool* new_pool, LLViewerImage *texturep)
204{ 195{
205 LLMemType mt1(LLMemType::MTYPE_DRAWABLE); 196 LLMemType mt1(LLMemType::MTYPE_DRAWABLE);
206 197
@@ -215,22 +206,12 @@ void LLFace::setPool(LLDrawPool* new_pool, LLViewerImage *texturep)
215 if (mDrawPoolp) 206 if (mDrawPoolp)
216 { 207 {
217 mDrawPoolp->removeFace(this); 208 mDrawPoolp->removeFace(this);
218 mSkipRender = FALSE;
219 mNextFace = NULL;
220 209
221 // Invalidate geometry (will get rebuilt next frame)
222 setDirty();
223 if (mDrawablep) 210 if (mDrawablep)
224 { 211 {
225 gPipeline.markRebuild(mDrawablep, LLDrawable::REBUILD_ALL, TRUE); 212 gPipeline.markRebuild(mDrawablep, LLDrawable::REBUILD_ALL, TRUE);
226 } 213 }
227 } 214 }
228 if (isState(BACKLIST))
229 {
230 delete[] mBackupMem;
231 mBackupMem = NULL;
232 clearState(BACKLIST);
233 }
234 mGeomIndex = -1; 215 mGeomIndex = -1;
235 216
236 // Add to new pool 217 // Add to new pool
@@ -239,7 +220,6 @@ void LLFace::setPool(LLDrawPool* new_pool, LLViewerImage *texturep)
239 new_pool->addFace(this); 220 new_pool->addFace(this);
240 } 221 }
241 mDrawPoolp = new_pool; 222 mDrawPoolp = new_pool;
242
243 } 223 }
244 mTexture = texturep; 224 mTexture = texturep;
245} 225}
@@ -268,91 +248,12 @@ void LLFace::setDrawable(LLDrawable *drawable)
268 mXform = &drawable->mXform; 248 mXform = &drawable->mXform;
269} 249}
270 250
271S32 LLFace::allocBackupMem()
272{
273 LLMemType mt1(LLMemType::MTYPE_DRAWABLE);
274
275 S32 size = 0;
276 size += mIndicesCount * 4;
277 size += mGeomCount * mDrawPoolp->getStride();
278
279 if (mDrawPoolp->mDataMaskNIL & LLDrawPool::DATA_VERTEX_WEIGHTS_MASK)
280 {
281 size += mGeomCount * mDrawPoolp->sDataSizes[LLDrawPool::DATA_VERTEX_WEIGHTS];
282 }
283
284 if (mDrawPoolp->mDataMaskNIL & LLDrawPool::DATA_CLOTHING_WEIGHTS_MASK)
285 {
286 size += mGeomCount * mDrawPoolp->sDataSizes[LLDrawPool::DATA_CLOTHING_WEIGHTS];
287 }
288
289 delete[] mBackupMem;
290 mBackupMem = new U8[size];
291 return size;
292}
293
294
295void LLFace::setSize(const S32 num_vertices, const S32 num_indices) 251void LLFace::setSize(const S32 num_vertices, const S32 num_indices)
296{ 252{
297 LLMemType mt1(LLMemType::MTYPE_DRAWABLE); 253 LLMemType mt1(LLMemType::MTYPE_DRAWABLE);
298 254
299 if (getState() & SHARED_GEOM) 255 mGeomCount = num_vertices;
300 { 256 mIndicesCount = num_indices;
301 mGeomCount = num_vertices;
302 mIndicesCount = num_indices;
303 return; // Shared, don't allocate or do anything with memory
304 }
305 if (num_vertices != (S32)mGeomCount || num_indices != (S32)mIndicesCount)
306 {
307 setDirty();
308
309 delete[] mBackupMem;
310 mBackupMem = NULL;
311 clearState(BACKLIST);
312
313 mGeomCount = num_vertices;
314 mIndicesCount = num_indices;
315 }
316
317}
318
319BOOL LLFace::reserveIfNeeded()
320{
321 LLMemType mt1(LLMemType::MTYPE_DRAWABLE);
322
323 if (getDirty())
324 {
325 if (isState(BACKLIST))
326 {
327 llwarns << "Reserve on backlisted object!" << llendl;
328 }
329
330 if (0 == mGeomCount)
331 {
332 //llwarns << "Reserving zero bytes for face!" << llendl;
333 mGeomCount = 0;
334 mIndicesCount = 0;
335 return FALSE;
336 }
337
338 mGeomIndex = mDrawPoolp->reserveGeom(mGeomCount);
339 // (reserveGeom() always returns a valid index)
340 mIndicesIndex = mDrawPoolp->reserveInd (mIndicesCount);
341 mGeneration = mDrawPoolp->mGeneration;
342 }
343
344 return TRUE;
345}
346
347void LLFace::unReserve()
348{
349 LLMemType mt1(LLMemType::MTYPE_DRAWABLE);
350
351 if (!(isState(SHARED_GEOM)))
352 {
353 mGeomIndex = mDrawPoolp->unReserveGeom(mGeomIndex, mGeomCount);
354 mIndicesIndex = mDrawPoolp->unReserveInd(mIndicesIndex, mIndicesCount);
355 }
356} 257}
357 258
358//============================================================================ 259//============================================================================
@@ -366,55 +267,22 @@ S32 LLFace::getGeometryAvatar(
366 LLStrider<LLVector4> &clothing_weights) 267 LLStrider<LLVector4> &clothing_weights)
367{ 268{
368 LLMemType mt1(LLMemType::MTYPE_DRAWABLE); 269 LLMemType mt1(LLMemType::MTYPE_DRAWABLE);
369
370 if (mGeomCount <= 0)
371 {
372 return -1;
373 }
374
375 if (isState(BACKLIST))
376 {
377 if (!mBackupMem)
378 {
379 llerrs << "No backup memory for backlist" << llendl;
380 }
381 270
382 vertices = (LLVector3*)(mBackupMem + (4 * mIndicesCount) + mDrawPoolp->mDataOffsets[LLDrawPool::DATA_VERTICES]); 271 if (mVertexBuffer.notNull())
383 normals = (LLVector3*)(mBackupMem + (4 * mIndicesCount) + mDrawPoolp->mDataOffsets[LLDrawPool::DATA_NORMALS]); 272 {
384 binormals = (LLVector3*)(mBackupMem + (4 * mIndicesCount) + mDrawPoolp->mDataOffsets[LLDrawPool::DATA_BINORMALS]); 273 mVertexBuffer->getVertexStrider (vertices, mGeomIndex);
385 tex_coords = (LLVector2*)(mBackupMem + (4 * mIndicesCount) + mDrawPoolp->mDataOffsets[LLDrawPool::DATA_TEX_COORDS0]); 274 mVertexBuffer->getNormalStrider (normals, mGeomIndex);
386 clothing_weights = (LLVector4*)(mBackupMem + (4 * mIndicesCount) + mDrawPoolp->mDataOffsets[LLDrawPool::DATA_CLOTHING_WEIGHTS]); 275 mVertexBuffer->getBinormalStrider (binormals, mGeomIndex);
387 vertex_weights = (F32*)(mBackupMem + (4 * mIndicesCount) + (mGeomCount * mDrawPoolp->getStride())); 276 mVertexBuffer->getTexCoordStrider (tex_coords, mGeomIndex);
388 tex_coords.setStride( mDrawPoolp->getStride()); 277 mVertexBuffer->getWeightStrider(vertex_weights, mGeomIndex);
389 vertices.setStride( mDrawPoolp->getStride()); 278 mVertexBuffer->getClothWeightStrider(clothing_weights, mGeomIndex);
390 normals.setStride( mDrawPoolp->getStride());
391 binormals.setStride( mDrawPoolp->getStride());
392 clothing_weights.setStride( mDrawPoolp->getStride());
393
394 return 0;
395 } 279 }
396 else 280 else
397 { 281 {
398 if (!reserveIfNeeded()) 282 mGeomIndex = -1;
399 {
400 return -1;
401 }
402
403 llassert(mGeomIndex >= 0);
404 llassert(mIndicesIndex >= 0);
405
406 mDrawPoolp->getVertexStrider (vertices, mGeomIndex);
407 mDrawPoolp->getNormalStrider (normals, mGeomIndex);
408 mDrawPoolp->getBinormalStrider (binormals, mGeomIndex);
409 mDrawPoolp->getTexCoordStrider (tex_coords, mGeomIndex);
410 mDrawPoolp->getVertexWeightStrider(vertex_weights, mGeomIndex);
411 mDrawPoolp->getClothingWeightStrider(clothing_weights, mGeomIndex);
412
413 mDrawPoolp->setDirty();
414
415 llassert(mGeomIndex >= 0);
416 return mGeomIndex;
417 } 283 }
284
285 return mGeomIndex;
418} 286}
419 287
420S32 LLFace::getGeometryTerrain( 288S32 LLFace::getGeometryTerrain(
@@ -423,64 +291,29 @@ S32 LLFace::getGeometryTerrain(
423 LLStrider<LLColor4U> &colors, 291 LLStrider<LLColor4U> &colors,
424 LLStrider<LLVector2> &texcoords0, 292 LLStrider<LLVector2> &texcoords0,
425 LLStrider<LLVector2> &texcoords1, 293 LLStrider<LLVector2> &texcoords1,
426 U32 *&indicesp) 294 LLStrider<U32> &indicesp)
427{ 295{
428 LLMemType mt1(LLMemType::MTYPE_DRAWABLE); 296 LLMemType mt1(LLMemType::MTYPE_DRAWABLE);
429 297
430 if (mGeomCount <= 0) 298 if (mVertexBuffer.notNull())
431 { 299 {
432 return -1; 300 mVertexBuffer->getVertexStrider(vertices, mGeomIndex);
433 } 301 mVertexBuffer->getNormalStrider(normals, mGeomIndex);
434 302 mVertexBuffer->getColorStrider(colors, mGeomIndex);
435 if (isState(BACKLIST)) 303 mVertexBuffer->getTexCoordStrider(texcoords0, mGeomIndex);
436 { 304 mVertexBuffer->getTexCoord2Strider(texcoords1, mGeomIndex);
437 if (!mBackupMem) 305 mVertexBuffer->getIndexStrider(indicesp, mIndicesIndex);
438 {
439 printDebugInfo();
440 llerrs << "No backup memory for face" << llendl;
441 }
442 vertices = (LLVector3*)(mBackupMem + (4 * mIndicesCount) + mDrawPoolp->mDataOffsets[LLDrawPool::DATA_VERTICES]);
443 normals = (LLVector3*)(mBackupMem + (4 * mIndicesCount) + mDrawPoolp->mDataOffsets[LLDrawPool::DATA_NORMALS]);
444 colors = (LLColor4U*)(mBackupMem + (4 * mIndicesCount) + mDrawPoolp->mDataOffsets[LLDrawPool::DATA_COLORS]);
445 texcoords0= (LLVector2*)(mBackupMem + (4 * mIndicesCount) + mDrawPoolp->mDataOffsets[LLDrawPool::DATA_TEX_COORDS0]);
446 texcoords1= (LLVector2*)(mBackupMem + (4 * mIndicesCount) + mDrawPoolp->mDataOffsets[LLDrawPool::DATA_TEX_COORDS1]);
447 texcoords0.setStride(mDrawPoolp->getStride());
448 texcoords1.setStride(mDrawPoolp->getStride());
449 vertices.setStride( mDrawPoolp->getStride());
450 normals.setStride( mDrawPoolp->getStride());
451 colors.setStride( mDrawPoolp->getStride());
452 indicesp = (U32*)mBackupMem;
453
454 return 0;
455 } 306 }
456 else 307 else
457 { 308 {
458 if (!reserveIfNeeded()) 309 mGeomIndex = -1;
459 {
460 llinfos << "Get geometry failed!" << llendl;
461 return -1;
462 }
463
464 llassert(mGeomIndex >= 0);
465 llassert(mIndicesIndex >= 0);
466
467 mDrawPoolp->getVertexStrider(vertices, mGeomIndex);
468 mDrawPoolp->getNormalStrider(normals, mGeomIndex);
469 mDrawPoolp->getColorStrider(colors, mGeomIndex);
470 mDrawPoolp->getTexCoordStrider(texcoords0, mGeomIndex, 0);
471 mDrawPoolp->getTexCoordStrider(texcoords1, mGeomIndex, 1);
472
473 indicesp = mDrawPoolp->getIndices(mIndicesIndex);
474
475 mDrawPoolp->setDirty();
476
477 llassert(mGeomIndex >= 0);
478 return mGeomIndex;
479 } 310 }
311
312 return mGeomIndex;
480} 313}
481 314
482S32 LLFace::getGeometry(LLStrider<LLVector3> &vertices, LLStrider<LLVector3> &normals, 315S32 LLFace::getGeometry(LLStrider<LLVector3> &vertices, LLStrider<LLVector3> &normals,
483 LLStrider<LLVector2> &tex_coords, U32 *&indicesp) 316 LLStrider<LLVector2> &tex_coords, LLStrider<U32> &indicesp)
484{ 317{
485 LLMemType mt1(LLMemType::MTYPE_DRAWABLE); 318 LLMemType mt1(LLMemType::MTYPE_DRAWABLE);
486 319
@@ -489,55 +322,31 @@ S32 LLFace::getGeometry(LLStrider<LLVector3> &vertices, LLStrider<LLVector3> &no
489 return -1; 322 return -1;
490 } 323 }
491 324
492 if (isState(BACKLIST)) 325 if (mVertexBuffer.notNull())
493 { 326 {
494 if (!mBackupMem) 327 mVertexBuffer->getVertexStrider(vertices, mGeomIndex);
328 if (mVertexBuffer->hasDataType(LLVertexBuffer::TYPE_NORMAL))
329 {
330 mVertexBuffer->getNormalStrider(normals, mGeomIndex);
331 }
332 if (mVertexBuffer->hasDataType(LLVertexBuffer::TYPE_TEXCOORD))
495 { 333 {
496 printDebugInfo(); 334 mVertexBuffer->getTexCoordStrider(tex_coords, mGeomIndex);
497 llerrs << "No backup memory for face" << llendl;
498 } 335 }
499 vertices = (LLVector3*)(mBackupMem + (4 * mIndicesCount) + mDrawPoolp->mDataOffsets[LLDrawPool::DATA_VERTICES]);
500 normals = (LLVector3*)(mBackupMem + (4 * mIndicesCount) + mDrawPoolp->mDataOffsets[LLDrawPool::DATA_NORMALS]);
501 tex_coords= (LLVector2*)(mBackupMem + (4 * mIndicesCount) + mDrawPoolp->mDataOffsets[LLDrawPool::DATA_TEX_COORDS0]);
502 tex_coords.setStride(mDrawPoolp->getStride());
503 vertices.setStride( mDrawPoolp->getStride());
504 normals.setStride( mDrawPoolp->getStride());
505 indicesp = (U32*)mBackupMem;
506 336
507 return 0; 337 mVertexBuffer->getIndexStrider(indicesp, mIndicesIndex);
508 } 338 }
509 else 339 else
510 { 340 {
511 if (!reserveIfNeeded()) 341 mGeomIndex = -1;
512 {
513 return -1;
514 }
515
516 llassert(mGeomIndex >= 0);
517 llassert(mIndicesIndex >= 0);
518
519 mDrawPoolp->getVertexStrider(vertices, mGeomIndex);
520 if (mDrawPoolp->mDataMaskIL & LLDrawPool::DATA_NORMALS_MASK)
521 {
522 mDrawPoolp->getNormalStrider(normals, mGeomIndex);
523 }
524 if (mDrawPoolp->mDataMaskIL & LLDrawPool::DATA_TEX_COORDS0_MASK)
525 {
526 mDrawPoolp->getTexCoordStrider(tex_coords, mGeomIndex);
527 }
528
529 indicesp =mDrawPoolp->getIndices (mIndicesIndex);
530
531 mDrawPoolp->setDirty();
532
533 llassert(mGeomIndex >= 0);
534 return mGeomIndex;
535 } 342 }
343
344 return mGeomIndex;
536} 345}
537 346
538S32 LLFace::getGeometryColors(LLStrider<LLVector3> &vertices, LLStrider<LLVector3> &normals, 347S32 LLFace::getGeometryColors(LLStrider<LLVector3> &vertices, LLStrider<LLVector3> &normals,
539 LLStrider<LLVector2> &tex_coords, LLStrider<LLColor4U> &colors, 348 LLStrider<LLVector2> &tex_coords, LLStrider<LLColor4U> &colors,
540 U32 *&indicesp) 349 LLStrider<U32> &indicesp)
541{ 350{
542 S32 res = getGeometry(vertices, normals, tex_coords, indicesp); 351 S32 res = getGeometry(vertices, normals, tex_coords, indicesp);
543 if (res >= 0) 352 if (res >= 0)
@@ -547,95 +356,25 @@ S32 LLFace::getGeometryColors(LLStrider<LLVector3> &vertices, LLStrider<LLVector
547 return res; 356 return res;
548} 357}
549 358
550S32 LLFace::getGeometryMultiTexture( 359void LLFace::updateCenterAgent()
551 LLStrider<LLVector3> &vertices,
552 LLStrider<LLVector3> &normals,
553 LLStrider<LLVector3> &binormals,
554 LLStrider<LLVector2> &tex_coords0,
555 LLStrider<LLVector2> &tex_coords1,
556 U32 *&indicesp)
557{ 360{
558 LLMemType mt1(LLMemType::MTYPE_DRAWABLE); 361 if (mDrawablep->isActive())
559
560 if (mGeomCount <= 0)
561 { 362 {
562 return -1; 363 mCenterAgent = mCenterLocal * getRenderMatrix();
563 }
564
565 if (isState(BACKLIST))
566 {
567 if (!mBackupMem)
568 {
569 printDebugInfo();
570 llerrs << "No backup memory for face" << llendl;
571 }
572 vertices = (LLVector3*)(mBackupMem + (4 * mIndicesCount) + mDrawPoolp->mDataOffsets[LLDrawPool::DATA_VERTICES]);
573 normals = (LLVector3*)(mBackupMem + (4 * mIndicesCount) + mDrawPoolp->mDataOffsets[LLDrawPool::DATA_NORMALS]);
574 tex_coords0 = (LLVector2*)(mBackupMem + (4 * mIndicesCount) + mDrawPoolp->mDataOffsets[LLDrawPool::DATA_TEX_COORDS0]);
575 tex_coords0.setStride( mDrawPoolp->getStride() );
576 vertices.setStride( mDrawPoolp->getStride() );
577 normals.setStride( mDrawPoolp->getStride() );
578 if (mDrawPoolp->mDataMaskIL & LLDrawPool::DATA_BINORMALS_MASK)
579 {
580 binormals = (LLVector3*)(mBackupMem + (4 * mIndicesCount) + mDrawPoolp->mDataOffsets[LLDrawPool::DATA_BINORMALS]);
581 binormals.setStride( mDrawPoolp->getStride() );
582 }
583 if (mDrawPoolp->mDataMaskIL & LLDrawPool::DATA_TEX_COORDS1_MASK)
584 {
585 tex_coords1 = (LLVector2*)(mBackupMem + (4 * mIndicesCount) + mDrawPoolp->mDataOffsets[LLDrawPool::DATA_TEX_COORDS1]);
586 tex_coords1.setStride( mDrawPoolp->getStride() );
587 }
588 indicesp = (U32*)mBackupMem;
589
590 return 0;
591 } 364 }
592 else 365 else
593 { 366 {
594 if (!reserveIfNeeded()) 367 mCenterAgent = mCenterLocal;
595 {
596 return -1;
597 }
598
599 llassert(mGeomIndex >= 0);
600 llassert(mIndicesIndex >= 0);
601
602 mDrawPoolp->getVertexStrider(vertices, mGeomIndex);
603 if (mDrawPoolp->mDataMaskIL & LLDrawPool::DATA_NORMALS_MASK)
604 {
605 mDrawPoolp->getNormalStrider(normals, mGeomIndex);
606 }
607 if (mDrawPoolp->mDataMaskIL & LLDrawPool::DATA_TEX_COORDS0_MASK)
608 {
609 mDrawPoolp->getTexCoordStrider(tex_coords0, mGeomIndex);
610 }
611 if (mDrawPoolp->mDataMaskIL & LLDrawPool::DATA_BINORMALS_MASK)
612 {
613 mDrawPoolp->getBinormalStrider(binormals, mGeomIndex);
614 }
615 if (mDrawPoolp->mDataMaskIL & LLDrawPool::DATA_TEX_COORDS1_MASK)
616 {
617 mDrawPoolp->getTexCoordStrider(tex_coords1, mGeomIndex, 1);
618 }
619 indicesp = mDrawPoolp->getIndices(mIndicesIndex);
620
621 mDrawPoolp->setDirty();
622
623 llassert(mGeomIndex >= 0);
624 return mGeomIndex;
625 } 368 }
626} 369}
627 370
628void LLFace::updateCenterAgent() 371void LLFace::renderForSelect(U32 data_mask)
629{
630 mCenterAgent = mCenterLocal * getRenderMatrix();
631}
632
633void LLFace::renderForSelect() const
634{ 372{
635 if(mGeomIndex < 0 || mDrawablep.isNull()) 373 if(mGeomIndex < 0 || mDrawablep.isNull() || mVertexBuffer.isNull())
636 { 374 {
637 return; 375 return;
638 } 376 }
377
639 if (mVObjp->mGLName) 378 if (mVObjp->mGLName)
640 { 379 {
641 S32 name = mVObjp->mGLName; 380 S32 name = mVObjp->mGLName;
@@ -649,47 +388,25 @@ void LLFace::renderForSelect() const
649#endif 388#endif
650 glColor4ubv(color.mV); 389 glColor4ubv(color.mV);
651 390
652 if (mVObjp->getPCode() == LL_PCODE_VOLUME) 391 if (!getPool())
653 { 392 {
654 LLVOVolume *volp; 393 switch (getPoolType())
655 volp = (LLVOVolume *)(LLViewerObject*)mVObjp;
656 if (volp->getNumFaces() == 1 && !volp->getVolumeChanged())
657 { 394 {
658 // We need to special case the coalesced face model. 395 case LLDrawPool::POOL_ALPHA:
659 S32 num_vfs = volp->getVolume()->getNumFaces(); 396 getTexture()->bind();
660 S32 offset = 0; 397 break;
661 S32 i; 398 default:
662 399 LLImageGL::unbindTexture(0);
663 for (i = 0; i < num_vfs; i++) 400 break;
664 {
665 if (gPickFaces)
666 {
667 // mask off high 4 bits (16 total possible faces)
668 color.mV[0] &= 0x0f;
669 color.mV[0] |= (i & 0x0f) << 4;
670 glColor4ubv(color.mV);
671 }
672 S32 count = volp->getVolume()->getVolumeFace(i).mIndices.size();
673 if (isState(GLOBAL))
674 {
675 glDrawElements(mPrimType, count, GL_UNSIGNED_INT, getRawIndices() + offset);
676 }
677 else
678 {
679 glPushMatrix();
680 glMultMatrixf((float*)getRenderMatrix().mMatrix);
681 glDrawElements(mPrimType, count, GL_UNSIGNED_INT, getRawIndices() + offset);
682 glPopMatrix();
683 }
684 offset += count;
685 }
686 // We're done, return.
687 return;
688 } 401 }
689
690 // We don't have coalesced faces, do this the normal way.
691 } 402 }
692 403
404 mVertexBuffer->setBuffer(data_mask);
405#if !LL_RELEASE_FOR_DOWNLOAD
406 LLGLState::checkClientArrays(data_mask);
407#endif
408 U32* indicesp = (U32*) mVertexBuffer->getIndicesPointer() + mIndicesIndex;
409
693 if (gPickFaces && mTEOffset != -1) 410 if (gPickFaces && mTEOffset != -1)
694 { 411 {
695 // mask off high 4 bits (16 total possible faces) 412 // mask off high 4 bits (16 total possible faces)
@@ -702,13 +419,13 @@ void LLFace::renderForSelect() const
702 { 419 {
703 if (isState(GLOBAL)) 420 if (isState(GLOBAL))
704 { 421 {
705 glDrawElements(mPrimType, mIndicesCount, GL_UNSIGNED_INT, getRawIndices()); 422 glDrawElements(GL_TRIANGLES, mIndicesCount, GL_UNSIGNED_INT, indicesp);
706 } 423 }
707 else 424 else
708 { 425 {
709 glPushMatrix(); 426 glPushMatrix();
710 glMultMatrixf((float*)getRenderMatrix().mMatrix); 427 glMultMatrixf((float*)getRenderMatrix().mMatrix);
711 glDrawElements(mPrimType, mIndicesCount, GL_UNSIGNED_INT, getRawIndices()); 428 glDrawElements(GL_TRIANGLES, mIndicesCount, GL_UNSIGNED_INT, indicesp);
712 glPopMatrix(); 429 glPopMatrix();
713 } 430 }
714 } 431 }
@@ -716,13 +433,13 @@ void LLFace::renderForSelect() const
716 { 433 {
717 if (isState(GLOBAL)) 434 if (isState(GLOBAL))
718 { 435 {
719 glDrawArrays(mPrimType, mGeomIndex, mGeomCount); 436 glDrawArrays(GL_TRIANGLES, mGeomIndex, mGeomCount);
720 } 437 }
721 else 438 else
722 { 439 {
723 glPushMatrix(); 440 glPushMatrix();
724 glMultMatrixf((float*)getRenderMatrix().mMatrix); 441 glMultMatrixf((float*)getRenderMatrix().mMatrix);
725 glDrawArrays(mPrimType, mGeomIndex, mGeomCount); 442 glDrawArrays(GL_TRIANGLES, mGeomIndex, mGeomCount);
726 glPopMatrix(); 443 glPopMatrix();
727 } 444 }
728 } 445 }
@@ -731,11 +448,12 @@ void LLFace::renderForSelect() const
731 448
732void LLFace::renderSelected(LLImageGL *imagep, const LLColor4& color, const S32 offset, const S32 count) 449void LLFace::renderSelected(LLImageGL *imagep, const LLColor4& color, const S32 offset, const S32 count)
733{ 450{
734 if(mGeomIndex < 0 || mDrawablep.isNull()) 451 if(mGeomIndex < 0 || mDrawablep.isNull() || mVertexBuffer.isNull())
735 { 452 {
736 return; 453 return;
737 } 454 }
738 if (mGeomCount > 0) 455
456 if (mGeomCount > 0 && mIndicesCount > 0)
739 { 457 {
740 LLGLSPipelineAlpha gls_pipeline_alpha; 458 LLGLSPipelineAlpha gls_pipeline_alpha;
741 glColor4fv(color.mV); 459 glColor4fv(color.mV);
@@ -748,110 +466,27 @@ void LLFace::renderSelected(LLImageGL *imagep, const LLColor4& color, const S32
748 glMultMatrixf((float*)getRenderMatrix().mMatrix); 466 glMultMatrixf((float*)getRenderMatrix().mMatrix);
749 } 467 }
750 468
751 if (sSafeRenderSelect) 469 glEnableClientState(GL_TEXTURE_COORD_ARRAY);
752 { 470 glEnableClientState(GL_VERTEX_ARRAY);
753 glBegin(mPrimType); 471 glEnableClientState(GL_NORMAL_ARRAY);
754 if (count)
755 {
756 for (S32 i = offset; i < offset + count; i++)
757 {
758 LLVector2 tc = mDrawPoolp->getTexCoord(mDrawPoolp->getIndex(getIndicesStart() + i), 0);
759 glTexCoord2fv(tc.mV);
760 LLVector3 normal = mDrawPoolp->getNormal(mDrawPoolp->getIndex(getIndicesStart() + i));
761 glNormal3fv(normal.mV);
762 LLVector3 vertex = mDrawPoolp->getVertex(mDrawPoolp->getIndex(getIndicesStart() + i));
763 glVertex3fv(vertex.mV);
764 }
765 }
766 else
767 {
768 for (U32 i = 0; i < getIndicesCount(); i++)
769 {
770 LLVector2 tc = mDrawPoolp->getTexCoord(mDrawPoolp->getIndex(getIndicesStart() + i), 0);
771 glTexCoord2fv(tc.mV);
772 LLVector3 normal = mDrawPoolp->getNormal(mDrawPoolp->getIndex(getIndicesStart() + i));
773 glNormal3fv(normal.mV);
774 LLVector3 vertex = mDrawPoolp->getVertex(mDrawPoolp->getIndex(getIndicesStart() + i));
775 glVertex3fv(vertex.mV);
776 }
777 }
778 glEnd();
779
780 if( gSavedSettings.getBOOL("ShowTangentBasis") )
781 {
782 S32 start;
783 S32 end;
784 if (count)
785 {
786 start = offset;
787 end = offset + count;
788 }
789 else
790 {
791 start = 0;
792 end = getIndicesCount();
793 }
794 472
795 LLGLSNoTexture gls_no_texture; 473 mVertexBuffer->setBuffer(LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_NORMAL | LLVertexBuffer::MAP_TEXCOORD);
796 glColor4f(1, 1, 1, 1); 474#if !LL_RELEASE_FOR_DOWNLOAD
797 glBegin(GL_LINES); 475 LLGLState::checkClientArrays(LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_NORMAL | LLVertexBuffer::MAP_TEXCOORD);
798 for (S32 i = start; i < end; i++) 476#endif
799 { 477 U32* indicesp = ((U32*) mVertexBuffer->getIndicesPointer()) + mIndicesIndex;
800 LLVector3 vertex = mDrawPoolp->getVertex(mDrawPoolp->getIndex(getIndicesStart() + i));
801 glVertex3fv(vertex.mV);
802 LLVector3 normal = mDrawPoolp->getNormal(mDrawPoolp->getIndex(getIndicesStart() + i));
803 glVertex3fv( (vertex + normal * 0.1f).mV );
804 }
805 glEnd();
806 478
807 if (mDrawPoolp->mDataMaskIL & LLDrawPool::DATA_BINORMALS_MASK) 479 if (count)
808 { 480 {
809 glColor4f(0, 1, 0, 1); 481 glDrawElements(GL_TRIANGLES, count, GL_UNSIGNED_INT, indicesp + offset);
810 glBegin(GL_LINES);
811 for (S32 i = start; i < end; i++)
812 {
813 LLVector3 vertex = mDrawPoolp->getVertex(mDrawPoolp->getIndex(getIndicesStart() + i));
814 glVertex3fv(vertex.mV);
815 LLVector3 binormal = mDrawPoolp->getBinormal(mDrawPoolp->getIndex(getIndicesStart() + i));
816 glVertex3fv( (vertex + binormal * 0.1f).mV );
817 }
818 glEnd();
819 }
820 }
821 } 482 }
822 else 483 else
823 { 484 {
824 glEnableClientState(GL_TEXTURE_COORD_ARRAY); 485 glDrawElements(GL_TRIANGLES, mIndicesCount, GL_UNSIGNED_INT, indicesp);
825 glEnableClientState(GL_VERTEX_ARRAY);
826 glEnableClientState(GL_NORMAL_ARRAY);
827 if (count)
828 {
829 if (mIndicesCount > 0)
830 {
831 glDrawElements(mPrimType, count, GL_UNSIGNED_INT, getRawIndices() + offset);
832 }
833 else
834 {
835 llerrs << "Rendering non-indexed volume face!" << llendl;
836 glDrawArrays(mPrimType, mGeomIndex, mGeomCount);
837 }
838 }
839 else
840 {
841 if (mIndicesCount > 0)
842 {
843 glDrawElements(mPrimType, mIndicesCount, GL_UNSIGNED_INT, getRawIndices());
844 }
845 else
846 {
847 glDrawArrays(mPrimType, mGeomIndex, mGeomCount);
848 }
849 }
850 glDisableClientState(GL_TEXTURE_COORD_ARRAY);
851 glDisableClientState(GL_VERTEX_ARRAY);
852 glDisableClientState(GL_NORMAL_ARRAY);
853 } 486 }
854 487 glDisableClientState(GL_TEXTURE_COORD_ARRAY);
488 glDisableClientState(GL_NORMAL_ARRAY);
489
855 if (!isState(GLOBAL)) 490 if (!isState(GLOBAL))
856 { 491 {
857 // Restore the tranform for non-global objects 492 // Restore the tranform for non-global objects
@@ -862,6 +497,7 @@ void LLFace::renderSelected(LLImageGL *imagep, const LLColor4& color, const S32
862 497
863void LLFace::renderSelectedUV(const S32 offset, const S32 count) 498void LLFace::renderSelectedUV(const S32 offset, const S32 count)
864{ 499{
500#if 0
865 LLUUID uv_img_red_blue_id(gViewerArt.getString("uv_test1.tga")); 501 LLUUID uv_img_red_blue_id(gViewerArt.getString("uv_test1.tga"));
866 LLUUID uv_img_green_id(gViewerArt.getString("uv_test2.tga")); 502 LLUUID uv_img_green_id(gViewerArt.getString("uv_test2.tga"));
867 LLViewerImage* red_blue_imagep = gImageList.getImage(uv_img_red_blue_id, TRUE, TRUE); 503 LLViewerImage* red_blue_imagep = gImageList.getImage(uv_img_red_blue_id, TRUE, TRUE);
@@ -911,7 +547,7 @@ void LLFace::renderSelectedUV(const S32 offset, const S32 count)
911 glPolygonOffset(factor, bias); 547 glPolygonOffset(factor, bias);
912 if (sSafeRenderSelect) 548 if (sSafeRenderSelect)
913 { 549 {
914 glBegin(mPrimType); 550 glBegin(GL_TRIANGLES);
915 if (count) 551 if (count)
916 { 552 {
917 for (S32 i = offset; i < offset + count; i++) 553 for (S32 i = offset; i < offset + count; i++)
@@ -943,7 +579,7 @@ void LLFace::renderSelectedUV(const S32 offset, const S32 count)
943 { 579 {
944 if (mIndicesCount > 0) 580 if (mIndicesCount > 0)
945 { 581 {
946 glDrawElements(mPrimType, count, GL_UNSIGNED_INT, getRawIndices() + offset); 582 glDrawElements(GL_TRIANGLES, count, GL_UNSIGNED_INT, getRawIndices() + offset);
947 } 583 }
948 else 584 else
949 { 585 {
@@ -955,15 +591,14 @@ void LLFace::renderSelectedUV(const S32 offset, const S32 count)
955 { 591 {
956 if (mIndicesCount > 0) 592 if (mIndicesCount > 0)
957 { 593 {
958 glDrawElements(mPrimType, mIndicesCount, GL_UNSIGNED_INT, getRawIndices()); 594 glDrawElements(GL_TRIANGLES, mIndicesCount, GL_UNSIGNED_INT, getRawIndices());
959 } 595 }
960 else 596 else
961 { 597 {
962 glDrawArrays(mPrimType, mGeomIndex, mGeomCount); 598 glDrawArrays(GL_TRIANGLES, mGeomIndex, mGeomCount);
963 } 599 }
964 } 600 }
965 glDisableClientState(GL_TEXTURE_COORD_ARRAY); 601 glDisableClientState(GL_TEXTURE_COORD_ARRAY);
966 glDisableClientState(GL_VERTEX_ARRAY);
967 } 602 }
968 603
969 glDisable(GL_POLYGON_OFFSET_FILL); 604 glDisable(GL_POLYGON_OFFSET_FILL);
@@ -984,12 +619,13 @@ void LLFace::renderSelectedUV(const S32 offset, const S32 count)
984 619
985 //restore blend func 620 //restore blend func
986 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); 621 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
622#endif
987} 623}
988 624
989 625
990void LLFace::printDebugInfo() const 626void LLFace::printDebugInfo() const
991{ 627{
992 LLDrawPool *poolp = getPool(); 628 LLFacePool *poolp = getPool();
993 llinfos << "Object: " << getViewerObject()->mID << llendl; 629 llinfos << "Object: " << getViewerObject()->mID << llendl;
994 if (getDrawable()) 630 if (getDrawable())
995 { 631 {
@@ -1005,10 +641,6 @@ void LLFace::printDebugInfo() const
1005 } 641 }
1006 642
1007 llinfos << "Face: " << this << llendl; 643 llinfos << "Face: " << this << llendl;
1008 if (isState(BACKLIST))
1009 {
1010 llinfos << "Backlisted!" << llendl;
1011 }
1012 llinfos << "State: " << getState() << llendl; 644 llinfos << "State: " << getState() << llendl;
1013 llinfos << "Geom Index Data:" << llendl; 645 llinfos << "Geom Index Data:" << llendl;
1014 llinfos << "--------------------" << llendl; 646 llinfos << "--------------------" << llendl;
@@ -1037,7 +669,7 @@ void LLFace::printDebugInfo() const
1037 llinfos << "Incorrect number of pool references!" << llendl; 669 llinfos << "Incorrect number of pool references!" << llendl;
1038 } 670 }
1039 671
1040 672#if 0
1041 llinfos << "Indices:" << llendl; 673 llinfos << "Indices:" << llendl;
1042 llinfos << "--------------------" << llendl; 674 llinfos << "--------------------" << llendl;
1043 675
@@ -1058,149 +690,7 @@ void LLFace::printDebugInfo() const
1058 llinfos << mGeomIndex + i << ":" << poolp->getVertex(mGeomIndex + i) << llendl; 690 llinfos << mGeomIndex + i << ":" << poolp->getVertex(mGeomIndex + i) << llendl;
1059 } 691 }
1060 llinfos << llendl; 692 llinfos << llendl;
1061}
1062
1063S32 LLFace::backup()
1064{
1065 LLMemType mt1(LLMemType::MTYPE_DRAWABLE);
1066
1067 if (isState(BACKLIST))
1068 {
1069 llwarns << "Face is already backed up in LLFace::backup!" << llendl;
1070 return mGeomCount;
1071 }
1072 if (mGeomIndex < 0)
1073 {
1074 // flexible objects can cause this
1075 //llwarns << "No geometry to back-up" << llendl;
1076 return 0;
1077 }
1078
1079 S32 size = 0;
1080 if (!mBackupMem)
1081 {
1082 size = allocBackupMem();
1083 }
1084 else
1085 {
1086 llerrs << "Memory already backed up!" << llendl;
1087 }
1088
1089 // Need to flag this, because we can allocate a non-zero backup mem if we have indices and no geometry.
1090
1091 if (mGeomCount || mIndicesCount)
1092 {
1093 setState(BACKLIST);
1094#if !RELEASE_FOR_DOWNLOAD
1095 if (mGeomIndex < 0 || mIndicesIndex < 0)
1096 {
1097 llerrs << "LLFace::backup" << llendl;
1098 }
1099#endif 693#endif
1100
1101 U32 *backup = (U32*)mBackupMem;
1102 S32 stride = mDrawPoolp->getStride();
1103
1104 U32 *index = mDrawPoolp->getIndices(mIndicesIndex);
1105 for (U32 i=0;i<mIndicesCount;i++)
1106 {
1107 *backup++ = index[i] - mGeomIndex;
1108 index[i] = 0;
1109 }
1110
1111 if (!mGeomCount)
1112 {
1113 return mGeomCount;
1114 }
1115 //
1116 // Don't change the order of these unles you change the corresponding getGeometry calls that read out of
1117 // backup memory, and also the other of the backup/restore pair!
1118 //
1119 memcpy(backup, (mDrawPoolp->mMemory.getMem() + mGeomIndex * stride), mGeomCount * stride);
1120 backup += mGeomCount * stride / 4;
1121
1122 if (mDrawPoolp->mDataMaskNIL & LLDrawPool::DATA_CLOTHING_WEIGHTS_MASK)
1123 {
1124 memcpy(backup, &mDrawPoolp->getClothingWeight(mGeomIndex), mGeomCount * sizeof(LLVector4));
1125 backup += mGeomCount*4;
1126 }
1127
1128 if (mDrawPoolp->mDataMaskNIL & LLDrawPool::DATA_VERTEX_WEIGHTS_MASK)
1129 {
1130 memcpy(backup, &mDrawPoolp->getVertexWeight(mGeomIndex), mGeomCount * sizeof(F32));
1131 backup += mGeomCount;
1132 }
1133
1134 llassert((U8*)backup - mBackupMem == size);
1135
1136 unReserve();
1137 }
1138 return mGeomCount;
1139}
1140
1141void LLFace::restore()
1142{
1143 LLMemType mt1(LLMemType::MTYPE_DRAWABLE);
1144
1145 if (!isState(BACKLIST))
1146 {
1147 // flexible objects can cause this
1148// printDebugInfo();
1149// llwarns << "not backlisted for restore" << llendl;
1150 return;
1151 }
1152 if (!mGeomCount || !mBackupMem)
1153 {
1154 if (!mBackupMem)
1155 {
1156 printDebugInfo();
1157 llwarns << "no backmem for restore" << llendl;
1158 }
1159
1160 clearState(BACKLIST);
1161 return;
1162 }
1163
1164 S32 stride = mDrawPoolp->getStride();
1165 mGeomIndex = mDrawPoolp->reserveGeom(mGeomCount);
1166 mIndicesIndex = mDrawPoolp->reserveInd (mIndicesCount);
1167 mGeneration = mDrawPoolp->mGeneration;
1168
1169 llassert(mGeomIndex >= 0);
1170 llassert(mIndicesIndex >= 0);
1171
1172 U32 *backup = (U32*)mBackupMem;
1173 U32 *index = mDrawPoolp->getIndices(mIndicesIndex);
1174
1175 for (U32 i=0;i<mIndicesCount;i++)
1176 {
1177 S32 ind = mGeomIndex + *backup;
1178 index[i] = ind;
1179 backup++;
1180 }
1181
1182 mDrawPoolp->mMemory.copyToMem(mGeomIndex * stride, (U8 *)backup, mGeomCount * stride);
1183 backup += mGeomCount * stride / 4;
1184
1185 //
1186 // Don't change the order of these unles you change the corresponding getGeometry calls that read out of
1187 // backup memory, and also the other of the backup/restore pair!
1188 //
1189 if (mDrawPoolp->mDataMaskNIL & LLDrawPool::DATA_CLOTHING_WEIGHTS_MASK)
1190 {
1191 mDrawPoolp->mClothingWeights.copyToMem(mGeomIndex, (U8 *)backup, mGeomCount);
1192 backup += mGeomCount*4;
1193 }
1194
1195 if (mDrawPoolp->mDataMaskNIL & LLDrawPool::DATA_VERTEX_WEIGHTS_MASK)
1196 {
1197 mDrawPoolp->mWeights.copyToMem(mGeomIndex, (U8 *)backup, mGeomCount);
1198 backup += mGeomCount;
1199 }
1200
1201 delete[] mBackupMem;
1202 mBackupMem = NULL;
1203 clearState(BACKLIST);
1204} 694}
1205 695
1206// Transform the texture coordinates for this face. 696// Transform the texture coordinates for this face.
@@ -1232,48 +722,199 @@ static void xform(LLVector2 &tex_coord, F32 cosAng, F32 sinAng, F32 offS, F32 of
1232} 722}
1233 723
1234 724
1235BOOL LLFace::genVolumeTriangles(const LLVolume &volume, S32 f, 725BOOL LLFace::genVolumeBBoxes(const LLVolume &volume, S32 f,
1236 const LLMatrix4& mat, const LLMatrix3& inv_trans_mat, BOOL global_volume) 726 const LLMatrix4& mat_vert, const LLMatrix3& mat_normal, BOOL global_volume)
727{
728 LLMemType mt1(LLMemType::MTYPE_DRAWABLE);
729
730 const LLVolumeFace &face = volume.getVolumeFace(f);
731
732 //get bounding box
733 if (mDrawablep->isState(LLDrawable::REBUILD_VOLUME | LLDrawable::REBUILD_POSITION))
734 {
735 if (mDrawablep->isState(LLDrawable::REBUILD_VOLUME))
736 { //vertex buffer no longer valid
737 mVertexBuffer = NULL;
738 mLastVertexBuffer = NULL;
739 }
740
741 LLVector3 min,max;
742
743 min = face.mExtents[0];
744 max = face.mExtents[1];
745
746 //min, max are in volume space, convert to drawable render space
747 LLVector3 center = ((min + max) * 0.5f)*mat_vert;
748 LLVector3 size = ((max-min) * 0.5f);
749 if (!global_volume)
750 {
751 size.scaleVec(mDrawablep->getVObj()->getScale());
752 }
753 LLQuaternion rotation = LLQuaternion(mat_normal);
754
755 LLVector3 v[4];
756 //get 4 corners of bounding box
757 v[0] = (size * rotation);
758 v[1] = (LLVector3(-size.mV[0], -size.mV[1], size.mV[2]) * rotation);
759 v[2] = (LLVector3(size.mV[0], -size.mV[1], -size.mV[2]) * rotation);
760 v[3] = (LLVector3(-size.mV[0], size.mV[1], -size.mV[2]) * rotation);
761
762 LLVector3& newMin = mExtents[0];
763 LLVector3& newMax = mExtents[1];
764
765 newMin = newMax = center;
766
767 for (U32 i = 0; i < 4; i++)
768 {
769 for (U32 j = 0; j < 3; j++)
770 {
771 F32 delta = fabsf(v[i].mV[j]);
772 F32 min = center.mV[j] - delta;
773 F32 max = center.mV[j] + delta;
774
775 if (min < newMin.mV[j])
776 {
777 newMin.mV[j] = min;
778 }
779
780 if (max > newMax.mV[j])
781 {
782 newMax.mV[j] = max;
783 }
784 }
785 }
786
787 mCenterLocal = (newMin+newMax)*0.5f;
788 updateCenterAgent();
789 }
790
791 return TRUE;
792}
793
794
795BOOL LLFace::getGeometryVolume(const LLVolume& volume,
796 S32 f,
797 LLStrider<LLVector3>& vertices,
798 LLStrider<LLVector3>& normals,
799 LLStrider<LLVector2>& tex_coords,
800 LLStrider<LLVector2>& tex_coords2,
801 LLStrider<LLColor4U>& colors,
802 LLStrider<U32>& indicesp,
803 const LLMatrix4& mat_vert, const LLMatrix3& mat_normal,
804 U32& index_offset)
1237{ 805{
1238 const LLVolumeFace &vf = volume.getVolumeFace(f); 806 const LLVolumeFace &vf = volume.getVolumeFace(f);
1239 S32 num_vertices = (S32)vf.mVertices.size(); 807 S32 num_vertices = (S32)vf.mVertices.size();
1240 S32 num_indices = (S32)vf.mIndices.size(); 808 S32 num_indices = (S32)vf.mIndices.size();
1241 setSize(num_vertices, num_indices);
1242 809
1243 return genVolumeTriangles(volume, f, f, mat, inv_trans_mat, global_volume); 810 LLStrider<LLVector3> old_verts;
1244} 811 LLStrider<LLVector2> old_texcoords;
812 LLStrider<LLVector2> old_texcoords2;
813 LLStrider<LLVector3> old_normals;
814 LLStrider<LLColor4U> old_colors;
1245 815
1246BOOL LLFace::genVolumeTriangles(const LLVolume &volume, S32 fstart, S32 fend, 816 BOOL full_rebuild = mDrawablep->isState(LLDrawable::REBUILD_VOLUME);
1247 const LLMatrix4& mat_vert, const LLMatrix3& mat_normal, const BOOL global_volume) 817 BOOL moved = TRUE;
1248{
1249 LLMemType mt1(LLMemType::MTYPE_DRAWABLE);
1250 818
1251 if (!mDrawablep) 819 BOOL global_volume = mDrawablep->getVOVolume()->isVolumeGlobal();
820 LLVector3 scale;
821 if (global_volume)
1252 { 822 {
1253 return TRUE; 823 scale.setVec(1,1,1);
824 }
825 else
826 {
827 scale = mVObjp->getScale();
1254 } 828 }
1255 829
1256 S32 index_offset; 830 if (!full_rebuild)
1257 F32 r, os, ot, ms, mt, cos_ang, sin_ang; 831 {
1258 LLStrider<LLVector3> vertices; 832 if (mLastVertexBuffer == mVertexBuffer &&
1259 LLStrider<LLVector3> normals; 833 !mVertexBuffer->isEmpty())
1260 LLStrider<LLVector3> binormals; 834 { //this face really doesn't need to be regenerated, try real hard not to do so
1261 LLStrider<LLVector2> tex_coords; 835 if (mLastGeomCount == mGeomCount &&
1262 LLStrider<LLVector2> tex_coords2; 836 mLastGeomIndex == mGeomIndex &&
1263 U32 *indicesp = NULL; 837 mLastIndicesCount == mIndicesCount &&
838 mLastIndicesIndex == mIndicesIndex)
839 { //data is in same location in vertex buffer
840 moved = FALSE;
841 }
1264 842
1265 BOOL bump = mDrawPoolp && (mDrawPoolp->mDataMaskIL & LLDrawPool::DATA_BINORMALS_MASK); 843 if (!moved && !mDrawablep->isState(LLDrawable::REBUILD_ALL))
1266 BOOL is_static = mDrawablep->isStatic(); 844 { //nothing needs to be done
1267 BOOL is_global = is_static; 845 vertices += mGeomCount;
1268 846 normals += mGeomCount;
1269 if (bump) 847 tex_coords += mGeomCount;
1270 { 848 colors += mGeomCount;
1271 index_offset = getGeometryMultiTexture(vertices, normals, binormals, tex_coords, tex_coords2, indicesp); 849 tex_coords2 += mGeomCount;
850 index_offset += mGeomCount;
851 indicesp += mIndicesCount;
852 return FALSE;
853 }
854
855 if (mLastGeomCount == mGeomCount)
856 {
857 if (mLastGeomIndex >= mGeomIndex &&
858 mLastGeomIndex + mGeomCount+1 < mVertexBuffer->getNumVerts())
859 {
860 //copy from further down the buffer
861 mVertexBuffer->getVertexStrider(old_verts, mLastGeomIndex);
862 mVertexBuffer->getTexCoordStrider(old_texcoords, mLastGeomIndex);
863 mVertexBuffer->getTexCoord2Strider(old_texcoords2, mLastGeomIndex);
864 mVertexBuffer->getNormalStrider(old_normals, mLastGeomIndex);
865 mVertexBuffer->getColorStrider(old_colors, mLastGeomIndex);
866
867 if (!mDrawablep->isState(LLDrawable::REBUILD_ALL))
868 {
869 //quick copy
870 for (S32 i = 0; i < mGeomCount; i++)
871 {
872 *vertices++ = *old_verts++;
873 *tex_coords++ = *old_texcoords++;
874 *tex_coords2++ = *old_texcoords2++;
875 *colors++ = *old_colors++;
876 *normals++ = *old_normals++;
877 }
878
879 for (U32 i = 0; i < mIndicesCount; i++)
880 {
881 *indicesp++ = vf.mIndices[i] + index_offset;
882 }
883
884 index_offset += mGeomCount;
885 mLastGeomIndex = mGeomIndex;
886 mLastIndicesCount = mIndicesCount;
887 mLastIndicesIndex = mIndicesIndex;
888
889 return TRUE;
890 }
891 }
892 else
893 {
894 full_rebuild = TRUE;
895 }
896 }
897 }
898 else
899 {
900 full_rebuild = TRUE;
901 }
1272 } 902 }
1273 else 903 else
1274 { 904 {
1275 index_offset = getGeometry(vertices, normals, tex_coords, indicesp); 905 mLastUpdateTime = gFrameTimeSeconds;
1276 } 906 }
907
908
909 BOOL rebuild_pos = full_rebuild || mDrawablep->isState(LLDrawable::REBUILD_POSITION);
910 BOOL rebuild_color = full_rebuild || mDrawablep->isState(LLDrawable::REBUILD_COLOR);
911 BOOL rebuild_tcoord = full_rebuild || mDrawablep->isState(LLDrawable::REBUILD_TCOORD);
912
913 F32 r = 0, os = 0, ot = 0, ms = 0, mt = 0, cos_ang = 0, sin_ang = 0;
914
915 BOOL is_static = mDrawablep->isStatic();
916 BOOL is_global = is_static;
917
1277 if (-1 == index_offset) 918 if (-1 == index_offset)
1278 { 919 {
1279 return TRUE; 920 return TRUE;
@@ -1281,16 +922,6 @@ BOOL LLFace::genVolumeTriangles(const LLVolume &volume, S32 fstart, S32 fend,
1281 922
1282 LLVector3 center_sum(0.f, 0.f, 0.f); 923 LLVector3 center_sum(0.f, 0.f, 0.f);
1283 924
1284 LLVector3 render_pos;
1285
1286 if (mDrawablep->isState(LLDrawable::REBUILD_TCOORD) &&
1287 global_volume)
1288 {
1289 render_pos = mVObjp->getRenderPosition();
1290 }
1291
1292 setPrimType(LLTriangles);
1293
1294 if (is_global) 925 if (is_global)
1295 { 926 {
1296 setState(GLOBAL); 927 setState(GLOBAL);
@@ -1299,26 +930,16 @@ BOOL LLFace::genVolumeTriangles(const LLVolume &volume, S32 fstart, S32 fend,
1299 { 930 {
1300 clearState(GLOBAL); 931 clearState(GLOBAL);
1301 } 932 }
1302 933
1303 LLVector3 min, max;
1304 LLVector2 tmin, tmax; 934 LLVector2 tmin, tmax;
1305 935
1306 BOOL grab_first_vert = TRUE; 936 const LLTextureEntry *tep = mVObjp->getTE(f);
1307 BOOL grab_first_tcoord = TRUE; 937 U8 bump_code = tep ? bump_code = tep->getBumpmap() : 0;
1308 938
1309 for (S32 vol_face = fstart; vol_face <= fend; vol_face++) 939 if (rebuild_tcoord)
1310 { 940 {
1311 const LLVolumeFace &vf = volume.getVolumeFace(vol_face);
1312 S32 num_vertices = (S32)vf.mVertices.size();
1313 S32 num_indices = (S32)vf.mIndices.size();
1314 llassert(num_indices > 0);
1315
1316 U8 bump_code;
1317 const LLTextureEntry *tep = mVObjp->getTE(vol_face);
1318
1319 if (tep) 941 if (tep)
1320 { 942 {
1321 bump_code = tep->getBumpmap();
1322 r = tep->getRotation(); 943 r = tep->getRotation();
1323 os = tep->mOffsetS; 944 os = tep->mOffsetS;
1324 ot = tep->mOffsetT; 945 ot = tep->mOffsetT;
@@ -1329,7 +950,6 @@ BOOL LLFace::genVolumeTriangles(const LLVolume &volume, S32 fstart, S32 fend,
1329 } 950 }
1330 else 951 else
1331 { 952 {
1332 bump_code = 0;
1333 cos_ang = 1.0f; 953 cos_ang = 1.0f;
1334 sin_ang = 0.0f; 954 sin_ang = 0.0f;
1335 os = 0.0f; 955 os = 0.0f;
@@ -1337,209 +957,235 @@ BOOL LLFace::genVolumeTriangles(const LLVolume &volume, S32 fstart, S32 fend,
1337 ms = 1.0f; 957 ms = 1.0f;
1338 mt = 1.0f; 958 mt = 1.0f;
1339 } 959 }
960 }
1340 961
1341 if (mDrawablep->isState(LLDrawable::REBUILD_VOLUME)) 962 if (isState(TEXTURE_ANIM))
963 {
964 LLVOVolume* vobj = (LLVOVolume*) (LLViewerObject*) mVObjp;
965 U8 mode = vobj->mTexAnimMode;
966 if (!mode)
1342 { 967 {
1343 // VERTICES & NORMALS 968 clearState(TEXTURE_ANIM);
1344 for (S32 i = 0; i < num_vertices; i++) 969 }
970 else
971 {
972 //if (mode & LLViewerTextureAnim::TRANSLATE)
1345 { 973 {
1346 LLVector3 v; 974 os = ot = 0.f;
1347 v = vf.mVertices[i].mPosition * mat_vert;
1348
1349 LLVector3 normal = vf.mVertices[i].mNormal * mat_normal;
1350 normal.normVec();
1351 *normals++ = normal;
1352
1353 *vertices++ = v;
1354
1355 if (grab_first_vert)
1356 {
1357 grab_first_vert = FALSE;
1358 min = max = v;
1359 }
1360 else
1361 {
1362 for (U32 j = 0; j < 3; j++)
1363 {
1364 if (v.mV[j] < min.mV[j])
1365 {
1366 min.mV[j] = v.mV[j];
1367 }
1368 if (v.mV[j] > max.mV[j])
1369 {
1370 max.mV[j] = v.mV[j];
1371 }
1372 }
1373 }
1374 } 975 }
1375 for (S32 i = 0; i < num_indices; i++) 976 //if (mode & LLViewerTextureAnim::ROTATE)
1376 { 977 {
1377 S32 index = vf.mIndices[i] + index_offset; 978 r = 0.f;
1378 llassert(index >= 0 && (i != 1 || *(indicesp-1)!=(U32)index)); 979 cos_ang = 1.f;
1379 *indicesp++ = index; 980 sin_ang = 0.f;
981 }
982 //if (mode & LLViewerTextureAnim::SCALE)
983 {
984 ms = mt = 1.f;
1380 } 985 }
1381 } 986 }
987 }
988
989 LLColor4U color = tep->getColor();
1382 990
1383 if ((mDrawablep->isState(LLDrawable::REBUILD_TCOORD)) || 991 if (rebuild_color)
1384 ((bump || getTextureEntry()->getTexGen() != 0) && mDrawablep->isState(LLDrawable::REBUILD_VOLUME))) 992 {
993 GLfloat alpha[4] =
1385 { 994 {
1386 // TEX COORDS AND BINORMALS 995 0.00f,
1387 LLVector3 binormal_dir( -sin_ang, cos_ang, 0 ); 996 0.25f,
1388 LLVector3 bump_s_primary_light_ray; 997 0.5f,
1389 LLVector3 bump_t_primary_light_ray; 998 0.75f
1390 if (bump) 999 };
1391 {
1392 F32 offset_multiple;
1393 switch( bump_code )
1394 {
1395 case BE_NO_BUMP:
1396 offset_multiple = 0.f;
1397 break;
1398 case BE_BRIGHTNESS:
1399 case BE_DARKNESS:
1400 if( mTexture.notNull() && mTexture->getHasGLTexture())
1401 {
1402 // Offset by approximately one texel
1403 S32 cur_discard = mTexture->getDiscardLevel();
1404 S32 max_size = llmax( mTexture->getWidth(), mTexture->getHeight() );
1405 max_size <<= cur_discard;
1406 const F32 ARTIFICIAL_OFFSET = 2.f;
1407 offset_multiple = ARTIFICIAL_OFFSET / (F32)max_size;
1408 }
1409 else
1410 {
1411 offset_multiple = 1.f/256;
1412 }
1413 break;
1414 1000
1415 default: // Standard bumpmap textures. Assumed to be 256x256 1001 if (gPipeline.getPoolTypeFromTE(tep, getTexture()) == LLDrawPool::POOL_BUMP)
1416 offset_multiple = 1.f / 256; 1002 {
1417 break; 1003 color.mV[3] = U8 (alpha[tep->getShiny()] * 255);
1418 } 1004 }
1005 }
1419 1006
1420 F32 s_scale = 1.f; 1007 // INDICES
1421 F32 t_scale = 1.f; 1008 if (full_rebuild || moved)
1422 if( tep ) 1009 {
1423 { 1010 for (S32 i = 0; i < num_indices; i++)
1424 tep->getScale( &s_scale, &t_scale ); 1011 {
1425 } 1012 *indicesp++ = vf.mIndices[i] + index_offset;
1426 LLVector3 sun_ray = gSky.getSunDirection(); 1013 }
1427 LLVector3 moon_ray = gSky.getMoonDirection(); 1014 }
1428 LLVector3& primary_light_ray = (sun_ray.mV[VZ] > 0) ? sun_ray : moon_ray; 1015 else
1429 bump_s_primary_light_ray = offset_multiple * s_scale * primary_light_ray; 1016 {
1430 bump_t_primary_light_ray = offset_multiple * t_scale * primary_light_ray; 1017 indicesp += num_indices;
1018 }
1019
1020 //bump setup
1021 LLVector3 binormal_dir( -sin_ang, cos_ang, 0 );
1022 LLVector3 bump_s_primary_light_ray;
1023 LLVector3 bump_t_primary_light_ray;
1024
1025 if (bump_code)
1026 {
1027 F32 offset_multiple;
1028 switch( bump_code )
1029 {
1030 case BE_NO_BUMP:
1031 offset_multiple = 0.f;
1032 break;
1033 case BE_BRIGHTNESS:
1034 case BE_DARKNESS:
1035 if( mTexture.notNull() && mTexture->getHasGLTexture())
1036 {
1037 // Offset by approximately one texel
1038 S32 cur_discard = mTexture->getDiscardLevel();
1039 S32 max_size = llmax( mTexture->getWidth(), mTexture->getHeight() );
1040 max_size <<= cur_discard;
1041 const F32 ARTIFICIAL_OFFSET = 2.f;
1042 offset_multiple = ARTIFICIAL_OFFSET / (F32)max_size;
1431 } 1043 }
1432 1044 else
1433 for (S32 i = 0; i < num_vertices; i++)
1434 { 1045 {
1435 LLVector2 tc = vf.mVertices[i].mTexCoord; 1046 offset_multiple = 1.f/256;
1047 }
1048 break;
1436 1049
1437 U8 texgen = getTextureEntry()->getTexGen(); 1050 default: // Standard bumpmap textures. Assumed to be 256x256
1438 if (texgen != LLTextureEntry::TEX_GEN_DEFAULT) 1051 offset_multiple = 1.f / 256;
1439 { 1052 break;
1053 }
1440 1054
1441 LLVector3 vec = vf.mVertices[i].mPosition; //-vf.mCenter; 1055 F32 s_scale = 1.f;
1442 1056 F32 t_scale = 1.f;
1443 if (global_volume) 1057 if( tep )
1444 { 1058 {
1445 vec -= render_pos; 1059 tep->getScale( &s_scale, &t_scale );
1446 } 1060 }
1447 else 1061 LLVector3 sun_ray = gSky.getSunDirection();
1448 { 1062 LLVector3 moon_ray = gSky.getMoonDirection();
1449 vec.scaleVec(mVObjp->getScale()); 1063 LLVector3& primary_light_ray = (sun_ray.mV[VZ] > 0) ? sun_ray : moon_ray;
1450 } 1064 bump_s_primary_light_ray = offset_multiple * s_scale * primary_light_ray;
1065 bump_t_primary_light_ray = offset_multiple * t_scale * primary_light_ray;
1066 }
1067
1068 U8 texgen = getTextureEntry()->getTexGen();
1451 1069
1452 switch (texgen) 1070 for (S32 i = 0; i < num_vertices; i++)
1453 { 1071 {
1454 case LLTextureEntry::TEX_GEN_PLANAR: 1072 if (rebuild_tcoord)
1455 planarProjection(tc, vf.mVertices[i], vf.mCenter, vec); 1073 {
1456 break; 1074 LLVector2 tc = vf.mVertices[i].mTexCoord;
1457 case LLTextureEntry::TEX_GEN_SPHERICAL: 1075
1458 sphericalProjection(tc, vf.mVertices[i], vf.mCenter, vec); 1076 if (texgen != LLTextureEntry::TEX_GEN_DEFAULT)
1459 break; 1077 {
1460 case LLTextureEntry::TEX_GEN_CYLINDRICAL: 1078 LLVector3 vec = vf.mVertices[i].mPosition;
1461 cylindricalProjection(tc, vf.mVertices[i], vf.mCenter, vec); 1079
1462 break; 1080 vec.scaleVec(scale);
1463 default: 1081
1464 break; 1082 switch (texgen)
1465 }
1466 }
1467 xform(tc, cos_ang, sin_ang, os, ot, ms, mt);
1468 *tex_coords++ = tc;
1469 if (grab_first_tcoord)
1470 {
1471 grab_first_tcoord = FALSE;
1472 tmin = tmax = tc;
1473 }
1474 else
1475 {
1476 for (U32 j = 0; j < 2; j++)
1477 {
1478 if (tmin.mV[j] > tc.mV[j])
1479 {
1480 tmin.mV[j] = tc.mV[j];
1481 }
1482 else if (tmax.mV[j] < tc.mV[j])
1483 {
1484 tmax.mV[j] = tc.mV[j];
1485 }
1486 }
1487 }
1488 if (bump)
1489 { 1083 {
1490 LLVector3 tangent = vf.mVertices[i].mBinormal % vf.mVertices[i].mNormal; 1084 case LLTextureEntry::TEX_GEN_PLANAR:
1491 LLMatrix3 tangent_to_object; 1085 planarProjection(tc, vf.mVertices[i], vf.mCenter, vec);
1492 tangent_to_object.setRows(tangent, vf.mVertices[i].mBinormal, vf.mVertices[i].mNormal); 1086 break;
1493 LLVector3 binormal = binormal_dir * tangent_to_object; 1087 case LLTextureEntry::TEX_GEN_SPHERICAL:
1088 sphericalProjection(tc, vf.mVertices[i], vf.mCenter, vec);
1089 break;
1090 case LLTextureEntry::TEX_GEN_CYLINDRICAL:
1091 cylindricalProjection(tc, vf.mVertices[i], vf.mCenter, vec);
1092 break;
1093 default:
1094 break;
1095 }
1096 }
1494 1097
1495 if (!global_volume) 1098 xform(tc, cos_ang, sin_ang, os, ot, ms, mt);
1496 { 1099 *tex_coords++ = tc;
1497 binormal = binormal * mat_normal; 1100
1498 } 1101 if (bump_code)
1499 binormal.normVec(); 1102 {
1500 tangent.normVec(); 1103 LLVector3 tangent = vf.mVertices[i].mBinormal % vf.mVertices[i].mNormal;
1501 1104 LLMatrix3 tangent_to_object;
1502 tc += LLVector2( bump_s_primary_light_ray * tangent, bump_t_primary_light_ray * binormal ); 1105 tangent_to_object.setRows(tangent, vf.mVertices[i].mBinormal, vf.mVertices[i].mNormal);
1503 *tex_coords2++ = tc; 1106 LLVector3 binormal = binormal_dir * tangent_to_object;
1504 1107
1505 *binormals++ = binormal; 1108 binormal = binormal * mat_normal;
1506 } 1109 binormal.normVec();
1110
1111 tc += LLVector2( bump_s_primary_light_ray * tangent, bump_t_primary_light_ray * binormal );
1112 *tex_coords2++ = tc;
1113 }
1114 }
1115 else if (moved)
1116 {
1117 *tex_coords++ = *old_texcoords++;
1118 if (bump_code)
1119 {
1120 *tex_coords2++ = *old_texcoords2++;
1507 } 1121 }
1508 } 1122 }
1123
1124 if (rebuild_pos)
1125 {
1126 *vertices++ = vf.mVertices[i].mPosition * mat_vert;
1509 1127
1510 index_offset += num_vertices; 1128 LLVector3 normal = vf.mVertices[i].mNormal * mat_normal;
1129 normal.normVec();
1130
1131 *normals++ = normal;
1132 }
1133 else if (moved)
1134 {
1135 *normals++ = *old_normals++;
1136 *vertices++ = *old_verts++;
1137 }
1511 1138
1512 center_sum += vf.mCenter * mat_vert; 1139 if (rebuild_color)
1140 {
1141 *colors++ = color;
1142 }
1143 else if (moved)
1144 {
1145 *colors++ = *old_colors++;
1146 }
1513 } 1147 }
1514 1148
1515 center_sum /= (F32)(fend-fstart+1); 1149 if (!rebuild_pos && !moved)
1516
1517 if (is_static)
1518 { 1150 {
1519 mCenterAgent = center_sum; 1151 vertices += num_vertices;
1520 mCenterLocal = mCenterAgent - mDrawablep->getPositionAgent();
1521 } 1152 }
1522 else 1153
1154 if (!rebuild_tcoord && !moved)
1523 { 1155 {
1524 mCenterLocal = center_sum; 1156 tex_coords2 += num_vertices;
1525 updateCenterAgent(); 1157 tex_coords += num_vertices;
1526 } 1158 }
1527 1159 else if (!bump_code)
1528 if (!grab_first_vert && mDrawablep->isState(LLDrawable::REBUILD_VOLUME))
1529 { 1160 {
1530 mExtents[0] = min; 1161 tex_coords2 += num_vertices;
1531 mExtents[1] = max;
1532 } 1162 }
1533 1163
1534 if (!grab_first_tcoord && mDrawablep->isState(LLDrawable::REBUILD_TCOORD)) 1164 if (!rebuild_color && !moved)
1535 { 1165 {
1536 mTexExtents[0] = tmin; 1166 colors += num_vertices;
1537 mTexExtents[1] = tmax;
1538 } 1167 }
1539 1168
1169 if (rebuild_tcoord)
1170 {
1171 mTexExtents[0].setVec(0,0);
1172 mTexExtents[1].setVec(1,1);
1173 xform(mTexExtents[0], cos_ang, sin_ang, os, ot, ms, mt);
1174 xform(mTexExtents[1], cos_ang, sin_ang, os, ot, ms, mt);
1175 }
1176
1177 index_offset += num_vertices;
1178
1179 mLastVertexBuffer = mVertexBuffer;
1180 mLastGeomCount = mGeomCount;
1181 mLastGeomIndex = mGeomIndex;
1182 mLastIndicesCount = mIndicesCount;
1183 mLastIndicesIndex = mIndicesIndex;
1184
1540 return TRUE; 1185 return TRUE;
1541} 1186}
1542 1187
1188#if 0
1543BOOL LLFace::genLighting(const LLVolume* volume, const LLDrawable* drawablep, S32 fstart, S32 fend, 1189BOOL LLFace::genLighting(const LLVolume* volume, const LLDrawable* drawablep, S32 fstart, S32 fend,
1544 const LLMatrix4& mat_vert, const LLMatrix3& mat_normal, BOOL do_lighting) 1190 const LLMatrix4& mat_vert, const LLMatrix3& mat_normal, BOOL do_lighting)
1545{ 1191{
@@ -1662,21 +1308,20 @@ BOOL LLFace::genShadows(const LLVolume* volume, const LLDrawable* drawablep, S32
1662 } 1308 }
1663 return TRUE; 1309 return TRUE;
1664} 1310}
1311#endif
1665 1312
1666BOOL LLFace::verify(const U32* indices_array) const 1313BOOL LLFace::verify(const U32* indices_array) const
1667{ 1314{
1668 BOOL ok = TRUE; 1315 BOOL ok = TRUE;
1669 // First, check whether the face data fits within the pool's range. 1316 // First, check whether the face data fits within the pool's range.
1670 if ((mGeomIndex < 0) || (mGeomIndex + mGeomCount) > (S32)getPool()->getVertexCount()) 1317 if ((mGeomIndex < 0) || (mGeomIndex + mGeomCount) > mVertexBuffer->getNumVerts())
1671 { 1318 {
1672 ok = FALSE; 1319 ok = FALSE;
1673 llinfos << "Face not within pool range!" << llendl; 1320 llinfos << "Face not within pool range!" << llendl;
1674 } 1321 }
1675 1322
1676 S32 indices_count = (S32)getIndicesCount(); 1323 S32 indices_count = (S32)getIndicesCount();
1677 S32 geom_start = getGeomStart(); 1324
1678 S32 geom_count = mGeomCount;
1679
1680 if (!indices_count) 1325 if (!indices_count)
1681 { 1326 {
1682 return TRUE; 1327 return TRUE;
@@ -1688,6 +1333,10 @@ BOOL LLFace::verify(const U32* indices_array) const
1688 llinfos << "Face has bogus indices count" << llendl; 1333 llinfos << "Face has bogus indices count" << llendl;
1689 } 1334 }
1690 1335
1336#if 0
1337 S32 geom_start = getGeomStart();
1338 S32 geom_count = mGeomCount;
1339
1691 const U32 *indicesp = indices_array ? indices_array + mIndicesIndex : getRawIndices(); 1340 const U32 *indicesp = indices_array ? indices_array + mIndicesIndex : getRawIndices();
1692 1341
1693 for (S32 i = 0; i < indices_count; i++) 1342 for (S32 i = 0; i < indices_count; i++)
@@ -1706,6 +1355,7 @@ BOOL LLFace::verify(const U32* indices_array) const
1706 ok = FALSE; 1355 ok = FALSE;
1707 } 1356 }
1708 } 1357 }
1358#endif
1709 1359
1710 if (!ok) 1360 if (!ok)
1711 { 1361 {
@@ -1756,7 +1406,7 @@ const LLColor4& LLFace::getRenderColor() const
1756 1406
1757void LLFace::renderSetColor() const 1407void LLFace::renderSetColor() const
1758{ 1408{
1759 if (!LLDrawPool::LLOverrideFaceColor::sOverrideFaceColor) 1409 if (!LLFacePool::LLOverrideFaceColor::sOverrideFaceColor)
1760 { 1410 {
1761 const LLColor4* color = &(getRenderColor()); 1411 const LLColor4* color = &(getRenderColor());
1762 1412
@@ -1773,61 +1423,21 @@ void LLFace::renderSetColor() const
1773 1423
1774S32 LLFace::pushVertices(const U32* index_array) const 1424S32 LLFace::pushVertices(const U32* index_array) const
1775{ 1425{
1776 U32 indices_count = mIndicesCount; 1426 if (mIndicesCount)
1777 S32 ret = 0;
1778#if ENABLE_FACE_LINKING
1779 LLFace* next = mNextFace;
1780#endif
1781
1782 if (mGeomCount < gGLManager.mGLMaxVertexRange && (S32) indices_count < gGLManager.mGLMaxIndexRange)
1783 { 1427 {
1784 LLFace* current = (LLFace*) this; 1428 if (mGeomCount <= gGLManager.mGLMaxVertexRange &&
1785 S32 geom_count = mGeomCount; 1429 mIndicesCount <= (U32) gGLManager.mGLMaxIndexRange)
1786#if ENABLE_FACE_LINKING
1787 while (current)
1788 { 1430 {
1789 //chop up batch into implementation recommended sizes 1431 glDrawRangeElements(GL_TRIANGLES, mGeomIndex, mGeomIndex + mGeomCount-1, mIndicesCount,
1790 while (next && 1432 GL_UNSIGNED_INT, index_array + mIndicesIndex);
1791 (current == next ||
1792 ((S32) (indices_count + next->mIndicesCount) < gGLManager.mGLMaxIndexRange &&
1793 geom_count + next->mGeomCount < gGLManager.mGLMaxVertexRange)))
1794 {
1795 indices_count += next->mIndicesCount;
1796 geom_count += next->mGeomCount;
1797 next = next->mNextFace;
1798 }
1799#endif
1800 if (indices_count)
1801 {
1802 glDrawRangeElements(mPrimType, current->mGeomIndex, current->mGeomIndex + geom_count, indices_count,
1803 GL_UNSIGNED_INT, index_array + current->mIndicesIndex);
1804 }
1805 ret += (S32) indices_count;
1806 indices_count = 0;
1807 geom_count = 0;
1808#if ENABLE_FACE_LINKING
1809 current = next;
1810 } 1433 }
1811#endif 1434 else
1812 }
1813 else
1814 {
1815#if ENABLE_FACE_LINKING
1816 while (next)
1817 {
1818 indices_count += next->mIndicesCount;
1819 next = next->mNextFace;
1820 }
1821#endif
1822 if (indices_count)
1823 { 1435 {
1824 glDrawElements(mPrimType, indices_count, GL_UNSIGNED_INT, index_array + mIndicesIndex); 1436 glDrawElements(GL_TRIANGLES, mIndicesCount, GL_UNSIGNED_INT, index_array+mIndicesIndex);
1825 } 1437 }
1826 ret += (S32) indices_count;
1827 } 1438 }
1828 1439
1829 return ret; 1440 return mIndicesCount;
1830
1831} 1441}
1832 1442
1833const LLMatrix4& LLFace::getRenderMatrix() const 1443const LLMatrix4& LLFace::getRenderMatrix() const
@@ -1854,19 +1464,25 @@ S32 LLFace::renderElements(const U32 *index_array) const
1854 return ret; 1464 return ret;
1855} 1465}
1856 1466
1857S32 LLFace::renderIndexed(const U32 *index_array) const 1467S32 LLFace::renderIndexed()
1858{ 1468{
1859 if (mSkipRender) 1469 if(mGeomIndex < 0 || mDrawablep.isNull() || mDrawPoolp == NULL)
1860 { 1470 {
1861 return 0; 1471 return 0;
1862 } 1472 }
1473
1474 return renderIndexed(mDrawPoolp->getVertexDataMask());
1475}
1863 1476
1864 if(mGeomIndex < 0 || mDrawablep.isNull()) 1477S32 LLFace::renderIndexed(U32 mask)
1478{
1479 if (mVertexBuffer.isNull())
1865 { 1480 {
1866 return 0; 1481 return 0;
1867 } 1482 }
1868 1483
1869 renderSetColor(); 1484 mVertexBuffer->setBuffer(mask);
1485 U32* index_array = (U32*) mVertexBuffer->getIndicesPointer();
1870 return renderElements(index_array); 1486 return renderElements(index_array);
1871} 1487}
1872 1488
@@ -1879,26 +1495,13 @@ S32 LLFace::getVertices(LLStrider<LLVector3> &vertices)
1879 { 1495 {
1880 return -1; 1496 return -1;
1881 } 1497 }
1882 if (isState(BACKLIST)) 1498
1883 { 1499 if (mGeomIndex >= 0) // flexible objects may not have geometry
1884 if (!mBackupMem)
1885 {
1886 printDebugInfo();
1887 llerrs << "No backup memory for face" << llendl;
1888 }
1889 vertices = (LLVector3*)(mBackupMem + (4 * mIndicesCount) + mDrawPoolp->mDataOffsets[LLDrawPool::DATA_VERTICES]);
1890 vertices.setStride( mDrawPoolp->getStride());
1891 return 0;
1892 }
1893 else
1894 { 1500 {
1895 if (mGeomIndex >= 0) // flexible objects may not have geometry 1501 mVertexBuffer->getVertexStrider(vertices, mGeomIndex);
1896 { 1502
1897 mDrawPoolp->getVertexStrider(vertices, mGeomIndex);
1898 mDrawPoolp->setDirty();
1899 }
1900 return mGeomIndex;
1901 } 1503 }
1504 return mGeomIndex;
1902} 1505}
1903 1506
1904S32 LLFace::getColors(LLStrider<LLColor4U> &colors) 1507S32 LLFace::getColors(LLStrider<LLColor4U> &colors)
@@ -1907,42 +1510,17 @@ S32 LLFace::getColors(LLStrider<LLColor4U> &colors)
1907 { 1510 {
1908 return -1; 1511 return -1;
1909 } 1512 }
1910 if (isState(BACKLIST)) 1513
1911 { 1514 llassert(mGeomIndex >= 0);
1912 llassert(mBackupMem); 1515 mVertexBuffer->getColorStrider(colors, mGeomIndex);
1913 colors = (LLColor4U*)(mBackupMem + (4 * mIndicesCount) + mDrawPoolp->mDataOffsets[LLDrawPool::DATA_COLORS]); 1516 return mGeomIndex;
1914 colors.setStride( mDrawPoolp->getStride());
1915 return 0;
1916 }
1917 else
1918 {
1919 llassert(mGeomIndex >= 0);
1920 mDrawPoolp->getColorStrider(colors, mGeomIndex);
1921 return mGeomIndex;
1922 }
1923}
1924
1925S32 LLFace::getIndices(U32* &indicesp)
1926{
1927 if (isState(BACKLIST))
1928 {
1929 indicesp = (U32*)mBackupMem;
1930 return 0;
1931 }
1932 else
1933 {
1934 indicesp = mDrawPoolp->getIndices(mIndicesIndex);
1935 llassert(mGeomIndex >= 0 && indicesp[0] != indicesp[1]);
1936 return mGeomIndex;
1937 }
1938} 1517}
1939 1518
1940void LLFace::link(LLFace* facep) 1519S32 LLFace::getIndices(LLStrider<U32> &indicesp)
1941{ 1520{
1942#if ENABLE_FACE_LINKING 1521 mVertexBuffer->getIndexStrider(indicesp, mIndicesIndex);
1943 mNextFace = facep; 1522 llassert(mGeomIndex >= 0 && indicesp[0] != indicesp[1]);
1944 facep->mSkipRender = TRUE; 1523 return mIndicesIndex;
1945#endif
1946} 1524}
1947 1525
1948LLVector3 LLFace::getPositionAgent() const 1526LLVector3 LLFace::getPositionAgent() const
diff --git a/linden/indra/newview/llface.h b/linden/indra/newview/llface.h
index cb3b705..b265b3a 100644
--- a/linden/indra/newview/llface.h
+++ b/linden/indra/newview/llface.h
@@ -38,18 +38,19 @@
38#include "llquaternion.h" 38#include "llquaternion.h"
39#include "xform.h" 39#include "xform.h"
40#include "lldarrayptr.h" 40#include "lldarrayptr.h"
41#include "llvertexbuffer.h"
42#include "llviewerimage.h"
41#include "llpagemem.h" 43#include "llpagemem.h"
42#include "llstat.h" 44#include "llstat.h"
43#include "lldrawable.h" 45#include "lldrawable.h"
44 46
45#define ENABLE_FACE_LINKING 1 // Causes problems with snapshot rendering 47class LLFacePool;
46
47class LLDrawPool;
48class LLVolume; 48class LLVolume;
49class LLViewerImage; 49class LLViewerImage;
50class LLTextureEntry; 50class LLTextureEntry;
51class LLVertexProgram; 51class LLVertexProgram;
52class LLViewerImage; 52class LLViewerImage;
53class LLGeometryManager;
53 54
54class LLFace 55class LLFace
55{ 56{
@@ -57,26 +58,12 @@ public:
57 58
58 enum EMasks 59 enum EMasks
59 { 60 {
60 SHARED_GEOM = 0x0001, 61 LIGHT = 0x0001,
61 LIGHT = 0x0002, 62 GLOBAL = 0x0002,
62 REBUILD = 0x0004, 63 FULLBRIGHT = 0x0004,
63 GLOBAL = 0x0008, 64 HUD_RENDER = 0x0008,
64 VISIBLE = 0x0010, 65 USE_FACE_COLOR = 0x0010,
65 BACKLIST = 0x0020, 66 TEXTURE_ANIM = 0x0020,
66 INTERP = 0x0040,
67 FULLBRIGHT = 0x0080,
68 HUD_RENDER = 0x0100,
69 USE_FACE_COLOR = 0x0200,
70
71 POINT_SPRITE = 0x10000,
72 BOARD_SPRITE = 0x20000,
73 FIXED_SPRITE = 0x40000,
74 DEPTH_SPRITE = 0x80000
75 };
76
77 enum EDirty
78 {
79 DIRTY = -2
80 }; 67 };
81 68
82 static void initClass(); 69 static void initClass();
@@ -93,54 +80,64 @@ public:
93 const S32 getGeomIndex() const { return mGeomIndex; } // index into draw pool 80 const S32 getGeomIndex() const { return mGeomIndex; } // index into draw pool
94 const U32 getGeomStart() const { return mGeomIndex; } // index into draw pool 81 const U32 getGeomStart() const { return mGeomIndex; } // index into draw pool
95 LLViewerImage* getTexture() const { return mTexture; } 82 LLViewerImage* getTexture() const { return mTexture; }
83 void setTexture(LLViewerImage* tex) { mTexture = tex; }
96 LLXformMatrix* getXform() const { return mXform; } 84 LLXformMatrix* getXform() const { return mXform; }
97 BOOL hasGeometry() const { return mGeomCount > 0; } 85 BOOL hasGeometry() const { return mGeomCount > 0; }
98 LLVector3 getPositionAgent() const; 86 LLVector3 getPositionAgent() const;
99 void setPrimType(U32 primType) { mPrimType = primType; } 87
100 const U32 getPrimType() const { return mPrimType; }
101
102 U32 getState() const { return mState; } 88 U32 getState() const { return mState; }
103 void setState(U32 state) { mState |= state; } 89 void setState(U32 state) { mState |= state; }
104 void clearState(U32 state) { mState &= ~state; } 90 void clearState(U32 state) { mState &= ~state; }
105 BOOL isState(U32 state) const { return ((mState & state) != 0); } 91 BOOL isState(U32 state) const { return ((mState & state) != 0) ? TRUE : FALSE; }
106 92 void setVirtualSize(F32 size) { mVSize = size; }
93 void setPixelArea(F32 area) { mPixelArea = area; }
94 F32 getVirtualSize() const { return mVSize; }
95 F32 getPixelArea() const { return mPixelArea; }
107 void bindTexture(S32 stage = 0) const { LLViewerImage::bindTexture(mTexture, stage); } 96 void bindTexture(S32 stage = 0) const { LLViewerImage::bindTexture(mTexture, stage); }
108 97
109 void enableLights() const; 98 void enableLights() const;
110 void renderSetColor() const; 99 void renderSetColor() const;
111 S32 renderElements(const U32 *index_array) const; 100 S32 renderElements(const U32 *index_array) const;
112 S32 renderIndexed (const U32 *index_array) const; 101 S32 renderIndexed ();
102 S32 renderIndexed (U32 mask);
113 S32 pushVertices(const U32* index_array) const; 103 S32 pushVertices(const U32* index_array) const;
114 104
115 void setWorldMatrix(const LLMatrix4& mat); 105 void setWorldMatrix(const LLMatrix4& mat);
116 const LLTextureEntry* getTextureEntry() const { return mVObjp->getTE(mTEOffset); } 106 const LLTextureEntry* getTextureEntry() const { return mVObjp->getTE(mTEOffset); }
117 107
118 LLDrawPool* getPool() const { return mDrawPoolp; } 108 LLFacePool* getPool() const { return mDrawPoolp; }
119 S32 getStride() const { return mDrawPoolp->getStride(); } 109 U32 getPoolType() const { return mPoolType; }
120 const U32* getRawIndices() const { return &mDrawPoolp->mIndices[mIndicesIndex]; }
121 LLDrawable* getDrawable() const { return mDrawablep; } 110 LLDrawable* getDrawable() const { return mDrawablep; }
122 LLViewerObject* getViewerObject() const { return mVObjp; } 111 LLViewerObject* getViewerObject() const { return mVObjp; }
123 112 S32 getLOD() const { return mVObjp.notNull() ? mVObjp->getLOD() : 0; }
124 void clearDirty() { mGeneration = mDrawPoolp->mGeneration; }; 113 LLVertexBuffer* getVertexBuffer() const { return mVertexBuffer; }
125 114 void setPoolType(U32 type) { mPoolType = type; }
126 S32 backup(); 115 S32 getTEOffset() { return mTEOffset; }
127 void restore();
128 116
129 void setViewerObject(LLViewerObject* object); 117 void setViewerObject(LLViewerObject* object);
130 void setPool(LLDrawPool *pool, LLViewerImage *texturep); 118 void setPool(LLFacePool *pool, LLViewerImage *texturep);
119
131 void setDrawable(LLDrawable *drawable); 120 void setDrawable(LLDrawable *drawable);
132 void setTEOffset(const S32 te_offset); 121 void setTEOffset(const S32 te_offset);
133 S32 getTEOffset() { return mTEOffset; } 122
134 123
135 void setFaceColor(const LLColor4& color); // override material color 124 void setFaceColor(const LLColor4& color); // override material color
136 void unsetFaceColor(); // switch back to material color 125 void unsetFaceColor(); // switch back to material color
137 const LLColor4& getFaceColor() const { return mFaceColor; } 126 const LLColor4& getFaceColor() const { return mFaceColor; }
138 const LLColor4& getRenderColor() const; 127 const LLColor4& getRenderColor() const;
139 128
140 void unReserve(); // Set Removed from pool 129 //for volumes
141 130 S32 getGeometryVolume(const LLVolume& volume,
142 BOOL reserveIfNeeded(); // Reserves data if dirty. 131 S32 f,
143 132 LLStrider<LLVector3>& vertices,
133 LLStrider<LLVector3>& normals,
134 LLStrider<LLVector2>& texcoords,
135 LLStrider<LLVector2>& texcoords2,
136 LLStrider<LLColor4U>& colors,
137 LLStrider<U32>& indices,
138 const LLMatrix4& mat_vert, const LLMatrix3& mat_normal,
139 U32& index_offset);
140
144 // For avatar 141 // For avatar
145 S32 getGeometryAvatar( 142 S32 getGeometryAvatar(
146 LLStrider<LLVector3> &vertices, 143 LLStrider<LLVector3> &vertices,
@@ -156,69 +153,51 @@ public:
156 LLStrider<LLColor4U> &colors, 153 LLStrider<LLColor4U> &colors,
157 LLStrider<LLVector2> &texCoords0, 154 LLStrider<LLVector2> &texCoords0,
158 LLStrider<LLVector2> &texCoords1, 155 LLStrider<LLVector2> &texCoords1,
159 U32* &indices); 156 LLStrider<U32> &indices);
160 157
161 // For volumes, etc. 158 // For volumes, etc.
162 S32 getGeometry(LLStrider<LLVector3> &vertices, 159 S32 getGeometry(LLStrider<LLVector3> &vertices,
163 LLStrider<LLVector3> &normals, 160 LLStrider<LLVector3> &normals,
164 LLStrider<LLVector2> &texCoords, 161 LLStrider<LLVector2> &texCoords,
165 U32* &indices); 162 LLStrider<U32> &indices);
166 163
167 S32 getGeometryColors(LLStrider<LLVector3> &vertices, 164 S32 getGeometryColors(LLStrider<LLVector3> &vertices,
168 LLStrider<LLVector3> &normals, 165 LLStrider<LLVector3> &normals,
169 LLStrider<LLVector2> &texCoords, 166 LLStrider<LLVector2> &texCoords,
170 LLStrider<LLColor4U> &colors, 167 LLStrider<LLColor4U> &colors,
171 U32* &indices); 168 LLStrider<U32> &indices);
172 169
173 S32 getGeometryMultiTexture(LLStrider<LLVector3> &vertices, 170 S32 getVertices(LLStrider<LLVector3> &vertices);
174 LLStrider<LLVector3> &normals, 171 S32 getColors(LLStrider<LLColor4U> &colors);
175 LLStrider<LLVector3> &binormals, 172 S32 getIndices(LLStrider<U32> &indices);
176 LLStrider<LLVector2> &texCoords0,
177 LLStrider<LLVector2> &texCoords1,
178 U32* &indices);
179
180
181 S32 getVertices (LLStrider<LLVector3> &vertices);
182 S32 getColors (LLStrider<LLColor4U> &colors);
183 S32 getIndices (U32* &indices);
184 173
185 void setSize(const S32 numVertices, const S32 num_indices = 0); 174 void setSize(const S32 numVertices, const S32 num_indices = 0);
186 BOOL getDirty() const { return (mGeneration != mDrawPoolp->mGeneration); } 175
187 176 BOOL genVolumeBBoxes(const LLVolume &volume, S32 f,
188 BOOL genVolumeTriangles(const LLVolume &volume, S32 f,
189 const LLMatrix4& mat, const LLMatrix3& inv_trans_mat, BOOL global_volume = FALSE);
190 BOOL genVolumeTriangles(const LLVolume &volume, S32 fstart, S32 fend,
191 const LLMatrix4& mat, const LLMatrix3& inv_trans_mat, BOOL global_volume = FALSE); 177 const LLMatrix4& mat, const LLMatrix3& inv_trans_mat, BOOL global_volume = FALSE);
192 BOOL genLighting(const LLVolume* volume, const LLDrawable* drawablep, S32 fstart, S32 fend, 178
193 const LLMatrix4& mat_vert, const LLMatrix3& mat_normal, BOOL do_lighting);
194
195 BOOL genShadows(const LLVolume* volume, const LLDrawable* drawablep, S32 fstart, S32 fend,
196 const LLMatrix4& mat_vert, const LLMatrix3& mat_normal, BOOL use_shadow_factor);
197
198 void init(LLDrawable* drawablep, LLViewerObject* objp); 179 void init(LLDrawable* drawablep, LLViewerObject* objp);
199 void destroy(); 180 void destroy();
200 void update(); 181 void update();
201 182
202 void updateCenterAgent(); // Update center when xform has changed. 183 void updateCenterAgent(); // Update center when xform has changed.
203 void renderSelectedUV(const S32 offset = 0, const S32 count = 0); 184 void renderSelectedUV(const S32 offset = 0, const S32 count = 0);
204 185
205 void renderForSelect() const; 186 void renderForSelect(U32 data_mask = LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_TEXCOORD);
206 void renderSelected(LLImageGL *image, const LLColor4 &color, const S32 offset = 0, const S32 count = 0); 187 void renderSelected(LLImageGL *image, const LLColor4 &color, const S32 offset = 0, const S32 count = 0);
207 188
208 F32 getKey() const { return mDistance; } 189 F32 getKey() const { return mDistance; }
209 190
210 S32 getGeneration() const { return mGeneration; }
211 S32 getReferenceIndex() const { return mReferenceIndex; } 191 S32 getReferenceIndex() const { return mReferenceIndex; }
212 void setReferenceIndex(const S32 index) { mReferenceIndex = index; } 192 void setReferenceIndex(const S32 index) { mReferenceIndex = index; }
213 193
214 BOOL verify(const U32* indices_array = NULL) const; 194 BOOL verify(const U32* indices_array = NULL) const;
215 void printDebugInfo() const; 195 void printDebugInfo() const;
216 196
217 void link(LLFace* facep); 197 void setGeomIndex(S32 idx) { mGeomIndex = idx; }
198 void setIndicesIndex(S32 idx) { mIndicesIndex = idx; }
218 199
219protected: 200protected:
220 S32 allocBackupMem(); // Allocate backup memory based on the draw pool information.
221 void setDirty();
222 201
223public: 202public:
224 LLVector3 mCenterLocal; 203 LLVector3 mCenterLocal;
@@ -227,30 +206,40 @@ public:
227 LLVector2 mTexExtents[2]; 206 LLVector2 mTexExtents[2];
228 F32 mDistance; 207 F32 mDistance;
229 F32 mAlphaFade; 208 F32 mAlphaFade;
230 LLFace* mNextFace; 209 LLPointer<LLVertexBuffer> mVertexBuffer;
231 BOOL mSkipRender; 210 LLPointer<LLVertexBuffer> mLastVertexBuffer;
232 211 F32 mLastUpdateTime;
212 LLMatrix4 mTextureMatrix;
213
233protected: 214protected:
234 S32 mGeneration; 215 friend class LLGeometryManager;
216 friend class LLVolumeGeometryManager;
217
235 U32 mState; 218 U32 mState;
236 LLDrawPool* mDrawPoolp; 219 LLFacePool* mDrawPoolp;
237 S32 mGeomIndex; // index into draw pool 220 U32 mPoolType;
238 LLColor4 mFaceColor; // overrides material color if state |= USE_FACE_COLOR 221 LLColor4 mFaceColor; // overrides material color if state |= USE_FACE_COLOR
239 222
240 U32 mPrimType;
241 S32 mGeomCount; // vertex count for this face 223 S32 mGeomCount; // vertex count for this face
224 S32 mGeomIndex; // index into draw pool
242 U32 mIndicesCount; 225 U32 mIndicesCount;
243 S32 mIndicesIndex; // index into draw pool for indices (yeah, I know!) 226 S32 mIndicesIndex; // index into draw pool for indices (yeah, I know!)
244 LLXformMatrix* mXform;
245 LLPointer<LLViewerImage> mTexture;
246 227
247 U8 *mBackupMem; 228 //previous rebuild's geometry info
229 S32 mLastGeomCount;
230 S32 mLastGeomIndex;
231 U32 mLastIndicesCount;
232 S32 mLastIndicesIndex;
248 233
234 LLXformMatrix* mXform;
235 LLPointer<LLViewerImage> mTexture;
249 LLPointer<LLDrawable> mDrawablep; 236 LLPointer<LLDrawable> mDrawablep;
250 LLPointer<LLViewerObject> mVObjp; 237 LLPointer<LLViewerObject> mVObjp;
251 S32 mTEOffset; 238 S32 mTEOffset;
252 239
253 S32 mReferenceIndex; 240 S32 mReferenceIndex;
241 F32 mVSize;
242 F32 mPixelArea;
254 243
255protected: 244protected:
256 static BOOL sSafeRenderSelect; 245 static BOOL sSafeRenderSelect;
@@ -264,6 +253,43 @@ public:
264 } 253 }
265 }; 254 };
266 255
256 struct CompareTexture
257 {
258 bool operator()(const LLFace* const& lhs, const LLFace* const& rhs)
259 {
260 return lhs->getTexture() < rhs->getTexture();
261 }
262 };
263
264 struct CompareTextureAndGeomCount
265 {
266 bool operator()(const LLFace* const& lhs, const LLFace* const& rhs)
267 {
268 return lhs->getTexture() == rhs->getTexture() ?
269 lhs->getGeomCount() < rhs->getGeomCount() :
270 lhs->getTexture() > rhs->getTexture();
271 }
272 };
273
274 struct CompareTextureAndLOD
275 {
276 bool operator()(const LLFace* const& lhs, const LLFace* const& rhs)
277 {
278 return lhs->getTexture() == rhs->getTexture() ?
279 lhs->getLOD() < rhs->getLOD() :
280 lhs->getTexture() < rhs->getTexture();
281 }
282 };
283
284 struct CompareTextureAndTime
285 {
286 bool operator()(const LLFace* const& lhs, const LLFace* const& rhs)
287 {
288 return lhs->getTexture() == rhs->getTexture() ?
289 lhs->mLastUpdateTime < rhs->mLastUpdateTime :
290 lhs->getTexture() < rhs->getTexture();
291 }
292 };
267}; 293};
268 294
269#endif // LL_LLFACE_H 295#endif // LL_LLFACE_H
diff --git a/linden/indra/newview/llfasttimerview.cpp b/linden/indra/newview/llfasttimerview.cpp
index e147e3f..5038ed9 100644
--- a/linden/indra/newview/llfasttimerview.cpp
+++ b/linden/indra/newview/llfasttimerview.cpp
@@ -86,31 +86,41 @@ static struct ft_display_info ft_display_table[] =
86 { LLFastTimer::FTM_RESET_DRAWORDER, " ResetDrawOrder", &LLColor4::pink1, 0 }, 86 { LLFastTimer::FTM_RESET_DRAWORDER, " ResetDrawOrder", &LLColor4::pink1, 0 },
87 { LLFastTimer::FTM_WORLD_UPDATE, " World Update", &LLColor4::blue1, 1 }, 87 { LLFastTimer::FTM_WORLD_UPDATE, " World Update", &LLColor4::blue1, 1 },
88 { LLFastTimer::FTM_UPDATE_MOVE, " Move Objects", &LLColor4::pink2, 0 }, 88 { LLFastTimer::FTM_UPDATE_MOVE, " Move Objects", &LLColor4::pink2, 0 },
89 { LLFastTimer::FTM_OCTREE_BALANCE, " Octree Balance", &LLColor4::red3, 0 }, 89 { LLFastTimer::FTM_OCTREE_BALANCE, " Octree Balance", &LLColor4::red3, 0 },
90 { LLFastTimer::FTM_CULL, " Object Cull", &LLColor4::blue2, 0 }, 90// { LLFastTimer::FTM_TEMP1, " Blur", &LLColor4::red1, 0 },
91 { LLFastTimer::FTM_CULL_REBOUND, " Rebound", &LLColor4::blue3, 0 }, 91 { LLFastTimer::FTM_CULL, " Object Cull", &LLColor4::blue2, 1 },
92 { LLFastTimer::FTM_CULL_REBOUND, " Rebound", &LLColor4::blue3, 0 },
93 { LLFastTimer::FTM_FRUSTUM_CULL, " Frustum Cull", &LLColor4::blue4, 0 },
94 { LLFastTimer::FTM_OCCLUSION, " Object Occlude", &LLColor4::pink1, 0 },
95 { LLFastTimer::FTM_OCCLUSION_READBACK, " Occlusion Read", &LLColor4::red2, 0 },
92 { LLFastTimer::FTM_HUD_EFFECTS, " HUD Effects", &LLColor4::orange1, 0 }, 96 { LLFastTimer::FTM_HUD_EFFECTS, " HUD Effects", &LLColor4::orange1, 0 },
93 { LLFastTimer::FTM_HUD_UPDATE, " HUD Update", &LLColor4::orange2, 0 }, 97 { LLFastTimer::FTM_HUD_UPDATE, " HUD Update", &LLColor4::orange2, 0 },
94 { LLFastTimer::FTM_OCCLUSION, " Object Occlude",&LLColor4::pink1, 0 },
95 { LLFastTimer::FTM_OCCLUSION_READBACK, " Occlusion Read",&LLColor4::red2, 0 },
96 { LLFastTimer::FTM_GEO_UPDATE, " Geo Update", &LLColor4::blue3, 0 }, 98 { LLFastTimer::FTM_GEO_UPDATE, " Geo Update", &LLColor4::blue3, 0 },
97 { LLFastTimer::FTM_UPDATE_PRIMITIVES, " Volumes", &LLColor4::blue4, 0 }, 99 { LLFastTimer::FTM_UPDATE_PRIMITIVES, " Volumes", &LLColor4::blue4, 0 },
98 { LLFastTimer::FTM_GEN_VOLUME, " Gen Volume", &LLColor4::yellow3, 0 }, 100 { LLFastTimer::FTM_GEN_VOLUME, " Gen Volume", &LLColor4::yellow3, 0 },
99 { LLFastTimer::FTM_GEN_FLEX, " Flexible", &LLColor4::yellow4, 0 }, 101 { LLFastTimer::FTM_GEN_FLEX, " Flexible", &LLColor4::yellow4, 0 },
100 { LLFastTimer::FTM_GEN_TRIANGLES, " Triangles", &LLColor4::yellow5, 0 }, 102 { LLFastTimer::FTM_GEN_TRIANGLES, " Triangles", &LLColor4::yellow5, 0 },
103 { LLFastTimer::FTM_UPDATE_AVATAR, " Avatar", &LLColor4::yellow1, 0 },
104 { LLFastTimer::FTM_UPDATE_TREE, " Tree", &LLColor4::yellow2, 0 },
105 { LLFastTimer::FTM_UPDATE_TERRAIN, " Terrain", &LLColor4::yellow6, 0 },
106 { LLFastTimer::FTM_UPDATE_CLOUDS, " Clouds", &LLColor4::yellow7, 0 },
107 { LLFastTimer::FTM_UPDATE_GRASS, " Grass", &LLColor4::yellow8, 0 },
108 { LLFastTimer::FTM_UPDATE_WATER, " Water", &LLColor4::yellow9, 0 },
101 { LLFastTimer::FTM_GEO_LIGHT, " Lighting", &LLColor4::yellow1, 0 }, 109 { LLFastTimer::FTM_GEO_LIGHT, " Lighting", &LLColor4::yellow1, 0 },
102 { LLFastTimer::FTM_GEO_SHADOW, " Shadow", &LLColor4::black, 0 }, 110 { LLFastTimer::FTM_GEO_SHADOW, " Shadow", &LLColor4::black, 0 },
103 { LLFastTimer::FTM_UPDATE_PARTICLES, " Particles", &LLColor4::blue5, 0 }, 111 { LLFastTimer::FTM_UPDATE_PARTICLES, " Particles", &LLColor4::blue5, 0 },
112 { LLFastTimer::FTM_SIMULATE_PARTICLES, " Particle Sim", &LLColor4::blue4, 0 },
104 { LLFastTimer::FTM_GEO_RESERVE, " Reserve", &LLColor4::blue6, 0 }, 113 { LLFastTimer::FTM_GEO_RESERVE, " Reserve", &LLColor4::blue6, 0 },
105 { LLFastTimer::FTM_UPDATE_LIGHTS, " Lights", &LLColor4::yellow2, 0 }, 114 { LLFastTimer::FTM_UPDATE_LIGHTS, " Lights", &LLColor4::yellow2, 0 },
106 { LLFastTimer::FTM_UPDATE_SKY, " Sky Update", &LLColor4::cyan1, 0 }, 115 { LLFastTimer::FTM_UPDATE_SKY, " Sky Update", &LLColor4::cyan1, 0 },
107 { LLFastTimer::FTM_OBJECTLIST_UPDATE, " Object Update", &LLColor4::purple1, 1 }, 116 { LLFastTimer::FTM_OBJECTLIST_UPDATE, " Object Update", &LLColor4::purple1, 0 },
108 { LLFastTimer::FTM_AVATAR_UPDATE, " Avatars", &LLColor4::purple2, 0 }, 117 { LLFastTimer::FTM_AVATAR_UPDATE, " Avatars", &LLColor4::purple2, 0 },
109 { LLFastTimer::FTM_JOINT_UPDATE, " Joints", &LLColor4::purple3, 0 }, 118 { LLFastTimer::FTM_JOINT_UPDATE, " Joints", &LLColor4::purple3, 0 },
110 { LLFastTimer::FTM_ATTACHMENT_UPDATE, " Attachments", &LLColor4::purple4, 0 }, 119 { LLFastTimer::FTM_ATTACHMENT_UPDATE, " Attachments", &LLColor4::purple4, 0 },
111 { LLFastTimer::FTM_UPDATE_ANIMATION, " Animation", &LLColor4::purple5, 0 }, 120 { LLFastTimer::FTM_UPDATE_ANIMATION, " Animation", &LLColor4::purple5, 0 },
112 { LLFastTimer::FTM_FLEXIBLE_UPDATE, " Flex Update", &LLColor4::pink2, 0 }, 121 { LLFastTimer::FTM_FLEXIBLE_UPDATE, " Flex Update", &LLColor4::pink2, 0 },
113 { LLFastTimer::FTM_LOD_UPDATE, " LOD Update", &LLColor4::magenta1, 0 }, 122 { LLFastTimer::FTM_LOD_UPDATE, " LOD Update", &LLColor4::magenta1, 0 },
123// { LLFastTimer::FTM_TEMP5, " Check", &LLColor4::red1, 1},
114 { LLFastTimer::FTM_REGION_UPDATE, " Region Update", &LLColor4::cyan2, 0 }, 124 { LLFastTimer::FTM_REGION_UPDATE, " Region Update", &LLColor4::cyan2, 0 },
115 { LLFastTimer::FTM_NETWORK, " Network", &LLColor4::orange1, 1 }, 125 { LLFastTimer::FTM_NETWORK, " Network", &LLColor4::orange1, 1 },
116 { LLFastTimer::FTM_IDLE_NETWORK, " Decode Msgs", &LLColor4::orange2, 0 }, 126 { LLFastTimer::FTM_IDLE_NETWORK, " Decode Msgs", &LLColor4::orange2, 0 },
@@ -125,17 +135,36 @@ static struct ft_display_info ft_display_table[] =
125 { LLFastTimer::FTM_IMAGE_UPDATE, " Image Update", &LLColor4::yellow4, 1 }, 135 { LLFastTimer::FTM_IMAGE_UPDATE, " Image Update", &LLColor4::yellow4, 1 },
126 { LLFastTimer::FTM_IMAGE_CREATE, " Image CreateGL",&LLColor4::yellow5, 0 }, 136 { LLFastTimer::FTM_IMAGE_CREATE, " Image CreateGL",&LLColor4::yellow5, 0 },
127 { LLFastTimer::FTM_IMAGE_DECODE, " Image Decode", &LLColor4::yellow6, 0 }, 137 { LLFastTimer::FTM_IMAGE_DECODE, " Image Decode", &LLColor4::yellow6, 0 },
138 { LLFastTimer::FTM_IMAGE_MARK_DIRTY, " Dirty Textures",&LLColor4::red1, 0 },
128 { LLFastTimer::FTM_VFILE_WAIT, " VFile Wait", &LLColor4::cyan6, 0 }, 139 { LLFastTimer::FTM_VFILE_WAIT, " VFile Wait", &LLColor4::cyan6, 0 },
129// { LLFastTimer::FTM_IDLE_CB, " Callbacks", &LLColor4::pink1, 0 }, 140// { LLFastTimer::FTM_IDLE_CB, " Callbacks", &LLColor4::pink1, 0 },
130 { LLFastTimer::FTM_RENDER, " Render", &green0, 0 }, 141 { LLFastTimer::FTM_RENDER, " Render", &green0, 1 },
131 { LLFastTimer::FTM_REBUILD, " Rebuild", &LLColor4::green1, 1 }, 142 { LLFastTimer::FTM_REBUILD, " Rebuild", &LLColor4::green1, 1 },
132 { LLFastTimer::FTM_STATESORT, " State Sort", &LLColor4::orange1, 1 }, 143 { LLFastTimer::FTM_STATESORT, " State Sort", &LLColor4::orange1, 1 },
144 { LLFastTimer::FTM_STATESORT_DRAWABLE, " Drawable", &LLColor4::orange2, 0 },
145 { LLFastTimer::FTM_STATESORT_POSTSORT, " Post Sort", &LLColor4::orange3, 0 },
146 { LLFastTimer::FTM_REBUILD_OCCLUSION_VB," Occlusion", &LLColor4::cyan5, 0 },
147 { LLFastTimer::FTM_REBUILD_VBO, " VBO Rebuild", &LLColor4::red4, 0 },
148 { LLFastTimer::FTM_REBUILD_VOLUME_VB, " Volume", &LLColor4::blue1, 0 },
149 { LLFastTimer::FTM_REBUILD_NONE_VB, " Unknown", &LLColor4::cyan5, 0 },
150 { LLFastTimer::FTM_REBUILD_BRIDGE_VB, " Bridge", &LLColor4::blue2, 0 },
151 { LLFastTimer::FTM_REBUILD_HUD_VB, " HUD", &LLColor4::blue3, 0 },
152 { LLFastTimer::FTM_REBUILD_TERRAIN_VB, " Terrain", &LLColor4::blue4, 0 },
153 { LLFastTimer::FTM_REBUILD_WATER_VB, " Water", &LLColor4::blue5, 0 },
154 { LLFastTimer::FTM_REBUILD_TREE_VB, " Tree", &LLColor4::cyan1, 0 },
155 { LLFastTimer::FTM_REBUILD_PARTICLE_VB, " Particle", &LLColor4::cyan2, 0 },
156 { LLFastTimer::FTM_REBUILD_CLOUD_VB, " Cloud", &LLColor4::cyan3, 0 },
157 { LLFastTimer::FTM_REBUILD_GRASS_VB, " Grass", &LLColor4::cyan4, 0 },
133 { LLFastTimer::FTM_RENDER_GEOMETRY, " Geometry", &LLColor4::green2, 1 }, 158 { LLFastTimer::FTM_RENDER_GEOMETRY, " Geometry", &LLColor4::green2, 1 },
134 { LLFastTimer::FTM_POOLS, " Pools", &LLColor4::green3, 0 }, 159 { LLFastTimer::FTM_POOLS, " Pools", &LLColor4::green3, 1 },
135 { LLFastTimer::FTM_POOLRENDER, " RenderPool", &LLColor4::green4, 0 }, 160 { LLFastTimer::FTM_POOLRENDER, " RenderPool", &LLColor4::green4, 1 },
136 { LLFastTimer::FTM_RENDER_TERRAIN, " Terrain", &LLColor4::green6, 0 }, 161 { LLFastTimer::FTM_RENDER_TERRAIN, " Terrain", &LLColor4::green6, 0 },
137 { LLFastTimer::FTM_RENDER_CHARACTERS, " Avatars", &LLColor4::yellow1, 0 }, 162 { LLFastTimer::FTM_RENDER_CHARACTERS, " Avatars", &LLColor4::yellow1, 0 },
138 { LLFastTimer::FTM_RENDER_SIMPLE, " Simple", &LLColor4::yellow2, 0 }, 163 { LLFastTimer::FTM_RENDER_SIMPLE, " Simple", &LLColor4::yellow2, 0 },
164 { LLFastTimer::FTM_RENDER_FULLBRIGHT, " Fullbright", &LLColor4::yellow5, 0 },
165 { LLFastTimer::FTM_RENDER_GLOW, " Glow", &LLColor4::orange1, 0 },
166 { LLFastTimer::FTM_RENDER_GRASS, " Grass", &LLColor4::yellow6, 0 },
167 { LLFastTimer::FTM_RENDER_INVISIBLE, " Invisible", &LLColor4::red2, 0 },
139 { LLFastTimer::FTM_RENDER_SHINY, " Shiny", &LLColor4::yellow3, 0 }, 168 { LLFastTimer::FTM_RENDER_SHINY, " Shiny", &LLColor4::yellow3, 0 },
140 { LLFastTimer::FTM_RENDER_BUMP, " Bump", &LLColor4::yellow4, 0 }, 169 { LLFastTimer::FTM_RENDER_BUMP, " Bump", &LLColor4::yellow4, 0 },
141 { LLFastTimer::FTM_RENDER_TREES, " Trees", &LLColor4::yellow8, 0 }, 170 { LLFastTimer::FTM_RENDER_TREES, " Trees", &LLColor4::yellow8, 0 },
@@ -149,15 +178,16 @@ static struct ft_display_info ft_display_table[] =
149// { LLFastTimer::FTM_RENDER_FONTS, " Fonts", &LLColor4::pink1, 0 }, 178// { LLFastTimer::FTM_RENDER_FONTS, " Fonts", &LLColor4::pink1, 0 },
150// { LLFastTimer::FTM_UPDATE_TEXTURES, " Textures", &LLColor4::pink2, 0 }, 179// { LLFastTimer::FTM_UPDATE_TEXTURES, " Textures", &LLColor4::pink2, 0 },
151 { LLFastTimer::FTM_SWAP, " Swap", &LLColor4::pink1, 0 }, 180 { LLFastTimer::FTM_SWAP, " Swap", &LLColor4::pink1, 0 },
181 { LLFastTimer::FTM_CLIENT_COPY, " Client Copy", &LLColor4::red1, 1},
152 182
153// { LLFastTimer::FTM_TEMP1, " Temp1", &LLColor4::red1, 0 }, 183// { LLFastTimer::FTM_TEMP1, " Temp1", &LLColor4::red1, 0 },
154// { LLFastTimer::FTM_TEMP2, " Temp2", &LLColor4::magenta1, 0 }, 184// { LLFastTimer::FTM_TEMP2, " Temp2", &LLColor4::magenta1, 0 },
155// { LLFastTimer::FTM_TEMP3, " Temp3", &LLColor4::red2, 0 }, 185// { LLFastTimer::FTM_TEMP3, " Temp3", &LLColor4::red2, 0 },
156// { LLFastTimer::FTM_TEMP4, " Temp4", &LLColor4::magenta2, 0 }, 186// { LLFastTimer::FTM_TEMP4, " Temp4", &LLColor4::magenta2, 0 },
157// { LLFastTimer::FTM_TEMP5, " Temp5", &LLColor4::red3, 0 }, 187// { LLFastTimer::FTM_TEMP5, " Temp5", &LLColor4::red3, 0 },
158// { LLFastTimer::FTM_TEMP6, " Temp6", &LLColor4::magenta3, 0 }, 188// { LLFastTimer::FTM_TEMP6, " Temp6", &LLColor4::magenta3, 0 },
159// { LLFastTimer::FTM_TEMP7, " Temp7", &LLColor4::red4, 0 }, 189// { LLFastTimer::FTM_TEMP7, " Temp7", &LLColor4::red4, 0 },
160// { LLFastTimer::FTM_TEMP8, " Temp8", &LLColor4::magenta4, 0 }, 190// { LLFastTimer::FTM_TEMP8, " Temp8", &LLColor4::magenta4, 0 },
161 191
162 { LLFastTimer::FTM_OTHER, " Other", &red0 } 192 { LLFastTimer::FTM_OTHER, " Other", &red0 }
163}; 193};
@@ -167,7 +197,7 @@ static const int FTV_DISPLAY_NUM = (sizeof(ft_display_table)/sizeof(ft_display_
167S32 ft_display_idx[FTV_DISPLAY_NUM]; // line of table entry for display purposes (for collapse) 197S32 ft_display_idx[FTV_DISPLAY_NUM]; // line of table entry for display purposes (for collapse)
168 198
169LLFastTimerView::LLFastTimerView(const std::string& name, const LLRect& rect) 199LLFastTimerView::LLFastTimerView(const std::string& name, const LLRect& rect)
170: LLView(name, rect, TRUE) 200 : LLFloater(name, rect, "Fast Timers")
171{ 201{
172 setVisible(FALSE); 202 setVisible(FALSE);
173 mDisplayMode = 0; 203 mDisplayMode = 0;
@@ -910,7 +940,10 @@ void LLFastTimerView::draw()
910 F32 ms = (F32)((F64)max_ticks * iclock_freq); 940 F32 ms = (F32)((F64)max_ticks * iclock_freq);
911 941
912 //display y-axis range 942 //display y-axis range
913 LLString tdesc = llformat("%4.2f ms", ms); 943 LLString tdesc = mDisplayCalls ?
944 llformat("%d calls", max_ticks) :
945 llformat("%4.2f ms", ms);
946
914 x = graph_rect.mRight - LLFontGL::sMonospace->getWidth(tdesc)-5; 947 x = graph_rect.mRight - LLFontGL::sMonospace->getWidth(tdesc)-5;
915 y = graph_rect.mTop - ((S32)LLFontGL::sMonospace->getLineHeight()); 948 y = graph_rect.mTop - ((S32)LLFontGL::sMonospace->getLineHeight());
916 949
@@ -976,6 +1009,13 @@ void LLFastTimerView::draw()
976 for (U32 j = 0; j < LLFastTimer::FTM_HISTORY_NUM; j++) 1009 for (U32 j = 0; j < LLFastTimer::FTM_HISTORY_NUM; j++)
977 { 1010 {
978 U64 ticks = ticks_sum[j+1][idx]; 1011 U64 ticks = ticks_sum[j+1][idx];
1012 if (mDisplayCalls)
1013 {
1014 S32 tidx = ft_display_table[idx].timer;
1015 S32 hidx = (LLFastTimer::sLastFrameIndex + j) % LLFastTimer::FTM_HISTORY_NUM;
1016 ticks = (S32)LLFastTimer::sCallHistory[hidx][tidx];
1017 }
1018
979 if (alpha == 1.f) 1019 if (alpha == 1.f)
980 { //normalize to highlighted timer 1020 { //normalize to highlighted timer
981 cur_max = llmax(cur_max, ticks); 1021 cur_max = llmax(cur_max, ticks);
diff --git a/linden/indra/newview/llfasttimerview.h b/linden/indra/newview/llfasttimerview.h
index b20c8eb..11a8887 100644
--- a/linden/indra/newview/llfasttimerview.h
+++ b/linden/indra/newview/llfasttimerview.h
@@ -28,10 +28,10 @@
28#ifndef LL_LLFASTTIMERVIEW_H 28#ifndef LL_LLFASTTIMERVIEW_H
29#define LL_LLFASTTIMERVIEW_H 29#define LL_LLFASTTIMERVIEW_H
30 30
31#include "llview.h" 31#include "llfloater.h"
32#include "llframetimer.h" 32#include "llframetimer.h"
33 33
34class LLFastTimerView : public LLView 34class LLFastTimerView : public LLFloater
35{ 35{
36public: 36public:
37 LLFastTimerView(const std::string& name, const LLRect& rect); 37 LLFastTimerView(const std::string& name, const LLRect& rect);
diff --git a/linden/indra/newview/llfeaturemanager.cpp b/linden/indra/newview/llfeaturemanager.cpp
index 061b343..c0fd96b 100644
--- a/linden/indra/newview/llfeaturemanager.cpp
+++ b/linden/indra/newview/llfeaturemanager.cpp
@@ -156,7 +156,7 @@ BOOL LLFeatureList::maskList(LLFeatureList &mask)
156 } 156 }
157 157
158#if 0 && !LL_RELEASE_FOR_DOWNLOAD 158#if 0 && !LL_RELEASE_FOR_DOWNLOAD
159 llinfos << "After appling mask " << mask.mName << llendl; 159 llinfos << "After applying mask " << mask.mName << llendl;
160 dump(); 160 dump();
161#endif 161#endif
162 return TRUE; 162 return TRUE;
@@ -208,12 +208,12 @@ BOOL LLFeatureManager::loadFeatureTables()
208 data_path += FEATURE_TABLE_FILENAME; 208 data_path += FEATURE_TABLE_FILENAME;
209 209
210 210
211 char name[MAX_STRING+1]; 211 char name[MAX_STRING+1]; /*Flawfinder: ignore*/
212 212
213 llifstream file; 213 llifstream file;
214 U32 version; 214 U32 version;
215 215
216 file.open(data_path.c_str()); 216 file.open(data_path.c_str()); /*Flawfinder: ignore*/
217 217
218 if (!file) 218 if (!file)
219 { 219 {
@@ -235,12 +235,12 @@ BOOL LLFeatureManager::loadFeatureTables()
235 LLFeatureList *flp = NULL; 235 LLFeatureList *flp = NULL;
236 while (!file.eof()) 236 while (!file.eof())
237 { 237 {
238 char buffer[MAX_STRING]; 238 char buffer[MAX_STRING]; /*Flawfinder: ignore*/
239 name[0] = 0; 239 name[0] = 0;
240 240
241 file >> name; 241 file >> name;
242 242
243 if (strlen(name) >= 2 && 243 if (strlen(name) >= 2 && /*Flawfinder: ignore*/
244 name[0] == '/' && 244 name[0] == '/' &&
245 name[1] == '/') 245 name[1] == '/')
246 { 246 {
@@ -249,7 +249,7 @@ BOOL LLFeatureManager::loadFeatureTables()
249 continue; 249 continue;
250 } 250 }
251 251
252 if (strlen(name) == 0) 252 if (strlen(name) == 0) /*Flawfinder: ignore*/
253 { 253 {
254 // This is a blank line 254 // This is a blank line
255 file.getline(buffer, MAX_STRING); 255 file.getline(buffer, MAX_STRING);
@@ -295,7 +295,6 @@ BOOL LLFeatureManager::loadFeatureTables()
295 } 295 }
296 } 296 }
297 file.close(); 297 file.close();
298 //flp->dump();
299 298
300 return TRUE; 299 return TRUE;
301} 300}
@@ -314,7 +313,7 @@ void LLFeatureManager::loadGPUClass()
314 313
315 llifstream file; 314 llifstream file;
316 315
317 file.open(data_path.c_str()); 316 file.open(data_path.c_str()); /*Flawfinder: ignore*/
318 317
319 if (!file) 318 if (!file)
320 { 319 {
@@ -330,12 +329,12 @@ void LLFeatureManager::loadGPUClass()
330 329
331 while (!file.eof()) 330 while (!file.eof())
332 { 331 {
333 char buffer[MAX_STRING]; 332 char buffer[MAX_STRING]; /*Flawfinder: ignore*/
334 buffer[0] = 0; 333 buffer[0] = 0;
335 334
336 file.getline(buffer, MAX_STRING); 335 file.getline(buffer, MAX_STRING);
337 336
338 if (strlen(buffer) >= 2 && 337 if (strlen(buffer) >= 2 && /*Flawfinder: ignore*/
339 buffer[0] == '/' && 338 buffer[0] == '/' &&
340 buffer[1] == '/') 339 buffer[1] == '/')
341 { 340 {
@@ -343,7 +342,7 @@ void LLFeatureManager::loadGPUClass()
343 continue; 342 continue;
344 } 343 }
345 344
346 if (strlen(buffer) == 0) 345 if (strlen(buffer) == 0) /*Flawfinder: ignore*/
347 { 346 {
348 // This is a blank line 347 // This is a blank line
349 continue; 348 continue;
@@ -360,7 +359,7 @@ void LLFeatureManager::loadGPUClass()
360 continue; 359 continue;
361 } 360 }
362 361
363 for (U32 i = 0; i < strlen(expr); i++) 362 for (U32 i = 0; i < strlen(expr); i++) /*Flawfinder: ignore*/
364 { 363 {
365 expr[i] = tolower(expr[i]); 364 expr[i] = tolower(expr[i]);
366 } 365 }
@@ -380,10 +379,11 @@ void LLFeatureManager::loadGPUClass()
380 llinfos << "GPU is " << label << llendl; 379 llinfos << "GPU is " << label << llendl;
381 mGPUString = label; 380 mGPUString = label;
382 mGPUClass = (S32) strtol(cls, NULL, 10); 381 mGPUClass = (S32) strtol(cls, NULL, 10);
382 file.close();
383 return;
383 } 384 }
384 } 385 }
385 file.close(); 386 file.close();
386 //flp->dump();
387 387
388 llwarns << "Couldn't match GPU to a class: " << gGLManager.getRawGLString() << llendl; 388 llwarns << "Couldn't match GPU to a class: " << gGLManager.getRawGLString() << llendl;
389} 389}
@@ -401,11 +401,7 @@ void LLFeatureManager::initCPUFeatureMasks()
401 { 401 {
402 maskFeatures("RAM256MB"); 402 maskFeatures("RAM256MB");
403 } 403 }
404 else if (gSysMemory.getPhysicalMemory() <= 512*1024*1024) 404
405 {
406 //maskFeatures("RAM512MB");
407 }
408
409 if (gSysCPU.getMhz() < 1100) 405 if (gSysCPU.getMhz() < 1100)
410 { 406 {
411 maskFeatures("CPUSlow"); 407 maskFeatures("CPUSlow");
@@ -468,7 +464,11 @@ void LLFeatureManager::initGraphicsFeatureMasks()
468 } 464 }
469 if (gGLManager.mIsIntel) 465 if (gGLManager.mIsIntel)
470 { 466 {
471 maskFeatures("Brookdale"); 467 maskFeatures("Intel");
468 }
469 if (gGLManager.mGLVersion < 1.5f)
470 {
471 maskFeatures("OpenGLPre15");
472 } 472 }
473 473
474 if (gGLManager.mIsMobilityRadeon9000) 474 if (gGLManager.mIsMobilityRadeon9000)
@@ -483,303 +483,6 @@ void LLFeatureManager::initGraphicsFeatureMasks()
483 483
484extern LLOSInfo gSysOS; 484extern LLOSInfo gSysOS;
485 485
486
487BOOL bad_hardware_dialog(const LLString &info_str, const LLString &url)
488{
489 if (!gSavedSettings.getWarning("AboutBadPCI"))
490 {
491 return FALSE;
492 }
493
494 // XUI:translate
495 std::string msg = llformat(
496 "[SECOND_LIFE] has detected that there may be a problem with.\n"
497 "hardware or drivers on your computer. Often resolving these\n"
498 "issues can result in enhanced stability and performance.\n"
499 " \n"
500 "%s\n"
501 " \n"
502 "Would you like to view a web page with more detailed\n"
503 "information on this problem?\n", info_str.c_str());
504
505 // Warn them that runnin without DirectX 9 will
506 // not allow us to tell them about driver issues
507 S32 button = OSMessageBox(msg.c_str(),
508 "Warning",
509 OSMB_YESNO);
510 if (OSBTN_YES== button)
511 {
512 llinfos << "User quitting after detecting bad drivers" << llendl;
513 spawn_web_browser(url.c_str());
514 return TRUE;
515 }
516 else
517 {
518 // Don't warn about bad PCI stuff again, they've clicked past it.
519 gSavedSettings.setWarning("AboutBadPCI", FALSE);
520 }
521 return FALSE;
522}
523
524BOOL LLFeatureManager::initPCIFeatureMasks()
525{
526#if LL_WINDOWS
527 BOOL exit_after_bad = FALSE;
528
529 BOOL is_2000 = FALSE;
530 BOOL is_xp = FALSE;
531
532 if (gSysOS.mMajorVer != 5)
533 {
534 // Unknown windows version number, exit!"
535 llwarns << "Unknown Windows major version " << gSysOS.mMajorVer << ", aborting detection!" << llendl;
536 return FALSE;
537 }
538 if (gSysOS.mMinorVer == 0)
539 {
540 is_2000 = TRUE;
541 }
542 else if (gSysOS.mMinorVer == 1)
543 {
544 is_xp = TRUE;
545 }
546 else
547 {
548 llwarns << "Unknown Windows minor version " << gSysOS.mMinorVer << ", aborting detection!" << llendl;
549 return FALSE;
550 }
551
552 // This only works on Win32, as it relies on DX9 hardware detection
553 // The PCI masks are actually the inverse of the normal masks
554 // We actually look through the masks,and see if any hardware matches it.
555 // This is because the masks encode logic about
556
557 // Check for the broken AMD AGP controllers (751, 761, 762)
558
559 // Horrible cruddy fixed lookup table.
560 // Figure out what OS we're on, the version numbers are different. Sigh...
561
562 LLDXDriverFile *dfilep = NULL;
563 LLDXDevice *devp = NULL;
564
565 // AMD(1022) AGP controllers
566 // 7007 AMD-751 AGP Controller
567 // 700F AMD-761 AGP Controller
568 // 700D AMD-762 AGP Controller
569 devp = gDXHardware.findDevice("VEN_1022", "DEV_7007|DEV_700F|DEV_700D");
570 if (devp)
571 {
572 // We're just pretty much screwed here, there are big problems with this hardware
573 // We've got trouble with the most recent nVidia drivers. Check for this and warn.
574
575 // Note: Need to detect that we're running with older nVidia hardware, probably
576 exit_after_bad |= bad_hardware_dialog("AMD AGP Controller",
577 AMD_AGP_URL);
578 }
579
580 // VIA(1106) AGP Controllers
581 // These need upgrading on both Win2K and WinXP
582 //
583 // 8305 VT8363/8365 CPU to AGP - Apollo KT133/KM133
584 // 8598 VT82C598MVP/694X CPU to AGP - Apollo MVP3/Pro133A
585 // 8605 VT8605 CPU to AGP - Apollo PM133
586 // B091 VT8633 CPU to AGP - Apollo Pro 266
587 // B099 VT8366/A/T CPU to AGP - Apollo KT266/A/333
588 // B168 VT8235 CPU to AGP (AGP 2.0/3.0) - ProSavageDDR P4X333 chipset
589 // B188 VT8237 CPU to AGP (AGP 2.0/3.0) - K8T800
590 // B198 VT8237 CPU to AGP (AGP 2.0/3.0) - ProSavageDDR P4X600 chipset
591
592 devp = gDXHardware.findDevice("VEN_1106",
593 "DEV_8305|DEV_8598|DEV_8605|DEV_B091|"
594 "DEV_B099|DEV_B168|DEV_B188|DEV_B198");
595 if (devp)
596 {
597 BOOL out_of_date = FALSE;
598 // Wanted driver: VIAAGP1.SYS
599 // Version Format: M.mm.0000.vvvv
600 // M.mm - Major/minor OS version (5.0 for Win2000, 5.1 for WinXP)
601 // vvvv - driver version number
602 //
603 // Notes:
604 // 3442 is most recent as of 2/25/04, probably want at least 3430 (seems to be a common version)
605
606 // These are DELIBERATE assignments inside if statements, blech.
607 if (dfilep = devp->findDriver("pci.sys"))
608 {
609 // Old driver: pci.sys
610 // Version: 5.01.2600.xxxx
611 //
612 // Notes:
613 // Default WinXP driver for B168, B198?
614
615 // Old driver: pci.sys
616 // Version: 5.01.2195.xxxx
617 //
618 // Notes:
619 // Default Win2K driver for 8305?
620
621 llwarns << "Detected pci.sys" << llendl;
622 write_debug("Old driver (pci.sys) for VIA detected!");
623 out_of_date = TRUE;
624 }
625 else if (dfilep = devp->findDriver("VIAAGP.SYS"))
626 {
627 // Old driver: VIAAGP.SYS
628 // Version: 5.01.2600.xxxx
629 //
630 // Notes:
631 // Default WinXP driver for B09x?
632
633 llwarns << "Detected VIAAGP.SYS" << llendl;
634 write_debug("Old driver (VIAAGP.SYS) for VIA detected!");
635 out_of_date = TRUE;
636 }
637 else if (dfilep = devp->findDriver("VIAAGP1.SYS"))
638 {
639 if (dfilep->mVersion.getField(3) < 3430)
640 {
641 // They're using a pretty old version of the VIA AGP drivers
642 // Maybe they want to upgrade?
643 llwarns << "Detected VIAAGP1.SYS" << llendl;
644 write_debug("Old driver (VIAAGP1.SYS) for VIA detected!");
645 out_of_date = TRUE;
646 }
647 }
648 if (out_of_date)
649 {
650 exit_after_bad |= bad_hardware_dialog("Out of date VIA AGP chipset driver",
651 VIA_URL);
652 }
653 }
654
655 // Intel(8086) AGP controllers (Win2K)
656 // These particular controllers only may need drivers on Win2K
657 //
658 // 1A31 82845[MP|MZ] Processor to AGP Controller
659 // 2532 82850/860 Processor to AGP Controller
660 if (is_2000)
661 {
662 devp = gDXHardware.findDevice("VEN_8086",
663 "DEV_1A31");
664 if (devp)
665 {
666 if (dfilep = devp->findDriver("pci.sys"))
667 {
668 // Old driver: pci.sys
669 // Version 5.01.21[9|6]5.xxxx
670 //
671 // Notes:
672 // Default driver for Win2K? Not sure what the "correct" driver is -
673 // maybe some variant of AGP440.SYS?
674 llwarns << "Detected pci.sys" << llendl;
675 write_debug("Old driver (pci.sys) for Intel 82845/850 on Win2K detected!");
676 exit_after_bad |= bad_hardware_dialog("Out of date Intel chipset driver",
677 INTEL_CHIPSET_URL);
678 }
679 }
680 }
681
682 /* Removed 4/3/2006 by JC
683 After talking with Doug, we don't know what the proper driver
684 and/or version number should be for Intel 865. Regardless, this
685 code would _always_ complain if you had that chipset.
686
687 // Intel(8086) AGP controllers (All)
688 // These particular controllers may need drivers on both Win2K and WinXP
689 //
690 // 2561 82845G/GL/GE/PE/GV Processor to AGP Controller
691 // 2571 82865G/PE/P/GV/28248P Processor to AGP Controller
692 devp = gDXHardware.findDevice("VEN_8086",
693 "DEV_2571");
694 if (devp)
695 {
696 // Wanted driver: AGP440.SYS(?)
697 //
698 // Notes:
699 // Not sure, need to verify with an actual 82865/75 (Dell 8300?)
700
701 // Old driver: pci.sys
702 // Version 5.01.21[9|6]5.xxxx
703 //
704 // Notes:
705 // Default driver for Win2K? Not sure what the "correct" driver is -
706 // maybe some variant of AGP440.SYS?
707 exit_after_bad |= bad_hardware_dialog("Out of date Intel chipset driver",
708 INTEL_CHIPSET_URL);
709 }
710 */
711
712
713 // SiS(1039) AGP controllers (All)
714 // These particular controllers may need drivers on both Win2K and WinXP
715 //
716 // 0001 SiS 530
717 // 0002 SiS SG86C202(???)
718 // 0003 SiS 648FX
719 devp = gDXHardware.findDevice("VEN_1039",
720 "DEV_0001|DEV_0002|DEV_0003");
721 if (devp)
722 {
723 BOOL out_of_date = FALSE;
724 // Wanted driver: SISAGPX.SYS
725 //
726 // Notes:
727 // Not sure, need to verify with an actual 82865/75 (Dell 8300?)
728
729 // Old driver: pci.sys
730 // Version 5.01.21[9|6]5.xxxx
731 //
732 // Notes:
733 // Default driver for Win2K? Not sure what the "correct" driver is -
734 // maybe some variant of AGP440.SYS?
735 if (dfilep = devp->findDriver("pci.sys"))
736 {
737 // Old driver: pci.sys
738 // Version 5.01.21[9|6]5.xxxx
739 //
740 llwarns << "Detected pci.sys" << llendl;
741 write_debug("Old driver (pci.sys) for SiS detected!");
742 out_of_date = TRUE;
743 }
744
745 if (dfilep = devp->findDriver("sisagp.sys"))
746 {
747 // Old driver: pci.sys
748 // Version 5.01.21[9|6]5.xxxx
749 //
750 llwarns << "Detected sisagp.sys" << llendl;
751 write_debug("Old driver (sisagp.sys) for SiS detected!");
752 out_of_date = TRUE;
753 }
754
755 if (dfilep = devp->findDriver("sisagpx.sys"))
756 {
757 // Old driver: pci.sys
758 // Version 7.02.0000.xxxx
759 //
760 // Notes:
761 // Default driver for Win2K? Not sure what the "correct" driver is -
762 // maybe some variant of AGP440.SYS?
763 if (dfilep->mVersion.getField(3) < 1160)
764 {
765 out_of_date = TRUE;
766 llwarns << "Detected sisagpx.sys" << llendl;
767 write_debug("Old driver (sisagpx.sys) for SiS detected!");
768 }
769 }
770 if (out_of_date)
771 {
772 exit_after_bad |= bad_hardware_dialog("Out of date SiS chipset driver",
773 SIS_CHIPSET_URL);
774 }
775 }
776
777 return exit_after_bad;
778#else
779 return TRUE;
780#endif
781}
782
783void LLFeatureManager::applyRecommendedFeatures() 486void LLFeatureManager::applyRecommendedFeatures()
784{ 487{
785 // see featuretable.txt 488 // see featuretable.txt
@@ -789,14 +492,14 @@ void LLFeatureManager::applyRecommendedFeatures()
789 dump(); 492 dump();
790#endif 493#endif
791 494
792 // Enabling AGP 495 // Enabling VBO
793 if (getRecommendedLevel("RenderAGP")) 496 if (getRecommendedLevel("RenderVBO"))
794 { 497 {
795 gSavedSettings.setBOOL("RenderUseAGP", TRUE); 498 gSavedSettings.setBOOL("RenderVBOEnable", TRUE);
796 } 499 }
797 else 500 else
798 { 501 {
799 gSavedSettings.setBOOL("RenderUseAGP", FALSE); 502 gSavedSettings.setBOOL("RenderVBOEnable", FALSE);
800 } 503 }
801 504
802 // Anisotropic rendering 505 // Anisotropic rendering
diff --git a/linden/indra/newview/llfeaturemanager.h b/linden/indra/newview/llfeaturemanager.h
index a24f06f..a3800da 100644
--- a/linden/indra/newview/llfeaturemanager.h
+++ b/linden/indra/newview/llfeaturemanager.h
@@ -100,8 +100,7 @@ public:
100 100
101 void initCPUFeatureMasks(); 101 void initCPUFeatureMasks();
102 void initGraphicsFeatureMasks(); 102 void initGraphicsFeatureMasks();
103 BOOL initPCIFeatureMasks(); 103
104
105 void applyRecommendedFeatures(); 104 void applyRecommendedFeatures();
106 105
107protected: 106protected:
diff --git a/linden/indra/newview/llfilepicker.cpp b/linden/indra/newview/llfilepicker.cpp
index 6b56df6..d3938e0 100644
--- a/linden/indra/newview/llfilepicker.cpp
+++ b/linden/indra/newview/llfilepicker.cpp
@@ -36,6 +36,10 @@
36#include "lldir.h" 36#include "lldir.h"
37#include "llframetimer.h" 37#include "llframetimer.h"
38 38
39#if LL_SDL
40#include "llwindowsdl.h" // for some X/GTK utils to help with filepickers
41#endif // LL_SDL
42
39// 43//
40// Globals 44// Globals
41// 45//
@@ -164,7 +168,7 @@ BOOL LLFilePicker::getOpenFile(ELoadFilter filter)
164 if (success) 168 if (success)
165 { 169 {
166 LLString tstr = utf16str_to_utf8str(llutf16string(mFilesW)); 170 LLString tstr = utf16str_to_utf8str(llutf16string(mFilesW));
167 memcpy(mFiles, tstr.c_str(), tstr.size()+1); 171 memcpy(mFiles, tstr.c_str(), tstr.size()+1); /*Flawfinder: ignore*/
168 mCurrentFile = mFiles; 172 mCurrentFile = mFiles;
169 } 173 }
170 send_agent_resume(); 174 send_agent_resume();
@@ -204,12 +208,12 @@ BOOL LLFilePicker::getMultipleOpenFiles(ELoadFilter filter)
204 // The getopenfilename api doesn't tell us if we got more than 208 // The getopenfilename api doesn't tell us if we got more than
205 // one file, so we have to test manually by checking string 209 // one file, so we have to test manually by checking string
206 // lengths. 210 // lengths.
207 if( wcslen(mOFN.lpstrFile) > mOFN.nFileOffset ) 211 if( wcslen(mOFN.lpstrFile) > mOFN.nFileOffset ) /*Flawfinder: ignore*/
208 { 212 {
209 mMultiFile = FALSE; 213 mMultiFile = FALSE;
210 mCurrentFile = mFiles; 214 mCurrentFile = mFiles;
211 LLString tstr = utf16str_to_utf8str(llutf16string(mFilesW)); 215 LLString tstr = utf16str_to_utf8str(llutf16string(mFilesW));
212 memcpy(mFiles, tstr.c_str(), tstr.size()+1); 216 memcpy(mFiles, tstr.c_str(), tstr.size()+1); /*Flawfinder: ignore*/
213 } 217 }
214 else 218 else
215 { 219 {
@@ -252,7 +256,7 @@ BOOL LLFilePicker::getSaveFile(ESaveFilter filter, const char* filename)
252 if (filename) 256 if (filename)
253 { 257 {
254 llutf16string tstring = utf8str_to_utf16str(filename); 258 llutf16string tstring = utf8str_to_utf16str(filename);
255 wcsncpy(mFilesW, tstring.c_str(), FILENAME_BUFFER_SIZE); } 259 wcsncpy(mFilesW, tstring.c_str(), FILENAME_BUFFER_SIZE); } /*Flawfinder: ignore*/
256 else 260 else
257 { 261 {
258 mFilesW[0] = '\0'; 262 mFilesW[0] = '\0';
@@ -272,7 +276,7 @@ BOOL LLFilePicker::getSaveFile(ESaveFilter filter, const char* filename)
272 case FFSAVE_WAV: 276 case FFSAVE_WAV:
273 if (!filename) 277 if (!filename)
274 { 278 {
275 wcsncpy( mFilesW,L"untitled.wav", FILENAME_BUFFER_SIZE); 279 wcsncpy( mFilesW,L"untitled.wav", FILENAME_BUFFER_SIZE); /*Flawfinder: ignore*/
276 } 280 }
277 mOFN.lpstrDefExt = L"wav"; 281 mOFN.lpstrDefExt = L"wav";
278 L"WAV Sounds (*.wav)\0*.wav\0" \ 282 L"WAV Sounds (*.wav)\0*.wav\0" \
@@ -281,7 +285,7 @@ BOOL LLFilePicker::getSaveFile(ESaveFilter filter, const char* filename)
281 case FFSAVE_TGA: 285 case FFSAVE_TGA:
282 if (!filename) 286 if (!filename)
283 { 287 {
284 wcsncpy( mFilesW,L"untitled.tga", FILENAME_BUFFER_SIZE); 288 wcsncpy( mFilesW,L"untitled.tga", FILENAME_BUFFER_SIZE); /*Flawfinder: ignore*/
285 } 289 }
286 mOFN.lpstrDefExt = L"tga"; 290 mOFN.lpstrDefExt = L"tga";
287 mOFN.lpstrFilter = 291 mOFN.lpstrFilter =
@@ -291,7 +295,7 @@ BOOL LLFilePicker::getSaveFile(ESaveFilter filter, const char* filename)
291 case FFSAVE_BMP: 295 case FFSAVE_BMP:
292 if (!filename) 296 if (!filename)
293 { 297 {
294 wcsncpy( mFilesW,L"untitled.bmp", FILENAME_BUFFER_SIZE); 298 wcsncpy( mFilesW,L"untitled.bmp", FILENAME_BUFFER_SIZE); /*Flawfinder: ignore*/
295 } 299 }
296 mOFN.lpstrDefExt = L"bmp"; 300 mOFN.lpstrDefExt = L"bmp";
297 mOFN.lpstrFilter = 301 mOFN.lpstrFilter =
@@ -301,7 +305,7 @@ BOOL LLFilePicker::getSaveFile(ESaveFilter filter, const char* filename)
301 case FFSAVE_AVI: 305 case FFSAVE_AVI:
302 if (!filename) 306 if (!filename)
303 { 307 {
304 wcsncpy( mFilesW,L"untitled.avi", FILENAME_BUFFER_SIZE); 308 wcsncpy( mFilesW,L"untitled.avi", FILENAME_BUFFER_SIZE); /*Flawfinder: ignore*/
305 } 309 }
306 mOFN.lpstrDefExt = L"avi"; 310 mOFN.lpstrDefExt = L"avi";
307 mOFN.lpstrFilter = 311 mOFN.lpstrFilter =
@@ -311,7 +315,7 @@ BOOL LLFilePicker::getSaveFile(ESaveFilter filter, const char* filename)
311 case FFSAVE_ANIM: 315 case FFSAVE_ANIM:
312 if (!filename) 316 if (!filename)
313 { 317 {
314 wcsncpy( mFilesW,L"untitled.xaf", FILENAME_BUFFER_SIZE); 318 wcsncpy( mFilesW,L"untitled.xaf", FILENAME_BUFFER_SIZE); /*Flawfinder: ignore*/
315 } 319 }
316 mOFN.lpstrDefExt = L"xaf"; 320 mOFN.lpstrDefExt = L"xaf";
317 mOFN.lpstrFilter = 321 mOFN.lpstrFilter =
@@ -322,7 +326,7 @@ BOOL LLFilePicker::getSaveFile(ESaveFilter filter, const char* filename)
322 case FFSAVE_GEOMETRY: 326 case FFSAVE_GEOMETRY:
323 if (!filename) 327 if (!filename)
324 { 328 {
325 wcsncpy( mFilesW,L"untitled.slg", FILENAME_BUFFER_SIZE); 329 wcsncpy( mFilesW,L"untitled.slg", FILENAME_BUFFER_SIZE); /*Flawfinder: ignore*/
326 } 330 }
327 mOFN.lpstrDefExt = L"slg"; 331 mOFN.lpstrDefExt = L"slg";
328 mOFN.lpstrFilter = 332 mOFN.lpstrFilter =
@@ -333,7 +337,7 @@ BOOL LLFilePicker::getSaveFile(ESaveFilter filter, const char* filename)
333 case FFSAVE_XML: 337 case FFSAVE_XML:
334 if (!filename) 338 if (!filename)
335 { 339 {
336 wcsncpy( mFilesW,L"untitled.xml", FILENAME_BUFFER_SIZE); 340 wcsncpy( mFilesW,L"untitled.xml", FILENAME_BUFFER_SIZE); /*Flawfinder: ignore*/
337 } 341 }
338 342
339 mOFN.lpstrDefExt = L"xml"; 343 mOFN.lpstrDefExt = L"xml";
@@ -344,7 +348,7 @@ BOOL LLFilePicker::getSaveFile(ESaveFilter filter, const char* filename)
344 case FFSAVE_COLLADA: 348 case FFSAVE_COLLADA:
345 if (!filename) 349 if (!filename)
346 { 350 {
347 wcsncpy( mFilesW,L"untitled.collada", FILENAME_BUFFER_SIZE); 351 wcsncpy( mFilesW,L"untitled.collada", FILENAME_BUFFER_SIZE); /*Flawfinder: ignore*/
348 } 352 }
349 mOFN.lpstrDefExt = L"collada"; 353 mOFN.lpstrDefExt = L"collada";
350 mOFN.lpstrFilter = 354 mOFN.lpstrFilter =
@@ -354,12 +358,22 @@ BOOL LLFilePicker::getSaveFile(ESaveFilter filter, const char* filename)
354 case FFSAVE_RAW: 358 case FFSAVE_RAW:
355 if (!filename) 359 if (!filename)
356 { 360 {
357 wcsncpy( mFilesW,L"untitled.raw", FILENAME_BUFFER_SIZE); 361 wcsncpy( mFilesW,L"untitled.raw", FILENAME_BUFFER_SIZE); /*Flawfinder: ignore*/
358 } 362 }
359 mOFN.lpstrDefExt = L"raw"; 363 mOFN.lpstrDefExt = L"raw";
360 mOFN.lpstrFilter = RAW_FILTER \ 364 mOFN.lpstrFilter = RAW_FILTER \
361 L"\0"; 365 L"\0";
362 break; 366 break;
367 case FFSAVE_J2C:
368 if (!filename)
369 {
370 wcsncpy( mFilesW,L"untitled.j2c", FILENAME_BUFFER_SIZE);
371 }
372 mOFN.lpstrDefExt = L"j2c";
373 mOFN.lpstrFilter =
374 L"Compressed Images (*.j2c)\0*.j2c\0" \
375 L"\0";
376 break;
363 default: 377 default:
364 return FALSE; 378 return FALSE;
365 } 379 }
@@ -376,7 +390,7 @@ BOOL LLFilePicker::getSaveFile(ESaveFilter filter, const char* filename)
376 if (success) 390 if (success)
377 { 391 {
378 LLString tstr = utf16str_to_utf8str(llutf16string(mFilesW)); 392 LLString tstr = utf16str_to_utf8str(llutf16string(mFilesW));
379 memcpy(mFiles, tstr.c_str(), tstr.size()+1); 393 memcpy(mFiles, tstr.c_str(), tstr.size()+1); /*Flawfinder: ignore*/
380 mCurrentFile = mFiles; 394 mCurrentFile = mFiles;
381 } 395 }
382 gKeyboard->resetKeys(); 396 gKeyboard->resetKeys();
@@ -402,7 +416,7 @@ const char* LLFilePicker::getNextFile()
402{ 416{
403 if(mMultiFile) 417 if(mMultiFile)
404 { 418 {
405 mCurrentFile += strlen(mCurrentFile) + 1; 419 mCurrentFile += strlen(mCurrentFile) + 1; /*Flawfinder: ignore*/
406 if( '\0' != mCurrentFile[0] ) 420 if( '\0' != mCurrentFile[0] )
407 { 421 {
408 buildFilename(); 422 buildFilename();
@@ -435,11 +449,11 @@ void LLFilePicker::reset()
435 449
436void LLFilePicker::buildFilename( void ) 450void LLFilePicker::buildFilename( void )
437{ 451{
438 strncpy( mFilename, mFiles, LL_MAX_PATH ); 452 strncpy( mFilename, mFiles, LL_MAX_PATH ); /*Flawfinder: ignore*/
439 S32 len = strlen( mFilename ); 453 S32 len = strlen( mFilename ); /*Flawfinder: ignore*/
440 454
441 strcat(mFilename,gDirUtilp->getDirDelimiter().c_str()); 455 strncat(mFilename,gDirUtilp->getDirDelimiter().c_str(), sizeof(mFilename)-len+1); /*Flawfinder: ignore*/
442 len += strlen(gDirUtilp->getDirDelimiter().c_str()); 456 len += strlen(gDirUtilp->getDirDelimiter().c_str()); /*Flawfinder: ignore*/
443 457
444// mFilename[len++] = '\\'; 458// mFilename[len++] = '\\';
445 LLString::copy( mFilename + len, mCurrentFile, LL_MAX_PATH - len ); 459 LLString::copy( mFilename + len, mCurrentFile, LL_MAX_PATH - len );
@@ -601,7 +615,7 @@ OSStatus LLFilePicker::doNavChooseDialog(ELoadFilter filter)
601 AEKeyword theAEKeyword; 615 AEKeyword theAEKeyword;
602 DescType typeCode; 616 DescType typeCode;
603 Size actualSize = 0; 617 Size actualSize = 0;
604 char path[MAX_PATH]; 618 char path[MAX_PATH]; /*Flawfinder: ignore*/
605 619
606 memset(&fsRef, 0, sizeof(fsRef)); 620 memset(&fsRef, 0, sizeof(fsRef));
607 error = AEGetNthPtr(&navReply.selection, index, typeFSRef, &theAEKeyword, &typeCode, &fsRef, sizeof(fsRef), &actualSize); 621 error = AEGetNthPtr(&navReply.selection, index, typeFSRef, &theAEKeyword, &typeCode, &fsRef, sizeof(fsRef), &actualSize);
@@ -675,6 +689,12 @@ OSStatus LLFilePicker::doNavSaveDialog(ESaveFilter filter, const char* filename)
675 extension = CFSTR(".raw"); 689 extension = CFSTR(".raw");
676 break; 690 break;
677 691
692 case FFSAVE_J2C:
693 type = '\?\?\?\?';
694 creator = 'prvw';
695 extension = CFSTR(".j2c");
696 break;
697
678 case FFSAVE_ALL: 698 case FFSAVE_ALL:
679 default: 699 default:
680 type = '\?\?\?\?'; 700 type = '\?\?\?\?';
@@ -750,8 +770,8 @@ OSStatus LLFilePicker::doNavSaveDialog(ESaveFilter filter, const char* filename)
750 770
751 if (error == noErr) 771 if (error == noErr)
752 { 772 {
753 char path[PATH_MAX]; 773 char path[PATH_MAX]; /*Flawfinder: ignore*/
754 char newFileName[SINGLE_FILENAME_BUFFER_SIZE]; 774 char newFileName[SINGLE_FILENAME_BUFFER_SIZE]; /*Flawfinder: ignore*/
755 775
756 error = FSRefMakePath(&fsRef, (UInt8*)path, PATH_MAX); 776 error = FSRefMakePath(&fsRef, (UInt8*)path, PATH_MAX);
757 if (error == noErr) 777 if (error == noErr)
@@ -836,7 +856,7 @@ void LLFilePicker::getFilePath(SInt32 index)
836{ 856{
837 mFiles[0] = 0; 857 mFiles[0] = 0;
838 if (mFileVector.size()) 858 if (mFileVector.size())
839 strcpy(mFiles, mFileVector[index].c_str()); 859 strncpy(mFiles, mFileVector[index].c_str(), sizeof(mFiles)); /*Flawfinder: ignore*/
840} 860}
841 861
842void LLFilePicker::getFileName(SInt32 index) 862void LLFilePicker::getFileName(SInt32 index)
@@ -846,7 +866,7 @@ void LLFilePicker::getFileName(SInt32 index)
846 { 866 {
847 char *start = strrchr(mFileVector[index].c_str(), '/'); 867 char *start = strrchr(mFileVector[index].c_str(), '/');
848 if (start && ((start + 1 - mFileVector[index].c_str()) < (mFileVector[index].size()))) 868 if (start && ((start + 1 - mFileVector[index].c_str()) < (mFileVector[index].size())))
849 strcpy(mFilename, start + 1); 869 strncpy(mFilename, start + 1, sizeof(mFilename)); /*Flawfinder: ignore*/
850 } 870 }
851} 871}
852 872
@@ -973,8 +993,7 @@ static void store_filenames(GtkWidget *widget, gpointer user_data) {
973 993
974GtkWindow* LLFilePicker::buildFilePicker(void) 994GtkWindow* LLFilePicker::buildFilePicker(void)
975{ 995{
976 gtk_disable_setlocale(); 996 if (ll_try_gtk_init() &&
977 if (gtk_init_check(NULL, NULL) &&
978 ! gViewerWindow->getWindow()->getFullscreen()) 997 ! gViewerWindow->getWindow()->getFullscreen())
979 { 998 {
980 GtkWidget *win = NULL; 999 GtkWidget *win = NULL;
@@ -986,18 +1005,17 @@ GtkWindow* LLFilePicker::buildFilePicker(void)
986 // Make GTK tell the window manager to associate this 1005 // Make GTK tell the window manager to associate this
987 // dialog with our non-GTK raw X11 window, which should try 1006 // dialog with our non-GTK raw X11 window, which should try
988 // to keep it on top etc. 1007 // to keep it on top etc.
989 Window *XWindowID_ptr = (Window*) gViewerWindow-> 1008 Window XWindowID = get_SDL_XWindowID();
990 getWindow()->getPlatformWindow(); 1009 if (None != XWindowID)
991 if (XWindowID_ptr && None != *XWindowID_ptr)
992 { 1010 {
993 gtk_widget_realize(GTK_WIDGET(win)); // so we can get its gdkwin 1011 gtk_widget_realize(GTK_WIDGET(win)); // so we can get its gdkwin
994 GdkWindow *gdkwin = gdk_window_foreign_new(*XWindowID_ptr); 1012 GdkWindow *gdkwin = gdk_window_foreign_new(XWindowID);
995 gdk_window_set_transient_for(GTK_WIDGET(win)->window, 1013 gdk_window_set_transient_for(GTK_WIDGET(win)->window,
996 gdkwin); 1014 gdkwin);
997 } 1015 }
998 else 1016 else
999 { 1017 {
1000 llwarns << "Hmm, couldn't get xwid from LLWindow." << llendl; 1018 llwarns << "Hmm, couldn't get xwid to use for transient." << llendl;
1001 } 1019 }
1002# endif //LL_X11 1020# endif //LL_X11
1003 1021
@@ -1080,6 +1098,10 @@ BOOL LLFilePicker::getSaveFile( ESaveFilter filter, const char* filename )
1080 caption += "RAW File (*.raw)"; 1098 caption += "RAW File (*.raw)";
1081 suggest_ext += ".raw"; 1099 suggest_ext += ".raw";
1082 break; 1100 break;
1101 case FFSAVE_J2C:
1102 caption += "Compressed Images (*.j2c)";
1103 suggest_ext += ".j2c";
1104 break;
1083 default:; 1105 default:;
1084 break; 1106 break;
1085 } 1107 }
diff --git a/linden/indra/newview/llfilepicker.h b/linden/indra/newview/llfilepicker.h
index 88530f6..c284a42 100644
--- a/linden/indra/newview/llfilepicker.h
+++ b/linden/indra/newview/llfilepicker.h
@@ -106,6 +106,7 @@ public:
106 FFSAVE_XML = 9, 106 FFSAVE_XML = 9,
107 FFSAVE_COLLADA = 10, 107 FFSAVE_COLLADA = 10,
108 FFSAVE_RAW = 11, 108 FFSAVE_RAW = 11,
109 FFSAVE_J2C = 12,
109 }; 110 };
110 111
111 // open the dialog. This is a modal operation 112 // open the dialog. This is a modal operation
@@ -169,8 +170,8 @@ private:
169 U32 mNextFileIndex; 170 U32 mNextFileIndex;
170#endif 171#endif
171 172
172 char mFiles[FILENAME_BUFFER_SIZE]; 173 char mFiles[FILENAME_BUFFER_SIZE]; /*Flawfinder: ignore*/
173 char mFilename[LL_MAX_PATH]; 174 char mFilename[LL_MAX_PATH]; /*Flawfinder: ignore*/
174 char* mCurrentFile; 175 char* mCurrentFile;
175 BOOL mLocked; 176 BOOL mLocked;
176 BOOL mMultiFile; 177 BOOL mMultiFile;
diff --git a/linden/indra/newview/llflexibleobject.cpp b/linden/indra/newview/llflexibleobject.cpp
index 7e37c4c..4ce1614 100644
--- a/linden/indra/newview/llflexibleobject.cpp
+++ b/linden/indra/newview/llflexibleobject.cpp
@@ -44,11 +44,6 @@
44#include "llviewerregion.h" 44#include "llviewerregion.h"
45#include "llworld.h" 45#include "llworld.h"
46 46
47/*static*/ LLVolumeImplFlexible::lodset_t LLVolumeImplFlexible::sLODBins[ FLEXIBLE_OBJECT_MAX_LOD ];
48/*static*/ U64 LLVolumeImplFlexible::sCurrentUpdateFrame = 0;
49/*static*/ U32 LLVolumeImplFlexible::sDebugInserted = 0;
50/*static*/ U32 LLVolumeImplFlexible::sDebugVisible = 0;
51
52/*static*/ F32 LLVolumeImplFlexible::sUpdateFactor = 1.0f; 47/*static*/ F32 LLVolumeImplFlexible::sUpdateFactor = 1.0f;
53 48
54// LLFlexibleObjectData::pack/unpack now in llprimitive.cpp 49// LLFlexibleObjectData::pack/unpack now in llprimitive.cpp
@@ -59,14 +54,13 @@
59LLVolumeImplFlexible::LLVolumeImplFlexible(LLViewerObject* vo, LLFlexibleObjectData* attributes) : 54LLVolumeImplFlexible::LLVolumeImplFlexible(LLViewerObject* vo, LLFlexibleObjectData* attributes) :
60 mVO(vo), mAttributes(attributes) 55 mVO(vo), mAttributes(attributes)
61{ 56{
57 static U32 seed = 0;
58 mID = seed++;
62 mInitialized = FALSE; 59 mInitialized = FALSE;
63 mUpdated = FALSE; 60 mUpdated = FALSE;
64 mJustShifted = FALSE;
65 mInitializedRes = -1; 61 mInitializedRes = -1;
66 mSimulateRes = 0; 62 mSimulateRes = 0;
67 mFrameNum = 0; 63 mFrameNum = 0;
68 mLastUpdate = 0;
69
70}//----------------------------------------------- 64}//-----------------------------------------------
71 65
72LLVector3 LLVolumeImplFlexible::getFramePosition() const 66LLVector3 LLVolumeImplFlexible::getFramePosition() const
@@ -94,7 +88,6 @@ void LLVolumeImplFlexible::onShift(const LLVector3 &shift_vector)
94 { 88 {
95 mSection[section].mPosition += shift_vector; 89 mSection[section].mPosition += shift_vector;
96 } 90 }
97 mVO->getVolume()->mBounds[0] += shift_vector;
98} 91}
99 92
100//----------------------------------------------------------------------------------------------- 93//-----------------------------------------------------------------------------------------------
@@ -107,7 +100,7 @@ void LLVolumeImplFlexible::setParentPositionAndRotationDirectly( LLVector3 p, LL
107 100
108void LLVolumeImplFlexible::remapSections(LLFlexibleObjectSection *source, S32 source_sections, 101void LLVolumeImplFlexible::remapSections(LLFlexibleObjectSection *source, S32 source_sections,
109 LLFlexibleObjectSection *dest, S32 dest_sections) 102 LLFlexibleObjectSection *dest, S32 dest_sections)
110{ 103{
111 S32 num_output_sections = 1<<dest_sections; 104 S32 num_output_sections = 1<<dest_sections;
112 LLVector3 scale = mVO->mDrawable->getScale(); 105 LLVector3 scale = mVO->mDrawable->getScale();
113 F32 source_section_length = scale.mV[VZ] / (F32)(1<<source_sections); 106 F32 source_section_length = scale.mV[VZ] / (F32)(1<<source_sections);
@@ -228,6 +221,7 @@ void LLVolumeImplFlexible::setAttributesOfAllSections()
228 221
229 F32 t_inc = 1.f/F32(num_sections); 222 F32 t_inc = 1.f/F32(num_sections);
230 F32 t = t_inc; 223 F32 t = t_inc;
224
231 for ( int i=1; i<= num_sections; i++) 225 for ( int i=1; i<= num_sections; i++)
232 { 226 {
233 mSection[i].mAxisRotation.setQuat(lerp(begin_rot,end_rot,t),0,0,1); 227 mSection[i].mAxisRotation.setQuat(lerp(begin_rot,end_rot,t),0,0,1);
@@ -236,18 +230,17 @@ void LLVolumeImplFlexible::setAttributesOfAllSections()
236 scale.mV[VY] * lerp(bottom_scale.mV[1], top_scale.mV[1], t)); 230 scale.mV[VY] * lerp(bottom_scale.mV[1], top_scale.mV[1], t));
237 t += t_inc; 231 t += t_inc;
238 } 232 }
239 mLastUpdate = 0;
240}//----------------------------------------------------------------------------------- 233}//-----------------------------------------------------------------------------------
241 234
242 235
243void LLVolumeImplFlexible::onSetVolume(const LLVolumeParams &volume_params, const S32 detail) 236void LLVolumeImplFlexible::onSetVolume(const LLVolumeParams &volume_params, const S32 detail)
244{ 237{
245 doIdleUpdate(gAgent, *gWorldp, 0.0); 238 /*doIdleUpdate(gAgent, *gWorldp, 0.0);
246 if (mVO && mVO->mDrawable.notNull()) 239 if (mVO && mVO->mDrawable.notNull())
247 { 240 {
248 gPipeline.markRebuild(mVO->mDrawable, LLDrawable::REBUILD_VOLUME, TRUE); 241 gPipeline.markRebuild(mVO->mDrawable, LLDrawable::REBUILD_VOLUME, TRUE);
249 gPipeline.markMoved(mVO->mDrawable); 242 gPipeline.markMoved(mVO->mDrawable);
250 } 243 }*/
251} 244}
252 245
253//--------------------------------------------------------------------------------- 246//---------------------------------------------------------------------------------
@@ -257,6 +250,13 @@ void LLVolumeImplFlexible::onSetVolume(const LLVolumeParams &volume_params, cons
257//--------------------------------------------------------------------------------- 250//---------------------------------------------------------------------------------
258BOOL LLVolumeImplFlexible::doIdleUpdate(LLAgent &agent, LLWorld &world, const F64 &time) 251BOOL LLVolumeImplFlexible::doIdleUpdate(LLAgent &agent, LLWorld &world, const F64 &time)
259{ 252{
253 if (!gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_FLEXIBLE))
254 {
255 return TRUE;
256 }
257
258 LLFastTimer ftm(LLFastTimer::FTM_FLEXIBLE_UPDATE);
259
260 if (mVO->mDrawable.isNull()) 260 if (mVO->mDrawable.isNull())
261 { 261 {
262 // Don't do anything until we have a drawable 262 // Don't do anything until we have a drawable
@@ -267,46 +267,17 @@ BOOL LLVolumeImplFlexible::doIdleUpdate(LLAgent &agent, LLWorld &world, const F6
267 mVO->mDrawable->mQuietCount = 0; 267 mVO->mDrawable->mQuietCount = 0;
268 if (!mVO->mDrawable->isRoot()) 268 if (!mVO->mDrawable->isRoot())
269 { 269 {
270 mVO->mDrawable->getParent()->mQuietCount = 0; 270 LLViewerObject* parent = (LLViewerObject*) mVO->getParent();
271 parent->mDrawable->mQuietCount = 0;
271 } 272 }
272 273
273 if (((LLVOVolume*)mVO)->mLODChanged || 274 S32 new_res = mAttributes->getSimulateLOD();
274 mVO->mDrawable->isState(LLDrawable::IN_REBUILD_Q1))
275 {
276 mLastUpdate = 0; // Force an immediate update
277 }
278 // Relegate invisible objects to the lowest priority bin
279 S32 lod = 0;
280 F32 app_angle = mVO->getAppAngle()*DEG_TO_RAD/gCamera->getView();
281 if (mVO->mDrawable->isVisible())
282 {
283 sDebugVisible++;
284 if (mVO->isSelected())
285 {
286 // Force selected objects to update *every* frame
287 lod = FLEXIBLE_OBJECT_MAX_LOD-1;
288 }
289 else
290 {
291 if (app_angle > 0)
292 {
293 lod = 5 - (S32)(1.0f/sqrtf(app_angle));
294 if (lod < 1)
295 {
296 lod = 1;
297 }
298 }
299 275
300 if (mVO->isAttachment()) 276 //number of segments only cares about z axis
301 { 277 F32 app_angle = llround((F32) atan2( mVO->getScale().mV[2]*2.f, mVO->mDrawable->mDistanceWRTCamera) * RAD_TO_DEG, 0.01f);
302 lod += 3;
303 }
304 }
305 }
306 278
307 S32 new_res = mAttributes->getSimulateLOD();
308 // Rendering sections increases with visible angle on the screen 279 // Rendering sections increases with visible angle on the screen
309 mRenderRes = (S32)(FLEXIBLE_OBJECT_MAX_SECTIONS*4*app_angle); 280 mRenderRes = (S32)(FLEXIBLE_OBJECT_MAX_SECTIONS*4*app_angle*DEG_TO_RAD/gCamera->getView());
310 if (mRenderRes > FLEXIBLE_OBJECT_MAX_SECTIONS) 281 if (mRenderRes > FLEXIBLE_OBJECT_MAX_SECTIONS)
311 { 282 {
312 mRenderRes = FLEXIBLE_OBJECT_MAX_SECTIONS; 283 mRenderRes = FLEXIBLE_OBJECT_MAX_SECTIONS;
@@ -329,22 +300,32 @@ BOOL LLVolumeImplFlexible::doIdleUpdate(LLAgent &agent, LLWorld &world, const F6
329 mInitialized = TRUE; 300 mInitialized = TRUE;
330 } 301 }
331 302
332 sLODBins[lod].insert(this); 303 if (mVO->mDrawable->isVisible() &&
333 sDebugInserted++; 304 !mVO->mDrawable->isState(LLDrawable::IN_REBUILD_Q1) &&
334 return TRUE; 305 mVO->getPixelArea() > 256.f)
335}
336
337// static
338void LLVolumeImplFlexible::resetUpdateBins()
339{
340 U32 lod;
341 for (lod=0; lod<FLEXIBLE_OBJECT_MAX_LOD; ++lod)
342 { 306 {
343 sLODBins[lod].clear(); 307 U32 id;
308 F32 pixel_area = mVO->getPixelArea();
309
310 if (mVO->isRootEdit())
311 {
312 id = mID;
313 }
314 else
315 {
316 LLVOVolume* parent = (LLVOVolume*) mVO->getParent();
317 id = parent->getVolumeInterfaceID();
318 }
319
320 U32 update_period = (U32) (gCamera->getScreenPixelArea()*0.01f/(pixel_area*(sUpdateFactor+1.f)))+1;
321
322 if ((LLDrawable::getCurrentFrame()+id)%update_period == 0)
323 {
324 gPipeline.markRebuild(mVO->mDrawable, LLDrawable::REBUILD_POSITION, FALSE);
325 }
344 } 326 }
345 ++sCurrentUpdateFrame; 327
346 sDebugInserted = 0; 328 return TRUE;
347 sDebugVisible = 0;
348} 329}
349 330
350inline S32 log2(S32 x) 331inline S32 log2(S32 x)
@@ -358,80 +339,15 @@ inline S32 log2(S32 x)
358 return ret; 339 return ret;
359} 340}
360 341
361// static
362void LLVolumeImplFlexible::doFlexibleUpdateBins()
363{
364 U32 lod;
365 U32 updated = 0;
366 U32 regen = 0;
367 U32 newflexies = 0;
368 F32 time_alloc[FLEXIBLE_OBJECT_MAX_LOD];
369 F32 total_time_alloc = 0;
370
371 bool new_objects_only = false;
372
373 if (!gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_FLEXIBLE))
374 {
375 new_objects_only = true;
376 }
377
378 for (lod=0; lod<FLEXIBLE_OBJECT_MAX_LOD; ++lod)
379 {
380 int count = sLODBins[lod].size();
381 if (count > 0)
382 {
383 time_alloc[lod] = (F32)((lod+1)*(log2(count)));
384 }
385 else
386 {
387 time_alloc[lod] = 0;
388 }
389 total_time_alloc += time_alloc[lod];
390 }
391 total_time_alloc = FLEXIBLE_OBJECT_TIMESLICE * (sUpdateFactor+0.01f) / total_time_alloc;
392
393 {
394 LLFastTimer t(LLFastTimer::FTM_FLEXIBLE_UPDATE);
395 LLTimer timer;
396 for (lod=0; lod<FLEXIBLE_OBJECT_MAX_LOD; ++lod)
397 {
398 LLVolumeImplFlexible::lodset_t::iterator itor = sLODBins[lod].begin();
399 int bin_count = 0;
400 if (!new_objects_only)
401 {
402 timer.reset();
403 double end_time = time_alloc[lod] * total_time_alloc;
404 for (; itor!=sLODBins[lod].end(); ++itor)
405 {
406
407 (*itor)->doFlexibleUpdate();
408 ++updated;
409 (*itor)->doFlexibleRebuild();
410 ++bin_count;
411 ++regen;
412 if (timer.getElapsedTimeF64() > end_time)
413 {
414 break;
415 }
416 }
417 }
418 for (; itor != sLODBins[lod].end(); ++itor)
419 {
420 if ((*itor)->getLastUpdate() == 0)
421 {
422 // *Always* update newly-created objects, or objects which have changed LOD
423 (*itor)->doFlexibleUpdate();
424 (*itor)->doFlexibleRebuild();
425 ++newflexies;
426 }
427 }
428 }
429 }
430}
431
432void LLVolumeImplFlexible::doFlexibleUpdate() 342void LLVolumeImplFlexible::doFlexibleUpdate()
433{ 343{
434 LLPath *path = &mVO->getVolume()->getPath(); 344 LLPath *path = &mVO->getVolume()->getPath();
345 if (mSimulateRes == 0)
346 {
347 mVO->markForUpdate(TRUE);
348 doIdleUpdate(gAgent, *gWorldp, 0.0);
349 }
350
435 S32 num_sections = 1 << mSimulateRes; 351 S32 num_sections = 1 << mSimulateRes;
436 352
437 F32 secondsThisFrame = mTimer.getElapsedTimeAndResetF32(); 353 F32 secondsThisFrame = mTimer.getElapsedTimeAndResetF32();
@@ -603,6 +519,10 @@ void LLVolumeImplFlexible::doFlexibleUpdate()
603 // calculate velocity 519 // calculate velocity
604 //------------------------------------------------------------------------------------------ 520 //------------------------------------------------------------------------------------------
605 mSection[i].mVelocity = mSection[i].mPosition - lastPosition; 521 mSection[i].mVelocity = mSection[i].mPosition - lastPosition;
522 if (mSection[i].mVelocity.magVecSquared() > 1.f)
523 {
524 mSection[i].mVelocity.normVec();
525 }
606 } 526 }
607 527
608 // Calculate derivatives (not necessary until normals are automagically generated) 528 // Calculate derivatives (not necessary until normals are automagically generated)
@@ -643,11 +563,38 @@ void LLVolumeImplFlexible::doFlexibleUpdate()
643 LLFlexibleObjectSection newSection[ (1<<FLEXIBLE_OBJECT_MAX_SECTIONS)+1 ]; 563 LLFlexibleObjectSection newSection[ (1<<FLEXIBLE_OBJECT_MAX_SECTIONS)+1 ];
644 remapSections(mSection, mSimulateRes, newSection, mRenderRes); 564 remapSections(mSection, mSimulateRes, newSection, mRenderRes);
645 565
566 //generate transform from global to prim space
567 LLVector3 delta_scale = LLVector3(1,1,1);
568 LLVector3 delta_pos;
569 LLQuaternion delta_rot;
570
571 delta_rot = ~getFrameRotation();
572 delta_pos = -getFramePosition()*delta_rot;
573
574 // Vertex transform (4x4)
575 LLVector3 x_axis = LLVector3(delta_scale.mV[VX], 0.f, 0.f) * delta_rot;
576 LLVector3 y_axis = LLVector3(0.f, delta_scale.mV[VY], 0.f) * delta_rot;
577 LLVector3 z_axis = LLVector3(0.f, 0.f, delta_scale.mV[VZ]) * delta_rot;
578
579 LLMatrix4 rel_xform;
580 rel_xform.initRows(LLVector4(x_axis, 0.f),
581 LLVector4(y_axis, 0.f),
582 LLVector4(z_axis, 0.f),
583 LLVector4(delta_pos, 1.f));
584
646 for (i=0; i<=num_render_sections; ++i) 585 for (i=0; i<=num_render_sections; ++i)
647 { 586 {
648 new_point = &path->mPath[i]; 587 new_point = &path->mPath[i];
649 new_point->mPos = newSection[i].mPosition; 588 LLVector3 pos = newSection[i].mPosition * rel_xform;
650 new_point->mRot = mSection[i].mAxisRotation * newSection[i].mRotation; 589 LLQuaternion rot = mSection[i].mAxisRotation * newSection[i].mRotation * delta_rot;
590
591 if (!mUpdated || (new_point->mPos-pos).magVecSquared() > 0.000001f)
592 {
593 new_point->mPos = newSection[i].mPosition * rel_xform;
594 mUpdated = FALSE;
595 }
596
597 new_point->mRot = rot;
651 new_point->mScale = newSection[i].mScale; 598 new_point->mScale = newSection[i].mScale;
652 new_point->mTexT = ((F32)i)/(num_render_sections); 599 new_point->mTexT = ((F32)i)/(num_render_sections);
653 } 600 }
@@ -658,13 +605,10 @@ void LLVolumeImplFlexible::doFlexibleUpdate()
658void LLVolumeImplFlexible::doFlexibleRebuild() 605void LLVolumeImplFlexible::doFlexibleRebuild()
659{ 606{
660 mVO->getVolume()->regen(); 607 mVO->getVolume()->regen();
661
662 mVO->markForUpdate(TRUE);
663
664 mUpdated = TRUE; 608 mUpdated = TRUE;
609}
665 610
666 mLastUpdate = sCurrentUpdateFrame; 611//------------------------------------------------------------------
667}//------------------------------------------------------------------
668 612
669void LLVolumeImplFlexible::onSetScale(const LLVector3& scale, BOOL damped) 613void LLVolumeImplFlexible::onSetScale(const LLVector3& scale, BOOL damped)
670{ 614{
@@ -673,8 +617,6 @@ void LLVolumeImplFlexible::onSetScale(const LLVector3& scale, BOOL damped)
673 617
674BOOL LLVolumeImplFlexible::doUpdateGeometry(LLDrawable *drawable) 618BOOL LLVolumeImplFlexible::doUpdateGeometry(LLDrawable *drawable)
675{ 619{
676 BOOL compiled = FALSE;
677
678 LLVOVolume *volume = (LLVOVolume*)mVO; 620 LLVOVolume *volume = (LLVOVolume*)mVO;
679 621
680 if (volume->mDrawable.isNull()) // Not sure why this is happening, but it is... 622 if (volume->mDrawable.isNull()) // Not sure why this is happening, but it is...
@@ -682,60 +624,36 @@ BOOL LLVolumeImplFlexible::doUpdateGeometry(LLDrawable *drawable)
682 return TRUE; // No update to complete 624 return TRUE; // No update to complete
683 } 625 }
684 626
685 volume->calcAllTEsSame(); 627 if (volume->mLODChanged)
686
687 if (volume->mVolumeChanged || volume->mFaceMappingChanged)
688 { 628 {
689 compiled = TRUE; 629 LLVolumeParams volume_params = volume->getVolume()->getParams();
690 volume->regenFaces();
691 }
692 else if (volume->mLODChanged)
693 {
694 LLPointer<LLVolume> old_volumep, new_volumep;
695 F32 old_lod, new_lod;
696
697 old_volumep = volume->getVolume();
698 old_lod = old_volumep->getDetail();
699
700 LLVolumeParams volume_params = volume->getVolume()->getParams();
701 volume->setVolume(volume_params, 0); 630 volume->setVolume(volume_params, 0);
702 doFlexibleUpdate(); 631 mUpdated = FALSE;
703 volume->getVolume()->regen();
704
705 new_volumep = volume->getVolume();
706 new_lod = new_volumep->getDetail();
707
708 if (new_lod != old_lod)
709 {
710 compiled = TRUE;
711 if (new_volumep->getNumFaces() != old_volumep->getNumFaces())
712 {
713 volume->regenFaces();
714 }
715 }
716 } 632 }
717 633
718 if (mUpdated) 634 volume->updateRelativeXform();
635 doFlexibleUpdate();
636
637 if (volume->mLODChanged || volume->mFaceMappingChanged ||
638 volume->mVolumeChanged)
719 { 639 {
720 compiled = TRUE; 640 volume->regenFaces();
721 mUpdated = FALSE; 641 volume->mDrawable->setState(LLDrawable::REBUILD_VOLUME);
722 } 642 }
723 643
724 if(compiled) 644 if (!mUpdated || volume->mFaceMappingChanged || volume->mVolumeChanged)
725 { 645 {
726 volume->updateRelativeXform(isVolumeGlobal()); 646 doFlexibleRebuild();
727 volume->genTriangles(isVolumeGlobal()); 647 volume->genBBoxes(isVolumeGlobal());
728 LLPipeline::sCompiles++;
729 } 648 }
730 649
731 volume->mVolumeChanged = FALSE; 650 volume->mVolumeChanged = FALSE;
732 volume->mLODChanged = FALSE; 651 volume->mLODChanged = FALSE;
733 volume->mFaceMappingChanged = FALSE; 652 volume->mFaceMappingChanged = FALSE;
734 653
654
735 // clear UV flag 655 // clear UV flag
736 drawable->clearState(LLDrawable::UV); 656 drawable->clearState(LLDrawable::UV);
737
738 drawable->movePartition();
739 657
740 return TRUE; 658 return TRUE;
741} 659}
@@ -811,42 +729,32 @@ LLQuaternion LLVolumeImplFlexible::getEndRotation()
811}//------------------------------------------------------------------ 729}//------------------------------------------------------------------
812 730
813 731
814void LLVolumeImplFlexible::updateRelativeXform(BOOL global_volume) 732void LLVolumeImplFlexible::updateRelativeXform()
815{ 733{
816 LLVOVolume* vo = (LLVOVolume*) mVO;
817
818 LLVector3 delta_scale = LLVector3(1,1,1);
819 LLVector3 delta_pos;
820 LLQuaternion delta_rot; 734 LLQuaternion delta_rot;
735 LLVector3 delta_pos, delta_scale;
736 LLVOVolume* vo = (LLVOVolume*) mVO;
737
738 //matrix from local space to parent relative/global space
739 delta_rot = vo->mDrawable->isSpatialRoot() ? LLQuaternion() : vo->mDrawable->getRotation();
740 delta_pos = vo->mDrawable->isSpatialRoot() ? LLVector3(0,0,0) : vo->mDrawable->getPosition();
741 delta_scale = LLVector3(1,1,1);
821 742
822 if (!mVO->mDrawable->isRoot())
823 { //global to parent relative
824 LLViewerObject* parent = (LLViewerObject*) vo->getParent();
825 delta_rot = ~parent->getRenderRotation();
826 delta_pos = -parent->getRenderPosition()*delta_rot;
827 }
828 else
829 { //global to local
830 delta_rot = ~getFrameRotation();
831 delta_pos = -getFramePosition()*delta_rot;
832 }
833
834 // Vertex transform (4x4) 743 // Vertex transform (4x4)
835 LLVector3 x_axis = LLVector3(delta_scale.mV[VX], 0.f, 0.f) * delta_rot; 744 LLVector3 x_axis = LLVector3(delta_scale.mV[VX], 0.f, 0.f) * delta_rot;
836 LLVector3 y_axis = LLVector3(0.f, delta_scale.mV[VY], 0.f) * delta_rot; 745 LLVector3 y_axis = LLVector3(0.f, delta_scale.mV[VY], 0.f) * delta_rot;
837 LLVector3 z_axis = LLVector3(0.f, 0.f, delta_scale.mV[VZ]) * delta_rot; 746 LLVector3 z_axis = LLVector3(0.f, 0.f, delta_scale.mV[VZ]) * delta_rot;
838 747
839 vo->mRelativeXform.initRows(LLVector4(x_axis, 0.f), 748 vo->mRelativeXform.initRows(LLVector4(x_axis, 0.f),
840 LLVector4(y_axis, 0.f), 749 LLVector4(y_axis, 0.f),
841 LLVector4(z_axis, 0.f), 750 LLVector4(z_axis, 0.f),
842 LLVector4(delta_pos, 1.f)); 751 LLVector4(delta_pos, 1.f));
843 752
844 x_axis.normVec(); 753 x_axis.normVec();
845 y_axis.normVec(); 754 y_axis.normVec();
846 z_axis.normVec(); 755 z_axis.normVec();
847 756
848 vo->mRelativeXformInvTrans.setRows(x_axis, y_axis, z_axis); 757 vo->mRelativeXformInvTrans.setRows(x_axis, y_axis, z_axis);
849
850} 758}
851 759
852const LLMatrix4& LLVolumeImplFlexible::getWorldMatrix(LLXformMatrix* xform) const 760const LLMatrix4& LLVolumeImplFlexible::getWorldMatrix(LLXformMatrix* xform) const
diff --git a/linden/indra/newview/llflexibleobject.h b/linden/indra/newview/llflexibleobject.h
index c028adb..9772c57 100644
--- a/linden/indra/newview/llflexibleobject.h
+++ b/linden/indra/newview/llflexibleobject.h
@@ -76,6 +76,7 @@ class LLVolumeImplFlexible : public LLVolumeInterface
76 LLVolumeImplFlexible(LLViewerObject* volume, LLFlexibleObjectData* attributes); 76 LLVolumeImplFlexible(LLViewerObject* volume, LLFlexibleObjectData* attributes);
77 77
78 // Implements LLVolumeInterface 78 // Implements LLVolumeInterface
79 U32 getID() const { return mID; }
79 LLVector3 getFramePosition() const; 80 LLVector3 getFramePosition() const;
80 LLQuaternion getFrameRotation() const; 81 LLQuaternion getFrameRotation() const;
81 LLVolumeInterfaceType getInterfaceType() const { return INTERFACE_FLEXIBLE; } 82 LLVolumeInterfaceType getInterfaceType() const { return INTERFACE_FLEXIBLE; }
@@ -90,12 +91,10 @@ class LLVolumeImplFlexible : public LLVolumeInterface
90 bool isVolumeGlobal() const { return true; } 91 bool isVolumeGlobal() const { return true; }
91 bool isActive() const { return true; } 92 bool isActive() const { return true; }
92 const LLMatrix4& getWorldMatrix(LLXformMatrix* xform) const; 93 const LLMatrix4& getWorldMatrix(LLXformMatrix* xform) const;
93 void updateRelativeXform(BOOL global_volume = FALSE); 94 void updateRelativeXform();
94 void doFlexibleUpdate(); // Called to update the simulation 95 void doFlexibleUpdate(); // Called to update the simulation
95 void doFlexibleRebuild(); // Called to rebuild the geometry 96 void doFlexibleRebuild(); // Called to rebuild the geometry
96 static void resetUpdateBins(); 97
97 static void doFlexibleUpdateBins();
98
99 //void setAttributes( LLFlexibleObjectData ); 98 //void setAttributes( LLFlexibleObjectData );
100 void setParentPositionAndRotationDirectly( LLVector3 p, LLQuaternion r ); 99 void setParentPositionAndRotationDirectly( LLVector3 p, LLQuaternion r );
101 void setUsingCollisionSphere( bool u ); 100 void setUsingCollisionSphere( bool u );
@@ -128,10 +127,7 @@ class LLVolumeImplFlexible : public LLVolumeInterface
128 U32 mFrameNum; 127 U32 mFrameNum;
129 LLVector3 mCollisionSpherePosition; 128 LLVector3 mCollisionSpherePosition;
130 F32 mCollisionSphereRadius; 129 F32 mCollisionSphereRadius;
131 130 U32 mID;
132 U64 mLastUpdate;
133
134 BOOL mJustShifted;
135 131
136 //-------------------------------------- 132 //--------------------------------------
137 // private methods 133 // private methods
@@ -140,29 +136,7 @@ class LLVolumeImplFlexible : public LLVolumeInterface
140 136
141 void remapSections(LLFlexibleObjectSection *source, S32 source_sections, 137 void remapSections(LLFlexibleObjectSection *source, S32 source_sections,
142 LLFlexibleObjectSection *dest, S32 dest_sections); 138 LLFlexibleObjectSection *dest, S32 dest_sections);
143 139
144 U64 getLastUpdate() const { return mLastUpdate; }
145
146 // LOD Bins
147 struct FlexCompare
148 {
149 bool operator()(LLVolumeImplFlexible* a, LLVolumeImplFlexible* b) const
150 {
151 U64 a_update = a->getLastUpdate();
152 U64 b_update = b->getLastUpdate();
153 if (a_update == b_update)
154 {
155 return a < b; // compare pointers
156 }
157 return a_update < b_update;
158 }
159 };
160 typedef std::set<LLVolumeImplFlexible*, FlexCompare> lodset_t;
161 static lodset_t sLODBins[ FLEXIBLE_OBJECT_MAX_LOD ];
162 static U64 sCurrentUpdateFrame;
163 static U32 sDebugInserted;
164 static U32 sDebugVisible;
165
166public: 140public:
167 // Global setting for update rate 141 // Global setting for update rate
168 static F32 sUpdateFactor; 142 static F32 sUpdateFactor;
diff --git a/linden/indra/newview/llfloaterabout.cpp b/linden/indra/newview/llfloaterabout.cpp
index 54168dc..cbac9f3 100644
--- a/linden/indra/newview/llfloaterabout.cpp
+++ b/linden/indra/newview/llfloaterabout.cpp
@@ -45,7 +45,10 @@
45#include "llvieweruictrlfactory.h" 45#include "llvieweruictrlfactory.h"
46#include "viewer.h" // for gViewerDigest 46#include "viewer.h" // for gViewerDigest
47 47
48#if LL_LIBXUL_ENABLED
48#include "llmozlib.h" 49#include "llmozlib.h"
50#endif // LL_LIBXUL_ENABLED
51
49#include "llglheaders.h" 52#include "llglheaders.h"
50 53
51extern LLCPUInfo gSysCPU; 54extern LLCPUInfo gSysCPU;
@@ -98,7 +101,7 @@ LLFloaterAbout::LLFloaterAbout()
98 gAgent.getRegion()->getName().c_str()); 101 gAgent.getRegion()->getName().c_str());
99 support.append(region_text); 102 support.append(region_text);
100 103
101 char buffer[MAX_STRING]; 104 char buffer[MAX_STRING]; /*Flawfinder: ignore*/
102 gAgent.getRegion()->getHost().getHostName(buffer, MAX_STRING); 105 gAgent.getRegion()->getHost().getHostName(buffer, MAX_STRING);
103 support.append(buffer); 106 support.append(buffer);
104 support.append(" ("); 107 support.append(" (");
@@ -154,7 +157,7 @@ LLFloaterAbout::LLFloaterAbout()
154 157
155 // MD5 digest of executable 158 // MD5 digest of executable
156 support.append("Viewer Digest: "); 159 support.append("Viewer Digest: ");
157 char viewer_digest_string[UUID_STR_LENGTH]; 160 char viewer_digest_string[UUID_STR_LENGTH]; /*Flawfinder: ignore*/
158 gViewerDigest.toString( viewer_digest_string ); 161 gViewerDigest.toString( viewer_digest_string );
159 support.append(viewer_digest_string); 162 support.append(viewer_digest_string);
160 163
@@ -182,5 +185,5 @@ void LLFloaterAbout::show(void*)
182 sInstance = new LLFloaterAbout(); 185 sInstance = new LLFloaterAbout();
183 } 186 }
184 187
185 sInstance->open(); 188 sInstance->open(); /*Flawfinder: ignore*/
186} 189}
diff --git a/linden/indra/newview/llfloateraccounthistory.cpp b/linden/indra/newview/llfloateraccounthistory.cpp
deleted file mode 100644
index a28c4c3..0000000
--- a/linden/indra/newview/llfloateraccounthistory.cpp
+++ /dev/null
@@ -1,224 +0,0 @@
1/**
2 * @file llfloateraccounthistory.cpp
3 * @brief LLFloaterAccountHistory class implementation
4 *
5 * Copyright (c) 2003-2007, Linden Research, Inc.
6 *
7 * The source code in this file ("Source Code") is provided by Linden Lab
8 * to you under the terms of the GNU General Public License, version 2.0
9 * ("GPL"), unless you have obtained a separate licensing agreement
10 * ("Other License"), formally executed by you and Linden Lab. Terms of
11 * the GPL can be found in doc/GPL-license.txt in this distribution, or
12 * online at http://secondlife.com/developers/opensource/gplv2
13 *
14 * There are special exceptions to the terms and conditions of the GPL as
15 * it is applied to this Source Code. View the full text of the exception
16 * in the file doc/FLOSS-exception.txt in this software distribution, or
17 * online at http://secondlife.com/developers/opensource/flossexception
18 *
19 * By copying, modifying or distributing this software, you acknowledge
20 * that you have read and understood your obligations described above,
21 * and agree to abide by those obligations.
22 *
23 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
24 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
25 * COMPLETENESS OR PERFORMANCE.
26 */
27
28/**
29 * The user's account history, including all Linden$ transactions from
30 * the transaction table.
31 */
32
33#include "llviewerprecompiledheaders.h"
34
35#include "llfloateraccounthistory.h"
36
37#include "llfontgl.h"
38#include "message.h"
39#include "llsecondlifeurls.h"
40#include "lltransactiontypes.h"
41
42#include "llagent.h"
43#include "llalertdialog.h"
44#include "llpanel.h"
45#include "llbutton.h"
46#include "llviewercontrol.h"
47#include "llviewertexteditor.h"
48#include "lluiconstants.h"
49#include "llresizehandle.h"
50#include "llstatusbar.h"
51#include "lltabcontainervertical.h"
52#include "llvieweruictrlfactory.h"
53#include "llviewerwindow.h"
54#include "llweb.h"
55
56static const char MONEY_HX_TITLE[] = "Account History";
57static const S32 MONEY_HX_WIDTH = 500;
58static const S32 MONEY_HX_HEIGHT = 350;
59static const S32 INSET = 4;
60
61
62LLMap<LLUUID, LLFloaterAccountHistory*> LLFloaterAccountHistory::sInstances;
63
64
65
66
67//---------------------------------------------------------------------------
68// LLFloaterAccountHistory
69// The container panel for all the panel views.
70//---------------------------------------------------------------------------
71// private
72LLFloaterAccountHistory::LLFloaterAccountHistory()
73: LLFloater("money history floater")
74{
75 // Unique ID for transactions
76 mFloaterID.generate();
77
78 // Instance management
79 LLFloaterAccountHistory::sInstances.addData(mFloaterID, this);
80
81 // User interface construction
82 gUICtrlFactory->buildFloater(this, "floater_account_history.xml");
83 center();
84
85 // Put resize handle on top
86 removeChild(mResizeHandle[0]);
87 addChild(mResizeHandle[0]);
88
89 LLTabContainerCommon* tab = LLUICtrlFactory::getTabContainerByName(this, "tab");
90 if (tab)
91 {
92 mPlanningPanel = new LLPanelAccountPlanning(mFloaterID);
93 tab->addTabPanel( mPlanningPanel, "Planning" );
94
95 mDetailsPanel = new LLPanelAccountDetails(mFloaterID);
96 tab->addTabPanel( mDetailsPanel, "Details" );
97
98 mTransactionsPanel = new LLPanelAccountTransactions(mFloaterID);
99 tab->addTabPanel( mTransactionsPanel, "Sales/Gifts" );
100
101 tab->selectFirstTab();
102 }
103
104 LLButton* btn = LLUICtrlFactory::getButtonByName(this, "details_btn");
105 if (btn) btn->setClickedCallback(onClickDetails, this);
106}
107
108
109// private virtual
110LLFloaterAccountHistory::~LLFloaterAccountHistory()
111{
112 LLFloaterAccountHistory::sInstances.removeData(mFloaterID);
113}
114
115
116// public static
117void LLFloaterAccountHistory::show(void*)
118{
119 // Make sure the mouse is available for clicking
120 if( gAgent.cameraMouselook() )
121 {
122 gAgent.changeCameraToDefault();
123 }
124
125 // Create the dialog and center on screen
126 // This will show a default "computing..." message
127 new LLFloaterAccountHistory();
128}
129
130// static
131void LLFloaterAccountHistory::processMoneySummaryReply(LLMessageSystem* msg, void** data)
132{
133 LLUUID agent_id;
134 LLUUID floater_id;
135
136 msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_AgentID, agent_id );
137 msg->getUUIDFast(_PREHASH_MoneyData, _PREHASH_RequestID, floater_id );
138
139 if (agent_id != gAgent.getID())
140 {
141 llwarns << "Received money summary for wrong agent " << agent_id << llendl;
142 return;
143 }
144
145 LLFloaterAccountHistory* floater = LLFloaterAccountHistory::sInstances.getIfThere(floater_id);
146 if (!floater)
147 {
148 llwarns << "Received money summary for unknown window " << floater_id << llendl;
149 return;
150 }
151
152 floater->open();
153 floater->mPlanningPanel->processReply(msg, data);
154}
155
156// static
157void LLFloaterAccountHistory::processMoneyDetailsReply(LLMessageSystem* msg, void** data)
158{
159 LLUUID agent_id;
160 LLUUID floater_id;
161
162 msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_AgentID, agent_id );
163 msg->getUUIDFast(_PREHASH_MoneyData, _PREHASH_RequestID, floater_id );
164
165 if (agent_id != gAgent.getID())
166 {
167 llwarns << "Received money details for wrong agent " << agent_id << llendl;
168 return;
169 }
170
171 LLFloaterAccountHistory* floater = LLFloaterAccountHistory::sInstances.getIfThere(floater_id);
172 if (!floater)
173 {
174 llwarns << "Received money details for unknown window " << floater_id << llendl;
175 return;
176 }
177
178 floater->open();
179
180 floater->mDetailsPanel->processReply(msg, data);
181}
182
183// static
184void LLFloaterAccountHistory::processMoneyTransactionsReply(LLMessageSystem* msg, void** data)
185{
186 LLUUID agent_id;
187 LLUUID floater_id;
188
189 msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_AgentID, agent_id );
190 msg->getUUIDFast(_PREHASH_MoneyData, _PREHASH_RequestID, floater_id );
191
192 if (agent_id != gAgent.getID())
193 {
194 llwarns << "Received money transactions for wrong agent " << agent_id << llendl;
195 return;
196 }
197
198 LLFloaterAccountHistory* floater = LLFloaterAccountHistory::sInstances.getIfThere(floater_id);
199 if (!floater)
200 {
201 llwarns << "Received money transactions for unknown window " << floater_id << llendl;
202 return;
203 }
204
205 floater->open();
206 floater->mTransactionsPanel->processReply(msg, data);
207}
208
209void callback_load_url_account_transactions(S32 option, void*)
210{
211 if (option == 0)
212 {
213 LLWeb::loadURL(ACCOUNT_TRANSACTIONS_URL);
214 }
215}
216
217// static
218void LLFloaterAccountHistory::onClickDetails(void*)
219{
220 std::map<std::string,std::string> args;
221 args["[URL]"] = ACCOUNT_TRANSACTIONS_URL;
222 gViewerWindow->alertXml("LoadAccountTransactions", args,
223 callback_load_url_account_transactions, NULL);
224}
diff --git a/linden/indra/newview/llfloateraccounthistory.h b/linden/indra/newview/llfloateraccounthistory.h
deleted file mode 100644
index ae4ae24..0000000
--- a/linden/indra/newview/llfloateraccounthistory.h
+++ /dev/null
@@ -1,83 +0,0 @@
1/**
2 * @file llfloateraccounthistory.h
3 * @brief LLFloaterAccountHistory class definition
4 *
5 * Copyright (c) 2003-2007, Linden Research, Inc.
6 *
7 * The source code in this file ("Source Code") is provided by Linden Lab
8 * to you under the terms of the GNU General Public License, version 2.0
9 * ("GPL"), unless you have obtained a separate licensing agreement
10 * ("Other License"), formally executed by you and Linden Lab. Terms of
11 * the GPL can be found in doc/GPL-license.txt in this distribution, or
12 * online at http://secondlife.com/developers/opensource/gplv2
13 *
14 * There are special exceptions to the terms and conditions of the GPL as
15 * it is applied to this Source Code. View the full text of the exception
16 * in the file doc/FLOSS-exception.txt in this software distribution, or
17 * online at http://secondlife.com/developers/opensource/flossexception
18 *
19 * By copying, modifying or distributing this software, you acknowledge
20 * that you have read and understood your obligations described above,
21 * and agree to abide by those obligations.
22 *
23 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
24 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
25 * COMPLETENESS OR PERFORMANCE.
26 */
27
28/**
29 * The user's account history, including all Linden$ transactions from
30 * the transaction table.
31 */
32
33#ifndef LL_LLFLOATERACCOUNTHISTORY_H
34#define LL_LLFLOATERACCOUNTHISTORY_H
35
36#include "llfloater.h"
37#include "llmap.h"
38#include "lluuid.h"
39#include "llpanelmoney.h"
40
41class LLMessageSystem;
42class LLTabContainer;
43class LLTabContainerVertical;
44class LLTextEditor;
45class LLButton;
46
47class LLFloaterAccountHistory
48: public LLFloater
49{
50public:
51 static void show(void*);
52
53 // Message system callbacks
54 static void processMoneySummaryReply(LLMessageSystem* msg, void**);
55 static void processMoneyDetailsReply(LLMessageSystem* msg, void**);
56 static void processMoneyTransactionsReply(LLMessageSystem* msg, void**);
57
58private:
59 // Must construct by calling show().
60 LLFloaterAccountHistory();
61 virtual ~LLFloaterAccountHistory();
62
63 static void onClickDetails(void*);
64
65private:
66 // Each money history window has its own id, which it uses
67 // for transactions and to allow more than one window to
68 // be open.
69 LLUUID mFloaterID;
70
71 // The actual information is encoded in panels in this
72 // tab container.
73 LLTabContainerVertical* mTab;
74
75 LLPanelAccountPlanning* mPlanningPanel;
76 LLPanelAccountDetails* mDetailsPanel;
77 LLPanelAccountTransactions* mTransactionsPanel;
78 LLButton* mBtnDetails;
79
80 static LLMap<LLUUID, LLFloaterAccountHistory*> sInstances;
81};
82
83#endif
diff --git a/linden/indra/newview/llfloateranimpreview.cpp b/linden/indra/newview/llfloateranimpreview.cpp
index ced7a0e..3661ea2 100644
--- a/linden/indra/newview/llfloateranimpreview.cpp
+++ b/linden/indra/newview/llfloateranimpreview.cpp
@@ -280,8 +280,8 @@ BOOL LLFloaterAnimPreview::postBuild()
280 childSetValue("ease_in_time", LLSD(motionp->getEaseInDuration())); 280 childSetValue("ease_in_time", LLSD(motionp->getEaseInDuration()));
281 childSetValue("ease_out_time", LLSD(motionp->getEaseOutDuration())); 281 childSetValue("ease_out_time", LLSD(motionp->getEaseOutDuration()));
282 mEnabled = TRUE; 282 mEnabled = TRUE;
283 char seconds_string[128]; 283 char seconds_string[128]; /*Flawfinder: ignore*/
284 sprintf(seconds_string, " - %.2f seconds", motionp->getDuration()); 284 snprintf(seconds_string, sizeof(seconds_string), " - %.2f seconds", motionp->getDuration()); /*Flawfinder: ignore*/
285 285
286 setTitle(mFilename + LLString(seconds_string)); 286 setTitle(mFilename + LLString(seconds_string));
287 } 287 }
@@ -301,9 +301,9 @@ BOOL LLFloaterAnimPreview::postBuild()
301 { 301 {
302 if (loaderp->getDuration() > MAX_ANIM_DURATION) 302 if (loaderp->getDuration() > MAX_ANIM_DURATION)
303 { 303 {
304 char output_str[256]; 304 char output_str[256]; /*Flawfinder: ignore*/
305 305
306 sprintf(output_str, "Animation file is %.1f seconds in length.\n\nMaximum animation length is %.1f seconds.\n", 306 snprintf(output_str, sizeof(output_str), "Animation file is %.1f seconds in length.\n\nMaximum animation length is %.1f seconds.\n", /*Flawfinder: ignore*/
307 loaderp->getDuration(), MAX_ANIM_DURATION); 307 loaderp->getDuration(), MAX_ANIM_DURATION);
308 childSetValue("bad_animation_text", LLSD(output_str)); 308 childSetValue("bad_animation_text", LLSD(output_str));
309 } 309 }
@@ -1016,7 +1016,7 @@ LLPreviewAnimation::LLPreviewAnimation(S32 width, S32 height) : LLDynamicTexture
1016 mDummyAvatar->updateGeometry(mDummyAvatar->mDrawable); 1016 mDummyAvatar->updateGeometry(mDummyAvatar->mDrawable);
1017 mDummyAvatar->startMotion(ANIM_AGENT_STAND, 5.f); 1017 mDummyAvatar->startMotion(ANIM_AGENT_STAND, 5.f);
1018 mDummyAvatar->mSkirtLOD.setVisible(FALSE, TRUE); 1018 mDummyAvatar->mSkirtLOD.setVisible(FALSE, TRUE);
1019 gPipeline.markVisible(mDummyAvatar->mDrawable); 1019 gPipeline.markVisible(mDummyAvatar->mDrawable, *gCamera);
1020 1020
1021 // stop extraneous animations 1021 // stop extraneous animations
1022 mDummyAvatar->stopMotion( ANIM_AGENT_HEAD_ROT, TRUE ); 1022 mDummyAvatar->stopMotion( ANIM_AGENT_HEAD_ROT, TRUE );
@@ -1092,6 +1092,10 @@ BOOL LLPreviewAnimation::render()
1092 avatarp->updateMotion(); 1092 avatarp->updateMotion();
1093 } 1093 }
1094 1094
1095 LLVertexBuffer::stopRender();
1096 avatarp->updateLOD();
1097 LLVertexBuffer::startRender();
1098
1095 avatarp->mRoot.updateWorldMatrixChildren(); 1099 avatarp->mRoot.updateWorldMatrixChildren();
1096 1100
1097 stop_glerror(); 1101 stop_glerror();
@@ -1101,13 +1105,7 @@ BOOL LLPreviewAnimation::render()
1101 if (avatarp->mDrawable.notNull()) 1105 if (avatarp->mDrawable.notNull())
1102 { 1106 {
1103 LLDrawPoolAvatar *avatarPoolp = (LLDrawPoolAvatar *)avatarp->mDrawable->getFace(0)->getPool(); 1107 LLDrawPoolAvatar *avatarPoolp = (LLDrawPoolAvatar *)avatarp->mDrawable->getFace(0)->getPool();
1104 gPipeline.unbindAGP(); 1108 avatarPoolp->renderAvatars(avatarp); // renders only one avatar
1105 avatarPoolp->syncAGP();
1106 if (avatarPoolp->canUseAGP() && gPipeline.usingAGP())
1107 {
1108 gPipeline.bindAGP();
1109 }
1110 avatarPoolp->renderAvatars(avatarp, TRUE); // renders only one avatar (no shaders)
1111 } 1109 }
1112 1110
1113 return TRUE; 1111 return TRUE;
diff --git a/linden/indra/newview/llfloaterauction.cpp b/linden/indra/newview/llfloaterauction.cpp
index db169a8..8e7124a 100644
--- a/linden/indra/newview/llfloaterauction.cpp
+++ b/linden/indra/newview/llfloaterauction.cpp
@@ -102,26 +102,27 @@ void LLFloaterAuction::show()
102 sInstance->setFocus(TRUE); 102 sInstance->setFocus(TRUE);
103 } 103 }
104 sInstance->initialize(); 104 sInstance->initialize();
105 sInstance->open(); 105 sInstance->open(); /*Flawfinder: ignore*/
106} 106}
107 107
108void LLFloaterAuction::initialize() 108void LLFloaterAuction::initialize()
109{ 109{
110 LLParcel* parcel = gParcelMgr->getSelectedParcel(); 110 mParcelp = gParcelMgr->getParcelSelection();
111 LLViewerRegion* region = gParcelMgr->getSelectionRegion(); 111 LLViewerRegion* region = gParcelMgr->getSelectionRegion();
112 if(parcel && region && !parcel->getForSale()) 112 LLParcel* parcelp = mParcelp->getParcel();
113 if(parcelp && region && !parcelp->getForSale())
113 { 114 {
114 mParcelHost = region->getHost(); 115 mParcelHost = region->getHost();
115 mParcelID = parcel->getLocalID(); 116 mParcelID = parcelp->getLocalID();
116 117
117 childSetText("parcel_text", parcel->getName()); 118 childSetText("parcel_text", parcelp->getName());
118 childEnable("snapshot_btn"); 119 childEnable("snapshot_btn");
119 childEnable("ok_btn"); 120 childEnable("ok_btn");
120 } 121 }
121 else 122 else
122 { 123 {
123 mParcelHost.invalidate(); 124 mParcelHost.invalidate();
124 if(parcel && parcel->getForSale()) 125 if(parcelp && parcelp->getForSale())
125 { 126 {
126 childSetText("parcel_text", childGetText("already for sale")); 127 childSetText("parcel_text", childGetText("already for sale"));
127 } 128 }
diff --git a/linden/indra/newview/llfloaterauction.h b/linden/indra/newview/llfloaterauction.h
index e9d9c65..7ff932f 100644
--- a/linden/indra/newview/llfloaterauction.h
+++ b/linden/indra/newview/llfloaterauction.h
@@ -39,6 +39,7 @@
39// 39//
40// Class which holds the functionality to start auctions. 40// Class which holds the functionality to start auctions.
41//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 41//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
42class LLParcelSelection;
42 43
43class LLFloaterAuction : public LLFloater 44class LLFloaterAuction : public LLFloater
44{ 45{
@@ -64,6 +65,7 @@ private:
64 LLTransactionID mTransactionID; 65 LLTransactionID mTransactionID;
65 LLAssetID mImageID; 66 LLAssetID mImageID;
66 LLPointer<LLImageGL> mImage; 67 LLPointer<LLImageGL> mImage;
68 LLHandle<LLParcelSelection> mParcelp;
67 S32 mParcelID; 69 S32 mParcelID;
68 LLHost mParcelHost; 70 LLHost mParcelHost;
69}; 71};
diff --git a/linden/indra/newview/llfloateravatarinfo.cpp b/linden/indra/newview/llfloateravatarinfo.cpp
index 959967a..ef34542 100644
--- a/linden/indra/newview/llfloateravatarinfo.cpp
+++ b/linden/indra/newview/llfloateravatarinfo.cpp
@@ -104,17 +104,8 @@ void* LLFloaterAvatarInfo::createPanelAvatar(void* data)
104//---------------------------------------------------------------------------- 104//----------------------------------------------------------------------------
105 105
106 106
107// static
108void LLFloaterAvatarInfo::onCommitNotes(LLUICtrl*, void* userdata)
109{
110 LLFloaterAvatarInfo* self = (LLFloaterAvatarInfo*)userdata;
111
112 self->mPanelAvatarp->sendAvatarNotesUpdate();
113}
114
115BOOL LLFloaterAvatarInfo::postBuild() 107BOOL LLFloaterAvatarInfo::postBuild()
116{ 108{
117
118 return TRUE; 109 return TRUE;
119} 110}
120 111
@@ -164,7 +155,9 @@ void LLFloaterAvatarInfo::resetGroupList()
164 155
165// Open profile to a certian tab. 156// Open profile to a certian tab.
166// static 157// static
167void LLFloaterAvatarInfo::showFromObject(const LLUUID &avatar_id, std::string tab_name) 158void LLFloaterAvatarInfo::showFromObject(
159 const LLUUID& avatar_id,
160 std::string tab_name)
168{ 161{
169 if(avatar_id.isNull()) 162 if(avatar_id.isNull())
170 { 163 {
@@ -185,9 +178,8 @@ void LLFloaterAvatarInfo::showFromObject(const LLUUID &avatar_id, std::string ta
185 floater->mPanelAvatarp->setAvatarID(avatar_id, "", ONLINE_STATUS_NO); 178 floater->mPanelAvatarp->setAvatarID(avatar_id, "", ONLINE_STATUS_NO);
186 179
187 } 180 }
188
189 floater->mPanelAvatarp->selectTabByName(tab_name); 181 floater->mPanelAvatarp->selectTabByName(tab_name);
190 floater->open(); 182 floater->open(); /*Flawfinder: ignore*/
191} 183}
192 184
193// static 185// static
@@ -203,7 +195,7 @@ void LLFloaterAvatarInfo::showFromDirectory(const LLUUID &avatar_id)
203 { 195 {
204 // ...bring that window to front 196 // ...bring that window to front
205 floater = gAvatarInfoInstances.getData(avatar_id); 197 floater = gAvatarInfoInstances.getData(avatar_id);
206 floater->open(); 198 floater->open(); /*Flawfinder: ignore*/
207 } 199 }
208 else 200 else
209 { 201 {
@@ -211,7 +203,7 @@ void LLFloaterAvatarInfo::showFromDirectory(const LLUUID &avatar_id)
211 avatar_id); 203 avatar_id);
212 floater->center(); 204 floater->center();
213 floater->mPanelAvatarp->setAvatarID(avatar_id, "", ONLINE_STATUS_NO); 205 floater->mPanelAvatarp->setAvatarID(avatar_id, "", ONLINE_STATUS_NO);
214 floater->open(); 206 floater->open(); /*Flawfinder: ignore*/
215 } 207 }
216 if(floater) 208 if(floater)
217 { 209 {
@@ -227,14 +219,14 @@ void LLFloaterAvatarInfo::showFromAvatar(LLViewerObject *avatar)
227 { 219 {
228 // ...bring that window to front 220 // ...bring that window to front
229 LLFloaterAvatarInfo *f = gAvatarInfoInstances.getData(avatar->getID()); 221 LLFloaterAvatarInfo *f = gAvatarInfoInstances.getData(avatar->getID());
230 f->open(); 222 f->open(); /*Flawfinder: ignore*/
231 } 223 }
232 else 224 else
233 { 225 {
234 LLFloaterAvatarInfo *floater = new LLFloaterAvatarInfo("avatarinfo", FAI_RECT, 226 LLFloaterAvatarInfo *floater = new LLFloaterAvatarInfo("avatarinfo", FAI_RECT,
235 avatar->getID() ); 227 avatar->getID() );
236 floater->center(); 228 floater->center();
237 floater->open(); 229 floater->open(); /*Flawfinder: ignore*/
238 } 230 }
239} 231}
240 232
@@ -250,7 +242,7 @@ void LLFloaterAvatarInfo::showFromFriend(const LLUUID& agent_id, BOOL online)
250 { 242 {
251 // ...bring that window to front 243 // ...bring that window to front
252 LLFloaterAvatarInfo *f = gAvatarInfoInstances.getData( agent_id ); 244 LLFloaterAvatarInfo *f = gAvatarInfoInstances.getData( agent_id );
253 f->open(); 245 f->open(); /*Flawfinder: ignore*/
254 } 246 }
255 else 247 else
256 { 248 {
diff --git a/linden/indra/newview/llfloateravatarinfo.h b/linden/indra/newview/llfloateravatarinfo.h
index ee7cebb..4879309 100644
--- a/linden/indra/newview/llfloateravatarinfo.h
+++ b/linden/indra/newview/llfloateravatarinfo.h
@@ -62,8 +62,6 @@ public:
62 static void* createPanelAvatar(void* data); 62 static void* createPanelAvatar(void* data);
63 63
64 virtual BOOL postBuild(); 64 virtual BOOL postBuild();
65 static void onCommitNotes(LLUICtrl*, void* userdata);
66
67 65
68 LLFloaterAvatarInfo(const std::string& name, const LLRect &rect, const LLUUID &avatar_id ); 66 LLFloaterAvatarInfo(const std::string& name, const LLRect &rect, const LLUUID &avatar_id );
69 /*virtual*/ ~LLFloaterAvatarInfo(); 67 /*virtual*/ ~LLFloaterAvatarInfo();
diff --git a/linden/indra/newview/llfloateravatarpicker.cpp b/linden/indra/newview/llfloateravatarpicker.cpp
index c95ac6b..cb9af67 100644
--- a/linden/indra/newview/llfloateravatarpicker.cpp
+++ b/linden/indra/newview/llfloateravatarpicker.cpp
@@ -61,13 +61,13 @@ LLFloaterAvatarPicker* LLFloaterAvatarPicker::show(callback_t callback,
61 sInstance->mCallbackUserdata = userdata; 61 sInstance->mCallbackUserdata = userdata;
62 sInstance->mCloseOnSelect = FALSE; 62 sInstance->mCloseOnSelect = FALSE;
63 63
64 sInstance->open(); 64 sInstance->open(); /* Flawfinder: ignore */
65 sInstance->center(); 65 sInstance->center();
66 sInstance->setAllowMultiple(allow_multiple); 66 sInstance->setAllowMultiple(allow_multiple);
67 } 67 }
68 else 68 else
69 { 69 {
70 sInstance->open(); 70 sInstance->open(); /*Flawfinder: ignore*/
71 sInstance->mCallback = callback; 71 sInstance->mCallback = callback;
72 sInstance->mCallbackUserdata = userdata; 72 sInstance->mCallbackUserdata = userdata;
73 sInstance->setAllowMultiple(allow_multiple); 73 sInstance->setAllowMultiple(allow_multiple);
@@ -285,8 +285,8 @@ void LLFloaterAvatarPicker::processAvatarPickerReply(LLMessageSystem* msg, void*
285 LLUUID agent_id; 285 LLUUID agent_id;
286 LLUUID query_id; 286 LLUUID query_id;
287 LLUUID avatar_id; 287 LLUUID avatar_id;
288 char first_name[DB_FIRST_NAME_BUF_SIZE]; 288 char first_name[DB_FIRST_NAME_BUF_SIZE]; /*Flawfinder: ignore*/
289 char last_name[DB_LAST_NAME_BUF_SIZE]; 289 char last_name[DB_LAST_NAME_BUF_SIZE]; /*Flawfinder: ignore*/
290 290
291 msg->getUUID("AgentData", "AgentID", agent_id); 291 msg->getUUID("AgentData", "AgentID", agent_id);
292 msg->getUUID("AgentData", "QueryID", query_id); 292 msg->getUUID("AgentData", "QueryID", query_id);
diff --git a/linden/indra/newview/llfloateravatartextures.cpp b/linden/indra/newview/llfloateravatartextures.cpp
index 8ff65ab..d7d7dfc 100644
--- a/linden/indra/newview/llfloateravatartextures.cpp
+++ b/linden/indra/newview/llfloateravatartextures.cpp
@@ -54,7 +54,7 @@ LLFloaterAvatarTextures* LLFloaterAvatarTextures::show(const LLUUID &id)
54 gUICtrlFactory->buildFloater(floaterp, "floater_avatar_textures.xml"); 54 gUICtrlFactory->buildFloater(floaterp, "floater_avatar_textures.xml");
55 55
56 gFloaterView->addChild(floaterp); 56 gFloaterView->addChild(floaterp);
57 floaterp->open(); 57 floaterp->open(); /*Flawfinder: ignore*/
58 58
59 gFloaterView->adjustToFitScreen(floaterp, FALSE); 59 gFloaterView->adjustToFitScreen(floaterp, FALSE);
60 60
@@ -110,7 +110,7 @@ static void update_texture_ctrl(LLVOAvatar* avatarp,
110 else 110 else
111 { 111 {
112 ctrl->setImageAssetID(id); 112 ctrl->setImageAssetID(id);
113 ctrl->setToolTip(id.getString()); 113 ctrl->setToolTip(id.asString());
114 } 114 }
115} 115}
116 116
@@ -138,8 +138,8 @@ void LLFloaterAvatarTextures::refresh()
138 LLVOAvatar *avatarp = find_avatar(mID); 138 LLVOAvatar *avatarp = find_avatar(mID);
139 if (avatarp) 139 if (avatarp)
140 { 140 {
141 char firstname[DB_FIRST_NAME_BUF_SIZE]; 141 char firstname[DB_FIRST_NAME_BUF_SIZE]; /*Flawfinder: ignore*/
142 char lastname[DB_LAST_NAME_BUF_SIZE]; 142 char lastname[DB_LAST_NAME_BUF_SIZE]; /*Flawfinder: ignore*/
143 if (gCacheName->getName(avatarp->getID(), firstname, lastname)) 143 if (gCacheName->getName(avatarp->getID(), firstname, lastname))
144 { 144 {
145 LLString name; 145 LLString name;
@@ -175,7 +175,7 @@ void LLFloaterAvatarTextures::refresh()
175 } 175 }
176 else 176 else
177 { 177 {
178 setTitle(mTitle + ": INVALID AVATAR (" + mID.getString() + ")"); 178 setTitle(mTitle + ": INVALID AVATAR (" + mID.asString() + ")");
179 } 179 }
180#endif 180#endif
181} 181}
diff --git a/linden/indra/newview/llfloaterbuildoptions.cpp b/linden/indra/newview/llfloaterbuildoptions.cpp
index f93483a..be5cd4e 100644
--- a/linden/indra/newview/llfloaterbuildoptions.cpp
+++ b/linden/indra/newview/llfloaterbuildoptions.cpp
@@ -69,14 +69,14 @@ void LLFloaterBuildOptions::show(void*)
69{ 69{
70 if (sInstance) 70 if (sInstance)
71 { 71 {
72 sInstance->open(); 72 sInstance->open(); /*Flawfinder: ignore*/
73 } 73 }
74 else 74 else
75 { 75 {
76 LLFloaterBuildOptions* floater = new LLFloaterBuildOptions(); 76 LLFloaterBuildOptions* floater = new LLFloaterBuildOptions();
77 77
78 gUICtrlFactory->buildFloater(floater, "floater_build_options.xml"); 78 gUICtrlFactory->buildFloater(floater, "floater_build_options.xml");
79 floater->open(); 79 floater->open(); /*Flawfinder: ignore*/
80 } 80 }
81} 81}
82 82
diff --git a/linden/indra/newview/llfloaterbump.cpp b/linden/indra/newview/llfloaterbump.cpp
index 265970f..ead50e8 100644
--- a/linden/indra/newview/llfloaterbump.cpp
+++ b/linden/indra/newview/llfloaterbump.cpp
@@ -96,7 +96,7 @@ void LLFloaterBump::show(void *contents)
96 } 96 }
97 } 97 }
98 98
99 sInstance->open(); 99 sInstance->open(); /*Flawfinder: ignore*/
100} 100}
101 101
102void LLFloaterBump::add(LLScrollListCtrl* list, LLMeanCollisionData* mcd) 102void LLFloaterBump::add(LLScrollListCtrl* list, LLMeanCollisionData* mcd)
diff --git a/linden/indra/newview/llfloaterbuy.cpp b/linden/indra/newview/llfloaterbuy.cpp
index 04b56bf..2266845 100644
--- a/linden/indra/newview/llfloaterbuy.cpp
+++ b/linden/indra/newview/llfloaterbuy.cpp
@@ -63,8 +63,6 @@ LLFloaterBuy::LLFloaterBuy()
63 63
64LLFloaterBuy::~LLFloaterBuy() 64LLFloaterBuy::~LLFloaterBuy()
65{ 65{
66 gSelectMgr->deselectAll();
67
68 sInstance = NULL; 66 sInstance = NULL;
69} 67}
70 68
@@ -80,7 +78,9 @@ void LLFloaterBuy::reset()
80// static 78// static
81void LLFloaterBuy::show(const LLSaleInfo& sale_info) 79void LLFloaterBuy::show(const LLSaleInfo& sale_info)
82{ 80{
83 if (gSelectMgr->getRootObjectCount() != 1) 81 LLObjectSelectionHandle selection = gSelectMgr->getSelection();
82
83 if (selection->getRootObjectCount() != 1)
84 { 84 {
85 gViewerWindow->alertXml("BuyOneObjectOnly"); 85 gViewerWindow->alertXml("BuyOneObjectOnly");
86 return; 86 return;
@@ -97,9 +97,10 @@ void LLFloaterBuy::show(const LLSaleInfo& sale_info)
97 sInstance = new LLFloaterBuy(); 97 sInstance = new LLFloaterBuy();
98 } 98 }
99 99
100 sInstance->open(); 100 sInstance->open(); /*Flawfinder: ignore*/
101 sInstance->setFocus(TRUE); 101 sInstance->setFocus(TRUE);
102 sInstance->mSaleInfo = sale_info; 102 sInstance->mSaleInfo = sale_info;
103 sInstance->mObjectSelection = gSelectMgr->getEditSelection();
103 104
104 // Always center the dialog. User can change the size, 105 // Always center the dialog. User can change the size,
105 // but purchases are important and should be center screen. 106 // but purchases are important and should be center screen.
@@ -107,7 +108,7 @@ void LLFloaterBuy::show(const LLSaleInfo& sale_info)
107 // mid-session and the saved rect is off-center. 108 // mid-session and the saved rect is off-center.
108 sInstance->center(); 109 sInstance->center();
109 110
110 LLSelectNode* node = gSelectMgr->getFirstRootNode(); 111 LLSelectNode* node = selection->getFirstRootNode();
111 if (!node) return; 112 if (!node) return;
112 113
113 // Set title based on sale type 114 // Set title based on sale type
@@ -181,7 +182,7 @@ void LLFloaterBuy::show(const LLSaleInfo& sale_info)
181 // Must do this after the floater is created, because 182 // Must do this after the floater is created, because
182 // sometimes the inventory is already there and 183 // sometimes the inventory is already there and
183 // the callback is called immediately. 184 // the callback is called immediately.
184 LLViewerObject* obj = gSelectMgr->getFirstRootObject(); 185 LLViewerObject* obj = selection->getFirstRootObject();
185 sInstance->registerVOInventoryListener(obj,NULL); 186 sInstance->registerVOInventoryListener(obj,NULL);
186 sInstance->requestVOInventory(); 187 sInstance->requestVOInventory();
187} 188}
diff --git a/linden/indra/newview/llfloaterbuy.h b/linden/indra/newview/llfloaterbuy.h
index fd1ffd2..1642aaa 100644
--- a/linden/indra/newview/llfloaterbuy.h
+++ b/linden/indra/newview/llfloaterbuy.h
@@ -41,6 +41,7 @@
41 41
42class LLViewerObject; 42class LLViewerObject;
43class LLSaleInfo; 43class LLSaleInfo;
44class LLObjectSelection;
44 45
45class LLFloaterBuy 46class LLFloaterBuy
46: public LLFloater, public LLVOInventoryListener 47: public LLFloater, public LLVOInventoryListener
@@ -66,6 +67,7 @@ protected:
66private: 67private:
67 static LLFloaterBuy* sInstance; 68 static LLFloaterBuy* sInstance;
68 69
70 LLHandle<LLObjectSelection> mObjectSelection;
69 LLSaleInfo mSaleInfo; 71 LLSaleInfo mSaleInfo;
70}; 72};
71 73
diff --git a/linden/indra/newview/llfloaterbuycontents.cpp b/linden/indra/newview/llfloaterbuycontents.cpp
index 4f6f52e..1deb1ab 100644
--- a/linden/indra/newview/llfloaterbuycontents.cpp
+++ b/linden/indra/newview/llfloaterbuycontents.cpp
@@ -68,8 +68,6 @@ LLFloaterBuyContents::LLFloaterBuyContents()
68 68
69LLFloaterBuyContents::~LLFloaterBuyContents() 69LLFloaterBuyContents::~LLFloaterBuyContents()
70{ 70{
71 gSelectMgr->deselectAll();
72
73 sInstance = NULL; 71 sInstance = NULL;
74} 72}
75 73
@@ -77,7 +75,9 @@ LLFloaterBuyContents::~LLFloaterBuyContents()
77// static 75// static
78void LLFloaterBuyContents::show(const LLSaleInfo& sale_info) 76void LLFloaterBuyContents::show(const LLSaleInfo& sale_info)
79{ 77{
80 if (gSelectMgr->getRootObjectCount() != 1) 78 LLObjectSelectionHandle selection = gSelectMgr->getSelection();
79
80 if (selection->getRootObjectCount() != 1)
81 { 81 {
82 gViewerWindow->alertXml("BuyContentsOneOnly"); 82 gViewerWindow->alertXml("BuyContentsOneOnly");
83 return; 83 return;
@@ -94,8 +94,9 @@ void LLFloaterBuyContents::show(const LLSaleInfo& sale_info)
94 sInstance = new LLFloaterBuyContents(); 94 sInstance = new LLFloaterBuyContents();
95 } 95 }
96 96
97 sInstance->open(); 97 sInstance->open(); /*Flawfinder: ignore*/
98 sInstance->setFocus(TRUE); 98 sInstance->setFocus(TRUE);
99 sInstance->mObjectSelection = gSelectMgr->getEditSelection();
99 100
100 // Always center the dialog. User can change the size, 101 // Always center the dialog. User can change the size,
101 // but purchases are important and should be center screen. 102 // but purchases are important and should be center screen.
@@ -115,11 +116,11 @@ void LLFloaterBuyContents::show(const LLSaleInfo& sale_info)
115 sInstance->mSaleInfo = sale_info; 116 sInstance->mSaleInfo = sale_info;
116 117
117 // Update the display 118 // Update the display
118 LLSelectNode* node = gSelectMgr->getFirstRootNode(); 119 LLSelectNode* node = selection->getFirstRootNode();
119 if (!node) return; 120 if (!node) return;
120 if(node->mPermissions->isGroupOwned()) 121 if(node->mPermissions->isGroupOwned())
121 { 122 {
122 char group_name[MAX_STRING]; 123 char group_name[MAX_STRING]; /*Flawfinder: ignore*/
123 gCacheName->getGroupName(owner_id, group_name); 124 gCacheName->getGroupName(owner_id, group_name);
124 owner_name.assign(group_name); 125 owner_name.assign(group_name);
125 } 126 }
@@ -131,7 +132,7 @@ void LLFloaterBuyContents::show(const LLSaleInfo& sale_info)
131 // Must do this after the floater is created, because 132 // Must do this after the floater is created, because
132 // sometimes the inventory is already there and 133 // sometimes the inventory is already there and
133 // the callback is called immediately. 134 // the callback is called immediately.
134 LLViewerObject* obj = gSelectMgr->getFirstRootObject(); 135 LLViewerObject* obj = selection->getFirstRootObject();
135 sInstance->registerVOInventoryListener(obj,NULL); 136 sInstance->registerVOInventoryListener(obj,NULL);
136 sInstance->requestVOInventory(); 137 sInstance->requestVOInventory();
137} 138}
diff --git a/linden/indra/newview/llfloaterbuycontents.h b/linden/indra/newview/llfloaterbuycontents.h
index 2c643f5..a30de0e 100644
--- a/linden/indra/newview/llfloaterbuycontents.h
+++ b/linden/indra/newview/llfloaterbuycontents.h
@@ -39,6 +39,7 @@
39#include "llinventory.h" 39#include "llinventory.h"
40 40
41class LLViewerObject; 41class LLViewerObject;
42class LLObjectSelection;
42 43
43class LLFloaterBuyContents 44class LLFloaterBuyContents
44: public LLFloater, public LLVOInventoryListener 45: public LLFloater, public LLVOInventoryListener
@@ -62,6 +63,7 @@ protected:
62protected: 63protected:
63 static LLFloaterBuyContents* sInstance; 64 static LLFloaterBuyContents* sInstance;
64 65
66 LLHandle<LLObjectSelection> mObjectSelection;
65 LLSaleInfo mSaleInfo; 67 LLSaleInfo mSaleInfo;
66}; 68};
67 69
diff --git a/linden/indra/newview/llfloaterbuycurrency.cpp b/linden/indra/newview/llfloaterbuycurrency.cpp
index 3ecffd5..388a8aa 100644
--- a/linden/indra/newview/llfloaterbuycurrency.cpp
+++ b/linden/indra/newview/llfloaterbuycurrency.cpp
@@ -185,7 +185,7 @@ BOOL LLFloaterBuyCurrencyUI::canClose()
185void LLFloaterBuyCurrencyUI::onClose(bool app_quitting) 185void LLFloaterBuyCurrencyUI::onClose(bool app_quitting)
186{ 186{
187 LLFloater::onClose(app_quitting); 187 LLFloater::onClose(app_quitting);
188 delete this; 188 destroy();
189} 189}
190 190
191void LLFloaterBuyCurrencyUI::updateUI() 191void LLFloaterBuyCurrencyUI::updateUI()
diff --git a/linden/indra/newview/llfloaterbuyland.cpp b/linden/indra/newview/llfloaterbuyland.cpp
index ca5f677..1b72d4e 100644
--- a/linden/indra/newview/llfloaterbuyland.cpp
+++ b/linden/indra/newview/llfloaterbuyland.cpp
@@ -75,7 +75,7 @@ private:
75 virtual ~LLFloaterBuyLandUI(); 75 virtual ~LLFloaterBuyLandUI();
76 76
77 LLViewerRegion* mRegion; 77 LLViewerRegion* mRegion;
78 LLParcel* mParcel; 78 LLParcelSelectionHandle mParcel;
79 bool mIsClaim; 79 bool mIsClaim;
80 bool mIsForGroup; 80 bool mIsForGroup;
81 81
@@ -146,7 +146,7 @@ public:
146 static LLFloaterBuyLandUI* soleInstance(bool createIfNeeded); 146 static LLFloaterBuyLandUI* soleInstance(bool createIfNeeded);
147 147
148 void setForGroup(bool is_for_group); 148 void setForGroup(bool is_for_group);
149 void setParcel(LLViewerRegion* region, LLParcel* parcel); 149 void setParcel(LLViewerRegion* region, LLParcelSelectionHandle parcel);
150 150
151 void updateAgentInfo(); 151 void updateAgentInfo();
152 void updateParcelInfo(); 152 void updateParcelInfo();
@@ -205,7 +205,7 @@ static void cacheNameUpdateRefreshesBuyLand(const LLUUID&,
205 205
206// static 206// static
207void LLFloaterBuyLand::buyLand( 207void LLFloaterBuyLand::buyLand(
208 LLViewerRegion* region, LLParcel* parcel, bool is_for_group) 208 LLViewerRegion* region, LLParcelSelectionHandle parcel, bool is_for_group)
209{ 209{
210 if(is_for_group && !gAgent.hasPowerInActiveGroup(GP_LAND_DEED)) 210 if(is_for_group && !gAgent.hasPowerInActiveGroup(GP_LAND_DEED))
211 { 211 {
@@ -216,7 +216,7 @@ void LLFloaterBuyLand::buyLand(
216 LLFloaterBuyLandUI* ui = LLFloaterBuyLandUI::soleInstance(true); 216 LLFloaterBuyLandUI* ui = LLFloaterBuyLandUI::soleInstance(true);
217 ui->setForGroup(is_for_group); 217 ui->setForGroup(is_for_group);
218 ui->setParcel(region, parcel); 218 ui->setParcel(region, parcel);
219 ui->open(); 219 ui->open(); /*Flawfinder: ignore*/
220} 220}
221 221
222// static 222// static
@@ -350,7 +350,7 @@ void LLFloaterBuyLandUI::SelectionObserver::changed()
350 else { 350 else {
351 ui->setParcel( 351 ui->setParcel(
352 gParcelMgr->getSelectionRegion(), 352 gParcelMgr->getSelectionRegion(),
353 gParcelMgr->getSelectedParcel()); 353 gParcelMgr->getParcelSelection());
354 } 354 }
355 } 355 }
356} 356}
@@ -368,7 +368,8 @@ void LLFloaterBuyLandUI::updateAgentInfo()
368 368
369void LLFloaterBuyLandUI::updateParcelInfo() 369void LLFloaterBuyLandUI::updateParcelInfo()
370{ 370{
371 mParcelValid = mParcel && mRegion; 371 LLParcel* parcel = mParcel->getParcel();
372 mParcelValid = parcel && mRegion;
372 mParcelIsForSale = false; 373 mParcelIsForSale = false;
373 mParcelIsFirstLand = false; 374 mParcelIsFirstLand = false;
374 mParcelIsGroupLand = false; 375 mParcelIsGroupLand = false;
@@ -391,50 +392,61 @@ void LLFloaterBuyLandUI::updateParcelInfo()
391 return; 392 return;
392 } 393 }
393 394
394 if (gParcelMgr->getMultipleOwners()) 395 if (mParcel->getMultipleOwners())
395 { 396 {
396 mCannotBuyReason = childGetText("multiple_parcels_selected"); 397 mCannotBuyReason = childGetText("multiple_parcels_selected");
397 return; 398 return;
398 } 399 }
399 400
401 const LLUUID& parcelOwner = parcel->getOwnerID();
400 402
401 const LLUUID& parcelOwner = mParcel->getOwnerID(); 403 mIsClaim = parcel->isPublic();
402
403 mIsClaim = mParcel->isPublic();
404 if (!mIsClaim) 404 if (!mIsClaim)
405 { 405 {
406 mParcelActualArea = mParcel->getArea(); 406 mParcelActualArea = parcel->getArea();
407 mParcelIsForSale = mParcel->getForSale(); 407 mParcelIsForSale = parcel->getForSale();
408 mParcelIsFirstLand = mParcel->getReservedForNewbie(); 408 mParcelIsFirstLand = parcel->getReservedForNewbie();
409 mParcelIsGroupLand = mParcel->getIsGroupOwned(); 409 mParcelIsGroupLand = parcel->getIsGroupOwned();
410 mParcelPrice = mParcelIsForSale ? mParcel->getSalePrice() : 0; 410 mParcelPrice = mParcelIsForSale ? parcel->getSalePrice() : 0;
411 411
412 if (mParcelIsGroupLand) 412 if (mParcelIsGroupLand)
413 { 413 {
414 LLUUID group_id = mParcel->getGroupID(); 414 LLUUID group_id = parcel->getGroupID();
415 mParcelGroupContribution = gAgent.getGroupContribution(group_id); 415 mParcelGroupContribution = gAgent.getGroupContribution(group_id);
416 } 416 }
417 } 417 }
418 else 418 else
419 { 419 {
420 mParcelActualArea = gParcelMgr->getClaimableArea(); 420 mParcelActualArea = mParcel->getClaimableArea();
421 mParcelIsForSale = true; 421 mParcelIsForSale = true;
422 mParcelPrice = mParcelActualArea * mParcel->getClaimPricePerMeter(); 422 mParcelPrice = mParcelActualArea * parcel->getClaimPricePerMeter();
423 } 423 }
424 424
425 mParcelBillableArea = 425 mParcelBillableArea =
426 llround(mRegion->getBillableFactor() * mParcelActualArea); 426 llround(mRegion->getBillableFactor() * mParcelActualArea);
427 427
428 mParcelSupportedObjects = mParcel->getMaxPrimCapacity(); 428 mParcelSupportedObjects = llround(
429 mParcelSoldWithObjects = mParcel->getSellWithObjects(); 429 parcel->getMaxPrimCapacity() * parcel->getParcelPrimBonus());
430 // Can't have more than region max tasks, regardless of parcel
431 // object bonus factor.
432 LLViewerRegion* region = gParcelMgr->getSelectionRegion();
433 if(region)
434 {
435 S32 max_tasks_per_region = (S32)region->getMaxTasks();
436 mParcelSupportedObjects = llmin(
437 mParcelSupportedObjects, max_tasks_per_region);
438 }
439
440 mParcelSoldWithObjects = parcel->getSellWithObjects();
441
430 442
431 LLVector3 center = mParcel->getCenterpoint(); 443 LLVector3 center = parcel->getCenterpoint();
432 mParcelLocation = llformat("%s %d,%d", 444 mParcelLocation = llformat("%s %d,%d",
433 mRegion->getName().c_str(), 445 mRegion->getName().c_str(),
434 (int)center[VX], (int)center[VY] 446 (int)center[VX], (int)center[VY]
435 ); 447 );
436 448
437 mParcelSnapshot = mParcel->getSnapshotID(); 449 mParcelSnapshot = parcel->getSnapshotID();
438 450
439 updateNames(); 451 updateNames();
440 452
@@ -453,7 +465,7 @@ void LLFloaterBuyLandUI::updateParcelInfo()
453 465
454 if (!mIsClaim) 466 if (!mIsClaim)
455 { 467 {
456 const LLUUID& authorizedBuyer = mParcel->getAuthorizedBuyerID(); 468 const LLUUID& authorizedBuyer = parcel->getAuthorizedBuyerID();
457 const LLUUID buyer = gAgent.getID(); 469 const LLUUID buyer = gAgent.getID();
458 const LLUUID newOwner = mIsForGroup ? gAgent.getGroupID() : buyer; 470 const LLUUID newOwner = mIsForGroup ? gAgent.getGroupID() : buyer;
459 471
@@ -492,7 +504,7 @@ void LLFloaterBuyLandUI::updateParcelInfo()
492 return; 504 return;
493 } 505 }
494 506
495 if (gParcelMgr->hasOthersSelected()) 507 if (mParcel->hasOthersSelected())
496 { 508 {
497 // Policy: Must not have someone else's land selected 509 // Policy: Must not have someone else's land selected
498 mCannotBuyReason = childGetText("not_owned_by_you"); 510 mCannotBuyReason = childGetText("not_owned_by_you");
@@ -511,7 +523,7 @@ void LLFloaterBuyLandUI::updateParcelInfo()
511 } 523 }
512 */ 524 */
513 525
514 if (mParcel->getReservedForNewbie()) 526 if (parcel->getReservedForNewbie())
515 { 527 {
516 if (mIsForGroup) 528 if (mIsForGroup)
517 { 529 {
@@ -684,9 +696,10 @@ void LLFloaterBuyLandUI::updateWebSiteInfo()
684#endif 696#endif
685 697
686 LLXMLRPCValue keywordArgs = LLXMLRPCValue::createStruct(); 698 LLXMLRPCValue keywordArgs = LLXMLRPCValue::createStruct();
687 keywordArgs.appendString("agentId", gAgent.getID().getString()); 699 keywordArgs.appendString("agentId", gAgent.getID().asString());
688 keywordArgs.appendString("secureSessionId", 700 keywordArgs.appendString(
689 gAgent.getSecureSessionID().getString()); 701 "secureSessionId",
702 gAgent.getSecureSessionID().asString());
690 keywordArgs.appendInt("billableArea", mPreflightAskBillableArea); 703 keywordArgs.appendInt("billableArea", mPreflightAskBillableArea);
691 keywordArgs.appendInt("currencyBuy", mPreflightAskCurrencyBuy); 704 keywordArgs.appendInt("currencyBuy", mPreflightAskCurrencyBuy);
692 705
@@ -771,9 +784,10 @@ void LLFloaterBuyLandUI::runWebSitePrep(const std::string& password)
771 } 784 }
772 785
773 LLXMLRPCValue keywordArgs = LLXMLRPCValue::createStruct(); 786 LLXMLRPCValue keywordArgs = LLXMLRPCValue::createStruct();
774 keywordArgs.appendString("agentId", gAgent.getID().getString()); 787 keywordArgs.appendString("agentId", gAgent.getID().asString());
775 keywordArgs.appendString("secureSessionId", 788 keywordArgs.appendString(
776 gAgent.getSecureSessionID().getString()); 789 "secureSessionId",
790 gAgent.getSecureSessionID().asString());
777 keywordArgs.appendString("levelId", newLevel); 791 keywordArgs.appendString("levelId", newLevel);
778 keywordArgs.appendInt("billableArea", 792 keywordArgs.appendInt("billableArea",
779 mIsForGroup ? 0 : mParcelBillableArea); 793 mIsForGroup ? 0 : mParcelBillableArea);
@@ -820,7 +834,9 @@ void LLFloaterBuyLandUI::sendBuyLand()
820 834
821void LLFloaterBuyLandUI::updateNames() 835void LLFloaterBuyLandUI::updateNames()
822{ 836{
823 if (!mParcelValid) 837 LLParcel* parcelp = mParcel->getParcel();
838
839 if (!parcelp)
824 { 840 {
825 mParcelSellerName = ""; 841 mParcelSellerName = "";
826 return; 842 return;
@@ -830,19 +846,19 @@ void LLFloaterBuyLandUI::updateNames()
830 { 846 {
831 mParcelSellerName = "Linden Lab"; 847 mParcelSellerName = "Linden Lab";
832 } 848 }
833 else if (mParcel->getIsGroupOwned()) 849 else if (parcelp->getIsGroupOwned())
834 { 850 {
835 char groupName[DB_LAST_NAME_BUF_SIZE]; 851 char groupName[DB_LAST_NAME_BUF_SIZE]; /*Flawfinder: ignore*/
836 852
837 gCacheName->getGroupName(mParcel->getGroupID(), &groupName[0]); 853 gCacheName->getGroupName(parcelp->getGroupID(), &groupName[0]);
838 mParcelSellerName = groupName; 854 mParcelSellerName = groupName;
839 } 855 }
840 else 856 else
841 { 857 {
842 char firstName[DB_LAST_NAME_BUF_SIZE]; 858 char firstName[DB_LAST_NAME_BUF_SIZE]; /*Flawfinder: ignore*/
843 char lastName[DB_LAST_NAME_BUF_SIZE]; 859 char lastName[DB_LAST_NAME_BUF_SIZE]; /*Flawfinder: ignore*/
844 860
845 gCacheName->getName(mParcel->getOwnerID(), firstName, lastName); 861 gCacheName->getName(parcelp->getOwnerID(), firstName, lastName);
846 mParcelSellerName = llformat("%s %s", firstName, lastName); 862 mParcelSellerName = llformat("%s %s", firstName, lastName);
847 } 863 }
848} 864}
@@ -939,7 +955,7 @@ BOOL LLFloaterBuyLandUI::postBuild()
939 return TRUE; 955 return TRUE;
940} 956}
941 957
942void LLFloaterBuyLandUI::setParcel(LLViewerRegion* region, LLParcel* parcel) 958void LLFloaterBuyLandUI::setParcel(LLViewerRegion* region, LLParcelSelectionHandle parcel)
943{ 959{
944 if (mTransaction && mTransactionType == TransactionBuy) 960 if (mTransaction && mTransactionType == TransactionBuy)
945 { 961 {
@@ -996,7 +1012,7 @@ BOOL LLFloaterBuyLandUI::canClose()
996void LLFloaterBuyLandUI::onClose(bool app_quitting) 1012void LLFloaterBuyLandUI::onClose(bool app_quitting)
997{ 1013{
998 LLFloater::onClose(app_quitting); 1014 LLFloater::onClose(app_quitting);
999 delete this; 1015 destroy();
1000} 1016}
1001 1017
1002 1018
diff --git a/linden/indra/newview/llfloaterbuyland.h b/linden/indra/newview/llfloaterbuyland.h
index 016c1ec..a91c6d6 100644
--- a/linden/indra/newview/llfloaterbuyland.h
+++ b/linden/indra/newview/llfloaterbuyland.h
@@ -28,15 +28,15 @@
28#ifndef LL_LLFLOATERBUYLAND_H 28#ifndef LL_LLFLOATERBUYLAND_H
29#define LL_LLFLOATERBUYLAND_H 29#define LL_LLFLOATERBUYLAND_H
30 30
31class LLParcel;
32class LLViewerRegion; 31class LLViewerRegion;
33class LLViewerTextEditor; 32class LLViewerTextEditor;
33class LLParcelSelection;
34 34
35class LLFloaterBuyLand 35class LLFloaterBuyLand
36{ 36{
37public: 37public:
38 static void buyLand(LLViewerRegion* region, 38 static void buyLand(LLViewerRegion* region,
39 LLParcel* parcel, 39 LLHandle<LLParcelSelection> parcel,
40 bool is_for_group); 40 bool is_for_group);
41 static void updateCovenantText(const std::string& string, const LLUUID& asset_id); 41 static void updateCovenantText(const std::string& string, const LLUUID& asset_id);
42 static void updateEstateName(const std::string& name); 42 static void updateEstateName(const std::string& name);
diff --git a/linden/indra/newview/llfloaterchat.cpp b/linden/indra/newview/llfloaterchat.cpp
index 0ffc518..2b27d15 100644
--- a/linden/indra/newview/llfloaterchat.cpp
+++ b/linden/indra/newview/llfloaterchat.cpp
@@ -135,7 +135,7 @@ void LLFloaterChat::onClose(bool app_quitting)
135// public 135// public
136void LLFloaterChat::show() 136void LLFloaterChat::show()
137{ 137{
138 open(); 138 open(); /*Flawfinder: ignore*/
139} 139}
140 140
141void add_timestamped_line(LLViewerTextEditor* edit, const LLString& line, const LLColor4& color) 141void add_timestamped_line(LLViewerTextEditor* edit, const LLString& line, const LLColor4& color)
diff --git a/linden/indra/newview/llfloatercolorpicker.cpp b/linden/indra/newview/llfloatercolorpicker.cpp
index f8d5cd4..84df754 100644
--- a/linden/indra/newview/llfloatercolorpicker.cpp
+++ b/linden/indra/newview/llfloatercolorpicker.cpp
@@ -181,7 +181,7 @@ showUI ()
181{ 181{
182 setVisible ( TRUE ); 182 setVisible ( TRUE );
183 setFocus ( TRUE ); 183 setFocus ( TRUE );
184 open(); 184 open(); /*Flawfinder: ignore*/
185 185
186 // HACK: if system color picker is required - close the SL one we made and use default system dialog 186 // HACK: if system color picker is required - close the SL one we made and use default system dialog
187 if ( gSavedSettings.getBOOL ( "UseDefaultColorPicker" ) ) 187 if ( gSavedSettings.getBOOL ( "UseDefaultColorPicker" ) )
@@ -635,7 +635,7 @@ void LLFloaterColorPicker::draw()
635 } 635 }
636 636
637 mPipetteBtn->setEnabled(gToolMgr != NULL); 637 mPipetteBtn->setEnabled(gToolMgr != NULL);
638 mPipetteBtn->setToggleState(gToolMgr && gToolMgr->getCurrentTool(gKeyboard->currentMask(TRUE)) == gToolPipette); 638 mPipetteBtn->setToggleState(gToolMgr && gToolMgr->getCurrentTool() == gToolPipette);
639 mApplyImmediateCheck->setEnabled(mActive && mCanApplyImmediately); 639 mApplyImmediateCheck->setEnabled(mActive && mCanApplyImmediately);
640 mSelectBtn->setEnabled(mActive); 640 mSelectBtn->setEnabled(mActive);
641 641
@@ -1272,7 +1272,7 @@ void LLFloaterColorPicker::setActive(BOOL active)
1272 1272
1273void LLFloaterColorPicker::stopUsingPipette() 1273void LLFloaterColorPicker::stopUsingPipette()
1274{ 1274{
1275 if (gToolMgr && gToolMgr->getCurrentTool(gKeyboard->currentMask(TRUE)) == gToolPipette) 1275 if (gToolMgr && gToolMgr->getCurrentTool() == gToolPipette)
1276 { 1276 {
1277 gToolMgr->clearTransientTool(); 1277 gToolMgr->clearTransientTool();
1278 } 1278 }
diff --git a/linden/indra/newview/llfloatercustomize.cpp b/linden/indra/newview/llfloatercustomize.cpp
index f564dad..7ac50ae 100644
--- a/linden/indra/newview/llfloatercustomize.cpp
+++ b/linden/indra/newview/llfloatercustomize.cpp
@@ -2162,6 +2162,8 @@ void LLFloaterCustomize::onTabChanged( void* userdata, bool from_click )
2162 2162
2163void LLFloaterCustomize::onClose(bool app_quitting) 2163void LLFloaterCustomize::onClose(bool app_quitting)
2164{ 2164{
2165 // since this window is potentially staying open, push to back to let next window take focus
2166 gFloaterView->sendChildToBack(this);
2165 handle_reset_view(); // Calls askToSaveAllIfDirty 2167 handle_reset_view(); // Calls askToSaveAllIfDirty
2166} 2168}
2167 2169
diff --git a/linden/indra/newview/llfloaterdirectory.cpp b/linden/indra/newview/llfloaterdirectory.cpp
index ab2e873..846a2fb 100644
--- a/linden/indra/newview/llfloaterdirectory.cpp
+++ b/linden/indra/newview/llfloaterdirectory.cpp
@@ -379,7 +379,7 @@ void LLFloaterDirectory::show(void *)
379 sInstance = new LLFloaterDirectory("directory"); 379 sInstance = new LLFloaterDirectory("directory");
380 } 380 }
381 381
382 sInstance->open(); 382 sInstance->open(); /*Flawfinder: ignore*/
383 sInstance->focusCurrentPanel(); 383 sInstance->focusCurrentPanel();
384} 384}
385 385
@@ -415,7 +415,7 @@ void LLFloaterDirectory::toggleFind(void*)
415 BOOL panel_visible = sInstance->getVisible(); 415 BOOL panel_visible = sInstance->getVisible();
416 if (!panel_visible) 416 if (!panel_visible)
417 { 417 {
418 sInstance->open(); 418 sInstance->open(); /*Flawfinder: ignore*/
419 sInstance->focusCurrentPanel(); 419 sInstance->focusCurrentPanel();
420 } 420 }
421 else 421 else
@@ -436,7 +436,7 @@ void LLFloaterDirectory::toggleEvents(void*)
436 BOOL panel_visible = sInstance->getVisible(); 436 BOOL panel_visible = sInstance->getVisible();
437 if (!panel_visible) 437 if (!panel_visible)
438 { 438 {
439 sInstance->open(); 439 sInstance->open(); /*Flawfinder: ignore*/
440 sInstance->showEvents(0); 440 sInstance->showEvents(0);
441 } 441 }
442 else 442 else
diff --git a/linden/indra/newview/llfloatereditui.cpp b/linden/indra/newview/llfloatereditui.cpp
index 21580d3..3af5741 100644
--- a/linden/indra/newview/llfloatereditui.cpp
+++ b/linden/indra/newview/llfloatereditui.cpp
@@ -319,7 +319,7 @@ void LLFloaterEditUI::show(void*)
319{ 319{
320 LLFloaterEditUI* self = new LLFloaterEditUI(); 320 LLFloaterEditUI* self = new LLFloaterEditUI();
321 self->center(); 321 self->center();
322 self->open(); 322 self->open(); /*Flawfinder: ignore*/
323} 323}
324 324
325// static 325// static
diff --git a/linden/indra/newview/llfloaterfriends.cpp b/linden/indra/newview/llfloaterfriends.cpp
index 207454b..8a36620 100644
--- a/linden/indra/newview/llfloaterfriends.cpp
+++ b/linden/indra/newview/llfloaterfriends.cpp
@@ -113,12 +113,12 @@ void LLFloaterFriends::show(void*)
113{ 113{
114 if(sInstance) 114 if(sInstance)
115 { 115 {
116 sInstance->open(); 116 sInstance->open(); /*Flawfinder: ignore*/
117 } 117 }
118 else 118 else
119 { 119 {
120 LLFloaterFriends* self = new LLFloaterFriends; 120 LLFloaterFriends* self = new LLFloaterFriends;
121 self->open(); 121 self->open(); /*Flawfinder: ignore*/
122 } 122 }
123} 123}
124 124
@@ -505,12 +505,12 @@ void LLFloaterFriends::onClickIM(void* user_data)
505 { 505 {
506 LLUUID agent_id = ids[0]; 506 LLUUID agent_id = ids[0];
507 const LLRelationship* info = LLAvatarTracker::instance().getBuddyInfo(agent_id); 507 const LLRelationship* info = LLAvatarTracker::instance().getBuddyInfo(agent_id);
508 char first[DB_FIRST_NAME_BUF_SIZE]; 508 char first[DB_FIRST_NAME_BUF_SIZE]; /* Flawfinder: ignore */
509 char last[DB_LAST_NAME_BUF_SIZE]; 509 char last[DB_LAST_NAME_BUF_SIZE]; /* Flawfinder: ignore */
510 if(info && gCacheName->getName(agent_id, first, last)) 510 if(info && gCacheName->getName(agent_id, first, last))
511 { 511 {
512 char buffer[MAX_STRING]; 512 char buffer[MAX_STRING]; /* Flawfinder: ignore */
513 snprintf(buffer, MAX_STRING, "%s %s", first, last); 513 snprintf(buffer, MAX_STRING, "%s %s", first, last); /* Flawfinder: ignore */
514 gIMView->setFloaterOpen(TRUE); 514 gIMView->setFloaterOpen(TRUE);
515 gIMView->addSession( 515 gIMView->addSession(
516 buffer, 516 buffer,
@@ -537,8 +537,7 @@ void LLFloaterFriends::requestFriendship(const LLUUID& target_id, const LLString
537{ 537{
538 // HACK: folder id stored as "message" 538 // HACK: folder id stored as "message"
539 LLUUID calling_card_folder_id = gInventory.findCategoryUUIDForType(LLAssetType::AT_CALLINGCARD); 539 LLUUID calling_card_folder_id = gInventory.findCategoryUUIDForType(LLAssetType::AT_CALLINGCARD);
540 std::string message = calling_card_folder_id.getString(); 540 std::string message = calling_card_folder_id.asString();
541
542 send_improved_im(target_id, 541 send_improved_im(target_id,
543 target_name.c_str(), 542 target_name.c_str(),
544 message.c_str(), 543 message.c_str(),
@@ -598,8 +597,8 @@ void LLFloaterFriends::onClickRemove(void* user_data)
598 if(ids.size() == 1) 597 if(ids.size() == 1)
599 { 598 {
600 LLUUID agent_id = ids[0]; 599 LLUUID agent_id = ids[0];
601 char first[DB_FIRST_NAME_BUF_SIZE]; 600 char first[DB_FIRST_NAME_BUF_SIZE]; /*Flawfinder: ignore*/
602 char last[DB_LAST_NAME_BUF_SIZE]; 601 char last[DB_LAST_NAME_BUF_SIZE]; /*Flawfinder: ignore*/
603 if(gCacheName->getName(agent_id, first, last)) 602 if(gCacheName->getName(agent_id, first, last))
604 { 603 {
605 args["[FIRST_NAME]"] = first; 604 args["[FIRST_NAME]"] = first;
@@ -671,8 +670,8 @@ void LLFloaterFriends::onClickModifyStatus(LLUICtrl* ctrl, void* user_data)
671 if(ids.size() == 1) 670 if(ids.size() == 1)
672 { 671 {
673 LLUUID agent_id = ids[0]; 672 LLUUID agent_id = ids[0];
674 char first[DB_FIRST_NAME_BUF_SIZE]; 673 char first[DB_FIRST_NAME_BUF_SIZE]; /*Flawfinder: ignore*/
675 char last[DB_LAST_NAME_BUF_SIZE]; 674 char last[DB_LAST_NAME_BUF_SIZE]; /*Flawfinder: ignore*/
676 if(gCacheName->getName(agent_id, first, last)) 675 if(gCacheName->getName(agent_id, first, last))
677 { 676 {
678 args["[FIRST_NAME]"] = first; 677 args["[FIRST_NAME]"] = first;
diff --git a/linden/indra/newview/llfloatergesture.cpp b/linden/indra/newview/llfloatergesture.cpp
index e4425d1..313dccf 100644
--- a/linden/indra/newview/llfloatergesture.cpp
+++ b/linden/indra/newview/llfloatergesture.cpp
@@ -133,7 +133,7 @@ void LLFloaterGesture::show()
133{ 133{
134 if (sInstance) 134 if (sInstance)
135 { 135 {
136 sInstance->open(); 136 sInstance->open(); /*Flawfinder: ignore*/
137 return; 137 return;
138 } 138 }
139 139
@@ -158,7 +158,7 @@ void LLFloaterGesture::show()
158 158
159 // Update button labels 159 // Update button labels
160 onCommitList(NULL, self); 160 onCommitList(NULL, self);
161 self->open(); 161 self->open(); /*Flawfinder: ignore*/
162} 162}
163 163
164// static 164// static
diff --git a/linden/indra/newview/llfloatergodtools.cpp b/linden/indra/newview/llfloatergodtools.cpp
index d2ce3fd..e1d12d2 100644
--- a/linden/indra/newview/llfloatergodtools.cpp
+++ b/linden/indra/newview/llfloatergodtools.cpp
@@ -86,7 +86,7 @@ LLFloaterGodTools* LLFloaterGodTools::instance()
86 if (!sGodTools) 86 if (!sGodTools)
87 { 87 {
88 sGodTools = new LLFloaterGodTools(); 88 sGodTools = new LLFloaterGodTools();
89 sGodTools->open(); 89 sGodTools->open(); /*Flawfinder: ignore*/
90 sGodTools->center(); 90 sGodTools->center();
91 sGodTools->setFocus(TRUE); 91 sGodTools->setFocus(TRUE);
92 } 92 }
@@ -223,7 +223,7 @@ void LLFloaterGodTools::show(void *)
223void LLFloaterGodTools::showPanel(const LLString& panel_name) 223void LLFloaterGodTools::showPanel(const LLString& panel_name)
224{ 224{
225 childShowTab("GodTools Tabs", panel_name); 225 childShowTab("GodTools Tabs", panel_name);
226 open(); 226 open(); /*Flawfinder: ignore*/
227 LLPanel *panel = childGetVisibleTab("GodTools Tabs"); 227 LLPanel *panel = childGetVisibleTab("GodTools Tabs");
228 if (panel) panel->setFocus(TRUE); 228 if (panel) panel->setFocus(TRUE);
229} 229}
@@ -254,7 +254,7 @@ void LLFloaterGodTools::processRegionInfo(LLMessageSystem* msg)
254 U32 region_flags; 254 U32 region_flags;
255 U8 sim_access; 255 U8 sim_access;
256 U8 agent_limit; 256 U8 agent_limit;
257 char sim_name[MAX_STRING]; 257 char sim_name[MAX_STRING]; /*Flawfinder: ignore*/
258 U32 estate_id; 258 U32 estate_id;
259 U32 parent_estate_id; 259 U32 parent_estate_id;
260 F32 water_height; 260 F32 water_height;
@@ -990,7 +990,7 @@ void LLPanelGridTools::flushMapVisibilityCachesConfirm(S32 option, void* data)
990 msg->addString("Method", "refreshmapvisibility"); 990 msg->addString("Method", "refreshmapvisibility");
991 msg->addUUID("Invoice", LLUUID::null); 991 msg->addUUID("Invoice", LLUUID::null);
992 msg->nextBlock("ParamList"); 992 msg->nextBlock("ParamList");
993 msg->addString("Parameter", gAgent.getID().getString()); 993 msg->addString("Parameter", gAgent.getID().asString());
994 gAgent.sendReliableMessage(); 994 gAgent.sendReliableMessage();
995} 995}
996 996
@@ -1256,8 +1256,8 @@ void LLPanelObjectTools::onClickSetBySelection(void* data)
1256 LLPanelObjectTools* panelp = (LLPanelObjectTools*) data; 1256 LLPanelObjectTools* panelp = (LLPanelObjectTools*) data;
1257 if (!panelp) return; 1257 if (!panelp) return;
1258 1258
1259 LLSelectNode* node = gSelectMgr->getFirstRootNode(); 1259 LLSelectNode* node = gSelectMgr->getSelection()->getFirstRootNode();
1260 if (!node) node = gSelectMgr->getFirstNode(); 1260 if (!node) node = gSelectMgr->getSelection()->getFirstNode();
1261 if (!node) return; 1261 if (!node) return;
1262 1262
1263 LLString owner_name; 1263 LLString owner_name;
diff --git a/linden/indra/newview/llfloatergroupinfo.cpp b/linden/indra/newview/llfloatergroupinfo.cpp
index 5fc999e..a807774 100644
--- a/linden/indra/newview/llfloatergroupinfo.cpp
+++ b/linden/indra/newview/llfloatergroupinfo.cpp
@@ -172,7 +172,7 @@ void LLFloaterGroupInfo::showFromUUID(const LLUUID& group_id,
172 fgi->selectTabByName(tab_name); 172 fgi->selectTabByName(tab_name);
173 173
174 fgi->center(); 174 fgi->center();
175 fgi->open(); 175 fgi->open(); /*Flawfinder: ignore*/
176} 176}
177 177
178// static 178// static
diff --git a/linden/indra/newview/llfloatergroupinvite.cpp b/linden/indra/newview/llfloatergroupinvite.cpp
index a727f22..0c8b526 100644
--- a/linden/indra/newview/llfloatergroupinvite.cpp
+++ b/linden/indra/newview/llfloatergroupinvite.cpp
@@ -132,6 +132,6 @@ void LLFloaterGroupInvite::showForGroup(const LLUUID& group_id)
132 } 132 }
133 133
134 fgi->center(); 134 fgi->center();
135 fgi->open(); 135 fgi->open(); /*Flawfinder: ignore*/
136 fgi->mImpl->mInvitePanelp->update(); 136 fgi->mImpl->mInvitePanelp->update();
137} 137}
diff --git a/linden/indra/newview/llfloatergroups.cpp b/linden/indra/newview/llfloatergroups.cpp
index 05a6927..11b58d5 100644
--- a/linden/indra/newview/llfloatergroups.cpp
+++ b/linden/indra/newview/llfloatergroups.cpp
@@ -93,7 +93,7 @@ LLFloaterGroups* LLFloaterGroups::show(const LLUUID& id, EGroupDialog type)
93 else 93 else
94 { 94 {
95 // Move the existing view to the front 95 // Move the existing view to the front
96 instance->open(); 96 instance->open(); /* Flawfinder: ignore */
97 } 97 }
98 } 98 }
99 99
@@ -119,7 +119,7 @@ LLFloaterGroups* LLFloaterGroups::show(const LLUUID& id, EGroupDialog type)
119 break; 119 break;
120 } 120 }
121 instance->center(); 121 instance->center();
122 instance->open(); 122 instance->open(); /*Flawfinder: ignore*/
123 } 123 }
124 } 124 }
125 return instance; 125 return instance;
diff --git a/linden/indra/newview/llfloaterimagepreview.cpp b/linden/indra/newview/llfloaterimagepreview.cpp
index c741bdb..9c68ca8 100644
--- a/linden/indra/newview/llfloaterimagepreview.cpp
+++ b/linden/indra/newview/llfloaterimagepreview.cpp
@@ -179,7 +179,6 @@ void LLFloaterImagePreview::onPreviewTypeCommit(LLUICtrl* ctrl, void* userdata)
179 break; 179 break;
180 } 180 }
181 fp->mAvatarPreview->refresh(); 181 fp->mAvatarPreview->refresh();
182 //gViewerWindow->requestFastFrame(fp);
183} 182}
184 183
185//----------------------------------------------------------------------------- 184//-----------------------------------------------------------------------------
@@ -489,7 +488,6 @@ BOOL LLFloaterImagePreview::handleHover(S32 x, S32 y, MASK mask)
489 } 488 }
490 489
491 LLUI::setCursorPositionLocal(this, mLastMouseX, mLastMouseY); 490 LLUI::setCursorPositionLocal(this, mLastMouseX, mLastMouseY);
492 //gViewerWindow->requestFastFrame(this);
493 } 491 }
494 492
495 if (!mPreviewRect.pointInRect(x, y) || !mAvatarPreview) 493 if (!mPreviewRect.pointInRect(x, y) || !mAvatarPreview)
@@ -521,7 +519,6 @@ BOOL LLFloaterImagePreview::handleScrollWheel(S32 x, S32 y, S32 clicks)
521 { 519 {
522 mAvatarPreview->zoom((F32)clicks * -0.2f); 520 mAvatarPreview->zoom((F32)clicks * -0.2f);
523 mAvatarPreview->refresh(); 521 mAvatarPreview->refresh();
524 //gViewerWindow->requestFastFrame(this);
525 } 522 }
526 523
527 return TRUE; 524 return TRUE;
@@ -557,7 +554,7 @@ LLImagePreviewAvatar::LLImagePreviewAvatar(S32 width, S32 height) : LLDynamicTex
557 mDummyAvatar->slamPosition(); 554 mDummyAvatar->slamPosition();
558 mDummyAvatar->updateJointLODs(); 555 mDummyAvatar->updateJointLODs();
559 mDummyAvatar->updateGeometry(mDummyAvatar->mDrawable); 556 mDummyAvatar->updateGeometry(mDummyAvatar->mDrawable);
560 gPipeline.markVisible(mDummyAvatar->mDrawable); 557 gPipeline.markVisible(mDummyAvatar->mDrawable, *gCamera);
561 558
562 mTextureName = 0; 559 mTextureName = 0;
563} 560}
@@ -645,6 +642,10 @@ BOOL LLImagePreviewAvatar::render()
645 gCamera->setView(gCamera->getDefaultFOV() / mCameraZoom); 642 gCamera->setView(gCamera->getDefaultFOV() / mCameraZoom);
646 gCamera->setPerspective(FALSE, mOrigin.mX, mOrigin.mY, mWidth, mHeight, FALSE); 643 gCamera->setPerspective(FALSE, mOrigin.mX, mOrigin.mY, mWidth, mHeight, FALSE);
647 644
645 LLVertexBuffer::stopRender();
646 avatarp->updateLOD();
647 LLVertexBuffer::startRender();
648
648 if (avatarp->mDrawable.notNull()) 649 if (avatarp->mDrawable.notNull())
649 { 650 {
650 LLGLDepthTest gls_depth(GL_TRUE, GL_TRUE); 651 LLGLDepthTest gls_depth(GL_TRUE, GL_TRUE);
@@ -653,13 +654,7 @@ BOOL LLImagePreviewAvatar::render()
653 654
654 LLDrawPoolAvatar *avatarPoolp = (LLDrawPoolAvatar *)avatarp->mDrawable->getFace(0)->getPool(); 655 LLDrawPoolAvatar *avatarPoolp = (LLDrawPoolAvatar *)avatarp->mDrawable->getFace(0)->getPool();
655 656
656 gPipeline.unbindAGP(); 657 avatarPoolp->renderAvatars(avatarp); // renders only one avatar
657 avatarPoolp->syncAGP();
658 if (avatarPoolp->canUseAGP() && gPipeline.usingAGP())
659 {
660 gPipeline.bindAGP();
661 }
662 avatarPoolp->renderAvatars(avatarp, TRUE); // renders only one avatar (no shaders)
663 } 658 }
664 659
665 return TRUE; 660 return TRUE;
diff --git a/linden/indra/newview/llfloaterimport.cpp b/linden/indra/newview/llfloaterimport.cpp
index b7255db..478b5d7 100644
--- a/linden/indra/newview/llfloaterimport.cpp
+++ b/linden/indra/newview/llfloaterimport.cpp
@@ -76,8 +76,9 @@ LLFloaterImport::LLFloaterImport(const std::string filename)
76{ 76{
77 mFilenameAndPath = filename; 77 mFilenameAndPath = filename;
78 78
79 char file_path[256]; 79 char file_path[256]; /*Flawfinder: ignore*/
80 strcpy(file_path, mFilenameAndPath.c_str()); 80 strncpy(file_path, mFilenameAndPath.c_str(), sizeof(file_path) -1); /*Flawfinder: ignore*/
81 file_path[sizeof(file_path) -1] = '\0';
81 char *file_name = strrchr( file_path, gDirUtilp->getDirDelimiter()[0]); 82 char *file_name = strrchr( file_path, gDirUtilp->getDirDelimiter()[0]);
82 file_name[0] = 0; 83 file_name[0] = 0;
83 84
@@ -104,7 +105,7 @@ BOOL LLFloaterImport::postBuild()
104 char* end_p = strrchr(asset_name_str, '.'); // strip extension if exists 105 char* end_p = strrchr(asset_name_str, '.'); // strip extension if exists
105 if( !end_p ) 106 if( !end_p )
106 { 107 {
107 end_p = asset_name_str + strlen( asset_name_str ); 108 end_p = asset_name_str + strlen( asset_name_str ); /*Flawfinder: ignore*/
108 } 109 }
109 110
110 S32 len = llmin( (S32) (DB_INV_ITEM_NAME_STR_LEN), (S32) (end_p - asset_name_str) ); 111 S32 len = llmin( (S32) (DB_INV_ITEM_NAME_STR_LEN), (S32) (end_p - asset_name_str) );
@@ -182,8 +183,8 @@ BOOL LLFloaterImport::postBuild()
182 LLScrollListItem *new_item = new LLScrollListItem(TRUE, task); 183 LLScrollListItem *new_item = new LLScrollListItem(TRUE, task);
183 new_item->addColumn("OBJECT", default_font, 60); 184 new_item->addColumn("OBJECT", default_font, 60);
184 LLString output_line; 185 LLString output_line;
185 char buffer[20]; 186 char buffer[20]; /*Flawfinder: ignore*/
186 sprintf(buffer, "%d", (S32)tasks_list.size()); 187 snprintf(buffer, sizeof(buffer), "%d", (S32)tasks_list.size()); /*Flawfinder: ignore*/
187 output_line.append(buffer); 188 output_line.append(buffer);
188 output_line.append(" prims"); 189 output_line.append(" prims");
189 new_item->addColumn(output_line, default_font, 80); 190 new_item->addColumn(output_line, default_font, 80);
@@ -257,9 +258,9 @@ BOOL LLFloaterImport::postBuild()
257 258
258 llinfos << "Getting hash for " << image_path << llendl; 259 llinfos << "Getting hash for " << image_path << llendl;
259 260
260 char md5_hash_string[33]; 261 char md5_hash_string[33]; /*Flawfinder: ignore*/
261 strcpy(md5_hash_string, "00000000000000000000000000000000"); 262 strcpy(md5_hash_string, "00000000000000000000000000000000"); /*Flawfinder: ignore*/
262 FILE *fCheck = LLFile::fopen(image_path.c_str(), "rb"); 263 FILE* fCheck = LLFile::fopen(image_path.c_str(), "rb"); /*Flawfinder: ignore*/
263 if (fCheck) 264 if (fCheck)
264 { 265 {
265 LLMD5 my_md5_hash(fCheck); 266 LLMD5 my_md5_hash(fCheck);
@@ -458,7 +459,7 @@ void LLFloaterImport::finishImport(ImportAssetInfo *info)
458 { 459 {
459 // Copy file into a local directory 460 // Copy file into a local directory
460 LLString new_file = "TEMP"; 461 LLString new_file = "TEMP";
461 new_file.append(new_file_id.getString()); 462 new_file.append(new_file_id.asString());
462 new_file.append(".slobject"); 463 new_file.append(".slobject");
463 464
464 S32 length; 465 S32 length;
@@ -509,7 +510,7 @@ void LLFloaterImport::asset_uploaded_callback(const LLUUID& uuid, void* user_dat
509 LLResourceData *resource_data = (LLResourceData*)user_data; 510 LLResourceData *resource_data = (LLResourceData*)user_data;
510 ImportAssetInfo *info = (ImportAssetInfo*)resource_data->mUserData; 511 ImportAssetInfo *info = (ImportAssetInfo*)resource_data->mUserData;
511 512
512 info->NewImageIDList.push_back(resource_data->mAssetInfo.mUuid.getString()); 513 info->NewImageIDList.push_back(resource_data->mAssetInfo.mUuid.asString());
513 514
514 LLUploadDialog::modalUploadFinished(); 515 LLUploadDialog::modalUploadFinished();
515 if (info->ImageFileQueue.size() == 0) 516 if (info->ImageFileQueue.size() == 0)
@@ -553,7 +554,7 @@ void LLFloaterImport::onBtnOK(void*userdata)
553 LLString *image_id = (LLString *)(*itor)->getUserdata(); 554 LLString *image_id = (LLString *)(*itor)->getUserdata();
554 if (image_id) 555 if (image_id)
555 { 556 {
556 asset_info->OldImageIDList.push_back(id.getString()); 557 asset_info->OldImageIDList.push_back(id.asString());
557 LLString image_file = fp->mInventoryPath; 558 LLString image_file = fp->mInventoryPath;
558 image_file.append(gDirUtilp->getDirDelimiter()); 559 image_file.append(gDirUtilp->getDirDelimiter());
559 image_file.append(*image_id); 560 image_file.append(*image_id);
diff --git a/linden/indra/newview/llfloaterinspect.cpp b/linden/indra/newview/llfloaterinspect.cpp
index 40132ce..8bb73e3 100644
--- a/linden/indra/newview/llfloaterinspect.cpp
+++ b/linden/indra/newview/llfloaterinspect.cpp
@@ -1,221 +1,221 @@
1#include "llviewerprecompiledheaders.h" 1#include "llviewerprecompiledheaders.h"
2#include "llfloateravatarinfo.h" 2#include "llfloateravatarinfo.h"
3#include "llfloaterinspect.h" 3#include "llfloaterinspect.h"
4#include "llfloatertools.h" 4#include "llfloatertools.h"
5#include "llcachename.h" 5#include "llcachename.h"
6#include "llscrolllistctrl.h" 6#include "llscrolllistctrl.h"
7#include "llselectmgr.h" 7#include "llselectmgr.h"
8#include "lltoolcomp.h" 8#include "lltoolcomp.h"
9#include "lltoolmgr.h" 9#include "lltoolmgr.h"
10#include "llviewercontrol.h" 10#include "llviewercontrol.h"
11#include "llviewerobject.h" 11#include "llviewerobject.h"
12#include "llvieweruictrlfactory.h" 12#include "llvieweruictrlfactory.h"
13 13
14LLFloaterInspect* LLFloaterInspect::sInstance = NULL; 14LLFloaterInspect* LLFloaterInspect::sInstance = NULL;
15 15
16LLFloaterInspect::LLFloaterInspect(void) : 16LLFloaterInspect::LLFloaterInspect(void) :
17 LLFloater("Inspect Object"), 17 LLFloater("Inspect Object"),
18 mDirty(FALSE) 18 mDirty(FALSE)
19{ 19{
20 sInstance = this; 20 sInstance = this;
21 gUICtrlFactory->buildFloater(this, "floater_inspect.xml"); 21 gUICtrlFactory->buildFloater(this, "floater_inspect.xml");
22} 22}
23 23
24LLFloaterInspect::~LLFloaterInspect(void) 24LLFloaterInspect::~LLFloaterInspect(void)
25{ 25{
26 if(!gFloaterTools->getVisible()) 26 if(!gFloaterTools->getVisible())
27 { 27 {
28 if(gToolMgr->getCurrentTool(MASK_NONE) == gToolInspect) 28 if(gToolMgr->getBaseTool() == gToolInspect)
29 { 29 {
30 select_tool(gToolNull); 30 select_tool(gToolNull);
31 } 31 }
32 gSelectMgr->deselectAll(); 32 // Switch back to basic toolset
33 // Switch back to basic toolset 33 gToolMgr->setCurrentToolset(gBasicToolset);
34 gCurrentToolset = gBasicToolset; 34 }
35 gBasicToolset->selectFirstTool(); 35 else
36 gToolMgr->useSelectedTool( gBasicToolset ); 36 {
37 } 37 gFloaterTools->setFocus(TRUE);
38 else 38 }
39 { 39 sInstance = NULL;
40 gFloaterTools->setFocus(TRUE); 40}
41 } 41
42 sInstance = NULL; 42BOOL LLFloaterInspect::isVisible()
43} 43{
44 44 return (!!sInstance);
45BOOL LLFloaterInspect::isVisible() 45}
46{ 46
47 return (!!sInstance); 47void LLFloaterInspect::show(void* ignored)
48} 48{
49 49 if(sInstance)
50void LLFloaterInspect::show(void* ignored) 50 {
51{ 51 sInstance->open();
52 if(sInstance) 52 }
53 { 53 else
54 sInstance->open(); 54 {
55 } 55 LLFloaterInspect* self = new LLFloaterInspect;
56 else 56 self->open();
57 { 57 }
58 LLFloaterInspect* self = new LLFloaterInspect; 58
59 self->open(); 59 sInstance->mObjectSelection = gSelectMgr->getSelection();
60 } 60 select_tool(gToolInspect);
61 select_tool(gToolInspect); 61 sInstance->refresh();
62} 62}
63 63
64void LLFloaterInspect::onClickCreatorProfile(void* ctrl) 64void LLFloaterInspect::onClickCreatorProfile(void* ctrl)
65{ 65{
66 if(sInstance->mObjectList->getAllSelected().size() == 0) return; 66 if(sInstance->mObjectList->getAllSelected().size() == 0) return;
67 LLSelectNode* obj = gSelectMgr->getFirstNode(); 67 LLSelectNode* obj = sInstance->mObjectSelection->getFirstNode();
68 LLUUID obj_id, creator_id; 68 LLUUID obj_id, creator_id;
69 obj_id = sInstance->mObjectList->getFirstSelected()->getUUID(); 69 obj_id = sInstance->mObjectList->getFirstSelected()->getUUID();
70 while(obj) 70 while(obj)
71 { 71 {
72 if(obj_id == obj->getObject()->getID()) 72 if(obj_id == obj->getObject()->getID())
73 { 73 {
74 creator_id = obj->mPermissions->getCreator(); 74 creator_id = obj->mPermissions->getCreator();
75 break; 75 break;
76 } 76 }
77 obj = gSelectMgr->getNextNode(); 77 obj = sInstance->mObjectSelection->getNextNode();
78 } 78 }
79 if(obj) 79 if(obj)
80 { 80 {
81 LLFloaterAvatarInfo::showFromDirectory(creator_id); 81 LLFloaterAvatarInfo::showFromDirectory(creator_id);
82 } 82 }
83} 83}
84 84
85void LLFloaterInspect::onClickOwnerProfile(void* ctrl) 85void LLFloaterInspect::onClickOwnerProfile(void* ctrl)
86{ 86{
87 if(sInstance->mObjectList->getAllSelected().size() == 0) return; 87 if(sInstance->mObjectList->getAllSelected().size() == 0) return;
88 LLSelectNode* obj = gSelectMgr->getFirstNode(); 88 LLSelectNode* obj = sInstance->mObjectSelection->getFirstNode();
89 LLUUID obj_id, owner_id; 89 LLUUID obj_id, owner_id;
90 obj_id = sInstance->mObjectList->getFirstSelected()->getUUID(); 90 obj_id = sInstance->mObjectList->getFirstSelected()->getUUID();
91 while(obj) 91 while(obj)
92 { 92 {
93 if(obj_id == obj->getObject()->getID()) 93 if(obj_id == obj->getObject()->getID())
94 { 94 {
95 owner_id = obj->mPermissions->getOwner(); 95 owner_id = obj->mPermissions->getOwner();
96 break; 96 break;
97 } 97 }
98 obj = gSelectMgr->getNextNode(); 98 obj = sInstance->mObjectSelection->getNextNode();
99 } 99 }
100 if(obj) 100 if(obj)
101 { 101 {
102 LLFloaterAvatarInfo::showFromDirectory(owner_id); 102 LLFloaterAvatarInfo::showFromDirectory(owner_id);
103 } 103 }
104} 104}
105 105
106BOOL LLFloaterInspect::postBuild() 106BOOL LLFloaterInspect::postBuild()
107{ 107{
108 mObjectList = LLUICtrlFactory::getScrollListByName(this, "object_list"); 108 mObjectList = LLUICtrlFactory::getScrollListByName(this, "object_list");
109 childSetAction("button owner",onClickOwnerProfile, this); 109 childSetAction("button owner",onClickOwnerProfile, this);
110 childSetAction("button creator",onClickCreatorProfile, this); 110 childSetAction("button creator",onClickCreatorProfile, this);
111 childSetCommitCallback("object_list", onSelectObject); 111 childSetCommitCallback("object_list", onSelectObject);
112 refresh(); 112 return TRUE;
113 return TRUE; 113}
114} 114
115 115void LLFloaterInspect::onSelectObject(LLUICtrl* ctrl, void* user_data)
116void LLFloaterInspect::onSelectObject(LLUICtrl* ctrl, void* user_data) 116{
117{ 117 if(LLFloaterInspect::getSelectedUUID() != LLUUID::null)
118 if(LLFloaterInspect::getSelectedUUID() != LLUUID::null) 118 {
119 { 119 sInstance->childSetEnabled("button owner", true);
120 sInstance->childSetEnabled("button owner", true); 120 sInstance->childSetEnabled("button creator", true);
121 sInstance->childSetEnabled("button creator", true); 121 }
122 } 122}
123} 123
124 124LLUUID LLFloaterInspect::getSelectedUUID()
125LLUUID LLFloaterInspect::getSelectedUUID() 125{
126{ 126 if(sInstance)
127 if(sInstance) 127 {
128 { 128 if(sInstance->mObjectList->getAllSelected().size() > 0) return sInstance->mObjectList->getFirstSelected()->getUUID();
129 if(sInstance->mObjectList->getAllSelected().size() > 0) return sInstance->mObjectList->getFirstSelected()->getUUID(); 129 }
130 } 130 return LLUUID::null;
131 return LLUUID::null; 131}
132} 132
133 133void LLFloaterInspect::refresh()
134void LLFloaterInspect::refresh() 134{
135{ 135 LLUUID creator_id;
136 LLUUID creator_id; 136 LLString creator_name;
137 LLString creator_name; 137 S32 pos = mObjectList->getScrollPos();
138 S32 pos = mObjectList->getScrollPos(); 138 childSetEnabled("button owner", false);
139 childSetEnabled("button owner", false); 139 childSetEnabled("button creator", false);
140 childSetEnabled("button creator", false); 140 LLUUID selected_uuid;
141 LLUUID selected_uuid; 141 S32 selected_index = mObjectList->getFirstSelectedIndex();
142 S32 selected_index = mObjectList->getFirstSelectedIndex(); 142 if(selected_index > -1) selected_uuid = mObjectList->getFirstSelected()->getUUID();
143 if(selected_index > -1) selected_uuid = mObjectList->getFirstSelected()->getUUID(); 143 mObjectList->operateOnAll(LLScrollListCtrl::OP_DELETE);
144 mObjectList->operateOnAll(LLScrollListCtrl::OP_DELETE); 144 //List all transient objects, then all linked objects
145 //List all transient objects, then all linked objects 145 LLSelectNode* obj = mObjectSelection->getFirstNode();
146 LLSelectNode* obj = gSelectMgr->getFirstNode(); 146 LLSD row;
147 LLSD row; 147 while(obj)
148 while(obj) 148 {
149 { 149 char owner_first_name[MAX_STRING], owner_last_name[MAX_STRING];
150 char owner_first_name[MAX_STRING], owner_last_name[MAX_STRING]; 150 char creator_first_name[MAX_STRING], creator_last_name[MAX_STRING];
151 char creator_first_name[MAX_STRING], creator_last_name[MAX_STRING]; 151 char time[MAX_STRING];
152 char time[MAX_STRING]; 152 std::ostringstream owner_name, creator_name, date;
153 std::ostringstream owner_name, creator_name, date; 153 time_t timestamp = (time_t) (obj->mCreationDate/1000000);
154 time_t timestamp = (time_t) (obj->mCreationDate/1000000); 154 LLString::copy(time, ctime(&timestamp), MAX_STRING);
155 LLString::copy(time, ctime(&timestamp), MAX_STRING); 155 time[24] = '\0';
156 time[24] = '\0'; 156 date << obj->mCreationDate;
157 date << obj->mCreationDate; 157 gCacheName->getName(obj->mPermissions->getOwner(), owner_first_name, owner_last_name);
158 gCacheName->getName(obj->mPermissions->getOwner(), owner_first_name, owner_last_name); 158 owner_name << owner_first_name << " " << owner_last_name;
159 owner_name << owner_first_name << " " << owner_last_name; 159 gCacheName->getName(obj->mPermissions->getCreator(), creator_first_name, creator_last_name);
160 gCacheName->getName(obj->mPermissions->getCreator(), creator_first_name, creator_last_name); 160 creator_name << creator_first_name << " " << creator_last_name;
161 creator_name << creator_first_name << " " << creator_last_name; 161 row["id"] = obj->getObject()->getID();
162 row["id"] = obj->getObject()->getID(); 162 row["columns"][0]["column"] = "object_name";
163 row["columns"][0]["column"] = "object_name"; 163 row["columns"][0]["type"] = "text";
164 row["columns"][0]["type"] = "text"; 164 // make sure we're either at the top of the link chain
165 // make sure we're either at the top of the link chain 165 // or top of the editable chain, for attachments
166 // or top of the editable chain, for attachments 166 if(!(obj->getObject()->isRoot() || obj->getObject()->isRootEdit()))
167 if(!(obj->getObject()->isRoot() || obj->getObject()->isRootEdit())) 167 {
168 { 168 row["columns"][0]["value"] = LLString(" ") + obj->mName;
169 row["columns"][0]["value"] = LLString(" ") + obj->mName; 169 }
170 } 170 else
171 else 171 {
172 { 172 row["columns"][0]["value"] = obj->mName;
173 row["columns"][0]["value"] = obj->mName; 173 }
174 } 174 row["columns"][1]["column"] = "owner_name";
175 row["columns"][1]["column"] = "owner_name"; 175 row["columns"][1]["type"] = "text";
176 row["columns"][1]["type"] = "text"; 176 row["columns"][1]["value"] = owner_name.str().c_str();
177 row["columns"][1]["value"] = owner_name.str().c_str(); 177 row["columns"][2]["column"] = "creator_name";
178 row["columns"][2]["column"] = "creator_name"; 178 row["columns"][2]["type"] = "text";
179 row["columns"][2]["type"] = "text"; 179 row["columns"][2]["value"] = creator_name.str().c_str();
180 row["columns"][2]["value"] = creator_name.str().c_str(); 180 row["columns"][3]["column"] = "creation_date";
181 row["columns"][3]["column"] = "creation_date"; 181 row["columns"][3]["type"] = "text";
182 row["columns"][3]["type"] = "text"; 182 row["columns"][3]["value"] = time;
183 row["columns"][3]["value"] = time; 183 mObjectList->addElement(row, ADD_TOP);
184 mObjectList->addElement(row, ADD_TOP); 184 obj = mObjectSelection->getNextNode();
185 obj = gSelectMgr->getNextNode(); 185 }
186 } 186 if(selected_index > -1 && mObjectList->getItemIndex(selected_uuid) == selected_index)
187 if(selected_index > -1 && mObjectList->getItemIndex(selected_uuid) == selected_index) 187 {
188 { 188 mObjectList->selectNthItem(selected_index);
189 mObjectList->selectNthItem(selected_index); 189 }
190 } 190 else
191 else 191 {
192 { 192 mObjectList->selectNthItem(0);
193 mObjectList->selectNthItem(0); 193 }
194 } 194 onSelectObject(this, NULL);
195 onSelectObject(this, NULL); 195 mObjectList->setScrollPos(pos);
196 mObjectList->setScrollPos(pos); 196}
197} 197
198 198void LLFloaterInspect::onFocusReceived()
199void LLFloaterInspect::onFocusReceived() 199{
200{ 200 select_tool(gToolInspect);
201 select_tool(gToolInspect); 201}
202} 202
203 203void LLFloaterInspect::dirty()
204void LLFloaterInspect::dirty() 204{
205{ 205 if(sInstance)
206 if(sInstance) 206 {
207 { 207 sInstance->setDirty();
208 sInstance->setDirty(); 208 }
209 } 209}
210} 210
211 211void LLFloaterInspect::draw()
212void LLFloaterInspect::draw() 212{
213{ 213 if (mDirty)
214 if (mDirty) 214 {
215 { 215 refresh();
216 refresh(); 216 mDirty = FALSE;
217 mDirty = FALSE; 217 }
218 } 218
219 219 LLFloater::draw();
220 LLFloater::draw(); 220}
221} \ No newline at end of file 221
diff --git a/linden/indra/newview/llfloaterinspect.h b/linden/indra/newview/llfloaterinspect.h
index 2075204..51549ad 100644
--- a/linden/indra/newview/llfloaterinspect.h
+++ b/linden/indra/newview/llfloaterinspect.h
@@ -1,10 +1,10 @@
1/** 1/**
2* @file llfloaterfriends.h 2* @file llfloaterfriends.h
3* @author Cube 3* @author Cube
4* @date 2006-12-16 4* @date 2006-12-16
5* @brief Declaration of class for displaying object attributes 5* @brief Declaration of class for displaying object attributes
6* 6*
7* Copyright (c) 2005-2007, Linden Research, Inc. 7* Copyright (c) 2005-2007, Linden Research, Inc.
8* 8*
9 * The source code in this file ("Source Code") is provided by Linden Lab 9 * The source code in this file ("Source Code") is provided by Linden Lab
10 * to you under the terms of the GNU General Public License, version 2.0 10 * to you under the terms of the GNU General Public License, version 2.0
@@ -24,43 +24,46 @@
24 * 24 *
25 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO 25 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
26 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, 26 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
27 * COMPLETENESS OR PERFORMANCE. 27 * COMPLETENESS OR PERFORMANCE.
28*/ 28*/
29 29
30#ifndef LL_LLFLOATERINSPECT_H 30#ifndef LL_LLFLOATERINSPECT_H
31#define LL_LLFLOATERINSPECT_H 31#define LL_LLFLOATERINSPECT_H
32 32
33#include "llfloater.h" 33#include "llfloater.h"
34 34
35//class LLTool; 35//class LLTool;
36class LLScrollListCtrl; 36class LLObjectSelection;
37class LLUICtrl; 37class LLScrollListCtrl;
38 38class LLUICtrl;
39class LLFloaterInspect : public LLFloater 39
40{ 40class LLFloaterInspect : public LLFloater
41public: 41{
42 virtual ~LLFloaterInspect(void); 42public:
43 static void show(void* ignored = NULL); 43 virtual ~LLFloaterInspect(void);
44 virtual BOOL postBuild(); 44 static void show(void* ignored = NULL);
45 static void dirty(); 45 virtual BOOL postBuild();
46 static LLUUID getSelectedUUID(); 46 static void dirty();
47 virtual void draw(); 47 static LLUUID getSelectedUUID();
48 virtual void refresh(); 48 virtual void draw();
49 static BOOL isVisible(); 49 virtual void refresh();
50 virtual void onFocusReceived(); 50 static BOOL isVisible();
51 static void onClickCreatorProfile(void* ctrl); 51 virtual void onFocusReceived();
52 static void onClickOwnerProfile(void* ctrl); 52 static void onClickCreatorProfile(void* ctrl);
53 static void onSelectObject(LLUICtrl* ctrl, void* user_data); 53 static void onClickOwnerProfile(void* ctrl);
54 LLScrollListCtrl* mObjectList; 54 static void onSelectObject(LLUICtrl* ctrl, void* user_data);
55protected: 55 LLScrollListCtrl* mObjectList;
56 // protected members 56protected:
57 LLFloaterInspect(); 57 // protected members
58 void setDirty() { mDirty = TRUE; } 58 LLFloaterInspect();
59 bool mDirty; 59 void setDirty() { mDirty = TRUE; }
60 60 bool mDirty;
61private: 61
62 // static data 62private:
63 static LLFloaterInspect* sInstance; 63 // static data
64}; 64 static LLFloaterInspect* sInstance;
65 65
66#endif //LL_LLFLOATERINSPECT_H \ No newline at end of file 66 LLHandle<LLObjectSelection> mObjectSelection;
67};
68
69#endif //LL_LLFLOATERINSPECT_H
diff --git a/linden/indra/newview/llfloaterland.cpp b/linden/indra/newview/llfloaterland.cpp
index f19baa9..6bb6aff 100644
--- a/linden/indra/newview/llfloaterland.cpp
+++ b/linden/indra/newview/llfloaterland.cpp
@@ -113,7 +113,7 @@ static const BOOL BUY_PERSONAL_LAND = FALSE;
113LLFloaterLand* LLFloaterLand::sInstance = NULL; 113LLFloaterLand* LLFloaterLand::sInstance = NULL;
114LLParcelSelectionObserver* LLFloaterLand::sObserver = NULL; 114LLParcelSelectionObserver* LLFloaterLand::sObserver = NULL;
115S32 LLFloaterLand::sLastTab = 0; 115S32 LLFloaterLand::sLastTab = 0;
116BOOL LLFloaterLand::sRequestReplyOnUpdate = TRUE; 116
117LLViewHandle LLPanelLandGeneral::sBuyPassDialogHandle; 117LLViewHandle LLPanelLandGeneral::sBuyPassDialogHandle;
118 118
119// Local classes 119// Local classes
@@ -185,7 +185,7 @@ void LLFloaterLand::show()
185 gParcelMgr->addObserver( sObserver ); 185 gParcelMgr->addObserver( sObserver );
186 } 186 }
187 187
188 sInstance->open(); 188 sInstance->open(); /*Flawfinder: ignore*/
189 189
190 // Done automatically when the selected parcel's properties arrive 190 // Done automatically when the selected parcel's properties arrive
191 // (and hence we have the local id). 191 // (and hence we have the local id).
@@ -193,13 +193,11 @@ void LLFloaterLand::show()
193 193
194 // If we've already got the parcel data, fill the 194 // If we've already got the parcel data, fill the
195 // floater with it. 195 // floater with it.
196 LLParcel *parcel = gParcelMgr->getSelectedParcel(); 196 sInstance->mParcel = gParcelMgr->getFloatingParcelSelection();
197 if (parcel) 197 if (sInstance->mParcel->getParcel())
198 { 198 {
199 sInstance->refresh(); 199 sInstance->refresh();
200 } 200 }
201
202 sRequestReplyOnUpdate = TRUE;
203} 201}
204 202
205//static 203//static
@@ -233,19 +231,6 @@ void LLFloaterLand::refreshAll()
233 } 231 }
234} 232}
235 233
236
237// virtual
238BOOL LLFloaterLand::canClose()
239{
240 // canClose is checked as the first step of attempting to close
241 // the window, before focus is released from controls. Since we're
242 // closing the window and deselecting the land, we
243 // don't want replies to the upstream messages that get sent
244 // (because the reply will cause the land to be selected again).
245 sRequestReplyOnUpdate = FALSE;
246 return TRUE;
247}
248
249// virtual 234// virtual
250void LLFloaterLand::onClose(bool app_quitting) 235void LLFloaterLand::onClose(bool app_quitting)
251{ 236{
@@ -253,10 +238,6 @@ void LLFloaterLand::onClose(bool app_quitting)
253 delete sObserver; 238 delete sObserver;
254 sObserver = NULL; 239 sObserver = NULL;
255 240
256 // Must do this after removing observer, otherwise
257 // infinite loops notifying and closing.
258 gParcelMgr->deselectLand();
259
260 // Might have been showing owned objects 241 // Might have been showing owned objects
261 gSelectMgr->unhighlightAll(); 242 gSelectMgr->unhighlightAll();
262 243
@@ -321,7 +302,7 @@ void LLFloaterLand::refresh()
321void* LLFloaterLand::createPanelLandGeneral(void* data) 302void* LLFloaterLand::createPanelLandGeneral(void* data)
322{ 303{
323 LLFloaterLand* self = (LLFloaterLand*)data; 304 LLFloaterLand* self = (LLFloaterLand*)data;
324 self->mPanelGeneral = new LLPanelLandGeneral(); 305 self->mPanelGeneral = new LLPanelLandGeneral(self->mParcel);
325 return self->mPanelGeneral; 306 return self->mPanelGeneral;
326} 307}
327 308
@@ -331,7 +312,7 @@ void* LLFloaterLand::createPanelLandGeneral(void* data)
331void* LLFloaterLand::createPanelLandCovenant(void* data) 312void* LLFloaterLand::createPanelLandCovenant(void* data)
332{ 313{
333 LLFloaterLand* self = (LLFloaterLand*)data; 314 LLFloaterLand* self = (LLFloaterLand*)data;
334 self->mPanelCovenant = new LLPanelLandCovenant(); 315 self->mPanelCovenant = new LLPanelLandCovenant(self->mParcel);
335 return self->mPanelCovenant; 316 return self->mPanelCovenant;
336} 317}
337 318
@@ -340,7 +321,7 @@ void* LLFloaterLand::createPanelLandCovenant(void* data)
340void* LLFloaterLand::createPanelLandObjects(void* data) 321void* LLFloaterLand::createPanelLandObjects(void* data)
341{ 322{
342 LLFloaterLand* self = (LLFloaterLand*)data; 323 LLFloaterLand* self = (LLFloaterLand*)data;
343 self->mPanelObjects = new LLPanelLandObjects(); 324 self->mPanelObjects = new LLPanelLandObjects(self->mParcel);
344 return self->mPanelObjects; 325 return self->mPanelObjects;
345} 326}
346 327
@@ -348,7 +329,7 @@ void* LLFloaterLand::createPanelLandObjects(void* data)
348void* LLFloaterLand::createPanelLandOptions(void* data) 329void* LLFloaterLand::createPanelLandOptions(void* data)
349{ 330{
350 LLFloaterLand* self = (LLFloaterLand*)data; 331 LLFloaterLand* self = (LLFloaterLand*)data;
351 self->mPanelOptions = new LLPanelLandOptions(); 332 self->mPanelOptions = new LLPanelLandOptions(self->mParcel);
352 return self->mPanelOptions; 333 return self->mPanelOptions;
353} 334}
354 335
@@ -356,7 +337,7 @@ void* LLFloaterLand::createPanelLandOptions(void* data)
356void* LLFloaterLand::createPanelLandMedia(void* data) 337void* LLFloaterLand::createPanelLandMedia(void* data)
357{ 338{
358 LLFloaterLand* self = (LLFloaterLand*)data; 339 LLFloaterLand* self = (LLFloaterLand*)data;
359 self->mPanelMedia = new LLPanelLandMedia(); 340 self->mPanelMedia = new LLPanelLandMedia(self->mParcel);
360 return self->mPanelMedia; 341 return self->mPanelMedia;
361} 342}
362 343
@@ -364,7 +345,7 @@ void* LLFloaterLand::createPanelLandMedia(void* data)
364void* LLFloaterLand::createPanelLandAccess(void* data) 345void* LLFloaterLand::createPanelLandAccess(void* data)
365{ 346{
366 LLFloaterLand* self = (LLFloaterLand*)data; 347 LLFloaterLand* self = (LLFloaterLand*)data;
367 self->mPanelAccess = new LLPanelLandAccess(); 348 self->mPanelAccess = new LLPanelLandAccess(self->mParcel);
368 return self->mPanelAccess; 349 return self->mPanelAccess;
369} 350}
370 351
@@ -372,7 +353,7 @@ void* LLFloaterLand::createPanelLandAccess(void* data)
372void* LLFloaterLand::createPanelLandBan(void* data) 353void* LLFloaterLand::createPanelLandBan(void* data)
373{ 354{
374 LLFloaterLand* self = (LLFloaterLand*)data; 355 LLFloaterLand* self = (LLFloaterLand*)data;
375 self->mPanelBan = new LLPanelLandBan(); 356 self->mPanelBan = new LLPanelLandBan(self->mParcel);
376 return self->mPanelBan; 357 return self->mPanelBan;
377} 358}
378 359
@@ -382,9 +363,10 @@ void* LLFloaterLand::createPanelLandBan(void* data)
382//--------------------------------------------------------------------------- 363//---------------------------------------------------------------------------
383 364
384 365
385LLPanelLandGeneral::LLPanelLandGeneral() 366LLPanelLandGeneral::LLPanelLandGeneral(LLParcelSelectionHandle& parcel)
386: LLPanel("land_general_panel"), 367: LLPanel("land_general_panel"),
387 mUncheckedSell(FALSE) 368 mUncheckedSell(FALSE),
369 mParcel(parcel)
388{ 370{
389} 371}
390 372
@@ -471,9 +453,8 @@ BOOL LLPanelLandGeneral::postBuild()
471 mBtnBuyGroupLand->setClickedCallback(onClickBuyLand, (void*)&BUY_GROUP_LAND); 453 mBtnBuyGroupLand->setClickedCallback(onClickBuyLand, (void*)&BUY_GROUP_LAND);
472 454
473 455
474 static BOOL deselect_when_done = FALSE;
475 mBtnBuyPass = LLUICtrlFactory::getButtonByName(this, "Buy Pass..."); 456 mBtnBuyPass = LLUICtrlFactory::getButtonByName(this, "Buy Pass...");
476 mBtnBuyPass->setClickedCallback(onClickBuyPass, &deselect_when_done); 457 mBtnBuyPass->setClickedCallback(onClickBuyPass, this);
477 458
478 mBtnReleaseLand = LLUICtrlFactory::getButtonByName(this, "Abandon Land..."); 459 mBtnReleaseLand = LLUICtrlFactory::getButtonByName(this, "Abandon Land...");
479 mBtnReleaseLand->setClickedCallback(onClickRelease, NULL); 460 mBtnReleaseLand->setClickedCallback(onClickRelease, NULL);
@@ -498,7 +479,7 @@ void LLPanelLandGeneral::refresh()
498{ 479{
499 mBtnStartAuction->setVisible(gAgent.isGodlike()); 480 mBtnStartAuction->setVisible(gAgent.isGodlike());
500 481
501 LLParcel *parcel = gParcelMgr->getSelectedParcel(); 482 LLParcel *parcel = mParcel->getParcel();
502 bool region_owner = false; 483 bool region_owner = false;
503 LLViewerRegion* regionp = gParcelMgr->getSelectionRegion(); 484 LLViewerRegion* regionp = gParcelMgr->getSelectionRegion();
504 if(regionp && (regionp->getOwner() == gAgent.getID())) 485 if(regionp && (regionp->getOwner() == gAgent.getID()))
@@ -607,8 +588,8 @@ void LLPanelLandGeneral::refresh()
607 } 588 }
608 else if(parcel->getAuctionID()) 589 else if(parcel->getAuctionID())
609 { 590 {
610 char auction_str[MAX_STRING]; 591 char auction_str[MAX_STRING]; /*Flawfinder: ignore*/
611 sprintf(auction_str, "Auction ID: %u", parcel->getAuctionID()); 592 snprintf(auction_str, sizeof(auction_str), "Auction ID: %u", parcel->getAuctionID()); /*Flawfinder: ignore*/
612 mTextSalePending->setText(auction_str); 593 mTextSalePending->setText(auction_str);
613 mTextSalePending->setEnabled(TRUE); 594 mTextSalePending->setEnabled(TRUE);
614 } 595 }
@@ -645,7 +626,7 @@ void LLPanelLandGeneral::refresh()
645 626
646 // Display claim date 627 // Display claim date
647 time_t claim_date = parcel->getClaimDate(); 628 time_t claim_date = parcel->getClaimDate();
648 char time_buf[TIME_STR_LENGTH]; 629 char time_buf[TIME_STR_LENGTH]; /*Flawfinder: ignore*/
649 mTextClaimDate->setText(formatted_time(claim_date, time_buf)); 630 mTextClaimDate->setText(formatted_time(claim_date, time_buf));
650 mTextClaimDate->setEnabled(is_leased); 631 mTextClaimDate->setEnabled(is_leased);
651 632
@@ -735,7 +716,7 @@ void LLPanelLandGeneral::refresh()
735 gParcelMgr->canAgentBuyParcel(parcel, true)); 716 gParcelMgr->canAgentBuyParcel(parcel, true));
736 717
737 // show pricing information 718 // show pricing information
738 char price[64]; 719 char price[64]; /*Flawfinder: ignore*/
739 const char* label = NULL; 720 const char* label = NULL;
740 S32 area; 721 S32 area;
741 S32 claim_price; 722 S32 claim_price;
@@ -748,13 +729,13 @@ void LLPanelLandGeneral::refresh()
748 &dwell); 729 &dwell);
749 730
750 // Area 731 // Area
751 sprintf(price, "%d sq. m.", area); 732 snprintf(price, sizeof(price), "%d sq. m.", area); /*Flawfinder: ignore*/
752 label = AREA; 733 label = AREA;
753 734
754 mTextPriceLabel->setText(label); 735 mTextPriceLabel->setText(label);
755 mTextPrice->setText(price); 736 mTextPrice->setText(price);
756 737
757 sprintf(price, "%.0f", dwell); 738 snprintf(price, sizeof(price), "%.0f", dwell); /*Flawfinder: ignore*/
758 mTextDwell->setText(price); 739 mTextDwell->setText(price);
759 740
760 if(region_owner) 741 if(region_owner)
@@ -780,31 +761,31 @@ void LLPanelLandGeneral::refresh()
780// public 761// public
781void LLPanelLandGeneral::refreshNames() 762void LLPanelLandGeneral::refreshNames()
782{ 763{
783 LLParcel *parcel = gParcelMgr->getSelectedParcel(); 764 LLParcel *parcel = mParcel->getParcel();
784 if (!parcel) 765 if (!parcel)
785 { 766 {
786 mTextOwner->setText(""); 767 mTextOwner->setText("");
787 return; 768 return;
788 } 769 }
789 770
790 char buffer[MAX_STRING]; 771 char buffer[MAX_STRING]; /*Flawfinder: ignore*/
791 if (parcel->getIsGroupOwned()) 772 if (parcel->getIsGroupOwned())
792 { 773 {
793 buffer[0] = '\0'; 774 buffer[0] = '\0';
794 strcat(buffer, "(Group Owned)"); 775 strcat(buffer, "(Group Owned)"); /*Flawfinder: ignore*/
795 } 776 }
796 else 777 else
797 { 778 {
798 // Figure out the owner's name 779 // Figure out the owner's name
799 char owner_first[MAX_STRING]; 780 char owner_first[MAX_STRING]; /*Flawfinder: ignore*/
800 char owner_last[MAX_STRING]; 781 char owner_last[MAX_STRING]; /*Flawfinder: ignore*/
801 gCacheName->getName(parcel->getOwnerID(), owner_first, owner_last); 782 gCacheName->getName(parcel->getOwnerID(), owner_first, owner_last);
802 sprintf(buffer, "%s %s", owner_first, owner_last); 783 snprintf(buffer, sizeof(buffer), "%s %s", owner_first, owner_last); /*Flawfinder: ignore*/
803 } 784 }
804 785
805 if(LLParcel::OS_LEASE_PENDING == parcel->getOwnershipStatus()) 786 if(LLParcel::OS_LEASE_PENDING == parcel->getOwnershipStatus())
806 { 787 {
807 strcat(buffer, " (Sale Pending)"); 788 strcat(buffer, " (Sale Pending)"); /*Flawfinder: ignore*/
808 } 789 }
809 mTextOwner->setText(buffer); 790 mTextOwner->setText(buffer);
810 791
@@ -822,8 +803,8 @@ void LLPanelLandGeneral::refreshNames()
822 if(auth_buyer_id.notNull()) 803 if(auth_buyer_id.notNull())
823 { 804 {
824 LLString name; 805 LLString name;
825 char firstname[MAX_STRING]; 806 char firstname[MAX_STRING]; /*Flawfinder: ignore*/
826 char lastname[MAX_STRING]; 807 char lastname[MAX_STRING]; /*Flawfinder: ignore*/
827 gCacheName->getName(auth_buyer_id, firstname, lastname); 808 gCacheName->getName(auth_buyer_id, firstname, lastname);
828 name.assign(firstname); 809 name.assign(firstname);
829 name.append(" "); 810 name.append(" ");
@@ -860,7 +841,8 @@ void LLPanelLandGeneral::onClickSetGroup(void* userdata)
860// static 841// static
861void LLPanelLandGeneral::onClickProfile(void* data) 842void LLPanelLandGeneral::onClickProfile(void* data)
862{ 843{
863 LLParcel* parcel = gParcelMgr->getSelectedParcel(); 844 LLPanelLandGeneral* panelp = (LLPanelLandGeneral*)data;
845 LLParcel* parcel = panelp->mParcel->getParcel();
864 if (!parcel) return; 846 if (!parcel) return;
865 847
866 if (parcel->getIsGroupOwned()) 848 if (parcel->getIsGroupOwned())
@@ -885,7 +867,7 @@ void LLPanelLandGeneral::cbGroupID(LLUUID group_id, void* userdata)
885// public 867// public
886void LLPanelLandGeneral::setGroup(const LLUUID& group_id) 868void LLPanelLandGeneral::setGroup(const LLUUID& group_id)
887{ 869{
888 LLParcel* parcel = gParcelMgr->getSelectedParcel(); 870 LLParcel* parcel = mParcel->getParcel();
889 if (!parcel) return; 871 if (!parcel) return;
890 872
891 // Set parcel properties and send message 873 // Set parcel properties and send message
@@ -894,7 +876,7 @@ void LLPanelLandGeneral::setGroup(const LLUUID& group_id)
894 //mTextGroup->setText(group_name); 876 //mTextGroup->setText(group_name);
895 877
896 // Send update 878 // Send update
897 gParcelMgr->sendParcelPropertiesUpdate(parcel, LLFloaterLand::sRequestReplyOnUpdate); 879 gParcelMgr->sendParcelPropertiesUpdate(parcel);
898 880
899 // Update UI 881 // Update UI
900 refresh(); 882 refresh();
@@ -907,16 +889,17 @@ void LLPanelLandGeneral::onClickBuyLand(void* data)
907 gParcelMgr->startBuyLand(*for_group); 889 gParcelMgr->startBuyLand(*for_group);
908} 890}
909 891
910BOOL LLPanelLandGeneral::enableDeedToGroup(void*) 892BOOL LLPanelLandGeneral::enableDeedToGroup(void* data)
911{ 893{
912 LLParcel* parcel = gParcelMgr->getSelectedParcel(); 894 LLPanelLandGeneral* panelp = (LLPanelLandGeneral*)data;
895 LLParcel* parcel = panelp->mParcel->getParcel();
913 return (parcel != NULL) && (parcel->getParcelFlag(PF_ALLOW_DEED_TO_GROUP)); 896 return (parcel != NULL) && (parcel->getParcelFlag(PF_ALLOW_DEED_TO_GROUP));
914} 897}
915 898
916// static 899// static
917void LLPanelLandGeneral::onClickDeed(void*) 900void LLPanelLandGeneral::onClickDeed(void*)
918{ 901{
919 //LLParcel* parcel = gParcelMgr->getSelectedParcel(); 902 //LLParcel* parcel = mParcel->getParcel();
920 //if (parcel) 903 //if (parcel)
921 //{ 904 //{
922 gParcelMgr->startDeedLandToGroup(); 905 gParcelMgr->startDeedLandToGroup();
@@ -937,39 +920,43 @@ void LLPanelLandGeneral::onClickReclaim(void*)
937} 920}
938 921
939// static 922// static
940BOOL LLPanelLandGeneral::enableBuyPass(void*) 923BOOL LLPanelLandGeneral::enableBuyPass(void* data)
941{ 924{
942 LLParcel* parcel = gParcelMgr->getSelectedParcel(); 925 LLPanelLandGeneral* panelp = (LLPanelLandGeneral*)data;
926 LLParcel* parcel = panelp != NULL ? panelp->mParcel->getParcel() : gParcelMgr->getParcelSelection()->getParcel();
943 return (parcel != NULL) && (parcel->getParcelFlag(PF_USE_PASS_LIST) && !gParcelMgr->isCollisionBanned()); 927 return (parcel != NULL) && (parcel->getParcelFlag(PF_USE_PASS_LIST) && !gParcelMgr->isCollisionBanned());
944} 928}
945 929
946 930
947// static 931// static
948void LLPanelLandGeneral::onClickBuyPass(void* deselect_when_done) 932void LLPanelLandGeneral::onClickBuyPass(void* data)
949{ 933{
950 LLParcel* parcel = gParcelMgr->getSelectedParcel(); 934 LLPanelLandGeneral* panelp = (LLPanelLandGeneral*)data;
935 LLParcel* parcel = panelp != NULL ? panelp->mParcel->getParcel() : gParcelMgr->getParcelSelection()->getParcel();
936
951 if (!parcel) return; 937 if (!parcel) return;
952 938
953 S32 pass_price = parcel->getPassPrice(); 939 S32 pass_price = parcel->getPassPrice();
954 const char* parcel_name = parcel->getName(); 940 const char* parcel_name = parcel->getName();
955 F32 pass_hours = parcel->getPassHours(); 941 F32 pass_hours = parcel->getPassHours();
956 942
957 char cost[256], time[256]; 943 char cost[256], time[256]; /*Flawfinder: ignore*/
958 sprintf(cost, "%d", pass_price); 944 snprintf(cost, sizeof(cost), "%d", pass_price); /*Flawfinder: ignore*/
959 sprintf(time, "%.2f", pass_hours); 945 snprintf(time, sizeof(time), "%.2f", pass_hours); /*Flawfinder: ignore*/
960 946
961 LLStringBase<char>::format_map_t args; 947 LLStringBase<char>::format_map_t args;
962 args["[COST]"] = cost; 948 args["[COST]"] = cost;
963 args["[PARCEL_NAME]"] = parcel_name; 949 args["[PARCEL_NAME]"] = parcel_name;
964 args["[TIME]"] = time; 950 args["[TIME]"] = time;
965 951
966 sBuyPassDialogHandle = gViewerWindow->alertXml("LandBuyPass", args, cbBuyPass, deselect_when_done)->getHandle(); 952 sBuyPassDialogHandle = gViewerWindow->alertXml("LandBuyPass", args, cbBuyPass)->getHandle();
967} 953}
968 954
969// static 955// static
970void LLPanelLandGeneral::onClickStartAuction(void*) 956void LLPanelLandGeneral::onClickStartAuction(void* data)
971{ 957{
972 LLParcel* parcelp = gParcelMgr->getSelectedParcel(); 958 LLPanelLandGeneral* panelp = (LLPanelLandGeneral*)data;
959 LLParcel* parcelp = panelp->mParcel->getParcel();
973 if(parcelp) 960 if(parcelp)
974 { 961 {
975 if(parcelp->getForSale()) 962 if(parcelp->getForSale())
@@ -986,18 +973,11 @@ void LLPanelLandGeneral::onClickStartAuction(void*)
986// static 973// static
987void LLPanelLandGeneral::cbBuyPass(S32 option, void* data) 974void LLPanelLandGeneral::cbBuyPass(S32 option, void* data)
988{ 975{
989 BOOL deselect_when_done = (BOOL)(intptr_t)data;
990
991 if (0 == option) 976 if (0 == option)
992 { 977 {
993 // User clicked OK 978 // User clicked OK
994 gParcelMgr->buyPass(); 979 gParcelMgr->buyPass();
995 } 980 }
996
997 if (deselect_when_done)
998 {
999 gParcelMgr->deselectLand();
1000 }
1001} 981}
1002 982
1003//static 983//static
@@ -1011,7 +991,7 @@ void LLPanelLandGeneral::onCommitAny(LLUICtrl *ctrl, void *userdata)
1011{ 991{
1012 LLPanelLandGeneral *panelp = (LLPanelLandGeneral *)userdata; 992 LLPanelLandGeneral *panelp = (LLPanelLandGeneral *)userdata;
1013 993
1014 LLParcel* parcel = gParcelMgr->getSelectedParcel(); 994 LLParcel* parcel = panelp->mParcel->getParcel();
1015 if (!parcel) 995 if (!parcel)
1016 { 996 {
1017 return; 997 return;
@@ -1034,7 +1014,7 @@ void LLPanelLandGeneral::onCommitAny(LLUICtrl *ctrl, void *userdata)
1034 parcel->setContributeWithDeed(contribute_with_deed); 1014 parcel->setContributeWithDeed(contribute_with_deed);
1035 1015
1036 // Send update to server 1016 // Send update to server
1037 gParcelMgr->sendParcelPropertiesUpdate( parcel, LLFloaterLand::sRequestReplyOnUpdate ); 1017 gParcelMgr->sendParcelPropertiesUpdate( parcel );
1038 1018
1039 // Might have changed properties, so let's redraw! 1019 // Might have changed properties, so let's redraw!
1040 panelp->refresh(); 1020 panelp->refresh();
@@ -1049,20 +1029,21 @@ void LLPanelLandGeneral::onClickSellLand(void* data)
1049// static 1029// static
1050void LLPanelLandGeneral::onClickStopSellLand(void* data) 1030void LLPanelLandGeneral::onClickStopSellLand(void* data)
1051{ 1031{
1052 LLParcel* parcel = gParcelMgr->getSelectedParcel(); 1032 LLPanelLandGeneral* panelp = (LLPanelLandGeneral*)data;
1033 LLParcel* parcel = panelp->mParcel->getParcel();
1053 1034
1054 parcel->setParcelFlag(PF_FOR_SALE, FALSE); 1035 parcel->setParcelFlag(PF_FOR_SALE, FALSE);
1055 parcel->setSalePrice(0); 1036 parcel->setSalePrice(0);
1056 parcel->setAuthorizedBuyerID(LLUUID::null); 1037 parcel->setAuthorizedBuyerID(LLUUID::null);
1057 1038
1058 gParcelMgr->sendParcelPropertiesUpdate(parcel, LLFloaterLand::sRequestReplyOnUpdate); 1039 gParcelMgr->sendParcelPropertiesUpdate(parcel);
1059} 1040}
1060 1041
1061//--------------------------------------------------------------------------- 1042//---------------------------------------------------------------------------
1062// LLPanelLandObjects 1043// LLPanelLandObjects
1063//--------------------------------------------------------------------------- 1044//---------------------------------------------------------------------------
1064LLPanelLandObjects::LLPanelLandObjects() 1045LLPanelLandObjects::LLPanelLandObjects(LLParcelSelectionHandle& parcel)
1065: LLPanel("land_objects_panel") 1046: LLPanel("land_objects_panel"), mParcel(parcel)
1066{ 1047{
1067} 1048}
1068 1049
@@ -1230,7 +1211,7 @@ void LLPanelLandObjects::onDoubleClickOwner(void *userdata)
1230// public 1211// public
1231void LLPanelLandObjects::refresh() 1212void LLPanelLandObjects::refresh()
1232{ 1213{
1233 LLParcel *parcel = gParcelMgr->getSelectedParcel(); 1214 LLParcel *parcel = mParcel->getParcel();
1234 1215
1235 mBtnShowOwnerObjects->setEnabled(FALSE); 1216 mBtnShowOwnerObjects->setEnabled(FALSE);
1236 mBtnShowGroupObjects->setEnabled(FALSE); 1217 mBtnShowGroupObjects->setEnabled(FALSE);
@@ -1258,16 +1239,16 @@ void LLPanelLandObjects::refresh()
1258 } 1239 }
1259 else 1240 else
1260 { 1241 {
1261 char count[MAX_STRING]; 1242 char count[MAX_STRING]; /*Flawfinder: ignore*/
1262 S32 sw_max; 1243 S32 sw_max = 0;
1263 S32 sw_total; 1244 S32 sw_total = 0;
1264 S32 max; 1245 S32 max = 0;
1265 S32 total; 1246 S32 total = 0;
1266 S32 owned; 1247 S32 owned = 0;
1267 S32 group; 1248 S32 group = 0;
1268 S32 other; 1249 S32 other = 0;
1269 S32 selected; 1250 S32 selected = 0;
1270 F32 parcel_object_bonus; 1251 F32 parcel_object_bonus = 0.f;
1271 1252
1272 gParcelMgr->getPrimInfo(sw_max, sw_total, 1253 gParcelMgr->getPrimInfo(sw_max, sw_total,
1273 max, total, owned, group, other, selected, 1254 max, total, owned, group, other, selected,
@@ -1285,7 +1266,7 @@ void LLPanelLandObjects::refresh()
1285 1266
1286 if (parcel_object_bonus != 1.0f) 1267 if (parcel_object_bonus != 1.0f)
1287 { 1268 {
1288 sprintf(count, "Region Object Bonus Factor: %.2f", 1269 snprintf(count, sizeof(count), "Region Object Bonus Factor: %.2f", /*Flawfinder: ignore*/
1289 parcel_object_bonus); 1270 parcel_object_bonus);
1290 mParcelObjectBonus->setText(count); 1271 mParcelObjectBonus->setText(count);
1291 } 1272 }
@@ -1296,35 +1277,35 @@ void LLPanelLandObjects::refresh()
1296 1277
1297 if (sw_total > sw_max) 1278 if (sw_total > sw_max)
1298 { 1279 {
1299 sprintf(count, "%d out of %d (%d will be deleted)", 1280 snprintf(count, sizeof(count), "%d out of %d (%d will be deleted)", /*Flawfinder: ignore*/
1300 sw_total, sw_max, sw_total - sw_max); 1281 sw_total, sw_max, sw_total - sw_max);
1301 } 1282 }
1302 else 1283 else
1303 { 1284 {
1304 sprintf(count, "%d out of %d (%d available)", 1285 snprintf(count, sizeof(count), "%d out of %d (%d available)", /*Flawfinder: ignore*/
1305 sw_total, sw_max, sw_max - sw_total); 1286 sw_total, sw_max, sw_max - sw_total);
1306 } 1287 }
1307 mSWTotalObjects->setText(count); 1288 mSWTotalObjects->setText(count);
1308 1289
1309 sprintf(count, "%d", max); 1290 snprintf(count, sizeof(count), "%d", max); /*Flawfinder: ignore*/
1310 mObjectContribution->setText(count); 1291 mObjectContribution->setText(count);
1311 1292
1312 sprintf(count, "%d", total); 1293 snprintf(count, sizeof(count), "%d", total); /*Flawfinder: ignore*/
1313 mTotalObjects->setText(count); 1294 mTotalObjects->setText(count);
1314 1295
1315 sprintf(count, "%d", owned); 1296 snprintf(count, sizeof(count), "%d", owned); /*Flawfinder: ignore*/
1316 mOwnerObjects->setText(count); 1297 mOwnerObjects->setText(count);
1317 1298
1318 sprintf(count, "%d", group); 1299 snprintf(count, sizeof(count), "%d", group); /*Flawfinder: ignore*/
1319 mGroupObjects->setText(count); 1300 mGroupObjects->setText(count);
1320 1301
1321 sprintf(count, "%d", other); 1302 snprintf(count, sizeof(count), "%d", other); /*Flawfinder: ignore*/
1322 mOtherObjects->setText(count); 1303 mOtherObjects->setText(count);
1323 1304
1324 sprintf(count, "%d", selected); 1305 snprintf(count, sizeof(count), "%d", selected); /*Flawfinder: ignore*/
1325 mSelectedObjects->setText(count); 1306 mSelectedObjects->setText(count);
1326 1307
1327 sprintf(count, "%d", mOtherTime); 1308 snprintf(count, sizeof(count), "%d", mOtherTime); /*Flawfinder: ignore*/
1328 mCleanOtherObjectsTime->setText(count); 1309 mCleanOtherObjectsTime->setText(count);
1329 1310
1330 BOOL can_return_owned = LLViewerParcelMgr::isParcelModifiableByAgent(parcel, GP_LAND_RETURN_GROUP_OWNED); 1311 BOOL can_return_owned = LLViewerParcelMgr::isParcelModifiableByAgent(parcel, GP_LAND_RETURN_GROUP_OWNED);
@@ -1425,7 +1406,7 @@ void send_return_objects_message(S32 parcel_local_id, S32 return_type,
1425void LLPanelLandObjects::callbackReturnOwnerObjects(S32 option, void* userdata) 1406void LLPanelLandObjects::callbackReturnOwnerObjects(S32 option, void* userdata)
1426{ 1407{
1427 LLPanelLandObjects *lop = (LLPanelLandObjects *)userdata; 1408 LLPanelLandObjects *lop = (LLPanelLandObjects *)userdata;
1428 LLParcel *parcel = gParcelMgr->getSelectedParcel(); 1409 LLParcel *parcel = lop->mParcel->getParcel();
1429 if (0 == option) 1410 if (0 == option)
1430 { 1411 {
1431 if (parcel) 1412 if (parcel)
@@ -1438,8 +1419,8 @@ void LLPanelLandObjects::callbackReturnOwnerObjects(S32 option, void* userdata)
1438 } 1419 }
1439 else 1420 else
1440 { 1421 {
1441 char first[DB_FIRST_NAME_BUF_SIZE]; 1422 char first[DB_FIRST_NAME_BUF_SIZE]; /*Flawfinder: ignore*/
1442 char last[DB_LAST_NAME_BUF_SIZE]; 1423 char last[DB_LAST_NAME_BUF_SIZE]; /*Flawfinder: ignore*/
1443 gCacheName->getName(owner_id, first, last); 1424 gCacheName->getName(owner_id, first, last);
1444 args["[FIRST]"] = first; 1425 args["[FIRST]"] = first;
1445 args["[LAST]"] = last; 1426 args["[LAST]"] = last;
@@ -1450,7 +1431,7 @@ void LLPanelLandObjects::callbackReturnOwnerObjects(S32 option, void* userdata)
1450 } 1431 }
1451 1432
1452 gSelectMgr->unhighlightAll(); 1433 gSelectMgr->unhighlightAll();
1453 gParcelMgr->sendParcelPropertiesUpdate( parcel, LLFloaterLand::sRequestReplyOnUpdate ); 1434 gParcelMgr->sendParcelPropertiesUpdate( parcel );
1454 lop->refresh(); 1435 lop->refresh();
1455} 1436}
1456 1437
@@ -1458,12 +1439,12 @@ void LLPanelLandObjects::callbackReturnOwnerObjects(S32 option, void* userdata)
1458void LLPanelLandObjects::callbackReturnGroupObjects(S32 option, void* userdata) 1439void LLPanelLandObjects::callbackReturnGroupObjects(S32 option, void* userdata)
1459{ 1440{
1460 LLPanelLandObjects *lop = (LLPanelLandObjects *)userdata; 1441 LLPanelLandObjects *lop = (LLPanelLandObjects *)userdata;
1461 LLParcel *parcel = gParcelMgr->getSelectedParcel(); 1442 LLParcel *parcel = lop->mParcel->getParcel();
1462 if (0 == option) 1443 if (0 == option)
1463 { 1444 {
1464 if (parcel) 1445 if (parcel)
1465 { 1446 {
1466 char group_name[MAX_STRING]; 1447 char group_name[MAX_STRING]; /*Flawfinder: ignore*/
1467 gCacheName->getGroupName(parcel->getGroupID(), group_name); 1448 gCacheName->getGroupName(parcel->getGroupID(), group_name);
1468 LLString::format_map_t args; 1449 LLString::format_map_t args;
1469 args["[GROUPNAME]"] = group_name; 1450 args["[GROUPNAME]"] = group_name;
@@ -1472,7 +1453,7 @@ void LLPanelLandObjects::callbackReturnGroupObjects(S32 option, void* userdata)
1472 } 1453 }
1473 } 1454 }
1474 gSelectMgr->unhighlightAll(); 1455 gSelectMgr->unhighlightAll();
1475 gParcelMgr->sendParcelPropertiesUpdate( parcel, LLFloaterLand::sRequestReplyOnUpdate ); 1456 gParcelMgr->sendParcelPropertiesUpdate( parcel );
1476 lop->refresh(); 1457 lop->refresh();
1477} 1458}
1478 1459
@@ -1480,7 +1461,7 @@ void LLPanelLandObjects::callbackReturnGroupObjects(S32 option, void* userdata)
1480void LLPanelLandObjects::callbackReturnOtherObjects(S32 option, void* userdata) 1461void LLPanelLandObjects::callbackReturnOtherObjects(S32 option, void* userdata)
1481{ 1462{
1482 LLPanelLandObjects *lop = (LLPanelLandObjects *)userdata; 1463 LLPanelLandObjects *lop = (LLPanelLandObjects *)userdata;
1483 LLParcel *parcel = gParcelMgr->getSelectedParcel(); 1464 LLParcel *parcel = lop->mParcel->getParcel();
1484 if (0 == option) 1465 if (0 == option)
1485 { 1466 {
1486 if (parcel) 1467 if (parcel)
@@ -1490,7 +1471,7 @@ void LLPanelLandObjects::callbackReturnOtherObjects(S32 option, void* userdata)
1490 } 1471 }
1491 } 1472 }
1492 gSelectMgr->unhighlightAll(); 1473 gSelectMgr->unhighlightAll();
1493 gParcelMgr->sendParcelPropertiesUpdate( parcel, LLFloaterLand::sRequestReplyOnUpdate ); 1474 gParcelMgr->sendParcelPropertiesUpdate( parcel );
1494 lop->refresh(); 1475 lop->refresh();
1495} 1476}
1496 1477
@@ -1498,7 +1479,7 @@ void LLPanelLandObjects::callbackReturnOtherObjects(S32 option, void* userdata)
1498void LLPanelLandObjects::callbackReturnOwnerList(S32 option, void* userdata) 1479void LLPanelLandObjects::callbackReturnOwnerList(S32 option, void* userdata)
1499{ 1480{
1500 LLPanelLandObjects *self = (LLPanelLandObjects *)userdata; 1481 LLPanelLandObjects *self = (LLPanelLandObjects *)userdata;
1501 LLParcel *parcel = gParcelMgr->getSelectedParcel(); 1482 LLParcel *parcel = self->mParcel->getParcel();
1502 if (0 == option) 1483 if (0 == option)
1503 { 1484 {
1504 if (parcel) 1485 if (parcel)
@@ -1525,7 +1506,7 @@ void LLPanelLandObjects::callbackReturnOwnerList(S32 option, void* userdata)
1525 } 1506 }
1526 } 1507 }
1527 gSelectMgr->unhighlightAll(); 1508 gSelectMgr->unhighlightAll();
1528 gParcelMgr->sendParcelPropertiesUpdate( parcel, LLFloaterLand::sRequestReplyOnUpdate ); 1509 gParcelMgr->sendParcelPropertiesUpdate( parcel );
1529 self->refresh(); 1510 self->refresh();
1530} 1511}
1531 1512
@@ -1543,7 +1524,7 @@ void LLPanelLandObjects::onClickReturnOwnerList(void* userdata)
1543 1524
1544 gParcelMgr->getPrimInfo(sw_max, sw_total, max, total, owned, group, other, selected, parcel_object_bonus, other_time); 1525 gParcelMgr->getPrimInfo(sw_max, sw_total, max, total, owned, group, other, selected, parcel_object_bonus, other_time);
1545 1526
1546 LLParcel* parcelp = gParcelMgr->getSelectedParcel(); 1527 LLParcel* parcelp = self->mParcel->getParcel();
1547 if (!parcelp) return; 1528 if (!parcelp) return;
1548 1529
1549 // Make sure we have something selected. 1530 // Make sure we have something selected.
@@ -1577,7 +1558,7 @@ void LLPanelLandObjects::onClickRefresh(void* userdata)
1577 1558
1578 LLMessageSystem *msg = gMessageSystem; 1559 LLMessageSystem *msg = gMessageSystem;
1579 1560
1580 LLParcel* parcel = gParcelMgr->getSelectedParcel(); 1561 LLParcel* parcel = self->mParcel->getParcel();
1581 if (!parcel) return; 1562 if (!parcel) return;
1582 1563
1583 LLViewerRegion* region = gParcelMgr->getSelectionRegion(); 1564 LLViewerRegion* region = gParcelMgr->getSelectionRegion();
@@ -1614,7 +1595,7 @@ void LLPanelLandObjects::processParcelObjectOwnersReply(LLMessageSystem *msg, vo
1614 BOOL is_group_owned; 1595 BOOL is_group_owned;
1615 S32 object_count; 1596 S32 object_count;
1616 BOOL is_online; 1597 BOOL is_online;
1617 char object_count_str[MAX_STRING]; 1598 char object_count_str[MAX_STRING]; /*Flawfinder: ignore*/
1618 //BOOL b_need_refresh = FALSE; 1599 //BOOL b_need_refresh = FALSE;
1619 1600
1620 // If we were waiting for the first reply, clear the "Searching..." text. 1601 // If we were waiting for the first reply, clear the "Searching..." text.
@@ -1655,7 +1636,7 @@ void LLPanelLandObjects::processParcelObjectOwnersReply(LLMessageSystem *msg, vo
1655 // Placeholder for name. 1636 // Placeholder for name.
1656 row->addColumn("", FONT, self->mColWidth[2]); 1637 row->addColumn("", FONT, self->mColWidth[2]);
1657 1638
1658 sprintf(object_count_str, "%d", object_count); 1639 snprintf(object_count_str, sizeof(object_count_str), "%d", object_count); /*Flawfinder: ignore*/
1659 row->addColumn(object_count_str, FONT, self->mColWidth[3]); 1640 row->addColumn(object_count_str, FONT, self->mColWidth[3]);
1660 1641
1661 if (is_group_owned) 1642 if (is_group_owned)
@@ -1730,7 +1711,7 @@ void LLPanelLandObjects::onCommitList(LLUICtrl* ctrl, void* data)
1730 self->mBtnReturnOwnerList->setEnabled(TRUE); 1711 self->mBtnReturnOwnerList->setEnabled(TRUE);
1731 1712
1732 // Highlight this user's objects 1713 // Highlight this user's objects
1733 clickShowCore(RT_LIST, &(self->mSelectedOwners)); 1714 clickShowCore(self, RT_LIST, &(self->mSelectedOwners));
1734 } 1715 }
1735} 1716}
1736 1717
@@ -1757,30 +1738,30 @@ void LLPanelLandObjects::onClickName(void* userdata)
1757} 1738}
1758 1739
1759// static 1740// static
1760void LLPanelLandObjects::clickShowCore(S32 return_type, uuid_list_t* list) 1741void LLPanelLandObjects::clickShowCore(LLPanelLandObjects* self, S32 return_type, uuid_list_t* list)
1761{ 1742{
1762 LLParcel* parcel = gParcelMgr->getSelectedParcel(); 1743 LLParcel* parcel = self->mParcel->getParcel();
1763 if (!parcel) return; 1744 if (!parcel) return;
1764 1745
1765 send_parcel_select_objects(parcel->getLocalID(), return_type, list); 1746 send_parcel_select_objects(parcel->getLocalID(), return_type, list);
1766} 1747}
1767 1748
1768// static 1749// static
1769void LLPanelLandObjects::onClickShowOwnerObjects(void*) 1750void LLPanelLandObjects::onClickShowOwnerObjects(void* userdata)
1770{ 1751{
1771 clickShowCore(RT_OWNER); 1752 clickShowCore((LLPanelLandObjects*)userdata, RT_OWNER);
1772} 1753}
1773 1754
1774// static 1755// static
1775void LLPanelLandObjects::onClickShowGroupObjects(void*) 1756void LLPanelLandObjects::onClickShowGroupObjects(void* userdata)
1776{ 1757{
1777 clickShowCore(RT_GROUP); 1758 clickShowCore((LLPanelLandObjects*)userdata, (RT_GROUP));
1778} 1759}
1779 1760
1780// static 1761// static
1781void LLPanelLandObjects::onClickShowOtherObjects(void*) 1762void LLPanelLandObjects::onClickShowOtherObjects(void* userdata)
1782{ 1763{
1783 clickShowCore(RT_OTHER); 1764 clickShowCore((LLPanelLandObjects*)userdata, RT_OTHER);
1784} 1765}
1785 1766
1786// static 1767// static
@@ -1794,7 +1775,8 @@ void LLPanelLandObjects::onClickReturnOwnerObjects(void* userdata)
1794 1775
1795 gParcelMgr->getPrimInfo(sw_max, sw_total, max, total, owned, group, other, selected, parcel_object_bonus, other_time); 1776 gParcelMgr->getPrimInfo(sw_max, sw_total, max, total, owned, group, other, selected, parcel_object_bonus, other_time);
1796 1777
1797 LLParcel* parcel = gParcelMgr->getSelectedParcel(); 1778 LLPanelLandObjects* panelp = (LLPanelLandObjects*)userdata;
1779 LLParcel* parcel = panelp->mParcel->getParcel();
1798 if (!parcel) return; 1780 if (!parcel) return;
1799 1781
1800 send_parcel_select_objects(parcel->getLocalID(), RT_OWNER); 1782 send_parcel_select_objects(parcel->getLocalID(), RT_OWNER);
@@ -1810,8 +1792,8 @@ void LLPanelLandObjects::onClickReturnOwnerObjects(void* userdata)
1810 } 1792 }
1811 else 1793 else
1812 { 1794 {
1813 char first[DB_FIRST_NAME_BUF_SIZE]; 1795 char first[DB_FIRST_NAME_BUF_SIZE]; /*Flawfinder: ignore*/
1814 char last[DB_LAST_NAME_BUF_SIZE]; 1796 char last[DB_LAST_NAME_BUF_SIZE]; /*Flawfinder: ignore*/
1815 gCacheName->getName(owner_id, first, last); 1797 gCacheName->getName(owner_id, first, last);
1816 std::string name = first; 1798 std::string name = first;
1817 name += " "; 1799 name += " ";
@@ -1832,12 +1814,13 @@ void LLPanelLandObjects::onClickReturnGroupObjects(void* userdata)
1832 1814
1833 gParcelMgr->getPrimInfo(sw_max, sw_total, max, total, owned, group, other, selected, parcel_object_bonus, other_time); 1815 gParcelMgr->getPrimInfo(sw_max, sw_total, max, total, owned, group, other, selected, parcel_object_bonus, other_time);
1834 1816
1835 LLParcel* parcel = gParcelMgr->getSelectedParcel(); 1817 LLPanelLandObjects* panelp = (LLPanelLandObjects*)userdata;
1818 LLParcel* parcel = panelp->mParcel->getParcel();
1836 if (!parcel) return; 1819 if (!parcel) return;
1837 1820
1838 send_parcel_select_objects(parcel->getLocalID(), RT_GROUP); 1821 send_parcel_select_objects(parcel->getLocalID(), RT_GROUP);
1839 1822
1840 char group_name[MAX_STRING]; 1823 char group_name[MAX_STRING]; /*Flawfinder: ignore*/
1841 gCacheName->getGroupName(parcel->getGroupID(), group_name); 1824 gCacheName->getGroupName(parcel->getGroupID(), group_name);
1842 1825
1843 LLStringBase<char>::format_map_t args; 1826 LLStringBase<char>::format_map_t args;
@@ -1859,7 +1842,8 @@ void LLPanelLandObjects::onClickReturnOtherObjects(void* userdata)
1859 1842
1860 gParcelMgr->getPrimInfo(sw_max, sw_total, max, total, owned, group, other, selected, parcel_object_bonus, other_time); 1843 gParcelMgr->getPrimInfo(sw_max, sw_total, max, total, owned, group, other, selected, parcel_object_bonus, other_time);
1861 1844
1862 LLParcel* parcel = gParcelMgr->getSelectedParcel(); 1845 LLPanelLandObjects* panelp = (LLPanelLandObjects*)userdata;
1846 LLParcel* parcel = panelp->mParcel->getParcel();
1863 if (!parcel) return; 1847 if (!parcel) return;
1864 1848
1865 send_parcel_select_objects(parcel->getLocalID(), RT_OTHER); 1849 send_parcel_select_objects(parcel->getLocalID(), RT_OTHER);
@@ -1869,7 +1853,7 @@ void LLPanelLandObjects::onClickReturnOtherObjects(void* userdata)
1869 1853
1870 if (parcel->getIsGroupOwned()) 1854 if (parcel->getIsGroupOwned())
1871 { 1855 {
1872 char group_name[MAX_STRING]; 1856 char group_name[MAX_STRING]; /*Flawfinder: ignore*/
1873 gCacheName->getGroupName(parcel->getGroupID(), group_name); 1857 gCacheName->getGroupName(parcel->getGroupID(), group_name);
1874 args["[NAME]"] = group_name; 1858 args["[NAME]"] = group_name;
1875 1859
@@ -1885,8 +1869,8 @@ void LLPanelLandObjects::onClickReturnOtherObjects(void* userdata)
1885 } 1869 }
1886 else 1870 else
1887 { 1871 {
1888 char first[DB_FIRST_NAME_BUF_SIZE]; 1872 char first[DB_FIRST_NAME_BUF_SIZE]; /*Flawfinder: ignore*/
1889 char last[DB_LAST_NAME_BUF_SIZE]; 1873 char last[DB_LAST_NAME_BUF_SIZE]; /*Flawfinder: ignore*/
1890 gCacheName->getName(owner_id, first, last); 1874 gCacheName->getName(owner_id, first, last);
1891 std::string name; 1875 std::string name;
1892 name += first; 1876 name += first;
@@ -1903,7 +1887,7 @@ void LLPanelLandObjects::onClickReturnOtherObjects(void* userdata)
1903void LLPanelLandObjects::onLostFocus(LLLineEditor *caller, void* user_data) 1887void LLPanelLandObjects::onLostFocus(LLLineEditor *caller, void* user_data)
1904{ 1888{
1905 LLPanelLandObjects *lop = (LLPanelLandObjects *)user_data; 1889 LLPanelLandObjects *lop = (LLPanelLandObjects *)user_data;
1906 LLParcel *parcel = gParcelMgr->getSelectedParcel(); 1890 LLParcel* parcel = lop->mParcel->getParcel();
1907 if (parcel) 1891 if (parcel)
1908 { 1892 {
1909 lop->mOtherTime = atoi(lop->mCleanOtherObjectsTime->getText().c_str()); 1893 lop->mOtherTime = atoi(lop->mCleanOtherObjectsTime->getText().c_str());
@@ -1918,7 +1902,7 @@ void LLPanelLandObjects::onLostFocus(LLLineEditor *caller, void* user_data)
1918// LLPanelLandOptions 1902// LLPanelLandOptions
1919//--------------------------------------------------------------------------- 1903//---------------------------------------------------------------------------
1920 1904
1921LLPanelLandOptions::LLPanelLandOptions() 1905LLPanelLandOptions::LLPanelLandOptions(LLParcelSelectionHandle& parcel)
1922: LLPanel("land_options_panel"), 1906: LLPanel("land_options_panel"),
1923 mCheckEditObjects(NULL), 1907 mCheckEditObjects(NULL),
1924 mCheckEditGroupObjects(NULL), 1908 mCheckEditGroupObjects(NULL),
@@ -1940,7 +1924,8 @@ LLPanelLandOptions::LLPanelLandOptions()
1940 mAllowPublishCtrl(NULL), 1924 mAllowPublishCtrl(NULL),
1941 mMatureCtrl(NULL), 1925 mMatureCtrl(NULL),
1942 mPushRestrictionCtrl(NULL), 1926 mPushRestrictionCtrl(NULL),
1943 mPublishHelpButton(NULL) 1927 mPublishHelpButton(NULL),
1928 mParcel(parcel)
1944{ 1929{
1945 1930
1946} 1931}
@@ -2073,7 +2058,7 @@ LLPanelLandOptions::~LLPanelLandOptions()
2073// public 2058// public
2074void LLPanelLandOptions::refresh() 2059void LLPanelLandOptions::refresh()
2075{ 2060{
2076 LLParcel *parcel = gParcelMgr->getSelectedParcel(); 2061 LLParcel *parcel = mParcel->getParcel();
2077 2062
2078 if (!parcel) 2063 if (!parcel)
2079 { 2064 {
@@ -2208,8 +2193,8 @@ void LLPanelLandOptions::refresh()
2208 } 2193 }
2209 else 2194 else
2210 { 2195 {
2211 char buffer[256]; 2196 char buffer[256]; /*Flawfinder: ignore*/
2212 sprintf(buffer, "Landing Point: %d, %d, %d", 2197 snprintf(buffer, sizeof(buffer), "Landing Point: %d, %d, %d", /*Flawfinder: ignore*/
2213 llround(pos.mV[VX]), 2198 llround(pos.mV[VX]),
2214 llround(pos.mV[VY]), 2199 llround(pos.mV[VY]),
2215 llround(pos.mV[VZ])); 2200 llround(pos.mV[VZ]));
@@ -2244,7 +2229,7 @@ void LLPanelLandOptions::onCommitAny(LLUICtrl *ctrl, void *userdata)
2244{ 2229{
2245 LLPanelLandOptions *self = (LLPanelLandOptions *)userdata; 2230 LLPanelLandOptions *self = (LLPanelLandOptions *)userdata;
2246 2231
2247 LLParcel* parcel = gParcelMgr->getSelectedParcel(); 2232 LLParcel* parcel = self->mParcel->getParcel();
2248 if (!parcel) 2233 if (!parcel)
2249 { 2234 {
2250 return; 2235 return;
@@ -2298,7 +2283,7 @@ void LLPanelLandOptions::onCommitAny(LLUICtrl *ctrl, void *userdata)
2298 parcel->setSnapshotID(snapshot_id); 2283 parcel->setSnapshotID(snapshot_id);
2299 2284
2300 // Send current parcel data upstream to server 2285 // Send current parcel data upstream to server
2301 gParcelMgr->sendParcelPropertiesUpdate( parcel, LLFloaterLand::sRequestReplyOnUpdate ); 2286 gParcelMgr->sendParcelPropertiesUpdate( parcel );
2302 2287
2303 // Might have changed properties, so let's redraw! 2288 // Might have changed properties, so let's redraw!
2304 self->refresh(); 2289 self->refresh();
@@ -2310,7 +2295,7 @@ void LLPanelLandOptions::onClickSet(void* userdata)
2310{ 2295{
2311 LLPanelLandOptions* self = (LLPanelLandOptions*)userdata; 2296 LLPanelLandOptions* self = (LLPanelLandOptions*)userdata;
2312 2297
2313 LLParcel* selected_parcel = gParcelMgr->getSelectedParcel(); 2298 LLParcel* selected_parcel = self->mParcel->getParcel();
2314 if (!selected_parcel) return; 2299 if (!selected_parcel) return;
2315 2300
2316 LLParcel* agent_parcel = gParcelMgr->getAgentParcel(); 2301 LLParcel* agent_parcel = gParcelMgr->getAgentParcel();
@@ -2326,7 +2311,7 @@ void LLPanelLandOptions::onClickSet(void* userdata)
2326 selected_parcel->setUserLocation(pos_region); 2311 selected_parcel->setUserLocation(pos_region);
2327 selected_parcel->setUserLookAt(gAgent.getFrameAgent().getAtAxis()); 2312 selected_parcel->setUserLookAt(gAgent.getFrameAgent().getAtAxis());
2328 2313
2329 gParcelMgr->sendParcelPropertiesUpdate(selected_parcel, LLFloaterLand::sRequestReplyOnUpdate); 2314 gParcelMgr->sendParcelPropertiesUpdate(selected_parcel);
2330 2315
2331 self->refresh(); 2316 self->refresh();
2332} 2317}
@@ -2335,7 +2320,7 @@ void LLPanelLandOptions::onClickClear(void* userdata)
2335{ 2320{
2336 LLPanelLandOptions* self = (LLPanelLandOptions*)userdata; 2321 LLPanelLandOptions* self = (LLPanelLandOptions*)userdata;
2337 2322
2338 LLParcel* selected_parcel = gParcelMgr->getSelectedParcel(); 2323 LLParcel* selected_parcel = self->mParcel->getParcel();
2339 if (!selected_parcel) return; 2324 if (!selected_parcel) return;
2340 2325
2341 // yes, this magic number of 0,0,0 means that it is clear 2326 // yes, this magic number of 0,0,0 means that it is clear
@@ -2343,7 +2328,7 @@ void LLPanelLandOptions::onClickClear(void* userdata)
2343 selected_parcel->setUserLocation(zero_vec); 2328 selected_parcel->setUserLocation(zero_vec);
2344 selected_parcel->setUserLookAt(zero_vec); 2329 selected_parcel->setUserLookAt(zero_vec);
2345 2330
2346 gParcelMgr->sendParcelPropertiesUpdate(selected_parcel, LLFloaterLand::sRequestReplyOnUpdate); 2331 gParcelMgr->sendParcelPropertiesUpdate(selected_parcel);
2347 2332
2348 self->refresh(); 2333 self->refresh();
2349} 2334}
@@ -2358,8 +2343,8 @@ void LLPanelLandOptions::onClickPublishHelp(void*)
2358// LLPanelLandMedia 2343// LLPanelLandMedia
2359//--------------------------------------------------------------------------- 2344//---------------------------------------------------------------------------
2360 2345
2361LLPanelLandMedia::LLPanelLandMedia() 2346LLPanelLandMedia::LLPanelLandMedia(LLParcelSelectionHandle& parcel)
2362: LLPanel("land_media_panel") 2347: LLPanel("land_media_panel"), mParcel(parcel)
2363{ 2348{
2364} 2349}
2365 2350
@@ -2401,7 +2386,7 @@ LLPanelLandMedia::~LLPanelLandMedia()
2401// public 2386// public
2402void LLPanelLandMedia::refresh() 2387void LLPanelLandMedia::refresh()
2403{ 2388{
2404 LLParcel *parcel = gParcelMgr->getSelectedParcel(); 2389 LLParcel *parcel = mParcel->getParcel();
2405 2390
2406 if (!parcel) 2391 if (!parcel)
2407 { 2392 {
@@ -2486,7 +2471,7 @@ void LLPanelLandMedia::onCommitAny(LLUICtrl *ctrl, void *userdata)
2486{ 2471{
2487 LLPanelLandMedia *self = (LLPanelLandMedia *)userdata; 2472 LLPanelLandMedia *self = (LLPanelLandMedia *)userdata;
2488 2473
2489 LLParcel* parcel = gParcelMgr->getSelectedParcel(); 2474 LLParcel* parcel = self->mParcel->getParcel();
2490 if (!parcel) 2475 if (!parcel)
2491 { 2476 {
2492 return; 2477 return;
@@ -2507,7 +2492,7 @@ void LLPanelLandMedia::onCommitAny(LLUICtrl *ctrl, void *userdata)
2507 parcel->setMediaAutoScale ( media_auto_scale ); 2492 parcel->setMediaAutoScale ( media_auto_scale );
2508 2493
2509 // Send current parcel data upstream to server 2494 // Send current parcel data upstream to server
2510 gParcelMgr->sendParcelPropertiesUpdate( parcel, LLFloaterLand::sRequestReplyOnUpdate ); 2495 gParcelMgr->sendParcelPropertiesUpdate( parcel );
2511 2496
2512 // Might have changed properties, so let's redraw! 2497 // Might have changed properties, so let's redraw!
2513 self->refresh(); 2498 self->refresh();
@@ -2531,8 +2516,8 @@ void LLPanelLandMedia::onClickStartMedia ( void* data )
2531// LLPanelLandAccess 2516// LLPanelLandAccess
2532//--------------------------------------------------------------------------- 2517//---------------------------------------------------------------------------
2533 2518
2534LLPanelLandAccess::LLPanelLandAccess() 2519LLPanelLandAccess::LLPanelLandAccess(LLParcelSelectionHandle& parcel)
2535: LLPanel("land_access_panel") 2520: LLPanel("land_access_panel"), mParcel(parcel)
2536{ 2521{
2537} 2522}
2538 2523
@@ -2574,32 +2559,33 @@ BOOL LLPanelLandAccess::postBuild()
2574 2559
2575 2560
2576LLPanelLandAccess::~LLPanelLandAccess() 2561LLPanelLandAccess::~LLPanelLandAccess()
2577{ } 2562{
2563}
2578 2564
2579void LLPanelLandAccess::refresh() 2565void LLPanelLandAccess::refresh()
2580{ 2566{
2581 mListAccess->deleteAllItems(); 2567 mListAccess->deleteAllItems();
2582 2568
2583 LLParcel *parcel = gParcelMgr->getSelectedParcel(); 2569 LLParcel *parcel = mParcel->getParcel();
2584 2570
2585 if (parcel) 2571 if (parcel)
2586 { 2572 {
2587 char label[256]; 2573 char label[256]; /*Flawfinder: ignore*/
2588 2574
2589 // Display options 2575 // Display options
2590 BOOL use_group = parcel->getParcelFlag(PF_USE_ACCESS_GROUP); 2576 BOOL use_group = parcel->getParcelFlag(PF_USE_ACCESS_GROUP);
2591 mCheckGroup->set( use_group ); 2577 mCheckGroup->set( use_group );
2592 2578
2593 char group_name[MAX_STRING]; 2579 char group_name[MAX_STRING]; /*Flawfinder: ignore*/
2594 gCacheName->getGroupName(parcel->getGroupID(), group_name); 2580 gCacheName->getGroupName(parcel->getGroupID(), group_name);
2595 sprintf(label, "Group: %s", group_name); 2581 snprintf(label, sizeof(label), "Group: %s", group_name); /*Flawfinder: ignore*/
2596 mCheckGroup->setLabel( label ); 2582 mCheckGroup->setLabel( label );
2597 2583
2598 S32 count = parcel->mAccessList.size(); 2584 S32 count = parcel->mAccessList.size();
2599 2585
2600 BOOL use_list = parcel->getParcelFlag(PF_USE_ACCESS_LIST); 2586 BOOL use_list = parcel->getParcelFlag(PF_USE_ACCESS_LIST);
2601 mCheckAccess->set( use_list ); 2587 mCheckAccess->set( use_list );
2602 sprintf(label, "Avatars: (%d listed, %d max)", 2588 snprintf(label, sizeof(label), "Avatars: (%d listed, %d max)", /*Flawfinder: ignore*/
2603 count, PARCEL_MAX_ACCESS_LIST); 2589 count, PARCEL_MAX_ACCESS_LIST);
2604 mCheckAccess->setLabel( label ); 2590 mCheckAccess->setLabel( label );
2605 2591
@@ -2618,8 +2604,8 @@ void LLPanelLandAccess::refresh()
2618 suffix.assign(" ("); 2604 suffix.assign(" (");
2619 if (seconds >= 120) 2605 if (seconds >= 120)
2620 { 2606 {
2621 char buf[30]; 2607 char buf[30]; /*Flawfinder: ignore*/
2622 sprintf(buf, "%d minutes", (seconds/60)); 2608 snprintf(buf, sizeof(buf), "%d minutes", (seconds/60)); /*Flawfinder: ignore*/
2623 suffix.append(buf); 2609 suffix.append(buf);
2624 } 2610 }
2625 else if (seconds >= 60) 2611 else if (seconds >= 60)
@@ -2628,8 +2614,8 @@ void LLPanelLandAccess::refresh()
2628 } 2614 }
2629 else 2615 else
2630 { 2616 {
2631 char buf[30]; 2617 char buf[30]; /*Flawfinder: ignore*/
2632 sprintf(buf, "%d seconds", seconds); 2618 snprintf(buf, sizeof(buf), "%d seconds", seconds); /*Flawfinder: ignore*/
2633 suffix.append(buf); 2619 suffix.append(buf);
2634 } 2620 }
2635 suffix.append(" remaining)"); 2621 suffix.append(" remaining)");
@@ -2686,15 +2672,15 @@ void LLPanelLandAccess::refresh()
2686// public 2672// public
2687void LLPanelLandAccess::refreshNames() 2673void LLPanelLandAccess::refreshNames()
2688{ 2674{
2689 LLParcel* parcel = gParcelMgr->getSelectedParcel(); 2675 LLParcel* parcel = mParcel->getParcel();
2690 char group_name[DB_GROUP_NAME_BUF_SIZE]; 2676 char group_name[DB_GROUP_NAME_BUF_SIZE]; /*Flawfinder: ignore*/
2691 group_name[0] = '\0'; 2677 group_name[0] = '\0';
2692 if(parcel) 2678 if(parcel)
2693 { 2679 {
2694 gCacheName->getGroupName(parcel->getGroupID(), group_name); 2680 gCacheName->getGroupName(parcel->getGroupID(), group_name);
2695 } 2681 }
2696 char label[MAX_STRING]; 2682 char label[MAX_STRING]; /*Flawfinder: ignore*/
2697 snprintf(label, MAX_STRING, "Group: %s", group_name); 2683 snprintf(label, sizeof(label), "Group: %s", group_name); /*Flawfinder: ignore*/
2698 mCheckGroup->setLabel(label); 2684 mCheckGroup->setLabel(label);
2699} 2685}
2700 2686
@@ -2717,7 +2703,7 @@ void LLPanelLandAccess::onCommitAny(LLUICtrl *ctrl, void *userdata)
2717{ 2703{
2718 LLPanelLandAccess *self = (LLPanelLandAccess *)userdata; 2704 LLPanelLandAccess *self = (LLPanelLandAccess *)userdata;
2719 2705
2720 LLParcel* parcel = gParcelMgr->getSelectedParcel(); 2706 LLParcel* parcel = self->mParcel->getParcel();
2721 if (!parcel) 2707 if (!parcel)
2722 { 2708 {
2723 return; 2709 return;
@@ -2750,7 +2736,7 @@ void LLPanelLandAccess::onCommitAny(LLUICtrl *ctrl, void *userdata)
2750 parcel->setPassHours( pass_hours ); 2736 parcel->setPassHours( pass_hours );
2751 2737
2752 // Send current parcel data upstream to server 2738 // Send current parcel data upstream to server
2753 gParcelMgr->sendParcelPropertiesUpdate( parcel, LLFloaterLand::sRequestReplyOnUpdate ); 2739 gParcelMgr->sendParcelPropertiesUpdate( parcel );
2754 2740
2755 // Might have changed properties, so let's redraw! 2741 // Might have changed properties, so let's redraw!
2756 self->refresh(); 2742 self->refresh();
@@ -2774,7 +2760,7 @@ void LLPanelLandAccess::callbackAvatarID(const std::vector<std::string>& names,
2774 2760
2775void LLPanelLandAccess::addAvatar(LLUUID id) 2761void LLPanelLandAccess::addAvatar(LLUUID id)
2776{ 2762{
2777 LLParcel* parcel = gParcelMgr->getSelectedParcel(); 2763 LLParcel* parcel = mParcel->getParcel();
2778 if (!parcel) return; 2764 if (!parcel) return;
2779 2765
2780 parcel->addToAccessList(id, 0); 2766 parcel->addToAccessList(id, 0);
@@ -2794,7 +2780,7 @@ void LLPanelLandAccess::onClickRemove(void* data)
2794 LLScrollListItem* item = self->mListAccess->getFirstSelected(); 2780 LLScrollListItem* item = self->mListAccess->getFirstSelected();
2795 if (!item) return; 2781 if (!item) return;
2796 2782
2797 LLParcel* parcel = gParcelMgr->getSelectedParcel(); 2783 LLParcel* parcel = self->mParcel->getParcel();
2798 if (!parcel) return; 2784 if (!parcel) return;
2799 2785
2800 const LLUUID& agent_id = item->getUUID(); 2786 const LLUUID& agent_id = item->getUUID();
@@ -2811,8 +2797,8 @@ void LLPanelLandAccess::onClickRemove(void* data)
2811//--------------------------------------------------------------------------- 2797//---------------------------------------------------------------------------
2812// LLPanelLandBan 2798// LLPanelLandBan
2813//--------------------------------------------------------------------------- 2799//---------------------------------------------------------------------------
2814LLPanelLandBan::LLPanelLandBan() 2800LLPanelLandBan::LLPanelLandBan(LLParcelSelectionHandle& parcel)
2815: LLPanel("land_ban_panel") 2801: LLPanel("land_ban_panel"), mParcel(parcel)
2816{ 2802{
2817 2803
2818} 2804}
@@ -2856,11 +2842,11 @@ void LLPanelLandBan::refresh()
2856{ 2842{
2857 mList->deleteAllItems(); 2843 mList->deleteAllItems();
2858 2844
2859 LLParcel *parcel = gParcelMgr->getSelectedParcel(); 2845 LLParcel *parcel = mParcel->getParcel();
2860 2846
2861 if (parcel) 2847 if (parcel)
2862 { 2848 {
2863 char label[256]; 2849 char label[256]; /*Flawfinder: ignore*/
2864 2850
2865 // Display options 2851 // Display options
2866 2852
@@ -2869,7 +2855,7 @@ void LLPanelLandBan::refresh()
2869 BOOL use_ban = parcel->getParcelFlag(PF_USE_BAN_LIST); 2855 BOOL use_ban = parcel->getParcelFlag(PF_USE_BAN_LIST);
2870 mCheck->set( use_ban ); 2856 mCheck->set( use_ban );
2871 2857
2872 sprintf(label, "Ban these avatars: (%d listed, %d max)", 2858 snprintf(label, sizeof(label), "Ban these avatars: (%d listed, %d max)", /*Flawfinder: ignore*/
2873 count, PARCEL_MAX_ACCESS_LIST); 2859 count, PARCEL_MAX_ACCESS_LIST);
2874 mCheck->setLabel( label ); 2860 mCheck->setLabel( label );
2875 2861
@@ -2887,8 +2873,8 @@ void LLPanelLandBan::refresh()
2887 suffix.assign(" ("); 2873 suffix.assign(" (");
2888 if (seconds >= 120) 2874 if (seconds >= 120)
2889 { 2875 {
2890 char buf[30]; 2876 char buf[30]; /*Flawfinder: ignore*/
2891 sprintf(buf, "%d minutes", (seconds/60)); 2877 snprintf(buf, sizeof(buf), "%d minutes", (seconds/60)); /*Flawfinder: ignore*/
2892 suffix.append(buf); 2878 suffix.append(buf);
2893 } 2879 }
2894 else if (seconds >= 60) 2880 else if (seconds >= 60)
@@ -2897,8 +2883,8 @@ void LLPanelLandBan::refresh()
2897 } 2883 }
2898 else 2884 else
2899 { 2885 {
2900 char buf[30]; 2886 char buf[30]; /*Flawfinder: ignore*/
2901 sprintf(buf, "%d seconds", seconds); 2887 snprintf(buf, sizeof(buf), "%d seconds", seconds); /*Flawfinder: ignore*/
2902 suffix.append(buf); 2888 suffix.append(buf);
2903 } 2889 }
2904 suffix.append(" remaining)"); 2890 suffix.append(" remaining)");
@@ -2968,7 +2954,7 @@ void LLPanelLandBan::onCommitAny(LLUICtrl *ctrl, void *userdata)
2968{ 2954{
2969 LLPanelLandBan *self = (LLPanelLandBan*)userdata; 2955 LLPanelLandBan *self = (LLPanelLandBan*)userdata;
2970 2956
2971 LLParcel* parcel = gParcelMgr->getSelectedParcel(); 2957 LLParcel* parcel = self->mParcel->getParcel();
2972 if (!parcel) 2958 if (!parcel)
2973 { 2959 {
2974 return; 2960 return;
@@ -2987,7 +2973,7 @@ void LLPanelLandBan::onCommitAny(LLUICtrl *ctrl, void *userdata)
2987 parcel->setParcelFlag(PF_DENY_TRANSACTED, deny_access_transacted); 2973 parcel->setParcelFlag(PF_DENY_TRANSACTED, deny_access_transacted);
2988 2974
2989 // Send current parcel data upstream to server 2975 // Send current parcel data upstream to server
2990 gParcelMgr->sendParcelPropertiesUpdate( parcel, LLFloaterLand::sRequestReplyOnUpdate ); 2976 gParcelMgr->sendParcelPropertiesUpdate( parcel );
2991 2977
2992 // Might have changed properties, so let's redraw! 2978 // Might have changed properties, so let's redraw!
2993 self->refresh(); 2979 self->refresh();
@@ -3011,7 +2997,7 @@ void LLPanelLandBan::callbackAvatarID(const std::vector<std::string>& names, con
3011 2997
3012void LLPanelLandBan::addAvatar(LLUUID id) 2998void LLPanelLandBan::addAvatar(LLUUID id)
3013{ 2999{
3014 LLParcel* parcel = gParcelMgr->getSelectedParcel(); 3000 LLParcel* parcel = mParcel->getParcel();
3015 if (!parcel) return; 3001 if (!parcel) return;
3016 3002
3017 parcel->addToBanList(id, 0); 3003 parcel->addToBanList(id, 0);
@@ -3031,7 +3017,7 @@ void LLPanelLandBan::onClickRemove(void* data)
3031 LLScrollListItem* item = self->mList->getFirstSelected(); 3017 LLScrollListItem* item = self->mList->getFirstSelected();
3032 if (!item) return; 3018 if (!item) return;
3033 3019
3034 LLParcel* parcel = gParcelMgr->getSelectedParcel(); 3020 LLParcel* parcel = self->mParcel->getParcel();
3035 if (!parcel) return; 3021 if (!parcel) return;
3036 3022
3037 const LLUUID& agent_id = item->getUUID(); 3023 const LLUUID& agent_id = item->getUUID();
@@ -3046,8 +3032,8 @@ void LLPanelLandBan::onClickRemove(void* data)
3046//--------------------------------------------------------------------------- 3032//---------------------------------------------------------------------------
3047// LLPanelLandRenters 3033// LLPanelLandRenters
3048//--------------------------------------------------------------------------- 3034//---------------------------------------------------------------------------
3049LLPanelLandRenters::LLPanelLandRenters() 3035LLPanelLandRenters::LLPanelLandRenters(LLParcelSelectionHandle& parcel)
3050: LLPanel("landrenters", LLRect(0,500,500,0)) 3036: LLPanel("landrenters", LLRect(0,500,500,0)), mParcel(parcel)
3051{ 3037{
3052 const S32 BTN_WIDTH = 64; 3038 const S32 BTN_WIDTH = 64;
3053 3039
@@ -3122,8 +3108,8 @@ void LLPanelLandRenters::onClickRemove(void*)
3122//--------------------------------------------------------------------------- 3108//---------------------------------------------------------------------------
3123// LLPanelLandCovenant 3109// LLPanelLandCovenant
3124//--------------------------------------------------------------------------- 3110//---------------------------------------------------------------------------
3125LLPanelLandCovenant::LLPanelLandCovenant() 3111LLPanelLandCovenant::LLPanelLandCovenant(LLParcelSelectionHandle& parcel)
3126: LLPanel("land_covenant_panel") 3112: LLPanel("land_covenant_panel"), mParcel(parcel)
3127{ 3113{
3128} 3114}
3129 3115
diff --git a/linden/indra/newview/llfloaterland.h b/linden/indra/newview/llfloaterland.h
index ba92c96..4301306 100644
--- a/linden/indra/newview/llfloaterland.h
+++ b/linden/indra/newview/llfloaterland.h
@@ -50,6 +50,7 @@ class LLParcelSelectionObserver;
50class LLTabContainer; 50class LLTabContainer;
51class LLTextureCtrl; 51class LLTextureCtrl;
52class LLViewerTextEditor; 52class LLViewerTextEditor;
53class LLParcelSelection;
53 54
54class LLPanelLandGeneral; 55class LLPanelLandGeneral;
55class LLPanelLandObjects; 56class LLPanelLandObjects;
@@ -73,9 +74,6 @@ public:
73 static LLPanelLandObjects* getCurrentPanelLandObjects(); 74 static LLPanelLandObjects* getCurrentPanelLandObjects();
74 static LLPanelLandCovenant* getCurrentPanelLandCovenant(); 75 static LLPanelLandCovenant* getCurrentPanelLandCovenant();
75 76
76 // Returns TRUE, but does some early prep work for closing the window.
77 virtual BOOL canClose();
78
79 // Destroys itself on close. 77 // Destroys itself on close.
80 virtual void onClose(bool app_quitting); 78 virtual void onClose(bool app_quitting);
81 79
@@ -112,6 +110,8 @@ protected:
112 LLPanelLandCovenant* mPanelCovenant; 110 LLPanelLandCovenant* mPanelCovenant;
113 LLPanelLandRenters* mPanelRenters; 111 LLPanelLandRenters* mPanelRenters;
114 112
113 LLHandle<LLParcelSelection> mParcel;
114
115public: 115public:
116 // When closing the dialog, we want to deselect the land. But when 116 // When closing the dialog, we want to deselect the land. But when
117 // we send an update to the simulator, it usually replies with the 117 // we send an update to the simulator, it usually replies with the
@@ -125,7 +125,7 @@ class LLPanelLandGeneral
125: public LLPanel 125: public LLPanel
126{ 126{
127public: 127public:
128 LLPanelLandGeneral(); 128 LLPanelLandGeneral(LLHandle<LLParcelSelection>& parcelp);
129 virtual ~LLPanelLandGeneral(); 129 virtual ~LLPanelLandGeneral();
130 void refresh(); 130 void refresh();
131 void refreshNames(); 131 void refreshNames();
@@ -217,6 +217,8 @@ protected:
217 LLButton* mBtnBuyPass; 217 LLButton* mBtnBuyPass;
218 LLButton* mBtnStartAuction; 218 LLButton* mBtnStartAuction;
219 219
220 LLHandle<LLParcelSelection>& mParcel;
221
220 static LLViewHandle sBuyPassDialogHandle; 222 static LLViewHandle sBuyPassDialogHandle;
221}; 223};
222 224
@@ -224,7 +226,7 @@ class LLPanelLandObjects
224: public LLPanel 226: public LLPanel
225{ 227{
226public: 228public:
227 LLPanelLandObjects(); 229 LLPanelLandObjects(LLHandle<LLParcelSelection>& parcelp);
228 virtual ~LLPanelLandObjects(); 230 virtual ~LLPanelLandObjects();
229 void refresh(); 231 void refresh();
230 virtual void draw(); 232 virtual void draw();
@@ -234,7 +236,7 @@ public:
234 static void callbackReturnOtherObjects(S32, void*); 236 static void callbackReturnOtherObjects(S32, void*);
235 static void callbackReturnOwnerList(S32, void*); 237 static void callbackReturnOwnerList(S32, void*);
236 238
237 static void clickShowCore(S32 return_type, uuid_list_t* list = 0); 239 static void clickShowCore(LLPanelLandObjects* panelp, S32 return_type, uuid_list_t* list = 0);
238 static void onClickShowOwnerObjects(void*); 240 static void onClickShowOwnerObjects(void*);
239 static void onClickShowGroupObjects(void*); 241 static void onClickShowGroupObjects(void*);
240 static void onClickShowOtherObjects(void*); 242 static void onClickShowOtherObjects(void*);
@@ -314,6 +316,8 @@ protected:
314 LLString mSelectedName; 316 LLString mSelectedName;
315 S32 mSelectedCount; 317 S32 mSelectedCount;
316 BOOL mSelectedIsGroup; 318 BOOL mSelectedIsGroup;
319
320 LLHandle<LLParcelSelection>& mParcel;
317}; 321};
318 322
319 323
@@ -321,7 +325,7 @@ class LLPanelLandOptions
321: public LLPanel 325: public LLPanel
322{ 326{
323public: 327public:
324 LLPanelLandOptions(); 328 LLPanelLandOptions(LLHandle<LLParcelSelection>& parcelp);
325 virtual ~LLPanelLandOptions(); 329 virtual ~LLPanelLandOptions();
326 void refresh(); 330 void refresh();
327 331
@@ -359,6 +363,8 @@ protected:
359 LLCheckBoxCtrl *mMatureCtrl; 363 LLCheckBoxCtrl *mMatureCtrl;
360 LLCheckBoxCtrl *mPushRestrictionCtrl; 364 LLCheckBoxCtrl *mPushRestrictionCtrl;
361 LLButton *mPublishHelpButton; 365 LLButton *mPublishHelpButton;
366
367 LLHandle<LLParcelSelection>& mParcel;
362}; 368};
363 369
364 370
@@ -366,7 +372,7 @@ class LLPanelLandMedia
366: public LLPanel 372: public LLPanel
367{ 373{
368public: 374public:
369 LLPanelLandMedia(); 375 LLPanelLandMedia(LLHandle<LLParcelSelection>& parcelp);
370 virtual ~LLPanelLandMedia(); 376 virtual ~LLPanelLandMedia();
371 void refresh(); 377 void refresh();
372 378
@@ -384,6 +390,8 @@ protected:
384 LLCheckBoxCtrl* mMediaAutoScaleCheck; 390 LLCheckBoxCtrl* mMediaAutoScaleCheck;
385 //LLButton* mMediaStopButton; 391 //LLButton* mMediaStopButton;
386 //LLButton* mMediaStartButton; 392 //LLButton* mMediaStartButton;
393
394 LLHandle<LLParcelSelection>& mParcel;
387}; 395};
388 396
389 397
@@ -392,7 +400,7 @@ class LLPanelLandAccess
392: public LLPanel 400: public LLPanel
393{ 401{
394public: 402public:
395 LLPanelLandAccess(); 403 LLPanelLandAccess(LLHandle<LLParcelSelection>& parcelp);
396 virtual ~LLPanelLandAccess(); 404 virtual ~LLPanelLandAccess();
397 void refresh(); 405 void refresh();
398 void refreshNames(); 406 void refreshNames();
@@ -426,6 +434,7 @@ protected:
426 LLCheckBoxCtrl* mCheckTransacted; 434 LLCheckBoxCtrl* mCheckTransacted;
427 LLRadioGroup* mCheckStatusLevel; 435 LLRadioGroup* mCheckStatusLevel;
428 436
437 LLHandle<LLParcelSelection>& mParcel;
429}; 438};
430 439
431 440
@@ -433,7 +442,7 @@ class LLPanelLandBan
433: public LLPanel 442: public LLPanel
434{ 443{
435public: 444public:
436 LLPanelLandBan(); 445 LLPanelLandBan(LLHandle<LLParcelSelection>& parcelp);
437 virtual ~LLPanelLandBan(); 446 virtual ~LLPanelLandBan();
438 void refresh(); 447 void refresh();
439 448
@@ -456,6 +465,8 @@ protected:
456 LLCheckBoxCtrl* mCheckDenyAnonymous; 465 LLCheckBoxCtrl* mCheckDenyAnonymous;
457 LLCheckBoxCtrl* mCheckDenyIdentified; 466 LLCheckBoxCtrl* mCheckDenyIdentified;
458 LLCheckBoxCtrl* mCheckDenyTransacted; 467 LLCheckBoxCtrl* mCheckDenyTransacted;
468
469 LLHandle<LLParcelSelection>& mParcel;
459}; 470};
460 471
461 472
@@ -463,7 +474,7 @@ class LLPanelLandRenters
463: public LLPanel 474: public LLPanel
464{ 475{
465public: 476public:
466 LLPanelLandRenters(); 477 LLPanelLandRenters(LLHandle<LLParcelSelection>& parcelp);
467 virtual ~LLPanelLandRenters(); 478 virtual ~LLPanelLandRenters();
468 void refresh(); 479 void refresh();
469 480
@@ -475,13 +486,15 @@ protected:
475 LLNameListCtrl* mListRenters; 486 LLNameListCtrl* mListRenters;
476 LLButton* mBtnAddRenter; 487 LLButton* mBtnAddRenter;
477 LLButton* mBtnRemoveRenter; 488 LLButton* mBtnRemoveRenter;
489
490 LLHandle<LLParcelSelection>& mParcel;
478}; 491};
479 492
480class LLPanelLandCovenant 493class LLPanelLandCovenant
481: public LLPanel 494: public LLPanel
482{ 495{
483public: 496public:
484 LLPanelLandCovenant(); 497 LLPanelLandCovenant(LLHandle<LLParcelSelection>& parcelp);
485 virtual ~LLPanelLandCovenant(); 498 virtual ~LLPanelLandCovenant();
486 virtual BOOL postBuild(); 499 virtual BOOL postBuild();
487 void refresh(); 500 void refresh();
@@ -489,6 +502,9 @@ public:
489 static void updateEstateName(const std::string& name); 502 static void updateEstateName(const std::string& name);
490 static void updateLastModified(const std::string& text); 503 static void updateLastModified(const std::string& text);
491 static void updateEstateOwnerName(const std::string& name); 504 static void updateEstateOwnerName(const std::string& name);
505
506protected:
507 LLHandle<LLParcelSelection>& mParcel;
492}; 508};
493 509
494#endif 510#endif
diff --git a/linden/indra/newview/llfloaterlandholdings.cpp b/linden/indra/newview/llfloaterlandholdings.cpp
index c9569d0..e34e84c 100644
--- a/linden/indra/newview/llfloaterlandholdings.cpp
+++ b/linden/indra/newview/llfloaterlandholdings.cpp
@@ -72,7 +72,7 @@ void LLFloaterLandHoldings::show(void*)
72 ""); 72 "");
73 73
74 // TODO: request updated money balance? 74 // TODO: request updated money balance?
75 floater->open(); 75 floater->open(); /* Flawfinder: ignore */
76} 76}
77 77
78 78
@@ -177,14 +177,14 @@ void LLFloaterLandHoldings::processPlacesReply(LLMessageSystem* msg, void**)
177 } 177 }
178 178
179 LLUUID owner_id; 179 LLUUID owner_id;
180 char name[MAX_STRING]; 180 char name[MAX_STRING]; /* Flawfinder: ignore */
181 char desc[MAX_STRING]; 181 char desc[MAX_STRING]; /* Flawfinder: ignore */
182 S32 actual_area; 182 S32 actual_area;
183 S32 billable_area; 183 S32 billable_area;
184 U8 flags; 184 U8 flags;
185 F32 global_x; 185 F32 global_x;
186 F32 global_y; 186 F32 global_y;
187 char sim_name[MAX_STRING]; 187 char sim_name[MAX_STRING]; /* Flawfinder: ignore */
188 188
189 S32 i; 189 S32 i;
190 S32 count = msg->getNumberOfBlocks("QueryData"); 190 S32 count = msg->getNumberOfBlocks("QueryData");
@@ -206,21 +206,21 @@ void LLFloaterLandHoldings::processPlacesReply(LLMessageSystem* msg, void**)
206 S32 region_x = llround(global_x) % REGION_WIDTH_UNITS; 206 S32 region_x = llround(global_x) % REGION_WIDTH_UNITS;
207 S32 region_y = llround(global_y) % REGION_WIDTH_UNITS; 207 S32 region_y = llround(global_y) % REGION_WIDTH_UNITS;
208 208
209 char location[MAX_STRING]; 209 char location[MAX_STRING]; /* Flawfinder: ignore */
210 sprintf(location, "%s (%d, %d)", sim_name, region_x, region_y); 210 snprintf(location, MAX_STRING, "%s (%d, %d)", sim_name, region_x, region_y); /* Flawfinder: ignore */
211 211
212 char area[MAX_STRING]; 212 char area[MAX_STRING]; /* Flawfinder: ignore */
213 if(billable_area == actual_area) 213 if(billable_area == actual_area)
214 { 214 {
215 sprintf(area, "%d", billable_area); 215 snprintf(area, MAX_STRING, "%d", billable_area); /* Flawfinder: ignore */
216 } 216 }
217 else 217 else
218 { 218 {
219 sprintf(area, "%d / %d", billable_area, actual_area); 219 snprintf(area, MAX_STRING, "%d / %d", billable_area, actual_area); /* Flawfinder: ignore */
220 } 220 }
221 221
222 char hidden[MAX_STRING]; 222 char hidden[MAX_STRING]; /* Flawfinder: ignore */
223 sprintf(hidden, "%f %f", global_x, global_y); 223 snprintf(hidden, MAX_STRING, "%f %f", global_x, global_y); /* Flawfinder: ignore */
224 224
225 LLSD element; 225 LLSD element;
226 element["columns"][0]["column"] = "name"; 226 element["columns"][0]["column"] = "name";
@@ -311,14 +311,14 @@ void LLFloaterLandHoldings::refreshAggregates()
311 S32 current_area = gStatusBar->getSquareMetersCommitted(); 311 S32 current_area = gStatusBar->getSquareMetersCommitted();
312 S32 available_area = gStatusBar->getSquareMetersLeft(); 312 S32 available_area = gStatusBar->getSquareMetersLeft();
313 313
314 char buffer[MAX_STRING]; 314 char buffer[MAX_STRING]; /* Flawfinder: ignore */
315 315
316 sprintf(buffer, "%d sq. meters", allowed_area); 316 snprintf(buffer, MAX_STRING, "%d sq. meters", allowed_area); /* Flawfinder: ignore */
317 childSetValue("allowed_text", LLSD(buffer)); 317 childSetValue("allowed_text", LLSD(buffer));
318 318
319 sprintf(buffer, "%d sq. meters", current_area); 319 snprintf(buffer, MAX_STRING, "%d sq. meters", current_area); /* Flawfinder: ignore */
320 childSetValue("current_text", LLSD(buffer)); 320 childSetValue("current_text", LLSD(buffer));
321 321
322 sprintf(buffer, "%d sq. meters", available_area); 322 snprintf(buffer, MAX_STRING, "%d sq. meters", available_area); /* Flawfinder: ignore */
323 childSetValue("available_text", LLSD(buffer)); 323 childSetValue("available_text", LLSD(buffer));
324} 324}
diff --git a/linden/indra/newview/llfloatermap.cpp b/linden/indra/newview/llfloatermap.cpp
index 29c4f08..2d549db 100644
--- a/linden/indra/newview/llfloatermap.cpp
+++ b/linden/indra/newview/llfloatermap.cpp
@@ -212,7 +212,7 @@ void LLFloaterMap::toggle(void*)
212 } 212 }
213 else 213 else
214 { 214 {
215 gFloaterMap->open(); 215 gFloaterMap->open(); /* Flawfinder: ignore */
216 } 216 }
217 } 217 }
218} 218}
diff --git a/linden/indra/newview/llfloatermute.cpp b/linden/indra/newview/llfloatermute.cpp
index a78a616..f71b58f 100644
--- a/linden/indra/newview/llfloatermute.cpp
+++ b/linden/indra/newview/llfloatermute.cpp
@@ -106,7 +106,7 @@ LLFloaterMute::~LLFloaterMute()
106void LLFloaterMute::show() 106void LLFloaterMute::show()
107{ 107{
108 // Make sure we make a noise. 108 // Make sure we make a noise.
109 open(); 109 open(); /* Flawfinder: ignore */
110} 110}
111 111
112//----------------------------------------------------------------------------- 112//-----------------------------------------------------------------------------
diff --git a/linden/indra/newview/llfloaternamedesc.cpp b/linden/indra/newview/llfloaternamedesc.cpp
index 8d84f94..b39a2eb 100644
--- a/linden/indra/newview/llfloaternamedesc.cpp
+++ b/linden/indra/newview/llfloaternamedesc.cpp
@@ -83,7 +83,7 @@ BOOL LLFloaterNameDesc::postBuild()
83 char* end_p = strrchr(asset_name_str, '.'); // strip extension if exists 83 char* end_p = strrchr(asset_name_str, '.'); // strip extension if exists
84 if( !end_p ) 84 if( !end_p )
85 { 85 {
86 end_p = asset_name_str + strlen( asset_name_str ); 86 end_p = asset_name_str + strlen( asset_name_str ); /* Flawfinder: ignore */
87 } 87 }
88 else 88 else
89 if( !stricmp( end_p, ".wav") ) 89 if( !stricmp( end_p, ".wav") )
diff --git a/linden/indra/newview/llfloaternewim.cpp b/linden/indra/newview/llfloaternewim.cpp
index 3199eef..4288209 100644
--- a/linden/indra/newview/llfloaternewim.cpp
+++ b/linden/indra/newview/llfloaternewim.cpp
@@ -117,9 +117,9 @@ void LLFloaterNewIM::addTarget(const LLUUID& uuid, const std::string& name,
117void LLFloaterNewIM::addAgent(const LLUUID& uuid, void* data, BOOL online) 117void LLFloaterNewIM::addAgent(const LLUUID& uuid, void* data, BOOL online)
118{ 118{
119 LLScrollListItem* item = new LLScrollListItem(TRUE, data, uuid); 119 LLScrollListItem* item = new LLScrollListItem(TRUE, data, uuid);
120 char first[DB_FIRST_NAME_BUF_SIZE]; 120 char first[DB_FIRST_NAME_BUF_SIZE]; /* Flawfinder: ignore */
121 first[0] = '\0'; 121 first[0] = '\0';
122 char last[DB_LAST_NAME_BUF_SIZE]; 122 char last[DB_LAST_NAME_BUF_SIZE]; /* Flawfinder: ignore */
123 last[0] = '\0'; 123 last[0] = '\0';
124 gCacheName->getName(uuid, first, last); 124 gCacheName->getName(uuid, first, last);
125 LLUIString fullname = sNameFormat; 125 LLUIString fullname = sNameFormat;
@@ -228,7 +228,6 @@ void LLFloaterNewIM::close(bool app_quitting)
228 } 228 }
229 else 229 else
230 { 230 {
231 // this shouldn't be called, because we are always hosted
232 LLFloater::close(app_quitting); 231 LLFloater::close(app_quitting);
233 } 232 }
234} 233}
diff --git a/linden/indra/newview/llfloateropenobject.cpp b/linden/indra/newview/llfloateropenobject.cpp
index 1f0cd5d..22b4292 100644
--- a/linden/indra/newview/llfloateropenobject.cpp
+++ b/linden/indra/newview/llfloateropenobject.cpp
@@ -68,7 +68,6 @@ LLFloaterOpenObject::LLFloaterOpenObject()
68 68
69LLFloaterOpenObject::~LLFloaterOpenObject() 69LLFloaterOpenObject::~LLFloaterOpenObject()
70{ 70{
71 gSelectMgr->deselectAll();
72 sInstance = NULL; 71 sInstance = NULL;
73} 72}
74 73
@@ -76,7 +75,7 @@ void LLFloaterOpenObject::refresh()
76{ 75{
77 mPanelInventory->refresh(); 76 mPanelInventory->refresh();
78 77
79 LLSelectNode* node = gSelectMgr->getFirstRootNode(); 78 LLSelectNode* node = mObjectSelection->getFirstRootNode();
80 if (node) 79 if (node)
81 { 80 {
82 std::string name = node->mName; 81 std::string name = node->mName;
@@ -103,7 +102,8 @@ void LLFloaterOpenObject::dirty()
103// static 102// static
104void LLFloaterOpenObject::show() 103void LLFloaterOpenObject::show()
105{ 104{
106 if (gSelectMgr->getRootObjectCount() != 1) 105 LLObjectSelectionHandle object_selection = gSelectMgr->getSelection();
106 if (object_selection->getRootObjectCount() != 1)
107 { 107 {
108 gViewerWindow->alertXml("UnableToViewContentsMoreThanOne"); 108 gViewerWindow->alertXml("UnableToViewContentsMoreThanOne");
109 return; 109 return;
@@ -116,21 +116,22 @@ void LLFloaterOpenObject::show()
116 sInstance->center(); 116 sInstance->center();
117 } 117 }
118 118
119 sInstance->open(); 119 sInstance->open(); /* Flawfinder: ignore */
120 sInstance->setFocus(TRUE); 120 sInstance->setFocus(TRUE);
121
122 sInstance->mObjectSelection = gSelectMgr->getEditSelection();
121} 123}
122 124
123 125
124// static
125void LLFloaterOpenObject::moveToInventory(bool wear) 126void LLFloaterOpenObject::moveToInventory(bool wear)
126{ 127{
127 if (gSelectMgr->getRootObjectCount() != 1) 128 if (mObjectSelection->getRootObjectCount() != 1)
128 { 129 {
129 gViewerWindow->alertXml("OnlyCopyContentsOfSingleItem"); 130 gViewerWindow->alertXml("OnlyCopyContentsOfSingleItem");
130 return; 131 return;
131 } 132 }
132 133
133 LLSelectNode* node = gSelectMgr->getFirstRootNode(); 134 LLSelectNode* node = mObjectSelection->getFirstRootNode();
134 if (!node) return; 135 if (!node) return;
135 LLViewerObject* object = node->getObject(); 136 LLViewerObject* object = node->getObject();
136 if (!object) return; 137 if (!object) return;
@@ -194,7 +195,7 @@ void LLFloaterOpenObject::callbackMoveInventory(S32 result, void* data)
194void LLFloaterOpenObject::onClickMoveToInventory(void* data) 195void LLFloaterOpenObject::onClickMoveToInventory(void* data)
195{ 196{
196 LLFloaterOpenObject* self = (LLFloaterOpenObject*)data; 197 LLFloaterOpenObject* self = (LLFloaterOpenObject*)data;
197 moveToInventory(false); 198 self->moveToInventory(false);
198 self->close(); 199 self->close();
199} 200}
200 201
@@ -202,7 +203,7 @@ void LLFloaterOpenObject::onClickMoveToInventory(void* data)
202void LLFloaterOpenObject::onClickMoveAndWear(void* data) 203void LLFloaterOpenObject::onClickMoveAndWear(void* data)
203{ 204{
204 LLFloaterOpenObject* self = (LLFloaterOpenObject*)data; 205 LLFloaterOpenObject* self = (LLFloaterOpenObject*)data;
205 moveToInventory(true); 206 self->moveToInventory(true);
206 self->close(); 207 self->close();
207} 208}
208 209
diff --git a/linden/indra/newview/llfloateropenobject.h b/linden/indra/newview/llfloateropenobject.h
index aae3876..4772982 100644
--- a/linden/indra/newview/llfloateropenobject.h
+++ b/linden/indra/newview/llfloateropenobject.h
@@ -35,8 +35,7 @@
35 35
36#include "llfloater.h" 36#include "llfloater.h"
37 37
38 38class LLObjectSelection;
39
40class LLPanelInventory; 39class LLPanelInventory;
41 40
42class LLFloaterOpenObject 41class LLFloaterOpenObject
@@ -59,9 +58,10 @@ protected:
59 void refresh(); 58 void refresh();
60 void draw(); 59 void draw();
61 60
61 void moveToInventory(bool wear);
62
62 static void onClickMoveToInventory(void* data); 63 static void onClickMoveToInventory(void* data);
63 static void onClickMoveAndWear(void* data); 64 static void onClickMoveAndWear(void* data);
64 static void moveToInventory(bool wear);
65 static void callbackMoveInventory(S32 result, void* data); 65 static void callbackMoveInventory(S32 result, void* data);
66 static void* createPanelInventory(void* data); 66 static void* createPanelInventory(void* data);
67 67
@@ -69,6 +69,7 @@ protected:
69 static LLFloaterOpenObject* sInstance; 69 static LLFloaterOpenObject* sInstance;
70 70
71 LLPanelInventory* mPanelInventory; 71 LLPanelInventory* mPanelInventory;
72 LLHandle<LLObjectSelection> mObjectSelection;
72 BOOL mDirty; 73 BOOL mDirty;
73}; 74};
74 75
diff --git a/linden/indra/newview/llfloaterpermissionsmgr.cpp b/linden/indra/newview/llfloaterpermissionsmgr.cpp
index 05945d9..1c13cf2 100644
--- a/linden/indra/newview/llfloaterpermissionsmgr.cpp
+++ b/linden/indra/newview/llfloaterpermissionsmgr.cpp
@@ -53,12 +53,12 @@ LLFloaterPermissionsMgr* LLFloaterPermissionsMgr::show()
53 { 53 {
54 sInstance = new LLFloaterPermissionsMgr(); 54 sInstance = new LLFloaterPermissionsMgr();
55 55
56 sInstance->open(); 56 sInstance->open(); /* Flawfinder: ignore */
57 gFloaterView->adjustToFitScreen(sInstance, TRUE); 57 gFloaterView->adjustToFitScreen(sInstance, TRUE);
58 } 58 }
59 else 59 else
60 { 60 {
61 sInstance->open(); 61 sInstance->open(); /* Flawfinder: ignore */
62 } 62 }
63 63
64 return sInstance; 64 return sInstance;
diff --git a/linden/indra/newview/llfloaterpostcard.cpp b/linden/indra/newview/llfloaterpostcard.cpp
index d6c66e3..036ce38 100644
--- a/linden/indra/newview/llfloaterpostcard.cpp
+++ b/linden/indra/newview/llfloaterpostcard.cpp
@@ -58,6 +58,8 @@
58#include "llvfs.h" 58#include "llvfs.h"
59#include "viewer.h" 59#include "viewer.h"
60 60
61#include "llassetuploadresponders.h"
62
61///---------------------------------------------------------------------------- 63///----------------------------------------------------------------------------
62/// Local function declarations, constants, enums, and typedefs 64/// Local function declarations, constants, enums, and typedefs
63///---------------------------------------------------------------------------- 65///----------------------------------------------------------------------------
@@ -70,8 +72,8 @@ LLLinkedList<LLFloaterPostcard> LLFloaterPostcard::sInstances;
70 72
71LLFloaterPostcard::LLFloaterPostcard(LLImageJPEG* jpeg, LLImageGL *img, const LLVector2& img_scale, const LLVector3d& pos_taken_global) 73LLFloaterPostcard::LLFloaterPostcard(LLImageJPEG* jpeg, LLImageGL *img, const LLVector2& img_scale, const LLVector3d& pos_taken_global)
72: LLFloater("Postcard Floater"), 74: LLFloater("Postcard Floater"),
73 mViewerImage(img),
74 mJPEGImage(jpeg), 75 mJPEGImage(jpeg),
76 mViewerImage(img),
75 mImageScale(img_scale), 77 mImageScale(img_scale),
76 mPosTakenGlobal(pos_taken_global) 78 mPosTakenGlobal(pos_taken_global)
77{ 79{
@@ -157,7 +159,7 @@ LLFloaterPostcard* LLFloaterPostcard::showFromSnapshot(LLImageJPEG *jpeg, LLImag
157 gFloaterView->getNewFloaterPosition(&left, &top); 159 gFloaterView->getNewFloaterPosition(&left, &top);
158 instance->setOrigin(left, top - instance->getRect().getHeight()); 160 instance->setOrigin(left, top - instance->getRect().getHeight());
159 161
160 instance->open(); 162 instance->open(); /*Flawfinder: ignore*/
161 163
162 return instance; 164 return instance;
163} 165}
@@ -225,6 +227,23 @@ void LLFloaterPostcard::onClickCancel(void* data)
225 } 227 }
226} 228}
227 229
230class LLSendPostcardResponder : public LLAssetUploadResponder
231{
232public:
233 LLSendPostcardResponder(const LLSD &post_data,
234 const LLUUID& vfile_id,
235 LLAssetType::EType asset_type):
236 LLAssetUploadResponder(post_data, vfile_id, asset_type)
237 {
238 }
239 // *TODO define custom uploadFailed here so it's not such a generic message
240 void LLSendPostcardResponder::uploadComplete(const LLSD& content)
241 {
242 // we don't care about what the server returns from this post, just clean up the UI
243 LLUploadDialog::modalUploadFinished();
244 }
245};
246
228// static 247// static
229void LLFloaterPostcard::onClickSend(void* data) 248void LLFloaterPostcard::onClickSend(void* data)
230{ 249{
@@ -249,12 +268,31 @@ void LLFloaterPostcard::onClickSend(void* data)
249 268
250 if (self->mJPEGImage.notNull()) 269 if (self->mJPEGImage.notNull())
251 { 270 {
252 // upload the image
253 self->mTransactionID.generate(); 271 self->mTransactionID.generate();
254 self->mAssetID = self->mTransactionID.makeAssetID(gAgent.getSecureSessionID()); 272 self->mAssetID = self->mTransactionID.makeAssetID(gAgent.getSecureSessionID());
255 LLVFile::writeFile(self->mJPEGImage->getData(), self->mJPEGImage->getDataSize(), gVFS, self->mAssetID, LLAssetType::AT_IMAGE_JPEG); 273 LLVFile::writeFile(self->mJPEGImage->getData(), self->mJPEGImage->getDataSize(), gVFS, self->mAssetID, LLAssetType::AT_IMAGE_JPEG);
256 274
257 gAssetStorage->storeAssetData(self->mTransactionID, LLAssetType::AT_IMAGE_JPEG, &uploadCallback, (void *)self, FALSE); 275 // upload the image
276 std::string url = gAgent.getRegion()->getCapability("SendPostcard");
277 if(!url.empty())
278 {
279 llinfos << "Send Postcard via capability" << llendl;
280 LLSD body = LLSD::emptyMap();
281 // the capability already encodes: agent ID, region ID
282 body["pos-global"] = self->mPosTakenGlobal.getValue();
283 body["to"] = self->childGetValue("to_form").asString();
284 body["from"] = self->childGetValue("from_form").asString();
285 body["name"] = self->childGetValue("name_form").asString();
286 body["subject"] = self->childGetValue("subject_form").asString();
287 body["msg"] = self->childGetValue("msg_form").asString();
288 body["allow-publish"] = self->childGetValue("allow_publish_check").asBoolean();
289 body["mature-publish"] = self->childGetValue("mature_check").asBoolean();
290 LLHTTPClient::post(url, body, new LLSendPostcardResponder(body, self->mAssetID, LLAssetType::AT_IMAGE_JPEG));
291 }
292 else
293 {
294 gAssetStorage->storeAssetData(self->mTransactionID, LLAssetType::AT_IMAGE_JPEG, &uploadCallback, (void *)self, FALSE);
295 }
258 296
259 LLUploadDialog::modalUploadDialog("Uploading...\n\nPostcard"); 297 LLUploadDialog::modalUploadDialog("Uploading...\n\nPostcard");
260 298
diff --git a/linden/indra/newview/llfloaterpreference.cpp b/linden/indra/newview/llfloaterpreference.cpp
index 5dbfc78..ad1990e 100644
--- a/linden/indra/newview/llfloaterpreference.cpp
+++ b/linden/indra/newview/llfloaterpreference.cpp
@@ -283,7 +283,7 @@ void LLFloaterPreference::show(void*)
283 sInstance->center(); 283 sInstance->center();
284 } 284 }
285 285
286 sInstance->open(); 286 sInstance->open(); /* Flawfinder: ignore */
287 287
288 if(!gAgent.getID().isNull()) 288 if(!gAgent.getID().isNull())
289 { 289 {
diff --git a/linden/indra/newview/llfloaterproperties.cpp b/linden/indra/newview/llfloaterproperties.cpp
index 8be2ce5..0beea67 100644
--- a/linden/indra/newview/llfloaterproperties.cpp
+++ b/linden/indra/newview/llfloaterproperties.cpp
@@ -126,7 +126,7 @@ LLFloaterProperties* LLFloaterProperties::show(const LLUUID& item_id,
126 } 126 }
127 127
128 instance->refresh(); 128 instance->refresh();
129 instance->open(); 129 instance->open(); /* Flawfinder: ignore */
130 } 130 }
131 return instance; 131 return instance;
132} 132}
@@ -233,7 +233,7 @@ void LLFloaterProperties::refresh()
233 "RadioSaleType", 233 "RadioSaleType",
234 "EditPrice" 234 "EditPrice"
235 }; 235 };
236 for(int t=0;t<sizeof(enableNames)/sizeof(char*);t++) 236 for(size_t t=0; t<sizeof(enableNames)/sizeof(char*); ++t)
237 { 237 {
238 childSetEnabled(enableNames[t],false); 238 childSetEnabled(enableNames[t],false);
239 } 239 }
@@ -244,7 +244,7 @@ void LLFloaterProperties::refresh()
244 "EveryoneMaskDebug", 244 "EveryoneMaskDebug",
245 "NextMaskDebug" 245 "NextMaskDebug"
246 }; 246 };
247 for(int t=0;t<sizeof(hideNames)/sizeof(char*);t++) 247 for(size_t t=0; t<sizeof(hideNames)/sizeof(char*); ++t)
248 { 248 {
249 childSetVisible(hideNames[t],false); 249 childSetVisible(hideNames[t],false);
250 } 250 }
@@ -298,7 +298,7 @@ void LLFloaterProperties::refreshFromItem(LLInventoryItem* item)
298 298
299 childSetEnabled("LabelItemNameTitle",TRUE); 299 childSetEnabled("LabelItemNameTitle",TRUE);
300 childSetEnabled("LabelItemName",is_modifiable); 300 childSetEnabled("LabelItemName",is_modifiable);
301 const char EMPTY_STRING[1] = ""; 301 const char EMPTY_STRING[1] = ""; /* Flawfinder: ignore */
302 const char* txt = EMPTY_STRING; 302 const char* txt = EMPTY_STRING;
303 if(!item->getName().empty()) 303 if(!item->getName().empty())
304 { 304 {
@@ -318,8 +318,8 @@ void LLFloaterProperties::refreshFromItem(LLInventoryItem* item)
318 ////////////////// 318 //////////////////
319 // CREATOR NAME // 319 // CREATOR NAME //
320 ////////////////// 320 //////////////////
321 char first_name[DB_FIRST_NAME_BUF_SIZE]; 321 char first_name[DB_FIRST_NAME_BUF_SIZE]; /* Flawfinder: ignore */
322 char last_name[DB_LAST_NAME_BUF_SIZE]; 322 char last_name[DB_LAST_NAME_BUF_SIZE]; /* Flawfinder: ignore */
323 if(!gCacheName) return; 323 if(!gCacheName) return;
324 if(!gAgent.getRegion()) return; 324 if(!gAgent.getRegion()) return;
325 325
@@ -351,7 +351,7 @@ void LLFloaterProperties::refreshFromItem(LLInventoryItem* item)
351 LLString name; 351 LLString name;
352 if (perm.isGroupOwned()) 352 if (perm.isGroupOwned())
353 { 353 {
354 char group_name[DB_GROUP_NAME_BUF_SIZE]; 354 char group_name[DB_GROUP_NAME_BUF_SIZE]; /* Flawfinder: ignore */
355 gCacheName->getGroupName(perm.getGroup(), group_name); 355 gCacheName->getGroupName(perm.getGroup(), group_name);
356 name.assign(group_name); 356 name.assign(group_name);
357 } 357 }
@@ -432,29 +432,29 @@ void LLFloaterProperties::refreshFromItem(LLInventoryItem* item)
432 overwrite_group = flags & LLInventoryItem::II_FLAGS_OBJECT_PERM_OVERWRITE_GROUP; 432 overwrite_group = flags & LLInventoryItem::II_FLAGS_OBJECT_PERM_OVERWRITE_GROUP;
433 } 433 }
434 434
435 char perm_string[11]; 435 char perm_string[11]; /* Flawfinder: ignore */
436 436
437 sprintf(perm_string, "B: "); 437 snprintf(perm_string, sizeof(perm_string), "B: "); /* Flawfinder: ignore */
438 mask_to_string(base_mask, perm_string+3); 438 mask_to_string(base_mask, perm_string+3);
439 childSetText("BaseMaskDebug",perm_string); 439 childSetText("BaseMaskDebug",perm_string);
440 childSetVisible("BaseMaskDebug",TRUE); 440 childSetVisible("BaseMaskDebug",TRUE);
441 441
442 sprintf(perm_string, "O: "); 442 snprintf(perm_string, sizeof(perm_string), "O: "); /* Flawfinder: ignore */
443 mask_to_string(owner_mask, perm_string+3); 443 mask_to_string(owner_mask, perm_string+3);
444 childSetText("OwnerMaskDebug",perm_string); 444 childSetText("OwnerMaskDebug",perm_string);
445 childSetVisible("OwnerMaskDebug",TRUE); 445 childSetVisible("OwnerMaskDebug",TRUE);
446 446
447 sprintf(perm_string, "G%s: ", overwrite_group ? "*" : ""); 447 snprintf(perm_string, sizeof(perm_string), "G%s: ", overwrite_group ? "*" : ""); /* Flawfinder: ignore */
448 mask_to_string(group_mask, perm_string + (overwrite_group ? 4 : 3)); 448 mask_to_string(group_mask, perm_string + (overwrite_group ? 4 : 3));
449 childSetText("GroupMaskDebug",perm_string); 449 childSetText("GroupMaskDebug",perm_string);
450 childSetVisible("GroupMaskDebug",TRUE); 450 childSetVisible("GroupMaskDebug",TRUE);
451 451
452 sprintf(perm_string, "E%s: ", overwrite_everyone ? "*" : ""); 452 snprintf(perm_string, sizeof(perm_string), "E%s: ", overwrite_everyone ? "*" : ""); /* Flawfinder: ignore */
453 mask_to_string(everyone_mask, perm_string + (overwrite_everyone ? 4 : 3)); 453 mask_to_string(everyone_mask, perm_string + (overwrite_everyone ? 4 : 3));
454 childSetText("EveryoneMaskDebug",perm_string); 454 childSetText("EveryoneMaskDebug",perm_string);
455 childSetVisible("EveryoneMaskDebug",TRUE); 455 childSetVisible("EveryoneMaskDebug",TRUE);
456 456
457 sprintf(perm_string, "N%s: ", slam_perm ? "*" : ""); 457 snprintf(perm_string, sizeof(perm_string), "N%s: ", slam_perm ? "*" : ""); /* Flawfinder: ignore */
458 mask_to_string(next_owner_mask, perm_string + (slam_perm ? 4 : 3)); 458 mask_to_string(next_owner_mask, perm_string + (slam_perm ? 4 : 3));
459 childSetText("NextMaskDebug",perm_string); 459 childSetText("NextMaskDebug",perm_string);
460 childSetVisible("NextMaskDebug",TRUE); 460 childSetVisible("NextMaskDebug",TRUE);
@@ -567,8 +567,8 @@ void LLFloaterProperties::refreshFromItem(LLInventoryItem* item)
567 if (is_for_sale) 567 if (is_for_sale)
568 { 568 {
569 radioSaleType->setSelectedIndex((S32)sale_info.getSaleType() - 1); 569 radioSaleType->setSelectedIndex((S32)sale_info.getSaleType() - 1);
570 char numerical_price[MAX_STRING]; 570 char numerical_price[MAX_STRING]; /* Flawfinder: ignore */
571 sprintf(numerical_price, "%d", sale_info.getSalePrice()); 571 snprintf(numerical_price, MAX_STRING, "%d", sale_info.getSalePrice()); /* Flawfinder: ignore */
572 childSetText("EditPrice",numerical_price); 572 childSetText("EditPrice",numerical_price);
573 } 573 }
574 else 574 else
diff --git a/linden/indra/newview/llfloaterrate.cpp b/linden/indra/newview/llfloaterrate.cpp
index 128d1e6..a057374 100644
--- a/linden/indra/newview/llfloaterrate.cpp
+++ b/linden/indra/newview/llfloaterrate.cpp
@@ -68,6 +68,8 @@ LLFloaterRate::LLFloaterRate(const std::string& name, const LLUUID &id)
68 68
69 childSetAction("OK", onClickOK, this); 69 childSetAction("OK", onClickOK, this);
70 childSetAction("Cancel", onClickCancel, this); 70 childSetAction("Cancel", onClickCancel, this);
71
72 mObjectSelection = gSelectMgr->getEditSelection();
71} 73}
72 74
73 75
@@ -82,8 +84,8 @@ void LLFloaterRate::draw()
82 LLString name; 84 LLString name;
83 85
84 // Construct the name, if possible 86 // Construct the name, if possible
85 char firstname[MAX_STRING]; 87 char firstname[MAX_STRING]; /* Flawfinder: ignore */
86 char lastname[MAX_STRING]; 88 char lastname[MAX_STRING]; /* Flawfinder: ignore */
87 gCacheName->getName(mAvatarID, firstname, lastname); 89 gCacheName->getName(mAvatarID, firstname, lastname);
88 name.assign(firstname); 90 name.assign(firstname);
89 name.append(" "); 91 name.append(" ");
@@ -127,7 +129,7 @@ void LLFloaterRate::show(const LLUUID &avatar_id)
127 if (iter != sInstanceMap.end()) 129 if (iter != sInstanceMap.end())
128 { 130 {
129 iter->second->setFocus(TRUE); 131 iter->second->setFocus(TRUE);
130 iter->second->open(); 132 iter->second->open(); /* Flawfinder: ignore */
131 } 133 }
132 else if (avatar_id != LLUUID::null) 134 else if (avatar_id != LLUUID::null)
133 { 135 {
@@ -136,7 +138,7 @@ void LLFloaterRate::show(const LLUUID &avatar_id)
136 f->center(); 138 f->center();
137 f->setFocus(TRUE); 139 f->setFocus(TRUE);
138 f->sendReputationIndividualRequest(avatar_id); 140 f->sendReputationIndividualRequest(avatar_id);
139 f->open(); 141 f->open(); /* Flawfinder: ignore */
140 } 142 }
141} 143}
142 144
@@ -166,10 +168,6 @@ void LLFloaterRate::show(ERateSelection which)
166 { 168 {
167 gViewerWindow->alertXml("SelectSingleRate"); 169 gViewerWindow->alertXml("SelectSingleRate");
168 } 170 }
169
170
171 // Clean up selection
172 gSelectMgr->deselectTransient();
173} 171}
174 172
175 173
diff --git a/linden/indra/newview/llfloaterrate.h b/linden/indra/newview/llfloaterrate.h
index 591fb96..1b24383 100644
--- a/linden/indra/newview/llfloaterrate.h
+++ b/linden/indra/newview/llfloaterrate.h
@@ -40,6 +40,7 @@ class LLRadioGroup;
40class LLButton; 40class LLButton;
41class LLMessageSystem; 41class LLMessageSystem;
42class LLLineEditor; 42class LLLineEditor;
43class LLObjectSelection;
43 44
44class LLFloaterRate 45class LLFloaterRate
45: public LLFloater 46: public LLFloater
@@ -81,6 +82,7 @@ protected:
81 F32 mLastAppearance; 82 F32 mLastAppearance;
82 F32 mLastBuilding; 83 F32 mLastBuilding;
83 BOOL mReputationRequested; 84 BOOL mReputationRequested;
85 LLHandle<LLObjectSelection> mObjectSelection;
84}; 86};
85 87
86#endif 88#endif
diff --git a/linden/indra/newview/llfloaterregioninfo.cpp b/linden/indra/newview/llfloaterregioninfo.cpp
index 7fe6148..b758777 100644
--- a/linden/indra/newview/llfloaterregioninfo.cpp
+++ b/linden/indra/newview/llfloaterregioninfo.cpp
@@ -221,7 +221,7 @@ void LLFloaterRegionInfo::show(LLViewerRegion* region)
221 "EstateOwnerMessage", 221 "EstateOwnerMessage",
222 &processEstateOwnerRequest); 222 &processEstateOwnerRequest);
223 } 223 }
224 sInstance->open(); 224 sInstance->open(); /* Flawfinder: ignore*/
225 sInstance->refreshFromRegion(region); 225 sInstance->refreshFromRegion(region);
226 226
227 // Must allow anyone to request the RegionInfo data 227 // Must allow anyone to request the RegionInfo data
@@ -291,7 +291,7 @@ void LLFloaterRegionInfo::processRegionInfo(LLMessageSystem* msg)
291 if(!tab) return; 291 if(!tab) return;
292 292
293 // extract message 293 // extract message
294 char sim_name[MAX_STRING]; 294 char sim_name[MAX_STRING]; /* Flawfinder: ignore*/
295 U32 region_flags; 295 U32 region_flags;
296 U8 agent_limit; 296 U8 agent_limit;
297 F32 object_bonus_factor; 297 F32 object_bonus_factor;
@@ -324,12 +324,20 @@ void LLFloaterRegionInfo::processRegionInfo(LLMessageSystem* msg)
324 panel->childSetValue("restrict_pushobject", (region_flags & REGION_FLAGS_RESTRICT_PUSHOBJECT) ? TRUE : FALSE ); 324 panel->childSetValue("restrict_pushobject", (region_flags & REGION_FLAGS_RESTRICT_PUSHOBJECT) ? TRUE : FALSE );
325 panel->childSetValue("allow_land_resell_check", (region_flags & REGION_FLAGS_BLOCK_LAND_RESELL) ? FALSE : TRUE ); 325 panel->childSetValue("allow_land_resell_check", (region_flags & REGION_FLAGS_BLOCK_LAND_RESELL) ? FALSE : TRUE );
326 panel->childSetValue("allow_parcel_changes_check", (region_flags & REGION_FLAGS_ALLOW_PARCEL_CHANGES) ? TRUE : FALSE ); 326 panel->childSetValue("allow_parcel_changes_check", (region_flags & REGION_FLAGS_ALLOW_PARCEL_CHANGES) ? TRUE : FALSE );
327
328 panel->childSetValue("agent_limit_spin", LLSD((F32)agent_limit) ); 327 panel->childSetValue("agent_limit_spin", LLSD((F32)agent_limit) );
329 panel->childSetValue("object_bonus_spin", LLSD(object_bonus_factor) ); 328 panel->childSetValue("object_bonus_spin", LLSD(object_bonus_factor) );
330
331 panel->childSetValue("access_combo", LLSD(LLViewerRegion::accessToString(sim_access)) ); 329 panel->childSetValue("access_combo", LLSD(LLViewerRegion::accessToString(sim_access)) );
332 330
331
332 // detect teen grid for maturity
333 LLViewerRegion* region = gAgent.getRegion();
334
335 U32 parent_estate_id;
336 msg->getU32("RegionInfo", "ParentEstateID", parent_estate_id);
337 BOOL teen_grid = (parent_estate_id == 5); // *TODO add field to estate table and test that
338 panel->childSetEnabled("access_combo", gAgent.isGodlike() || (region && region->canManageEstate() && !teen_grid));
339
340
333 // DEBUG PANEL 341 // DEBUG PANEL
334 panel = LLUICtrlFactory::getPanelByName(tab, "Debug"); 342 panel = LLUICtrlFactory::getPanelByName(tab, "Debug");
335 if(!panel) return; 343 if(!panel) return;
@@ -349,7 +357,6 @@ void LLFloaterRegionInfo::processRegionInfo(LLMessageSystem* msg)
349 panel->childSetValue("terrain_lower_spin", LLSD(terrain_lower_limit)); 357 panel->childSetValue("terrain_lower_spin", LLSD(terrain_lower_limit));
350 panel->childSetValue("use_estate_sun_check", LLSD(use_estate_sun)); 358 panel->childSetValue("use_estate_sun_check", LLSD(use_estate_sun));
351 359
352 LLViewerRegion* region = gAgent.getRegion();
353 BOOL allow_modify = gAgent.isGodlike() || (region && region->canManageEstate()); 360 BOOL allow_modify = gAgent.isGodlike() || (region && region->canManageEstate());
354 panel->childSetValue("fixed_sun_check", LLSD((BOOL)(region_flags & REGION_FLAGS_SUN_FIXED))); 361 panel->childSetValue("fixed_sun_check", LLSD((BOOL)(region_flags & REGION_FLAGS_SUN_FIXED)));
355 panel->childSetEnabled("fixed_sun_check", allow_modify && !use_estate_sun); 362 panel->childSetEnabled("fixed_sun_check", allow_modify && !use_estate_sun);
@@ -525,7 +532,8 @@ bool LLPanelRegionGeneralInfo::refreshFromRegion(LLViewerRegion* region)
525 setCtrlsEnabled(allow_modify); 532 setCtrlsEnabled(allow_modify);
526 childDisable("apply_btn"); 533 childDisable("apply_btn");
527 childSetEnabled("access_text", allow_modify); 534 childSetEnabled("access_text", allow_modify);
528 childSetEnabled("access_combo", allow_modify); 535 // childSetEnabled("access_combo", allow_modify);
536 // now set in processRegionInfo for teen grid detection
529 childSetEnabled("kick_btn", allow_modify); 537 childSetEnabled("kick_btn", allow_modify);
530 childSetEnabled("kick_all_btn", allow_modify); 538 childSetEnabled("kick_all_btn", allow_modify);
531 childSetEnabled("im_btn", allow_modify); 539 childSetEnabled("im_btn", allow_modify);
@@ -591,7 +599,7 @@ void LLPanelRegionGeneralInfo::onKickCommit(const std::vector<std::string>& name
591 strings_t strings; 599 strings_t strings;
592 // [0] = our agent id 600 // [0] = our agent id
593 // [1] = target agent id 601 // [1] = target agent id
594 char buffer[MAX_STRING]; 602 char buffer[MAX_STRING]; /* Flawfinder: ignore*/
595 gAgent.getID().toString(buffer); 603 gAgent.getID().toString(buffer);
596 strings.push_back(buffer); 604 strings.push_back(buffer);
597 605
@@ -619,7 +627,7 @@ void LLPanelRegionGeneralInfo::onKickAllCommit(S32 option, void* userdata)
619 if(!self) return; 627 if(!self) return;
620 strings_t strings; 628 strings_t strings;
621 // [0] = our agent id 629 // [0] = our agent id
622 char buffer[MAX_STRING]; 630 char buffer[MAX_STRING]; /* Flawfinder: ignore*/
623 gAgent.getID().toString(buffer); 631 gAgent.getID().toString(buffer);
624 strings.push_back(buffer); 632 strings.push_back(buffer);
625 633
@@ -654,7 +662,7 @@ void LLPanelRegionGeneralInfo::onMessageCommit(S32 option, const LLString& text,
654 // [4] message 662 // [4] message
655 strings.push_back("-1"); 663 strings.push_back("-1");
656 strings.push_back("-1"); 664 strings.push_back("-1");
657 char buffer[MAX_STRING]; 665 char buffer[MAX_STRING]; /* Flawfinder: ignore*/
658 gAgent.getID().toString(buffer); 666 gAgent.getID().toString(buffer);
659 strings.push_back(buffer); 667 strings.push_back(buffer);
660 std::string name; 668 std::string name;
@@ -688,35 +696,35 @@ BOOL LLPanelRegionGeneralInfo::sendUpdate()
688 llinfos << "LLPanelRegionGeneralInfo::sendUpdate()" << llendl; 696 llinfos << "LLPanelRegionGeneralInfo::sendUpdate()" << llendl;
689 strings_t strings; 697 strings_t strings;
690 //integers_t integers; 698 //integers_t integers;
691 char buffer[MAX_STRING]; 699 char buffer[MAX_STRING]; /* Flawfinder: ignore*/
692 sprintf(buffer, "%s", (childGetValue("block_terraform_check").asBoolean() ? "Y" : "N")); 700 snprintf(buffer, MAX_STRING, "%s", (childGetValue("block_terraform_check").asBoolean() ? "Y" : "N")); /* Flawfinder: ignore */
693 strings.push_back(strings_t::value_type(buffer)); 701 strings.push_back(strings_t::value_type(buffer));
694 702
695 sprintf(buffer, "%s", (childGetValue("block_fly_check").asBoolean() ? "Y" : "N")); 703 snprintf(buffer, MAX_STRING, "%s", (childGetValue("block_fly_check").asBoolean() ? "Y" : "N")); /* Flawfinder: ignore */
696 strings.push_back(strings_t::value_type(buffer)); 704 strings.push_back(strings_t::value_type(buffer));
697 705
698 sprintf(buffer, "%s", (childGetValue("allow_damage_check").asBoolean() ? "Y" : "N")); 706 snprintf(buffer, MAX_STRING, "%s", (childGetValue("allow_damage_check").asBoolean() ? "Y" : "N")); /* Flawfinder: ignore */
699 strings.push_back(strings_t::value_type(buffer)); 707 strings.push_back(strings_t::value_type(buffer));
700 708
701 sprintf(buffer, "%s", (childGetValue("allow_land_resell_check").asBoolean() ? "Y" : "N")); 709 snprintf(buffer, MAX_STRING, "%s", (childGetValue("allow_land_resell_check").asBoolean() ? "Y" : "N")); /* Flawfinder: ignore */
702 strings.push_back(strings_t::value_type(buffer)); 710 strings.push_back(strings_t::value_type(buffer));
703 711
704 F32 value = (F32)childGetValue("agent_limit_spin").asReal(); 712 F32 value = (F32)childGetValue("agent_limit_spin").asReal();
705 sprintf(buffer, "%f", value); 713 snprintf(buffer, MAX_STRING, "%f", value); /* Flawfinder: ignore*/
706 strings.push_back(strings_t::value_type(buffer)); 714 strings.push_back(strings_t::value_type(buffer));
707 715
708 value = (F32)childGetValue("object_bonus_spin").asReal(); 716 value = (F32)childGetValue("object_bonus_spin").asReal();
709 sprintf(buffer, "%f", value); 717 snprintf(buffer, MAX_STRING, "%f", value); /* Flawfinder: ignore*/
710 strings.push_back(strings_t::value_type(buffer)); 718 strings.push_back(strings_t::value_type(buffer));
711 719
712 U8 access = LLViewerRegion::stringToAccess(childGetValue("access_combo").asString().c_str()); 720 U8 access = LLViewerRegion::stringToAccess(childGetValue("access_combo").asString().c_str());
713 sprintf(buffer, "%d", (S32)access); 721 snprintf(buffer, MAX_STRING, "%d", (S32)access); /* Flawfinder: ignore */
714 strings.push_back(strings_t::value_type(buffer)); 722 strings.push_back(strings_t::value_type(buffer));
715 723
716 sprintf(buffer, "%s", (childGetValue("restrict_pushobject").asBoolean() ? "Y" : "N")); 724 snprintf(buffer, MAX_STRING, "%s", (childGetValue("restrict_pushobject").asBoolean() ? "Y" : "N")); /* Flawfinder: ignore */
717 strings.push_back(strings_t::value_type(buffer)); 725 strings.push_back(strings_t::value_type(buffer));
718 726
719 sprintf(buffer, "%s", (childGetValue("allow_parcel_changes_check").asBoolean() ? "Y" : "N")); 727 snprintf(buffer, MAX_STRING, "%s", (childGetValue("allow_parcel_changes_check").asBoolean() ? "Y" : "N")); /* Flawfinder: ignore */
720 strings.push_back(strings_t::value_type(buffer)); 728 strings.push_back(strings_t::value_type(buffer));
721 729
722 LLUUID invoice(LLFloaterRegionInfo::getLastInvoice()); 730 LLUUID invoice(LLFloaterRegionInfo::getLastInvoice());
@@ -724,7 +732,7 @@ BOOL LLPanelRegionGeneralInfo::sendUpdate()
724 732
725 LLViewerRegion* region = gAgent.getRegion(); 733 LLViewerRegion* region = gAgent.getRegion();
726 if (region 734 if (region
727 && access != region->getSimAccess() ) 735 && access != region->getSimAccess() ) /* Flawfinder: ignore */
728 { 736 {
729 gViewerWindow->alertXml("RegionMaturityChange"); 737 gViewerWindow->alertXml("RegionMaturityChange");
730 } 738 }
@@ -783,15 +791,15 @@ BOOL LLPanelRegionDebugInfo::sendUpdate()
783{ 791{
784 llinfos << "LLPanelRegionDebugInfo::sendUpdate" << llendl; 792 llinfos << "LLPanelRegionDebugInfo::sendUpdate" << llendl;
785 strings_t strings; 793 strings_t strings;
786 char buffer[MAX_STRING]; 794 char buffer[MAX_STRING]; /* Flawfinder: ignore */
787 795
788 sprintf(buffer, "%s", (childGetValue("disable_scripts_check").asBoolean() ? "Y" : "N")); 796 snprintf(buffer, MAX_STRING, "%s", (childGetValue("disable_scripts_check").asBoolean() ? "Y" : "N")); /* Flawfinder: ignore */
789 strings.push_back(buffer); 797 strings.push_back(buffer);
790 798
791 sprintf(buffer, "%s", (childGetValue("disable_collisions_check").asBoolean() ? "Y" : "N")); 799 snprintf(buffer, MAX_STRING, "%s", (childGetValue("disable_collisions_check").asBoolean() ? "Y" : "N")); /* Flawfinder: ignore */
792 strings.push_back(buffer); 800 strings.push_back(buffer);
793 801
794 sprintf(buffer, "%s", (childGetValue("disable_physics_check").asBoolean() ? "Y" : "N")); 802 snprintf(buffer, MAX_STRING, "%s", (childGetValue("disable_physics_check").asBoolean() ? "Y" : "N")); /* Flawfinder: ignore */
795 strings.push_back(buffer); 803 strings.push_back(buffer);
796 804
797 LLUUID invoice(LLFloaterRegionInfo::getLastInvoice()); 805 LLUUID invoice(LLFloaterRegionInfo::getLastInvoice());
@@ -946,10 +954,10 @@ bool LLPanelRegionTextureInfo::refreshFromRegion(LLViewerRegion* region)
946 954
947 LLVLComposition* compp = region->getComposition(); 955 LLVLComposition* compp = region->getComposition();
948 LLTextureCtrl* texture_ctrl; 956 LLTextureCtrl* texture_ctrl;
949 char buffer[MAX_STRING]; 957 char buffer[MAX_STRING]; /* Flawfinder: ignore */
950 for(S32 i = 0; i < TERRAIN_TEXTURE_COUNT; ++i) 958 for(S32 i = 0; i < TERRAIN_TEXTURE_COUNT; ++i)
951 { 959 {
952 sprintf(buffer, "texture_detail_%d", i); 960 snprintf(buffer, MAX_STRING, "texture_detail_%d", i); /* Flawfinder: ignore */
953 texture_ctrl = LLViewerUICtrlFactory::getTexturePickerByName(this, buffer); 961 texture_ctrl = LLViewerUICtrlFactory::getTexturePickerByName(this, buffer);
954 if(texture_ctrl) 962 if(texture_ctrl)
955 { 963 {
@@ -962,9 +970,9 @@ bool LLPanelRegionTextureInfo::refreshFromRegion(LLViewerRegion* region)
962 970
963 for(S32 i = 0; i < CORNER_COUNT; ++i) 971 for(S32 i = 0; i < CORNER_COUNT; ++i)
964 { 972 {
965 sprintf(buffer, "height_start_spin_%d", i); 973 snprintf(buffer, MAX_STRING, "height_start_spin_%d", i); /* Flawfinder: ignore */
966 childSetValue(buffer, LLSD(compp->getStartHeight(i))); 974 childSetValue(buffer, LLSD(compp->getStartHeight(i)));
967 sprintf(buffer, "height_range_spin_%d", i); 975 snprintf(buffer, MAX_STRING, "height_range_spin_%d", i); /* Flawfinder: ignore */
968 childSetValue(buffer, LLSD(compp->getHeightRange(i))); 976 childSetValue(buffer, LLSD(compp->getHeightRange(i)));
969 } 977 }
970 978
@@ -976,18 +984,18 @@ bool LLPanelRegionTextureInfo::refreshFromRegion(LLViewerRegion* region)
976BOOL LLPanelRegionTextureInfo::postBuild() 984BOOL LLPanelRegionTextureInfo::postBuild()
977{ 985{
978 LLPanelRegionInfo::postBuild(); 986 LLPanelRegionInfo::postBuild();
979 char buffer[MAX_STRING]; 987 char buffer[MAX_STRING]; /* Flawfinder: ignore */
980 for(S32 i = 0; i < TERRAIN_TEXTURE_COUNT; ++i) 988 for(S32 i = 0; i < TERRAIN_TEXTURE_COUNT; ++i)
981 { 989 {
982 sprintf(buffer, "texture_detail_%d", i); 990 snprintf(buffer, MAX_STRING, "texture_detail_%d", i); /* Flawfinder: ignore */
983 initCtrl(buffer); 991 initCtrl(buffer);
984 } 992 }
985 993
986 for(S32 i = 0; i < CORNER_COUNT; ++i) 994 for(S32 i = 0; i < CORNER_COUNT; ++i)
987 { 995 {
988 sprintf(buffer, "height_start_spin_%d", i); 996 snprintf(buffer, MAX_STRING, "height_start_spin_%d", i); /* Flawfinder: ignore */
989 initCtrl(buffer); 997 initCtrl(buffer);
990 sprintf(buffer, "height_range_spin_%d", i); 998 snprintf(buffer, MAX_STRING, "height_range_spin_%d", i); /* Flawfinder: ignore */
991 initCtrl(buffer); 999 initCtrl(buffer);
992 } 1000 }
993 1001
@@ -1017,9 +1025,9 @@ BOOL LLPanelRegionTextureInfo::sendUpdate()
1017 } 1025 }
1018 1026
1019 LLTextureCtrl* texture_ctrl; 1027 LLTextureCtrl* texture_ctrl;
1020 char buffer[MAX_STRING]; 1028 char buffer[MAX_STRING]; /* Flawfinder: ignore */
1021 char buffer2[MAX_STRING]; 1029 char buffer2[MAX_STRING]; /* Flawfinder: ignore */
1022 char id_str[UUID_STR_LENGTH]; 1030 char id_str[UUID_STR_LENGTH]; /* Flawfinder: ignore */
1023 LLMessageSystem* msg = gMessageSystem; 1031 LLMessageSystem* msg = gMessageSystem;
1024 strings_t strings; 1032 strings_t strings;
1025 1033
@@ -1027,13 +1035,13 @@ BOOL LLPanelRegionTextureInfo::sendUpdate()
1027 1035
1028 for(S32 i = 0; i < TERRAIN_TEXTURE_COUNT; ++i) 1036 for(S32 i = 0; i < TERRAIN_TEXTURE_COUNT; ++i)
1029 { 1037 {
1030 sprintf(buffer, "texture_detail_%d", i); 1038 snprintf(buffer, MAX_STRING, "texture_detail_%d", i); /* Flawfinder: ignore */
1031 texture_ctrl = LLViewerUICtrlFactory::getTexturePickerByName(this, buffer); 1039 texture_ctrl = LLViewerUICtrlFactory::getTexturePickerByName(this, buffer);
1032 if(texture_ctrl) 1040 if(texture_ctrl)
1033 { 1041 {
1034 LLUUID tmp_id(texture_ctrl->getImageAssetID()); 1042 LLUUID tmp_id(texture_ctrl->getImageAssetID());
1035 tmp_id.toString(id_str); 1043 tmp_id.toString(id_str);
1036 sprintf(buffer, "%d %s", i, id_str); 1044 snprintf(buffer, MAX_STRING, "%d %s", i, id_str); /* Flawfinder: ignore */
1037 strings.push_back(strings_t::value_type(buffer)); 1045 strings.push_back(strings_t::value_type(buffer));
1038 } 1046 }
1039 } 1047 }
@@ -1041,9 +1049,9 @@ BOOL LLPanelRegionTextureInfo::sendUpdate()
1041 strings.clear(); 1049 strings.clear();
1042 for(S32 i = 0; i < CORNER_COUNT; ++i) 1050 for(S32 i = 0; i < CORNER_COUNT; ++i)
1043 { 1051 {
1044 sprintf(buffer, "height_start_spin_%d", i); 1052 snprintf(buffer, MAX_STRING, "height_start_spin_%d", i); /* Flawfinder: ignore */
1045 sprintf(buffer2, "height_range_spin_%d", i); 1053 snprintf(buffer2, MAX_STRING, "height_range_spin_%d", i); /* Flawfinder: ignore */
1046 sprintf(buffer, "%d %f %f", i, (F32)childGetValue(buffer).asReal(), (F32)childGetValue(buffer2).asReal()); 1054 snprintf(buffer, MAX_STRING, "%d %f %f", i, (F32)childGetValue(buffer).asReal(), (F32)childGetValue(buffer2).asReal()); /* Flawfinder: ignore */
1047 strings.push_back(strings_t::value_type(buffer)); 1055 strings.push_back(strings_t::value_type(buffer));
1048 } 1056 }
1049 sendEstateOwnerMessage(msg, "textureheights", invoice, strings); 1057 sendEstateOwnerMessage(msg, "textureheights", invoice, strings);
@@ -1056,8 +1064,8 @@ BOOL LLPanelRegionTextureInfo::validateTextureSizes()
1056{ 1064{
1057 for(S32 i = 0; i < TERRAIN_TEXTURE_COUNT; ++i) 1065 for(S32 i = 0; i < TERRAIN_TEXTURE_COUNT; ++i)
1058 { 1066 {
1059 char buffer[MAX_STRING]; 1067 char buffer[MAX_STRING]; /* Flawfinder: ignore */
1060 sprintf(buffer, "texture_detail_%d", i); 1068 snprintf(buffer, MAX_STRING, "texture_detail_%d", i); /* Flawfinder: ignore */
1061 LLTextureCtrl* texture_ctrl = LLViewerUICtrlFactory::getTexturePickerByName(this, buffer); 1069 LLTextureCtrl* texture_ctrl = LLViewerUICtrlFactory::getTexturePickerByName(this, buffer);
1062 if (!texture_ctrl) continue; 1070 if (!texture_ctrl) continue;
1063 1071
@@ -1158,21 +1166,21 @@ bool LLPanelRegionTerrainInfo::refreshFromRegion(LLViewerRegion* region)
1158BOOL LLPanelRegionTerrainInfo::sendUpdate() 1166BOOL LLPanelRegionTerrainInfo::sendUpdate()
1159{ 1167{
1160 llinfos << "LLPanelRegionTerrainInfo::sendUpdate" << llendl; 1168 llinfos << "LLPanelRegionTerrainInfo::sendUpdate" << llendl;
1161 char buffer[MAX_STRING]; 1169 char buffer[MAX_STRING]; /* Flawfinder: ignore */
1162 strings_t strings; 1170 strings_t strings;
1163 LLUUID invoice(LLFloaterRegionInfo::getLastInvoice()); 1171 LLUUID invoice(LLFloaterRegionInfo::getLastInvoice());
1164 1172
1165 sprintf(buffer, "%f", (F32)childGetValue("water_height_spin").asReal()); 1173 snprintf(buffer, MAX_STRING, "%f", (F32)childGetValue("water_height_spin").asReal()); /* Flawfinder: ignore */
1166 strings.push_back(buffer); 1174 strings.push_back(buffer);
1167 sprintf(buffer, "%f", (F32)childGetValue("terrain_raise_spin").asReal()); 1175 snprintf(buffer, MAX_STRING, "%f", (F32)childGetValue("terrain_raise_spin").asReal()); /* Flawfinder: ignore */
1168 strings.push_back(buffer); 1176 strings.push_back(buffer);
1169 sprintf(buffer, "%f", (F32)childGetValue("terrain_lower_spin").asReal()); 1177 snprintf(buffer, MAX_STRING, "%f", (F32)childGetValue("terrain_lower_spin").asReal()); /* Flawfinder: ignore */
1170 strings.push_back(buffer); 1178 strings.push_back(buffer);
1171 sprintf(buffer, "%s", (childGetValue("use_estate_sun_check").asBoolean() ? "Y" : "N")); 1179 snprintf(buffer, MAX_STRING, "%s", (childGetValue("use_estate_sun_check").asBoolean() ? "Y" : "N")); /* Flawfinder: ignore*/
1172 strings.push_back(buffer); 1180 strings.push_back(buffer);
1173 sprintf(buffer, "%s", (childGetValue("fixed_sun_check").asBoolean() ? "Y" : "N")); 1181 snprintf(buffer, MAX_STRING, "%s", (childGetValue("fixed_sun_check").asBoolean() ? "Y" : "N")); /* Flawfinder: ignore*/
1174 strings.push_back(buffer); 1182 strings.push_back(buffer);
1175 sprintf(buffer, "%f", (F32)childGetValue("sun_hour_slider").asReal() ); 1183 snprintf(buffer, MAX_STRING, "%f", (F32)childGetValue("sun_hour_slider").asReal() ); /* Flawfinder: ignore*/
1176 strings.push_back(buffer); 1184 strings.push_back(buffer);
1177 1185
1178 // Grab estate information in case the user decided to set the 1186 // Grab estate information in case the user decided to set the
@@ -1198,11 +1206,11 @@ BOOL LLPanelRegionTerrainInfo::sendUpdate()
1198 estate_sun_hour = panel->getSunHour(); 1206 estate_sun_hour = panel->getSunHour();
1199 } 1207 }
1200 1208
1201 sprintf(buffer, "%s", (estate_global_time ? "Y" : "N") ); 1209 snprintf(buffer, MAX_STRING, "%s", (estate_global_time ? "Y" : "N") ); /* Flawfinder: ignore*/
1202 strings.push_back(buffer); 1210 strings.push_back(buffer);
1203 sprintf(buffer, "%s", (estate_fixed_sun ? "Y" : "N") ); 1211 snprintf(buffer, MAX_STRING, "%s", (estate_fixed_sun ? "Y" : "N") ); /* Flawfinder: ignore*/
1204 strings.push_back(buffer); 1212 strings.push_back(buffer);
1205 sprintf(buffer, "%f", estate_sun_hour); 1213 snprintf(buffer, MAX_STRING, "%f", estate_sun_hour); /* Flawfinder: ignore*/
1206 strings.push_back(buffer); 1214 strings.push_back(buffer);
1207 1215
1208 sendEstateOwnerMessage(gMessageSystem, "setregionterrain", invoice, strings); 1216 sendEstateOwnerMessage(gMessageSystem, "setregionterrain", invoice, strings);
@@ -1531,7 +1539,7 @@ void LLPanelEstateInfo::kickUserConfirm(S32 option, void* userdata)
1531 1539
1532 LLUUID invoice(LLFloaterRegionInfo::getLastInvoice()); 1540 LLUUID invoice(LLFloaterRegionInfo::getLastInvoice());
1533 strings_t strings; 1541 strings_t strings;
1534 char buffer[MAX_STRING]; 1542 char buffer[MAX_STRING]; /* Flawfinder: ignore*/
1535 1543
1536 switch(option) 1544 switch(option)
1537 { 1545 {
@@ -1814,12 +1822,12 @@ void LLPanelEstateInfo::sendEstateAccessDelta(U32 flags, const LLUUID& agent_or_
1814 msg->addString("Method", "estateaccessdelta"); 1822 msg->addString("Method", "estateaccessdelta");
1815 msg->addUUID("Invoice", LLFloaterRegionInfo::getLastInvoice()); 1823 msg->addUUID("Invoice", LLFloaterRegionInfo::getLastInvoice());
1816 1824
1817 char buf[MAX_STRING]; 1825 char buf[MAX_STRING]; /* Flawfinder: ignore*/
1818 gAgent.getID().toString(buf); 1826 gAgent.getID().toString(buf);
1819 msg->nextBlock("ParamList"); 1827 msg->nextBlock("ParamList");
1820 msg->addString("Parameter", buf); 1828 msg->addString("Parameter", buf);
1821 1829
1822 sprintf(buf, "%u", flags); 1830 snprintf(buf, MAX_STRING, "%u", flags); /* Flawfinder: ignore*/
1823 msg->nextBlock("ParamList"); 1831 msg->nextBlock("ParamList");
1824 msg->addString("Parameter", buf); 1832 msg->addString("Parameter", buf);
1825 1833
@@ -2075,8 +2083,8 @@ void LLPanelEstateInfo::commitEstateInfo()
2075 msg->nextBlock("ParamList"); 2083 msg->nextBlock("ParamList");
2076 msg->addString("Parameter", getEstateName()); 2084 msg->addString("Parameter", getEstateName());
2077 2085
2078 char buf[MAX_STRING]; 2086 char buf[MAX_STRING]; /* Flawfinder: ignore*/
2079 sprintf(buf, "%u", computeEstateFlags()); 2087 snprintf(buf, MAX_STRING, "%u", computeEstateFlags()); /* Flawfinder: ignore*/
2080 msg->nextBlock("ParamList"); 2088 msg->nextBlock("ParamList");
2081 msg->addString("Parameter", buf); 2089 msg->addString("Parameter", buf);
2082 2090
@@ -2086,7 +2094,7 @@ void LLPanelEstateInfo::commitEstateInfo()
2086 sun_hour = 0.f; // 0 = global time 2094 sun_hour = 0.f; // 0 = global time
2087 } 2095 }
2088 2096
2089 sprintf(buf, "%d", (S32)(sun_hour*1024.0f)); 2097 snprintf(buf, MAX_STRING, "%d", (S32)(sun_hour*1024.0f)); /* Flawfinder: ignore*/
2090 msg->nextBlock("ParamList"); 2098 msg->nextBlock("ParamList");
2091 msg->addString("Parameter", buf); 2099 msg->addString("Parameter", buf);
2092 2100
@@ -2560,8 +2568,13 @@ void LLPanelEstateCovenant::onLoadComplete(LLVFS *vfs,
2560 S32 file_length = file.getSize(); 2568 S32 file_length = file.getSize();
2561 2569
2562 char* buffer = new char[file_length+1]; 2570 char* buffer = new char[file_length+1];
2563 file.read((U8*)buffer, file_length); 2571 if (buffer == NULL)
2572 {
2573 llerrs << "Memory Allocation Failed" << llendl;
2574 return;
2575 }
2564 2576
2577 file.read((U8*)buffer, file_length); /* Flawfinder: ignore */
2565 // put a EOS at the end 2578 // put a EOS at the end
2566 buffer[file_length] = 0; 2579 buffer[file_length] = 0;
2567 2580
@@ -2633,7 +2646,7 @@ void LLPanelEstateCovenant::sendChangeCovenantID(const LLUUID &asset_id)
2633 msg->addUUID("Invoice", LLFloaterRegionInfo::getLastInvoice()); 2646 msg->addUUID("Invoice", LLFloaterRegionInfo::getLastInvoice());
2634 2647
2635 msg->nextBlock("ParamList"); 2648 msg->nextBlock("ParamList");
2636 msg->addString("Parameter", getCovenantID().getString().c_str()); 2649 msg->addString("Parameter", getCovenantID().asString());
2637 gAgent.sendReliableMessage(); 2650 gAgent.sendReliableMessage();
2638 } 2651 }
2639} 2652}
@@ -2879,7 +2892,7 @@ bool LLDispatchSetEstateAccess::operator()(
2879 for (S32 i = 0; i < num_allowed_agents && i < ESTATE_MAX_ACCESS_IDS; i++) 2892 for (S32 i = 0; i < num_allowed_agents && i < ESTATE_MAX_ACCESS_IDS; i++)
2880 { 2893 {
2881 LLUUID id; 2894 LLUUID id;
2882 memcpy(id.mData, strings[index++].data(), UUID_BYTES); 2895 memcpy(id.mData, strings[index++].data(), UUID_BYTES); /* Flawfinder: ignore */
2883 allowed_agent_name_list->addNameItem(id); 2896 allowed_agent_name_list->addNameItem(id);
2884 } 2897 }
2885 panel->childSetEnabled("remove_allowed_avatar_btn", allowed_agent_name_list->getFirstSelected() ? TRUE : FALSE); 2898 panel->childSetEnabled("remove_allowed_avatar_btn", allowed_agent_name_list->getFirstSelected() ? TRUE : FALSE);
@@ -2903,7 +2916,7 @@ bool LLDispatchSetEstateAccess::operator()(
2903 for (S32 i = 0; i < num_allowed_groups && i < ESTATE_MAX_GROUP_IDS; i++) 2916 for (S32 i = 0; i < num_allowed_groups && i < ESTATE_MAX_GROUP_IDS; i++)
2904 { 2917 {
2905 LLUUID id; 2918 LLUUID id;
2906 memcpy(id.mData, strings[index++].data(), UUID_BYTES); 2919 memcpy(id.mData, strings[index++].data(), UUID_BYTES); /* Flawfinder: ignore */
2907 allowed_group_name_list->addGroupNameItem(id); 2920 allowed_group_name_list->addGroupNameItem(id);
2908 } 2921 }
2909 panel->childSetEnabled("remove_allowed_group_btn", allowed_group_name_list->getFirstSelected() ? TRUE : FALSE); 2922 panel->childSetEnabled("remove_allowed_group_btn", allowed_group_name_list->getFirstSelected() ? TRUE : FALSE);
@@ -2935,7 +2948,7 @@ bool LLDispatchSetEstateAccess::operator()(
2935 for (S32 i = 0; i < num_banned_agents && i < ESTATE_MAX_ACCESS_IDS; i++) 2948 for (S32 i = 0; i < num_banned_agents && i < ESTATE_MAX_ACCESS_IDS; i++)
2936 { 2949 {
2937 LLUUID id; 2950 LLUUID id;
2938 memcpy(id.mData, strings[index++].data(), UUID_BYTES); 2951 memcpy(id.mData, strings[index++].data(), UUID_BYTES); /* Flawfinder: ignore */
2939 banned_agent_name_list->addNameItem(id); 2952 banned_agent_name_list->addNameItem(id);
2940 } 2953 }
2941 panel->childSetEnabled("remove_banned_avatar_btn", banned_agent_name_list->getFirstSelected() ? TRUE : FALSE); 2954 panel->childSetEnabled("remove_banned_avatar_btn", banned_agent_name_list->getFirstSelected() ? TRUE : FALSE);
@@ -2958,7 +2971,7 @@ bool LLDispatchSetEstateAccess::operator()(
2958 for (S32 i = 0; i < num_estate_managers && i < ESTATE_MAX_MANAGERS; i++) 2971 for (S32 i = 0; i < num_estate_managers && i < ESTATE_MAX_MANAGERS; i++)
2959 { 2972 {
2960 LLUUID id; 2973 LLUUID id;
2961 memcpy(id.mData, strings[index++].data(), UUID_BYTES); 2974 memcpy(id.mData, strings[index++].data(), UUID_BYTES); /* Flawfinder: ignore */
2962 estate_manager_name_list->addNameItem(id); 2975 estate_manager_name_list->addNameItem(id);
2963 } 2976 }
2964 panel->childSetEnabled("remove_estate_manager_btn", estate_manager_name_list->getFirstSelected() ? TRUE : FALSE); 2977 panel->childSetEnabled("remove_estate_manager_btn", estate_manager_name_list->getFirstSelected() ? TRUE : FALSE);
diff --git a/linden/indra/newview/llfloaterreporter.cpp b/linden/indra/newview/llfloaterreporter.cpp
index 116b338..0337dd0 100644
--- a/linden/indra/newview/llfloaterreporter.cpp
+++ b/linden/indra/newview/llfloaterreporter.cpp
@@ -63,6 +63,7 @@
63#include "lltooldraganddrop.h" 63#include "lltooldraganddrop.h"
64#include "llfloatermap.h" 64#include "llfloatermap.h"
65#include "lluiconstants.h" 65#include "lluiconstants.h"
66#include "lluploaddialog.h"
66#include "llcallingcard.h" 67#include "llcallingcard.h"
67#include "llviewerobjectlist.h" 68#include "llviewerobjectlist.h"
68#include "llagent.h" 69#include "llagent.h"
@@ -80,6 +81,7 @@
80#include "llvieweruictrlfactory.h" 81#include "llvieweruictrlfactory.h"
81#include "viewer.h" 82#include "viewer.h"
82 83
84#include "llassetuploadresponders.h"
83 85
84const U32 INCLUDE_SCREENSHOT = 0x01 << 0; 86const U32 INCLUDE_SCREENSHOT = 0x01 << 0;
85 87
@@ -115,7 +117,8 @@ LLFloaterReporter::LLFloaterReporter(
115 mDeselectOnClose( FALSE ), 117 mDeselectOnClose( FALSE ),
116 mPicking( FALSE), 118 mPicking( FALSE),
117 mPosition(), 119 mPosition(),
118 mCopyrightWarningSeen( FALSE ) 120 mCopyrightWarningSeen( FALSE ),
121 mResourceDatap(new LLResourceData())
119{ 122{
120 if (report_type == BUG_REPORT) 123 if (report_type == BUG_REPORT)
121 { 124 {
@@ -166,9 +169,9 @@ LLFloaterReporter::LLFloaterReporter(
166 169
167 gReporterInstances.addData(report_type, this); 170 gReporterInstances.addData(report_type, this);
168 171
169 // Upload a screenshot, but don't draw this floater. 172 // Take a screenshot, but don't draw this floater.
170 setVisible(FALSE); 173 setVisible(FALSE);
171 uploadScreenshot(); 174 takeScreenshot();
172 setVisible(TRUE); 175 setVisible(TRUE);
173 176
174 // Default text to be blank 177 // Default text to be blank
@@ -230,11 +233,7 @@ LLFloaterReporter::~LLFloaterReporter()
230 std::for_each(mMCDList.begin(), mMCDList.end(), DeletePointer() ); 233 std::for_each(mMCDList.begin(), mMCDList.end(), DeletePointer() );
231 mMCDList.clear(); 234 mMCDList.clear();
232 235
233 if (gSelectMgr) 236 delete mResourceDatap;
234 {
235 gSelectMgr->deselectTransient();
236 }
237
238 gDialogVisible = FALSE; 237 gDialogVisible = FALSE;
239} 238}
240 239
@@ -368,7 +367,7 @@ void LLFloaterReporter::callbackAvatarID(const std::vector<std::string>& names,
368 if ( self->mReportType != BUG_REPORT ) 367 if ( self->mReportType != BUG_REPORT )
369 { 368 {
370 self->childSetText("abuser_name_edit", names[0] ); 369 self->childSetText("abuser_name_edit", names[0] );
371 370
372 self->mAbuserID = ids[0]; 371 self->mAbuserID = ids[0];
373 372
374 self->refresh(); 373 self->refresh();
@@ -379,31 +378,59 @@ void LLFloaterReporter::callbackAvatarID(const std::vector<std::string>& names,
379void LLFloaterReporter::onClickSend(void *userdata) 378void LLFloaterReporter::onClickSend(void *userdata)
380{ 379{
381 LLFloaterReporter *self = (LLFloaterReporter *)userdata; 380 LLFloaterReporter *self = (LLFloaterReporter *)userdata;
381
382 if (self->mPicking)
383 {
384 closePickTool(self);
385 }
382 386
383 // only do this for abuse reports 387 if(self->validateReport())
384 if ( self->mReportType != BUG_REPORT )
385 { 388 {
386 if ( ! self->mCopyrightWarningSeen ) 389 // only show copyright alert for abuse reports
390 if ( self->mReportType != BUG_REPORT )
387 { 391 {
388 LLString details_lc = self->childGetText("details_edit"); 392 if ( ! self->mCopyrightWarningSeen )
389 LLString::toLower( details_lc );
390 LLString summary_lc = self->childGetText("summary_edit");
391 LLString::toLower( summary_lc );
392 if ( details_lc.find( "copyright" ) != std::string::npos ||
393 summary_lc.find( "copyright" ) != std::string::npos )
394 { 393 {
395 gViewerWindow->alertXml("HelpReportAbuseContainsCopyright"); 394 LLString details_lc = self->childGetText("details_edit");
396 self->mCopyrightWarningSeen = TRUE; 395 LLString::toLower( details_lc );
397 return; 396 LLString summary_lc = self->childGetText("summary_edit");
397 LLString::toLower( summary_lc );
398 if ( details_lc.find( "copyright" ) != std::string::npos ||
399 summary_lc.find( "copyright" ) != std::string::npos )
400 {
401 gViewerWindow->alertXml("HelpReportAbuseContainsCopyright");
402 self->mCopyrightWarningSeen = TRUE;
403 return;
404 };
398 }; 405 };
399 }; 406 };
400 };
401 407
402 if (self->mPicking) 408 LLUploadDialog::modalUploadDialog("Uploading...\n\nReport");
403 { 409 // *TODO don't upload image if checkbox isn't checked
404 closePickTool(self); 410 std::string url = gAgent.getRegion()->getCapability("SendUserReport");
411 std::string sshot_url = gAgent.getRegion()->getCapability("SendUserReportWithScreenshot");
412 if(!url.empty() || !sshot_url.empty())
413 {
414 self->sendReportViaCaps(url, sshot_url, self->gatherReport());
415 self->close();
416 }
417 else
418 {
419 if(self->childGetValue("screen_check"))
420 {
421 self->childDisable("send_btn");
422 self->childDisable("cancel_btn");
423 // the callback from uploading the image calls sendReportViaLegacy()
424 self->uploadImage();
425 }
426 else
427 {
428 self->sendReportViaLegacy(self->gatherReport());
429 LLUploadDialog::modalUploadFinished();
430 self->close();
431 }
432 }
405 } 433 }
406 self->sendReport();
407} 434}
408 435
409 436
@@ -459,7 +486,7 @@ void LLFloaterReporter::showFromMenu(EReportType report_type)
459 { 486 {
460 // ...bring that window to front 487 // ...bring that window to front
461 LLFloaterReporter *f = gReporterInstances.getData(report_type); 488 LLFloaterReporter *f = gReporterInstances.getData(report_type);
462 f->open(); 489 f->open(); /* Flawfinder: ignore */
463 } 490 }
464 else 491 else
465 { 492 {
@@ -515,7 +542,7 @@ void LLFloaterReporter::showFromObject(const LLUUID& object_id)
515 // Need to deselect on close 542 // Need to deselect on close
516 f->mDeselectOnClose = TRUE; 543 f->mDeselectOnClose = TRUE;
517 544
518 f->open(); 545 f->open(); /* Flawfinder: ignore */
519} 546}
520 547
521 548
@@ -556,10 +583,9 @@ void LLFloaterReporter::setPickedObjectProperties(const char *object_name, const
556 childSetText("owner_name", owner_name); 583 childSetText("owner_name", owner_name);
557} 584}
558 585
559void LLFloaterReporter::sendReport() 586
587bool LLFloaterReporter::validateReport()
560{ 588{
561 LLViewerRegion *regionp = gAgent.getRegion();
562 if (!regionp) return;
563 // Ensure user selected a category from the list 589 // Ensure user selected a category from the list
564 LLSD category_sd = childGetValue("category_combo"); 590 LLSD category_sd = childGetValue("category_combo");
565 U8 category = (U8)category_sd.asInteger(); 591 U8 category = (U8)category_sd.asInteger();
@@ -573,7 +599,7 @@ void LLFloaterReporter::sendReport()
573 { 599 {
574 gViewerWindow->alertXml("HelpReportBugSelectCategory"); 600 gViewerWindow->alertXml("HelpReportBugSelectCategory");
575 } 601 }
576 return; 602 return false;
577 } 603 }
578 604
579 if ( mReportType != BUG_REPORT ) 605 if ( mReportType != BUG_REPORT )
@@ -581,13 +607,13 @@ void LLFloaterReporter::sendReport()
581 if ( childGetText("abuser_name_edit").empty() ) 607 if ( childGetText("abuser_name_edit").empty() )
582 { 608 {
583 gViewerWindow->alertXml("HelpReportAbuseAbuserNameEmpty"); 609 gViewerWindow->alertXml("HelpReportAbuseAbuserNameEmpty");
584 return; 610 return false;
585 }; 611 };
586 612
587 if ( childGetText("abuse_location_edit").empty() ) 613 if ( childGetText("abuse_location_edit").empty() )
588 { 614 {
589 gViewerWindow->alertXml("HelpReportAbuseAbuserLocationEmpty"); 615 gViewerWindow->alertXml("HelpReportAbuseAbuserLocationEmpty");
590 return; 616 return false;
591 }; 617 };
592 }; 618 };
593 619
@@ -601,7 +627,7 @@ void LLFloaterReporter::sendReport()
601 { 627 {
602 gViewerWindow->alertXml("HelpReportBugSummaryEmpty"); 628 gViewerWindow->alertXml("HelpReportBugSummaryEmpty");
603 } 629 }
604 return; 630 return false;
605 }; 631 };
606 632
607 if ( childGetText("details_edit") == mDefaultSummary ) 633 if ( childGetText("details_edit") == mDefaultSummary )
@@ -614,53 +640,19 @@ void LLFloaterReporter::sendReport()
614 { 640 {
615 gViewerWindow->alertXml("HelpReportBugDetailsEmpty"); 641 gViewerWindow->alertXml("HelpReportBugDetailsEmpty");
616 } 642 }
617 return; 643 return false;
618 }; 644 };
645 return true;
646}
647
648LLSD LLFloaterReporter::gatherReport()
649{
650 LLViewerRegion *regionp = gAgent.getRegion();
651 if (!regionp) return LLSD(); // *TODO handle this failure case more gracefully
619 652
620 // reset flag in case the next report also contains this text 653 // reset flag in case the next report also contains this text
621 mCopyrightWarningSeen = FALSE; 654 mCopyrightWarningSeen = FALSE;
622 655
623 U32 check_flags = 0;
624 if (childGetValue("screen_check"))
625 {
626 check_flags |= INCLUDE_SCREENSHOT;
627 }
628
629 LLMessageSystem *msg = gMessageSystem;
630 msg->newMessageFast(_PREHASH_UserReport);
631 msg->nextBlockFast(_PREHASH_AgentData);
632 msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
633 msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
634 msg->nextBlockFast(_PREHASH_ReportData);
635 msg->addU8Fast(_PREHASH_ReportType, (U8) mReportType);
636 msg->addU8(_PREHASH_Category, category);
637 msg->addVector3Fast(_PREHASH_Position, mPosition);
638 msg->addU8Fast(_PREHASH_CheckFlags, (U8) check_flags);
639
640 // only send a screenshot ID if we're asked too and the email is
641 // going to LL - Estate Owners cannot see the screenshot asset
642 LLSD screenshot_id = LLUUID::null;
643 if (childGetValue("screen_check"))
644 {
645 if ( mReportType != BUG_REPORT )
646 {
647 if ( gEmailToEstateOwner == FALSE )
648 {
649 screenshot_id = childGetValue("screenshot");
650 }
651 }
652 else
653 {
654 screenshot_id = childGetValue("screenshot");
655 };
656 };
657 msg->addUUIDFast(_PREHASH_ScreenshotID, screenshot_id);
658 msg->addUUIDFast(_PREHASH_ObjectID, mObjectID);
659
660 msg->addUUID("AbuserID", mAbuserID );
661 msg->addString("AbuseRegionName", "");
662 msg->addUUID("AbuseRegionID", LLUUID::null);
663
664 std::ostringstream summary; 656 std::ostringstream summary;
665 if (!gInProductionGrid) 657 if (!gInProductionGrid)
666 { 658 {
@@ -708,7 +700,6 @@ void LLFloaterReporter::sendReport()
708 << " {" << childGetText("abuser_name_edit") << "} " // name of abuse entered in report (chosen using LLAvatarPicker) 700 << " {" << childGetText("abuser_name_edit") << "} " // name of abuse entered in report (chosen using LLAvatarPicker)
709 << " \"" << childGetValue("summary_edit").asString() << "\""; // summary as entered 701 << " \"" << childGetValue("summary_edit").asString() << "\""; // summary as entered
710 }; 702 };
711 msg->addStringFast(_PREHASH_Summary, summary.str().c_str());
712 703
713 std::ostringstream details; 704 std::ostringstream details;
714 if (mReportType != BUG_REPORT) 705 if (mReportType != BUG_REPORT)
@@ -733,10 +724,10 @@ void LLFloaterReporter::sendReport()
733 }; 724 };
734 725
735 details << childGetValue("details_edit").asString(); 726 details << childGetValue("details_edit").asString();
736 msg->addStringFast(_PREHASH_Details, details.str() );
737 727
738 char version_string[MAX_STRING]; 728 char version_string[MAX_STRING]; /* Flawfinder: ignore */
739 sprintf(version_string, 729 snprintf(version_string, /* Flawfinder: ignore */
730 MAX_STRING,
740 "%d.%d.%d %s %s %s %s", 731 "%d.%d.%d %s %s %s %s",
741 LL_VERSION_MAJOR, 732 LL_VERSION_MAJOR,
742 LL_VERSION_MINOR, 733 LL_VERSION_MINOR,
@@ -745,120 +736,204 @@ void LLFloaterReporter::sendReport()
745 gSysCPU.getFamily().c_str(), 736 gSysCPU.getFamily().c_str(),
746 gGLManager.mGLRenderer.c_str(), 737 gGLManager.mGLRenderer.c_str(),
747 gGLManager.mDriverVersionVendorString.c_str()); 738 gGLManager.mDriverVersionVendorString.c_str());
748 msg->addString("VersionString", version_string);
749 739
750 msg->sendReliable(regionp->getHost()); 740 // only send a screenshot ID if we're asked to and the email is
741 // going to LL - Estate Owners cannot see the screenshot asset
742 LLUUID screenshot_id = LLUUID::null;
743 if (childGetValue("screen_check"))
744 {
745 if ( mReportType != BUG_REPORT )
746 {
747 if ( gEmailToEstateOwner == FALSE )
748 {
749 screenshot_id = childGetValue("screenshot");
750 }
751 }
752 else
753 {
754 screenshot_id = childGetValue("screenshot");
755 };
756 };
757
758 LLSD report = LLSD::emptyMap();
759 report["report-type"] = (U8) mReportType;
760 report["category"] = childGetValue("category_combo");
761 report["position"] = mPosition.getValue();
762 report["check-flags"] = (U8)0; // this is not used
763 report["screenshot-id"] = screenshot_id;
764 report["object-id"] = mObjectID;
765 report["abuser-id"] = mAbuserID;
766 report["abuse-region-name"] = "";
767 report["abuse-region-id"] = LLUUID::null;
768 report["summary"] = summary.str();
769 report["version-string"] = version_string;
770 report["details"] = details.str();
771 return report;
772}
751 773
752 close(); 774void LLFloaterReporter::sendReportViaLegacy(const LLSD & report)
775{
776 LLViewerRegion *regionp = gAgent.getRegion();
777 if (!regionp) return;
778 LLMessageSystem *msg = gMessageSystem;
779 msg->newMessageFast(_PREHASH_UserReport);
780 msg->nextBlockFast(_PREHASH_AgentData);
781 msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
782 msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
783
784 msg->nextBlockFast(_PREHASH_ReportData);
785 msg->addU8Fast(_PREHASH_ReportType, report["report-type"].asInteger());
786 msg->addU8(_PREHASH_Category, report["category"].asInteger());
787 msg->addVector3Fast(_PREHASH_Position, LLVector3(report["position"]));
788 msg->addU8Fast(_PREHASH_CheckFlags, report["check-flags"].asInteger());
789 msg->addUUIDFast(_PREHASH_ScreenshotID, report["screenshot-id"].asUUID());
790 msg->addUUIDFast(_PREHASH_ObjectID, report["object-id"].asUUID());
791 msg->addUUID("AbuserID", report["abuser-id"].asUUID());
792 msg->addString("AbuseRegionName", report["abuse-region-name"].asString());
793 msg->addUUID("AbuseRegionID", report["abuse-region-id"].asUUID());
794
795 msg->addStringFast(_PREHASH_Summary, report["summary"].asString().c_str());
796 msg->addString("VersionString", report["version-string"]);
797 msg->addStringFast(_PREHASH_Details, report["details"] );
798
799 msg->sendReliable(regionp->getHost());
753} 800}
754 801
802class LLUserReportScreenshotResponder : public LLAssetUploadResponder
803{
804public:
805 LLUserReportScreenshotResponder(const LLSD & post_data,
806 const LLUUID & vfile_id,
807 LLAssetType::EType asset_type):
808 LLAssetUploadResponder(post_data, vfile_id, asset_type)
809 {
810 }
811 void uploadFailed(const LLSD& content)
812 {
813 // *TODO pop up a dialog so the user knows their report screenshot didn't make it
814 LLUploadDialog::modalUploadFinished();
815 }
816 void uploadComplete(const LLSD& content)
817 {
818 // we don't care about what the server returns from this post, just clean up the UI
819 LLUploadDialog::modalUploadFinished();
820 }
821};
822
823class LLUserReportResponder : public LLHTTPClient::Responder
824{
825public:
826 LLUserReportResponder(): LLHTTPClient::Responder() {}
827
828 void error(U32 status, const std::string& reason)
829 {
830 // *TODO do some user messaging here
831 LLUploadDialog::modalUploadFinished();
832 }
833 void result(const LLSD& content)
834 {
835 // we don't care about what the server returns
836 LLUploadDialog::modalUploadFinished();
837 }
838};
839
840void LLFloaterReporter::sendReportViaCaps(std::string url, std::string sshot_url, const LLSD& report)
841{
842 if(childGetValue("screen_check").asBoolean() && !sshot_url.empty())
843 {
844 // try to upload screenshot
845 LLHTTPClient::post(sshot_url, report, new LLUserReportScreenshotResponder(report,
846 mResourceDatap->mAssetInfo.mUuid,
847 mResourceDatap->mAssetInfo.mType));
848 }
849 else
850 {
851 // screenshot not wanted or we don't have screenshot cap
852 LLHTTPClient::post(url, report, new LLUserReportResponder());
853 }
854}
755 855
756void LLFloaterReporter::uploadScreenshot() 856void LLFloaterReporter::takeScreenshot()
757{ 857{
758 const S32 IMAGE_WIDTH = 1024; 858 const S32 IMAGE_WIDTH = 1024;
759 const S32 IMAGE_HEIGHT = 768; 859 const S32 IMAGE_HEIGHT = 768;
760 LLString filename("report_screenshot.bmp");
761 860
762 if( !gViewerWindow->saveSnapshot( filename, IMAGE_WIDTH, IMAGE_HEIGHT, TRUE, FALSE ) ) 861 LLPointer<LLImageRaw> raw = new LLImageRaw;
862 if( !gViewerWindow->rawSnapshot(raw, IMAGE_WIDTH, IMAGE_HEIGHT, TRUE, TRUE, FALSE))
763 { 863 {
864 llwarns << "Unable to take screenshot" << llendl;
764 return; 865 return;
765 } 866 }
867 LLPointer<LLImageJ2C> upload_data = LLViewerImageList::convertToUploadFile(raw);
766 868
767 // Generate the temporary filename 869 // create a resource data
768 std::string temp_filename = gDirUtilp->getTempFilename(); 870 mResourceDatap->mInventoryType = LLInventoryType::IT_NONE;
769 871 mResourceDatap->mAssetInfo.mTransactionID.generate();
770 // try to create the upload file 872 mResourceDatap->mAssetInfo.mUuid = mResourceDatap->mAssetInfo.mTransactionID.makeAssetID(gAgent.getSecureSessionID());
771 if (!LLViewerImageList::createUploadFile(filename, 873 if (BUG_REPORT == mReportType)
772 temp_filename,
773 IMG_CODEC_BMP ))
774 { 874 {
775 llwarns << "Unable to upload report screenshot " << filename << ":\n\n" << LLImageBase::getLastError() << "\n" << llendl; 875 mResourceDatap->mAssetInfo.mType = LLAssetType::AT_TEXTURE;
776 if(LLFile::remove(temp_filename.c_str()) == -1) 876 mResourceDatap->mPreferredLocation = LLAssetType::EType(-1);
777 { 877 }
778 lldebugs << "unable to remove temp file" << llendl; 878 else if (COMPLAINT_REPORT == mReportType)
779 } 879 {
780 LLFilePicker::instance().reset(); 880 mResourceDatap->mAssetInfo.mType = LLAssetType::AT_TEXTURE;
881 mResourceDatap->mPreferredLocation = LLAssetType::EType(-2);
781 } 882 }
782 else 883 else
783 { 884 {
784 // create a resource data 885 llwarns << "Unknown LLFloaterReporter type" << llendl;
785 LLResourceData* data = NULL; 886 }
786 data = new LLResourceData; 887 mResourceDatap->mAssetInfo.mCreatorID = gAgentID;
787 data->mInventoryType = LLInventoryType::IT_NONE; 888 mResourceDatap->mAssetInfo.setName("screenshot_name");
788 data->mAssetInfo.mTransactionID.generate(); 889 mResourceDatap->mAssetInfo.setDescription("screenshot_descr");
789 data->mAssetInfo.mUuid = data->mAssetInfo.mTransactionID.makeAssetID(gAgent.getSecureSessionID()); 890
790 if (BUG_REPORT == mReportType) 891 // store in VFS
791 { 892 LLVFile::writeFile(upload_data->getData(),
792 //data->mAssetInfo.mType = LLAssetType::AT_BUG_REPORT_SCREENSHOT; 893 upload_data->getDataSize(),
793 data->mAssetInfo.mType = LLAssetType::AT_TEXTURE; 894 gVFS,
794 data->mPreferredLocation = LLAssetType::EType(-1); 895 mResourceDatap->mAssetInfo.mUuid,
795 } 896 mResourceDatap->mAssetInfo.mType);
796 else if (COMPLAINT_REPORT == mReportType) 897
797 { 898 // store in the image list so it doesn't try to fetch from the server
798 //data->mAssetInfo.mType = LLAssetType::AT_COMPLAINT_REPORT_SCREENSHOT; 899 LLViewerImage* image_in_list = new LLViewerImage(mResourceDatap->mAssetInfo.mUuid, TRUE);
799 data->mAssetInfo.mType = LLAssetType::AT_TEXTURE; 900 image_in_list->createGLTexture(0, raw);
800 data->mPreferredLocation = LLAssetType::EType(-2); 901 gImageList.addImage(image_in_list);
801 } 902
802 else 903 // the texture picker then uses that texture
803 { 904 LLTexturePicker* texture = LLUICtrlFactory::getTexturePickerByName(this, "screenshot");
804 llwarns << "Unknown LLFloaterReporter type" << llendl; 905 if (texture)
805 } 906 {
806 data->mAssetInfo.mCreatorID = gAgentID; 907 texture->setImageAssetID(mResourceDatap->mAssetInfo.mUuid);
807 data->mAssetInfo.setName("screenshot_name"); 908 texture->setDefaultImageAssetID(mResourceDatap->mAssetInfo.mUuid);
808 data->mAssetInfo.setDescription("screenshot_descr"); 909 texture->setCaption("Screenshot");
809
810 llinfos << "*** Uploading: " << llendl;
811 llinfos << "Type: " << LLAssetType::lookup(data->mAssetInfo.mType) << llendl;
812 llinfos << "File: " << filename << llendl;
813 llinfos << "Dest: " << temp_filename << llendl;
814 llinfos << "Name: " << data->mAssetInfo.getName() << llendl;
815 llinfos << "Desc: " << data->mAssetInfo.getDescription() << llendl;
816
817 gAssetStorage->storeAssetData(temp_filename.c_str(),
818 data->mAssetInfo.mTransactionID,
819 data->mAssetInfo.mType,
820 LLFloaterReporter::uploadDoneCallback,
821 (void*)data, TRUE);
822 } 910 }
911
912}
913
914void LLFloaterReporter::uploadImage()
915{
916 llinfos << "*** Uploading: " << llendl;
917 llinfos << "Type: " << LLAssetType::lookup(mResourceDatap->mAssetInfo.mType) << llendl;
918 llinfos << "UUID: " << mResourceDatap->mAssetInfo.mUuid << llendl;
919 llinfos << "Name: " << mResourceDatap->mAssetInfo.getName() << llendl;
920 llinfos << "Desc: " << mResourceDatap->mAssetInfo.getDescription() << llendl;
921
922 gAssetStorage->storeAssetData(mResourceDatap->mAssetInfo.mTransactionID,
923 mResourceDatap->mAssetInfo.mType,
924 LLFloaterReporter::uploadDoneCallback,
925 (void*)mResourceDatap, TRUE);
823} 926}
824 927
825 928
826// static 929// static
827void LLFloaterReporter::uploadDoneCallback(const LLUUID &uuid, void *user_data, S32 result) // StoreAssetData callback (fixed) 930void LLFloaterReporter::uploadDoneCallback(const LLUUID &uuid, void *user_data, S32 result) // StoreAssetData callback (fixed)
828{ 931{
829 LLResourceData* data = (LLResourceData*)user_data; 932 LLUploadDialog::modalUploadFinished();
830 933
831 if(result >= 0) 934 LLResourceData* data = (LLResourceData*)user_data;
832 {
833 EReportType report_type = UNKNOWN_REPORT;
834 if (data->mPreferredLocation == -1)
835 {
836 report_type = BUG_REPORT;
837 }
838 else if (data->mPreferredLocation == -2)
839 {
840 report_type = COMPLAINT_REPORT;
841 }
842 else
843 {
844 llwarns << "Unknown report type : " << data->mPreferredLocation << llendl;
845 }
846 935
847 LLFloaterReporter *self = getReporter(report_type); 936 if(result < 0)
848 if (self)
849 {
850 LLTexturePicker* texture = LLUICtrlFactory::getTexturePickerByName(self, "screenshot");
851 if (texture)
852 {
853 texture->setImageAssetID(uuid);
854 texture->setDefaultImageAssetID(uuid);
855 texture->setCaption("Screenshot");
856 }
857 self->mScreenID = uuid;
858 llinfos << "Got screen shot " << uuid << llendl;
859 }
860 }
861 else // if(result >= 0)
862 { 937 {
863 LLStringBase<char>::format_map_t args; 938 LLStringBase<char>::format_map_t args;
864 args["[REASON]"] = std::string(LLAssetStorage::getErrorString(result)); 939 args["[REASON]"] = std::string(LLAssetStorage::getErrorString(result));
@@ -867,8 +942,31 @@ void LLFloaterReporter::uploadDoneCallback(const LLUUID &uuid, void *user_data,
867 std::string err_msg("There was a problem uploading a report screenshot"); 942 std::string err_msg("There was a problem uploading a report screenshot");
868 err_msg += " due to the following reason: " + args["[REASON]"]; 943 err_msg += " due to the following reason: " + args["[REASON]"];
869 llwarns << err_msg << llendl; 944 llwarns << err_msg << llendl;
945 return;
946 }
947
948 EReportType report_type = UNKNOWN_REPORT;
949 if (data->mPreferredLocation == -1)
950 {
951 report_type = BUG_REPORT;
870 } 952 }
871 delete data; 953 else if (data->mPreferredLocation == -2)
954 {
955 report_type = COMPLAINT_REPORT;
956 }
957 else
958 {
959 llwarns << "Unknown report type : " << data->mPreferredLocation << llendl;
960 }
961
962 LLFloaterReporter *self = getReporter(report_type);
963 if (self)
964 {
965 self->mScreenID = uuid;
966 llinfos << "Got screen shot " << uuid << llendl;
967 self->sendReportViaLegacy(self->gatherReport());
968 }
969 self->close();
872} 970}
873 971
874 972
diff --git a/linden/indra/newview/llfloaterreporter.h b/linden/indra/newview/llfloaterreporter.h
index af01771..5e25d59 100644
--- a/linden/indra/newview/llfloaterreporter.h
+++ b/linden/indra/newview/llfloaterreporter.h
@@ -40,6 +40,7 @@ class LLViewerObject;
40class LLAgent; 40class LLAgent;
41class LLToolObjPicker; 41class LLToolObjPicker;
42class LLMeanCollisionData; 42class LLMeanCollisionData;
43struct LLResourceData;
43 44
44// these flags are used to label info requests to the server 45// these flags are used to label info requests to the server
45const U32 BUG_REPORT_REQUEST = 0x01 << 0; 46const U32 BUG_REPORT_REQUEST = 0x01 << 0;
@@ -70,7 +71,6 @@ enum EReportType
70 CS_REQUEST_REPORT = 4 71 CS_REQUEST_REPORT = 4
71}; 72};
72 73
73
74class LLFloaterReporter 74class LLFloaterReporter
75: public LLFloater 75: public LLFloater
76{ 76{
@@ -106,11 +106,16 @@ public:
106 static void processRegionInfo(LLMessageSystem* msg); 106 static void processRegionInfo(LLMessageSystem* msg);
107 107
108 void setPickedObjectProperties(const char *object_name, const char *owner_name); 108 void setPickedObjectProperties(const char *object_name, const char *owner_name);
109 void uploadScreenshot();
110 109
111private: 110private:
111 void takeScreenshot();
112 void sendReportViaCaps(std::string url);
113 void uploadImage();
114 bool validateReport();
112 void setReporterID(); 115 void setReporterID();
113 void sendReport(); 116 LLSD gatherReport();
117 void sendReportViaLegacy(const LLSD & report);
118 void sendReportViaCaps(std::string url, std::string sshot_url, const LLSD & report);
114 void setPosBox(const LLVector3d &pos); 119 void setPosBox(const LLVector3d &pos);
115 void enableControls(BOOL own_avatar); 120 void enableControls(BOOL own_avatar);
116 void getObjectInfo(const LLUUID& object_id); 121 void getObjectInfo(const LLUUID& object_id);
@@ -127,6 +132,7 @@ private:
127 BOOL mCopyrightWarningSeen; 132 BOOL mCopyrightWarningSeen;
128 std::list<LLMeanCollisionData*> mMCDList; 133 std::list<LLMeanCollisionData*> mMCDList;
129 LLString mDefaultSummary; 134 LLString mDefaultSummary;
135 LLResourceData* mResourceDatap;
130}; 136};
131 137
132#endif 138#endif
diff --git a/linden/indra/newview/llfloatersaveavatar.cpp b/linden/indra/newview/llfloatersaveavatar.cpp
index 2f55288..3b8439e 100644
--- a/linden/indra/newview/llfloatersaveavatar.cpp
+++ b/linden/indra/newview/llfloatersaveavatar.cpp
@@ -68,7 +68,7 @@ void LLFloaterSaveAvatar::show()
68 } 68 }
69 else 69 else
70 { 70 {
71 mSingleton->open(); 71 mSingleton->open(); /*Flawfinder: ignore*/
72 } 72 }
73} 73}
74 74
diff --git a/linden/indra/newview/llfloaterscriptdebug.cpp b/linden/indra/newview/llfloaterscriptdebug.cpp
index 0781f7c..94047cb 100644
--- a/linden/indra/newview/llfloaterscriptdebug.cpp
+++ b/linden/indra/newview/llfloaterscriptdebug.cpp
@@ -66,7 +66,7 @@ void LLFloaterScriptDebug::show(const LLUUID& object_id)
66 LLFloater* floaterp = addOutputWindow(object_id); 66 LLFloater* floaterp = addOutputWindow(object_id);
67 if (sInstance) 67 if (sInstance)
68 { 68 {
69 sInstance->open(); 69 sInstance->open(); /* Flawfinder: ignore */
70 sInstance->showFloater(floaterp); 70 sInstance->showFloater(floaterp);
71 } 71 }
72} 72}
@@ -225,7 +225,7 @@ LLFloaterScriptDebugOutput* LLFloaterScriptDebugOutput::show(const LLUUID& objec
225 { 225 {
226 floaterp = new LLFloaterScriptDebugOutput(object_id); 226 floaterp = new LLFloaterScriptDebugOutput(object_id);
227 sInstanceMap[object_id] = floaterp; 227 sInstanceMap[object_id] = floaterp;
228 floaterp->open(); 228 floaterp->open(); /* Flawfinder: ignore*/
229 } 229 }
230 else 230 else
231 { 231 {
diff --git a/linden/indra/newview/llfloatersellland.cpp b/linden/indra/newview/llfloatersellland.cpp
index 5fac819..cc7df3b 100755
--- a/linden/indra/newview/llfloatersellland.cpp
+++ b/linden/indra/newview/llfloatersellland.cpp
@@ -55,15 +55,15 @@ private:
55 virtual ~LLFloaterSellLandUI(); 55 virtual ~LLFloaterSellLandUI();
56 56
57 LLViewerRegion* mRegion; 57 LLViewerRegion* mRegion;
58 LLParcel* mParcel; 58 LLParcelSelectionHandle mParcelSelection;
59 bool mParcelIsForSale; 59 bool mParcelIsForSale;
60 bool mSellToBuyer; 60 bool mSellToBuyer;
61 bool mChoseSellTo; 61 bool mChoseSellTo;
62 S32 mParcelPrice; 62 S32 mParcelPrice;
63 S32 mParcelActualArea; 63 S32 mParcelActualArea;
64 LLUUID mParcelSnapshot; 64 LLUUID mParcelSnapshot;
65 LLUUID mAuthorizedBuyer; 65 LLUUID mAuthorizedBuyer;
66 bool mParcelSoldWithObjects; 66 bool mParcelSoldWithObjects;
67 67
68 void updateParcelInfo(); 68 void updateParcelInfo();
69 void refreshUI(); 69 void refreshUI();
@@ -87,17 +87,24 @@ public:
87 87
88 static LLFloaterSellLandUI* soleInstance(bool createIfNeeded); 88 static LLFloaterSellLandUI* soleInstance(bool createIfNeeded);
89 89
90 bool setParcel(LLViewerRegion* region, LLParcel* parcel); 90 bool setParcel(LLViewerRegion* region, LLParcelSelectionHandle parcel);
91
92private:
93 class SelectionObserver : public LLParcelObserver
94 {
95 public:
96 virtual void changed();
97 };
91}; 98};
92 99
93// static 100// static
94void LLFloaterSellLand::sellLand( 101void LLFloaterSellLand::sellLand(
95 LLViewerRegion* region, LLParcel* parcel) 102 LLViewerRegion* region, LLParcelSelectionHandle parcel)
96{ 103{
97 LLFloaterSellLandUI* ui = LLFloaterSellLandUI::soleInstance(true); 104 LLFloaterSellLandUI* ui = LLFloaterSellLandUI::soleInstance(true);
98 if (ui->setParcel(region, parcel)) 105 if (ui->setParcel(region, parcel))
99 { 106 {
100 ui->open(); 107 ui->open(); /* Flawfinder: ignore */
101 } 108 }
102} 109}
103 110
@@ -115,12 +122,20 @@ LLFloaterSellLandUI* LLFloaterSellLandUI::soleInstance(bool createIfNeeded)
115 sInstance->center(); 122 sInstance->center();
116 } 123 }
117 124
125
126 static SelectionObserver* parcelSelectionObserver = NULL;
127 if (!parcelSelectionObserver)
128 {
129 parcelSelectionObserver = new SelectionObserver;
130 gParcelMgr->addObserver(parcelSelectionObserver);
131 }
132
118 return sInstance; 133 return sInstance;
119} 134}
120 135
121LLFloaterSellLandUI::LLFloaterSellLandUI() 136LLFloaterSellLandUI::LLFloaterSellLandUI()
122: LLFloater("Sell Land"), 137: LLFloater("Sell Land"),
123 mRegion(0), mParcel(0) 138 mRegion(0)
124{ 139{
125} 140}
126 141
@@ -132,11 +147,27 @@ LLFloaterSellLandUI::~LLFloaterSellLandUI()
132 } 147 }
133} 148}
134 149
150void LLFloaterSellLandUI::SelectionObserver::changed()
151{
152 LLFloaterSellLandUI* ui = LLFloaterSellLandUI::soleInstance(false);
153 if (ui)
154 {
155 if (gParcelMgr->selectionEmpty())
156 {
157 ui->close();
158 }
159 else {
160 ui->setParcel(
161 gParcelMgr->getSelectionRegion(),
162 gParcelMgr->getParcelSelection());
163 }
164 }
165}
135 166
136void LLFloaterSellLandUI::onClose(bool app_quitting) 167void LLFloaterSellLandUI::onClose(bool app_quitting)
137{ 168{
138 LLFloater::onClose(app_quitting); 169 LLFloater::onClose(app_quitting);
139 delete this; 170 destroy();
140} 171}
141 172
142BOOL LLFloaterSellLandUI::postBuild() 173BOOL LLFloaterSellLandUI::postBuild()
@@ -152,17 +183,18 @@ BOOL LLFloaterSellLandUI::postBuild()
152 return TRUE; 183 return TRUE;
153} 184}
154 185
155bool LLFloaterSellLandUI::setParcel(LLViewerRegion* region, LLParcel* parcel) 186bool LLFloaterSellLandUI::setParcel(LLViewerRegion* region, LLParcelSelectionHandle parcel)
156{ 187{
157 if (!parcel) // || !can_agent_modify_parcel(parcel)) // can_agent_modify_parcel was deprecated by GROUPS 188 if (!parcel->getParcel()) // || !can_agent_modify_parcel(parcel)) // can_agent_modify_parcel was deprecated by GROUPS
158 { 189 {
159 return false; 190 return false;
160 } 191 }
161 192
162 mRegion = region; 193 mRegion = region;
163 mParcel = parcel; 194 mParcelSelection = parcel;
164 mChoseSellTo = false; 195 mChoseSellTo = false;
165 196
197
166 updateParcelInfo(); 198 updateParcelInfo();
167 refreshUI(); 199 refreshUI();
168 200
@@ -171,14 +203,17 @@ bool LLFloaterSellLandUI::setParcel(LLViewerRegion* region, LLParcel* parcel)
171 203
172void LLFloaterSellLandUI::updateParcelInfo() 204void LLFloaterSellLandUI::updateParcelInfo()
173{ 205{
174 mParcelActualArea = mParcel->getArea(); 206 LLParcel* parcelp = mParcelSelection->getParcel();
175 mParcelIsForSale = mParcel->getForSale(); 207 if (!parcelp) return;
208
209 mParcelActualArea = parcelp->getArea();
210 mParcelIsForSale = parcelp->getForSale();
176 if (mParcelIsForSale) 211 if (mParcelIsForSale)
177 { 212 {
178 mChoseSellTo = true; 213 mChoseSellTo = true;
179 } 214 }
180 mParcelPrice = mParcelIsForSale ? mParcel->getSalePrice() : 0; 215 mParcelPrice = mParcelIsForSale ? parcelp->getSalePrice() : 0;
181 mParcelSoldWithObjects = mParcel->getSellWithObjects(); 216 mParcelSoldWithObjects = parcelp->getSellWithObjects();
182 if (mParcelIsForSale) 217 if (mParcelIsForSale)
183 { 218 {
184 childSetValue("price", mParcelPrice); 219 childSetValue("price", mParcelPrice);
@@ -197,16 +232,16 @@ void LLFloaterSellLandUI::updateParcelInfo()
197 childSetValue("sell_objects", "none"); 232 childSetValue("sell_objects", "none");
198 } 233 }
199 234
200 mParcelSnapshot = mParcel->getSnapshotID(); 235 mParcelSnapshot = parcelp->getSnapshotID();
201 236
202 mAuthorizedBuyer = mParcel->getAuthorizedBuyerID(); 237 mAuthorizedBuyer = parcelp->getAuthorizedBuyerID();
203 mSellToBuyer = mAuthorizedBuyer.notNull(); 238 mSellToBuyer = mAuthorizedBuyer.notNull();
204 239
205 if(mSellToBuyer) 240 if(mSellToBuyer)
206 { 241 {
207 LLString name; 242 LLString name;
208 char firstname[MAX_STRING]; 243 char firstname[MAX_STRING]; /* Flawfinder: ignore */
209 char lastname[MAX_STRING]; 244 char lastname[MAX_STRING]; /* Flawfinder: ignore */
210 gCacheName->getName(mAuthorizedBuyer, firstname, lastname); 245 gCacheName->getName(mAuthorizedBuyer, firstname, lastname);
211 name.assign(firstname); 246 name.assign(firstname);
212 name.append(" "); 247 name.append(" ");
@@ -238,13 +273,16 @@ void LLFloaterSellLandUI::setBadge(const char* id, Badge badge)
238 273
239void LLFloaterSellLandUI::refreshUI() 274void LLFloaterSellLandUI::refreshUI()
240{ 275{
276 LLParcel* parcelp = mParcelSelection->getParcel();
277 if (!parcelp) return;
278
241 LLTextureCtrl* snapshot = LLViewerUICtrlFactory::getTexturePickerByName(this, "info_image"); 279 LLTextureCtrl* snapshot = LLViewerUICtrlFactory::getTexturePickerByName(this, "info_image");
242 if (snapshot) 280 if (snapshot)
243 { 281 {
244 snapshot->setImageAssetID(mParcelSnapshot); 282 snapshot->setImageAssetID(mParcelSnapshot);
245 } 283 }
246 284
247 childSetText("info_parcel", mParcel->getName()); 285 childSetText("info_parcel", parcelp->getName());
248 childSetTextArg("info_size", "[AREA]", llformat("%d", mParcelActualArea)); 286 childSetTextArg("info_size", "[AREA]", llformat("%d", mParcelActualArea));
249 287
250 LLString price_str = childGetValue("price").asString(); 288 LLString price_str = childGetValue("price").asString();
@@ -377,7 +415,7 @@ void LLFloaterSellLandUI::doSelectAgent(void *userdata)
377void LLFloaterSellLandUI::callbackAvatarPick(const std::vector<std::string>& names, const std::vector<LLUUID>& ids, void* data) 415void LLFloaterSellLandUI::callbackAvatarPick(const std::vector<std::string>& names, const std::vector<LLUUID>& ids, void* data)
378{ 416{
379 LLFloaterSellLandUI* floaterp = (LLFloaterSellLandUI*)data; 417 LLFloaterSellLandUI* floaterp = (LLFloaterSellLandUI*)data;
380 LLParcel* parcel = floaterp->mParcel; 418 LLParcel* parcel = floaterp->mParcelSelection->getParcel();
381 419
382 if (names.empty() || ids.empty()) return; 420 if (names.empty() || ids.empty()) return;
383 421
@@ -402,7 +440,10 @@ void LLFloaterSellLandUI::doCancel(void *userdata)
402void LLFloaterSellLandUI::doShowObjects(void *userdata) 440void LLFloaterSellLandUI::doShowObjects(void *userdata)
403{ 441{
404 LLFloaterSellLandUI* self = (LLFloaterSellLandUI*)userdata; 442 LLFloaterSellLandUI* self = (LLFloaterSellLandUI*)userdata;
405 send_parcel_select_objects(self->mParcel->getLocalID(), RT_SELL); 443 LLParcel* parcel = self->mParcelSelection->getParcel();
444 if (!parcel) return;
445
446 send_parcel_select_objects(parcel->getLocalID(), RT_SELL);
406 447
407 LLNotifyBox::showXml("TransferObjectsHighlighted", 448 LLNotifyBox::showXml("TransferObjectsHighlighted",
408 callbackHighlightTransferable, 449 callbackHighlightTransferable,
@@ -420,7 +461,7 @@ void LLFloaterSellLandUI::doSellLand(void *userdata)
420{ 461{
421 LLFloaterSellLandUI* self = (LLFloaterSellLandUI*)userdata; 462 LLFloaterSellLandUI* self = (LLFloaterSellLandUI*)userdata;
422 463
423 LLParcel* parcel = self->mParcel; 464 LLParcel* parcel = self->mParcelSelection->getParcel();
424 465
425 // Do a confirmation 466 // Do a confirmation
426 if (!parcel->getForSale()) 467 if (!parcel->getForSale())
@@ -472,7 +513,8 @@ void LLFloaterSellLandUI::onConfirmSale(S32 option, void *userdata)
472 return; 513 return;
473 } 514 }
474 515
475 LLParcel* parcel = self->mParcel; 516 LLParcel* parcel = self->mParcelSelection->getParcel();
517 if (!parcel) return;
476 518
477 // can_agent_modify_parcel deprecated by GROUPS 519 // can_agent_modify_parcel deprecated by GROUPS
478// if (!can_agent_modify_parcel(parcel)) 520// if (!can_agent_modify_parcel(parcel))
@@ -499,7 +541,7 @@ void LLFloaterSellLandUI::onConfirmSale(S32 option, void *userdata)
499 } 541 }
500 542
501 // Send update to server 543 // Send update to server
502 gParcelMgr->sendParcelPropertiesUpdate( parcel, LLFloaterLand::sRequestReplyOnUpdate ); 544 gParcelMgr->sendParcelPropertiesUpdate( parcel );
503 545
504 self->close(); 546 self->close();
505} 547}
diff --git a/linden/indra/newview/llfloatersellland.h b/linden/indra/newview/llfloatersellland.h
index 183ffc4..4131011 100755
--- a/linden/indra/newview/llfloatersellland.h
+++ b/linden/indra/newview/llfloatersellland.h
@@ -26,15 +26,17 @@
26 26
27#ifndef LL_LLFLOATERSELLLAND_H 27#ifndef LL_LLFLOATERSELLLAND_H
28#define LL_LLFLOATERSELLLAND_H 28#define LL_LLFLOATERSELLLAND_H
29#include "llmemory.h"
29 30
30class LLParcel; 31class LLParcel;
31class LLViewerRegion; 32class LLViewerRegion;
33class LLParcelSelection;
32 34
33class LLFloaterSellLand 35class LLFloaterSellLand
34{ 36{
35public: 37public:
36 static void sellLand(LLViewerRegion* region, 38 static void sellLand(LLViewerRegion* region,
37 LLParcel* parcel); 39 LLHandle<LLParcelSelection> parcel);
38}; 40};
39 41
40#endif // LL_LLFLOATERSELLLAND_H 42#endif // LL_LLFLOATERSELLLAND_H
diff --git a/linden/indra/newview/llfloatersnapshot.cpp b/linden/indra/newview/llfloatersnapshot.cpp
index 01f86af..cfa94a5 100644
--- a/linden/indra/newview/llfloatersnapshot.cpp
+++ b/linden/indra/newview/llfloatersnapshot.cpp
@@ -824,21 +824,22 @@ void LLFloaterSnapshot::Impl::updateLayout(LLFloaterSnapshot* floaterp)
824 824
825 //RN: freeze all avatars 825 //RN: freeze all avatars
826 LLCharacter* avatarp; 826 LLCharacter* avatarp;
827 for (avatarp = LLCharacter::sInstances.getFirstData(); avatarp; avatarp = LLCharacter::sInstances.getNextData()) 827 for (std::vector<LLCharacter*>::iterator iter = LLCharacter::sInstances.begin();
828 iter != LLCharacter::sInstances.end(); ++iter)
828 { 829 {
830 avatarp = *iter;
829 sInstance->impl.mAvatarPauseHandles.push_back(avatarp->requestPause()); 831 sInstance->impl.mAvatarPauseHandles.push_back(avatarp->requestPause());
830 } 832 }
831 833
832 // freeze everything else 834 // freeze everything else
833 gSavedSettings.setBOOL("FreezeTime", TRUE); 835 gSavedSettings.setBOOL("FreezeTime", TRUE);
834 836
835 if (gCurrentToolset != gCameraToolset) 837 if (gToolMgr->getCurrentToolset() != gCameraToolset)
836 { 838 {
837 sInstance->impl.mLastToolset = gCurrentToolset; 839 sInstance->impl.mLastToolset = gToolMgr->getCurrentToolset();
838 gCurrentToolset = gCameraToolset;
839 if (gToolMgr) 840 if (gToolMgr)
840 { 841 {
841 gToolMgr->useSelectedTool( gCurrentToolset ); 842 gToolMgr->setCurrentToolset(gCameraToolset);
842 } 843 }
843 } 844 }
844 } 845 }
@@ -861,10 +862,9 @@ void LLFloaterSnapshot::Impl::updateLayout(LLFloaterSnapshot* floaterp)
861 // restore last tool (e.g. pie menu, etc) 862 // restore last tool (e.g. pie menu, etc)
862 if (sInstance->impl.mLastToolset) 863 if (sInstance->impl.mLastToolset)
863 { 864 {
864 gCurrentToolset = sInstance->impl.mLastToolset;
865 if (gToolMgr) 865 if (gToolMgr)
866 { 866 {
867 gToolMgr->useSelectedTool( gCurrentToolset ); 867 gToolMgr->setCurrentToolset(sInstance->impl.mLastToolset);
868 } 868 }
869 } 869 }
870 } 870 }
@@ -1239,10 +1239,9 @@ LLFloaterSnapshot::~LLFloaterSnapshot()
1239 1239
1240 if (impl.mLastToolset) 1240 if (impl.mLastToolset)
1241 { 1241 {
1242 gCurrentToolset = impl.mLastToolset; 1242 if (gToolMgr)
1243 if (gToolMgr && gCurrentToolset)
1244 { 1243 {
1245 gToolMgr->useSelectedTool( gCurrentToolset ); 1244 gToolMgr->setCurrentToolset(impl.mLastToolset);
1246 } 1245 }
1247 } 1246 }
1248 1247
@@ -1432,7 +1431,7 @@ void LLFloaterSnapshot::show(void*)
1432 sInstance->impl.updateLayout(sInstance); 1431 sInstance->impl.updateLayout(sInstance);
1433 } 1432 }
1434 1433
1435 sInstance->open(); 1434 sInstance->open(); /* Flawfinder: ignore */
1436 sInstance->focusFirstItem(FALSE); 1435 sInstance->focusFirstItem(FALSE);
1437 gSnapshotFloaterView->setEnabled(TRUE); 1436 gSnapshotFloaterView->setEnabled(TRUE);
1438 gSnapshotFloaterView->adjustToFitScreen(sInstance, FALSE); 1437 gSnapshotFloaterView->adjustToFitScreen(sInstance, FALSE);
@@ -1506,7 +1505,7 @@ BOOL LLSnapshotFloaterView::handleMouseDown(S32 x, S32 y, MASK mask)
1506 // give floater a change to handle mouse, else camera tool 1505 // give floater a change to handle mouse, else camera tool
1507 if (childrenHandleMouseDown(x, y, mask) == NULL) 1506 if (childrenHandleMouseDown(x, y, mask) == NULL)
1508 { 1507 {
1509 gToolMgr->getCurrentTool(mask)->handleMouseDown( x, y, mask ); 1508 gToolMgr->getCurrentTool()->handleMouseDown( x, y, mask );
1510 } 1509 }
1511 return TRUE; 1510 return TRUE;
1512} 1511}
@@ -1521,7 +1520,7 @@ BOOL LLSnapshotFloaterView::handleMouseUp(S32 x, S32 y, MASK mask)
1521 // give floater a change to handle mouse, else camera tool 1520 // give floater a change to handle mouse, else camera tool
1522 if (childrenHandleMouseUp(x, y, mask) == NULL) 1521 if (childrenHandleMouseUp(x, y, mask) == NULL)
1523 { 1522 {
1524 gToolMgr->getCurrentTool(mask)->handleMouseUp( x, y, mask ); 1523 gToolMgr->getCurrentTool()->handleMouseUp( x, y, mask );
1525 } 1524 }
1526 return TRUE; 1525 return TRUE;
1527} 1526}
@@ -1536,7 +1535,7 @@ BOOL LLSnapshotFloaterView::handleHover(S32 x, S32 y, MASK mask)
1536 // give floater a change to handle mouse, else camera tool 1535 // give floater a change to handle mouse, else camera tool
1537 if (childrenHandleHover(x, y, mask) == NULL) 1536 if (childrenHandleHover(x, y, mask) == NULL)
1538 { 1537 {
1539 gToolMgr->getCurrentTool(mask)->handleHover( x, y, mask ); 1538 gToolMgr->getCurrentTool()->handleHover( x, y, mask );
1540 } 1539 }
1541 return TRUE; 1540 return TRUE;
1542} 1541}
diff --git a/linden/indra/newview/llfloatertelehub.cpp b/linden/indra/newview/llfloatertelehub.cpp
index 9fa614c..150e369 100644
--- a/linden/indra/newview/llfloatertelehub.cpp
+++ b/linden/indra/newview/llfloatertelehub.cpp
@@ -58,8 +58,8 @@ void LLFloaterTelehub::show()
58 sInstance = new LLFloaterTelehub(); 58 sInstance = new LLFloaterTelehub();
59 59
60 // Show tools floater by selecting translate (select) tool 60 // Show tools floater by selecting translate (select) tool
61 gCurrentToolset = gBasicToolset; 61 gToolMgr->setCurrentToolset(gBasicToolset);
62 gCurrentToolset->selectTool( gToolTranslate ); 62 gToolMgr->getCurrentToolset()->selectTool( gToolTranslate );
63 63
64 // Find tools floater, glue to bottom 64 // Find tools floater, glue to bottom
65 if (gFloaterTools) 65 if (gFloaterTools)
@@ -101,6 +101,8 @@ LLFloaterTelehub::LLFloaterTelehub()
101 // otherwise you can't walk with arrow keys while floater is up 101 // otherwise you can't walk with arrow keys while floater is up
102 list->setAllowKeyboardMovement(FALSE); 102 list->setAllowKeyboardMovement(FALSE);
103 } 103 }
104
105 mObjectSelection = gSelectMgr->getEditSelection();
104} 106}
105 107
106LLFloaterTelehub::~LLFloaterTelehub() 108LLFloaterTelehub::~LLFloaterTelehub()
@@ -123,10 +125,10 @@ void LLFloaterTelehub::draw()
123// Per-frame updates, because we don't have a selection manager observer. 125// Per-frame updates, because we don't have a selection manager observer.
124void LLFloaterTelehub::refresh() 126void LLFloaterTelehub::refresh()
125{ 127{
126 LLViewerObject* object = gSelectMgr->getFirstRootObject(); 128 LLViewerObject* object = mObjectSelection->getFirstRootObject();
127 if(!object) 129 if(!object)
128 { 130 {
129 object = gSelectMgr->getFirstObject(); 131 object = mObjectSelection->getFirstObject();
130 } 132 }
131 133
132 BOOL have_selection = (object != NULL); 134 BOOL have_selection = (object != NULL);
@@ -241,8 +243,8 @@ void LLFloaterTelehub::onClickRemoveSpawnPoint(void* data)
241 msg->nextBlock("ParamList"); 243 msg->nextBlock("ParamList");
242 msg->addString("Parameter", "spawnpoint remove"); 244 msg->addString("Parameter", "spawnpoint remove");
243 245
244 char buffer[MAX_STRING]; 246 char buffer[MAX_STRING]; /* Flawfinder: ignore */
245 sprintf(buffer, "%d", spawn_index); 247 snprintf(buffer, MAX_STRING, "%d", spawn_index); /* Flawfinder: ignore */
246 msg->nextBlock("ParamList"); 248 msg->nextBlock("ParamList");
247 msg->addString("Parameter", buffer); 249 msg->addString("Parameter", buffer);
248 250
@@ -260,7 +262,7 @@ void LLFloaterTelehub::processTelehubInfo(LLMessageSystem* msg, void**)
260 262
261void LLFloaterTelehub::unpackTelehubInfo(LLMessageSystem* msg) 263void LLFloaterTelehub::unpackTelehubInfo(LLMessageSystem* msg)
262{ 264{
263 char buffer[MAX_STRING]; 265 char buffer[MAX_STRING]; /* Flawfinder: ignore */
264 266
265 msg->getUUID("TelehubBlock", "ObjectID", mTelehubObjectID); 267 msg->getUUID("TelehubBlock", "ObjectID", mTelehubObjectID);
266 msg->getString("TelehubBlock", "ObjectName", MAX_STRING, buffer); 268 msg->getString("TelehubBlock", "ObjectName", MAX_STRING, buffer);
diff --git a/linden/indra/newview/llfloatertelehub.h b/linden/indra/newview/llfloatertelehub.h
index ccc75bc..3458998 100644
--- a/linden/indra/newview/llfloatertelehub.h
+++ b/linden/indra/newview/llfloatertelehub.h
@@ -32,6 +32,7 @@
32#include "llfloater.h" 32#include "llfloater.h"
33 33
34class LLMessageSystem; 34class LLMessageSystem;
35class LLObjectSelection;
35 36
36const S32 MAX_SPAWNPOINTS_PER_TELEHUB = 16; 37const S32 MAX_SPAWNPOINTS_PER_TELEHUB = 16;
37 38
@@ -69,6 +70,8 @@ private:
69 70
70 S32 mNumSpawn; 71 S32 mNumSpawn;
71 LLVector3 mSpawnPointPos[MAX_SPAWNPOINTS_PER_TELEHUB]; 72 LLVector3 mSpawnPointPos[MAX_SPAWNPOINTS_PER_TELEHUB];
73
74 LLHandle<LLObjectSelection> mObjectSelection;
72 75
73 static LLFloaterTelehub* sInstance; 76 static LLFloaterTelehub* sInstance;
74}; 77};
diff --git a/linden/indra/newview/llfloatertest.cpp b/linden/indra/newview/llfloatertest.cpp
index 9f0503b..29c897d 100644
--- a/linden/indra/newview/llfloatertest.cpp
+++ b/linden/indra/newview/llfloatertest.cpp
@@ -303,7 +303,7 @@ LLFloaterTestImpl::LLFloaterTestImpl()
303 //----------------------------------------------------------------------- 303 //-----------------------------------------------------------------------
304 // Hook us up with the floater view 304 // Hook us up with the floater view
305 //----------------------------------------------------------------------- 305 //-----------------------------------------------------------------------
306 open(); 306 open(); /* Flawfinder: ignore */
307 center(); 307 center();
308} 308}
309 309
diff --git a/linden/indra/newview/llfloatertools.cpp b/linden/indra/newview/llfloatertools.cpp
index 05dd70b..f777581 100644
--- a/linden/indra/newview/llfloatertools.cpp
+++ b/linden/indra/newview/llfloatertools.cpp
@@ -264,7 +264,7 @@ BOOL LLFloaterTools::postBuild()
264 &LLToolPlacerPanel::sTriangleTorus, 264 &LLToolPlacerPanel::sTriangleTorus,
265 &LLToolPlacerPanel::sTree, 265 &LLToolPlacerPanel::sTree,
266 &LLToolPlacerPanel::sGrass}; 266 &LLToolPlacerPanel::sGrass};
267 for(int t=0;t<sizeof(toolNames)/sizeof(toolNames[0]);t++) 267 for(size_t t=0; t<sizeof(toolNames)/sizeof(toolNames[0]); ++t)
268 { 268 {
269 LLButton *found = LLViewerUICtrlFactory::getButtonByName(this,toolNames[t]); 269 LLButton *found = LLViewerUICtrlFactory::getButtonByName(this,toolNames[t]);
270 if(found) 270 if(found)
@@ -395,7 +395,7 @@ LLFloaterTools::LLFloaterTools()
395 factory_map["ContentsInventory"] = LLCallbackMap(createPanelContentsInventory, this);//LLPanelContents 395 factory_map["ContentsInventory"] = LLCallbackMap(createPanelContentsInventory, this);//LLPanelContents
396 factory_map["land info panel"] = LLCallbackMap(createPanelLandInfo, this);//LLPanelLandInfo 396 factory_map["land info panel"] = LLCallbackMap(createPanelLandInfo, this);//LLPanelLandInfo
397 397
398 gUICtrlFactory->buildFloater(this,"floater_tools.xml",&factory_map); 398 gUICtrlFactory->buildFloater(this,"floater_tools.xml",&factory_map,FALSE);
399 399
400 mLargeHeight = getRect().getHeight(); 400 mLargeHeight = getRect().getHeight();
401 mSmallHeight = mLargeHeight; 401 mSmallHeight = mLargeHeight;
@@ -478,7 +478,7 @@ void LLFloaterTools::resetToolState()
478 478
479void LLFloaterTools::updatePopup(LLCoordGL center, MASK mask) 479void LLFloaterTools::updatePopup(LLCoordGL center, MASK mask)
480{ 480{
481 LLTool *tool = gToolMgr->getCurrentTool( mask ); 481 LLTool *tool = gToolMgr->getCurrentTool();
482 482
483 // HACK to allow seeing the buttons when you have the app in a window. 483 // HACK to allow seeing the buttons when you have the app in a window.
484 // Keep the visibility the same as it 484 // Keep the visibility the same as it
@@ -579,7 +579,7 @@ void LLFloaterTools::updatePopup(LLCoordGL center, MASK mask)
579 S32 index = mComboGridMode->getCurrentIndex(); 579 S32 index = mComboGridMode->getCurrentIndex();
580 mComboGridMode->removeall(); 580 mComboGridMode->removeall();
581 581
582 switch (gSelectMgr->getSelectType()) 582 switch (mObjectSelection->getSelectType())
583 { 583 {
584 case SELECT_TYPE_HUD: 584 case SELECT_TYPE_HUD:
585 mComboGridMode->add("Screen"); 585 mComboGridMode->add("Screen");
@@ -726,6 +726,13 @@ BOOL LLFloaterTools::canClose()
726} 726}
727 727
728// virtual 728// virtual
729void LLFloaterTools::onOpen()
730{
731 mParcelSelection = gParcelMgr->getFloatingParcelSelection();
732 mObjectSelection = gSelectMgr->getEditSelection();
733}
734
735// virtual
729void LLFloaterTools::onClose(bool app_quitting) 736void LLFloaterTools::onClose(bool app_quitting)
730{ 737{
731 setMinimized(FALSE); 738 setMinimized(FALSE);
@@ -744,10 +751,14 @@ void LLFloaterTools::onClose(bool app_quitting)
744 751
745 resetToolState(); 752 resetToolState();
746 753
754 mParcelSelection = NULL;
755 mObjectSelection = NULL;
756
747 // Switch back to basic toolset 757 // Switch back to basic toolset
748 gCurrentToolset = gBasicToolset; 758 gToolMgr->setCurrentToolset(gBasicToolset);
749 gBasicToolset->selectFirstTool(); 759 // we were already in basic toolset, using build tools
750 gToolMgr->useSelectedTool( gBasicToolset ); 760 // so manually reset tool to default (pie menu tool)
761 gToolMgr->getCurrentToolset()->selectFirstTool();
751} 762}
752 763
753void LLFloaterTools::showMore(BOOL show_more) 764void LLFloaterTools::showMore(BOOL show_more)
@@ -955,6 +966,5 @@ void LLFloaterTools::setEditTool(void* tool_pointer)
955 966
956void LLFloaterTools::onFocusReceived() 967void LLFloaterTools::onFocusReceived()
957{ 968{
958 gCurrentToolset = gBasicToolset; 969 gToolMgr->setCurrentToolset(gBasicToolset);
959 gCurrentToolset->selectTool(gCurrentToolset->getSelectedTool()); 970}
960} \ No newline at end of file
diff --git a/linden/indra/newview/llfloatertools.h b/linden/indra/newview/llfloatertools.h
index a6c4ceb..664aa62 100644
--- a/linden/indra/newview/llfloatertools.h
+++ b/linden/indra/newview/llfloatertools.h
@@ -44,6 +44,11 @@ class LLPanelFace;
44class LLPanelLandInfo; 44class LLPanelLandInfo;
45class LLComboBox; 45class LLComboBox;
46class LLVolumeSliderCtrl; 46class LLVolumeSliderCtrl;
47class LLParcelSelection;
48class LLObjectSelection;
49
50typedef LLHandle<LLParcelSelection> LLParcelSelectionHandle;
51typedef LLHandle<LLObjectSelection> LLObjectSelectionHandle;
47 52
48class LLFloaterTools 53class LLFloaterTools
49: public LLFloater 54: public LLFloater
@@ -61,6 +66,7 @@ public:
61 LLFloaterTools(); 66 LLFloaterTools();
62 virtual ~LLFloaterTools(); 67 virtual ~LLFloaterTools();
63 68
69 virtual void onOpen();
64 virtual void onClose(bool app_quitting); 70 virtual void onClose(bool app_quitting);
65 virtual BOOL canClose(); 71 virtual BOOL canClose();
66 72
@@ -175,7 +181,10 @@ public:
175 LLPanelLandInfo *mPanelLandInfo; 181 LLPanelLandInfo *mPanelLandInfo;
176 182
177 LLTabContainer* mTabLand; 183 LLTabContainer* mTabLand;
178 184
185 LLParcelSelectionHandle mParcelSelection;
186 LLObjectSelectionHandle mObjectSelection;
187
179private: 188private:
180 BOOL mDirty; 189 BOOL mDirty;
181 S32 mSmallHeight; 190 S32 mSmallHeight;
diff --git a/linden/indra/newview/llfloatertopobjects.cpp b/linden/indra/newview/llfloatertopobjects.cpp
index 093b840..7c86e83 100644
--- a/linden/indra/newview/llfloatertopobjects.cpp
+++ b/linden/indra/newview/llfloatertopobjects.cpp
@@ -160,8 +160,8 @@ void LLFloaterTopObjects::handleReply(LLMessageSystem *msg, void** data)
160 LLUUID task_id; 160 LLUUID task_id;
161 F32 location_x, location_y, location_z; 161 F32 location_x, location_y, location_z;
162 F32 score; 162 F32 score;
163 char name_buf[MAX_STRING]; 163 char name_buf[MAX_STRING]; /* Flawfinder: ignore */
164 char owner_buf[MAX_STRING]; 164 char owner_buf[MAX_STRING]; /* Flawfinder: ignore */
165 165
166 msg->getU32Fast(_PREHASH_ReportData, _PREHASH_TaskLocalID, task_local_id, block); 166 msg->getU32Fast(_PREHASH_ReportData, _PREHASH_TaskLocalID, task_local_id, block);
167 msg->getUUIDFast(_PREHASH_ReportData, _PREHASH_TaskID, task_id, block); 167 msg->getUUIDFast(_PREHASH_ReportData, _PREHASH_TaskID, task_id, block);
@@ -250,7 +250,7 @@ void LLFloaterTopObjects::updateSelectionInfo()
250 LLUUID object_id = list->getCurrentID(); 250 LLUUID object_id = list->getCurrentID();
251 if (object_id.isNull()) return; 251 if (object_id.isNull()) return;
252 252
253 LLString object_id_string = object_id.getString(); 253 std::string object_id_string = object_id.asString();
254 254
255 childSetValue("id_editor", LLSD(object_id_string)); 255 childSetValue("id_editor", LLSD(object_id_string));
256 childSetValue("object_name_editor", list->getFirstSelected()->getColumn(1)->getText()); 256 childSetValue("object_name_editor", list->getFirstSelected()->getColumn(1)->getText());
diff --git a/linden/indra/newview/llfloatertos.cpp b/linden/indra/newview/llfloatertos.cpp
index 35b4531..26346d5 100644
--- a/linden/indra/newview/llfloatertos.cpp
+++ b/linden/indra/newview/llfloatertos.cpp
@@ -125,9 +125,9 @@ BOOL LLFloaterTOS::postBuild()
125 childSetAction("Cancel", onCancel, this); 125 childSetAction("Cancel", onCancel, this);
126 childSetCommitCallback("tos_agreement", updateAgree, this); 126 childSetCommitCallback("tos_agreement", updateAgree, this);
127 127
128 // this displays the critical message
129 if ( mType != TOS_TOS ) 128 if ( mType != TOS_TOS )
130 { 129 {
130 // this displays the critical message
131 LLTextEditor *Editor = LLUICtrlFactory::getTextEditorByName(this, "tos_text"); 131 LLTextEditor *Editor = LLUICtrlFactory::getTextEditorByName(this, "tos_text");
132 if (Editor) 132 if (Editor)
133 { 133 {
@@ -137,25 +137,11 @@ BOOL LLFloaterTOS::postBuild()
137 Editor->setWordWrap(TRUE); 137 Editor->setWordWrap(TRUE);
138 Editor->setFocus(TRUE); 138 Editor->setFocus(TRUE);
139 } 139 }
140 childSetValue("tos_text", LLSD(mMessage)); 140 childSetValue("tos_text", LLSD(mMessage));
141 }; 141 return TRUE;
142 142 }
143 // this displays the critical message
144 if ( mType != TOS_TOS )
145 {
146 LLTextEditor *Editor = LLUICtrlFactory::getTextEditorByName(this, "tos_text");
147 if (Editor)
148 {
149 Editor->setHandleEditKeysDirectly( TRUE );
150 Editor->setEnabled( FALSE );
151 Editor->setReadOnlyFgColor(LLColor4::white);
152 Editor->setWordWrap(TRUE);
153 Editor->setFocus(TRUE);
154 }
155 childSetValue("tos_text", LLSD(mMessage));
156 };
157 143
158 #if LL_LIBXUL_ENABLED 144#if LL_LIBXUL_ENABLED
159 // disable Agree to TOS radio button until the page has fully loaded 145 // disable Agree to TOS radio button until the page has fully loaded
160 LLRadioGroup* tos_agreement = LLUICtrlFactory::getRadioGroupByName(this, "tos_agreement"); 146 LLRadioGroup* tos_agreement = LLUICtrlFactory::getRadioGroupByName(this, "tos_agreement");
161 if ( tos_agreement ) 147 if ( tos_agreement )
@@ -163,19 +149,26 @@ BOOL LLFloaterTOS::postBuild()
163 tos_agreement->setEnabled( false ); 149 tos_agreement->setEnabled( false );
164 }; 150 };
165 151
152 // hide the SL text widget if we're displaying TOS with using a browser widget.
153 LLTextEditor *editor = LLUICtrlFactory::getTextEditorByName(this, "tos_text");
154 if ( editor )
155 {
156 editor->setVisible( FALSE );
157 };
158
166 LLWebBrowserCtrl* web_browser = LLUICtrlFactory::getWebBrowserCtrlByName(this, "tos_html"); 159 LLWebBrowserCtrl* web_browser = LLUICtrlFactory::getWebBrowserCtrlByName(this, "tos_html");
167 if ( web_browser ) 160 if ( web_browser )
168 { 161 {
169 // start to observe it so we see navigate complete events 162 // start to observe it so we see navigate complete events
170 if ( web_browser ) 163 if ( web_browser )
171 { 164 {
172 web_browser->addObserver( this ); 165 web_browser->addObserver( this );
173 }; 166 };
174 167
175 gResponsePtr = LLIamHere::build( this ); 168 gResponsePtr = LLIamHere::build( this );
176 LLHTTPClient::get( childGetValue( "real_url" ).asString(), gResponsePtr ); 169 LLHTTPClient::get( childGetValue( "real_url" ).asString(), gResponsePtr );
177 }; 170 };
178 #else 171#else
179 LLTextEditor *Editor = LLUICtrlFactory::getTextEditorByName(this, "tos_text"); 172 LLTextEditor *Editor = LLUICtrlFactory::getTextEditorByName(this, "tos_text");
180 if (Editor) 173 if (Editor)
181 { 174 {
@@ -186,7 +179,8 @@ BOOL LLFloaterTOS::postBuild()
186 Editor->setFocus(TRUE); 179 Editor->setFocus(TRUE);
187 } 180 }
188 childSetValue("tos_text", LLSD(mMessage)); 181 childSetValue("tos_text", LLSD(mMessage));
189 #endif 182#endif
183
190 return TRUE; 184 return TRUE;
191} 185}
192 186
diff --git a/linden/indra/newview/llfloaterworldmap.cpp b/linden/indra/newview/llfloaterworldmap.cpp
index af0e5c0..967e6d0 100644
--- a/linden/indra/newview/llfloaterworldmap.cpp
+++ b/linden/indra/newview/llfloaterworldmap.cpp
@@ -312,7 +312,7 @@ void LLFloaterWorldMap::show(void*, BOOL center_on_target)
312 BOOL was_visible = gFloaterWorldMap->getVisible(); 312 BOOL was_visible = gFloaterWorldMap->getVisible();
313 313
314 gFloaterWorldMap->mIsClosing = FALSE; 314 gFloaterWorldMap->mIsClosing = FALSE;
315 gFloaterWorldMap->open(); 315 gFloaterWorldMap->open(); /* Flawfinder: ignore */
316 316
317 LLWorldMapView* map_panel; 317 LLWorldMapView* map_panel;
318 map_panel = (LLWorldMapView*)gFloaterWorldMap->mTabs->getCurrentPanel(); 318 map_panel = (LLWorldMapView*)gFloaterWorldMap->mTabs->getCurrentPanel();
@@ -458,6 +458,14 @@ void LLFloaterWorldMap::draw()
458 return; 458 return;
459 } 459 }
460 460
461 // On orientation island, users don't have a home location yet, so don't
462 // let them teleport "home". It dumps them in an often-crowed welcome
463 // area (infohub) and they get confused. JC
464 LLViewerRegion* regionp = gAgent.getRegion();
465 bool agent_on_prelude = (regionp && regionp->isPrelude());
466 bool enable_go_home = gAgent.isGodlike() || !agent_on_prelude;
467 childSetEnabled("Go Home", enable_go_home);
468
461 updateLocation(); 469 updateLocation();
462 470
463 LLTracker::ETrackingStatus tracking_status = LLTracker::getTrackingStatus(); 471 LLTracker::ETrackingStatus tracking_status = LLTracker::getTrackingStatus();
diff --git a/linden/indra/newview/llfloaterworldmap.h b/linden/indra/newview/llfloaterworldmap.h
index 67386c9..4b812b6 100644
--- a/linden/indra/newview/llfloaterworldmap.h
+++ b/linden/indra/newview/llfloaterworldmap.h
@@ -56,18 +56,18 @@ public:
56 static void *createWorldMapView(void* data); 56 static void *createWorldMapView(void* data);
57 BOOL postBuild(); 57 BOOL postBuild();
58 58
59 virtual void onClose(bool app_quitting); 59 /*virtual*/ void onClose(bool app_quitting);
60 60
61 static void show(void*, BOOL center_on_target ); 61 static void show(void*, BOOL center_on_target );
62 static void reloadIcons(void*); 62 static void reloadIcons(void*);
63 static void toggle(void*); 63 static void toggle(void*);
64 static void hide(void*); 64 static void hide(void*);
65 65
66 virtual void reshape( S32 width, S32 height, BOOL called_from_parent = TRUE ); 66 /*virtual*/ void reshape( S32 width, S32 height, BOOL called_from_parent = TRUE );
67 virtual BOOL handleHover(S32 x, S32 y, MASK mask); 67 /*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask);
68 virtual BOOL handleScrollWheel(S32 x, S32 y, S32 clicks); 68 /*virtual*/ BOOL handleScrollWheel(S32 x, S32 y, S32 clicks);
69 virtual void setVisible(BOOL visible); 69 /*virtual*/ void setVisible(BOOL visible);
70 virtual void draw(); 70 /*virtual*/ void draw();
71 71
72 // methods for dealing with inventory. The observe() method is 72 // methods for dealing with inventory. The observe() method is
73 // called during program startup. inventoryUpdated() will be 73 // called during program startup. inventoryUpdated() will be
diff --git a/linden/indra/newview/llfolderview.cpp b/linden/indra/newview/llfolderview.cpp
index 431f212..377e620 100644
--- a/linden/indra/newview/llfolderview.cpp
+++ b/linden/indra/newview/llfolderview.cpp
@@ -327,10 +327,10 @@ void LLFolderViewItem::arrangeFromRoot()
327// UI. If open is TRUE, then folders are opened up along the way to 327// UI. If open is TRUE, then folders are opened up along the way to
328// the selection. 328// the selection.
329void LLFolderViewItem::setSelectionFromRoot(LLFolderViewItem* selection, 329void LLFolderViewItem::setSelectionFromRoot(LLFolderViewItem* selection,
330 BOOL open, 330 BOOL open, /* Flawfinder: ignore */
331 BOOL take_keyboard_focus) 331 BOOL take_keyboard_focus)
332{ 332{
333 getRoot()->setSelection(selection, open, take_keyboard_focus); 333 getRoot()->setSelection(selection, open, take_keyboard_focus); /* Flawfinder: ignore */
334} 334}
335 335
336// helper function to change the selection from the root. 336// helper function to change the selection from the root.
@@ -534,7 +534,7 @@ void LLFolderViewItem::buildContextMenu(LLMenuGL& menu, U32 flags)
534 } 534 }
535} 535}
536 536
537void LLFolderViewItem::open( void ) 537void LLFolderViewItem::open( void ) /* Flawfinder: ignore */
538{ 538{
539 if( mListener ) 539 if( mListener )
540 { 540 {
@@ -1365,7 +1365,7 @@ BOOL LLFolderViewFolder::hasFilteredDescendants()
1365 1365
1366// Passes selection information on to children and record selection 1366// Passes selection information on to children and record selection
1367// information if necessary. 1367// information if necessary.
1368BOOL LLFolderViewFolder::setSelection(LLFolderViewItem* selection, BOOL open, 1368BOOL LLFolderViewFolder::setSelection(LLFolderViewItem* selection, BOOL open, /* Flawfinder: ignore */
1369 BOOL take_keyboard_focus) 1369 BOOL take_keyboard_focus)
1370{ 1370{
1371 BOOL rv = FALSE; 1371 BOOL rv = FALSE;
@@ -1389,7 +1389,7 @@ BOOL LLFolderViewFolder::setSelection(LLFolderViewItem* selection, BOOL open,
1389 iter != mFolders.end();) 1389 iter != mFolders.end();)
1390 { 1390 {
1391 folders_t::iterator fit = iter++; 1391 folders_t::iterator fit = iter++;
1392 if((*fit)->setSelection(selection, open, take_keyboard_focus)) 1392 if((*fit)->setSelection(selection, open, take_keyboard_focus)) /* Flawfinder: ignore */
1393 { 1393 {
1394 rv = TRUE; 1394 rv = TRUE;
1395 child_selected = TRUE; 1395 child_selected = TRUE;
@@ -1400,14 +1400,14 @@ BOOL LLFolderViewFolder::setSelection(LLFolderViewItem* selection, BOOL open,
1400 iter != mItems.end();) 1400 iter != mItems.end();)
1401 { 1401 {
1402 items_t::iterator iit = iter++; 1402 items_t::iterator iit = iter++;
1403 if((*iit)->setSelection(selection, open, take_keyboard_focus)) 1403 if((*iit)->setSelection(selection, open, take_keyboard_focus)) /* Flawfinder: ignore */
1404 { 1404 {
1405 rv = TRUE; 1405 rv = TRUE;
1406 child_selected = TRUE; 1406 child_selected = TRUE;
1407 mNumDescendantsSelected++; 1407 mNumDescendantsSelected++;
1408 } 1408 }
1409 } 1409 }
1410 if(open && child_selected) 1410 if(open && child_selected) /* Flawfinder: ignore */
1411 { 1411 {
1412 setOpenArrangeRecursively(TRUE); 1412 setOpenArrangeRecursively(TRUE);
1413 } 1413 }
@@ -1964,16 +1964,16 @@ void LLFolderViewFolder::toggleOpen()
1964} 1964}
1965 1965
1966// Force a folder open or closed 1966// Force a folder open or closed
1967void LLFolderViewFolder::setOpen(BOOL open) 1967void LLFolderViewFolder::setOpen(BOOL open) /* Flawfinder: ignore */
1968{ 1968{
1969 setOpenArrangeRecursively(open); 1969 setOpenArrangeRecursively(open); /* Flawfinder: ignore */
1970} 1970}
1971 1971
1972void LLFolderViewFolder::setOpenArrangeRecursively(BOOL open, ERecurseType recurse) 1972void LLFolderViewFolder::setOpenArrangeRecursively(BOOL open, ERecurseType recurse) /* Flawfinder: ignore */
1973{ 1973{
1974 BOOL was_open = mIsOpen; 1974 BOOL was_open = mIsOpen;
1975 mIsOpen = open; 1975 mIsOpen = open; /* Flawfinder: ignore */
1976 if(!was_open && open) 1976 if(!was_open && open) /* Flawfinder: ignore */
1977 { 1977 {
1978 if(mListener) 1978 if(mListener)
1979 { 1979 {
@@ -1986,12 +1986,12 @@ void LLFolderViewFolder::setOpenArrangeRecursively(BOOL open, ERecurseType recur
1986 iter != mFolders.end();) 1986 iter != mFolders.end();)
1987 { 1987 {
1988 folders_t::iterator fit = iter++; 1988 folders_t::iterator fit = iter++;
1989 (*fit)->setOpenArrangeRecursively(open, RECURSE_DOWN); 1989 (*fit)->setOpenArrangeRecursively(open, RECURSE_DOWN); /* Flawfinder: ignore */
1990 } 1990 }
1991 } 1991 }
1992 if (mParentFolder && (recurse == RECURSE_UP || recurse == RECURSE_UP_DOWN)) 1992 if (mParentFolder && (recurse == RECURSE_UP || recurse == RECURSE_UP_DOWN))
1993 { 1993 {
1994 mParentFolder->setOpenArrangeRecursively(open, RECURSE_UP); 1994 mParentFolder->setOpenArrangeRecursively(open, RECURSE_UP); /* Flawfinder: ignore */
1995 } 1995 }
1996 1996
1997 if (was_open != mIsOpen) 1997 if (was_open != mIsOpen)
@@ -2024,7 +2024,7 @@ BOOL LLFolderViewFolder::handleDragAndDropFromChild(MASK mask,
2024 return TRUE; 2024 return TRUE;
2025} 2025}
2026 2026
2027void LLFolderViewFolder::open( void ) 2027void LLFolderViewFolder::open( void ) /* Flawfinder: ignore */
2028{ 2028{
2029 toggleOpen(); 2029 toggleOpen();
2030} 2030}
@@ -2713,10 +2713,10 @@ void LLFolderView::openFolder(const LLString& foldername)
2713 } 2713 }
2714} 2714}
2715 2715
2716void LLFolderView::setOpenArrangeRecursively(BOOL open, ERecurseType recurse) 2716void LLFolderView::setOpenArrangeRecursively(BOOL open, ERecurseType recurse) /* Flawfinder: ignore */
2717{ 2717{
2718 // call base class to do proper recursion 2718 // call base class to do proper recursion
2719 LLFolderViewFolder::setOpenArrangeRecursively(open, recurse); 2719 LLFolderViewFolder::setOpenArrangeRecursively(open, recurse); /* Flawfinder: ignore */
2720 // make sure root folder is always open 2720 // make sure root folder is always open
2721 mIsOpen = TRUE; 2721 mIsOpen = TRUE;
2722} 2722}
@@ -2892,7 +2892,7 @@ LLFolderViewItem* LLFolderView::getCurSelectedItem( void )
2892 2892
2893 2893
2894// Record the selected item and pass it down the hierachy. 2894// Record the selected item and pass it down the hierachy.
2895BOOL LLFolderView::setSelection(LLFolderViewItem* selection, BOOL open, 2895BOOL LLFolderView::setSelection(LLFolderViewItem* selection, BOOL open, /* Flawfinder: ignore */
2896 BOOL take_keyboard_focus) 2896 BOOL take_keyboard_focus)
2897{ 2897{
2898 if( selection == this ) 2898 if( selection == this )
@@ -2914,8 +2914,8 @@ BOOL LLFolderView::setSelection(LLFolderViewItem* selection, BOOL open,
2914 addToSelectionList(selection); 2914 addToSelectionList(selection);
2915 } 2915 }
2916 2916
2917 BOOL rv = LLFolderViewFolder::setSelection(selection, open, take_keyboard_focus); 2917 BOOL rv = LLFolderViewFolder::setSelection(selection, open, take_keyboard_focus); /* Flawfinder: ignore */
2918 if(open) 2918 if(open) /* Flawfinder: ignore */
2919 { 2919 {
2920 selection->getParentFolder()->requestArrange(); 2920 selection->getParentFolder()->requestArrange();
2921 } 2921 }
@@ -3331,7 +3331,7 @@ void LLFolderView::openSelectedItems( void )
3331 { 3331 {
3332 if (mSelectedItems.size() == 1) 3332 if (mSelectedItems.size() == 1)
3333 { 3333 {
3334 mSelectedItems.front()->open(); 3334 mSelectedItems.front()->open(); /* Flawfinder: ignore */
3335 } 3335 }
3336 else 3336 else
3337 { 3337 {
@@ -3345,11 +3345,11 @@ void LLFolderView::openSelectedItems( void )
3345 selected_items_t::iterator item_it; 3345 selected_items_t::iterator item_it;
3346 for (item_it = mSelectedItems.begin(); item_it != mSelectedItems.end(); ++item_it) 3346 for (item_it = mSelectedItems.begin(); item_it != mSelectedItems.end(); ++item_it)
3347 { 3347 {
3348 (*item_it)->open(); 3348 (*item_it)->open(); /* Flawfinder: ignore */
3349 } 3349 }
3350 3350
3351 LLFloater::setFloaterHost(NULL); 3351 LLFloater::setFloaterHost(NULL);
3352 multi_previewp->open(); 3352 multi_previewp->open(); /* Flawfinder: ignore */
3353 } 3353 }
3354 } 3354 }
3355} 3355}
@@ -3380,7 +3380,7 @@ void LLFolderView::propertiesSelectedItems( void )
3380 } 3380 }
3381 3381
3382 LLFloater::setFloaterHost(NULL); 3382 LLFloater::setFloaterHost(NULL);
3383 multi_propertiesp->open(); 3383 multi_propertiesp->open(); /* Flawfinder: ignore */
3384 } 3384 }
3385 } 3385 }
3386} 3386}
@@ -3858,34 +3858,8 @@ BOOL LLFolderView::handleKeyHere( KEY key, MASK mask, BOOL called_from_parent )
3858 search(getCurSelectedItem(), mSearchString.c_str(), FALSE); 3858 search(getCurSelectedItem(), mSearchString.c_str(), FALSE);
3859 handled = TRUE; 3859 handled = TRUE;
3860 } 3860 }
3861 else if (mask & MASK_CONTROL && key == 'N')
3862 {
3863 LLFolderViewItem* selection = getCurSelectedItem();
3864 if (selection)
3865 {
3866 selection = selection->getNextOpenNode();
3867 }
3868 search(selection, mSearchString.c_str(), FALSE);
3869 mSearchTimer.reset();
3870 handled = TRUE;
3871 }
3872 else if (mask & MASK_CONTROL && key == 'P')
3873 {
3874 LLFolderViewItem* selection = getCurSelectedItem();
3875 if (selection)
3876 {
3877 selection = selection->getPreviousOpenNode();
3878 }
3879 search(selection, mSearchString.c_str(), TRUE);
3880 mSearchTimer.reset();
3881 handled = TRUE;
3882 }
3883 } 3861 }
3884 3862
3885 if (handled)
3886 {
3887 gViewerWindow->requestFastFrame(this);
3888 }
3889 return handled; 3863 return handled;
3890} 3864}
3891 3865
@@ -3921,11 +3895,6 @@ BOOL LLFolderView::handleUnicodeCharHere(llwchar uni_char, BOOL called_from_pare
3921 handled = TRUE; 3895 handled = TRUE;
3922 } 3896 }
3923 3897
3924 if (handled)
3925 {
3926 gViewerWindow->requestFastFrame(this);
3927 }
3928
3929 return handled; 3898 return handled;
3930} 3899}
3931 3900
@@ -4078,7 +4047,7 @@ BOOL LLFolderView::handleRightMouseDown( S32 x, S32 y, MASK mask )
4078 } 4047 }
4079 4048
4080 menu->arrange(); 4049 menu->arrange();
4081 menu->updateParent(gMenuHolder); 4050 menu->updateParent(LLMenuGL::sMenuContainer);
4082 LLMenuGL::showPopup(this, menu, x, y); 4051 LLMenuGL::showPopup(this, menu, x, y);
4083 } 4052 }
4084 else 4053 else
@@ -4499,14 +4468,15 @@ std::string::size_type LLInventoryFilter::getStringMatchOffset() const
4499 return mSubStringMatchOffset; 4468 return mSubStringMatchOffset;
4500} 4469}
4501 4470
4471// has user modified default filter params?
4502BOOL LLInventoryFilter::isActive() 4472BOOL LLInventoryFilter::isActive()
4503{ 4473{
4504 return mFilterOps.mFilterTypes != 0xffffffff 4474 return mFilterOps.mFilterTypes != mDefaultFilterOps.mFilterTypes
4505 || mFilterSubString.size() 4475 || mFilterSubString.size()
4506 || mFilterOps.mPermissions != PERM_NONE 4476 || mFilterOps.mPermissions != mDefaultFilterOps.mPermissions
4507 || mFilterOps.mMinDate != 0 4477 || mFilterOps.mMinDate != mDefaultFilterOps.mMinDate
4508 || mFilterOps.mMaxDate != U32_MAX 4478 || mFilterOps.mMaxDate != mDefaultFilterOps.mMaxDate
4509 || mFilterOps.mHoursAgo != 0; 4479 || mFilterOps.mHoursAgo != mDefaultFilterOps.mHoursAgo;
4510} 4480}
4511 4481
4512BOOL LLInventoryFilter::isModified() 4482BOOL LLInventoryFilter::isModified()
diff --git a/linden/indra/newview/llfolderview.h b/linden/indra/newview/llfolderview.h
index a63ae26..ccadba9 100644
--- a/linden/indra/newview/llfolderview.h
+++ b/linden/indra/newview/llfolderview.h
@@ -317,7 +317,7 @@ protected:
317 // the specified selected item appropriately for display and use 317 // the specified selected item appropriately for display and use
318 // in the UI. If open is TRUE, then folders are opened up along 318 // in the UI. If open is TRUE, then folders are opened up along
319 // the way to the selection. 319 // the way to the selection.
320 void setSelectionFromRoot(LLFolderViewItem* selection, BOOL open, 320 void setSelectionFromRoot(LLFolderViewItem* selection, BOOL open, /* Flawfinder: ignore */
321 BOOL take_keyboard_focus = TRUE); 321 BOOL take_keyboard_focus = TRUE);
322 322
323 // helper function to change the selection from the root. 323 // helper function to change the selection from the root.
@@ -366,7 +366,7 @@ public:
366 // ignore. Returns TRUE if this object was affected. If open is 366 // ignore. Returns TRUE if this object was affected. If open is
367 // TRUE, then folders are opened up along the way to the 367 // TRUE, then folders are opened up along the way to the
368 // selection. 368 // selection.
369 virtual BOOL setSelection(LLFolderViewItem* selection, BOOL open, 369 virtual BOOL setSelection(LLFolderViewItem* selection, BOOL open, /* Flawfinder: ignore */
370 BOOL take_keyboard_focus); 370 BOOL take_keyboard_focus);
371 371
372 // This method is used to toggle the selection of an item. If 372 // This method is used to toggle the selection of an item. If
@@ -433,7 +433,7 @@ public:
433 void rename(const LLString& new_name); 433 void rename(const LLString& new_name);
434 434
435 // open 435 // open
436 virtual void open( void ); 436 virtual void open( void ); /* Flawfinder: ignore */
437 virtual void preview(void); 437 virtual void preview(void);
438 438
439 // Show children (unfortunate that this is called "open") 439 // Show children (unfortunate that this is called "open")
@@ -558,7 +558,7 @@ public:
558 // Passes selection information on to children and record 558 // Passes selection information on to children and record
559 // selection information if necessary. Returns TRUE if this object 559 // selection information if necessary. Returns TRUE if this object
560 // (or a child) was affected. 560 // (or a child) was affected.
561 virtual BOOL setSelection(LLFolderViewItem* selection, BOOL open, 561 virtual BOOL setSelection(LLFolderViewItem* selection, BOOL open, /* Flawfinder: ignore */
562 BOOL take_keyboard_focus); 562 BOOL take_keyboard_focus);
563 563
564 // This method is used to change the selection of an item. If 564 // This method is used to change the selection of an item. If
@@ -612,7 +612,7 @@ public:
612 virtual void toggleOpen(); 612 virtual void toggleOpen();
613 613
614 // Force a folder open or closed 614 // Force a folder open or closed
615 virtual void setOpen(BOOL open = TRUE); 615 virtual void setOpen(BOOL open = TRUE); /* Flawfinder: ignore */
616 616
617 // Called when a child is refreshed. 617 // Called when a child is refreshed.
618 virtual void requestArrange(); 618 virtual void requestArrange();
@@ -621,7 +621,7 @@ public:
621 // method was written because the list iterators destroy the state 621 // method was written because the list iterators destroy the state
622 // of other iterations, thus, we can't arrange while iterating 622 // of other iterations, thus, we can't arrange while iterating
623 // through the children (such as when setting which is selected. 623 // through the children (such as when setting which is selected.
624 virtual void setOpenArrangeRecursively(BOOL open, ERecurseType recurse = RECURSE_NO); 624 virtual void setOpenArrangeRecursively(BOOL open, ERecurseType recurse = RECURSE_NO); /* Flawfinder: ignore */
625 625
626 // Get the current state of the folder. 626 // Get the current state of the folder.
627 virtual BOOL isOpen() { return mIsOpen; } 627 virtual BOOL isOpen() { return mIsOpen; }
@@ -637,7 +637,7 @@ public:
637 void applyFunctorRecursively(LLFolderViewFunctor& functor); 637 void applyFunctorRecursively(LLFolderViewFunctor& functor);
638 virtual void applyListenerFunctorRecursively(LLFolderViewListenerFunctor& functor); 638 virtual void applyListenerFunctorRecursively(LLFolderViewListenerFunctor& functor);
639 639
640 virtual void open( void ); 640 virtual void open( void ); /* Flawfinder: ignore */
641 virtual BOOL addItem(LLFolderViewItem* item); 641 virtual BOOL addItem(LLFolderViewItem* item);
642 virtual BOOL addFolder( LLFolderViewFolder* folder); 642 virtual BOOL addFolder( LLFolderViewFolder* folder);
643 643
@@ -705,7 +705,7 @@ public:
705 void openFolder(const LLString& foldername); 705 void openFolder(const LLString& foldername);
706 706
707 virtual void toggleOpen() {}; 707 virtual void toggleOpen() {};
708 virtual void setOpenArrangeRecursively(BOOL open, ERecurseType recurse); 708 virtual void setOpenArrangeRecursively(BOOL open, ERecurseType recurse); /* Flawfinder: ignore */
709 virtual BOOL addFolder( LLFolderViewFolder* folder); 709 virtual BOOL addFolder( LLFolderViewFolder* folder);
710 710
711 // Finds width and height of this object and it's children. Also 711 // Finds width and height of this object and it's children. Also
@@ -722,7 +722,7 @@ public:
722 virtual LLFolderViewItem* getCurSelectedItem( void ); 722 virtual LLFolderViewItem* getCurSelectedItem( void );
723 723
724 // Record the selected item and pass it down the hierachy. 724 // Record the selected item and pass it down the hierachy.
725 virtual BOOL setSelection(LLFolderViewItem* selection, BOOL open, 725 virtual BOOL setSelection(LLFolderViewItem* selection, BOOL open, /* Flawfinder: ignore */
726 BOOL take_keyboard_focus); 726 BOOL take_keyboard_focus);
727 727
728 // This method is used to toggle the selection of an item. Walks 728 // This method is used to toggle the selection of an item. Walks
@@ -817,7 +817,6 @@ public:
817 817
818 static void idle(void* user_data); 818 static void idle(void* user_data);
819 819
820 void setAutoSelectOverride(bool override) { mAutoSelectOverride = override; }
821 BOOL needsAutoSelect() { return mNeedsAutoSelect && !mAutoSelectOverride; } 820 BOOL needsAutoSelect() { return mNeedsAutoSelect && !mAutoSelectOverride; }
822 BOOL getDebugFilters() { return mDebugFilters; } 821 BOOL getDebugFilters() { return mDebugFilters; }
823 822
diff --git a/linden/indra/newview/llframestats.cpp b/linden/indra/newview/llframestats.cpp
index cd49e7d..237f59b 100644
--- a/linden/indra/newview/llframestats.cpp
+++ b/linden/indra/newview/llframestats.cpp
@@ -168,7 +168,7 @@ void LLFrameStats::dump()
168 S32 total_visible_objects = 0; 168 S32 total_visible_objects = 0;
169 169
170 time_t cur_time; 170 time_t cur_time;
171 char time_str[24]; 171 char time_str[24]; /* Flawfinder: ignore */
172 //char *time_str; 172 //char *time_str;
173 time(&cur_time); 173 time(&cur_time);
174 strftime(time_str, 24, "%Y.%m.%d %H:%M:%S", localtime(&cur_time)); 174 strftime(time_str, 24, "%Y.%m.%d %H:%M:%S", localtime(&cur_time));
@@ -177,13 +177,13 @@ void LLFrameStats::dump()
177 177
178 static S32 dump_count = 0; 178 static S32 dump_count = 0;
179 179
180 char file_with_num[256]; 180 char file_with_num[256]; /* Flawfinder: ignore */
181 sprintf(file_with_num, "fs%d.txt", dump_count); 181 snprintf(file_with_num, sizeof(file_with_num), "fs%d.txt", dump_count); /* Flawfinder: ignore */
182 dump_count++; 182 dump_count++;
183 183
184 char filename[LL_MAX_PATH]; 184 char filename[LL_MAX_PATH]; /* Flawfinder: ignore */
185 sprintf(filename, "%s", gDirUtilp->getExpandedFilename(LL_PATH_LOGS, file_with_num).c_str()); 185 snprintf(filename, LL_MAX_PATH, "%s", gDirUtilp->getExpandedFilename(LL_PATH_LOGS, file_with_num).c_str()); /* Flawfinder: ignore */
186 FILE *fp = LLFile::fopen(filename, "w"); 186 FILE *fp = LLFile::fopen(filename, "w"); /* Flawfinder: ignore */
187 if (!fp) 187 if (!fp)
188 { 188 {
189 llinfos << "Couldn't open file for dumping frame stats!" << llendl; 189 llinfos << "Couldn't open file for dumping frame stats!" << llendl;
@@ -224,8 +224,8 @@ void LLFrameStats::dump()
224 fclose(fp); 224 fclose(fp);
225 225
226 // Now dump cumulative stats 226 // Now dump cumulative stats
227 sprintf(filename, "%s", gDirUtilp->getExpandedFilename(LL_PATH_LOGS, mSummaryFilename.c_str()).c_str()); 227 snprintf(filename, LL_MAX_PATH, "%s", gDirUtilp->getExpandedFilename(LL_PATH_LOGS, mSummaryFilename.c_str()).c_str()); /* Flawfinder: ignore */
228 fp = LLFile::fopen(filename, "a"); 228 fp = LLFile::fopen(filename, "a"); /* Flawfinder: ignore */
229 if (!fp) 229 if (!fp)
230 { 230 {
231 llinfos << "Couldn't open file for dumping frame stats!" << llendl; 231 llinfos << "Couldn't open file for dumping frame stats!" << llendl;
diff --git a/linden/indra/newview/llframestatview.cpp b/linden/indra/newview/llframestatview.cpp
index d17d51e..e0c1cc7 100644
--- a/linden/indra/newview/llframestatview.cpp
+++ b/linden/indra/newview/llframestatview.cpp
@@ -198,7 +198,7 @@ void LLFrameStatView::draw()
198 198
199 // Draw ticks for the "Average bar" 199 // Draw ticks for the "Average bar"
200 F32 tick_value; 200 F32 tick_value;
201 char tick_label[256]; 201 char tick_label[256]; /* Flawfinder: ignore */
202 for (tick_value = 0; tick_value <= 100; tick_value += 10) 202 for (tick_value = 0; tick_value <= 100; tick_value += 10)
203 { 203 {
204 left = 10 + llfloor(tick_value*(total_width/100.f)); 204 left = 10 + llfloor(tick_value*(total_width/100.f));
@@ -215,7 +215,7 @@ void LLFrameStatView::draw()
215 right = left + 1; 215 right = left + 1;
216 gl_rect_2d(left, top, right, bottom, LLColor4(1.f, 1.f, 1.f, 0.2f)); 216 gl_rect_2d(left, top, right, bottom, LLColor4(1.f, 1.f, 1.f, 0.2f));
217 217
218 sprintf(tick_label, "%.2f", tick_value); 218 snprintf(tick_label, sizeof(tick_label), "%.2f", tick_value); /* Flawfinder: ignore */
219 // draw labels for the tick marks 219 // draw labels for the tick marks
220 LLFontGL::sMonospace->renderUTF8(tick_label, 0, left, bottom, 220 LLFontGL::sMonospace->renderUTF8(tick_label, 0, left, bottom,
221 LLColor4(1.f, 1.f, 1.f, 0.5f), 221 LLColor4(1.f, 1.f, 1.f, 0.5f),
@@ -265,7 +265,7 @@ void LLFrameStatView::draw()
265 right = left + 1; 265 right = left + 1;
266 gl_rect_2d(left, top, right, bottom, LLColor4(1.f, 1.f, 1.f, 0.25f)); 266 gl_rect_2d(left, top, right, bottom, LLColor4(1.f, 1.f, 1.f, 0.25f));
267 267
268 sprintf(tick_label, "%.2f", tick_value); 268 snprintf(tick_label, sizeof(tick_label), "%.2f", tick_value); /* Flawfinder: ignore */
269 // draw labels for the tick marks 269 // draw labels for the tick marks
270 LLFontGL::sMonospace->renderUTF8(tick_label, 0, left, bottom, 270 LLFontGL::sMonospace->renderUTF8(tick_label, 0, left, bottom,
271 LLColor4(1.f, 1.f, 1.f, 0.5f), 271 LLColor4(1.f, 1.f, 1.f, 0.5f),
@@ -290,7 +290,7 @@ void LLFrameStatView::draw()
290 right = left + 1; 290 right = left + 1;
291 gl_rect_2d(left, top, right, bottom, LLColor4(1.f, 1.f, 1.f, 0.25f)); 291 gl_rect_2d(left, top, right, bottom, LLColor4(1.f, 1.f, 1.f, 0.25f));
292 292
293 sprintf(tick_label, "%.2f", tick_value); 293 snprintf(tick_label, sizeof(tick_label), "%.2f", tick_value); /* Flawfinder: ignore */
294 // draw labels for the tick marks 294 // draw labels for the tick marks
295 LLFontGL::sMonospace->renderUTF8(tick_label, 0, left, bottom, 295 LLFontGL::sMonospace->renderUTF8(tick_label, 0, left, bottom,
296 LLColor4(1.f, 1.f, 1.f, 0.5f), 296 LLColor4(1.f, 1.f, 1.f, 0.5f),
diff --git a/linden/indra/newview/llframestatview.h b/linden/indra/newview/llframestatview.h
index 35d63b1..465b238 100644
--- a/linden/indra/newview/llframestatview.h
+++ b/linden/indra/newview/llframestatview.h
@@ -64,7 +64,7 @@ public:
64private: 64private:
65 LLStat *mStats[MAX_STATS]; 65 LLStat *mStats[MAX_STATS];
66 LLColor4 mColors[MAX_STATS]; 66 LLColor4 mColors[MAX_STATS];
67 const char *mLabels[MAX_STATS]; 67 const char *mLabels[MAX_STATS]; /* Flawfinder: ignore */
68 S32 mNumStats; 68 S32 mNumStats;
69}; 69};
70 70
diff --git a/linden/indra/newview/llgenepool.cpp b/linden/indra/newview/llgenepool.cpp
index 33cb70d..2a2c864 100644
--- a/linden/indra/newview/llgenepool.cpp
+++ b/linden/indra/newview/llgenepool.cpp
@@ -56,10 +56,10 @@ LLGenePool::~LLGenePool()
56 56
57BOOL LLGenePool::load() 57BOOL LLGenePool::load()
58{ 58{
59 char filename[MAX_PATH]; 59 char filename[MAX_PATH]; /*Flawfinder: ignore*/
60
61 strcpy(filename,gDirUtilp->getExpandedFilename(LL_PATH_CHARACTER,"genepool.xml").c_str());
62 60
61 strncpy(filename,gDirUtilp->getExpandedFilename(LL_PATH_CHARACTER,"genepool.xml").c_str(), sizeof(filename) -1); /*Flawfinder: ignore*/
62 filename[sizeof(filename) -1] = '\0';
63 if( mLoaded ) 63 if( mLoaded )
64 { 64 {
65 return TRUE; 65 return TRUE;
diff --git a/linden/indra/newview/llgesturemgr.cpp b/linden/indra/newview/llgesturemgr.cpp
index 8f906d9..76a2ca7 100644
--- a/linden/indra/newview/llgesturemgr.cpp
+++ b/linden/indra/newview/llgesturemgr.cpp
@@ -875,7 +875,13 @@ void LLGestureManager::onLoadComplete(LLVFS *vfs,
875 S32 size = file.getSize(); 875 S32 size = file.getSize();
876 876
877 char* buffer = new char[size+1]; 877 char* buffer = new char[size+1];
878 file.read((U8*)buffer, size); 878 if (buffer == NULL)
879 {
880 llerrs << "Memory Allocation Failed" << llendl;
881 return;
882 }
883
884 file.read((U8*)buffer, size); /* Flawfinder: ignore */
879 // ensure there's a trailing NULL so strlen will work. 885 // ensure there's a trailing NULL so strlen will work.
880 buffer[size] = '\0'; 886 buffer[size] = '\0';
881 887
diff --git a/linden/indra/newview/llgivemoney.cpp b/linden/indra/newview/llgivemoney.cpp
index d3c7598..0baf1f3 100644
--- a/linden/indra/newview/llgivemoney.cpp
+++ b/linden/indra/newview/llgivemoney.cpp
@@ -91,6 +91,7 @@ LLFloaterPay::LLFloaterPay(const std::string& name,
91 if (target_is_object) 91 if (target_is_object)
92 { 92 {
93 gUICtrlFactory->buildFloater(this,"floater_pay_object.xml"); 93 gUICtrlFactory->buildFloater(this,"floater_pay_object.xml");
94 mObjectSelection = gSelectMgr->getEditSelection();
94 } 95 }
95 else 96 else
96 { 97 {
@@ -166,13 +167,16 @@ LLFloaterPay::LLFloaterPay(const std::string& name,
166 childSetAction("cancel btn",&LLFloaterPay::onCancel,this); 167 childSetAction("cancel btn",&LLFloaterPay::onCancel,this);
167 168
168 center(); 169 center();
169 open(); 170 open(); /*Flawfinder: ignore*/
170} 171}
171 172
172// Destroys the object 173// Destroys the object
173LLFloaterPay::~LLFloaterPay() 174LLFloaterPay::~LLFloaterPay()
174{ 175{
175 std::for_each(mCallbackData.begin(), mCallbackData.end(), DeletePointer()); 176 std::for_each(mCallbackData.begin(), mCallbackData.end(), DeletePointer());
177
178 // Clean up if we are still waiting for a name.
179 gCacheName->cancelCallback(mTargetUUID,onCacheOwnerName,this);
176} 180}
177 181
178// static 182// static
@@ -314,11 +318,16 @@ void LLFloaterPay::payViaObject(money_callback callback, const LLUUID& object_id
314 LLViewerObject* object = gObjectList.findObject(object_id); 318 LLViewerObject* object = gObjectList.findObject(object_id);
315 if (!object) return; 319 if (!object) return;
316 320
317 LLSelectNode* node = gSelectMgr->getFirstRootNode();
318 if (!node) return;
319
320 LLFloaterPay *floater = new LLFloaterPay("Give Money", callback, object_id, TRUE); 321 LLFloaterPay *floater = new LLFloaterPay("Give Money", callback, object_id, TRUE);
321 if (!floater) return; 322 if (!floater) return;
323
324 LLSelectNode* node = floater->mObjectSelection->getFirstRootNode();
325 if (!node)
326 {
327 //FIXME: notify user object no longer exists
328 floater->close();
329 return;
330 }
322 331
323 LLHost target_region = object->getRegion()->getHost(); 332 LLHost target_region = object->getRegion()->getHost();
324 333
@@ -361,7 +370,7 @@ void LLFloaterPay::payDirectly(money_callback callback,
361void LLFloaterPay::finishPayUI(const LLUUID& target_id, BOOL is_group) 370void LLFloaterPay::finishPayUI(const LLUUID& target_id, BOOL is_group)
362{ 371{
363 gCacheName->get(target_id, is_group, onCacheOwnerName, (void*)this); 372 gCacheName->get(target_id, is_group, onCacheOwnerName, (void*)this);
364 373
365 // Make sure the amount field has focus 374 // Make sure the amount field has focus
366 375
367 childSetFocus("amount", TRUE); 376 childSetFocus("amount", TRUE);
@@ -402,10 +411,6 @@ void LLFloaterPay::onCancel(void* data)
402 LLFloaterPay* self = reinterpret_cast<LLFloaterPay*>(data); 411 LLFloaterPay* self = reinterpret_cast<LLFloaterPay*>(data);
403 if(self) 412 if(self)
404 { 413 {
405 if (self->mTargetIsObject)
406 {
407 gSelectMgr->deselectAll();
408 }
409 self->close(); 414 self->close();
410 } 415 }
411} 416}
@@ -460,7 +465,7 @@ void LLFloaterPay::give(S32 amount)
460 if (region) 465 if (region)
461 { 466 {
462 // Find the name of the root object 467 // Find the name of the root object
463 LLSelectNode* node = gSelectMgr->getFirstRootNode(); 468 LLSelectNode* node = mObjectSelection->getFirstRootNode();
464 LLString object_name; 469 LLString object_name;
465 if (node) 470 if (node)
466 { 471 {
@@ -469,7 +474,7 @@ void LLFloaterPay::give(S32 amount)
469 S32 tx_type = TRANS_PAY_OBJECT; 474 S32 tx_type = TRANS_PAY_OBJECT;
470 if(dest_object->isAvatar()) tx_type = TRANS_GIFT; 475 if(dest_object->isAvatar()) tx_type = TRANS_GIFT;
471 mCallback(mTargetUUID, region, amount, FALSE, tx_type, object_name); 476 mCallback(mTargetUUID, region, amount, FALSE, tx_type, object_name);
472 gSelectMgr->deselectAll(); 477 mObjectSelection = NULL;
473 } 478 }
474 } 479 }
475 } 480 }
diff --git a/linden/indra/newview/llgivemoney.h b/linden/indra/newview/llgivemoney.h
index 0edb735..cff4fb7 100644
--- a/linden/indra/newview/llgivemoney.h
+++ b/linden/indra/newview/llgivemoney.h
@@ -40,6 +40,7 @@ class LLViewerRegion;
40class LLLineEditor; 40class LLLineEditor;
41class LLTextBox; 41class LLTextBox;
42class LLButton; 42class LLButton;
43class LLObjectSelection;
43struct LLGiveMoneyInfo; 44struct LLGiveMoneyInfo;
44 45
45typedef void (*money_callback)(const LLUUID&, LLViewerRegion*,S32,BOOL,S32,const LLString&); 46typedef void (*money_callback)(const LLUUID&, LLViewerRegion*,S32,BOOL,S32,const LLString&);
@@ -85,10 +86,13 @@ protected:
85 LLUUID mTargetUUID; 86 LLUUID mTargetUUID;
86 BOOL mTargetIsObject; 87 BOOL mTargetIsObject;
87 BOOL mTargetIsGroup; 88 BOOL mTargetIsGroup;
89 BOOL mHaveName;
88 90
89 LLButton* mQuickPayButton[MAX_PAY_BUTTONS]; 91 LLButton* mQuickPayButton[MAX_PAY_BUTTONS];
90 LLGiveMoneyInfo* mQuickPayInfo[MAX_PAY_BUTTONS]; 92 LLGiveMoneyInfo* mQuickPayInfo[MAX_PAY_BUTTONS];
91 93
94 LLHandle<LLObjectSelection> mObjectSelection;
95
92 static S32 sLastAmount; 96 static S32 sLastAmount;
93}; 97};
94 98
diff --git a/linden/indra/newview/llglsandbox.cpp b/linden/indra/newview/llglsandbox.cpp
index cc4ec9d..decbdd9 100644
--- a/linden/indra/newview/llglsandbox.cpp
+++ b/linden/indra/newview/llglsandbox.cpp
@@ -181,15 +181,17 @@ void LLToolSelectRect::handleRectangleSelection(S32 x, S32 y, MASK mask)
181 F32 select_dist_squared = gSavedSettings.getF32("MaxSelectDistance"); 181 F32 select_dist_squared = gSavedSettings.getF32("MaxSelectDistance");
182 select_dist_squared = select_dist_squared * select_dist_squared; 182 select_dist_squared = select_dist_squared * select_dist_squared;
183 183
184 x = llround((F32)x * LLUI::sGLScaleFactor.mV[VX]);
185 y = llround((F32)y * LLUI::sGLScaleFactor.mV[VY]);
186
187 BOOL deselect = (mask == MASK_CONTROL); 184 BOOL deselect = (mask == MASK_CONTROL);
188 S32 left = llmin(x, mDragStartX); 185 S32 left = llmin(x, mDragStartX);
189 S32 right = llmax(x, mDragStartX); 186 S32 right = llmax(x, mDragStartX);
190 S32 top = llmax(y, mDragStartY); 187 S32 top = llmax(y, mDragStartY);
191 S32 bottom =llmin(y, mDragStartY); 188 S32 bottom =llmin(y, mDragStartY);
192 189
190 left = llround((F32) left * LLUI::sGLScaleFactor.mV[VX]);
191 right = llround((F32) right * LLUI::sGLScaleFactor.mV[VX]);
192 top = llround((F32) top * LLUI::sGLScaleFactor.mV[VY]);
193 bottom = llround((F32) bottom * LLUI::sGLScaleFactor.mV[VY]);
194
193 F32 old_far_plane = gCamera->getFar(); 195 F32 old_far_plane = gCamera->getFar();
194 F32 old_near_plane = gCamera->getNear(); 196 F32 old_near_plane = gCamera->getNear();
195 197
@@ -245,9 +247,11 @@ void LLToolSelectRect::handleRectangleSelection(S32 x, S32 y, MASK mask)
245 247
246 if (shrink_selection) 248 if (shrink_selection)
247 { 249 {
248 for (LLViewerObject* vobjp = gSelectMgr->getFirstHighlightedObject(); 250 LLObjectSelectionHandle highlighted_objects = gSelectMgr->getHighlightedObjects();
251
252 for (LLViewerObject* vobjp = highlighted_objects->getFirstObject();
249 vobjp; 253 vobjp;
250 vobjp = gSelectMgr->getNextHighlightedObject()) 254 vobjp = highlighted_objects->getNextObject())
251 { 255 {
252 LLDrawable* drawable = vobjp->mDrawable; 256 LLDrawable* drawable = vobjp->mDrawable;
253 if (!drawable || vobjp->getPCode() != LL_PCODE_VOLUME || vobjp->isAttachment()) 257 if (!drawable || vobjp->getPCode() != LL_PCODE_VOLUME || vobjp->isAttachment())
@@ -255,7 +259,7 @@ void LLToolSelectRect::handleRectangleSelection(S32 x, S32 y, MASK mask)
255 continue; 259 continue;
256 } 260 }
257 261
258 S32 result = gCamera->sphereInFrustum(drawable->getWorldPosition(), drawable->getRadius()); 262 S32 result = gCamera->sphereInFrustum(drawable->getPositionAgent(), drawable->getRadius());
259 switch (result) 263 switch (result)
260 { 264 {
261 case 0: 265 case 0:
@@ -278,11 +282,16 @@ void LLToolSelectRect::handleRectangleSelection(S32 x, S32 y, MASK mask)
278 { 282 {
279 std::vector<LLDrawable*> potentials; 283 std::vector<LLDrawable*> potentials;
280 284
281 if (gPipeline.mObjectPartition) 285
286 for (U32 i = 0; i < LLPipeline::NUM_PARTITIONS-1; i++)
282 { 287 {
283 gPipeline.mObjectPartition->cull(*gCamera, &potentials, TRUE); 288 LLSpatialPartition* part = gPipeline.getSpatialPartition(i);
289 if (part)
290 {
291 part->cull(*gCamera, &potentials, TRUE);
292 }
284 } 293 }
285 294
286 for (std::vector<LLDrawable*>::iterator iter = potentials.begin(); 295 for (std::vector<LLDrawable*>::iterator iter = potentials.begin();
287 iter != potentials.end(); iter++) 296 iter != potentials.end(); iter++)
288 { 297 {
@@ -302,7 +311,7 @@ void LLToolSelectRect::handleRectangleSelection(S32 x, S32 y, MASK mask)
302 continue; 311 continue;
303 } 312 }
304 313
305 S32 result = gCamera->sphereInFrustum(drawable->getWorldPosition(), drawable->getRadius()); 314 S32 result = gCamera->sphereInFrustum(drawable->getPositionAgent(), drawable->getRadius());
306 if (result) 315 if (result)
307 { 316 {
308 switch (result) 317 switch (result)
@@ -956,119 +965,6 @@ void LLViewerParcelMgr::renderCollisionSegments(U8* segments, BOOL use_pass, LLV
956 glEnd(); 965 glEnd();
957} 966}
958 967
959
960const S32 CLIENT_RECT_VPAD = 4;
961void LLPreviewTexture::draw()
962{
963 if( getVisible() )
964 {
965 updateAspectRatio();
966
967 LLPreview::draw();
968
969 if (!mMinimized)
970 {
971 LLGLSUIDefault gls_ui;
972 LLGLSNoTexture gls_notex;
973
974 const LLRect& border = mClientRect;
975 LLRect interior = mClientRect;
976 interior.stretch( -PREVIEW_BORDER_WIDTH );
977
978 // ...border
979 gl_rect_2d( border, LLColor4(0.f, 0.f, 0.f, 1.f));
980 gl_rect_2d_checkerboard( interior );
981
982 if ( mImage.notNull() )
983 {
984 LLGLSTexture gls_no_texture;
985 // Draw the texture
986 glColor3f( 1.f, 1.f, 1.f );
987 gl_draw_scaled_image(interior.mLeft,
988 interior.mBottom,
989 interior.getWidth(),
990 interior.getHeight(),
991 mImage);
992
993 // Pump the texture priority
994 F32 pixel_area = mLoadingFullImage ? (F32)MAX_IMAGE_AREA : (F32)(interior.getWidth() * interior.getHeight() );
995 mImage->addTextureStats( pixel_area );
996
997 // Don't bother decoding more than we can display, unless
998 // we're loading the full image.
999 if (!mLoadingFullImage)
1000 {
1001 S32 int_width = interior.getWidth();
1002 S32 int_height = interior.getHeight();
1003 mImage->setKnownDrawSize(int_width, int_height);
1004 }
1005 else
1006 {
1007 // Don't use this feature
1008 mImage->setKnownDrawSize(0, 0);
1009 }
1010
1011 if( mLoadingFullImage )
1012 {
1013 LLFontGL::sSansSerif->renderUTF8("Receiving:", 0,
1014 interior.mLeft + 4,
1015 interior.mBottom + 4,
1016 LLColor4::white, LLFontGL::LEFT, LLFontGL::BOTTOM,
1017 LLFontGL::DROP_SHADOW);
1018
1019 F32 data_progress = 0.0f;
1020 F32 decode_progress = mImage->getDecodeProgress(&data_progress);
1021
1022 // Draw the progress bar.
1023 const S32 BAR_HEIGHT = 12;
1024 const S32 BAR_LEFT_PAD = 80;
1025 S32 left = interior.mLeft + 4 + BAR_LEFT_PAD;
1026 S32 bar_width = mRect.getWidth() - left - RESIZE_HANDLE_WIDTH - 2;
1027 S32 top = interior.mBottom + 4 + BAR_HEIGHT;
1028 S32 right = left + bar_width;
1029 S32 bottom = top - BAR_HEIGHT;
1030
1031 LLColor4 background_color(0.f, 0.f, 0.f, 0.75f);
1032 LLColor4 decoded_color(0.f, 1.f, 0.f, 1.0f);
1033 LLColor4 downloaded_color(0.f, 0.5f, 0.f, 1.0f);
1034
1035 gl_rect_2d(left, top, right, bottom, background_color);
1036
1037 if (data_progress > 0.0f)
1038 {
1039 // Decoded bytes
1040 right = left + llfloor(decode_progress * (F32)bar_width);
1041
1042 if (left < right)
1043 {
1044 gl_rect_2d(left, top, right, bottom, decoded_color);
1045 }
1046
1047 // Downloaded bytes
1048 left = right;
1049 right = left + llfloor((data_progress - decode_progress) * (F32)bar_width);
1050
1051 if (left < right)
1052 {
1053 gl_rect_2d(left, top, right, bottom, downloaded_color);
1054 }
1055 }
1056 }
1057 else
1058 if( !mSavedFileTimer.hasExpired() )
1059 {
1060 LLFontGL::sSansSerif->renderUTF8("File Saved", 0,
1061 interior.mLeft + 4,
1062 interior.mBottom + 4,
1063 LLColor4::white, LLFontGL::LEFT, LLFontGL::BOTTOM,
1064 LLFontGL::DROP_SHADOW);
1065 }
1066 }
1067 }
1068 }
1069}
1070
1071
1072void draw_line_cube(F32 width, const LLVector3& center) 968void draw_line_cube(F32 width, const LLVector3& center)
1073{ 969{
1074 width = 0.5f * width; 970 width = 0.5f * width;
diff --git a/linden/indra/newview/llgroupmgr.cpp b/linden/indra/newview/llgroupmgr.cpp
index 35e1b95..d020236 100644
--- a/linden/indra/newview/llgroupmgr.cpp
+++ b/linden/indra/newview/llgroupmgr.cpp
@@ -820,8 +820,8 @@ void LLGroupMgr::processGroupMembersReply(LLMessageSystem* msg, void** data)
820 if (group_datap->mMemberCount > 0) 820 if (group_datap->mMemberCount > 0)
821 { 821 {
822 S32 contribution = 0; 822 S32 contribution = 0;
823 char online_status[DB_DATETIME_BUF_SIZE]; 823 char online_status[DB_DATETIME_BUF_SIZE]; /* Flawfinder: ignore */
824 char title[DB_GROUP_TITLE_BUF_SIZE]; 824 char title[DB_GROUP_TITLE_BUF_SIZE]; /* Flawfinder: ignore */
825 U64 agent_powers = 0; 825 U64 agent_powers = 0;
826 BOOL is_owner = FALSE; 826 BOOL is_owner = FALSE;
827 827
@@ -862,7 +862,7 @@ void LLGroupMgr::processGroupMembersReply(LLMessageSystem* msg, void** data)
862 } 862 }
863 } 863 }
864 864
865 if (group_datap->mMembers.size() == group_datap->mMemberCount) 865 if (group_datap->mMembers.size() == (U32)group_datap->mMemberCount)
866 { 866 {
867 group_datap->mMemberDataComplete = TRUE; 867 group_datap->mMemberDataComplete = TRUE;
868 group_datap->mMemberRequestID.setNull(); 868 group_datap->mMemberRequestID.setNull();
@@ -892,13 +892,13 @@ void LLGroupMgr::processGroupPropertiesReply(LLMessageSystem* msg, void** data)
892 } 892 }
893 893
894 LLUUID group_id; 894 LLUUID group_id;
895 char name[DB_GROUP_NAME_BUF_SIZE]; 895 char name[DB_GROUP_NAME_BUF_SIZE]; /* Flawfinder: ignore */
896 char charter[DB_GROUP_CHARTER_BUF_SIZE]; 896 char charter[DB_GROUP_CHARTER_BUF_SIZE]; /* Flawfinder: ignore */
897 BOOL show_in_list = FALSE; 897 BOOL show_in_list = FALSE;
898 LLUUID founder_id; 898 LLUUID founder_id;
899 U64 powers_mask = GP_NO_POWERS; 899 U64 powers_mask = GP_NO_POWERS;
900 S32 money = 0; 900 S32 money = 0;
901 char member_title[DB_GROUP_TITLE_BUF_SIZE]; 901 char member_title[DB_GROUP_TITLE_BUF_SIZE]; /* Flawfinder: ignore */
902 LLUUID insignia_id; 902 LLUUID insignia_id;
903 LLUUID owner_role; 903 LLUUID owner_role;
904 U32 membership_fee = 0; 904 U32 membership_fee = 0;
@@ -974,9 +974,9 @@ void LLGroupMgr::processGroupRoleDataReply(LLMessageSystem* msg, void** data)
974 974
975 msg->getS32(_PREHASH_GroupData, "RoleCount", group_data->mRoleCount ); 975 msg->getS32(_PREHASH_GroupData, "RoleCount", group_data->mRoleCount );
976 976
977 char name[DB_GROUP_NAME_BUF_SIZE]; 977 char name[DB_GROUP_NAME_BUF_SIZE]; /* Flawfinder: ignore */
978 char title[DB_GROUP_TITLE_BUF_SIZE]; 978 char title[DB_GROUP_TITLE_BUF_SIZE]; /* Flawfinder: ignore */
979 char desc[DB_GROUP_CHARTER_BUF_SIZE]; 979 char desc[DB_GROUP_CHARTER_BUF_SIZE]; /* Flawfinder: ignore */
980 U64 powers = 0; 980 U64 powers = 0;
981 U32 member_count = 0; 981 U32 member_count = 0;
982 LLUUID role_id; 982 LLUUID role_id;
@@ -998,7 +998,7 @@ void LLGroupMgr::processGroupRoleDataReply(LLMessageSystem* msg, void** data)
998 group_data->mRoles[role_id] = rd; 998 group_data->mRoles[role_id] = rd;
999 } 999 }
1000 1000
1001 if (group_data->mRoles.size() == group_data->mRoleCount) 1001 if (group_data->mRoles.size() == (U32)group_data->mRoleCount)
1002 { 1002 {
1003 group_data->mRoleDataComplete = TRUE; 1003 group_data->mRoleDataComplete = TRUE;
1004 group_data->mRoleDataRequestID.setNull(); 1004 group_data->mRoleDataRequestID.setNull();
@@ -1152,7 +1152,7 @@ void LLGroupMgr::processGroupTitlesReply(LLMessageSystem* msg, void** data)
1152 return; 1152 return;
1153 } 1153 }
1154 1154
1155 char title_buf[DB_GROUP_TITLE_BUF_SIZE]; 1155 char title_buf[DB_GROUP_TITLE_BUF_SIZE]; /* Flawfinder: ignore */
1156 1156
1157 LLGroupTitle title; 1157 LLGroupTitle title;
1158 1158
@@ -1241,7 +1241,7 @@ void LLGroupMgr::processCreateGroupReply(LLMessageSystem* msg, void ** data)
1241{ 1241{
1242 LLUUID group_id; 1242 LLUUID group_id;
1243 BOOL success; 1243 BOOL success;
1244 char message[MAX_STRING]; 1244 char message[MAX_STRING]; /* Flawfinder: ignore */
1245 1245
1246 msg->getUUIDFast(_PREHASH_ReplyData, _PREHASH_GroupID, group_id ); 1246 msg->getUUIDFast(_PREHASH_ReplyData, _PREHASH_GroupID, group_id );
1247 1247
diff --git a/linden/indra/newview/llgroupnotify.cpp b/linden/indra/newview/llgroupnotify.cpp
index 5d839f2..d6e5785 100644
--- a/linden/indra/newview/llgroupnotify.cpp
+++ b/linden/indra/newview/llgroupnotify.cpp
@@ -80,7 +80,7 @@ LLGroupNotifyBox* LLGroupNotifyBox::show(const char* subject,
80 LLGroupData group_data; 80 LLGroupData group_data;
81 if (!gAgent.getGroupData(group_id,group_data)) 81 if (!gAgent.getGroupData(group_id,group_data))
82 { 82 {
83 llwarns << "Group notice for unkown group : " << group_id.getString() << llendl; 83 llwarns << "Group notice for unkown group: " << group_id << llendl;
84 return NULL; 84 return NULL;
85 } 85 }
86 86
@@ -129,7 +129,7 @@ LLGroupNotifyBox::LLGroupNotifyBox(const char* subject,
129 129
130 time_t timestamp = (time_t)t; 130 time_t timestamp = (time_t)t;
131 131
132 char time_buf[30]; 132 char time_buf[30]; /*Flawfinder: ignore*/
133 g_formatted_time(timestamp, time_buf); 133 g_formatted_time(timestamp, time_buf);
134 134
135 setFollows(FOLLOWS_TOP|FOLLOWS_RIGHT); 135 setFollows(FOLLOWS_TOP|FOLLOWS_RIGHT);
@@ -401,7 +401,8 @@ void LLGroupNotifyBox::close()
401 inventory_offer_callback( 1 , mInventoryOffer); 401 inventory_offer_callback( 1 , mInventoryOffer);
402 } 402 }
403 gNotifyBoxView->removeChild(this); 403 gNotifyBoxView->removeChild(this);
404 delete this; 404
405 die();
405} 406}
406 407
407 408
diff --git a/linden/indra/newview/llhoverview.cpp b/linden/indra/newview/llhoverview.cpp
index 9c403f4..30ee2b0 100644
--- a/linden/indra/newview/llhoverview.cpp
+++ b/linden/indra/newview/llhoverview.cpp
@@ -144,7 +144,7 @@ void LLHoverView::updateHover(LLTool* current_tool)
144 else if (mStartHoverTimer.getElapsedTimeF32() > DELAY_BEFORE_SHOW_TIP) 144 else if (mStartHoverTimer.getElapsedTimeF32() > DELAY_BEFORE_SHOW_TIP)
145 { 145 {
146 gViewerWindow->hitObjectOrLandGlobalAsync(gViewerWindow->getCurrentMouseX(), 146 gViewerWindow->hitObjectOrLandGlobalAsync(gViewerWindow->getCurrentMouseX(),
147 gViewerWindow->getCurrentMouseY(), 0, pickCallback, TRUE ); 147 gViewerWindow->getCurrentMouseY(), 0, pickCallback );
148 } 148 }
149 } 149 }
150 else 150 else
@@ -214,9 +214,9 @@ void LLHoverView::resetLastHoverObject()
214 214
215void LLHoverView::updateText() 215void LLHoverView::updateText()
216{ 216{
217 char first_name[DB_FIRST_NAME_BUF_SIZE]; 217 char first_name[DB_FIRST_NAME_BUF_SIZE]; /*Flawfinder: ignore*/
218 char last_name[DB_LAST_NAME_BUF_SIZE]; 218 char last_name[DB_LAST_NAME_BUF_SIZE]; /*Flawfinder: ignore*/
219 char group_name[DB_GROUP_NAME_BUF_SIZE]; 219 char group_name[DB_GROUP_NAME_BUF_SIZE]; /*Flawfinder: ignore*/
220 220
221 LLViewerObject* hit_object = getLastHoverObject(); 221 LLViewerObject* hit_object = getLastHoverObject();
222 222
@@ -274,12 +274,10 @@ void LLHoverView::updateText()
274 // 274 //
275 BOOL suppressObjectHoverDisplay = !gSavedSettings.getBOOL("ShowAllObjectHoverTip"); 275 BOOL suppressObjectHoverDisplay = !gSavedSettings.getBOOL("ShowAllObjectHoverTip");
276 276
277 277 LLSelectNode *nodep = gSelectMgr->getHoverNode();;
278 LLSelectNodeList &nodes = gSelectMgr->getHoverObjects();
279 LLSelectNode *nodep = nodes.getFirstRootNode();
280 if (nodep) 278 if (nodep)
281 { 279 {
282 char cstring[256]; 280 char cstring[256]; /*Flawfinder: ignore*/
283 LLString *temp_str = NULL; 281 LLString *temp_str = NULL;
284 282
285 temp_str = new LLString(); 283 temp_str = new LLString();
@@ -426,7 +424,7 @@ void LLHoverView::updateText()
426 { 424 {
427 temp_str = new LLString(); 425 temp_str = new LLString();
428 temp_str->append("For Sale: "); 426 temp_str->append("For Sale: ");
429 sprintf(cstring, "L$%d", nodep->mSaleInfo.getSalePrice()); 427 snprintf(cstring, sizeof(cstring), "L$%d", nodep->mSaleInfo.getSalePrice()); /*Flawfinder: ignore*/
430 temp_str->append(cstring); 428 temp_str->append(cstring);
431 mText.addDataAtEnd(temp_str); 429 mText.addDataAtEnd(temp_str);
432 suppressObjectHoverDisplay = FALSE; // Show tip 430 suppressObjectHoverDisplay = FALSE; // Show tip
@@ -616,8 +614,8 @@ void LLHoverView::updateText()
616 */ 614 */
617 if (hover_parcel && hover_parcel->getParcelFlag(PF_FOR_SALE)) 615 if (hover_parcel && hover_parcel->getParcelFlag(PF_FOR_SALE))
618 { 616 {
619 char buffer[MAX_STRING]; 617 char buffer[MAX_STRING]; /*Flawfinder: ignore*/
620 sprintf(buffer, "For Sale: L$%d", hover_parcel->getSalePrice() ); 618 snprintf(buffer, sizeof(buffer), "For Sale: L$%d", hover_parcel->getSalePrice() ); /*Flawfinder: ignore*/
621 619
622 line = new LLString(buffer); 620 line = new LLString(buffer);
623 mText.addDataAtEnd(line); 621 mText.addDataAtEnd(line);
diff --git a/linden/indra/newview/llhoverview.h b/linden/indra/newview/llhoverview.h
index 1fd1a2e..e7fdd6a 100644
--- a/linden/indra/newview/llhoverview.h
+++ b/linden/indra/newview/llhoverview.h
@@ -40,7 +40,6 @@
40#include "lldarray.h" 40#include "lldarray.h"
41#include "llhudconnector.h" 41#include "llhudconnector.h"
42 42
43class LLSelectNodeList;
44class LLTool; 43class LLTool;
45 44
46// 45//
diff --git a/linden/indra/newview/llhudeffecttrail.cpp b/linden/indra/newview/llhudeffecttrail.cpp
index ac7f22f..cf76357 100644
--- a/linden/indra/newview/llhudeffecttrail.cpp
+++ b/linden/indra/newview/llhudeffecttrail.cpp
@@ -175,7 +175,7 @@ void LLHUDEffectSpiral::triggerLocal()
175 mKillTime = mTimer.getElapsedTimeF32() + mDuration; 175 mKillTime = mTimer.getElapsedTimeF32() + mDuration;
176 176
177 BOOL show_beam = gSavedSettings.getBOOL("ShowSelectionBeam"); 177 BOOL show_beam = gSavedSettings.getBOOL("ShowSelectionBeam");
178 178
179 LLColor4 color; 179 LLColor4 color;
180 color.setVec(mColor); 180 color.setVec(mColor);
181 181
@@ -269,20 +269,12 @@ void LLHUDEffectSpiral::setTargetObject(LLViewerObject *objp)
269 269
270void LLHUDEffectSpiral::render() 270void LLHUDEffectSpiral::render()
271{ 271{
272 if (!mSourceObject.isNull() && mSourceObject->isDead())
273 {
274 markDead();
275 return;
276 }
277
278 if(!mTargetObject.isNull() && mTargetObject->isDead())
279 {
280 markDead();
281 return;
282 }
283
284 F32 time = mTimer.getElapsedTimeF32(); 272 F32 time = mTimer.getElapsedTimeF32();
285 if (mKillTime < time) 273
274 if (!mSourceObject.isNull() && mSourceObject->isDead() ||
275 !mTargetObject.isNull() && mTargetObject->isDead() ||
276 mKillTime < time ||
277 !gSavedSettings.getBOOL("ShowSelectionBeam"))
286 { 278 {
287 markDead(); 279 markDead();
288 return; 280 return;
diff --git a/linden/indra/newview/llhudicon.cpp b/linden/indra/newview/llhudicon.cpp
index 169a12b..d0d2ea5 100644
--- a/linden/indra/newview/llhudicon.cpp
+++ b/linden/indra/newview/llhudicon.cpp
@@ -34,6 +34,7 @@
34#include "llviewerobject.h" 34#include "llviewerobject.h"
35#include "lldrawable.h" 35#include "lldrawable.h"
36#include "llviewercamera.h" 36#include "llviewercamera.h"
37#include "llviewerimage.h"
37#include "llviewerwindow.h" 38#include "llviewerwindow.h"
38 39
39//----------------------------------------------------------------------------- 40//-----------------------------------------------------------------------------
diff --git a/linden/indra/newview/llhudobject.cpp b/linden/indra/newview/llhudobject.cpp
index eece86f..4aef468 100644
--- a/linden/indra/newview/llhudobject.cpp
+++ b/linden/indra/newview/llhudobject.cpp
@@ -167,7 +167,7 @@ LLHUDObject *LLHUDObject::addHUDObject(const U8 type)
167 ((LLHUDEffectSpiral *)hud_objectp)->setColor(LLColor4U(255, 255, 255, 255)); 167 ((LLHUDEffectSpiral *)hud_objectp)->setColor(LLColor4U(255, 255, 255, 255));
168 break; 168 break;
169 case LL_HUD_EFFECT_GLOW: 169 case LL_HUD_EFFECT_GLOW:
170 llerrs << "Glow not implemented!" << llendl; 170 // deprecated
171 break; 171 break;
172 case LL_HUD_EFFECT_POINT: 172 case LL_HUD_EFFECT_POINT:
173 hud_objectp = new LLHUDEffectSpiral(type); 173 hud_objectp = new LLHUDEffectSpiral(type);
diff --git a/linden/indra/newview/llimpanel.cpp b/linden/indra/newview/llimpanel.cpp
index 317283c..088d601 100644
--- a/linden/indra/newview/llimpanel.cpp
+++ b/linden/indra/newview/llimpanel.cpp
@@ -263,7 +263,7 @@ BOOL LLFloaterIMPanel::addParticipants(const LLDynamicArray<LLUUID>& ids)
263 U8* pos = bucket; 263 U8* pos = bucket;
264 for(S32 i = 0; i < count; ++i) 264 for(S32 i = 0; i < count; ++i)
265 { 265 {
266 memcpy(pos, &(ids.get(i)), UUID_BYTES); 266 memcpy(pos, &(ids.get(i)), UUID_BYTES); /* Flawfinder: ignore */
267 pos += UUID_BYTES; 267 pos += UUID_BYTES;
268 } 268 }
269 msg->addBinaryDataFast(_PREHASH_BinaryBucket, bucket, bucket_size); 269 msg->addBinaryDataFast(_PREHASH_BinaryBucket, bucket, bucket_size);
@@ -611,7 +611,7 @@ void LLFloaterIMPanel::onInputEditorKeystroke(LLLineEditor* caller, void* userda
611 } 611 }
612} 612}
613 613
614void LLFloaterIMPanel::close(bool app_quitting) 614void LLFloaterIMPanel::onClose(bool app_quitting)
615{ 615{
616 setTyping(FALSE); 616 setTyping(FALSE);
617 617
@@ -685,8 +685,9 @@ void LLFloaterIMPanel::sendMsg()
685 gAgent.buildFullname(history_echo); 685 gAgent.buildFullname(history_echo);
686 686
687 // Look for IRC-style emotes here. 687 // Look for IRC-style emotes here.
688 char tmpstr[5]; 688 char tmpstr[5]; /* Flawfinder: ignore */
689 strcpy(tmpstr,utf8_text.substr(0,4).c_str()); 689 strncpy(tmpstr,utf8_text.substr(0,4).c_str(), sizeof(tmpstr) -1); /* Flawfinder: ignore */
690 tmpstr[sizeof(tmpstr) -1] = '\0';
690 if (!strncmp(tmpstr, "/me ", 4) || !strncmp(tmpstr, "/me'", 4)) 691 if (!strncmp(tmpstr, "/me ", 4) || !strncmp(tmpstr, "/me'", 4))
691 { 692 {
692 utf8_text.replace(0,3,""); 693 utf8_text.replace(0,3,"");
diff --git a/linden/indra/newview/llimpanel.h b/linden/indra/newview/llimpanel.h
index 08a35cd..877fd88 100644
--- a/linden/indra/newview/llimpanel.h
+++ b/linden/indra/newview/llimpanel.h
@@ -56,7 +56,7 @@ public:
56 // Check typing timeout timer. 56 // Check typing timeout timer.
57 /*virtual*/ void draw(); 57 /*virtual*/ void draw();
58 58
59 /*virtual*/ void close(bool app_quitting = FALSE); 59 /*virtual*/ void onClose(bool app_quitting = FALSE);
60 60
61 // add target ids to the session. 61 // add target ids to the session.
62 // Return TRUE if successful, otherwise FALSE. 62 // Return TRUE if successful, otherwise FALSE.
diff --git a/linden/indra/newview/llimview.cpp b/linden/indra/newview/llimview.cpp
index e2d33fd..a4fd729 100644
--- a/linden/indra/newview/llimview.cpp
+++ b/linden/indra/newview/llimview.cpp
@@ -558,7 +558,7 @@ void LLIMView::setFloaterOpen(BOOL set_open)
558 //RN "visible" and "open" are considered synonomous for now 558 //RN "visible" and "open" are considered synonomous for now
559 if (set_open) 559 if (set_open)
560 { 560 {
561 mTalkFloater->open(); 561 mTalkFloater->open(); /*Flawfinder: ignore*/
562 } 562 }
563 else 563 else
564 { 564 {
@@ -701,8 +701,8 @@ void LLIMView::noteOfflineUsers(LLFloaterIMPanel* floater,
701 for(S32 i = 0; i < count; ++i) 701 for(S32 i = 0; i < count; ++i)
702 { 702 {
703 info = at.getBuddyInfo(ids.get(i)); 703 info = at.getBuddyInfo(ids.get(i));
704 char first[DB_FIRST_NAME_BUF_SIZE]; 704 char first[DB_FIRST_NAME_BUF_SIZE]; /*Flawfinder: ignore*/
705 char last[DB_LAST_NAME_BUF_SIZE]; 705 char last[DB_LAST_NAME_BUF_SIZE]; /*Flawfinder: ignore*/
706 if(info && !info->isOnline() 706 if(info && !info->isOnline()
707 && gCacheName->getName(ids.get(i), first, last)) 707 && gCacheName->getName(ids.get(i), first, last))
708 { 708 {
diff --git a/linden/indra/newview/llimview.h b/linden/indra/newview/llimview.h
index 00b052f..9a0c462 100644
--- a/linden/indra/newview/llimview.h
+++ b/linden/indra/newview/llimview.h
@@ -97,7 +97,7 @@ public:
97 // IM received that you haven't seen yet 97 // IM received that you haven't seen yet
98 BOOL getIMReceived() const; 98 BOOL getIMReceived() const;
99 99
100 void setFloaterOpen(BOOL open); 100 void setFloaterOpen(BOOL open); /*Flawfinder: ignore*/
101 BOOL getFloaterOpen(); 101 BOOL getFloaterOpen();
102 102
103 LLFloaterIM * getFloater() { return mTalkFloater; } 103 LLFloaterIM * getFloater() { return mTalkFloater; }
diff --git a/linden/indra/newview/llinventoryactions.cpp b/linden/indra/newview/llinventoryactions.cpp
index a10ccdf..756ba63 100644
--- a/linden/indra/newview/llinventoryactions.cpp
+++ b/linden/indra/newview/llinventoryactions.cpp
@@ -110,7 +110,7 @@ bool doToSelected(LLFolderView* folder, LLString action)
110 LLMultiPreview* multi_previewp = NULL; 110 LLMultiPreview* multi_previewp = NULL;
111 LLMultiProperties* multi_propertiesp = NULL; 111 LLMultiProperties* multi_propertiesp = NULL;
112 112
113 if ("open" == action && selected_items.size() > 1) 113 if (("task_open" == action || "open" == action) && selected_items.size() > 1)
114 { 114 {
115 S32 left, top; 115 S32 left, top;
116 gFloaterView->getNewFloaterPosition(&left, &top); 116 gFloaterView->getNewFloaterPosition(&left, &top);
@@ -121,7 +121,7 @@ bool doToSelected(LLFolderView* folder, LLString action)
121 LLFloater::setFloaterHost(multi_previewp); 121 LLFloater::setFloaterHost(multi_previewp);
122 122
123 } 123 }
124 else if ("properties" == action && selected_items.size() > 1) 124 else if (("task_properties" == action || "properties" == action) && selected_items.size() > 1)
125 { 125 {
126 S32 left, top; 126 S32 left, top;
127 gFloaterView->getNewFloaterPosition(&left, &top); 127 gFloaterView->getNewFloaterPosition(&left, &top);
@@ -145,13 +145,13 @@ bool doToSelected(LLFolderView* folder, LLString action)
145 } 145 }
146 146
147 LLFloater::setFloaterHost(NULL); 147 LLFloater::setFloaterHost(NULL);
148 if ("open" == action && selected_items.size() > 1) 148 if (multi_previewp)
149 { 149 {
150 multi_previewp->open(); 150 multi_previewp->open();
151 } 151 }
152 else if ("properties" == action && selected_items.size() > 1) 152 else if (multi_propertiesp)
153 { 153 {
154 multi_propertiesp->open(); 154 multi_propertiesp->open(); /*Flawfinder: ignore*/
155 } 155 }
156 156
157 return true; 157 return true;
@@ -209,7 +209,7 @@ class LLNewWindow : public inventory_listener_t
209 mPtr->getActivePanel()->getModel()); 209 mPtr->getActivePanel()->getModel());
210 iv->getActivePanel()->setFilterTypes(mPtr->getActivePanel()->getFilterTypes()); 210 iv->getActivePanel()->setFilterTypes(mPtr->getActivePanel()->getFilterTypes());
211 iv->getActivePanel()->setFilterSubString(mPtr->getActivePanel()->getFilterSubString()); 211 iv->getActivePanel()->setFilterSubString(mPtr->getActivePanel()->getFilterSubString());
212 iv->open(); 212 iv->open(); /*Flawfinder: ignore*/
213 213
214 // force onscreen 214 // force onscreen
215 gFloaterView->adjustToFitScreen(iv, FALSE); 215 gFloaterView->adjustToFitScreen(iv, FALSE);
@@ -283,6 +283,29 @@ class LLEmptyTrash : public inventory_panel_listener_t
283 } 283 }
284}; 284};
285 285
286class LLEmptyLostAndFound : public inventory_panel_listener_t
287{
288 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
289 {
290 LLInventoryModel* model = mPtr->getModel();
291 if(!model) return false;
292 gViewerWindow->alertXml("ConfirmEmptyLostAndFound", callback_empty_lost_and_found, this);
293 return true;
294 }
295
296 static void callback_empty_lost_and_found(S32 option, void* userdata)
297 {
298 LLEmptyLostAndFound* empty_lost_and_found = (LLEmptyLostAndFound*)userdata;
299 if (option == 0) // YES
300 {
301 LLInventoryModel* model = empty_lost_and_found->mPtr->getModel();
302 LLUUID lost_and_found_id = model->findCategoryUUIDForType(LLAssetType::AT_LOST_AND_FOUND);
303 model->purgeDescendentsOf(lost_and_found_id);
304 model->notifyObservers();
305 }
306 }
307};
308
286class LLEmptyTrashFloater : public inventory_listener_t 309class LLEmptyTrashFloater : public inventory_listener_t
287{ 310{
288 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) 311 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
@@ -635,6 +658,7 @@ void init_inventory_panel_actions(LLInventoryPanel *panel)
635 (new LLAttachObject())->registerListener(panel, "Inventory.AttachObject"); 658 (new LLAttachObject())->registerListener(panel, "Inventory.AttachObject");
636 (new LLCloseAllFolders())->registerListener(panel, "Inventory.CloseAllFolders"); 659 (new LLCloseAllFolders())->registerListener(panel, "Inventory.CloseAllFolders");
637 (new LLEmptyTrash())->registerListener(panel, "Inventory.EmptyTrash"); 660 (new LLEmptyTrash())->registerListener(panel, "Inventory.EmptyTrash");
661 (new LLEmptyLostAndFound())->registerListener(panel, "Inventory.EmptyLostAndFound");
638 (new LLDoCreate())->registerListener(panel, "Inventory.DoCreate"); 662 (new LLDoCreate())->registerListener(panel, "Inventory.DoCreate");
639 (new LLBeginIMSession())->registerListener(panel, "Inventory.BeginIMSession"); 663 (new LLBeginIMSession())->registerListener(panel, "Inventory.BeginIMSession");
640} 664}
diff --git a/linden/indra/newview/llinventorybridge.cpp b/linden/indra/newview/llinventorybridge.cpp
index a7628d7..baf6638 100644
--- a/linden/indra/newview/llinventorybridge.cpp
+++ b/linden/indra/newview/llinventorybridge.cpp
@@ -346,6 +346,14 @@ void hideContextEntries(LLMenuGL& menu,
346 for (itor = list->begin(); itor != list->end(); ++itor) 346 for (itor = list->begin(); itor != list->end(); ++itor)
347 { 347 {
348 LLString name = (*itor)->getName(); 348 LLString name = (*itor)->getName();
349
350 // descend into split menus:
351 if ((name == "More") && (WIDGET_TYPE_MENU_ITEM_BRANCH == (*itor)->getWidgetType()))
352 {
353 hideContextEntries(*((LLMenuItemBranchGL *)(*itor))->getBranch(), entries_to_show, disabled_entries);
354 }
355
356
349 bool found = false; 357 bool found = false;
350 std::vector<LLString>::const_iterator itor2; 358 std::vector<LLString>::const_iterator itor2;
351 for (itor2 = entries_to_show.begin(); itor2 != entries_to_show.end(); ++itor2) 359 for (itor2 = entries_to_show.begin(); itor2 != entries_to_show.end(); ++itor2)
@@ -709,7 +717,7 @@ void LLItemBridge::performAction(LLFolderView* folder, LLInventoryModel* model,
709 LLInventoryItem* item = model->getItem(mUUID); 717 LLInventoryItem* item = model->getItem(mUUID);
710 if(!item) return; 718 if(!item) return;
711 LLUUID asset_id = item->getAssetUUID(); 719 LLUUID asset_id = item->getAssetUUID();
712 char buffer[UUID_STR_LENGTH]; 720 char buffer[UUID_STR_LENGTH]; /*Flawfinder: ignore*/
713 asset_id.toString(buffer); 721 asset_id.toString(buffer);
714 722
715 gViewerWindow->mWindow->copyTextToClipboard(utf8str_to_wstring(buffer)); 723 gViewerWindow->mWindow->copyTextToClipboard(utf8str_to_wstring(buffer));
@@ -828,8 +836,8 @@ LLString LLItemBridge::getLabelSuffix() const
828 const char* sxfer; 836 const char* sxfer;
829 if(xfer) sxfer = EMPTY; 837 if(xfer) sxfer = EMPTY;
830 else sxfer = NO_XFER; 838 else sxfer = NO_XFER;
831 char buffer[MAX_STRING]; 839 char buffer[MAX_STRING]; /*Flawfinder: ignore*/
832 snprintf( 840 snprintf( /*Flawfinder: ignore*/
833 buffer, 841 buffer,
834 MAX_STRING, 842 MAX_STRING,
835 "%s%s%s", 843 "%s%s%s",
@@ -1777,6 +1785,14 @@ void LLFolderBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
1777 LLInventoryModel* model = mInventoryPanel->getModel(); 1785 LLInventoryModel* model = mInventoryPanel->getModel();
1778 if(!model) return; 1786 if(!model) return;
1779 LLUUID trash_id = model->findCategoryUUIDForType(LLAssetType::AT_TRASH); 1787 LLUUID trash_id = model->findCategoryUUIDForType(LLAssetType::AT_TRASH);
1788 LLUUID lost_and_found_id = model->findCategoryUUIDForType(LLAssetType::AT_LOST_AND_FOUND);
1789
1790 if (lost_and_found_id == mUUID)
1791 {
1792 // This is the lost+found folder.
1793 mItems.push_back("Empty Lost And Found");
1794 }
1795
1780 if(trash_id == mUUID) 1796 if(trash_id == mUUID)
1781 { 1797 {
1782 // This is the trash. 1798 // This is the trash.
@@ -2177,6 +2193,8 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item,
2177 case LLAssetType::AT_CATEGORY: 2193 case LLAssetType::AT_CATEGORY:
2178 is_movable = ( LLAssetType::AT_NONE == ((LLInventoryCategory*)inv_item)->getPreferredType() ); 2194 is_movable = ( LLAssetType::AT_NONE == ((LLInventoryCategory*)inv_item)->getPreferredType() );
2179 break; 2195 break;
2196 default:
2197 break;
2180 } 2198 }
2181 2199
2182 LLUUID trash_id = model->findCategoryUUIDForType(LLAssetType::AT_TRASH); 2200 LLUUID trash_id = model->findCategoryUUIDForType(LLAssetType::AT_TRASH);
@@ -2193,6 +2211,8 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item,
2193 case LLAssetType::AT_OBJECT: 2211 case LLAssetType::AT_OBJECT:
2194 is_movable = !avatar->isWearingAttachment(inv_item->getUUID()); 2212 is_movable = !avatar->isWearingAttachment(inv_item->getUUID());
2195 break; 2213 break;
2214 default:
2215 break;
2196 } 2216 }
2197 } 2217 }
2198 2218
@@ -2762,6 +2782,8 @@ BOOL LLCallingCardBridge::dragOrDrop(MASK mask, BOOL drop,
2762 } 2782 }
2763 break; 2783 break;
2764 } 2784 }
2785 default:
2786 break;
2765 } 2787 }
2766 } 2788 }
2767 return rv; 2789 return rv;
@@ -3190,7 +3212,7 @@ void rez_attachment(LLViewerInventoryItem* item, LLViewerJointAttachment* attach
3190 rez_action->mItemID = item->getUUID(); 3212 rez_action->mItemID = item->getUUID();
3191 rez_action->mAttachPt = gAgent.getAvatarObject()->mAttachmentPoints.reverseLookup(attachment); 3213 rez_action->mAttachPt = gAgent.getAvatarObject()->mAttachmentPoints.reverseLookup(attachment);
3192 3214
3193 if (attachment && attachment->getObject(0)) 3215 if (attachment && attachment->getObject())
3194 { 3216 {
3195 gViewerWindow->alertXml("ReplaceAttachment", confirm_replace_attachment_rez, (void*)rez_action); 3217 gViewerWindow->alertXml("ReplaceAttachment", confirm_replace_attachment_rez, (void*)rez_action);
3196 } 3218 }
@@ -3336,7 +3358,7 @@ BOOL LLObjectBridge::renameItem(const LLString& new_name)
3336 { 3358 {
3337 gSelectMgr->deselectAll(); 3359 gSelectMgr->deselectAll();
3338 gSelectMgr->addAsIndividual( obj, SELECT_ALL_TES, FALSE ); 3360 gSelectMgr->addAsIndividual( obj, SELECT_ALL_TES, FALSE );
3339 gSelectMgr->setObjectName( new_name ); 3361 gSelectMgr->selectionSetObjectName( new_name );
3340 gSelectMgr->deselectAll(); 3362 gSelectMgr->deselectAll();
3341 } 3363 }
3342 } 3364 }
@@ -3410,8 +3432,8 @@ struct LLFoundData
3410 LLAssetType::EType asset_type) : 3432 LLAssetType::EType asset_type) :
3411 mItemID(item_id), 3433 mItemID(item_id),
3412 mAssetID(asset_id), 3434 mAssetID(asset_id),
3413 mAssetType(asset_type),
3414 mName(name), 3435 mName(name),
3436 mAssetType(asset_type),
3415 mWearable( NULL ) {} 3437 mWearable( NULL ) {}
3416 3438
3417 LLUUID mItemID; 3439 LLUUID mItemID;
diff --git a/linden/indra/newview/llinventorymodel.cpp b/linden/indra/newview/llinventorymodel.cpp
index 7864aa8..e35f71b 100644
--- a/linden/indra/newview/llinventorymodel.cpp
+++ b/linden/indra/newview/llinventorymodel.cpp
@@ -47,6 +47,7 @@
47#include "llmutelist.h" 47#include "llmutelist.h"
48#include "llnotify.h" 48#include "llnotify.h"
49#include "llcallbacklist.h" 49#include "llcallbacklist.h"
50#include "llpreview.h"
50#include <deque> 51#include <deque>
51 52
52//#define DIFF_INVENTORY_FILES 53//#define DIFF_INVENTORY_FILES
@@ -1150,11 +1151,11 @@ void LLInventoryModel::cache(
1150 items, 1151 items,
1151 INCLUDE_TRASH, 1152 INCLUDE_TRASH,
1152 can_cache); 1153 can_cache);
1153 char agent_id_str[UUID_STR_LENGTH]; 1154 char agent_id_str[UUID_STR_LENGTH]; /*Flawfinder: ignore*/
1154 char inventory_filename[LL_MAX_PATH]; 1155 char inventory_filename[LL_MAX_PATH]; /*Flawfinder: ignore*/
1155 agent_id.toString(agent_id_str); 1156 agent_id.toString(agent_id_str);
1156 std::string path(gDirUtilp->getExpandedFilename(LL_PATH_CACHE, agent_id_str)); 1157 std::string path(gDirUtilp->getExpandedFilename(LL_PATH_CACHE, agent_id_str));
1157 snprintf( 1158 snprintf( /*Flawfinder: ignore*/
1158 inventory_filename, 1159 inventory_filename,
1159 LL_MAX_PATH, 1160 LL_MAX_PATH,
1160 CACHE_FORMAT_STRING, 1161 CACHE_FORMAT_STRING,
@@ -1439,11 +1440,11 @@ bool LLInventoryModel::loadSkeleton(
1439 { 1440 {
1440 cat_array_t categories; 1441 cat_array_t categories;
1441 item_array_t items; 1442 item_array_t items;
1442 char owner_id_str[UUID_STR_LENGTH]; 1443 char owner_id_str[UUID_STR_LENGTH]; /*Flawfinder: ignore*/
1443 owner_id.toString(owner_id_str); 1444 owner_id.toString(owner_id_str);
1444 std::string path(gDirUtilp->getExpandedFilename(LL_PATH_CACHE, owner_id_str)); 1445 std::string path(gDirUtilp->getExpandedFilename(LL_PATH_CACHE, owner_id_str));
1445 char inventory_filename[LL_MAX_PATH]; 1446 char inventory_filename[LL_MAX_PATH]; /*Flawfinder: ignore*/
1446 snprintf( 1447 snprintf( /*Flawfinder: ignore*/
1447 inventory_filename, 1448 inventory_filename,
1448 LL_MAX_PATH, 1449 LL_MAX_PATH,
1449 CACHE_FORMAT_STRING, 1450 CACHE_FORMAT_STRING,
@@ -1451,7 +1452,7 @@ bool LLInventoryModel::loadSkeleton(
1451 const S32 NO_VERSION = LLViewerInventoryCategory::VERSION_UNKNOWN; 1452 const S32 NO_VERSION = LLViewerInventoryCategory::VERSION_UNKNOWN;
1452 std::string gzip_filename(inventory_filename); 1453 std::string gzip_filename(inventory_filename);
1453 gzip_filename.append(".gz"); 1454 gzip_filename.append(".gz");
1454 FILE* fp = LLFile::fopen(gzip_filename.c_str(), "rb"); 1455 FILE* fp = LLFile::fopen(gzip_filename.c_str(), "rb"); /*Flawfinder: ignore*/
1455 bool remove_inventory_file = false; 1456 bool remove_inventory_file = false;
1456 if(fp) 1457 if(fp)
1457 { 1458 {
@@ -1959,19 +1960,24 @@ bool LLInventoryModel::loadFromFile(
1959 LLInventoryModel::cat_array_t& categories, 1960 LLInventoryModel::cat_array_t& categories,
1960 LLInventoryModel::item_array_t& items) 1961 LLInventoryModel::item_array_t& items)
1961{ 1962{
1963 if(!filename)
1964 {
1965 llerrs << "Filename is Null!" << llendl;
1966 return false;
1967 }
1962 llinfos << "LLInventoryModel::loadFromFile(" << filename << ")" << llendl; 1968 llinfos << "LLInventoryModel::loadFromFile(" << filename << ")" << llendl;
1963 FILE* file = LLFile::fopen(filename, "rb"); 1969 FILE* file = LLFile::fopen(filename, "rb"); /*Flawfinder: ignore*/
1964 if(!file) 1970 if(!file)
1965 { 1971 {
1966 llinfos << "unable to load inventory from: " << filename << llendl; 1972 llinfos << "unable to load inventory from: " << filename << llendl;
1967 return false; 1973 return false;
1968 } 1974 }
1969 // *NOTE: This buffer size is hard coded into scanf() below. 1975 // *NOTE: This buffer size is hard coded into scanf() below.
1970 char buffer[MAX_STRING]; 1976 char buffer[MAX_STRING]; /*Flawfinder: ignore*/
1971 char keyword[MAX_STRING]; 1977 char keyword[MAX_STRING]; /*Flawfinder: ignore*/
1972 while(!feof(file) && fgets(buffer, MAX_STRING, file)) 1978 while(!feof(file) && fgets(buffer, MAX_STRING, file))
1973 { 1979 {
1974 sscanf(buffer, " %254s", keyword); 1980 sscanf(buffer, " %254s", keyword); /* Flawfinder: ignore */
1975 if(0 == strcmp("inv_category", keyword)) 1981 if(0 == strcmp("inv_category", keyword))
1976 { 1982 {
1977 LLPointer<LLViewerInventoryCategory> inv_cat = new LLViewerInventoryCategory(LLUUID::null); 1983 LLPointer<LLViewerInventoryCategory> inv_cat = new LLViewerInventoryCategory(LLUUID::null);
@@ -2027,8 +2033,13 @@ bool LLInventoryModel::saveToFile(
2027 const cat_array_t& categories, 2033 const cat_array_t& categories,
2028 const item_array_t& items) 2034 const item_array_t& items)
2029{ 2035{
2036 if(!filename)
2037 {
2038 llerrs << "Filename is Null!" << llendl;
2039 return false;
2040 }
2030 llinfos << "LLInventoryModel::saveToFile(" << filename << ")" << llendl; 2041 llinfos << "LLInventoryModel::saveToFile(" << filename << ")" << llendl;
2031 FILE* file = LLFile::fopen(filename, "wb"); 2042 FILE* file = LLFile::fopen(filename, "wb"); /*Flawfinder: ignore*/
2032 if(!file) 2043 if(!file)
2033 { 2044 {
2034 llwarns << "unable to save inventory to: " << filename << llendl; 2045 llwarns << "unable to save inventory to: " << filename << llendl;
@@ -2304,6 +2315,8 @@ bool LLInventoryModel::messageUpdateCore(LLMessageSystem* msg, bool account, boo
2304 item_array_t items; 2315 item_array_t items;
2305 update_map_t update; 2316 update_map_t update;
2306 S32 count = msg->getNumberOfBlocksFast(_PREHASH_InventoryData); 2317 S32 count = msg->getNumberOfBlocksFast(_PREHASH_InventoryData);
2318 bool all_one_folder = true;
2319 LLUUID folder_id;
2307 for(S32 i = 0; i < count; ++i) 2320 for(S32 i = 0; i < count; ++i)
2308 { 2321 {
2309 LLPointer<LLViewerInventoryItem> titem = new LLViewerInventoryItem; 2322 LLPointer<LLViewerInventoryItem> titem = new LLViewerInventoryItem;
@@ -2330,6 +2343,14 @@ bool LLInventoryModel::messageUpdateCore(LLMessageSystem* msg, bool account, boo
2330 { 2343 {
2331 ++update[titem->getParentUUID()]; 2344 ++update[titem->getParentUUID()];
2332 } 2345 }
2346 if (folder_id.isNull())
2347 {
2348 folder_id = titem->getParentUUID();
2349 }
2350 else
2351 {
2352 all_one_folder = false;
2353 }
2333 } 2354 }
2334 if(account) 2355 if(account)
2335 { 2356 {
@@ -2353,6 +2374,18 @@ bool LLInventoryModel::messageUpdateCore(LLMessageSystem* msg, bool account, boo
2353 trash_id = gInventory.findCategoryUUIDForType(LLAssetType::AT_TRASH); 2374 trash_id = gInventory.findCategoryUUIDForType(LLAssetType::AT_TRASH);
2354 if(!gInventory.isObjectDescendentOf(lastitem->getUUID(), trash_id)) 2375 if(!gInventory.isObjectDescendentOf(lastitem->getUUID(), trash_id))
2355 { 2376 {
2377 LLMultiPreview* multi_previewp = LLMultiPreview::getAutoOpenInstance(folder_id);
2378 if (!multi_previewp && all_one_folder && count > 1)
2379 {
2380 S32 left, top;
2381 gFloaterView->getNewFloaterPosition(&left, &top);
2382
2383 multi_previewp = new LLMultiPreview(LLRect(left, top, left + 300, top - 100));
2384 LLMultiPreview::setAutoOpenInstance(multi_previewp, folder_id);
2385 }
2386
2387 LLFloater::setFloaterHost(multi_previewp);
2388
2356 bool show_keep_discard = lastitem->getPermissions().getCreator() != gAgent.getID(); 2389 bool show_keep_discard = lastitem->getPermissions().getCreator() != gAgent.getID();
2357 switch(lastitem->getType()) 2390 switch(lastitem->getType())
2358 { 2391 {
@@ -2383,6 +2416,13 @@ bool LLInventoryModel::messageUpdateCore(LLMessageSystem* msg, bool account, boo
2383 default: 2416 default:
2384 break; 2417 break;
2385 } 2418 }
2419
2420 LLFloater::setFloaterHost(NULL);
2421 if (multi_previewp)
2422 {
2423 multi_previewp->open();
2424 }
2425
2386 LLInventoryView* view = LLInventoryView::getActiveInventory(); 2426 LLInventoryView* view = LLInventoryView::getActiveInventory();
2387 if(view) 2427 if(view)
2388 { 2428 {
@@ -2814,7 +2854,7 @@ void LLInventoryModel::processMoveInventoryItem(LLMessageSystem* msg, void**)
2814 2854
2815 LLUUID item_id; 2855 LLUUID item_id;
2816 LLUUID folder_id; 2856 LLUUID folder_id;
2817 char new_name[MAX_STRING]; 2857 char new_name[MAX_STRING]; /*Flawfinder: ignore*/
2818 bool anything_changed = false; 2858 bool anything_changed = false;
2819 S32 count = msg->getNumberOfBlocksFast(_PREHASH_InventoryData); 2859 S32 count = msg->getNumberOfBlocksFast(_PREHASH_InventoryData);
2820 for(S32 i = 0; i < count; ++i) 2860 for(S32 i = 0; i < count; ++i)
@@ -2837,7 +2877,7 @@ void LLInventoryModel::processMoveInventoryItem(LLMessageSystem* msg, void**)
2837 gInventory.accountForUpdate(update); 2877 gInventory.accountForUpdate(update);
2838 2878
2839 new_item->setParent(folder_id); 2879 new_item->setParent(folder_id);
2840 if(strlen(new_name) > 0) 2880 if(strlen(new_name) > 0) /*Flawfinder: ignore*/
2841 { 2881 {
2842 new_item->rename(new_name); 2882 new_item->rename(new_name);
2843 } 2883 }
diff --git a/linden/indra/newview/llinventoryview.cpp b/linden/indra/newview/llinventoryview.cpp
index 9eb33ee..afeb3be 100644
--- a/linden/indra/newview/llinventoryview.cpp
+++ b/linden/indra/newview/llinventoryview.cpp
@@ -373,19 +373,15 @@ void LLInventoryViewFinder::selectNoTypes(void* user_data)
373///---------------------------------------------------------------------------- 373///----------------------------------------------------------------------------
374/// LLInventoryView 374/// LLInventoryView
375///---------------------------------------------------------------------------- 375///----------------------------------------------------------------------------
376class LLSaveFolderState : public LLFolderViewFunctor 376void LLSaveFolderState::setApply(BOOL apply)
377{ 377{
378public: 378 mApply = apply;
379 LLSaveFolderState() : mApply(FALSE) {} 379 // before generating new list of open folders, clear the old one
380 virtual ~LLSaveFolderState() {} 380 if(!apply)
381 virtual void doFolder(LLFolderViewFolder* folder); 381 {
382 virtual void doItem(LLFolderViewItem* item) {} 382 clearOpenFolders();
383 void setApply(BOOL apply) { mApply = apply; } 383 }
384 void clearOpenFolders() { mOpenFolders.clear(); } 384}
385protected:
386 std::set<LLUUID> mOpenFolders;
387 BOOL mApply;
388};
389 385
390void LLSaveFolderState::doFolder(LLFolderViewFolder* folder) 386void LLSaveFolderState::doFolder(LLFolderViewFolder* folder)
391{ 387{
@@ -512,17 +508,6 @@ LLInventoryView::~LLInventoryView( void )
512 508
513void LLInventoryView::draw() 509void LLInventoryView::draw()
514{ 510{
515 if (mActivePanel && mActivePanel->getNeedsAutoSelect())
516 {
517 LLOpenFilteredFolders opener;
518 mActivePanel->getRootFolder()->applyFunctorRecursively(opener);
519 // select first filtered item
520 LLSelectFirstFilteredItem filter;
521 mActivePanel->getRootFolder()->applyFunctorRecursively(filter);
522 mActivePanel->getRootFolder()->scrollToShowSelection();
523 mActivePanel->setNeedsAutoSelect(FALSE);
524 }
525
526 if (LLInventoryModel::isEverythingFetched()) 511 if (LLInventoryModel::isEverythingFetched())
527 { 512 {
528 LLLocale locale(LLLocale::USER_LOCALE); 513 LLLocale locale(LLLocale::USER_LOCALE);
@@ -590,15 +575,6 @@ void LLSelectFirstFilteredItem::doFolder(LLFolderViewFolder* folder)
590 } 575 }
591} 576}
592 577
593class LLOpenFoldersWithSelection : public LLFolderViewFunctor
594{
595public:
596 LLOpenFoldersWithSelection() {}
597 virtual ~LLOpenFoldersWithSelection() {}
598 virtual void doFolder(LLFolderViewFolder* folder);
599 virtual void doItem(LLFolderViewItem* item);
600};
601
602void LLOpenFoldersWithSelection::doItem(LLFolderViewItem *item) 578void LLOpenFoldersWithSelection::doItem(LLFolderViewItem *item)
603{ 579{
604 if (item->getParentFolder() && item->isSelected()) 580 if (item->getParentFolder() && item->isSelected())
@@ -728,7 +704,7 @@ LLInventoryView* LLInventoryView::showAgentInventory(BOOL take_keyboard_focus)
728 { 704 {
729 // Make sure it's in front and it makes a noise 705 // Make sure it's in front and it makes a noise
730 iv->setTitle("Inventory"); 706 iv->setTitle("Inventory");
731 iv->open(); 707 iv->open(); /*Flawfinder: ignore*/
732 } 708 }
733 //if (take_keyboard_focus) 709 //if (take_keyboard_focus)
734 //{ 710 //{
@@ -813,7 +789,7 @@ void LLInventoryView::toggleFindOptions()
813 LLRect(mRect.mLeft - INV_FINDER_WIDTH, mRect.mTop, mRect.mLeft, mRect.mTop - INV_FINDER_HEIGHT), 789 LLRect(mRect.mLeft - INV_FINDER_WIDTH, mRect.mTop, mRect.mLeft, mRect.mTop - INV_FINDER_HEIGHT),
814 this); 790 this);
815 mFinderHandle = finder->getHandle(); 791 mFinderHandle = finder->getHandle();
816 finder->open(); 792 finder->open(); /*Flawfinder: ignore*/
817 addDependentFloater(mFinderHandle); 793 addDependentFloater(mFinderHandle);
818 794
819 // start background fetch of folders 795 // start background fetch of folders
@@ -894,7 +870,6 @@ void LLInventoryView::onSearchEdit(const LLString& search_string, void* user_dat
894 // save current folder open state if no filter currently applied 870 // save current folder open state if no filter currently applied
895 if (!self->mActivePanel->getRootFolder()->isFilterActive()) 871 if (!self->mActivePanel->getRootFolder()->isFilterActive())
896 { 872 {
897 self->mSavedFolderState->clearOpenFolders();
898 self->mSavedFolderState->setApply(FALSE); 873 self->mSavedFolderState->setApply(FALSE);
899 self->mActivePanel->getRootFolder()->applyFunctorRecursively(*self->mSavedFolderState); 874 self->mActivePanel->getRootFolder()->applyFunctorRecursively(*self->mSavedFolderState);
900 } 875 }
@@ -1107,8 +1082,7 @@ LLInventoryPanel::LLInventoryPanel(const LLString& name,
1107 mScroller(NULL), 1082 mScroller(NULL),
1108 mAllowMultiSelect(allow_multi_select), 1083 mAllowMultiSelect(allow_multi_select),
1109 mSortOrderSetting(sort_order_setting), 1084 mSortOrderSetting(sort_order_setting),
1110 mSearchFunction(search), 1085 mSearchFunction(search)
1111 mNeedsAutoSelect(FALSE)
1112{ 1086{
1113} 1087}
1114 1088
@@ -1258,8 +1232,10 @@ void LLInventoryPanel::modelChanged(U32 mask)
1258{ 1232{
1259 LLFastTimer t2(LLFastTimer::FTM_REFRESH); 1233 LLFastTimer t2(LLFastTimer::FTM_REFRESH);
1260 1234
1235 bool handled = false;
1261 if(mask & LLInventoryObserver::LABEL) 1236 if(mask & LLInventoryObserver::LABEL)
1262 { 1237 {
1238 handled = true;
1263 // label change - empty out the display name for each object 1239 // label change - empty out the display name for each object
1264 // in this change set. 1240 // in this change set.
1265 const std::set<LLUUID>& changed_items = gInventory.getChangedIDs(); 1241 const std::set<LLUUID>& changed_items = gInventory.getChangedIDs();
@@ -1282,11 +1258,11 @@ void LLInventoryPanel::modelChanged(U32 mask)
1282 } 1258 }
1283 } 1259 }
1284 } 1260 }
1285 else if((mask & (LLInventoryObserver::STRUCTURE 1261 if((mask & (LLInventoryObserver::STRUCTURE
1286 | LLInventoryObserver::ADD 1262 | LLInventoryObserver::ADD
1287 | LLInventoryObserver::REMOVE)) != 0) 1263 | LLInventoryObserver::REMOVE)) != 0)
1288 { 1264 {
1289 1265 handled = true;
1290 // Record which folders are open by uuid. 1266 // Record which folders are open by uuid.
1291 LLInventoryModel* model = getModel(); 1267 LLInventoryModel* model = getModel();
1292 if (model) 1268 if (model)
@@ -1347,7 +1323,8 @@ void LLInventoryPanel::modelChanged(U32 mask)
1347 } 1323 }
1348 } 1324 }
1349 } 1325 }
1350 else 1326
1327 if (!handled)
1351 { 1328 {
1352 // it's a small change that only requires a refresh. 1329 // it's a small change that only requires a refresh.
1353 // *TODO: figure out a more efficient way to do the refresh 1330 // *TODO: figure out a more efficient way to do the refresh
diff --git a/linden/indra/newview/llinventoryview.h b/linden/indra/newview/llinventoryview.h
index 38c44da..78fa362 100644
--- a/linden/indra/newview/llinventoryview.h
+++ b/linden/indra/newview/llinventoryview.h
@@ -126,11 +126,6 @@ public:
126 126
127 void unSelectAll() { mFolders->setSelection(NULL, FALSE, FALSE); } 127 void unSelectAll() { mFolders->setSelection(NULL, FALSE, FALSE); }
128 128
129 BOOL getNeedsAutoSelect() { return mNeedsAutoSelect; }
130 void setNeedsAutoSelect(BOOL val) { mNeedsAutoSelect = val; }
131
132 void setAutoSelectOverride(bool override) { mFolders->setAutoSelectOverride(override); }
133
134protected: 129protected:
135 // Given the id and the parent, build all of the folder views. 130 // Given the id and the parent, build all of the folder views.
136 void rebuildViewsFor(const LLUUID& id, U32 mask); 131 void rebuildViewsFor(const LLUUID& id, U32 mask);
@@ -155,7 +150,6 @@ protected:
155 BOOL mAllowMultiSelect; 150 BOOL mAllowMultiSelect;
156 const LLString mSortOrderSetting; 151 const LLString mSortOrderSetting;
157 LLFolderSearchFunction mSearchFunction; 152 LLFolderSearchFunction mSearchFunction;
158 BOOL mNeedsAutoSelect;
159}; 153};
160 154
161class LLInventoryView; 155class LLInventoryView;
@@ -292,6 +286,29 @@ public:
292 virtual void doItem(LLFolderViewItem* item); 286 virtual void doItem(LLFolderViewItem* item);
293}; 287};
294 288
289class LLSaveFolderState : public LLFolderViewFunctor
290{
291public:
292 LLSaveFolderState() : mApply(FALSE) {}
293 virtual ~LLSaveFolderState() {}
294 virtual void doFolder(LLFolderViewFolder* folder);
295 virtual void doItem(LLFolderViewItem* item) {}
296 void setApply(BOOL apply);
297 void clearOpenFolders() { mOpenFolders.clear(); }
298protected:
299 std::set<LLUUID> mOpenFolders;
300 BOOL mApply;
301};
302
303class LLOpenFoldersWithSelection : public LLFolderViewFunctor
304{
305public:
306 LLOpenFoldersWithSelection() {}
307 virtual ~LLOpenFoldersWithSelection() {}
308 virtual void doFolder(LLFolderViewFolder* folder);
309 virtual void doItem(LLFolderViewItem* item);
310};
311
295///---------------------------------------------------------------------------- 312///----------------------------------------------------------------------------
296/// Function declarations, constants, enums, and typedefs 313/// Function declarations, constants, enums, and typedefs
297///---------------------------------------------------------------------------- 314///----------------------------------------------------------------------------
diff --git a/linden/indra/newview/lljoystickbutton.h b/linden/indra/newview/lljoystickbutton.h
index 8d1817a..69baa32 100644
--- a/linden/indra/newview/lljoystickbutton.h
+++ b/linden/indra/newview/lljoystickbutton.h
@@ -30,6 +30,7 @@
30 30
31#include "llbutton.h" 31#include "llbutton.h"
32#include "llcoord.h" 32#include "llcoord.h"
33#include "llviewerimage.h"
33 34
34typedef enum e_joystick_quadrant 35typedef enum e_joystick_quadrant
35{ 36{
diff --git a/linden/indra/newview/lllandmarklist.cpp b/linden/indra/newview/lllandmarklist.cpp
index a1c658d..f17a73b 100644
--- a/linden/indra/newview/lllandmarklist.cpp
+++ b/linden/indra/newview/lllandmarklist.cpp
@@ -84,7 +84,7 @@ void LLLandmarkList::processGetAssetReply(
84 S32 file_length = file.getSize(); 84 S32 file_length = file.getSize();
85 85
86 char* buffer = new char[ file_length + 1 ]; 86 char* buffer = new char[ file_length + 1 ];
87 file.read( (U8*)buffer, file_length); 87 file.read( (U8*)buffer, file_length); /*Flawfinder: ignore*/
88 buffer[ file_length ] = 0; 88 buffer[ file_length ] = 0;
89 89
90 LLLandmark* landmark = LLLandmark::constructFromString(buffer); 90 LLLandmark* landmark = LLLandmark::constructFromString(buffer);
diff --git a/linden/indra/newview/lllogchat.cpp b/linden/indra/newview/lllogchat.cpp
index f8b100e..6be5ee1 100644
--- a/linden/indra/newview/lllogchat.cpp
+++ b/linden/indra/newview/lllogchat.cpp
@@ -43,7 +43,13 @@ LLString LLLogChat::makeLogFileName(LLString filename)
43//static 43//static
44void LLLogChat::saveHistory(LLString filename, LLString line) 44void LLLogChat::saveHistory(LLString filename, LLString line)
45{ 45{
46 FILE *fp = LLFile::fopen(LLLogChat::makeLogFileName(filename).c_str(), "a"); 46 if(!filename.size())
47 {
48 llinfos << "Filename is Empty!" << llendl;
49 return;
50 }
51
52 FILE* fp = LLFile::fopen(LLLogChat::makeLogFileName(filename).c_str(), "a"); /*Flawfinder: ignore*/
47 if (!fp) 53 if (!fp)
48 { 54 {
49 llinfos << "Couldn't open chat history log!" << llendl; 55 llinfos << "Couldn't open chat history log!" << llendl;
@@ -58,14 +64,19 @@ void LLLogChat::saveHistory(LLString filename, LLString line)
58 64
59void LLLogChat::loadHistory(LLString filename , void (*callback)(LLString,void*), void* userdata) 65void LLLogChat::loadHistory(LLString filename , void (*callback)(LLString,void*), void* userdata)
60{ 66{
61 FILE *fptr = LLFile::fopen(makeLogFileName(filename).c_str(), "r"); 67 if(!filename.size())
68 {
69 llerrs << "Filename is Empty!" << llendl;
70 }
71
72 FILE* fptr = LLFile::fopen(makeLogFileName(filename).c_str(), "r"); /*Flawfinder: ignore*/
62 if (!fptr) 73 if (!fptr)
63 { 74 {
64 return; //No previous conversation with this name. 75 return; //No previous conversation with this name.
65 } 76 }
66 else 77 else
67 { 78 {
68 char buffer[LOG_RECALL_SIZE]; 79 char buffer[LOG_RECALL_SIZE]; /*Flawfinder: ignore*/
69 char *bptr; 80 char *bptr;
70 S32 len; 81 S32 len;
71 bool firstline=TRUE; 82 bool firstline=TRUE;
@@ -82,7 +93,7 @@ void LLLogChat::loadHistory(LLString filename , void (*callback)(LLString,void*)
82 93
83 while ( fgets(buffer, LOG_RECALL_SIZE, fptr) && !feof(fptr) ) 94 while ( fgets(buffer, LOG_RECALL_SIZE, fptr) && !feof(fptr) )
84 { 95 {
85 len = strlen(buffer) - 1; 96 len = strlen(buffer) - 1; /*Flawfinder: ignore*/
86 for ( bptr = (buffer + len); (*bptr == '\n' || *bptr == '\r') && bptr>buffer; bptr--) *bptr='\0'; 97 for ( bptr = (buffer + len); (*bptr == '\n' || *bptr == '\r') && bptr>buffer; bptr--) *bptr='\0';
87 98
88 if (!firstline) 99 if (!firstline)
diff --git a/linden/indra/newview/llmanip.cpp b/linden/indra/newview/llmanip.cpp
index 20d77e0..a1ff7c3 100644
--- a/linden/indra/newview/llmanip.cpp
+++ b/linden/indra/newview/llmanip.cpp
@@ -169,7 +169,7 @@ F32 LLManip::getSubdivisionLevel(const LLVector3 &reference_point, const LLVecto
169{ 169{
170 //update current snap subdivision level 170 //update current snap subdivision level
171 LLVector3 cam_to_reference; 171 LLVector3 cam_to_reference;
172 if (gSelectMgr->getSelectType() == SELECT_TYPE_HUD) 172 if (mObjectSelection->getSelectType() == SELECT_TYPE_HUD)
173 { 173 {
174 cam_to_reference = LLVector3(1.f / gAgent.getAvatarObject()->mHUDCurZoom, 0.f, 0.f); 174 cam_to_reference = LLVector3(1.f / gAgent.getAvatarObject()->mHUDCurZoom, 0.f, 0.f);
175 } 175 }
@@ -186,12 +186,27 @@ F32 LLManip::getSubdivisionLevel(const LLVector3 &reference_point, const LLVecto
186 return subdivisions; 186 return subdivisions;
187} 187}
188 188
189void LLManip::handleSelect()
190{
191 mObjectSelection = gSelectMgr->getEditSelection();
192}
193
194void LLManip::handleDeselect()
195{
196 mObjectSelection = NULL;
197}
198
199LLObjectSelectionHandle LLManip::getSelection()
200{
201 return mObjectSelection;
202}
203
189BOOL LLManip::handleHover(S32 x, S32 y, MASK mask) 204BOOL LLManip::handleHover(S32 x, S32 y, MASK mask)
190{ 205{
191 // We only handle the event if mousedown started with us 206 // We only handle the event if mousedown started with us
192 if( hasMouseCapture() ) 207 if( hasMouseCapture() )
193 { 208 {
194 if( gSelectMgr->isEmpty() ) 209 if( mObjectSelection->isEmpty() )
195 { 210 {
196 // Somehow the object got deselected while we were dragging it. 211 // Somehow the object got deselected while we were dragging it.
197 // Release the mouse 212 // Release the mouse
@@ -236,7 +251,7 @@ BOOL LLManip::getMousePointOnPlaneAgent(LLVector3& point, S32 x, S32 y, LLVector
236 251
237BOOL LLManip::getMousePointOnPlaneGlobal(LLVector3d& point, S32 x, S32 y, LLVector3d origin, LLVector3 normal) 252BOOL LLManip::getMousePointOnPlaneGlobal(LLVector3d& point, S32 x, S32 y, LLVector3d origin, LLVector3 normal)
238{ 253{
239 if (gSelectMgr->getSelectType() == SELECT_TYPE_HUD) 254 if (mObjectSelection->getSelectType() == SELECT_TYPE_HUD)
240 { 255 {
241 BOOL result = FALSE; 256 BOOL result = FALSE;
242 F32 mouse_x = ((F32)x / gViewerWindow->getWindowWidth() - 0.5f) * gCamera->getAspect() / gAgent.getAvatarObject()->mHUDCurZoom; 257 F32 mouse_x = ((F32)x / gViewerWindow->getWindowWidth() - 0.5f) * gCamera->getAspect() / gAgent.getAvatarObject()->mHUDCurZoom;
@@ -271,12 +286,12 @@ BOOL LLManip::getMousePointOnPlaneGlobal(LLVector3d& point, S32 x, S32 y, LLVect
271// Given the line defined by mouse cursor (a1 + a_param*(a2-a1)) and the line defined by b1 + b_param*(b2-b1), 286// Given the line defined by mouse cursor (a1 + a_param*(a2-a1)) and the line defined by b1 + b_param*(b2-b1),
272// returns a_param and b_param for the points where lines are closest to each other. 287// returns a_param and b_param for the points where lines are closest to each other.
273// Returns false if the two lines are parallel. 288// Returns false if the two lines are parallel.
274BOOL LLManip::nearestPointOnLineFromMouse( S32 x, S32 y, const LLVector3& b1, const LLVector3& b2, F32 &a_param, F32 &b_param ) const 289BOOL LLManip::nearestPointOnLineFromMouse( S32 x, S32 y, const LLVector3& b1, const LLVector3& b2, F32 &a_param, F32 &b_param )
275{ 290{
276 LLVector3 a1; 291 LLVector3 a1;
277 LLVector3 a2; 292 LLVector3 a2;
278 293
279 if (gSelectMgr->getSelectType() == SELECT_TYPE_HUD) 294 if (mObjectSelection->getSelectType() == SELECT_TYPE_HUD)
280 { 295 {
281 F32 mouse_x = (((F32)x / gViewerWindow->getWindowWidth()) - 0.5f) * gCamera->getAspect() / gAgent.getAvatarObject()->mHUDCurZoom; 296 F32 mouse_x = (((F32)x / gViewerWindow->getWindowWidth()) - 0.5f) * gCamera->getAspect() / gAgent.getAvatarObject()->mHUDCurZoom;
282 F32 mouse_y = (((F32)y / gViewerWindow->getWindowHeight()) - 0.5f) / gAgent.getAvatarObject()->mHUDCurZoom; 297 F32 mouse_y = (((F32)y / gViewerWindow->getWindowHeight()) - 0.5f) / gAgent.getAvatarObject()->mHUDCurZoom;
@@ -324,11 +339,11 @@ LLVector3 LLManip::getSavedPivotPoint() const
324 return gSelectMgr->getSavedBBoxOfSelection().getCenterAgent(); 339 return gSelectMgr->getSavedBBoxOfSelection().getCenterAgent();
325} 340}
326 341
327LLVector3 LLManip::getPivotPoint() const 342LLVector3 LLManip::getPivotPoint()
328{ 343{
329 if (gSelectMgr->getFirstObject() && gSelectMgr->getObjectCount() == 1 && gSelectMgr->getSelectType() != SELECT_TYPE_HUD) 344 if (mObjectSelection->getFirstObject() && mObjectSelection->getObjectCount() == 1 && mObjectSelection->getSelectType() != SELECT_TYPE_HUD)
330 { 345 {
331 return gSelectMgr->getFirstObject()->getPivotPositionAgent(); 346 return mObjectSelection->getFirstObject()->getPivotPositionAgent();
332 } 347 }
333 return gSelectMgr->getBBoxOfSelection().getCenterAgent(); 348 return gSelectMgr->getBBoxOfSelection().getCenterAgent();
334} 349}
@@ -341,10 +356,10 @@ void LLManip::renderGuidelines(BOOL draw_x, BOOL draw_y, BOOL draw_z)
341 LLVector3 grid_scale; 356 LLVector3 grid_scale;
342 gSelectMgr->getGrid(grid_origin, grid_rot, grid_scale); 357 gSelectMgr->getGrid(grid_origin, grid_rot, grid_scale);
343 358
344 LLViewerObject* object = gSelectMgr->getFirstRootObject(); 359 LLViewerObject* object = mObjectSelection->getFirstRootObject();
345 if (!object) 360 if (!object)
346 { 361 {
347 object = gSelectMgr->getFirstObject(); 362 object = mObjectSelection->getFirstObject();
348 if (!object) 363 if (!object)
349 { 364 {
350 return; 365 return;
@@ -404,7 +419,7 @@ void LLManip::renderGuidelines(BOOL draw_x, BOOL draw_y, BOOL draw_z)
404void LLManip::renderXYZ(const LLVector3 &vec) 419void LLManip::renderXYZ(const LLVector3 &vec)
405{ 420{
406 const S32 PAD = 10; 421 const S32 PAD = 10;
407 char feedback_string[128]; 422 char feedback_string[128]; /*Flawfinder: ignore*/
408 LLVector3 camera_pos = gCamera->getOrigin() + gCamera->getAtAxis(); 423 LLVector3 camera_pos = gCamera->getOrigin() + gCamera->getAtAxis();
409 S32 vertical_offset = gViewerWindow->getWindowHeight() / 2 - VERTICAL_OFFSET; 424 S32 vertical_offset = gViewerWindow->getWindowHeight() / 2 - VERTICAL_OFFSET;
410 S32 window_center_x = gViewerWindow->getWindowWidth() / 2; 425 S32 window_center_x = gViewerWindow->getWindowWidth() / 2;
@@ -439,25 +454,25 @@ void LLManip::renderXYZ(const LLVector3 &vec)
439 LLGLDepthTest gls_depth(GL_FALSE); 454 LLGLDepthTest gls_depth(GL_FALSE);
440 LLGLEnable tex(GL_TEXTURE_2D); 455 LLGLEnable tex(GL_TEXTURE_2D);
441 // render drop shadowed text 456 // render drop shadowed text
442 sprintf(feedback_string, "X: %.3f", vec.mV[VX]); 457 snprintf(feedback_string, sizeof(feedback_string), "X: %.3f", vec.mV[VX]); /*Flawfinder: ignore*/
443 hud_render_text(utf8str_to_wstring(feedback_string), camera_pos, *gResMgr->getRes( LLFONT_SANSSERIF ), LLFontGL::NORMAL, -102.f + 1.f, (F32)vertical_offset - 1.f, LLColor4::black, FALSE); 458 hud_render_text(utf8str_to_wstring(feedback_string), camera_pos, *gResMgr->getRes( LLFONT_SANSSERIF ), LLFontGL::NORMAL, -102.f + 1.f, (F32)vertical_offset - 1.f, LLColor4::black, FALSE);
444 459
445 sprintf(feedback_string, "Y: %.3f", vec.mV[VY]); 460 snprintf(feedback_string, sizeof(feedback_string), "Y: %.3f", vec.mV[VY]); /*Flawfinder: ignore*/
446 hud_render_text(utf8str_to_wstring(feedback_string), camera_pos, *gResMgr->getRes( LLFONT_SANSSERIF ), LLFontGL::NORMAL, -27.f + 1.f, (F32)vertical_offset - 1.f, LLColor4::black, FALSE); 461 hud_render_text(utf8str_to_wstring(feedback_string), camera_pos, *gResMgr->getRes( LLFONT_SANSSERIF ), LLFontGL::NORMAL, -27.f + 1.f, (F32)vertical_offset - 1.f, LLColor4::black, FALSE);
447 462
448 sprintf(feedback_string, "Z: %.3f", vec.mV[VZ]); 463 snprintf(feedback_string, sizeof(feedback_string), "Z: %.3f", vec.mV[VZ]); /*Flawfinder: ignore*/
449 hud_render_text(utf8str_to_wstring(feedback_string), camera_pos, *gResMgr->getRes( LLFONT_SANSSERIF ), LLFontGL::NORMAL, 48.f + 1.f, (F32)vertical_offset - 1.f, LLColor4::black, FALSE); 464 hud_render_text(utf8str_to_wstring(feedback_string), camera_pos, *gResMgr->getRes( LLFONT_SANSSERIF ), LLFontGL::NORMAL, 48.f + 1.f, (F32)vertical_offset - 1.f, LLColor4::black, FALSE);
450 465
451 // render text on top 466 // render text on top
452 sprintf(feedback_string, "X: %.3f", vec.mV[VX]); 467 snprintf(feedback_string, sizeof(feedback_string), "X: %.3f", vec.mV[VX]); /*Flawfinder: ignore*/
453 hud_render_text(utf8str_to_wstring(feedback_string), camera_pos, *gResMgr->getRes( LLFONT_SANSSERIF ), LLFontGL::NORMAL, -102.f, (F32)vertical_offset, LLColor4(1.f, 0.5f, 0.5f, 1.f), FALSE); 468 hud_render_text(utf8str_to_wstring(feedback_string), camera_pos, *gResMgr->getRes( LLFONT_SANSSERIF ), LLFontGL::NORMAL, -102.f, (F32)vertical_offset, LLColor4(1.f, 0.5f, 0.5f, 1.f), FALSE);
454 469
455 glColor3f(0.5f, 1.f, 0.5f); 470 glColor3f(0.5f, 1.f, 0.5f);
456 sprintf(feedback_string, "Y: %.3f", vec.mV[VY]); 471 snprintf(feedback_string, sizeof(feedback_string), "Y: %.3f", vec.mV[VY]); /*Flawfinder: ignore*/
457 hud_render_text(utf8str_to_wstring(feedback_string), camera_pos, *gResMgr->getRes( LLFONT_SANSSERIF ), LLFontGL::NORMAL, -27.f, (F32)vertical_offset, LLColor4(0.5f, 1.f, 0.5f, 1.f), FALSE); 472 hud_render_text(utf8str_to_wstring(feedback_string), camera_pos, *gResMgr->getRes( LLFONT_SANSSERIF ), LLFontGL::NORMAL, -27.f, (F32)vertical_offset, LLColor4(0.5f, 1.f, 0.5f, 1.f), FALSE);
458 473
459 glColor3f(0.5f, 0.5f, 1.f); 474 glColor3f(0.5f, 0.5f, 1.f);
460 sprintf(feedback_string, "Z: %.3f", vec.mV[VZ]); 475 snprintf(feedback_string, sizeof(feedback_string), "Z: %.3f", vec.mV[VZ]); /*Flawfinder: ignore*/
461 hud_render_text(utf8str_to_wstring(feedback_string), camera_pos, *gResMgr->getRes( LLFONT_SANSSERIF ), LLFontGL::NORMAL, 48.f, (F32)vertical_offset, LLColor4(0.5f, 0.5f, 1.f, 1.f), FALSE); 476 hud_render_text(utf8str_to_wstring(feedback_string), camera_pos, *gResMgr->getRes( LLFONT_SANSSERIF ), LLFontGL::NORMAL, 48.f, (F32)vertical_offset, LLColor4(0.5f, 0.5f, 1.f, 1.f), FALSE);
462 } 477 }
463} 478}
@@ -466,7 +481,7 @@ void LLManip::renderTickText(const LLVector3& pos, const char* text, const LLCol
466{ 481{
467 const LLFontGL* big_fontp = gResMgr->getRes( LLFONT_SANSSERIF ); 482 const LLFontGL* big_fontp = gResMgr->getRes( LLFONT_SANSSERIF );
468 483
469 BOOL hud_selection = gSelectMgr->getSelectType() == SELECT_TYPE_HUD; 484 BOOL hud_selection = mObjectSelection->getSelectType() == SELECT_TYPE_HUD;
470 glMatrixMode(GL_MODELVIEW); 485 glMatrixMode(GL_MODELVIEW);
471 glPushMatrix(); 486 glPushMatrix();
472 LLVector3 render_pos = pos; 487 LLVector3 render_pos = pos;
@@ -484,9 +499,9 @@ void LLManip::renderTickText(const LLVector3& pos, const char* text, const LLCol
484 LLGLEnable tex(GL_TEXTURE_2D); 499 LLGLEnable tex(GL_TEXTURE_2D);
485 shadow_color.mV[VALPHA] = color.mV[VALPHA] * 0.5f; 500 shadow_color.mV[VALPHA] = color.mV[VALPHA] * 0.5f;
486 gViewerWindow->setupViewport(1, -1); 501 gViewerWindow->setupViewport(1, -1);
487 hud_render_utf8text(text, render_pos, *big_fontp, LLFontGL::NORMAL, -0.5f * big_fontp->getWidthF32(text), 3.f, shadow_color, gSelectMgr->getSelectType() == SELECT_TYPE_HUD); 502 hud_render_utf8text(text, render_pos, *big_fontp, LLFontGL::NORMAL, -0.5f * big_fontp->getWidthF32(text), 3.f, shadow_color, mObjectSelection->getSelectType() == SELECT_TYPE_HUD);
488 gViewerWindow->setupViewport(); 503 gViewerWindow->setupViewport();
489 hud_render_utf8text(text, render_pos, *big_fontp, LLFontGL::NORMAL, -0.5f * big_fontp->getWidthF32(text), 3.f, color, gSelectMgr->getSelectType() == SELECT_TYPE_HUD); 504 hud_render_utf8text(text, render_pos, *big_fontp, LLFontGL::NORMAL, -0.5f * big_fontp->getWidthF32(text), 3.f, color, mObjectSelection->getSelectType() == SELECT_TYPE_HUD);
490 505
491 glPopMatrix(); 506 glPopMatrix();
492} 507}
@@ -498,34 +513,34 @@ void LLManip::renderTickValue(const LLVector3& pos, F32 value, const char* suffi
498 const LLFontGL* big_fontp = gResMgr->getRes( LLFONT_SANSSERIF ); 513 const LLFontGL* big_fontp = gResMgr->getRes( LLFONT_SANSSERIF );
499 const LLFontGL* small_fontp = gResMgr->getRes( LLFONT_SANSSERIF_SMALL ); 514 const LLFontGL* small_fontp = gResMgr->getRes( LLFONT_SANSSERIF_SMALL );
500 515
501 char val_string[128]; 516 char val_string[128]; /*Flawfinder: ignore*/
502 char fraction_string[128]; 517 char fraction_string[128]; /*Flawfinder: ignore*/
503 F32 val_to_print = llround(value, 0.001f); 518 F32 val_to_print = llround(value, 0.001f);
504 S32 fractional_portion = llround(fmodf(llabs(val_to_print), 1.f) * 100.f); 519 S32 fractional_portion = llround(fmodf(llabs(val_to_print), 1.f) * 100.f);
505 if (val_to_print < 0.f) 520 if (val_to_print < 0.f)
506 { 521 {
507 if (fractional_portion == 0) 522 if (fractional_portion == 0)
508 { 523 {
509 sprintf(val_string, "-%d%s", lltrunc(llabs(val_to_print)), suffix); 524 snprintf(val_string, sizeof(val_string), "-%d%s", lltrunc(llabs(val_to_print)), suffix); /*Flawfinder: ignore*/
510 } 525 }
511 else 526 else
512 { 527 {
513 sprintf(val_string, "-%d", lltrunc(llabs(val_to_print))); 528 snprintf(val_string, sizeof(val_string), "-%d", lltrunc(llabs(val_to_print))); /*Flawfinder: ignore*/
514 } 529 }
515 } 530 }
516 else 531 else
517 { 532 {
518 if (fractional_portion == 0) 533 if (fractional_portion == 0)
519 { 534 {
520 sprintf(val_string, "%d%s", lltrunc(llabs(val_to_print)), suffix); 535 snprintf(val_string, sizeof(val_string), "%d%s", lltrunc(llabs(val_to_print)), suffix); /*Flawfinder: ignore*/
521 } 536 }
522 else 537 else
523 { 538 {
524 sprintf(val_string, "%d", lltrunc(val_to_print)); 539 snprintf(val_string, sizeof(val_string), "%d", lltrunc(val_to_print)); /*Flawfinder: ignore*/
525 } 540 }
526 } 541 }
527 542
528 BOOL hud_selection = gSelectMgr->getSelectType() == SELECT_TYPE_HUD; 543 BOOL hud_selection = mObjectSelection->getSelectType() == SELECT_TYPE_HUD;
529 glMatrixMode(GL_MODELVIEW); 544 glMatrixMode(GL_MODELVIEW);
530 glPushMatrix(); 545 glPushMatrix();
531 LLVector3 render_pos = pos; 546 LLVector3 render_pos = pos;
@@ -544,7 +559,7 @@ void LLManip::renderTickValue(const LLVector3& pos, F32 value, const char* suffi
544 LLGLEnable tex(GL_TEXTURE_2D); 559 LLGLEnable tex(GL_TEXTURE_2D);
545 if (fractional_portion != 0) 560 if (fractional_portion != 0)
546 { 561 {
547 sprintf(fraction_string, "%c%d%s", gResMgr->getDecimalPoint(), fractional_portion, suffix); 562 snprintf(fraction_string, sizeof(fraction_string), "%c%d%s", gResMgr->getDecimalPoint(), fractional_portion, suffix); /*Flawfinder: ignore*/
548 563
549 gViewerWindow->setupViewport(1, -1); 564 gViewerWindow->setupViewport(1, -1);
550 hud_render_utf8text(val_string, render_pos, *big_fontp, LLFontGL::NORMAL, -1.f * big_fontp->getWidthF32(val_string), 3.f, shadow_color, hud_selection); 565 hud_render_utf8text(val_string, render_pos, *big_fontp, LLFontGL::NORMAL, -1.f * big_fontp->getWidthF32(val_string), 3.f, shadow_color, hud_selection);
diff --git a/linden/indra/newview/llmanip.h b/linden/indra/newview/llmanip.h
index 7382bd4..7f83ae2 100644
--- a/linden/indra/newview/llmanip.h
+++ b/linden/indra/newview/llmanip.h
@@ -36,6 +36,7 @@ class LLTextBox;
36class LLViewerObject; 36class LLViewerObject;
37class LLToolComposite; 37class LLToolComposite;
38class LLVector3; 38class LLVector3;
39class LLObjectSelection;
39 40
40const S32 MIN_DIVISION_PIXEL_WIDTH = 9; 41const S32 MIN_DIVISION_PIXEL_WIDTH = 9;
41 42
@@ -121,14 +122,18 @@ public:
121 void renderGuidelines(BOOL draw_x = TRUE, BOOL draw_y = TRUE, BOOL draw_z = TRUE); 122 void renderGuidelines(BOOL draw_x = TRUE, BOOL draw_y = TRUE, BOOL draw_z = TRUE);
122 static void renderXYZ(const LLVector3 &vec); 123 static void renderXYZ(const LLVector3 &vec);
123 124
124 virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask) = 0;
125 /*virtual*/ BOOL handleMouseUp(S32 x, S32 y, MASK mask); 125 /*virtual*/ BOOL handleMouseUp(S32 x, S32 y, MASK mask);
126 /*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask); 126 /*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask);
127 virtual EManipPart getHighlightedPart() { return LL_NO_PART; } 127 virtual EManipPart getHighlightedPart() { return LL_NO_PART; }
128 virtual void highlightManipulators(S32 x, S32 y) {}; 128 virtual void highlightManipulators(S32 x, S32 y) {};
129 virtual void handleSelect();
130 virtual void handleDeselect();
131
132 LLHandle<LLObjectSelection> getSelection();
133
129protected: 134protected:
130 LLVector3 getSavedPivotPoint() const; 135 LLVector3 getSavedPivotPoint() const;
131 LLVector3 getPivotPoint() const; 136 LLVector3 getPivotPoint();
132 void getManipNormal(LLViewerObject* object, EManipPart manip, LLVector3 &normal); 137 void getManipNormal(LLViewerObject* object, EManipPart manip, LLVector3 &normal);
133 BOOL getManipAxis(LLViewerObject* object, EManipPart manip, LLVector3 &axis); 138 BOOL getManipAxis(LLViewerObject* object, EManipPart manip, LLVector3 &axis);
134 F32 getSubdivisionLevel(const LLVector3 &reference_point, const LLVector3 &translate_axis, F32 grid_scale, S32 min_pixel_spacing = MIN_DIVISION_PIXEL_WIDTH); 139 F32 getSubdivisionLevel(const LLVector3 &reference_point, const LLVector3 &translate_axis, F32 grid_scale, S32 min_pixel_spacing = MIN_DIVISION_PIXEL_WIDTH);
@@ -137,11 +142,12 @@ protected:
137 void updateGridSettings(); 142 void updateGridSettings();
138 BOOL getMousePointOnPlaneGlobal(LLVector3d& point, S32 x, S32 y, LLVector3d origin, LLVector3 normal); 143 BOOL getMousePointOnPlaneGlobal(LLVector3d& point, S32 x, S32 y, LLVector3d origin, LLVector3 normal);
139 BOOL getMousePointOnPlaneAgent(LLVector3& point, S32 x, S32 y, LLVector3 origin, LLVector3 normal); 144 BOOL getMousePointOnPlaneAgent(LLVector3& point, S32 x, S32 y, LLVector3 origin, LLVector3 normal);
140 BOOL nearestPointOnLineFromMouse( S32 x, S32 y, const LLVector3& b1, const LLVector3& b2, F32 &a_param, F32 &b_param ) const; 145 BOOL nearestPointOnLineFromMouse( S32 x, S32 y, const LLVector3& b1, const LLVector3& b2, F32 &a_param, F32 &b_param );
141 LLColor4 setupSnapGuideRenderPass(S32 pass); 146 LLColor4 setupSnapGuideRenderPass(S32 pass);
142protected: 147protected:
143 LLFrameTimer mHelpTextTimer; 148 LLFrameTimer mHelpTextTimer;
144 BOOL mInSnapRegime; 149 BOOL mInSnapRegime;
150 LLHandle<LLObjectSelection> mObjectSelection;
145 151
146 static F32 sHelpTextVisibleTime; 152 static F32 sHelpTextVisibleTime;
147 static F32 sHelpTextFadeTime; 153 static F32 sHelpTextFadeTime;
diff --git a/linden/indra/newview/llmaniprotate.cpp b/linden/indra/newview/llmaniprotate.cpp
index 93cbfe4..452e4d4 100644
--- a/linden/indra/newview/llmaniprotate.cpp
+++ b/linden/indra/newview/llmaniprotate.cpp
@@ -81,7 +81,6 @@ const F32 SELECTED_MANIPULATOR_SCALE = 1.05f;
81const F32 MANIPULATOR_SCALE_HALF_LIFE = 0.07f; 81const F32 MANIPULATOR_SCALE_HALF_LIFE = 0.07f;
82 82
83extern void handle_reset_rotation(void*); // in LLViewerWindow 83extern void handle_reset_rotation(void*); // in LLViewerWindow
84extern void handle_first_tool(void*);
85 84
86LLManipRotate::LLManipRotate( LLToolComposite* composite ) 85LLManipRotate::LLManipRotate( LLToolComposite* composite )
87: LLManip( "Rotate", composite ), 86: LLManip( "Rotate", composite ),
@@ -108,6 +107,7 @@ void LLManipRotate::handleSelect()
108 // *FIX: put this in mouseDown? 107 // *FIX: put this in mouseDown?
109 gSelectMgr->saveSelectedObjectTransform(SELECT_ACTION_TYPE_PICK); 108 gSelectMgr->saveSelectedObjectTransform(SELECT_ACTION_TYPE_PICK);
110 gFloaterTools->setStatusText("Drag colored bands to rotate object"); 109 gFloaterTools->setStatusText("Drag colored bands to rotate object");
110 LLManip::handleSelect();
111} 111}
112 112
113void LLManipRotate::handleDeselect() 113void LLManipRotate::handleDeselect()
@@ -116,6 +116,7 @@ void LLManipRotate::handleDeselect()
116 mManipPart = LL_NO_PART; 116 mManipPart = LL_NO_PART;
117 117
118 gFloaterTools->setStatusText(""); 118 gFloaterTools->setStatusText("");
119 LLManip::handleDeselect();
119} 120}
120 121
121void LLManipRotate::render() 122void LLManipRotate::render()
@@ -127,7 +128,7 @@ void LLManipRotate::render()
127 LLGLEnable gls_alpha_test(GL_ALPHA_TEST); 128 LLGLEnable gls_alpha_test(GL_ALPHA_TEST);
128 129
129 // You can rotate if you can move 130 // You can rotate if you can move
130 LLViewerObject* first_object = gSelectMgr->getFirstMoveableObject(TRUE); 131 LLViewerObject* first_object = mObjectSelection->getFirstMoveableObject(TRUE);
131 if( !first_object ) 132 if( !first_object )
132 { 133 {
133 return; 134 return;
@@ -140,7 +141,7 @@ void LLManipRotate::render()
140 141
141 glMatrixMode(GL_MODELVIEW); 142 glMatrixMode(GL_MODELVIEW);
142 glPushMatrix(); 143 glPushMatrix();
143 if (gSelectMgr->getSelectType() == SELECT_TYPE_HUD) 144 if (mObjectSelection->getSelectType() == SELECT_TYPE_HUD)
144 { 145 {
145 F32 zoom = gAgent.getAvatarObject()->mHUDCurZoom; 146 F32 zoom = gAgent.getAvatarObject()->mHUDCurZoom;
146 glScalef(zoom, zoom, zoom); 147 glScalef(zoom, zoom, zoom);
@@ -358,7 +359,7 @@ BOOL LLManipRotate::handleMouseDown(S32 x, S32 y, MASK mask)
358{ 359{
359 BOOL handled = FALSE; 360 BOOL handled = FALSE;
360 361
361 LLViewerObject* first_object = gSelectMgr->getFirstMoveableObject(TRUE); 362 LLViewerObject* first_object = mObjectSelection->getFirstMoveableObject(TRUE);
362 if( first_object ) 363 if( first_object )
363 { 364 {
364 LLViewerObject* hit_obj = gViewerWindow->lastObjectHit(); 365 LLViewerObject* hit_obj = gViewerWindow->lastObjectHit();
@@ -374,10 +375,10 @@ BOOL LLManipRotate::handleMouseDown(S32 x, S32 y, MASK mask)
374// Assumes that one of the parts of the manipulator was hit. 375// Assumes that one of the parts of the manipulator was hit.
375BOOL LLManipRotate::handleMouseDownOnPart( S32 x, S32 y, MASK mask ) 376BOOL LLManipRotate::handleMouseDownOnPart( S32 x, S32 y, MASK mask )
376{ 377{
377 BOOL can_rotate = gSelectMgr->getObjectCount() != 0; 378 BOOL can_rotate = mObjectSelection->getObjectCount() != 0;
378 for (LLViewerObject* objectp = gSelectMgr->getFirstObject(); 379 for (LLViewerObject* objectp = mObjectSelection->getFirstObject();
379 objectp; 380 objectp;
380 objectp = gSelectMgr->getNextObject()) 381 objectp = mObjectSelection->getNextObject())
381 { 382 {
382 can_rotate = can_rotate && objectp->permMove() && (objectp->permModify() || gSavedSettings.getBOOL("SelectLinkedSet")); 383 can_rotate = can_rotate && objectp->permMove() && (objectp->permModify() || gSavedSettings.getBOOL("SelectLinkedSet"));
383 } 384 }
@@ -463,11 +464,7 @@ BOOL LLManipRotate::handleMouseUp(S32 x, S32 y, MASK mask)
463 mManipPart = LL_NO_PART; 464 mManipPart = LL_NO_PART;
464 465
465 // Might have missed last update due to timing. 466 // Might have missed last update due to timing.
466 if (mSendUpdateOnMouseUp) 467 gSelectMgr->sendMultipleUpdate( UPD_ROTATION | UPD_POSITION );
467 {
468 gSelectMgr->sendMultipleUpdate( UPD_ROTATION | UPD_POSITION );
469 mSendUpdateOnMouseUp = FALSE;
470 }
471 gSelectMgr->enableSilhouette(TRUE); 468 gSelectMgr->enableSilhouette(TRUE);
472 //gAgent.setObjectTracking(gSavedSettings.getBOOL("TrackFocusObject")); 469 //gAgent.setObjectTracking(gSavedSettings.getBOOL("TrackFocusObject"));
473 470
@@ -482,7 +479,7 @@ BOOL LLManipRotate::handleHover(S32 x, S32 y, MASK mask)
482{ 479{
483 if( hasMouseCapture() ) 480 if( hasMouseCapture() )
484 { 481 {
485 if( gSelectMgr->isEmpty() ) 482 if( mObjectSelection->isEmpty() )
486 { 483 {
487 // Somehow the object got deselected while we were dragging it. 484 // Somehow the object got deselected while we were dragging it.
488 setMouseCapture( FALSE ); 485 setMouseCapture( FALSE );
@@ -523,12 +520,6 @@ extern U32 gFrameCount;
523// Freeform rotation 520// Freeform rotation
524void LLManipRotate::drag( S32 x, S32 y ) 521void LLManipRotate::drag( S32 x, S32 y )
525{ 522{
526 static LLTimer update_timer;
527 F32 elapsed_time = update_timer.getElapsedTimeF32();
528 const F32 UPDATE_DELAY = 0.1f; // min time between transmitted updates
529 BOOL send_rotation_update = FALSE;
530 BOOL send_position_update = FALSE;
531
532 if( !updateVisiblity() ) 523 if( !updateVisiblity() )
533 { 524 {
534 return; 525 return;
@@ -548,9 +539,8 @@ void LLManipRotate::drag( S32 x, S32 y )
548 539
549 LLViewerObject* object; 540 LLViewerObject* object;
550 LLSelectNode* selectNode; 541 LLSelectNode* selectNode;
551 BOOL using_linked_selection = gSavedSettings.getBOOL("SelectLinkedSet");
552 542
553 for( selectNode = gSelectMgr->getFirstNode(); selectNode != NULL; selectNode = gSelectMgr->getNextNode() ) 543 for( selectNode = mObjectSelection->getFirstNode(); selectNode != NULL; selectNode = mObjectSelection->getNextNode() )
554 { 544 {
555 object = selectNode->getObject(); 545 object = selectNode->getObject();
556 546
@@ -595,12 +585,6 @@ void LLManipRotate::drag( S32 x, S32 y )
595 rebuild(object); 585 rebuild(object);
596 } 586 }
597 587
598 // don't send updates all the time for sub-objects
599 if (using_linked_selection && object->getRenderRotation() != new_rot)
600 {
601 send_rotation_update = TRUE;
602 }
603
604 // for individually selected roots, we need to counterrotate all the children 588 // for individually selected roots, we need to counterrotate all the children
605 if (object->isRootEdit() && selectNode->mIndividualSelection) 589 if (object->isRootEdit() && selectNode->mIndividualSelection)
606 { 590 {
@@ -622,7 +606,7 @@ void LLManipRotate::drag( S32 x, S32 y )
622 } 606 }
623 607
624 // update positions 608 // update positions
625 for( selectNode = gSelectMgr->getFirstNode(); selectNode != NULL; selectNode = gSelectMgr->getNextNode() ) 609 for( selectNode = mObjectSelection->getFirstNode(); selectNode != NULL; selectNode = mObjectSelection->getNextNode() )
626 { 610 {
627 object = selectNode->getObject(); 611 object = selectNode->getObject();
628 612
@@ -692,11 +676,6 @@ void LLManipRotate::drag( S32 x, S32 y )
692 } 676 }
693 } 677 }
694 678
695 if (using_linked_selection && object->getPositionAgent() != new_position)
696 {
697 send_position_update = TRUE;
698 }
699
700 // for individually selected roots, we need to counter-translate all unselected children 679 // for individually selected roots, we need to counter-translate all unselected children
701 if (object->isRootEdit() && selectNode->mIndividualSelection) 680 if (object->isRootEdit() && selectNode->mIndividualSelection)
702 { 681 {
@@ -727,27 +706,19 @@ void LLManipRotate::drag( S32 x, S32 y )
727 } 706 }
728 } 707 }
729 708
730 if ((send_position_update || send_rotation_update) && (elapsed_time > UPDATE_DELAY)) 709 // store changes to override updates
710 for (LLSelectNode* selectNode = gSelectMgr->getSelection()->getFirstNode();
711 selectNode != NULL;
712 selectNode = gSelectMgr->getSelection()->getNextNode())
731 { 713 {
732 U32 flag = UPD_NONE; 714 LLViewerObject*cur = selectNode->getObject();
733 if (send_rotation_update) 715 if( cur->permModify() && cur->permMove() && !cur->isAvatar())
734 {
735 flag |= UPD_ROTATION;
736 }
737 if (send_position_update)
738 { 716 {
739 flag |= UPD_POSITION; 717 selectNode->mLastRotation = cur->getRotation();
718 selectNode->mLastPositionLocal = cur->getPosition();
740 } 719 }
720 }
741 721
742 gSelectMgr->sendMultipleUpdate( flag );
743 update_timer.reset();
744 mSendUpdateOnMouseUp = FALSE;
745 }
746 else
747 {
748 mSendUpdateOnMouseUp = TRUE;
749 }
750
751 gSelectMgr->updateSelectionCenter(); 722 gSelectMgr->updateSelectionCenter();
752 723
753 // RN: just clear focus so camera doesn't follow spurious object updates 724 // RN: just clear focus so camera doesn't follow spurious object updates
@@ -785,7 +756,7 @@ void LLManipRotate::renderSnapGuides()
785 756
786 LLVector3 center = gAgent.getPosAgentFromGlobal( mRotationCenter ); 757 LLVector3 center = gAgent.getPosAgentFromGlobal( mRotationCenter );
787 LLVector3 cam_at_axis; 758 LLVector3 cam_at_axis;
788 if (gSelectMgr->getSelectType() == SELECT_TYPE_HUD) 759 if (mObjectSelection->getSelectType() == SELECT_TYPE_HUD)
789 { 760 {
790 cam_at_axis.setVec(1.f, 0.f, 0.f); 761 cam_at_axis.setVec(1.f, 0.f, 0.f);
791 } 762 }
@@ -799,7 +770,7 @@ void LLManipRotate::renderSnapGuides()
799 LLVector3 test_axis = constraint_axis; 770 LLVector3 test_axis = constraint_axis;
800 771
801 BOOL constrain_to_ref_object = FALSE; 772 BOOL constrain_to_ref_object = FALSE;
802 if (gSelectMgr->getSelectType() == SELECT_TYPE_ATTACHMENT && gAgent.getAvatarObject()) 773 if (mObjectSelection->getSelectType() == SELECT_TYPE_ATTACHMENT && gAgent.getAvatarObject())
803 { 774 {
804 test_axis = test_axis * ~grid_rotation; 775 test_axis = test_axis * ~grid_rotation;
805 } 776 }
@@ -826,7 +797,7 @@ void LLManipRotate::renderSnapGuides()
826 } 797 }
827 798
828 LLVector3 projected_snap_axis = world_snap_axis; 799 LLVector3 projected_snap_axis = world_snap_axis;
829 if (gSelectMgr->getSelectType() == SELECT_TYPE_ATTACHMENT && gAgent.getAvatarObject()) 800 if (mObjectSelection->getSelectType() == SELECT_TYPE_ATTACHMENT && gAgent.getAvatarObject())
830 { 801 {
831 projected_snap_axis = projected_snap_axis * grid_rotation; 802 projected_snap_axis = projected_snap_axis * grid_rotation;
832 } 803 }
@@ -966,32 +937,32 @@ void LLManipRotate::renderSnapGuides()
966 { 937 {
967 if (i == 0) 938 if (i == 0)
968 { 939 {
969 renderTickText(text_point, gSelectMgr->selectionIsAttachment() ? "Forward" : "East", LLColor4::white); 940 renderTickText(text_point, mObjectSelection->isAttachment() ? "Forward" : "East", LLColor4::white);
970 } 941 }
971 else if (i == 16) 942 else if (i == 16)
972 { 943 {
973 if (constraint_axis.mV[VZ] > 0.f) 944 if (constraint_axis.mV[VZ] > 0.f)
974 { 945 {
975 renderTickText(text_point, gSelectMgr->selectionIsAttachment() ? "Left" : "North", LLColor4::white); 946 renderTickText(text_point, mObjectSelection->isAttachment() ? "Left" : "North", LLColor4::white);
976 } 947 }
977 else 948 else
978 { 949 {
979 renderTickText(text_point, gSelectMgr->selectionIsAttachment() ? "Right" : "South", LLColor4::white); 950 renderTickText(text_point, mObjectSelection->isAttachment() ? "Right" : "South", LLColor4::white);
980 } 951 }
981 } 952 }
982 else if (i == 32) 953 else if (i == 32)
983 { 954 {
984 renderTickText(text_point, gSelectMgr->selectionIsAttachment() ? "Back" : "West", LLColor4::white); 955 renderTickText(text_point, mObjectSelection->isAttachment() ? "Back" : "West", LLColor4::white);
985 } 956 }
986 else 957 else
987 { 958 {
988 if (constraint_axis.mV[VZ] > 0.f) 959 if (constraint_axis.mV[VZ] > 0.f)
989 { 960 {
990 renderTickText(text_point, gSelectMgr->selectionIsAttachment() ? "Right" : "South", LLColor4::white); 961 renderTickText(text_point, mObjectSelection->isAttachment() ? "Right" : "South", LLColor4::white);
991 } 962 }
992 else 963 else
993 { 964 {
994 renderTickText(text_point, gSelectMgr->selectionIsAttachment() ? "Left" : "North", LLColor4::white); 965 renderTickText(text_point, mObjectSelection->isAttachment() ? "Left" : "North", LLColor4::white);
995 } 966 }
996 } 967 }
997 } 968 }
@@ -999,7 +970,7 @@ void LLManipRotate::renderSnapGuides()
999 { 970 {
1000 if (i == 0) 971 if (i == 0)
1001 { 972 {
1002 renderTickText(text_point, gSelectMgr->selectionIsAttachment() ? "Left" : "North", LLColor4::white); 973 renderTickText(text_point, mObjectSelection->isAttachment() ? "Left" : "North", LLColor4::white);
1003 } 974 }
1004 else if (i == 16) 975 else if (i == 16)
1005 { 976 {
@@ -1014,7 +985,7 @@ void LLManipRotate::renderSnapGuides()
1014 } 985 }
1015 else if (i == 32) 986 else if (i == 32)
1016 { 987 {
1017 renderTickText(text_point, gSelectMgr->selectionIsAttachment() ? "Right" : "South", LLColor4::white); 988 renderTickText(text_point, mObjectSelection->isAttachment() ? "Right" : "South", LLColor4::white);
1018 } 989 }
1019 else 990 else
1020 { 991 {
@@ -1038,11 +1009,11 @@ void LLManipRotate::renderSnapGuides()
1038 { 1009 {
1039 if (constraint_axis.mV[VY] > 0.f) 1010 if (constraint_axis.mV[VY] > 0.f)
1040 { 1011 {
1041 renderTickText(text_point, gSelectMgr->selectionIsAttachment() ? "Forward" : "East", LLColor4::white); 1012 renderTickText(text_point, mObjectSelection->isAttachment() ? "Forward" : "East", LLColor4::white);
1042 } 1013 }
1043 else 1014 else
1044 { 1015 {
1045 renderTickText(text_point, gSelectMgr->selectionIsAttachment() ? "Back" : "West", LLColor4::white); 1016 renderTickText(text_point, mObjectSelection->isAttachment() ? "Back" : "West", LLColor4::white);
1046 } 1017 }
1047 } 1018 }
1048 else if (i == 32) 1019 else if (i == 32)
@@ -1053,11 +1024,11 @@ void LLManipRotate::renderSnapGuides()
1053 { 1024 {
1054 if (constraint_axis.mV[VY] > 0.f) 1025 if (constraint_axis.mV[VY] > 0.f)
1055 { 1026 {
1056 renderTickText(text_point, gSelectMgr->selectionIsAttachment() ? "Back" : "West", LLColor4::white); 1027 renderTickText(text_point, mObjectSelection->isAttachment() ? "Back" : "West", LLColor4::white);
1057 } 1028 }
1058 else 1029 else
1059 { 1030 {
1060 renderTickText(text_point, gSelectMgr->selectionIsAttachment() ? "Forward" : "East", LLColor4::white); 1031 renderTickText(text_point, mObjectSelection->isAttachment() ? "Forward" : "East", LLColor4::white);
1061 } 1032 }
1062 } 1033 }
1063 } 1034 }
@@ -1072,7 +1043,7 @@ void LLManipRotate::renderSnapGuides()
1072 getObjectAxisClosestToMouse(object_axis); 1043 getObjectAxisClosestToMouse(object_axis);
1073 1044
1074 // project onto constraint plane 1045 // project onto constraint plane
1075 LLSelectNode* first_node = gSelectMgr->getFirstMoveableNode(TRUE); 1046 LLSelectNode* first_node = mObjectSelection->getFirstMoveableNode(TRUE);
1076 object_axis = object_axis * first_node->getObject()->getRenderRotation(); 1047 object_axis = object_axis * first_node->getObject()->getRenderRotation();
1077 object_axis = object_axis - (object_axis * getConstraintAxis()) * getConstraintAxis(); 1048 object_axis = object_axis - (object_axis * getConstraintAxis()) * getConstraintAxis();
1078 object_axis.normVec(); 1049 object_axis.normVec();
@@ -1156,7 +1127,7 @@ BOOL LLManipRotate::updateVisiblity()
1156 BOOL visible = FALSE; 1127 BOOL visible = FALSE;
1157 1128
1158 LLVector3 center = gAgent.getPosAgentFromGlobal( mRotationCenter ); 1129 LLVector3 center = gAgent.getPosAgentFromGlobal( mRotationCenter );
1159 if (gSelectMgr->getSelectType() == SELECT_TYPE_HUD) 1130 if (mObjectSelection->getSelectType() == SELECT_TYPE_HUD)
1160 { 1131 {
1161 mCenterToCam = LLVector3(-1.f / gAgent.getAvatarObject()->mHUDCurZoom, 0.f, 0.f); 1132 mCenterToCam = LLVector3(-1.f / gAgent.getAvatarObject()->mHUDCurZoom, 0.f, 0.f);
1162 mCenterToCamNorm = mCenterToCam; 1133 mCenterToCamNorm = mCenterToCam;
@@ -1265,7 +1236,7 @@ LLQuaternion LLManipRotate::dragUnconstrained( S32 x, S32 y )
1265 F32 angle = (-1.f + dist_to_intersection / dist_to_tangent_point) * in_sphere_angle; 1236 F32 angle = (-1.f + dist_to_intersection / dist_to_tangent_point) * in_sphere_angle;
1266 1237
1267 LLVector3 axis; 1238 LLVector3 axis;
1268 if (gSelectMgr->getSelectType() == SELECT_TYPE_HUD) 1239 if (mObjectSelection->getSelectType() == SELECT_TYPE_HUD)
1269 { 1240 {
1270 axis = LLVector3(-1.f, 0.f, 0.f) % profile_center_to_intersection; 1241 axis = LLVector3(-1.f, 0.f, 0.f) % profile_center_to_intersection;
1271 } 1242 }
@@ -1308,7 +1279,7 @@ LLVector3 LLManipRotate::getConstraintAxis()
1308 1279
1309 gSelectMgr->getGrid(grid_origin, grid_rotation, grid_scale); 1280 gSelectMgr->getGrid(grid_origin, grid_rotation, grid_scale);
1310 1281
1311 LLSelectNode* first_node = gSelectMgr->getFirstMoveableNode(TRUE); 1282 LLSelectNode* first_node = mObjectSelection->getFirstMoveableNode(TRUE);
1312 if (first_node) 1283 if (first_node)
1313 { 1284 {
1314 // *FIX: get agent local attachment grid working 1285 // *FIX: get agent local attachment grid working
@@ -1322,7 +1293,7 @@ LLVector3 LLManipRotate::getConstraintAxis()
1322 1293
1323LLQuaternion LLManipRotate::dragConstrained( S32 x, S32 y ) 1294LLQuaternion LLManipRotate::dragConstrained( S32 x, S32 y )
1324{ 1295{
1325 LLSelectNode* first_object_node = gSelectMgr->getFirstMoveableNode(TRUE); 1296 LLSelectNode* first_object_node = mObjectSelection->getFirstMoveableNode(TRUE);
1326 LLVector3 constraint_axis = getConstraintAxis(); 1297 LLVector3 constraint_axis = getConstraintAxis();
1327 LLVector3 center = gAgent.getPosAgentFromGlobal( mRotationCenter ); 1298 LLVector3 center = gAgent.getPosAgentFromGlobal( mRotationCenter );
1328 1299
@@ -1339,7 +1310,7 @@ LLQuaternion LLManipRotate::dragConstrained( S32 x, S32 y )
1339 LLVector3 axis2; 1310 LLVector3 axis2;
1340 1311
1341 LLVector3 test_axis = constraint_axis; 1312 LLVector3 test_axis = constraint_axis;
1342 if (gSelectMgr->getSelectType() == SELECT_TYPE_ATTACHMENT && gAgent.getAvatarObject()) 1313 if (mObjectSelection->getSelectType() == SELECT_TYPE_ATTACHMENT && gAgent.getAvatarObject())
1343 { 1314 {
1344 test_axis = test_axis * ~grid_rotation; 1315 test_axis = test_axis * ~grid_rotation;
1345 } 1316 }
@@ -1363,7 +1334,7 @@ LLQuaternion LLManipRotate::dragConstrained( S32 x, S32 y )
1363 axis1 = LLVector3::x_axis; 1334 axis1 = LLVector3::x_axis;
1364 } 1335 }
1365 1336
1366 if (gSelectMgr->getSelectType() == SELECT_TYPE_ATTACHMENT && gAgent.getAvatarObject()) 1337 if (mObjectSelection->getSelectType() == SELECT_TYPE_ATTACHMENT && gAgent.getAvatarObject())
1367 { 1338 {
1368 axis1 = axis1 * grid_rotation; 1339 axis1 = axis1 * grid_rotation;
1369 } 1340 }
@@ -1385,7 +1356,7 @@ LLQuaternion LLManipRotate::dragConstrained( S32 x, S32 y )
1385 // We're looking at the ring edge-on. 1356 // We're looking at the ring edge-on.
1386 LLVector3 snap_plane_center = (center + (constraint_axis * mRadiusMeters * 0.5f)); 1357 LLVector3 snap_plane_center = (center + (constraint_axis * mRadiusMeters * 0.5f));
1387 LLVector3 cam_to_snap_plane; 1358 LLVector3 cam_to_snap_plane;
1388 if (gSelectMgr->getSelectType() == SELECT_TYPE_HUD) 1359 if (mObjectSelection->getSelectType() == SELECT_TYPE_HUD)
1389 { 1360 {
1390 cam_to_snap_plane.setVec(1.f, 0.f, 0.f); 1361 cam_to_snap_plane.setVec(1.f, 0.f, 0.f);
1391 } 1362 }
@@ -1435,7 +1406,7 @@ LLQuaternion LLManipRotate::dragConstrained( S32 x, S32 y )
1435 { 1406 {
1436 // try other plane 1407 // try other plane
1437 snap_plane_center = (center - (constraint_axis * mRadiusMeters * 0.5f)); 1408 snap_plane_center = (center - (constraint_axis * mRadiusMeters * 0.5f));
1438 if (gSelectMgr->getSelectType() == SELECT_TYPE_HUD) 1409 if (mObjectSelection->getSelectType() == SELECT_TYPE_HUD)
1439 { 1410 {
1440 cam_to_snap_plane.setVec(1.f, 0.f, 0.f); 1411 cam_to_snap_plane.setVec(1.f, 0.f, 0.f);
1441 } 1412 }
@@ -1482,7 +1453,7 @@ LLQuaternion LLManipRotate::dragConstrained( S32 x, S32 y )
1482 if (snap_plane > 0) 1453 if (snap_plane > 0)
1483 { 1454 {
1484 LLVector3 cam_at_axis; 1455 LLVector3 cam_at_axis;
1485 if (gSelectMgr->getSelectType() == SELECT_TYPE_HUD) 1456 if (mObjectSelection->getSelectType() == SELECT_TYPE_HUD)
1486 { 1457 {
1487 cam_at_axis.setVec(1.f, 0.f, 0.f); 1458 cam_at_axis.setVec(1.f, 0.f, 0.f);
1488 } 1459 }
@@ -1680,9 +1651,10 @@ LLVector3 LLManipRotate::intersectRayWithSphere( const LLVector3& ray_pt, const
1680} 1651}
1681 1652
1682// Utility function. Should probably be moved to another class. 1653// Utility function. Should probably be moved to another class.
1654//static
1683void LLManipRotate::mouseToRay( S32 x, S32 y, LLVector3* ray_pt, LLVector3* ray_dir ) 1655void LLManipRotate::mouseToRay( S32 x, S32 y, LLVector3* ray_pt, LLVector3* ray_dir )
1684{ 1656{
1685 if (gSelectMgr->getSelectType() == SELECT_TYPE_HUD) 1657 if (gSelectMgr->getSelection()->getSelectType() == SELECT_TYPE_HUD)
1686 { 1658 {
1687 F32 mouse_x = (((F32)x / gViewerWindow->getWindowWidth()) - 0.5f) / gAgent.getAvatarObject()->mHUDCurZoom; 1659 F32 mouse_x = (((F32)x / gViewerWindow->getWindowWidth()) - 0.5f) / gAgent.getAvatarObject()->mHUDCurZoom;
1688 F32 mouse_y = ((((F32)y) / gViewerWindow->getWindowHeight()) - 0.5f) / gAgent.getAvatarObject()->mHUDCurZoom; 1660 F32 mouse_y = ((((F32)y) / gViewerWindow->getWindowHeight()) - 0.5f) / gAgent.getAvatarObject()->mHUDCurZoom;
@@ -1704,7 +1676,7 @@ void LLManipRotate::highlightManipulators( S32 x, S32 y )
1704 mHighlightedPart = LL_NO_PART; 1676 mHighlightedPart = LL_NO_PART;
1705 1677
1706 //LLBBox bbox = gSelectMgr->getBBoxOfSelection(); 1678 //LLBBox bbox = gSelectMgr->getBBoxOfSelection();
1707 LLViewerObject *first_object = gSelectMgr->getFirstMoveableObject(TRUE); 1679 LLViewerObject *first_object = mObjectSelection->getFirstMoveableObject(TRUE);
1708 1680
1709 if (!first_object) 1681 if (!first_object)
1710 { 1682 {
@@ -1840,7 +1812,7 @@ void LLManipRotate::highlightManipulators( S32 x, S32 y )
1840 1812
1841S32 LLManipRotate::getObjectAxisClosestToMouse(LLVector3& object_axis) 1813S32 LLManipRotate::getObjectAxisClosestToMouse(LLVector3& object_axis)
1842{ 1814{
1843 LLSelectNode* first_object_node = gSelectMgr->getFirstMoveableNode(TRUE); 1815 LLSelectNode* first_object_node = mObjectSelection->getFirstMoveableNode(TRUE);
1844 1816
1845 if (!first_object_node) 1817 if (!first_object_node)
1846 { 1818 {
diff --git a/linden/indra/newview/llmanipscale.cpp b/linden/indra/newview/llmanipscale.cpp
index f143c5a..d520fbe 100644
--- a/linden/indra/newview/llmanipscale.cpp
+++ b/linden/indra/newview/llmanipscale.cpp
@@ -159,6 +159,7 @@ void LLManipScale::handleSelect()
159 updateSnapGuides(bbox); 159 updateSnapGuides(bbox);
160 gSelectMgr->saveSelectedObjectTransform(SELECT_ACTION_TYPE_PICK); 160 gSelectMgr->saveSelectedObjectTransform(SELECT_ACTION_TYPE_PICK);
161 gFloaterTools->setStatusText("Click and drag to stretch selected side"); 161 gFloaterTools->setStatusText("Click and drag to stretch selected side");
162 LLManip::handleSelect();
162} 163}
163 164
164void LLManipScale::handleDeselect() 165void LLManipScale::handleDeselect()
@@ -166,6 +167,7 @@ void LLManipScale::handleDeselect()
166 mHighlightedPart = LL_NO_PART; 167 mHighlightedPart = LL_NO_PART;
167 mManipPart = LL_NO_PART; 168 mManipPart = LL_NO_PART;
168 gFloaterTools->setStatusText(""); 169 gFloaterTools->setStatusText("");
170 LLManip::handleDeselect();
169} 171}
170 172
171BOOL sort_manip_by_z(LLManipScale::ManipulatorHandle *new_manip, LLManipScale::ManipulatorHandle *test_manip) 173BOOL sort_manip_by_z(LLManipScale::ManipulatorHandle *new_manip, LLManipScale::ManipulatorHandle *test_manip)
@@ -215,7 +217,7 @@ void LLManipScale::render()
215 { 217 {
216 glMatrixMode(GL_MODELVIEW); 218 glMatrixMode(GL_MODELVIEW);
217 glPushMatrix(); 219 glPushMatrix();
218 if (gSelectMgr->getSelectType() == SELECT_TYPE_HUD) 220 if (mObjectSelection->getSelectType() == SELECT_TYPE_HUD)
219 { 221 {
220 F32 zoom = gAgent.getAvatarObject()->mHUDCurZoom; 222 F32 zoom = gAgent.getAvatarObject()->mHUDCurZoom;
221 glScalef(zoom, zoom, zoom); 223 glScalef(zoom, zoom, zoom);
@@ -231,7 +233,7 @@ void LLManipScale::render()
231 233
232 F32 range; 234 F32 range;
233 F32 range_from_agent; 235 F32 range_from_agent;
234 if (gSelectMgr->getSelectType() == SELECT_TYPE_HUD) 236 if (mObjectSelection->getSelectType() == SELECT_TYPE_HUD)
235 { 237 {
236 mBoxHandleSize = BOX_HANDLE_BASE_SIZE * BOX_HANDLE_BASE_FACTOR / (F32) gCamera->getViewHeightInPixels(); 238 mBoxHandleSize = BOX_HANDLE_BASE_SIZE * BOX_HANDLE_BASE_FACTOR / (F32) gCamera->getViewHeightInPixels();
237 mBoxHandleSize /= gAgent.getAvatarObject()->mHUDCurZoom; 239 mBoxHandleSize /= gAgent.getAvatarObject()->mHUDCurZoom;
@@ -330,10 +332,10 @@ BOOL LLManipScale::handleMouseDown(S32 x, S32 y, MASK mask)
330// Assumes that one of the arrows on an object was hit. 332// Assumes that one of the arrows on an object was hit.
331BOOL LLManipScale::handleMouseDownOnPart( S32 x, S32 y, MASK mask ) 333BOOL LLManipScale::handleMouseDownOnPart( S32 x, S32 y, MASK mask )
332{ 334{
333 BOOL can_scale = gSelectMgr->getObjectCount() != 0; 335 BOOL can_scale = mObjectSelection->getObjectCount() != 0;
334 for (LLViewerObject* objectp = gSelectMgr->getFirstObject(); 336 for (LLViewerObject* objectp = mObjectSelection->getFirstObject();
335 objectp; 337 objectp;
336 objectp = gSelectMgr->getNextObject()) 338 objectp = mObjectSelection->getNextObject())
337 { 339 {
338 can_scale = can_scale && objectp->permModify() && objectp->permMove() && !objectp->isSeat(); 340 can_scale = can_scale && objectp->permModify() && objectp->permMove() && !objectp->isSeat();
339 } 341 }
@@ -377,15 +379,27 @@ BOOL LLManipScale::handleMouseUp(S32 x, S32 y, MASK mask)
377 // first, perform normal processing in case this was a quick-click 379 // first, perform normal processing in case this was a quick-click
378 handleHover(x, y, mask); 380 handleHover(x, y, mask);
379 381
382 if( (LL_FACE_MIN <= (S32)mManipPart)
383 && ((S32)mManipPart <= LL_FACE_MAX) )
384 {
385 sendUpdates(TRUE,TRUE,FALSE);
386 }
387 else
388 if( (LL_CORNER_MIN <= (S32)mManipPart)
389 && ((S32)mManipPart <= LL_CORNER_MAX) )
390 {
391 sendUpdates(TRUE,TRUE,TRUE);
392 }
393
394 //send texture update
395 gSelectMgr->adjustTexturesByScale(TRUE, getStretchTextures());
396
380 gSelectMgr->enableSilhouette(TRUE); 397 gSelectMgr->enableSilhouette(TRUE);
381 mManipPart = LL_NO_PART; 398 mManipPart = LL_NO_PART;
382 399
383 // Might have missed last update due to UPDATE_DELAY timing 400 // Might have missed last update due to UPDATE_DELAY timing
384 if (mSendUpdateOnMouseUp) 401 gSelectMgr->sendMultipleUpdate( mLastUpdateFlags );
385 { 402
386 gSelectMgr->sendMultipleUpdate( mLastUpdateFlags );
387 }
388
389 //gAgent.setObjectTracking(gSavedSettings.getBOOL("TrackFocusObject")); 403 //gAgent.setObjectTracking(gSavedSettings.getBOOL("TrackFocusObject"));
390 gSelectMgr->saveSelectedObjectTransform(SELECT_ACTION_TYPE_PICK); 404 gSelectMgr->saveSelectedObjectTransform(SELECT_ACTION_TYPE_PICK);
391 return LLManip::handleMouseUp(x, y, mask); 405 return LLManip::handleMouseUp(x, y, mask);
@@ -396,7 +410,7 @@ BOOL LLManipScale::handleHover(S32 x, S32 y, MASK mask)
396{ 410{
397 if( hasMouseCapture() ) 411 if( hasMouseCapture() )
398 { 412 {
399 if( gSelectMgr->isEmpty() ) 413 if( mObjectSelection->isEmpty() )
400 { 414 {
401 // Somehow the object got deselected while we were dragging it. 415 // Somehow the object got deselected while we were dragging it.
402 setMouseCapture( FALSE ); 416 setMouseCapture( FALSE );
@@ -415,7 +429,7 @@ BOOL LLManipScale::handleHover(S32 x, S32 y, MASK mask)
415 } 429 }
416 430
417 // Patch up textures, if possible. 431 // Patch up textures, if possible.
418 gSelectMgr->adjustTexturesByScale(TRUE, getStretchTextures()); 432 gSelectMgr->adjustTexturesByScale(FALSE, getStretchTextures());
419 433
420 gViewerWindow->getWindow()->setCursor(UI_CURSOR_TOOLSCALE); 434 gViewerWindow->getWindow()->setCursor(UI_CURSOR_TOOLSCALE);
421 return TRUE; 435 return TRUE;
@@ -432,7 +446,7 @@ void LLManipScale::highlightManipulators(S32 x, S32 y)
432 if( isSelectionScalable() ) 446 if( isSelectionScalable() )
433 { 447 {
434 LLMatrix4 transform; 448 LLMatrix4 transform;
435 if (gSelectMgr->getSelectType() == SELECT_TYPE_HUD) 449 if (mObjectSelection->getSelectType() == SELECT_TYPE_HUD)
436 { 450 {
437 LLVector4 translation(bbox.getPositionAgent()); 451 LLVector4 translation(bbox.getPositionAgent());
438 transform.initRotTrans(bbox.getRotation(), translation); 452 transform.initRotTrans(bbox.getRotation(), translation);
@@ -473,7 +487,7 @@ void LLManipScale::highlightManipulators(S32 x, S32 y)
473 mManipulatorVertices[numManips++] = LLVector4(max.mV[VX], max.mV[VY], max.mV[VZ], 1.f); 487 mManipulatorVertices[numManips++] = LLVector4(max.mV[VX], max.mV[VY], max.mV[VZ], 1.f);
474 488
475 // 1-D highlights are applicable iff one object is selected 489 // 1-D highlights are applicable iff one object is selected
476 if( gSelectMgr->getObjectCount() == 1 ) 490 if( mObjectSelection->getObjectCount() == 1 )
477 { 491 {
478 // face centers 492 // face centers
479 mManipulatorVertices[numManips++] = LLVector4(ctr.mV[VX], ctr.mV[VY], max.mV[VZ], 1.f); 493 mManipulatorVertices[numManips++] = LLVector4(ctr.mV[VX], ctr.mV[VY], max.mV[VZ], 1.f);
@@ -539,7 +553,7 @@ void LLManipScale::renderFaces( const LLBBox& bbox )
539{ 553{
540 // Don't bother to render the drag handles for 1-D scaling if 554 // Don't bother to render the drag handles for 1-D scaling if
541 // more than one object is selected or if it is an attachment 555 // more than one object is selected or if it is an attachment
542 if ( gSelectMgr->getObjectCount() > 1 ) 556 if ( mObjectSelection->getObjectCount() > 1 )
543 { 557 {
544 return; 558 return;
545 } 559 }
@@ -806,8 +820,21 @@ void LLManipScale::drag( S32 x, S32 y )
806 dragCorner( x, y ); 820 dragCorner( x, y );
807 } 821 }
808 822
809 //gAgent.setObjectTracking(FALSE); 823 // store changes to override updates
810 gAgent.clearFocusObject(); 824 for (LLSelectNode* selectNode = gSelectMgr->getSelection()->getFirstNode();
825 selectNode != NULL;
826 selectNode = gSelectMgr->getSelection()->getNextNode())
827 {
828 LLViewerObject*cur = selectNode->getObject();
829 if( cur->permModify() && cur->permMove() && !cur->isAvatar())
830 {
831 selectNode->mLastScale = cur->getScale();
832 selectNode->mLastPositionLocal = cur->getPosition();
833 }
834 }
835
836 gSelectMgr->updateSelectionCenter();
837 gAgent.clearFocusObject();
811} 838}
812 839
813// Scale around the 840// Scale around the
@@ -818,10 +845,7 @@ void LLManipScale::dragCorner( S32 x, S32 y )
818 // Suppress scale if mouse hasn't moved. 845 // Suppress scale if mouse hasn't moved.
819 if (x == mLastMouseX && y == mLastMouseY) 846 if (x == mLastMouseX && y == mLastMouseY)
820 { 847 {
821 if (mSendUpdateOnMouseUp) 848 // sendUpdates(TRUE,TRUE,TRUE);
822 {
823 sendUpdates(TRUE,TRUE,TRUE);
824 }
825 return; 849 return;
826 } 850 }
827 851
@@ -945,7 +969,7 @@ void LLManipScale::dragCorner( S32 x, S32 y )
945 969
946 // find max and min scale factors that will make biggest object hit max absolute scale and smallest object hit min absolute scale 970 // find max and min scale factors that will make biggest object hit max absolute scale and smallest object hit min absolute scale
947 LLSelectNode* selectNode; 971 LLSelectNode* selectNode;
948 for( selectNode = gSelectMgr->getFirstNode(); selectNode; selectNode = gSelectMgr->getNextNode() ) 972 for( selectNode = mObjectSelection->getFirstNode(); selectNode; selectNode = mObjectSelection->getNextNode() )
949 { 973 {
950 LLViewerObject* cur = selectNode->getObject(); 974 LLViewerObject* cur = selectNode->getObject();
951 if( cur->permModify() && cur->permMove() && !cur->isAvatar() ) 975 if( cur->permModify() && cur->permMove() && !cur->isAvatar() )
@@ -965,7 +989,7 @@ void LLManipScale::dragCorner( S32 x, S32 y )
965 LLVector3d drag_global = uniform ? mDragStartCenterGlobal : mDragFarHitGlobal; 989 LLVector3d drag_global = uniform ? mDragStartCenterGlobal : mDragFarHitGlobal;
966 990
967 // do the root objects i.e. (TRUE == cur->isRootEdit()) 991 // do the root objects i.e. (TRUE == cur->isRootEdit())
968 for( selectNode = gSelectMgr->getFirstNode(); selectNode; selectNode = gSelectMgr->getNextNode() ) 992 for( selectNode = mObjectSelection->getFirstNode(); selectNode; selectNode = mObjectSelection->getNextNode() )
969 { 993 {
970 LLViewerObject* cur = selectNode->getObject(); 994 LLViewerObject* cur = selectNode->getObject();
971 if( cur->permModify() && cur->permMove() && !cur->isAvatar() && cur->isRootEdit() ) 995 if( cur->permModify() && cur->permMove() && !cur->isAvatar() && cur->isRootEdit() )
@@ -1009,7 +1033,7 @@ void LLManipScale::dragCorner( S32 x, S32 y )
1009 } 1033 }
1010 } 1034 }
1011 // do the child objects i.e. (FALSE == cur->isRootEdit()) 1035 // do the child objects i.e. (FALSE == cur->isRootEdit())
1012 for( selectNode = gSelectMgr->getFirstNode(); selectNode; selectNode = gSelectMgr->getNextNode() ) 1036 for( selectNode = mObjectSelection->getFirstNode(); selectNode; selectNode = mObjectSelection->getNextNode() )
1013 { 1037 {
1014 LLViewerObject*cur = selectNode->getObject(); 1038 LLViewerObject*cur = selectNode->getObject();
1015 if( cur->permModify() && cur->permMove() && !cur->isAvatar() && !cur->isRootEdit() ) 1039 if( cur->permModify() && cur->permMove() && !cur->isAvatar() && !cur->isRootEdit() )
@@ -1020,11 +1044,8 @@ void LLManipScale::dragCorner( S32 x, S32 y )
1020 if (!selectNode->mIndividualSelection) 1044 if (!selectNode->mIndividualSelection)
1021 { 1045 {
1022 cur->setPosition(selectNode->mSavedPositionLocal * scale_factor); 1046 cur->setPosition(selectNode->mSavedPositionLocal * scale_factor);
1023 continue;
1024 } 1047 }
1025 1048
1026 LLVector3d new_pos_global = drag_global + (selectNode->mSavedPositionGlobal - drag_global) * scale_factor;
1027 cur->setPositionAbsoluteGlobal( new_pos_global );
1028 rebuild(cur); 1049 rebuild(cur);
1029 } 1050 }
1030 } 1051 }
@@ -1032,8 +1053,6 @@ void LLManipScale::dragCorner( S32 x, S32 y )
1032 1053
1033 1054
1034 mDragPointGlobal = drag_point_global; 1055 mDragPointGlobal = drag_point_global;
1035
1036 sendUpdates( TRUE, TRUE, TRUE );
1037} 1056}
1038 1057
1039 1058
@@ -1042,10 +1061,7 @@ void LLManipScale::dragFace( S32 x, S32 y )
1042 // Suppress scale if mouse hasn't moved. 1061 // Suppress scale if mouse hasn't moved.
1043 if (x == mLastMouseX && y == mLastMouseY) 1062 if (x == mLastMouseX && y == mLastMouseY)
1044 { 1063 {
1045 if (mSendUpdateOnMouseUp) 1064 // sendUpdates(TRUE,TRUE,FALSE);
1046 {
1047 sendUpdates(TRUE,TRUE,FALSE);
1048 }
1049 return; 1065 return;
1050 } 1066 }
1051 1067
@@ -1179,8 +1195,6 @@ void LLManipScale::dragFace( S32 x, S32 y )
1179 send_scale_update = TRUE; 1195 send_scale_update = TRUE;
1180 1196
1181 mDragPointGlobal = drag_point_global; 1197 mDragPointGlobal = drag_point_global;
1182
1183 sendUpdates( send_position_update, send_scale_update );
1184} 1198}
1185 1199
1186void LLManipScale::sendUpdates( BOOL send_position_update, BOOL send_scale_update, BOOL corner ) 1200void LLManipScale::sendUpdates( BOOL send_position_update, BOOL send_scale_update, BOOL corner )
@@ -1215,8 +1229,6 @@ void LLManipScale::sendUpdates( BOOL send_position_update, BOOL send_scale_updat
1215 { 1229 {
1216 mSendUpdateOnMouseUp = TRUE; 1230 mSendUpdateOnMouseUp = TRUE;
1217 } 1231 }
1218
1219 gSelectMgr->updateSelectionCenter();
1220 dialog_refresh_all(); 1232 dialog_refresh_all();
1221 } 1233 }
1222} 1234}
@@ -1228,7 +1240,7 @@ void LLManipScale::stretchFace( const LLVector3& drag_start_agent, const LLVecto
1228 LLVector3 drag_start_center_agent = gAgent.getPosAgentFromGlobal(mDragStartCenterGlobal); 1240 LLVector3 drag_start_center_agent = gAgent.getPosAgentFromGlobal(mDragStartCenterGlobal);
1229 1241
1230 LLSelectNode *selectNode; 1242 LLSelectNode *selectNode;
1231 for( selectNode = gSelectMgr->getFirstNode(); selectNode; selectNode = gSelectMgr->getNextNode() ) 1243 for( selectNode = mObjectSelection->getFirstNode(); selectNode; selectNode = mObjectSelection->getNextNode() )
1232 { 1244 {
1233 LLViewerObject*cur = selectNode->getObject(); 1245 LLViewerObject*cur = selectNode->getObject();
1234 if( cur->permModify() && cur->permMove() && !cur->isAvatar() ) 1246 if( cur->permModify() && cur->permMove() && !cur->isAvatar() )
@@ -1349,7 +1361,7 @@ void LLManipScale::updateSnapGuides(const LLBBox& bbox)
1349 mScaleDir = box_corner_agent - mScaleCenter; 1361 mScaleDir = box_corner_agent - mScaleCenter;
1350 mScaleDir.normVec(); 1362 mScaleDir.normVec();
1351 1363
1352 if(gSelectMgr->getSelectType() == SELECT_TYPE_HUD) 1364 if(mObjectSelection->getSelectType() == SELECT_TYPE_HUD)
1353 { 1365 {
1354 mSnapRegimeOffset = SNAP_GUIDE_SCREEN_OFFSET / gAgent.getAvatarObject()->mHUDCurZoom; 1366 mSnapRegimeOffset = SNAP_GUIDE_SCREEN_OFFSET / gAgent.getAvatarObject()->mHUDCurZoom;
1355 1367
@@ -1361,7 +1373,7 @@ void LLManipScale::updateSnapGuides(const LLBBox& bbox)
1361 } 1373 }
1362 LLVector3 cam_at_axis; 1374 LLVector3 cam_at_axis;
1363 F32 snap_guide_length; 1375 F32 snap_guide_length;
1364 if (gSelectMgr->getSelectType() == SELECT_TYPE_HUD) 1376 if (mObjectSelection->getSelectType() == SELECT_TYPE_HUD)
1365 { 1377 {
1366 cam_at_axis.setVec(1.f, 0.f, 0.f); 1378 cam_at_axis.setVec(1.f, 0.f, 0.f);
1367 snap_guide_length = SNAP_GUIDE_SCREEN_LENGTH / gAgent.getAvatarObject()->mHUDCurZoom; 1379 snap_guide_length = SNAP_GUIDE_SCREEN_LENGTH / gAgent.getAvatarObject()->mHUDCurZoom;
@@ -1408,7 +1420,7 @@ void LLManipScale::updateSnapGuides(const LLBBox& bbox)
1408 { 1420 {
1409 LLVector3 local_scale_dir = partToUnitVector( mManipPart ); 1421 LLVector3 local_scale_dir = partToUnitVector( mManipPart );
1410 LLVector3 local_camera_dir; 1422 LLVector3 local_camera_dir;
1411 if (gSelectMgr->getSelectType() == SELECT_TYPE_HUD) 1423 if (mObjectSelection->getSelectType() == SELECT_TYPE_HUD)
1412 { 1424 {
1413 local_camera_dir = LLVector3(-1.f, 0.f, 0.f) * ~bbox.getRotation(); 1425 local_camera_dir = LLVector3(-1.f, 0.f, 0.f) * ~bbox.getRotation();
1414 } 1426 }
@@ -1687,7 +1699,7 @@ void LLManipScale::renderSnapGuides(const LLBBox& bbox)
1687 start_tick = -(llmin(ticks_from_scale_center_1, num_ticks_per_side1)); 1699 start_tick = -(llmin(ticks_from_scale_center_1, num_ticks_per_side1));
1688 stop_tick = llmin(max_ticks1, num_ticks_per_side1); 1700 stop_tick = llmin(max_ticks1, num_ticks_per_side1);
1689 1701
1690 F32 grid_resolution = gSelectMgr->getSelectType() == SELECT_TYPE_HUD ? 0.25f : llmax(gSavedSettings.getF32("GridResolution"), 0.001f); 1702 F32 grid_resolution = mObjectSelection->getSelectType() == SELECT_TYPE_HUD ? 0.25f : llmax(gSavedSettings.getF32("GridResolution"), 0.001f);
1691 S32 label_sub_div_offset_1 = llround(fmod(dist_grid_axis - grid_offset1, mScaleSnapUnit1 * 32.f) / (mScaleSnapUnit1 / max_subdivisions)); 1703 S32 label_sub_div_offset_1 = llround(fmod(dist_grid_axis - grid_offset1, mScaleSnapUnit1 * 32.f) / (mScaleSnapUnit1 / max_subdivisions));
1692 S32 label_sub_div_offset_2 = llround(fmod(dist_grid_axis - grid_offset2, mScaleSnapUnit2 * 32.f) / (mScaleSnapUnit2 / max_subdivisions)); 1704 S32 label_sub_div_offset_2 = llround(fmod(dist_grid_axis - grid_offset2, mScaleSnapUnit2 * 32.f) / (mScaleSnapUnit2 / max_subdivisions));
1693 1705
@@ -1793,7 +1805,7 @@ void LLManipScale::renderSnapGuides(const LLBBox& bbox)
1793 1805
1794 1806
1795 // render help text 1807 // render help text
1796 if (gSelectMgr->getSelectType() != SELECT_TYPE_HUD) 1808 if (mObjectSelection->getSelectType() != SELECT_TYPE_HUD)
1797 { 1809 {
1798 if (mHelpTextTimer.getElapsedTimeF32() < sHelpTextVisibleTime + sHelpTextFadeTime && sNumTimesHelpTextShown < sMaxTimesShowHelpText) 1810 if (mHelpTextTimer.getElapsedTimeF32() < sHelpTextVisibleTime + sHelpTextFadeTime && sNumTimesHelpTextShown < sMaxTimesShowHelpText)
1799 { 1811 {
@@ -1815,10 +1827,10 @@ void LLManipScale::renderSnapGuides(const LLBBox& bbox)
1815 std::string help_text = "Move mouse cursor over ruler"; 1827 std::string help_text = "Move mouse cursor over ruler";
1816 LLColor4 help_text_color = LLColor4::white; 1828 LLColor4 help_text_color = LLColor4::white;
1817 help_text_color.mV[VALPHA] = clamp_rescale(mHelpTextTimer.getElapsedTimeF32(), sHelpTextVisibleTime, sHelpTextVisibleTime + sHelpTextFadeTime, grid_alpha, 0.f); 1829 help_text_color.mV[VALPHA] = clamp_rescale(mHelpTextTimer.getElapsedTimeF32(), sHelpTextVisibleTime, sHelpTextVisibleTime + sHelpTextFadeTime, grid_alpha, 0.f);
1818 hud_render_utf8text(help_text, help_text_pos, *big_fontp, LLFontGL::NORMAL, -0.5f * big_fontp->getWidthF32(help_text), 3.f, help_text_color, gSelectMgr->getSelectType() == SELECT_TYPE_HUD); 1830 hud_render_utf8text(help_text, help_text_pos, *big_fontp, LLFontGL::NORMAL, -0.5f * big_fontp->getWidthF32(help_text), 3.f, help_text_color, mObjectSelection->getSelectType() == SELECT_TYPE_HUD);
1819 help_text = "to snap to grid"; 1831 help_text = "to snap to grid";
1820 help_text_pos -= gCamera->getUpAxis() * mSnapRegimeOffset * 0.4f; 1832 help_text_pos -= gCamera->getUpAxis() * mSnapRegimeOffset * 0.4f;
1821 hud_render_utf8text(help_text, help_text_pos, *big_fontp, LLFontGL::NORMAL, -0.5f * big_fontp->getWidthF32(help_text), 3.f, help_text_color, gSelectMgr->getSelectType() == SELECT_TYPE_HUD); 1833 hud_render_utf8text(help_text, help_text_pos, *big_fontp, LLFontGL::NORMAL, -0.5f * big_fontp->getWidthF32(help_text), 3.f, help_text_color, mObjectSelection->getSelectType() == SELECT_TYPE_HUD);
1822 } 1834 }
1823 } 1835 }
1824 } 1836 }
@@ -2022,14 +2034,16 @@ LLVector3 LLManipScale::nearestAxis( const LLVector3& v ) const
2022 return LLVector3( coords[greatest_index] ); 2034 return LLVector3( coords[greatest_index] );
2023} 2035}
2024 2036
2025BOOL LLManipScale::isSelectionScalable() const 2037//FIXME: make this const once we switch to iterator interface
2038//(making object traversal a const-able operation)
2039BOOL LLManipScale::isSelectionScalable()
2026{ 2040{
2027 // An selection is scalable if you are allowed to both edit and move 2041 // An selection is scalable if you are allowed to both edit and move
2028 // everything in it, and it does not have any sitting agents 2042 // everything in it, and it does not have any sitting agents
2029 BOOL scalable = gSelectMgr->getFirstObject() ? TRUE : FALSE; 2043 BOOL scalable = mObjectSelection->getFirstObject() ? TRUE : FALSE;
2030 for(LLViewerObject* cur = gSelectMgr->getFirstObject(); 2044 for(LLViewerObject* cur = mObjectSelection->getFirstObject();
2031 cur; 2045 cur;
2032 cur = gSelectMgr->getNextObject() ) 2046 cur = mObjectSelection->getNextObject() )
2033 { 2047 {
2034 if( !(cur->permModify() && cur->permMove()) 2048 if( !(cur->permModify() && cur->permMove())
2035 || cur->isSeat()) 2049 || cur->isSeat())
diff --git a/linden/indra/newview/llmanipscale.h b/linden/indra/newview/llmanipscale.h
index 7ac3aef..2452e6b 100644
--- a/linden/indra/newview/llmanipscale.h
+++ b/linden/indra/newview/llmanipscale.h
@@ -113,7 +113,7 @@ private:
113 F32 partToMinScale( S32 part, const LLBBox& bbox ) const; 113 F32 partToMinScale( S32 part, const LLBBox& bbox ) const;
114 LLVector3 nearestAxis( const LLVector3& v ) const; 114 LLVector3 nearestAxis( const LLVector3& v ) const;
115 115
116 BOOL isSelectionScalable() const; 116 BOOL isSelectionScalable();
117 117
118 void stretchFace( const LLVector3& drag_start_agent, const LLVector3& drag_delta_agent); 118 void stretchFace( const LLVector3& drag_start_agent, const LLVector3& drag_delta_agent);
119 119
diff --git a/linden/indra/newview/llmaniptranslate.cpp b/linden/indra/newview/llmaniptranslate.cpp
index fea6092..bb58a9c 100644
--- a/linden/indra/newview/llmaniptranslate.cpp
+++ b/linden/indra/newview/llmaniptranslate.cpp
@@ -59,6 +59,7 @@
59#include "llworld.h" 59#include "llworld.h"
60#include "viewer.h" 60#include "viewer.h"
61#include "llui.h" 61#include "llui.h"
62#include "pipeline.h"
62 63
63const S32 NUM_AXES = 3; 64const S32 NUM_AXES = 3;
64const S32 MOUSE_DRAG_SLOP = 2; // pixels 65const S32 MOUSE_DRAG_SLOP = 2; // pixels
@@ -257,6 +258,7 @@ void LLManipTranslate::handleSelect()
257{ 258{
258 gSelectMgr->saveSelectedObjectTransform(SELECT_ACTION_TYPE_PICK); 259 gSelectMgr->saveSelectedObjectTransform(SELECT_ACTION_TYPE_PICK);
259 gFloaterTools->setStatusText("Drag to move, shift-drag to copy"); 260 gFloaterTools->setStatusText("Drag to move, shift-drag to copy");
261 LLManip::handleSelect();
260} 262}
261 263
262void LLManipTranslate::handleDeselect() 264void LLManipTranslate::handleDeselect()
@@ -264,6 +266,7 @@ void LLManipTranslate::handleDeselect()
264 mHighlightedPart = LL_NO_PART; 266 mHighlightedPart = LL_NO_PART;
265 mManipPart = LL_NO_PART; 267 mManipPart = LL_NO_PART;
266 gFloaterTools->setStatusText(""); 268 gFloaterTools->setStatusText("");
269 LLManip::handleDeselect();
267} 270}
268 271
269BOOL LLManipTranslate::handleMouseDown(S32 x, S32 y, MASK mask) 272BOOL LLManipTranslate::handleMouseDown(S32 x, S32 y, MASK mask)
@@ -289,10 +292,10 @@ BOOL LLManipTranslate::handleMouseDown(S32 x, S32 y, MASK mask)
289// Assumes that one of the arrows on an object was hit. 292// Assumes that one of the arrows on an object was hit.
290BOOL LLManipTranslate::handleMouseDownOnPart( S32 x, S32 y, MASK mask ) 293BOOL LLManipTranslate::handleMouseDownOnPart( S32 x, S32 y, MASK mask )
291{ 294{
292 BOOL can_move = gSelectMgr->getObjectCount() != 0; 295 BOOL can_move = mObjectSelection->getObjectCount() != 0;
293 for (LLViewerObject* objectp = gSelectMgr->getFirstObject(); 296 for (LLViewerObject* objectp = mObjectSelection->getFirstObject();
294 objectp; 297 objectp;
295 objectp = gSelectMgr->getNextObject()) 298 objectp = mObjectSelection->getNextObject())
296 { 299 {
297 can_move = can_move && objectp->permMove() && (objectp->permModify() || gSavedSettings.getBOOL("SelectLinkedSet")); 300 can_move = can_move && objectp->permMove() && (objectp->permModify() || gSavedSettings.getBOOL("SelectLinkedSet"));
298 } 301 }
@@ -332,7 +335,7 @@ BOOL LLManipTranslate::handleMouseDownOnPart( S32 x, S32 y, MASK mask )
332 335
333 LLVector3 axis; 336 LLVector3 axis;
334 337
335 LLSelectNode *selectNode = gSelectMgr->getFirstMoveableNode(TRUE); 338 LLSelectNode *selectNode = mObjectSelection->getFirstMoveableNode(TRUE);
336 339
337 if (!selectNode) 340 if (!selectNode)
338 { 341 {
@@ -407,7 +410,7 @@ BOOL LLManipTranslate::handleHover(S32 x, S32 y, MASK mask)
407 BOOL rotated = FALSE; 410 BOOL rotated = FALSE;
408 411
409 // ...build mode moves camera about focus point 412 // ...build mode moves camera about focus point
410 if (gSelectMgr->getSelectType() != SELECT_TYPE_HUD) 413 if (mObjectSelection->getSelectType() != SELECT_TYPE_HUD)
411 { 414 {
412 if (x < ROTATE_H_MARGIN) 415 if (x < ROTATE_H_MARGIN)
413 { 416 {
@@ -421,6 +424,8 @@ BOOL LLManipTranslate::handleHover(S32 x, S32 y, MASK mask)
421 } 424 }
422 } 425 }
423 426
427 LLViewerObject *object;
428
424 // Suppress processing if mouse hasn't actually moved. 429 // Suppress processing if mouse hasn't actually moved.
425 // This may cause problems if the camera moves outside of the 430 // This may cause problems if the camera moves outside of the
426 // rotation above. 431 // rotation above.
@@ -467,11 +472,10 @@ BOOL LLManipTranslate::handleHover(S32 x, S32 y, MASK mask)
467 472
468 LLVector3 axis_f; 473 LLVector3 axis_f;
469 LLVector3d axis_d; 474 LLVector3d axis_d;
470 LLViewerObject *object;
471 475
472 // pick the first object to constrain to grid w/ common origin 476 // pick the first object to constrain to grid w/ common origin
473 // this is so we don't screw up groups 477 // this is so we don't screw up groups
474 LLSelectNode* selectNode = gSelectMgr->getFirstMoveableNode(TRUE); 478 LLSelectNode* selectNode = mObjectSelection->getFirstMoveableNode(TRUE);
475 if (!selectNode) 479 if (!selectNode)
476 { 480 {
477 // somehow we lost the object! 481 // somehow we lost the object!
@@ -643,12 +647,12 @@ BOOL LLManipTranslate::handleHover(S32 x, S32 y, MASK mask)
643 LLVector3d clamped_relative_move = axis_magnitude * axis_d; // scalar multiply 647 LLVector3d clamped_relative_move = axis_magnitude * axis_d; // scalar multiply
644 LLVector3 clamped_relative_move_f = (F32)axis_magnitude * axis_f; // scalar multiply 648 LLVector3 clamped_relative_move_f = (F32)axis_magnitude * axis_f; // scalar multiply
645 649
646 for(selectNode = gSelectMgr->getFirstNode(); 650 for(selectNode = mObjectSelection->getFirstNode();
647 selectNode; 651 selectNode;
648 selectNode = gSelectMgr->getNextNode() ) 652 selectNode = mObjectSelection->getNextNode() )
649 { 653 {
650 object = selectNode->getObject(); 654 object = selectNode->getObject();
651 655
652 // Only apply motion to root objects and objects selected 656 // Only apply motion to root objects and objects selected
653 // as "individual". 657 // as "individual".
654 if (!object->isRootEdit() && !selectNode->mIndividualSelection) 658 if (!object->isRootEdit() && !selectNode->mIndividualSelection)
@@ -779,27 +783,12 @@ BOOL LLManipTranslate::handleHover(S32 x, S32 y, MASK mask)
779 send_update = TRUE; 783 send_update = TRUE;
780 } 784 }
781 } 785 }
786 selectNode->mLastPositionLocal = object->getPosition();
782 } 787 }
783 } 788 }
784 789
785 // Handle throttling to 10 updates per second.
786 F32 elapsed_time = mUpdateTimer.getElapsedTimeF32();
787 const F32 UPDATE_DELAY = 0.1f; // min time between transmitted updates
788 if (send_update && (elapsed_time > UPDATE_DELAY))
789 {
790 gSelectMgr->sendMultipleUpdate(UPD_POSITION);
791 mUpdateTimer.reset();
792 mSendUpdateOnMouseUp = FALSE;
793 }
794 else
795 {
796 // ...suppressed update
797 mSendUpdateOnMouseUp = TRUE;
798 }
799
800 gSelectMgr->updateSelectionCenter(); 790 gSelectMgr->updateSelectionCenter();
801 gAgent.clearFocusObject(); 791 gAgent.clearFocusObject();
802 //gAgent.setObjectTracking(FALSE);
803 dialog_refresh_all(); // ??? is this necessary? 792 dialog_refresh_all(); // ??? is this necessary?
804 793
805 lldebugst(LLERR_USER_INPUT) << "hover handled by LLManipTranslate (active)" << llendl; 794 lldebugst(LLERR_USER_INPUT) << "hover handled by LLManipTranslate (active)" << llendl;
@@ -811,7 +800,7 @@ void LLManipTranslate::highlightManipulators(S32 x, S32 y)
811{ 800{
812 mHighlightedPart = LL_NO_PART; 801 mHighlightedPart = LL_NO_PART;
813 802
814 if (!gSelectMgr->getObjectCount()) 803 if (!mObjectSelection->getObjectCount())
815 { 804 {
816 return; 805 return;
817 } 806 }
@@ -832,7 +821,7 @@ void LLManipTranslate::highlightManipulators(S32 x, S32 y)
832 821
833 LLMatrix4 transform; 822 LLMatrix4 transform;
834 823
835 if (gSelectMgr->getSelectType() == SELECT_TYPE_HUD) 824 if (mObjectSelection->getSelectType() == SELECT_TYPE_HUD)
836 { 825 {
837 relative_camera_dir = LLVector3(1.f, 0.f, 0.f) * ~grid_rotation; 826 relative_camera_dir = LLVector3(1.f, 0.f, 0.f) * ~grid_rotation;
838 LLVector4 translation(object_position); 827 LLVector4 translation(object_position);
@@ -1056,17 +1045,8 @@ BOOL LLManipTranslate::handleMouseUp(S32 x, S32 y, MASK mask)
1056 gSelectMgr->enableSilhouette(TRUE); 1045 gSelectMgr->enableSilhouette(TRUE);
1057 1046
1058 // Might have missed last update due to UPDATE_DELAY timing. 1047 // Might have missed last update due to UPDATE_DELAY timing.
1059 if (mSendUpdateOnMouseUp) 1048 gSelectMgr->sendMultipleUpdate( UPD_POSITION );
1060 { 1049
1061 gSelectMgr->sendMultipleUpdate( UPD_POSITION );
1062 mSendUpdateOnMouseUp = FALSE;
1063 }
1064
1065// if (mCopyMadeThisDrag)
1066// {
1067// gSelectMgr->clearGridObjects();
1068// }
1069
1070 mInSnapRegime = FALSE; 1050 mInSnapRegime = FALSE;
1071 gSelectMgr->saveSelectedObjectTransform(SELECT_ACTION_TYPE_PICK); 1051 gSelectMgr->saveSelectedObjectTransform(SELECT_ACTION_TYPE_PICK);
1072 //gAgent.setObjectTracking(gSavedSettings.getBOOL("TrackFocusObject")); 1052 //gAgent.setObjectTracking(gSavedSettings.getBOOL("TrackFocusObject"));
@@ -1079,7 +1059,7 @@ void LLManipTranslate::render()
1079{ 1059{
1080 glMatrixMode(GL_MODELVIEW); 1060 glMatrixMode(GL_MODELVIEW);
1081 glPushMatrix(); 1061 glPushMatrix();
1082 if (gSelectMgr->getSelectType() == SELECT_TYPE_HUD) 1062 if (mObjectSelection->getSelectType() == SELECT_TYPE_HUD)
1083 { 1063 {
1084 F32 zoom = gAgent.getAvatarObject()->mHUDCurZoom; 1064 F32 zoom = gAgent.getAvatarObject()->mHUDCurZoom;
1085 glScalef(zoom, zoom, zoom); 1065 glScalef(zoom, zoom, zoom);
@@ -1117,7 +1097,7 @@ void LLManipTranslate::renderSnapGuides()
1117 return; 1097 return;
1118 } 1098 }
1119 1099
1120 LLSelectNode *first_node = gSelectMgr->getFirstMoveableNode(TRUE); 1100 LLSelectNode *first_node = mObjectSelection->getFirstMoveableNode(TRUE);
1121 if (!first_node) 1101 if (!first_node)
1122 { 1102 {
1123 return; 1103 return;
@@ -1139,10 +1119,36 @@ void LLManipTranslate::renderSnapGuides()
1139 //pick appropriate projection plane for snap rulers according to relative camera position 1119 //pick appropriate projection plane for snap rulers according to relative camera position
1140 if (mManipPart >= LL_X_ARROW && mManipPart <= LL_Z_ARROW) 1120 if (mManipPart >= LL_X_ARROW && mManipPart <= LL_Z_ARROW)
1141 { 1121 {
1122 LLVector3 normal;
1123 LLColor4 inner_color;
1124 LLManip::EManipPart temp_manip = mManipPart;
1125 switch (mManipPart)
1126 {
1127 case LL_X_ARROW:
1128 normal.setVec(1,0,0);
1129 inner_color.setVec(0,1,1,line_alpha);
1130 mManipPart = LL_YZ_PLANE;
1131 break;
1132 case LL_Y_ARROW:
1133 normal.setVec(0,1,0);
1134 inner_color.setVec(1,0,1,line_alpha);
1135 mManipPart = LL_XZ_PLANE;
1136 break;
1137 case LL_Z_ARROW:
1138 normal.setVec(0,0,1);
1139 inner_color.setVec(1,1,0,line_alpha);
1140 mManipPart = LL_XY_PLANE;
1141 break;
1142 default:
1143 break;
1144 }
1145
1146 highlightIntersection(normal, selection_center, grid_rotation, inner_color);
1147 mManipPart = temp_manip;
1142 getManipAxis(first_object, mManipPart, translate_axis); 1148 getManipAxis(first_object, mManipPart, translate_axis);
1143 1149
1144 LLVector3 at_axis_abs; 1150 LLVector3 at_axis_abs;
1145 if (gSelectMgr->getSelectType() == SELECT_TYPE_HUD) 1151 if (mObjectSelection->getSelectType() == SELECT_TYPE_HUD)
1146 { 1152 {
1147 at_axis_abs = LLVector3::x_axis * ~grid_rotation; 1153 at_axis_abs = LLVector3::x_axis * ~grid_rotation;
1148 } 1154 }
@@ -1217,7 +1223,7 @@ void LLManipTranslate::renderSnapGuides()
1217 1223
1218 F32 guide_size_meters; 1224 F32 guide_size_meters;
1219 1225
1220 if (gSelectMgr->getSelectType() == SELECT_TYPE_HUD) 1226 if (mObjectSelection->getSelectType() == SELECT_TYPE_HUD)
1221 { 1227 {
1222 guide_size_meters = 1.f / gAgent.getAvatarObject()->mHUDCurZoom; 1228 guide_size_meters = 1.f / gAgent.getAvatarObject()->mHUDCurZoom;
1223 mSnapOffsetMeters = mArrowLengthMeters * 1.5f; 1229 mSnapOffsetMeters = mArrowLengthMeters * 1.5f;
@@ -1419,7 +1425,7 @@ void LLManipTranslate::renderSnapGuides()
1419 } 1425 }
1420 } 1426 }
1421 } 1427 }
1422 if (gSelectMgr->getSelectType() != SELECT_TYPE_HUD) 1428 if (mObjectSelection->getSelectType() != SELECT_TYPE_HUD)
1423 { 1429 {
1424 // render helpful text 1430 // render helpful text
1425 if (mHelpTextTimer.getElapsedTimeF32() < sHelpTextVisibleTime + sHelpTextFadeTime && sNumTimesHelpTextShown < sMaxTimesShowHelpText) 1431 if (mHelpTextTimer.getElapsedTimeF32() < sHelpTextVisibleTime + sHelpTextFadeTime && sNumTimesHelpTextShown < sMaxTimesShowHelpText)
@@ -1443,10 +1449,10 @@ void LLManipTranslate::renderSnapGuides()
1443 std::string help_text = "Move mouse cursor over ruler to snap"; 1449 std::string help_text = "Move mouse cursor over ruler to snap";
1444 LLColor4 help_text_color = LLColor4::white; 1450 LLColor4 help_text_color = LLColor4::white;
1445 help_text_color.mV[VALPHA] = clamp_rescale(mHelpTextTimer.getElapsedTimeF32(), sHelpTextVisibleTime, sHelpTextVisibleTime + sHelpTextFadeTime, line_alpha, 0.f); 1451 help_text_color.mV[VALPHA] = clamp_rescale(mHelpTextTimer.getElapsedTimeF32(), sHelpTextVisibleTime, sHelpTextVisibleTime + sHelpTextFadeTime, line_alpha, 0.f);
1446 hud_render_utf8text(help_text, help_text_pos, *big_fontp, LLFontGL::NORMAL, -0.5f * big_fontp->getWidthF32(help_text), 3.f, help_text_color, gSelectMgr->getSelectType() == SELECT_TYPE_HUD); 1452 hud_render_utf8text(help_text, help_text_pos, *big_fontp, LLFontGL::NORMAL, -0.5f * big_fontp->getWidthF32(help_text), 3.f, help_text_color, mObjectSelection->getSelectType() == SELECT_TYPE_HUD);
1447 help_text = "to snap to grid"; 1453 help_text = "to snap to grid";
1448 help_text_pos -= gCamera->getUpAxis() * mSnapOffsetMeters * 0.2f; 1454 help_text_pos -= gCamera->getUpAxis() * mSnapOffsetMeters * 0.2f;
1449 hud_render_utf8text(help_text, help_text_pos, *big_fontp, LLFontGL::NORMAL, -0.5f * big_fontp->getWidthF32(help_text), 3.f, help_text_color, gSelectMgr->getSelectType() == SELECT_TYPE_HUD); 1455 hud_render_utf8text(help_text, help_text_pos, *big_fontp, LLFontGL::NORMAL, -0.5f * big_fontp->getWidthF32(help_text), 3.f, help_text_color, mObjectSelection->getSelectType() == SELECT_TYPE_HUD);
1450 } 1456 }
1451 } 1457 }
1452 } 1458 }
@@ -1455,18 +1461,13 @@ void LLManipTranslate::renderSnapGuides()
1455 // render gridlines for planar snapping 1461 // render gridlines for planar snapping
1456 1462
1457 F32 u = 0, v = 0; 1463 F32 u = 0, v = 0;
1458 glPushMatrix(); 1464 LLColor4 inner_color;
1459 1465 LLVector3 normal;
1460 F32 x,y,z,angle_radians;
1461 grid_rotation.getAngleAxis(&angle_radians, &x, &y, &z);
1462 glTranslatef(selection_center.mV[VX], selection_center.mV[VY], selection_center.mV[VZ]);
1463 glRotatef(angle_radians * RAD_TO_DEG, x, y, z);
1464
1465 LLVector3 grid_center = selection_center - grid_origin; 1466 LLVector3 grid_center = selection_center - grid_origin;
1466 grid_center *= ~grid_rotation;
1467
1468 F32 usc = 1; 1467 F32 usc = 1;
1469 F32 vsc = 1; 1468 F32 vsc = 1;
1469
1470 grid_center *= ~grid_rotation;
1470 1471
1471 switch (mManipPart) 1472 switch (mManipPart)
1472 { 1473 {
@@ -1475,23 +1476,38 @@ void LLManipTranslate::renderSnapGuides()
1475 v = grid_center.mV[VZ]; 1476 v = grid_center.mV[VZ];
1476 usc = grid_scale.mV[VY]; 1477 usc = grid_scale.mV[VY];
1477 vsc = grid_scale.mV[VZ]; 1478 vsc = grid_scale.mV[VZ];
1479 inner_color.setVec(0,1,1,line_alpha);
1480 normal.setVec(1,0,0);
1478 break; 1481 break;
1479 case LL_XZ_PLANE: 1482 case LL_XZ_PLANE:
1480 u = grid_center.mV[VX]; 1483 u = grid_center.mV[VX];
1481 v = grid_center.mV[VZ]; 1484 v = grid_center.mV[VZ];
1482 usc = grid_scale.mV[VX]; 1485 usc = grid_scale.mV[VX];
1483 vsc = grid_scale.mV[VZ]; 1486 vsc = grid_scale.mV[VZ];
1487 inner_color.setVec(1,0,1,line_alpha);
1488 normal.setVec(0,1,0);
1484 break; 1489 break;
1485 case LL_XY_PLANE: 1490 case LL_XY_PLANE:
1486 u = grid_center.mV[VX]; 1491 u = grid_center.mV[VX];
1487 v = grid_center.mV[VY]; 1492 v = grid_center.mV[VY];
1488 usc = grid_scale.mV[VX]; 1493 usc = grid_scale.mV[VX];
1489 vsc = grid_scale.mV[VY]; 1494 vsc = grid_scale.mV[VY];
1495 inner_color.setVec(1,1,0,line_alpha);
1496 normal.setVec(0,0,1);
1490 break; 1497 break;
1491 default: 1498 default:
1492 break; 1499 break;
1493 } 1500 }
1494 1501
1502 highlightIntersection(normal, selection_center, grid_rotation, inner_color);
1503
1504 glPushMatrix();
1505
1506 F32 x,y,z,angle_radians;
1507 grid_rotation.getAngleAxis(&angle_radians, &x, &y, &z);
1508 glTranslatef(selection_center.mV[VX], selection_center.mV[VY], selection_center.mV[VZ]);
1509 glRotatef(angle_radians * RAD_TO_DEG, x, y, z);
1510
1495 F32 sz = mGridSizeMeters; 1511 F32 sz = mGridSizeMeters;
1496 F32 tiles = sz; 1512 F32 tiles = sz;
1497 glMatrixMode(GL_TEXTURE); 1513 glMatrixMode(GL_TEXTURE);
@@ -1608,20 +1624,118 @@ void LLManipTranslate::renderGrid(F32 x, F32 y, F32 size, F32 r, F32 g, F32 b, F
1608 1624
1609} 1625}
1610 1626
1627void LLManipTranslate::highlightIntersection(LLVector3 normal,
1628 LLVector3 selection_center,
1629 LLQuaternion grid_rotation,
1630 LLColor4 inner_color)
1631{
1632 if (!gSavedSettings.getBOOL("GridCrossSections"))
1633 {
1634 return;
1635 }
1636
1637 U32 types[] = { LLRenderPass::PASS_SIMPLE, LLRenderPass::PASS_ALPHA, LLRenderPass::PASS_FULLBRIGHT };
1638
1639 GLuint stencil_mask = 0xFFFFFFFF;
1640 //stencil in volumes
1641 {
1642 glStencilMask(stencil_mask);
1643 glClearStencil(1);
1644 glClear(GL_STENCIL_BUFFER_BIT);
1645 LLGLEnable cull_face(GL_CULL_FACE);
1646 LLGLEnable stencil(GL_STENCIL_TEST);
1647 LLGLDepthTest depth (GL_TRUE, GL_FALSE, GL_ALWAYS);
1648 glStencilFunc(GL_ALWAYS, 0, stencil_mask);
1649 glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE);
1650 LLGLDisable tex(GL_TEXTURE_2D);
1651 glColor4f(1,1,1,1);
1652
1653 //setup clip plane
1654 normal = normal * grid_rotation;
1655 if (normal * (gCamera->getOrigin()-selection_center) < 0)
1656 {
1657 normal = -normal;
1658 }
1659 F32 d = -(selection_center * normal);
1660 F64 plane[] = { normal.mV[0], normal.mV[1], normal.mV[2], d };
1661 LLGLEnable clip(GL_CLIP_PLANE0);
1662 glClipPlane(GL_CLIP_PLANE0, plane);
1663
1664 BOOL particles = gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_PARTICLES);
1665 BOOL clouds = gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_CLOUDS);
1666
1667 if (particles)
1668 {
1669 LLPipeline::toggleRenderType(LLPipeline::RENDER_TYPE_PARTICLES);
1670 }
1671 if (clouds)
1672 {
1673 LLPipeline::toggleRenderType(LLPipeline::RENDER_TYPE_CLOUDS);
1674 }
1675
1676 //stencil in volumes
1677 glStencilOp(GL_INCR, GL_INCR, GL_INCR);
1678 glCullFace(GL_FRONT);
1679 for (U32 i = 0; i < 3; i++)
1680 {
1681 gPipeline.renderObjects(types[i], LLVertexBuffer::MAP_VERTEX, FALSE);
1682 }
1683
1684 glStencilOp(GL_DECR, GL_DECR, GL_DECR);
1685 glCullFace(GL_BACK);
1686 for (U32 i = 0; i < 3; i++)
1687 {
1688 gPipeline.renderObjects(types[i], LLVertexBuffer::MAP_VERTEX, FALSE);
1689 }
1690
1691 if (particles)
1692 {
1693 LLPipeline::toggleRenderType(LLPipeline::RENDER_TYPE_PARTICLES);
1694 }
1695 if (clouds)
1696 {
1697 LLPipeline::toggleRenderType(LLPipeline::RENDER_TYPE_CLOUDS);
1698 }
1699
1700 glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
1701 }
1702
1703 glPushMatrix();
1704
1705 F32 x,y,z,angle_radians;
1706 grid_rotation.getAngleAxis(&angle_radians, &x, &y, &z);
1707 glTranslatef(selection_center.mV[VX], selection_center.mV[VY], selection_center.mV[VZ]);
1708 glRotatef(angle_radians * RAD_TO_DEG, x, y, z);
1709
1710 F32 sz = mGridSizeMeters;
1711 F32 tiles = sz;
1712
1713 //draw volume/plane intersections
1714 {
1715 LLGLDisable tex(GL_TEXTURE_2D);
1716 LLGLDepthTest depth(GL_FALSE);
1717 LLGLEnable stencil(GL_STENCIL_TEST);
1718 glStencilOp(GL_KEEP, GL_KEEP, GL_KEEP);
1719 glStencilFunc(GL_EQUAL, 0, stencil_mask);
1720 renderGrid(0,0,tiles,inner_color.mV[0], inner_color.mV[1], inner_color.mV[2], 0.25f);
1721 }
1722
1723 glPopMatrix();
1724}
1611 1725
1612void LLManipTranslate::renderText() 1726void LLManipTranslate::renderText()
1613{ 1727{
1614 if (gSelectMgr->getRootObjectCount() && !gSelectMgr->selectionIsAttachment()) 1728 if (mObjectSelection->getRootObjectCount() && !mObjectSelection->isAttachment())
1615 { 1729 {
1616 LLVector3 pos = getPivotPoint(); 1730 LLVector3 pos = getPivotPoint();
1617 renderXYZ(pos); 1731 renderXYZ(pos);
1618 } 1732 }
1619 else 1733 else
1620 { 1734 {
1621 LLViewerObject* objectp = gSelectMgr->getFirstRootObject(); 1735 LLViewerObject* objectp = mObjectSelection->getFirstRootObject();
1622 if(!objectp) 1736 if(!objectp)
1623 { 1737 {
1624 objectp = gSelectMgr->getFirstObject(); 1738 objectp = mObjectSelection->getFirstObject();
1625 } 1739 }
1626 1740
1627 if (objectp) 1741 if (objectp)
@@ -1640,7 +1754,7 @@ void LLManipTranslate::renderTranslationHandles()
1640 1754
1641 gSelectMgr->getGrid(grid_origin, grid_rotation, grid_scale); 1755 gSelectMgr->getGrid(grid_origin, grid_rotation, grid_scale);
1642 LLVector3 at_axis; 1756 LLVector3 at_axis;
1643 if (gSelectMgr->getSelectType() == SELECT_TYPE_HUD) 1757 if (mObjectSelection->getSelectType() == SELECT_TYPE_HUD)
1644 { 1758 {
1645 at_axis = LLVector3::x_axis * ~grid_rotation; 1759 at_axis = LLVector3::x_axis * ~grid_rotation;
1646 } 1760 }
@@ -1676,13 +1790,13 @@ void LLManipTranslate::renderTranslationHandles()
1676 mPlaneManipPositions.mV[VZ] = -1.f; 1790 mPlaneManipPositions.mV[VZ] = -1.f;
1677 } 1791 }
1678 1792
1679 LLViewerObject *first_object = gSelectMgr->getFirstMoveableObject(TRUE); 1793 LLViewerObject *first_object = mObjectSelection->getFirstMoveableObject(TRUE);
1680 if (!first_object) return; 1794 if (!first_object) return;
1681 1795
1682 LLVector3 selection_center = getPivotPoint(); 1796 LLVector3 selection_center = getPivotPoint();
1683 1797
1684 // Drag handles 1798 // Drag handles
1685 if (gSelectMgr->getSelectType() == SELECT_TYPE_HUD) 1799 if (mObjectSelection->getSelectType() == SELECT_TYPE_HUD)
1686 { 1800 {
1687 mArrowLengthMeters = mAxisArrowLength / gViewerWindow->getWindowHeight(); 1801 mArrowLengthMeters = mAxisArrowLength / gViewerWindow->getWindowHeight();
1688 mArrowLengthMeters /= gAgent.getAvatarObject()->mHUDCurZoom; 1802 mArrowLengthMeters /= gAgent.getAvatarObject()->mHUDCurZoom;
@@ -1735,7 +1849,7 @@ void LLManipTranslate::renderTranslationHandles()
1735 1849
1736 LLVector3 relative_camera_dir; 1850 LLVector3 relative_camera_dir;
1737 1851
1738 if (gSelectMgr->getSelectType() == SELECT_TYPE_HUD) 1852 if (mObjectSelection->getSelectType() == SELECT_TYPE_HUD)
1739 { 1853 {
1740 relative_camera_dir = LLVector3::x_axis * invRotation; 1854 relative_camera_dir = LLVector3::x_axis * invRotation;
1741 } 1855 }
@@ -2007,7 +2121,7 @@ void LLManipTranslate::renderTranslationHandles()
2007 2121
2008 // draw arrows for deeper faces first, closer faces last 2122 // draw arrows for deeper faces first, closer faces last
2009 LLVector3 camera_axis; 2123 LLVector3 camera_axis;
2010 if (gSelectMgr->getSelectType() == SELECT_TYPE_HUD) 2124 if (mObjectSelection->getSelectType() == SELECT_TYPE_HUD)
2011 { 2125 {
2012 camera_axis = LLVector3::x_axis; 2126 camera_axis = LLVector3::x_axis;
2013 } 2127 }
diff --git a/linden/indra/newview/llmaniptranslate.h b/linden/indra/newview/llmaniptranslate.h
index b055478..4937d71 100644
--- a/linden/indra/newview/llmaniptranslate.h
+++ b/linden/indra/newview/llmaniptranslate.h
@@ -77,6 +77,10 @@ protected:
77 void renderSnapGuides(); 77 void renderSnapGuides();
78 void renderGrid(F32 x, F32 y, F32 size, F32 r, F32 g, F32 b, F32 a); 78 void renderGrid(F32 x, F32 y, F32 size, F32 r, F32 g, F32 b, F32 a);
79 void renderGridVert(F32 x_trans, F32 y_trans, F32 r, F32 g, F32 b, F32 alpha); 79 void renderGridVert(F32 x_trans, F32 y_trans, F32 r, F32 g, F32 b, F32 alpha);
80 void highlightIntersection(LLVector3 normal,
81 LLVector3 selection_center,
82 LLQuaternion grid_rotation,
83 LLColor4 inner_color);
80 F32 getMinGridScale(); 84 F32 getMinGridScale();
81 85
82private: 86private:
diff --git a/linden/indra/newview/llmapresponders.cpp b/linden/indra/newview/llmapresponders.cpp
index 0bf8754..2863c0b 100644
--- a/linden/indra/newview/llmapresponders.cpp
+++ b/linden/indra/newview/llmapresponders.cpp
@@ -96,99 +96,102 @@ void LLMapLayerResponder::result(const LLSD& result)
96 bool found_null_sim = false; 96 bool found_null_sim = false;
97 97
98 adjust = FALSE; 98 adjust = FALSE;
99 const LLSD& map_blocks = result["MapBlocks"]; 99 if (result.has("MapBlocks"))
100 for (iter = map_blocks.beginArray(); iter != map_blocks.endArray(); ++iter)
101 { 100 {
102 const LLSD& map_block = *iter; 101 const LLSD& map_blocks = result["MapBlocks"];
103 102 for (iter = map_blocks.beginArray(); iter != map_blocks.endArray(); ++iter)
104 S32 x_regions = map_block["X"];
105 S32 y_regions = map_block["Y"];
106 std::string name = map_block["Name"];
107 S32 access = map_block["Access"];
108 S32 region_flags = map_block["RegionFlags"];
109 S32 water_height = map_block["WaterHeight"];
110 LLUUID image_id = map_block["MapImageID"];
111
112 U32 x_meters = x_regions * REGION_WIDTH_UNITS;
113 U32 y_meters = y_regions * REGION_WIDTH_UNITS;
114
115 if (access == 255)
116 { 103 {
117 // This region doesn't exist 104 const LLSD& map_block = *iter;
118 if (gWorldMap->mIsTrackingUnknownLocation && 105
119 gWorldMap->mUnknownLocation.mdV[0] >= x_meters && 106 S32 x_regions = map_block["X"];
120 gWorldMap->mUnknownLocation.mdV[0] < x_meters + 256 && 107 S32 y_regions = map_block["Y"];
121 gWorldMap->mUnknownLocation.mdV[1] >= y_meters && 108 std::string name = map_block["Name"];
122 gWorldMap->mUnknownLocation.mdV[1] < y_meters + 256) 109 S32 access = map_block["Access"];
123 { 110 S32 region_flags = map_block["RegionFlags"];
124 // We were tracking this location, but it doesn't exist 111 S32 water_height = map_block["WaterHeight"];
125 gWorldMap->mInvalidLocation = TRUE; 112 LLUUID image_id = map_block["MapImageID"];
126 } 113
127 114 U32 x_meters = x_regions * REGION_WIDTH_UNITS;
128 found_null_sim = true; 115 U32 y_meters = y_regions * REGION_WIDTH_UNITS;
129 } 116
130 else 117 if (access == 255)
131 {
132 adjust = gWorldMap->extendAABB(x_meters,
133 y_meters,
134 x_meters+REGION_WIDTH_UNITS,
135 y_meters+REGION_WIDTH_UNITS) || adjust;
136 U64 handle = to_region_handle(x_meters, y_meters);
137
138// llinfos << "Map sim " << name << " image layer " << agent_flags << " ID " << image_id.getString() << llendl;
139
140 LLSimInfo* siminfo = new LLSimInfo();
141 LLWorldMap::sim_info_map_t::iterator iter = gWorldMap->mSimInfoMap.find(handle);
142 if (iter != gWorldMap->mSimInfoMap.end())
143 { 118 {
144 LLSimInfo* oldinfo = iter->second; 119 // This region doesn't exist
145 for (S32 image=0; image<MAP_SIM_IMAGE_TYPES; ++image) 120 if (gWorldMap->mIsTrackingUnknownLocation &&
121 gWorldMap->mUnknownLocation.mdV[0] >= x_meters &&
122 gWorldMap->mUnknownLocation.mdV[0] < x_meters + 256 &&
123 gWorldMap->mUnknownLocation.mdV[1] >= y_meters &&
124 gWorldMap->mUnknownLocation.mdV[1] < y_meters + 256)
146 { 125 {
147 siminfo->mMapImageID[image] = oldinfo->mMapImageID[image]; 126 // We were tracking this location, but it doesn't exist
127 gWorldMap->mInvalidLocation = TRUE;
148 } 128 }
149 delete oldinfo; 129
150 } 130 found_null_sim = true;
151 gWorldMap->mSimInfoMap[handle] = siminfo;
152
153 siminfo->mHandle = handle;
154 siminfo->mName.assign( name );
155 siminfo->mAccess = access;
156 siminfo->mRegionFlags = region_flags;
157 siminfo->mWaterHeight = (F32) water_height;
158 siminfo->mMapImageID[agent_flags] = image_id;
159 siminfo->mCurrentImage = gImageList.getImage(siminfo->mMapImageID[gWorldMap->mCurrentMap], MIPMAP_TRUE, FALSE);
160 siminfo->mCurrentImage->bindTexture(0);
161 siminfo->mCurrentImage->setClamp(TRUE, TRUE);
162
163 if (siminfo->mMapImageID[2].notNull())
164 {
165 siminfo->mOverlayImage = gImageList.getImage(siminfo->mMapImageID[2], MIPMAP_TRUE, FALSE);
166 } 131 }
167 else 132 else
168 { 133 {
169 siminfo->mOverlayImage = NULL; 134 adjust = gWorldMap->extendAABB(x_meters,
170 } 135 y_meters,
136 x_meters+REGION_WIDTH_UNITS,
137 y_meters+REGION_WIDTH_UNITS) || adjust;
138 U64 handle = to_region_handle(x_meters, y_meters);
171 139
172 if (gWorldMap->mIsTrackingUnknownLocation && 140 // llinfos << "Map sim " << name << " image layer " << agent_flags << " ID " << image_id.getString() << llendl;
173 gWorldMap->mUnknownLocation.mdV[0] >= x_meters && 141
174 gWorldMap->mUnknownLocation.mdV[0] < x_meters + 256 && 142 LLSimInfo* siminfo = new LLSimInfo();
175 gWorldMap->mUnknownLocation.mdV[1] >= y_meters && 143 LLWorldMap::sim_info_map_t::iterator iter = gWorldMap->mSimInfoMap.find(handle);
176 gWorldMap->mUnknownLocation.mdV[1] < y_meters + 256) 144 if (iter != gWorldMap->mSimInfoMap.end())
177 {
178 if (siminfo->mAccess == SIM_ACCESS_DOWN)
179 { 145 {
180 // We were tracking this location, but it doesn't exist 146 LLSimInfo* oldinfo = iter->second;
181 gWorldMap->mInvalidLocation = true; 147 for (S32 image=0; image<MAP_SIM_IMAGE_TYPES; ++image)
148 {
149 siminfo->mMapImageID[image] = oldinfo->mMapImageID[image];
150 }
151 delete oldinfo;
152 }
153 gWorldMap->mSimInfoMap[handle] = siminfo;
154
155 siminfo->mHandle = handle;
156 siminfo->mName.assign( name );
157 siminfo->mAccess = access; /*Flawfinder: ignore*/
158 siminfo->mRegionFlags = region_flags;
159 siminfo->mWaterHeight = (F32) water_height;
160 siminfo->mMapImageID[agent_flags] = image_id;
161 siminfo->mCurrentImage = gImageList.getImage(siminfo->mMapImageID[gWorldMap->mCurrentMap], MIPMAP_TRUE, FALSE);
162 siminfo->mCurrentImage->bindTexture(0);
163 siminfo->mCurrentImage->setClamp(TRUE, TRUE);
164
165 if (siminfo->mMapImageID[2].notNull())
166 {
167 siminfo->mOverlayImage = gImageList.getImage(siminfo->mMapImageID[2], MIPMAP_TRUE, FALSE);
182 } 168 }
183 else 169 else
184 { 170 {
185 // We were tracking this location, and it does exist 171 siminfo->mOverlayImage = NULL;
186 bool is_tracking_dbl = gWorldMap->mIsTrackingDoubleClick == TRUE; 172 }
187 gFloaterWorldMap->trackLocation(gWorldMap->mUnknownLocation); 173
188 if (is_tracking_dbl) 174 if (gWorldMap->mIsTrackingUnknownLocation &&
175 gWorldMap->mUnknownLocation.mdV[0] >= x_meters &&
176 gWorldMap->mUnknownLocation.mdV[0] < x_meters + 256 &&
177 gWorldMap->mUnknownLocation.mdV[1] >= y_meters &&
178 gWorldMap->mUnknownLocation.mdV[1] < y_meters + 256)
179 {
180 if (siminfo->mAccess == SIM_ACCESS_DOWN)
181 {
182 // We were tracking this location, but it doesn't exist
183 gWorldMap->mInvalidLocation = true;
184 }
185 else
189 { 186 {
190 LLVector3d pos_global = LLTracker::getTrackedPositionGlobal(); 187 // We were tracking this location, and it does exist
191 gAgent.teleportViaLocation( pos_global ); 188 bool is_tracking_dbl = gWorldMap->mIsTrackingDoubleClick == TRUE;
189 gFloaterWorldMap->trackLocation(gWorldMap->mUnknownLocation);
190 if (is_tracking_dbl)
191 {
192 LLVector3d pos_global = LLTracker::getTrackedPositionGlobal();
193 gAgent.teleportViaLocation( pos_global );
194 }
192 } 195 }
193 } 196 }
194 } 197 }
diff --git a/linden/indra/newview/llmemoryview.cpp b/linden/indra/newview/llmemoryview.cpp
index 3432c4d..c377560 100644
--- a/linden/indra/newview/llmemoryview.cpp
+++ b/linden/indra/newview/llmemoryview.cpp
@@ -35,6 +35,7 @@
35#include "llgl.h" 35#include "llgl.h"
36#include "llmath.h" 36#include "llmath.h"
37#include "llfontgl.h" 37#include "llfontgl.h"
38#include "llmemtype.h"
38 39
39#include "viewer.h" 40#include "viewer.h"
40#include "llui.h" 41#include "llui.h"
@@ -114,6 +115,7 @@ static struct mtv_display_info mtv_display_table[] =
114 { LLMemType::MTYPE_PIPELINE, "Pipeline", &LLColor4::green3 }, 115 { LLMemType::MTYPE_PIPELINE, "Pipeline", &LLColor4::green3 },
115 { LLMemType::MTYPE_PARTICLES, "Particles", &LLColor4::green4 }, 116 { LLMemType::MTYPE_PARTICLES, "Particles", &LLColor4::green4 },
116 { LLMemType::MTYPE_SPACE_PARTITION, "Space Partition", &LLColor4::blue2 }, 117 { LLMemType::MTYPE_SPACE_PARTITION, "Space Partition", &LLColor4::blue2 },
118 { LLMemType::MTYPE_VERTEX_DATA, "Vertex Buffer", &LLColor4::blue3 },
117 { LLMemType::MTYPE_AVATAR, "Avatar", &LLColor4::purple1 }, 119 { LLMemType::MTYPE_AVATAR, "Avatar", &LLColor4::purple1 },
118 { LLMemType::MTYPE_REGIONS, "Regions", &LLColor4::blue1 }, 120 { LLMemType::MTYPE_REGIONS, "Regions", &LLColor4::blue1 },
119 { LLMemType::MTYPE_TEMP1, "Temp1", &LLColor4::red1 }, 121 { LLMemType::MTYPE_TEMP1, "Temp1", &LLColor4::red1 },
diff --git a/linden/indra/newview/llmorphview.cpp b/linden/indra/newview/llmorphview.cpp
index 9c56ab3..f2ac87c 100644
--- a/linden/indra/newview/llmorphview.cpp
+++ b/linden/indra/newview/llmorphview.cpp
@@ -143,7 +143,7 @@ void LLMorphView::setVisible(BOOL visible)
143 llassert( !gFloaterCustomize ); 143 llassert( !gFloaterCustomize );
144 gFloaterCustomize = new LLFloaterCustomize(); 144 gFloaterCustomize = new LLFloaterCustomize();
145 gFloaterCustomize->fetchInventory(); 145 gFloaterCustomize->fetchInventory();
146 gFloaterCustomize->open(); 146 gFloaterCustomize->open(); /*Flawfinder: ignore*/
147 147
148 // Must do this _after_ gFloaterView is initialized. 148 // Must do this _after_ gFloaterView is initialized.
149 gFloaterCustomize->switchToDefaultSubpart(); 149 gFloaterCustomize->switchToDefaultSubpart();
diff --git a/linden/indra/newview/llmoveview.cpp b/linden/indra/newview/llmoveview.cpp
index 878705f..755aec9 100644
--- a/linden/indra/newview/llmoveview.cpp
+++ b/linden/indra/newview/llmoveview.cpp
@@ -135,12 +135,12 @@ void LLFloaterMove::show(void*)
135{ 135{
136 if (sInstance) 136 if (sInstance)
137 { 137 {
138 sInstance->open(); 138 sInstance->open(); /*Flawfinder: ignore*/
139 } 139 }
140 else 140 else
141 { 141 {
142 LLFloaterMove* f = new LLFloaterMove(); 142 LLFloaterMove* f = new LLFloaterMove();
143 f->open(); 143 f->open(); /*Flawfinder: ignore*/
144 } 144 }
145 145
146 gSavedSettings.setBOOL("ShowMovementControls", TRUE); 146 gSavedSettings.setBOOL("ShowMovementControls", TRUE);
diff --git a/linden/indra/newview/llmutelist.cpp b/linden/indra/newview/llmutelist.cpp
index fc0046a..e02d6fc 100644
--- a/linden/indra/newview/llmutelist.cpp
+++ b/linden/indra/newview/llmutelist.cpp
@@ -356,7 +356,13 @@ std::vector<LLMute> LLMuteList::getMutes() const
356//----------------------------------------------------------------------------- 356//-----------------------------------------------------------------------------
357BOOL LLMuteList::loadFromFile(const LLString& filename) 357BOOL LLMuteList::loadFromFile(const LLString& filename)
358{ 358{
359 FILE* fp = LLFile::fopen(filename.c_str(), "rb"); 359 if(!filename.size())
360 {
361 llwarns << "Mute List Filename is Empty!" << llendl;
362 return FALSE;
363 }
364
365 FILE* fp = LLFile::fopen(filename.c_str(), "rb"); /*Flawfinder: ignore*/
360 if (!fp) 366 if (!fp)
361 { 367 {
362 llwarns << "Couldn't open mute list " << filename << llendl; 368 llwarns << "Couldn't open mute list " << filename << llendl;
@@ -365,16 +371,17 @@ BOOL LLMuteList::loadFromFile(const LLString& filename)
365 371
366 // *NOTE: Changing the size of these buffers will require changes 372 // *NOTE: Changing the size of these buffers will require changes
367 // in the scanf below. 373 // in the scanf below.
368 char id_buffer[MAX_STRING]; 374 char id_buffer[MAX_STRING]; /*Flawfinder: ignore*/
369 char name_buffer[MAX_STRING]; 375 char name_buffer[MAX_STRING]; /*Flawfinder: ignore*/
370 char buffer[MAX_STRING]; 376 char buffer[MAX_STRING]; /*Flawfinder: ignore*/
371 while (!feof(fp) 377 while (!feof(fp)
372 && fgets(buffer, MAX_STRING, fp)) 378 && fgets(buffer, MAX_STRING, fp))
373 { 379 {
374 id_buffer[0] = '\0'; 380 id_buffer[0] = '\0';
375 name_buffer[0] = '\0'; 381 name_buffer[0] = '\0';
376 S32 type = 0; 382 S32 type = 0;
377 sscanf(buffer, " %d %254s %254[^|]", &type, id_buffer, name_buffer); 383 sscanf( /* Flawfinder: ignore */
384 buffer, " %d %254s %254[^|]", &type, id_buffer, name_buffer);
378 LLUUID id = LLUUID(id_buffer); 385 LLUUID id = LLUUID(id_buffer);
379 LLMute mute(id, name_buffer, (LLMute::EType)type); 386 LLMute mute(id, name_buffer, (LLMute::EType)type);
380 if (mute.mID.isNull() 387 if (mute.mID.isNull()
@@ -398,14 +405,20 @@ BOOL LLMuteList::loadFromFile(const LLString& filename)
398//----------------------------------------------------------------------------- 405//-----------------------------------------------------------------------------
399BOOL LLMuteList::saveToFile(const LLString& filename) 406BOOL LLMuteList::saveToFile(const LLString& filename)
400{ 407{
401 FILE* fp = LLFile::fopen(filename.c_str(), "wb"); 408 if(!filename.size())
409 {
410 llwarns << "Mute List Filename is Empty!" << llendl;
411 return FALSE;
412 }
413
414 FILE* fp = LLFile::fopen(filename.c_str(), "wb"); /*Flawfinder: ignore*/
402 if (!fp) 415 if (!fp)
403 { 416 {
404 llwarns << "Couldn't open mute list " << filename << llendl; 417 llwarns << "Couldn't open mute list " << filename << llendl;
405 return FALSE; 418 return FALSE;
406 } 419 }
407 // legacy mutes have null uuid 420 // legacy mutes have null uuid
408 char id_string[UUID_STR_LENGTH]; 421 char id_string[UUID_STR_LENGTH]; /*Flawfinder: ignore*/
409 LLUUID::null.toString(id_string); 422 LLUUID::null.toString(id_string);
410 for (string_set_t::iterator it = mLegacyMutes.begin(); 423 for (string_set_t::iterator it = mLegacyMutes.begin();
411 it != mLegacyMutes.end(); 424 it != mLegacyMutes.end();
@@ -446,10 +459,10 @@ BOOL LLMuteList::isMuted(const LLUUID& id, const LLString& name) const
446//----------------------------------------------------------------------------- 459//-----------------------------------------------------------------------------
447void LLMuteList::requestFromServer(const LLUUID& agent_id) 460void LLMuteList::requestFromServer(const LLUUID& agent_id)
448{ 461{
449 char agent_id_string[UUID_STR_LENGTH]; 462 char agent_id_string[UUID_STR_LENGTH]; /*Flawfinder: ignore*/
450 char filename[LL_MAX_PATH]; 463 char filename[LL_MAX_PATH]; /*Flawfinder: ignore*/
451 agent_id.toString(agent_id_string); 464 agent_id.toString(agent_id_string);
452 sprintf(filename, "%s.cached_mute", gDirUtilp->getExpandedFilename(LL_PATH_CACHE,agent_id_string).c_str()); 465 snprintf(filename, sizeof(filename), "%s.cached_mute", gDirUtilp->getExpandedFilename(LL_PATH_CACHE,agent_id_string).c_str()); /*Flawfinder: ignore*/
453 LLCRC crc; 466 LLCRC crc;
454 crc.update(filename); 467 crc.update(filename);
455 468
@@ -472,10 +485,10 @@ void LLMuteList::cache(const LLUUID& agent_id)
472 // Write to disk even if empty. 485 // Write to disk even if empty.
473 if(mIsLoaded) 486 if(mIsLoaded)
474 { 487 {
475 char agent_id_string[UUID_STR_LENGTH]; 488 char agent_id_string[UUID_STR_LENGTH]; /*Flawfinder: ignore*/
476 char filename[LL_MAX_PATH]; 489 char filename[LL_MAX_PATH]; /*Flawfinder: ignore*/
477 agent_id.toString(agent_id_string); 490 agent_id.toString(agent_id_string);
478 sprintf(filename, "%s.cached_mute", gDirUtilp->getExpandedFilename(LL_PATH_CACHE,agent_id_string).c_str()); 491 snprintf(filename, sizeof(filename), "%s.cached_mute", gDirUtilp->getExpandedFilename(LL_PATH_CACHE,agent_id_string).c_str()); /*Flawfinder: ignore*/
479 saveToFile(filename); 492 saveToFile(filename);
480 } 493 }
481} 494}
@@ -495,7 +508,7 @@ void LLMuteList::processMuteListUpdate(LLMessageSystem* msg, void**)
495 llwarns << "Got an mute list update for the wrong agent." << llendl; 508 llwarns << "Got an mute list update for the wrong agent." << llendl;
496 return; 509 return;
497 } 510 }
498 char filename[MAX_STRING]; 511 char filename[MAX_STRING]; /*Flawfinder: ignore*/
499 filename[0] = '\0'; 512 filename[0] = '\0';
500 msg->getStringFast(_PREHASH_MuteData, _PREHASH_Filename, MAX_STRING, filename); 513 msg->getStringFast(_PREHASH_MuteData, _PREHASH_Filename, MAX_STRING, filename);
501 514
@@ -515,10 +528,10 @@ void LLMuteList::processUseCachedMuteList(LLMessageSystem* msg, void**)
515 llinfos << "LLMuteList::processUseCachedMuteList()" << llendl; 528 llinfos << "LLMuteList::processUseCachedMuteList()" << llendl;
516 if (!gMuteListp) return; 529 if (!gMuteListp) return;
517 530
518 char agent_id_string[UUID_STR_LENGTH]; 531 char agent_id_string[UUID_STR_LENGTH]; /*Flawfinder: ignore*/
519 gAgent.getID().toString(agent_id_string); 532 gAgent.getID().toString(agent_id_string);
520 char filename[LL_MAX_PATH]; 533 char filename[LL_MAX_PATH]; /*Flawfinder: ignore*/
521 sprintf(filename, "%s.cached_mute", gDirUtilp->getExpandedFilename(LL_PATH_CACHE,agent_id_string).c_str()); 534 snprintf(filename, sizeof(filename), "%s.cached_mute", gDirUtilp->getExpandedFilename(LL_PATH_CACHE,agent_id_string).c_str()); /*Flawfinder: ignore*/
522 gMuteListp->loadFromFile(filename); 535 gMuteListp->loadFromFile(filename);
523} 536}
524 537
diff --git a/linden/indra/newview/llnamebox.cpp b/linden/indra/newview/llnamebox.cpp
index bdaa224..8dacf34 100644
--- a/linden/indra/newview/llnamebox.cpp
+++ b/linden/indra/newview/llnamebox.cpp
@@ -66,9 +66,9 @@ void LLNameBox::setNameID(const LLUUID& name_id, BOOL is_group)
66{ 66{
67 mNameID = name_id; 67 mNameID = name_id;
68 68
69 char first[DB_FIRST_NAME_BUF_SIZE]; 69 char first[DB_FIRST_NAME_BUF_SIZE]; /*Flawfinder: ignore*/
70 char last[DB_LAST_NAME_BUF_SIZE]; 70 char last[DB_LAST_NAME_BUF_SIZE]; /*Flawfinder: ignore*/
71 char group_name[DB_GROUP_NAME_BUF_SIZE]; 71 char group_name[DB_GROUP_NAME_BUF_SIZE]; /*Flawfinder: ignore*/
72 LLString name; 72 LLString name;
73 73
74 if (!is_group) 74 if (!is_group)
diff --git a/linden/indra/newview/llnameeditor.cpp b/linden/indra/newview/llnameeditor.cpp
index fb238e9..5cc5ddd 100644
--- a/linden/indra/newview/llnameeditor.cpp
+++ b/linden/indra/newview/llnameeditor.cpp
@@ -86,9 +86,9 @@ void LLNameEditor::setNameID(const LLUUID& name_id, BOOL is_group)
86{ 86{
87 mNameID = name_id; 87 mNameID = name_id;
88 88
89 char first[DB_FIRST_NAME_BUF_SIZE]; 89 char first[DB_FIRST_NAME_BUF_SIZE]; /*Flawfinder: ignore*/
90 char last[DB_LAST_NAME_BUF_SIZE]; 90 char last[DB_LAST_NAME_BUF_SIZE]; /*Flawfinder: ignore*/
91 char group_name[DB_GROUP_NAME_BUF_SIZE]; 91 char group_name[DB_GROUP_NAME_BUF_SIZE]; /*Flawfinder: ignore*/
92 LLString name; 92 LLString name;
93 93
94 if (!is_group) 94 if (!is_group)
diff --git a/linden/indra/newview/llnamelistctrl.cpp b/linden/indra/newview/llnamelistctrl.cpp
index f02e86b..90bfb86 100644
--- a/linden/indra/newview/llnamelistctrl.cpp
+++ b/linden/indra/newview/llnamelistctrl.cpp
@@ -69,8 +69,8 @@ BOOL LLNameListCtrl::addNameItem(const LLUUID& agent_id, EAddPosition pos,
69{ 69{
70 //llinfos << "LLNameListCtrl::addNameItem " << agent_id << llendl; 70 //llinfos << "LLNameListCtrl::addNameItem " << agent_id << llendl;
71 71
72 char first[DB_FIRST_NAME_BUF_SIZE]; 72 char first[DB_FIRST_NAME_BUF_SIZE]; /*Flawfinder: ignore*/
73 char last[DB_LAST_NAME_BUF_SIZE]; 73 char last[DB_LAST_NAME_BUF_SIZE]; /*Flawfinder: ignore*/
74 74
75 BOOL result = gCacheName->getName(agent_id, first, last); 75 BOOL result = gCacheName->getName(agent_id, first, last);
76 76
@@ -138,7 +138,7 @@ void LLNameListCtrl::addGroupNameItem(const LLUUID& group_id, EAddPosition pos,
138 BOOL enabled) 138 BOOL enabled)
139{ 139{
140 //llinfos << "LLNameListCtrl::addGroupNameItem " << group_id << llendl; 140 //llinfos << "LLNameListCtrl::addGroupNameItem " << group_id << llendl;
141 char group_name[DB_GROUP_NAME_BUF_SIZE]; 141 char group_name[DB_GROUP_NAME_BUF_SIZE]; /*Flawfinder: ignore*/
142 gCacheName->getGroupName(group_id, group_name); 142 gCacheName->getGroupName(group_id, group_name);
143 addStringUUIDItem(group_name, group_id, pos, enabled); 143 addStringUUIDItem(group_name, group_id, pos, enabled);
144} 144}
@@ -149,7 +149,7 @@ void LLNameListCtrl::addGroupNameItem(LLScrollListItem* item, EAddPosition pos)
149{ 149{
150 //llinfos << "LLNameListCtrl::addGroupNameItem " << item->getUUID() << llendl; 150 //llinfos << "LLNameListCtrl::addGroupNameItem " << item->getUUID() << llendl;
151 151
152 char group_name[DB_GROUP_NAME_BUF_SIZE]; 152 char group_name[DB_GROUP_NAME_BUF_SIZE]; /*Flawfinder: ignore*/
153 gCacheName->getGroupName(item->getUUID(), group_name); 153 gCacheName->getGroupName(item->getUUID(), group_name);
154 154
155 LLScrollListCell* cell = (LLScrollListCell*)item->getColumn(mNameColumnIndex); 155 LLScrollListCell* cell = (LLScrollListCell*)item->getColumn(mNameColumnIndex);
@@ -162,8 +162,8 @@ BOOL LLNameListCtrl::addNameItem(LLScrollListItem* item, EAddPosition pos)
162{ 162{
163 //llinfos << "LLNameListCtrl::addNameItem " << item->getUUID() << llendl; 163 //llinfos << "LLNameListCtrl::addNameItem " << item->getUUID() << llendl;
164 164
165 char first[DB_FIRST_NAME_BUF_SIZE]; 165 char first[DB_FIRST_NAME_BUF_SIZE]; /*Flawfinder: ignore*/
166 char last[DB_LAST_NAME_BUF_SIZE]; 166 char last[DB_LAST_NAME_BUF_SIZE]; /*Flawfinder: ignore*/
167 167
168 BOOL result = gCacheName->getName(item->getUUID(), first, last); 168 BOOL result = gCacheName->getName(item->getUUID(), first, last);
169 169
@@ -184,8 +184,8 @@ LLScrollListItem* LLNameListCtrl::addElement(const LLSD& value, EAddPosition pos
184{ 184{
185 LLScrollListItem* item = LLScrollListCtrl::addElement(value, pos, userdata); 185 LLScrollListItem* item = LLScrollListCtrl::addElement(value, pos, userdata);
186 186
187 char first[DB_FIRST_NAME_BUF_SIZE]; 187 char first[DB_FIRST_NAME_BUF_SIZE]; /*Flawfinder: ignore*/
188 char last[DB_LAST_NAME_BUF_SIZE]; 188 char last[DB_LAST_NAME_BUF_SIZE]; /*Flawfinder: ignore*/
189 189
190 gCacheName->getName(item->getUUID(), first, last); 190 gCacheName->getName(item->getUUID(), first, last);
191 191
diff --git a/linden/indra/newview/llnetmap.cpp b/linden/indra/newview/llnetmap.cpp
index 3db447a..dcbf960 100644
--- a/linden/indra/newview/llnetmap.cpp
+++ b/linden/indra/newview/llnetmap.cpp
@@ -609,7 +609,7 @@ BOOL LLNetMap::handleToolTip( S32 x, S32 y, LLString& msg, LLRect* sticky_rect_s
609 msg.assign( region->getName() ); 609 msg.assign( region->getName() );
610 610
611#ifndef LL_RELEASE_FOR_DOWNLOAD 611#ifndef LL_RELEASE_FOR_DOWNLOAD
612 char buffer[MAX_STRING]; 612 char buffer[MAX_STRING]; /*Flawfinder: ignore*/
613 msg.append("\n"); 613 msg.append("\n");
614 region->getHost().getHostName(buffer, MAX_STRING); 614 region->getHost().getHostName(buffer, MAX_STRING);
615 msg.append(buffer); 615 msg.append(buffer);
@@ -791,7 +791,7 @@ BOOL LLNetMap::handleRightMouseDown(S32 x, S32 y, MASK mask)
791 if (menu) 791 if (menu)
792 { 792 {
793 menu->buildDrawLabels(); 793 menu->buildDrawLabels();
794 menu->updateParent(gMenuHolder); 794 menu->updateParent(LLMenuGL::sMenuContainer);
795 LLMenuGL::showPopup(this, menu, x, y); 795 LLMenuGL::showPopup(this, menu, x, y);
796 } 796 }
797 return TRUE; 797 return TRUE;
diff --git a/linden/indra/newview/llnotify.cpp b/linden/indra/newview/llnotify.cpp
index c7d3a95..3512e57 100644
--- a/linden/indra/newview/llnotify.cpp
+++ b/linden/indra/newview/llnotify.cpp
@@ -281,10 +281,6 @@ LLNotifyBox::LLNotifyBox(const LLString& xml_desc, const LLString::format_map_t&
281// virtual 281// virtual
282LLNotifyBox::~LLNotifyBox() 282LLNotifyBox::~LLNotifyBox()
283{ 283{
284 if (!mIsTip)
285 {
286 sNotifyBoxCount--;
287 }
288 S32 count = mBtnCallbackData.count(); 284 S32 count = mBtnCallbackData.count();
289 for (S32 i = 0; i < count; i++) 285 for (S32 i = 0; i < count; i++)
290 { 286 {
@@ -395,9 +391,13 @@ void LLNotifyBox::drawBackground() const
395void LLNotifyBox::close() 391void LLNotifyBox::close()
396{ 392{
397 BOOL isTipTmp = mIsTip; 393 BOOL isTipTmp = mIsTip;
398 // delete this so that the sNotifyBoxCount is updated properly, so that the 394
399 // new frontman properly has a next button or not 395 if (!mIsTip)
400 delete this; 396 {
397 sNotifyBoxCount--;
398 }
399
400 die();
401 if(!isTipTmp) 401 if(!isTipTmp)
402 { 402 {
403 LLNotifyBox * front = gNotifyBoxView->getFirstNontipBox(); 403 LLNotifyBox * front = gNotifyBoxView->getFirstNontipBox();
@@ -714,7 +714,7 @@ LLNotifyBox * LLNotifyBoxView::getFirstNontipBox() const
714 iter++) 714 iter++)
715 { 715 {
716 LLNotifyBox * box = static_cast<LLNotifyBox*>(*iter); 716 LLNotifyBox * box = static_cast<LLNotifyBox*>(*iter);
717 if(!box->isTip()) 717 if(!box->isTip() && !box->isDead())
718 { 718 {
719 return box; 719 return box;
720 } 720 }
diff --git a/linden/indra/newview/llpanelavatar.cpp b/linden/indra/newview/llpanelavatar.cpp
index c7019e0..70b18be 100644
--- a/linden/indra/newview/llpanelavatar.cpp
+++ b/linden/indra/newview/llpanelavatar.cpp
@@ -64,6 +64,7 @@
64#include "lluiconstants.h" 64#include "lluiconstants.h"
65#include "llvoavatar.h" 65#include "llvoavatar.h"
66#include "llviewermenu.h" // *FIX: for is_agent_friend() 66#include "llviewermenu.h" // *FIX: for is_agent_friend()
67#include "llviewermessage.h" // send_generic_message
67#include "llviewerobjectlist.h" 68#include "llviewerobjectlist.h"
68#include "llviewerregion.h" 69#include "llviewerregion.h"
69#include "llviewborder.h" 70#include "llviewborder.h"
@@ -253,35 +254,60 @@ BOOL LLDropTarget::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop,
253 254
254 255
255//----------------------------------------------------------------------------- 256//-----------------------------------------------------------------------------
256// LLPanelAvatarSecondLife() 257// LLPanelAvatarTab()
257//----------------------------------------------------------------------------- 258//-----------------------------------------------------------------------------
258LLPanelAvatarSecondLife::LLPanelAvatarSecondLife(const std::string& name, const LLRect &rect, LLPanelAvatar* panel_avatar ) 259LLPanelAvatarTab::LLPanelAvatarTab(const std::string& name, const LLRect &rect,
260 LLPanelAvatar* panel_avatar)
259: LLPanel(name, rect), 261: LLPanel(name, rect),
260 mPanelAvatar(panel_avatar), 262 mPanelAvatar(panel_avatar),
261 mPartnerID() 263 mDataRequested(false)
262{ 264{ }
263}
264 265
265LLPanelAvatarSecondLife::~LLPanelAvatarSecondLife() 266// virtual
267void LLPanelAvatarTab::draw()
266{ 268{
269 if (getVisible())
270 {
271 refresh();
272
273 LLPanel::draw();
274 }
267} 275}
268 276
269void LLPanelAvatarSecondLife::draw() 277void LLPanelAvatarTab::sendAvatarProfileRequestIfNeeded(const char* type)
270{ 278{
271 if (getVisible()) 279 if (!mDataRequested)
272 { 280 {
273 updatePartnerName(); 281 std::vector<std::string> strings;
282 strings.push_back( mPanelAvatar->getAvatarID().asString() );
283 strings.push_back( type );
284 send_generic_message("avatarprofilerequest", strings);
285 mDataRequested = true;
274 } 286 }
287}
288
289//-----------------------------------------------------------------------------
290// LLPanelAvatarSecondLife()
291//-----------------------------------------------------------------------------
292LLPanelAvatarSecondLife::LLPanelAvatarSecondLife(const std::string& name,
293 const LLRect &rect,
294 LLPanelAvatar* panel_avatar )
295: LLPanelAvatarTab(name, rect, panel_avatar),
296 mPartnerID()
297{
298}
275 299
276 LLPanel::draw(); 300void LLPanelAvatarSecondLife::refresh()
301{
302 updatePartnerName();
277} 303}
278 304
279void LLPanelAvatarSecondLife::updatePartnerName() 305void LLPanelAvatarSecondLife::updatePartnerName()
280{ 306{
281 if (mPartnerID.notNull()) 307 if (mPartnerID.notNull())
282 { 308 {
283 char first[128]; 309 char first[128]; /*Flawfinder: ignore*/
284 char last[128]; 310 char last[128]; /*Flawfinder: ignore*/
285 BOOL found = gCacheName->getName(mPartnerID, first, last); 311 BOOL found = gCacheName->getName(mPartnerID, first, last);
286 if (found) 312 if (found)
287 { 313 {
@@ -378,17 +404,27 @@ void LLPanelAvatarSecondLife::onClickPublishHelp(void *)
378 gViewerWindow->alertXml("ClickPublishHelpAvatar"); 404 gViewerWindow->alertXml("ClickPublishHelpAvatar");
379} 405}
380 406
381//----------------------------------------------------------------------------- 407// static
382// LLPanelAvatarFirstLife() 408void LLPanelAvatarSecondLife::onClickPartnerHelp(void *)
383//----------------------------------------------------------------------------- 409{
384LLPanelAvatarFirstLife::LLPanelAvatarFirstLife(const std::string& name, const LLRect &rect, LLPanelAvatar* panel_avatar ) 410 gViewerWindow->alertXml("ClickPartnerHelpAvatar", onClickPartnerHelpLoadURL, (void*) NULL);
385: LLPanel(name, rect), 411}
386 mPanelAvatar(panel_avatar) 412
413// static
414void LLPanelAvatarSecondLife::onClickPartnerHelpLoadURL(S32 option, void* userdata)
387{ 415{
416 if (option == 0)
417 LLWeb::loadURL("http://secondlife.com/partner");
388} 418}
389 419
390 420
391LLPanelAvatarFirstLife::~LLPanelAvatarFirstLife() 421//-----------------------------------------------------------------------------
422// LLPanelAvatarFirstLife()
423//-----------------------------------------------------------------------------
424LLPanelAvatarFirstLife::LLPanelAvatarFirstLife(const std::string& name,
425 const LLRect &rect,
426 LLPanelAvatar* panel_avatar )
427: LLPanelAvatarTab(name, rect, panel_avatar)
392{ 428{
393} 429}
394 430
@@ -407,9 +443,10 @@ BOOL LLPanelAvatarSecondLife::postBuild(void)
407{ 443{
408 childSetEnabled("born", FALSE); 444 childSetEnabled("born", FALSE);
409 childSetEnabled("partner_edit", FALSE); 445 childSetEnabled("partner_edit", FALSE);
446 childSetAction("partner_help",onClickPartnerHelp,this);
410 447
411 childSetAction("?",onClickPublishHelp,this); 448 childSetAction("?",onClickPublishHelp,this);
412 BOOL own_avatar = (mPanelAvatar->getAvatarID() == gAgent.getID() ); 449 BOOL own_avatar = (getPanelAvatar()->getAvatarID() == gAgent.getID() );
413 enableControls(own_avatar); 450 enableControls(own_avatar);
414 451
415 childSetVisible("About:",LLPanelAvatar::sAllowFirstLife); 452 childSetVisible("About:",LLPanelAvatar::sAllowFirstLife);
@@ -426,26 +463,30 @@ BOOL LLPanelAvatarSecondLife::postBuild(void)
426 childSetVisible("online_unknown",FALSE); 463 childSetVisible("online_unknown",FALSE);
427 childSetVisible("online_no",FALSE); 464 childSetVisible("online_no",FALSE);
428 465
429 childSetAction("Show on Map", LLPanelAvatar::onClickTrack, mPanelAvatar); 466 childSetAction("Show on Map", LLPanelAvatar::onClickTrack, getPanelAvatar());
430 childSetAction("Instant Message...", LLPanelAvatar::onClickIM, mPanelAvatar); 467 childSetAction("Instant Message...", LLPanelAvatar::onClickIM, getPanelAvatar());
431 childSetAction("Rate...", LLPanelAvatar::onClickRate, mPanelAvatar); 468 childSetAction("Rate...", LLPanelAvatar::onClickRate, getPanelAvatar());
432 childSetAction("Pay...", LLPanelAvatar::onClickPay, mPanelAvatar); 469 childSetAction("Pay...", LLPanelAvatar::onClickPay, getPanelAvatar());
433 childSetAction("Mute", LLPanelAvatar::onClickMute, mPanelAvatar ); 470 childSetAction("Mute", LLPanelAvatar::onClickMute, getPanelAvatar() );
434 471
435 childSetAction("Offer Teleport...", LLPanelAvatar::onClickOfferTeleport, mPanelAvatar); 472 childSetAction("Offer Teleport...", LLPanelAvatar::onClickOfferTeleport,
473 getPanelAvatar() );
436 474
437 childSetDoubleClickCallback("groups", onDoubleClickGroup, this ); 475 childSetDoubleClickCallback("groups", onDoubleClickGroup, this );
438 476
439 return TRUE; 477 return TRUE;
440} 478}
479
441BOOL LLPanelAvatarFirstLife::postBuild(void) 480BOOL LLPanelAvatarFirstLife::postBuild(void)
442{ 481{
443 BOOL own_avatar = (mPanelAvatar->getAvatarID() == gAgent.getID() ); 482 BOOL own_avatar = (getPanelAvatar()->getAvatarID() == gAgent.getID() );
444 enableControls(own_avatar); 483 enableControls(own_avatar);
445 return TRUE; 484 return TRUE;
446} 485}
486
447BOOL LLPanelAvatarNotes::postBuild(void) 487BOOL LLPanelAvatarNotes::postBuild(void)
448{ childSetCommitCallback("notes edit",onCommitNotes,this); 488{
489 childSetCommitCallback("notes edit",onCommitNotes,this);
449 490
450 LLTextEditor* te = LLUICtrlFactory::getTextEditorByName(this,"notes edit"); 491 LLTextEditor* te = LLUICtrlFactory::getTextEditorByName(this,"notes edit");
451 if(te) te->setCommitOnFocusLost(TRUE); 492 if(te) te->setCommitOnFocusLost(TRUE);
@@ -482,6 +523,7 @@ BOOL LLPanelAvatarClassified::postBuild(void)
482 childSetAction("Delete...",onClickDelete,NULL); 523 childSetAction("Delete...",onClickDelete,NULL);
483 return TRUE; 524 return TRUE;
484} 525}
526
485BOOL LLPanelAvatarPicks::postBuild(void) 527BOOL LLPanelAvatarPicks::postBuild(void)
486{ 528{
487 childSetAction("New...",onClickNew,NULL); 529 childSetAction("New...",onClickNew,NULL);
@@ -489,25 +531,25 @@ BOOL LLPanelAvatarPicks::postBuild(void)
489 return TRUE; 531 return TRUE;
490} 532}
491 533
492BOOL LLPanelAvatarAdvanced::postBuild() 534BOOL LLPanelAvatarAdvanced::postBuild()
493{ 535{
494 for( S32 i = 0; i < kArraySize(mWantToCheck); i++ ) 536 for(size_t ii = 0; ii < kArraySize(mWantToCheck); ++ii)
495 mWantToCheck[i] = NULL; 537 mWantToCheck[ii] = NULL;
496 for( S32 i = 0; i < kArraySize(mSkillsCheck); i++ ) 538 for(size_t ii = 0; ii < kArraySize(mSkillsCheck); ++ii)
497 mSkillsCheck[i] = NULL; 539 mSkillsCheck[ii] = NULL;
498 mWantToCount = (8>kArraySize(mWantToCheck))?kArraySize(mWantToCheck):8; 540 mWantToCount = (8>kArraySize(mWantToCheck))?kArraySize(mWantToCheck):8;
499 for(int t=0;t < mWantToCount ;t++) 541 for(S32 tt=0; tt < mWantToCount; ++tt)
500 { 542 {
501 LLString ctlname = llformat("chk%d",t); 543 LLString ctlname = llformat("chk%d", tt);
502 mWantToCheck[t] = LLUICtrlFactory::getCheckBoxByName(this,ctlname); 544 mWantToCheck[tt] = LLUICtrlFactory::getCheckBoxByName(this,ctlname);
503 } 545 }
504 mSkillsCount = (6>kArraySize(mSkillsCheck))?kArraySize(mSkillsCheck):6; 546 mSkillsCount = (6>kArraySize(mSkillsCheck))?kArraySize(mSkillsCheck):6;
505 547
506 for(int t=0;t<mSkillsCount;t++) 548 for(S32 tt=0; tt < mSkillsCount; ++tt)
507 { 549 {
508 //Find the Skills checkboxes and save off thier controls 550 //Find the Skills checkboxes and save off thier controls
509 LLString ctlname = llformat("schk%d",t); 551 LLString ctlname = llformat("schk%d",tt);
510 mSkillsCheck[t] = LLUICtrlFactory::getCheckBoxByName(this,ctlname); 552 mSkillsCheck[tt] = LLUICtrlFactory::getCheckBoxByName(this,ctlname);
511 } 553 }
512 554
513 mWantToEdit = LLUICtrlFactory::getLineEditorByName(this,"want_to_edit"); 555 mWantToEdit = LLUICtrlFactory::getLineEditorByName(this,"want_to_edit");
@@ -518,9 +560,12 @@ BOOL LLPanelAvatarAdvanced::postBuild()
518 return TRUE; 560 return TRUE;
519} 561}
520 562
521LLPanelAvatarWeb::LLPanelAvatarWeb(const std::string& name, const LLRect& rect, LLPanelAvatar* panel_avatar) 563//-----------------------------------------------------------------------------
522: LLPanel(name, rect), 564// LLPanelAvatarWeb
523 mPanelAvatar(panel_avatar), 565//-----------------------------------------------------------------------------
566LLPanelAvatarWeb::LLPanelAvatarWeb(const std::string& name, const LLRect& rect,
567 LLPanelAvatar* panel_avatar)
568: LLPanelAvatarTab(name, rect, panel_avatar),
524 mWebBrowser(NULL) 569 mWebBrowser(NULL)
525{ 570{
526} 571}
@@ -668,13 +713,14 @@ void LLPanelAvatarWeb::onLocationChange( const EventType& eventIn )
668} 713}
669#endif 714#endif
670 715
671LLPanelAvatarAdvanced::LLPanelAvatarAdvanced( 716
672 const std::string& name, 717//-----------------------------------------------------------------------------
673 const LLRect& rect, 718// LLPanelAvatarAdvanced
674 LLPanelAvatar* panel_avatar) 719//-----------------------------------------------------------------------------
675 : 720LLPanelAvatarAdvanced::LLPanelAvatarAdvanced(const std::string& name,
676 LLPanel(name, rect), 721 const LLRect& rect,
677 mPanelAvatar(panel_avatar), 722 LLPanelAvatar* panel_avatar)
723: LLPanelAvatarTab(name, rect, panel_avatar),
678 mWantToCount(0), 724 mWantToCount(0),
679 mSkillsCount(0), 725 mSkillsCount(0),
680 mWantToEdit( NULL ), 726 mWantToEdit( NULL ),
@@ -682,13 +728,9 @@ LLPanelAvatarAdvanced::LLPanelAvatarAdvanced(
682{ 728{
683} 729}
684 730
685LLPanelAvatarAdvanced::~LLPanelAvatarAdvanced()
686{
687}
688
689
690void LLPanelAvatarAdvanced::enableControls(BOOL self) 731void LLPanelAvatarAdvanced::enableControls(BOOL self)
691{ int t; 732{
733 S32 t;
692 for(t=0;t<mWantToCount;t++) 734 for(t=0;t<mWantToCount;t++)
693 { 735 {
694 if(mWantToCheck[t])mWantToCheck[t]->setEnabled(self); 736 if(mWantToCheck[t])mWantToCheck[t]->setEnabled(self);
@@ -774,25 +816,27 @@ void LLPanelAvatarAdvanced::getWantSkills(U32* want_to_mask, std::string& want_t
774// LLPanelAvatarNotes() 816// LLPanelAvatarNotes()
775//----------------------------------------------------------------------------- 817//-----------------------------------------------------------------------------
776LLPanelAvatarNotes::LLPanelAvatarNotes(const std::string& name, const LLRect& rect, LLPanelAvatar* panel_avatar) 818LLPanelAvatarNotes::LLPanelAvatarNotes(const std::string& name, const LLRect& rect, LLPanelAvatar* panel_avatar)
777: LLPanel(name, rect), 819: LLPanelAvatarTab(name, rect, panel_avatar)
778 mPanelAvatar(panel_avatar)
779{ 820{
780} 821}
781 822
782LLPanelAvatarNotes::~LLPanelAvatarNotes() 823void LLPanelAvatarNotes::refresh()
783{ 824{
825 sendAvatarProfileRequestIfNeeded("notes");
784} 826}
785 827
786 828void LLPanelAvatarNotes::clearControls()
787void LLPanelAvatarNotes::enableControls(BOOL self) 829{
788{ } 830 childSetText("notes edit", "Loading...");
831 childSetEnabled("notes edit", false);
832}
789 833
790// static 834// static
791void LLPanelAvatarNotes::onCommitNotes(LLUICtrl*, void* userdata) 835void LLPanelAvatarNotes::onCommitNotes(LLUICtrl*, void* userdata)
792{ 836{
793 LLPanelAvatarNotes* self = (LLPanelAvatarNotes*)userdata; 837 LLPanelAvatarNotes* self = (LLPanelAvatarNotes*)userdata;
794 838
795 self->mPanelAvatar->sendAvatarNotesUpdate(); 839 self->getPanelAvatar()->sendAvatarNotesUpdate();
796} 840}
797 841
798 842
@@ -801,33 +845,14 @@ void LLPanelAvatarNotes::onCommitNotes(LLUICtrl*, void* userdata)
801//----------------------------------------------------------------------------- 845//-----------------------------------------------------------------------------
802LLPanelAvatarClassified::LLPanelAvatarClassified(const LLString& name, const LLRect& rect, 846LLPanelAvatarClassified::LLPanelAvatarClassified(const LLString& name, const LLRect& rect,
803 LLPanelAvatar* panel_avatar) 847 LLPanelAvatar* panel_avatar)
804: LLPanel(name, rect), 848: LLPanelAvatarTab(name, rect, panel_avatar)
805 mPanelAvatar(panel_avatar)
806{ 849{
807} 850}
808 851
809 852
810LLPanelAvatarClassified::~LLPanelAvatarClassified()
811{
812 // children deleted by view destructor
813}
814
815
816void LLPanelAvatarClassified::draw()
817{
818 if (getVisible())
819 {
820 refresh();
821
822 LLPanel::draw();
823 }
824}
825
826
827void LLPanelAvatarClassified::refresh() 853void LLPanelAvatarClassified::refresh()
828{ 854{
829 BOOL self = (gAgent.getID() == mPanelAvatar->getAvatarID()); 855 BOOL self = (gAgent.getID() == getPanelAvatar()->getAvatarID());
830
831 856
832 LLTabContainerCommon* tabs = LLUICtrlFactory::getTabContainerByName(this,"classified tab"); 857 LLTabContainerCommon* tabs = LLUICtrlFactory::getTabContainerByName(this,"classified tab");
833 858
@@ -839,15 +864,12 @@ void LLPanelAvatarClassified::refresh()
839 864
840 childSetEnabled("New...",self && allow_new); 865 childSetEnabled("New...",self && allow_new);
841 childSetEnabled("Delete...",self && allow_delete); 866 childSetEnabled("Delete...",self && allow_delete);
842 childSetVisible("help_text",self && show_help);
843 childSetVisible("classified tab",!show_help); 867 childSetVisible("classified tab",!show_help);
844}
845 868
846 869 sendAvatarProfileRequestIfNeeded("classifieds");
847void LLPanelAvatarClassified::enableControls(BOOL self)
848{
849} 870}
850 871
872
851BOOL LLPanelAvatarClassified::titleIsValid() 873BOOL LLPanelAvatarClassified::titleIsValid()
852{ 874{
853 LLTabContainerCommon* tabs = LLViewerUICtrlFactory::getTabContainerByName(this, "classified tab"); 875 LLTabContainerCommon* tabs = LLViewerUICtrlFactory::getTabContainerByName(this, "classified tab");
@@ -884,6 +906,10 @@ void LLPanelAvatarClassified::deleteClassifiedPanels()
884 { 906 {
885 tabs->deleteAllTabs(); 907 tabs->deleteAllTabs();
886 } 908 }
909
910 childSetVisible("New...", false);
911 childSetVisible("Delete...", false);
912 childSetVisible("loading_text", true);
887} 913}
888 914
889 915
@@ -892,7 +918,7 @@ void LLPanelAvatarClassified::processAvatarClassifiedReply(LLMessageSystem* msg,
892 S32 block = 0; 918 S32 block = 0;
893 S32 block_count = 0; 919 S32 block_count = 0;
894 LLUUID classified_id; 920 LLUUID classified_id;
895 char classified_name[DB_PICK_NAME_SIZE]; 921 char classified_name[DB_PICK_NAME_SIZE]; /*Flawfinder: ignore*/
896 LLPanelClassified* panel_classified = NULL; 922 LLPanelClassified* panel_classified = NULL;
897 923
898 LLTabContainerCommon* tabs = LLViewerUICtrlFactory::getTabContainerByName(this,"classified tab"); 924 LLTabContainerCommon* tabs = LLViewerUICtrlFactory::getTabContainerByName(this,"classified tab");
@@ -927,6 +953,10 @@ void LLPanelAvatarClassified::processAvatarClassifiedReply(LLMessageSystem* msg,
927 { 953 {
928 tabs->selectFirstTab(); 954 tabs->selectFirstTab();
929 } 955 }
956
957 childSetVisible("New...", true);
958 childSetVisible("Delete...", true);
959 childSetVisible("loading_text", false);
930} 960}
931 961
932 962
@@ -1018,34 +1048,17 @@ void LLPanelAvatarClassified::callbackDelete(S32 option, void* data)
1018//----------------------------------------------------------------------------- 1048//-----------------------------------------------------------------------------
1019// LLPanelAvatarPicks() 1049// LLPanelAvatarPicks()
1020//----------------------------------------------------------------------------- 1050//-----------------------------------------------------------------------------
1021LLPanelAvatarPicks::LLPanelAvatarPicks(const std::string& name, const LLRect& rect, 1051LLPanelAvatarPicks::LLPanelAvatarPicks(const std::string& name,
1052 const LLRect& rect,
1022 LLPanelAvatar* panel_avatar) 1053 LLPanelAvatar* panel_avatar)
1023: LLPanel(name, rect), 1054: LLPanelAvatarTab(name, rect, panel_avatar)
1024 mPanelAvatar(panel_avatar)
1025{ 1055{
1026} 1056}
1027 1057
1028 1058
1029LLPanelAvatarPicks::~LLPanelAvatarPicks()
1030{
1031 // children deleted by view destructor
1032}
1033
1034
1035void LLPanelAvatarPicks::draw()
1036{
1037 if (getVisible())
1038 {
1039 refresh();
1040
1041 LLPanel::draw();
1042 }
1043}
1044
1045
1046void LLPanelAvatarPicks::refresh() 1059void LLPanelAvatarPicks::refresh()
1047{ 1060{
1048 BOOL self = (gAgent.getID() == mPanelAvatar->getAvatarID()); 1061 BOOL self = (gAgent.getID() == getPanelAvatar()->getAvatarID());
1049 1062
1050 LLTabContainerCommon* tabs = LLViewerUICtrlFactory::getTabContainerByName(this,"picks tab"); 1063 LLTabContainerCommon* tabs = LLViewerUICtrlFactory::getTabContainerByName(this,"picks tab");
1051 S32 tab_count = tabs ? tabs->getTabCount() : 0; 1064 S32 tab_count = tabs ? tabs->getTabCount() : 0;
@@ -1054,12 +1067,8 @@ void LLPanelAvatarPicks::refresh()
1054 1067
1055 childSetEnabled("New...",self && allow_new); 1068 childSetEnabled("New...",self && allow_new);
1056 childSetEnabled("Delete...",self && allow_delete); 1069 childSetEnabled("Delete...",self && allow_delete);
1057}
1058 1070
1059 1071 sendAvatarProfileRequestIfNeeded("picks");
1060// You are only allowed 10 picks.
1061void LLPanelAvatarPicks::enableControls(BOOL self)
1062{
1063} 1072}
1064 1073
1065 1074
@@ -1070,15 +1079,18 @@ void LLPanelAvatarPicks::deletePickPanels()
1070 { 1079 {
1071 tabs->deleteAllTabs(); 1080 tabs->deleteAllTabs();
1072 } 1081 }
1073}
1074 1082
1083 childSetVisible("New...", false);
1084 childSetVisible("Delete...", false);
1085 childSetVisible("loading_text", true);
1086}
1075 1087
1076void LLPanelAvatarPicks::processAvatarPicksReply(LLMessageSystem* msg, void**) 1088void LLPanelAvatarPicks::processAvatarPicksReply(LLMessageSystem* msg, void**)
1077{ 1089{
1078 S32 block = 0; 1090 S32 block = 0;
1079 S32 block_count = 0; 1091 S32 block_count = 0;
1080 LLUUID pick_id; 1092 LLUUID pick_id;
1081 char pick_name[DB_PICK_NAME_SIZE]; 1093 char pick_name[DB_PICK_NAME_SIZE]; /*Flawfinder: ignore*/
1082 LLPanelPick* panel_pick = NULL; 1094 LLPanelPick* panel_pick = NULL;
1083 1095
1084 LLTabContainerCommon* tabs = LLUICtrlFactory::getTabContainerByName(this,"picks tab"); 1096 LLTabContainerCommon* tabs = LLUICtrlFactory::getTabContainerByName(this,"picks tab");
@@ -1114,6 +1126,10 @@ void LLPanelAvatarPicks::processAvatarPicksReply(LLMessageSystem* msg, void**)
1114 { 1126 {
1115 tabs->selectFirstTab(); 1127 tabs->selectFirstTab();
1116 } 1128 }
1129
1130 childSetVisible("New...", true);
1131 childSetVisible("Delete...", true);
1132 childSetVisible("loading_text", false);
1117} 1133}
1118 1134
1119 1135
@@ -1313,6 +1329,31 @@ void LLPanelAvatar::setOnlineStatus(EOnlineStatus online_status)
1313 } 1329 }
1314 1330
1315 mPanelSecondLife->childSetVisible("online_yes", (online_status == ONLINE_STATUS_YES)); 1331 mPanelSecondLife->childSetVisible("online_yes", (online_status == ONLINE_STATUS_YES));
1332
1333 // Since setOnlineStatus gets called after setAvatarID
1334 // need to make sure that "Offer Teleport" doesn't get set
1335 // to TRUE again for yourself
1336 if (mAvatarID != gAgent.getID())
1337 {
1338 childSetVisible("Offer Teleport...",TRUE);
1339 }
1340
1341 BOOL in_prelude = gAgent.inPrelude();
1342 if(gAgent.isGodlike())
1343 {
1344 childSetEnabled("Offer Teleport...", TRUE);
1345 childSetToolTip("Offer Teleport...", childGetValue("TeleportGod").asString());
1346 }
1347 else if (in_prelude)
1348 {
1349 childSetEnabled("Offer Teleport...",FALSE);
1350 childSetToolTip("Offer Teleport...",childGetValue("TeleportPrelude").asString());
1351 }
1352 else
1353 {
1354 childSetEnabled("Offer Teleport...", (online_status == ONLINE_STATUS_YES));
1355 childSetToolTip("Offer Teleport...", childGetValue("TeleportNormal").asString());
1356 }
1316} 1357}
1317 1358
1318void LLPanelAvatar::setAvatarID(const LLUUID &avatar_id, const LLString &name, 1359void LLPanelAvatar::setAvatarID(const LLUUID &avatar_id, const LLString &name,
@@ -1338,12 +1379,8 @@ void LLPanelAvatar::setAvatarID(const LLUUID &avatar_id, const LLString &name,
1338 mPanelSecondLife->enableControls(own_avatar && mAllowEdit); 1379 mPanelSecondLife->enableControls(own_avatar && mAllowEdit);
1339 mPanelWeb->enableControls(own_avatar && mAllowEdit); 1380 mPanelWeb->enableControls(own_avatar && mAllowEdit);
1340 mPanelAdvanced->enableControls(own_avatar && mAllowEdit); 1381 mPanelAdvanced->enableControls(own_avatar && mAllowEdit);
1341 mPanelPicks->enableControls(own_avatar && mAllowEdit);
1342 mPanelClassified->enableControls(own_avatar && mAllowEdit);
1343 // Teens don't have this. 1382 // Teens don't have this.
1344 if (mPanelFirstLife) mPanelFirstLife->enableControls(own_avatar && mAllowEdit); 1383 if (mPanelFirstLife) mPanelFirstLife->enableControls(own_avatar && mAllowEdit);
1345 mPanelNotes->enableControls(own_avatar && mAllowEdit);
1346
1347 1384
1348 LLView *target_view = getChildByName("drop_target_rect", TRUE); 1385 LLView *target_view = getChildByName("drop_target_rect", TRUE);
1349 if(target_view) 1386 if(target_view)
@@ -1357,16 +1394,16 @@ void LLPanelAvatar::setAvatarID(const LLUUID &avatar_id, const LLString &name,
1357 mDropTarget->setAgentID(mAvatarID); 1394 mDropTarget->setAgentID(mAvatarID);
1358 } 1395 }
1359 1396
1360 LLNameEditor* NameEdit = LLViewerUICtrlFactory::getNameEditorByName(this, "name"); 1397 LLNameEditor* name_edit = LLViewerUICtrlFactory::getNameEditorByName(this, "name");
1361 if(NameEdit) 1398 if(name_edit)
1362 { 1399 {
1363 if (name.empty()) 1400 if (name.empty())
1364 { 1401 {
1365 NameEdit->setNameID(avatar_id, FALSE); 1402 name_edit->setNameID(avatar_id, FALSE);
1366 } 1403 }
1367 else 1404 else
1368 { 1405 {
1369 NameEdit->setText(name); 1406 name_edit->setText(name);
1370 } 1407 }
1371 } 1408 }
1372// if (avatar_changed) 1409// if (avatar_changed)
@@ -1374,9 +1411,19 @@ void LLPanelAvatar::setAvatarID(const LLUUID &avatar_id, const LLString &name,
1374 // While we're waiting for data off the network, clear out the 1411 // While we're waiting for data off the network, clear out the
1375 // old data. 1412 // old data.
1376 mPanelSecondLife->clearControls(); 1413 mPanelSecondLife->clearControls();
1414
1377 mPanelPicks->deletePickPanels(); 1415 mPanelPicks->deletePickPanels();
1416 mPanelPicks->setDataRequested(false);
1417
1378 mPanelClassified->deleteClassifiedPanels(); 1418 mPanelClassified->deleteClassifiedPanels();
1419 mPanelClassified->setDataRequested(false);
1379 1420
1421 mPanelNotes->clearControls();
1422 mPanelNotes->setDataRequested(false);
1423
1424 // Request just the first two pages of data. The picks,
1425 // classifieds, and notes will be requested when that panel
1426 // is made visible. JC
1380 sendAvatarPropertiesRequest(); 1427 sendAvatarPropertiesRequest();
1381 1428
1382 if (own_avatar) 1429 if (own_avatar)
@@ -1423,25 +1470,6 @@ void LLPanelAvatar::setAvatarID(const LLUUID &avatar_id, const LLString &name,
1423 childSetVisible("Mute",TRUE); 1470 childSetVisible("Mute",TRUE);
1424 childSetEnabled("Mute",FALSE); 1471 childSetEnabled("Mute",FALSE);
1425 1472
1426 childSetVisible("Offer Teleport...",TRUE);
1427 BOOL in_prelude = gAgent.inPrelude();
1428 if(gAgent.isGodlike())
1429 {
1430 childSetEnabled("Offer Teleport...", TRUE);
1431 childSetToolTip("Offer Teleport...", childGetValue("TeleportGod").asString());
1432 }
1433 else if (in_prelude)
1434 {
1435 childSetEnabled("Offer Teleport...",FALSE);
1436 childSetToolTip("Offer Teleport...",childGetValue("TeleportPrelude").asString());
1437 }
1438 else
1439 {
1440 // Even if user might be offline, allow a teleport offer.
1441 BOOL maybe_online = (online_status != ONLINE_STATUS_NO);
1442 childSetEnabled("Offer Teleport...", maybe_online);
1443 childSetToolTip("Offer Teleport...", childGetValue("TeleportNormal").asString());
1444 }
1445 childSetVisible("drop target",TRUE); 1473 childSetVisible("drop target",TRUE);
1446 childSetEnabled("drop target",FALSE); 1474 childSetEnabled("drop target",FALSE);
1447 1475
@@ -1670,12 +1698,17 @@ void LLPanelAvatar::onClickCancel(void *userdata)
1670 1698
1671 if (self) 1699 if (self)
1672 { 1700 {
1673 self->sendAvatarPropertiesRequest();
1674 LLFloaterAvatarInfo *infop; 1701 LLFloaterAvatarInfo *infop;
1675 if ((infop = LLFloaterAvatarInfo::getInstance(self->mAvatarID))) 1702 if ((infop = LLFloaterAvatarInfo::getInstance(self->mAvatarID)))
1676 { 1703 {
1677 infop->close(); 1704 infop->close();
1678 } 1705 }
1706 else
1707 {
1708 // We're in the Search directory and are cancelling an edit
1709 // to our own profile, so reset.
1710 self->sendAvatarPropertiesRequest();
1711 }
1679 } 1712 }
1680} 1713}
1681 1714
@@ -1721,16 +1754,16 @@ void LLPanelAvatar::processAvatarPropertiesReply(LLMessageSystem *msg, void**)
1721 LLUUID image_id; 1754 LLUUID image_id;
1722 LLUUID fl_image_id; 1755 LLUUID fl_image_id;
1723 LLUUID partner_id; 1756 LLUUID partner_id;
1724 char about_text[DB_USER_ABOUT_BUF_SIZE]; 1757 char about_text[DB_USER_ABOUT_BUF_SIZE]; /*Flawfinder: ignore*/
1725 char fl_about_text[DB_USER_FL_ABOUT_BUF_SIZE]; 1758 char fl_about_text[DB_USER_FL_ABOUT_BUF_SIZE]; /*Flawfinder: ignore*/
1726 char born_on[DB_BORN_BUF_SIZE]; 1759 char born_on[DB_BORN_BUF_SIZE]; /*Flawfinder: ignore*/
1727 S32 charter_member_size = 0; 1760 S32 charter_member_size = 0;
1728 BOOL allow_publish = FALSE; 1761 BOOL allow_publish = FALSE;
1729 //BOOL mature = FALSE; 1762 //BOOL mature = FALSE;
1730 BOOL identified = FALSE; 1763 BOOL identified = FALSE;
1731 BOOL transacted = FALSE; 1764 BOOL transacted = FALSE;
1732 BOOL online = FALSE; 1765 BOOL online = FALSE;
1733 char profile_url[DB_USER_PROFILE_URL_BUF_SIZE]; 1766 char profile_url[DB_USER_PROFILE_URL_BUF_SIZE]; /*Flawfinder: ignore*/
1734 1767
1735 U32 flags = 0x0; 1768 U32 flags = 0x0;
1736 1769
@@ -1786,7 +1819,7 @@ void LLPanelAvatar::processAvatarPropertiesReply(LLMessageSystem *msg, void**)
1786 } 1819 }
1787 else if(1 < charter_member_size) 1820 else if(1 < charter_member_size)
1788 { 1821 {
1789 char caption[MAX_STRING]; 1822 char caption[MAX_STRING]; /*Flawfinder: ignore*/
1790 msg->getString("PropertiesData", "CharterMember", MAX_STRING, caption); 1823 msg->getString("PropertiesData", "CharterMember", MAX_STRING, caption);
1791 caption_text = caption; 1824 caption_text = caption;
1792 } 1825 }
@@ -1868,10 +1901,10 @@ void LLPanelAvatar::processAvatarInterestsReply(LLMessageSystem *msg, void**)
1868 LLUUID avatar_id; // target of this panel 1901 LLUUID avatar_id; // target of this panel
1869 1902
1870 U32 want_to_mask; 1903 U32 want_to_mask;
1871 char want_to_text[DB_USER_WANT_TO_BUF_SIZE]; 1904 char want_to_text[DB_USER_WANT_TO_BUF_SIZE]; /*Flawfinder: ignore*/
1872 U32 skills_mask; 1905 U32 skills_mask;
1873 char skills_text[DB_USER_SKILLS_BUF_SIZE]; 1906 char skills_text[DB_USER_SKILLS_BUF_SIZE]; /*Flawfinder: ignore*/
1874 char languages_text[DB_USER_SKILLS_BUF_SIZE]; 1907 char languages_text[DB_USER_SKILLS_BUF_SIZE]; /*Flawfinder: ignore*/
1875 1908
1876 //llinfos << "properties packet size " << msg->getReceiveSize() << llendl; 1909 //llinfos << "properties packet size " << msg->getReceiveSize() << llendl;
1877 1910
@@ -1903,9 +1936,9 @@ void LLPanelAvatar::processAvatarGroupsReply(LLMessageSystem *msg, void**)
1903 LLUUID agent_id; // your id 1936 LLUUID agent_id; // your id
1904 LLUUID avatar_id; // target of this panel 1937 LLUUID avatar_id; // target of this panel
1905 U64 group_powers; 1938 U64 group_powers;
1906 char group_title[DB_GROUP_TITLE_BUF_SIZE]; 1939 char group_title[DB_GROUP_TITLE_BUF_SIZE]; /*Flawfinder: ignore*/
1907 LLUUID group_id; 1940 LLUUID group_id;
1908 char group_name[DB_GROUP_NAME_BUF_SIZE]; 1941 char group_name[DB_GROUP_NAME_BUF_SIZE]; /*Flawfinder: ignore*/
1909 LLUUID group_insignia_id; 1942 LLUUID group_insignia_id;
1910 const LLFontGL* FONT = LLFontGL::sSansSerifSmall; 1943 const LLFontGL* FONT = LLFontGL::sSansSerifSmall;
1911 1944
@@ -2117,10 +2150,10 @@ void LLPanelAvatar::processAvatarStatisticsReply(LLMessageSystem *msg, void**)
2117 S32 items = msg->getNumberOfBlocksFast(_PREHASH_StatisticsData); 2150 S32 items = msg->getNumberOfBlocksFast(_PREHASH_StatisticsData);
2118 for (S32 i = 0; i < items; i++) 2151 for (S32 i = 0; i < items; i++)
2119 { 2152 {
2120 char name[MAX_STRING]; 2153 char name[MAX_STRING]; /*Flawfinder: ignore*/
2121 S32 positive; 2154 S32 positive;
2122 S32 negative; 2155 S32 negative;
2123 char value_string[MAX_STRING]; 2156 char value_string[MAX_STRING]; /*Flawfinder: ignore*/
2124 2157
2125 msg->getStringFast( _PREHASH_StatisticsData, 2158 msg->getStringFast( _PREHASH_StatisticsData,
2126 _PREHASH_Name, MAX_STRING, name, i); 2159 _PREHASH_Name, MAX_STRING, name, i);
@@ -2134,7 +2167,7 @@ void LLPanelAvatar::processAvatarStatisticsReply(LLMessageSystem *msg, void**)
2134 item = new LLScrollListItem(); 2167 item = new LLScrollListItem();
2135 item->addColumn( name, font, TEXT_WIDTH ); 2168 item->addColumn( name, font, TEXT_WIDTH );
2136 2169
2137 sprintf( value_string, "+%d", positive); 2170 snprintf( value_string, sizeof(value_string), "+%d", positive); /*Flawfinder: ignore*/
2138 item->addColumn( value_string, font, 50 ); 2171 item->addColumn( value_string, font, 50 );
2139 2172
2140 item->addColumn("", font); // extra column to force striped appearance 2173 item->addColumn("", font); // extra column to force striped appearance
@@ -2163,9 +2196,10 @@ void LLPanelAvatar::processAvatarNotesReply(LLMessageSystem *msg, void**)
2163 continue; 2196 continue;
2164 } 2197 }
2165 2198
2166 char text[DB_USER_NOTE_SIZE]; 2199 char text[DB_USER_NOTE_SIZE]; /*Flawfinder: ignore*/
2167 msg->getString("Data", "Notes", DB_USER_NOTE_SIZE, text); 2200 msg->getString("Data", "Notes", DB_USER_NOTE_SIZE, text);
2168 self->childSetValue("notes edit", text); 2201 self->childSetValue("notes edit", text);
2202 self->childSetEnabled("notes edit", true);
2169 } 2203 }
2170} 2204}
2171 2205
diff --git a/linden/indra/newview/llpanelavatar.h b/linden/indra/newview/llpanelavatar.h
index 81cfe02..3e8bffd 100644
--- a/linden/indra/newview/llpanelavatar.h
+++ b/linden/indra/newview/llpanelavatar.h
@@ -59,35 +59,61 @@ enum EOnlineStatus
59 ONLINE_STATUS_YES = 1 59 ONLINE_STATUS_YES = 1
60}; 60};
61 61
62class LLPanelAvatarFirstLife 62// Base class for all sub-tabs inside the avatar profile. Many of these
63: public LLPanel 63// panels need to keep track of the parent panel (to get the avatar id)
64// and only request data from the database when they are first drawn. JC
65class LLPanelAvatarTab : public LLPanel
64{ 66{
65public: 67public:
66 LLPanelAvatarFirstLife(const std::string& name, const LLRect &rect, LLPanelAvatar* panel_avatar); 68 LLPanelAvatarTab(const std::string& name, const LLRect &rect,
67 /*virtual*/ ~LLPanelAvatarFirstLife(); 69 LLPanelAvatar* panel_avatar);
68 /*virtual*/ BOOL postBuild(void);
69 70
70 void enableControls(BOOL own_avatar); 71 // Calls refresh() once per frame when panel is visible
72 /*virtual*/ void draw();
71 73
72protected: 74 LLPanelAvatar* getPanelAvatar() const { return mPanelAvatar; }
75
76 void setDataRequested(bool requested) { mDataRequested = requested; }
77 bool isDataRequested() const { return mDataRequested; }
78
79 // If the data for this tab has not yet been requested,
80 // send the request. Used by tabs that are filled in only
81 // when they are first displayed.
82 // type is one of "notes", "classifieds", "picks"
83 void sendAvatarProfileRequestIfNeeded(const char* type);
84
85private:
73 LLPanelAvatar* mPanelAvatar; 86 LLPanelAvatar* mPanelAvatar;
87 bool mDataRequested;
88};
89
90
91class LLPanelAvatarFirstLife : public LLPanelAvatarTab
92{
93public:
94 LLPanelAvatarFirstLife(const std::string& name, const LLRect &rect, LLPanelAvatar* panel_avatar);
95
96 /*virtual*/ BOOL postBuild(void);
97
98 void enableControls(BOOL own_avatar);
74}; 99};
75 100
76 101
77class LLPanelAvatarSecondLife 102class LLPanelAvatarSecondLife
78: public LLPanel 103: public LLPanelAvatarTab
79{ 104{
80public: 105public:
81 LLPanelAvatarSecondLife(const std::string& name, const LLRect &rect, LLPanelAvatar* panel_avatar ); 106 LLPanelAvatarSecondLife(const std::string& name, const LLRect &rect, LLPanelAvatar* panel_avatar );
82 /*virtual*/ ~LLPanelAvatarSecondLife();
83 107
84 /*virtual*/ BOOL postBuild(void); 108 /*virtual*/ BOOL postBuild(void);
85 /*virtual*/ void draw(); 109 /*virtual*/ void refresh();
86 110
87 static void onClickImage( void *userdata); 111 static void onClickImage( void *userdata);
88 static void onClickFriends( void *userdata); 112 static void onClickFriends( void *userdata);
89 static void onDoubleClickGroup(void* userdata); 113 static void onDoubleClickGroup(void* userdata);
90 static void onClickPublishHelp(void *userdata); 114 static void onClickPublishHelp(void *userdata);
115 static void onClickPartnerHelp(void *userdata);
116 static void onClickPartnerHelpLoadURL(S32 option, void* userdata);
91 117
92 // Clear out the controls anticipating new network data. 118 // Clear out the controls anticipating new network data.
93 void clearControls(); 119 void clearControls();
@@ -97,15 +123,14 @@ public:
97 123
98 void setPartnerID(LLUUID id) { mPartnerID = id; } 124 void setPartnerID(LLUUID id) { mPartnerID = id; }
99 125
100protected: 126private:
101 LLPanelAvatar* mPanelAvatar;
102
103 LLUUID mPartnerID; 127 LLUUID mPartnerID;
104}; 128};
105 129
130
106// WARNING! The order of the inheritance here matters!! Do not change. - KLW 131// WARNING! The order of the inheritance here matters!! Do not change. - KLW
107class LLPanelAvatarWeb : 132class LLPanelAvatarWeb :
108 public LLPanel 133 public LLPanelAvatarTab
109#if LL_LIBXUL_ENABLED 134#if LL_LIBXUL_ENABLED
110 , public LLWebBrowserCtrlObserver 135 , public LLWebBrowserCtrlObserver
111#endif 136#endif
@@ -132,17 +157,17 @@ public:
132 virtual void onLocationChange( const EventType& eventIn ); 157 virtual void onLocationChange( const EventType& eventIn );
133#endif 158#endif
134 159
135protected: 160private:
136 LLPanelAvatar* mPanelAvatar;
137 std::string mURL; 161 std::string mURL;
138 LLWebBrowserCtrl* mWebBrowser; 162 LLWebBrowserCtrl* mWebBrowser;
139}; 163};
140 164
141class LLPanelAvatarAdvanced : public LLPanel 165
166class LLPanelAvatarAdvanced : public LLPanelAvatarTab
142{ 167{
143public: 168public:
144 LLPanelAvatarAdvanced(const std::string& name, const LLRect& rect, LLPanelAvatar* panel_avatar); 169 LLPanelAvatarAdvanced(const std::string& name, const LLRect& rect, LLPanelAvatar* panel_avatar);
145 /*virtual*/ ~LLPanelAvatarAdvanced(); 170
146 /*virtual*/ BOOL postBuild(void); 171 /*virtual*/ BOOL postBuild(void);
147 172
148 void enableControls(BOOL own_avatar); 173 void enableControls(BOOL own_avatar);
@@ -153,8 +178,7 @@ public:
153 U32* skills_mask, std::string& skills_text, 178 U32* skills_mask, std::string& skills_text,
154 std::string& languages_text); 179 std::string& languages_text);
155 180
156protected: 181private:
157 LLPanelAvatar* mPanelAvatar;
158 S32 mWantToCount; 182 S32 mWantToCount;
159 S32 mSkillsCount; 183 S32 mSkillsCount;
160 LLCheckBoxCtrl *mWantToCheck[8]; 184 LLCheckBoxCtrl *mWantToCheck[8];
@@ -164,35 +188,31 @@ protected:
164}; 188};
165 189
166 190
167class LLPanelAvatarNotes : public LLPanel 191class LLPanelAvatarNotes : public LLPanelAvatarTab
168{ 192{
169public: 193public:
170 LLPanelAvatarNotes(const std::string& name, const LLRect& rect, LLPanelAvatar* panel_avatar); 194 LLPanelAvatarNotes(const std::string& name, const LLRect& rect, LLPanelAvatar* panel_avatar);
171 /*virtual*/ ~LLPanelAvatarNotes(); 195
172 /*virtual*/ BOOL postBuild(void); 196 /*virtual*/ BOOL postBuild(void);
173 197
174 void enableControls(BOOL own_avatar); 198 /*virtual*/ void refresh();
175 199
176 static void onCommitNotes(LLUICtrl* field, void* userdata); 200 void clearControls();
177 201
178protected: 202 static void onCommitNotes(LLUICtrl* field, void* userdata);
179 LLPanelAvatar* mPanelAvatar;
180}; 203};
181 204
182 205
183class LLPanelAvatarClassified : public LLPanel 206class LLPanelAvatarClassified : public LLPanelAvatarTab
184{ 207{
185public: 208public:
186 LLPanelAvatarClassified(const LLString& name, const LLRect& rect, LLPanelAvatar* panel_avatar); 209 LLPanelAvatarClassified(const LLString& name, const LLRect& rect, LLPanelAvatar* panel_avatar);
187 /*virtual*/ ~LLPanelAvatarClassified();
188 210
189 /*virtual*/ BOOL postBuild(void); 211 /*virtual*/ BOOL postBuild(void);
190 /*virtual*/ void draw();
191 212
192 void refresh(); 213 /*virtual*/ void refresh();
193 214
194 void apply(); 215 void apply();
195 void enableControls(BOOL own_avatar);
196 216
197 BOOL titleIsValid(); 217 BOOL titleIsValid();
198 218
@@ -209,23 +229,17 @@ private:
209 229
210 static void callbackDelete(S32 option, void* data); 230 static void callbackDelete(S32 option, void* data);
211 static void callbackNew(S32 option, void* data); 231 static void callbackNew(S32 option, void* data);
212
213private:
214 LLPanelAvatar* mPanelAvatar;
215}; 232};
216 233
217class LLPanelAvatarPicks : public LLPanel 234
235class LLPanelAvatarPicks : public LLPanelAvatarTab
218{ 236{
219public: 237public:
220 LLPanelAvatarPicks(const std::string& name, const LLRect& rect, LLPanelAvatar* panel_avatar); 238 LLPanelAvatarPicks(const std::string& name, const LLRect& rect, LLPanelAvatar* panel_avatar);
221 /*virtual*/ ~LLPanelAvatarPicks();
222 239
223 /*virtual*/ BOOL postBuild(void); 240 /*virtual*/ BOOL postBuild(void);
224 /*virtual*/ void draw();
225
226 void refresh();
227 241
228 void enableControls(BOOL own_avatar); 242 /*virtual*/ void refresh();
229 243
230 // Delete all the pick sub-panels from the tab container 244 // Delete all the pick sub-panels from the tab container
231 void deletePickPanels(); 245 void deletePickPanels();
@@ -240,9 +254,6 @@ private:
240 static void onClickDelete(void* data); 254 static void onClickDelete(void* data);
241 255
242 static void callbackDelete(S32 option, void* data); 256 static void callbackDelete(S32 option, void* data);
243
244private:
245 LLPanelAvatar* mPanelAvatar;
246}; 257};
247 258
248 259
diff --git a/linden/indra/newview/llpanelclassified.cpp b/linden/indra/newview/llpanelclassified.cpp
index d6ca984..11120e0 100644
--- a/linden/indra/newview/llpanelclassified.cpp
+++ b/linden/indra/newview/llpanelclassified.cpp
@@ -102,16 +102,17 @@ LLPanelClassified::LLPanelClassified(BOOL in_finder)
102 mDataRequested(FALSE), 102 mDataRequested(FALSE),
103 mEnableCommit(FALSE), 103 mEnableCommit(FALSE),
104 mPaidFor(FALSE), 104 mPaidFor(FALSE),
105 mParcelID(),
106 mPosGlobal(), 105 mPosGlobal(),
107 mSnapshotCtrl(NULL), 106 mSnapshotCtrl(NULL),
108 mNameEditor(NULL), 107 mNameEditor(NULL),
109 mLocationEditor(NULL),
110 mDescEditor(NULL), 108 mDescEditor(NULL),
109 mLocationEditor(NULL),
110 mCategoryCombo(NULL),
111 mUpdateBtn(NULL),
111 mTeleportBtn(NULL), 112 mTeleportBtn(NULL),
112 mMapBtn(NULL), 113 mMapBtn(NULL),
113 //mLandmarkBtn(NULL), 114 mProfileBtn(NULL),
114 //mEnabledCheck(NULL), 115 mInfoText(NULL),
115 mMatureCheck(NULL), 116 mMatureCheck(NULL),
116 mAutoRenewCheck(NULL), 117 mAutoRenewCheck(NULL),
117 mSetBtn(NULL), 118 mSetBtn(NULL),
@@ -441,10 +442,10 @@ void LLPanelClassified::processClassifiedInfoReply(LLMessageSystem *msg, void **
441 LLUUID parcel_id; 442 LLUUID parcel_id;
442 msg->getUUIDFast(_PREHASH_Data, _PREHASH_ParcelID, parcel_id); 443 msg->getUUIDFast(_PREHASH_Data, _PREHASH_ParcelID, parcel_id);
443 444
444 char name[DB_PARCEL_NAME_SIZE]; 445 char name[DB_PARCEL_NAME_SIZE]; /*Flawfinder: ignore*/
445 msg->getStringFast(_PREHASH_Data, _PREHASH_Name, DB_PARCEL_NAME_SIZE, name); 446 msg->getStringFast(_PREHASH_Data, _PREHASH_Name, DB_PARCEL_NAME_SIZE, name);
446 447
447 char desc[DB_PICK_DESC_SIZE]; 448 char desc[DB_PICK_DESC_SIZE]; /*Flawfinder: ignore*/
448 msg->getStringFast(_PREHASH_Data, _PREHASH_Desc, DB_PICK_DESC_SIZE, desc); 449 msg->getStringFast(_PREHASH_Data, _PREHASH_Desc, DB_PICK_DESC_SIZE, desc);
449 450
450 LLUUID snapshot_id; 451 LLUUID snapshot_id;
@@ -452,7 +453,7 @@ void LLPanelClassified::processClassifiedInfoReply(LLMessageSystem *msg, void **
452 453
453 // "Location text" is actually the original 454 // "Location text" is actually the original
454 // name that owner gave the parcel, and the location. 455 // name that owner gave the parcel, and the location.
455 char buffer[256]; 456 char buffer[256]; /*Flawfinder: ignore*/
456 LLString location_text; 457 LLString location_text;
457 458
458 msg->getStringFast(_PREHASH_Data, _PREHASH_ParcelName, 256, buffer); 459 msg->getStringFast(_PREHASH_Data, _PREHASH_ParcelName, 256, buffer);
@@ -466,7 +467,7 @@ void LLPanelClassified::processClassifiedInfoReply(LLMessageSystem *msg, void **
466 location_text.assign(""); 467 location_text.assign("");
467 } 468 }
468 469
469 char sim_name[256]; 470 char sim_name[256]; /*Flawfinder: ignore*/
470 msg->getStringFast(_PREHASH_Data, _PREHASH_SimName, 256, sim_name); 471 msg->getStringFast(_PREHASH_Data, _PREHASH_SimName, 256, sim_name);
471 472
472 LLVector3d pos_global; 473 LLVector3d pos_global;
@@ -476,7 +477,7 @@ void LLPanelClassified::processClassifiedInfoReply(LLMessageSystem *msg, void **
476 S32 region_y = llround((F32)pos_global.mdV[VY]) % REGION_WIDTH_UNITS; 477 S32 region_y = llround((F32)pos_global.mdV[VY]) % REGION_WIDTH_UNITS;
477 S32 region_z = llround((F32)pos_global.mdV[VZ]); 478 S32 region_z = llround((F32)pos_global.mdV[VZ]);
478 479
479 sprintf(buffer, "%s (%d, %d, %d)", sim_name, region_x, region_y, region_z); 480 snprintf(buffer, sizeof(buffer), "%s (%d, %d, %d)", sim_name, region_x, region_y, region_z); /*Flawfinder: ignore*/
480 location_text.append(buffer); 481 location_text.append(buffer);
481 482
482 U8 flags; 483 U8 flags;
@@ -762,7 +763,7 @@ void LLPanelClassified::onClickSet(void* data)
762 self->mPosGlobal = gAgent.getPositionGlobal(); 763 self->mPosGlobal = gAgent.getPositionGlobal();
763 764
764 LLString location_text; 765 LLString location_text;
765 location_text.assign("(will update after save)"); 766 location_text.assign("(will update after publish)");
766 location_text.append(", "); 767 location_text.append(", ");
767 768
768 S32 region_x = llround((F32)self->mPosGlobal.mdV[VX]) % REGION_WIDTH_UNITS; 769 S32 region_x = llround((F32)self->mPosGlobal.mdV[VX]) % REGION_WIDTH_UNITS;
@@ -804,7 +805,7 @@ void LLPanelClassified::sendClassifiedClickMessage(const char* type)
804 // You're allowed to click on your own ads to reassure yourself 805 // You're allowed to click on your own ads to reassure yourself
805 // that the system is working. 806 // that the system is working.
806 std::vector<std::string> strings; 807 std::vector<std::string> strings;
807 strings.push_back(mClassifiedID.getString()); 808 strings.push_back(mClassifiedID.asString());
808 strings.push_back(type); 809 strings.push_back(type);
809 LLUUID no_invoice; 810 LLUUID no_invoice;
810 send_generic_message("classifiedclick", strings, no_invoice); 811 send_generic_message("classifiedclick", strings, no_invoice);
diff --git a/linden/indra/newview/llpanelcontents.cpp b/linden/indra/newview/llpanelcontents.cpp
index 6fa34cf..47f2d35 100644
--- a/linden/indra/newview/llpanelcontents.cpp
+++ b/linden/indra/newview/llpanelcontents.cpp
@@ -115,8 +115,8 @@ void LLPanelContents::getState(LLViewerObject *objectp )
115 // unambiguous destination for the object. 115 // unambiguous destination for the object.
116 if( editable && 116 if( editable &&
117 all_volume && 117 all_volume &&
118 ((gSelectMgr->getRootObjectCount() == 1) 118 ((gSelectMgr->getSelection()->getRootObjectCount() == 1)
119 || (gSelectMgr->getObjectCount() == 1))) 119 || (gSelectMgr->getSelection()->getObjectCount() == 1)))
120 { 120 {
121 //mBtnNewScript->setEnabled(TRUE); 121 //mBtnNewScript->setEnabled(TRUE);
122 childSetEnabled("button new script",TRUE); 122 childSetEnabled("button new script",TRUE);
@@ -131,10 +131,10 @@ void LLPanelContents::getState(LLViewerObject *objectp )
131 131
132void LLPanelContents::refresh() 132void LLPanelContents::refresh()
133{ 133{
134 LLViewerObject* object = gSelectMgr->getFirstRootObject(); 134 LLViewerObject* object = gSelectMgr->getSelection()->getFirstRootObject();
135 if(!object) 135 if(!object)
136 { 136 {
137 object = gSelectMgr->getFirstObject(); 137 object = gSelectMgr->getSelection()->getFirstObject();
138 } 138 }
139 139
140 getState(object); 140 getState(object);
@@ -153,10 +153,10 @@ void LLPanelContents::refresh()
153// static 153// static
154void LLPanelContents::onClickNewScript(void *userdata) 154void LLPanelContents::onClickNewScript(void *userdata)
155{ 155{
156 LLViewerObject* object = gSelectMgr->getFirstRootObject(); 156 LLViewerObject* object = gSelectMgr->getSelection()->getFirstRootObject();
157 if(!object) 157 if(!object)
158 { 158 {
159 object = gSelectMgr->getFirstObject(); 159 object = gSelectMgr->getSelection()->getFirstObject();
160 } 160 }
161 if(object) 161 if(object)
162 { 162 {
@@ -203,7 +203,7 @@ void LLPanelContents::onClickNewScript(void *userdata)
203 "Script: New Script", 203 "Script: New Script",
204 object->mID, 204 object->mID,
205 LLUUID::null); 205 LLUUID::null);
206 editor->open(); 206 editor->open(); /*Flawfinder: ignore*/
207 207
208 // keep onscreen 208 // keep onscreen
209 gFloaterView->adjustToFitScreen(editor, FALSE); 209 gFloaterView->adjustToFitScreen(editor, FALSE);
diff --git a/linden/indra/newview/llpaneldirbrowser.cpp b/linden/indra/newview/llpaneldirbrowser.cpp
index f701bf4..7f15a85 100644
--- a/linden/indra/newview/llpaneldirbrowser.cpp
+++ b/linden/indra/newview/llpaneldirbrowser.cpp
@@ -400,8 +400,8 @@ void LLPanelDirBrowser::showEvent(const U32 event_id)
400void LLPanelDirBrowser::processDirPeopleReply(LLMessageSystem *msg, void**) 400void LLPanelDirBrowser::processDirPeopleReply(LLMessageSystem *msg, void**)
401{ 401{
402 LLUUID query_id; 402 LLUUID query_id;
403 char first_name[DB_FIRST_NAME_BUF_SIZE]; 403 char first_name[DB_FIRST_NAME_BUF_SIZE]; /* Flawfinder: ignore */
404 char last_name[DB_LAST_NAME_BUF_SIZE]; 404 char last_name[DB_LAST_NAME_BUF_SIZE]; /* Flawfinder: ignore */
405 LLUUID agent_id; 405 LLUUID agent_id;
406 406
407 msg->getUUIDFast(_PREHASH_QueryData,_PREHASH_QueryID, query_id); 407 msg->getUUIDFast(_PREHASH_QueryData,_PREHASH_QueryID, query_id);
@@ -471,9 +471,7 @@ void LLPanelDirBrowser::processDirPeopleReply(LLMessageSystem *msg, void**)
471 content["name"] = fullname; 471 content["name"] = fullname;
472 472
473 list->addElement(row); 473 list->addElement(row);
474 474 self->mResultsContents[agent_id.asString()] = content;
475 LLString id_str = agent_id.getString();
476 self->mResultsContents[id_str] = content;
477 } 475 }
478 476
479 list->sortByColumn(self->mCurrentSortColumn, self->mCurrentSortAscending); 477 list->sortByColumn(self->mCurrentSortColumn, self->mCurrentSortAscending);
@@ -490,7 +488,7 @@ void LLPanelDirBrowser::processDirPlacesReply(LLMessageSystem* msg, void**)
490 LLUUID agent_id; 488 LLUUID agent_id;
491 LLUUID query_id; 489 LLUUID query_id;
492 LLUUID parcel_id; 490 LLUUID parcel_id;
493 char name[MAX_STRING]; 491 char name[MAX_STRING]; /*Flawfinder: ignore*/
494 BOOL is_for_sale; 492 BOOL is_for_sale;
495 BOOL is_auction; 493 BOOL is_auction;
496 BOOL is_newbie; 494 BOOL is_newbie;
@@ -552,9 +550,7 @@ void LLPanelDirBrowser::processDirPlacesReply(LLMessageSystem* msg, void**)
552 row["columns"][3]["font"] = "SANSSERIFSMALL"; 550 row["columns"][3]["font"] = "SANSSERIFSMALL";
553 551
554 list->addElement(row); 552 list->addElement(row);
555 553 self->mResultsContents[parcel_id.asString()] = content;
556 LLString id_str = parcel_id.getString();
557 self->mResultsContents[id_str] = content;
558 } 554 }
559 555
560 list->sortByColumn(self->mCurrentSortColumn, self->mCurrentSortAscending); 556 list->sortByColumn(self->mCurrentSortColumn, self->mCurrentSortAscending);
@@ -572,7 +568,7 @@ void LLPanelDirBrowser::processDirPopularReply(LLMessageSystem *msg, void**)
572 LLUUID agent_id; 568 LLUUID agent_id;
573 LLUUID query_id; 569 LLUUID query_id;
574 LLUUID parcel_id; 570 LLUUID parcel_id;
575 char name[MAX_STRING]; 571 char name[MAX_STRING]; /*Flawfinder: ignore*/
576 F32 dwell; 572 F32 dwell;
577 573
578 msg->getUUID("AgentData", "AgentID", agent_id); 574 msg->getUUID("AgentData", "AgentID", agent_id);
@@ -634,9 +630,7 @@ void LLPanelDirBrowser::processDirPopularReply(LLMessageSystem *msg, void**)
634 row["columns"][2]["font"] = "SANSSERIFSMALL"; 630 row["columns"][2]["font"] = "SANSSERIFSMALL";
635 631
636 list->addElement(row); 632 list->addElement(row);
637 633 self->mResultsContents[parcel_id.asString()] = content;
638 LLString id_str = parcel_id.getString();
639 self->mResultsContents[id_str] = content;
640 } 634 }
641 635
642 list->sortByColumn(self->mCurrentSortColumn, self->mCurrentSortAscending); 636 list->sortByColumn(self->mCurrentSortColumn, self->mCurrentSortAscending);
@@ -653,8 +647,8 @@ void LLPanelDirBrowser::processDirEventsReply(LLMessageSystem* msg, void**)
653 LLUUID agent_id; 647 LLUUID agent_id;
654 LLUUID query_id; 648 LLUUID query_id;
655 LLUUID owner_id; 649 LLUUID owner_id;
656 char name[MAX_STRING]; 650 char name[MAX_STRING]; /*Flawfinder: ignore*/
657 char date[MAX_STRING]; 651 char date[MAX_STRING]; /*Flawfinder: ignore*/
658 BOOL show_mature = gSavedSettings.getBOOL("ShowMatureEvents"); 652 BOOL show_mature = gSavedSettings.getBOOL("ShowMatureEvents");
659 653
660 msg->getUUID("AgentData", "AgentID", agent_id); 654 msg->getUUID("AgentData", "AgentID", agent_id);
@@ -771,7 +765,7 @@ void LLPanelDirBrowser::processDirGroupsReply(LLMessageSystem* msg, void**)
771 765
772 LLUUID query_id; 766 LLUUID query_id;
773 LLUUID group_id; 767 LLUUID group_id;
774 char group_name[DB_GROUP_NAME_BUF_SIZE]; 768 char group_name[DB_GROUP_NAME_BUF_SIZE]; /*Flawfinder: ignore*/
775 S32 members; 769 S32 members;
776 BOOL open_enrollment; 770 BOOL open_enrollment;
777 S32 membership_fee; 771 S32 membership_fee;
@@ -836,8 +830,7 @@ void LLPanelDirBrowser::processDirGroupsReply(LLMessageSystem* msg, void**)
836 row["columns"][2]["font"] = "SANSSERIFSMALL"; 830 row["columns"][2]["font"] = "SANSSERIFSMALL";
837 831
838 list->addElement(row); 832 list->addElement(row);
839 LLString id_str = group_id.getString(); 833 self->mResultsContents[group_id.asString()] = content;
840 self->mResultsContents[id_str] = content;
841 } 834 }
842 list->sortByColumn(self->mCurrentSortColumn, self->mCurrentSortAscending); 835 list->sortByColumn(self->mCurrentSortColumn, self->mCurrentSortAscending);
843 self->updateResultCount(); 836 self->updateResultCount();
@@ -890,7 +883,7 @@ void LLPanelDirBrowser::processDirClassifiedReply(LLMessageSystem* msg, void**)
890 for (i = 0; i < num_new_rows; i++) 883 for (i = 0; i < num_new_rows; i++)
891 { 884 {
892 LLUUID classified_id; 885 LLUUID classified_id;
893 char name[DB_PARCEL_NAME_SIZE]; 886 char name[DB_PARCEL_NAME_SIZE]; /*Flawfinder: ignore*/
894 U32 creation_date = 0; // unix timestamp 887 U32 creation_date = 0; // unix timestamp
895 U32 expiration_date = 0; // future use 888 U32 expiration_date = 0; // future use
896 S32 price_for_listing = 0; 889 S32 price_for_listing = 0;
@@ -907,9 +900,7 @@ void LLPanelDirBrowser::processDirClassifiedReply(LLMessageSystem* msg, void**)
907 LLSD content; 900 LLSD content;
908 content["type"] = CLASSIFIED_CODE; 901 content["type"] = CLASSIFIED_CODE;
909 content["name"] = name; 902 content["name"] = name;
910 903 self->mResultsContents[classified_id.asString()] = content;
911 LLString id_str = classified_id.getString();
912 self->mResultsContents[id_str] = content;
913 } 904 }
914 } 905 }
915 // The server does the initial sort, by price paid per listing and date. JC 906 // The server does the initial sort, by price paid per listing and date. JC
@@ -925,7 +916,7 @@ void LLPanelDirBrowser::processDirLandReply(LLMessageSystem *msg, void**)
925 LLUUID agent_id; 916 LLUUID agent_id;
926 LLUUID query_id; 917 LLUUID query_id;
927 LLUUID parcel_id; 918 LLUUID parcel_id;
928 char name[MAX_STRING]; 919 char name[MAX_STRING]; /*Flawfinder: ignore*/
929 BOOL auction; 920 BOOL auction;
930 BOOL for_sale; 921 BOOL for_sale;
931 S32 sale_price; 922 S32 sale_price;
@@ -1033,8 +1024,7 @@ void LLPanelDirBrowser::processDirLandReply(LLMessageSystem *msg, void**)
1033 } 1024 }
1034 1025
1035 list->addElement(row); 1026 list->addElement(row);
1036 LLString id_str = parcel_id.getString(); 1027 self->mResultsContents[parcel_id.asString()] = content;
1037 self->mResultsContents[id_str] = content;
1038 } 1028 }
1039 1029
1040 // All auction results are shown on the first page 1030 // All auction results are shown on the first page
diff --git a/linden/indra/newview/llpaneldirevents.cpp b/linden/indra/newview/llpaneldirevents.cpp
index 703ee5e..f3cd2ce 100644
--- a/linden/indra/newview/llpaneldirevents.cpp
+++ b/linden/indra/newview/llpaneldirevents.cpp
@@ -50,8 +50,8 @@ BOOL gDisplayEventHack = FALSE;
50 50
51LLPanelDirEvents::LLPanelDirEvents(const std::string& name, LLFloaterDirectory* floater) 51LLPanelDirEvents::LLPanelDirEvents(const std::string& name, LLFloaterDirectory* floater)
52 : LLPanelDirBrowser(name, floater), 52 : LLPanelDirBrowser(name, floater),
53 mDay(0), 53 mDoneQuery(FALSE),
54 mDoneQuery(FALSE) 54 mDay(0)
55{ 55{
56 // more results per page for this 56 // more results per page for this
57 mResultsPerPage = 200; 57 mResultsPerPage = 200;
diff --git a/linden/indra/newview/llpaneldisplay.cpp b/linden/indra/newview/llpaneldisplay.cpp
index ea3d7e7..a8611b1 100644
--- a/linden/indra/newview/llpaneldisplay.cpp
+++ b/linden/indra/newview/llpaneldisplay.cpp
@@ -247,11 +247,11 @@ void LLPanelDisplay::onApplyResolution(LLUICtrl* src, void* user_data)
247 247
248void LLPanelDisplay::applyResolution() 248void LLPanelDisplay::applyResolution()
249{ 249{
250 char aspect_ratio_text[ASPECT_RATIO_STR_LEN]; 250 char aspect_ratio_text[ASPECT_RATIO_STR_LEN]; /*Flawfinder: ignore*/
251 if (mCtrlAspectRatio->getCurrentIndex() == -1) 251 if (mCtrlAspectRatio->getCurrentIndex() == -1)
252 { 252 {
253 strcpy(aspect_ratio_text, mCtrlAspectRatio->getSimple().c_str()); 253 strncpy(aspect_ratio_text, mCtrlAspectRatio->getSimple().c_str(), sizeof(aspect_ratio_text) -1); /*Flawfinder: ignore*/
254 254 aspect_ratio_text[sizeof(aspect_ratio_text) -1] = '\0';
255 char *element = strtok(aspect_ratio_text, ":/\\"); 255 char *element = strtok(aspect_ratio_text, ":/\\");
256 if (!element) 256 if (!element)
257 { 257 {
@@ -385,7 +385,7 @@ void LLPanelDisplay::onCommitAutoDetectAspect(LLUICtrl *ctrl, void *data)
385 385
386 if (auto_detect) 386 if (auto_detect)
387 { 387 {
388 char aspect[100]; 388 char aspect[100]; /*Flawfinder: ignore*/
389 S32 numerator = 0; 389 S32 numerator = 0;
390 S32 denominator = 0; 390 S32 denominator = 0;
391 // clear any aspect ratio override 391 // clear any aspect ratio override
@@ -394,11 +394,11 @@ void LLPanelDisplay::onCommitAutoDetectAspect(LLUICtrl *ctrl, void *data)
394 394
395 if (numerator != 0) 395 if (numerator != 0)
396 { 396 {
397 sprintf(aspect, "%d:%d", numerator, denominator); 397 snprintf(aspect, sizeof(aspect), "%d:%d", numerator, denominator); /*Flawfinder: ignore*/
398 } 398 }
399 else 399 else
400 { 400 {
401 sprintf(aspect, "%.3f", gViewerWindow->mWindow->getNativeAspectRatio()); 401 snprintf(aspect, sizeof(aspect), "%.3f", gViewerWindow->mWindow->getNativeAspectRatio()); /*Flawfinder: ignore*/
402 } 402 }
403 403
404 panel->mCtrlAspectRatio->setLabel(aspect); 404 panel->mCtrlAspectRatio->setLabel(aspect);
@@ -449,7 +449,7 @@ BOOL LLPanelDisplay2::postBuild()
449 449
450 requires("ani", WIDGET_TYPE_CHECKBOX); 450 requires("ani", WIDGET_TYPE_CHECKBOX);
451 requires("gamma", WIDGET_TYPE_SPINNER); 451 requires("gamma", WIDGET_TYPE_SPINNER);
452 requires("agp", WIDGET_TYPE_CHECKBOX); 452 requires("vbo", WIDGET_TYPE_CHECKBOX);
453 requires("video card memory radio", WIDGET_TYPE_RADIO_GROUP); 453 requires("video card memory radio", WIDGET_TYPE_RADIO_GROUP);
454 requires("fog", WIDGET_TYPE_SPINNER); 454 requires("fog", WIDGET_TYPE_SPINNER);
455 requires("particles", WIDGET_TYPE_SPINNER); 455 requires("particles", WIDGET_TYPE_SPINNER);
@@ -460,35 +460,9 @@ BOOL LLPanelDisplay2::postBuild()
460 return FALSE; 460 return FALSE;
461 } 461 }
462 462
463 //============================================================================
464 //Visual Enancements
465
466 // Anisotropic filtering checkbox
467 mCtrlAnisotropic = LLUICtrlFactory::getCheckBoxByName(this, "ani");
468
469 //============================================================================
470 // Gamma
471 mCtrlGamma = LLUICtrlFactory::getSpinnerByName(this, "gamma");
472
473 // Nighttime brigtness detail slider
474 mCtrlNighttimeBrightness = LLUICtrlFactory::getSpinnerByName(this, "nighttime_brightness");
475
476 //============================================================================
477 // Use AGP
478 mCtrlUseAGP = LLUICtrlFactory::getCheckBoxByName(this, "agp");
479
480 // Graphics Card Memory 463 // Graphics Card Memory
481 mRadioVideoCardMem = LLUICtrlFactory::getRadioGroupByName(this, "video card memory radio"); 464 mRadioVideoCardMem = LLUICtrlFactory::getRadioGroupByName(this, "video card memory radio");
482 465
483 // Fog ratio spin ctrl
484 mCtrlFogRatio = LLUICtrlFactory::getSpinnerByName(this, "fog");
485
486 // Particle count spin ctrl
487 mCtrlParticles = LLUICtrlFactory::getSpinnerByName(this, "particles");
488
489 // Avatar composite limit spin ctrl
490 mCtrlCompositeLimit = LLUICtrlFactory::getSpinnerByName(this, "comp limit");
491
492 refresh(); 466 refresh();
493 467
494 return TRUE; 468 return TRUE;
@@ -504,7 +478,7 @@ void LLPanelDisplay2::refresh()
504{ 478{
505 LLPanel::refresh(); 479 LLPanel::refresh();
506 480
507 mUseAGP = gSavedSettings.getBOOL("RenderUseAGP"); 481 mUseVBO = gSavedSettings.getBOOL("RenderVBOEnable");
508 mUseAniso = gSavedSettings.getBOOL("RenderAnisotropic"); 482 mUseAniso = gSavedSettings.getBOOL("RenderAnisotropic");
509 mGamma = gSavedSettings.getF32("RenderGamma"); 483 mGamma = gSavedSettings.getF32("RenderGamma");
510 mBrightness = gSavedSettings.getF32("RenderNightBrightness"); 484 mBrightness = gSavedSettings.getF32("RenderNightBrightness");
@@ -525,9 +499,10 @@ void LLPanelDisplay2::refreshEnabledState()
525 mRadioVideoCardMem->getRadioButton(i)->setEnabled(FALSE); 499 mRadioVideoCardMem->getRadioButton(i)->setEnabled(FALSE);
526 } 500 }
527 501
528 if (!gGLManager.mHasAnyAGP || !gFeatureManagerp->isFeatureAvailable("RenderAGP")) 502 if (!gFeatureManagerp->isFeatureAvailable("RenderVBO") ||
503 !gGLManager.mHasVertexBufferObject)
529 { 504 {
530 mCtrlUseAGP->setEnabled(FALSE); 505 childSetEnabled("vbo", FALSE);
531 } 506 }
532} 507}
533 508
@@ -535,7 +510,7 @@ void LLPanelDisplay2::apply()
535{ 510{
536 // Anisotropic rendering 511 // Anisotropic rendering
537 BOOL old_anisotropic = LLImageGL::sGlobalUseAnisotropic; 512 BOOL old_anisotropic = LLImageGL::sGlobalUseAnisotropic;
538 LLImageGL::sGlobalUseAnisotropic = mCtrlAnisotropic->get(); 513 LLImageGL::sGlobalUseAnisotropic = childGetValue("ani");
539 if (old_anisotropic != LLImageGL::sGlobalUseAnisotropic) 514 if (old_anisotropic != LLImageGL::sGlobalUseAnisotropic)
540 { 515 {
541 BOOL logged_in = (gStartupState >= STATE_STARTED); 516 BOOL logged_in = (gStartupState >= STATE_STARTED);
@@ -549,7 +524,7 @@ void LLPanelDisplay2::apply()
549 524
550void LLPanelDisplay2::cancel() 525void LLPanelDisplay2::cancel()
551{ 526{
552 gSavedSettings.setBOOL("RenderUseAGP", mUseAGP); 527 gSavedSettings.setBOOL("RenderVBOEnable", mUseVBO);
553 gSavedSettings.setBOOL("RenderAnisotropic", mUseAniso); 528 gSavedSettings.setBOOL("RenderAnisotropic", mUseAniso);
554 gSavedSettings.setF32("RenderGamma", mGamma); 529 gSavedSettings.setF32("RenderGamma", mGamma);
555 gSavedSettings.setF32("RenderNightBrightness", mBrightness); 530 gSavedSettings.setF32("RenderNightBrightness", mBrightness);
diff --git a/linden/indra/newview/llpaneldisplay.h b/linden/indra/newview/llpaneldisplay.h
index ed711c5..305b290 100644
--- a/linden/indra/newview/llpaneldisplay.h
+++ b/linden/indra/newview/llpaneldisplay.h
@@ -90,17 +90,9 @@ public:
90 void refreshEnabledState(); 90 void refreshEnabledState();
91 91
92protected: 92protected:
93 LLCheckBoxCtrl *mCtrlAnisotropic; // Anisitropic filtering
94 LLSpinCtrl *mCtrlGamma;
95 LLSpinCtrl *mCtrlNighttimeBrightness; // user adjusted nighttime brightness ([0.0, 2.0] 1.0 = normal)
96 LLCheckBoxCtrl *mCtrlUseAGP; // Use AGP if available
97 LLSpinCtrl *mCtrlFogRatio; // Fig distance / draw distance ratio
98 LLSpinCtrl *mCtrlParticles; // Max number of particles
99 LLSpinCtrl *mCtrlCompositeLimit; // Max num non-self avatars that can be composited
100
101 LLRadioGroup* mRadioVideoCardMem; 93 LLRadioGroup* mRadioVideoCardMem;
102 94
103 BOOL mUseAGP; 95 BOOL mUseVBO;
104 BOOL mUseAniso; 96 BOOL mUseAniso;
105 F32 mGamma; 97 F32 mGamma;
106 F32 mBrightness; 98 F32 mBrightness;
diff --git a/linden/indra/newview/llpanelevent.cpp b/linden/indra/newview/llpanelevent.cpp
index 498d4fc..9478ea2 100644
--- a/linden/indra/newview/llpanelevent.cpp
+++ b/linden/indra/newview/llpanelevent.cpp
@@ -166,7 +166,7 @@ void LLPanelEvent::processEventInfoReply(LLMessageSystem *msg, void **)
166 { 166 {
167 continue; 167 continue;
168 } 168 }
169 char buffer[256]; 169 char buffer[256]; /*Flawfinder: ignore*/
170 170
171 self->mEventInfo.unpack(msg); 171 self->mEventInfo.unpack(msg);
172 self->mTBName->setText(self->mEventInfo.mName); 172 self->mTBName->setText(self->mEventInfo.mName);
@@ -174,7 +174,7 @@ void LLPanelEvent::processEventInfoReply(LLMessageSystem *msg, void **)
174 self->mTBDate->setText(self->mEventInfo.mTimeStr); 174 self->mTBDate->setText(self->mEventInfo.mTimeStr);
175 self->mTBDesc->setText(self->mEventInfo.mDesc); 175 self->mTBDesc->setText(self->mEventInfo.mDesc);
176 176
177 sprintf(buffer, "%d:%.2d", self->mEventInfo.mDuration / 60, self->mEventInfo.mDuration % 60); 177 snprintf(buffer, sizeof(buffer), "%d:%.2d", self->mEventInfo.mDuration / 60, self->mEventInfo.mDuration % 60); /*Flawfinder: ignore*/
178 178
179 self->mTBDuration->setText(buffer); 179 self->mTBDuration->setText(buffer);
180 180
@@ -184,7 +184,7 @@ void LLPanelEvent::processEventInfoReply(LLMessageSystem *msg, void **)
184 } 184 }
185 else 185 else
186 { 186 {
187 sprintf(buffer, "%d", self->mEventInfo.mCover); 187 snprintf(buffer, sizeof(buffer), "%d", self->mEventInfo.mCover); /*Flawfinder: ignore*/
188 self->mTBCover->setText(buffer); 188 self->mTBCover->setText(buffer);
189 } 189 }
190 190
@@ -195,7 +195,7 @@ void LLPanelEvent::processEventInfoReply(LLMessageSystem *msg, void **)
195 S32 region_y = llround(global_y) % REGION_WIDTH_UNITS; 195 S32 region_y = llround(global_y) % REGION_WIDTH_UNITS;
196 S32 region_z = llround((F32)self->mEventInfo.mPosGlobal.mdV[VZ]); 196 S32 region_z = llround((F32)self->mEventInfo.mPosGlobal.mdV[VZ]);
197 197
198 sprintf(buffer, "%s (%d, %d, %d)", self->mEventInfo.mSimName.c_str(), region_x, region_y, region_z); 198 snprintf(buffer, sizeof(buffer), "%s (%d, %d, %d)", self->mEventInfo.mSimName.c_str(), region_x, region_y, region_z); /*Flawfinder: ignore*/
199 self->mTBLocation->setText(buffer); 199 self->mTBLocation->setText(buffer);
200 200
201 if (self->mEventInfo.mEventFlags & EVENT_FLAG_MATURE) 201 if (self->mEventInfo.mEventFlags & EVENT_FLAG_MATURE)
@@ -232,8 +232,8 @@ void LLPanelEvent::processEventInfoReply(LLMessageSystem *msg, void **)
232 232
233void LLPanelEvent::draw() 233void LLPanelEvent::draw()
234{ 234{
235 char firstname[DB_FIRST_NAME_BUF_SIZE]; 235 char firstname[DB_FIRST_NAME_BUF_SIZE]; /*Flawfinder: ignore*/
236 char lastname[DB_LAST_NAME_BUF_SIZE]; 236 char lastname[DB_LAST_NAME_BUF_SIZE]; /*Flawfinder: ignore*/
237 gCacheName->getName(mEventInfo.mRunByID, firstname, lastname); 237 gCacheName->getName(mEventInfo.mRunByID, firstname, lastname);
238 238
239 LLString name; 239 LLString name;
diff --git a/linden/indra/newview/llpanelface.cpp b/linden/indra/newview/llpanelface.cpp
index 56deb91..c69d765 100644
--- a/linden/indra/newview/llpanelface.cpp
+++ b/linden/indra/newview/llpanelface.cpp
@@ -257,7 +257,8 @@ void LLPanelFace::sendTextureInfo()
257{ 257{
258 S32 te; 258 S32 te;
259 LLViewerObject* object; 259 LLViewerObject* object;
260 for ( gSelectMgr->getFirstTE(&object, &te); object; gSelectMgr->getNextTE(&object, &te) ) 260 LLObjectSelectionHandle selection = gSelectMgr->getSelection();
261 for ( selection->getFirstTE(&object, &te); object; selection->getNextTE(&object, &te) )
261 { 262 {
262 BOOL valid; 263 BOOL valid;
263 F32 value; 264 F32 value;
@@ -336,7 +337,7 @@ void LLPanelFace::sendTextureInfo()
336 } 337 }
337 } 338 }
338 339
339 for ( object = gSelectMgr->getFirstObject(); object; object = gSelectMgr->getNextObject() ) 340 for ( object = gSelectMgr->getSelection()->getFirstObject(); object; object = gSelectMgr->getSelection()->getNextObject() )
340 { 341 {
341 object->sendTEUpdate(); 342 object->sendTEUpdate();
342 } 343 }
@@ -344,7 +345,7 @@ void LLPanelFace::sendTextureInfo()
344 345
345void LLPanelFace::getState() 346void LLPanelFace::getState()
346{ 347{
347 LLViewerObject* objectp = gSelectMgr->getFirstObject(); 348 LLViewerObject* objectp = gSelectMgr->getSelection()->getFirstObject();
348 349
349 if( objectp 350 if( objectp
350 && objectp->getPCode() == LL_PCODE_VOLUME) 351 && objectp->getPCode() == LL_PCODE_VOLUME)
@@ -619,7 +620,7 @@ BOOL LLPanelFace::allFacesSameValue( F32 (get_face_value(LLViewerObject*, S32)),
619 // Get the value from the primary selected TE 620 // Get the value from the primary selected TE
620 F32 first_value = *value; 621 F32 first_value = *value;
621 BOOL got_first = FALSE; 622 BOOL got_first = FALSE;
622 gSelectMgr->getPrimaryTE(&object, &te); 623 gSelectMgr->getSelection()->getPrimaryTE(&object, &te);
623 if (object) 624 if (object)
624 { 625 {
625 first_value = get_face_value(object, te); 626 first_value = get_face_value(object, te);
@@ -628,7 +629,8 @@ BOOL LLPanelFace::allFacesSameValue( F32 (get_face_value(LLViewerObject*, S32)),
628 629
629 // Now iterate through all TEs to test for sameness 630 // Now iterate through all TEs to test for sameness
630 BOOL identical = TRUE; 631 BOOL identical = TRUE;
631 for ( gSelectMgr->getFirstTE(&object, &te); object; gSelectMgr->getNextTE(&object, &te) ) 632 LLObjectSelectionHandle selection = gSelectMgr->getSelection();
633 for ( selection->getFirstTE(&object, &te); object; selection->getNextTE(&object, &te) )
632 { 634 {
633 if (!got_first) 635 if (!got_first)
634 { 636 {
@@ -779,13 +781,13 @@ void LLPanelFace::onCommitFullbright(LLUICtrl* ctrl, void* userdata)
779BOOL LLPanelFace::onDragTexture(LLUICtrl*, LLInventoryItem* item, void*) 781BOOL LLPanelFace::onDragTexture(LLUICtrl*, LLInventoryItem* item, void*)
780{ 782{
781 BOOL accept = TRUE; 783 BOOL accept = TRUE;
782 LLViewerObject* obj = gSelectMgr->getFirstRootObject(); 784 LLViewerObject* obj = gSelectMgr->getSelection()->getFirstRootObject();
783 while(accept && obj) 785 while(accept && obj)
784 { 786 {
785 if(!LLToolDragAndDrop::isInventoryDropAcceptable(obj, item)) 787 if(!LLToolDragAndDrop::isInventoryDropAcceptable(obj, item))
786 accept = FALSE; 788 accept = FALSE;
787 else 789 else
788 obj = gSelectMgr->getNextRootObject(); 790 obj = gSelectMgr->getSelection()->getNextRootObject();
789 } 791 }
790 return accept; 792 return accept;
791} 793}
@@ -842,7 +844,8 @@ void LLPanelFace::onClickAutoFix(void* userdata)
842 LLViewerObject* object; 844 LLViewerObject* object;
843 845
844 // for all selected objects 846 // for all selected objects
845 for ( gSelectMgr->getFirstTE(&object, &te); object; gSelectMgr->getNextTE(&object, &te) ) 847 LLObjectSelectionHandle selection = gSelectMgr->getSelection();
848 for ( selection->getFirstTE(&object, &te); object; selection->getNextTE(&object, &te) )
846 { 849 {
847 // only do this if it's a media texture 850 // only do this if it's a media texture
848 if ( object->getTE ( te )->getID() == LLMediaEngine::getInstance()->getImageUUID () ) 851 if ( object->getTE ( te )->getID() == LLMediaEngine::getInstance()->getImageUUID () )
@@ -867,7 +870,7 @@ void LLPanelFace::onClickAutoFix(void* userdata)
867 }; 870 };
868 871
869 // not clear why this is in a separate loop but i followed the patter from further up this file just in case. 872 // not clear why this is in a separate loop but i followed the patter from further up this file just in case.
870 for ( object = gSelectMgr->getFirstObject(); object; object = gSelectMgr->getNextObject() ) 873 for ( object = gSelectMgr->getSelection()->getFirstObject(); object; object = gSelectMgr->getSelection()->getNextObject() )
871 { 874 {
872 object->sendTEUpdate(); 875 object->sendTEUpdate();
873 }; 876 };
diff --git a/linden/indra/newview/llpanelgroup.cpp b/linden/indra/newview/llpanelgroup.cpp
index 8a44da5..ce7c67a 100644
--- a/linden/indra/newview/llpanelgroup.cpp
+++ b/linden/indra/newview/llpanelgroup.cpp
@@ -151,8 +151,8 @@ LLPanelGroup::LLPanelGroup(const std::string& filename,
151 mCurrentTab( NULL ), 151 mCurrentTab( NULL ),
152 mRequestedTab( NULL ), 152 mRequestedTab( NULL ),
153 mTabContainer( NULL ), 153 mTabContainer( NULL ),
154 mForceClose( FALSE ),
155 mIgnoreTransition( FALSE ), 154 mIgnoreTransition( FALSE ),
155 mForceClose( FALSE ),
156 mInitialTab(initial_tab_selected), 156 mInitialTab(initial_tab_selected),
157 mAllowEdit( TRUE ), 157 mAllowEdit( TRUE ),
158 mShowingNotifyDialog( FALSE ) 158 mShowingNotifyDialog( FALSE )
diff --git a/linden/indra/newview/llpanelgroupgeneral.cpp b/linden/indra/newview/llpanelgroupgeneral.cpp
index 871bc4b..e99f341 100644
--- a/linden/indra/newview/llpanelgroupgeneral.cpp
+++ b/linden/indra/newview/llpanelgroupgeneral.cpp
@@ -452,7 +452,7 @@ bool LLPanelGroupGeneral::apply(LLString& mesg)
452 if (!gdatap) 452 if (!gdatap)
453 { 453 {
454 mesg = "No group data found for group "; 454 mesg = "No group data found for group ";
455 mesg.append(mGroupID.getString()); 455 mesg.append(mGroupID.asString());
456 return false; 456 return false;
457 } 457 }
458 458
@@ -638,7 +638,7 @@ void LLPanelGroupGeneral::update(LLGroupChange gc)
638 } 638 }
639 if ( mBtnJoinGroup ) 639 if ( mBtnJoinGroup )
640 { 640 {
641 char fee_buff[20]; 641 char fee_buff[20]; /*Flawfinder: ignore*/
642 bool visible; 642 bool visible;
643 643
644 visible = !is_member && gdatap->mOpenEnrollment; 644 visible = !is_member && gdatap->mOpenEnrollment;
@@ -646,7 +646,7 @@ void LLPanelGroupGeneral::update(LLGroupChange gc)
646 646
647 if ( visible ) 647 if ( visible )
648 { 648 {
649 sprintf(fee_buff, "Join (L$%d)", gdatap->mMembershipFee); 649 snprintf(fee_buff, sizeof(fee_buff), "Join (L$%d)", gdatap->mMembershipFee); /*Flawfinder: ignore*/
650 mBtnJoinGroup->setLabelSelected(std::string(fee_buff)); 650 mBtnJoinGroup->setLabelSelected(std::string(fee_buff));
651 mBtnJoinGroup->setLabelUnselected(std::string(fee_buff)); 651 mBtnJoinGroup->setLabelUnselected(std::string(fee_buff));
652 } 652 }
diff --git a/linden/indra/newview/llpanelgrouplandmoney.cpp b/linden/indra/newview/llpanelgrouplandmoney.cpp
index e7dcb9f..21f4d4b 100644
--- a/linden/indra/newview/llpanelgrouplandmoney.cpp
+++ b/linden/indra/newview/llpanelgrouplandmoney.cpp
@@ -226,9 +226,9 @@ int LLPanelGroupLandMoney::impl::getStoredContribution()
226// Fills in the text field with the contribution, contrib 226// Fills in the text field with the contribution, contrib
227void LLPanelGroupLandMoney::impl::setYourContributionTextField(int contrib) 227void LLPanelGroupLandMoney::impl::setYourContributionTextField(int contrib)
228{ 228{
229 char buffer[MAX_STRING]; 229 char buffer[MAX_STRING]; /* Flawfinder: ignore*/
230 buffer[0] = '\0'; 230 buffer[0] = '\0';
231 sprintf(buffer, "%d", contrib); 231 snprintf(buffer, sizeof(buffer), "%d", contrib); /* Flawfinder: ignore*/
232 232
233 if ( mYourContributionEditorp ) 233 if ( mYourContributionEditorp )
234 { 234 {
@@ -239,10 +239,10 @@ void LLPanelGroupLandMoney::impl::setYourContributionTextField(int contrib)
239 239
240void LLPanelGroupLandMoney::impl::setYourMaxContributionTextBox(int max) 240void LLPanelGroupLandMoney::impl::setYourMaxContributionTextBox(int max)
241{ 241{
242 char buffer[MAX_STRING]; 242 char buffer[MAX_STRING]; /*Flawfinder: ignore*/
243 buffer[0] = '\0'; 243 buffer[0] = '\0';
244 244
245 sprintf(buffer, "(%d max)", max); 245 snprintf(buffer, sizeof(buffer), "(%d max)", max); /*Flawfinder: ignore*/
246 if ( mYourContributionMaxTextp ) 246 if ( mYourContributionMaxTextp )
247 { 247 {
248 mYourContributionMaxTextp->setText(buffer); 248 mYourContributionMaxTextp->setText(buffer);
@@ -307,15 +307,15 @@ void LLPanelGroupLandMoney::impl::processGroupLand(LLMessageSystem* msg)
307 ++first_block; 307 ++first_block;
308 S32 total_contribution; 308 S32 total_contribution;
309 msg->getS32("QueryData", "ActualArea", total_contribution, 0); 309 msg->getS32("QueryData", "ActualArea", total_contribution, 0);
310 char buffer[MAX_STRING]; 310 char buffer[MAX_STRING]; /*Flawfinder: ignore*/
311 sprintf(buffer, "%d sq. meters", total_contribution); 311 snprintf(buffer, sizeof(buffer), "%d sq. meters", total_contribution); /*Flawfinder: ignore*/
312 mTotalContributedLandp->setText(buffer); 312 mTotalContributedLandp->setText(buffer);
313 S32 committed; 313 S32 committed;
314 msg->getS32("QueryData", "BillableArea", committed, 0); 314 msg->getS32("QueryData", "BillableArea", committed, 0);
315 sprintf(buffer, "%d sq. meters", committed); 315 snprintf(buffer, sizeof(buffer), "%d sq. meters", committed); /*Flawfinder: ignore*/
316 mTotalLandInUsep->setText(buffer); 316 mTotalLandInUsep->setText(buffer);
317 S32 available = total_contribution - committed; 317 S32 available = total_contribution - committed;
318 sprintf(buffer, "%d sq. meters", available); 318 snprintf(buffer, sizeof(buffer), "%d sq. meters", available); /*Flawfinder: ignore*/
319 mLandAvailablep->setText(buffer); 319 mLandAvailablep->setText(buffer);
320 buffer[0] = '\0'; 320 buffer[0] = '\0';
321 if ( mGroupOverLimitTextp && mGroupOverLimitIconp ) 321 if ( mGroupOverLimitTextp && mGroupOverLimitIconp )
@@ -336,14 +336,14 @@ void LLPanelGroupLandMoney::impl::processGroupLand(LLMessageSystem* msg)
336 mMapButtonp->setEnabled(TRUE); 336 mMapButtonp->setEnabled(TRUE);
337 } 337 }
338 338
339 char name[MAX_STRING]; 339 char name[MAX_STRING]; /*Flawfinder: ignore*/
340 char desc[MAX_STRING]; 340 char desc[MAX_STRING]; /*Flawfinder: ignore*/
341 S32 actual_area; 341 S32 actual_area;
342 S32 billable_area; 342 S32 billable_area;
343 U8 flags; 343 U8 flags;
344 F32 global_x; 344 F32 global_x;
345 F32 global_y; 345 F32 global_y;
346 char sim_name[MAX_STRING]; 346 char sim_name[MAX_STRING]; /*Flawfinder: ignore*/
347 for(S32 i = first_block; i < count; ++i) 347 for(S32 i = first_block; i < count; ++i)
348 { 348 {
349 msg->getUUID("QueryData", "OwnerID", owner_id, i); 349 msg->getUUID("QueryData", "OwnerID", owner_id, i);
@@ -358,19 +358,19 @@ void LLPanelGroupLandMoney::impl::processGroupLand(LLMessageSystem* msg)
358 358
359 S32 region_x = llround(global_x) % REGION_WIDTH_UNITS; 359 S32 region_x = llround(global_x) % REGION_WIDTH_UNITS;
360 S32 region_y = llround(global_y) % REGION_WIDTH_UNITS; 360 S32 region_y = llround(global_y) % REGION_WIDTH_UNITS;
361 char location[MAX_STRING]; 361 char location[MAX_STRING]; /*Flawfinder: ignore*/
362 sprintf(location, "%s (%d, %d)", sim_name, region_x, region_y); 362 snprintf(location, MAX_STRING, "%s (%d, %d)", sim_name, region_x, region_y); /*Flawfinder: ignore*/
363 char area[MAX_STRING]; 363 char area[MAX_STRING]; /*Flawfinder: ignore*/
364 if(billable_area == actual_area) 364 if(billable_area == actual_area)
365 { 365 {
366 sprintf(area, "%d", billable_area); 366 snprintf(area, MAX_STRING, "%d", billable_area); /*Flawfinder: ignore*/
367 } 367 }
368 else 368 else
369 { 369 {
370 sprintf(area, "%d / %d", billable_area, actual_area); 370 snprintf(area, MAX_STRING, "%d / %d", billable_area, actual_area); /*Flawfinder: ignore*/
371 } 371 }
372 char hidden[MAX_STRING]; 372 char hidden[MAX_STRING]; /*Flawfinder: ignore*/
373 sprintf(hidden, "%f %f", global_x, global_y); 373 snprintf(hidden, MAX_STRING, "%f %f", global_x, global_y); /*Flawfinder: ignore*/
374 374
375 LLSD row; 375 LLSD row;
376 376
@@ -977,10 +977,10 @@ void LLGroupMoneyDetailsTabEventHandler::processReply(LLMessageSystem* msg,
977 return; 977 return;
978 } 978 }
979 979
980 char line[MAX_STRING]; 980 char line[MAX_STRING]; /*Flawfinder: ignore*/
981 LLString text; 981 LLString text;
982 982
983 char start_date[MAX_STRING]; 983 char start_date[MAX_STRING]; /*Flawfinder: ignore*/
984 S32 interval_days; 984 S32 interval_days;
985 S32 current_interval; 985 S32 current_interval;
986 986
@@ -996,7 +996,7 @@ void LLGroupMoneyDetailsTabEventHandler::processReply(LLMessageSystem* msg,
996 return; 996 return;
997 } 997 }
998 998
999 sprintf(line, "%s\n\n", start_date); 999 snprintf(line, MAX_STRING, "%s\n\n", start_date); /*Flawfinder: ignore*/
1000 text.append(line); 1000 text.append(line);
1001 1001
1002 S32 total_amount = 0; 1002 S32 total_amount = 0;
@@ -1004,14 +1004,14 @@ void LLGroupMoneyDetailsTabEventHandler::processReply(LLMessageSystem* msg,
1004 for(S32 i = 0; i < transactions; i++) 1004 for(S32 i = 0; i < transactions; i++)
1005 { 1005 {
1006 S32 amount = 0; 1006 S32 amount = 0;
1007 char desc[MAX_STRING]; 1007 char desc[MAX_STRING]; /*Flawfinder: ignore*/
1008 1008
1009 msg->getStringFast(_PREHASH_HistoryData, _PREHASH_Description, MAX_STRING, desc, i ); 1009 msg->getStringFast(_PREHASH_HistoryData, _PREHASH_Description, MAX_STRING, desc, i );
1010 msg->getS32Fast(_PREHASH_HistoryData, _PREHASH_Amount, amount, i); 1010 msg->getS32Fast(_PREHASH_HistoryData, _PREHASH_Amount, amount, i);
1011 1011
1012 if (amount != 0) 1012 if (amount != 0)
1013 { 1013 {
1014 sprintf(line, "%-24s %6d\n", desc, amount ); 1014 snprintf(line, MAX_STRING, "%-24s %6d\n", desc, amount ); /*Flawfinder: ignore*/
1015 text.append(line); 1015 text.append(line);
1016 } 1016 }
1017 else 1017 else
@@ -1024,7 +1024,7 @@ void LLGroupMoneyDetailsTabEventHandler::processReply(LLMessageSystem* msg,
1024 1024
1025 text.append(1, '\n'); 1025 text.append(1, '\n');
1026 1026
1027 sprintf(line, "%-24s %6d\n", "Total", total_amount ); 1027 snprintf(line, MAX_STRING, "%-24s %6d\n", "Total", total_amount ); /*Flawfinder: ignore*/
1028 text.append(line); 1028 text.append(line);
1029 1029
1030 if ( mImplementationp->mTextEditorp ) 1030 if ( mImplementationp->mTextEditorp )
@@ -1116,10 +1116,10 @@ void LLGroupMoneySalesTabEventHandler::processReply(LLMessageSystem* msg,
1116 return; 1116 return;
1117 } 1117 }
1118 1118
1119 char line[MAX_STRING]; 1119 char line[MAX_STRING]; /*Flawfinder: ignore*/
1120 std::string text = mImplementationp->mTextEditorp->getText(); 1120 std::string text = mImplementationp->mTextEditorp->getText();
1121 1121
1122 char start_date[MAX_STRING]; 1122 char start_date[MAX_STRING]; /*Flawfinder: ignore*/
1123 S32 interval_days; 1123 S32 interval_days;
1124 S32 current_interval; 1124 S32 current_interval;
1125 1125
@@ -1141,7 +1141,7 @@ void LLGroupMoneySalesTabEventHandler::processReply(LLMessageSystem* msg,
1141 { 1141 {
1142 text.clear(); 1142 text.clear();
1143 1143
1144 sprintf(line, "%s\n\n", start_date); 1144 snprintf(line, MAX_STRING, "%s\n\n", start_date); /*Flawfinder: ignore*/
1145 text.append(line); 1145 text.append(line);
1146 } 1146 }
1147 1147
@@ -1155,11 +1155,11 @@ void LLGroupMoneySalesTabEventHandler::processReply(LLMessageSystem* msg,
1155 for(S32 i = 0; i < transactions; i++) 1155 for(S32 i = 0; i < transactions; i++)
1156 { 1156 {
1157 const S32 SHORT_STRING = 64; 1157 const S32 SHORT_STRING = 64;
1158 char time[SHORT_STRING]; 1158 char time[SHORT_STRING]; /*Flawfinder: ignore*/
1159 S32 type = 0; 1159 S32 type = 0;
1160 S32 amount = 0; 1160 S32 amount = 0;
1161 char user[SHORT_STRING]; 1161 char user[SHORT_STRING]; /*Flawfinder: ignore*/
1162 char item[SHORT_STRING]; 1162 char item[SHORT_STRING]; /*Flawfinder: ignore*/
1163 1163
1164 msg->getStringFast(_PREHASH_HistoryData, _PREHASH_Time, SHORT_STRING, time, i); 1164 msg->getStringFast(_PREHASH_HistoryData, _PREHASH_Time, SHORT_STRING, time, i);
1165 msg->getStringFast(_PREHASH_HistoryData, _PREHASH_User, SHORT_STRING, user, i ); 1165 msg->getStringFast(_PREHASH_HistoryData, _PREHASH_User, SHORT_STRING, user, i );
@@ -1196,7 +1196,7 @@ void LLGroupMoneySalesTabEventHandler::processReply(LLMessageSystem* msg,
1196 break; 1196 break;
1197 } 1197 }
1198 1198
1199 sprintf(line, "%s %6d - %s %s %s\n", time, amount, user, verb, item); 1199 snprintf(line, sizeof(line), "%s %6d - %s %s %s\n", time, amount, user, verb, item); /*Flawfinder: ignore*/
1200 text.append(line); 1200 text.append(line);
1201 } 1201 }
1202 } 1202 }
@@ -1292,12 +1292,12 @@ void LLGroupMoneyPlanningTabEventHandler::processReply(LLMessageSystem* msg,
1292 return; 1292 return;
1293 } 1293 }
1294 1294
1295 char line[MAX_STRING]; 1295 char line[MAX_STRING]; /*Flawfinder: ignore*/
1296 LLString text; 1296 LLString text;
1297 1297
1298 char start_date[MAX_STRING]; 1298 char start_date[MAX_STRING]; /*Flawfinder: ignore*/
1299 char last_stipend_date[MAX_STRING]; 1299 char last_stipend_date[MAX_STRING]; /*Flawfinder: ignore*/
1300 char next_stipend_date[MAX_STRING]; 1300 char next_stipend_date[MAX_STRING]; /*Flawfinder: ignore*/
1301 S32 interval_days; 1301 S32 interval_days;
1302 S32 current_interval; 1302 S32 current_interval;
1303 S32 balance; 1303 S32 balance;
@@ -1349,26 +1349,26 @@ void LLGroupMoneyPlanningTabEventHandler::processReply(LLMessageSystem* msg,
1349 return; 1349 return;
1350 } 1350 }
1351 1351
1352 sprintf(line, "Summary for this week, beginning on %s\n", start_date); 1352 snprintf(line, MAX_STRING, "Summary for this week, beginning on %s\n", start_date); /*Flawfinder: ignore*/
1353 text.append(line); 1353 text.append(line);
1354 1354
1355 if (current_interval == 0) 1355 if (current_interval == 0)
1356 { 1356 {
1357 sprintf(line, "The next stipend day is %s\n\n", next_stipend_date); 1357 snprintf(line, MAX_STRING, "The next stipend day is %s\n\n", next_stipend_date); /*Flawfinder: ignore*/
1358 text.append(line); 1358 text.append(line);
1359 sprintf(line, "%-24sL$%6d\n", "Balance", balance ); 1359 snprintf(line, MAX_STRING, "%-24sL$%6d\n", "Balance", balance ); /*Flawfinder: ignore*/
1360 text.append(line); 1360 text.append(line);
1361 1361
1362 text.append(1, '\n'); 1362 text.append(1, '\n');
1363 } 1363 }
1364 1364
1365 sprintf(line, " Group Individual Share\n"); 1365 snprintf(line, MAX_STRING, " Group Individual Share\n"); /*Flawfinder: ignore*/
1366 text.append(line); 1366 text.append(line);
1367 sprintf(line, "%-24s %6d %6d \n", "Credits", total_credits, (S32)floor((F32)total_credits/(F32)non_exempt_members)); 1367 snprintf(line, MAX_STRING, "%-24s %6d %6d \n", "Credits", total_credits, (S32)floor((F32)total_credits/(F32)non_exempt_members)); /*Flawfinder: ignore*/
1368 text.append(line); 1368 text.append(line);
1369 sprintf(line, "%-24s %6d %6d \n", "Debits", total_debits, (S32)floor((F32)total_debits/(F32)non_exempt_members)); 1369 snprintf(line, MAX_STRING, "%-24s %6d %6d \n", "Debits", total_debits, (S32)floor((F32)total_debits/(F32)non_exempt_members)); /*Flawfinder: ignore*/
1370 text.append(line); 1370 text.append(line);
1371 sprintf(line, "%-24s %6d %6d \n", "Total", total_credits + total_debits, (S32)floor((F32)(total_credits + total_debits)/(F32)non_exempt_members)); 1371 snprintf(line, MAX_STRING, "%-24s %6d %6d \n", "Total", total_credits + total_debits, (S32)floor((F32)(total_credits + total_debits)/(F32)non_exempt_members)); /*Flawfinder: ignore*/
1372 text.append(line); 1372 text.append(line);
1373 1373
1374 if ( mImplementationp->mTextEditorp ) 1374 if ( mImplementationp->mTextEditorp )
diff --git a/linden/indra/newview/llpanelgroupnotices.cpp b/linden/indra/newview/llpanelgroupnotices.cpp
index b8b2f2c..2a7cdf5 100644
--- a/linden/indra/newview/llpanelgroupnotices.cpp
+++ b/linden/indra/newview/llpanelgroupnotices.cpp
@@ -50,6 +50,8 @@
50#include "llviewerwindow.h" 50#include "llviewerwindow.h"
51#include "llviewermessage.h" 51#include "llviewermessage.h"
52 52
53const S32 NOTICE_DATE_STRING_SIZE = 30;
54
53///////////////////////// 55/////////////////////////
54// LLPanelGroupNotices // 56// LLPanelGroupNotices //
55///////////////////////// 57/////////////////////////
@@ -181,8 +183,7 @@ char* build_notice_date(const time_t& the_time, char* buffer)
181 tm* lt = localtime(&t); 183 tm* lt = localtime(&t);
182 //for some reason, the month is off by 1. See other uses of 184 //for some reason, the month is off by 1. See other uses of
183 //"local" time in the code... 185 //"local" time in the code...
184 sprintf(buffer,"%i/%i/%i", lt->tm_mon + 1, lt->tm_mday, lt->tm_year + 1900); 186 snprintf(buffer, NOTICE_DATE_STRING_SIZE, "%i/%i/%i", lt->tm_mon + 1, lt->tm_mday, lt->tm_year + 1900); /*Flawfinder: ignore*/
185
186 return buffer; 187 return buffer;
187} 188}
188 189
@@ -447,8 +448,8 @@ void LLPanelGroupNotices::processGroupNoticesListReply(LLMessageSystem* msg, voi
447void LLPanelGroupNotices::processNotices(LLMessageSystem* msg) 448void LLPanelGroupNotices::processNotices(LLMessageSystem* msg)
448{ 449{
449 LLUUID id; 450 LLUUID id;
450 char subj[MAX_STRING]; 451 char subj[MAX_STRING]; /*Flawfinder: ignore*/
451 char name[MAX_STRING]; 452 char name[MAX_STRING]; /*Flawfinder: ignore*/
452 U32 timestamp; 453 U32 timestamp;
453 BOOL has_attachment; 454 BOOL has_attachment;
454 U8 asset_type; 455 U8 asset_type;
@@ -492,12 +493,12 @@ void LLPanelGroupNotices::processNotices(LLMessageSystem* msg)
492 row["columns"][2]["column"] = "from"; 493 row["columns"][2]["column"] = "from";
493 row["columns"][2]["value"] = name; 494 row["columns"][2]["value"] = name;
494 495
495 char buffer[30]; 496 char buffer[NOTICE_DATE_STRING_SIZE]; /*Flawfinder: ignore*/
496 build_notice_date(t, buffer); 497 build_notice_date(t, buffer);
497 row["columns"][3]["column"] = "date"; 498 row["columns"][3]["column"] = "date";
498 row["columns"][3]["value"] = buffer; 499 row["columns"][3]["value"] = buffer;
499 500
500 snprintf(buffer, 30, "%u", timestamp); 501 snprintf(buffer, 30, "%u", timestamp); /*Flawfinder: ignore*/
501 row["columns"][4]["column"] = "sort"; 502 row["columns"][4]["column"] = "sort";
502 row["columns"][4]["value"] = buffer; 503 row["columns"][4]["value"] = buffer;
503 504
@@ -522,7 +523,7 @@ void LLPanelGroupNotices::onSelectNotice(LLUICtrl* ctrl, void* data)
522 msg->addUUID("GroupNoticeID",item->getUUID()); 523 msg->addUUID("GroupNoticeID",item->getUUID());
523 gAgent.sendReliableMessage(); 524 gAgent.sendReliableMessage();
524 525
525 lldebugs << "Item " << item->getUUID().getString().c_str() << " selected." << llendl; 526 lldebugs << "Item " << item->getUUID() << " selected." << llendl;
526} 527}
527 528
528void LLPanelGroupNotices::showNotice(const char* subject, 529void LLPanelGroupNotices::showNotice(const char* subject,
diff --git a/linden/indra/newview/llpanelgrouproles.cpp b/linden/indra/newview/llpanelgrouproles.cpp
index 82f38e2..59ac556 100644
--- a/linden/indra/newview/llpanelgrouproles.cpp
+++ b/linden/indra/newview/llpanelgrouproles.cpp
@@ -185,6 +185,9 @@ BOOL LLPanelGroupRoles::postBuild()
185 185
186BOOL LLPanelGroupRoles::isVisibleByAgent(LLAgent* agentp) 186BOOL LLPanelGroupRoles::isVisibleByAgent(LLAgent* agentp)
187{ 187{
188 if (agentp->isGodlike())
189 return TRUE;
190
188 /* This power was removed to make group roles simpler 191 /* This power was removed to make group roles simpler
189 return agentp->hasPowerInGroup(mGroupID, 192 return agentp->hasPowerInGroup(mGroupID,
190 GP_ROLE_CREATE | 193 GP_ROLE_CREATE |
@@ -1117,7 +1120,10 @@ void LLPanelGroupMembersSubTab::handleMemberSelect()
1117 check->setCommitCallback(onRoleCheck); 1120 check->setCommitCallback(onRoleCheck);
1118 check->setCallbackUserData(this); 1121 check->setCallbackUserData(this);
1119 check->set( count > 0 ); 1122 check->set( count > 0 );
1120 check->setTentative(0 != count && selected_members.size() != count); 1123 check->setTentative(
1124 (0 != count)
1125 && (selected_members.size() !=
1126 (std::vector<LLUUID>::size_type)count));
1121 1127
1122 //NOTE: as of right now a user can break the group 1128 //NOTE: as of right now a user can break the group
1123 //by removing himself from a role if he is the 1129 //by removing himself from a role if he is the
@@ -1696,8 +1702,8 @@ void LLPanelGroupMembersSubTab::updateMembers()
1696 1702
1697 LLGroupMgrGroupData::member_iter end = gdatap->mMembers.end(); 1703 LLGroupMgrGroupData::member_iter end = gdatap->mMembers.end();
1698 1704
1699 char first[DB_FIRST_NAME_BUF_SIZE]; 1705 char first[DB_FIRST_NAME_BUF_SIZE]; /*Flawfinder: ignore*/
1700 char last[DB_LAST_NAME_BUF_SIZE]; 1706 char last[DB_LAST_NAME_BUF_SIZE]; /*Flawfinder: ignore*/
1701 S32 i = 0; 1707 S32 i = 0;
1702 for( ; mMemberProgress != end && i<UPDATE_MEMBERS_PER_FRAME; 1708 for( ; mMemberProgress != end && i<UPDATE_MEMBERS_PER_FRAME;
1703 ++mMemberProgress, ++i) 1709 ++mMemberProgress, ++i)
@@ -2012,7 +2018,7 @@ void LLPanelGroupRolesSubTab::update(LLGroupChange gc)
2012 2018
2013 mRolesList->sortByColumn("name", TRUE); 2019 mRolesList->sortByColumn("name", TRUE);
2014 2020
2015 if ( (gdatap->mRoles.size() < MAX_ROLES) 2021 if ( (gdatap->mRoles.size() < (U32)MAX_ROLES)
2016 && gAgent.hasPowerInGroup(mGroupID, GP_ROLE_CREATE) ) 2022 && gAgent.hasPowerInGroup(mGroupID, GP_ROLE_CREATE) )
2017 { 2023 {
2018 mCreateRoleButton->setEnabled(TRUE); 2024 mCreateRoleButton->setEnabled(TRUE);
diff --git a/linden/indra/newview/llpanelgroupvoting.cpp b/linden/indra/newview/llpanelgroupvoting.cpp
index 1be6bf0..ebe99b1 100644
--- a/linden/indra/newview/llpanelgroupvoting.cpp
+++ b/linden/indra/newview/llpanelgroupvoting.cpp
@@ -330,8 +330,8 @@ void LLPanelGroupVoting::impl::setEnableVoteProposal()
330 330
331 if (already_voted == "Yes") 331 if (already_voted == "Yes")
332 { 332 {
333 char message[MAX_STRING]; 333 char message[MAX_STRING]; /*Flawfinder: ignore*/
334 sprintf(message, "You have voted: %s ", vote_cast.c_str()); 334 snprintf(message, MAX_STRING, "You have voted: %s ", vote_cast.c_str()); /*Flawfinder: ignore*/
335 mInstructions->setText(message); 335 mInstructions->setText(message);
336 336
337 mBtnYes->setEnabled(FALSE); 337 mBtnYes->setEnabled(FALSE);
@@ -641,8 +641,8 @@ void LLPanelGroupVoting::impl::updateQuorumText()
641 if ( mQuorumText ) 641 if ( mQuorumText )
642 { 642 {
643 //update the quorum count 643 //update the quorum count
644 char quorum_text[MAX_STRING]; 644 char quorum_text[MAX_STRING]; /*Flawfinder: ignore*/
645 sprintf(quorum_text, 645 snprintf(quorum_text, MAX_STRING, /*Flawfinder: ignore*/
646 " out of %d members must vote", 646 " out of %d members must vote",
647 mNumGroupMembers); 647 mNumGroupMembers);
648 mQuorumText->setText(quorum_text); 648 mQuorumText->setText(quorum_text);
@@ -737,15 +737,15 @@ void LLPanelGroupVoting::impl::processGroupActiveProposalItemReply(LLMessageSyst
737 737
738 U32 num_expected; 738 U32 num_expected;
739 const S32 MAX_STRING_NUM_LEN = 20; 739 const S32 MAX_STRING_NUM_LEN = 20;
740 char item_num_string[DB_TERSE_DATETIME_BUF_SIZE]; 740 char item_num_string[DB_TERSE_DATETIME_BUF_SIZE]; /*Flawfinder: ignore*/
741 char proposal_text[DB_VOTE_TEXT_BUF_SIZE]; 741 char proposal_text[DB_VOTE_TEXT_BUF_SIZE]; /*Flawfinder: ignore*/
742 char vote_cast[DB_VOTE_RESULT_BUF_SIZE]; 742 char vote_cast[DB_VOTE_RESULT_BUF_SIZE]; /*Flawfinder: ignore*/
743 char start_datetime[DB_DATETIME_BUF_SIZE]; 743 char start_datetime[DB_DATETIME_BUF_SIZE]; /*Flawfinder: ignore*/
744 char end_datetime[DB_DATETIME_BUF_SIZE]; 744 char end_datetime[DB_DATETIME_BUF_SIZE]; /*Flawfinder: ignore*/
745 char vote_type[DB_VOTE_TYPE_BUF_SIZE]; 745 char vote_type[DB_VOTE_TYPE_BUF_SIZE]; /*Flawfinder: ignore*/
746 char majority_text[MAX_STRING_NUM_LEN]; 746 char majority_text[MAX_STRING_NUM_LEN]; /*Flawfinder: ignore*/
747 char quorum_text[MAX_STRING_NUM_LEN]; 747 char quorum_text[MAX_STRING_NUM_LEN]; /*Flawfinder: ignore*/
748 char vote_initiator_string[UUID_STR_LENGTH]; 748 char vote_initiator_string[UUID_STR_LENGTH]; /*Flawfinder: ignore*/
749 749
750 LLUUID vote_id; 750 LLUUID vote_id;
751 LLUUID vote_initiator; 751 LLUUID vote_initiator;
@@ -778,8 +778,8 @@ void LLPanelGroupVoting::impl::processGroupActiveProposalItemReply(LLMessageSyst
778 msg->getS32Fast(_PREHASH_ProposalData, _PREHASH_Quorum, quorum, i ); 778 msg->getS32Fast(_PREHASH_ProposalData, _PREHASH_Quorum, quorum, i );
779 779
780 vote_initiator.toString(vote_initiator_string); 780 vote_initiator.toString(vote_initiator_string);
781 sprintf(majority_text, "%f", majority); 781 snprintf(majority_text, MAX_STRING_NUM_LEN, "%f", majority); /*Flawfinder: ignore*/
782 sprintf(quorum_text, "%i", quorum); 782 snprintf(quorum_text, MAX_STRING_NUM_LEN, "%i", quorum); /*Flawfinder: ignore*/
783 783
784 LLScrollListItem *row = new LLScrollListItem( TRUE, NULL, vote_id ); 784 LLScrollListItem *row = new LLScrollListItem( TRUE, NULL, vote_id );
785 if (!row) return; 785 if (!row) return;
@@ -879,12 +879,12 @@ void LLPanelGroupVoting::impl::processGroupVoteHistoryItemReply(LLMessageSystem
879 } 879 }
880 880
881 const S32 ITEM_NUM_MAX_BUF_LEN = 15; 881 const S32 ITEM_NUM_MAX_BUF_LEN = 15;
882 char item_num_string[ITEM_NUM_MAX_BUF_LEN]; 882 char item_num_string[ITEM_NUM_MAX_BUF_LEN]; /*Flawfinder: ignore*/
883 char proposal_text[DB_VOTE_TEXT_BUF_SIZE]; 883 char proposal_text[DB_VOTE_TEXT_BUF_SIZE]; /*Flawfinder: ignore*/
884 char vote_result[MAX_STRING]; 884 char vote_result[MAX_STRING]; /*Flawfinder: ignore*/
885 char start_datetime[DB_DATETIME_BUF_SIZE]; 885 char start_datetime[DB_DATETIME_BUF_SIZE]; /*Flawfinder: ignore*/
886 char end_datetime[DB_DATETIME_BUF_SIZE]; 886 char end_datetime[DB_DATETIME_BUF_SIZE]; /*Flawfinder: ignore*/
887 char vote_type[DB_VOTE_TYPE_BUF_SIZE]; 887 char vote_type[DB_VOTE_TYPE_BUF_SIZE]; /*Flawfinder: ignore*/
888 888
889 LLString vote_text; 889 LLString vote_text;
890 LLUUID vote_id; 890 LLUUID vote_id;
@@ -927,15 +927,15 @@ void LLPanelGroupVoting::impl::processGroupVoteHistoryItemReply(LLMessageSystem
927 } 927 }
928 vote_text.append(" Votes->\n"); 928 vote_text.append(" Votes->\n");
929 929
930 char vote_result[DB_VOTE_RESULT_BUF_SIZE]; 930 char vote_result[DB_VOTE_RESULT_BUF_SIZE]; /*Flawfinder: ignore*/
931 char result_msg[MAX_STRING]; 931 char result_msg[MAX_STRING]; /*Flawfinder: ignore*/
932 S32 num_votes; 932 S32 num_votes;
933 933
934 for (S32 i = 0; i < vote_items; ++i) 934 for (S32 i = 0; i < vote_items; ++i)
935 { 935 {
936 msg->getStringFast(_PREHASH_VoteItem, _PREHASH_VoteCast, DB_VOTE_RESULT_BUF_SIZE, vote_result, i); 936 msg->getStringFast(_PREHASH_VoteItem, _PREHASH_VoteCast, DB_VOTE_RESULT_BUF_SIZE, vote_result, i);
937 msg->getS32Fast(_PREHASH_VoteItem, _PREHASH_NumVotes, num_votes, i); 937 msg->getS32Fast(_PREHASH_VoteItem, _PREHASH_NumVotes, num_votes, i);
938 sprintf(result_msg, 938 snprintf(result_msg, MAX_STRING, /*Flawfinder: ignore*/
939 " %s: %d\n", 939 " %s: %d\n",
940 vote_result, 940 vote_result,
941 num_votes); 941 num_votes);
diff --git a/linden/indra/newview/llpanelinventory.cpp b/linden/indra/newview/llpanelinventory.cpp
index bd32ad2..d9638fd 100644
--- a/linden/indra/newview/llpanelinventory.cpp
+++ b/linden/indra/newview/llpanelinventory.cpp
@@ -182,7 +182,7 @@ void LLTaskInvFVBridge::showProperties()
182 "Object Inventory Item Properties", 182 "Object Inventory Item Properties",
183 mUUID, 183 mUUID,
184 mPanel->getTaskUUID()); 184 mPanel->getTaskUUID());
185 floater->open(); 185 floater->open(); /*Flawfinder: ignore*/
186 } 186 }
187} 187}
188 188
@@ -943,7 +943,7 @@ void LLTaskSoundBridge::openSoundPreview(void* data)
943 self->getName(), 943 self->getName(),
944 self->mUUID, 944 self->mUUID,
945 self->mPanel->getTaskUUID()); 945 self->mPanel->getTaskUUID());
946 floaterp->open(); 946 floaterp->open(); /*Flawfinder: ignore*/
947 } 947 }
948} 948}
949 949
@@ -1182,7 +1182,7 @@ void LLTaskLSLBridge::openItem()
1182 mUUID); 1182 mUUID);
1183 LLMultiFloater* previous_host = LLFloater::getFloaterHost(); 1183 LLMultiFloater* previous_host = LLFloater::getFloaterHost();
1184 LLFloater::setFloaterHost(NULL); 1184 LLFloater::setFloaterHost(NULL);
1185 editor->open(); 1185 editor->open(); /*Flawfinder: ignore*/
1186 LLFloater::setFloaterHost(previous_host); 1186 LLFloater::setFloaterHost(previous_host);
1187 1187
1188 // keep onscreen 1188 // keep onscreen
@@ -1824,16 +1824,16 @@ void LLPanelInventory::refresh()
1824{ 1824{
1825 //llinfos << "LLPanelInventory::refresh()" << llendl; 1825 //llinfos << "LLPanelInventory::refresh()" << llendl;
1826 BOOL has_inventory = FALSE; 1826 BOOL has_inventory = FALSE;
1827 LLSelectNode* node = gSelectMgr->getFirstRootNode(); 1827 LLSelectNode* node = gSelectMgr->getSelection()->getFirstRootNode();
1828 if(!node) 1828 if(!node)
1829 { 1829 {
1830 node = gSelectMgr->getFirstNode(); 1830 node = gSelectMgr->getSelection()->getFirstNode();
1831 } 1831 }
1832 if(node) 1832 if(node)
1833 { 1833 {
1834 LLViewerObject* object = node->getObject(); 1834 LLViewerObject* object = node->getObject();
1835 if(object && ((gSelectMgr->getRootObjectCount() == 1) 1835 if(object && ((gSelectMgr->getSelection()->getRootObjectCount() == 1)
1836 || (gSelectMgr->getObjectCount() == 1))) 1836 || (gSelectMgr->getSelection()->getObjectCount() == 1)))
1837 { 1837 {
1838 // determine if we need to make a request. Start with a 1838 // determine if we need to make a request. Start with a
1839 // default based on if we have inventory at all. 1839 // default based on if we have inventory at all.
diff --git a/linden/indra/newview/llpanelland.cpp b/linden/indra/newview/llpanelland.cpp
index 38eac5d..1b3e146 100644
--- a/linden/indra/newview/llpanelland.cpp
+++ b/linden/indra/newview/llpanelland.cpp
@@ -109,7 +109,7 @@ void LLPanelLandInfo::refreshAll()
109// public 109// public
110void LLPanelLandInfo::refresh() 110void LLPanelLandInfo::refresh()
111{ 111{
112 LLParcel *parcel = gParcelMgr->getSelectedParcel(); 112 LLParcel *parcel = gParcelMgr->getParcelSelection()->getParcel();
113 LLViewerRegion *regionp = gParcelMgr->getSelectionRegion(); 113 LLViewerRegion *regionp = gParcelMgr->getSelectionRegion();
114 114
115 if (!parcel || !regionp) 115 if (!parcel || !regionp)
@@ -177,7 +177,7 @@ void LLPanelLandInfo::refresh()
177 // and it must not be a whole parcel. 177 // and it must not be a whole parcel.
178 if (gParcelMgr->getSelectedArea() > PARCEL_UNIT_AREA 178 if (gParcelMgr->getSelectedArea() > PARCEL_UNIT_AREA
179 //&& gParcelMgr->getSelfCount() > 1 179 //&& gParcelMgr->getSelfCount() > 1
180 && !gParcelMgr->getWholeParcelSelected()) 180 && !gParcelMgr->getParcelSelection()->getWholeParcelSelected())
181 { 181 {
182 childSetEnabled("button join land",TRUE); 182 childSetEnabled("button join land",TRUE);
183 } 183 }
@@ -200,7 +200,7 @@ void LLPanelLandInfo::refresh()
200 &rent_price, 200 &rent_price,
201 &for_sale, 201 &for_sale,
202 &dwell); 202 &dwell);
203 if(is_public || (is_for_sale && gParcelMgr->getWholeParcelSelected())) 203 if(is_public || (is_for_sale && gParcelMgr->getParcelSelection()->getWholeParcelSelected()))
204 { 204 {
205 childSetTextArg("label_area_price","[PRICE]", llformat("%d",claim_price)); 205 childSetTextArg("label_area_price","[PRICE]", llformat("%d",claim_price));
206 childSetTextArg("label_area_price","[AREA]", llformat("%d",area)); 206 childSetTextArg("label_area_price","[AREA]", llformat("%d",area));
@@ -246,7 +246,7 @@ void LLPanelLandInfo::onClickJoin(void*)
246void LLPanelLandInfo::onClickAbout(void*) 246void LLPanelLandInfo::onClickAbout(void*)
247{ 247{
248 // Promote the rectangle selection to a parcel selection 248 // Promote the rectangle selection to a parcel selection
249 if (!gParcelMgr->getWholeParcelSelected()) 249 if (!gParcelMgr->getParcelSelection()->getWholeParcelSelected())
250 { 250 {
251 gParcelMgr->selectParcelInRectangle(); 251 gParcelMgr->selectParcelInRectangle();
252 } 252 }
diff --git a/linden/indra/newview/llpanellogin.cpp b/linden/indra/newview/llpanellogin.cpp
index 3d3aee9..6a0bdb4 100644
--- a/linden/indra/newview/llpanellogin.cpp
+++ b/linden/indra/newview/llpanellogin.cpp
@@ -518,14 +518,15 @@ void LLPanelLogin::setFields(const std::string& firstname, const std::string& la
518 // nice row of asterixes. 518 // nice row of asterixes.
519 const char* filler = "123456789!123456"; 519 const char* filler = "123456789!123456";
520 sInstance->childSetText("password_edit", filler); 520 sInstance->childSetText("password_edit", filler);
521 strcpy(sInstance->mIncomingPassword, filler); 521 strcpy(sInstance->mIncomingPassword, filler); /*Flawfinder: ignore*/
522 strcpy(sInstance->mMungedPassword, password.c_str()); 522 strcpy(sInstance->mMungedPassword, password.c_str()); /*Flawfinder: ignore*/
523 } 523 }
524 else 524 else
525 { 525 {
526 // this is a normal text password 526 // this is a normal text password
527 sInstance->childSetText("password_edit", password); 527 sInstance->childSetText("password_edit", password);
528 strcpy(sInstance->mIncomingPassword, password.c_str()); 528 strncpy(sInstance->mIncomingPassword, password.c_str(), sizeof(sInstance->mIncomingPassword) -1); /*Flawfinder: ignore*/
529 sInstance->mIncomingPassword[sizeof(sInstance->mIncomingPassword) -1] = '\0';
529 LLMD5 pass((unsigned char *)password.c_str()); 530 LLMD5 pass((unsigned char *)password.c_str());
530 pass.hex_digest(sInstance->mMungedPassword); 531 pass.hex_digest(sInstance->mMungedPassword);
531 } 532 }
diff --git a/linden/indra/newview/llpanellogin.h b/linden/indra/newview/llpanellogin.h
index 6e11f6f..6bd825a 100644
--- a/linden/indra/newview/llpanellogin.h
+++ b/linden/indra/newview/llpanellogin.h
@@ -91,8 +91,8 @@ private:
91 void (*mCallback)(S32 option, void *userdata); 91 void (*mCallback)(S32 option, void *userdata);
92 void* mCallbackData; 92 void* mCallbackData;
93 93
94 char mIncomingPassword[DB_USER_PASSWORD_BUF_SIZE]; 94 char mIncomingPassword[DB_USER_PASSWORD_BUF_SIZE]; /*Flawfinder: ignore*/
95 char mMungedPassword[MD5HEX_STR_SIZE]; 95 char mMungedPassword[MD5HEX_STR_SIZE]; /*Flawfinder: ignore*/
96 96
97 static LLPanelLogin* sInstance; 97 static LLPanelLogin* sInstance;
98 static BOOL sCapslockDidNotification; 98 static BOOL sCapslockDidNotification;
diff --git a/linden/indra/newview/llpanelmoney.cpp b/linden/indra/newview/llpanelmoney.cpp
deleted file mode 100644
index 1dcd544..0000000
--- a/linden/indra/newview/llpanelmoney.cpp
+++ /dev/null
@@ -1,483 +0,0 @@
1/**
2 * @file llpanelmoney.cpp
3 * @author James Cook
4 * @brief Panels for Account History floater
5 *
6 * Copyright (c) 2003-2007, Linden Research, Inc.
7 *
8 * The source code in this file ("Source Code") is provided by Linden Lab
9 * to you under the terms of the GNU General Public License, version 2.0
10 * ("GPL"), unless you have obtained a separate licensing agreement
11 * ("Other License"), formally executed by you and Linden Lab. Terms of
12 * the GPL can be found in doc/GPL-license.txt in this distribution, or
13 * online at http://secondlife.com/developers/opensource/gplv2
14 *
15 * There are special exceptions to the terms and conditions of the GPL as
16 * it is applied to this Source Code. View the full text of the exception
17 * in the file doc/FLOSS-exception.txt in this software distribution, or
18 * online at http://secondlife.com/developers/opensource/flossexception
19 *
20 * By copying, modifying or distributing this software, you acknowledge
21 * that you have read and understood your obligations described above,
22 * and agree to abide by those obligations.
23 *
24 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
25 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
26 * COMPLETENESS OR PERFORMANCE.
27 */
28
29#include "llviewerprecompiledheaders.h"
30
31#include "llpanelmoney.h"
32
33#include "llfontgl.h"
34#include "message.h"
35#include "lltransactiontypes.h"
36
37#include "llpanel.h"
38#include "llbutton.h"
39#include "llviewercontrol.h"
40#include "llstatusbar.h"
41#include "lluiconstants.h"
42#include "llvieweruictrlfactory.h"
43#include "viewer.h"
44
45// XUI:translate
46const char LOADING_STRING[] = "Computing...";
47
48S32 LLPanelAccount::sCurrentInterval = 0;
49
50//---------------------------------------------------------------------------
51// LLPanelAccount - the base class for all account panels
52//---------------------------------------------------------------------------
53
54// Construct with a dummy rectangle because tab containers will
55// resize their panels. Thus, merely need to make sure the follow
56// flags are correctly set.
57LLPanelAccount::LLPanelAccount(const LLUUID& request_id, S32 interval_days, S32 max_interval, const std::string& filename)
58: LLPanel("account_panel"),
59 mRequestID( request_id ),
60 mDataRequested( FALSE ),
61 mIntervalDays( interval_days ),
62 mMaxInterval( max_interval )
63{
64 sCurrentInterval = 0;
65
66 gUICtrlFactory->buildPanel(this, filename);
67
68 childSetText("editor", LOADING_STRING);
69
70 childSetAction("earlier_btn", onClickEarlier, this);
71 childSetAction("later_btn", onClickLater, this);
72}
73
74
75// public virtual
76void LLPanelAccount::draw()
77{
78 if (!mDataRequested || (mDisplayedInterval != sCurrentInterval) )
79 {
80 sendRequest();
81 refreshPanel();
82 mDisplayedInterval = sCurrentInterval;
83 mDataRequested = TRUE;
84 }
85
86 LLPanel::draw();
87}
88
89void LLPanelAccount::refreshPanel()
90{
91 // Used by some panels that have buttons and some that don't (so no warnings)
92 if (hasChild("earlier_btn"))
93 {
94 childSetEnabled("earlier_btn", sCurrentInterval < mMaxInterval);
95 }
96 if (hasChild("later_btn"))
97 {
98 childSetEnabled("later_btn", sCurrentInterval > 0);
99 }
100}
101
102// static
103void LLPanelAccount::onClickEarlier(void *userdata)
104{
105 LLPanelAccount* self = (LLPanelAccount*)userdata;
106 if (!self) return;
107
108 if (self->sCurrentInterval < self->mMaxInterval)
109 {
110 self->childSetText("editor", LOADING_STRING);
111 self->sCurrentInterval++;
112 self->refreshPanel();
113 self->setDataRequested(FALSE);
114 }
115}
116
117// static
118void LLPanelAccount::onClickLater(void *userdata)
119{
120 LLPanelAccount* self = (LLPanelAccount*)userdata;
121 if (!self) return;
122
123 if (self->sCurrentInterval > 0)
124 {
125 self->childSetText("editor", LOADING_STRING);
126 self->sCurrentInterval--;
127 self->refreshPanel();
128 self->setDataRequested(FALSE);
129 }
130}
131
132
133//---------------------------------------------------------------------------
134// LLPanelAccountPlanning - the first, default view of money
135//---------------------------------------------------------------------------
136LLPanelAccountPlanning::LLPanelAccountPlanning(const LLUUID& request_id)
137: LLPanelAccount(request_id, SUMMARY_INTERVAL, SUMMARY_MAX, "panel_account_planning.xml")
138{
139 childSetText("editor", LOADING_STRING);
140}
141
142// virtual
143void LLPanelAccountPlanning::sendRequest()
144{
145 LLMessageSystem* msg = gMessageSystem;
146
147 msg->newMessageFast(_PREHASH_MoneySummaryRequest);
148 msg->nextBlockFast(_PREHASH_AgentData);
149 msg->addUUIDFast(_PREHASH_AgentID, agent_get_id() );
150 msg->addUUIDFast(_PREHASH_SessionID, agent_get_session_id() );
151 msg->nextBlockFast(_PREHASH_MoneyData);
152 msg->addUUIDFast(_PREHASH_RequestID, mRequestID );
153 msg->addS32Fast(_PREHASH_IntervalDays, mIntervalDays );
154 msg->addS32Fast(_PREHASH_CurrentInterval, 0 );
155
156 agent_send_reliable_message();
157
158 childSetText("editor", LOADING_STRING);
159}
160
161// virtual
162void LLPanelAccountPlanning::processReply(LLMessageSystem* msg, void** data)
163{
164 char line[MAX_STRING];
165 LLString text;
166
167 char start_date[MAX_STRING];
168 char last_stipend_date[MAX_STRING];
169 char next_stipend_date[MAX_STRING];
170 S32 interval_days;
171 S32 current_interval;
172 S32 balance;
173 S32 total_credits;
174 S32 total_debits;
175 S32 cur_object_tax;
176 S32 cur_light_tax;
177 S32 cur_land_tax;
178 S32 cur_group_tax;
179 S32 cur_parcel_dir_fee;
180 S32 cur_total_tax;
181 S32 proj_object_tax;
182 S32 proj_light_tax;
183 S32 proj_land_tax;
184 S32 proj_group_tax;
185 S32 proj_parcel_dir_fee;
186 S32 proj_total_tax;
187 S32 stipend;
188
189 msg->getS32("MoneyData", "IntervalDays", interval_days );
190 msg->getS32("MoneyData", "CurrentInterval", current_interval );
191 msg->getS32("MoneyData", "Balance", balance );
192 msg->getS32("MoneyData", "TotalCredits", total_credits );
193 msg->getS32("MoneyData", "TotalDebits", total_debits );
194 msg->getS32("MoneyData", "ObjectTaxCurrent", cur_object_tax );
195 msg->getS32("MoneyData", "LightTaxCurrent", cur_light_tax );
196 msg->getS32("MoneyData", "LandTaxCurrent", cur_land_tax );
197 msg->getS32("MoneyData", "GroupTaxCurrent", cur_group_tax );
198 msg->getS32("MoneyData", "ParcelDirFeeCurrent", cur_parcel_dir_fee );
199 msg->getS32("MoneyData", "ObjectTaxEstimate", proj_object_tax );
200 msg->getS32("MoneyData", "LightTaxEstimate", proj_light_tax );
201 msg->getS32("MoneyData", "LandTaxEstimate", proj_land_tax );
202 msg->getS32("MoneyData", "GroupTaxEstimate", proj_group_tax );
203 msg->getS32("MoneyData", "ParcelDirFeeEstimate", proj_parcel_dir_fee );
204 msg->getS32("MoneyData", "StipendEstimate", stipend );
205
206 msg->getString("MoneyData", "StartDate", MAX_STRING, start_date);
207 msg->getString("MoneyData", "LastTaxDate", MAX_STRING, last_stipend_date);
208 msg->getString("MoneyData", "TaxDate", MAX_STRING, next_stipend_date);
209
210 cur_total_tax = cur_object_tax + cur_light_tax + cur_land_tax + cur_group_tax + cur_parcel_dir_fee;
211 proj_total_tax = proj_object_tax + proj_light_tax + proj_land_tax + proj_group_tax + proj_parcel_dir_fee;
212
213 if (interval_days != mIntervalDays || current_interval != sCurrentInterval)
214 {
215 llinfos << "Out of date summary packet " << interval_days << " "
216 << current_interval << llendl;
217 return;
218 }
219
220 // *NOTE: actually use the balance from the status bar, so the two
221 // match. This should not be necessary because the simulator no
222 // longer buffers transaction. If status bar balance is zero,
223 // assume this is because we haven't received the first balance
224 // yet, and trust the database.
225 if (0 != gStatusBar->getBalance())
226 {
227 balance = gStatusBar->getBalance();
228 }
229
230 sprintf(line, "Summary for this week, beginning on %s\n", start_date);
231 text.append(line);
232
233 if (current_interval == 0)
234 {
235 text.append(1, '\n');
236
237 sprintf(line, "Your next stipend day is %s\n\n", next_stipend_date);
238 text.append(line);
239 sprintf(line, "%-24sL$%6d\n", "Balance", balance );
240 text.append(line);
241
242 text.append(1, '\n');
243 }
244
245 sprintf(line, "%-24s %6d\n", "Credits", total_credits);
246 text.append(line);
247
248 sprintf(line, "%-24s %6d\n", "Debits", total_debits);
249 text.append(line);
250
251 sprintf(line, "%-24s %6d\n", "Total Change", total_credits + total_debits);
252 text.append(line);
253
254 if (current_interval == 0)
255 {
256 text.append(1, '\n');
257
258 text.append(1, '\n');
259
260 sprintf(line, "%-24s %6d\n", "Estimated Stipend", stipend );
261 text.append(line);
262
263 // Generate projected "wealth tax" based on current balance, projected stipend/bonus
264 }
265 else
266 {
267 text.append(1, '\n');
268 text.append(1, '\n');
269
270 sprintf(line, "%-24s %6d\n", "Parcel Directory Fee", cur_parcel_dir_fee);
271 text.append(line);
272 }
273
274 childSetText("editor", text);
275}
276
277
278//---------------------------------------------------------------------------
279// LLPanelAccountDetails
280//---------------------------------------------------------------------------
281LLPanelAccountDetails::LLPanelAccountDetails(const LLUUID& request_id)
282: LLPanelAccount(request_id,
283 DETAILS_INTERVAL,
284 DETAILS_MAX,
285 "panel_account_details.xml")
286{
287 childSetText("editor", LOADING_STRING);
288}
289
290// virtual
291void LLPanelAccountDetails::sendRequest()
292{
293 LLMessageSystem* msg = gMessageSystem;
294
295 msg->newMessageFast(_PREHASH_MoneyDetailsRequest);
296 msg->nextBlockFast(_PREHASH_AgentData);
297 msg->addUUIDFast(_PREHASH_AgentID, agent_get_id() );
298 msg->addUUIDFast(_PREHASH_SessionID, agent_get_session_id() );
299 msg->nextBlockFast(_PREHASH_MoneyData);
300 msg->addUUIDFast(_PREHASH_RequestID, mRequestID );
301 msg->addS32Fast(_PREHASH_IntervalDays, mIntervalDays );
302 msg->addS32Fast(_PREHASH_CurrentInterval, sCurrentInterval );
303
304 agent_send_reliable_message();
305}
306
307// virtual
308void LLPanelAccountDetails::processReply(LLMessageSystem* msg, void** data)
309{
310 char line[MAX_STRING];
311 LLString text;
312
313 char start_date[MAX_STRING];
314 S32 interval_days;
315 S32 current_interval;
316
317 msg->getS32Fast(_PREHASH_MoneyData, _PREHASH_IntervalDays, interval_days );
318 msg->getS32Fast(_PREHASH_MoneyData, _PREHASH_CurrentInterval, current_interval );
319 msg->getStringFast(_PREHASH_MoneyData, _PREHASH_StartDate, MAX_STRING, start_date);
320
321 if (interval_days != mIntervalDays || current_interval != sCurrentInterval)
322 {
323 llinfos << "Out of date details packet " << interval_days << " "
324 << current_interval << llendl;
325 return;
326 }
327
328 sprintf(line, "%s\n\n", start_date);
329 text.append(line);
330
331 S32 total_amount = 0;
332 S32 transactions = msg->getNumberOfBlocksFast(_PREHASH_HistoryData);
333 for(S32 i = 0; i < transactions; i++)
334 {
335 S32 amount = 0;
336 char desc[MAX_STRING];
337
338 msg->getStringFast(_PREHASH_HistoryData, _PREHASH_Description, MAX_STRING, desc, i );
339 msg->getS32Fast(_PREHASH_HistoryData, _PREHASH_Amount, amount, i);
340
341 if (amount != 0)
342 {
343 sprintf(line, "%-24s %6d\n", desc, amount );
344 text.append(line);
345 }
346 else
347 {
348 // skip it
349 }
350
351 total_amount += amount;
352 }
353
354 text.append(1, '\n');
355
356 sprintf(line, "%-24s %6d\n", "Total", total_amount );
357 text.append(line);
358
359 childSetText("editor", text);
360}
361
362//---------------------------------------------------------------------------
363// LLPanelAccountTransactions
364//---------------------------------------------------------------------------
365LLPanelAccountTransactions::LLPanelAccountTransactions(const LLUUID& request_id)
366: LLPanelAccount(request_id,
367 TRANSACTIONS_INTERVAL,
368 TRANSACTIONS_MAX,
369 "panel_account_transactions.xml")
370{
371 childSetText("editor", LOADING_STRING);
372}
373
374// virtual
375void LLPanelAccountTransactions::sendRequest()
376{
377 LLMessageSystem* msg = gMessageSystem;
378
379 msg->newMessageFast(_PREHASH_MoneyTransactionsRequest);
380 msg->nextBlockFast(_PREHASH_AgentData);
381 msg->addUUIDFast(_PREHASH_AgentID, agent_get_id() );
382 msg->addUUIDFast(_PREHASH_SessionID, agent_get_session_id() );
383 msg->nextBlockFast(_PREHASH_MoneyData);
384 msg->addUUIDFast(_PREHASH_RequestID, mRequestID );
385 msg->addS32Fast(_PREHASH_IntervalDays, mIntervalDays );
386 msg->addS32Fast(_PREHASH_CurrentInterval, sCurrentInterval );
387
388 agent_send_reliable_message();
389
390 childSetText("editor", LOADING_STRING);
391}
392
393// virtual
394void LLPanelAccountTransactions::processReply(LLMessageSystem* msg, void** data)
395{
396 char line[MAX_STRING];
397 LLSD value = childGetValue("editor");
398 std::string text = value.asString();
399
400 char start_date[MAX_STRING];
401 S32 interval_days;
402 S32 current_interval;
403
404 msg->getS32Fast(_PREHASH_MoneyData, _PREHASH_IntervalDays, interval_days );
405 msg->getS32Fast(_PREHASH_MoneyData, _PREHASH_CurrentInterval, current_interval );
406 msg->getStringFast(_PREHASH_MoneyData, _PREHASH_StartDate, MAX_STRING, start_date);
407
408 if (interval_days != mIntervalDays || current_interval != sCurrentInterval)
409 {
410 llinfos << "Out of date details packet " << interval_days << " "
411 << current_interval << llendl;
412 return;
413 }
414
415 // If this is the first packet, clear the text, don't append.
416 // Start with the date.
417 if (text == LOADING_STRING)
418 {
419 text.clear();
420
421 sprintf(line, "%s\n\n", start_date);
422 text.append(line);
423 }
424
425 S32 transactions = msg->getNumberOfBlocksFast(_PREHASH_HistoryData);
426 if (transactions == 0)
427 {
428 text.append("(none)");
429 }
430 else
431 {
432 for(S32 i = 0; i < transactions; i++)
433 {
434 const S32 SHORT_STRING = 64;
435 char time[SHORT_STRING];
436 S32 type = 0;
437 S32 amount = 0;
438 char user[SHORT_STRING];
439 char item[SHORT_STRING];
440
441 msg->getStringFast(_PREHASH_HistoryData, _PREHASH_Time, SHORT_STRING, time, i);
442 msg->getStringFast(_PREHASH_HistoryData, _PREHASH_User, SHORT_STRING, user, i );
443 msg->getS32Fast(_PREHASH_HistoryData, _PREHASH_Type, type, i);
444 msg->getStringFast(_PREHASH_HistoryData, _PREHASH_Item, SHORT_STRING, item, i );
445 msg->getS32Fast(_PREHASH_HistoryData, _PREHASH_Amount, amount, i);
446
447 if (amount != 0)
448 {
449 char* verb;
450
451 switch(type)
452 {
453 case TRANS_OBJECT_SALE:
454 verb = "bought";
455 break;
456 case TRANS_GIFT:
457 verb = "paid you";
458 break;
459 case TRANS_PAY_OBJECT:
460 verb = "paid into";
461 break;
462 case TRANS_LAND_PASS_SALE:
463 verb = "bought pass to";
464 break;
465 case TRANS_EVENT_FEE:
466 verb = "paid fee for event";
467 break;
468 case TRANS_EVENT_PRIZE:
469 verb = "paid prize for event";
470 break;
471 default:
472 verb = "";
473 break;
474 }
475
476 sprintf(line, "%s %6d - %s %s %s\n", time, amount, user, verb, item);
477 text.append(line);
478 }
479 }
480 }
481
482 childSetText("editor", text);
483}
diff --git a/linden/indra/newview/llpanelmoney.h b/linden/indra/newview/llpanelmoney.h
deleted file mode 100644
index 9600a33..0000000
--- a/linden/indra/newview/llpanelmoney.h
+++ /dev/null
@@ -1,106 +0,0 @@
1/**
2 * @file llpanelmoney.h
3 * @author James Cook
4 * @brief Panels for Account History floater
5 *
6 * Copyright (c) 2003-2007, Linden Research, Inc.
7 *
8 * The source code in this file ("Source Code") is provided by Linden Lab
9 * to you under the terms of the GNU General Public License, version 2.0
10 * ("GPL"), unless you have obtained a separate licensing agreement
11 * ("Other License"), formally executed by you and Linden Lab. Terms of
12 * the GPL can be found in doc/GPL-license.txt in this distribution, or
13 * online at http://secondlife.com/developers/opensource/gplv2
14 *
15 * There are special exceptions to the terms and conditions of the GPL as
16 * it is applied to this Source Code. View the full text of the exception
17 * in the file doc/FLOSS-exception.txt in this software distribution, or
18 * online at http://secondlife.com/developers/opensource/flossexception
19 *
20 * By copying, modifying or distributing this software, you acknowledge
21 * that you have read and understood your obligations described above,
22 * and agree to abide by those obligations.
23 *
24 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
25 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
26 * COMPLETENESS OR PERFORMANCE.
27 */
28
29#ifndef LL_LLPANELMONEY_H
30#define LL_LLPANELMONEY_H
31
32#include "llpanel.h"
33#include "lluuid.h"
34
35class LLMessageSystem;
36class LLTextEditor;
37class LLButton;
38
39// Base class for all the panels.
40class LLPanelAccount
41: public LLPanel
42{
43public:
44 LLPanelAccount(const LLUUID& request_id, S32 interval_days, S32 max_interval, const std::string& filename);
45
46 void setDataRequested(BOOL b) { mDataRequested = b; }
47
48 virtual void draw();
49
50 virtual void sendRequest() = 0;
51 virtual void processReply(LLMessageSystem* msg, void** data) = 0;
52
53 void refreshPanel();
54
55 static void onClickEarlier(void* userdata);
56 static void onClickLater(void* userdata);
57
58protected:
59 LLUUID mRequestID;
60
61 BOOL mDataRequested;
62
63 // Time between start and end day, inclusive. 7 = one week
64 S32 mIntervalDays;
65
66 // How many intervals back are we looking?
67 static S32 sCurrentInterval;
68 S32 mDisplayedInterval;
69
70 S32 mMaxInterval;
71};
72
73
74class LLPanelAccountPlanning
75: public LLPanelAccount
76{
77public:
78 LLPanelAccountPlanning(const LLUUID& request_id);
79
80 virtual void sendRequest();
81 virtual void processReply(LLMessageSystem* msg, void** data);
82};
83
84
85class LLPanelAccountDetails
86: public LLPanelAccount
87{
88public:
89 LLPanelAccountDetails(const LLUUID& request_id);
90
91 virtual void sendRequest();
92 virtual void processReply(LLMessageSystem* msg, void** data);
93};
94
95
96class LLPanelAccountTransactions
97: public LLPanelAccount
98{
99public:
100 LLPanelAccountTransactions(const LLUUID& request_id);
101
102 virtual void sendRequest();
103 virtual void processReply(LLMessageSystem* msg, void** data);
104};
105
106#endif
diff --git a/linden/indra/newview/llpanelnetwork.cpp b/linden/indra/newview/llpanelnetwork.cpp
index c55dacb..ef538ba 100644
--- a/linden/indra/newview/llpanelnetwork.cpp
+++ b/linden/indra/newview/llpanelnetwork.cpp
@@ -37,19 +37,25 @@
37 37
38// project includes 38// project includes
39#include "llbutton.h" 39#include "llbutton.h"
40#include "lldirpicker.h"
40#include "llui.h" 41#include "llui.h"
41#include "lluictrlfactory.h" 42#include "lluictrlfactory.h"
42#include "llresmgr.h" 43#include "llresmgr.h"
43#include "llsliderctrl.h" 44#include "llsliderctrl.h"
45#include "llspinctrl.h"
46#include "llcheckboxctrl.h"
44#include "lltextbox.h" 47#include "lltextbox.h"
45#include "llviewerregion.h" 48#include "llviewerregion.h"
46#include "llviewerthrottle.h" 49#include "llviewerthrottle.h"
47#include "llworld.h" 50#include "llworld.h"
48#include "llviewercontrol.h" 51#include "llviewercontrol.h"
49#include "llvieweruictrlfactory.h" 52#include "llvieweruictrlfactory.h"
50#include "llmozlib.h"
51#include "llviewerwindow.h" 53#include "llviewerwindow.h"
52 54
55#if LL_LIBXUL_ENABLED
56#include "llmozlib.h"
57#endif // LL_LIBXUL_ENABLED
58
53 59
54LLPanelNetwork::LLPanelNetwork() 60LLPanelNetwork::LLPanelNetwork()
55{ 61{
@@ -58,22 +64,17 @@ LLPanelNetwork::LLPanelNetwork()
58 64
59BOOL LLPanelNetwork::postBuild() 65BOOL LLPanelNetwork::postBuild()
60{ 66{
61 requires("disk cache", WIDGET_TYPE_RADIO_GROUP); 67 LLString cache_location = gDirUtilp->getExpandedFilename(LL_PATH_CACHE, "");
62 requires("max_bandwidth", WIDGET_TYPE_SLIDER); 68 childSetText("cache_location", cache_location);
63 requires("clear_cache", WIDGET_TYPE_BUTTON); 69
64 70 childSetAction("clear_cache", onClickClearCache, this);
65 if (!checkRequirements()) 71 childSetAction("set_cache", onClickSetCache, this);
66 { 72 childSetAction("reset_cache", onClickResetCache, this);
67 return FALSE; 73
68 } 74 childSetEnabled("connection_port",
75 gSavedSettings.getBOOL("ConnectionPortEnabled"));
76 childSetCommitCallback("connection_port_enabled", onCommitPort, this);
69 77
70 // retrieve controls
71 mDiskCacheRadio = LLUICtrlFactory::getRadioGroupByName(this, "disk cache");
72 mCtrlBandwidth = LLUICtrlFactory::getSliderByName(this, "max_bandwidth");
73
74 mClearCacheBtn = LLUICtrlFactory::getButtonByName(this, "clear_cache");
75 mClearCacheBtn->setClickedCallback(onClickClearCache);
76 mClearCacheBtn->setCallbackUserData(this);
77 78
78 refresh(); 79 refresh();
79 80
@@ -94,14 +95,18 @@ void LLPanelNetwork::refresh()
94{ 95{
95 LLPanel::refresh(); 96 LLPanel::refresh();
96 97
97 mCacheSetting = gSavedSettings.getU32("VFSSize"); 98 mCacheSetting = gSavedSettings.getU32("CacheSize");
98 mBandwidthBPS = gSavedSettings.getF32("ThrottleBandwidthKBPS")*1024; 99 mBandwidthBPS = gSavedSettings.getF32("ThrottleBandwidthKBPS")*1024;
100 mConnectionPortEnabled = gSavedSettings.getBOOL("ConnectionPortEnabled");
101 mConnectionPort = gSavedSettings.getU32("ConnectionPort");
99} 102}
100 103
101void LLPanelNetwork::cancel() 104void LLPanelNetwork::cancel()
102{ 105{
103 gSavedSettings.setU32("VFSSize", mCacheSetting); 106 gSavedSettings.setU32("CacheSize", mCacheSetting);
104 gSavedSettings.setF32("ThrottleBandwidthKBPS", mBandwidthBPS/1024); 107 gSavedSettings.setF32("ThrottleBandwidthKBPS", mBandwidthBPS/1024);
108 gSavedSettings.setBOOL("ConnectionPortEnabled", mConnectionPortEnabled);
109 gSavedSettings.setU32("ConnectionPort", mConnectionPort);
105} 110}
106 111
107// static 112// static
@@ -116,3 +121,55 @@ void LLPanelNetwork::onClickClearCache(void*)
116 gSavedSettings.setBOOL("PurgeCacheOnNextStartup", TRUE); 121 gSavedSettings.setBOOL("PurgeCacheOnNextStartup", TRUE);
117 gViewerWindow->alertXml("CacheWillClear"); 122 gViewerWindow->alertXml("CacheWillClear");
118} 123}
124
125// static
126void LLPanelNetwork::onClickSetCache(void* user_data)
127{
128 LLPanelNetwork* self = (LLPanelNetwork*)user_data;
129
130 LLString cur_name(gSavedSettings.getString("CacheLocation"));
131 LLString proposed_name(cur_name);
132
133 LLDirPicker& picker = LLDirPicker::instance();
134 if (! picker.getDir(&proposed_name ) )
135 {
136 return; //Canceled!
137 }
138
139 LLString dir_name = picker.getDirName();
140 if (!dir_name.empty() && dir_name != cur_name)
141 {
142 self->childSetText("cache_location", dir_name);
143 gViewerWindow->alertXml("CacheWillBeMoved");
144 gSavedSettings.setString("NewCacheLocation", dir_name);
145 }
146 else
147 {
148 LLString cache_location = gDirUtilp->getCacheDir();
149 self->childSetText("cache_location", cache_location);
150 }
151}
152
153// static
154void LLPanelNetwork::onClickResetCache(void* user_data)
155{
156 LLPanelNetwork* self = (LLPanelNetwork*)user_data;
157 if (!gSavedSettings.getString("CacheLocation").empty())
158 {
159 gSavedSettings.setString("NewCacheLocation", "");
160 gViewerWindow->alertXml("CacheWillBeMoved");
161 }
162 LLString cache_location = gDirUtilp->getCacheDir(true);
163 self->childSetText("cache_location", cache_location);
164}
165
166// static
167void LLPanelNetwork::onCommitPort(LLUICtrl* ctrl, void* data)
168{
169 LLPanelNetwork* self = (LLPanelNetwork*)data;
170 LLCheckBoxCtrl* check = (LLCheckBoxCtrl*)ctrl;
171
172 if (!self || !check) return;
173 self->childSetEnabled("connection_port", check->get());
174 gViewerWindow->alertXml("ChangeConnectionPort");
175}
diff --git a/linden/indra/newview/llpanelnetwork.h b/linden/indra/newview/llpanelnetwork.h
index eb54042..051293a 100644
--- a/linden/indra/newview/llpanelnetwork.h
+++ b/linden/indra/newview/llpanelnetwork.h
@@ -51,14 +51,15 @@ public:
51 51
52private: 52private:
53 static void onClickClearCache(void*); 53 static void onClickClearCache(void*);
54 static void onClickSetCache(void*);
55 static void onClickResetCache(void*);
56 static void onCommitPort(LLUICtrl* ctrl, void*);
54 57
55private: 58private:
56 LLSliderCtrl *mCtrlBandwidth;
57 LLRadioGroup* mDiskCacheRadio;
58 LLButton* mClearCacheBtn;
59
60 U32 mCacheSetting; 59 U32 mCacheSetting;
61 F32 mBandwidthBPS; 60 F32 mBandwidthBPS;
61 BOOL mConnectionPortEnabled;
62 U32 mConnectionPort;
62}; 63};
63 64
64#endif 65#endif
diff --git a/linden/indra/newview/llpanelobject.cpp b/linden/indra/newview/llpanelobject.cpp
index 54e24e2..590eb63 100644
--- a/linden/indra/newview/llpanelobject.cpp
+++ b/linden/indra/newview/llpanelobject.cpp
@@ -275,11 +275,11 @@ LLPanelObject::~LLPanelObject()
275 275
276void LLPanelObject::getState( ) 276void LLPanelObject::getState( )
277{ 277{
278 LLViewerObject* objectp = gSelectMgr->getFirstRootObject(); 278 LLViewerObject* objectp = gSelectMgr->getSelection()->getFirstRootObject();
279 LLViewerObject* root_objectp = objectp; 279 LLViewerObject* root_objectp = objectp;
280 if(!objectp) 280 if(!objectp)
281 { 281 {
282 objectp = gSelectMgr->getFirstObject(); 282 objectp = gSelectMgr->getSelection()->getFirstObject();
283 // *FIX: shouldn't we just keep the child? 283 // *FIX: shouldn't we just keep the child?
284 if (objectp) 284 if (objectp)
285 { 285 {
@@ -391,9 +391,9 @@ void LLPanelObject::getState( )
391 owners_identical = gSelectMgr->selectGetOwner(owner_id, owner_name); 391 owners_identical = gSelectMgr->selectGetOwner(owner_id, owner_name);
392 392
393 // BUG? Check for all objects being editable? 393 // BUG? Check for all objects being editable?
394 S32 roots_selected = gSelectMgr->getRootObjectCount(); 394 S32 roots_selected = gSelectMgr->getSelection()->getRootObjectCount();
395 BOOL editable = root_objectp->permModify(); 395 BOOL editable = root_objectp->permModify();
396 S32 selected_count = gSelectMgr->getObjectCount(); 396 S32 selected_count = gSelectMgr->getSelection()->getObjectCount();
397 BOOL single_volume = (gSelectMgr->selectionAllPCode( LL_PCODE_VOLUME )) 397 BOOL single_volume = (gSelectMgr->selectionAllPCode( LL_PCODE_VOLUME ))
398 && (selected_count == 1); 398 && (selected_count == 1);
399 399
@@ -1525,7 +1525,7 @@ void LLPanelObject::draw()
1525 const LLColor4 blue( 0.f, 0.5f, 1.0f, 1); 1525 const LLColor4 blue( 0.f, 0.5f, 1.0f, 1);
1526 1526
1527 // Tune the colors of the labels 1527 // Tune the colors of the labels
1528 LLTool* tool = gToolMgr->getCurrentTool( gKeyboard->currentMask(TRUE) ); 1528 LLTool* tool = gToolMgr->getCurrentTool();
1529 1529
1530 if (tool == gToolTranslate) 1530 if (tool == gToolTranslate)
1531 { 1531 {
@@ -1645,7 +1645,7 @@ void LLPanelObject::onCommitLock(LLUICtrl *ctrl, void *data)
1645 1645
1646 BOOL new_state = self->mCheckLock->get(); 1646 BOOL new_state = self->mCheckLock->get();
1647 1647
1648 gSelectMgr->setObjectPermissions(PERM_OWNER, !new_state, PERM_MOVE | PERM_MODIFY); 1648 gSelectMgr->selectionSetObjectPermissions(PERM_OWNER, !new_state, PERM_MOVE | PERM_MODIFY);
1649} 1649}
1650 1650
1651// static 1651// static
diff --git a/linden/indra/newview/llpanelpermissions.cpp b/linden/indra/newview/llpanelpermissions.cpp
index 84509a9..8512342 100644
--- a/linden/indra/newview/llpanelpermissions.cpp
+++ b/linden/indra/newview/llpanelpermissions.cpp
@@ -147,16 +147,16 @@ void LLPanelPermissions::refresh()
147 BtnDeedToGroup->setLabelUnselected(deedText); 147 BtnDeedToGroup->setLabelUnselected(deedText);
148 } 148 }
149 BOOL root_selected = TRUE; 149 BOOL root_selected = TRUE;
150 LLSelectNode* nodep = gSelectMgr->getFirstRootNode(); 150 LLSelectNode* nodep = gSelectMgr->getSelection()->getFirstRootNode();
151 S32 object_count = gSelectMgr->getRootObjectCount(); 151 S32 object_count = gSelectMgr->getSelection()->getRootObjectCount();
152 if(!nodep || 0 == object_count) 152 if(!nodep || 0 == object_count)
153 { 153 {
154 nodep = gSelectMgr->getFirstNode(); 154 nodep = gSelectMgr->getSelection()->getFirstNode();
155 object_count = gSelectMgr->getObjectCount(); 155 object_count = gSelectMgr->getSelection()->getObjectCount();
156 root_selected = FALSE; 156 root_selected = FALSE;
157 } 157 }
158 158
159 //BOOL attachment_selected = gSelectMgr->selectionIsAttachment(); 159 //BOOL attachment_selected = gSelectMgr->getSelection()->isAttachment();
160 //attachment_selected = false; 160 //attachment_selected = false;
161 LLViewerObject* objectp = NULL; 161 LLViewerObject* objectp = NULL;
162 if(nodep) objectp = nodep->getObject(); 162 if(nodep) objectp = nodep->getObject();
@@ -249,7 +249,7 @@ void LLPanelPermissions::refresh()
249 BOOL is_one_object = (object_count == 1); 249 BOOL is_one_object = (object_count == 1);
250 250
251 // BUG: fails if a root and non-root are both single-selected. 251 // BUG: fails if a root and non-root are both single-selected.
252 BOOL is_perm_modify = (gSelectMgr->getFirstRootNode() 252 BOOL is_perm_modify = (gSelectMgr->getSelection()->getFirstRootNode()
253 && gSelectMgr->selectGetRootsModify()) 253 && gSelectMgr->selectGetRootsModify())
254 || gSelectMgr->selectGetModify(); 254 || gSelectMgr->selectGetModify();
255 const LLView* keyboard_focus_view = gFocusMgr.getKeyboardFocus(); 255 const LLView* keyboard_focus_view = gFocusMgr.getKeyboardFocus();
@@ -373,8 +373,8 @@ void LLPanelPermissions::refresh()
373 373
374 374
375 // Pre-compute object info string 375 // Pre-compute object info string
376 S32 prim_count = gSelectMgr->getObjectCount(); 376 S32 prim_count = gSelectMgr->getSelection()->getObjectCount();
377 S32 obj_count = gSelectMgr->getRootObjectCount(); 377 S32 obj_count = gSelectMgr->getSelection()->getRootObjectCount();
378 378
379 LLString object_info_string; 379 LLString object_info_string;
380 if (1 == obj_count) 380 if (1 == obj_count)
@@ -383,8 +383,8 @@ void LLPanelPermissions::refresh()
383 } 383 }
384 else 384 else
385 { 385 {
386 char buffer[MAX_STRING]; 386 char buffer[MAX_STRING]; /*Flawfinder: ignore*/
387 sprintf(buffer, "%d Objects, ", obj_count); 387 snprintf(buffer, MAX_STRING, "%d Objects, ", obj_count); /*Flawfinder: ignore*/
388 object_info_string.assign(buffer); 388 object_info_string.assign(buffer);
389 } 389 }
390 if (1 == prim_count) 390 if (1 == prim_count)
@@ -393,8 +393,8 @@ void LLPanelPermissions::refresh()
393 } 393 }
394 else 394 else
395 { 395 {
396 char buffer[MAX_STRING]; 396 char buffer[MAX_STRING]; /*Flawfinder: ignore*/
397 sprintf(buffer, "%d Primitives", prim_count); 397 snprintf(buffer, MAX_STRING, "%d Primitives", prim_count); /*Flawfinder: ignore*/
398 object_info_string.append(buffer); 398 object_info_string.append(buffer);
399 } 399 }
400 childSetText("prim info",object_info_string); 400 childSetText("prim info",object_info_string);
@@ -496,36 +496,36 @@ void LLPanelPermissions::refresh()
496 496
497 if( gSavedSettings.getBOOL("DebugPermissions") ) 497 if( gSavedSettings.getBOOL("DebugPermissions") )
498 { 498 {
499 char perm_string[10]; 499 char perm_string[10]; /*Flawfinder: ignore*/
500 if (valid_base_perms) 500 if (valid_base_perms)
501 { 501 {
502 502
503 strcpy(perm_string, "B: "); 503 strcpy(perm_string, "B: "); /*Flawfinder: ignore*/
504 mask_to_string(base_mask_on, perm_string+3); 504 mask_to_string(base_mask_on, perm_string+3);
505 childSetText("B:",perm_string); 505 childSetText("B:",perm_string);
506 childSetVisible("B:",true); 506 childSetVisible("B:",true);
507 507
508 strcpy(perm_string, "O: "); 508 strcpy(perm_string, "O: "); /*Flawfinder: ignore*/
509 mask_to_string(owner_mask_on, perm_string+3); 509 mask_to_string(owner_mask_on, perm_string+3);
510 childSetText("O:",perm_string); 510 childSetText("O:",perm_string);
511 childSetVisible("O:",true); 511 childSetVisible("O:",true);
512 512
513 strcpy(perm_string, "G: "); 513 strcpy(perm_string, "G: "); /*Flawfinder: ignore*/
514 mask_to_string(group_mask_on, perm_string+3); 514 mask_to_string(group_mask_on, perm_string+3);
515 childSetText("G:",perm_string); 515 childSetText("G:",perm_string);
516 childSetVisible("G:",true); 516 childSetVisible("G:",true);
517 517
518 strcpy(perm_string, "E: "); 518 strcpy(perm_string, "E: "); /*Flawfinder: ignore*/
519 mask_to_string(everyone_mask_on, perm_string+3); 519 mask_to_string(everyone_mask_on, perm_string+3);
520 childSetText("E:",perm_string); 520 childSetText("E:",perm_string);
521 childSetVisible("E:",true); 521 childSetVisible("E:",true);
522 522
523 strcpy(perm_string, "N: "); 523 strcpy(perm_string, "N: "); /*Flawfinder: ignore*/
524 mask_to_string(next_owner_mask_on, perm_string+3); 524 mask_to_string(next_owner_mask_on, perm_string+3);
525 childSetText("N:",perm_string); 525 childSetText("N:",perm_string);
526 childSetVisible("N:",true); 526 childSetVisible("N:",true);
527 } 527 }
528 strcpy(perm_string, "F: "); 528 strcpy(perm_string, "F: "); /*Flawfinder: ignore*/
529 U32 flag_mask = 0x0; 529 U32 flag_mask = 0x0;
530 if (objectp->permMove()) 530 if (objectp->permMove())
531 flag_mask |= PERM_MOVE; 531 flag_mask |= PERM_MOVE;
@@ -729,6 +729,11 @@ void LLPanelPermissions::refresh()
729 { 729 {
730 RadioSaleType->setSelectedIndex((S32)sale_type - 1); 730 RadioSaleType->setSelectedIndex((S32)sale_type - 1);
731 } 731 }
732 else
733 {
734 // default option is sell copy, determined to be safest
735 RadioSaleType->setSelectedIndex((S32)LLSaleInfo::FS_COPY - 1);
736 }
732 737
733 if (is_for_sale) 738 if (is_for_sale)
734 { 739 {
@@ -847,7 +852,7 @@ void LLPanelPermissions::onClickDeedToGroup(void* data)
847// static 852// static
848void LLPanelPermissions::onCommitPerm(LLUICtrl *ctrl, void *data, U8 field, U32 perm) 853void LLPanelPermissions::onCommitPerm(LLUICtrl *ctrl, void *data, U8 field, U32 perm)
849{ 854{
850 LLViewerObject* object = gSelectMgr->getFirstRootObject(); 855 LLViewerObject* object = gSelectMgr->getSelection()->getFirstRootObject();
851 if(!object) return; 856 if(!object) return;
852 857
853 // Checkbox will have toggled itself 858 // Checkbox will have toggled itself
@@ -855,7 +860,7 @@ void LLPanelPermissions::onCommitPerm(LLUICtrl *ctrl, void *data, U8 field, U32
855 LLCheckBoxCtrl *check = (LLCheckBoxCtrl *)ctrl; 860 LLCheckBoxCtrl *check = (LLCheckBoxCtrl *)ctrl;
856 BOOL new_state = check->get(); 861 BOOL new_state = check->get();
857 862
858 gSelectMgr->setObjectPermissions(field, new_state, perm); 863 gSelectMgr->selectionSetObjectPermissions(field, new_state, perm);
859} 864}
860 865
861// static 866// static
@@ -906,8 +911,8 @@ void LLPanelPermissions::onCommitName(LLUICtrl*, void* data)
906 LLLineEditor* tb = gUICtrlFactory->getLineEditorByName(self,"Object Name"); 911 LLLineEditor* tb = gUICtrlFactory->getLineEditorByName(self,"Object Name");
907 if(tb) 912 if(tb)
908 { 913 {
909 gSelectMgr->setObjectName(tb->getText()); 914 gSelectMgr->selectionSetObjectName(tb->getText());
910// gSelectMgr->setObjectName(self->mLabelObjectName->getText()); 915// gSelectMgr->selectionSetObjectName(self->mLabelObjectName->getText());
911 } 916 }
912} 917}
913 918
@@ -920,7 +925,7 @@ void LLPanelPermissions::onCommitDesc(LLUICtrl*, void* data)
920 LLLineEditor* le = gUICtrlFactory->getLineEditorByName(self,"Object Description"); 925 LLLineEditor* le = gUICtrlFactory->getLineEditorByName(self,"Object Description");
921 if(le) 926 if(le)
922 { 927 {
923 gSelectMgr->setObjectDescription(le->getText()); 928 gSelectMgr->selectionSetObjectDescription(le->getText());
924 } 929 }
925} 930}
926 931
@@ -982,7 +987,7 @@ void LLPanelPermissions::setAllSaleInfo()
982 } 987 }
983 988
984 LLSaleInfo sale_info(sale_type, price); 989 LLSaleInfo sale_info(sale_type, price);
985 gSelectMgr->setObjectSaleInfo(sale_info); 990 gSelectMgr->selectionSetObjectSaleInfo(sale_info);
986 991
987 // If turned off for-sale, make sure click-action buy is turned 992 // If turned off for-sale, make sure click-action buy is turned
988 // off as well 993 // off as well
@@ -1036,7 +1041,7 @@ void LLPanelPermissions::onCommitClickAction(LLUICtrl* ctrl, void*)
1036 { 1041 {
1037 // Verify object has script with money() handler 1042 // Verify object has script with money() handler
1038 LLSelectionPayable payable; 1043 LLSelectionPayable payable;
1039 bool can_pay = gSelectMgr->applyToObjects(&payable); 1044 bool can_pay = gSelectMgr->getSelection()->applyToObjects(&payable);
1040 if (!can_pay) 1045 if (!can_pay)
1041 { 1046 {
1042 // Warn, but do it anyway. 1047 // Warn, but do it anyway.
diff --git a/linden/indra/newview/llpanelpick.cpp b/linden/indra/newview/llpanelpick.cpp
index 4c9d5c3..ddd7934 100644
--- a/linden/indra/newview/llpanelpick.cpp
+++ b/linden/indra/newview/llpanelpick.cpp
@@ -289,10 +289,10 @@ void LLPanelPick::processPickInfoReply(LLMessageSystem *msg, void **)
289 LLUUID parcel_id; 289 LLUUID parcel_id;
290 msg->getUUID("Data", "ParcelID", parcel_id); 290 msg->getUUID("Data", "ParcelID", parcel_id);
291 291
292 char name[DB_PARCEL_NAME_SIZE]; 292 char name[DB_PARCEL_NAME_SIZE]; /*Flawfinder: ignore*/
293 msg->getString("Data", "Name", DB_PARCEL_NAME_SIZE, name); 293 msg->getString("Data", "Name", DB_PARCEL_NAME_SIZE, name);
294 294
295 char desc[DB_PICK_DESC_SIZE]; 295 char desc[DB_PICK_DESC_SIZE]; /*Flawfinder: ignore*/
296 msg->getString("Data", "Desc", DB_PICK_DESC_SIZE, desc); 296 msg->getString("Data", "Desc", DB_PICK_DESC_SIZE, desc);
297 297
298 LLUUID snapshot_id; 298 LLUUID snapshot_id;
@@ -300,7 +300,7 @@ void LLPanelPick::processPickInfoReply(LLMessageSystem *msg, void **)
300 300
301 // "Location text" is actually the owner name, the original 301 // "Location text" is actually the owner name, the original
302 // name that owner gave the parcel, and the location. 302 // name that owner gave the parcel, and the location.
303 char buffer[256]; 303 char buffer[256]; /*Flawfinder: ignore*/
304 LLString location_text; 304 LLString location_text;
305 305
306 msg->getString("Data", "User", 256, buffer); 306 msg->getString("Data", "User", 256, buffer);
@@ -314,7 +314,7 @@ void LLPanelPick::processPickInfoReply(LLMessageSystem *msg, void **)
314 location_text.append(", "); 314 location_text.append(", ");
315 } 315 }
316 316
317 char sim_name[256]; 317 char sim_name[256]; /*Flawfinder: ignore*/
318 msg->getString("Data", "SimName", 256, sim_name); 318 msg->getString("Data", "SimName", 256, sim_name);
319 319
320 LLVector3d pos_global; 320 LLVector3d pos_global;
@@ -324,7 +324,7 @@ void LLPanelPick::processPickInfoReply(LLMessageSystem *msg, void **)
324 S32 region_y = llround((F32)pos_global.mdV[VY]) % REGION_WIDTH_UNITS; 324 S32 region_y = llround((F32)pos_global.mdV[VY]) % REGION_WIDTH_UNITS;
325 S32 region_z = llround((F32)pos_global.mdV[VZ]); 325 S32 region_z = llround((F32)pos_global.mdV[VZ]);
326 326
327 sprintf(buffer, "%s (%d, %d, %d)", sim_name, region_x, region_y, region_z); 327 snprintf(buffer, sizeof(buffer), "%s (%d, %d, %d)", sim_name, region_x, region_y, region_z); /*Flawfinder: ignore*/
328 location_text.append(buffer); 328 location_text.append(buffer);
329 329
330 S32 sort_order; 330 S32 sort_order;
@@ -359,7 +359,7 @@ void LLPanelPick::processPickInfoReply(LLMessageSystem *msg, void **)
359 self->mLocationEditor->setText(location_text); 359 self->mLocationEditor->setText(location_text);
360 self->mEnabledCheck->set(enabled); 360 self->mEnabledCheck->set(enabled);
361 361
362 sprintf(buffer, "%d", sort_order); 362 snprintf(buffer, sizeof(buffer), "%d", sort_order); /*Flawfinder: ignore*/
363 self->mSortOrderEditor->setText(buffer); 363 self->mSortOrderEditor->setText(buffer);
364 } 364 }
365} 365}
@@ -506,8 +506,11 @@ void LLPanelPick::onCommitAny(LLUICtrl* ctrl, void* data)
506 } 506 }
507 else 507 else
508 {*/ 508 {*/
509 LLTabContainerVertical* tab = (LLTabContainerVertical*)self->getParent(); 509 LLTabContainerVertical* tab = (LLTabContainerVertical*)self->getParent();
510 tab->setCurrentTabName(self->mNameEditor->getText()); 510 if (tab)
511 {
512 if(tab) tab->setCurrentTabName(self->mNameEditor->getText());
513 }
511 //} 514 //}
512 } 515 }
513} 516}
diff --git a/linden/indra/newview/llpanelplace.cpp b/linden/indra/newview/llpanelplace.cpp
index 4f316c9..f373e99 100644
--- a/linden/indra/newview/llpanelplace.cpp
+++ b/linden/indra/newview/llpanelplace.cpp
@@ -139,20 +139,20 @@ void LLPanelPlace::processParcelInfoReply(LLMessageSystem *msg, void **)
139 LLUUID agent_id; 139 LLUUID agent_id;
140 LLUUID parcel_id; 140 LLUUID parcel_id;
141 LLUUID owner_id; 141 LLUUID owner_id;
142 char name[MAX_STRING]; 142 char name[MAX_STRING]; /*Flawfinder: ignore*/
143 char desc[MAX_STRING]; 143 char desc[MAX_STRING]; /*Flawfinder: ignore*/
144 S32 actual_area; 144 S32 actual_area;
145 S32 billable_area; 145 S32 billable_area;
146 U8 flags; 146 U8 flags;
147 F32 global_x; 147 F32 global_x;
148 F32 global_y; 148 F32 global_y;
149 F32 global_z; 149 F32 global_z;
150 char sim_name[MAX_STRING]; 150 char sim_name[MAX_STRING]; /*Flawfinder: ignore*/
151 LLUUID snapshot_id; 151 LLUUID snapshot_id;
152 F32 dwell; 152 F32 dwell;
153 S32 sale_price; 153 S32 sale_price;
154 S32 auction_id; 154 S32 auction_id;
155 char buffer[256]; 155 char buffer[256]; /*Flawfinder: ignore*/
156 156
157 msg->getUUID("AgentData", "AgentID", agent_id ); 157 msg->getUUID("AgentData", "AgentID", agent_id );
158 msg->getUUID("Data", "ParcelID", parcel_id); 158 msg->getUUID("Data", "ParcelID", parcel_id);
@@ -193,16 +193,16 @@ void LLPanelPlace::processParcelInfoReply(LLMessageSystem *msg, void **)
193 self->mDescEditor->setText(desc); 193 self->mDescEditor->setText(desc);
194 194
195 LLString info; 195 LLString info;
196 sprintf(buffer, "Traffic: %.0f, Area: %d sq. m.", dwell, actual_area); 196 snprintf(buffer, sizeof(buffer), "Traffic: %.0f, Area: %d sq. m.", dwell, actual_area); /*Flawfinder: ignore*/
197 info.append(buffer); 197 info.append(buffer);
198 if (flags & DFQ_FOR_SALE) 198 if (flags & DFQ_FOR_SALE)
199 { 199 {
200 sprintf(buffer, ", For Sale for L$%d", sale_price); 200 snprintf(buffer, sizeof(buffer), ", For Sale for L$%d", sale_price); /*Flawfinder: ignore*/
201 info.append(buffer); 201 info.append(buffer);
202 } 202 }
203 if (auction_id != 0) 203 if (auction_id != 0)
204 { 204 {
205 sprintf(buffer, ", Auction ID %010d", auction_id); 205 snprintf(buffer, sizeof(buffer), ", Auction ID %010d", auction_id); /*Flawfinder: ignore*/
206 info.append(buffer); 206 info.append(buffer);
207 } 207 }
208 self->mInfoEditor->setText(info); 208 self->mInfoEditor->setText(info);
@@ -218,7 +218,7 @@ void LLPanelPlace::processParcelInfoReply(LLMessageSystem *msg, void **)
218 rating = LLViewerRegion::accessToString(SIM_ACCESS_MATURE); 218 rating = LLViewerRegion::accessToString(SIM_ACCESS_MATURE);
219 } 219 }
220 220
221 sprintf(buffer, "%s %d, %d, %d (%s)", 221 snprintf(buffer, sizeof(buffer), "%s %d, %d, %d (%s)", /*Flawfinder: ignore*/
222 sim_name, region_x, region_y, region_z, rating); 222 sim_name, region_x, region_y, region_z, rating);
223 self->mLocationEditor->setText(buffer); 223 self->mLocationEditor->setText(buffer);
224 224
@@ -280,8 +280,8 @@ void LLPanelPlace::callbackAuctionWebPage(S32 option, void* data)
280 280
281 if (0 == option) 281 if (0 == option)
282 { 282 {
283 char url[256]; 283 char url[256]; /*Flawfinder: ignore*/
284 sprintf(url, "%s%010d", AUCTION_URL, self->mAuctionID); 284 snprintf(url, sizeof(url), "%s%010d", AUCTION_URL, self->mAuctionID); /*Flawfinder: ignore*/
285 285
286 llinfos << "Loading auction page " << url << llendl; 286 llinfos << "Loading auction page " << url << llendl;
287 287
diff --git a/linden/indra/newview/llpanelvolume.cpp b/linden/indra/newview/llpanelvolume.cpp
index afda5bd..3a8650d 100644
--- a/linden/indra/newview/llpanelvolume.cpp
+++ b/linden/indra/newview/llpanelvolume.cpp
@@ -136,11 +136,11 @@ LLPanelVolume::~LLPanelVolume()
136 136
137void LLPanelVolume::getState( ) 137void LLPanelVolume::getState( )
138{ 138{
139 LLViewerObject* objectp = gSelectMgr->getFirstRootObject(); 139 LLViewerObject* objectp = gSelectMgr->getSelection()->getFirstRootObject();
140 LLViewerObject* root_objectp = objectp; 140 LLViewerObject* root_objectp = objectp;
141 if(!objectp) 141 if(!objectp)
142 { 142 {
143 objectp = gSelectMgr->getFirstObject(); 143 objectp = gSelectMgr->getSelection()->getFirstObject();
144 // *FIX: shouldn't we just keep the child? 144 // *FIX: shouldn't we just keep the child?
145 if (objectp) 145 if (objectp)
146 { 146 {
@@ -185,7 +185,7 @@ void LLPanelVolume::getState( )
185 // BUG? Check for all objects being editable? 185 // BUG? Check for all objects being editable?
186 BOOL editable = root_objectp->permModify(); 186 BOOL editable = root_objectp->permModify();
187 BOOL single_volume = gSelectMgr->selectionAllPCode( LL_PCODE_VOLUME ) 187 BOOL single_volume = gSelectMgr->selectionAllPCode( LL_PCODE_VOLUME )
188 && gSelectMgr->getObjectCount() == 1; 188 && gSelectMgr->getSelection()->getObjectCount() == 1;
189 189
190 // Select Single Message 190 // Select Single Message
191 if (single_volume) 191 if (single_volume)
diff --git a/linden/indra/newview/llpolymesh.cpp b/linden/indra/newview/llpolymesh.cpp
index d58ec74..4f339ac 100644
--- a/linden/indra/newview/llpolymesh.cpp
+++ b/linden/indra/newview/llpolymesh.cpp
@@ -261,7 +261,12 @@ BOOL LLPolyMeshSharedData::loadMesh( const char *fileName )
261 //------------------------------------------------------------------------- 261 //-------------------------------------------------------------------------
262 // Open the file 262 // Open the file
263 //------------------------------------------------------------------------- 263 //-------------------------------------------------------------------------
264 FILE *fp = LLFile::fopen(fileName, "rb"); 264 if(!fileName)
265 {
266 llerrs << "Filename is Empty!" << llendl;
267 return FALSE;
268 }
269 FILE* fp = LLFile::fopen(fileName, "rb"); /*Flawfinder: ignore*/
265 if (!fp) 270 if (!fp)
266 { 271 {
267 llerrs << "can't open: " << fileName << llendl; 272 llerrs << "can't open: " << fileName << llendl;
@@ -271,14 +276,14 @@ BOOL LLPolyMeshSharedData::loadMesh( const char *fileName )
271 //------------------------------------------------------------------------- 276 //-------------------------------------------------------------------------
272 // Read a chunk 277 // Read a chunk
273 //------------------------------------------------------------------------- 278 //-------------------------------------------------------------------------
274 char header[128]; 279 char header[128]; /*Flawfinder: ignore*/
275 fread(header, sizeof(char), 128, fp); 280 fread(header, sizeof(char), 128, fp);
276 281
277 //------------------------------------------------------------------------- 282 //-------------------------------------------------------------------------
278 // Check for proper binary header 283 // Check for proper binary header
279 //------------------------------------------------------------------------- 284 //-------------------------------------------------------------------------
280 BOOL status = FALSE; 285 BOOL status = FALSE;
281 if ( strncmp(header, HEADER_BINARY, strlen(HEADER_BINARY)) == 0 ) 286 if ( strncmp(header, HEADER_BINARY, strlen(HEADER_BINARY)) == 0 ) /*Flawfinder: ignore*/
282 { 287 {
283 lldebugs << "Loading " << fileName << llendl; 288 lldebugs << "Loading " << fileName << llendl;
284 289
@@ -541,7 +546,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const char *fileName )
541 //---------------------------------------------------------------- 546 //----------------------------------------------------------------
542 for (i=0; i < numSkinJoints; i++) 547 for (i=0; i < numSkinJoints; i++)
543 { 548 {
544 char jointName[64]; 549 char jointName[64]; /*Flawfinder: ignore*/
545 numRead = fread(jointName, sizeof(jointName), 1, fp); 550 numRead = fread(jointName, sizeof(jointName), 1, fp);
546 if (numRead != 1) 551 if (numRead != 1)
547 { 552 {
@@ -555,7 +560,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const char *fileName )
555 //------------------------------------------------------------------------- 560 //-------------------------------------------------------------------------
556 // look for morph section 561 // look for morph section
557 //------------------------------------------------------------------------- 562 //-------------------------------------------------------------------------
558 char morphName[64]; 563 char morphName[64]; /*Flawfinder: ignore*/
559 while(fread(&morphName, sizeof(char), 64, fp) == 64) 564 while(fread(&morphName, sizeof(char), 64, fp) == 64)
560 { 565 {
561 if (!strcmp(morphName, "End Morphs")) 566 if (!strcmp(morphName, "End Morphs"))
@@ -739,8 +744,8 @@ LLPolyMesh *LLPolyMesh::getMesh(const LLString &name, LLPolyMesh* reference_mesh
739 //------------------------------------------------------------------------- 744 //-------------------------------------------------------------------------
740 // if not found, create a new one, add it to the list 745 // if not found, create a new one, add it to the list
741 //------------------------------------------------------------------------- 746 //-------------------------------------------------------------------------
742 char full_path[LL_MAX_PATH]; 747 char full_path[LL_MAX_PATH]; /*Flawfinder: ignore*/
743 sprintf(full_path, "%s", (gDirUtilp->getExpandedFilename(LL_PATH_CHARACTER,name.c_str())).c_str()); 748 snprintf(full_path, LL_MAX_PATH, "%s", (gDirUtilp->getExpandedFilename(LL_PATH_CHARACTER,name.c_str())).c_str()); /*Flawfinder: ignore*/
744 749
745 LLPolyMeshSharedData *mesh_data = new LLPolyMeshSharedData(); 750 LLPolyMeshSharedData *mesh_data = new LLPolyMeshSharedData();
746 if (reference_mesh) 751 if (reference_mesh)
@@ -799,7 +804,7 @@ void LLPolyMesh::dumpDiagInfo()
799 U32 total_faces = 0; 804 U32 total_faces = 0;
800 U32 total_kb = 0; 805 U32 total_kb = 0;
801 806
802 char buf[1024]; 807 char buf[1024]; /*Flawfinder: ignore*/
803 808
804 llinfos << "-----------------------------------------------------" << llendl; 809 llinfos << "-----------------------------------------------------" << llendl;
805 llinfos << " Global PolyMesh Table (DEBUG only)" << llendl; 810 llinfos << " Global PolyMesh Table (DEBUG only)" << llendl;
@@ -818,7 +823,7 @@ void LLPolyMesh::dumpDiagInfo()
818 S32 num_faces = mesh.mNumFaces; 823 S32 num_faces = mesh.mNumFaces;
819 U32 num_kb = mesh.getNumKB(); 824 U32 num_kb = mesh.getNumKB();
820 825
821 sprintf(buf, "%8d %8d %8d %s", num_verts, num_faces, num_kb, mesh_name_p->c_str()); 826 snprintf(buf, sizeof(buf), "%8d %8d %8d %s", num_verts, num_faces, num_kb, mesh_name_p->c_str()); /*Flawfinder: ignore*/
822 llinfos << buf << llendl; 827 llinfos << buf << llendl;
823 828
824 total_verts += num_verts; 829 total_verts += num_verts;
@@ -827,7 +832,7 @@ void LLPolyMesh::dumpDiagInfo()
827 } 832 }
828 833
829 llinfos << "-----------------------------------------------------" << llendl; 834 llinfos << "-----------------------------------------------------" << llendl;
830 sprintf(buf, "%8d %8d %8d TOTAL", total_verts, total_faces, total_kb ); 835 snprintf(buf, sizeof(buf), "%8d %8d %8d TOTAL", total_verts, total_faces, total_kb ); /*Flawfinder: ignore*/
831 llinfos << buf << llendl; 836 llinfos << buf << llendl;
832 llinfos << "-----------------------------------------------------" << llendl; 837 llinfos << "-----------------------------------------------------" << llendl;
833} 838}
@@ -906,12 +911,12 @@ void LLPolyMesh::initializeForMorph()
906 if (!mSharedData) 911 if (!mSharedData)
907 return; 912 return;
908 913
909 memcpy(mCoords, mSharedData->mBaseCoords, sizeof(LLVector3) * mSharedData->mNumVertices); 914 memcpy(mCoords, mSharedData->mBaseCoords, sizeof(LLVector3) * mSharedData->mNumVertices); /*Flawfinder: ignore*/
910 memcpy(mNormals, mSharedData->mBaseNormals, sizeof(LLVector3) * mSharedData->mNumVertices); 915 memcpy(mNormals, mSharedData->mBaseNormals, sizeof(LLVector3) * mSharedData->mNumVertices); /*Flawfinder: ignore*/
911 memcpy(mScaledNormals, mSharedData->mBaseNormals, sizeof(LLVector3) * mSharedData->mNumVertices); 916 memcpy(mScaledNormals, mSharedData->mBaseNormals, sizeof(LLVector3) * mSharedData->mNumVertices); /*Flawfinder: ignore*/
912 memcpy(mBinormals, mSharedData->mBaseBinormals, sizeof(LLVector3) * mSharedData->mNumVertices); 917 memcpy(mBinormals, mSharedData->mBaseBinormals, sizeof(LLVector3) * mSharedData->mNumVertices); /*Flawfinder: ignore*/
913 memcpy(mScaledBinormals, mSharedData->mBaseBinormals, sizeof(LLVector3) * mSharedData->mNumVertices); 918 memcpy(mScaledBinormals, mSharedData->mBaseBinormals, sizeof(LLVector3) * mSharedData->mNumVertices); /*Flawfinder: ignore*/
914 memcpy(mTexCoords, mSharedData->mTexCoords, sizeof(LLVector2) * mSharedData->mNumVertices); 919 memcpy(mTexCoords, mSharedData->mTexCoords, sizeof(LLVector2) * mSharedData->mNumVertices); /*Flawfinder: ignore*/
915 memset(mClothingWeights, 0, sizeof(LLVector4) * mSharedData->mNumVertices); 920 memset(mClothingWeights, 0, sizeof(LLVector4) * mSharedData->mNumVertices);
916} 921}
917 922
@@ -1070,10 +1075,10 @@ BOOL LLPolySkeletalDistortion::setInfo(LLPolySkeletalDistortionInfo *info)
1070 mJointScales[joint] = bone_info->mScaleDeformation; 1075 mJointScales[joint] = bone_info->mScaleDeformation;
1071 1076
1072 // apply to children that need to inherit it 1077 // apply to children that need to inherit it
1073 for ( LLViewerJoint *child_joint = (LLViewerJoint *)joint->mChildren.getFirstData(); 1078 for (LLJoint::child_list_t::iterator iter = joint->mChildren.begin();
1074 child_joint != NULL; 1079 iter != joint->mChildren.end(); ++iter)
1075 child_joint = (LLViewerJoint *)joint->mChildren.getNextData() )
1076 { 1080 {
1081 LLViewerJoint* child_joint = (LLViewerJoint*)(*iter);
1077 if (child_joint->inheritScale()) 1082 if (child_joint->inheritScale())
1078 { 1083 {
1079 LLVector3 childDeformation = LLVector3(child_joint->getScale()); 1084 LLVector3 childDeformation = LLVector3(child_joint->getScale());
diff --git a/linden/indra/newview/llpolymesh.h b/linden/indra/newview/llpolymesh.h
index 851a9bc..0d448ac 100644
--- a/linden/indra/newview/llpolymesh.h
+++ b/linden/indra/newview/llpolymesh.h
@@ -324,6 +324,7 @@ public:
324 324
325 U32 mFaceVertexOffset; 325 U32 mFaceVertexOffset;
326 U32 mFaceVertexCount; 326 U32 mFaceVertexCount;
327 U32 mFaceIndexOffset;
327 U32 mFaceIndexCount; 328 U32 mFaceIndexCount;
328 U32 mCurVertexCount; 329 U32 mCurVertexCount;
329private: 330private:
diff --git a/linden/indra/newview/llpolymorph.cpp b/linden/indra/newview/llpolymorph.cpp
index ae9b37a..3937da2 100644
--- a/linden/indra/newview/llpolymorph.cpp
+++ b/linden/indra/newview/llpolymorph.cpp
@@ -49,8 +49,8 @@ LLPolyMorphData::LLPolyMorphData(char *morph_name)
49{ 49{
50 llassert (morph_name); 50 llassert (morph_name);
51 51
52 mName = new char[strlen(morph_name) + 1]; 52 mName = new char[strlen(morph_name) + 1]; /*Flawfinder: ignore*/
53 strcpy(mName, morph_name); 53 strcpy(mName, morph_name); /*Flawfinder: ignore*/
54 54
55 mNumIndices = 0; 55 mNumIndices = 0;
56 mCurrentIndex = 0; 56 mCurrentIndex = 0;
diff --git a/linden/indra/newview/llpreview.cpp b/linden/indra/newview/llpreview.cpp
index c5dc414..534513f 100644
--- a/linden/indra/newview/llpreview.cpp
+++ b/linden/indra/newview/llpreview.cpp
@@ -52,6 +52,7 @@
52// Globals and statics 52// Globals and statics
53LLPreview::preview_multimap_t LLPreview::sPreviewsBySource; 53LLPreview::preview_multimap_t LLPreview::sPreviewsBySource;
54LLPreview::preview_map_t LLPreview::sInstances; 54LLPreview::preview_map_t LLPreview::sInstances;
55std::map<LLUUID, LLViewHandle> LLMultiPreview::sAutoOpenPreviewHandles;
55 56
56// Functions 57// Functions
57LLPreview::LLPreview(const std::string& name) : 58LLPreview::LLPreview(const std::string& name) :
@@ -219,11 +220,11 @@ void LLPreview::onCommit()
219 { 220 {
220 gSelectMgr->deselectAll(); 221 gSelectMgr->deselectAll();
221 gSelectMgr->addAsIndividual( obj, SELECT_ALL_TES, FALSE ); 222 gSelectMgr->addAsIndividual( obj, SELECT_ALL_TES, FALSE );
222 gSelectMgr->setObjectDescription( childGetText("desc") ); 223 gSelectMgr->selectionSetObjectDescription( childGetText("desc") );
223 224
224 if( has_sale_info ) 225 if( has_sale_info )
225 { 226 {
226 gSelectMgr->setObjectSaleInfo( sale_info ); 227 gSelectMgr->selectionSetObjectSaleInfo( sale_info );
227 } 228 }
228 229
229 gSelectMgr->deselectAll(); 230 gSelectMgr->deselectAll();
@@ -272,7 +273,7 @@ LLPreview* LLPreview::show( const LLUUID& item_uuid, BOOL take_focus )
272 // needs to be rehosted 273 // needs to be rehosted
273 LLFloater::getFloaterHost()->addFloater(instance, TRUE); 274 LLFloater::getFloaterHost()->addFloater(instance, TRUE);
274 } 275 }
275 instance->open(); 276 instance->open(); /*Flawfinder: ignore*/
276 if (take_focus) 277 if (take_focus)
277 { 278 {
278 instance->setFocus(TRUE); 279 instance->setFocus(TRUE);
@@ -382,14 +383,14 @@ BOOL LLPreview::handleHover(S32 x, S32 y, MASK mask)
382 return LLFloater::handleHover(x,y,mask); 383 return LLFloater::handleHover(x,y,mask);
383} 384}
384 385
385void LLPreview::open() 386void LLPreview::open() /*Flawfinder: ignore*/
386{ 387{
387 LLMultiFloater* hostp = getHost(); 388 LLMultiFloater* hostp = getHost();
388 if (!sHostp && !hostp && getAssetStatus() == PREVIEW_ASSET_UNLOADED) 389 if (!sHostp && !hostp && getAssetStatus() == PREVIEW_ASSET_UNLOADED)
389 { 390 {
390 loadAsset(); 391 loadAsset();
391 } 392 }
392 LLFloater::open(); 393 LLFloater::open(); /*Flawfinder: ignore*/
393} 394}
394 395
395// virtual 396// virtual
@@ -491,11 +492,12 @@ LLPreview* LLPreview::getFirstPreviewForSource(const LLUUID& source_id)
491 492
492LLMultiPreview::LLMultiPreview(const LLRect& rect) : LLMultiFloater("Preview", rect) 493LLMultiPreview::LLMultiPreview(const LLRect& rect) : LLMultiFloater("Preview", rect)
493{ 494{
495 setCanResize(TRUE);
494} 496}
495 497
496void LLMultiPreview::open() 498void LLMultiPreview::open() /*Flawfinder: ignore*/
497{ 499{
498 LLMultiFloater::open(); 500 LLMultiFloater::open(); /*Flawfinder: ignore*/
499 LLPreview* frontmost_preview = (LLPreview*)mTabContainer->getCurrentPanel(); 501 LLPreview* frontmost_preview = (LLPreview*)mTabContainer->getCurrentPanel();
500 if (frontmost_preview && frontmost_preview->getAssetStatus() == LLPreview::PREVIEW_ASSET_UNLOADED) 502 if (frontmost_preview && frontmost_preview->getAssetStatus() == LLPreview::PREVIEW_ASSET_UNLOADED)
501 { 503 {
@@ -511,3 +513,23 @@ void LLMultiPreview::tabOpen(LLFloater* opened_floater, bool from_click)
511 opened_preview->loadAsset(); 513 opened_preview->loadAsset();
512 } 514 }
513} 515}
516
517//static
518LLMultiPreview* LLMultiPreview::getAutoOpenInstance(const LLUUID& id)
519{
520 handle_map_t::iterator found_it = sAutoOpenPreviewHandles.find(id);
521 if (found_it != sAutoOpenPreviewHandles.end())
522 {
523 return (LLMultiPreview*)gFloaterView->getFloaterByHandle(found_it->second);
524 }
525 return NULL;
526}
527
528//static
529void LLMultiPreview::setAutoOpenInstance(LLMultiPreview* previewp, const LLUUID& id)
530{
531 if (previewp)
532 {
533 sAutoOpenPreviewHandles[id] = previewp->getHandle();
534 }
535}
diff --git a/linden/indra/newview/llpreview.h b/linden/indra/newview/llpreview.h
index 418c797..7882b4c 100644
--- a/linden/indra/newview/llpreview.h
+++ b/linden/indra/newview/llpreview.h
@@ -34,7 +34,7 @@
34#include "lluuid.h" 34#include "lluuid.h"
35#include "llviewerinventory.h" 35#include "llviewerinventory.h"
36#include "lltabcontainer.h" 36#include "lltabcontainer.h"
37#include "lllineeditor.h" 37#include <map>
38 38
39class LLLineEditor; 39class LLLineEditor;
40class LLRadioGroup; 40class LLRadioGroup;
@@ -45,8 +45,15 @@ class LLMultiPreview : public LLMultiFloater
45public: 45public:
46 LLMultiPreview(const LLRect& rect); 46 LLMultiPreview(const LLRect& rect);
47 47
48 /*virtual*/void open(); 48 /*virtual*/void open(); /*Flawfinder: ignore*/
49 /*virtual*/void tabOpen(LLFloater* opened_floater, bool from_click); 49 /*virtual*/void tabOpen(LLFloater* opened_floater, bool from_click);
50
51 static LLMultiPreview* getAutoOpenInstance(const LLUUID& id);
52 static void setAutoOpenInstance(LLMultiPreview* previewp, const LLUUID& id);
53
54protected:
55 typedef std::map<LLUUID, LLViewHandle> handle_map_t;
56 static std::map<LLUUID, LLViewHandle> sAutoOpenPreviewHandles;
50}; 57};
51 58
52class LLPreview : public LLFloater 59class LLPreview : public LLFloater
@@ -79,7 +86,7 @@ public:
79 virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask); 86 virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask);
80 virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask); 87 virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask);
81 virtual BOOL handleHover(S32 x, S32 y, MASK mask); 88 virtual BOOL handleHover(S32 x, S32 y, MASK mask);
82 virtual void open(); 89 virtual void open(); /*Flawfinder: ignore*/
83 virtual bool saveItem(LLPointer<LLInventoryItem>* itemptr); 90 virtual bool saveItem(LLPointer<LLInventoryItem>* itemptr);
84 91
85 void setAuxItem( const LLInventoryItem* item ) 92 void setAuxItem( const LLInventoryItem* item )
diff --git a/linden/indra/newview/llpreviewgesture.cpp b/linden/indra/newview/llpreviewgesture.cpp
index 1ff782a..fdbeb6c 100644
--- a/linden/indra/newview/llpreviewgesture.cpp
+++ b/linden/indra/newview/llpreviewgesture.cpp
@@ -41,6 +41,7 @@
41 41
42// newview 42// newview
43#include "llagent.h" // todo: remove 43#include "llagent.h" // todo: remove
44#include "llassetuploadresponders.h"
44#include "llbutton.h" 45#include "llbutton.h"
45#include "llcheckboxctrl.h" 46#include "llcheckboxctrl.h"
46#include "llcombobox.h" 47#include "llcombobox.h"
@@ -57,6 +58,7 @@
57#include "llviewerinventory.h" 58#include "llviewerinventory.h"
58#include "llviewerobject.h" 59#include "llviewerobject.h"
59#include "llviewerobjectlist.h" 60#include "llviewerobjectlist.h"
61#include "llviewerregion.h"
60#include "llviewerstats.h" 62#include "llviewerstats.h"
61#include "llviewerwindow.h" // busycount 63#include "llviewerwindow.h" // busycount
62#include "viewer.h" // gVFS 64#include "viewer.h" // gVFS
@@ -112,7 +114,7 @@ LLPreviewGesture* LLPreviewGesture::show(const std::string& title, const LLUUID&
112 LLPreviewGesture* previewp = (LLPreviewGesture*)LLPreview::find(item_id); 114 LLPreviewGesture* previewp = (LLPreviewGesture*)LLPreview::find(item_id);
113 if (previewp) 115 if (previewp)
114 { 116 {
115 previewp->open(); 117 previewp->open(); /*Flawfinder: ignore*/
116 if (take_focus) 118 if (take_focus)
117 { 119 {
118 previewp->setFocus(TRUE); 120 previewp->setFocus(TRUE);
@@ -790,8 +792,8 @@ void LLPreviewGesture::refresh()
790 mWaitTimeCheck->setVisible(TRUE); 792 mWaitTimeCheck->setVisible(TRUE);
791 mWaitTimeCheck->set(wait_step->mFlags & WAIT_FLAG_TIME); 793 mWaitTimeCheck->set(wait_step->mFlags & WAIT_FLAG_TIME);
792 mWaitTimeEditor->setVisible(TRUE); 794 mWaitTimeEditor->setVisible(TRUE);
793 char buffer[16]; 795 char buffer[16]; /*Flawfinder: ignore*/
794 sprintf(buffer, "%.1f", (double)wait_step->mWaitSeconds); 796 snprintf(buffer, sizeof(buffer), "%.1f", (double)wait_step->mWaitSeconds); /*Flawfinder: ignore*/
795 mWaitTimeEditor->setText(buffer); 797 mWaitTimeEditor->setText(buffer);
796 break; 798 break;
797 } 799 }
@@ -895,7 +897,7 @@ void LLPreviewGesture::onLoadComplete(LLVFS *vfs,
895 S32 size = file.getSize(); 897 S32 size = file.getSize();
896 898
897 char* buffer = new char[size+1]; 899 char* buffer = new char[size+1];
898 file.read((U8*)buffer, size); 900 file.read((U8*)buffer, size); /*Flawfinder: ignore*/
899 buffer[size] = '\0'; 901 buffer[size] = '\0';
900 902
901 LLMultiGesture* gesture = new LLMultiGesture(); 903 LLMultiGesture* gesture = new LLMultiGesture();
@@ -1120,13 +1122,31 @@ void LLPreviewGesture::saveIfNeeded()
1120 LLInventoryItem* item = getItem(); 1122 LLInventoryItem* item = getItem();
1121 if (item) 1123 if (item)
1122 { 1124 {
1123 LLLineEditor* descEditor = LLUICtrlFactory::getLineEditorByName(this, "desc"); 1125 std::string agent_url = gAgent.getRegion()->getCapability("UpdateGestureAgentInventory");
1124 LLSaveInfo* info = new LLSaveInfo(mItemUUID, mObjectUUID, descEditor->getText(), tid); 1126 std::string task_url = gAgent.getRegion()->getCapability("UpdateGestureTaskInventory");
1125 1127 if (mObjectUUID.isNull() && !agent_url.empty())
1126 const BOOL temp_file = FALSE; 1128 {
1127 1129 // Saving into agent inventory
1128 gAssetStorage->storeAssetData(tid, LLAssetType::AT_GESTURE, onSaveComplete, info, temp_file); 1130 LLSD body;
1129 1131 body["item_id"] = mItemUUID;
1132 LLHTTPClient::post(agent_url, body,
1133 new LLUpdateAgentInventoryResponder(body, asset_id, LLAssetType::AT_GESTURE));
1134 }
1135 else if (!mObjectUUID.isNull() && !task_url.empty())
1136 {
1137 // Saving into task inventory
1138 LLSD body;
1139 body["task_id"] = mObjectUUID;
1140 body["item_id"] = mItemUUID;
1141 LLHTTPClient::post(task_url, body,
1142 new LLUpdateTaskInventoryResponder(body, asset_id, LLAssetType::AT_GESTURE));
1143 }
1144 else if (gAssetStorage)
1145 {
1146 LLLineEditor* descEditor = LLUICtrlFactory::getLineEditorByName(this, "desc");
1147 LLSaveInfo* info = new LLSaveInfo(mItemUUID, mObjectUUID, descEditor->getText(), tid);
1148 gAssetStorage->storeAssetData(tid, LLAssetType::AT_GESTURE, onSaveComplete, info, FALSE);
1149 }
1130 } 1150 }
1131 1151
1132 // If this gesture is active, then we need to update the in-memory 1152 // If this gesture is active, then we need to update the in-memory
diff --git a/linden/indra/newview/llpreviewnotecard.cpp b/linden/indra/newview/llpreviewnotecard.cpp
index da8b9fc..fe5ade2 100644
--- a/linden/indra/newview/llpreviewnotecard.cpp
+++ b/linden/indra/newview/llpreviewnotecard.cpp
@@ -32,6 +32,7 @@
32#include "llinventory.h" 32#include "llinventory.h"
33 33
34#include "llagent.h" 34#include "llagent.h"
35#include "llassetuploadresponders.h"
35#include "llviewerwindow.h" 36#include "llviewerwindow.h"
36#include "llbutton.h" 37#include "llbutton.h"
37#include "llinventorymodel.h" 38#include "llinventorymodel.h"
@@ -110,8 +111,12 @@ LLPreviewNotecard::LLPreviewNotecard(const std::string& name,
110 } 111 }
111 } 112 }
112 113
113 reshape(curRect.getWidth(), curRect.getHeight(), TRUE); 114 // only assert shape if not hosted in a multifloater
114 setRect(curRect); 115 if (!getHost())
116 {
117 reshape(curRect.getWidth(), curRect.getHeight(), TRUE);
118 setRect(curRect);
119 }
115 120
116 childSetVisible("lock", FALSE); 121 childSetVisible("lock", FALSE);
117 122
@@ -142,6 +147,7 @@ BOOL LLPreviewNotecard::postBuild()
142 if (ed) 147 if (ed)
143 { 148 {
144 ed->setNotecardInfo(mNotecardItemID, mObjectID); 149 ed->setNotecardInfo(mNotecardItemID, mObjectID);
150 ed->makePristine();
145 } 151 }
146 return TRUE; 152 return TRUE;
147} 153}
@@ -234,6 +240,22 @@ const LLInventoryItem* LLPreviewNotecard::getDragItem()
234 return NULL; 240 return NULL;
235} 241}
236 242
243bool LLPreviewNotecard::hasEmbeddedInventory()
244{
245 LLViewerTextEditor* editor = NULL;
246 editor = LLViewerUICtrlFactory::getViewerTextEditorByName(
247 this,
248 "Notecard Editor");
249 if (!editor) return false;
250 return editor->hasEmbeddedInventory();
251}
252
253void LLPreviewNotecard::refreshFromInventory()
254{
255 lldebugs << "LLPreviewNotecard::refreshFromInventory()" << llendl;
256 loadAsset();
257}
258
237void LLPreviewNotecard::loadAsset() 259void LLPreviewNotecard::loadAsset()
238{ 260{
239 // request the asset. 261 // request the asset.
@@ -337,7 +359,7 @@ void LLPreviewNotecard::onLoadComplete(LLVFS *vfs,
337 S32 file_length = file.getSize(); 359 S32 file_length = file.getSize();
338 360
339 char* buffer = new char[file_length+1]; 361 char* buffer = new char[file_length+1];
340 file.read((U8*)buffer, file_length); 362 file.read((U8*)buffer, file_length); /*Flawfinder: ignore*/
341 363
342 // put a EOS at the end 364 // put a EOS at the end
343 buffer[file_length] = 0; 365 buffer[file_length] = 0;
@@ -363,7 +385,7 @@ void LLPreviewNotecard::onLoadComplete(LLVFS *vfs,
363 LLInventoryItem* item = preview->getItem(); 385 LLInventoryItem* item = preview->getItem();
364 BOOL modifiable = item && gAgent.allowOperation(PERM_MODIFY, 386 BOOL modifiable = item && gAgent.allowOperation(PERM_MODIFY,
365 item->getPermissions(), GP_OBJECT_MANIPULATE); 387 item->getPermissions(), GP_OBJECT_MANIPULATE);
366 previewEditor->setEnabled(modifiable); 388 preview->setEnabled(modifiable);
367 delete[] buffer; 389 delete[] buffer;
368 preview->mAssetStatus = PREVIEW_ASSET_LOADED; 390 preview->mAssetStatus = PREVIEW_ASSET_LOADED;
369 } 391 }
@@ -468,14 +490,43 @@ bool LLPreviewNotecard::saveIfNeeded(LLInventoryItem* copyitem)
468 LLInventoryItem* item = getItem(); 490 LLInventoryItem* item = getItem();
469 // save it out to database 491 // save it out to database
470 if (item) 492 if (item)
471 { 493 {
472 494 std::string agent_url = gAgent.getRegion()->getCapability("UpdateNotecardAgentInventory");
473 LLSaveNotecardInfo* info = new LLSaveNotecardInfo(this, mItemUUID, mObjectUUID, 495 std::string task_url = gAgent.getRegion()->getCapability("UpdateNotecardTaskInventory");
474 tid, copyitem); 496 if (mObjectUUID.isNull() && !agent_url.empty())
475 gAssetStorage->storeAssetData(tid, LLAssetType::AT_NOTECARD, 497 {
476 &onSaveComplete, 498 // Saving into agent inventory
477 (void*)info, 499 mAssetStatus = PREVIEW_ASSET_LOADING;
478 FALSE); 500 setEnabled(FALSE);
501 LLSD body;
502 body["item_id"] = mItemUUID;
503 llinfos << "Saving notecard " << mItemUUID
504 << " into agent inventory via " << agent_url << llendl;
505 LLHTTPClient::post(agent_url, body,
506 new LLUpdateAgentInventoryResponder(body, asset_id, LLAssetType::AT_NOTECARD));
507 }
508 else if (!mObjectUUID.isNull() && !task_url.empty())
509 {
510 // Saving into task inventory
511 mAssetStatus = PREVIEW_ASSET_LOADING;
512 setEnabled(FALSE);
513 LLSD body;
514 body["task_id"] = mObjectUUID;
515 body["item_id"] = mItemUUID;
516 llinfos << "Saving notecard " << mItemUUID << " into task "
517 << mObjectUUID << " via " << task_url << llendl;
518 LLHTTPClient::post(task_url, body,
519 new LLUpdateTaskInventoryResponder(body, asset_id, LLAssetType::AT_NOTECARD));
520 }
521 else if (gAssetStorage)
522 {
523 LLSaveNotecardInfo* info = new LLSaveNotecardInfo(this, mItemUUID, mObjectUUID,
524 tid, copyitem);
525 gAssetStorage->storeAssetData(tid, LLAssetType::AT_NOTECARD,
526 &onSaveComplete,
527 (void*)info,
528 FALSE);
529 }
479 } 530 }
480 } 531 }
481 return true; 532 return true;
@@ -551,10 +602,10 @@ void LLPreviewNotecard::onSaveComplete(const LLUUID& asset_uuid, void* user_data
551 gViewerWindow->alertXml("SaveNotecardFailReason",args); 602 gViewerWindow->alertXml("SaveNotecardFailReason",args);
552 } 603 }
553 604
554 char uuid_string[UUID_STR_LENGTH]; 605 char uuid_string[UUID_STR_LENGTH]; /*Flawfinder: ignore*/
555 asset_uuid.toString(uuid_string); 606 asset_uuid.toString(uuid_string);
556 char filename[LL_MAX_PATH]; 607 char filename[LL_MAX_PATH]; /*Flawfinder: ignore*/
557 sprintf(filename, "%s.tmp", gDirUtilp->getExpandedFilename(LL_PATH_CACHE,uuid_string).c_str()); 608 snprintf(filename, LL_MAX_PATH, "%s.tmp", gDirUtilp->getExpandedFilename(LL_PATH_CACHE,uuid_string).c_str()); /*Flawfinder: ignore*/
558 LLFile::remove(filename); 609 LLFile::remove(filename);
559 delete info; 610 delete info;
560} 611}
diff --git a/linden/indra/newview/llpreviewnotecard.h b/linden/indra/newview/llpreviewnotecard.h
index da3fc3f..9b72ec8 100644
--- a/linden/indra/newview/llpreviewnotecard.h
+++ b/linden/indra/newview/llpreviewnotecard.h
@@ -69,6 +69,14 @@ public:
69 const LLInventoryItem* getDragItem(); 69 const LLInventoryItem* getDragItem();
70 70
71 71
72 // return true if there is any embedded inventory.
73 bool hasEmbeddedInventory();
74
75 // After saving a notecard, the tcp based upload system will
76 // change the asset, therefore, we need to re-fetch it from the
77 // asset system. :(
78 void refreshFromInventory();
79
72protected: 80protected:
73 81
74 virtual void loadAsset(); 82 virtual void loadAsset();
diff --git a/linden/indra/newview/llpreviewscript.cpp b/linden/indra/newview/llpreviewscript.cpp
index c13da9b..75371b2 100644
--- a/linden/indra/newview/llpreviewscript.cpp
+++ b/linden/indra/newview/llpreviewscript.cpp
@@ -30,6 +30,7 @@
30#include "llpreviewscript.h" 30#include "llpreviewscript.h"
31 31
32#include "llassetstorage.h" 32#include "llassetstorage.h"
33#include "llassetuploadresponders.h"
33#include "llbutton.h" 34#include "llbutton.h"
34#include "llcheckboxctrl.h" 35#include "llcheckboxctrl.h"
35#include "llcombobox.h" 36#include "llcombobox.h"
@@ -155,7 +156,7 @@ public:
155 LLScriptEdCore* getEditorCore() { return mEditorCore; } 156 LLScriptEdCore* getEditorCore() { return mEditorCore; }
156 static LLFloaterScriptSearch* getInstance() { return sInstance; } 157 static LLFloaterScriptSearch* getInstance() { return sInstance; }
157 158
158 void open(); 159 void open(); /*Flawfinder: ignore*/
159 160
160private: 161private:
161 162
@@ -187,6 +188,18 @@ LLFloaterScriptSearch::LLFloaterScriptSearch(std::string title, LLRect rect, LLS
187 sInstance = this; 188 sInstance = this;
188 189
189 childSetFocus("search_text", TRUE); 190 childSetFocus("search_text", TRUE);
191
192 // find floater in which script panel is embedded
193 LLView* viewp = (LLView*)editor_core;
194 while(viewp)
195 {
196 if (viewp->getWidgetType() == WIDGET_TYPE_FLOATER)
197 {
198 ((LLFloater*)viewp)->addDependentFloater(this);
199 break;
200 }
201 viewp = viewp->getParent();
202 }
190} 203}
191 204
192//static 205//static
@@ -208,7 +221,7 @@ void LLFloaterScriptSearch::show(LLScriptEdCore* editor_core)
208 new LLFloaterScriptSearch("Script Search",LLRect(left,top,left + SCRIPT_SEARCH_WIDTH,top - SCRIPT_SEARCH_HEIGHT),editor_core); 221 new LLFloaterScriptSearch("Script Search",LLRect(left,top,left + SCRIPT_SEARCH_WIDTH,top - SCRIPT_SEARCH_HEIGHT),editor_core);
209 } 222 }
210 223
211 sInstance->open(); 224 sInstance->open(); /*Flawfinder: ignore*/
212} 225}
213 226
214LLFloaterScriptSearch::~LLFloaterScriptSearch() 227LLFloaterScriptSearch::~LLFloaterScriptSearch()
@@ -255,9 +268,9 @@ void LLFloaterScriptSearch::handleBtnReplaceAll()
255 mEditorCore->mEditor->replaceTextAll(childGetText("search_text"), childGetText("replace_text"), caseChk->get()); 268 mEditorCore->mEditor->replaceTextAll(childGetText("search_text"), childGetText("replace_text"), caseChk->get());
256} 269}
257 270
258void LLFloaterScriptSearch::open() 271void LLFloaterScriptSearch::open() /*Flawfinder: ignore*/
259{ 272{
260 LLFloater::open(); 273 LLFloater::open(); /*Flawfinder: ignore*/
261 childSetFocus("search_text", TRUE); 274 childSetFocus("search_text", TRUE);
262} 275}
263/// --------------------------------------------------------------------------- 276/// ---------------------------------------------------------------------------
@@ -428,8 +441,8 @@ void LLScriptEdCore::draw()
428 S32 line = 0; 441 S32 line = 0;
429 S32 column = 0; 442 S32 column = 0;
430 mEditor->getCurrentLineAndColumn( &line, &column, FALSE ); // don't include wordwrap 443 mEditor->getCurrentLineAndColumn( &line, &column, FALSE ); // don't include wordwrap
431 char cursor_pos[STD_STRING_BUF_SIZE]; 444 char cursor_pos[STD_STRING_BUF_SIZE]; /*Flawfinder: ignore*/
432 sprintf( cursor_pos, "Line %d, Column %d", line, column ); 445 snprintf( cursor_pos, STD_STRING_BUF_SIZE, "Line %d, Column %d", line, column ); /*Flawfinder: ignore*/
433 childSetText("line_col", cursor_pos); 446 childSetText("line_col", cursor_pos);
434 } 447 }
435 else 448 else
@@ -851,6 +864,33 @@ LLPreviewLSL::LLPreviewLSL(const std::string& name, const LLRect& rect,
851 } 864 }
852} 865}
853 866
867// virtual
868void LLPreviewLSL::callbackLSLCompileSucceeded()
869{
870 llinfos << "LSL Bytecode saved" << llendl;
871 mScriptEd->mErrorList->addSimpleItem("Compile successful!");
872 mScriptEd->mErrorList->addSimpleItem("Save complete.");
873 closeIfNeeded();
874}
875
876// virtual
877void LLPreviewLSL::callbackLSLCompileFailed(const LLSD& compile_errors)
878{
879 llinfos << "Compile failed!" << llendl;
880
881 const LLFontGL* err_font = gResMgr->getRes(LLFONT_OCRA);
882 LLScrollListItem* item = NULL;
883 for(LLSD::array_const_iterator line = compile_errors.beginArray();
884 line < compile_errors.endArray();
885 line++)
886 {
887 item = new LLScrollListItem();
888 item->addColumn(line->asString(), err_font);
889 mScriptEd->mErrorList->addItem(item);
890 }
891 mScriptEd->selectFirstError();
892 closeIfNeeded();
893}
854 894
855void LLPreviewLSL::loadAsset() 895void LLPreviewLSL::loadAsset()
856{ 896{
@@ -912,10 +952,21 @@ BOOL LLPreviewLSL::canClose()
912 return mScriptEd->canClose(); 952 return mScriptEd->canClose();
913} 953}
914 954
955void LLPreviewLSL::closeIfNeeded()
956{
957 // Find our window and close it if requested.
958 getWindow()->decBusyCount();
959 mPendingUploads--;
960 if (mPendingUploads <= 0 && mCloseAfterSave)
961 {
962 close();
963 }
964}
965
915//override the llpreview open which attempts to load asset, load after xml ui made 966//override the llpreview open which attempts to load asset, load after xml ui made
916void LLPreviewLSL::open() 967void LLPreviewLSL::open() /*Flawfinder: ignore*/
917{ 968{
918 LLFloater::open(); 969 LLFloater::open(); /*Flawfinder: ignore*/
919} 970}
920 971
921// static 972// static
@@ -933,152 +984,152 @@ void LLPreviewLSL::onSave(void* userdata, BOOL close_after_save)
933 self->saveIfNeeded(); 984 self->saveIfNeeded();
934} 985}
935 986
936
937// Save needs to compile the text in the buffer. If the compile 987// Save needs to compile the text in the buffer. If the compile
938// succeeds, then save both assets out to the database. If the compile 988// succeeds, then save both assets out to the database. If the compile
939// fails, go ahead and save the text anyway so that the user doesn't 989// fails, go ahead and save the text anyway so that the user doesn't
940// get too fucked. 990// get too fucked.
941void LLPreviewLSL::saveIfNeeded() 991void LLPreviewLSL::saveIfNeeded()
942{ 992{
943 // llinfos << "LLPreviewLSL::save()" << llendl; 993 // llinfos << "LLPreviewLSL::saveIfNeeded()" << llendl;
944 if(!mScriptEd->mEditor->isPristine()) 994 if(mScriptEd->mEditor->isPristine())
945 { 995 {
946 mPendingUploads = 0; 996 return;
947 mScriptEd->mErrorList->deleteAllItems(); 997 }
948 mScriptEd->mEditor->makePristine();
949
950 // We need to update the asset information
951 LLTransactionID tid;
952 LLAssetID uuid;
953 tid.generate();
954 uuid = tid.makeAssetID(gAgent.getSecureSessionID());
955 char uuid_string[UUID_STR_LENGTH];
956 uuid.toString(uuid_string);
957 char filename[LL_MAX_PATH];
958 sprintf(filename, "%s.lsl", gDirUtilp->getExpandedFilename(LL_PATH_CACHE,uuid_string).c_str());
959 FILE* fp = LLFile::fopen(filename, "wb");
960 if(!fp)
961 {
962 llwarns << "Unable to write to " << filename << llendl;
963 LLScrollListItem* item = new LLScrollListItem();
964 item->addColumn("Error writing to local file. Is your hard drive full?", LLFontGL::sSansSerifSmall);
965 mScriptEd->mErrorList->addItem(item);
966 return;
967 }
968 998
969 LLString utf8text = mScriptEd->mEditor->getText(); 999 mPendingUploads = 0;
970 //fprintf(fp, "%s|%s\n", LLAssetType::lookup(LLAssetType::AT_LSL_TEXT), 1000 mScriptEd->mErrorList->deleteAllItems();
971 //uuid_string); 1001 mScriptEd->mEditor->makePristine();
972 //fprintf(fp,"{\n%s}\n", text.c_str());
973 fputs(utf8text.c_str(), fp);
974 fclose(fp);
975 fp = NULL;
976 1002
977 // also write it out to the vfs for upload 1003 // save off asset into file
978 LLVFile file(gVFS, uuid, LLAssetType::AT_LSL_TEXT, LLVFile::APPEND); 1004 LLTransactionID tid;
979 S32 size = utf8text.length() + 1; 1005 tid.generate();
1006 LLAssetID asset_id = tid.makeAssetID(gAgent.getSecureSessionID());
1007 std::string filepath = gDirUtilp->getExpandedFilename(LL_PATH_CACHE,asset_id.asString());
1008 std::string filename = llformat("%s.lsl", filepath.c_str());
980 1009
981 file.setMaxSize(size); 1010 FILE* fp = LLFile::fopen(filename.c_str(), "wb");
982 file.write((U8*)utf8text.c_str(), size); 1011 if(!fp)
1012 {
1013 llwarns << "Unable to write to " << filename << llendl;
1014 LLScrollListItem* item = new LLScrollListItem();
1015 item->addColumn("Error writing to local file. Is your hard drive full?", LLFontGL::sSansSerifSmall);
1016 mScriptEd->mErrorList->addItem(item);
1017 return;
1018 }
983 1019
984 LLInventoryItem *inv_item = getItem(); 1020 LLString utf8text = mScriptEd->mEditor->getText();
1021 fputs(utf8text.c_str(), fp);
1022 fclose(fp);
1023 fp = NULL;
985 1024
986 // save it out to database 1025 LLInventoryItem *inv_item = getItem();
987 if(gAssetStorage && inv_item) 1026 // save it out to asset server
1027 std::string url = gAgent.getRegion()->getCapability("UpdateScriptAgentInventory");
1028 if(inv_item)
1029 {
1030 getWindow()->incBusyCount();
1031 mPendingUploads++;
1032 if (!url.empty())
988 { 1033 {
989 getWindow()->incBusyCount(); 1034 uploadAssetViaCaps(url, filename, mItemUUID);
990 mPendingUploads++; 1035 }
991 LLScriptSaveInfo* info = NULL; 1036 else if (gAssetStorage)
1037 {
1038 uploadAssetLegacy(filename, mItemUUID, tid);
1039 }
1040 }
1041}
992 1042
993 LLLineEditor* descEditor = LLUICtrlFactory::getLineEditorByName(this, "desc"); 1043void LLPreviewLSL::uploadAssetViaCaps(const std::string& url,
1044 const std::string& filename,
1045 const LLUUID& item_id)
1046{
1047 llinfos << "Update Agent Inventory via capability" << llendl;
1048 LLSD body;
1049 body["item_id"] = item_id;
1050 LLHTTPClient::post(url, body, new LLUpdateAgentInventoryResponder(body, filename));
1051}
994 1052
995 info = new LLScriptSaveInfo(mItemUUID, 1053void LLPreviewLSL::uploadAssetLegacy(const std::string& filename,
996 descEditor->getText(), 1054 const LLUUID& item_id,
997 tid); 1055 const LLTransactionID& tid)
998 gAssetStorage->storeAssetData(tid, LLAssetType::AT_LSL_TEXT, &LLPreviewLSL::onSaveComplete, info); 1056{
999 } 1057 LLLineEditor* descEditor = LLUICtrlFactory::getLineEditorByName(this, "desc");
1058 LLScriptSaveInfo* info = new LLScriptSaveInfo(item_id,
1059 descEditor->getText(),
1060 tid);
1061 gAssetStorage->storeAssetData(filename.c_str(), tid,
1062 LLAssetType::AT_LSL_TEXT,
1063 &LLPreviewLSL::onSaveComplete,
1064 info);
1000 1065
1001 char dst_filename[LL_MAX_PATH]; 1066 LLAssetID asset_id = tid.makeAssetID(gAgent.getSecureSessionID());
1002 sprintf(dst_filename, "%s.lso", gDirUtilp->getExpandedFilename(LL_PATH_CACHE,uuid_string).c_str()); 1067 std::string filepath = gDirUtilp->getExpandedFilename(LL_PATH_CACHE,asset_id.asString());
1003 char err_filename[LL_MAX_PATH]; 1068 std::string dst_filename = llformat("%s.lso", filepath.c_str());
1004 sprintf(err_filename, "%s.out", gDirUtilp->getExpandedFilename(LL_PATH_CACHE,uuid_string).c_str()); 1069 std::string err_filename = llformat("%s.out", filepath.c_str());
1005 LLScrollListItem* item = NULL;
1006 const LLFontGL* err_font = gResMgr->getRes(LLFONT_OCRA);
1007 if(!lscript_compile(filename, dst_filename, err_filename, gAgent.isGodlike()))
1008 {
1009 llinfos << "Compile failed!" << llendl;
1010 //char command[256];
1011 //sprintf(command, "type %s\n", err_filename);
1012 //system(command);
1013 1070
1014 // load the error file into the error scrolllist 1071 LLScrollListItem* item = NULL;
1015 if(NULL != (fp = LLFile::fopen(err_filename, "r"))) 1072 const LLFontGL* err_font = gResMgr->getRes(LLFONT_OCRA);
1073 if(!lscript_compile(filename.c_str(),
1074 dst_filename.c_str(),
1075 err_filename.c_str(),
1076 gAgent.isGodlike()))
1077 {
1078 llinfos << "Compile failed!" << llendl;
1079 //char command[256];
1080 //sprintf(command, "type %s\n", err_filename);
1081 //system(command);
1082
1083 // load the error file into the error scrolllist
1084 FILE* fp = LLFile::fopen(err_filename.c_str(), "r");
1085 if(fp)
1086 {
1087 char buffer[MAX_STRING]; /*Flawfinder: ignore*/
1088 LLString line;
1089 while(!feof(fp))
1016 { 1090 {
1017 char buffer[MAX_STRING]; 1091 fgets(buffer, MAX_STRING, fp);
1018 LLString line; 1092 if(feof(fp))
1019 while(!feof(fp))
1020 { 1093 {
1021 1094 break;
1022 fgets(buffer, MAX_STRING, fp);
1023 if(feof(fp))
1024 {
1025 break;
1026 }
1027 else if(!buffer)
1028 {
1029 continue;
1030 }
1031 else
1032 {
1033 line.assign(buffer);
1034 LLString::stripNonprintable(line);
1035 item = new LLScrollListItem();
1036 item->addColumn(line, err_font);
1037 mScriptEd->mErrorList->addItem(item);
1038 }
1039 } 1095 }
1040 fclose(fp); 1096 else if(!buffer)
1041 mScriptEd->selectFirstError();
1042 }
1043 }
1044 else
1045 {
1046 llinfos << "Compile worked!" << llendl;
1047 if(gAssetStorage)
1048 {
1049 // move the compiled file into the vfs for transport
1050 FILE* fp = LLFile::fopen(dst_filename, "rb");
1051 LLVFile file(gVFS, uuid, LLAssetType::AT_LSL_BYTECODE, LLVFile::APPEND);
1052
1053 fseek(fp, 0, SEEK_END);
1054 S32 size = ftell(fp);
1055 fseek(fp, 0, SEEK_SET);
1056
1057 file.setMaxSize(size);
1058
1059 const S32 buf_size = 65536;
1060 U8 copy_buf[buf_size];
1061 while ((size = fread(copy_buf, 1, buf_size, fp)))
1062 { 1097 {
1063 file.write(copy_buf, size); 1098 continue;
1099 }
1100 else
1101 {
1102 line.assign(buffer);
1103 LLString::stripNonprintable(line);
1104 item = new LLScrollListItem();
1105 item->addColumn(line, err_font);
1106 mScriptEd->mErrorList->addItem(item);
1064 } 1107 }
1065 fclose(fp);
1066 fp = NULL;
1067 getWindow()->incBusyCount();
1068 mPendingUploads++;
1069 LLUUID* this_uuid = new LLUUID(mItemUUID);
1070 gAssetStorage->storeAssetData(tid,
1071 LLAssetType::AT_LSL_BYTECODE,
1072 &LLPreviewLSL::onSaveBytecodeComplete,
1073 (void**)this_uuid);
1074 } 1108 }
1109 fclose(fp);
1110 mScriptEd->selectFirstError();
1111 }
1112 }
1113 else
1114 {
1115 llinfos << "Compile worked!" << llendl;
1116 if(gAssetStorage)
1117 {
1118 getWindow()->incBusyCount();
1119 mPendingUploads++;
1120 LLUUID* this_uuid = new LLUUID(mItemUUID);
1121 gAssetStorage->storeAssetData(dst_filename.c_str(),
1122 tid,
1123 LLAssetType::AT_LSL_BYTECODE,
1124 &LLPreviewLSL::onSaveBytecodeComplete,
1125 (void**)this_uuid);
1075 } 1126 }
1076
1077 // get rid of any temp files left lying around
1078 LLFile::remove(filename);
1079 LLFile::remove(err_filename);
1080 LLFile::remove(dst_filename);
1081 } 1127 }
1128
1129 // get rid of any temp files left lying around
1130 LLFile::remove(filename.c_str());
1131 LLFile::remove(err_filename.c_str());
1132 LLFile::remove(dst_filename.c_str());
1082} 1133}
1083 1134
1084 1135
@@ -1184,7 +1235,7 @@ void LLPreviewLSL::onLoadComplete( LLVFS *vfs, const LLUUID& asset_uuid, LLAsset
1184 S32 file_length = file.getSize(); 1235 S32 file_length = file.getSize();
1185 1236
1186 char* buffer = new char[file_length+1]; 1237 char* buffer = new char[file_length+1];
1187 file.read((U8*)buffer, file_length); 1238 file.read((U8*)buffer, file_length); /*Flawfinder: ignore*/
1188 1239
1189 // put a EOS at the end 1240 // put a EOS at the end
1190 buffer[file_length] = 0; 1241 buffer[file_length] = 0;
@@ -1287,7 +1338,7 @@ LLLiveLSLEditor::LLLiveLSLEditor(const std::string& name,
1287 const std::string& title, 1338 const std::string& title,
1288 const LLUUID& object_id, 1339 const LLUUID& object_id,
1289 const LLUUID& item_id) : 1340 const LLUUID& item_id) :
1290 LLFloater(name, rect, title, TRUE, SCRIPT_MIN_WIDTH, SCRIPT_MIN_HEIGHT), 1341 LLPreview(name, rect, title, item_id, object_id, TRUE, SCRIPT_MIN_WIDTH, SCRIPT_MIN_HEIGHT),
1291 mObjectID(object_id), 1342 mObjectID(object_id),
1292 mItemID(item_id), 1343 mItemID(item_id),
1293 mScriptEd(NULL), 1344 mScriptEd(NULL),
@@ -1346,6 +1397,40 @@ LLLiveLSLEditor::~LLLiveLSLEditor()
1346 LLLiveLSLEditor::sInstances.removeData(mItemID ^ mObjectID); 1397 LLLiveLSLEditor::sInstances.removeData(mItemID ^ mObjectID);
1347} 1398}
1348 1399
1400// this is called via LLPreview::loadAsset() virtual method
1401void LLLiveLSLEditor::loadAsset()
1402{
1403 loadAsset(FALSE);
1404}
1405
1406// virtual
1407void LLLiveLSLEditor::callbackLSLCompileSucceeded(const LLUUID& task_id,
1408 const LLUUID& item_id,
1409 bool is_script_running)
1410{
1411 lldebugs << "LSL Bytecode saved" << llendl;
1412 mScriptEd->mErrorList->addSimpleItem("Compile successful!");
1413 mScriptEd->mErrorList->addSimpleItem("Save complete.");
1414 closeIfNeeded();
1415}
1416
1417// virtual
1418void LLLiveLSLEditor::callbackLSLCompileFailed(const LLSD& compile_errors)
1419{
1420 lldebugs << "Compile failed!" << llendl;
1421 const LLFontGL* err_font = gResMgr->getRes(LLFONT_OCRA);
1422 LLScrollListItem* item = NULL;
1423 for(LLSD::array_const_iterator line = compile_errors.beginArray();
1424 line < compile_errors.endArray();
1425 line++)
1426 {
1427 item = new LLScrollListItem();
1428 item->addColumn(line->asString(), err_font);
1429 mScriptEd->mErrorList->addItem(item);
1430 }
1431 mScriptEd->selectFirstError();
1432 closeIfNeeded();
1433}
1349 1434
1350void LLLiveLSLEditor::loadAsset(BOOL is_new) 1435void LLLiveLSLEditor::loadAsset(BOOL is_new)
1351{ 1436{
@@ -1377,6 +1462,7 @@ void LLLiveLSLEditor::loadAsset(BOOL is_new)
1377 mScriptEd->mEditor->setText("You are not allowed to view this script."); 1462 mScriptEd->mEditor->setText("You are not allowed to view this script.");
1378 mScriptEd->mEditor->makePristine(); 1463 mScriptEd->mEditor->makePristine();
1379 mScriptEd->mEditor->setEnabled(FALSE); 1464 mScriptEd->mEditor->setEnabled(FALSE);
1465 mAssetStatus = PREVIEW_ASSET_LOADED;
1380 } 1466 }
1381 else if(mItem.notNull()) 1467 else if(mItem.notNull())
1382 { 1468 {
@@ -1400,11 +1486,13 @@ void LLLiveLSLEditor::loadAsset(BOOL is_new)
1400 msg->addUUIDFast(_PREHASH_ItemID, mItemID); 1486 msg->addUUIDFast(_PREHASH_ItemID, mItemID);
1401 msg->sendReliable(object->getRegion()->getHost()); 1487 msg->sendReliable(object->getRegion()->getHost());
1402 mAskedForRunningInfo = TRUE; 1488 mAskedForRunningInfo = TRUE;
1489 mAssetStatus = PREVIEW_ASSET_LOADING;
1403 } 1490 }
1404 else 1491 else
1405 { 1492 {
1406 mScriptEd->mEditor->setText(""); 1493 mScriptEd->mEditor->setText("");
1407 mScriptEd->mEditor->makePristine(); 1494 mScriptEd->mEditor->makePristine();
1495 mAssetStatus = PREVIEW_ASSET_LOADED;
1408 } 1496 }
1409 1497
1410 if(item 1498 if(item
@@ -1448,6 +1536,7 @@ void LLLiveLSLEditor::loadAsset(BOOL is_new)
1448 LLSaleInfo::DEFAULT, 1536 LLSaleInfo::DEFAULT,
1449 LLInventoryItem::II_FLAGS_NONE, 1537 LLInventoryItem::II_FLAGS_NONE,
1450 time_corrected()); 1538 time_corrected());
1539 mAssetStatus = PREVIEW_ASSET_LOADED;
1451 } 1540 }
1452} 1541}
1453 1542
@@ -1463,10 +1552,11 @@ void LLLiveLSLEditor::onLoadComplete(LLVFS *vfs, const LLUUID& asset_id,
1463 1552
1464 if( LLLiveLSLEditor::sInstances.checkData(*xored_id) ) 1553 if( LLLiveLSLEditor::sInstances.checkData(*xored_id) )
1465 { 1554 {
1555 instance = LLLiveLSLEditor::sInstances[*xored_id];
1466 if( LL_ERR_NOERR == status ) 1556 if( LL_ERR_NOERR == status )
1467 { 1557 {
1468 instance = LLLiveLSLEditor::sInstances[*xored_id];
1469 instance->loadScriptText(vfs, asset_id, type); 1558 instance->loadScriptText(vfs, asset_id, type);
1559 instance->mAssetStatus = PREVIEW_ASSET_LOADED;
1470 } 1560 }
1471 else 1561 else
1472 { 1562 {
@@ -1488,6 +1578,7 @@ void LLLiveLSLEditor::onLoadComplete(LLVFS *vfs, const LLUUID& asset_id,
1488 { 1578 {
1489 LLNotifyBox::showXml("UnableToLoadScript"); 1579 LLNotifyBox::showXml("UnableToLoadScript");
1490 } 1580 }
1581 instance->mAssetStatus = PREVIEW_ASSET_ERROR;
1491 } 1582 }
1492 } 1583 }
1493 1584
@@ -1496,7 +1587,11 @@ void LLLiveLSLEditor::onLoadComplete(LLVFS *vfs, const LLUUID& asset_id,
1496 1587
1497void LLLiveLSLEditor::loadScriptText(const char* filename) 1588void LLLiveLSLEditor::loadScriptText(const char* filename)
1498{ 1589{
1499 FILE* file = LLFile::fopen(filename, "rb"); 1590 if(!filename)
1591 {
1592 llerrs << "Filename is Empty!" << llendl;
1593 }
1594 FILE* file = LLFile::fopen(filename, "rb"); /*Flawfinder: ignore*/
1500 if(file) 1595 if(file)
1501 { 1596 {
1502 // read in the whole file 1597 // read in the whole file
@@ -1522,7 +1617,7 @@ void LLLiveLSLEditor::loadScriptText(LLVFS *vfs, const LLUUID &uuid, LLAssetType
1522 LLVFile file(vfs, uuid, type); 1617 LLVFile file(vfs, uuid, type);
1523 S32 file_length = file.getSize(); 1618 S32 file_length = file.getSize();
1524 char *buffer = new char[file_length + 1]; 1619 char *buffer = new char[file_length + 1];
1525 file.read((U8*)buffer, file_length); 1620 file.read((U8*)buffer, file_length); /*Flawfinder: ignore*/
1526 1621
1527 if (file.getLastBytesRead() != file_length || 1622 if (file.getLastBytesRead() != file_length ||
1528 file_length <= 0) 1623 file_length <= 0)
@@ -1680,18 +1775,16 @@ void LLLiveLSLEditor::saveIfNeeded()
1680 // set up the save on the local machine. 1775 // set up the save on the local machine.
1681 mScriptEd->mEditor->makePristine(); 1776 mScriptEd->mEditor->makePristine();
1682 LLTransactionID tid; 1777 LLTransactionID tid;
1683 LLAssetID uuid;
1684 tid.generate(); 1778 tid.generate();
1685 uuid = tid.makeAssetID(gAgent.getSecureSessionID()); 1779 LLAssetID asset_id = tid.makeAssetID(gAgent.getSecureSessionID());
1686 mItem->setAssetUUID(uuid); 1780 std::string filepath = gDirUtilp->getExpandedFilename(LL_PATH_CACHE,asset_id.asString());
1781 std::string filename = llformat("%s.lsl", filepath.c_str());
1782
1783 mItem->setAssetUUID(asset_id);
1687 mItem->setTransactionID(tid); 1784 mItem->setTransactionID(tid);
1688 1785
1689 // write out the data, and store it in the asset database 1786 // write out the data, and store it in the asset database
1690 char uuid_string[UUID_STR_LENGTH]; 1787 FILE* fp = LLFile::fopen(filename.c_str(), "wb");
1691 uuid.toString(uuid_string);
1692 char filename[LL_MAX_PATH];
1693 sprintf(filename, "%s.lsl", gDirUtilp->getExpandedFilename(LL_PATH_CACHE,uuid_string).c_str());
1694 FILE* fp = LLFile::fopen(filename, "wb");
1695 if(!fp) 1788 if(!fp)
1696 { 1789 {
1697 llwarns << "Unable to write to " << filename << llendl; 1790 llwarns << "Unable to write to " << filename << llendl;
@@ -1703,65 +1796,71 @@ void LLLiveLSLEditor::saveIfNeeded()
1703 LLString utf8text = mScriptEd->mEditor->getText(); 1796 LLString utf8text = mScriptEd->mEditor->getText();
1704 fputs(utf8text.c_str(), fp); 1797 fputs(utf8text.c_str(), fp);
1705 fclose(fp); 1798 fclose(fp);
1706 1799 fp = NULL;
1707 LLCheckBoxCtrl* runningCheckbox = LLUICtrlFactory::getCheckBoxByName(this, "running");
1708 1800
1709 // save it out to database 1801 // save it out to asset server
1710 if(gAssetStorage) 1802 std::string url = gAgent.getRegion()->getCapability("UpdateScriptTaskInventory");
1803 getWindow()->incBusyCount();
1804 mPendingUploads++;
1805 BOOL is_running = LLUICtrlFactory::getCheckBoxByName(this, "running")->get();
1806 if (!url.empty())
1711 { 1807 {
1712 // write it out to the vfs for upload 1808 uploadAssetViaCaps(url, filename, mObjectID,
1713 LLVFile file(gVFS, uuid, LLAssetType::AT_LSL_TEXT, LLVFile::APPEND); 1809 mItemID, is_running);
1714 S32 size = utf8text.length() + 1;
1715
1716 file.setMaxSize(size);
1717 file.write((U8*)utf8text.c_str(), size);
1718
1719 getWindow()->incBusyCount();
1720 mPendingUploads++;
1721 LLLiveLSLSaveData* data = new LLLiveLSLSaveData(mObjectID,
1722 mItem,
1723 runningCheckbox->get());
1724 gAssetStorage->storeAssetData(tid, LLAssetType::AT_LSL_TEXT, &onSaveTextComplete, (void*)data, FALSE);
1725 } 1810 }
1726 1811 else if (gAssetStorage)
1727#if LL_WINDOWS
1728 // This major hack was inserted because sometimes compilation
1729 // would fail because it couldn't open this file... I decided
1730 // to make a loop until open was successful. This seems to be
1731 // a problem specific to ntfs.
1732 fp = NULL;
1733 const U32 MAX_TRIES = 20;
1734 U32 tries = MAX_TRIES;
1735 while((!fp) && --tries)
1736 { 1812 {
1737 ms_sleep(17); 1813 uploadAssetLegacy(filename, object, tid, is_running);
1738 fp = LLFile::fopen(filename, "r");
1739 if(!fp)
1740 {
1741 llwarns << "Trying to open the source file " << filename
1742 << " again" << llendl;
1743 }
1744 else
1745 {
1746 fclose(fp);
1747 }
1748 } 1814 }
1749 fp = NULL; 1815}
1750#endif 1816
1817void LLLiveLSLEditor::uploadAssetViaCaps(const std::string& url,
1818 const std::string& filename,
1819 const LLUUID& task_id,
1820 const LLUUID& item_id,
1821 BOOL is_running)
1822{
1823 llinfos << "Update Task Inventory via capability" << llendl;
1824 LLSD body;
1825 body["task_id"] = task_id;
1826 body["item_id"] = item_id;
1827 body["is_script_running"] = is_running;
1828 LLHTTPClient::post(url, body,
1829 new LLUpdateTaskInventoryResponder(body, filename));
1830}
1831
1832void LLLiveLSLEditor::uploadAssetLegacy(const std::string& filename,
1833 LLViewerObject* object,
1834 const LLTransactionID& tid,
1835 BOOL is_running)
1836{
1837 LLLiveLSLSaveData* data = new LLLiveLSLSaveData(mObjectID,
1838 mItem,
1839 is_running);
1840 gAssetStorage->storeAssetData(filename.c_str(), tid,
1841 LLAssetType::AT_LSL_TEXT,
1842 &onSaveTextComplete,
1843 (void*)data,
1844 FALSE);
1845
1846 LLAssetID asset_id = tid.makeAssetID(gAgent.getSecureSessionID());
1847 std::string filepath = gDirUtilp->getExpandedFilename(LL_PATH_CACHE,asset_id.asString());
1848 std::string dst_filename = llformat("%s.lso", filepath.c_str());
1849 std::string err_filename = llformat("%s.out", filepath.c_str());
1751 1850
1752 char dst_filename[LL_MAX_PATH];
1753 sprintf(dst_filename, "%s.lso", gDirUtilp->getExpandedFilename(LL_PATH_CACHE,uuid_string).c_str());
1754 char err_filename[LL_MAX_PATH];
1755 sprintf(err_filename, "%s.out", gDirUtilp->getExpandedFilename(LL_PATH_CACHE,uuid_string).c_str());
1756 LLScrollListItem* item = NULL; 1851 LLScrollListItem* item = NULL;
1757 const LLFontGL* err_font = gResMgr->getRes(LLFONT_OCRA); 1852 const LLFontGL* err_font = gResMgr->getRes(LLFONT_OCRA);
1758 if(!lscript_compile(filename, dst_filename, err_filename, gAgent.isGodlike())) 1853 FILE *fp;
1854 if(!lscript_compile(filename.c_str(),
1855 dst_filename.c_str(),
1856 err_filename.c_str(),
1857 gAgent.isGodlike()))
1759 { 1858 {
1760 // load the error file into the error scrolllist 1859 // load the error file into the error scrolllist
1761 llinfos << "Compile failed!" << llendl; 1860 llinfos << "Compile failed!" << llendl;
1762 if(NULL != (fp = LLFile::fopen(err_filename, "r"))) 1861 if(NULL != (fp = LLFile::fopen(err_filename.c_str(), "r")))
1763 { 1862 {
1764 char buffer[MAX_STRING]; 1863 char buffer[MAX_STRING]; /*Flawfinder: ignore*/
1765 LLString line; 1864 LLString line;
1766 while(!feof(fp)) 1865 while(!feof(fp))
1767 { 1866 {
@@ -1801,33 +1900,14 @@ void LLLiveLSLEditor::saveIfNeeded()
1801 { 1900 {
1802 llinfos << "LLLiveLSLEditor::saveAsset " 1901 llinfos << "LLLiveLSLEditor::saveAsset "
1803 << mItem->getAssetUUID() << llendl; 1902 << mItem->getAssetUUID() << llendl;
1804
1805 // move the compiled file into the vfs for transport
1806 FILE* fp = LLFile::fopen(dst_filename, "rb");
1807 LLVFile file(gVFS, uuid, LLAssetType::AT_LSL_BYTECODE, LLVFile::APPEND);
1808
1809 fseek(fp, 0, SEEK_END);
1810 S32 size = ftell(fp);
1811 fseek(fp, 0, SEEK_SET);
1812
1813 file.setMaxSize(size);
1814
1815 const S32 buf_size = 65536;
1816 U8 copy_buf[buf_size];
1817 while ((size = fread(copy_buf, 1, buf_size, fp)))
1818 {
1819 file.write(copy_buf, size);
1820 }
1821 fclose(fp);
1822 fp = NULL;
1823
1824 getWindow()->incBusyCount(); 1903 getWindow()->incBusyCount();
1825 mPendingUploads++; 1904 mPendingUploads++;
1826 LLLiveLSLSaveData* data = NULL; 1905 LLLiveLSLSaveData* data = NULL;
1827 data = new LLLiveLSLSaveData(mObjectID, 1906 data = new LLLiveLSLSaveData(mObjectID,
1828 mItem, 1907 mItem,
1829 runningCheckbox->get()); 1908 is_running);
1830 gAssetStorage->storeAssetData(tid, 1909 gAssetStorage->storeAssetData(dst_filename.c_str(),
1910 tid,
1831 LLAssetType::AT_LSL_BYTECODE, 1911 LLAssetType::AT_LSL_BYTECODE,
1832 &LLLiveLSLEditor::onSaveBytecodeComplete, 1912 &LLLiveLSLEditor::onSaveBytecodeComplete,
1833 (void*)data); 1913 (void*)data);
@@ -1836,11 +1916,12 @@ void LLLiveLSLEditor::saveIfNeeded()
1836 } 1916 }
1837 1917
1838 // get rid of any temp files left lying around 1918 // get rid of any temp files left lying around
1839 LLFile::remove(filename); 1919 LLFile::remove(filename.c_str());
1840 LLFile::remove(err_filename); 1920 LLFile::remove(err_filename.c_str());
1841 LLFile::remove(dst_filename); 1921 LLFile::remove(dst_filename.c_str());
1842 1922
1843 // If we successfully saved it, then we should be able to check/uncheck the running box! 1923 // If we successfully saved it, then we should be able to check/uncheck the running box!
1924 LLCheckBoxCtrl* runningCheckbox = LLUICtrlFactory::getCheckBoxByName(this, "running");
1844 runningCheckbox->setLabel(ENABLED_RUNNING_CHECKBOX_LABEL); 1925 runningCheckbox->setLabel(ENABLED_RUNNING_CHECKBOX_LABEL);
1845 runningCheckbox->setEnabled(TRUE); 1926 runningCheckbox->setEnabled(TRUE);
1846} 1927}
@@ -1916,13 +1997,10 @@ void LLLiveLSLEditor::onSaveBytecodeComplete(const LLUUID& asset_uuid, void* use
1916 args["[REASON]"] = std::string(LLAssetStorage::getErrorString(status)); 1997 args["[REASON]"] = std::string(LLAssetStorage::getErrorString(status));
1917 gViewerWindow->alertXml("CompileQueueSaveBytecode", args); 1998 gViewerWindow->alertXml("CompileQueueSaveBytecode", args);
1918 } 1999 }
1919 char uuid_string[UUID_STR_LENGTH]; 2000
1920 data->mItem->getAssetUUID().toString(uuid_string); 2001 std::string filepath = gDirUtilp->getExpandedFilename(LL_PATH_CACHE,asset_uuid.asString());
1921 char dst_filename[LL_MAX_PATH]; 2002 std::string dst_filename = llformat("%s.lso", filepath.c_str());
1922 sprintf(dst_filename, "%s.lso", gDirUtilp->getExpandedFilename(LL_PATH_CACHE,uuid_string).c_str()); 2003 LLFile::remove(dst_filename.c_str());
1923 LLFile::remove(dst_filename);
1924 sprintf(dst_filename, "%s.lsl", gDirUtilp->getExpandedFilename(LL_PATH_CACHE,uuid_string).c_str());
1925 LLFile::remove(dst_filename);
1926 delete data; 2004 delete data;
1927} 2005}
1928 2006
@@ -1931,6 +2009,16 @@ BOOL LLLiveLSLEditor::canClose()
1931 return (mScriptEd->canClose()); 2009 return (mScriptEd->canClose());
1932} 2010}
1933 2011
2012void LLLiveLSLEditor::closeIfNeeded()
2013{
2014 getWindow()->decBusyCount();
2015 mPendingUploads--;
2016 if (mPendingUploads <= 0 && mCloseAfterSave)
2017 {
2018 close();
2019 }
2020}
2021
1934// static 2022// static
1935void LLLiveLSLEditor::onLoad(void* userdata) 2023void LLLiveLSLEditor::onLoad(void* userdata)
1936{ 2024{
@@ -1955,7 +2043,7 @@ LLLiveLSLEditor* LLLiveLSLEditor::show(const LLUUID& script_id, const LLUUID& ob
1955 { 2043 {
1956 // Move the existing view to the front 2044 // Move the existing view to the front
1957 instance = LLLiveLSLEditor::sInstances[xored_id]; 2045 instance = LLLiveLSLEditor::sInstances[xored_id];
1958 instance->open(); 2046 instance->open(); /*Flawfinder: ignore*/
1959 } 2047 }
1960 return instance; 2048 return instance;
1961} 2049}
@@ -1974,6 +2062,13 @@ void LLLiveLSLEditor::hide(const LLUUID& script_id, const LLUUID& object_id)
1974 delete instance; 2062 delete instance;
1975 } 2063 }
1976} 2064}
2065// static
2066LLLiveLSLEditor* LLLiveLSLEditor::find(const LLUUID& script_id, const LLUUID& object_id)
2067{
2068 LLUUID xored_id = script_id ^ object_id;
2069 return sInstances.getIfThere(xored_id);
2070}
2071
1977 2072
1978// static 2073// static
1979void LLLiveLSLEditor::processScriptRunningReply(LLMessageSystem* msg, void**) 2074void LLLiveLSLEditor::processScriptRunningReply(LLMessageSystem* msg, void**)
diff --git a/linden/indra/newview/llpreviewscript.h b/linden/indra/newview/llpreviewscript.h
index fd17388..cdc4df8 100644
--- a/linden/indra/newview/llpreviewscript.h
+++ b/linden/indra/newview/llpreviewscript.h
@@ -135,15 +135,24 @@ class LLPreviewLSL : public LLPreview
135public: 135public:
136 LLPreviewLSL(const std::string& name, const LLRect& rect, const std::string& title, 136 LLPreviewLSL(const std::string& name, const LLRect& rect, const std::string& title,
137 const LLUUID& item_uuid ); 137 const LLUUID& item_uuid );
138 virtual void callbackLSLCompileSucceeded();
139 virtual void callbackLSLCompileFailed(const LLSD& compile_errors);
138 140
139 /*virtual*/ void open(); 141 /*virtual*/ void open(); /*Flawfinder: ignore*/
140 142
141protected: 143protected:
142 virtual BOOL canClose(); 144 virtual BOOL canClose();
145 void closeIfNeeded();
143 virtual void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE); 146 virtual void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE);
144 147
145 virtual void loadAsset(); 148 virtual void loadAsset();
146 void saveIfNeeded(); 149 void saveIfNeeded();
150 void uploadAssetViaCaps(const std::string& url,
151 const std::string& filename,
152 const LLUUID& item_id);
153 void uploadAssetLegacy(const std::string& filename,
154 const LLUUID& item_id,
155 const LLTransactionID& tid);
147 156
148 static void onLoad(void* userdata); 157 static void onLoad(void* userdata);
149 static void onSave(void* userdata, BOOL close_after_save); 158 static void onSave(void* userdata, BOOL close_after_save);
@@ -166,7 +175,7 @@ protected:
166 175
167 176
168// Used to view and edit an LSL that is attached to an object. 177// Used to view and edit an LSL that is attached to an object.
169class LLLiveLSLEditor : public LLFloater 178class LLLiveLSLEditor : public LLPreview
170{ 179{
171public: 180public:
172 LLLiveLSLEditor(const std::string& name, const LLRect& rect, 181 LLLiveLSLEditor(const std::string& name, const LLRect& rect,
@@ -177,16 +186,33 @@ public:
177 186
178 static LLLiveLSLEditor* show(const LLUUID& item_id, const LLUUID& object_id); 187 static LLLiveLSLEditor* show(const LLUUID& item_id, const LLUUID& object_id);
179 static void hide(const LLUUID& item_id, const LLUUID& object_id); 188 static void hide(const LLUUID& item_id, const LLUUID& object_id);
189 static LLLiveLSLEditor* find(const LLUUID& item_id, const LLUUID& object_id);
180 190
181 static void processScriptRunningReply(LLMessageSystem* msg, void**); 191 static void processScriptRunningReply(LLMessageSystem* msg, void**);
182 192
193 virtual void callbackLSLCompileSucceeded(const LLUUID& task_id,
194 const LLUUID& item_id,
195 bool is_script_running);
196 virtual void callbackLSLCompileFailed(const LLSD& compile_errors);
197
183protected: 198protected:
184 virtual BOOL canClose(); 199 virtual BOOL canClose();
200 void closeIfNeeded();
185 virtual void draw(); 201 virtual void draw();
186 virtual void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE); 202 virtual void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE);
187 203
188 void loadAsset(BOOL is_new = FALSE); 204 virtual void loadAsset();
205 void loadAsset(BOOL is_new);
189 void saveIfNeeded(); 206 void saveIfNeeded();
207 void uploadAssetViaCaps(const std::string& url,
208 const std::string& filename,
209 const LLUUID& task_id,
210 const LLUUID& item_id,
211 BOOL is_running);
212 void uploadAssetLegacy(const std::string& filename,
213 LLViewerObject* object,
214 const LLTransactionID& tid,
215 BOOL is_running);
190 216
191 static void onLoad(void* userdata); 217 static void onLoad(void* userdata);
192 static void onSave(void* userdata, BOOL close_after_save); 218 static void onSave(void* userdata, BOOL close_after_save);
diff --git a/linden/indra/newview/llpreviewsound.cpp b/linden/indra/newview/llpreviewsound.cpp
index 76d41b0..10130db 100644
--- a/linden/indra/newview/llpreviewsound.cpp
+++ b/linden/indra/newview/llpreviewsound.cpp
@@ -35,6 +35,7 @@
35#include "audioengine.h" 35#include "audioengine.h"
36#include "llviewermessage.h" // send_guid_sound_trigger 36#include "llviewermessage.h" // send_guid_sound_trigger
37#include "llagent.h" // gAgent 37#include "llagent.h" // gAgent
38#include "lllineeditor.h"
38#include "llvieweruictrlfactory.h" 39#include "llvieweruictrlfactory.h"
39 40
40extern LLAudioEngine* gAudiop; 41extern LLAudioEngine* gAudiop;
diff --git a/linden/indra/newview/llpreviewtexture.cpp b/linden/indra/newview/llpreviewtexture.cpp
index 7948db4..99d0959 100644
--- a/linden/indra/newview/llpreviewtexture.cpp
+++ b/linden/indra/newview/llpreviewtexture.cpp
@@ -29,19 +29,21 @@
29 29
30#include "llpreviewtexture.h" 30#include "llpreviewtexture.h"
31 31
32#include "llviewerimage.h"
33#include "llviewerimagelist.h"
34#include "llresmgr.h"
35#include "llagent.h" 32#include "llagent.h"
36#include "llbutton.h" 33#include "llbutton.h"
37#include "llui.h" 34#include "llfilepicker.h"
35#include "llimagetga.h"
38#include "llinventoryview.h" 36#include "llinventoryview.h"
39#include "llinventory.h" 37#include "llinventory.h"
40#include "llviewerwindow.h" 38#include "llresmgr.h"
41#include "lltextbox.h" 39#include "lltextbox.h"
42#include "llimagetga.h" 40#include "lltextureview.h"
43#include "llfilepicker.h" 41#include "llui.h"
42#include "llviewerimage.h"
43#include "llviewerimagelist.h"
44#include "llvieweruictrlfactory.h" 44#include "llvieweruictrlfactory.h"
45#include "llviewerwindow.h"
46#include "lllineeditor.h"
45 47
46const S32 PREVIEW_TEXTURE_MIN_WIDTH = 300; 48const S32 PREVIEW_TEXTURE_MIN_WIDTH = 300;
47const S32 PREVIEW_TEXTURE_MIN_HEIGHT = 120; 49const S32 PREVIEW_TEXTURE_MIN_HEIGHT = 120;
@@ -185,6 +187,105 @@ void LLPreviewTexture::init()
185 } 187 }
186} 188}
187 189
190void LLPreviewTexture::draw()
191{
192 if( getVisible() )
193 {
194 updateAspectRatio();
195
196 LLPreview::draw();
197
198 if (!mMinimized)
199 {
200 LLGLSUIDefault gls_ui;
201 LLGLSNoTexture gls_notex;
202
203 const LLRect& border = mClientRect;
204 LLRect interior = mClientRect;
205 interior.stretch( -PREVIEW_BORDER_WIDTH );
206
207 // ...border
208 gl_rect_2d( border, LLColor4(0.f, 0.f, 0.f, 1.f));
209 gl_rect_2d_checkerboard( interior );
210
211 if ( mImage.notNull() )
212 {
213 LLGLSTexture gls_no_texture;
214 // Draw the texture
215 glColor3f( 1.f, 1.f, 1.f );
216 gl_draw_scaled_image(interior.mLeft,
217 interior.mBottom,
218 interior.getWidth(),
219 interior.getHeight(),
220 mImage);
221
222 // Pump the texture priority
223 F32 pixel_area = mLoadingFullImage ? (F32)MAX_IMAGE_AREA : (F32)(interior.getWidth() * interior.getHeight() );
224 mImage->addTextureStats( pixel_area );
225
226 // Don't bother decoding more than we can display, unless
227 // we're loading the full image.
228 if (!mLoadingFullImage)
229 {
230 S32 int_width = interior.getWidth();
231 S32 int_height = interior.getHeight();
232 mImage->setKnownDrawSize(int_width, int_height);
233 }
234 else
235 {
236 // Don't use this feature
237 mImage->setKnownDrawSize(0, 0);
238 }
239
240 if( mLoadingFullImage )
241 {
242 LLFontGL::sSansSerif->renderUTF8("Receiving:", 0,
243 interior.mLeft + 4,
244 interior.mBottom + 4,
245 LLColor4::white, LLFontGL::LEFT, LLFontGL::BOTTOM,
246 LLFontGL::DROP_SHADOW);
247
248 F32 data_progress = mImage->mDownloadProgress;
249
250 // Draw the progress bar.
251 const S32 BAR_HEIGHT = 12;
252 const S32 BAR_LEFT_PAD = 80;
253 S32 left = interior.mLeft + 4 + BAR_LEFT_PAD;
254 S32 bar_width = mRect.getWidth() - left - RESIZE_HANDLE_WIDTH - 2;
255 S32 top = interior.mBottom + 4 + BAR_HEIGHT;
256 S32 right = left + bar_width;
257 S32 bottom = top - BAR_HEIGHT;
258
259 LLColor4 background_color(0.f, 0.f, 0.f, 0.75f);
260 LLColor4 decoded_color(0.f, 1.f, 0.f, 1.0f);
261 LLColor4 downloaded_color(0.f, 0.5f, 0.f, 1.0f);
262
263 gl_rect_2d(left, top, right, bottom, background_color);
264
265 if (data_progress > 0.0f)
266 {
267 // Downloaded bytes
268 right = left + llfloor(data_progress * (F32)bar_width);
269 if (right > left)
270 {
271 gl_rect_2d(left, top, right, bottom, downloaded_color);
272 }
273 }
274 }
275 else
276 if( !mSavedFileTimer.hasExpired() )
277 {
278 LLFontGL::sSansSerif->renderUTF8("File Saved", 0,
279 interior.mLeft + 4,
280 interior.mBottom + 4,
281 LLColor4::white, LLFontGL::LEFT, LLFontGL::BOTTOM,
282 LLFontGL::DROP_SHADOW);
283 }
284 }
285 }
286 }
287}
288
188 289
189// virtual 290// virtual
190BOOL LLPreviewTexture::canSaveAs() 291BOOL LLPreviewTexture::canSaveAs()
@@ -330,43 +431,46 @@ void LLPreviewTexture::updateAspectRatio()
330 button_height = BTN_HEIGHT + PREVIEW_PAD; 431 button_height = BTN_HEIGHT + PREVIEW_PAD;
331 } 432 }
332 433
333 LLRect window_rect(0, mRect.getHeight(), mRect.getWidth(), 0); 434 if (client_height != mLastHeight || client_width != mLastWidth)
334 window_rect.mTop -= (PREVIEW_HEADER_SIZE + CLIENT_RECT_VPAD);
335 window_rect.mBottom += PREVIEW_BORDER + button_height + CLIENT_RECT_VPAD + info_height + CLIENT_RECT_VPAD;
336 LLMultiFloater* hostp = getHost();
337 if (hostp)
338 { 435 {
339 // try to keep aspect ratio when hosted, as hosting view can resize without user input 436 mLastWidth = client_width;
340 mClientRect.setLeftTopAndSize(window_rect.getCenterX() - (client_width / 2), window_rect.mTop, client_width, client_height); 437 mLastHeight = client_height;
341 }
342 else
343 {
344 mClientRect.setLeftTopAndSize(LLPANEL_BORDER_WIDTH + PREVIEW_PAD + 6,
345 mRect.getHeight() - (PREVIEW_HEADER_SIZE + CLIENT_RECT_VPAD),
346 mRect.getWidth() - horiz_pad,
347 mRect.getHeight() - (view_height - client_height) - 8);
348 }
349
350 if (mImage->mFullHeight > mLastHeight && mImage->mFullWidth > mLastWidth)
351 {
352 mLastWidth = image_width;
353 mLastHeight = image_height;
354 438
355 S32 old_top = mRect.mTop; 439 S32 old_top = mRect.mTop;
356 S32 old_left = mRect.mLeft; 440 S32 old_left = mRect.mLeft;
357 if (hostp) 441 if (getHost())
358 { 442 {
359 hostp->growToFit(this, view_width, view_height); 443 getHost()->growToFit(this, view_width, view_height);
360 } 444 }
361 else 445 else
362 { 446 {
363 reshape( view_width, view_height ); 447 reshape( view_width, view_height );
364 S32 new_bottom = old_top - mRect.getHeight(); 448 S32 new_bottom = old_top - mRect.getHeight();
365 setOrigin( old_left, new_bottom ); 449 setOrigin( old_left, new_bottom );
450 // Try to keep whole view onscreen, don't allow partial offscreen.
451 gFloaterView->adjustToFitScreen(this, FALSE);
366 } 452 }
453 }
454
455 // clamp texture size to fit within actual size of floater after attempting resize
456 client_width = llmin(client_width, mRect.getWidth() - horiz_pad);
457 client_height = llmin(client_height, mRect.getHeight() - PREVIEW_HEADER_SIZE - (2 * CLIENT_RECT_VPAD) - LLPANEL_BORDER_WIDTH - info_height);
367 458
368 // Try to keep whole view onscreen, don't allow partial offscreen. 459 LLRect window_rect(0, mRect.getHeight(), mRect.getWidth(), 0);
369 gFloaterView->adjustToFitScreen(this, FALSE); 460 window_rect.mTop -= (PREVIEW_HEADER_SIZE + CLIENT_RECT_VPAD);
461 window_rect.mBottom += PREVIEW_BORDER + button_height + CLIENT_RECT_VPAD + info_height + CLIENT_RECT_VPAD;
462
463 if (getHost())
464 {
465 // try to keep aspect ratio when hosted, as hosting view can resize without user input
466 mClientRect.setLeftTopAndSize(window_rect.getCenterX() - (client_width / 2), window_rect.mTop, client_width, client_height);
467 }
468 else
469 {
470 mClientRect.setLeftTopAndSize(LLPANEL_BORDER_WIDTH + PREVIEW_PAD + 6,
471 mRect.getHeight() - (PREVIEW_HEADER_SIZE + CLIENT_RECT_VPAD),
472 mRect.getWidth() - horiz_pad,
473 client_height);
370 } 474 }
371} 475}
372 476
diff --git a/linden/indra/newview/llprogressview.cpp b/linden/indra/newview/llprogressview.cpp
index 9e7f1a5..dd75c3f 100644
--- a/linden/indra/newview/llprogressview.cpp
+++ b/linden/indra/newview/llprogressview.cpp
@@ -39,8 +39,9 @@
39#include "llglheaders.h" 39#include "llglheaders.h"
40 40
41#include "llagent.h" 41#include "llagent.h"
42#include "llfocusmgr.h"
43#include "llbutton.h" 42#include "llbutton.h"
43#include "llfocusmgr.h"
44#include "llstartup.h"
44#include "llviewercontrol.h" 45#include "llviewercontrol.h"
45#include "llviewerimagelist.h" 46#include "llviewerimagelist.h"
46#include "llviewerwindow.h" 47#include "llviewerwindow.h"
@@ -48,9 +49,8 @@
48 49
49LLProgressView* LLProgressView::sInstance = NULL; 50LLProgressView* LLProgressView::sInstance = NULL;
50 51
51LLPointer<LLImageGL> gStartImageGL = NULL; 52S32 gStartImageWidth = 1;
52S32 gStartImageWidth = 1; 53S32 gStartImageHeight = 1;
53S32 gStartImageHeight = 1;
54const F32 FADE_IN_TIME = 1.f; 54const F32 FADE_IN_TIME = 1.f;
55 55
56const LLString ANIMATION_FILENAME = "Login Sequence "; 56const LLString ANIMATION_FILENAME = "Login Sequence ";
diff --git a/linden/indra/newview/llselectmgr.cpp b/linden/indra/newview/llselectmgr.cpp
index 9b13441..4e0cb17 100644
--- a/linden/indra/newview/llselectmgr.cpp
+++ b/linden/indra/newview/llselectmgr.cpp
@@ -122,6 +122,10 @@ LLColor4 LLSelectMgr::sHighlightParentColor;
122LLColor4 LLSelectMgr::sHighlightChildColor; 122LLColor4 LLSelectMgr::sHighlightChildColor;
123LLColor4 LLSelectMgr::sContextSilhouetteColor; 123LLColor4 LLSelectMgr::sContextSilhouetteColor;
124 124
125static LLObjectSelection* get_null_object_selection();
126template<>
127 const LLHandle<LLObjectSelection>::NullFunc
128 LLHandle<LLObjectSelection>::sNullFunc = get_null_object_selection;
125 129
126//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 130//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
127// struct LLDeRezInfo 131// struct LLDeRezInfo
@@ -146,6 +150,13 @@ struct LLDeRezInfo
146// Functions 150// Functions
147// 151//
148 152
153LLObjectSelection* get_null_object_selection()
154{
155 static LLObjectSelectionHandle null_ptr(new LLObjectSelection());
156 return (LLObjectSelection*)null_ptr;
157}
158
159
149//----------------------------------------------------------------------------- 160//-----------------------------------------------------------------------------
150// LLSelectMgr() 161// LLSelectMgr()
151//----------------------------------------------------------------------------- 162//-----------------------------------------------------------------------------
@@ -177,7 +188,9 @@ LLSelectMgr::LLSelectMgr()
177 gSavedSettings.setS32("GridMode", (S32)GRID_MODE_WORLD); 188 gSavedSettings.setS32("GridMode", (S32)GRID_MODE_WORLD);
178 mGridValid = FALSE; 189 mGridValid = FALSE;
179 190
180 mSelectType = SELECT_TYPE_WORLD; 191 mSelectedObjects = new LLObjectSelection();
192 mHoverObjects = new LLObjectSelection();
193 mHighlightedObjects = new LLObjectSelection();
181} 194}
182 195
183 196
@@ -186,78 +199,72 @@ LLSelectMgr::LLSelectMgr()
186//----------------------------------------------------------------------------- 199//-----------------------------------------------------------------------------
187LLSelectMgr::~LLSelectMgr() 200LLSelectMgr::~LLSelectMgr()
188{ 201{
189 mHoverObjects.deleteAllNodes(); 202 mHoverObjects->deleteAllNodes();
190 mSelectedObjects.deleteAllNodes(); 203 mSelectedObjects->deleteAllNodes();
191 mHighlightedObjects.deleteAllNodes(); 204 mHighlightedObjects->deleteAllNodes();
192 mRectSelectedObjects.clear(); 205 mRectSelectedObjects.clear();
193 mGridObjects.deleteAllNodes(); 206 mGridObjects.deleteAllNodes();
194 mUndoQueue.clear();
195 mRedoQueue.clear();
196}
197
198bool LLSelectMgr::applyToObjects(LLSelectedObjectFunctor* func)
199{
200 bool result = true;
201 LLViewerObject* object;
202 for (object = getFirstObject(); object != NULL; object = getNextObject())
203 {
204 result = result && func->apply(object);
205 }
206 return result;
207}
208
209bool LLSelectMgr::applyToRootObjects(LLSelectedObjectFunctor* func)
210{
211 bool result = true;
212 LLViewerObject* object;
213 for (object = getFirstRootObject();
214 object != NULL;
215 object = getNextRootObject())
216 {
217 result = result && func->apply(object);
218 }
219 return result;
220} 207}
221 208
222bool LLSelectMgr::applyToNodes(LLSelectedNodeFunctor *func) 209void LLSelectMgr::updateEffects()
223{ 210{
224 bool result = true; 211 if (mEffectsTimer.getElapsedTimeF32() > 1.f)
225 LLSelectNode* node;
226 for (node = getFirstNode(); node != NULL; node = getNextNode())
227 { 212 {
228 result = result && func->apply(node); 213 mSelectedObjects->updateEffects();
214 mEffectsTimer.reset();
229 } 215 }
230 return result;
231} 216}
232 217
233void LLSelectMgr::updateEffects() 218void LLSelectMgr::overrideObjectUpdates()
234{ 219{
235 if (mEffectsTimer.getElapsedTimeF32() > 1.f) 220 //override any position updates from simulator on objects being edited
221 LLSelectNode* selectNode;
222 for (selectNode = gSelectMgr->getSelection()->getFirstNode();
223 selectNode != NULL;
224 selectNode = gSelectMgr->getSelection()->getNextNode())
236 { 225 {
237 mSelectedObjects.updateEffects(); 226 LLViewerObject* object = selectNode->getObject();
238 mEffectsTimer.reset(); 227
228 if (object->permMove())
229 {
230 if (!selectNode->mLastPositionLocal.isExactlyZero())
231 {
232 object->setPosition(selectNode->mLastPositionLocal);
233 }
234 if (selectNode->mLastRotation != LLQuaternion())
235 {
236 object->setRotation(selectNode->mLastRotation);
237 }
238 if (!selectNode->mLastScale.isExactlyZero())
239 {
240 object->setScale(selectNode->mLastScale);
241 }
242 }
239 } 243 }
240} 244}
241 245
242//----------------------------------------------------------------------------- 246//-----------------------------------------------------------------------------
243// Select just the object, not any other group members. 247// Select just the object, not any other group members.
244//----------------------------------------------------------------------------- 248//-----------------------------------------------------------------------------
245void LLSelectMgr::selectObjectOnly(LLViewerObject* object, S32 face) 249LLObjectSelectionHandle LLSelectMgr::selectObjectOnly(LLViewerObject* object, S32 face)
246{ 250{
247 llassert( object ); 251 llassert( object );
248 252
253 //remember primary object
254 mSelectedObjects->mPrimaryObject = object;
255
249 // Don't add an object that is already in the list 256 // Don't add an object that is already in the list
250 if (object->isSelected() ) { 257 if (object->isSelected() ) {
251 // make sure point at position is updated 258 // make sure point at position is updated
252 updatePointAt(); 259 updatePointAt();
253 gEditMenuHandler = this; 260 gEditMenuHandler = this;
254 return; 261 return NULL;
255 } 262 }
256 263
257 if (!canSelectObject(object)) 264 if (!canSelectObject(object))
258 { 265 {
259 //make_ui_sound("UISndInvalidOp"); 266 //make_ui_sound("UISndInvalidOp");
260 return; 267 return NULL;
261 } 268 }
262 269
263 // llinfos << "Adding object to selected object list" << llendl; 270 // llinfos << "Adding object to selected object list" << llendl;
@@ -291,19 +298,24 @@ void LLSelectMgr::selectObjectOnly(LLViewerObject* object, S32 face)
291 298
292 // have selection manager handle edit menu immediately after 299 // have selection manager handle edit menu immediately after
293 // user selects an object 300 // user selects an object
294 if (getObjectCount()) 301 if (mSelectedObjects->getObjectCount())
295 { 302 {
296 gEditMenuHandler = this; 303 gEditMenuHandler = this;
297 } 304 }
305
306 return mSelectedObjects;
298} 307}
299 308
300//----------------------------------------------------------------------------- 309//-----------------------------------------------------------------------------
301// Select the object, parents and children. 310// Select the object, parents and children.
302//----------------------------------------------------------------------------- 311//-----------------------------------------------------------------------------
303void LLSelectMgr::selectObjectAndFamily(LLViewerObject* obj, BOOL add_to_end) 312LLObjectSelectionHandle LLSelectMgr::selectObjectAndFamily(LLViewerObject* obj, BOOL add_to_end)
304{ 313{
305 llassert( obj ); 314 llassert( obj );
306 315
316 //remember primary object
317 mSelectedObjects->mPrimaryObject = obj;
318
307 // This may be incorrect if things weren't family selected before... - djs 07/08/02 319 // This may be incorrect if things weren't family selected before... - djs 07/08/02
308 // Don't add an object that is already in the list 320 // Don't add an object that is already in the list
309 if (obj->isSelected() ) 321 if (obj->isSelected() )
@@ -311,13 +323,13 @@ void LLSelectMgr::selectObjectAndFamily(LLViewerObject* obj, BOOL add_to_end)
311 // make sure pointat position is updated 323 // make sure pointat position is updated
312 updatePointAt(); 324 updatePointAt();
313 gEditMenuHandler = this; 325 gEditMenuHandler = this;
314 return; 326 return NULL;
315 } 327 }
316 328
317 if (!canSelectObject(obj)) 329 if (!canSelectObject(obj))
318 { 330 {
319 //make_ui_sound("UISndInvalidOp"); 331 //make_ui_sound("UISndInvalidOp");
320 return; 332 return NULL;
321 } 333 }
322 334
323 // Since we're selecting a family, start at the root, but 335 // Since we're selecting a family, start at the root, but
@@ -366,16 +378,18 @@ void LLSelectMgr::selectObjectAndFamily(LLViewerObject* obj, BOOL add_to_end)
366 378
367 // have selection manager handle edit menu immediately after 379 // have selection manager handle edit menu immediately after
368 // user selects an object 380 // user selects an object
369 if (getObjectCount()) 381 if (mSelectedObjects->getObjectCount())
370 { 382 {
371 gEditMenuHandler = this; 383 gEditMenuHandler = this;
372 } 384 }
385
386 return mSelectedObjects;
373} 387}
374 388
375//----------------------------------------------------------------------------- 389//-----------------------------------------------------------------------------
376// Select the object, parents and children. 390// Select the object, parents and children.
377//----------------------------------------------------------------------------- 391//-----------------------------------------------------------------------------
378void LLSelectMgr::selectObjectAndFamily(const LLDynamicArray<LLViewerObject*>& object_list, 392LLObjectSelectionHandle LLSelectMgr::selectObjectAndFamily(const LLDynamicArray<LLViewerObject*>& object_list,
379 BOOL send_to_sim) 393 BOOL send_to_sim)
380{ 394{
381 // Collect all of the objects, children included 395 // Collect all of the objects, children included
@@ -383,7 +397,10 @@ void LLSelectMgr::selectObjectAndFamily(const LLDynamicArray<LLViewerObject*>& o
383 LLViewerObject *object; 397 LLViewerObject *object;
384 S32 i; 398 S32 i;
385 399
386 if (object_list.count() < 1) return; 400 //clear primary object (no primary object)
401 mSelectedObjects->mPrimaryObject = NULL;
402
403 if (object_list.count() < 1) return NULL;
387 404
388 // NOTE -- we add the objects in REVERSE ORDER 405 // NOTE -- we add the objects in REVERSE ORDER
389 // to preserve the order in the mSelectedObjects list 406 // to preserve the order in the mSelectedObjects list
@@ -429,25 +446,25 @@ void LLSelectMgr::selectObjectAndFamily(const LLDynamicArray<LLViewerObject*>& o
429 446
430 // have selection manager handle edit menu immediately after 447 // have selection manager handle edit menu immediately after
431 // user selects an object 448 // user selects an object
432 if (getObjectCount()) 449 if (mSelectedObjects->getObjectCount())
433 { 450 {
434 gEditMenuHandler = this; 451 gEditMenuHandler = this;
435 } 452 }
453
454 return mSelectedObjects;
436} 455}
437 456
438// Use for when the simulator kills an object. This version also 457// Use for when the simulator kills an object. This version also
439// handles informing the current tool of the object's deletion. 458// handles informing the current tool of the object's deletion.
440// 459//
441// Caller needs to call dialog_refresh_all if necessary. 460// Caller needs to call dialog_refresh_all if necessary.
442BOOL LLSelectMgr::selectionRemoveObject(const LLUUID &id) 461BOOL LLSelectMgr::removeObjectFromSelections(const LLUUID &id)
443{ 462{
444
445
446 BOOL object_found = FALSE; 463 BOOL object_found = FALSE;
447 LLTool *tool = NULL; 464 LLTool *tool = NULL;
448 if (!gNoRender) 465 if (!gNoRender)
449 { 466 {
450 tool = gToolMgr->getCurrentTool( gKeyboard->currentMask(TRUE) ); 467 tool = gToolMgr->getCurrentTool();
451 468
452 // It's possible that the tool is editing an object that is not selected 469 // It's possible that the tool is editing an object that is not selected
453 LLViewerObject* tool_editing_object = tool->getEditingObject(); 470 LLViewerObject* tool_editing_object = tool->getEditingObject();
@@ -462,13 +479,13 @@ BOOL LLSelectMgr::selectionRemoveObject(const LLUUID &id)
462 if( !object_found ) 479 if( !object_found )
463 { 480 {
464 LLViewerObject* prevobjp = NULL; 481 LLViewerObject* prevobjp = NULL;
465 for( LLViewerObject* tobjp = getFirstObject(); tobjp != NULL; tobjp = getNextObject() ) 482 for( LLViewerObject* tobjp = mSelectedObjects->getFirstObject(); tobjp != NULL; tobjp = mSelectedObjects->getNextObject() )
466 { 483 {
467 if (tobjp == prevobjp) 484 if (tobjp == prevobjp)
468 { 485 {
469 // Somehow we got stuck in an infinite loop... (DaveP) 486 // Somehow we got stuck in an infinite loop... (DaveP)
470 // this logic is kind of twisted, not sure how this is happening, so... 487 // this logic is kind of twisted, not sure how this is happening, so...
471 llwarns << "Detected infinite loop #1 in LLSelectMgr::selectionRemoveObject:|" << llendl; 488 llwarns << "Detected infinite loop #1 in LLSelectMgr::removeObjectFromSelections:|" << llendl;
472 //MikeS. adding warning and comment... 489 //MikeS. adding warning and comment...
473 //These infinite loops happen because the LLSelectMgr iteration routines are non-reentrant. 490 //These infinite loops happen because the LLSelectMgr iteration routines are non-reentrant.
474 //deselectObjectAndFamily uses getFirstObject and getNextObject to mess with the array, 491 //deselectObjectAndFamily uses getFirstObject and getNextObject to mess with the array,
@@ -492,7 +509,7 @@ BOOL LLSelectMgr::selectionRemoveObject(const LLUUID &id)
492 if(object_found == TRUE){ 509 if(object_found == TRUE){
493 //MikeS. adding warning... This happens when removing a linked attachment while sitting on an object.. 510 //MikeS. adding warning... This happens when removing a linked attachment while sitting on an object..
494 //I think the selection manager needs to be rewritten. BAD. 511 //I think the selection manager needs to be rewritten. BAD.
495 llwarns << "Detected infinite loop #2 in LLSelectMgr::selectionRemoveObject:|" << llendl; 512 llwarns << "Detected infinite loop #2 in LLSelectMgr::removeObjectFromSelections:|" << llendl;
496 break; 513 break;
497 } 514 }
498 object_found = TRUE; 515 object_found = TRUE;
@@ -613,11 +630,11 @@ void LLSelectMgr::addAsFamily(LLDynamicArray<LLViewerObject*>& objects, BOOL add
613 nodep = new LLSelectNode(objectp, TRUE); 630 nodep = new LLSelectNode(objectp, TRUE);
614 if (add_to_end) 631 if (add_to_end)
615 { 632 {
616 mSelectedObjects.addNodeAtEnd(nodep); 633 mSelectedObjects->addNodeAtEnd(nodep);
617 } 634 }
618 else 635 else
619 { 636 {
620 mSelectedObjects.addNode(nodep); 637 mSelectedObjects->addNode(nodep);
621 } 638 }
622 objectp->setSelected(TRUE); 639 objectp->setSelected(TRUE);
623 640
@@ -634,7 +651,7 @@ void LLSelectMgr::addAsFamily(LLDynamicArray<LLViewerObject*>& objects, BOOL add
634 { 651 {
635 // we want this object to be selected for real 652 // we want this object to be selected for real
636 // so clear transient flag 653 // so clear transient flag
637 LLSelectNode* select_node = findSelectNode(objectp); 654 LLSelectNode* select_node = mSelectedObjects->findNode(objectp);
638 if (select_node) 655 if (select_node)
639 { 656 {
640 select_node->setTransient(FALSE); 657 select_node->setTransient(FALSE);
@@ -650,21 +667,21 @@ void LLSelectMgr::addAsFamily(LLDynamicArray<LLViewerObject*>& objects, BOOL add
650void LLSelectMgr::addAsIndividual(LLViewerObject *objectp, S32 face, BOOL undoable) 667void LLSelectMgr::addAsIndividual(LLViewerObject *objectp, S32 face, BOOL undoable)
651{ 668{
652 // check to see if object is already in list 669 // check to see if object is already in list
653 LLSelectNode *nodep = findSelectNode(objectp); 670 LLSelectNode *nodep = mSelectedObjects->findNode(objectp);
654 671
655 // if not in list, add it 672 // if not in list, add it
656 if (!nodep) 673 if (!nodep)
657 { 674 {
658 nodep = new LLSelectNode(objectp, TRUE); 675 nodep = new LLSelectNode(objectp, TRUE);
659 mSelectedObjects.addNode(nodep); 676 mSelectedObjects->addNode(nodep);
660 } 677 }
661 else 678 else
662 { 679 {
663 // make this a full-fledged selection 680 // make this a full-fledged selection
664 nodep->setTransient(FALSE); 681 nodep->setTransient(FALSE);
665 // Move it to the front of the list 682 // Move it to the front of the list
666 mSelectedObjects.removeNode(nodep); 683 mSelectedObjects->removeNode(nodep);
667 mSelectedObjects.addNode(nodep); 684 mSelectedObjects->addNode(nodep);
668 } 685 }
669 686
670 // Make sure the object is tagged as selected 687 // Make sure the object is tagged as selected
@@ -698,26 +715,26 @@ void LLSelectMgr::addAsIndividual(LLViewerObject *objectp, S32 face, BOOL undoab
698} 715}
699 716
700 717
701void LLSelectMgr::setHoverObject(LLViewerObject *objectp) 718LLObjectSelectionHandle LLSelectMgr::setHoverObject(LLViewerObject *objectp)
702{ 719{
703 // Always blitz hover list when setting 720 // Always blitz hover list when setting
704 mHoverObjects.deleteAllNodes(); 721 mHoverObjects->deleteAllNodes();
705 722
706 if (!objectp) 723 if (!objectp)
707 { 724 {
708 return; 725 return NULL;
709 } 726 }
710 727
711 // Can't select yourself 728 // Can't select yourself
712 if (objectp->mID == gAgentID) 729 if (objectp->mID == gAgentID)
713 { 730 {
714 return; 731 return NULL;
715 } 732 }
716 733
717 // Can't select land 734 // Can't select land
718 if (objectp->getPCode() == LLViewerObject::LL_VO_SURFACE_PATCH) 735 if (objectp->getPCode() == LLViewerObject::LL_VO_SURFACE_PATCH)
719 { 736 {
720 return; 737 return NULL;
721 } 738 }
722 739
723 // Collect all of the objects 740 // Collect all of the objects
@@ -733,15 +750,16 @@ void LLSelectMgr::setHoverObject(LLViewerObject *objectp)
733 { 750 {
734 cur_objectp = objects[i]; 751 cur_objectp = objects[i];
735 nodep = new LLSelectNode(cur_objectp, FALSE); 752 nodep = new LLSelectNode(cur_objectp, FALSE);
736 mHoverObjects.addNodeAtEnd(nodep); 753 mHoverObjects->addNodeAtEnd(nodep);
737 } 754 }
738 755
739 requestObjectPropertiesFamily(objectp); 756 requestObjectPropertiesFamily(objectp);
757 return mHoverObjects;
740} 758}
741 759
742LLSelectNode *LLSelectMgr::getHoverNode() 760LLSelectNode *LLSelectMgr::getHoverNode()
743{ 761{
744 return getHoverObjects().getFirstRootNode(); 762 return getHoverObjects()->getFirstRootNode();
745} 763}
746 764
747void LLSelectMgr::highlightObjectOnly(LLViewerObject* objectp) 765void LLSelectMgr::highlightObjectOnly(LLViewerObject* objectp)
@@ -842,20 +860,23 @@ void LLSelectMgr::unhighlightObjectAndFamily(LLViewerObject* objectp)
842void LLSelectMgr::unhighlightAll() 860void LLSelectMgr::unhighlightAll()
843{ 861{
844 mRectSelectedObjects.clear(); 862 mRectSelectedObjects.clear();
845 mHighlightedObjects.deleteAllNodes(); 863 mHighlightedObjects->deleteAllNodes();
846} 864}
847 865
848void LLSelectMgr::selectHighlightedObjects() 866LLObjectSelectionHandle LLSelectMgr::selectHighlightedObjects()
849{ 867{
850 if (!mHighlightedObjects.getNumNodes()) 868 if (!mHighlightedObjects->getNumNodes())
851 { 869 {
852 return; 870 return NULL;
853 } 871 }
854 872
873 //clear primary object
874 mSelectedObjects->mPrimaryObject = NULL;
875
855 LLSelectNode *nodep; 876 LLSelectNode *nodep;
856 for (nodep = mHighlightedObjects.getFirstNode(); 877 for (nodep = mHighlightedObjects->getFirstNode();
857 nodep; 878 nodep;
858 nodep = mHighlightedObjects.getNextNode()) 879 nodep = mHighlightedObjects->getNextNode())
859 { 880 {
860 LLViewerObject* objectp = nodep->getObject(); 881 LLViewerObject* objectp = nodep->getObject();
861 882
@@ -871,12 +892,12 @@ void LLSelectMgr::selectHighlightedObjects()
871 } 892 }
872 893
873 LLSelectNode* new_nodep = new LLSelectNode(*nodep); 894 LLSelectNode* new_nodep = new LLSelectNode(*nodep);
874 mSelectedObjects.addNode(new_nodep); 895 mSelectedObjects->addNode(new_nodep);
875 896
876 // flag this object as selected 897 // flag this object as selected
877 objectp->setSelected(TRUE); 898 objectp->setSelected(TRUE);
878 899
879 mSelectType = getSelectTypeForObject(objectp); 900 mSelectedObjects->mSelectType = getSelectTypeForObject(objectp);
880 901
881 // request properties on root objects 902 // request properties on root objects
882 if (objectp->isRootEdit()) 903 if (objectp->isRootEdit())
@@ -892,10 +913,12 @@ void LLSelectMgr::selectHighlightedObjects()
892 saveSelectedObjectTransform(SELECT_ACTION_TYPE_PICK); 913 saveSelectedObjectTransform(SELECT_ACTION_TYPE_PICK);
893 updatePointAt(); 914 updatePointAt();
894 915
895 if (getObjectCount()) 916 if (mSelectedObjects->getObjectCount())
896 { 917 {
897 gEditMenuHandler = this; 918 gEditMenuHandler = this;
898 } 919 }
920
921 return mSelectedObjects;
899} 922}
900 923
901void LLSelectMgr::deselectHighlightedObjects() 924void LLSelectMgr::deselectHighlightedObjects()
@@ -957,7 +980,7 @@ void LLSelectMgr::getGrid(LLVector3& origin, LLQuaternion &rotation, LLVector3 &
957 grid_object = NULL; 980 grid_object = NULL;
958 } 981 }
959 982
960 if (mGridMode == GRID_MODE_LOCAL && gSelectMgr->getObjectCount()) 983 if (mGridMode == GRID_MODE_LOCAL && mSelectedObjects->getObjectCount())
961 { 984 {
962 LLBBox bbox = mSavedSelectionBBox; 985 LLBBox bbox = mSavedSelectionBBox;
963 mGridOrigin = mSavedSelectionBBox.getCenterAgent(); 986 mGridOrigin = mSavedSelectionBBox.getCenterAgent();
@@ -1011,18 +1034,18 @@ void LLSelectMgr::getGrid(LLVector3& origin, LLQuaternion &rotation, LLVector3 &
1011 } 1034 }
1012 else // GRID_MODE_WORLD or just plain default 1035 else // GRID_MODE_WORLD or just plain default
1013 { 1036 {
1014 LLViewerObject* first_object = gSelectMgr->getFirstRootObject(); 1037 LLViewerObject* first_object = mSelectedObjects->getFirstRootObject();
1015 if (!first_object) 1038 if (!first_object)
1016 { 1039 {
1017 first_object = gSelectMgr->getFirstObject(); 1040 first_object = mSelectedObjects->getFirstObject();
1018 } 1041 }
1019 1042
1020 mGridOrigin.clearVec(); 1043 mGridOrigin.clearVec();
1021 mGridRotation.loadIdentity(); 1044 mGridRotation.loadIdentity();
1022 1045
1023 mSelectType = getSelectTypeForObject( first_object ); 1046 mSelectedObjects->mSelectType = getSelectTypeForObject( first_object );
1024 1047
1025 switch (mSelectType) 1048 switch (mSelectedObjects->mSelectType)
1026 { 1049 {
1027 case SELECT_TYPE_ATTACHMENT: 1050 case SELECT_TYPE_ATTACHMENT:
1028 if (first_object) 1051 if (first_object)
@@ -1051,59 +1074,6 @@ void LLSelectMgr::getGrid(LLVector3& origin, LLQuaternion &rotation, LLVector3 &
1051 mGridValid = TRUE; 1074 mGridValid = TRUE;
1052} 1075}
1053 1076
1054
1055
1056LLSelectNode* LLSelectMgr::findSelectNode(LLViewerObject *object)
1057{
1058 return mSelectedObjects.findNode(object);
1059}
1060
1061//-----------------------------------------------------------------------------
1062// contains()
1063//-----------------------------------------------------------------------------
1064BOOL LLSelectMgr::contains(LLViewerObject* object)
1065{
1066 return mSelectedObjects.findNode(object) != NULL;
1067}
1068
1069
1070//-----------------------------------------------------------------------------
1071// contains()
1072//-----------------------------------------------------------------------------
1073BOOL LLSelectMgr::contains(LLViewerObject* object, S32 te)
1074{
1075 LLSelectNode *nodep;
1076 if (te == SELECT_ALL_TES)
1077 {
1078 // ...all faces
1079 for (nodep = mSelectedObjects.getFirstNode(); nodep; nodep = mSelectedObjects.getNextNode() )
1080 {
1081 if (nodep->getObject() == object)
1082 {
1083 BOOL all_selected = TRUE;
1084 for (S32 i = 0; i < SELECT_MAX_TES; i++)
1085 {
1086 all_selected = all_selected && nodep->isTESelected(i);
1087 }
1088 return all_selected;
1089 }
1090 }
1091 return FALSE;
1092 }
1093 else
1094 {
1095 // ...one face
1096 for (nodep = mSelectedObjects.getFirstNode(); nodep; nodep = mSelectedObjects.getNextNode() )
1097 {
1098 if (nodep->getObject() == object && nodep->isTESelected(te))
1099 {
1100 return TRUE;
1101 }
1102 }
1103 return FALSE;
1104 }
1105}
1106
1107//----------------------------------------------------------------------------- 1077//-----------------------------------------------------------------------------
1108// remove() - an array of objects 1078// remove() - an array of objects
1109//----------------------------------------------------------------------------- 1079//-----------------------------------------------------------------------------
@@ -1116,14 +1086,14 @@ void LLSelectMgr::remove(LLDynamicArray<LLViewerObject*>& objects)
1116 for(S32 i = 0; i < count; i++) 1086 for(S32 i = 0; i < count; i++)
1117 { 1087 {
1118 objectp = objects.get(i); 1088 objectp = objects.get(i);
1119 for(nodep = mSelectedObjects.getFirstNode(); 1089 for(nodep = mSelectedObjects->getFirstNode();
1120 nodep != NULL; 1090 nodep != NULL;
1121 nodep = mSelectedObjects.getNextNode()) 1091 nodep = mSelectedObjects->getNextNode())
1122 { 1092 {
1123 if(nodep->getObject() == objectp) 1093 if(nodep->getObject() == objectp)
1124 { 1094 {
1125 objectp->setSelected(FALSE); 1095 objectp->setSelected(FALSE);
1126 mSelectedObjects.removeNode(nodep); 1096 mSelectedObjects->removeNode(nodep);
1127 break; 1097 break;
1128 } 1098 }
1129 } 1099 }
@@ -1140,7 +1110,7 @@ void LLSelectMgr::remove(LLViewerObject *objectp, S32 te, BOOL undoable)
1140{ 1110{
1141 // check if object already in list 1111 // check if object already in list
1142 // *FIX: can we just check isSelected()? 1112 // *FIX: can we just check isSelected()?
1143 LLSelectNode *nodep = findSelectNode(objectp); 1113 LLSelectNode *nodep = mSelectedObjects->findNode(objectp);
1144 1114
1145 if (!nodep) 1115 if (!nodep)
1146 { 1116 {
@@ -1152,12 +1122,12 @@ void LLSelectMgr::remove(LLViewerObject *objectp, S32 te, BOOL undoable)
1152 if (objectp->getNumTEs() <= 0) 1122 if (objectp->getNumTEs() <= 0)
1153 { 1123 {
1154 // object doesn't have faces, so blow it away 1124 // object doesn't have faces, so blow it away
1155 mSelectedObjects.removeNode(nodep); 1125 mSelectedObjects->removeNode(nodep);
1156 objectp->setSelected( FALSE ); 1126 objectp->setSelected( FALSE );
1157 } 1127 }
1158 else if (te == SELECT_ALL_TES) 1128 else if (te == SELECT_ALL_TES)
1159 { 1129 {
1160 mSelectedObjects.removeNode(nodep); 1130 mSelectedObjects->removeNode(nodep);
1161 objectp->setSelected( FALSE ); 1131 objectp->setSelected( FALSE );
1162 } 1132 }
1163 else if (0 <= te && te < SELECT_MAX_TES) 1133 else if (0 <= te && te < SELECT_MAX_TES)
@@ -1183,7 +1153,7 @@ void LLSelectMgr::remove(LLViewerObject *objectp, S32 te, BOOL undoable)
1183 // ...all faces now turned off, so remove 1153 // ...all faces now turned off, so remove
1184 if (!found) 1154 if (!found)
1185 { 1155 {
1186 mSelectedObjects.removeNode(nodep); 1156 mSelectedObjects->removeNode(nodep);
1187 objectp->setSelected( FALSE ); 1157 objectp->setSelected( FALSE );
1188 1158
1189 // BUG: Doesn't update simulator that object is gone. 1159 // BUG: Doesn't update simulator that object is gone.
@@ -1206,12 +1176,12 @@ void LLSelectMgr::remove(LLViewerObject *objectp, S32 te, BOOL undoable)
1206void LLSelectMgr::removeAll() 1176void LLSelectMgr::removeAll()
1207{ 1177{
1208 LLViewerObject *objectp; 1178 LLViewerObject *objectp;
1209 for (objectp = mSelectedObjects.getFirstObject(); objectp; objectp = mSelectedObjects.getNextObject() ) 1179 for (objectp = mSelectedObjects->getFirstObject(); objectp; objectp = mSelectedObjects->getNextObject() )
1210 { 1180 {
1211 objectp->setSelected( FALSE ); 1181 objectp->setSelected( FALSE );
1212 } 1182 }
1213 1183
1214 mSelectedObjects.deleteAllNodes(); 1184 mSelectedObjects->deleteAllNodes();
1215 1185
1216 updateSelectionCenter(); 1186 updateSelectionCenter();
1217 dialog_refresh_all(); 1187 dialog_refresh_all();
@@ -1228,9 +1198,9 @@ void LLSelectMgr::promoteSelectionToRoot()
1228 1198
1229 LLSelectNode* nodep; 1199 LLSelectNode* nodep;
1230 LLViewerObject *objectp; 1200 LLViewerObject *objectp;
1231 for (nodep = mSelectedObjects.getFirstNode(); 1201 for (nodep = mSelectedObjects->getFirstNode();
1232 nodep; 1202 nodep;
1233 nodep = mSelectedObjects.getNextNode() ) 1203 nodep = mSelectedObjects->getNextNode() )
1234 { 1204 {
1235 if (nodep->mIndividualSelection) 1205 if (nodep->mIndividualSelection)
1236 { 1206 {
@@ -1266,9 +1236,9 @@ void LLSelectMgr::demoteSelectionToIndividuals()
1266{ 1236{
1267 LLDynamicArray<LLViewerObject*> objects; 1237 LLDynamicArray<LLViewerObject*> objects;
1268 1238
1269 for (LLViewerObject* root_objectp = mSelectedObjects.getFirstRootObject(); 1239 for (LLViewerObject* root_objectp = mSelectedObjects->getFirstRootObject();
1270 root_objectp; 1240 root_objectp;
1271 root_objectp = mSelectedObjects.getNextRootObject()) 1241 root_objectp = mSelectedObjects->getNextRootObject())
1272 { 1242 {
1273 root_objectp->addThisAndNonJointChildren(objects); 1243 root_objectp->addThisAndNonJointChildren(objects);
1274 } 1244 }
@@ -1284,71 +1254,20 @@ void LLSelectMgr::demoteSelectionToIndividuals()
1284} 1254}
1285 1255
1286//----------------------------------------------------------------------------- 1256//-----------------------------------------------------------------------------
1287// getObjectCount()
1288//-----------------------------------------------------------------------------
1289S32 LLSelectMgr::getObjectCount()
1290{
1291 return mSelectedObjects.getNumNodes();
1292}
1293
1294
1295//-----------------------------------------------------------------------------
1296// getTECount()
1297//-----------------------------------------------------------------------------
1298S32 LLSelectMgr::getTECount()
1299{
1300 S32 count = 0;
1301
1302 LLSelectNode* nodep;
1303 for (nodep = mSelectedObjects.getFirstNode(); nodep; nodep = mSelectedObjects.getNextNode() )
1304 {
1305 if (nodep->getObject())
1306 {
1307 S32 num_tes = nodep->getObject()->getNumTEs();
1308 for (S32 te = 0; te < num_tes; te++)
1309 {
1310 if (nodep->isTESelected(te))
1311 {
1312 count++;
1313 }
1314 }
1315 }
1316 }
1317
1318 return count;
1319}
1320
1321//-----------------------------------------------------------------------------
1322// getRootObjectCount()
1323//-----------------------------------------------------------------------------
1324S32 LLSelectMgr::getRootObjectCount()
1325{
1326 LLSelectNode *nodep;
1327
1328 S32 count = 0;
1329 for(nodep = mSelectedObjects.getFirstRootNode(); nodep; nodep = mSelectedObjects.getNextRootNode())
1330 {
1331 ++count;
1332 }
1333 return count;
1334}
1335
1336
1337//-----------------------------------------------------------------------------
1338// dump() 1257// dump()
1339//----------------------------------------------------------------------------- 1258//-----------------------------------------------------------------------------
1340void LLSelectMgr::dump() 1259void LLSelectMgr::dump()
1341{ 1260{
1342 llinfos << "Selection Manager: " << mSelectedObjects.getNumNodes() << " items" << llendl; 1261 llinfos << "Selection Manager: " << mSelectedObjects->getNumNodes() << " items" << llendl;
1343 1262
1344 llinfos << "TE mode " << mTEMode << llendl; 1263 llinfos << "TE mode " << mTEMode << llendl;
1345 1264
1346 S32 i = 0; 1265 S32 i = 0;
1347 1266
1348 LLViewerObject *objectp; 1267 LLViewerObject *objectp;
1349 for (objectp = mSelectedObjects.getFirstObject(); 1268 for (objectp = mSelectedObjects->getFirstObject();
1350 objectp; 1269 objectp;
1351 objectp = mSelectedObjects.getNextObject()) 1270 objectp = mSelectedObjects->getNextObject())
1352 { 1271 {
1353 llinfos << "Object " << i << " type " << LLPrimitive::pCodeToString(objectp->getPCode()) << llendl; 1272 llinfos << "Object " << i << " type " << LLPrimitive::pCodeToString(objectp->getPCode()) << llendl;
1354 llinfos << " hasLSL " << objectp->flagScripted() << llendl; 1273 llinfos << " hasLSL " << objectp->flagScripted() << llendl;
@@ -1366,14 +1285,14 @@ void LLSelectMgr::dump()
1366 1285
1367 // Face iterator 1286 // Face iterator
1368 S32 te; 1287 S32 te;
1369 for (mSelectedObjects.getFirstTE(&objectp, &te); 1288 for (mSelectedObjects->getFirstTE(&objectp, &te);
1370 objectp; 1289 objectp;
1371 mSelectedObjects.getNextTE(&objectp, &te)) 1290 mSelectedObjects->getNextTE(&objectp, &te))
1372 { 1291 {
1373 llinfos << "Object " << objectp << " te " << te << llendl; 1292 llinfos << "Object " << objectp << " te " << te << llendl;
1374 } 1293 }
1375 1294
1376 llinfos << mHighlightedObjects.getNumNodes() << " objects currently highlighted." << llendl; 1295 llinfos << mHighlightedObjects->getNumNodes() << " objects currently highlighted." << llendl;
1377 1296
1378 llinfos << "Center global " << mSelectionCenterGlobal << llendl; 1297 llinfos << "Center global " << mSelectionCenterGlobal << llendl;
1379} 1298}
@@ -1402,7 +1321,7 @@ void LLSelectMgr::selectionSetImage(const LLUUID& imageid)
1402 1321
1403 if(item 1322 if(item
1404 && !item->getPermissions().allowOperationBy(PERM_COPY, gAgent.getID()) 1323 && !item->getPermissions().allowOperationBy(PERM_COPY, gAgent.getID())
1405 && (mSelectedObjects.getNumNodes() > 1) ) 1324 && (mSelectedObjects->getNumNodes() > 1) )
1406 { 1325 {
1407 llwarns << "Attempted to apply no-copy texture to multiple objects" 1326 llwarns << "Attempted to apply no-copy texture to multiple objects"
1408 << llendl; 1327 << llendl;
@@ -1412,43 +1331,43 @@ void LLSelectMgr::selectionSetImage(const LLUUID& imageid)
1412 LLViewerObject* objectp; 1331 LLViewerObject* objectp;
1413 S32 te; 1332 S32 te;
1414 1333
1415 // Apply the texture to each side 1334 for (mSelectedObjects->getFirstTE(&objectp, &te); objectp; mSelectedObjects->getNextTE(&objectp, &te))
1416 for (mSelectedObjects.getFirstTE(&objectp, &te); objectp; mSelectedObjects.getNextTE(&objectp, &te))
1417 { 1335 {
1418
1419 if (item) 1336 if (item)
1420 { 1337 {
1421 LLToolDragAndDrop::dropTextureOneFace(objectp,te,item,LLToolDragAndDrop::SOURCE_AGENT,LLUUID::null); 1338 if (te == -1) // all faces
1422
1423 // HACK! HACK! ARG!
1424 // *TODO: Replace mSelectedObjects with a REAL container class!
1425 LLViewerObject* tmp_object;
1426 S32 tmp_te;
1427 mSelectedObjects.getCurrentTE(&tmp_object,&tmp_te);
1428 if ((tmp_object != objectp) || (tmp_te != te) )
1429 { 1339 {
1430 //AAARG someone has moved our list around! 1340 LLToolDragAndDrop::dropTextureAllFaces(objectp,
1431 mSelectedObjects.getFirstTE(&tmp_object, &tmp_te); 1341 item,
1432 while ((tmp_object != objectp) || (tmp_te != te)) 1342 LLToolDragAndDrop::SOURCE_AGENT,
1433 { 1343 LLUUID::null);
1434 mSelectedObjects.getNextTE(&tmp_object, &tmp_te); 1344 }
1435 } 1345 else // one face
1346 {
1347 LLToolDragAndDrop::dropTextureOneFace(objectp,
1348 te,
1349 item,
1350 LLToolDragAndDrop::SOURCE_AGENT,
1351 LLUUID::null);
1436 } 1352 }
1437 } 1353 }
1438 else 1354
1355 else // not an inventory item
1439 { 1356 {
1440 // Texture picker defaults aren't inventory items 1357 // Texture picker defaults aren't inventory items
1441 // * Don't need to worry about permissions for them 1358 // * Don't need to worry about permissions for them
1442 // * Can just apply the texture and be done with it. 1359 // * Can just apply the texture and be done with it.
1443 objectp->setTEImage(te, gImageList.getImage(imageid)); 1360 objectp->setTEImage(te, gImageList.getImage(imageid));
1361
1444 objectp->sendTEUpdate(); 1362 objectp->sendTEUpdate();
1445 } 1363 }
1446 } 1364 }
1447 1365
1366
1448 // 1 particle effect per object 1367 // 1 particle effect per object
1449 if (mSelectType != SELECT_TYPE_HUD) 1368 if (mSelectedObjects->mSelectType != SELECT_TYPE_HUD)
1450 { 1369 {
1451 for (objectp = mSelectedObjects.getFirstObject(); objectp; objectp = mSelectedObjects.getNextObject()) 1370 for (objectp = mSelectedObjects->getFirstObject(); objectp; objectp = mSelectedObjects->getNextObject())
1452 { 1371 {
1453 LLHUDEffectSpiral *effectp = (LLHUDEffectSpiral *)gHUDManager->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_BEAM, TRUE); 1372 LLHUDEffectSpiral *effectp = (LLHUDEffectSpiral *)gHUDManager->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_BEAM, TRUE);
1454 effectp->setSourceObject(gAgent.getAvatarObject()); 1373 effectp->setSourceObject(gAgent.getAvatarObject());
@@ -1466,7 +1385,7 @@ void LLSelectMgr::selectionSetColor(const LLColor4 &color)
1466{ 1385{
1467 LLViewerObject* object; 1386 LLViewerObject* object;
1468 S32 te; 1387 S32 te;
1469 for (mSelectedObjects.getFirstTE(&object, &te); object; mSelectedObjects.getNextTE(&object, &te) ) 1388 for (mSelectedObjects->getFirstTE(&object, &te); object; mSelectedObjects->getNextTE(&object, &te) )
1470 { 1389 {
1471 if (object->permModify()) 1390 if (object->permModify())
1472 { 1391 {
@@ -1475,7 +1394,7 @@ void LLSelectMgr::selectionSetColor(const LLColor4 &color)
1475 } 1394 }
1476 } 1395 }
1477 1396
1478 for ( object = mSelectedObjects.getFirstObject(); object; object = mSelectedObjects.getNextObject() ) 1397 for ( object = mSelectedObjects->getFirstObject(); object; object = mSelectedObjects->getNextObject() )
1479 { 1398 {
1480 if (object->permModify()) 1399 if (object->permModify())
1481 { 1400 {
@@ -1492,7 +1411,7 @@ void LLSelectMgr::selectionSetColorOnly(const LLColor4 &color)
1492 LLViewerObject* object; 1411 LLViewerObject* object;
1493 LLColor4 new_color = color; 1412 LLColor4 new_color = color;
1494 S32 te; 1413 S32 te;
1495 for (mSelectedObjects.getFirstTE(&object, &te); object; mSelectedObjects.getNextTE(&object, &te) ) 1414 for (mSelectedObjects->getFirstTE(&object, &te); object; mSelectedObjects->getNextTE(&object, &te) )
1496 { 1415 {
1497 if (object->permModify()) 1416 if (object->permModify())
1498 { 1417 {
@@ -1503,7 +1422,7 @@ void LLSelectMgr::selectionSetColorOnly(const LLColor4 &color)
1503 } 1422 }
1504 } 1423 }
1505 1424
1506 for ( object = mSelectedObjects.getFirstObject(); object; object = mSelectedObjects.getNextObject() ) 1425 for ( object = mSelectedObjects->getFirstObject(); object; object = mSelectedObjects->getNextObject() )
1507 { 1426 {
1508 if (object->permModify()) 1427 if (object->permModify())
1509 { 1428 {
@@ -1519,7 +1438,7 @@ void LLSelectMgr::selectionSetAlphaOnly(const F32 alpha)
1519{ 1438{
1520 LLViewerObject* object; 1439 LLViewerObject* object;
1521 S32 te; 1440 S32 te;
1522 for (mSelectedObjects.getFirstTE(&object, &te); object; mSelectedObjects.getNextTE(&object, &te) ) 1441 for (mSelectedObjects->getFirstTE(&object, &te); object; mSelectedObjects->getNextTE(&object, &te) )
1523 { 1442 {
1524 if (object->permModify()) 1443 if (object->permModify())
1525 { 1444 {
@@ -1530,7 +1449,7 @@ void LLSelectMgr::selectionSetAlphaOnly(const F32 alpha)
1530 } 1449 }
1531 } 1450 }
1532 1451
1533 for ( object = mSelectedObjects.getFirstObject(); object; object = mSelectedObjects.getNextObject() ) 1452 for ( object = mSelectedObjects->getFirstObject(); object; object = mSelectedObjects->getNextObject() )
1534 { 1453 {
1535 if (object->permModify()) 1454 if (object->permModify())
1536 { 1455 {
@@ -1544,11 +1463,11 @@ void LLSelectMgr::selectionRevertColors()
1544 LLViewerObject* object; 1463 LLViewerObject* object;
1545 S32 te; 1464 S32 te;
1546 1465
1547 for (mSelectedObjects.getFirstTE(&object, &te); object; mSelectedObjects.getNextTE(&object, &te) ) 1466 for (mSelectedObjects->getFirstTE(&object, &te); object; mSelectedObjects->getNextTE(&object, &te) )
1548 { 1467 {
1549 if (object->permModify()) 1468 if (object->permModify())
1550 { 1469 {
1551 LLSelectNode* nodep = mSelectedObjects.findNode(object); 1470 LLSelectNode* nodep = mSelectedObjects->findNode(object);
1552 if (nodep && te < (S32)nodep->mSavedColors.size()) 1471 if (nodep && te < (S32)nodep->mSavedColors.size())
1553 { 1472 {
1554 LLColor4 color = nodep->mSavedColors[te]; 1473 LLColor4 color = nodep->mSavedColors[te];
@@ -1558,7 +1477,7 @@ void LLSelectMgr::selectionRevertColors()
1558 } 1477 }
1559 } 1478 }
1560 1479
1561 for ( object = mSelectedObjects.getFirstObject(); object; object = mSelectedObjects.getNextObject() ) 1480 for ( object = mSelectedObjects->getFirstObject(); object; object = mSelectedObjects->getNextObject() )
1562 { 1481 {
1563 if (object->permModify()) 1482 if (object->permModify())
1564 { 1483 {
@@ -1573,11 +1492,11 @@ BOOL LLSelectMgr::selectionRevertTextures()
1573 S32 te; 1492 S32 te;
1574 1493
1575 BOOL revert_successful = TRUE; 1494 BOOL revert_successful = TRUE;
1576 for (mSelectedObjects.getFirstTE(&object, &te); object; mSelectedObjects.getNextTE(&object, &te) ) 1495 for (mSelectedObjects->getFirstTE(&object, &te); object; mSelectedObjects->getNextTE(&object, &te) )
1577 { 1496 {
1578 if (object->permModify()) 1497 if (object->permModify())
1579 { 1498 {
1580 LLSelectNode* nodep = mSelectedObjects.findNode(object); 1499 LLSelectNode* nodep = mSelectedObjects->findNode(object);
1581 if (nodep && te < (S32)nodep->mSavedTextures.size()) 1500 if (nodep && te < (S32)nodep->mSavedTextures.size())
1582 { 1501 {
1583 LLUUID id = nodep->mSavedTextures[te]; 1502 LLUUID id = nodep->mSavedTextures[te];
@@ -1596,7 +1515,7 @@ BOOL LLSelectMgr::selectionRevertTextures()
1596 } 1515 }
1597 1516
1598 // propagate texture changes to server 1517 // propagate texture changes to server
1599 for ( object = mSelectedObjects.getFirstObject(); object; object = mSelectedObjects.getNextObject() ) 1518 for ( object = mSelectedObjects->getFirstObject(); object; object = mSelectedObjects->getNextObject() )
1600 { 1519 {
1601 if (object->permModify()) 1520 if (object->permModify())
1602 { 1521 {
@@ -1611,7 +1530,7 @@ void LLSelectMgr::selectionSetBumpmap(U8 bumpmap)
1611{ 1530{
1612 LLViewerObject* object; 1531 LLViewerObject* object;
1613 S32 te; 1532 S32 te;
1614 for (mSelectedObjects.getFirstTE(&object, &te); object; mSelectedObjects.getNextTE(&object, &te) ) 1533 for (mSelectedObjects->getFirstTE(&object, &te); object; mSelectedObjects->getNextTE(&object, &te) )
1615 { 1534 {
1616 if (object->permModify()) 1535 if (object->permModify())
1617 { 1536 {
@@ -1620,7 +1539,7 @@ void LLSelectMgr::selectionSetBumpmap(U8 bumpmap)
1620 } 1539 }
1621 } 1540 }
1622 1541
1623 for ( object = mSelectedObjects.getFirstObject(); object; object = mSelectedObjects.getNextObject() ) 1542 for ( object = mSelectedObjects->getFirstObject(); object; object = mSelectedObjects->getNextObject() )
1624 { 1543 {
1625 if (object->permModify()) 1544 if (object->permModify())
1626 { 1545 {
@@ -1633,7 +1552,7 @@ void LLSelectMgr::selectionSetTexGen(U8 texgen)
1633{ 1552{
1634 LLViewerObject* object; 1553 LLViewerObject* object;
1635 S32 te; 1554 S32 te;
1636 for (mSelectedObjects.getFirstTE(&object, &te); object; mSelectedObjects.getNextTE(&object, &te) ) 1555 for (mSelectedObjects->getFirstTE(&object, &te); object; mSelectedObjects->getNextTE(&object, &te) )
1637 { 1556 {
1638 if (object->permModify()) 1557 if (object->permModify())
1639 { 1558 {
@@ -1642,7 +1561,7 @@ void LLSelectMgr::selectionSetTexGen(U8 texgen)
1642 } 1561 }
1643 } 1562 }
1644 1563
1645 for ( object = mSelectedObjects.getFirstObject(); object; object = mSelectedObjects.getNextObject() ) 1564 for ( object = mSelectedObjects->getFirstObject(); object; object = mSelectedObjects->getNextObject() )
1646 { 1565 {
1647 if (object->permModify()) 1566 if (object->permModify())
1648 { 1567 {
@@ -1656,7 +1575,7 @@ void LLSelectMgr::selectionSetShiny(U8 shiny)
1656{ 1575{
1657 LLViewerObject* object; 1576 LLViewerObject* object;
1658 S32 te; 1577 S32 te;
1659 for (mSelectedObjects.getFirstTE(&object, &te); object; mSelectedObjects.getNextTE(&object, &te) ) 1578 for (mSelectedObjects->getFirstTE(&object, &te); object; mSelectedObjects->getNextTE(&object, &te) )
1660 { 1579 {
1661 if (object->permModify()) 1580 if (object->permModify())
1662 { 1581 {
@@ -1665,7 +1584,7 @@ void LLSelectMgr::selectionSetShiny(U8 shiny)
1665 } 1584 }
1666 } 1585 }
1667 1586
1668 for ( object = mSelectedObjects.getFirstObject(); object; object = mSelectedObjects.getNextObject() ) 1587 for ( object = mSelectedObjects->getFirstObject(); object; object = mSelectedObjects->getNextObject() )
1669 { 1588 {
1670 if (object->permModify()) 1589 if (object->permModify())
1671 { 1590 {
@@ -1678,7 +1597,7 @@ void LLSelectMgr::selectionSetFullbright(U8 fullbright)
1678{ 1597{
1679 LLViewerObject* object; 1598 LLViewerObject* object;
1680 S32 te; 1599 S32 te;
1681 for (mSelectedObjects.getFirstTE(&object, &te); object; mSelectedObjects.getNextTE(&object, &te) ) 1600 for (mSelectedObjects->getFirstTE(&object, &te); object; mSelectedObjects->getNextTE(&object, &te) )
1682 { 1601 {
1683 if (object->permModify()) 1602 if (object->permModify())
1684 { 1603 {
@@ -1687,7 +1606,7 @@ void LLSelectMgr::selectionSetFullbright(U8 fullbright)
1687 } 1606 }
1688 } 1607 }
1689 1608
1690 for ( object = mSelectedObjects.getFirstObject(); object; object = mSelectedObjects.getNextObject() ) 1609 for ( object = mSelectedObjects->getFirstObject(); object; object = mSelectedObjects->getNextObject() )
1691 { 1610 {
1692 if (object->permModify()) 1611 if (object->permModify())
1693 { 1612 {
@@ -1718,7 +1637,7 @@ void LLSelectMgr::selectionSetMediaTypeAndURL(U8 media_type, const std::string&
1718 media_flags = LLTextureEntry::MF_WEB_PAGE; 1637 media_flags = LLTextureEntry::MF_WEB_PAGE;
1719 } 1638 }
1720 1639
1721 for (mSelectedObjects.getFirstTE(&object, &te); object; mSelectedObjects.getNextTE(&object, &te) ) 1640 for (mSelectedObjects->getFirstTE(&object, &te); object; mSelectedObjects->getNextTE(&object, &te) )
1722 { 1641 {
1723 if (object->permModify()) 1642 if (object->permModify())
1724 { 1643 {
@@ -1727,7 +1646,7 @@ void LLSelectMgr::selectionSetMediaTypeAndURL(U8 media_type, const std::string&
1727 } 1646 }
1728 } 1647 }
1729 1648
1730 for ( object = mSelectedObjects.getFirstObject(); object; object = mSelectedObjects.getNextObject() ) 1649 for ( object = mSelectedObjects->getFirstObject(); object; object = mSelectedObjects->getNextObject() )
1731 { 1650 {
1732 if (object->permModify()) 1651 if (object->permModify())
1733 { 1652 {
@@ -1749,7 +1668,7 @@ LLPermissions* LLSelectMgr::findObjectPermissions(const LLViewerObject* object)
1749{ 1668{
1750 LLSelectNode* nodep; 1669 LLSelectNode* nodep;
1751 1670
1752 for (nodep = mSelectedObjects.getFirstNode(); nodep; nodep = mSelectedObjects.getNextNode() ) 1671 for (nodep = mSelectedObjects->getFirstNode(); nodep; nodep = mSelectedObjects->getNextNode() )
1753 { 1672 {
1754 if((nodep->getObject() == object) && nodep->mValid) 1673 if((nodep->getObject() == object) && nodep->mValid)
1755 { 1674 {
@@ -1768,7 +1687,7 @@ BOOL LLSelectMgr::selectionGetTexUUID(LLUUID& id)
1768{ 1687{
1769 LLViewerObject* first_objectp; 1688 LLViewerObject* first_objectp;
1770 S32 first_te; 1689 S32 first_te;
1771 mSelectedObjects.getPrimaryTE(&first_objectp, &first_te); 1690 mSelectedObjects->getPrimaryTE(&first_objectp, &first_te);
1772 1691
1773 // nothing selected 1692 // nothing selected
1774 if (!first_objectp) 1693 if (!first_objectp)
@@ -1786,7 +1705,7 @@ BOOL LLSelectMgr::selectionGetTexUUID(LLUUID& id)
1786 BOOL identical = TRUE; 1705 BOOL identical = TRUE;
1787 LLViewerObject *objectp; 1706 LLViewerObject *objectp;
1788 S32 te; 1707 S32 te;
1789 for (mSelectedObjects.getFirstTE(&objectp, &te); objectp; mSelectedObjects.getNextTE(&objectp, &te) ) 1708 for (mSelectedObjects->getFirstTE(&objectp, &te); objectp; mSelectedObjects->getNextTE(&objectp, &te) )
1790 { 1709 {
1791 if (objectp->getTEImage(te) != first_imagep) 1710 if (objectp->getTEImage(te) != first_imagep)
1792 { 1711 {
@@ -1806,7 +1725,7 @@ BOOL LLSelectMgr::selectionGetColor(LLColor4 &color)
1806{ 1725{
1807 LLViewerObject* first_object; 1726 LLViewerObject* first_object;
1808 S32 first_te; 1727 S32 first_te;
1809 mSelectedObjects.getPrimaryTE(&first_object, &first_te); 1728 mSelectedObjects->getPrimaryTE(&first_object, &first_te);
1810 1729
1811 // nothing selected 1730 // nothing selected
1812 if (!first_object) 1731 if (!first_object)
@@ -1827,7 +1746,7 @@ BOOL LLSelectMgr::selectionGetColor(LLColor4 &color)
1827 BOOL identical = TRUE; 1746 BOOL identical = TRUE;
1828 LLViewerObject* object; 1747 LLViewerObject* object;
1829 S32 te; 1748 S32 te;
1830 for (mSelectedObjects.getFirstTE(&object, &te); object; mSelectedObjects.getNextTE(&object, &te)) 1749 for (mSelectedObjects->getFirstTE(&object, &te); object; mSelectedObjects->getNextTE(&object, &te))
1831 { 1750 {
1832 if (!object->getTE(te) || (object->getTE(te)->getColor() != first_color)) 1751 if (!object->getTE(te) || (object->getTE(te)->getColor() != first_color))
1833 { 1752 {
@@ -1848,7 +1767,7 @@ BOOL LLSelectMgr::selectionGetBumpmap(U8 *bumpmap)
1848{ 1767{
1849 LLViewerObject* first_object; 1768 LLViewerObject* first_object;
1850 S32 first_te; 1769 S32 first_te;
1851 mSelectedObjects.getPrimaryTE(&first_object, &first_te); 1770 mSelectedObjects->getPrimaryTE(&first_object, &first_te);
1852 1771
1853 // nothing selected 1772 // nothing selected
1854 if (!first_object) 1773 if (!first_object)
@@ -1869,7 +1788,7 @@ BOOL LLSelectMgr::selectionGetBumpmap(U8 *bumpmap)
1869 BOOL identical = TRUE; 1788 BOOL identical = TRUE;
1870 LLViewerObject* object; 1789 LLViewerObject* object;
1871 S32 te; 1790 S32 te;
1872 for (mSelectedObjects.getFirstTE(&object, &te); object; mSelectedObjects.getNextTE(&object, &te)) 1791 for (mSelectedObjects->getFirstTE(&object, &te); object; mSelectedObjects->getNextTE(&object, &te))
1873 { 1792 {
1874 if (!object->getTE(te) || (object->getTE(te)->getBumpmap() != first_value)) 1793 if (!object->getTE(te) || (object->getTE(te)->getBumpmap() != first_value))
1875 { 1794 {
@@ -1889,7 +1808,7 @@ BOOL LLSelectMgr::selectionGetShiny(U8 *shiny)
1889{ 1808{
1890 LLViewerObject* first_object; 1809 LLViewerObject* first_object;
1891 S32 first_te; 1810 S32 first_te;
1892 mSelectedObjects.getPrimaryTE(&first_object, &first_te); 1811 mSelectedObjects->getPrimaryTE(&first_object, &first_te);
1893 1812
1894 // nothing selected 1813 // nothing selected
1895 if (!first_object) 1814 if (!first_object)
@@ -1910,7 +1829,7 @@ BOOL LLSelectMgr::selectionGetShiny(U8 *shiny)
1910 BOOL identical = TRUE; 1829 BOOL identical = TRUE;
1911 LLViewerObject* object; 1830 LLViewerObject* object;
1912 S32 te; 1831 S32 te;
1913 for (mSelectedObjects.getFirstTE(&object, &te); object; mSelectedObjects.getNextTE(&object, &te)) 1832 for (mSelectedObjects->getFirstTE(&object, &te); object; mSelectedObjects->getNextTE(&object, &te))
1914 { 1833 {
1915 if (!object->getTE(te) || (object->getTE(te)->getShiny() != first_value)) 1834 if (!object->getTE(te) || (object->getTE(te)->getShiny() != first_value))
1916 { 1835 {
@@ -1930,7 +1849,7 @@ BOOL LLSelectMgr::selectionGetFullbright(U8 *fullbright)
1930{ 1849{
1931 LLViewerObject* first_object; 1850 LLViewerObject* first_object;
1932 S32 first_te; 1851 S32 first_te;
1933 mSelectedObjects.getPrimaryTE(&first_object, &first_te); 1852 mSelectedObjects->getPrimaryTE(&first_object, &first_te);
1934 1853
1935 // nothing selected 1854 // nothing selected
1936 if (!first_object) 1855 if (!first_object)
@@ -1951,7 +1870,7 @@ BOOL LLSelectMgr::selectionGetFullbright(U8 *fullbright)
1951 BOOL identical = TRUE; 1870 BOOL identical = TRUE;
1952 LLViewerObject* object; 1871 LLViewerObject* object;
1953 S32 te; 1872 S32 te;
1954 for (mSelectedObjects.getFirstTE(&object, &te); object; mSelectedObjects.getNextTE(&object, &te)) 1873 for (mSelectedObjects->getFirstTE(&object, &te); object; mSelectedObjects->getNextTE(&object, &te))
1955 { 1874 {
1956 if (!object->getTE(te) || (object->getTE(te)->getFullbright() != first_value)) 1875 if (!object->getTE(te) || (object->getTE(te)->getFullbright() != first_value))
1957 { 1876 {
@@ -1969,7 +1888,7 @@ bool LLSelectMgr::selectionGetMediaType(U8 *media_type)
1969{ 1888{
1970 LLViewerObject* first_object; 1889 LLViewerObject* first_object;
1971 S32 first_te; 1890 S32 first_te;
1972 mSelectedObjects.getPrimaryTE(&first_object, &first_te); 1891 mSelectedObjects->getPrimaryTE(&first_object, &first_te);
1973 1892
1974 // nothing selected 1893 // nothing selected
1975 if (!first_object) 1894 if (!first_object)
@@ -1990,7 +1909,7 @@ bool LLSelectMgr::selectionGetMediaType(U8 *media_type)
1990 bool identical = true; 1909 bool identical = true;
1991 LLViewerObject* object; 1910 LLViewerObject* object;
1992 S32 te; 1911 S32 te;
1993 for (mSelectedObjects.getFirstTE(&object, &te); object; mSelectedObjects.getNextTE(&object, &te)) 1912 for (mSelectedObjects->getFirstTE(&object, &te); object; mSelectedObjects->getNextTE(&object, &te))
1994 { 1913 {
1995 if (!object->getTE(te) || (object->getTE(te)->getMediaFlags() != first_value)) 1914 if (!object->getTE(te) || (object->getTE(te)->getMediaFlags() != first_value))
1996 { 1915 {
@@ -2011,7 +1930,7 @@ bool LLSelectMgr::selectionGetMediaType(U8 *media_type)
2011void LLSelectMgr::selectionSetMaterial(U8 material) 1930void LLSelectMgr::selectionSetMaterial(U8 material)
2012{ 1931{
2013 LLViewerObject* object; 1932 LLViewerObject* object;
2014 for (object = mSelectedObjects.getFirstObject(); object != NULL; object = mSelectedObjects.getNextObject() ) 1933 for (object = mSelectedObjects->getFirstObject(); object != NULL; object = mSelectedObjects->getNextObject() )
2015 { 1934 {
2016 if (object->permModify()) 1935 if (object->permModify())
2017 { 1936 {
@@ -2027,7 +1946,7 @@ void LLSelectMgr::selectionSetMaterial(U8 material)
2027BOOL LLSelectMgr::selectionAllPCode(LLPCode code) 1946BOOL LLSelectMgr::selectionAllPCode(LLPCode code)
2028{ 1947{
2029 LLViewerObject *object; 1948 LLViewerObject *object;
2030 for ( object = mSelectedObjects.getFirstObject(); object; object = mSelectedObjects.getNextObject() ) 1949 for ( object = mSelectedObjects->getFirstObject(); object; object = mSelectedObjects->getNextObject() )
2031 { 1950 {
2032 if (object->getPCode() != code) 1951 if (object->getPCode() != code)
2033 { 1952 {
@@ -2042,13 +1961,13 @@ BOOL LLSelectMgr::selectionAllPCode(LLPCode code)
2042//----------------------------------------------------------------------------- 1961//-----------------------------------------------------------------------------
2043BOOL LLSelectMgr::selectionGetMaterial(U8 *out_material) 1962BOOL LLSelectMgr::selectionGetMaterial(U8 *out_material)
2044{ 1963{
2045 LLViewerObject *object = mSelectedObjects.getFirstObject(); 1964 LLViewerObject *object = mSelectedObjects->getFirstObject();
2046 if (!object) return FALSE; 1965 if (!object) return FALSE;
2047 1966
2048 U8 material = object->getMaterial(); 1967 U8 material = object->getMaterial();
2049 1968
2050 BOOL identical = TRUE; 1969 BOOL identical = TRUE;
2051 for ( object = mSelectedObjects.getFirstObject(); object; object = mSelectedObjects.getNextObject() ) 1970 for ( object = mSelectedObjects->getFirstObject(); object; object = mSelectedObjects->getNextObject() )
2052 { 1971 {
2053 if ( material != object->getMaterial()) 1972 if ( material != object->getMaterial())
2054 { 1973 {
@@ -2063,13 +1982,13 @@ BOOL LLSelectMgr::selectionGetMaterial(U8 *out_material)
2063 1982
2064BOOL LLSelectMgr::selectionGetClickAction(U8 *out_action) 1983BOOL LLSelectMgr::selectionGetClickAction(U8 *out_action)
2065{ 1984{
2066 LLViewerObject *object = mSelectedObjects.getFirstObject(); 1985 LLViewerObject *object = mSelectedObjects->getFirstObject();
2067 if (!object) return FALSE; 1986 if (!object) return FALSE;
2068 1987
2069 U8 action = object->getClickAction(); 1988 U8 action = object->getClickAction();
2070 1989
2071 BOOL identical = TRUE; 1990 BOOL identical = TRUE;
2072 for ( object = mSelectedObjects.getFirstObject(); object; object = mSelectedObjects.getNextObject() ) 1991 for ( object = mSelectedObjects->getFirstObject(); object; object = mSelectedObjects->getNextObject() )
2073 { 1992 {
2074 if ( action != object->getClickAction()) 1993 if ( action != object->getClickAction())
2075 { 1994 {
@@ -2085,7 +2004,7 @@ BOOL LLSelectMgr::selectionGetClickAction(U8 *out_action)
2085void LLSelectMgr::selectionSetClickAction(U8 action) 2004void LLSelectMgr::selectionSetClickAction(U8 action)
2086{ 2005{
2087 LLViewerObject* object = NULL; 2006 LLViewerObject* object = NULL;
2088 for ( object = mSelectedObjects.getFirstObject(); object; object = mSelectedObjects.getNextObject() ) 2007 for ( object = mSelectedObjects->getFirstObject(); object; object = mSelectedObjects->getNextObject() )
2089 { 2008 {
2090 object->setClickAction(action); 2009 object->setClickAction(action);
2091 } 2010 }
@@ -2118,7 +2037,7 @@ void LLSelectMgr::sendGodlikeRequest(const LLString& request, const LLString& pa
2118 } 2037 }
2119 2038
2120 godlike_request_t data(request, param); 2039 godlike_request_t data(request, param);
2121 if(!getRootObjectCount()) 2040 if(!mSelectedObjects->getRootObjectCount())
2122 { 2041 {
2123 LLMessageSystem* msg = gMessageSystem; 2042 LLMessageSystem* msg = gMessageSystem;
2124 msg->newMessage(message_type.c_str()); 2043 msg->newMessage(message_type.c_str());
@@ -2158,8 +2077,8 @@ void LLSelectMgr::packGodlikeHead(void* user_data)
2158// static 2077// static
2159void LLSelectMgr::packObjectIDAsParam(LLSelectNode* node, void *) 2078void LLSelectMgr::packObjectIDAsParam(LLSelectNode* node, void *)
2160{ 2079{
2161 char buf [MAX_STRING]; 2080 char buf [MAX_STRING]; /* Flawfinder: ignore */
2162 sprintf(buf, "%u", node->getObject()->getLocalID()); 2081 snprintf(buf, MAX_STRING, "%u", node->getObject()->getLocalID()); /* Flawfinder: ignore */
2163 gMessageSystem->nextBlock("ParamList"); 2082 gMessageSystem->nextBlock("ParamList");
2164 gMessageSystem->addString("Parameter", buf); 2083 gMessageSystem->addString("Parameter", buf);
2165} 2084}
@@ -2172,7 +2091,7 @@ void LLSelectMgr::selectionResetRotation()
2172 LLQuaternion identity(0.f, 0.f, 0.f, 1.f); 2091 LLQuaternion identity(0.f, 0.f, 0.f, 1.f);
2173 2092
2174 LLViewerObject* object; 2093 LLViewerObject* object;
2175 for (object = mSelectedObjects.getFirstRootObject(); object; object = mSelectedObjects.getNextRootObject() ) 2094 for (object = mSelectedObjects->getFirstRootObject(); object; object = mSelectedObjects->getNextRootObject() )
2176 { 2095 {
2177 object->setRotation(identity); 2096 object->setRotation(identity);
2178 if (object->mDrawable.notNull()) 2097 if (object->mDrawable.notNull())
@@ -2188,7 +2107,7 @@ void LLSelectMgr::selectionRotateAroundZ(F32 degrees)
2188 LLQuaternion rot( degrees * DEG_TO_RAD, LLVector3(0,0,1) ); 2107 LLQuaternion rot( degrees * DEG_TO_RAD, LLVector3(0,0,1) );
2189 2108
2190 LLViewerObject* object; 2109 LLViewerObject* object;
2191 for (object = mSelectedObjects.getFirstRootObject(); object; object = mSelectedObjects.getNextRootObject() ) 2110 for (object = mSelectedObjects->getFirstRootObject(); object; object = mSelectedObjects->getNextRootObject() )
2192 { 2111 {
2193 object->setRotation( object->getRotationEdit() * rot ); 2112 object->setRotation( object->getRotationEdit() * rot );
2194 if (object->mDrawable.notNull()) 2113 if (object->mDrawable.notNull())
@@ -2207,7 +2126,7 @@ void LLSelectMgr::selectionTexScaleAutofit(F32 repeats_per_meter)
2207{ 2126{
2208 LLViewerObject* object; 2127 LLViewerObject* object;
2209 S32 te; 2128 S32 te;
2210 for (mSelectedObjects.getFirstTE(&object, &te); object; mSelectedObjects.getNextTE(&object, &te)) 2129 for (mSelectedObjects->getFirstTE(&object, &te); object; mSelectedObjects->getNextTE(&object, &te))
2211 { 2130 {
2212 if (!object->permModify()) 2131 if (!object->permModify())
2213 { 2132 {
@@ -2232,7 +2151,7 @@ void LLSelectMgr::selectionTexScaleAutofit(F32 repeats_per_meter)
2232 object->setTEScale(te, new_s, new_t); 2151 object->setTEScale(te, new_s, new_t);
2233 } 2152 }
2234 2153
2235 for (object = mSelectedObjects.getFirstObject(); object; object = mSelectedObjects.getNextObject()) 2154 for (object = mSelectedObjects->getFirstObject(); object; object = mSelectedObjects->getNextObject())
2236 { 2155 {
2237 if (object->permModify()) 2156 if (object->permModify())
2238 { 2157 {
@@ -2299,7 +2218,7 @@ void LLSelectMgr::adjustTexturesByScale(BOOL send_to_sim, BOOL stretch)
2299 2218
2300 BOOL send = FALSE; 2219 BOOL send = FALSE;
2301 2220
2302 for (selectNode = mSelectedObjects.getFirstNode(); selectNode; selectNode = mSelectedObjects.getNextNode()) 2221 for (selectNode = mSelectedObjects->getFirstNode(); selectNode; selectNode = mSelectedObjects->getNextNode())
2303 { 2222 {
2304 object = selectNode->getObject(); 2223 object = selectNode->getObject();
2305 if (!object->permModify()) 2224 if (!object->permModify())
@@ -2357,7 +2276,7 @@ void LLSelectMgr::selectionResetTexInfo(S32 selected_face)
2357 S32 start_face, end_face; 2276 S32 start_face, end_face;
2358 2277
2359 LLViewerObject* object; 2278 LLViewerObject* object;
2360 for (object = mSelectedObjects.getFirstObject(); object; object = mSelectedObjects.getNextObject()) 2279 for (object = mSelectedObjects->getFirstObject(); object; object = mSelectedObjects->getNextObject())
2361 { 2280 {
2362 if (!object->permModify()) 2281 if (!object->permModify())
2363 { 2282 {
@@ -2392,259 +2311,12 @@ void LLSelectMgr::selectionResetTexInfo(S32 selected_face)
2392} 2311}
2393 2312
2394//----------------------------------------------------------------------------- 2313//-----------------------------------------------------------------------------
2395// getFirstEditableObject()
2396//-----------------------------------------------------------------------------
2397LLViewerObject* LLSelectMgr::getFirstEditableObject(BOOL get_root)
2398{
2399 LLViewerObject* object = NULL;
2400 for(LLViewerObject* cur = mSelectedObjects.getFirstObject(); cur; cur = mSelectedObjects.getNextObject())
2401 {
2402 if( cur->permModify() )
2403 {
2404 object = cur;
2405 break;
2406 }
2407 }
2408
2409 if (get_root && object)
2410 {
2411 LLViewerObject *parent;
2412 while ((parent = (LLViewerObject*)object->getParent()))
2413 {
2414 if (parent->isSelected())
2415 {
2416 object = parent;
2417 }
2418 else
2419 {
2420 break;
2421 }
2422 }
2423 }
2424
2425 return object;
2426}
2427
2428//-----------------------------------------------------------------------------
2429// getFirstMoveableObject()
2430//-----------------------------------------------------------------------------
2431LLViewerObject* LLSelectMgr::getFirstMoveableObject(BOOL get_root)
2432{
2433 LLViewerObject* object = NULL;
2434 for(LLViewerObject* cur = mSelectedObjects.getFirstObject(); cur; cur = mSelectedObjects.getNextObject())
2435 {
2436 if( cur->permMove() )
2437 {
2438 object = cur;
2439 break;
2440 }
2441 }
2442
2443 if (get_root && object && !object->isJointChild())
2444 {
2445 LLViewerObject *parent;
2446 while ((parent = (LLViewerObject*)object->getParent()))
2447 {
2448 if (parent->isSelected())
2449 {
2450 object = parent;
2451 }
2452 else
2453 {
2454 break;
2455 }
2456 }
2457 }
2458
2459 return object;
2460}
2461
2462//-----------------------------------------------------------------------------
2463// getFirstEditableNode()
2464//-----------------------------------------------------------------------------
2465LLSelectNode* LLSelectMgr::getFirstEditableNode(BOOL get_root)
2466{
2467 LLSelectNode* selectNode = NULL;
2468
2469 if (get_root)
2470 {
2471 for(selectNode = mSelectedObjects.getFirstRootNode(); selectNode; selectNode = mSelectedObjects.getNextRootNode())
2472 {
2473 if( selectNode->getObject()->permModify() )
2474 {
2475 return selectNode;
2476 break;
2477 }
2478 }
2479 }
2480 for(selectNode = mSelectedObjects.getFirstNode(); selectNode; selectNode = mSelectedObjects.getNextNode())
2481 {
2482 if( selectNode->getObject()->permModify() )
2483 {
2484 return selectNode;
2485 break;
2486 }
2487 }
2488
2489 return NULL;
2490}
2491
2492//-----------------------------------------------------------------------------
2493// getFirstMoveableNode()
2494//-----------------------------------------------------------------------------
2495LLSelectNode* LLSelectMgr::getFirstMoveableNode(BOOL get_root)
2496{
2497 LLSelectNode* selectNode = NULL;
2498
2499 if (get_root)
2500 {
2501 for(selectNode = mSelectedObjects.getFirstRootNode(); selectNode; selectNode = mSelectedObjects.getNextRootNode())
2502 {
2503 if( selectNode->getObject()->permMove() )
2504 {
2505 return selectNode;
2506 break;
2507 }
2508 }
2509 }
2510 for(selectNode = mSelectedObjects.getFirstNode(); selectNode; selectNode = mSelectedObjects.getNextNode())
2511 {
2512 if( selectNode->getObject()->permMove() )
2513 {
2514 return selectNode;
2515 break;
2516 }
2517 }
2518
2519 return NULL;
2520}
2521
2522//-----------------------------------------------------------------------------
2523// getFirstDeleteableObject()
2524//-----------------------------------------------------------------------------
2525LLViewerObject* LLSelectMgr::getFirstDeleteableObject(BOOL get_root)
2526{
2527 //RN: don't currently support deletion of child objects, as that requires separating them first
2528 // then derezzing to trash
2529 get_root = TRUE;
2530
2531 LLViewerObject* object = NULL;
2532 if (get_root)
2533 {
2534 for(LLViewerObject* current = getFirstRootObject();
2535 current != NULL;
2536 current = getNextRootObject())
2537 {
2538 // you can delete an object if permissions allow it, you are
2539 // the owner, you are an officer in the group that owns the
2540 // object, or you are not the owner but it is on land you own
2541 // or land owned by your group. (whew!)
2542 if( (current->permModify())
2543 || (current->permYouOwner())
2544 || (!current->permAnyOwner()) // public
2545 || (current->isOverAgentOwnedLand())
2546 || (current->isOverGroupOwnedLand())
2547 )
2548 {
2549
2550 if( !current->isAttachment() )
2551 {
2552 object = current;
2553 break;
2554 }
2555 }
2556 }
2557 }
2558 else
2559 {
2560 for(LLViewerObject* current = getFirstObject();
2561 current != NULL;
2562 current = getNextObject())
2563 {
2564 // you can delete an object if permissions allow it, you are
2565 // the owner, you are an officer in the group that owns the
2566 // object, or you are not the owner but it is on land you own
2567 // or land owned by your group. (whew!)
2568 if( (current->permModify())
2569 || (current->permYouOwner())
2570 || (!current->permAnyOwner()) // public
2571 || (current->isOverAgentOwnedLand())
2572 || (current->isOverGroupOwnedLand())
2573 )
2574 {
2575 if( !current->isAttachment() )
2576 {
2577 object = current;
2578 break;
2579 }
2580 }
2581 }
2582 }
2583
2584 return object;
2585}
2586
2587//-----------------------------------------------------------------------------
2588// getFirstCopyableObject()
2589//-----------------------------------------------------------------------------
2590LLViewerObject* LLSelectMgr::getFirstCopyableObject(BOOL get_root)
2591{
2592 LLViewerObject* object = NULL;
2593 for(LLViewerObject* cur = mSelectedObjects.getFirstObject(); cur; cur = mSelectedObjects.getNextObject())
2594 {
2595 if( cur->permCopy() && !cur->isAttachment())
2596 {
2597 object = cur;
2598 break;
2599 }
2600 }
2601
2602 if (get_root && object)
2603 {
2604 LLViewerObject *parent;
2605 while ((parent = (LLViewerObject*)object->getParent()))
2606 {
2607 if (parent->isSelected())
2608 {
2609 object = parent;
2610 }
2611 else
2612 {
2613 break;
2614 }
2615 }
2616 }
2617
2618 return object;
2619}
2620
2621//-----------------------------------------------------------------------------
2622// areMultpleEditableObjectsSelected()
2623//-----------------------------------------------------------------------------
2624BOOL LLSelectMgr::areMultpleEditableObjectsSelected()
2625{
2626 S32 count = 0;
2627 for( LLViewerObject* cur = mSelectedObjects.getFirstObject(); cur; cur = mSelectedObjects.getNextObject() )
2628 {
2629 if( cur->permModify() )
2630 {
2631 count++;
2632 if( count > 1 )
2633 {
2634 return TRUE;
2635 }
2636 }
2637 }
2638 return FALSE;
2639}
2640
2641//-----------------------------------------------------------------------------
2642// selectGetAllRootsValid() 2314// selectGetAllRootsValid()
2643// Returns true if the viewer has information on all selected objects 2315// Returns true if the viewer has information on all selected objects
2644//----------------------------------------------------------------------------- 2316//-----------------------------------------------------------------------------
2645BOOL LLSelectMgr::selectGetAllRootsValid() 2317BOOL LLSelectMgr::selectGetAllRootsValid()
2646{ 2318{
2647 for( LLSelectNode* node = getFirstRootNode(); node; node = getNextRootNode() ) 2319 for( LLSelectNode* node = mSelectedObjects->getFirstRootNode(); node; node = mSelectedObjects->getNextRootNode() )
2648 { 2320 {
2649 2321
2650 if( !node->mValid ) 2322 if( !node->mValid )
@@ -2667,7 +2339,7 @@ BOOL LLSelectMgr::selectGetAllRootsValid()
2667//----------------------------------------------------------------------------- 2339//-----------------------------------------------------------------------------
2668BOOL LLSelectMgr::selectGetAllValid() 2340BOOL LLSelectMgr::selectGetAllValid()
2669{ 2341{
2670 for( LLSelectNode* node = getFirstNode(); node; node = getNextNode() ) 2342 for( LLSelectNode* node = mSelectedObjects->getFirstNode(); node; node = mSelectedObjects->getNextNode() )
2671 { 2343 {
2672 2344
2673 if( !node->mValid ) 2345 if( !node->mValid )
@@ -2690,7 +2362,7 @@ BOOL LLSelectMgr::selectGetAllValid()
2690//----------------------------------------------------------------------------- 2362//-----------------------------------------------------------------------------
2691BOOL LLSelectMgr::selectGetModify() 2363BOOL LLSelectMgr::selectGetModify()
2692{ 2364{
2693 for( LLSelectNode* node = getFirstNode(); node; node = getNextNode() ) 2365 for( LLSelectNode* node = mSelectedObjects->getFirstNode(); node; node = mSelectedObjects->getNextNode() )
2694 { 2366 {
2695 if( !node->mValid ) 2367 if( !node->mValid )
2696 { 2368 {
@@ -2712,7 +2384,7 @@ BOOL LLSelectMgr::selectGetModify()
2712//----------------------------------------------------------------------------- 2384//-----------------------------------------------------------------------------
2713BOOL LLSelectMgr::selectGetRootsModify() 2385BOOL LLSelectMgr::selectGetRootsModify()
2714{ 2386{
2715 for( LLSelectNode* node = getFirstRootNode(); node; node = getNextRootNode() ) 2387 for( LLSelectNode* node = mSelectedObjects->getFirstRootNode(); node; node = mSelectedObjects->getNextRootNode() )
2716 { 2388 {
2717 if( !node->mValid ) 2389 if( !node->mValid )
2718 { 2390 {
@@ -2735,7 +2407,7 @@ BOOL LLSelectMgr::selectGetRootsModify()
2735//----------------------------------------------------------------------------- 2407//-----------------------------------------------------------------------------
2736BOOL LLSelectMgr::selectGetRootsTransfer() 2408BOOL LLSelectMgr::selectGetRootsTransfer()
2737{ 2409{
2738 for(LLSelectNode* node = getFirstRootNode(); node; node = getNextRootNode()) 2410 for(LLSelectNode* node = mSelectedObjects->getFirstRootNode(); node; node = mSelectedObjects->getNextRootNode())
2739 { 2411 {
2740 if(!node->mValid) 2412 if(!node->mValid)
2741 { 2413 {
@@ -2756,7 +2428,7 @@ BOOL LLSelectMgr::selectGetRootsTransfer()
2756//----------------------------------------------------------------------------- 2428//-----------------------------------------------------------------------------
2757BOOL LLSelectMgr::selectGetRootsCopy() 2429BOOL LLSelectMgr::selectGetRootsCopy()
2758{ 2430{
2759 for(LLSelectNode* node = getFirstRootNode(); node; node = getNextRootNode()) 2431 for(LLSelectNode* node = mSelectedObjects->getFirstRootNode(); node; node = mSelectedObjects->getNextRootNode())
2760 { 2432 {
2761 if(!node->mValid) 2433 if(!node->mValid)
2762 { 2434 {
@@ -2777,8 +2449,8 @@ BOOL LLSelectMgr::selectGetRootsCopy()
2777//----------------------------------------------------------------------------- 2449//-----------------------------------------------------------------------------
2778BOOL LLSelectMgr::selectGetCreator(LLUUID& id, LLString& name) 2450BOOL LLSelectMgr::selectGetCreator(LLUUID& id, LLString& name)
2779{ 2451{
2780 LLSelectNode* node = getFirstRootNode(); 2452 LLSelectNode* node = mSelectedObjects->getFirstRootNode();
2781 if(!node) node = getFirstNode(); 2453 if(!node) node = mSelectedObjects->getFirstNode();
2782 if(!node) return FALSE; 2454 if(!node) return FALSE;
2783 if(!node->mValid) return FALSE; 2455 if(!node->mValid) return FALSE;
2784 LLViewerObject* obj = node->getObject(); 2456 LLViewerObject* obj = node->getObject();
@@ -2788,7 +2460,7 @@ BOOL LLSelectMgr::selectGetCreator(LLUUID& id, LLString& name)
2788 id = node->mPermissions->getCreator(); 2460 id = node->mPermissions->getCreator();
2789 2461
2790 BOOL identical = TRUE; 2462 BOOL identical = TRUE;
2791 for ( node = getNextRootNode(); node; node = getNextRootNode() ) 2463 for ( node = mSelectedObjects->getNextRootNode(); node; node = mSelectedObjects->getNextRootNode() )
2792 { 2464 {
2793 if (!node->mValid) 2465 if (!node->mValid)
2794 { 2466 {
@@ -2805,8 +2477,8 @@ BOOL LLSelectMgr::selectGetCreator(LLUUID& id, LLString& name)
2805 2477
2806 if (identical) 2478 if (identical)
2807 { 2479 {
2808 char firstname[DB_FIRST_NAME_BUF_SIZE]; 2480 char firstname[DB_FIRST_NAME_BUF_SIZE]; /* Flawfinder: ignore */
2809 char lastname[DB_LAST_NAME_BUF_SIZE]; 2481 char lastname[DB_LAST_NAME_BUF_SIZE]; /* Flawfinder: ignore */
2810 gCacheName->getName(id, firstname, lastname); 2482 gCacheName->getName(id, firstname, lastname);
2811 name.assign( firstname ); 2483 name.assign( firstname );
2812 name.append( " " ); 2484 name.append( " " );
@@ -2827,8 +2499,8 @@ BOOL LLSelectMgr::selectGetCreator(LLUUID& id, LLString& name)
2827//----------------------------------------------------------------------------- 2499//-----------------------------------------------------------------------------
2828BOOL LLSelectMgr::selectGetOwner(LLUUID& id, LLString& name) 2500BOOL LLSelectMgr::selectGetOwner(LLUUID& id, LLString& name)
2829{ 2501{
2830 LLSelectNode* node = getFirstRootNode(); 2502 LLSelectNode* node = mSelectedObjects->getFirstRootNode();
2831 if(!node) node = getFirstNode(); 2503 if(!node) node = mSelectedObjects->getFirstNode();
2832 if(!node) return FALSE; 2504 if(!node) return FALSE;
2833 if(!node->mValid) return FALSE; 2505 if(!node->mValid) return FALSE;
2834 LLViewerObject* obj = node->getObject(); 2506 LLViewerObject* obj = node->getObject();
@@ -2840,7 +2512,7 @@ BOOL LLSelectMgr::selectGetOwner(LLUUID& id, LLString& name)
2840 node->mPermissions->getOwnership(id, group_owner); 2512 node->mPermissions->getOwnership(id, group_owner);
2841 2513
2842 BOOL identical = TRUE; 2514 BOOL identical = TRUE;
2843 for ( node = getNextRootNode(); node; node = getNextRootNode() ) 2515 for ( node = mSelectedObjects->getNextRootNode(); node; node = mSelectedObjects->getNextRootNode() )
2844 { 2516 {
2845 if (!node->mValid) 2517 if (!node->mValid)
2846 { 2518 {
@@ -2868,8 +2540,8 @@ BOOL LLSelectMgr::selectGetOwner(LLUUID& id, LLString& name)
2868 } 2540 }
2869 else if(!public_owner) 2541 else if(!public_owner)
2870 { 2542 {
2871 char firstname[DB_FIRST_NAME_BUF_SIZE]; 2543 char firstname[DB_FIRST_NAME_BUF_SIZE]; /* Flawfinder: ignore */
2872 char lastname[DB_LAST_NAME_BUF_SIZE]; 2544 char lastname[DB_LAST_NAME_BUF_SIZE]; /* Flawfinder: ignore */
2873 gCacheName->getName(id, firstname, lastname); 2545 gCacheName->getName(id, firstname, lastname);
2874 name.assign( firstname ); 2546 name.assign( firstname );
2875 name.append( " " ); 2547 name.append( " " );
@@ -2895,8 +2567,8 @@ BOOL LLSelectMgr::selectGetOwner(LLUUID& id, LLString& name)
2895//----------------------------------------------------------------------------- 2567//-----------------------------------------------------------------------------
2896BOOL LLSelectMgr::selectGetLastOwner(LLUUID& id, LLString& name) 2568BOOL LLSelectMgr::selectGetLastOwner(LLUUID& id, LLString& name)
2897{ 2569{
2898 LLSelectNode* node = getFirstRootNode(); 2570 LLSelectNode* node = mSelectedObjects->getFirstRootNode();
2899 if(!node) node = getFirstNode(); 2571 if(!node) node = mSelectedObjects->getFirstNode();
2900 if(!node) return FALSE; 2572 if(!node) return FALSE;
2901 if(!node->mValid) return FALSE; 2573 if(!node->mValid) return FALSE;
2902 LLViewerObject* obj = node->getObject(); 2574 LLViewerObject* obj = node->getObject();
@@ -2906,7 +2578,7 @@ BOOL LLSelectMgr::selectGetLastOwner(LLUUID& id, LLString& name)
2906 id = node->mPermissions->getLastOwner(); 2578 id = node->mPermissions->getLastOwner();
2907 2579
2908 BOOL identical = TRUE; 2580 BOOL identical = TRUE;
2909 for ( node = getNextRootNode(); node; node = getNextRootNode() ) 2581 for ( node = mSelectedObjects->getNextRootNode(); node; node = mSelectedObjects->getNextRootNode() )
2910 { 2582 {
2911 if (!node->mValid) 2583 if (!node->mValid)
2912 { 2584 {
@@ -2927,8 +2599,8 @@ BOOL LLSelectMgr::selectGetLastOwner(LLUUID& id, LLString& name)
2927 { 2599 {
2928 if(!public_owner) 2600 if(!public_owner)
2929 { 2601 {
2930 char firstname[DB_FIRST_NAME_BUF_SIZE]; 2602 char firstname[DB_FIRST_NAME_BUF_SIZE]; /* Flawfinder: ignore */
2931 char lastname[DB_LAST_NAME_BUF_SIZE]; 2603 char lastname[DB_LAST_NAME_BUF_SIZE]; /* Flawfinder: ignore */
2932 gCacheName->getName(id, firstname, lastname); 2604 gCacheName->getName(id, firstname, lastname);
2933 name.assign( firstname ); 2605 name.assign( firstname );
2934 name.append( " " ); 2606 name.append( " " );
@@ -2954,8 +2626,8 @@ BOOL LLSelectMgr::selectGetLastOwner(LLUUID& id, LLString& name)
2954//----------------------------------------------------------------------------- 2626//-----------------------------------------------------------------------------
2955BOOL LLSelectMgr::selectGetGroup(LLUUID& id) 2627BOOL LLSelectMgr::selectGetGroup(LLUUID& id)
2956{ 2628{
2957 LLSelectNode* node = getFirstRootNode(); 2629 LLSelectNode* node = mSelectedObjects->getFirstRootNode();
2958 if(!node) node = getFirstNode(); 2630 if(!node) node = mSelectedObjects->getFirstNode();
2959 if(!node) return FALSE; 2631 if(!node) return FALSE;
2960 if(!node->mValid) return FALSE; 2632 if(!node->mValid) return FALSE;
2961 LLViewerObject* obj = node->getObject(); 2633 LLViewerObject* obj = node->getObject();
@@ -2965,7 +2637,7 @@ BOOL LLSelectMgr::selectGetGroup(LLUUID& id)
2965 id = node->mPermissions->getGroup(); 2637 id = node->mPermissions->getGroup();
2966 2638
2967 BOOL identical = TRUE; 2639 BOOL identical = TRUE;
2968 for ( node = getNextRootNode(); node; node = getNextRootNode() ) 2640 for ( node = mSelectedObjects->getNextRootNode(); node; node = mSelectedObjects->getNextRootNode() )
2969 { 2641 {
2970 if (!node->mValid) 2642 if (!node->mValid)
2971 { 2643 {
@@ -2990,8 +2662,8 @@ BOOL LLSelectMgr::selectGetGroup(LLUUID& id)
2990//----------------------------------------------------------------------------- 2662//-----------------------------------------------------------------------------
2991BOOL LLSelectMgr::selectIsGroupOwned() 2663BOOL LLSelectMgr::selectIsGroupOwned()
2992{ 2664{
2993 LLSelectNode* node = getFirstRootNode(); 2665 LLSelectNode* node = mSelectedObjects->getFirstRootNode();
2994 if(!node) node = getFirstNode(); 2666 if(!node) node = mSelectedObjects->getFirstNode();
2995 if(!node) return FALSE; 2667 if(!node) return FALSE;
2996 if(!node->mValid) return FALSE; 2668 if(!node->mValid) return FALSE;
2997 LLViewerObject* obj = node->getObject(); 2669 LLViewerObject* obj = node->getObject();
@@ -3002,7 +2674,7 @@ BOOL LLSelectMgr::selectIsGroupOwned()
3002 2674
3003 if(is_group_owned) 2675 if(is_group_owned)
3004 { 2676 {
3005 for ( node = getNextRootNode(); node; node = getNextRootNode() ) 2677 for ( node = mSelectedObjects->getNextRootNode(); node; node = mSelectedObjects->getNextRootNode() )
3006 { 2678 {
3007 if (!node->mValid) 2679 if (!node->mValid)
3008 { 2680 {
@@ -3031,7 +2703,7 @@ BOOL LLSelectMgr::selectIsGroupOwned()
3031//----------------------------------------------------------------------------- 2703//-----------------------------------------------------------------------------
3032BOOL LLSelectMgr::selectGetPerm(U8 which_perm, U32* mask_on, U32* mask_off) 2704BOOL LLSelectMgr::selectGetPerm(U8 which_perm, U32* mask_on, U32* mask_off)
3033{ 2705{
3034 LLSelectNode* node = getFirstRootNode(); 2706 LLSelectNode* node = mSelectedObjects->getFirstRootNode();
3035 if (!node) return FALSE; 2707 if (!node) return FALSE;
3036 if (!node->mValid) return FALSE; 2708 if (!node->mValid) return FALSE;
3037 2709
@@ -3040,7 +2712,7 @@ BOOL LLSelectMgr::selectGetPerm(U8 which_perm, U32* mask_on, U32* mask_off)
3040 U32 mask_or = 0x00000000; 2712 U32 mask_or = 0x00000000;
3041 BOOL all_valid = TRUE; 2713 BOOL all_valid = TRUE;
3042 2714
3043 for ( node = getFirstRootNode(); node; node = getNextRootNode() ) 2715 for ( node = mSelectedObjects->getFirstRootNode(); node; node = mSelectedObjects->getNextRootNode() )
3044 { 2716 {
3045 if (!node->mValid) 2717 if (!node->mValid)
3046 { 2718 {
@@ -3094,17 +2766,17 @@ BOOL LLSelectMgr::selectGetPerm(U8 which_perm, U32* mask_on, U32* mask_off)
3094 2766
3095BOOL LLSelectMgr::selectGetOwnershipCost(S32* out_cost) 2767BOOL LLSelectMgr::selectGetOwnershipCost(S32* out_cost)
3096{ 2768{
3097 return mSelectedObjects.getOwnershipCost(*out_cost); 2769 return mSelectedObjects->getOwnershipCost(*out_cost);
3098} 2770}
3099 2771
3100BOOL LLSelectMgr::selectGetPermissions(LLPermissions& perm) 2772BOOL LLSelectMgr::selectGetPermissions(LLPermissions& perm)
3101{ 2773{
3102 LLSelectNode* node = getFirstRootNode(); 2774 LLSelectNode* node = mSelectedObjects->getFirstRootNode();
3103 if (!node) return FALSE; 2775 if (!node) return FALSE;
3104 if (!node->mValid) return FALSE; 2776 if (!node->mValid) return FALSE;
3105 BOOL valid = TRUE; 2777 BOOL valid = TRUE;
3106 perm = *(node->mPermissions); 2778 perm = *(node->mPermissions);
3107 for(node = getNextRootNode(); node != NULL; node = getNextRootNode()) 2779 for(node = mSelectedObjects->getNextRootNode(); node != NULL; node = mSelectedObjects->getNextRootNode())
3108 { 2780 {
3109 if(!node->mValid) 2781 if(!node->mValid)
3110 { 2782 {
@@ -3124,9 +2796,9 @@ void LLSelectMgr::selectDelete()
3124 BOOL locked_but_deleteable_object = FALSE; 2796 BOOL locked_but_deleteable_object = FALSE;
3125 BOOL no_copy_but_deleteable_object = FALSE; 2797 BOOL no_copy_but_deleteable_object = FALSE;
3126 BOOL all_owned_by_you = TRUE; 2798 BOOL all_owned_by_you = TRUE;
3127 for(LLViewerObject* obj = getFirstObject(); 2799 for(LLViewerObject* obj = mSelectedObjects->getFirstObject();
3128 obj != NULL; 2800 obj != NULL;
3129 obj = getNextObject()) 2801 obj = mSelectedObjects->getNextObject())
3130 { 2802 {
3131 if( obj->isAttachment() ) 2803 if( obj->isAttachment() )
3132 { 2804 {
@@ -3156,6 +2828,8 @@ void LLSelectMgr::selectDelete()
3156 return; 2828 return;
3157 } 2829 }
3158 2830
2831 LLObjectSelectionHandle* selection_handlep = new LLObjectSelectionHandle(getSelection());
2832
3159 if(locked_but_deleteable_object || 2833 if(locked_but_deleteable_object ||
3160 no_copy_but_deleteable_object || 2834 no_copy_but_deleteable_object ||
3161 !all_owned_by_you) 2835 !all_owned_by_you)
@@ -3172,49 +2846,49 @@ void LLSelectMgr::selectDelete()
3172 //Locked only 2846 //Locked only
3173 gViewerWindow->alertXml( "ConfirmObjectDeleteLock", 2847 gViewerWindow->alertXml( "ConfirmObjectDeleteLock",
3174 &LLSelectMgr::confirmDelete, 2848 &LLSelectMgr::confirmDelete,
3175 this); 2849 selection_handlep);
3176 } 2850 }
3177 else if(!locked_but_deleteable_object && no_copy_but_deleteable_object && all_owned_by_you) 2851 else if(!locked_but_deleteable_object && no_copy_but_deleteable_object && all_owned_by_you)
3178 { 2852 {
3179 //No Copy only 2853 //No Copy only
3180 gViewerWindow->alertXml( "ConfirmObjectDeleteNoCopy", 2854 gViewerWindow->alertXml( "ConfirmObjectDeleteNoCopy",
3181 &LLSelectMgr::confirmDelete, 2855 &LLSelectMgr::confirmDelete,
3182 this); 2856 selection_handlep);
3183 } 2857 }
3184 else if(!locked_but_deleteable_object && !no_copy_but_deleteable_object && !all_owned_by_you) 2858 else if(!locked_but_deleteable_object && !no_copy_but_deleteable_object && !all_owned_by_you)
3185 { 2859 {
3186 //not owned only 2860 //not owned only
3187 gViewerWindow->alertXml( "ConfirmObjectDeleteNoOwn", 2861 gViewerWindow->alertXml( "ConfirmObjectDeleteNoOwn",
3188 &LLSelectMgr::confirmDelete, 2862 &LLSelectMgr::confirmDelete,
3189 this); 2863 selection_handlep);
3190 } 2864 }
3191 else if(locked_but_deleteable_object && no_copy_but_deleteable_object && all_owned_by_you) 2865 else if(locked_but_deleteable_object && no_copy_but_deleteable_object && all_owned_by_you)
3192 { 2866 {
3193 //locked and no copy 2867 //locked and no copy
3194 gViewerWindow->alertXml( "ConfirmObjectDeleteLockNoCopy", 2868 gViewerWindow->alertXml( "ConfirmObjectDeleteLockNoCopy",
3195 &LLSelectMgr::confirmDelete, 2869 &LLSelectMgr::confirmDelete,
3196 this); 2870 selection_handlep);
3197 } 2871 }
3198 else if(locked_but_deleteable_object && !no_copy_but_deleteable_object && !all_owned_by_you) 2872 else if(locked_but_deleteable_object && !no_copy_but_deleteable_object && !all_owned_by_you)
3199 { 2873 {
3200 //locked and not owned 2874 //locked and not owned
3201 gViewerWindow->alertXml( "ConfirmObjectDeleteLockNoOwn", 2875 gViewerWindow->alertXml( "ConfirmObjectDeleteLockNoOwn",
3202 &LLSelectMgr::confirmDelete, 2876 &LLSelectMgr::confirmDelete,
3203 this); 2877 selection_handlep);
3204 } 2878 }
3205 else if(!locked_but_deleteable_object && no_copy_but_deleteable_object && !all_owned_by_you) 2879 else if(!locked_but_deleteable_object && no_copy_but_deleteable_object && !all_owned_by_you)
3206 { 2880 {
3207 //no copy and not owned 2881 //no copy and not owned
3208 gViewerWindow->alertXml( "ConfirmObjectDeleteNoCopyNoOwn", 2882 gViewerWindow->alertXml( "ConfirmObjectDeleteNoCopyNoOwn",
3209 &LLSelectMgr::confirmDelete, 2883 &LLSelectMgr::confirmDelete,
3210 this); 2884 selection_handlep);
3211 } 2885 }
3212 else 2886 else
3213 { 2887 {
3214 //locked, no copy and not owned 2888 //locked, no copy and not owned
3215 gViewerWindow->alertXml( "ConfirmObjectDeleteLockNoCopyNoOwn", 2889 gViewerWindow->alertXml( "ConfirmObjectDeleteLockNoCopyNoOwn",
3216 &LLSelectMgr::confirmDelete, 2890 &LLSelectMgr::confirmDelete,
3217 this); 2891 selection_handlep);
3218 } 2892 }
3219 2893
3220 2894
@@ -3222,15 +2896,22 @@ void LLSelectMgr::selectDelete()
3222 } 2896 }
3223 else 2897 else
3224 { 2898 {
3225 confirmDelete(0, (void*)this); 2899 confirmDelete(0, (void*)selection_handlep);
3226 } 2900 }
3227} 2901}
3228 2902
3229// static 2903// static
3230void LLSelectMgr::confirmDelete(S32 option, void* data) 2904void LLSelectMgr::confirmDelete(S32 option, void* data)
3231{ 2905{
3232 LLSelectMgr* self = (LLSelectMgr*)data; 2906 LLObjectSelectionHandle handle = *(LLObjectSelectionHandle*)data;
3233 if(!self) return; 2907 delete (LLObjectSelectionHandle*)data;
2908
2909 if (!handle->getObjectCount())
2910 {
2911 llwarns << "Nothing to delete!" << llendl;
2912 return;
2913 }
2914
3234 switch(option) 2915 switch(option)
3235 { 2916 {
3236 case 0: 2917 case 0:
@@ -3239,19 +2920,19 @@ void LLSelectMgr::confirmDelete(S32 option, void* data)
3239 LLUUID trash_id = gInventory.findCategoryUUIDForType(LLAssetType::AT_TRASH); 2920 LLUUID trash_id = gInventory.findCategoryUUIDForType(LLAssetType::AT_TRASH);
3240 // attempt to derez into the trash. 2921 // attempt to derez into the trash.
3241 LLDeRezInfo* info = new LLDeRezInfo(DRD_TRASH, trash_id); 2922 LLDeRezInfo* info = new LLDeRezInfo(DRD_TRASH, trash_id);
3242 self->sendListToRegions("DeRezObject", 2923 gSelectMgr->sendListToRegions("DeRezObject",
3243 packDeRezHeader, 2924 packDeRezHeader,
3244 packObjectLocalID, 2925 packObjectLocalID,
3245 (void*)info, 2926 (void*)info,
3246 SEND_ONLY_ROOTS); 2927 SEND_ONLY_ROOTS);
3247 // VEFFECT: Delete Object - one effect for all deletes 2928 // VEFFECT: Delete Object - one effect for all deletes
3248 if (self->mSelectType != SELECT_TYPE_HUD) 2929 if (gSelectMgr->mSelectedObjects->mSelectType != SELECT_TYPE_HUD)
3249 { 2930 {
3250 LLHUDEffectSpiral *effectp = (LLHUDEffectSpiral *)gHUDManager->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_POINT, TRUE); 2931 LLHUDEffectSpiral *effectp = (LLHUDEffectSpiral *)gHUDManager->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_POINT, TRUE);
3251 effectp->setPositionGlobal( self->getSelectionCenterGlobal() ); 2932 effectp->setPositionGlobal( gSelectMgr->getSelectionCenterGlobal() );
3252 effectp->setColor(LLColor4U(gAgent.getEffectColor())); 2933 effectp->setColor(LLColor4U(gAgent.getEffectColor()));
3253 F32 duration = 0.5f; 2934 F32 duration = 0.5f;
3254 duration += self->getObjectCount() / 64.f; 2935 duration += gSelectMgr->mSelectedObjects->getObjectCount() / 64.f;
3255 effectp->setDuration(duration); 2936 effectp->setDuration(duration);
3256 } 2937 }
3257 2938
@@ -3259,7 +2940,7 @@ void LLSelectMgr::confirmDelete(S32 option, void* data)
3259 2940
3260 // Keep track of how many objects have been deleted. 2941 // Keep track of how many objects have been deleted.
3261 F64 obj_delete_count = gViewerStats->getStat(LLViewerStats::ST_OBJECT_DELETE_COUNT); 2942 F64 obj_delete_count = gViewerStats->getStat(LLViewerStats::ST_OBJECT_DELETE_COUNT);
3262 obj_delete_count += self->getObjectCount(); 2943 obj_delete_count += gSelectMgr->mSelectedObjects->getObjectCount();
3263 gViewerStats->setStat(LLViewerStats::ST_OBJECT_DELETE_COUNT, obj_delete_count ); 2944 gViewerStats->setStat(LLViewerStats::ST_OBJECT_DELETE_COUNT, obj_delete_count );
3264 } 2945 }
3265 break; 2946 break;
@@ -3289,7 +2970,7 @@ BOOL LLSelectMgr::selectIsForSale(S32& price)
3289 price = 0; 2970 price = 0;
3290 2971
3291 LLSelectNode *node; 2972 LLSelectNode *node;
3292 for (node = getFirstRootNode(); node; node = getNextRootNode() ) 2973 for (node = mSelectedObjects->getFirstRootNode(); node; node = mSelectedObjects->getNextRootNode() )
3293 { 2974 {
3294 if (node->mSaleInfo.isForSale()) 2975 if (node->mSaleInfo.isForSale())
3295 { 2976 {
@@ -3306,12 +2987,12 @@ BOOL LLSelectMgr::selectIsForSale(S32& price)
3306// accumulated sale info. 2987// accumulated sale info.
3307BOOL LLSelectMgr::selectGetSaleInfo(LLSaleInfo& sale_info) 2988BOOL LLSelectMgr::selectGetSaleInfo(LLSaleInfo& sale_info)
3308{ 2989{
3309 LLSelectNode* node = getFirstRootNode(); 2990 LLSelectNode* node = mSelectedObjects->getFirstRootNode();
3310 if (!node) return FALSE; 2991 if (!node) return FALSE;
3311 if (!node->mValid) return FALSE; 2992 if (!node->mValid) return FALSE;
3312 BOOL valid = TRUE; 2993 BOOL valid = TRUE;
3313 sale_info = node->mSaleInfo; 2994 sale_info = node->mSaleInfo;
3314 for(node = getNextRootNode(); node != NULL; node = getNextRootNode()) 2995 for(node = mSelectedObjects->getNextRootNode(); node != NULL; node = mSelectedObjects->getNextRootNode())
3315 { 2996 {
3316 if(!node->mValid) 2997 if(!node->mValid)
3317 { 2998 {
@@ -3325,12 +3006,12 @@ BOOL LLSelectMgr::selectGetSaleInfo(LLSaleInfo& sale_info)
3325 3006
3326BOOL LLSelectMgr::selectGetAggregatePermissions(LLAggregatePermissions& ag_perm) 3007BOOL LLSelectMgr::selectGetAggregatePermissions(LLAggregatePermissions& ag_perm)
3327{ 3008{
3328 LLSelectNode* node = getFirstNode(); 3009 LLSelectNode* node = mSelectedObjects->getFirstNode();
3329 if (!node) return FALSE; 3010 if (!node) return FALSE;
3330 if (!node->mValid) return FALSE; 3011 if (!node->mValid) return FALSE;
3331 BOOL valid = TRUE; 3012 BOOL valid = TRUE;
3332 ag_perm = node->mAggregatePerm; 3013 ag_perm = node->mAggregatePerm;
3333 for(node = getNextNode(); node != NULL; node = getNextNode()) 3014 for(node = mSelectedObjects->getNextNode(); node != NULL; node = mSelectedObjects->getNextNode())
3334 { 3015 {
3335 if(!node->mValid) 3016 if(!node->mValid)
3336 { 3017 {
@@ -3344,12 +3025,12 @@ BOOL LLSelectMgr::selectGetAggregatePermissions(LLAggregatePermissions& ag_perm)
3344 3025
3345BOOL LLSelectMgr::selectGetAggregateTexturePermissions(LLAggregatePermissions& ag_perm) 3026BOOL LLSelectMgr::selectGetAggregateTexturePermissions(LLAggregatePermissions& ag_perm)
3346{ 3027{
3347 LLSelectNode* node = getFirstNode(); 3028 LLSelectNode* node = mSelectedObjects->getFirstNode();
3348 if (!node) return FALSE; 3029 if (!node) return FALSE;
3349 if (!node->mValid) return FALSE; 3030 if (!node->mValid) return FALSE;
3350 BOOL valid = TRUE; 3031 BOOL valid = TRUE;
3351 ag_perm = node->getObject()->permYouOwner() ? node->mAggregateTexturePermOwner : node->mAggregateTexturePerm; 3032 ag_perm = node->getObject()->permYouOwner() ? node->mAggregateTexturePermOwner : node->mAggregateTexturePerm;
3352 for(node = getNextNode(); node != NULL; node = getNextNode()) 3033 for(node = mSelectedObjects->getNextNode(); node != NULL; node = mSelectedObjects->getNextNode())
3353 { 3034 {
3354 if(!node->mValid) 3035 if(!node->mValid)
3355 { 3036 {
@@ -3362,12 +3043,6 @@ BOOL LLSelectMgr::selectGetAggregateTexturePermissions(LLAggregatePermissions& a
3362} 3043}
3363 3044
3364 3045
3365// returns TRUE is any node is currenly worn as an attachment
3366BOOL LLSelectMgr::selectionIsAttachment()
3367{
3368 return (mSelectType == SELECT_TYPE_ATTACHMENT || mSelectType == SELECT_TYPE_HUD);
3369}
3370
3371//-------------------------------------------------------------------- 3046//--------------------------------------------------------------------
3372// Duplicate objects 3047// Duplicate objects
3373//-------------------------------------------------------------------- 3048//--------------------------------------------------------------------
@@ -3383,7 +3058,7 @@ struct LLDuplicateData
3383 3058
3384void LLSelectMgr::selectDuplicate(const LLVector3& offset, BOOL select_copy) 3059void LLSelectMgr::selectDuplicate(const LLVector3& offset, BOOL select_copy)
3385{ 3060{
3386 if (selectionIsAttachment()) 3061 if (mSelectedObjects->isAttachment())
3387 { 3062 {
3388 //RN: do not duplicate attachments 3063 //RN: do not duplicate attachments
3389 make_ui_sound("UISndInvalidOp"); 3064 make_ui_sound("UISndInvalidOp");
@@ -3403,7 +3078,7 @@ void LLSelectMgr::selectDuplicate(const LLVector3& offset, BOOL select_copy)
3403 } 3078 }
3404 else 3079 else
3405 { 3080 {
3406 for (LLSelectNode* node = getFirstRootNode(); node; node = getNextRootNode()) 3081 for (LLSelectNode* node = mSelectedObjects->getFirstRootNode(); node; node = mSelectedObjects->getNextRootNode())
3407 { 3082 {
3408 node->mDuplicated = TRUE; 3083 node->mDuplicated = TRUE;
3409 node->mDuplicatePos = node->getObject()->getPositionGlobal(); 3084 node->mDuplicatePos = node->getObject()->getPositionGlobal();
@@ -3414,7 +3089,7 @@ void LLSelectMgr::selectDuplicate(const LLVector3& offset, BOOL select_copy)
3414 3089
3415void LLSelectMgr::repeatDuplicate() 3090void LLSelectMgr::repeatDuplicate()
3416{ 3091{
3417 if (selectionIsAttachment()) 3092 if (mSelectedObjects->isAttachment())
3418 { 3093 {
3419 //RN: do not duplicate attachments 3094 //RN: do not duplicate attachments
3420 make_ui_sound("UISndInvalidOp"); 3095 make_ui_sound("UISndInvalidOp");
@@ -3424,7 +3099,7 @@ void LLSelectMgr::repeatDuplicate()
3424 LLSelectNode* node; 3099 LLSelectNode* node;
3425 LLDynamicArray<LLViewerObject*> non_duplicated_objects; 3100 LLDynamicArray<LLViewerObject*> non_duplicated_objects;
3426 3101
3427 for (node = getFirstRootNode(); node; node = getNextRootNode()) 3102 for (node = mSelectedObjects->getFirstRootNode(); node; node = mSelectedObjects->getNextRootNode())
3428 { 3103 {
3429 if (!node->mDuplicated) 3104 if (!node->mDuplicated)
3430 { 3105 {
@@ -3447,7 +3122,7 @@ void LLSelectMgr::repeatDuplicate()
3447 sendListToRegions("ObjectDuplicate", packDuplicateHeader, packDuplicate, &data, SEND_ONLY_ROOTS); 3122 sendListToRegions("ObjectDuplicate", packDuplicateHeader, packDuplicate, &data, SEND_ONLY_ROOTS);
3448 3123
3449 // move current selection based on delta from duplication position and update duplication position 3124 // move current selection based on delta from duplication position and update duplication position
3450 for (node = getFirstRootNode(); node; node = getNextRootNode()) 3125 for (node = mSelectedObjects->getFirstRootNode(); node; node = mSelectedObjects->getNextRootNode())
3451 { 3126 {
3452 if (node->mDuplicated) 3127 if (node->mDuplicated)
3453 { 3128 {
@@ -3502,7 +3177,7 @@ void LLSelectMgr::selectDuplicateOnRay(const LLVector3 &ray_start_region,
3502 BOOL copy_rotates, 3177 BOOL copy_rotates,
3503 BOOL select_copy) 3178 BOOL select_copy)
3504{ 3179{
3505 if (selectionIsAttachment()) 3180 if (mSelectedObjects->isAttachment())
3506 { 3181 {
3507 // do not duplicate attachments 3182 // do not duplicate attachments
3508 make_ui_sound("UISndInvalidOp"); 3183 make_ui_sound("UISndInvalidOp");
@@ -3714,7 +3389,7 @@ struct LLPermData
3714}; 3389};
3715 3390
3716// TODO: Make this able to fail elegantly. 3391// TODO: Make this able to fail elegantly.
3717void LLSelectMgr::setObjectPermissions(U8 field, 3392void LLSelectMgr::selectionSetObjectPermissions(U8 field,
3718 BOOL set, 3393 BOOL set,
3719 U32 mask, 3394 U32 mask,
3720 BOOL override) 3395 BOOL override)
@@ -3751,7 +3426,7 @@ void LLSelectMgr::sendSelect()
3751 3426
3752void LLSelectMgr::deselectAll() 3427void LLSelectMgr::deselectAll()
3753{ 3428{
3754 if (!mSelectedObjects.getNumNodes()) 3429 if (!mSelectedObjects->getNumNodes())
3755 { 3430 {
3756 return; 3431 return;
3757 } 3432 }
@@ -3772,42 +3447,29 @@ void LLSelectMgr::deselectAll()
3772 updateSelectionCenter(); 3447 updateSelectionCenter();
3773} 3448}
3774 3449
3775void LLSelectMgr::deselectTransient() 3450void LLSelectMgr::deselectUnused()
3776{ 3451{
3777 std::set<LLViewerObject*> objects_to_deselect; 3452 // no more outstanding references to this selection
3778 LLSelectNode *nodep; 3453 if (mSelectedObjects->getNumRefs() == 1)
3779 for (nodep = mSelectedObjects.getFirstNode(); nodep; nodep = mSelectedObjects.getNextNode())
3780 {
3781 if (nodep->isTransient())
3782 {
3783 objects_to_deselect.insert(nodep->getObject());
3784 }
3785 }
3786
3787 std::set<LLViewerObject*>::iterator iter;
3788 for (iter = objects_to_deselect.begin();
3789 iter != objects_to_deselect.end();
3790 ++iter)
3791 { 3454 {
3792 deselectObjectOnly(*iter); 3455 deselectAll();
3793 } 3456 }
3794
3795 gHUDManager->clearJoints();
3796 updateSelectionCenter();
3797} 3457}
3798 3458
3799void LLSelectMgr::convertTransient() 3459void LLSelectMgr::convertTransient()
3800{ 3460{
3801 LLSelectNode *nodep; 3461 // use STL-style iteration to avoid recursive iteration problems
3802 for (nodep = mSelectedObjects.getFirstNode(); nodep; nodep = mSelectedObjects.getNextNode()) 3462 LLObjectSelection::iterator node_it;
3463 for (node_it = mSelectedObjects->begin(); node_it != mSelectedObjects->end(); ++node_it)
3803 { 3464 {
3465 LLSelectNode *nodep = *node_it;
3804 nodep->setTransient(FALSE); 3466 nodep->setTransient(FALSE);
3805 } 3467 }
3806} 3468}
3807 3469
3808void LLSelectMgr::deselectAllIfTooFar() 3470void LLSelectMgr::deselectAllIfTooFar()
3809{ 3471{
3810 if (isEmpty() || mSelectType == SELECT_TYPE_HUD) 3472 if (mSelectedObjects->isEmpty() || mSelectedObjects->mSelectType == SELECT_TYPE_HUD)
3811 { 3473 {
3812 return; 3474 return;
3813 } 3475 }
@@ -3844,10 +3506,10 @@ void LLSelectMgr::deselectAllIfTooFar()
3844} 3506}
3845 3507
3846 3508
3847void LLSelectMgr::setObjectName(const LLString& name) 3509void LLSelectMgr::selectionSetObjectName(const LLString& name)
3848{ 3510{
3849 // we only work correctly if 1 object is selected. 3511 // we only work correctly if 1 object is selected.
3850 if(getRootObjectCount() == 1) 3512 if(mSelectedObjects->getRootObjectCount() == 1)
3851 { 3513 {
3852 sendListToRegions("ObjectName", 3514 sendListToRegions("ObjectName",
3853 packAgentAndSessionID, 3515 packAgentAndSessionID,
@@ -3855,7 +3517,7 @@ void LLSelectMgr::setObjectName(const LLString& name)
3855 (void*)name.c_str(), 3517 (void*)name.c_str(),
3856 SEND_ONLY_ROOTS); 3518 SEND_ONLY_ROOTS);
3857 } 3519 }
3858 else if(getObjectCount() == 1) 3520 else if(mSelectedObjects->getObjectCount() == 1)
3859 { 3521 {
3860 sendListToRegions("ObjectName", 3522 sendListToRegions("ObjectName",
3861 packAgentAndSessionID, 3523 packAgentAndSessionID,
@@ -3865,10 +3527,10 @@ void LLSelectMgr::setObjectName(const LLString& name)
3865 } 3527 }
3866} 3528}
3867 3529
3868void LLSelectMgr::setObjectDescription(const LLString& desc) 3530void LLSelectMgr::selectionSetObjectDescription(const LLString& desc)
3869{ 3531{
3870 // we only work correctly if 1 object is selected. 3532 // we only work correctly if 1 object is selected.
3871 if(getRootObjectCount() == 1) 3533 if(mSelectedObjects->getRootObjectCount() == 1)
3872 { 3534 {
3873 sendListToRegions("ObjectDescription", 3535 sendListToRegions("ObjectDescription",
3874 packAgentAndSessionID, 3536 packAgentAndSessionID,
@@ -3876,7 +3538,7 @@ void LLSelectMgr::setObjectDescription(const LLString& desc)
3876 (void*)desc.c_str(), 3538 (void*)desc.c_str(),
3877 SEND_ONLY_ROOTS); 3539 SEND_ONLY_ROOTS);
3878 } 3540 }
3879 else if(getObjectCount() == 1) 3541 else if(mSelectedObjects->getObjectCount() == 1)
3880 { 3542 {
3881 sendListToRegions("ObjectDescription", 3543 sendListToRegions("ObjectDescription",
3882 packAgentAndSessionID, 3544 packAgentAndSessionID,
@@ -3886,11 +3548,11 @@ void LLSelectMgr::setObjectDescription(const LLString& desc)
3886 } 3548 }
3887} 3549}
3888 3550
3889void LLSelectMgr::setObjectCategory(const LLCategory& category) 3551void LLSelectMgr::selectionSetObjectCategory(const LLCategory& category)
3890{ 3552{
3891 // for now, we only want to be able to set one root category at 3553 // for now, we only want to be able to set one root category at
3892 // a time. 3554 // a time.
3893 if(getRootObjectCount() != 1) return; 3555 if(mSelectedObjects->getRootObjectCount() != 1) return;
3894 sendListToRegions("ObjectCategory", 3556 sendListToRegions("ObjectCategory",
3895 packAgentAndSessionID, 3557 packAgentAndSessionID,
3896 packObjectCategory, 3558 packObjectCategory,
@@ -3898,10 +3560,10 @@ void LLSelectMgr::setObjectCategory(const LLCategory& category)
3898 SEND_ONLY_ROOTS); 3560 SEND_ONLY_ROOTS);
3899} 3561}
3900 3562
3901void LLSelectMgr::setObjectSaleInfo(const LLSaleInfo& sale_info) 3563void LLSelectMgr::selectionSetObjectSaleInfo(const LLSaleInfo& sale_info)
3902{ 3564{
3903 // Only one sale info at a time for now 3565 // Only one sale info at a time for now
3904 if(getRootObjectCount() != 1) return; 3566 if(mSelectedObjects->getRootObjectCount() != 1) return;
3905 sendListToRegions("ObjectSaleInfo", 3567 sendListToRegions("ObjectSaleInfo",
3906 packAgentAndSessionID, 3568 packAgentAndSessionID,
3907 packObjectSaleInfo, 3569 packObjectSaleInfo,
@@ -3915,16 +3577,17 @@ void LLSelectMgr::setObjectSaleInfo(const LLSaleInfo& sale_info)
3915 3577
3916void LLSelectMgr::sendAttach(U8 attachment_point) 3578void LLSelectMgr::sendAttach(U8 attachment_point)
3917{ 3579{
3918 LLViewerObject* attach_object = mSelectedObjects.getFirstRootObject(); 3580 LLViewerObject* attach_object = mSelectedObjects->getFirstRootObject();
3919 3581
3920 if (!attach_object || !gAgent.getAvatarObject() || mSelectType != SELECT_TYPE_WORLD) 3582 if (!attach_object || !gAgent.getAvatarObject() || mSelectedObjects->mSelectType != SELECT_TYPE_WORLD)
3921 { 3583 {
3922 return; 3584 return;
3923 } 3585 }
3924 3586
3925 BOOL build_mode = gToolMgr->inEdit(); 3587 BOOL build_mode = gToolMgr->inEdit();
3926 // Special case: Attach to default location for this object. 3588 // Special case: Attach to default location for this object.
3927 if (0 == attachment_point) 3589 if (0 == attachment_point ||
3590 gAgent.getAvatarObject()->mAttachmentPoints.getIfThere(attachment_point))
3928 { 3591 {
3929 sendListToRegions( 3592 sendListToRegions(
3930 "ObjectAttach", 3593 "ObjectAttach",
@@ -3937,53 +3600,11 @@ void LLSelectMgr::sendAttach(U8 attachment_point)
3937 deselectAll(); 3600 deselectAll();
3938 } 3601 }
3939 } 3602 }
3940 else
3941 {
3942 LLViewerJointAttachment* attachment = gAgent.getAvatarObject()->mAttachmentPoints.getIfThere(attachment_point);
3943 if (attachment)
3944 {
3945 LLQuaternion object_world_rot = attach_object->getRenderRotation();
3946 LLQuaternion attachment_pt__world_rot = attachment->getWorldRotation();
3947 LLQuaternion local_rot = object_world_rot * ~attachment_pt__world_rot;
3948
3949 F32 x,y,z;
3950 local_rot.getEulerAngles(&x, &y, &z);
3951 // snap to nearest 90 degree rotation
3952 // make sure all euler angles are positive
3953 if (x < F_PI_BY_TWO) x += F_TWO_PI;
3954 if (y < F_PI_BY_TWO) y += F_TWO_PI;
3955 if (z < F_PI_BY_TWO) z += F_TWO_PI;
3956
3957 // add 45 degrees so that rounding down becomes rounding off
3958 x += F_PI_BY_TWO / 2.f;
3959 y += F_PI_BY_TWO / 2.f;
3960 z += F_PI_BY_TWO / 2.f;
3961 // round down to nearest multiple of 90 degrees
3962 x -= fmodf(x, F_PI_BY_TWO);
3963 y -= fmodf(y, F_PI_BY_TWO);
3964 z -= fmodf(z, F_PI_BY_TWO);
3965
3966 // pass the requested rotation on to the simulator
3967 local_rot.setQuat(x, y, z);
3968 attach_object->setRotation(local_rot);
3969
3970 sendListToRegions(
3971 "ObjectAttach",
3972 packAgentIDAndSessionAndAttachment,
3973 packObjectIDAndRotation,
3974 &attachment_point,
3975 SEND_ONLY_ROOTS );
3976 if (!build_mode)
3977 {
3978 deselectAll();
3979 }
3980 }
3981 }
3982} 3603}
3983 3604
3984void LLSelectMgr::sendDetach() 3605void LLSelectMgr::sendDetach()
3985{ 3606{
3986 if (!mSelectedObjects.getNumNodes() || mSelectType == SELECT_TYPE_WORLD) 3607 if (!mSelectedObjects->getNumNodes() || mSelectedObjects->mSelectType == SELECT_TYPE_WORLD)
3987 { 3608 {
3988 return; 3609 return;
3989 } 3610 }
@@ -3999,7 +3620,7 @@ void LLSelectMgr::sendDetach()
3999 3620
4000void LLSelectMgr::sendDropAttachment() 3621void LLSelectMgr::sendDropAttachment()
4001{ 3622{
4002 if (!mSelectedObjects.getNumNodes() || mSelectType == SELECT_TYPE_WORLD) 3623 if (!mSelectedObjects->getNumNodes() || mSelectedObjects->mSelectType == SELECT_TYPE_WORLD)
4003 { 3624 {
4004 return; 3625 return;
4005 } 3626 }
@@ -4018,7 +3639,7 @@ void LLSelectMgr::sendDropAttachment()
4018 3639
4019void LLSelectMgr::sendLink() 3640void LLSelectMgr::sendLink()
4020{ 3641{
4021 if (!mSelectedObjects.getNumNodes()) 3642 if (!mSelectedObjects->getNumNodes())
4022 { 3643 {
4023 return; 3644 return;
4024 } 3645 }
@@ -4033,7 +3654,7 @@ void LLSelectMgr::sendLink()
4033 3654
4034void LLSelectMgr::sendDelink() 3655void LLSelectMgr::sendDelink()
4035{ 3656{
4036 if (!mSelectedObjects.getNumNodes()) 3657 if (!mSelectedObjects->getNumNodes())
4037 { 3658 {
4038 return; 3659 return;
4039 } 3660 }
@@ -4055,7 +3676,7 @@ void LLSelectMgr::sendDelink()
4055 3676
4056void LLSelectMgr::sendHinge(U8 type) 3677void LLSelectMgr::sendHinge(U8 type)
4057{ 3678{
4058 if (!mSelectedObjects.getNumNodes()) 3679 if (!mSelectedObjects->getNumNodes())
4059 { 3680 {
4060 return; 3681 return;
4061 } 3682 }
@@ -4071,7 +3692,7 @@ void LLSelectMgr::sendHinge(U8 type)
4071 3692
4072void LLSelectMgr::sendDehinge() 3693void LLSelectMgr::sendDehinge()
4073{ 3694{
4074 if (!mSelectedObjects.getNumNodes()) 3695 if (!mSelectedObjects->getNumNodes())
4075 { 3696 {
4076 return; 3697 return;
4077 } 3698 }
@@ -4086,7 +3707,7 @@ void LLSelectMgr::sendDehinge()
4086 3707
4087void LLSelectMgr::sendSelect() 3708void LLSelectMgr::sendSelect()
4088{ 3709{
4089 if (!mSelectedObjects.getNumNodes()) 3710 if (!mSelectedObjects->getNumNodes())
4090 { 3711 {
4091 return; 3712 return;
4092 } 3713 }
@@ -4116,7 +3737,7 @@ void LLSelectMgr::selectionDump()
4116{ 3737{
4117 LLViewerObject *object; 3738 LLViewerObject *object;
4118 3739
4119 for (object = getFirstObject(); object; object = getNextObject() ) 3740 for (object = mSelectedObjects->getFirstObject(); object; object = mSelectedObjects->getNextObject() )
4120 { 3741 {
4121 object->dump(); 3742 object->dump();
4122 } 3743 }
@@ -4125,7 +3746,7 @@ void LLSelectMgr::selectionDump()
4125void LLSelectMgr::saveSelectedObjectColors() 3746void LLSelectMgr::saveSelectedObjectColors()
4126{ 3747{
4127 LLSelectNode* selectNode; 3748 LLSelectNode* selectNode;
4128 for (selectNode = getFirstNode(); selectNode; selectNode = getNextNode() ) 3749 for (selectNode = mSelectedObjects->getFirstNode(); selectNode; selectNode = mSelectedObjects->getNextNode() )
4129 { 3750 {
4130 selectNode->saveColors(); 3751 selectNode->saveColors();
4131 } 3752 }
@@ -4136,7 +3757,7 @@ void LLSelectMgr::saveSelectedObjectTextures()
4136 LLSelectNode* selectNode; 3757 LLSelectNode* selectNode;
4137 3758
4138 // invalidate current selection so we update saved textures 3759 // invalidate current selection so we update saved textures
4139 for (selectNode = getFirstNode(); selectNode; selectNode = getNextNode() ) 3760 for (selectNode = mSelectedObjects->getFirstNode(); selectNode; selectNode = mSelectedObjects->getNextNode() )
4140 { 3761 {
4141 selectNode->mValid = FALSE; 3762 selectNode->mValid = FALSE;
4142 } 3763 }
@@ -4152,13 +3773,13 @@ void LLSelectMgr::saveSelectedObjectTransform(EActionType action_type)
4152{ 3773{
4153 LLSelectNode* selectNode; 3774 LLSelectNode* selectNode;
4154 3775
4155 if (isEmpty()) 3776 if (mSelectedObjects->isEmpty())
4156 { 3777 {
4157 // nothing selected, so nothing to save 3778 // nothing selected, so nothing to save
4158 return; 3779 return;
4159 } 3780 }
4160 3781
4161 for (selectNode = getFirstNode(); selectNode; selectNode = getNextNode() ) 3782 for (selectNode = mSelectedObjects->getFirstNode(); selectNode; selectNode = mSelectedObjects->getNextNode() )
4162 { 3783 {
4163 LLViewerObject* object; 3784 LLViewerObject* object;
4164 object = selectNode->getObject(); 3785 object = selectNode->getObject();
@@ -4168,7 +3789,10 @@ void LLSelectMgr::saveSelectedObjectTransform(EActionType action_type)
4168 if (object->isRootEdit()) 3789 if (object->isRootEdit())
4169 { 3790 {
4170 LLXform* parent_xform = object->mDrawable->getXform()->getParent(); 3791 LLXform* parent_xform = object->mDrawable->getXform()->getParent();
4171 selectNode->mSavedPositionGlobal = gAgent.getPosGlobalFromAgent((object->getPosition() * parent_xform->getWorldRotation()) + parent_xform->getWorldPosition()); 3792 if (parent_xform)
3793 {
3794 selectNode->mSavedPositionGlobal = gAgent.getPosGlobalFromAgent((object->getPosition() * parent_xform->getWorldRotation()) + parent_xform->getWorldPosition());
3795 }
4172 } 3796 }
4173 else 3797 else
4174 { 3798 {
@@ -4189,42 +3813,6 @@ void LLSelectMgr::saveSelectedObjectTransform(EActionType action_type)
4189 selectNode->mSavedScale = object->getScale(); 3813 selectNode->mSavedScale = object->getScale();
4190 selectNode->saveTextureScaleRatios(); 3814 selectNode->saveTextureScaleRatios();
4191 3815
4192 if (object->isAttachment() &&
4193 action_type != SELECT_ACTION_TYPE_PICK)
4194 {
4195 LLSelectAction* selectAction = new LLSelectAction();
4196 selectAction->mActionType = action_type;
4197 selectAction->mPosition = object->getPosition();
4198 selectAction->mRotation = object->getRotation();
4199 selectAction->mScale = object->getScale();
4200 selectAction->mObjectID = object->getID();
4201 selectAction->mIndividualSelection = selectNode->mIndividualSelection;
4202
4203 mUndoQueue.push_back(selectAction);
4204
4205 while ((mUndoQueue.size() > (U32)MAX_ACTION_QUEUE_SIZE))
4206 {
4207 LLSelectAction* action = mUndoQueue.front();
4208 mUndoQueue.pop_front();
4209 delete action;
4210 }
4211
4212 // remove this object from the redo queue
4213 std::deque<LLSelectAction*>::iterator it;
4214 for (it = mRedoQueue.begin(); it != mRedoQueue.end();)
4215 {
4216 if ((*it)->mObjectID == object->getID())
4217 {
4218 LLSelectAction* actionp = *it;
4219 it = mRedoQueue.erase(it);
4220 delete actionp;
4221 }
4222 else
4223 {
4224 ++it;
4225 }
4226 }
4227 }
4228 } 3816 }
4229 mSavedSelectionBBox = getBBoxOfSelection(); 3817 mSavedSelectionBBox = getBBoxOfSelection();
4230} 3818}
@@ -4233,7 +3821,7 @@ void LLSelectMgr::selectionUpdatePhysics(BOOL physics)
4233{ 3821{
4234 LLViewerObject *object; 3822 LLViewerObject *object;
4235 3823
4236 for (object = getFirstObject(); object; object = getNextObject() ) 3824 for (object = mSelectedObjects->getFirstObject(); object; object = mSelectedObjects->getNextObject() )
4237 { 3825 {
4238 if ( !object->permModify() // preemptive permissions check 3826 if ( !object->permModify() // preemptive permissions check
4239 || !(object->isRoot() // don't send for child objects 3827 || !(object->isRoot() // don't send for child objects
@@ -4249,7 +3837,7 @@ void LLSelectMgr::selectionUpdateTemporary(BOOL is_temporary)
4249{ 3837{
4250 LLViewerObject *object; 3838 LLViewerObject *object;
4251 3839
4252 for (object = getFirstObject(); object; object = getNextObject() ) 3840 for (object = mSelectedObjects->getFirstObject(); object; object = mSelectedObjects->getNextObject() )
4253 { 3841 {
4254 if ( !object->permModify() // preemptive permissions check 3842 if ( !object->permModify() // preemptive permissions check
4255 || !(object->isRoot() // don't send for child objects 3843 || !(object->isRoot() // don't send for child objects
@@ -4265,7 +3853,7 @@ void LLSelectMgr::selectionUpdatePhantom(BOOL is_phantom)
4265{ 3853{
4266 LLViewerObject *object; 3854 LLViewerObject *object;
4267 3855
4268 for (object = getFirstObject(); object; object = getNextObject() ) 3856 for (object = mSelectedObjects->getFirstObject(); object; object = mSelectedObjects->getNextObject() )
4269 { 3857 {
4270 if ( !object->permModify() // preemptive permissions check 3858 if ( !object->permModify() // preemptive permissions check
4271 || !(object->isRoot() // don't send for child objects 3859 || !(object->isRoot() // don't send for child objects
@@ -4281,7 +3869,7 @@ void LLSelectMgr::selectionUpdateCastShadows(BOOL cast_shadows)
4281{ 3869{
4282 LLViewerObject *object; 3870 LLViewerObject *object;
4283 3871
4284 for (object = getFirstObject(); object; object = getNextObject() ) 3872 for (object = mSelectedObjects->getFirstObject(); object; object = mSelectedObjects->getNextObject() )
4285 { 3873 {
4286 if ( !object->permModify() // preemptive permissions check 3874 if ( !object->permModify() // preemptive permissions check
4287 || object->isJointChild()) 3875 || object->isJointChild())
@@ -4505,70 +4093,81 @@ void LLSelectMgr::sendListToRegions(const LLString& message_name,
4505 S32 packets_sent = 0; 4093 S32 packets_sent = 0;
4506 S32 objects_in_this_packet = 0; 4094 S32 objects_in_this_packet = 0;
4507 4095
4096
4097 //clear update override data (allow next update through)
4098 for (node = mSelectedObjects->getFirstNode();
4099 node;
4100 node = mSelectedObjects->getNextNode())
4101 {
4102 node->mLastPositionLocal.setVec(0,0,0);
4103 node->mLastRotation = LLQuaternion();
4104 node->mLastScale.setVec(0,0,0);
4105 }
4106
4508 std::queue<LLSelectNode*> nodes_to_send; 4107 std::queue<LLSelectNode*> nodes_to_send;
4509 4108
4510 switch(send_type) 4109 switch(send_type)
4511 { 4110 {
4512 case SEND_ONLY_ROOTS: 4111 case SEND_ONLY_ROOTS:
4513 node = mSelectedObjects.getFirstRootNode(); 4112 node = mSelectedObjects->getFirstRootNode();
4514 while(node) 4113 while(node)
4515 { 4114 {
4516 nodes_to_send.push(node); 4115 nodes_to_send.push(node);
4517 node = mSelectedObjects.getNextRootNode(); 4116 node = mSelectedObjects->getNextRootNode();
4518 } 4117 }
4519 break; 4118 break;
4520 case SEND_INDIVIDUALS: 4119 case SEND_INDIVIDUALS:
4521 node = mSelectedObjects.getFirstNode(); 4120 node = mSelectedObjects->getFirstNode();
4522 while(node) 4121 while(node)
4523 { 4122 {
4524 nodes_to_send.push(node); 4123 nodes_to_send.push(node);
4525 node = mSelectedObjects.getNextNode(); 4124 node = mSelectedObjects->getNextNode();
4526 } 4125 }
4527 break; 4126 break;
4528 case SEND_ROOTS_FIRST: 4127 case SEND_ROOTS_FIRST:
4529 // first roots... 4128 // first roots...
4530 node = mSelectedObjects.getFirstNode(); 4129 node = mSelectedObjects->getFirstNode();
4531 while(node) 4130 while(node)
4532 { 4131 {
4533 if (node->getObject()->isRootEdit()) 4132 if (node->getObject()->isRootEdit())
4534 { 4133 {
4535 nodes_to_send.push(node); 4134 nodes_to_send.push(node);
4536 } 4135 }
4537 node = mSelectedObjects.getNextNode(); 4136 node = mSelectedObjects->getNextNode();
4538 } 4137 }
4539 4138
4540 // then children... 4139 // then children...
4541 node = mSelectedObjects.getFirstNode(); 4140 node = mSelectedObjects->getFirstNode();
4542 while(node) 4141 while(node)
4543 { 4142 {
4544 if (!node->getObject()->isRootEdit()) 4143 if (!node->getObject()->isRootEdit())
4545 { 4144 {
4546 nodes_to_send.push(node); 4145 nodes_to_send.push(node);
4547 } 4146 }
4548 node = mSelectedObjects.getNextNode(); 4147 node = mSelectedObjects->getNextNode();
4549 } 4148 }
4550 break; 4149 break;
4551 case SEND_CHILDREN_FIRST: 4150 case SEND_CHILDREN_FIRST:
4552 // first children... 4151 // first children...
4553 node = mSelectedObjects.getFirstNode(); 4152 node = mSelectedObjects->getFirstNode();
4554 while(node) 4153 while(node)
4555 { 4154 {
4556 if (!node->getObject()->isRootEdit()) 4155 if (!node->getObject()->isRootEdit())
4557 { 4156 {
4558 nodes_to_send.push(node); 4157 nodes_to_send.push(node);
4559 } 4158 }
4560 node = mSelectedObjects.getNextNode(); 4159 node = mSelectedObjects->getNextNode();
4561 } 4160 }
4562 4161
4563 // ...then roots 4162 // ...then roots
4564 node = mSelectedObjects.getFirstNode(); 4163 node = mSelectedObjects->getFirstNode();
4565 while(node) 4164 while(node)
4566 { 4165 {
4567 if (node->getObject()->isRootEdit()) 4166 if (node->getObject()->isRootEdit())
4568 { 4167 {
4569 nodes_to_send.push(node); 4168 nodes_to_send.push(node);
4570 } 4169 }
4571 node = mSelectedObjects.getNextNode(); 4170 node = mSelectedObjects->getNextNode();
4572 } 4171 }
4573 break; 4172 break;
4574 4173
@@ -4720,14 +4319,14 @@ void LLSelectMgr::processObjectProperties(LLMessageSystem* msg, void** user_data
4720 4319
4721 msg->getUUIDFast(_PREHASH_ObjectData, _PREHASH_LastOwnerID, last_owner_id, i); 4320 msg->getUUIDFast(_PREHASH_ObjectData, _PREHASH_LastOwnerID, last_owner_id, i);
4722 4321
4723 char name[DB_INV_ITEM_NAME_BUF_SIZE]; 4322 char name[DB_INV_ITEM_NAME_BUF_SIZE]; /* Flawfinder: ignore */
4724 msg->getStringFast(_PREHASH_ObjectData, _PREHASH_Name, DB_INV_ITEM_NAME_BUF_SIZE, name, i); 4323 msg->getStringFast(_PREHASH_ObjectData, _PREHASH_Name, DB_INV_ITEM_NAME_BUF_SIZE, name, i);
4725 char desc[DB_INV_ITEM_DESC_BUF_SIZE]; 4324 char desc[DB_INV_ITEM_DESC_BUF_SIZE]; /* Flawfinder: ignore */
4726 msg->getStringFast(_PREHASH_ObjectData, _PREHASH_Description, DB_INV_ITEM_DESC_BUF_SIZE, desc, i); 4325 msg->getStringFast(_PREHASH_ObjectData, _PREHASH_Description, DB_INV_ITEM_DESC_BUF_SIZE, desc, i);
4727 4326
4728 char touch_name[DB_INV_ITEM_NAME_BUF_SIZE]; 4327 char touch_name[DB_INV_ITEM_NAME_BUF_SIZE]; /* Flawfinder: ignore */
4729 msg->getStringFast(_PREHASH_ObjectData, _PREHASH_TouchName, DB_INV_ITEM_NAME_BUF_SIZE, touch_name, i); 4328 msg->getStringFast(_PREHASH_ObjectData, _PREHASH_TouchName, DB_INV_ITEM_NAME_BUF_SIZE, touch_name, i);
4730 char sit_name[DB_INV_ITEM_DESC_BUF_SIZE]; 4329 char sit_name[DB_INV_ITEM_DESC_BUF_SIZE]; /* Flawfinder: ignore */
4731 msg->getStringFast(_PREHASH_ObjectData, _PREHASH_SitName, DB_INV_ITEM_DESC_BUF_SIZE, sit_name, i); 4330 msg->getStringFast(_PREHASH_ObjectData, _PREHASH_SitName, DB_INV_ITEM_DESC_BUF_SIZE, sit_name, i);
4732 4331
4733 //unpack TE IDs 4332 //unpack TE IDs
@@ -4741,7 +4340,7 @@ void LLSelectMgr::processObjectProperties(LLMessageSystem* msg, void** user_data
4741 for (S32 buf_offset = 0; buf_offset < size; buf_offset += UUID_BYTES) 4340 for (S32 buf_offset = 0; buf_offset < size; buf_offset += UUID_BYTES)
4742 { 4341 {
4743 LLUUID id; 4342 LLUUID id;
4744 memcpy(id.mData, packed_buffer + buf_offset, UUID_BYTES); 4343 memcpy(id.mData, packed_buffer + buf_offset, UUID_BYTES); /* Flawfinder: ignore */
4745 texture_ids.push_back(id); 4344 texture_ids.push_back(id);
4746 } 4345 }
4747 } 4346 }
@@ -4750,9 +4349,9 @@ void LLSelectMgr::processObjectProperties(LLMessageSystem* msg, void** user_data
4750 // Iterate through nodes at end, since it can be on both the regular AND hover list 4349 // Iterate through nodes at end, since it can be on both the regular AND hover list
4751 BOOL found = FALSE; 4350 BOOL found = FALSE;
4752 LLSelectNode* node; 4351 LLSelectNode* node;
4753 for (node = gSelectMgr->mSelectedObjects.getFirstNode(); 4352 for (node = gSelectMgr->mSelectedObjects->getFirstNode();
4754 node; 4353 node;
4755 node = gSelectMgr->mSelectedObjects.getNextNode()) 4354 node = gSelectMgr->mSelectedObjects->getNextNode())
4756 { 4355 {
4757 if (node->getObject()->mID == id) 4356 if (node->getObject()->mID == id)
4758 { 4357 {
@@ -4874,10 +4473,10 @@ void LLSelectMgr::processObjectPropertiesFamily(LLMessageSystem* msg, void** use
4874 msg->getUUIDFast(_PREHASH_ObjectData, _PREHASH_LastOwnerID, last_owner_id ); 4473 msg->getUUIDFast(_PREHASH_ObjectData, _PREHASH_LastOwnerID, last_owner_id );
4875 4474
4876 // unpack name & desc 4475 // unpack name & desc
4877 char name[DB_INV_ITEM_NAME_BUF_SIZE]; 4476 char name[DB_INV_ITEM_NAME_BUF_SIZE]; /* Flawfinder: ignore */
4878 msg->getStringFast(_PREHASH_ObjectData, _PREHASH_Name, DB_INV_ITEM_NAME_BUF_SIZE, name); 4477 msg->getStringFast(_PREHASH_ObjectData, _PREHASH_Name, DB_INV_ITEM_NAME_BUF_SIZE, name);
4879 4478
4880 char desc[DB_INV_ITEM_DESC_BUF_SIZE]; 4479 char desc[DB_INV_ITEM_DESC_BUF_SIZE]; /* Flawfinder: ignore */
4881 msg->getStringFast(_PREHASH_ObjectData, _PREHASH_Description, DB_INV_ITEM_DESC_BUF_SIZE, desc); 4480 msg->getStringFast(_PREHASH_ObjectData, _PREHASH_Description, DB_INV_ITEM_DESC_BUF_SIZE, desc);
4882 4481
4883 // the reporter widget askes the server for info about picked objects 4482 // the reporter widget askes the server for info about picked objects
@@ -4887,8 +4486,8 @@ void LLSelectMgr::processObjectPropertiesFamily(LLMessageSystem* msg, void** use
4887 LLFloaterReporter *reporterp = LLFloaterReporter::getReporter(report_type); 4486 LLFloaterReporter *reporterp = LLFloaterReporter::getReporter(report_type);
4888 if (reporterp) 4487 if (reporterp)
4889 { 4488 {
4890 char first_name[DB_FIRST_NAME_BUF_SIZE]; 4489 char first_name[DB_FIRST_NAME_BUF_SIZE]; /* Flawfinder: ignore */
4891 char last_name[DB_LAST_NAME_BUF_SIZE]; 4490 char last_name[DB_LAST_NAME_BUF_SIZE]; /* Flawfinder: ignore */
4892 gCacheName->getName(owner_id, first_name, last_name); 4491 gCacheName->getName(owner_id, first_name, last_name);
4893 LLString fullname(first_name); 4492 LLString fullname(first_name);
4894 fullname.append(" "); 4493 fullname.append(" ");
@@ -4900,9 +4499,9 @@ void LLSelectMgr::processObjectPropertiesFamily(LLMessageSystem* msg, void** use
4900 // Now look through all of the hovered nodes 4499 // Now look through all of the hovered nodes
4901 BOOL found = FALSE; 4500 BOOL found = FALSE;
4902 LLSelectNode* node; 4501 LLSelectNode* node;
4903 for (node = gSelectMgr->mHoverObjects.getFirstNode(); 4502 for (node = gSelectMgr->mHoverObjects->getFirstNode();
4904 node; 4503 node;
4905 node = gSelectMgr->mHoverObjects.getNextNode()) 4504 node = gSelectMgr->mHoverObjects->getNextNode())
4906 { 4505 {
4907 if (node->getObject()->mID == id) 4506 if (node->getObject()->mID == id)
4908 { 4507 {
@@ -4985,7 +4584,7 @@ void LLSelectMgr::updateSilhouettes()
4985 4584
4986 if((cameraPos - mLastCameraPos).magVecSquared() > SILHOUETTE_UPDATE_THRESHOLD_SQUARED * currentCameraZoom * currentCameraZoom) 4585 if((cameraPos - mLastCameraPos).magVecSquared() > SILHOUETTE_UPDATE_THRESHOLD_SQUARED * currentCameraZoom * currentCameraZoom)
4987 { 4586 {
4988 for (node = mSelectedObjects.getFirstNode(); node; node = mSelectedObjects.getNextNode() ) 4587 for (node = mSelectedObjects->getFirstNode(); node; node = mSelectedObjects->getNextNode() )
4989 { 4588 {
4990 if (node->getObject()) 4589 if (node->getObject())
4991 { 4590 {
@@ -4998,7 +4597,7 @@ void LLSelectMgr::updateSilhouettes()
4998 4597
4999 LLDynamicArray<LLViewerObject*> changed_objects; 4598 LLDynamicArray<LLViewerObject*> changed_objects;
5000 4599
5001 if (mSelectedObjects.getNumNodes()) 4600 if (mSelectedObjects->getNumNodes())
5002 { 4601 {
5003 //gGLSPipelineSelection.set(); 4602 //gGLSPipelineSelection.set();
5004 4603
@@ -5007,7 +4606,7 @@ void LLSelectMgr::updateSilhouettes()
5007 4606
5008 for (S32 pass = 0; pass < 2; pass++) 4607 for (S32 pass = 0; pass < 2; pass++)
5009 { 4608 {
5010 for (node = mSelectedObjects.getFirstNode(); node; node = mSelectedObjects.getNextNode() ) 4609 for (node = mSelectedObjects->getFirstNode(); node; node = mSelectedObjects->getNextNode() )
5011 { 4610 {
5012 LLViewerObject* objectp = node->getObject(); 4611 LLViewerObject* objectp = node->getObject();
5013 4612
@@ -5023,7 +4622,7 @@ void LLSelectMgr::updateSilhouettes()
5023 || objectp->isChanged(LLXform::SILHOUETTE) 4622 || objectp->isChanged(LLXform::SILHOUETTE)
5024 || (objectp->getParent() && objectp->getParent()->isChanged(LLXform::SILHOUETTE))) 4623 || (objectp->getParent() && objectp->getParent()->isChanged(LLXform::SILHOUETTE)))
5025 { 4624 {
5026 if (num_sils_genned++ < MAX_SILS_PER_FRAME && objectp->mDrawable->isVisible()) 4625 if (num_sils_genned++ < MAX_SILS_PER_FRAME)// && objectp->mDrawable->isVisible())
5027 { 4626 {
5028 generateSilhouette(node, gCamera->getOrigin()); 4627 generateSilhouette(node, gCamera->getOrigin());
5029 changed_objects.put(objectp); 4628 changed_objects.put(objectp);
@@ -5077,7 +4676,7 @@ void LLSelectMgr::updateSilhouettes()
5077 // remove highlight nodes not in roots list 4676 // remove highlight nodes not in roots list
5078 LLDynamicArray<LLSelectNode*> remove_these_nodes; 4677 LLDynamicArray<LLSelectNode*> remove_these_nodes;
5079 LLDynamicArray<LLViewerObject*> remove_these_roots; 4678 LLDynamicArray<LLViewerObject*> remove_these_roots;
5080 for (LLSelectNode* nodep = mHighlightedObjects.getFirstNode(); nodep; nodep = mHighlightedObjects.getNextNode()) 4679 for (LLSelectNode* nodep = mHighlightedObjects->getFirstNode(); nodep; nodep = mHighlightedObjects->getNextNode())
5081 { 4680 {
5082 LLViewerObject* objectp = nodep->getObject(); 4681 LLViewerObject* objectp = nodep->getObject();
5083 if (objectp->isRoot() || !select_linked_set) 4682 if (objectp->isRoot() || !select_linked_set)
@@ -5106,7 +4705,7 @@ void LLSelectMgr::updateSilhouettes()
5106 S32 i; 4705 S32 i;
5107 for (i = 0; i < remove_these_nodes.count(); i++) 4706 for (i = 0; i < remove_these_nodes.count(); i++)
5108 { 4707 {
5109 mHighlightedObjects.removeNode(remove_these_nodes[i]); 4708 mHighlightedObjects->removeNode(remove_these_nodes[i]);
5110 } 4709 }
5111 4710
5112 // remove all root objects already being highlighted 4711 // remove all root objects already being highlighted
@@ -5128,7 +4727,7 @@ void LLSelectMgr::updateSilhouettes()
5128 continue; 4727 continue;
5129 } 4728 }
5130 4729
5131 mHighlightedObjects.addNode(rect_select_node); 4730 mHighlightedObjects->addNode(rect_select_node);
5132 4731
5133 if (!select_linked_set) 4732 if (!select_linked_set)
5134 { 4733 {
@@ -5147,7 +4746,7 @@ void LLSelectMgr::updateSilhouettes()
5147 4746
5148 rect_select_node = new LLSelectNode(objectp->mChildList[i], TRUE); 4747 rect_select_node = new LLSelectNode(objectp->mChildList[i], TRUE);
5149 rect_select_node->selectAllTEs(TRUE); 4748 rect_select_node->selectAllTEs(TRUE);
5150 mHighlightedObjects.addNode(rect_select_node); 4749 mHighlightedObjects->addNode(rect_select_node);
5151 } 4750 }
5152 } 4751 }
5153 } 4752 }
@@ -5158,7 +4757,7 @@ void LLSelectMgr::updateSilhouettes()
5158 //BOOL subtracting_from_selection = (gKeyboard->currentMask(TRUE) == MASK_CONTROL); 4757 //BOOL subtracting_from_selection = (gKeyboard->currentMask(TRUE) == MASK_CONTROL);
5159 for (S32 pass = 0; pass < 2; pass++) 4758 for (S32 pass = 0; pass < 2; pass++)
5160 { 4759 {
5161 for (node = mHighlightedObjects.getFirstNode(); node; node = mHighlightedObjects.getNextNode() ) 4760 for (node = mHighlightedObjects->getFirstNode(); node; node = mHighlightedObjects->getNextNode() )
5162 { 4761 {
5163 LLViewerObject* objectp = node->getObject(); 4762 LLViewerObject* objectp = node->getObject();
5164 4763
@@ -5207,7 +4806,7 @@ void LLSelectMgr::updateSilhouettes()
5207 } 4806 }
5208 else 4807 else
5209 { 4808 {
5210 mHighlightedObjects.deleteAllNodes(); 4809 mHighlightedObjects->deleteAllNodes();
5211 } 4810 }
5212 4811
5213 for (S32 i = 0; i < changed_objects.count(); i++) 4812 for (S32 i = 0; i < changed_objects.count(); i++)
@@ -5254,13 +4853,12 @@ void LLSelectMgr::renderSilhouettes(BOOL for_hud)
5254 glTranslatef(-hud_bbox.getCenterLocal().mV[VX] + (depth *0.5f), 0.f, 0.f); 4853 glTranslatef(-hud_bbox.getCenterLocal().mV[VX] + (depth *0.5f), 0.f, 0.f);
5255 glScalef(cur_zoom, cur_zoom, cur_zoom); 4854 glScalef(cur_zoom, cur_zoom, cur_zoom);
5256 } 4855 }
5257 if (mSelectedObjects.getNumNodes()) 4856 if (mSelectedObjects->getNumNodes())
5258 { 4857 {
5259 glPushAttrib(GL_FOG_BIT);
5260 LLUUID inspect_item_id = LLFloaterInspect::getSelectedUUID(); 4858 LLUUID inspect_item_id = LLFloaterInspect::getSelectedUUID();
5261 for (S32 pass = 0; pass < 2; pass++) 4859 for (S32 pass = 0; pass < 2; pass++)
5262 { 4860 {
5263 for (node = mSelectedObjects.getFirstNode(); node; node = mSelectedObjects.getNextNode() ) 4861 for (node = mSelectedObjects->getFirstNode(); node; node = mSelectedObjects->getNextNode() )
5264 { 4862 {
5265 LLViewerObject* objectp = node->getObject(); 4863 LLViewerObject* objectp = node->getObject();
5266 if (objectp->isHUDAttachment() != for_hud) 4864 if (objectp->isHUDAttachment() != for_hud)
@@ -5288,16 +4886,15 @@ void LLSelectMgr::renderSilhouettes(BOOL for_hud)
5288 } 4886 }
5289 } 4887 }
5290 } 4888 }
5291 glPopAttrib();
5292 } 4889 }
5293 4890
5294 if (mHighlightedObjects.getNumNodes()) 4891 if (mHighlightedObjects->getNumNodes())
5295 { 4892 {
5296 // render silhouettes for highlighted objects 4893 // render silhouettes for highlighted objects
5297 BOOL subtracting_from_selection = (gKeyboard->currentMask(TRUE) == MASK_CONTROL); 4894 BOOL subtracting_from_selection = (gKeyboard->currentMask(TRUE) == MASK_CONTROL);
5298 for (S32 pass = 0; pass < 2; pass++) 4895 for (S32 pass = 0; pass < 2; pass++)
5299 { 4896 {
5300 for (node = mHighlightedObjects.getFirstNode(); node; node = mHighlightedObjects.getNextNode() ) 4897 for (node = mHighlightedObjects->getFirstNode(); node; node = mHighlightedObjects->getNextNode() )
5301 { 4898 {
5302 LLViewerObject* objectp = node->getObject(); 4899 LLViewerObject* objectp = node->getObject();
5303 if (objectp->isHUDAttachment() != for_hud) 4900 if (objectp->isHUDAttachment() != for_hud)
@@ -5706,12 +5303,7 @@ void LLSelectNode::renderOneSilhouette(const LLColor4 &color)
5706 } 5303 }
5707 5304
5708 BOOL is_hud_object = objectp->isHUDAttachment(); 5305 BOOL is_hud_object = objectp->isHUDAttachment();
5709 5306
5710 if (!drawable->isVisible() && !is_hud_object)
5711 {
5712 return;
5713 }
5714
5715 if (mSilhouetteVertices.size() == 0 || mSilhouetteNormals.size() != mSilhouetteVertices.size()) 5307 if (mSilhouetteVertices.size() == 0 || mSilhouetteNormals.size() != mSilhouetteVertices.size())
5716 { 5308 {
5717 return; 5309 return;
@@ -5742,7 +5334,7 @@ void LLSelectNode::renderOneSilhouette(const LLColor4 &color)
5742 else 5334 else
5743 { 5335 {
5744 LLVector3 view_vector = gCamera->getOrigin() - objectp->getRenderPosition(); 5336 LLVector3 view_vector = gCamera->getOrigin() - objectp->getRenderPosition();
5745 silhouette_thickness = drawable->mDistanceWRTCamera * LLSelectMgr::sHighlightThickness * (gCamera->getView() / gCamera->getDefaultFOV()); 5337 silhouette_thickness = view_vector.magVec() * LLSelectMgr::sHighlightThickness * (gCamera->getView() / gCamera->getDefaultFOV());
5746 } 5338 }
5747 F32 animationTime = (F32)LLFrameTimer::getElapsedSeconds(); 5339 F32 animationTime = (F32)LLFrameTimer::getElapsedSeconds();
5748 5340
@@ -5768,7 +5360,6 @@ void LLSelectNode::renderOneSilhouette(const LLColor4 &color)
5768 S32 i = 0; 5360 S32 i = 0;
5769 for (S32 seg_num = 0; seg_num < (S32)mSilhouetteSegments.size(); seg_num++) 5361 for (S32 seg_num = 0; seg_num < (S32)mSilhouetteSegments.size(); seg_num++)
5770 { 5362 {
5771// S32 first_i = i;
5772 for(; i < mSilhouetteSegments[seg_num]; i++) 5363 for(; i < mSilhouetteSegments[seg_num]; i++)
5773 { 5364 {
5774 u_coord += u_divisor * LLSelectMgr::sHighlightUScale; 5365 u_coord += u_divisor * LLSelectMgr::sHighlightUScale;
@@ -5777,11 +5368,6 @@ void LLSelectNode::renderOneSilhouette(const LLColor4 &color)
5777 glTexCoord2f( u_coord, v_coord ); 5368 glTexCoord2f( u_coord, v_coord );
5778 glVertex3fv( mSilhouetteVertices[i].mV ); 5369 glVertex3fv( mSilhouetteVertices[i].mV );
5779 } 5370 }
5780
5781 /*u_coord += u_divisor * LLSelectMgr::sHighlightUScale;
5782 glColor4f(color.mV[VRED], color.mV[VGREEN], color.mV[VBLUE], 0.4f);
5783 glTexCoord2f( u_coord, v_coord );
5784 glVertex3fv( mSilhouetteVertices[first_i].mV );*/
5785 } 5371 }
5786 } 5372 }
5787 glEnd(); 5373 glEnd();
@@ -5789,7 +5375,6 @@ void LLSelectNode::renderOneSilhouette(const LLColor4 &color)
5789 } 5375 }
5790 5376
5791 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); 5377 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
5792 //glAlphaFunc(GL_GREATER, LLSelectMgr::sHighlightAlphaTest);
5793 glBegin(GL_TRIANGLES); 5378 glBegin(GL_TRIANGLES);
5794 { 5379 {
5795 S32 i = 0; 5380 S32 i = 0;
@@ -5908,7 +5493,11 @@ void LLSelectMgr::updateSelectionCenter()
5908 const F32 MOVE_SELECTION_THRESHOLD = 1.f; // Movement threshold in meters for updating selection 5493 const F32 MOVE_SELECTION_THRESHOLD = 1.f; // Movement threshold in meters for updating selection
5909 // center (tractor beam) 5494 // center (tractor beam)
5910 5495
5911 LLViewerObject* object = mSelectedObjects.getFirstObject(); 5496 //override any object updates received
5497 //for selected objects
5498 gSelectMgr->overrideObjectUpdates();
5499
5500 LLViewerObject* object = mSelectedObjects->getFirstObject();
5912 if (!object) 5501 if (!object)
5913 { 5502 {
5914 // nothing selected, probably grabbing 5503 // nothing selected, probably grabbing
@@ -5925,9 +5514,9 @@ void LLSelectMgr::updateSelectionCenter()
5925 } 5514 }
5926 else 5515 else
5927 { 5516 {
5928 mSelectType = getSelectTypeForObject(object); 5517 mSelectedObjects->mSelectType = getSelectTypeForObject(object);
5929 5518
5930 if (mSelectType == SELECT_TYPE_ATTACHMENT && gAgent.getAvatarObject()) 5519 if (mSelectedObjects->mSelectType == SELECT_TYPE_ATTACHMENT && gAgent.getAvatarObject())
5931 { 5520 {
5932 mPauseRequest = gAgent.getAvatarObject()->requestPause(); 5521 mPauseRequest = gAgent.getAvatarObject()->requestPause();
5933 } 5522 }
@@ -5936,7 +5525,7 @@ void LLSelectMgr::updateSelectionCenter()
5936 mPauseRequest = NULL; 5525 mPauseRequest = NULL;
5937 } 5526 }
5938 5527
5939 if (mSelectType != SELECT_TYPE_HUD && gAgent.getAvatarObject()) 5528 if (mSelectedObjects->mSelectType != SELECT_TYPE_HUD && gAgent.getAvatarObject())
5940 { 5529 {
5941 // reset hud ZOOM 5530 // reset hud ZOOM
5942 gAgent.getAvatarObject()->mHUDTargetZoom = 1.f; 5531 gAgent.getAvatarObject()->mHUDTargetZoom = 1.f;
@@ -5952,11 +5541,11 @@ void LLSelectMgr::updateSelectionCenter()
5952 gHUDManager->clearJoints(); 5541 gHUDManager->clearJoints();
5953 LLDynamicArray < LLViewerObject *> jointed_objects; 5542 LLDynamicArray < LLViewerObject *> jointed_objects;
5954 5543
5955 for (object = mSelectedObjects.getFirstObject(); object; object = mSelectedObjects.getNextObject() ) 5544 for (object = mSelectedObjects->getFirstObject(); object; object = mSelectedObjects->getNextObject() )
5956 { 5545 {
5957 LLViewerObject *myAvatar = gAgent.getAvatarObject(); 5546 LLViewerObject *myAvatar = gAgent.getAvatarObject();
5958 LLViewerObject *root = object->getRootEdit(); 5547 LLViewerObject *root = object->getRootEdit();
5959 if (mSelectType == SELECT_TYPE_WORLD && // not an attachment 5548 if (mSelectedObjects->mSelectType == SELECT_TYPE_WORLD && // not an attachment
5960 !root->isChild(myAvatar) && // not the object you're sitting on 5549 !root->isChild(myAvatar) && // not the object you're sitting on
5961 !object->isAvatar()) // not another avatar 5550 !object->isAvatar()) // not another avatar
5962 { 5551 {
@@ -5981,9 +5570,9 @@ void LLSelectMgr::updateSelectionCenter()
5981 } 5570 }
5982 } 5571 }
5983 5572
5984 if ( !(gAgentID == LLUUID::null) ) 5573 if ( !(gAgentID == LLUUID::null) && gToolMgr)
5985 { 5574 {
5986 LLTool *tool = gToolMgr->getCurrentTool( gKeyboard->currentMask(TRUE) ); 5575 LLTool *tool = gToolMgr->getCurrentTool();
5987 if (mShowSelection) 5576 if (mShowSelection)
5988 { 5577 {
5989 LLVector3d select_center_global; 5578 LLVector3d select_center_global;
@@ -6010,7 +5599,7 @@ void LLSelectMgr::updateSelectionCenter()
6010 } 5599 }
6011 5600
6012 // give up edit menu if no objects selected 5601 // give up edit menu if no objects selected
6013 if (gEditMenuHandler == this && getObjectCount() == 0) 5602 if (gEditMenuHandler == this && mSelectedObjects->getObjectCount() == 0)
6014 { 5603 {
6015 gEditMenuHandler = NULL; 5604 gEditMenuHandler = NULL;
6016 } 5605 }
@@ -6020,7 +5609,7 @@ void LLSelectMgr::updatePointAt()
6020{ 5609{
6021 if (mShowSelection) 5610 if (mShowSelection)
6022 { 5611 {
6023 if (getObjectCount()) 5612 if (mSelectedObjects->getObjectCount())
6024 { 5613 {
6025 LLVector3 select_offset; 5614 LLVector3 select_offset;
6026 LLViewerObject *click_object = gObjectList.findObject(gLastHitObjectID); 5615 LLViewerObject *click_object = gObjectList.findObject(gLastHitObjectID);
@@ -6036,8 +5625,8 @@ void LLSelectMgr::updatePointAt()
6036 else 5625 else
6037 { 5626 {
6038 // didn't click on an object this time, revert to pointing at center of first object 5627 // didn't click on an object this time, revert to pointing at center of first object
6039 gAgent.setPointAt(POINTAT_TARGET_SELECT, getFirstObject()); 5628 gAgent.setPointAt(POINTAT_TARGET_SELECT, mSelectedObjects->getFirstObject());
6040 gAgent.setLookAt(LOOKAT_TARGET_SELECT, getFirstObject()); 5629 gAgent.setLookAt(LOOKAT_TARGET_SELECT, mSelectedObjects->getFirstObject());
6041 } 5630 }
6042 } 5631 }
6043 else 5632 else
@@ -6067,7 +5656,7 @@ LLBBox LLSelectMgr::getBBoxOfSelection() const
6067//----------------------------------------------------------------------------- 5656//-----------------------------------------------------------------------------
6068BOOL LLSelectMgr::canUndo() 5657BOOL LLSelectMgr::canUndo()
6069{ 5658{
6070 return getFirstEditableObject() != NULL; 5659 return mSelectedObjects->getFirstEditableObject() != NULL;
6071} 5660}
6072 5661
6073//----------------------------------------------------------------------------- 5662//-----------------------------------------------------------------------------
@@ -6085,7 +5674,7 @@ void LLSelectMgr::undo()
6085//----------------------------------------------------------------------------- 5674//-----------------------------------------------------------------------------
6086BOOL LLSelectMgr::canRedo() 5675BOOL LLSelectMgr::canRedo()
6087{ 5676{
6088 return getFirstEditableObject() != NULL; 5677 return mSelectedObjects->getFirstEditableObject() != NULL;
6089} 5678}
6090 5679
6091//----------------------------------------------------------------------------- 5680//-----------------------------------------------------------------------------
@@ -6103,7 +5692,7 @@ void LLSelectMgr::redo()
6103//----------------------------------------------------------------------------- 5692//-----------------------------------------------------------------------------
6104BOOL LLSelectMgr::canDoDelete() 5693BOOL LLSelectMgr::canDoDelete()
6105{ 5694{
6106 return getFirstDeleteableObject() != NULL; 5695 return mSelectedObjects->getFirstDeleteableObject() != NULL;
6107} 5696}
6108 5697
6109//----------------------------------------------------------------------------- 5698//-----------------------------------------------------------------------------
@@ -6119,7 +5708,7 @@ void LLSelectMgr::doDelete()
6119//----------------------------------------------------------------------------- 5708//-----------------------------------------------------------------------------
6120BOOL LLSelectMgr::canDeselect() 5709BOOL LLSelectMgr::canDeselect()
6121{ 5710{
6122 return !isEmpty(); 5711 return !mSelectedObjects->isEmpty();
6123} 5712}
6124 5713
6125//----------------------------------------------------------------------------- 5714//-----------------------------------------------------------------------------
@@ -6134,7 +5723,7 @@ void LLSelectMgr::deselect()
6134//----------------------------------------------------------------------------- 5723//-----------------------------------------------------------------------------
6135BOOL LLSelectMgr::canDuplicate() 5724BOOL LLSelectMgr::canDuplicate()
6136{ 5725{
6137 return getFirstCopyableObject() != NULL; 5726 return mSelectedObjects->getFirstCopyableObject() != NULL;
6138} 5727}
6139//----------------------------------------------------------------------------- 5728//-----------------------------------------------------------------------------
6140// duplicate() 5729// duplicate()
@@ -6144,125 +5733,6 @@ void LLSelectMgr::duplicate()
6144 LLVector3 offset(0.5f, 0.5f, 0.f); 5733 LLVector3 offset(0.5f, 0.5f, 0.f);
6145 selectDuplicate(offset, TRUE); 5734 selectDuplicate(offset, TRUE);
6146} 5735}
6147//-----------------------------------------------------------------------------
6148// undoRedo()
6149//-----------------------------------------------------------------------------
6150U32 LLSelectMgr::undoRedo(std::deque<LLSelectAction*> &queue_src, std::deque<LLSelectAction*> &queue_dst, const LLUUID &object_id)
6151{
6152 if (queue_src.size() == 0)
6153 {
6154 return 0;
6155 }
6156
6157 U32 update_type = 0;
6158 std::deque<LLSelectAction*> temp_queue;
6159 LLSelectAction* src_actionp = queue_src.back();
6160
6161 while (src_actionp->mObjectID != object_id)
6162 {
6163 temp_queue.push_back(src_actionp);
6164 queue_src.pop_back();
6165 if (!queue_src.size())
6166 {
6167 // put everything back
6168 LLSelectAction* actionp;
6169 while (temp_queue.size())
6170 {
6171 actionp = temp_queue.back();
6172 temp_queue.pop_back();
6173 queue_src.push_back(actionp);
6174 }
6175 return 0;
6176 }
6177 src_actionp = queue_src.back();
6178 }
6179
6180 if(src_actionp)
6181 {
6182 LLSelectAction* dst_actionp = new LLSelectAction();
6183 dst_actionp->mActionType = src_actionp->mActionType;
6184 dst_actionp->mObjectID = src_actionp->mObjectID;
6185 dst_actionp->mIndividualSelection = src_actionp->mIndividualSelection;
6186
6187 LLViewerObject* object = gObjectList.findObject(src_actionp->mObjectID);
6188 if (object && object->mDrawable.notNull())
6189 {
6190 LLVector3 old_position_local = object->getPosition();
6191
6192 switch(src_actionp->mActionType)
6193 {
6194 case SELECT_ACTION_TYPE_MOVE:
6195 dst_actionp->mPosition = object->mDrawable->getPosition();
6196 object->setPosition(src_actionp->mPosition, TRUE);
6197 if (object->isRootEdit() && src_actionp->mIndividualSelection)
6198 {
6199 // counter-translate children
6200 LLVector3 parent_offset = (src_actionp->mPosition - old_position_local) * ~object->getRotation();
6201
6202 // counter-translate child objects if we are moving the root as an individual
6203 for (U32 child_num = 0; child_num < object->mChildList.size(); child_num++)
6204 {
6205 LLViewerObject* childp = object->mChildList[child_num];
6206 childp->setPosition(childp->getPosition() - parent_offset);
6207 }
6208 }
6209 update_type |= UPD_POSITION;
6210 break;
6211 case SELECT_ACTION_TYPE_ROTATE:
6212 dst_actionp->mPosition = object->mDrawable->getPosition();
6213 dst_actionp->mRotation = object->mDrawable->getRotation();
6214 object->setRotation(src_actionp->mRotation, TRUE);
6215 object->setPosition(src_actionp->mPosition, TRUE);
6216 if (object->isRootEdit() && src_actionp->mIndividualSelection)
6217 {
6218 // counter-translate and rotate children
6219 LLVector3 parent_offset = (src_actionp->mPosition - old_position_local) * ~object->getRotation();
6220
6221 for (U32 child_num = 0; child_num < object->mChildList.size(); child_num++)
6222 {
6223 LLViewerObject* childp = object->mChildList[child_num];
6224 LLQuaternion delta_rot_inv = dst_actionp->mRotation * ~src_actionp->mRotation;
6225 childp->setPosition((childp->getPosition() * delta_rot_inv) - parent_offset);
6226 childp->setRotation(childp->getRotation() * delta_rot_inv );
6227 }
6228 }
6229 update_type |= UPD_ROTATION | UPD_POSITION;
6230 break;
6231 case SELECT_ACTION_TYPE_SCALE:
6232 dst_actionp->mPosition = object->mDrawable->getPosition();
6233 dst_actionp->mScale = object->getScale();
6234 object->setScale(src_actionp->mScale, TRUE);
6235 object->setPosition(src_actionp->mPosition, TRUE);
6236 update_type |= UPD_SCALE | UPD_POSITION;
6237 break;
6238 default:
6239 // do nothing
6240 break;
6241 }
6242 }
6243 queue_src.pop_back();
6244 delete src_actionp;
6245 queue_dst.push_back(dst_actionp);
6246 while (queue_dst.size() > (U32)MAX_ACTION_QUEUE_SIZE)
6247 {
6248 LLSelectAction* action = queue_dst.front();
6249 queue_dst.pop_front();
6250 delete action;
6251 }
6252
6253 }
6254
6255 // put everything back
6256 LLSelectAction* actionp;
6257 while (temp_queue.size())
6258 {
6259 actionp = temp_queue.back();
6260 temp_queue.pop_back();
6261 queue_src.push_back(actionp);
6262 }
6263
6264 return update_type;
6265}
6266 5736
6267ESelectType LLSelectMgr::getSelectTypeForObject(LLViewerObject* object) 5737ESelectType LLSelectMgr::getSelectTypeForObject(LLViewerObject* object)
6268{ 5738{
@@ -6287,7 +5757,7 @@ ESelectType LLSelectMgr::getSelectTypeForObject(LLViewerObject* object)
6287void LLSelectMgr::validateSelection() 5757void LLSelectMgr::validateSelection()
6288{ 5758{
6289 LLViewerObject* objectp; 5759 LLViewerObject* objectp;
6290 for (objectp = getFirstObject(); objectp; objectp = getNextObject()) 5760 for (objectp = mSelectedObjects->getFirstObject(); objectp; objectp = mSelectedObjects->getNextObject())
6291 { 5761 {
6292 if (!canSelectObject(objectp)) 5762 if (!canSelectObject(objectp))
6293 { 5763 {
@@ -6323,64 +5793,71 @@ BOOL LLSelectMgr::canSelectObject(LLViewerObject* object)
6323 if (object->getPCode() == LLViewerObject::LL_VO_SURFACE_PATCH) return FALSE; 5793 if (object->getPCode() == LLViewerObject::LL_VO_SURFACE_PATCH) return FALSE;
6324 5794
6325 ESelectType selection_type = getSelectTypeForObject(object); 5795 ESelectType selection_type = getSelectTypeForObject(object);
6326 if (getObjectCount() > 0 && mSelectType != selection_type) return FALSE; 5796 if (mSelectedObjects->getObjectCount() > 0 && mSelectedObjects->mSelectType != selection_type) return FALSE;
6327 5797
6328 return TRUE; 5798 return TRUE;
6329} 5799}
6330 5800
6331LLSelectNodeList::LLSelectNodeList() : std::list<LLSelectNode*>() 5801LLObjectSelection::LLObjectSelection() :
5802 std::list<LLSelectNode*>(),
5803 LLRefCount(),
5804 mCurrentNode(end()),
5805 mCurrentTE(-1),
5806 mSelectType(SELECT_TYPE_WORLD)
6332{ 5807{
6333 mCurrentTE = -1;
6334 mCurrentNode = end();
6335} 5808}
6336 5809
6337LLSelectNodeList::~LLSelectNodeList() 5810LLObjectSelection::~LLObjectSelection()
6338{ 5811{
6339 std::for_each(begin(), end(), DeletePointer()); 5812 std::for_each(begin(), end(), DeletePointer());
6340} 5813}
6341 5814
6342void LLSelectNodeList::updateEffects() 5815void LLObjectSelection::updateEffects()
6343{ 5816{
6344} 5817}
6345 5818
6346S32 LLSelectNodeList::getNumNodes() 5819S32 LLObjectSelection::getNumNodes()
6347{ 5820{
6348 return size(); 5821 return size();
6349} 5822}
6350 5823
6351void LLSelectNodeList::addNode(LLSelectNode *nodep) 5824void LLObjectSelection::addNode(LLSelectNode *nodep)
6352{ 5825{
6353 push_front(nodep); 5826 push_front(nodep);
6354 mSelectNodeMap[nodep->getObject()] = nodep; 5827 mSelectNodeMap[nodep->getObject()] = nodep;
6355} 5828}
6356 5829
6357void LLSelectNodeList::addNodeAtEnd(LLSelectNode *nodep) 5830void LLObjectSelection::addNodeAtEnd(LLSelectNode *nodep)
6358{ 5831{
6359 push_back(nodep); 5832 push_back(nodep);
6360 mSelectNodeMap[nodep->getObject()] = nodep; 5833 mSelectNodeMap[nodep->getObject()] = nodep;
6361} 5834}
6362 5835
6363void LLSelectNodeList::removeNode(LLSelectNode *nodep) 5836void LLObjectSelection::removeNode(LLSelectNode *nodep)
6364{ 5837{
6365 std::list<LLSelectNode*>::iterator iter; 5838 std::list<LLSelectNode*>::iterator iter = begin();
6366 for (iter = begin(); iter != end(); ++iter) 5839 while(iter != end())
6367 { 5840 {
6368 if ((*iter) == nodep) 5841 if ((*iter) == nodep)
6369 { 5842 {
6370 mSelectNodeMap.erase(nodep->getObject()); 5843 mSelectNodeMap.erase(nodep->getObject());
6371 erase(iter++); 5844 iter = erase(iter);
5845 }
5846 else
5847 {
5848 ++iter;
6372 } 5849 }
6373 } 5850 }
6374} 5851}
6375 5852
6376void LLSelectNodeList::deleteAllNodes() 5853void LLObjectSelection::deleteAllNodes()
6377{ 5854{
6378 std::for_each(begin(), end(), DeletePointer()); 5855 std::for_each(begin(), end(), DeletePointer());
6379 clear(); 5856 clear();
6380 mSelectNodeMap.clear(); 5857 mSelectNodeMap.clear();
6381} 5858}
6382 5859
6383LLSelectNode* LLSelectNodeList::findNode(LLViewerObject* objectp) 5860LLSelectNode* LLObjectSelection::findNode(LLViewerObject* objectp)
6384{ 5861{
6385 std::map<LLViewerObject*, LLSelectNode*>::iterator found_it = mSelectNodeMap.find(objectp); 5862 std::map<LLViewerObject*, LLSelectNode*>::iterator found_it = mSelectNodeMap.find(objectp);
6386 if (found_it != mSelectNodeMap.end()) 5863 if (found_it != mSelectNodeMap.end())
@@ -6393,7 +5870,7 @@ LLSelectNode* LLSelectNodeList::findNode(LLViewerObject* objectp)
6393//----------------------------------------------------------------------------- 5870//-----------------------------------------------------------------------------
6394// getFirstNode() 5871// getFirstNode()
6395//----------------------------------------------------------------------------- 5872//-----------------------------------------------------------------------------
6396LLSelectNode *LLSelectNodeList::getFirstNode() 5873LLSelectNode *LLObjectSelection::getFirstNode()
6397{ 5874{
6398 mCurrentNode = begin();//getFirstData(); 5875 mCurrentNode = begin();//getFirstData();
6399 5876
@@ -6414,7 +5891,7 @@ LLSelectNode *LLSelectNodeList::getFirstNode()
6414//----------------------------------------------------------------------------- 5891//-----------------------------------------------------------------------------
6415// getCurrentNode() 5892// getCurrentNode()
6416//----------------------------------------------------------------------------- 5893//-----------------------------------------------------------------------------
6417LLSelectNode *LLSelectNodeList::getCurrentNode() 5894LLSelectNode *LLObjectSelection::getCurrentNode()
6418{ 5895{
6419 while (mCurrentNode != end() && !(*mCurrentNode)->getObject()) 5896 while (mCurrentNode != end() && !(*mCurrentNode)->getObject())
6420 { 5897 {
@@ -6432,7 +5909,7 @@ LLSelectNode *LLSelectNodeList::getCurrentNode()
6432//----------------------------------------------------------------------------- 5909//-----------------------------------------------------------------------------
6433// getNextNode() 5910// getNextNode()
6434//----------------------------------------------------------------------------- 5911//-----------------------------------------------------------------------------
6435LLSelectNode *LLSelectNodeList::getNextNode() 5912LLSelectNode *LLObjectSelection::getNextNode()
6436{ 5913{
6437 ++mCurrentNode; 5914 ++mCurrentNode;
6438 5915
@@ -6454,7 +5931,7 @@ LLSelectNode *LLSelectNodeList::getNextNode()
6454//----------------------------------------------------------------------------- 5931//-----------------------------------------------------------------------------
6455// getFirstObject() 5932// getFirstObject()
6456//----------------------------------------------------------------------------- 5933//-----------------------------------------------------------------------------
6457LLViewerObject* LLSelectNodeList::getFirstObject() 5934LLViewerObject* LLObjectSelection::getFirstObject()
6458{ 5935{
6459 mCurrentNode = begin(); 5936 mCurrentNode = begin();
6460 5937
@@ -6476,7 +5953,7 @@ LLViewerObject* LLSelectNodeList::getFirstObject()
6476//----------------------------------------------------------------------------- 5953//-----------------------------------------------------------------------------
6477// getNextObject() 5954// getNextObject()
6478//----------------------------------------------------------------------------- 5955//-----------------------------------------------------------------------------
6479LLViewerObject* LLSelectNodeList::getNextObject() 5956LLViewerObject* LLObjectSelection::getNextObject()
6480{ 5957{
6481 ++mCurrentNode;// = getNextData(); 5958 ++mCurrentNode;// = getNextData();
6482 5959
@@ -6499,7 +5976,7 @@ LLViewerObject* LLSelectNodeList::getNextObject()
6499//----------------------------------------------------------------------------- 5976//-----------------------------------------------------------------------------
6500// getPrimaryTE() 5977// getPrimaryTE()
6501//----------------------------------------------------------------------------- 5978//-----------------------------------------------------------------------------
6502void LLSelectNodeList::getPrimaryTE(LLViewerObject* *object, S32 *te) 5979void LLObjectSelection::getPrimaryTE(LLViewerObject* *object, S32 *te)
6503{ 5980{
6504 // initialize object and te 5981 // initialize object and te
6505 *te = 0; 5982 *te = 0;
@@ -6554,7 +6031,7 @@ void LLSelectNodeList::getPrimaryTE(LLViewerObject* *object, S32 *te)
6554//----------------------------------------------------------------------------- 6031//-----------------------------------------------------------------------------
6555// getFirstTE() 6032// getFirstTE()
6556//----------------------------------------------------------------------------- 6033//-----------------------------------------------------------------------------
6557void LLSelectNodeList::getFirstTE(LLViewerObject* *object, S32 *te) 6034void LLObjectSelection::getFirstTE(LLViewerObject* *object, S32 *te)
6558{ 6035{
6559 // start with first face 6036 // start with first face
6560 mCurrentTE = 0; 6037 mCurrentTE = 0;
@@ -6608,7 +6085,7 @@ void LLSelectNodeList::getFirstTE(LLViewerObject* *object, S32 *te)
6608//----------------------------------------------------------------------------- 6085//-----------------------------------------------------------------------------
6609// getNextFace() 6086// getNextFace()
6610//----------------------------------------------------------------------------- 6087//-----------------------------------------------------------------------------
6611void LLSelectNodeList::getNextTE(LLViewerObject* *object, S32 *te) 6088void LLObjectSelection::getNextTE(LLViewerObject* *object, S32 *te)
6612{ 6089{
6613 // try next face 6090 // try next face
6614 mCurrentTE++; 6091 mCurrentTE++;
@@ -6651,7 +6128,7 @@ void LLSelectNodeList::getNextTE(LLViewerObject* *object, S32 *te)
6651 return; 6128 return;
6652} 6129}
6653 6130
6654void LLSelectNodeList::getCurrentTE(LLViewerObject* *object, S32 *te) 6131void LLObjectSelection::getCurrentTE(LLViewerObject* *object, S32 *te)
6655{ 6132{
6656 if (mCurrentNode != end()) 6133 if (mCurrentNode != end())
6657 { 6134 {
@@ -6667,7 +6144,7 @@ void LLSelectNodeList::getCurrentTE(LLViewerObject* *object, S32 *te)
6667//----------------------------------------------------------------------------- 6144//-----------------------------------------------------------------------------
6668// getFirstRootNode() 6145// getFirstRootNode()
6669//----------------------------------------------------------------------------- 6146//-----------------------------------------------------------------------------
6670LLSelectNode *LLSelectNodeList::getFirstRootNode() 6147LLSelectNode *LLObjectSelection::getFirstRootNode()
6671{ 6148{
6672 LLSelectNode *cur_node = getFirstNode(); 6149 LLSelectNode *cur_node = getFirstNode();
6673 6150
@@ -6686,7 +6163,7 @@ LLSelectNode *LLSelectNodeList::getFirstRootNode()
6686//----------------------------------------------------------------------------- 6163//-----------------------------------------------------------------------------
6687// getNextRootNode() 6164// getNextRootNode()
6688//----------------------------------------------------------------------------- 6165//-----------------------------------------------------------------------------
6689LLSelectNode *LLSelectNodeList::getNextRootNode() 6166LLSelectNode *LLObjectSelection::getNextRootNode()
6690{ 6167{
6691 LLSelectNode *cur_node = getNextNode(); 6168 LLSelectNode *cur_node = getNextNode();
6692 6169
@@ -6704,7 +6181,7 @@ LLSelectNode *LLSelectNodeList::getNextRootNode()
6704//----------------------------------------------------------------------------- 6181//-----------------------------------------------------------------------------
6705// getFirstRootObject() 6182// getFirstRootObject()
6706//----------------------------------------------------------------------------- 6183//-----------------------------------------------------------------------------
6707LLViewerObject *LLSelectNodeList::getFirstRootObject() 6184LLViewerObject *LLObjectSelection::getFirstRootObject()
6708{ 6185{
6709 LLSelectNode *node = getFirstRootNode(); 6186 LLSelectNode *node = getFirstRootNode();
6710 6187
@@ -6722,7 +6199,7 @@ LLViewerObject *LLSelectNodeList::getFirstRootObject()
6722//----------------------------------------------------------------------------- 6199//-----------------------------------------------------------------------------
6723// getNextRootObject() 6200// getNextRootObject()
6724//----------------------------------------------------------------------------- 6201//-----------------------------------------------------------------------------
6725LLViewerObject *LLSelectNodeList::getNextRootObject() 6202LLViewerObject *LLObjectSelection::getNextRootObject()
6726{ 6203{
6727 LLSelectNode *node = getNextRootNode(); 6204 LLSelectNode *node = getNextRootNode();
6728 6205
@@ -6739,7 +6216,7 @@ LLViewerObject *LLSelectNodeList::getNextRootObject()
6739//----------------------------------------------------------------------------- 6216//-----------------------------------------------------------------------------
6740// isEmpty() 6217// isEmpty()
6741//----------------------------------------------------------------------------- 6218//-----------------------------------------------------------------------------
6742BOOL LLSelectNodeList::isEmpty() 6219BOOL LLObjectSelection::isEmpty()
6743{ 6220{
6744 return (size() == 0); 6221 return (size() == 0);
6745} 6222}
@@ -6747,7 +6224,7 @@ BOOL LLSelectNodeList::isEmpty()
6747//----------------------------------------------------------------------------- 6224//-----------------------------------------------------------------------------
6748// getOwnershipCost() 6225// getOwnershipCost()
6749//----------------------------------------------------------------------------- 6226//-----------------------------------------------------------------------------
6750BOOL LLSelectNodeList::getOwnershipCost(S32 &cost) 6227BOOL LLObjectSelection::getOwnershipCost(S32 &cost)
6751{ 6228{
6752 S32 count = 0; 6229 S32 count = 0;
6753 for( LLSelectNode* nodep = getFirstNode(); nodep; nodep = getNextNode() ) 6230 for( LLSelectNode* nodep = getFirstNode(); nodep; nodep = getNextNode() )
@@ -6759,3 +6236,341 @@ BOOL LLSelectNodeList::getOwnershipCost(S32 &cost)
6759 6236
6760 return (count > 0); 6237 return (count > 0);
6761} 6238}
6239
6240
6241
6242//-----------------------------------------------------------------------------
6243// getObjectCount()
6244//-----------------------------------------------------------------------------
6245S32 LLObjectSelection::getObjectCount()
6246{
6247 return getNumNodes();
6248}
6249
6250
6251//-----------------------------------------------------------------------------
6252// getTECount()
6253//-----------------------------------------------------------------------------
6254S32 LLObjectSelection::getTECount()
6255{
6256 S32 count = 0;
6257
6258 LLSelectNode* nodep;
6259 for (nodep = getFirstNode(); nodep; nodep = getNextNode() )
6260 {
6261 if (nodep->getObject())
6262 {
6263 S32 num_tes = nodep->getObject()->getNumTEs();
6264 for (S32 te = 0; te < num_tes; te++)
6265 {
6266 if (nodep->isTESelected(te))
6267 {
6268 count++;
6269 }
6270 }
6271 }
6272 }
6273
6274 return count;
6275}
6276
6277//-----------------------------------------------------------------------------
6278// getRootObjectCount()
6279//-----------------------------------------------------------------------------
6280S32 LLObjectSelection::getRootObjectCount()
6281{
6282 LLSelectNode *nodep;
6283
6284 S32 count = 0;
6285 for(nodep = getFirstRootNode(); nodep; nodep = getNextRootNode())
6286 {
6287 ++count;
6288 }
6289 return count;
6290}
6291
6292bool LLObjectSelection::applyToObjects(LLSelectedObjectFunctor* func)
6293{
6294 bool result = true;
6295 LLViewerObject* object;
6296 for (object = getFirstObject(); object != NULL; object = getNextObject())
6297 {
6298 result = result && func->apply(object);
6299 }
6300 return result;
6301}
6302
6303bool LLObjectSelection::applyToRootObjects(LLSelectedObjectFunctor* func)
6304{
6305 bool result = true;
6306 LLViewerObject* object;
6307 for (object = getFirstRootObject();
6308 object != NULL;
6309 object = getNextRootObject())
6310 {
6311 result = result && func->apply(object);
6312 }
6313 return result;
6314}
6315
6316bool LLObjectSelection::applyToNodes(LLSelectedNodeFunctor *func)
6317{
6318 bool result = true;
6319 LLSelectNode* node;
6320 for (node = getFirstNode(); node != NULL; node = getNextNode())
6321 {
6322 result = result && func->apply(node);
6323 }
6324 return result;
6325}
6326
6327//-----------------------------------------------------------------------------
6328// contains()
6329//-----------------------------------------------------------------------------
6330BOOL LLObjectSelection::contains(LLViewerObject* object)
6331{
6332 return findNode(object) != NULL;
6333}
6334
6335
6336//-----------------------------------------------------------------------------
6337// contains()
6338//-----------------------------------------------------------------------------
6339BOOL LLObjectSelection::contains(LLViewerObject* object, S32 te)
6340{
6341 LLSelectNode *nodep;
6342 if (te == SELECT_ALL_TES)
6343 {
6344 // ...all faces
6345 for (nodep = getFirstNode(); nodep; nodep = getNextNode() )
6346 {
6347 if (nodep->getObject() == object)
6348 {
6349 BOOL all_selected = TRUE;
6350 for (S32 i = 0; i < SELECT_MAX_TES; i++)
6351 {
6352 all_selected = all_selected && nodep->isTESelected(i);
6353 }
6354 return all_selected;
6355 }
6356 }
6357 return FALSE;
6358 }
6359 else
6360 {
6361 // ...one face
6362 for (nodep = getFirstNode(); nodep; nodep = getNextNode() )
6363 {
6364 if (nodep->getObject() == object && nodep->isTESelected(te))
6365 {
6366 return TRUE;
6367 }
6368 }
6369 return FALSE;
6370 }
6371}
6372
6373// returns TRUE is any node is currenly worn as an attachment
6374BOOL LLObjectSelection::isAttachment()
6375{
6376 return (mSelectType == SELECT_TYPE_ATTACHMENT || mSelectType == SELECT_TYPE_HUD);
6377}
6378
6379//-----------------------------------------------------------------------------
6380// getFirstMoveableNode()
6381//-----------------------------------------------------------------------------
6382LLSelectNode* LLObjectSelection::getFirstMoveableNode(BOOL get_root)
6383{
6384 LLSelectNode* selectNode = NULL;
6385
6386 if (get_root)
6387 {
6388 for(selectNode = getFirstRootNode(); selectNode; selectNode = getNextRootNode())
6389 {
6390 if( selectNode->getObject()->permMove() )
6391 {
6392 return selectNode;
6393 break;
6394 }
6395 }
6396 }
6397 for(selectNode = getFirstNode(); selectNode; selectNode = getNextNode())
6398 {
6399 if( selectNode->getObject()->permMove() )
6400 {
6401 return selectNode;
6402 break;
6403 }
6404 }
6405
6406 return NULL;
6407}
6408
6409//-----------------------------------------------------------------------------
6410// getFirstCopyableObject()
6411//-----------------------------------------------------------------------------
6412LLViewerObject* LLObjectSelection::getFirstCopyableObject(BOOL get_root)
6413{
6414 LLViewerObject* object = NULL;
6415 for(LLViewerObject* cur = getFirstObject(); cur; cur = getNextObject())
6416 {
6417 if( cur->permCopy() && !cur->isAttachment())
6418 {
6419 object = cur;
6420 break;
6421 }
6422 }
6423
6424 if (get_root && object)
6425 {
6426 LLViewerObject *parent;
6427 while ((parent = (LLViewerObject*)object->getParent()))
6428 {
6429 if (parent->isSelected())
6430 {
6431 object = parent;
6432 }
6433 else
6434 {
6435 break;
6436 }
6437 }
6438 }
6439
6440 return object;
6441}
6442
6443
6444//-----------------------------------------------------------------------------
6445// getFirstDeleteableObject()
6446//-----------------------------------------------------------------------------
6447LLViewerObject* LLObjectSelection::getFirstDeleteableObject(BOOL get_root)
6448{
6449 //RN: don't currently support deletion of child objects, as that requires separating them first
6450 // then derezzing to trash
6451 get_root = TRUE;
6452
6453 LLViewerObject* object = NULL;
6454 if (get_root)
6455 {
6456 for(LLViewerObject* current = getFirstRootObject();
6457 current != NULL;
6458 current = getNextRootObject())
6459 {
6460 // you can delete an object if permissions allow it, you are
6461 // the owner, you are an officer in the group that owns the
6462 // object, or you are not the owner but it is on land you own
6463 // or land owned by your group. (whew!)
6464 if( (current->permModify())
6465 || (current->permYouOwner())
6466 || (!current->permAnyOwner()) // public
6467 || (current->isOverAgentOwnedLand())
6468 || (current->isOverGroupOwnedLand())
6469 )
6470 {
6471
6472 if( !current->isAttachment() )
6473 {
6474 object = current;
6475 break;
6476 }
6477 }
6478 }
6479 }
6480 else
6481 {
6482 for(LLViewerObject* current = getFirstObject();
6483 current != NULL;
6484 current = getNextObject())
6485 {
6486 // you can delete an object if permissions allow it, you are
6487 // the owner, you are an officer in the group that owns the
6488 // object, or you are not the owner but it is on land you own
6489 // or land owned by your group. (whew!)
6490 if( (current->permModify())
6491 || (current->permYouOwner())
6492 || (!current->permAnyOwner()) // public
6493 || (current->isOverAgentOwnedLand())
6494 || (current->isOverGroupOwnedLand())
6495 )
6496 {
6497 if( !current->isAttachment() )
6498 {
6499 object = current;
6500 break;
6501 }
6502 }
6503 }
6504 }
6505
6506 return object;
6507}
6508
6509
6510//-----------------------------------------------------------------------------
6511// getFirstEditableObject()
6512//-----------------------------------------------------------------------------
6513LLViewerObject* LLObjectSelection::getFirstEditableObject(BOOL get_root)
6514{
6515 LLViewerObject* object = NULL;
6516 for(LLViewerObject* cur = getFirstObject(); cur; cur = getNextObject())
6517 {
6518 if( cur->permModify() )
6519 {
6520 object = cur;
6521 break;
6522 }
6523 }
6524
6525 if (get_root && object)
6526 {
6527 LLViewerObject *parent;
6528 while ((parent = (LLViewerObject*)object->getParent()))
6529 {
6530 if (parent->isSelected())
6531 {
6532 object = parent;
6533 }
6534 else
6535 {
6536 break;
6537 }
6538 }
6539 }
6540
6541 return object;
6542}
6543
6544//-----------------------------------------------------------------------------
6545// getFirstMoveableObject()
6546//-----------------------------------------------------------------------------
6547LLViewerObject* LLObjectSelection::getFirstMoveableObject(BOOL get_root)
6548{
6549 LLViewerObject* object = NULL;
6550 for(LLViewerObject* cur = getFirstObject(); cur; cur = getNextObject())
6551 {
6552 if( cur->permMove() )
6553 {
6554 object = cur;
6555 break;
6556 }
6557 }
6558
6559 if (get_root && object && !object->isJointChild())
6560 {
6561 LLViewerObject *parent;
6562 while ((parent = (LLViewerObject*)object->getParent()))
6563 {
6564 if (parent->isSelected())
6565 {
6566 object = parent;
6567 }
6568 else
6569 {
6570 break;
6571 }
6572 }
6573 }
6574
6575 return object;
6576}
diff --git a/linden/indra/newview/llselectmgr.h b/linden/indra/newview/llselectmgr.h
index fe54360..4b9a550 100644
--- a/linden/indra/newview/llselectmgr.h
+++ b/linden/indra/newview/llselectmgr.h
@@ -110,11 +110,12 @@ typedef enum e_selection_type
110 SELECT_TYPE_HUD 110 SELECT_TYPE_HUD
111}ESelectType; 111}ESelectType;
112 112
113class LLSelectNodeList : public std::list<LLSelectNode*> 113class LLObjectSelection : public std::list<LLSelectNode*>, public LLRefCount
114{ 114{
115 friend class LLSelectMgr;
115public: 116public:
116 LLSelectNodeList(); 117 LLObjectSelection();
117 virtual ~LLSelectNodeList(); 118 virtual ~LLObjectSelection();
118 119
119 void updateEffects(); 120 void updateEffects();
120 121
@@ -129,6 +130,8 @@ public:
129 LLSelectNode *getFirstRootNode(); 130 LLSelectNode *getFirstRootNode();
130 LLSelectNode *getNextRootNode(); 131 LLSelectNode *getNextRootNode();
131 132
133 LLSelectNode* getFirstMoveableNode(BOOL get_root = FALSE);
134
132 // iterate through objects 135 // iterate through objects
133 LLViewerObject* getFirstObject(); 136 LLViewerObject* getFirstObject();
134 LLViewerObject* getNextObject(); 137 LLViewerObject* getNextObject();
@@ -137,6 +140,12 @@ public:
137 LLViewerObject *getFirstRootObject(); 140 LLViewerObject *getFirstRootObject();
138 LLViewerObject *getNextRootObject(); 141 LLViewerObject *getNextRootObject();
139 142
143 LLViewerObject* getFirstEditableObject(BOOL get_root = FALSE);
144 LLViewerObject* getFirstCopyableObject(BOOL get_root = FALSE);
145 LLViewerObject* getFirstDeleteableObject(BOOL get_root = FALSE);
146 LLViewerObject* getFirstMoveableObject(BOOL get_root = FALSE);
147 LLViewerObject* getPrimaryObject() { return mPrimaryObject; }
148
140 // iterate through texture entries 149 // iterate through texture entries
141 void getPrimaryTE(LLViewerObject* *object, S32 *te); 150 void getPrimaryTE(LLViewerObject* *object, S32 *te);
142 void getFirstTE(LLViewerObject* *object, S32 *te); 151 void getFirstTE(LLViewerObject* *object, S32 *te);
@@ -149,24 +158,37 @@ public:
149 void deleteAllNodes(); // Delete all nodes 158 void deleteAllNodes(); // Delete all nodes
150 S32 getNumNodes(); 159 S32 getNumNodes();
151 LLSelectNode* findNode(LLViewerObject* objectp); 160 LLSelectNode* findNode(LLViewerObject* objectp);
161
162 // count members
163 S32 getObjectCount();
164 S32 getTECount();
165 S32 getRootObjectCount();
166
167 BOOL contains(LLViewerObject* object);
168 BOOL contains(LLViewerObject* object, S32 te);
169
170 // returns TRUE is any node is currenly worn as an attachment
171 BOOL isAttachment();
172
173 // Apply functors to various subsets of the selected objects
174 // Returns the AND of all apply() calls.
175 bool applyToRootObjects(LLSelectedObjectFunctor* func);
176 bool applyToObjects(LLSelectedObjectFunctor* func);
177 bool applyToNodes(LLSelectedNodeFunctor* func);
178
179 ESelectType getSelectType() { return mSelectType; }
180
152private: 181private:
153 const LLSelectNodeList &operator=(const LLSelectNodeList &); 182 const LLObjectSelection &operator=(const LLObjectSelection &);
154 183
155 std::list<LLSelectNode*>::iterator mCurrentNode; 184 LLPointer<LLViewerObject> mPrimaryObject;
156 S32 mCurrentTE; 185 std::list<LLSelectNode*>::iterator mCurrentNode;
157 std::map<LLViewerObject*, LLSelectNode*> mSelectNodeMap; 186 S32 mCurrentTE;
187 std::map<LLViewerObject*, LLSelectNode*> mSelectNodeMap;
188 ESelectType mSelectType;
158}; 189};
159 190
160struct LLSelectAction 191typedef LLHandle<LLObjectSelection> LLObjectSelectionHandle;
161{
162public:
163 EActionType mActionType;
164 LLVector3 mPosition;
165 LLVector3 mScale;
166 LLQuaternion mRotation;
167 LLUUID mObjectID;
168 BOOL mIndividualSelection;
169};
170 192
171class LLSelectMgr : public LLEditMenuHandler 193class LLSelectMgr : public LLEditMenuHandler
172{ 194{
@@ -187,6 +209,7 @@ public:
187 static LLColor4 sHighlightChildColor; 209 static LLColor4 sHighlightChildColor;
188 static LLColor4 sHighlightInspectColor; 210 static LLColor4 sHighlightInspectColor;
189 static LLColor4 sContextSilhouetteColor; 211 static LLColor4 sContextSilhouetteColor;
212
190public: 213public:
191 LLSelectMgr(); 214 LLSelectMgr();
192 ~LLSelectMgr(); 215 ~LLSelectMgr();
@@ -207,115 +230,91 @@ public:
207 virtual void duplicate(); 230 virtual void duplicate();
208 virtual BOOL canDuplicate(); 231 virtual BOOL canDuplicate();
209 232
210 // Apply functors to various subsets of the selected objects
211 // Returns the AND of all apply() calls.
212 bool applyToRootObjects(LLSelectedObjectFunctor* func);
213 bool applyToObjects(LLSelectedObjectFunctor* func);
214 bool applyToNodes(LLSelectedNodeFunctor* func);
215
216 void updateEffects(); // Update HUD effects 233 void updateEffects(); // Update HUD effects
234 void overrideObjectUpdates();
217 235
218 void setForceSelection(BOOL force) { mForceSelection = force; } 236 void setForceSelection(BOOL force) { mForceSelection = force; }
219 237
238 ////////////////////////////////////////////////////////////////
239 // Selection methods
240 ////////////////////////////////////////////////////////////////
241
242 ////////////////////////////////////////////////////////////////
243 // Add
244 ////////////////////////////////////////////////////////////////
245
220 // For when you want just a child object. 246 // For when you want just a child object.
221 void selectObjectOnly(LLViewerObject* object, S32 face = SELECT_ALL_TES); 247 LLObjectSelectionHandle selectObjectOnly(LLViewerObject* object, S32 face = SELECT_ALL_TES);
222 248
223 // This method is meant to select an object, and then select all 249 // This method is meant to select an object, and then select all
224 // of the ancestors and descendents. This should be the normal behavior. 250 // of the ancestors and descendents. This should be the normal behavior.
225 void selectObjectAndFamily(LLViewerObject* object, BOOL add_to_end = FALSE); 251 LLObjectSelectionHandle selectObjectAndFamily(LLViewerObject* object, BOOL add_to_end = FALSE);
226 252
227 // Same as above, but takes a list of objects. Used by rectangle select. 253 // Same as above, but takes a list of objects. Used by rectangle select.
228 void selectObjectAndFamily(const LLDynamicArray<LLViewerObject*>& object_list, BOOL send_to_sim = TRUE); 254 LLObjectSelectionHandle selectObjectAndFamily(const LLDynamicArray<LLViewerObject*>& object_list, BOOL send_to_sim = TRUE);
229 255
230 void deselectObjectOnly(LLViewerObject* object, BOOL send_to_sim = TRUE); 256 // converts all objects currently highlighted to a selection, and returns it
257 LLObjectSelectionHandle selectHighlightedObjects();
231 258
232 void deselectObjectAndFamily(LLViewerObject* object, BOOL send_to_sim = TRUE); 259 LLObjectSelectionHandle setHoverObject(LLViewerObject *objectp);
233 260
234 void deselectTransient(); // deselect "temporarily" selected objects (via pie menu) 261 void highlightObjectOnly(LLViewerObject *objectp);
235 void convertTransient(); // converts temporarily selected objects to full-fledged selections 262 void highlightObjectAndFamily(LLViewerObject *objectp);
263 void highlightObjectAndFamily(const LLDynamicArray<LLViewerObject*>& list);
264
265 ////////////////////////////////////////////////////////////////
266 // Remove
267 ////////////////////////////////////////////////////////////////
268
269 void deselectObjectOnly(LLViewerObject* object, BOOL send_to_sim = TRUE);
270 void deselectObjectAndFamily(LLViewerObject* object, BOOL send_to_sim = TRUE);
236 271
237 // Send deselect messages to simulator, then clear the list 272 // Send deselect messages to simulator, then clear the list
238 void deselectAll(); 273 void deselectAll();
239 274
275 // deselect only if nothing else currently referencing the selection
276 void deselectUnused();
277
240 // Deselect if the selection center is too far away from the agent. 278 // Deselect if the selection center is too far away from the agent.
241 void deselectAllIfTooFar(); 279 void deselectAllIfTooFar();
242 280
243 BOOL selectionRemoveObject(const LLUUID &id); 281 // Removes all highlighted objects from current selection
244 282 void deselectHighlightedObjects();
245 BOOL contains(LLViewerObject* object);
246 BOOL contains(LLViewerObject* object, S32 te);
247
248 ESelectType getSelectType() { return mSelectType; }
249
250 // count members
251 S32 getObjectCount();
252 S32 getTECount();
253 S32 getRootObjectCount();
254
255 BOOL isEmpty() { return !mSelectedObjects.getNumNodes(); }
256
257 BOOL shouldShowSelection() { return mShowSelection; }
258
259 LLSelectNodeList &getHoverObjects() { return mHoverObjects; }
260 LLSelectNodeList &getSelectedObjects() { return mSelectedObjects; }
261
262 // iterate through objects
263 LLViewerObject* getFirstObject() { return mSelectedObjects.getFirstObject(); }
264 LLViewerObject* getNextObject() { return mSelectedObjects.getNextObject(); }
265
266 // iterate through root objects
267 LLViewerObject *getFirstRootObject() { return mSelectedObjects.getFirstRootObject(); }
268 LLViewerObject *getNextRootObject() { return mSelectedObjects.getNextRootObject(); }
269
270 LLViewerObject* getFirstHighlightedObject() { return mHighlightedObjects.getFirstObject(); }
271 LLViewerObject* getNextHighlightedObject() { return mHighlightedObjects.getNextObject(); }
272
273 // iterate through tes
274 void getPrimaryTE(LLViewerObject* *object, S32 *te) { mSelectedObjects.getPrimaryTE(object, te); }
275 void getFirstTE(LLViewerObject* *object, S32 *te) { mSelectedObjects.getFirstTE(object, te); }
276 void getNextTE(LLViewerObject* *object, S32 *te) { mSelectedObjects.getNextTE(object, te); };
277
278 void setHoverObject(LLViewerObject *objectp);
279
280 void addGridObject(LLViewerObject* objectp);
281 void clearGridObjects();
282 void setGridMode(EGridMode mode);
283 EGridMode getGridMode() { return mGridMode; }
284 void getGrid(LLVector3& origin, LLQuaternion& rotation, LLVector3 &scale);
285 283
286 void highlightObjectOnly(LLViewerObject *objectp);
287 void highlightObjectAndFamily(LLViewerObject *objectp);
288 void highlightObjectAndFamily(const LLDynamicArray<LLViewerObject*>& list);
289 void unhighlightObjectOnly(LLViewerObject *objectp); 284 void unhighlightObjectOnly(LLViewerObject *objectp);
290 void unhighlightObjectAndFamily(LLViewerObject *objectp); 285 void unhighlightObjectAndFamily(LLViewerObject *objectp);
291 void unhighlightAll(); 286 void unhighlightAll();
292 void selectHighlightedObjects();
293 void deselectHighlightedObjects();
294 287
295 LLSelectNode *findSelectNode(LLViewerObject *objectp); 288 BOOL removeObjectFromSelections(const LLUUID &id);
296 LLSelectNode *getFirstRootNode() { return mSelectedObjects.getFirstRootNode(); } 289
297 LLSelectNode *getNextRootNode() { return mSelectedObjects.getNextRootNode(); } 290 ////////////////////////////////////////////////////////////////
298 LLSelectNode* getFirstNode() { return mSelectedObjects.getFirstNode(); } 291 // Selection accessors
299 LLSelectNode* getNextNode() { return mSelectedObjects.getNextNode(); } 292 ////////////////////////////////////////////////////////////////
293 LLObjectSelectionHandle getHoverObjects() { return mHoverObjects; }
294 LLObjectSelectionHandle getSelection() { return mSelectedObjects; }
295 // right now this just renders the selection with root/child colors instead of a single color
296 LLObjectSelectionHandle getEditSelection() { convertTransient(); return mSelectedObjects; }
297 LLObjectSelectionHandle getHighlightedObjects() { return mHighlightedObjects; }
300 298
301 LLSelectNode *getHoverNode(); 299 LLSelectNode *getHoverNode();
302 300
301 ////////////////////////////////////////////////////////////////
302 // Grid manipulation
303 ////////////////////////////////////////////////////////////////
304 void addGridObject(LLViewerObject* objectp);
305 void clearGridObjects();
306 void setGridMode(EGridMode mode);
307 EGridMode getGridMode() { return mGridMode; }
308 void getGrid(LLVector3& origin, LLQuaternion& rotation, LLVector3 &scale);
309
303 BOOL getTEMode() { return mTEMode; } 310 BOOL getTEMode() { return mTEMode; }
304 void setTEMode(BOOL b) { mTEMode = b; } 311 void setTEMode(BOOL b) { mTEMode = b; }
305 312
306 LLViewerObject* getFirstCopyableObject(BOOL get_root = FALSE); 313 BOOL shouldShowSelection() { return mShowSelection; }
307 LLViewerObject* getFirstEditableObject(BOOL get_root = FALSE);
308 LLViewerObject* getFirstMoveableObject(BOOL get_root = FALSE);
309 LLViewerObject* getFirstDeleteableObject(BOOL get_root = FALSE);
310
311 LLSelectNode* getFirstEditableNode(BOOL get_root = FALSE);
312 LLSelectNode* getFirstMoveableNode(BOOL get_root = FALSE);
313 314
314 LLBBox getBBoxOfSelection() const; 315 LLBBox getBBoxOfSelection() const;
315 LLBBox getSavedBBoxOfSelection() const { return mSavedSelectionBBox; } 316 LLBBox getSavedBBoxOfSelection() const { return mSavedSelectionBBox; }
316 317
317 BOOL areMultpleEditableObjectsSelected();
318
319 void dump(); 318 void dump();
320 void cleanup(); 319 void cleanup();
321 320
@@ -323,17 +322,18 @@ public:
323 void renderSilhouettes(BOOL for_hud); 322 void renderSilhouettes(BOOL for_hud);
324 void enableSilhouette(BOOL enable) { mRenderSilhouettes = enable; } 323 void enableSilhouette(BOOL enable) { mRenderSilhouettes = enable; }
325 324
326 // Utility functions to operate on the list 325 ////////////////////////////////////////////////////////////////
327 326 // Utility functions that operate on the current selection
328 void saveSelectedObjectTransform(EActionType action_type); 327 ////////////////////////////////////////////////////////////////
329 void saveSelectedObjectColors(); 328 void saveSelectedObjectTransform(EActionType action_type);
330 void saveSelectedObjectTextures(); 329 void saveSelectedObjectColors();
331 330 void saveSelectedObjectTextures();
332 void selectionUpdatePhysics(BOOL use_physics); 331
333 void selectionUpdateTemporary(BOOL is_temporary); 332 void selectionUpdatePhysics(BOOL use_physics);
334 void selectionUpdatePhantom(BOOL is_ghost); 333 void selectionUpdateTemporary(BOOL is_temporary);
335 void selectionUpdateCastShadows(BOOL cast_shadows); 334 void selectionUpdatePhantom(BOOL is_ghost);
336 void selectionDump(); 335 void selectionUpdateCastShadows(BOOL cast_shadows);
336 void selectionDump();
337 337
338 BOOL selectionAllPCode(LLPCode code); // all objects have this PCode 338 BOOL selectionAllPCode(LLPCode code); // all objects have this PCode
339 BOOL selectionGetMaterial(U8 *material); // all objects have same material 339 BOOL selectionGetMaterial(U8 *material); // all objects have same material
@@ -362,11 +362,11 @@ public:
362 void selectionSetMediaTypeAndURL( U8 media_type, const std::string& media_url ); 362 void selectionSetMediaTypeAndURL( U8 media_type, const std::string& media_url );
363 void selectionSetClickAction(U8 action); 363 void selectionSetClickAction(U8 action);
364 364
365 void setObjectPermissions(U8 perm_field, BOOL set, U32 perm_mask, BOOL override = FALSE); 365 void selectionSetObjectPermissions(U8 perm_field, BOOL set, U32 perm_mask, BOOL override = FALSE);
366 void setObjectName(const LLString& name); 366 void selectionSetObjectName(const LLString& name);
367 void setObjectDescription(const LLString& desc); 367 void selectionSetObjectDescription(const LLString& desc);
368 void setObjectCategory(const LLCategory& category); 368 void selectionSetObjectCategory(const LLCategory& category);
369 void setObjectSaleInfo(const LLSaleInfo& sale_info); 369 void selectionSetObjectSaleInfo(const LLSaleInfo& sale_info);
370 370
371 void selectionTexScaleAutofit(F32 repeats_per_meter); 371 void selectionTexScaleAutofit(F32 repeats_per_meter);
372 void selectionResetTexInfo(S32 te); // sets S,T to 1 372 void selectionResetTexInfo(S32 te); // sets S,T to 1
@@ -433,23 +433,20 @@ public:
433 // with the aggregate permissions for texture inventory items of the selection. 433 // with the aggregate permissions for texture inventory items of the selection.
434 BOOL selectGetAggregateTexturePermissions(LLAggregatePermissions& ag_perm); 434 BOOL selectGetAggregateTexturePermissions(LLAggregatePermissions& ag_perm);
435 435
436 // returns TRUE is any node is currenly worn as an attachment
437 BOOL selectionIsAttachment();
438
439 LLPermissions* findObjectPermissions(const LLViewerObject* object); 436 LLPermissions* findObjectPermissions(const LLViewerObject* object);
440 437
441 void selectDelete(); // Delete on simulator 438 void selectDelete(); // Delete on simulator
442 void selectForceDelete(); // just delete, no into trash 439 void selectForceDelete(); // just delete, no into trash
443 void selectDuplicate(const LLVector3& offset, BOOL select_copy); // Duplicate on simulator 440 void selectDuplicate(const LLVector3& offset, BOOL select_copy); // Duplicate on simulator
444 void repeatDuplicate(); 441 void repeatDuplicate();
445 void selectDuplicateOnRay(const LLVector3 &ray_start_region, 442 void selectDuplicateOnRay(const LLVector3 &ray_start_region,
446 const LLVector3 &ray_end_region, 443 const LLVector3 &ray_end_region,
447 BOOL bypass_raycast, 444 BOOL bypass_raycast,
448 BOOL ray_end_is_intersection, 445 BOOL ray_end_is_intersection,
449 const LLUUID &ray_target_id, 446 const LLUUID &ray_target_id,
450 BOOL copy_centers, 447 BOOL copy_centers,
451 BOOL copy_rotates, 448 BOOL copy_rotates,
452 BOOL select_copy); 449 BOOL select_copy);
453 450
454 void sendMultipleUpdate(U32 type); // Position, rotation, scale all in one 451 void sendMultipleUpdate(U32 type); // Position, rotation, scale all in one
455 void sendOwner(const LLUUID& owner_id, const LLUUID& group_id, BOOL override = FALSE); 452 void sendOwner(const LLUUID& owner_id, const LLUUID& group_id, BOOL override = FALSE);
@@ -490,7 +487,7 @@ public:
490 void demoteSelectionToIndividuals(); 487 void demoteSelectionToIndividuals();
491 488
492private: 489private:
493 490 void convertTransient(); // converts temporarily selected objects to full-fledged selections
494 ESelectType getSelectTypeForObject(LLViewerObject* object); 491 ESelectType getSelectTypeForObject(LLViewerObject* object);
495 void addAsFamily(LLDynamicArray<LLViewerObject*>& objects, BOOL add_to_end = FALSE); 492 void addAsFamily(LLDynamicArray<LLViewerObject*>& objects, BOOL add_to_end = FALSE);
496 void generateSilhouette(LLSelectNode *nodep, const LLVector3& view_point); 493 void generateSilhouette(LLSelectNode *nodep, const LLVector3& view_point);
@@ -501,7 +498,6 @@ private:
501 void (*pack_body)(LLSelectNode* node, void *user_data), 498 void (*pack_body)(LLSelectNode* node, void *user_data),
502 void *user_data, 499 void *user_data,
503 ESendType send_type); 500 ESendType send_type);
504 U32 undoRedo(std::deque<LLSelectAction*> &queue_src, std::deque<LLSelectAction*> &queue_dst, const LLUUID &object_id);
505 501
506 static void packAgentID( void *); 502 static void packAgentID( void *);
507 static void packAgentAndSessionID(void* user_data); 503 static void packAgentAndSessionID(void* user_data);
@@ -536,22 +532,19 @@ private:
536 static void confirmDelete(S32 option, void* data); 532 static void confirmDelete(S32 option, void* data);
537 533
538private: 534private:
539 LLPointer<LLViewerImage> mSilhouetteImagep; 535 LLPointer<LLViewerImage> mSilhouetteImagep;
540 536 LLObjectSelectionHandle mSelectedObjects;
541 LLSelectNodeList mSelectedObjects; 537 LLObjectSelectionHandle mHoverObjects;
542 538 LLObjectSelectionHandle mHighlightedObjects;
543 LLSelectNodeList mHoverObjects;
544
545 std::set<LLPointer<LLViewerObject> > mRectSelectedObjects; 539 std::set<LLPointer<LLViewerObject> > mRectSelectedObjects;
546 540
547 LLSelectNodeList mGridObjects; 541 LLObjectSelection mGridObjects;
548 LLQuaternion mGridRotation; 542 LLQuaternion mGridRotation;
549 LLVector3 mGridOrigin; 543 LLVector3 mGridOrigin;
550 LLVector3 mGridScale; 544 LLVector3 mGridScale;
551 EGridMode mGridMode; 545 EGridMode mGridMode;
552 BOOL mGridValid; 546 BOOL mGridValid;
553 547
554 LLSelectNodeList mHighlightedObjects;
555 548
556 BOOL mTEMode; // render te 549 BOOL mTEMode; // render te
557 LLVector3d mSelectionCenterGlobal; 550 LLVector3d mSelectionCenterGlobal;
@@ -563,15 +556,10 @@ private:
563 BOOL mRenderSilhouettes; // do we render the silhouette 556 BOOL mRenderSilhouettes; // do we render the silhouette
564 LLBBox mSavedSelectionBBox; 557 LLBBox mSavedSelectionBBox;
565 558
566 ESelectType mSelectType;
567
568 LLFrameTimer mEffectsTimer; 559 LLFrameTimer mEffectsTimer;
569 BOOL mForceSelection; 560 BOOL mForceSelection;
570 561
571 std::deque<LLSelectAction*> mUndoQueue; 562 LLAnimPauseRequest mPauseRequest;
572 std::deque<LLSelectAction*> mRedoQueue;
573
574 LLAnimPauseRequest mPauseRequest;
575}; 563};
576 564
577 565
@@ -614,9 +602,12 @@ public:
614 LLCategory mCategory; 602 LLCategory mCategory;
615 S16 mInventorySerial; 603 S16 mInventorySerial;
616 LLVector3 mSavedPositionLocal; // for interactively modifying object position 604 LLVector3 mSavedPositionLocal; // for interactively modifying object position
605 LLVector3 mLastPositionLocal;
617 LLVector3d mSavedPositionGlobal; // for interactively modifying object position 606 LLVector3d mSavedPositionGlobal; // for interactively modifying object position
618 LLVector3 mSavedScale; // for interactively modifying object scale 607 LLVector3 mSavedScale; // for interactively modifying object scale
608 LLVector3 mLastScale;
619 LLQuaternion mSavedRotation; // for interactively modifying object rotation 609 LLQuaternion mSavedRotation; // for interactively modifying object rotation
610 LLQuaternion mLastRotation;
620 BOOL mDuplicated; 611 BOOL mDuplicated;
621 LLVector3d mDuplicatePos; 612 LLVector3d mDuplicatePos;
622 LLQuaternion mDuplicateRot; 613 LLQuaternion mDuplicateRot;
diff --git a/linden/indra/newview/llsky.cpp b/linden/indra/newview/llsky.cpp
index f4e305c..2888d95 100644
--- a/linden/indra/newview/llsky.cpp
+++ b/linden/indra/newview/llsky.cpp
@@ -366,7 +366,7 @@ void LLSky::updateCull()
366 366
367 if (mVOStarsp.notNull() && mVOStarsp->mDrawable.notNull()) 367 if (mVOStarsp.notNull() && mVOStarsp->mDrawable.notNull())
368 { 368 {
369 gPipeline.markVisible(mVOStarsp->mDrawable); 369 gPipeline.markVisible(mVOStarsp->mDrawable, *gCamera);
370 } 370 }
371 else 371 else
372 { 372 {
@@ -391,10 +391,10 @@ void LLSky::updateSky()
391 } 391 }
392 if (mVOStarsp) 392 if (mVOStarsp)
393 { 393 {
394 if (mVOStarsp->mDrawable) 394 //if (mVOStarsp->mDrawable)
395 { 395 //{
396 gPipeline.markRebuild(mVOStarsp->mDrawable, LLDrawable::REBUILD_VOLUME, TRUE); 396 // gPipeline.markRebuild(mVOStarsp->mDrawable, LLDrawable::REBUILD_VOLUME, TRUE);
397 } 397 //}
398 } 398 }
399} 399}
400 400
diff --git a/linden/indra/newview/llspatialpartition.cpp b/linden/indra/newview/llspatialpartition.cpp
index fd9eec0..24ac1ca 100644
--- a/linden/indra/newview/llspatialpartition.cpp
+++ b/linden/indra/newview/llspatialpartition.cpp
@@ -29,25 +29,21 @@
29 29
30#include "llspatialpartition.h" 30#include "llspatialpartition.h"
31 31
32#include "llglheaders.h" 32#include "llviewerwindow.h"
33
34#include "llviewerobjectlist.h" 33#include "llviewerobjectlist.h"
35#include "llvovolume.h" 34#include "llvovolume.h"
36#include "llviewercamera.h" 35#include "llviewercamera.h"
37#include "llface.h" 36#include "llface.h"
38#include "viewer.h" 37#include "viewer.h"
39 38#include "llagent.h"
39#include "llviewerregion.h"
40#include "llcamera.h" 40#include "llcamera.h"
41#include "pipeline.h" 41#include "pipeline.h"
42 42
43static BOOL sIgnoreOcclusion = TRUE;
44static GLuint sBoxList = 0; 43static GLuint sBoxList = 0;
45 44
46const S32 SG_LOD_SWITCH_STAGGER = 4; 45const F32 SG_OCCLUSION_FUDGE = 1.01f;
47const F32 SG_MAX_OBJ_RAD = 1.f; 46//const S32 SG_LOD_PERIOD = 16;
48const F32 SG_OCCLUSION_FUDGE = 1.1f;
49const S32 SG_MOVE_PERIOD = 32;
50const S32 SG_LOD_PERIOD = 16;
51 47
52#define SG_DISCARD_TOLERANCE 0.25f 48#define SG_DISCARD_TOLERANCE 0.25f
53 49
@@ -57,11 +53,12 @@ const S32 SG_LOD_PERIOD = 16;
57#define assert_octree_valid(x) 53#define assert_octree_valid(x)
58#endif 54#endif
59 55
56static U32 sZombieGroups = 0;
57
60static F32 sLastMaxTexPriority = 1.f; 58static F32 sLastMaxTexPriority = 1.f;
61static F32 sCurMaxTexPriority = 1.f; 59static F32 sCurMaxTexPriority = 1.f;
62 60
63//static counter for frame to switch LOD on 61//static counter for frame to switch LOD on
64S32 LLSpatialGroup::sLODSeed = 0;
65 62
66void sg_assert(BOOL expr) 63void sg_assert(BOOL expr)
67{ 64{
@@ -144,30 +141,22 @@ S32 LLSphereAABB(const LLVector3& center, const LLVector3& size, const LLVector3
144 141
145LLSpatialGroup::~LLSpatialGroup() 142LLSpatialGroup::~LLSpatialGroup()
146{ 143{
147 LLMemType mt(LLMemType::MTYPE_SPACE_PARTITION); 144 if (isState(DEAD))
148 if (!safeToDelete())
149 { 145 {
150#ifdef LL_RELEASE_FOR_DOWNLOAD 146 sZombieGroups--;
151 llwarns << "Spatial Group deleted while being tracked " << ((void*) mState) << llendl;
152#else
153 llerrs << "Spatial Group deleted while being tracked " << ((void*) mState) << llendl;
154#endif
155 } 147 }
156 148
157#if LL_OCTREE_PARANOIA_CHECK 149 LLMemType mt(LLMemType::MTYPE_SPACE_PARTITION);
158 for (U32 i = 0; i < mSpatialPartition->mOccludedList.size(); i++) 150 clearDrawMap();
159 {
160 if (mSpatialPartition->mOccludedList[i] == this)
161 {
162 llerrs << "Spatial Group deleted while being tracked STATE ERROR " << ((void*) mState) << llendl;
163 }
164 }
165#endif
166} 151}
167 152
168BOOL LLSpatialGroup::safeToDelete() 153void LLSpatialGroup::clearDrawMap()
169{ 154{
170 return gQuit || !isState(IN_QUEUE | ACTIVE_OCCLUSION | RESHADOW_QUEUE); 155 for (LLSpatialGroup::draw_map_t::iterator i = mDrawMap.begin(); i != mDrawMap.end(); ++i)
156 {
157 std::for_each(i->second.begin(), i->second.end(), DeletePointer());
158 }
159 mDrawMap.clear();
171} 160}
172 161
173class LLRelightPainter : public LLSpatialGroup::OctreeTraveler 162class LLRelightPainter : public LLSpatialGroup::OctreeTraveler
@@ -212,13 +201,13 @@ public:
212 201
213BOOL LLSpatialGroup::isVisible() 202BOOL LLSpatialGroup::isVisible()
214{ 203{
215 if (sIgnoreOcclusion) 204 if (LLPipeline::sUseOcclusion)
216 { 205 {
217 return !isState(CULLED); 206 return !isState(CULLED | OCCLUDED);
218 } 207 }
219 else 208 else
220 { 209 {
221 return !isState(CULLED | OCCLUDED); 210 return !isState(CULLED);
222 } 211 }
223} 212}
224 213
@@ -254,6 +243,90 @@ void LLSpatialGroup::validate()
254#endif 243#endif
255} 244}
256 245
246void validate_draw_info(LLDrawInfo& params)
247{
248#if LL_DEBUG
249/* if (params.mVertexBuffer.isNull())
250 {
251 llerrs << "Draw batch has no vertex buffer." << llendl;
252 }
253
254 //bad range
255 if (params.mStart >= params.mEnd)
256 {
257 llerrs << "Draw batch has invalid range." << llendl;
258 }
259
260 if (params.mEnd >= params.mVertexBuffer->getNumVerts())
261 {
262 llerrs << "Draw batch has buffer overrun error." << llendl;
263 }
264
265 if (params.mOffset + params.mCount > params.mVertexBuffer->getNumIndices())
266 {
267 llerrs << "Draw batch has index buffer ovverrun error." << llendl;
268 }
269
270 //bad indices
271 U32* indicesp = (U32*) params.mVertexBuffer->getIndicesPointer();
272 if (indicesp)
273 {
274 for (U32 i = params.mOffset; i < params.mOffset+params.mCount; i++)
275 {
276 if (indicesp[i] < params.mStart)
277 {
278 llerrs << "Draw batch has vertex buffer index out of range error (index too low)." << llendl;
279 }
280
281 if (indicesp[i] > params.mEnd)
282 {
283 llerrs << "Draw batch has vertex buffer index out of range error (index too high)." << llendl;
284 }
285 }
286 }*/
287#endif
288}
289
290void LLSpatialGroup::validateDrawMap()
291{
292/* for (draw_map_t::iterator i = mDrawMap.begin(); i != mDrawMap.end(); ++i)
293 {
294 std::vector<LLDrawInfo*>& draw_vec = i->second;
295 for (std::vector<LLDrawInfo*>::iterator j = draw_vec.begin(); j != draw_vec.end(); ++j)
296 {
297 LLDrawInfo& params = **j;
298
299 validate_draw_info(params);
300 }
301 }*/
302}
303
304void LLSpatialGroup::makeStatic()
305{
306#if !LL_DARWIN
307 if (isState(GEOM_DIRTY | ALPHA_DIRTY))
308 {
309 return;
310 }
311
312 if (mSpatialPartition->mRenderByGroup && mBufferUsage != GL_STATIC_DRAW_ARB)
313 {
314 mBufferUsage = GL_STATIC_DRAW_ARB;
315 if (mVertexBuffer.notNull())
316 {
317 mVertexBuffer->makeStatic();
318 }
319
320 for (buffer_map_t::iterator i = mBufferMap.begin(); i != mBufferMap.end(); ++i)
321 {
322 i->second->makeStatic();
323 }
324
325 mBuilt = 1.f;
326 }
327#endif
328}
329
257BOOL LLSpatialGroup::updateInGroup(LLDrawable *drawablep, BOOL immediate) 330BOOL LLSpatialGroup::updateInGroup(LLDrawable *drawablep, BOOL immediate)
258{ 331{
259 LLMemType mt(LLMemType::MTYPE_SPACE_PARTITION); 332 LLMemType mt(LLMemType::MTYPE_SPACE_PARTITION);
@@ -261,10 +334,16 @@ BOOL LLSpatialGroup::updateInGroup(LLDrawable *drawablep, BOOL immediate)
261 drawablep->updateSpatialExtents(); 334 drawablep->updateSpatialExtents();
262 validate_drawable(drawablep); 335 validate_drawable(drawablep);
263 336
264 if (mOctreeNode->isInside(drawablep) && mOctreeNode->contains(drawablep)) 337 OctreeNode* parent = mOctreeNode->getOctParent();
338
339 if (mOctreeNode->isInside(drawablep->getPositionGroup()) &&
340 (mOctreeNode->contains(drawablep) ||
341 (drawablep->getBinRadius() > mOctreeNode->getSize().mdV[0] &&
342 parent && parent->getElementCount() >= LL_OCTREE_MAX_CAPACITY)))
265 { 343 {
266 unbound(); 344 unbound();
267 setState(OBJECT_DIRTY); 345 setState(OBJECT_DIRTY);
346 setState(GEOM_DIRTY);
268 validate_drawable(drawablep); 347 validate_drawable(drawablep);
269 return TRUE; 348 return TRUE;
270 } 349 }
@@ -284,11 +363,82 @@ BOOL LLSpatialGroup::addObject(LLDrawable *drawablep, BOOL add_all, BOOL from_oc
284 { 363 {
285 drawablep->setSpatialGroup(this, 0); 364 drawablep->setSpatialGroup(this, 0);
286 validate_drawable(drawablep); 365 validate_drawable(drawablep);
366 setState(OBJECT_DIRTY | GEOM_DIRTY);
367 mLastAddTime = gFrameTimeSeconds;
368 if (drawablep->isSpatialBridge())
369 {
370 mBridgeList.push_back((LLSpatialBridge*) drawablep);
371 }
372 setState(IMAGE_DIRTY);
287 } 373 }
288 374
289 return TRUE; 375 return TRUE;
290} 376}
291 377
378void LLSpatialGroup::rebuildGeom()
379{
380 LLMemType mt(LLMemType::MTYPE_SPACE_PARTITION);
381 if (!isDead())
382 {
383 mSpatialPartition->rebuildGeom(this);
384 }
385}
386
387void LLSpatialPartition::rebuildGeom(LLSpatialGroup* group)
388{
389 if (group->changeLOD())
390 {
391 group->mLastUpdateDistance = group->mDistance;
392 group->mLastUpdateViewAngle = group->mViewAngle;
393 }
394
395 if (group->isDead() || !group->isState(LLSpatialGroup::GEOM_DIRTY))
396 {
397 return;
398 }
399
400 LLFastTimer ftm(LLFastTimer::FTM_REBUILD_VBO);
401
402 group->clearDrawMap();
403
404 //get geometry count
405 group->mIndexCount = 0;
406 group->mVertexCount = 0;
407
408 addGeometryCount(group, group->mVertexCount, group->mIndexCount);
409
410 if (group->mVertexCount > 0 && group->mIndexCount > 0)
411 { //create vertex buffer containing volume geometry for this node
412 group->mBuilt = 1.f;
413 if (group->mVertexBuffer.isNull() || (group->mBufferUsage != group->mVertexBuffer->getUsage() && LLVertexBuffer::sEnableVBOs))
414 {
415 //LLFastTimer ftm(LLFastTimer::FTM_REBUILD_NONE_VB);
416 group->mVertexBuffer = createVertexBuffer(mVertexDataMask, group->mBufferUsage);
417 group->mVertexBuffer->allocateBuffer(group->mVertexCount, group->mIndexCount, true);
418 stop_glerror();
419 }
420 else
421 {
422 //LLFastTimer ftm(LLFastTimer::FTM_REBUILD_NONE_VB);
423 group->mVertexBuffer->resizeBuffer(group->mVertexCount, group->mIndexCount);
424 stop_glerror();
425 }
426
427 {
428 LLFastTimer ftm((LLFastTimer::EFastTimerType) ((U32) LLFastTimer::FTM_REBUILD_VOLUME_VB + mPartitionType));
429 getGeometry(group);
430 }
431 }
432 else
433 {
434 group->mVertexBuffer = NULL;
435 group->mBufferMap.clear();
436 }
437
438 group->mLastUpdateTime = gFrameTimeSeconds;
439 group->clearState(LLSpatialGroup::GEOM_DIRTY | LLSpatialGroup::MATRIX_DIRTY);
440}
441
292BOOL LLSpatialGroup::boundObjects(BOOL empty, LLVector3& minOut, LLVector3& maxOut) 442BOOL LLSpatialGroup::boundObjects(BOOL empty, LLVector3& minOut, LLVector3& maxOut)
293{ 443{
294 const OctreeState* node = mOctreeNode->getOctState(); 444 const OctreeState* node = mOctreeNode->getOctState();
@@ -304,7 +454,7 @@ BOOL LLSpatialGroup::boundObjects(BOOL empty, LLVector3& minOut, LLVector3& maxO
304 454
305 LLVector3& newMin = mObjectExtents[0]; 455 LLVector3& newMin = mObjectExtents[0];
306 LLVector3& newMax = mObjectExtents[1]; 456 LLVector3& newMax = mObjectExtents[1];
307 457
308 if (isState(OBJECT_DIRTY)) 458 if (isState(OBJECT_DIRTY))
309 { //calculate new bounding box 459 { //calculate new bounding box
310 clearState(OBJECT_DIRTY); 460 clearState(OBJECT_DIRTY);
@@ -390,11 +540,28 @@ void LLSpatialGroup::unbound()
390 } 540 }
391} 541}
392 542
543LLSpatialGroup* LLSpatialGroup::getParent()
544{
545 if (isDead())
546 {
547 return NULL;
548 }
549
550 OctreeNode* parent = mOctreeNode->getOctParent();
551
552 if (parent)
553 {
554 return (LLSpatialGroup*) parent->getListener(0);
555 }
556
557 return NULL;
558}
559
393BOOL LLSpatialGroup::removeObject(LLDrawable *drawablep, BOOL from_octree) 560BOOL LLSpatialGroup::removeObject(LLDrawable *drawablep, BOOL from_octree)
394{ 561{
395 LLMemType mt(LLMemType::MTYPE_SPACE_PARTITION); 562 LLMemType mt(LLMemType::MTYPE_SPACE_PARTITION);
396 unbound(); 563 unbound();
397 if (!from_octree) 564 if (mOctreeNode && !from_octree)
398 { 565 {
399 if (!mOctreeNode->remove(drawablep)) 566 if (!mOctreeNode->remove(drawablep))
400 { 567 {
@@ -404,6 +571,18 @@ BOOL LLSpatialGroup::removeObject(LLDrawable *drawablep, BOOL from_octree)
404 else 571 else
405 { 572 {
406 drawablep->setSpatialGroup(NULL, -1); 573 drawablep->setSpatialGroup(NULL, -1);
574 setState(GEOM_DIRTY);
575 if (drawablep->isSpatialBridge())
576 {
577 for (bridge_list_t::iterator i = mBridgeList.begin(); i != mBridgeList.end(); ++i)
578 {
579 if (*i == drawablep)
580 {
581 mBridgeList.erase(i);
582 break;
583 }
584 }
585 }
407 } 586 }
408 return TRUE; 587 return TRUE;
409} 588}
@@ -420,6 +599,8 @@ void LLSpatialGroup::shift(const LLVector3 &offset)
420 mObjectBounds[0] += offset; 599 mObjectBounds[0] += offset;
421 mObjectExtents[0] += offset; 600 mObjectExtents[0] += offset;
422 mObjectExtents[1] += offset; 601 mObjectExtents[1] += offset;
602
603 setState(GEOM_DIRTY | MATRIX_DIRTY | OCCLUSION_DIRTY);
423} 604}
424 605
425class LLSpatialSetState : public LLSpatialGroup::OctreeTraveler 606class LLSpatialSetState : public LLSpatialGroup::OctreeTraveler
@@ -533,30 +714,160 @@ void LLSpatialGroup::clearState(U32 state, S32 mode)
533// Octree Listener Implementation 714// Octree Listener Implementation
534//====================================== 715//======================================
535 716
536LLSpatialGroup::LLSpatialGroup(OctreeNode* node, LLSpatialPartition* part) 717LLSpatialGroup::LLSpatialGroup(OctreeNode* node, LLSpatialPartition* part) :
537: mState(0), mOctreeNode(node), mSpatialPartition(part) 718 mState(0),
719 mBuilt(0.f),
720 mOctreeNode(node),
721 mSpatialPartition(part),
722 mVertexBuffer(NULL),
723 mBufferUsage(GL_STATIC_DRAW_ARB),
724 mDistance(0.f),
725 mDepth(0.f),
726 mLastUpdateDistance(-1.f),
727 mLastUpdateTime(gFrameTimeSeconds),
728 mLastAddTime(gFrameTimeSeconds),
729 mLastRenderTime(gFrameTimeSeconds),
730 mViewAngle(0.f),
731 mLastUpdateViewAngle(-1.f)
538{ 732{
539 LLMemType mt(LLMemType::MTYPE_SPACE_PARTITION); 733 LLMemType mt(LLMemType::MTYPE_SPACE_PARTITION);
734
540 sg_assert(mOctreeNode->getListenerCount() == 0); 735 sg_assert(mOctreeNode->getListenerCount() == 0);
541 mOctreeNode->addListener(this); 736 mOctreeNode->addListener(this);
542 setState(DIRTY); 737 setState(SG_INITIAL_STATE_MASK);
543 738
544 mBounds[0] = LLVector3(node->getCenter()); 739 mBounds[0] = LLVector3(node->getCenter());
545 mBounds[1] = LLVector3(node->getSize()); 740 mBounds[1] = LLVector3(node->getSize());
546 741
547 sLODSeed = (sLODSeed+1)%SG_LOD_PERIOD; 742 part->mLODSeed = (part->mLODSeed+1)%part->mLODPeriod;
548 mLODHash = sLODSeed; 743 mLODHash = part->mLODSeed;
744
745 mRadius = 1;
746 mPixelArea = 1024.f;
747}
748
749void LLSpatialGroup::updateDistance(LLCamera &camera)
750{
751#if !LL_RELEASE_FOR_DOWNLOAD
752 if (isState(LLSpatialGroup::OBJECT_DIRTY))
753 {
754 llerrs << "Spatial group dirty on distance update." << llendl;
755 }
756#endif
757 if (!getData().empty())
758 {
759 mRadius = mSpatialPartition->mRenderByGroup ? mObjectBounds[1].magVec() :
760 (F32) mOctreeNode->getSize().magVec();
761 mDistance = mSpatialPartition->calcDistance(this, camera);
762 mPixelArea = mSpatialPartition->calcPixelArea(this, camera);
763 }
764}
765
766F32 LLSpatialPartition::calcDistance(LLSpatialGroup* group, LLCamera& camera)
767{
768 LLVector3 eye = group->mObjectBounds[0] - camera.getOrigin();
769
770 F32 dist = 0.f;
771
772 if (group->mDrawMap.find(LLRenderPass::PASS_ALPHA) != group->mDrawMap.end())
773 {
774 LLVector3 v = eye;
775 dist = eye.normVec();
776
777 if (!group->isState(LLSpatialGroup::ALPHA_DIRTY))
778 {
779 LLVector3 view_angle = LLVector3(eye * LLVector3(1,0,0),
780 eye * LLVector3(0,1,0),
781 eye * LLVector3(0,0,1));
782
783 if ((view_angle-group->mLastUpdateViewAngle).magVec() > 0.64f)
784 {
785 group->mViewAngle = view_angle;
786 group->mLastUpdateViewAngle = view_angle;
787 //for occasional alpha sorting within the group
788 //NOTE: If there is a trivial way to detect that alpha sorting here would not change the render order,
789 //not setting this node to dirty would be a very good thing
790 group->setState(LLSpatialGroup::ALPHA_DIRTY);
791 }
792 }
793
794 //calculate depth of node for alpha sorting
795
796 LLVector3 at = camera.getAtAxis();
797
798 //front of bounding box
799 for (U32 i = 0; i < 3; i++)
800 {
801 v.mV[i] -= group->mObjectBounds[1].mV[i]*0.25f * at.mV[i];
802 }
803
804 group->mDepth = v * at;
805
806 F32 water_height = gAgent.getRegion()->getWaterHeight();
807 //figure out if this node is above or below water
808 if (group->mObjectBounds[0].mV[2] < water_height)
809 {
810 group->setState(LLSpatialGroup::BELOW_WATER);
811 }
812 else
813 {
814 group->clearState(LLSpatialGroup::BELOW_WATER);
815 }
816 }
817 else
818 {
819 dist = eye.magVec();
820 }
821
822 if (dist < 16.f)
823 {
824 dist /= 16.f;
825 dist *= dist;
826 dist *= 16.f;
827 }
828
829 return dist;
830}
831
832F32 LLSpatialPartition::calcPixelArea(LLSpatialGroup* group, LLCamera& camera)
833{
834 return LLPipeline::calcPixelArea(group->mObjectBounds[0], group->mObjectBounds[1], camera);
549} 835}
550 836
551BOOL LLSpatialGroup::changeLOD() 837BOOL LLSpatialGroup::changeLOD()
552{ 838{
553 return LLDrawable::getCurrentFrame()%SG_LOD_PERIOD == mLODHash; 839 if (isState(ALPHA_DIRTY))
840 { ///an alpha sort is going to happen, update distance and LOD
841 return TRUE;
842 }
843
844 if (mSpatialPartition->mSlopRatio > 0.f)
845 {
846 F32 ratio = (mDistance - mLastUpdateDistance)/(llmax(mLastUpdateDistance, mRadius));
847
848 if (fabsf(ratio) >= mSpatialPartition->mSlopRatio)
849 {
850 return TRUE;
851 }
852
853 if (mDistance > mRadius)
854 {
855 return FALSE;
856 }
857 }
858
859 if (LLDrawable::getCurrentFrame()%mSpatialPartition->mLODPeriod == mLODHash)
860 {
861 return TRUE;
862 }
863
864 return FALSE;
554} 865}
555 866
556void LLSpatialGroup::handleInsertion(const TreeNode* node, LLDrawable* drawable) 867void LLSpatialGroup::handleInsertion(const TreeNode* node, LLDrawable* drawablep)
557{ 868{
558 LLMemType mt(LLMemType::MTYPE_SPACE_PARTITION); 869 LLMemType mt(LLMemType::MTYPE_SPACE_PARTITION);
559 addObject(drawable, FALSE, TRUE); 870 addObject(drawablep, FALSE, TRUE);
560 unbound(); 871 unbound();
561 setState(OBJECT_DIRTY); 872 setState(OBJECT_DIRTY);
562} 873}
@@ -571,29 +882,13 @@ void LLSpatialGroup::handleRemoval(const TreeNode* node, LLDrawable* drawable)
571void LLSpatialGroup::handleDestruction(const TreeNode* node) 882void LLSpatialGroup::handleDestruction(const TreeNode* node)
572{ 883{
573 LLMemType mt(LLMemType::MTYPE_SPACE_PARTITION); 884 LLMemType mt(LLMemType::MTYPE_SPACE_PARTITION);
574 885 setState(DEAD);
575 if (mOctreeNode) 886 clearDrawMap();
576 { 887 mOcclusionVerts = NULL;
577 OctreeState* state = mOctreeNode->getOctState(); 888 mVertexBuffer = NULL;
578 for (OctreeState::element_iter i = state->getData().begin(); i != state->getData().end(); ++i) 889 mBufferMap.clear();
579 { 890 sZombieGroups++;
580 LLDrawable* drawable = *i; 891 mOctreeNode = NULL;
581 if (!drawable->isDead())
582 {
583 drawable->setSpatialGroup(NULL, -1);
584 }
585 }
586 }
587
588 if (safeToDelete())
589 {
590 delete this;
591 }
592 else
593 {
594 setState(DEAD);
595 mOctreeNode = NULL;
596 }
597} 892}
598 893
599void LLSpatialGroup::handleStateChange(const TreeNode* node) 894void LLSpatialGroup::handleStateChange(const TreeNode* node)
@@ -611,7 +906,8 @@ void LLSpatialGroup::handleChildAddition(const OctreeNode* parent, OctreeNode* c
611 LLMemType mt(LLMemType::MTYPE_SPACE_PARTITION); 906 LLMemType mt(LLMemType::MTYPE_SPACE_PARTITION);
612 if (child->getListenerCount() == 0) 907 if (child->getListenerCount() == 0)
613 { 908 {
614 (new LLSpatialGroup(child, mSpatialPartition))->setState(mState & SG_STATE_INHERIT_MASK); 909 LLSpatialGroup* group = new LLSpatialGroup(child, mSpatialPartition);
910 group->setState(mState & SG_STATE_INHERIT_MASK);
615 } 911 }
616 else 912 else
617 { 913 {
@@ -626,6 +922,31 @@ void LLSpatialGroup::handleChildRemoval(const OctreeNode* parent, const OctreeNo
626 unbound(); 922 unbound();
627} 923}
628 924
925void LLSpatialGroup::destroyGL()
926{
927 setState(LLSpatialGroup::GEOM_DIRTY |
928 LLSpatialGroup::OCCLUSION_DIRTY |
929 LLSpatialGroup::IMAGE_DIRTY);
930 mLastUpdateTime = gFrameTimeSeconds;
931 mVertexBuffer = NULL;
932 mBufferMap.clear();
933
934 mOcclusionVerts = NULL;
935 mReflectionMap = NULL;
936 clearDrawMap();
937
938 for (LLSpatialGroup::element_iter i = getData().begin(); i != getData().end(); ++i)
939 {
940 LLDrawable* drawable = *i;
941 for (S32 j = 0; j < drawable->getNumFaces(); j++)
942 {
943 LLFace* facep = drawable->getFace(j);
944 facep->mVertexBuffer = NULL;
945 facep->mLastVertexBuffer = NULL;
946 }
947 }
948}
949
629BOOL LLSpatialGroup::rebound() 950BOOL LLSpatialGroup::rebound()
630{ 951{
631 if (!isState(DIRTY)) 952 if (!isState(DIRTY))
@@ -635,7 +956,7 @@ BOOL LLSpatialGroup::rebound()
635 956
636 LLVector3 oldBounds[2]; 957 LLVector3 oldBounds[2];
637 958
638 if (isState(QUERY_OUT)) 959 if (mSpatialPartition->isVolatile() && isState(QUERY_OUT))
639 { //a query has been issued, if our bounding box changes significantly 960 { //a query has been issued, if our bounding box changes significantly
640 //we need to discard the issued query 961 //we need to discard the issued query
641 oldBounds[0] = mBounds[0]; 962 oldBounds[0] = mBounds[0];
@@ -700,7 +1021,7 @@ BOOL LLSpatialGroup::rebound()
700 mBounds[1] = (newMax - newMin)*0.5f; 1021 mBounds[1] = (newMax - newMin)*0.5f;
701 } 1022 }
702 1023
703 if (isState(QUERY_OUT)) 1024 if (mSpatialPartition->isVolatile() && isState(QUERY_OUT))
704 { 1025 {
705 for (U32 i = 0; i < 3 && !isState(DISCARD_QUERY); i++) 1026 for (U32 i = 0; i < 3 && !isState(DISCARD_QUERY); i++)
706 { 1027 {
@@ -713,6 +1034,8 @@ BOOL LLSpatialGroup::rebound()
713 } 1034 }
714 } 1035 }
715 1036
1037 setState(OCCLUSION_DIRTY);
1038
716 clearState(DIRTY); 1039 clearState(DIRTY);
717 1040
718 return TRUE; 1041 return TRUE;
@@ -720,9 +1043,21 @@ BOOL LLSpatialGroup::rebound()
720 1043
721//============================================== 1044//==============================================
722 1045
723LLSpatialPartition::LLSpatialPartition() 1046LLSpatialPartition::LLSpatialPartition(U32 data_mask, BOOL is_volatile, U32 buffer_usage)
724{ 1047{
725 LLMemType mt(LLMemType::MTYPE_SPACE_PARTITION); 1048 LLMemType mt(LLMemType::MTYPE_SPACE_PARTITION);
1049 mDrawableType = 0;
1050 mPartitionType = LLPipeline::PARTITION_NONE;
1051 mVolatile = is_volatile;
1052 mLODSeed = 0;
1053 mLODPeriod = 1;
1054 mVertexDataMask = data_mask;
1055 mBufferUsage = buffer_usage;
1056 mDepthMask = FALSE;
1057 mSlopRatio = 0.25f;
1058 mRenderByGroup = TRUE;
1059 mImageEnabled = FALSE;
1060
726 mOctree = new LLSpatialGroup::OctreeNode(LLVector3d(0,0,0), 1061 mOctree = new LLSpatialGroup::OctreeNode(LLVector3d(0,0,0),
727 LLVector3d(1,1,1), 1062 LLVector3d(1,1,1),
728 new LLSpatialGroup::OctreeRoot(), NULL); 1063 new LLSpatialGroup::OctreeRoot(), NULL);
@@ -733,19 +1068,25 @@ LLSpatialPartition::LLSpatialPartition()
733LLSpatialPartition::~LLSpatialPartition() 1068LLSpatialPartition::~LLSpatialPartition()
734{ 1069{
735 LLMemType mt(LLMemType::MTYPE_SPACE_PARTITION); 1070 LLMemType mt(LLMemType::MTYPE_SPACE_PARTITION);
1071
1072 for (U32 i = 0; i < mOcclusionQueries.size(); i++)
1073 {
1074 glDeleteQueriesARB(1, (GLuint*)(&(mOcclusionQueries[i])));
1075 }
1076
736 delete mOctree; 1077 delete mOctree;
737 mOctree = NULL; 1078 mOctree = NULL;
738} 1079}
739 1080
740 1081
741LLSpatialGroup *LLSpatialPartition::put(LLDrawable *drawablep) 1082LLSpatialGroup *LLSpatialPartition::put(LLDrawable *drawablep, BOOL was_visible)
742{ 1083{
743 LLMemType mt(LLMemType::MTYPE_SPACE_PARTITION); 1084 LLMemType mt(LLMemType::MTYPE_SPACE_PARTITION);
744 const F32 MAX_MAG = 1000000.f*1000000.f; // 1 million 1085 const F32 MAX_MAG = 1000000.f*1000000.f; // 1 million
745 1086
746 if (drawablep->getPositionGroup().magVecSquared() > MAX_MAG) 1087 if (drawablep->getPositionGroup().magVecSquared() > MAX_MAG)
747 { 1088 {
748#ifndef LL_RELEASE_FOR_DOWNLOAD 1089#if 0 //ndef LL_RELEASE_FOR_DOWNLOAD
749 llwarns << "LLSpatialPartition::put Object out of range!" << llendl; 1090 llwarns << "LLSpatialPartition::put Object out of range!" << llendl;
750 llinfos << drawablep->getPositionGroup() << llendl; 1091 llinfos << drawablep->getPositionGroup() << llendl;
751 1092
@@ -770,7 +1111,13 @@ LLSpatialGroup *LLSpatialPartition::put(LLDrawable *drawablep)
770 1111
771 LLSpatialGroup::OctreeNode* node = mOctree->getNodeAt(drawablep); 1112 LLSpatialGroup::OctreeNode* node = mOctree->getNodeAt(drawablep);
772 1113
773 return (LLSpatialGroup*) node->getListener(0); 1114 LLSpatialGroup* group = (LLSpatialGroup*) node->getListener(0);
1115 if (was_visible && group->isState(LLSpatialGroup::QUERY_OUT))
1116 {
1117 group->setState(LLSpatialGroup::DISCARD_QUERY);
1118 }
1119
1120 return group;
774} 1121}
775 1122
776BOOL LLSpatialPartition::remove(LLDrawable *drawablep, LLSpatialGroup *curp) 1123BOOL LLSpatialPartition::remove(LLDrawable *drawablep, LLSpatialGroup *curp)
@@ -793,14 +1140,16 @@ void LLSpatialPartition::move(LLDrawable *drawablep, LLSpatialGroup *curp, BOOL
793{ 1140{
794 LLMemType mt(LLMemType::MTYPE_SPACE_PARTITION); 1141 LLMemType mt(LLMemType::MTYPE_SPACE_PARTITION);
795 LLFastTimer t(LLFastTimer::FTM_UPDATE_MOVE); 1142 LLFastTimer t(LLFastTimer::FTM_UPDATE_MOVE);
796 1143
1144 BOOL was_visible = curp ? curp->isVisible() : FALSE;
1145
797 if (curp && curp->mSpatialPartition != this) 1146 if (curp && curp->mSpatialPartition != this)
798 { 1147 {
799 //keep drawable from being garbage collected 1148 //keep drawable from being garbage collected
800 LLPointer<LLDrawable> ptr = drawablep; 1149 LLPointer<LLDrawable> ptr = drawablep;
801 if (curp->mSpatialPartition->remove(drawablep, curp)) 1150 if (curp->mSpatialPartition->remove(drawablep, curp))
802 { 1151 {
803 put(drawablep); 1152 put(drawablep, was_visible);
804 return; 1153 return;
805 } 1154 }
806 else 1155 else
@@ -823,7 +1172,7 @@ void LLSpatialPartition::move(LLDrawable *drawablep, LLSpatialGroup *curp, BOOL
823 OCT_ERRS << "Move couldn't find existing spatial group!" << llendl; 1172 OCT_ERRS << "Move couldn't find existing spatial group!" << llendl;
824 } 1173 }
825 1174
826 put(drawablep); 1175 put(drawablep, was_visible);
827} 1176}
828 1177
829class LLSpatialShift : public LLSpatialGroup::OctreeTraveler 1178class LLSpatialShift : public LLSpatialGroup::OctreeTraveler
@@ -848,13 +1197,9 @@ void LLSpatialPartition::shift(const LLVector3 &offset)
848 1197
849BOOL LLSpatialPartition::checkOcclusion(LLSpatialGroup* group, LLCamera* camera) 1198BOOL LLSpatialPartition::checkOcclusion(LLSpatialGroup* group, LLCamera* camera)
850{ 1199{
851 if (sIgnoreOcclusion) 1200 if (LLPipeline::sUseOcclusion &&
852 { 1201 !group->isState(LLSpatialGroup::ACTIVE_OCCLUSION | LLSpatialGroup::OCCLUDED) &&
853 return FALSE; 1202 (!camera || !earlyFail(camera, group)))
854 }
855
856 if (!group->isState(LLSpatialGroup::ACTIVE_OCCLUSION | LLSpatialGroup::OCCLUDED) &&
857 !earlyFail(camera, group))
858 { 1203 {
859 group->setState(LLSpatialGroup::ACTIVE_OCCLUSION); 1204 group->setState(LLSpatialGroup::ACTIVE_OCCLUSION);
860 mQueryQueue.push(group); 1205 mQueryQueue.push(group);
@@ -872,8 +1217,8 @@ public:
872 1217
873 virtual bool earlyFail(const LLSpatialGroup* group) 1218 virtual bool earlyFail(const LLSpatialGroup* group)
874 { 1219 {
875 if (mRes && //never occlusion cull the root node 1220 if (group->mOctreeNode->getParent() && //never occlusion cull the root node
876 !sIgnoreOcclusion && //never occlusion cull selection 1221 LLPipeline::sUseOcclusion && //never occlusion cull selection
877 group->isState(LLSpatialGroup::OCCLUDED)) 1222 group->isState(LLSpatialGroup::OCCLUDED))
878 { 1223 {
879 return true; 1224 return true;
@@ -950,22 +1295,19 @@ public:
950 group->mSpatialPartition->checkOcclusion(group, mCamera); 1295 group->mSpatialPartition->checkOcclusion(group, mCamera);
951 } 1296 }
952 } 1297 }
1298
1299 if (LLPipeline::sDynamicReflections &&
1300 group->mOctreeNode->getSize().mdV[0] == 16.0 &&
1301 group->mDistance < 64.f &&
1302 group->mLastAddTime < gFrameTimeSeconds - 2.f)
1303 {
1304 group->mSpatialPartition->markReimage(group);
1305 }
953 } 1306 }
954 1307
955 virtual void processDrawable(LLDrawable* drawable) 1308 virtual void processGroup(LLSpatialGroup* group)
956 { 1309 {
957 if (!drawable->isDead()) 1310 gPipeline.markNotCulled(group, *mCamera);
958 {
959 const LLVector3* extents = drawable->getSpatialExtents();
960
961 F32 objRad = drawable->getRadius();
962 objRad *= objRad;
963 F32 distSqr = ((extents[0]+extents[1])*0.5f - mCamera->getOrigin()).magVecSquared();
964 if (objRad/distSqr > SG_MIN_DIST_RATIO)
965 {
966 gPipeline.markNotCulled(drawable, *mCamera);
967 }
968 }
969 } 1311 }
970 1312
971 virtual void visit(const LLSpatialGroup::OctreeState* branch) 1313 virtual void visit(const LLSpatialGroup::OctreeState* branch)
@@ -976,10 +1318,7 @@ public:
976 1318
977 if (checkObjects(branch, group)) 1319 if (checkObjects(branch, group))
978 { 1320 {
979 for (LLSpatialGroup::OctreeState::const_element_iter i = branch->getData().begin(); i != branch->getData().end(); ++i) 1321 processGroup(group);
980 {
981 processDrawable(*i);
982 }
983 } 1322 }
984 } 1323 }
985 1324
@@ -998,34 +1337,32 @@ public:
998 virtual void lateFail(LLSpatialGroup* group) { } 1337 virtual void lateFail(LLSpatialGroup* group) { }
999 virtual void preprocess(LLSpatialGroup* group) { } 1338 virtual void preprocess(LLSpatialGroup* group) { }
1000 1339
1001 virtual void processDrawable(LLDrawable* drawable) 1340 virtual void processGroup(LLSpatialGroup* group)
1002 { 1341 {
1003 if (!drawable->isDead()) 1342 LLSpatialGroup::OctreeState* branch = group->mOctreeNode->getOctState();
1343
1344 for (LLSpatialGroup::OctreeState::const_element_iter i = branch->getData().begin(); i != branch->getData().end(); ++i)
1004 { 1345 {
1005 if (drawable->isSpatialBridge()) 1346 LLDrawable* drawable = *i;
1006 { 1347
1007 drawable->setVisible(*mCamera, mResults, TRUE); 1348 if (!drawable->isDead())
1008 }
1009 else
1010 { 1349 {
1011 mResults->push_back(drawable); 1350 if (drawable->isSpatialBridge())
1012 } 1351 {
1013 } 1352 drawable->setVisible(*mCamera, mResults, TRUE);
1353 }
1354 else
1355 {
1356 mResults->push_back(drawable);
1357 }
1358 }
1359 }
1014 } 1360 }
1015 1361
1016 std::vector<LLDrawable*>* mResults; 1362 std::vector<LLDrawable*>* mResults;
1017}; 1363};
1018 1364
1019 1365
1020void drawBox(const LLVector3& c, const LLVector3& r)
1021{
1022 glPushMatrix();
1023 glTranslatef(c.mV[0], c.mV[1], c.mV[2]);
1024 glScalef(r.mV[0], r.mV[1], r.mV[2]);
1025 glCallList(sBoxList);
1026 glPopMatrix();
1027}
1028
1029void genBoxList() 1366void genBoxList()
1030{ 1367{
1031 if (sBoxList != 0) 1368 if (sBoxList != 0)
@@ -1077,6 +1414,83 @@ void genBoxList()
1077 glEndList(); 1414 glEndList();
1078} 1415}
1079 1416
1417void drawBox(const LLVector3& c, const LLVector3& r)
1418{
1419 genBoxList();
1420
1421 glPushMatrix();
1422 glTranslatef(c.mV[0], c.mV[1], c.mV[2]);
1423 glScalef(r.mV[0], r.mV[1], r.mV[2]);
1424 glCallList(sBoxList);
1425 glPopMatrix();
1426}
1427
1428void drawBoxOutline(const LLVector3& pos, const LLVector3& size)
1429{
1430 LLVector3 v1 = size.scaledVec(LLVector3( 1, 1,1));
1431 LLVector3 v2 = size.scaledVec(LLVector3(-1, 1,1));
1432 LLVector3 v3 = size.scaledVec(LLVector3(-1,-1,1));
1433 LLVector3 v4 = size.scaledVec(LLVector3( 1,-1,1));
1434
1435 glBegin(GL_LINE_LOOP); //top
1436 glVertex3fv((pos+v1).mV);
1437 glVertex3fv((pos+v2).mV);
1438 glVertex3fv((pos+v3).mV);
1439 glVertex3fv((pos+v4).mV);
1440 glEnd();
1441
1442 glBegin(GL_LINE_LOOP); //bottom
1443 glVertex3fv((pos-v1).mV);
1444 glVertex3fv((pos-v2).mV);
1445 glVertex3fv((pos-v3).mV);
1446 glVertex3fv((pos-v4).mV);
1447 glEnd();
1448
1449
1450 glBegin(GL_LINES);
1451
1452 //right
1453 glVertex3fv((pos+v1).mV);
1454 glVertex3fv((pos-v3).mV);
1455
1456 glVertex3fv((pos+v4).mV);
1457 glVertex3fv((pos-v2).mV);
1458
1459 //left
1460 glVertex3fv((pos+v2).mV);
1461 glVertex3fv((pos-v4).mV);
1462
1463 glVertex3fv((pos+v3).mV);
1464 glVertex3fv((pos-v1).mV);
1465
1466 glEnd();
1467}
1468
1469class LLOctreeDirty : public LLOctreeTraveler<LLDrawable>
1470{
1471public:
1472 virtual void visit(const LLOctreeState<LLDrawable>* state)
1473 {
1474 LLSpatialGroup* group = (LLSpatialGroup*) state->getListener(0);
1475 group->destroyGL();
1476
1477 for (LLSpatialGroup::element_iter i = group->getData().begin(); i != group->getData().end(); ++i)
1478 {
1479 LLDrawable* drawable = *i;
1480 if (drawable->getVObj() && !group->mSpatialPartition->mRenderByGroup)
1481 {
1482 gPipeline.markRebuild(drawable, LLDrawable::REBUILD_ALL, TRUE);
1483 }
1484 }
1485
1486 for (LLSpatialGroup::bridge_list_t::iterator i = group->mBridgeList.begin(); i != group->mBridgeList.end(); ++i)
1487 {
1488 LLSpatialBridge* bridge = *i;
1489 traverse(bridge->mOctree);
1490 }
1491 }
1492};
1493
1080void LLSpatialPartition::restoreGL() 1494void LLSpatialPartition::restoreGL()
1081{ 1495{
1082 LLMemType mt(LLMemType::MTYPE_SPACE_PARTITION); 1496 LLMemType mt(LLMemType::MTYPE_SPACE_PARTITION);
@@ -1099,6 +1513,14 @@ void LLSpatialPartition::restoreGL()
1099 genBoxList(); 1513 genBoxList();
1100} 1514}
1101 1515
1516void LLSpatialPartition::resetVertexBuffers()
1517{
1518 LLOctreeDirty dirty;
1519 dirty.traverse(mOctree);
1520
1521 mOcclusionIndices = NULL;
1522}
1523
1102S32 LLSpatialPartition::cull(LLCamera &camera, std::vector<LLDrawable *>* results, BOOL for_select) 1524S32 LLSpatialPartition::cull(LLCamera &camera, std::vector<LLDrawable *>* results, BOOL for_select)
1103{ 1525{
1104 LLMemType mt(LLMemType::MTYPE_SPACE_PARTITION); 1526 LLMemType mt(LLMemType::MTYPE_SPACE_PARTITION);
@@ -1115,11 +1537,11 @@ S32 LLSpatialPartition::cull(LLCamera &camera, std::vector<LLDrawable *>* result
1115 } 1537 }
1116 else 1538 else
1117 { 1539 {
1540 LLFastTimer ftm(LLFastTimer::FTM_FRUSTUM_CULL);
1118 LLOctreeCull culler(&camera); 1541 LLOctreeCull culler(&camera);
1119 culler.traverse(mOctree); 1542 culler.traverse(mOctree);
1120 } 1543 }
1121 1544
1122 sIgnoreOcclusion = !(gSavedSettings.getBOOL("UseOcclusion") && gGLManager.mHasOcclusionQuery);
1123 return 0; 1545 return 0;
1124} 1546}
1125 1547
@@ -1174,9 +1596,10 @@ public:
1174BOOL earlyFail(LLCamera* camera, LLSpatialGroup* group) 1596BOOL earlyFail(LLCamera* camera, LLSpatialGroup* group)
1175{ 1597{
1176 LLVector3 c = group->mBounds[0]; 1598 LLVector3 c = group->mBounds[0];
1177 LLVector3 r = group->mBounds[1] * (SG_OCCLUSION_FUDGE*2.f) + LLVector3(0.01f,0.01f,0.01f); 1599 LLVector3 r = group->mBounds[1]*SG_OCCLUSION_FUDGE + LLVector3(0.2f,0.2f,0.2f);
1178 1600
1179 if (group->isState(LLSpatialGroup::CULLED) || !camera->AABBInFrustum(c, r)) 1601 //if (group->isState(LLSpatialGroup::CULLED)) // ||
1602 if (!camera->AABBInFrustum(c, r))
1180 { 1603 {
1181 return TRUE; 1604 return TRUE;
1182 } 1605 }
@@ -1197,6 +1620,100 @@ BOOL earlyFail(LLCamera* camera, LLSpatialGroup* group)
1197 return TRUE; 1620 return TRUE;
1198} 1621}
1199 1622
1623void LLSpatialPartition::markReimage(LLSpatialGroup* group)
1624{
1625 if (mImageEnabled && group->isState(LLSpatialGroup::IMAGE_DIRTY))
1626 {
1627 if (!group->isState(LLSpatialGroup::IN_IMAGE_QUEUE))
1628 {
1629 group->setState(LLSpatialGroup::IN_IMAGE_QUEUE);
1630 mImageQueue.push(group);
1631 }
1632 }
1633}
1634
1635void LLSpatialPartition::processImagery(LLCamera* camera)
1636{
1637 if (!mImageEnabled)
1638 {
1639 return;
1640 }
1641
1642 U32 process_count = 1;
1643
1644 while (process_count > 0 && !mImageQueue.empty())
1645 {
1646 LLPointer<LLSpatialGroup> group = mImageQueue.front();
1647 mImageQueue.pop();
1648
1649 group->clearState(LLSpatialGroup::IN_IMAGE_QUEUE);
1650
1651 if (group->isDead())
1652 {
1653 continue;
1654 }
1655
1656 if (LLPipeline::sDynamicReflections)
1657 {
1658 process_count--;
1659 LLVector3 origin = group->mBounds[0];
1660
1661 LLCamera cube_cam;
1662 cube_cam.setOrigin(origin);
1663 cube_cam.setFar(64.f);
1664
1665 LLPointer<LLCubeMap> cube_map = group->mReflectionMap;
1666 group->mReflectionMap = NULL;
1667 if (cube_map.isNull())
1668 {
1669 cube_map = new LLCubeMap();
1670 cube_map->initGL();
1671 }
1672
1673 if (gPipeline.mCubeBuffer == NULL)
1674 {
1675 gPipeline.mCubeBuffer = new LLCubeMap();
1676 gPipeline.mCubeBuffer->initGL();
1677 }
1678
1679 gPipeline.generateReflectionMap(gPipeline.mCubeBuffer, cube_cam, 128);
1680 gPipeline.blurReflectionMap(gPipeline.mCubeBuffer, cube_map, 64);
1681 group->mReflectionMap = cube_map;
1682 group->setState(LLSpatialGroup::GEOM_DIRTY);
1683 }
1684
1685 group->clearState(LLSpatialGroup::IMAGE_DIRTY);
1686 }
1687}
1688
1689void validate_occlusion_list(std::vector<LLPointer<LLSpatialGroup> >& occluded_list)
1690{
1691#if !LL_RELEASE_FOR_DOWNLOAD
1692 for (U32 i = 0; i < occluded_list.size(); i++)
1693 {
1694 LLSpatialGroup* group = occluded_list[i];
1695 for (U32 j = i+1; j < occluded_list.size(); j++)
1696 {
1697 if (occluded_list[i] == occluded_list[j])
1698 {
1699 llerrs << "Duplicate node in occlusion list." << llendl;
1700 }
1701 }
1702
1703 LLSpatialGroup::OctreeNode* parent = group->mOctreeNode->getOctParent();
1704 while (parent)
1705 {
1706 LLSpatialGroup* parent_group = (LLSpatialGroup*) parent->getListener(0);
1707 if (parent_group->isState(LLSpatialGroup::OCCLUDED))
1708 {
1709 llerrs << "Child node of occluded node in occlusion list (redundant query)." << llendl;
1710 }
1711 parent = parent->getOctParent();
1712 }
1713 }
1714#endif
1715}
1716
1200void LLSpatialPartition::processOcclusion(LLCamera* camera) 1717void LLSpatialPartition::processOcclusion(LLCamera* camera)
1201{ 1718{
1202 LLMemType mt(LLMemType::MTYPE_SPACE_PARTITION); 1719 LLMemType mt(LLMemType::MTYPE_SPACE_PARTITION);
@@ -1217,12 +1734,12 @@ void LLSpatialPartition::processOcclusion(LLCamera* camera)
1217 const U32 MAX_PUSHED = mOcclusionQueue.size(); 1734 const U32 MAX_PUSHED = mOcclusionQueue.size();
1218 U32 count = 0; 1735 U32 count = 0;
1219 U32 pcount = 0; 1736 U32 pcount = 0;
1220 1737
1221 while (pcount < MAX_PUSHED && count < MAX_PULLED && !mOcclusionQueue.empty()) 1738 while (pcount < MAX_PUSHED && count < MAX_PULLED && !mOcclusionQueue.empty())
1222 { 1739 {
1223 LLFastTimer t(LLFastTimer::FTM_OCCLUSION); 1740 LLFastTimer t(LLFastTimer::FTM_OCCLUSION);
1224 1741
1225 LLSpatialGroup* group = mOcclusionQueue.front(); 1742 LLPointer<LLSpatialGroup> group = mOcclusionQueue.front();
1226 if (!group->isState(LLSpatialGroup::IN_QUEUE)) 1743 if (!group->isState(LLSpatialGroup::IN_QUEUE))
1227 { 1744 {
1228 OCT_ERRS << "Spatial Group State Error. Group in queue not tagged as such." << llendl; 1745 OCT_ERRS << "Spatial Group State Error. Group in queue not tagged as such." << llendl;
@@ -1233,10 +1750,6 @@ void LLSpatialPartition::processOcclusion(LLCamera* camera)
1233 1750
1234 if (group->isDead()) 1751 if (group->isDead())
1235 { 1752 {
1236 if (group->safeToDelete())
1237 {
1238 delete group;
1239 }
1240 continue; 1753 continue;
1241 } 1754 }
1242 1755
@@ -1250,22 +1763,14 @@ void LLSpatialPartition::processOcclusion(LLCamera* camera)
1250 { 1763 {
1251 LLSpatialGroup* child = (LLSpatialGroup*) group->mOctreeNode->getChild(i)->getListener(0); 1764 LLSpatialGroup* child = (LLSpatialGroup*) group->mOctreeNode->getChild(i)->getListener(0);
1252 1765
1253 if (!child->isState(LLSpatialGroup::OCCLUDED | LLSpatialGroup::CULLED) 1766 //if (!child->isState(LLSpatialGroup::OCCLUDED | LLSpatialGroup::CULLED)
1254 && !child->isState(LLSpatialGroup::IN_QUEUE | LLSpatialGroup::ACTIVE_OCCLUSION)) 1767 if (!child->isState(LLSpatialGroup::IN_QUEUE | LLSpatialGroup::ACTIVE_OCCLUSION))
1255 { 1768 {
1256 child->setState(LLSpatialGroup::IN_QUEUE); 1769 child->setState(LLSpatialGroup::IN_QUEUE);
1257 mOcclusionQueue.push(child); 1770 mOcclusionQueue.push(child);
1258 } 1771 }
1259 } 1772 }
1260 1773
1261 /*if (group->isState(LLSpatialGroup::QUERY_PENDING))
1262 { //already on the pending group, put it back
1263 group->setState(LLSpatialGroup::IN_QUEUE);
1264 mOcclusionQueue.push(group);
1265 pcount++;
1266 continue;
1267 }*/
1268
1269 if (earlyFail(camera, group)) 1774 if (earlyFail(camera, group))
1270 { 1775 {
1271 sg_assert(!group->isState(LLSpatialGroup::OCCLUDED)); 1776 sg_assert(!group->isState(LLSpatialGroup::OCCLUDED));
@@ -1284,7 +1789,6 @@ void LLSpatialPartition::processOcclusion(LLCamera* camera)
1284 sg_assert(mOccludedList[i] != group); 1789 sg_assert(mOccludedList[i] != group);
1285 } 1790 }
1286#endif 1791#endif
1287 //group->setState(LLSpatialGroup::QUERY_PENDING);
1288 group->setState(LLSpatialGroup::ACTIVE_OCCLUSION); 1792 group->setState(LLSpatialGroup::ACTIVE_OCCLUSION);
1289 mQueryQueue.push(group); 1793 mQueryQueue.push(group);
1290 count++; 1794 count++;
@@ -1296,7 +1800,7 @@ void LLSpatialPartition::processOcclusion(LLCamera* camera)
1296 { 1800 {
1297 LLFastTimer t(LLFastTimer::FTM_OCCLUSION_READBACK); 1801 LLFastTimer t(LLFastTimer::FTM_OCCLUSION_READBACK);
1298 1802
1299 if (mOccludedList[i]->isDead() || !mOccludedList[i]->isState(LLSpatialGroup::ACTIVE_OCCLUSION)) 1803 if (mOccludedList[i]->isDead() || mOccludedList[i]->isState(LLSpatialGroup::DEACTIVATE_OCCLUSION))
1300 { 1804 {
1301 continue; 1805 continue;
1302 } 1806 }
@@ -1347,8 +1851,7 @@ void LLSpatialPartition::processOcclusion(LLCamera* camera)
1347 LLSpatialGroup* parent = (LLSpatialGroup*) oct_parent->getListener(0); 1851 LLSpatialGroup* parent = (LLSpatialGroup*) oct_parent->getListener(0);
1348 1852
1349 if (checkOcclusion(parent, camera)) 1853 if (checkOcclusion(parent, camera))
1350 { //force a guess on the parent and siblings 1854 { //force a guess on the parent and siblings
1351
1352 for (U32 i = 0; i < parent->mOctreeNode->getChildCount(); i++) 1855 for (U32 i = 0; i < parent->mOctreeNode->getChildCount(); i++)
1353 { 1856 {
1354 LLSpatialGroup* child = (LLSpatialGroup*) parent->mOctreeNode->getChild(i)->getListener(0); 1857 LLSpatialGroup* child = (LLSpatialGroup*) parent->mOctreeNode->getChild(i)->getListener(0);
@@ -1356,13 +1859,17 @@ void LLSpatialPartition::processOcclusion(LLCamera* camera)
1356 } 1859 }
1357 } 1860 }
1358 } 1861 }
1862
1863 //take children off the active list
1864 mOccludedList[i]->setState(LLSpatialGroup::DEACTIVATE_OCCLUSION, LLSpatialGroup::STATE_MODE_BRANCH);
1865 mOccludedList[i]->clearState(LLSpatialGroup::DEACTIVATE_OCCLUSION);
1359 } 1866 }
1360 mOccludedList[i]->setState(LLSpatialGroup::OCCLUDED, LLSpatialGroup::STATE_MODE_DIFF); 1867 mOccludedList[i]->setState(LLSpatialGroup::OCCLUDED, LLSpatialGroup::STATE_MODE_DIFF);
1361 } 1868 }
1362 else 1869 else
1363 { 1870 {
1364 //take children off the active list 1871 //take children off the active list
1365 mOccludedList[i]->setState(LLSpatialGroup::DEACTIVATE_OCCLUSION, LLSpatialGroup::STATE_MODE_DIFF); 1872 mOccludedList[i]->setState(LLSpatialGroup::DEACTIVATE_OCCLUSION, LLSpatialGroup::STATE_MODE_BRANCH);
1366 1873
1367 //keep this node on the active list 1874 //keep this node on the active list
1368 mOccludedList[i]->clearState(LLSpatialGroup::DEACTIVATE_OCCLUSION); 1875 mOccludedList[i]->clearState(LLSpatialGroup::DEACTIVATE_OCCLUSION);
@@ -1383,15 +1890,13 @@ void LLSpatialPartition::processOcclusion(LLCamera* camera)
1383 mOccludedList[i]->isState(LLSpatialGroup::DEACTIVATE_OCCLUSION)) //parent is occluded 1890 mOccludedList[i]->isState(LLSpatialGroup::DEACTIVATE_OCCLUSION)) //parent is occluded
1384 { 1891 {
1385 LLSpatialGroup* groupp = mOccludedList[i]; 1892 LLSpatialGroup* groupp = mOccludedList[i];
1386 mOccludedList.erase(mOccludedList.begin()+i); 1893 if (!groupp->isDead())
1387 groupp->clearState(LLSpatialGroup::ACTIVE_OCCLUSION);
1388 groupp->clearState(LLSpatialGroup::DEACTIVATE_OCCLUSION);
1389 groupp->clearState(LLSpatialGroup::OCCLUDING);
1390
1391 if (groupp->isDead() && groupp->safeToDelete())
1392 { 1894 {
1393 delete groupp; 1895 groupp->clearState(LLSpatialGroup::ACTIVE_OCCLUSION);
1896 groupp->clearState(LLSpatialGroup::DEACTIVATE_OCCLUSION);
1897 groupp->clearState(LLSpatialGroup::OCCLUDING);
1394 } 1898 }
1899 mOccludedList.erase(mOccludedList.begin()+i);
1395 } 1900 }
1396 else 1901 else
1397 { 1902 {
@@ -1399,11 +1904,13 @@ void LLSpatialPartition::processOcclusion(LLCamera* camera)
1399 } 1904 }
1400 } 1905 }
1401 1906
1907 validate_occlusion_list(mOccludedList);
1908
1402 //pump some non-culled items onto the occlusion list 1909 //pump some non-culled items onto the occlusion list
1403 //count = MAX_PULLED; 1910 //count = MAX_PULLED;
1404 while (!mQueryQueue.empty()) 1911 while (!mQueryQueue.empty())
1405 { 1912 {
1406 LLSpatialGroup* group = mQueryQueue.front(); 1913 LLPointer<LLSpatialGroup> group = mQueryQueue.front();
1407 mQueryQueue.pop(); 1914 mQueryQueue.pop();
1408 //group->clearState(LLSpatialGroup::QUERY_PENDING); 1915 //group->clearState(LLSpatialGroup::QUERY_PENDING);
1409 mOccludedList.push_back(group); 1916 mOccludedList.push_back(group);
@@ -1418,12 +1925,161 @@ void LLSpatialPartition::processOcclusion(LLCamera* camera)
1418 } 1925 }
1419} 1926}
1420 1927
1928class LLOcclusionIndexBuffer : public LLVertexBuffer
1929{
1930public:
1931 LLOcclusionIndexBuffer(U32 size)
1932 : LLVertexBuffer(0, GL_STREAM_DRAW_ARB)
1933 {
1934 allocateBuffer(0, size, TRUE);
1935
1936 LLStrider<U32> idx;
1937
1938 getIndexStrider(idx);
1939
1940 //12 triangles' indices
1941 idx[0] = 1; idx[1] = 0; idx[2] = 2; //front
1942 idx[3] = 3; idx[4] = 2; idx[5] = 0;
1943
1944 idx[6] = 4; idx[7] = 5; idx[8] = 1; //top
1945 idx[9] = 0; idx[10] = 1; idx[11] = 5;
1946
1947 idx[12] = 5; idx[13] = 4; idx[14] = 6; //back
1948 idx[15] = 7; idx[16] = 6; idx[17] = 4;
1949
1950 idx[18] = 6; idx[19] = 7; idx[20] = 3; //bottom
1951 idx[21] = 2; idx[22] = 3; idx[23] = 7;
1952
1953 idx[24] = 0; idx[25] = 5; idx[26] = 3; //left
1954 idx[27] = 6; idx[28] = 3; idx[29] = 5;
1955
1956 idx[30] = 4; idx[31] = 1; idx[32] = 7; //right
1957 idx[33] = 2; idx[34] = 7; idx[35] = 1;
1958 }
1959
1960 //virtual BOOL useVBOs() const { return FALSE; }
1961
1962 void setBuffer(U32 data_mask)
1963 {
1964 if (useVBOs())
1965 {
1966 glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, mGLIndices);
1967 sIBOActive = TRUE;
1968 unmapBuffer();
1969 }
1970 else if (sIBOActive)
1971 {
1972 glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, 0);
1973 sIBOActive = FALSE;
1974 }
1975
1976 sGLRenderIndices = mGLIndices;
1977 }
1978};
1979
1980class LLOcclusionVertexBuffer : public LLVertexBuffer
1981{
1982public:
1983 LLOcclusionVertexBuffer(S32 usage)
1984 : LLVertexBuffer(MAP_VERTEX, usage)
1985 {
1986 allocateBuffer(8, 0, TRUE);
1987 }
1988
1989 //virtual BOOL useVBOs() const { return FALSE; }
1990
1991 void setBuffer(U32 data_mask)
1992 {
1993 if (useVBOs())
1994 {
1995 glBindBufferARB(GL_ARRAY_BUFFER_ARB, mGLBuffer);
1996 sVBOActive = TRUE;
1997 unmapBuffer();
1998 }
1999 else if (sVBOActive)
2000 {
2001 glBindBufferARB(GL_ARRAY_BUFFER_ARB, 0);
2002 sVBOActive = FALSE;
2003 }
2004
2005 if (data_mask)
2006 {
2007 glVertexPointer(3,GL_FLOAT, 0, useVBOs() ? 0 : mMappedData);
2008 }
2009
2010 sGLRenderBuffer = mGLBuffer;
2011 }
2012};
2013
2014void LLSpatialPartition::buildOcclusion()
2015{
2016 if (mOccludedList.empty())
2017 {
2018 return;
2019 }
2020
2021 BOOL reset_all = FALSE;
2022 if (mOcclusionIndices.isNull())
2023 {
2024 mOcclusionIndices = new LLOcclusionIndexBuffer(36);
2025 reset_all = TRUE;
2026 }
2027
2028 //fill occlusion vertex buffers
2029 for (U32 i = 0; i < mOccludedList.size(); i++)
2030 {
2031 LLSpatialGroup* group = mOccludedList[i];
2032
2033 if (group->isState(LLSpatialGroup::OCCLUSION_DIRTY) || reset_all)
2034 {
2035 LLFastTimer ftm(LLFastTimer::FTM_REBUILD_OCCLUSION_VB);
2036
2037 if (group->mOcclusionVerts.isNull())
2038 {
2039 group->mOcclusionVerts = new LLOcclusionVertexBuffer(GL_STREAM_DRAW_ARB);
2040 }
2041
2042 group->clearState(LLSpatialGroup::OCCLUSION_DIRTY);
2043
2044 LLStrider<LLVector3> vert;
2045
2046 group->mOcclusionVerts->getVertexStrider(vert);
2047
2048 LLVector3 r = group->mBounds[1]*SG_OCCLUSION_FUDGE + LLVector3(0.1f,0.1f,0.1f);
2049
2050 for (U32 k = 0; k < 3; k++)
2051 {
2052 r.mV[k] = llmin(group->mBounds[1].mV[k]+0.25f, r.mV[k]);
2053 }
2054
2055 *vert++ = group->mBounds[0] + r.scaledVec(LLVector3(-1,1,1)); // 0 - left top front
2056 *vert++ = group->mBounds[0] + r.scaledVec(LLVector3(1,1,1)); // 1 - right top front
2057 *vert++ = group->mBounds[0] + r.scaledVec(LLVector3(1,-1,1)); // 2 - right bottom front
2058 *vert++ = group->mBounds[0] + r.scaledVec(LLVector3(-1,-1,1)); // 3 - left bottom front
2059
2060 *vert++ = group->mBounds[0] + r.scaledVec(LLVector3(1,1,-1)); // 4 - left top back
2061 *vert++ = group->mBounds[0] + r.scaledVec(LLVector3(-1,1,-1)); // 5 - right top back
2062 *vert++ = group->mBounds[0] + r.scaledVec(LLVector3(-1,-1,-1)); // 6 - right bottom back
2063 *vert++ = group->mBounds[0] + r.scaledVec(LLVector3(1,-1,-1)); // 7 -left bottom back
2064 }
2065 }
2066
2067/* for (U32 i = 0; i < mOccludedList.size(); i++)
2068 {
2069 LLSpatialGroup* group = mOccludedList[i];
2070 if (!group->mOcclusionVerts.isNull() && group->mOcclusionVerts->isLocked())
2071 {
2072 LLFastTimer ftm(LLFastTimer::FTM_REBUILD_OCCLUSION_VB);
2073 group->mOcclusionVerts->setBuffer(0);
2074 }
2075 }*/
2076}
2077
1421void LLSpatialPartition::doOcclusion(LLCamera* camera) 2078void LLSpatialPartition::doOcclusion(LLCamera* camera)
1422{ 2079{
1423 LLMemType mt(LLMemType::MTYPE_SPACE_PARTITION); 2080 LLMemType mt(LLMemType::MTYPE_SPACE_PARTITION);
1424 2081
1425 sIgnoreOcclusion = gUseWireframe; 2082 LLFastTimer t(LLFastTimer::FTM_RENDER_OCCLUSION);
1426 LLFastTimer t(LLFastTimer::FTM_RENDER_OCCLUSION);
1427 2083
1428#if LL_OCTREE_PARANOIA_CHECK 2084#if LL_OCTREE_PARANOIA_CHECK
1429 LLSpatialGroup* check = (LLSpatialGroup*) mOctree->getListener(0); 2085 LLSpatialGroup* check = (LLSpatialGroup*) mOctree->getListener(0);
@@ -1432,9 +2088,16 @@ void LLSpatialPartition::doOcclusion(LLCamera* camera)
1432 2088
1433 stop_glerror(); 2089 stop_glerror();
1434 2090
2091 U32 num_verts = mOccludedList.size() * 8;
2092
2093 if (num_verts == 0)
2094 {
2095 return;
2096 }
2097
1435 //actually perform the occlusion queries 2098 //actually perform the occlusion queries
1436 LLGLDepthTest gls_depth(GL_TRUE, GL_FALSE); 2099 LLGLDepthTest gls_depth(GL_TRUE, GL_FALSE);
1437 glDisable(GL_TEXTURE_2D); 2100 LLGLDisable(GL_TEXTURE_2D);
1438 gPipeline.disableLights(); 2101 gPipeline.disableLights();
1439 LLGLEnable cull_face(GL_CULL_FACE); 2102 LLGLEnable cull_face(GL_CULL_FACE);
1440 LLGLDisable blend(GL_BLEND); 2103 LLGLDisable blend(GL_BLEND);
@@ -1443,25 +2106,16 @@ void LLSpatialPartition::doOcclusion(LLCamera* camera)
1443 glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE); 2106 glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE);
1444 glColor4f(1,1,1,1); 2107 glColor4f(1,1,1,1);
1445 2108
1446 //sort occlusion queries front to back 2109 mOcclusionIndices->setBuffer(0);
1447 /*for (U32 i = 0; i < mOccludedList.size(); i++)
1448 {
1449 LLSpatialGroup* group = mOccludedList[i];
1450
1451 LLVector3 v = group->mOctreeNode->getCenter()-camera->getOrigin();
1452 group->mDistance = v*v;
1453 }
1454
1455 std::sort(mOccludedList.begin(), mOccludedList.end(), dist_greater());
1456 2110
1457 glClearStencil(0); 2111 U32* indicesp = (U32*) mOcclusionIndices->getIndicesPointer();
1458 glClear(GL_STENCIL_BUFFER_BIT);
1459 LLGLEnable stencil(GL_STENCIL_TEST);
1460 glStencilFunc(GL_GREATER, 1, 0xFFFFFFFF);
1461 glStencilOp(GL_KEEP, GL_SET, GL_KEEP);*/
1462
1463 genBoxList();
1464 2112
2113 glDisableClientState(GL_NORMAL_ARRAY);
2114 glDisableClientState(GL_TEXTURE_COORD_ARRAY);
2115 glDisableClientState(GL_COLOR_ARRAY);
2116#if !LL_RELEASE_FOR_DOWNLOAD
2117 LLGLState::checkClientArrays(LLVertexBuffer::MAP_VERTEX);
2118#endif
1465 for (U32 i = 0; i < mOccludedList.size(); i++) 2119 for (U32 i = 0; i < mOccludedList.size(); i++)
1466 { 2120 {
1467#if LL_OCTREE_PARANOIA_CHECK 2121#if LL_OCTREE_PARANOIA_CHECK
@@ -1482,32 +2136,10 @@ void LLSpatialPartition::doOcclusion(LLCamera* camera)
1482 } 2136 }
1483 else 2137 else
1484 { //early rejection criteria passed, send some geometry to the query 2138 { //early rejection criteria passed, send some geometry to the query
1485 LLVector3 c; 2139 group->mOcclusionVerts->setBuffer(LLVertexBuffer::MAP_VERTEX);
1486 LLVector3 r;
1487
1488 sg_assert(!group->isState(LLSpatialGroup::DIRTY));
1489
1490 c = group->mBounds[0];
1491 r = group->mBounds[1]*SG_OCCLUSION_FUDGE + LLVector3(0.01f,0.01f,0.01f);
1492 for (U32 k = 0; k < 3; k++)
1493 {
1494 r.mV[k] = llmin(group->mBounds[1].mV[k]+0.25f, r.mV[k]);
1495 }
1496
1497#if LL_OCTREE_PARANOIA_CHECK
1498 LLVector3 e = camera->getOrigin();
1499 LLVector3 min = c - r;
1500 LLVector3 max = c + r;
1501 BOOL outside = FALSE;
1502 for (U32 j = 0; j < 3; j++)
1503 {
1504 outside = outside || (e.mV[j] < min.mV[j] || e.mV[j] > max.mV[j]);
1505 }
1506 sg_assert(outside);
1507#endif
1508
1509 glBeginQueryARB(GL_SAMPLES_PASSED_ARB, mOcclusionQueries[i]); 2140 glBeginQueryARB(GL_SAMPLES_PASSED_ARB, mOcclusionQueries[i]);
1510 drawBox(c,r); 2141 glDrawRangeElements(GL_TRIANGLES, 0, 7, 36,
2142 GL_UNSIGNED_INT, indicesp);
1511 glEndQueryARB(GL_SAMPLES_PASSED_ARB); 2143 glEndQueryARB(GL_SAMPLES_PASSED_ARB);
1512 2144
1513 group->setState(LLSpatialGroup::QUERY_OUT); 2145 group->setState(LLSpatialGroup::QUERY_OUT);
@@ -1516,10 +2148,11 @@ void LLSpatialPartition::doOcclusion(LLCamera* camera)
1516 } 2148 }
1517 stop_glerror(); 2149 stop_glerror();
1518 2150
2151 gPipeline.mTrianglesDrawn += mOccludedList.size()*12;
2152
1519 glFlush(); 2153 glFlush();
1520 2154
1521 glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); 2155 glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
1522 glEnable(GL_TEXTURE_2D);
1523} 2156}
1524 2157
1525class LLOctreeGet : public LLSpatialGroup::OctreeTraveler 2158class LLOctreeGet : public LLSpatialGroup::OctreeTraveler
@@ -1618,6 +2251,8 @@ S32 LLSpatialPartition::getDrawables(const LLVector3& pos, F32 rad,
1618 2251
1619S32 LLSpatialPartition::getObjects(const LLVector3& pos, F32 rad, LLDrawable::drawable_set_t &results) 2252S32 LLSpatialPartition::getObjects(const LLVector3& pos, F32 rad, LLDrawable::drawable_set_t &results)
1620{ 2253{
2254 LLSpatialGroup* group = (LLSpatialGroup*) mOctree->getListener(0);
2255 group->rebound();
1621 return getDrawables(pos, rad, results, FALSE); 2256 return getDrawables(pos, rad, results, FALSE);
1622} 2257}
1623 2258
@@ -1626,182 +2261,363 @@ S32 LLSpatialPartition::getLights(const LLVector3& pos, F32 rad, LLDrawable::dra
1626 return getDrawables(pos, rad, results, TRUE); 2261 return getDrawables(pos, rad, results, TRUE);
1627} 2262}
1628 2263
1629class LLOctreeRenderNonOccluded : public LLOctreeTraveler<LLDrawable> 2264void pushVerts(LLDrawInfo* params, U32 mask)
1630{ 2265{
1631public: 2266 params->mVertexBuffer->setBuffer(mask);
1632 LLOctreeRenderNonOccluded() {} 2267 U32* indicesp = (U32*) params->mVertexBuffer->getIndicesPointer();
1633 2268 glDrawRangeElements(params->mParticle ? GL_POINTS : GL_TRIANGLES, params->mStart, params->mEnd, params->mCount,
1634 virtual void traverse(const LLSpatialGroup::OctreeNode* node) 2269 GL_UNSIGNED_INT, indicesp+params->mOffset);
2270}
2271
2272void pushVerts(LLSpatialGroup* group, U32 mask)
2273{
2274 LLDrawInfo* params = NULL;
2275
2276 for (LLSpatialGroup::draw_map_t::iterator i = group->mDrawMap.begin(); i != group->mDrawMap.end(); ++i)
1635 { 2277 {
1636 const LLSpatialGroup::OctreeState* state = node->getOctState(); 2278 for (std::vector<LLDrawInfo*>::iterator j = i->second.begin(); j != i->second.end(); ++j)
1637 LLSpatialGroup* group = (LLSpatialGroup*) node->getListener(0); 2279 {
2280 params = *j;
2281 pushVerts(params, mask);
2282 }
2283 }
2284}
2285
2286void pushVertsColorCoded(LLSpatialGroup* group, U32 mask)
2287{
2288 LLDrawInfo* params = NULL;
2289
2290 LLColor4 colors[] = {
2291 LLColor4::green,
2292 LLColor4::green1,
2293 LLColor4::green2,
2294 LLColor4::green3,
2295 LLColor4::green4,
2296 LLColor4::green5,
2297 LLColor4::green6
2298 };
1638 2299
1639 if (!group->isState(LLSpatialGroup::OCCLUDED | LLSpatialGroup::CULLED)) 2300 static const U32 col_count = sizeof(colors)/sizeof(LLColor4);
2301
2302 U32 col = 0;
2303
2304 for (LLSpatialGroup::draw_map_t::iterator i = group->mDrawMap.begin(); i != group->mDrawMap.end(); ++i)
2305 {
2306 for (std::vector<LLDrawInfo*>::iterator j = i->second.begin(); j != i->second.end(); ++j)
1640 { 2307 {
1641 state->accept(this); 2308 params = *j;
2309 glColor4f(colors[col].mV[0], colors[col].mV[1], colors[col].mV[2], 0.5f);
2310 params->mVertexBuffer->setBuffer(mask);
2311 U32* indicesp = (U32*) params->mVertexBuffer->getIndicesPointer();
2312 glDrawRangeElements(params->mParticle ? GL_POINTS : GL_TRIANGLES, params->mStart, params->mEnd, params->mCount,
2313 GL_UNSIGNED_INT, indicesp+params->mOffset);
2314 col = (col+1)%col_count;
2315 }
2316 }
2317}
1642 2318
1643 for (U32 i = 0; i < state->getChildCount(); i++) 2319void renderOctree(LLSpatialGroup* group)
2320{
2321 //render solid object bounding box, color
2322 //coded by buffer usage and activity
2323 LLGLDepthTest depth(GL_TRUE, GL_FALSE);
2324 glBlendFunc(GL_SRC_ALPHA, GL_ONE);
2325 LLVector4 col;
2326 if (group->mBuilt > 0.f)
2327 {
2328 group->mBuilt -= 2.f * gFrameIntervalSeconds;
2329 if (group->mBufferUsage == GL_STATIC_DRAW_ARB)
2330 {
2331 col.setVec(1.0f, 0, 0, group->mBuilt*0.5f);
2332 }
2333 else
2334 {
2335 col.setVec(0.1f,0.1f,1,0.1f);
2336 //col.setVec(1.0f, 1.0f, 0, sinf(group->mBuilt*3.14159f)*0.5f);
2337 }
2338
2339 if (group->mBufferUsage != GL_STATIC_DRAW_ARB)
2340 {
2341 if (group->mBufferUsage == GL_DYNAMIC_DRAW_ARB)
1644 { 2342 {
1645 traverse(state->getChild(i)); 2343 glColor4f(1,0,0,group->mBuilt);
1646 } 2344 }
1647 2345 else
1648 /*if (state->getElementCount() == 0)
1649 { 2346 {
1650 return; 2347 glColor4f(1,1,0,group->mBuilt);
1651 }*/ 2348 }
1652 2349
1653 //draw tight fit bounding box for spatial group 2350 LLGLDepthTest gl_depth(FALSE, FALSE);
1654 if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_OCTREE)) 2351 glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
2352 for (LLSpatialGroup::element_iter i = group->getData().begin(); i != group->getData().end(); ++i)
1655 { 2353 {
1656 if (node->getElementCount() == 0) 2354 LLDrawable* drawable = *i;
1657 { 2355 for (S32 j = 0; j < drawable->getNumFaces(); j++)
1658 return;
1659 }
1660
1661 if (node->hasLeafState())
1662 {
1663 glColor4f(1,1,1,1);
1664 }
1665 else
1666 { 2356 {
1667 glColor4f(0,1,1,1); 2357 LLFace* face = drawable->getFace(j);
2358 if (gFrameTimeSeconds - face->mLastUpdateTime < 0.5f && face->mVertexBuffer.notNull())
2359 {
2360 face->mVertexBuffer->setBuffer(LLVertexBuffer::MAP_VERTEX);
2361 //drawBox((face->mExtents[0] + face->mExtents[1])*0.5f,
2362 // (face->mExtents[1]-face->mExtents[0])*0.5f);
2363 glDrawElements(GL_TRIANGLES, face->getIndicesCount(), GL_UNSIGNED_INT,
2364 ((U32*) face->mVertexBuffer->getIndicesPointer())+face->getIndicesStart());
2365 }
1668 } 2366 }
2367 }
2368 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
2369 }
2370 }
2371 else
2372 {
2373 if (group->mBufferUsage == GL_STATIC_DRAW_ARB && !group->getData().empty()
2374 && group->mSpatialPartition->mRenderByGroup)
2375 {
2376 col.setVec(0.8f, 0.4f, 0.1f, 0.1f);
2377 }
2378 else
2379 {
2380 col.setVec(0.1f, 0.1f, 1.f, 0.1f);
2381 }
2382 }
1669 2383
2384 glColor4fv(col.mV);
2385 drawBox(group->mObjectBounds[0], group->mObjectBounds[1]*1.01f+LLVector3(0.001f, 0.001f, 0.001f));
2386 glDepthMask(GL_TRUE);
2387 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
1670 2388
1671 LLVector3 pos; 2389 //draw opaque outline
1672 LLVector3 size; 2390 glColor4f(col.mV[0], col.mV[1], col.mV[2], 1.f);
1673 2391 drawBoxOutline(group->mObjectBounds[0], group->mObjectBounds[1]);
1674 pos = group->mObjectBounds[0];
1675 size = group->mObjectBounds[1];
1676
1677 LLVector3 v1 = size.scaledVec(LLVector3( 1, 1,1));
1678 LLVector3 v2 = size.scaledVec(LLVector3(-1, 1,1));
1679 LLVector3 v3 = size.scaledVec(LLVector3(-1,-1,1));
1680 LLVector3 v4 = size.scaledVec(LLVector3( 1,-1,1));
1681
1682 glBegin(GL_LINE_LOOP); //top
1683 glVertex3fv((pos+v1).mV);
1684 glVertex3fv((pos+v2).mV);
1685 glVertex3fv((pos+v3).mV);
1686 glVertex3fv((pos+v4).mV);
1687 glEnd();
1688
1689 glBegin(GL_LINE_LOOP); //bottom
1690 glVertex3fv((pos-v1).mV);
1691 glVertex3fv((pos-v2).mV);
1692 glVertex3fv((pos-v3).mV);
1693 glVertex3fv((pos-v4).mV);
1694 glEnd();
1695
1696
1697 glBegin(GL_LINES);
1698
1699 //right
1700 glVertex3fv((pos+v1).mV);
1701 glVertex3fv((pos-v3).mV);
1702
1703 glVertex3fv((pos+v4).mV);
1704 glVertex3fv((pos-v2).mV);
1705
1706 //left
1707 glVertex3fv((pos+v2).mV);
1708 glVertex3fv((pos-v4).mV);
1709
1710 glVertex3fv((pos+v3).mV);
1711 glVertex3fv((pos-v1).mV);
1712 2392
1713 glEnd(); 2393 if (group->mOctreeNode->hasLeafState())
2394 {
2395 glColor4f(1,1,1,1);
2396 }
2397 else
2398 {
2399 glColor4f(0,1,1,1);
2400 }
2401
2402 drawBoxOutline(group->mBounds[0],group->mBounds[1]);
2403
2404// LLSpatialGroup::OctreeNode* node = group->mOctreeNode;
2405// glColor4f(0,1,0,1);
2406// drawBoxOutline(LLVector3(node->getCenter()), LLVector3(node->getSize()));
2407}
1714 2408
1715 LLVector3 nc = LLVector3(node->getCenter()); 2409void renderVisibility(LLSpatialGroup* group)
1716 LLVector3 ns = LLVector3(node->getSize()); 2410{
2411 LLGLEnable blend(GL_BLEND);
2412 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
2413 LLGLEnable cull(GL_CULL_FACE);
2414 glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
2415 {
2416 LLGLDepthTest depth_under(GL_TRUE, GL_FALSE, GL_GREATER);
2417 glColor4f(0, 0.5f, 0, 0.5f);
2418 pushVerts(group, LLVertexBuffer::MAP_VERTEX);
2419 }
1717 2420
1718 LLVector3 nv1 = ns.scaledVec(LLVector3( 1, 1,1)); 2421 {
1719 LLVector3 nv2 = ns.scaledVec(LLVector3(-1, 1,1)); 2422 LLGLDepthTest depth_over(GL_TRUE, GL_FALSE, GL_LEQUAL);
1720 LLVector3 nv3 = ns.scaledVec(LLVector3(-1,-1,1)); 2423 pushVertsColorCoded(group, LLVertexBuffer::MAP_VERTEX);
1721 LLVector3 nv4 = ns.scaledVec(LLVector3( 1,-1,1));
1722 2424
1723 2425 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
1724 2426
1725 /*if (node->getElementCount() > 0) 2427 pushVertsColorCoded(group, LLVertexBuffer::MAP_VERTEX);
1726 { 2428 }
1727 //spokes 2429}
1728 glColor4f(1,1,0,1);
1729 glVertex3fv(pos.mV);
1730 glColor4f(1,1,0,0);
1731 glVertex3fv(nc.mV);
1732
1733 glColor4f(1,1,0,1); glVertex3fv((pos+v1).mV); glColor4f(1,1,0,0); glVertex3fv(pos.mV);
1734 glColor4f(1,1,0,1); glVertex3fv((pos-v1).mV); glColor4f(1,1,0,0); glVertex3fv(pos.mV);
1735 glColor4f(1,1,0,1); glVertex3fv((pos+v2).mV); glColor4f(1,1,0,0); glVertex3fv(pos.mV);
1736 glColor4f(1,1,0,1); glVertex3fv((pos-v2).mV); glColor4f(1,1,0,0); glVertex3fv(pos.mV);
1737 glColor4f(1,1,0,1); glVertex3fv((pos+v3).mV); glColor4f(1,1,0,0); glVertex3fv(pos.mV);
1738 glColor4f(1,1,0,1); glVertex3fv((pos-v3).mV); glColor4f(1,1,0,0); glVertex3fv(pos.mV);
1739 glColor4f(1,1,0,1); glVertex3fv((pos+v4).mV); glColor4f(1,1,0,0); glVertex3fv(pos.mV);
1740 glColor4f(1,1,0,1); glVertex3fv((pos-v4).mV); glColor4f(1,1,0,0); glVertex3fv(pos.mV);
1741 }*/
1742 2430
1743 2431void renderBoundingBox(LLDrawable* drawable)
2432{
2433 if (drawable->isSpatialBridge())
2434 {
2435 glColor4f(1,0.5f,0,1);
2436 }
2437 else if (drawable->getVOVolume())
2438 {
2439 if (drawable->isRoot())
2440 {
2441 glColor4f(1,1,0,1);
2442 }
2443 else
2444 {
2445 glColor4f(0,1,0,1);
2446 }
2447 }
2448 else if (drawable->getVObj())
2449 {
2450 switch (drawable->getVObj()->getPCode())
2451 {
2452 case LLViewerObject::LL_VO_SURFACE_PATCH:
2453 glColor4f(0,1,1,1);
2454 break;
2455 case LLViewerObject::LL_VO_CLOUDS:
2456 glColor4f(0.5f,0.5f,0.5f,1.0f);
2457 break;
2458 case LLViewerObject::LL_VO_PART_GROUP:
2459 glColor4f(0,0,1,1);
2460 break;
2461 case LLViewerObject::LL_VO_WATER:
2462 glColor4f(0,0.5f,1,1);
2463 break;
2464 case LL_PCODE_LEGACY_TREE:
2465 glColor4f(0,0.5f,0,1);
2466 default:
2467 glColor4f(1,0,1,1);
2468 break;
2469 }
2470 }
2471 else
2472 {
2473 glColor4f(1,0,0,1);
2474 }
1744 2475
1745 /*glColor4f(0,1,0,1); 2476 const LLVector3* ext;
1746 glBegin(GL_LINE_LOOP); //top 2477 LLVector3 pos, size;
1747 glVertex3fv((nc+nv1).mV);
1748 glVertex3fv((nc+nv2).mV);
1749 glVertex3fv((nc+nv3).mV);
1750 glVertex3fv((nc+nv4).mV);
1751 glEnd();
1752 2478
1753 glBegin(GL_LINE_LOOP); //bottom 2479 //render face bounding boxes
1754 glVertex3fv((nc-nv1).mV); 2480 for (S32 i = 0; i < drawable->getNumFaces(); i++)
1755 glVertex3fv((nc-nv2).mV); 2481 {
1756 glVertex3fv((nc-nv3).mV); 2482 LLFace* facep = drawable->getFace(i);
1757 glVertex3fv((nc-nv4).mV);
1758 glEnd();
1759 2483
2484 ext = facep->mExtents;
1760 2485
1761 glBegin(GL_LINES); 2486 if (ext[0].isExactlyZero() && ext[1].isExactlyZero())
2487 {
2488 continue;
2489 }
2490 pos = (ext[0] + ext[1]) * 0.5f;
2491 size = (ext[1] - ext[0]) * 0.5f;
2492 drawBoxOutline(pos,size);
2493 }
1762 2494
1763 //right 2495 //render drawable bounding box
1764 glVertex3fv((nc+nv1).mV); 2496 ext = drawable->getSpatialExtents();
1765 glVertex3fv((nc-nv3).mV);
1766
1767 glVertex3fv((nc+nv4).mV);
1768 glVertex3fv((nc-nv2).mV);
1769 2497
1770 //left 2498 pos = (ext[0] + ext[1]) * 0.5f;
1771 glVertex3fv((nc+nv2).mV); 2499 size = (ext[1] - ext[0]) * 0.5f;
1772 glVertex3fv((nc-nv4).mV); 2500
2501 drawBoxOutline(pos,size);
2502}
1773 2503
1774 glVertex3fv((nc+nv3).mV); 2504void renderTexturePriority(LLDrawable* drawable)
1775 glVertex3fv((nc-nv1).mV); 2505{
1776 glEnd();*/ 2506 for (int face=0; face<drawable->getNumFaces(); ++face)
2507 {
2508 LLFace *facep = drawable->getFace(face);
2509
2510 LLVector4 cold(0,0,0.25f);
2511 LLVector4 hot(1,0.25f,0.25f);
2512
2513 LLVector4 boost_cold(0,0,0,0);
2514 LLVector4 boost_hot(0,1,0,1);
2515
2516 LLGLDisable blend(GL_BLEND);
2517
2518 //LLViewerImage* imagep = facep->getTexture();
2519 //if (imagep)
2520 {
2521
2522 //F32 vsize = LLVOVolume::getTextureVirtualSize(facep);
2523 //F32 vsize = imagep->mMaxVirtualSize;
2524 F32 vsize = facep->getPixelArea();
1777 2525
1778 glLineWidth(1); 2526 if (vsize > sCurMaxTexPriority)
1779 2527 {
1780 glDepthMask(GL_FALSE); 2528 sCurMaxTexPriority = vsize;
1781 glBlendFunc(GL_SRC_ALPHA, GL_ONE);
1782 glColor4f(0.1f,0.1f,1,0.1f);
1783 drawBox(group->mObjectBounds[0], group->mObjectBounds[1]*1.01f+LLVector3(0.001f, 0.001f, 0.001f));
1784 glDepthMask(GL_TRUE);
1785 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
1786 } 2529 }
2530
2531 F32 t = vsize/sLastMaxTexPriority;
2532
2533 LLVector4 col = lerp(cold, hot, t);
2534 glColor4fv(col.mV);
1787 } 2535 }
1788 /*else 2536 //else
2537 //{
2538 // glColor4f(1,0,1,1);
2539 //}
2540
2541
2542
2543 LLVector3 center = (facep->mExtents[1]+facep->mExtents[0])*0.5f;
2544 LLVector3 size = (facep->mExtents[1]-facep->mExtents[0])*0.5f + LLVector3(0.01f, 0.01f, 0.01f);
2545 drawBox(center, size);
2546
2547 /*S32 boost = imagep->getBoostLevel();
2548 if (boost)
2549 {
2550 F32 t = (F32) boost / (F32) (LLViewerImage::BOOST_MAX_LEVEL-1);
2551 LLVector4 col = lerp(boost_cold, boost_hot, t);
2552 LLGLEnable blend_on(GL_BLEND);
2553 glBlendFunc(GL_SRC_ALPHA, GL_ONE);
2554 glColor4fv(col.mV);
2555 drawBox(center, size);
2556 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
2557 }*/
2558 }
2559}
2560
2561void renderPoints(LLDrawable* drawablep)
2562{
2563 LLGLDepthTest depth(GL_FALSE, GL_FALSE);
2564 glBegin(GL_POINTS);
2565 glColor3f(1,1,1);
2566 LLVector3 center(drawablep->getPositionGroup());
2567 for (S32 i = 0; i < drawablep->getNumFaces(); i++)
2568 {
2569 glVertex3fv(drawablep->getFace(i)->mCenterLocal.mV);
2570 }
2571 glEnd();
2572}
2573
2574void renderTextureAnim(LLDrawInfo* params)
2575{
2576 if (!params->mTextureMatrix)
2577 {
2578 return;
2579 }
2580
2581 LLGLEnable blend(GL_BLEND);
2582 glColor4f(1,1,0,0.5f);
2583 pushVerts(params, LLVertexBuffer::MAP_VERTEX);
2584}
2585
2586class LLOctreeRenderNonOccluded : public LLOctreeTraveler<LLDrawable>
2587{
2588public:
2589 LLOctreeRenderNonOccluded() {}
2590
2591 virtual void traverse(const LLSpatialGroup::OctreeNode* node)
2592 {
2593 const LLSpatialGroup::OctreeState* state = node->getOctState();
2594 LLSpatialGroup* group = (LLSpatialGroup*) node->getListener(0);
2595
2596
2597 if ((!gPipeline.sUseOcclusion || !group->isState(LLSpatialGroup::OCCLUDED)) &&
2598 !group->isState(LLSpatialGroup::CULLED))
1789 { 2599 {
1790 //occlusion paranoia check 2600 state->accept(this);
1791 const LLSpatialGroup::OctreeNode* parent = node; 2601
1792 while (parent != NULL) 2602 for (U32 i = 0; i < state->getChildCount(); i++)
1793 { 2603 {
1794 LLSpatialGroup* grp = (LLSpatialGroup*) parent->getListener(0); 2604 traverse(state->getChild(i));
1795 if (grp->isState(LLSpatialGroup::ACTIVE_OCCLUSION)) 2605 }
1796 { 2606
1797 return; 2607 //draw tight fit bounding boxes for spatial group
1798 } 2608 if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_OCTREE))
1799 parent = (const LLSpatialGroup::OctreeNode*) parent->getParent(); 2609 {
2610 renderOctree(group);
1800 } 2611 }
1801 2612
1802 glColor4f(1,0,1,1); 2613 //render visibility wireframe
1803 drawBox(group->mBounds[0], group->mBounds[1]); 2614 if (group->mSpatialPartition->mRenderByGroup &&
1804 }*/ 2615 gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_OCCLUSION) &&
2616 !group->isState(LLSpatialGroup::GEOM_DIRTY))
2617 {
2618 renderVisibility(group);
2619 }
2620 }
1805 } 2621 }
1806 2622
1807 virtual void visit(const LLSpatialGroup::OctreeState* branch) 2623 virtual void visit(const LLSpatialGroup::OctreeState* branch)
@@ -1816,276 +2632,37 @@ public:
1816 LLVector3 nodeCenter = group->mBounds[0]; 2632 LLVector3 nodeCenter = group->mBounds[0];
1817 LLVector3 octCenter = LLVector3(group->mOctreeNode->getCenter()); 2633 LLVector3 octCenter = LLVector3(group->mOctreeNode->getCenter());
1818 2634
1819 if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_OCTREE))
1820 {
1821 glBegin(GL_LINES);
1822 glColor4f(1,0.5f,0,1);
1823 glVertex3fv(nodeCenter.mV);
1824 glColor4f(0,1,1,0);
1825 glVertex3fv(octCenter.mV);
1826 glEnd();
1827 }
1828
1829 for (LLSpatialGroup::OctreeState::const_element_iter i = branch->getData().begin(); i != branch->getData().end(); ++i) 2635 for (LLSpatialGroup::OctreeState::const_element_iter i = branch->getData().begin(); i != branch->getData().end(); ++i)
1830 { 2636 {
1831 LLDrawable* drawable = *i; 2637 LLDrawable* drawable = *i;
1832 2638
1833 if (drawable->isSpatialBridge())
1834 {
1835 LLSpatialBridge* bridge = (LLSpatialBridge*) drawable;
1836 glPushMatrix();
1837 glMultMatrixf((F32*)bridge->mDrawable->getWorldMatrix().mMatrix);
1838 traverse(bridge->mOctree);
1839 glPopMatrix();
1840 }
1841
1842 if (!drawable->isVisible())
1843 {
1844 continue;
1845 }
1846
1847 if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_BBOXES)) 2639 if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_BBOXES))
1848 { 2640 {
1849 if (drawable->isSpatialBridge()) 2641 renderBoundingBox(drawable);
1850 {
1851 glColor4f(1,0.5f,0,1);
1852 }
1853 else if (drawable->getVOVolume())
1854 {
1855 if (drawable->isRoot())
1856 {
1857 glColor4f(1,1,0,1);
1858 }
1859 else
1860 {
1861 glColor4f(0,1,0,1);
1862 }
1863 }
1864 else if (drawable->getVObj())
1865 {
1866 switch (drawable->getVObj()->getPCode())
1867 {
1868 case LLViewerObject::LL_VO_SURFACE_PATCH:
1869 glColor4f(0,1,1,1);
1870 break;
1871 case LLViewerObject::LL_VO_CLOUDS:
1872 glColor4f(0.5f,0.5f,0.5f,1.0f);
1873 break;
1874 case LLViewerObject::LL_VO_PART_GROUP:
1875 glColor4f(0,0,1,1);
1876 break;
1877 case LLViewerObject::LL_VO_WATER:
1878 glColor4f(0,0.5f,1,1);
1879 break;
1880 case LL_PCODE_LEGACY_TREE:
1881 glColor4f(0,0.5f,0,1);
1882 default:
1883 glColor4f(1,0,1,1);
1884 break;
1885 }
1886 }
1887 else
1888 {
1889 glColor4f(1,0,0,1);
1890 }
1891
1892
1893 const LLVector3* ext = drawable->getSpatialExtents();
1894
1895 LLVector3 pos = (ext[0] + ext[1]) * 0.5f;
1896 LLVector3 size = (ext[1] - ext[0]) * 0.5f;
1897
1898 LLVector3 v1 = size.scaledVec(LLVector3( 1, 1,1));
1899 LLVector3 v2 = size.scaledVec(LLVector3(-1, 1,1));
1900 LLVector3 v3 = size.scaledVec(LLVector3(-1,-1,1));
1901 LLVector3 v4 = size.scaledVec(LLVector3( 1,-1,1));
1902
1903 glBegin(GL_LINE_LOOP); //top
1904 glVertex3fv((pos+v1).mV);
1905 glVertex3fv((pos+v2).mV);
1906 glVertex3fv((pos+v3).mV);
1907 glVertex3fv((pos+v4).mV);
1908 glEnd();
1909
1910 glBegin(GL_LINE_LOOP); //bottom
1911 glVertex3fv((pos-v1).mV);
1912 glVertex3fv((pos-v2).mV);
1913 glVertex3fv((pos-v3).mV);
1914 glVertex3fv((pos-v4).mV);
1915 glEnd();
1916
1917
1918 glBegin(GL_LINES);
1919
1920 //right
1921 glVertex3fv((pos+v1).mV);
1922 glVertex3fv((pos-v3).mV);
1923
1924 glVertex3fv((pos+v4).mV);
1925 glVertex3fv((pos-v2).mV);
1926
1927 //left
1928 glVertex3fv((pos+v2).mV);
1929 glVertex3fv((pos-v4).mV);
1930
1931 glVertex3fv((pos+v3).mV);
1932 glVertex3fv((pos-v1).mV);
1933
1934 glEnd();
1935
1936 //render space partition trace
1937 glBegin(GL_LINE_STRIP);
1938 glColor4f(1,0,0,1);
1939 glVertex3fv(pos.mV);
1940 glColor4f(0,1,0,1);
1941 glVertex3dv(drawable->getPositionGroup().mdV);
1942 glColor4f(0,0,1,1);
1943 glVertex3fv(nodeCenter.mV);
1944 glColor4f(1,1,0,1);
1945 glVertex3fv(octCenter.mV);
1946 glEnd();
1947 } 2642 }
1948 2643
1949 if (drawable->getVOVolume() && gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_FACE_CHAINS | LLPipeline::RENDER_DEBUG_TEXTURE_PRIORITY)) 2644 if (drawable->getVOVolume() && gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_TEXTURE_PRIORITY))
1950 { 2645 {
1951 glLineWidth(3); 2646 renderTexturePriority(drawable);
1952
1953 for (int face=0; face<drawable->getNumFaces(); ++face)
1954 {
1955 LLFace *facep = drawable->getFace(face);
1956
1957 if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_FACE_CHAINS))
1958 {
1959 LLGLDepthTest depth(GL_FALSE);
1960 if (facep->mNextFace)
1961 {
1962 glBegin(GL_LINE_STRIP);
1963
1964 if (facep->isState(LLFace::GLOBAL))
1965 {
1966 glColor4f(0,1,0,1);
1967 }
1968 else
1969 {
1970 glColor4f(1,0.5f,0.25f,1);
1971 }
1972
1973 if (drawable->isActive())
1974 {
1975 glVertex3fv(facep->mCenterLocal.mV);
1976 glVertex3fv(facep->mNextFace->mCenterLocal.mV);
1977 }
1978 else
1979 {
1980 glVertex3fv(facep->mCenterAgent.mV);
1981 glVertex3fv(facep->mNextFace->mCenterAgent.mV);
1982 }
1983
1984 glEnd();
1985 }
1986 else
1987 {
1988 glPointSize(5);
1989 glBegin(GL_POINTS);
1990
1991 if (!facep->isState(LLFace::GLOBAL))
1992 {
1993 glColor4f(1,0.75f,0,1);
1994 glVertex3fv(facep->mCenterLocal.mV);
1995 }
1996 else
1997 {
1998 glColor4f(0,0.75f,1,1);
1999 glVertex3fv(facep->mCenterAgent.mV);
2000 }
2001
2002 glEnd();
2003 glPointSize(1);
2004 }
2005 }
2006
2007 if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_TEXTURE_PRIORITY))
2008 {
2009 LLVector4 cold(0,0,0.25f);
2010 LLVector4 hot(1,0.25f,0.25f);
2011
2012 LLVector4 boost_cold(0,0,0,0);
2013 LLVector4 boost_hot(0,1,0,1);
2014
2015 LLGLDisable blend(GL_BLEND);
2016
2017 LLViewerImage* imagep = facep->getTexture();
2018 if (imagep)
2019 {
2020
2021 //F32 vsize = LLVOVolume::getTextureVirtualSize(facep);
2022 F32 vsize = imagep->mMaxVirtualSize;
2023
2024 if (vsize > sCurMaxTexPriority)
2025 {
2026 sCurMaxTexPriority = vsize;
2027 }
2028
2029 F32 t = vsize/sLastMaxTexPriority;
2030
2031 LLVector4 col = lerp(cold, hot, t);
2032 glColor4fv(col.mV);
2033 }
2034 else
2035 {
2036 glColor4f(1,0,1,1);
2037 }
2038
2039 LLVector3 center = (facep->mExtents[1]+facep->mExtents[0])*0.5f;
2040 LLVector3 size = (facep->mExtents[1]-facep->mExtents[0])*0.5f + LLVector3(0.01f, 0.01f, 0.01f);
2041 drawBox(center, size);
2042
2043 S32 boost = imagep->getBoostLevel();
2044 if (boost)
2045 {
2046 F32 t = (F32) boost / (F32) (LLViewerImage::BOOST_MAX_LEVEL-1);
2047 LLVector4 col = lerp(boost_cold, boost_hot, t);
2048 LLGLEnable blend_on(GL_BLEND);
2049 glBlendFunc(GL_SRC_ALPHA, GL_ONE);
2050 glColor4fv(col.mV);
2051 drawBox(center, size);
2052 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
2053 }
2054
2055 }
2056 }
2057 } 2647 }
2058 2648
2059 if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_POINTS)) 2649 if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_POINTS))
2060 { 2650 {
2061 glPointSize(4); 2651 renderPoints(drawable);
2062 glColor4f(1,1,1,1); 2652 }
2063 glBegin(GL_POINTS); 2653 }
2064 S32 num_faces = drawable->getNumFaces(); 2654
2065 for (S32 i = 0; i < num_faces; i++) 2655 for (LLSpatialGroup::draw_map_t::iterator i = group->mDrawMap.begin(); i != group->mDrawMap.end(); ++i)
2656 {
2657 std::vector<LLDrawInfo*>& draw_vec = i->second;
2658 for (std::vector<LLDrawInfo*>::iterator j = draw_vec.begin(); j != draw_vec.end(); ++j)
2659 {
2660 LLDrawInfo* draw_info = *j;
2661 if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_TEXTURE_ANIM))
2066 { 2662 {
2067 LLStrider<LLVector3> vertices; 2663 renderTextureAnim(draw_info);
2068 drawable->getFace(i)->getVertices(vertices);
2069
2070 LLFace* face = drawable->getFace(i);
2071
2072 for (S32 v = 0; v < (S32)drawable->getFace(i)->getGeomCount(); v++)
2073 {
2074 if (!face->getDrawable()->isActive())
2075 {
2076 //glVertex3fv(vertices[v].mV);
2077 }
2078 else
2079 {
2080 glVertex3fv((vertices[v]*face->getRenderMatrix()).mV);
2081 }
2082 }
2083 } 2664 }
2084 glEnd();
2085 glPointSize(1);
2086 } 2665 }
2087
2088 glLineWidth(1);
2089 } 2666 }
2090 } 2667 }
2091}; 2668};
@@ -2096,8 +2673,8 @@ void LLSpatialPartition::renderDebug()
2096 LLPipeline::RENDER_DEBUG_OCCLUSION | 2673 LLPipeline::RENDER_DEBUG_OCCLUSION |
2097 LLPipeline::RENDER_DEBUG_BBOXES | 2674 LLPipeline::RENDER_DEBUG_BBOXES |
2098 LLPipeline::RENDER_DEBUG_POINTS | 2675 LLPipeline::RENDER_DEBUG_POINTS |
2099 LLPipeline::RENDER_DEBUG_FACE_CHAINS | 2676 LLPipeline::RENDER_DEBUG_TEXTURE_PRIORITY |
2100 LLPipeline::RENDER_DEBUG_TEXTURE_PRIORITY)) 2677 LLPipeline::RENDER_DEBUG_TEXTURE_ANIM))
2101 { 2678 {
2102 return; 2679 return;
2103 } 2680 }
@@ -2105,7 +2682,7 @@ void LLSpatialPartition::renderDebug()
2105 if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_TEXTURE_PRIORITY)) 2682 if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_TEXTURE_PRIORITY))
2106 { 2683 {
2107 //sLastMaxTexPriority = lerp(sLastMaxTexPriority, sCurMaxTexPriority, gFrameIntervalSeconds); 2684 //sLastMaxTexPriority = lerp(sLastMaxTexPriority, sCurMaxTexPriority, gFrameIntervalSeconds);
2108 sLastMaxTexPriority = sCurMaxTexPriority; 2685 sLastMaxTexPriority = (F32) gCamera->getScreenPixelArea();
2109 sCurMaxTexPriority = 0.f; 2686 sCurMaxTexPriority = 0.f;
2110 } 2687 }
2111 2688
@@ -2119,78 +2696,50 @@ void LLSpatialPartition::renderDebug()
2119 2696
2120 LLOctreeRenderNonOccluded render_debug; 2697 LLOctreeRenderNonOccluded render_debug;
2121 render_debug.traverse(mOctree); 2698 render_debug.traverse(mOctree);
2122
2123 LLGLDisable cull_face(GL_CULL_FACE);
2124 2699
2125 { 2700 LLGLDisable cull_face(GL_CULL_FACE);
2126 LLGLDepthTest gls_depth(GL_TRUE, GL_FALSE);
2127
2128 //draw frustum
2129 glColor4f(0,0,1,0.5f);
2130 glBegin(GL_QUADS);
2131 //glVertex3fv(gCamera->mAgentFrustum[0].mV);
2132 //glVertex3fv(gCamera->mAgentFrustum[1].mV);
2133 //glVertex3fv(gCamera->mAgentFrustum[2].mV);
2134 //glVertex3fv(gCamera->mAgentFrustum[3].mV);
2135 2701
2136 //glVertex3fv(gCamera->mAgentFrustum[4].mV); 2702 if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_OCCLUSION) && !mOccludedList.empty() &&
2137 //glVertex3fv(gCamera->mAgentFrustum[5].mV); 2703 mOcclusionIndices.notNull())
2138 //glVertex3fv(gCamera->mAgentFrustum[6].mV);
2139 //glVertex3fv(gCamera->mAgentFrustum[7].mV);
2140
2141 glVertex3fv(gCamera->mAgentFrustum[0].mV);
2142 glVertex3fv(gCamera->mAgentFrustum[1].mV);
2143 glVertex3fv(gCamera->mAgentFrustum[5].mV);
2144 glVertex3fv(gCamera->mAgentFrustum[4].mV);
2145
2146 glVertex3fv(gCamera->mAgentFrustum[1].mV);
2147 glVertex3fv(gCamera->mAgentFrustum[2].mV);
2148 glVertex3fv(gCamera->mAgentFrustum[6].mV);
2149 glVertex3fv(gCamera->mAgentFrustum[5].mV);
2150
2151 glVertex3fv(gCamera->mAgentFrustum[2].mV);
2152 glVertex3fv(gCamera->mAgentFrustum[3].mV);
2153 glVertex3fv(gCamera->mAgentFrustum[7].mV);
2154 glVertex3fv(gCamera->mAgentFrustum[6].mV);
2155
2156 glVertex3fv(gCamera->mAgentFrustum[3].mV);
2157 glVertex3fv(gCamera->mAgentFrustum[0].mV);
2158 glVertex3fv(gCamera->mAgentFrustum[4].mV);
2159 glVertex3fv(gCamera->mAgentFrustum[7].mV);
2160
2161 glEnd();
2162 }
2163
2164 if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_OCCLUSION))
2165 { 2704 {
2166 LLGLDisable fog(GL_FOG); 2705 LLGLDisable fog(GL_FOG);
2167 LLGLDepthTest gls_depth(GL_FALSE); 2706 LLGLDepthTest gls_depth(GL_FALSE);
2168 glBlendFunc(GL_SRC_ALPHA, GL_ONE); 2707 glBlendFunc(GL_SRC_ALPHA, GL_ONE);
2708 mOcclusionIndices->setBuffer(0);
2709 U32* indicesp = (U32*) mOcclusionIndices->getIndicesPointer();
2710
2711 LLGLEnable blend(GL_BLEND);
2712 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
2713 LLGLEnable cull(GL_CULL_FACE);
2714 glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
2169 2715
2170 for (std::vector<LLSpatialGroup*>::iterator i = mOccludedList.begin(); i != mOccludedList.end(); ++i) 2716 for (U32 i = 0; i < mOccludedList.size(); i++)
2171 { //draw occluded nodes 2717 { //draw occluded nodes
2172 LLSpatialGroup* node = *i; 2718 LLSpatialGroup* node = mOccludedList[i];
2173 if (node->isDead()) 2719 if (node->isDead() ||
2720 !node->isState(LLSpatialGroup::OCCLUDED) ||
2721 node->mOcclusionVerts.isNull())
2174 { 2722 {
2175 continue; 2723 continue;
2176 } 2724 }
2177 if (!node->isState(LLSpatialGroup::OCCLUDED)) 2725
2726 node->mOcclusionVerts->setBuffer(LLVertexBuffer::MAP_VERTEX);
2178 { 2727 {
2179 continue; 2728 LLGLDepthTest depth_under(GL_TRUE, GL_FALSE, GL_GREATER);
2729 glColor4f(0.5, 0.5f, 0, 0.25f);
2730 glDrawRangeElements(GL_TRIANGLES, 0, 7, 36,
2731 GL_UNSIGNED_INT, indicesp);
2180 } 2732 }
2181 else 2733
2182 { 2734 {
2183 glColor4f(0.25f,0.125f,0.1f,0.125f); 2735 LLGLDepthTest depth_over(GL_TRUE, GL_FALSE, GL_LEQUAL);
2736 glColor4f(0.0,1.0f,1.0f,1.0f);
2737 glDrawRangeElements(GL_TRIANGLES, 0, 7, 36,
2738 GL_UNSIGNED_INT, indicesp);
2184 } 2739 }
2185 LLVector3 c;
2186 LLVector3 r;
2187
2188 c = node->mBounds[0];
2189 r = node->mBounds[1]*SG_OCCLUSION_FUDGE + LLVector3(0.01f,0.01f,0.01f);;
2190
2191 drawBox(c,r);
2192 } 2740 }
2193 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); 2741
2742 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
2194 } 2743 }
2195} 2744}
2196 2745
@@ -2272,3 +2821,27 @@ LLDrawable* LLSpatialPartition::pickDrawable(const LLVector3& start, const LLVec
2272 collision.setVec(pick.mEnd); 2821 collision.setVec(pick.mEnd);
2273 return ret; 2822 return ret;
2274} 2823}
2824
2825LLDrawInfo::LLDrawInfo(U32 start, U32 end, U32 count, U32 offset,
2826 LLViewerImage* texture, LLVertexBuffer* buffer,
2827 BOOL fullbright, U8 bump, BOOL particle, F32 part_size)
2828:
2829 mVertexBuffer(buffer),
2830 mTexture(texture),
2831 mTextureMatrix(NULL),
2832 mStart(start),
2833 mEnd(end),
2834 mCount(count),
2835 mOffset(offset),
2836 mFullbright(fullbright),
2837 mBump(bump),
2838 mParticle(particle),
2839 mPartSize(part_size),
2840 mVSize(0.f)
2841{
2842}
2843
2844LLVertexBuffer* LLGeometryManager::createVertexBuffer(U32 type_mask, U32 usage)
2845{
2846 return new LLVertexBuffer(type_mask, usage);
2847}
diff --git a/linden/indra/newview/llspatialpartition.h b/linden/indra/newview/llspatialpartition.h
index 737029a..5804a57 100644
--- a/linden/indra/newview/llspatialpartition.h
+++ b/linden/indra/newview/llspatialpartition.h
@@ -33,26 +33,77 @@
33#include "llmemory.h" 33#include "llmemory.h"
34#include "lldrawable.h" 34#include "lldrawable.h"
35#include "lloctree.h" 35#include "lloctree.h"
36#include "llvertexbuffer.h"
36#include "llgltypes.h" 37#include "llgltypes.h"
38#include "llcubemap.h"
37 39
38#include <queue> 40#include <queue>
39 41
40class LLCullInfo 42#define SG_STATE_INHERIT_MASK (CULLED | OCCLUDED)
43#define SG_INITIAL_STATE_MASK (OCCLUSION_DIRTY | DIRTY | GEOM_DIRTY)
44
45class LLSpatialPartition;
46class LLSpatialBridge;
47
48class LLDrawInfo
41{ 49{
42public: 50public:
43 LLVector3 mPos; 51 LLDrawInfo(U32 start, U32 end, U32 count, U32 offset,
44 F32 mRadius; 52 LLViewerImage* image, LLVertexBuffer* buffer,
45 LLPointer<LLDrawable> mDrawablep; 53 BOOL fullbright = FALSE, U8 bump = 0, BOOL particle = FALSE, F32 part_size = 0);
46}; 54
55 LLPointer<LLVertexBuffer> mVertexBuffer;
56 LLPointer<LLViewerImage> mTexture;
57 LLPointer<LLCubeMap> mReflectionMap;
58 LLColor4U mGlowColor;
59 const LLMatrix4* mTextureMatrix;
60 U32 mStart;
61 U32 mEnd;
62 U32 mCount;
63 U32 mOffset;
64 BOOL mFullbright;
65 U8 mBump;
66 BOOL mParticle;
67 F32 mPartSize;
68 F32 mVSize;
69
70 struct CompareTexture
71 {
72 bool operator()(const LLDrawInfo& lhs, const LLDrawInfo& rhs)
73 {
74 return lhs.mTexture > rhs.mTexture;
75 }
76 };
47 77
48#define SG_STATE_INHERIT_MASK (CULLED | OCCLUDED) 78 struct CompareTexturePtr
49class LLSpatialPartition; 79 {
80 bool operator()(const LLDrawInfo* const& lhs, const LLDrawInfo* const& rhs)
81 {
82
83 return lhs == NULL || rhs == NULL || lhs->mTexture > rhs->mTexture;
84 }
85 };
86
87 struct CompareBump
88 {
89 bool operator()(const LLDrawInfo* const& lhs, const LLDrawInfo* const& rhs)
90 {
91 return lhs == NULL || rhs == NULL || lhs->mBump > rhs->mBump;
92 }
93 };
94};
50 95
51class LLSpatialGroup : public LLOctreeListener<LLDrawable> 96class LLSpatialGroup : public LLOctreeListener<LLDrawable>
52{ 97{
53 friend class LLSpatialPartition; 98 friend class LLSpatialPartition;
54public: 99public:
55 100
101 typedef std::vector<LLPointer<LLSpatialGroup> > sg_vector_t;
102 typedef std::set<LLPointer<LLSpatialGroup> > sg_set_t;
103 typedef std::vector<LLPointer<LLSpatialBridge> > bridge_list_t;
104 typedef std::map<U32, std::vector<LLDrawInfo*> > draw_map_t;
105 typedef std::map<LLPointer<LLViewerImage>, LLPointer<LLVertexBuffer> > buffer_map_t;
106
56 typedef LLOctreeListener<LLDrawable> BaseType; 107 typedef LLOctreeListener<LLDrawable> BaseType;
57 typedef LLOctreeListener<LLDrawable> OctreeListener; 108 typedef LLOctreeListener<LLDrawable> OctreeListener;
58 typedef LLTreeNode<LLDrawable> TreeNode; 109 typedef LLTreeNode<LLDrawable> TreeNode;
@@ -60,6 +111,24 @@ public:
60 typedef LLOctreeRoot<LLDrawable> OctreeRoot; 111 typedef LLOctreeRoot<LLDrawable> OctreeRoot;
61 typedef LLOctreeState<LLDrawable> OctreeState; 112 typedef LLOctreeState<LLDrawable> OctreeState;
62 typedef LLOctreeTraveler<LLDrawable> OctreeTraveler; 113 typedef LLOctreeTraveler<LLDrawable> OctreeTraveler;
114 typedef LLOctreeState<LLDrawable>::element_iter element_iter;
115 typedef LLOctreeState<LLDrawable>::element_list element_list;
116
117 struct CompareDistanceGreater
118 {
119 bool operator()(const LLSpatialGroup* const& lhs, const LLSpatialGroup* const& rhs)
120 {
121 return lhs->mDistance > rhs->mDistance;
122 }
123 };
124
125 struct CompareDepthGreater
126 {
127 bool operator()(const LLSpatialGroup* const& lhs, const LLSpatialGroup* const& rhs)
128 {
129 return lhs->mDepth > rhs->mDepth;
130 }
131 };
63 132
64 typedef enum 133 typedef enum
65 { 134 {
@@ -75,10 +144,17 @@ public:
75 RESHADOW_QUEUE = 0x00000200, 144 RESHADOW_QUEUE = 0x00000200,
76 DIRTY = 0x00000400, 145 DIRTY = 0x00000400,
77 OBJECT_DIRTY = 0x00000800, 146 OBJECT_DIRTY = 0x00000800,
78 DISCARD_QUERY = 0x00001000, 147 GEOM_DIRTY = 0x00001000,
79 QUERY_OUT = 0x00002000, 148 MATRIX_DIRTY = 0x00002000,
80 OCCLUDING = 0x00004000, 149 ALPHA_DIRTY = 0x00004000,
81 SKIP_FRUSTUM_CHECK = 0x00008000, 150 DISCARD_QUERY = 0x00008000,
151 QUERY_OUT = 0x00010000,
152 OCCLUDING = 0x00020000,
153 SKIP_FRUSTUM_CHECK = 0x00040000,
154 OCCLUSION_DIRTY = 0x00080000,
155 BELOW_WATER = 0x00100000,
156 IN_IMAGE_QUEUE = 0x00200000,
157 IMAGE_DIRTY = 0x00400000,
82 } eSpatialState; 158 } eSpatialState;
83 159
84 typedef enum 160 typedef enum
@@ -89,20 +165,21 @@ public:
89 } eSetStateMode; 165 } eSetStateMode;
90 166
91 LLSpatialGroup(OctreeNode* node, LLSpatialPartition* part); 167 LLSpatialGroup(OctreeNode* node, LLSpatialPartition* part);
92 BOOL safeToDelete();
93 virtual ~LLSpatialGroup(); 168 virtual ~LLSpatialGroup();
94 169
95 S32 getCount() const { return mObjects.size(); }
96 BOOL isDead() { return isState(DEAD); } 170 BOOL isDead() { return isState(DEAD); }
97 BOOL isState(U32 state) const { return mState & state ? TRUE : FALSE; } 171 BOOL isState(U32 state) const { return mState & state ? TRUE : FALSE; }
98 U32 getState() { return mState; } 172 U32 getState() { return mState; }
99 void setState(U32 state) { mState |= state; } 173 void setState(U32 state) { mState |= state; }
100 void clearState(U32 state) { mState &= ~state; } 174 void clearState(U32 state) { mState &= ~state; }
101 175
176 void clearDrawMap();
102 void validate(); 177 void validate();
103 178 void validateDrawMap();
179
104 void setState(U32 state, S32 mode); 180 void setState(U32 state, S32 mode);
105 181
182 LLSpatialGroup* getParent();
106 183
107 void clearState(U32 state, S32 mode); 184 void clearState(U32 state, S32 mode);
108 BOOL addObject(LLDrawable *drawablep, BOOL add_all = FALSE, BOOL from_octree = FALSE); 185 BOOL addObject(LLDrawable *drawablep, BOOL add_all = FALSE, BOOL from_octree = FALSE);
@@ -113,8 +190,16 @@ public:
113 BOOL boundObjects(BOOL empty, LLVector3& newMin, LLVector3& newMax); 190 BOOL boundObjects(BOOL empty, LLVector3& newMin, LLVector3& newMax);
114 void unbound(); 191 void unbound();
115 BOOL rebound(); 192 BOOL rebound();
193 void destroyGL();
194
195 void updateDistance(LLCamera& camera);
116 BOOL changeLOD(); 196 BOOL changeLOD();
117 197 void rebuildGeom();
198 void makeStatic();
199
200 void dirtyGeom() { setState(GEOM_DIRTY); }
201 element_list& getData() { return mOctreeNode->getOctState()->getData(); }
202
118 //LISTENER FUNCTIONS 203 //LISTENER FUNCTIONS
119 virtual void handleInsertion(const TreeNode* node, LLDrawable* face); 204 virtual void handleInsertion(const TreeNode* node, LLDrawable* face);
120 virtual void handleRemoval(const TreeNode* node, LLDrawable* face); 205 virtual void handleRemoval(const TreeNode* node, LLDrawable* face);
@@ -124,12 +209,15 @@ public:
124 virtual void handleChildRemoval(const OctreeNode* parent, const OctreeNode* child); 209 virtual void handleChildRemoval(const OctreeNode* parent, const OctreeNode* child);
125 210
126protected: 211protected:
127 std::vector<LLCullInfo> mObjects;
128 U32 mState; 212 U32 mState;
129 S32 mLODHash; 213 S32 mLODHash;
130 static S32 sLODSeed; 214 static S32 sLODSeed;
131 215
132public: 216public:
217 bridge_list_t mBridgeList;
218 buffer_map_t mBufferMap; //used by volume buffers to store unique buffers per texture
219
220 F32 mBuilt;
133 OctreeNode* mOctreeNode; 221 OctreeNode* mOctreeNode;
134 LLSpatialPartition* mSpatialPartition; 222 LLSpatialPartition* mSpatialPartition;
135 LLVector3 mBounds[2]; 223 LLVector3 mBounds[2];
@@ -137,69 +225,130 @@ public:
137 LLVector3 mObjectExtents[2]; 225 LLVector3 mObjectExtents[2];
138 LLVector3 mObjectBounds[2]; 226 LLVector3 mObjectBounds[2];
139 227
228 LLPointer<LLVertexBuffer> mVertexBuffer;
229 LLPointer<LLVertexBuffer> mOcclusionVerts;
230 LLPointer<LLCubeMap> mReflectionMap;
231
232 U32 mBufferUsage;
233 draw_map_t mDrawMap;
234
235 U32 mVertexCount;
236 U32 mIndexCount;
237 F32 mDistance;
238 F32 mDepth;
239 F32 mLastUpdateDistance;
240 F32 mLastUpdateTime;
241 F32 mLastAddTime;
242 F32 mLastRenderTime;
243
244 LLVector3 mViewAngle;
245 LLVector3 mLastUpdateViewAngle;
246
247 F32 mPixelArea;
248 F32 mRadius;
140}; 249};
141 250
142class LLSpatialPartition 251class LLGeometryManager
143{ 252{
144public: 253public:
145 LLSpatialPartition(); 254 std::vector<LLFace*> mFaceList;
255 virtual ~LLGeometryManager() { }
256 virtual void rebuildGeom(LLSpatialGroup* group) = 0;
257 virtual void getGeometry(LLSpatialGroup* group) = 0;
258 virtual void addGeometryCount(LLSpatialGroup* group, U32 &vertex_count, U32 &index_count);
259 virtual LLVertexBuffer* createVertexBuffer(U32 type_mask, U32 usage);
260};
261
262class LLSpatialPartition: public LLGeometryManager
263{
264public:
265 LLSpatialPartition(U32 data_mask, BOOL is_volatile = FALSE, U32 mBufferUsage = GL_STATIC_DRAW_ARB);
146 virtual ~LLSpatialPartition(); 266 virtual ~LLSpatialPartition();
147 267
148 LLSpatialGroup *put(LLDrawable *drawablep); 268 LLSpatialGroup *put(LLDrawable *drawablep, BOOL was_visible = FALSE);
149 BOOL remove(LLDrawable *drawablep, LLSpatialGroup *curp); 269 BOOL remove(LLDrawable *drawablep, LLSpatialGroup *curp);
150 270
151 LLDrawable* pickDrawable(const LLVector3& start, const LLVector3& end, LLVector3& collision); 271 LLDrawable* pickDrawable(const LLVector3& start, const LLVector3& end, LLVector3& collision);
152 272
153 // If the drawable moves, move it here. 273 // If the drawable moves, move it here.
154 virtual void move(LLDrawable *drawablep, LLSpatialGroup *curp, BOOL immediate = FALSE); 274 virtual void move(LLDrawable *drawablep, LLSpatialGroup *curp, BOOL immediate = FALSE);
155 void shift(const LLVector3 &offset); 275 virtual void shift(const LLVector3 &offset);
276
277 virtual F32 calcDistance(LLSpatialGroup* group, LLCamera& camera);
278 virtual F32 calcPixelArea(LLSpatialGroup* group, LLCamera& camera);
279
280 virtual void rebuildGeom(LLSpatialGroup* group);
156 281
157 S32 cull(LLCamera &camera, std::vector<LLDrawable *>* results = NULL, BOOL for_select = FALSE); // Cull on arbitrary frustum 282 S32 cull(LLCamera &camera, std::vector<LLDrawable *>* results = NULL, BOOL for_select = FALSE); // Cull on arbitrary frustum
158 BOOL checkOcclusion(LLSpatialGroup* group, LLCamera* camera); 283 BOOL checkOcclusion(LLSpatialGroup* group, LLCamera* camera);
284 void markReimage(LLSpatialGroup* group);
285 void processImagery(LLCamera* camera);
159 void processOcclusion(LLCamera* camera); 286 void processOcclusion(LLCamera* camera);
287 void buildOcclusion();
160 void doOcclusion(LLCamera* camera); 288 void doOcclusion(LLCamera* camera);
161 BOOL isVisible(const LLVector3& v); 289 BOOL isVisible(const LLVector3& v);
162 290 BOOL isVolatile() const { return mVolatile; }
291
292 virtual LLSpatialBridge* asBridge() { return NULL; }
293 virtual BOOL isBridge() { return asBridge() != NULL; }
294
163 S32 getObjects(const LLVector3& pos, F32 rad, LLDrawable::drawable_set_t &results ); 295 S32 getObjects(const LLVector3& pos, F32 rad, LLDrawable::drawable_set_t &results );
164 S32 getLights(const LLVector3& pos, F32 rad, LLDrawable::drawable_set_t &results ); 296 S32 getLights(const LLVector3& pos, F32 rad, LLDrawable::drawable_set_t &results );
165 297
166 void renderDebug(); 298 void renderDebug();
167 void restoreGL(); 299 void restoreGL();
300 void resetVertexBuffers();
168 301
169protected: 302protected:
170 S32 getDrawables(const LLVector3& pos, F32 rad, LLDrawable::drawable_set_t &results, BOOL get_lights ); 303 S32 getDrawables(const LLVector3& pos, F32 rad, LLDrawable::drawable_set_t &results, BOOL get_lights );
171 304
172 LLSpatialGroup *mLastAddedGroupp; 305 typedef std::set<LLPointer<LLSpatialGroup> > spatial_group_set_t;
173
174 typedef std::set<LLSpatialGroup*> spatial_group_set_t;
175 spatial_group_set_t mSpatialGroups; 306 spatial_group_set_t mSpatialGroups;
176 307
177 //things that might be occluded 308 //things that might be occluded
178 std::queue<LLSpatialGroup*> mOcclusionQueue; 309 typedef std::queue<LLPointer<LLSpatialGroup> > spatial_group_queue_t;
310 spatial_group_queue_t mOcclusionQueue;
311
312 //things that need an image update
313 spatial_group_queue_t mImageQueue;
179 314
180 //things awaiting query 315 //things awaiting query
181 std::queue<LLSpatialGroup*> mQueryQueue; 316 spatial_group_queue_t mQueryQueue;
182 317
183 std::vector<LLGLuint> mOcclusionQueries; 318 std::vector<LLGLuint> mOcclusionQueries;
184 319
185public: 320public:
186 LLSpatialGroup::OctreeNode* mOctree; 321 LLSpatialGroup::OctreeNode* mOctree;
187 322
188 //things that are occluded 323 U32 mBufferUsage;
189 std::vector<LLSpatialGroup*> mOccludedList; 324 BOOL mRenderByGroup;
190 325 BOOL mImageEnabled;
191 std::queue<LLSpatialGroup*> mReshadowQueue; 326 U32 mLODSeed;
327 U32 mLODPeriod;
328 U32 mVertexDataMask;
329 F32 mSlopRatio; //percentage distance must change before drawables receive LOD update (default is 0.25);
330 BOOL mVolatile; //if TRUE, occlusion queries will be discarded when nodes change size
331 BOOL mDepthMask; //if TRUE, objects in this partition will be written to depth during alpha rendering
332 U32 mDrawableType;
333 U32 mPartitionType;
334
335 //index buffer for occlusion verts
336 LLPointer<LLVertexBuffer> mOcclusionIndices;
192 337
338 //things that are occluded
339 std::vector<LLPointer<LLSpatialGroup> > mOccludedList;
193}; 340};
194 341
195// class for creating bridges between spatial partitions 342// class for creating bridges between spatial partitions
196class LLSpatialBridge : public LLDrawable, public LLSpatialPartition 343class LLSpatialBridge : public LLDrawable, public LLSpatialPartition
197{ 344{
198public: 345public:
199 LLSpatialBridge(LLDrawable* root); 346 typedef std::vector<LLPointer<LLSpatialBridge> > bridge_vector_t;
347
348 LLSpatialBridge(LLDrawable* root, U32 data_mask);
200 virtual ~LLSpatialBridge(); 349 virtual ~LLSpatialBridge();
201 350
202 virtual BOOL isSpatialBridge() const { return TRUE; } 351 virtual BOOL isSpatialBridge() const { return TRUE; }
203 352
204 virtual void updateSpatialExtents(); 353 virtual void updateSpatialExtents();
205 virtual void updateBinRadius(); 354 virtual void updateBinRadius();
@@ -212,11 +361,123 @@ public:
212 virtual void shiftPos(const LLVector3& vec); 361 virtual void shiftPos(const LLVector3& vec);
213 virtual void cleanupReferences(); 362 virtual void cleanupReferences();
214 virtual LLSpatialPartition* asPartition() { return this; } 363 virtual LLSpatialPartition* asPartition() { return this; }
215 LLCamera transformCamera(LLCamera& camera); 364 virtual LLSpatialBridge* asBridge() { return this; }
365
366 virtual LLCamera transformCamera(LLCamera& camera);
216 367
217 LLDrawable* mDrawable; 368 LLDrawable* mDrawable;
218}; 369};
219 370
371//spatial partition for water (implemented in LLVOWater.cpp)
372class LLWaterPartition : public LLSpatialPartition
373{
374public:
375 LLWaterPartition();
376 virtual void getGeometry(LLSpatialGroup* group) { }
377 virtual void addGeometryCount(LLSpatialGroup* group, U32 &vertex_count, U32& index_count) { }
378};
379
380//spatial partition for terrain (impelmented in LLVOSurfacePatch.cpp)
381class LLTerrainPartition : public LLSpatialPartition
382{
383public:
384 LLTerrainPartition();
385 virtual void getGeometry(LLSpatialGroup* group);
386 virtual LLVertexBuffer* createVertexBuffer(U32 type_mask, U32 usage);
387};
388
389//spatial partition for trees
390class LLTreePartition : public LLSpatialPartition
391{
392public:
393 LLTreePartition();
394 virtual void getGeometry(LLSpatialGroup* group) { }
395 virtual void addGeometryCount(LLSpatialGroup* group, U32 &vertex_count, U32& index_count) { }
396
397};
398
399//spatial partition for particles (implemented in LLVOPartGroup.cpp)
400class LLParticlePartition : public LLSpatialPartition
401{
402public:
403 LLParticlePartition();
404 virtual void getGeometry(LLSpatialGroup* group);
405 virtual void addGeometryCount(LLSpatialGroup* group, U32 &vertex_count, U32& index_count);
406 virtual F32 calcPixelArea(LLSpatialGroup* group, LLCamera& camera);
407protected:
408 U32 mRenderPass;
409};
410
411//spatial partition for grass (implemented in LLVOGrass.cpp)
412class LLGrassPartition : public LLParticlePartition
413{
414public:
415 LLGrassPartition();
416};
417
418//spatial partition for clouds (implemented in LLVOClouds.cpp)
419class LLCloudPartition : public LLParticlePartition
420{
421public:
422 LLCloudPartition();
423};
424
425//class for wrangling geometry out of volumes (implemented in LLVOVolume.cpp)
426class LLVolumeGeometryManager: public LLGeometryManager
427{
428public:
429 virtual ~LLVolumeGeometryManager() { }
430 virtual void rebuildGeom(LLSpatialGroup* group);
431 virtual void getGeometry(LLSpatialGroup* group);
432 void registerFace(LLSpatialGroup* group, LLFace* facep, U32 type);
433};
434
435//spatial partition that uses volume geometry manager (implemented in LLVOVolume.cpp)
436class LLVolumePartition : public LLSpatialPartition, public LLVolumeGeometryManager
437{
438public:
439 LLVolumePartition();
440 virtual void rebuildGeom(LLSpatialGroup* group) { LLVolumeGeometryManager::rebuildGeom(group); }
441 virtual void getGeometry(LLSpatialGroup* group) { LLVolumeGeometryManager::getGeometry(group); }
442 virtual void addGeometryCount(LLSpatialGroup* group, U32 &vertex_count, U32& index_count) { LLVolumeGeometryManager::addGeometryCount(group, vertex_count, index_count); }
443};
444
445//spatial bridge that uses volume geometry manager (implemented in LLVOVolume.cpp)
446class LLVolumeBridge : public LLSpatialBridge, public LLVolumeGeometryManager
447{
448public:
449 LLVolumeBridge(LLDrawable* drawable);
450 virtual void rebuildGeom(LLSpatialGroup* group) { LLVolumeGeometryManager::rebuildGeom(group); }
451 virtual void getGeometry(LLSpatialGroup* group) { LLVolumeGeometryManager::getGeometry(group); }
452 virtual void addGeometryCount(LLSpatialGroup* group, U32 &vertex_count, U32& index_count) { LLVolumeGeometryManager::addGeometryCount(group, vertex_count, index_count); }
453};
454
455class LLHUDBridge : public LLVolumeBridge
456{
457public:
458 LLHUDBridge(LLDrawable* drawablep);
459 virtual void shiftPos(const LLVector3& vec);
460 virtual F32 calcPixelArea(LLSpatialGroup* group, LLCamera& camera);
461};
462
463//spatial partition that holds nothing but spatial bridges
464class LLBridgePartition : public LLSpatialPartition
465{
466public:
467 LLBridgePartition();
468 virtual void getGeometry(LLSpatialGroup* group) { }
469 virtual void addGeometryCount(LLSpatialGroup* group, U32 &vertex_count, U32& index_count) { }
470};
471
472class LLHUDPartition : public LLBridgePartition
473{
474public:
475 LLHUDPartition();
476 virtual void shift(const LLVector3 &offset);
477};
478
479void validate_draw_info(LLDrawInfo& params);
480
220extern const F32 SG_BOX_SIDE; 481extern const F32 SG_BOX_SIDE;
221extern const F32 SG_BOX_OFFSET; 482extern const F32 SG_BOX_OFFSET;
222extern const F32 SG_BOX_RAD; 483extern const F32 SG_BOX_RAD;
diff --git a/linden/indra/newview/llsphere.cpp b/linden/indra/newview/llsphere.cpp
index 44eaeff..5c49e6e 100644
--- a/linden/indra/newview/llsphere.cpp
+++ b/linden/indra/newview/llsphere.cpp
@@ -32,7 +32,7 @@
32#include "llviewerprecompiledheaders.h" 32#include "llviewerprecompiledheaders.h"
33#include "llsphere.h" 33#include "llsphere.h"
34#include "llerror.h" 34#include "llerror.h"
35 35#include "llvertexbuffer.h"
36#include "llglheaders.h" 36#include "llglheaders.h"
37 37
38GLUquadricObj *gQuadObj2 = NULL; 38GLUquadricObj *gQuadObj2 = NULL;
@@ -167,11 +167,13 @@ void LLSphere::render(F32 pixel_area)
167 { 167 {
168 level_of_detail = 3; 168 level_of_detail = 3;
169 } 169 }
170 LLVertexBuffer::unbind();
170 glCallList(mDList[level_of_detail]); 171 glCallList(mDList[level_of_detail]);
171} 172}
172 173
173 174
174void LLSphere::render() 175void LLSphere::render()
175{ 176{
177 LLVertexBuffer::unbind();
176 glCallList(mDList[0]); 178 glCallList(mDList[0]);
177} 179}
diff --git a/linden/indra/newview/llsprite.cpp b/linden/indra/newview/llsprite.cpp
index 601810c..fb56f4d 100644
--- a/linden/indra/newview/llsprite.cpp
+++ b/linden/indra/newview/llsprite.cpp
@@ -94,14 +94,7 @@ void LLSprite::updateFace(LLFace &face)
94 // First, figure out how many vertices/indices we need. 94 // First, figure out how many vertices/indices we need.
95 U32 num_vertices, num_indices; 95 U32 num_vertices, num_indices;
96 U32 vertex_count = 0; 96 U32 vertex_count = 0;
97 97
98
99 LLStrider<LLVector3> verticesp;
100 LLStrider<LLVector3> normalsp;
101 LLStrider<LLVector2> tex_coordsp;
102 U32 *indicesp;
103 S32 index_offset;
104
105 // Get the total number of vertices and indices 98 // Get the total number of vertices and indices
106 if (mFollow) 99 if (mFollow)
107 { 100 {
@@ -114,14 +107,7 @@ void LLSprite::updateFace(LLFace &face)
114 num_indices = 12; 107 num_indices = 12;
115 } 108 }
116 109
117 // Setup face
118 face.setPrimType(LLTriangles);
119 face.setSize(num_vertices, num_indices); 110 face.setSize(num_vertices, num_indices);
120 index_offset = face.getGeometry(verticesp,normalsp,tex_coordsp, indicesp);
121 if (-1 == index_offset)
122 {
123 return;
124 }
125 111
126 if (mFollow) 112 if (mFollow)
127 { 113 {
@@ -206,7 +192,30 @@ void LLSprite::updateFace(LLFace &face)
206 } 192 }
207 193
208 face.setFaceColor(mColor); 194 face.setFaceColor(mColor);
209 195
196 LLStrider<LLVector3> verticesp;
197 LLStrider<LLVector3> normalsp;
198 LLStrider<LLVector2> tex_coordsp;
199 LLStrider<U32> indicesp;
200 S32 index_offset;
201
202 // Setup face
203 if (face.mVertexBuffer.isNull())
204 {
205 face.mVertexBuffer = new LLVertexBuffer(LLVertexBuffer::MAP_VERTEX |
206 LLVertexBuffer::MAP_TEXCOORD,
207 GL_STREAM_DRAW_ARB);
208 face.mVertexBuffer->allocateBuffer(4, 12, TRUE);
209 face.setGeomIndex(0);
210 face.setIndicesIndex(0);
211 }
212
213 index_offset = face.getGeometry(verticesp,normalsp,tex_coordsp, indicesp);
214 if (-1 == index_offset)
215 {
216 return;
217 }
218
210 *tex_coordsp = LLVector2(0.f, 0.f); 219 *tex_coordsp = LLVector2(0.f, 0.f);
211 *verticesp = mC; 220 *verticesp = mC;
212 tex_coordsp++; 221 tex_coordsp++;
@@ -251,6 +260,7 @@ void LLSprite::updateFace(LLFace &face)
251 *indicesp++ = 3 + index_offset; 260 *indicesp++ = 3 + index_offset;
252 } 261 }
253 262
263 //face.mVertexBuffer->setBuffer(0);
254 face.mCenterAgent = mPosition; 264 face.mCenterAgent = mPosition;
255} 265}
256 266
diff --git a/linden/indra/newview/llstartup.cpp b/linden/indra/newview/llstartup.cpp
index 916db16..cfdf899 100644
--- a/linden/indra/newview/llstartup.cpp
+++ b/linden/indra/newview/llstartup.cpp
@@ -44,9 +44,9 @@
44#include "audiosettings.h" 44#include "audiosettings.h"
45#include "llcachename.h" 45#include "llcachename.h"
46#include "llviewercontrol.h" 46#include "llviewercontrol.h"
47#include "llcrypto.h"
48#include "lldir.h" 47#include "lldir.h"
49#include "lleconomy.h" 48#include "lleconomy.h"
49#include "llerrorcontrol.h"
50#include "llfiltersd2xmlrpc.h" 50#include "llfiltersd2xmlrpc.h"
51#include "llfocusmgr.h" 51#include "llfocusmgr.h"
52#include "imageids.h" 52#include "imageids.h"
@@ -64,6 +64,7 @@
64#include "llversion.h" 64#include "llversion.h"
65#include "llvfs.h" 65#include "llvfs.h"
66#include "llwindow.h" // for shell_open 66#include "llwindow.h" // for shell_open
67#include "llxorcipher.h" // saved password, MAC address
67#include "message.h" 68#include "message.h"
68#include "v3math.h" 69#include "v3math.h"
69 70
@@ -81,7 +82,6 @@
81#include "lleventnotifier.h" 82#include "lleventnotifier.h"
82#include "llface.h" 83#include "llface.h"
83#include "llfeaturemanager.h" 84#include "llfeaturemanager.h"
84#include "llfloateraccounthistory.h"
85#include "llfloaterchat.h" 85#include "llfloaterchat.h"
86#include "llfloatergesture.h" 86#include "llfloatergesture.h"
87#include "llfloaterland.h" 87#include "llfloaterland.h"
@@ -118,6 +118,8 @@
118#include "llsky.h" 118#include "llsky.h"
119#include "llstatview.h" 119#include "llstatview.h"
120#include "llsurface.h" 120#include "llsurface.h"
121#include "lltexturecache.h"
122#include "lltexturefetch.h"
121#include "lltoolmgr.h" 123#include "lltoolmgr.h"
122#include "llui.h" 124#include "llui.h"
123#include "llurlwhitelist.h" 125#include "llurlwhitelist.h"
@@ -145,10 +147,13 @@
145#include "viewer.h" 147#include "viewer.h"
146#include "llmediaengine.h" 148#include "llmediaengine.h"
147#include "llfasttimerview.h" 149#include "llfasttimerview.h"
148#include "llmozlib.h"
149#include "llweb.h" 150#include "llweb.h"
150#include "llfloaterhtml.h" 151#include "llfloaterhtml.h"
151 152
153#if LL_LIBXUL_ENABLED
154#include "llmozlib.h"
155#endif // LL_LIBXUL_ENABLED
156
152#if LL_WINDOWS 157#if LL_WINDOWS
153#include "llwindebug.h" 158#include "llwindebug.h"
154#include "lldxhardware.h" 159#include "lldxhardware.h"
@@ -183,7 +188,6 @@ const char* SCREEN_LAST_FILENAME = "screen_last.bmp";
183// 188//
184// Imported globals 189// Imported globals
185// 190//
186extern LLPointer<LLImageGL> gStartImageGL;
187extern S32 gStartImageWidth; 191extern S32 gStartImageWidth;
188extern S32 gStartImageHeight; 192extern S32 gStartImageHeight;
189extern std::string gSerialNumber; 193extern std::string gSerialNumber;
@@ -192,6 +196,8 @@ extern std::string gSerialNumber;
192// local globals 196// local globals
193// 197//
194 198
199LLPointer<LLImageGL> gStartImageGL;
200
195static LLHost gAgentSimHost; 201static LLHost gAgentSimHost;
196static BOOL gSkipOptionalUpdate = FALSE; 202static BOOL gSkipOptionalUpdate = FALSE;
197 203
@@ -250,7 +256,13 @@ public:
250 } 256 }
251}; 257};
252 258
253 259void update_texture_fetch()
260{
261 gTextureCache->update(1); // unpauses the texture cache thread
262 gImageDecodeThread->update(1); // unpauses the image thread
263 gTextureFetch->update(1); // unpauses the texture fetch thread
264 gImageList.updateImages(0.10f);
265}
254 266
255// Returns FALSE to skip other idle processing. Should only return 267// Returns FALSE to skip other idle processing. Should only return
256// TRUE when all initialization done. 268// TRUE when all initialization done.
@@ -301,8 +313,6 @@ BOOL idle_startup()
301 313
302 static BOOL samename = FALSE; 314 static BOOL samename = FALSE;
303 315
304 static BOOL did_precache = FALSE;
305
306 BOOL do_normal_idle = FALSE; 316 BOOL do_normal_idle = FALSE;
307 317
308 // HACK: These are things from the main loop that usually aren't done 318 // HACK: These are things from the main loop that usually aren't done
@@ -391,14 +401,22 @@ BOOL idle_startup()
391 std::string message_template_path = gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS,"message_template.msg"); 401 std::string message_template_path = gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS,"message_template.msg");
392 402
393 FILE* found_template = NULL; 403 FILE* found_template = NULL;
394 found_template = LLFile::fopen(message_template_path.c_str(), "r"); 404 found_template = LLFile::fopen(message_template_path.c_str(), "r"); /* Flawfinder: ignore */
395 if (found_template) 405 if (found_template)
396 { 406 {
397 fclose(found_template); 407 fclose(found_template);
398 408
409 U32 port = gAgent.mViewerPort;
410
411 if ((NET_USE_OS_ASSIGNED_PORT == port) && // if nothing specified on command line (-port)
412 (gSavedSettings.getBOOL("ConnectionPortEnabled")))
413 {
414 port = gSavedSettings.getU32("ConnectionPort");
415 }
416
399 if(!start_messaging_system( 417 if(!start_messaging_system(
400 message_template_path, 418 message_template_path,
401 gAgent.mViewerPort, 419 port,
402 LL_VERSION_MAJOR, 420 LL_VERSION_MAJOR,
403 LL_VERSION_MINOR, 421 LL_VERSION_MINOR,
404 LL_VERSION_PATCH, 422 LL_VERSION_PATCH,
@@ -432,7 +450,6 @@ BOOL idle_startup()
432 invalid_message_callback, 450 invalid_message_callback,
433 NULL); 451 NULL);
434 452
435 gErrorStream.setUTCTimestamp(gLogUTC);
436 if (gSavedSettings.getBOOL("LogMessages") || gLogMessages) 453 if (gSavedSettings.getBOOL("LogMessages") || gLogMessages)
437 { 454 {
438 llinfos << "Message logging activated!" << llendl; 455 llinfos << "Message logging activated!" << llendl;
@@ -476,12 +493,13 @@ BOOL idle_startup()
476 #if LL_LIBXUL_ENABLED 493 #if LL_LIBXUL_ENABLED
477 set_startup_status(0.48f, "Initializing embedded web browser...", gAgent.mMOTD.c_str()); 494 set_startup_status(0.48f, "Initializing embedded web browser...", gAgent.mMOTD.c_str());
478 display_startup(); 495 display_startup();
496 llinfos << "Initializing embedded web browser..." << llendl;
479 497
480 #if LL_DARWIN 498 #if LL_DARWIN
481 // For Mac OS, we store both the shared libraries and the runtime files (chrome/, plugins/, etc) in 499 // For Mac OS, we store both the shared libraries and the runtime files (chrome/, plugins/, etc) in
482 // Second Life.app/Contents/MacOS/. This matches the way Firefox is distributed on the Mac. 500 // Second Life.app/Contents/MacOS/. This matches the way Firefox is distributed on the Mac.
483 std::string profileBaseDir(gDirUtilp->getExecutableDir()); 501 std::string profileBaseDir(gDirUtilp->getExecutableDir());
484 #else 502 #elif LL_WINDOWS
485 std::string profileBaseDir( gDirUtilp->getExpandedFilename( LL_PATH_APP_SETTINGS, "" ) ); 503 std::string profileBaseDir( gDirUtilp->getExpandedFilename( LL_PATH_APP_SETTINGS, "" ) );
486 profileBaseDir += gDirUtilp->getDirDelimiter(); 504 profileBaseDir += gDirUtilp->getDirDelimiter();
487 #ifdef LL_DEBUG 505 #ifdef LL_DEBUG
@@ -489,8 +507,28 @@ BOOL idle_startup()
489 #else 507 #else
490 profileBaseDir += "mozilla"; 508 profileBaseDir += "mozilla";
491 #endif 509 #endif
510 #elif LL_LINUX
511 std::string profileBaseDir( gDirUtilp->getExpandedFilename( LL_PATH_APP_SETTINGS, "" ) );
512 profileBaseDir += gDirUtilp->getDirDelimiter();
513 profileBaseDir += "mozilla-runtime-linux-i686";
514 #else
515 std::string profileBaseDir( gDirUtilp->getExpandedFilename( LL_PATH_APP_SETTINGS, "" ) );
516 profileBaseDir += gDirUtilp->getDirDelimiter();
517 profileBaseDir += "mozilla";
492 #endif 518 #endif
493 LLMozLib::getInstance()->init( profileBaseDir, gDirUtilp->getExpandedFilename( LL_PATH_MOZILLA_PROFILE, "" ) ); 519
520#if LL_LINUX
521 // Yuck, Mozilla init plays with the locale - push/pop
522 // the locale to protect it, as exotic/non-C locales
523 // causes our code lots of general critical weirdness
524 // and crashness. (SL-35450)
525 char *saved_locale = setlocale(LC_ALL, NULL);
526#endif // LL_LINUX
527 LLMozLib::getInstance()->init( profileBaseDir, gDirUtilp->getExpandedFilename( LL_PATH_MOZILLA_PROFILE, "" ) );
528#if LL_LINUX
529 if (saved_locale)
530 setlocale(LC_ALL, saved_locale);
531#endif // LL_LINUX
494 532
495 std::ostringstream codec; 533 std::ostringstream codec;
496 codec << "[Second Life " << LL_VERSION_MAJOR << "." << LL_VERSION_MINOR << "." << LL_VERSION_PATCH << "." << LL_VERSION_BUILD << "]"; 534 codec << "[Second Life " << LL_VERSION_MAJOR << "." << LL_VERSION_MINOR << "." << LL_VERSION_PATCH << "." << LL_VERSION_BUILD << "]";
@@ -556,7 +594,7 @@ BOOL idle_startup()
556 lastname = gCmdLineLastName; 594 lastname = gCmdLineLastName;
557 595
558 LLMD5 pass((unsigned char*)gCmdLinePassword.c_str()); 596 LLMD5 pass((unsigned char*)gCmdLinePassword.c_str());
559 char md5pass[33]; 597 char md5pass[33]; /* Flawfinder: ignore */
560 pass.hex_digest(md5pass); 598 pass.hex_digest(md5pass);
561 password = md5pass; 599 password = md5pass;
562 600
@@ -728,7 +766,7 @@ BOOL idle_startup()
728 if (gUserServerChoice == USERSERVER_OTHER) 766 if (gUserServerChoice == USERSERVER_OTHER)
729 { 767 {
730 gUserServer.setHostByName( server_label.c_str() ); 768 gUserServer.setHostByName( server_label.c_str() );
731 snprintf(gUserServerName, MAX_STRING, "%s", server_label.c_str()); 769 snprintf(gUserServerName, MAX_STRING, "%s", server_label.c_str()); /* Flawfinder: ignore */
732 } 770 }
733 } 771 }
734 772
@@ -814,11 +852,12 @@ BOOL idle_startup()
814 case USERSERVER_SHAKTI: 852 case USERSERVER_SHAKTI:
815 case USERSERVER_DURGA: 853 case USERSERVER_DURGA:
816 case USERSERVER_SOMA: 854 case USERSERVER_SOMA:
855 case USERSERVER_VAAK:
817 case USERSERVER_GANGA: 856 case USERSERVER_GANGA:
818 case USERSERVER_UMA: 857 case USERSERVER_UMA:
819 { 858 {
820 const char* host_name = gUserServerDomainName[gUserServerChoice].mName; 859 const char* host_name = gUserServerDomainName[gUserServerChoice].mName;
821 sprintf(gUserServerName,"%s", host_name); 860 snprintf(gUserServerName, MAX_STRING, "%s", host_name); /* Flawfinder: ignore */
822 llinfos << "Resolving " << 861 llinfos << "Resolving " <<
823 gUserServerDomainName[gUserServerChoice].mLabel << 862 gUserServerDomainName[gUserServerChoice].mLabel <<
824 " userserver domain name " << host_name << llendl; 863 " userserver domain name " << host_name << llendl;
@@ -892,7 +931,7 @@ BOOL idle_startup()
892 } 931 }
893 932
894 write_debug("Userserver: "); 933 write_debug("Userserver: ");
895 char tmp_str[256]; 934 char tmp_str[256]; /* Flawfinder: ignore */
896 gUserServer.getIPString(tmp_str, 256); 935 gUserServer.getIPString(tmp_str, 256);
897 write_debug(tmp_str); 936 write_debug(tmp_str);
898 write_debug("\n"); 937 write_debug("\n");
@@ -1128,7 +1167,7 @@ BOOL idle_startup()
1128 start << "home"; 1167 start << "home";
1129 } 1168 }
1130 1169
1131 char hashed_mac_string[MD5HEX_STR_SIZE]; 1170 char hashed_mac_string[MD5HEX_STR_SIZE]; /* Flawfinder: ignore */
1132 LLMD5 hashed_mac; 1171 LLMD5 hashed_mac;
1133 hashed_mac.update( gMACAddress, MAC_ADDRESS_BYTES ); 1172 hashed_mac.update( gMACAddress, MAC_ADDRESS_BYTES );
1134 hashed_mac.finalize(); 1173 hashed_mac.finalize();
@@ -1442,7 +1481,7 @@ BOOL idle_startup()
1442 const char* look_at_str = gUserAuthp->getResponse("look_at"); 1481 const char* look_at_str = gUserAuthp->getResponse("look_at");
1443 if (look_at_str) 1482 if (look_at_str)
1444 { 1483 {
1445 LLMemoryStream mstr((U8*)look_at_str, strlen(look_at_str)); 1484 LLMemoryStream mstr((U8*)look_at_str, strlen(look_at_str)); /* Flawfinder: ignore */
1446 LLSD sd = LLSDNotationParser::parse(mstr); 1485 LLSD sd = LLSDNotationParser::parse(mstr);
1447 agent_start_look_at = ll_vector3_from_sd(sd); 1486 agent_start_look_at = ll_vector3_from_sd(sd);
1448 } 1487 }
@@ -1464,7 +1503,7 @@ BOOL idle_startup()
1464 const char* home_location = gUserAuthp->getResponse("home"); 1503 const char* home_location = gUserAuthp->getResponse("home");
1465 if(home_location) 1504 if(home_location)
1466 { 1505 {
1467 LLMemoryStream mstr((U8*)home_location, strlen(home_location)); 1506 LLMemoryStream mstr((U8*)home_location, strlen(home_location)); /* Flawfinder: ignore */
1468 LLSD sd = LLSDNotationParser::parse(mstr); 1507 LLSD sd = LLSDNotationParser::parse(mstr);
1469 S32 region_x = sd["region_handle"][0].asInteger(); 1508 S32 region_x = sd["region_handle"][0].asInteger();
1470 S32 region_y = sd["region_handle"][1].asInteger(); 1509 S32 region_y = sd["region_handle"][1].asInteger();
@@ -1582,6 +1621,8 @@ BOOL idle_startup()
1582 args["[ERROR_MESSAGE]"] = emsg.str(); 1621 args["[ERROR_MESSAGE]"] = emsg.str();
1583 gViewerWindow->alertXml("ErrorMessage", args, login_alert_done); 1622 gViewerWindow->alertXml("ErrorMessage", args, login_alert_done);
1584 gStartupState = STATE_LOGIN_SHOW; 1623 gStartupState = STATE_LOGIN_SHOW;
1624 gAutoLogin = FALSE;
1625 show_connect_box = TRUE;
1585 } 1626 }
1586 } 1627 }
1587 else 1628 else
@@ -1597,6 +1638,8 @@ BOOL idle_startup()
1597 args["[ERROR_MESSAGE]"] = emsg.str(); 1638 args["[ERROR_MESSAGE]"] = emsg.str();
1598 gViewerWindow->alertXml("ErrorMessage", args, login_alert_done); 1639 gViewerWindow->alertXml("ErrorMessage", args, login_alert_done);
1599 gStartupState = STATE_LOGIN_SHOW; 1640 gStartupState = STATE_LOGIN_SHOW;
1641 gAutoLogin = FALSE;
1642 show_connect_box = TRUE;
1600 } 1643 }
1601 return do_normal_idle; 1644 return do_normal_idle;
1602 } 1645 }
@@ -1629,6 +1672,9 @@ BOOL idle_startup()
1629 // 1672 //
1630 // Initialize classes w/graphics stuff. 1673 // Initialize classes w/graphics stuff.
1631 // 1674 //
1675 gImageList.doPrefetchImages();
1676 update_texture_fetch();
1677
1632 LLSurface::initClasses(); 1678 LLSurface::initClasses();
1633 1679
1634 LLFace::initClass(); 1680 LLFace::initClass();
@@ -1690,7 +1736,7 @@ BOOL idle_startup()
1690 // Move the progress view in front of the UI 1736 // Move the progress view in front of the UI
1691 gViewerWindow->moveProgressViewToFront(); 1737 gViewerWindow->moveProgressViewToFront();
1692 1738
1693 gErrorStream.setFixedBuffer(gDebugView->mDebugConsolep); 1739 LLError::logToFixedBuffer(gDebugView->mDebugConsolep);
1694 // set initial visibility of debug console 1740 // set initial visibility of debug console
1695 gDebugView->mDebugConsolep->setVisible(gSavedSettings.getBOOL("ShowDebugConsole")); 1741 gDebugView->mDebugConsolep->setVisible(gSavedSettings.getBOOL("ShowDebugConsole"));
1696 gDebugView->mStatViewp->setVisible(gSavedSettings.getBOOL("ShowDebugStats")); 1742 gDebugView->mStatViewp->setVisible(gSavedSettings.getBOOL("ShowDebugStats"));
@@ -1791,7 +1837,7 @@ BOOL idle_startup()
1791 llinfos << "Decoding images..." << llendl; 1837 llinfos << "Decoding images..." << llendl;
1792 // For all images pre-loaded into viewer cache, decode them. 1838 // For all images pre-loaded into viewer cache, decode them.
1793 // Need to do this AFTER we init the sky 1839 // Need to do this AFTER we init the sky
1794 gImageList.decodeAllImages(); 1840 gImageList.decodeAllImages(2.f);
1795 gStartupState++; 1841 gStartupState++;
1796 1842
1797 // JC - Do this as late as possible to increase likelihood Purify 1843 // JC - Do this as late as possible to increase likelihood Purify
@@ -2298,11 +2344,11 @@ BOOL idle_startup()
2298 // JC - 7/20/2002 2344 // JC - 7/20/2002
2299 gViewerWindow->sendShapeToSim(); 2345 gViewerWindow->sendShapeToSim();
2300 2346
2347 // Ignore stipend information for now. Money history is on the web site.
2301 // if needed, show the money history window 2348 // if needed, show the money history window
2302 if (stipend_since_login && !gNoRender) 2349 //if (stipend_since_login && !gNoRender)
2303 { 2350 //{
2304 LLFloaterAccountHistory::show(NULL); 2351 //}
2305 }
2306 2352
2307 if (!gAgent.isFirstLogin()) 2353 if (!gAgent.isFirstLogin())
2308 { 2354 {
@@ -2360,18 +2406,6 @@ BOOL idle_startup()
2360 if (STATE_PRECACHE == gStartupState) 2406 if (STATE_PRECACHE == gStartupState)
2361 { 2407 {
2362 do_normal_idle = TRUE; 2408 do_normal_idle = TRUE;
2363 if (!did_precache)
2364 {
2365 did_precache = TRUE;
2366 // Don't preload map information! The amount of data for all the
2367 // map items (icons for classifieds, avatar locations, etc.) is
2368 // huge, and not throttled. This overflows the downstream
2369 // pipe during startup, when lots of information is being sent.
2370 // The problem manifests itself as invisible avatars on login. JC
2371 //gWorldMap->setCurrentLayer(0); // pre-load layer 0 of the world map
2372
2373 gImageList.doPreloadImages(); // pre-load some images from static VFS
2374 }
2375 2409
2376 F32 timeout_frac = timeout.getElapsedTimeF32()/PRECACHING_DELAY; 2410 F32 timeout_frac = timeout.getElapsedTimeF32()/PRECACHING_DELAY;
2377 // wait precache-delay and for agent's avatar or a lot longer. 2411 // wait precache-delay and for agent's avatar or a lot longer.
@@ -2382,6 +2416,7 @@ BOOL idle_startup()
2382 } 2416 }
2383 else 2417 else
2384 { 2418 {
2419 update_texture_fetch();
2385 set_startup_status(0.50f + 0.50f * timeout_frac, "Precaching...", 2420 set_startup_status(0.50f + 0.50f * timeout_frac, "Precaching...",
2386 gAgent.mMOTD.c_str()); 2421 gAgent.mMOTD.c_str());
2387 } 2422 }
@@ -2410,6 +2445,7 @@ BOOL idle_startup()
2410 } 2445 }
2411 else 2446 else
2412 { 2447 {
2448 update_texture_fetch();
2413 set_startup_status(0.f + 0.25f * wearables_time / MAX_WEARABLES_TIME, 2449 set_startup_status(0.f + 0.25f * wearables_time / MAX_WEARABLES_TIME,
2414 "Downloading clothing...", 2450 "Downloading clothing...",
2415 gAgent.mMOTD.c_str()); 2451 gAgent.mMOTD.c_str());
@@ -2512,34 +2548,6 @@ BOOL idle_startup()
2512// local function definition 2548// local function definition
2513// 2549//
2514 2550
2515void unsupported_graphics_callback(S32 option, void* userdata)
2516{
2517 if (0 == option)
2518 {
2519 llinfos << "User cancelled after driver check" << llendl;
2520 std::string help_path;
2521 help_path = gDirUtilp->getExpandedFilename(LL_PATH_HELP,
2522 "unsupported_card.html");
2523 app_force_quit( help_path.c_str() );
2524 }
2525
2526 LLPanelLogin::giveFocus();
2527}
2528
2529void check_driver_callback(S32 option, void* userdata)
2530{
2531 if (0 == option)
2532 {
2533 llinfos << "User cancelled after driver check" << llendl;
2534 std::string help_path;
2535 help_path = gDirUtilp->getExpandedFilename(LL_PATH_HELP,
2536 "graphics_driver_update.html");
2537 app_force_quit( help_path.c_str() );
2538 }
2539
2540 LLPanelLogin::giveFocus();
2541}
2542
2543void login_show() 2551void login_show()
2544{ 2552{
2545 LLPanelLogin::show( gViewerWindow->getVirtualWindowRect(), 2553 LLPanelLogin::show( gViewerWindow->getVirtualWindowRect(),
@@ -2547,7 +2555,7 @@ void login_show()
2547 login_callback, NULL ); 2555 login_callback, NULL );
2548 2556
2549 // Make sure all the UI textures are present and decoded. 2557 // Make sure all the UI textures are present and decoded.
2550 gImageList.decodeAllImages(); 2558 gImageList.decodeAllImages(2.f);
2551 2559
2552 if( USERSERVER_OTHER == gUserServerChoice ) 2560 if( USERSERVER_OTHER == gUserServerChoice )
2553 { 2561 {
@@ -2569,6 +2577,7 @@ void login_show()
2569 LLPanelLogin::addServer( gUserServerDomainName[USERSERVER_GANGA].mLabel, USERSERVER_GANGA ); 2577 LLPanelLogin::addServer( gUserServerDomainName[USERSERVER_GANGA].mLabel, USERSERVER_GANGA );
2570 LLPanelLogin::addServer( gUserServerDomainName[USERSERVER_UMA].mLabel, USERSERVER_UMA ); 2578 LLPanelLogin::addServer( gUserServerDomainName[USERSERVER_UMA].mLabel, USERSERVER_UMA );
2571 LLPanelLogin::addServer( gUserServerDomainName[USERSERVER_SOMA].mLabel, USERSERVER_SOMA ); 2579 LLPanelLogin::addServer( gUserServerDomainName[USERSERVER_SOMA].mLabel, USERSERVER_SOMA );
2580 LLPanelLogin::addServer( gUserServerDomainName[USERSERVER_VAAK].mLabel, USERSERVER_VAAK );
2572} 2581}
2573 2582
2574// Callback for when login screen is closed. Option 0 = connect, option 1 = quit. 2583// Callback for when login screen is closed. Option 0 = connect, option 1 = quit.
@@ -2628,7 +2637,7 @@ LLString load_password_from_disk()
2628 2637
2629 std::string filepath = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, 2638 std::string filepath = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS,
2630 "password.dat"); 2639 "password.dat");
2631 FILE* fp = LLFile::fopen(filepath.c_str(), "rb"); 2640 FILE* fp = LLFile::fopen(filepath.c_str(), "rb"); /* Flawfinder: ignore */
2632 if (!fp) 2641 if (!fp)
2633 { 2642 {
2634 return hashed_password; 2643 return hashed_password;
@@ -2675,7 +2684,7 @@ void save_password_to_disk(const char* hashed_password)
2675 } 2684 }
2676 else 2685 else
2677 { 2686 {
2678 FILE* fp = LLFile::fopen(filepath.c_str(), "wb"); 2687 FILE* fp = LLFile::fopen(filepath.c_str(), "wb"); /* Flawfinder: ignore */
2679 if (!fp) 2688 if (!fp)
2680 { 2689 {
2681 return; 2690 return;
@@ -2889,7 +2898,7 @@ void update_dialog_callback(S32 option, void *userdata)
2889 } 2898 }
2890 2899
2891#if LL_WINDOWS 2900#if LL_WINDOWS
2892 char ip[MAX_STRING]; 2901 char ip[MAX_STRING]; /* Flawfinder: ignore */
2893 2902
2894 update_exe_path = gDirUtilp->getTempFilename(); 2903 update_exe_path = gDirUtilp->getTempFilename();
2895 if (update_exe_path.empty()) 2904 if (update_exe_path.empty())
@@ -2934,7 +2943,7 @@ void update_dialog_callback(S32 option, void *userdata)
2934 // Figure out the program name. 2943 // Figure out the program name.
2935 const char* data_dir = gDirUtilp->getAppRODataDir().c_str(); 2944 const char* data_dir = gDirUtilp->getAppRODataDir().c_str();
2936 // Roll back from the end, stopping at the first '\' 2945 // Roll back from the end, stopping at the first '\'
2937 const char* program_name = data_dir + strlen(data_dir); 2946 const char* program_name = data_dir + strlen(data_dir); /* Flawfinder: ignore */
2938 while ( (data_dir != --program_name) && 2947 while ( (data_dir != --program_name) &&
2939 *(program_name) != '\\'); 2948 *(program_name) != '\\');
2940 2949
@@ -2981,7 +2990,7 @@ void update_dialog_callback(S32 option, void *userdata)
2981 remove_marker_file(); // In case updater fails 2990 remove_marker_file(); // In case updater fails
2982 2991
2983 // Run the auto-updater. 2992 // Run the auto-updater.
2984 system(update_exe_path.c_str()); 2993 system(update_exe_path.c_str()); /* Flawfinder: ignore */
2985 2994
2986#elif LL_LINUX 2995#elif LL_LINUX
2987 OSMessageBox("Automatic updating is not yet implemented for Linux.\n" 2996 OSMessageBox("Automatic updating is not yet implemented for Linux.\n"
@@ -3019,8 +3028,8 @@ void use_circuit_callback(void**, S32 result)
3019void register_viewer_callbacks(LLMessageSystem* msg) 3028void register_viewer_callbacks(LLMessageSystem* msg)
3020{ 3029{
3021 msg->setHandlerFuncFast(_PREHASH_LayerData, process_layer_data ); 3030 msg->setHandlerFuncFast(_PREHASH_LayerData, process_layer_data );
3022 msg->setHandlerFuncFast(_PREHASH_ImageData, LLViewerImage::receiveImage ); 3031 msg->setHandlerFuncFast(_PREHASH_ImageData, LLViewerImageList::receiveImageHeader );
3023 msg->setHandlerFuncFast(_PREHASH_ImagePacket, LLViewerImage::receiveImagePacket ); 3032 msg->setHandlerFuncFast(_PREHASH_ImagePacket, LLViewerImageList::receiveImagePacket );
3024 msg->setHandlerFuncFast(_PREHASH_ObjectUpdate, process_object_update ); 3033 msg->setHandlerFuncFast(_PREHASH_ObjectUpdate, process_object_update );
3025 msg->setHandlerFunc("ObjectUpdateCompressed", process_compressed_object_update ); 3034 msg->setHandlerFunc("ObjectUpdateCompressed", process_compressed_object_update );
3026 msg->setHandlerFunc("ObjectUpdateCached", process_cached_object_update ); 3035 msg->setHandlerFunc("ObjectUpdateCached", process_cached_object_update );
@@ -3136,14 +3145,6 @@ void register_viewer_callbacks(LLMessageSystem* msg)
3136 3145
3137 msg->setHandlerFuncFast(_PREHASH_GrantGodlikePowers, process_grant_godlike_powers); 3146 msg->setHandlerFuncFast(_PREHASH_GrantGodlikePowers, process_grant_godlike_powers);
3138 3147
3139 msg->setHandlerFuncFast(_PREHASH_MoneySummaryReply,
3140 LLFloaterAccountHistory::processMoneySummaryReply);
3141 msg->setHandlerFuncFast(_PREHASH_MoneyDetailsReply,
3142 LLFloaterAccountHistory::processMoneyDetailsReply);
3143 msg->setHandlerFuncFast(_PREHASH_MoneyTransactionsReply,
3144 LLFloaterAccountHistory::processMoneyTransactionsReply);
3145
3146 // ASDF
3147 msg->setHandlerFuncFast(_PREHASH_GroupAccountSummaryReply, 3148 msg->setHandlerFuncFast(_PREHASH_GroupAccountSummaryReply,
3148 LLGroupMoneyPlanningTabEventHandler::processGroupAccountSummaryReply); 3149 LLGroupMoneyPlanningTabEventHandler::processGroupAccountSummaryReply);
3149 msg->setHandlerFuncFast(_PREHASH_GroupAccountDetailsReply, 3150 msg->setHandlerFuncFast(_PREHASH_GroupAccountDetailsReply,
@@ -3869,7 +3870,7 @@ void dialog_choose_gender_first_start()
3869// location_id = 1 => home position 3870// location_id = 1 => home position
3870void init_start_screen(S32 location_id) 3871void init_start_screen(S32 location_id)
3871{ 3872{
3872 if (gStartImageGL) 3873 if (gStartImageGL.notNull())
3873 { 3874 {
3874 gStartImageGL = NULL; 3875 gStartImageGL = NULL;
3875 llinfos << "re-initializing start screen" << llendl; 3876 llinfos << "re-initializing start screen" << llendl;
diff --git a/linden/indra/newview/llstartup.h b/linden/indra/newview/llstartup.h
index c2c822e..26f5bc6 100644
--- a/linden/indra/newview/llstartup.h
+++ b/linden/indra/newview/llstartup.h
@@ -28,10 +28,13 @@
28#ifndef LL_LLSTARTUP_H 28#ifndef LL_LLSTARTUP_H
29#define LL_LLSTARTUP_H 29#define LL_LLSTARTUP_H
30 30
31#include "llimagegl.h"
32
31// functions 33// functions
32BOOL idle_startup(); 34BOOL idle_startup();
33void cleanup_app(); 35void cleanup_app();
34LLString load_password_from_disk(); 36LLString load_password_from_disk();
37void release_start_screen();
35 38
36// constants, variables, & enumerations 39// constants, variables, & enumerations
37extern const char* SCREEN_HOME_FILENAME; 40extern const char* SCREEN_HOME_FILENAME;
@@ -78,6 +81,7 @@ enum EStartupState{
78// exorted symbol 81// exorted symbol
79extern S32 gStartupState; 82extern S32 gStartupState;
80extern bool gQuickTimeInitialized; 83extern bool gQuickTimeInitialized;
84extern LLPointer<LLImageGL> gStartImageGL;
81 85
82class LLStartUp 86class LLStartUp
83{ 87{
diff --git a/linden/indra/newview/llstatbar.cpp b/linden/indra/newview/llstatbar.cpp
index b23840a..4b7067c 100644
--- a/linden/indra/newview/llstatbar.cpp
+++ b/linden/indra/newview/llstatbar.cpp
@@ -143,17 +143,17 @@ void LLStatBar::draw()
143 LLFontGL::sMonospace->renderUTF8(mLabel, 0, 0, mRect.getHeight(), LLColor4(1.f, 1.f, 1.f, 1.f), 143 LLFontGL::sMonospace->renderUTF8(mLabel, 0, 0, mRect.getHeight(), LLColor4(1.f, 1.f, 1.f, 1.f),
144 LLFontGL::LEFT, LLFontGL::TOP); 144 LLFontGL::LEFT, LLFontGL::TOP);
145 145
146 char value_format[64]; 146 char value_format[64]; /* Flawfinder: ignore */
147 char value_str[256]; 147 char value_str[256]; /* Flawfinder: ignore */
148 if (!mUnitLabel.empty()) 148 if (!mUnitLabel.empty())
149 { 149 {
150 sprintf(value_format, "%%.%df%%s", mPrecision); 150 snprintf(value_format, sizeof(value_format), "%%.%df%%s", mPrecision); /* Flawfinder: ignore */
151 sprintf(value_str, value_format, mValue, mUnitLabel.c_str()); 151 snprintf(value_str, sizeof(value_str), value_format, mValue, mUnitLabel.c_str()); /* Flawfinder: ignore */
152 } 152 }
153 else 153 else
154 { 154 {
155 sprintf(value_format, "%%.%df", mPrecision); 155 snprintf(value_format, sizeof(value_format), "%%.%df", mPrecision); /* Flawfinder: ignore */
156 sprintf(value_str, value_format, mValue); 156 snprintf(value_str, sizeof(value_str), value_format, mValue); /* Flawfinder: ignore */
157 } 157 }
158 158
159 // Draw the value. 159 // Draw the value.
@@ -161,10 +161,10 @@ void LLStatBar::draw()
161 LLColor4(1.f, 1.f, 1.f, 0.5f), 161 LLColor4(1.f, 1.f, 1.f, 0.5f),
162 LLFontGL::RIGHT, LLFontGL::TOP); 162 LLFontGL::RIGHT, LLFontGL::TOP);
163 163
164 sprintf(value_format, "%%.%df", mPrecision); 164 snprintf(value_format, sizeof(value_format), "%%.%df", mPrecision); /* Flawfinder: ignore */
165 if (mDisplayBar) 165 if (mDisplayBar)
166 { 166 {
167 char tick_label[256]; 167 char tick_label[256]; /* Flawfinder: ignore */
168 168
169 // Draw the tick marks. 169 // Draw the tick marks.
170 F32 tick_value; 170 F32 tick_value;
@@ -188,7 +188,7 @@ void LLStatBar::draw()
188 right = left + tick_width; 188 right = left + tick_width;
189 gl_rect_2d(left, top, right, bottom, LLColor4(1.f, 1.f, 1.f, 0.25f)); 189 gl_rect_2d(left, top, right, bottom, LLColor4(1.f, 1.f, 1.f, 0.25f));
190 190
191 sprintf(tick_label, value_format, tick_value); 191 snprintf(tick_label, sizeof(tick_label), value_format, tick_value); /* Flawfinder: ignore */
192 // draw labels for the tick marks 192 // draw labels for the tick marks
193 LLFontGL::sMonospace->renderUTF8(tick_label, 0, left - 1, bar_top - bar_height - tick_height, 193 LLFontGL::sMonospace->renderUTF8(tick_label, 0, left - 1, bar_top - bar_height - tick_height,
194 LLColor4(1.f, 1.f, 1.f, 0.5f), 194 LLColor4(1.f, 1.f, 1.f, 0.5f),
diff --git a/linden/indra/newview/llstatgraph.cpp b/linden/indra/newview/llstatgraph.cpp
index b2dec08..e85dc8d 100644
--- a/linden/indra/newview/llstatgraph.cpp
+++ b/linden/indra/newview/llstatgraph.cpp
@@ -91,10 +91,10 @@ void LLStatGraph::draw()
91 91
92 if (mUpdateTimer.getElapsedTimeF32() > 0.5f) 92 if (mUpdateTimer.getElapsedTimeF32() > 0.5f)
93 { 93 {
94 char format_str[256]; 94 char format_str[256]; /* Flawfinder: ignore */
95 char tmp_str[256]; 95 char tmp_str[256]; /* Flawfinder: ignore */
96 sprintf(format_str, "%%s%%.%df%%s", mPrecision); 96 snprintf(format_str, sizeof(format_str), "%%s%%.%df%%s", mPrecision); /* Flawfinder: ignore */
97 sprintf(tmp_str, format_str, mLabel.c_str(), mValue, mUnits.c_str()); 97 sprintf(tmp_str, format_str, mLabel.c_str(), mValue, mUnits.c_str()); /* Flawfinder: ignore */
98 setToolTip(tmp_str); 98 setToolTip(tmp_str);
99 99
100 mUpdateTimer.reset(); 100 mUpdateTimer.reset();
diff --git a/linden/indra/newview/llstatusbar.cpp b/linden/indra/newview/llstatusbar.cpp
index a358f1e..22c0a2a 100644
--- a/linden/indra/newview/llstatusbar.cpp
+++ b/linden/indra/newview/llstatusbar.cpp
@@ -209,7 +209,13 @@ void LLStatusBar::draw()
209{ 209{
210 refresh(); 210 refresh();
211 211
212 LLView::draw(); 212 if (mBgVisible)
213 {
214 gl_drop_shadow(0, mRect.getHeight(), mRect.getWidth(), 0,
215 LLUI::sColorsGroup->getColor("ColorDropShadow"),
216 LLUI::sConfigGroup->getS32("DropShadowFloater") );
217 }
218 LLPanel::draw();
213} 219}
214 220
215 221
@@ -262,6 +268,12 @@ void LLStatusBar::refresh()
262 const S32 MENU_RIGHT = gMenuBarView->getRightmostMenuEdge(); 268 const S32 MENU_RIGHT = gMenuBarView->getRightmostMenuEdge();
263 S32 x = MENU_RIGHT + MENU_PARCEL_SPACING; 269 S32 x = MENU_RIGHT + MENU_PARCEL_SPACING;
264 S32 y = 0; 270 S32 y = 0;
271
272 // reshape menu bar to its content's width
273 if (MENU_RIGHT != gMenuBarView->getRect().getWidth())
274 {
275 gMenuBarView->reshape(MENU_RIGHT, gMenuBarView->getRect().getHeight());
276 }
265 277
266 LLViewerRegion *region = gAgent.getRegion(); 278 LLViewerRegion *region = gAgent.getRegion();
267 LLParcel *parcel = gParcelMgr->getAgentParcel(); 279 LLParcel *parcel = gParcelMgr->getAgentParcel();
@@ -448,6 +460,7 @@ void LLStatusBar::setVisibleForMouselook(bool visible)
448 mSGBandwidth->setVisible(visible); 460 mSGBandwidth->setVisible(visible);
449 mSGPacketLoss->setVisible(visible); 461 mSGPacketLoss->setVisible(visible);
450 mBtnBuyCurrency->setVisible(visible); 462 mBtnBuyCurrency->setVisible(visible);
463 setBackgroundVisible(visible);
451} 464}
452 465
453void LLStatusBar::debitBalance(S32 debit) 466void LLStatusBar::debitBalance(S32 debit)
@@ -484,8 +497,8 @@ void LLStatusBar::setBalance(S32 balance)
484 497
485void LLStatusBar::setHealth(S32 health) 498void LLStatusBar::setHealth(S32 health)
486{ 499{
487 char buffer[MAX_STRING]; 500 char buffer[MAX_STRING]; /* Flawfinder: ignore */
488 sprintf(buffer, "%d%%", health); 501 snprintf(buffer, MAX_STRING, "%d%%", health); /* Flawfinder: ignore */
489 //llinfos << "Setting health to: " << buffer << llendl; 502 //llinfos << "Setting health to: " << buffer << llendl;
490 mTextHealth->setText(buffer); 503 mTextHealth->setText(buffer);
491 504
diff --git a/linden/indra/newview/llstatview.cpp b/linden/indra/newview/llstatview.cpp
index e288879..64ad5aa 100644
--- a/linden/indra/newview/llstatview.cpp
+++ b/linden/indra/newview/llstatview.cpp
@@ -50,7 +50,7 @@ LLStatView::LLStatView(const LLString& name, const LLString& label, const LLStri
50 { 50 {
51 open = gSavedSettings.getBOOL(mSetting); 51 open = gSavedSettings.getBOOL(mSetting);
52 } 52 }
53 setDisplayChildren(open); 53 setDisplayChildren(open); /* Flawfinder: ignore */
54} 54}
55 55
56LLStatView::~LLStatView() 56LLStatView::~LLStatView()
@@ -59,7 +59,7 @@ LLStatView::~LLStatView()
59 if (mSetting.length() > 0) 59 if (mSetting.length() > 0)
60 { 60 {
61 BOOL open = getDisplayChildren(); 61 BOOL open = getDisplayChildren();
62 gSavedSettings.setBOOL(mSetting, open); 62 gSavedSettings.setBOOL(mSetting, open); /* Flawfinder: ignore */
63 } 63 }
64} 64}
65 65
diff --git a/linden/indra/newview/llsurface.cpp b/linden/indra/newview/llsurface.cpp
index c1b22c9..191c079 100644
--- a/linden/indra/newview/llsurface.cpp
+++ b/linden/indra/newview/llsurface.cpp
@@ -50,7 +50,7 @@
50#include "noise.h" 50#include "noise.h"
51#include "llviewercamera.h" 51#include "llviewercamera.h"
52#include "llglheaders.h" 52#include "llglheaders.h"
53#include "lldrawpool.h" 53#include "lldrawpoolterrain.h"
54#include "lldrawable.h" 54#include "lldrawable.h"
55 55
56extern LLPipeline gPipeline; 56extern LLPipeline gPipeline;
@@ -120,7 +120,7 @@ LLSurface::~LLSurface()
120 mNumberOfPatches = 0; 120 mNumberOfPatches = 0;
121 destroyPatchData(); 121 destroyPatchData();
122 122
123 LLDrawPool *poolp = gPipeline.findPool(LLDrawPool::POOL_TERRAIN, mSTexturep); 123 LLDrawPoolTerrain *poolp = (LLDrawPoolTerrain*) gPipeline.findPool(LLDrawPool::POOL_TERRAIN, mSTexturep);
124 if (!poolp) 124 if (!poolp)
125 { 125 {
126 llwarns << "No pool for terrain on destruction!" << llendl; 126 llwarns << "No pool for terrain on destruction!" << llendl;
@@ -331,7 +331,6 @@ void LLSurface::setOriginGlobal(const LLVector3d &origin_global)
331 LLVector3d water_origin_global(x, y, z); 331 LLVector3d water_origin_global(x, y, z);
332 332
333 mWaterObjp->setPositionGlobal(water_origin_global); 333 mWaterObjp->setPositionGlobal(water_origin_global);
334 gPipeline.markMoved(mWaterObjp->mDrawable);
335 } 334 }
336} 335}
337 336
@@ -621,45 +620,45 @@ void LLSurface::updatePatchVisibilities(LLAgent &agent)
621 } 620 }
622} 621}
623 622
624 623BOOL LLSurface::idleUpdate(F32 max_update_time)
625
626BOOL LLSurface::idleUpdate()
627{ 624{
628 if (!gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_TERRAIN)) 625 if (!gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_TERRAIN))
629 { 626 {
630 return TRUE; 627 return FALSE;
631 } 628 }
632 629
633 // Perform idle time update of non-critical stuff. 630 // Perform idle time update of non-critical stuff.
634 // In this case, texture and normal updates. 631 // In this case, texture and normal updates.
635 LLTimer update_timer; 632 LLTimer update_timer;
636 LLSurfacePatch *patchp = NULL; 633 BOOL did_update = FALSE;
637 634
638 // If the Z height data has changed, we need to rebuild our 635 // If the Z height data has changed, we need to rebuild our
639 // property line vertex arrays. 636 // property line vertex arrays.
640 if (mDirtyPatchList.count() > 0) 637 if (mDirtyPatchList.size() > 0)
641 { 638 {
642 getRegion()->dirtyHeights(); 639 getRegion()->dirtyHeights();
643 } 640 }
644 641
645 S32 i = 0; 642 // Always call updateNormals() / updateVerticalStats()
646 while (i < mDirtyPatchList.count()) 643 // every frame to avoid artifacts
644 for(std::set<LLSurfacePatch *>::iterator iter = mDirtyPatchList.begin();
645 iter != mDirtyPatchList.end(); )
647 { 646 {
648 patchp = mDirtyPatchList[i]; 647 std::set<LLSurfacePatch *>::iterator curiter = iter++;
648 LLSurfacePatch *patchp = *curiter;
649 patchp->updateNormals(); 649 patchp->updateNormals();
650 patchp->updateVerticalStats(); 650 patchp->updateVerticalStats();
651 651 if (max_update_time == 0.f || update_timer.getElapsedTimeF32() < max_update_time)
652 if ((update_timer.getElapsedTimeF32() < 0.05f) && patchp->updateTexture())
653 {
654 patchp->clearDirty();
655 mDirtyPatchList.remove(i);
656 }
657 else
658 { 652 {
659 i++; 653 if (patchp->updateTexture())
654 {
655 did_update = TRUE;
656 patchp->clearDirty();
657 mDirtyPatchList.erase(curiter);
658 }
660 } 659 }
661 } 660 }
662 return TRUE; 661 return did_update;
663} 662}
664 663
665// TODO -- move this to LLViewerRegion class 664// TODO -- move this to LLViewerRegion class
@@ -1229,10 +1228,7 @@ void LLSurface::dirtyAllPatches()
1229void LLSurface::dirtySurfacePatch(LLSurfacePatch *patchp) 1228void LLSurface::dirtySurfacePatch(LLSurfacePatch *patchp)
1230{ 1229{
1231 // Put surface patch on dirty surface patch list 1230 // Put surface patch on dirty surface patch list
1232 if (-1 == mDirtyPatchList.find(patchp)) 1231 mDirtyPatchList.insert(patchp);
1233 {
1234 mDirtyPatchList.put(patchp);
1235 }
1236} 1232}
1237 1233
1238 1234
diff --git a/linden/indra/newview/llsurface.h b/linden/indra/newview/llsurface.h
index 12c1afc..73fe6e6 100644
--- a/linden/indra/newview/llsurface.h
+++ b/linden/indra/newview/llsurface.h
@@ -41,7 +41,6 @@
41 41
42#include "llvowater.h" 42#include "llvowater.h"
43#include "llpatchvertexarray.h" 43#include "llpatchvertexarray.h"
44#include "lldarray.h"
45#include "llviewerimage.h" 44#include "llviewerimage.h"
46 45
47class LLTimer; 46class LLTimer;
@@ -115,7 +114,7 @@ public:
115 LLSurfacePatch *resolvePatchGlobal(const LLVector3d &position_global) const; 114 LLSurfacePatch *resolvePatchGlobal(const LLVector3d &position_global) const;
116 115
117 // Update methods (called during idle, normally) 116 // Update methods (called during idle, normally)
118 BOOL idleUpdate(); 117 BOOL idleUpdate(F32 max_update_time);
119 118
120 void renderSurfaceBounds(); 119 void renderSurfaceBounds();
121 120
@@ -200,7 +199,7 @@ protected:
200 // Array of grid normals, mGridsPerEdge * mGridsPerEdge 199 // Array of grid normals, mGridsPerEdge * mGridsPerEdge
201 LLVector3 *mNorm; 200 LLVector3 *mNorm;
202 201
203 LLDynamicArray<LLSurfacePatch *> mDirtyPatchList; 202 std::set<LLSurfacePatch *> mDirtyPatchList;
204 203
205 204
206 // The textures should never be directly initialized - use the setter methods! 205 // The textures should never be directly initialized - use the setter methods!
diff --git a/linden/indra/newview/llsurfacepatch.cpp b/linden/indra/newview/llsurfacepatch.cpp
index d19d930..66d100f 100644
--- a/linden/indra/newview/llsurfacepatch.cpp
+++ b/linden/indra/newview/llsurfacepatch.cpp
@@ -813,7 +813,7 @@ void LLSurfacePatch::connectNeighbor(LLSurfacePatch *neighbor_patchp, const U32
813 813
814void LLSurfacePatch::updateVisibility() 814void LLSurfacePatch::updateVisibility()
815{ 815{
816 if (mVObjp == (LLVOSurfacePatch*)NULL) 816 if (mVObjp.isNull())
817 { 817 {
818 return; 818 return;
819 } 819 }
diff --git a/linden/indra/newview/lltexlayer.cpp b/linden/indra/newview/lltexlayer.cpp
index 63d167d..d8a97cf 100644
--- a/linden/indra/newview/lltexlayer.cpp
+++ b/linden/indra/newview/lltexlayer.cpp
@@ -55,8 +55,6 @@
55 55
56// SJB: We really always want to use the GL cache; 56// SJB: We really always want to use the GL cache;
57// let GL page textures in and out of video RAM instead of trying to do so by hand. 57// let GL page textures in and out of video RAM instead of trying to do so by hand.
58// const U32 USE_AVATAR_GL_CACHE_THRESHOLD = 1024 * 1024 * 35; // 35 MB
59BOOL gUseAvatarGLCache = TRUE; //FALSE;
60 58
61LLGradientPaletteList gGradientPaletteList; 59LLGradientPaletteList gGradientPaletteList;
62 60
@@ -237,8 +235,6 @@ BOOL LLTexLayerSetBuffer::render()
237{ 235{
238 U8* baked_bump_data = NULL; 236 U8* baked_bump_data = NULL;
239 237
240// gUseAvatarGLCache = ( gImageList.getMaxResidentTexMem() > USE_AVATAR_GL_CACHE_THRESHOLD );
241
242 // do we need to upload, and do we have sufficient data to create an uploadable composite? 238 // do we need to upload, and do we have sufficient data to create an uploadable composite?
243 // When do we upload the texture if gAgent.mNumPendingQueries is non-zero? 239 // When do we upload the texture if gAgent.mNumPendingQueries is non-zero?
244 BOOL upload_now = (gAgent.mNumPendingQueries == 0 && mNeedsUpload && mTexLayerSet->isLocalTextureDataFinal()); 240 BOOL upload_now = (gAgent.mNumPendingQueries == 0 && mNeedsUpload && mTexLayerSet->isLocalTextureDataFinal());
@@ -773,7 +769,6 @@ BOOL LLTexLayerSet::render( S32 x, S32 y, S32 width, S32 height )
773 glColorMask( GL_FALSE, GL_FALSE, GL_FALSE, GL_TRUE ); 769 glColorMask( GL_FALSE, GL_FALSE, GL_FALSE, GL_TRUE );
774 glBlendFunc( GL_ONE, GL_ZERO ); 770 glBlendFunc( GL_ONE, GL_ZERO );
775 771
776 if( gUseAvatarGLCache )
777 { 772 {
778 LLImageGL* image_gl = gTexStaticImageList.getImageGL( getInfo()->mStaticAlphaFileName, TRUE ); 773 LLImageGL* image_gl = gTexStaticImageList.getImageGL( getInfo()->mStaticAlphaFileName, TRUE );
779 if( image_gl ) 774 if( image_gl )
@@ -787,29 +782,6 @@ BOOL LLTexLayerSet::render( S32 x, S32 y, S32 width, S32 height )
787 success = FALSE; 782 success = FALSE;
788 } 783 }
789 } 784 }
790 else
791 {
792 LLImageRaw* image_raw = gTexStaticImageList.getImageRaw( getInfo()->mStaticAlphaFileName );
793 if( image_raw )
794 {
795 GLenum format = GL_ALPHA;
796 if( mAvatar->bindScratchTexture(format) )
797 {
798 glTexSubImage2D( GL_TEXTURE_2D, 0, 0, 0, image_raw->getWidth(), image_raw->getHeight(), format, GL_UNSIGNED_BYTE, image_raw->getData() );
799 stop_glerror();
800
801 gl_rect_2d_simple_tex( width, height );
802 }
803 else
804 {
805 success = FALSE;
806 }
807 }
808 else
809 {
810 success = FALSE;
811 }
812 }
813 LLImageGL::unbindTexture(0, GL_TEXTURE_2D); 785 LLImageGL::unbindTexture(0, GL_TEXTURE_2D);
814 786
815 glColorMask( GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE ); 787 glColorMask( GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE );
@@ -1286,23 +1258,6 @@ BOOL LLTexLayer::parseData( LLXmlTreeNode* node )
1286//----------------------------------------------------------------------------- 1258//-----------------------------------------------------------------------------
1287 1259
1288 1260
1289BOOL LLTexLayer::loadStaticImageRaw()
1290{
1291 if( mStaticImageRaw.isNull() && !mStaticImageInvalid)
1292 {
1293 mStaticImageRaw = gTexStaticImageList.getImageRaw( getInfo()->mStaticImageFileName );
1294 // We now have something in one of our caches
1295 LLTexLayerSet::sHasCaches |= mStaticImageRaw.notNull() ? TRUE : FALSE;
1296 if( mStaticImageRaw.isNull() )
1297 {
1298 llwarns << "Unable to load static file: " << getInfo()->mStaticImageFileName << llendl;
1299 mStaticImageInvalid = TRUE; // don't try again.
1300 return FALSE;
1301 }
1302 }
1303 return TRUE;
1304}
1305
1306void LLTexLayer::deleteCaches() 1261void LLTexLayer::deleteCaches()
1307{ 1262{
1308 for( alpha_list_t::iterator iter = mParamAlphaList.begin(); 1263 for( alpha_list_t::iterator iter = mParamAlphaList.begin();
@@ -1375,7 +1330,6 @@ BOOL LLTexLayer::render( S32 x, S32 y, S32 width, S32 height )
1375 1330
1376 if( (getInfo()->mLocalTexture != -1) && !getInfo()->mUseLocalTextureAlphaOnly ) 1331 if( (getInfo()->mLocalTexture != -1) && !getInfo()->mUseLocalTextureAlphaOnly )
1377 { 1332 {
1378 if( gUseAvatarGLCache )
1379 { 1333 {
1380 LLImageGL* image_gl = NULL; 1334 LLImageGL* image_gl = NULL;
1381 if( mTexLayerSet->getAvatar()->getLocalTextureGL( getInfo()->mLocalTexture, &image_gl ) ) 1335 if( mTexLayerSet->getAvatar()->getLocalTextureGL( getInfo()->mLocalTexture, &image_gl ) )
@@ -1401,29 +1355,10 @@ BOOL LLTexLayer::render( S32 x, S32 y, S32 width, S32 height )
1401 success = FALSE; 1355 success = FALSE;
1402 } 1356 }
1403 } 1357 }
1404 else
1405 {
1406 LLPointer<LLImageRaw> image_raw = new LLImageRaw;
1407 if( mTexLayerSet->getAvatar()->getLocalTextureRaw( getInfo()->mLocalTexture, image_raw ) )
1408 {
1409 success &= renderImageRaw( image_raw->getData(),
1410 image_raw->getWidth(),
1411 image_raw->getHeight(),
1412 image_raw->getComponents(),
1413 width,
1414 height,
1415 FALSE );
1416 }
1417 else
1418 {
1419 success = FALSE;
1420 }
1421 }
1422 } 1358 }
1423 1359
1424 if( !getInfo()->mStaticImageFileName.empty() ) 1360 if( !getInfo()->mStaticImageFileName.empty() )
1425 { 1361 {
1426 if( gUseAvatarGLCache )
1427 { 1362 {
1428 LLImageGL* image_gl = gTexStaticImageList.getImageGL( getInfo()->mStaticImageFileName, getInfo()->mStaticImageIsMask ); 1363 LLImageGL* image_gl = gTexStaticImageList.getImageGL( getInfo()->mStaticImageFileName, getInfo()->mStaticImageIsMask );
1429 if( image_gl ) 1364 if( image_gl )
@@ -1437,26 +1372,6 @@ BOOL LLTexLayer::render( S32 x, S32 y, S32 width, S32 height )
1437 success = FALSE; 1372 success = FALSE;
1438 } 1373 }
1439 } 1374 }
1440 else
1441 {
1442 // Don't load the image file until we actually need it the first time. Like now.
1443 if (!loadStaticImageRaw())
1444 {
1445 success = FALSE;
1446 }
1447 if( mStaticImageRaw.notNull() )
1448 {
1449 success &= renderImageRaw(
1450 mStaticImageRaw->getData(),
1451 mStaticImageRaw->getWidth(),
1452 mStaticImageRaw->getHeight(),
1453 mStaticImageRaw->getComponents(), width, height, getInfo()->mStaticImageIsMask );
1454 }
1455 else
1456 {
1457 success = FALSE;
1458 }
1459 }
1460 } 1375 }
1461 1376
1462 if( ((-1 == getInfo()->mLocalTexture) || 1377 if( ((-1 == getInfo()->mLocalTexture) ||
@@ -1610,7 +1525,6 @@ BOOL LLTexLayer::renderAlphaMasks( S32 x, S32 y, S32 width, S32 height, LLColor4
1610 // Accumulate the alpha component of the texture 1525 // Accumulate the alpha component of the texture
1611 if( getInfo()->mLocalTexture != -1 ) 1526 if( getInfo()->mLocalTexture != -1 )
1612 { 1527 {
1613 if( gUseAvatarGLCache )
1614 { 1528 {
1615 LLImageGL* image_gl = NULL; 1529 LLImageGL* image_gl = NULL;
1616 if( mTexLayerSet->getAvatar()->getLocalTextureGL( getInfo()->mLocalTexture, &image_gl ) ) 1530 if( mTexLayerSet->getAvatar()->getLocalTextureGL( getInfo()->mLocalTexture, &image_gl ) )
@@ -1635,30 +1549,10 @@ BOOL LLTexLayer::renderAlphaMasks( S32 x, S32 y, S32 width, S32 height, LLColor4
1635 success = FALSE; 1549 success = FALSE;
1636 } 1550 }
1637 } 1551 }
1638 else
1639 {
1640 LLPointer<LLImageRaw> image_raw = new LLImageRaw;
1641 if( mTexLayerSet->getAvatar()->getLocalTextureRaw( getInfo()->mLocalTexture, image_raw ) )
1642 {
1643 if(image_raw->getComponents() == 4)
1644 {
1645 success &= renderImageRaw(
1646 image_raw->getData(),
1647 image_raw->getWidth(),
1648 image_raw->getHeight(),
1649 image_raw->getComponents(), width, height, FALSE );
1650 }
1651 }
1652 else
1653 {
1654 success = FALSE;
1655 }
1656 }
1657 } 1552 }
1658 1553
1659 if( !getInfo()->mStaticImageFileName.empty() ) 1554 if( !getInfo()->mStaticImageFileName.empty() )
1660 { 1555 {
1661 if( gUseAvatarGLCache )
1662 { 1556 {
1663 LLImageGL* image_gl = gTexStaticImageList.getImageGL( getInfo()->mStaticImageFileName, getInfo()->mStaticImageIsMask ); 1557 LLImageGL* image_gl = gTexStaticImageList.getImageGL( getInfo()->mStaticImageFileName, getInfo()->mStaticImageIsMask );
1664 if( image_gl ) 1558 if( image_gl )
@@ -1677,31 +1571,6 @@ BOOL LLTexLayer::renderAlphaMasks( S32 x, S32 y, S32 width, S32 height, LLColor4
1677 success = FALSE; 1571 success = FALSE;
1678 } 1572 }
1679 } 1573 }
1680 else
1681 {
1682 // Don't load the image file until we actually need it the first time. Like now.
1683 if (!loadStaticImageRaw())
1684 {
1685 success = FALSE;
1686 }
1687
1688 if( mStaticImageRaw.notNull() )
1689 {
1690 if( (mStaticImageRaw->getComponents() == 4) ||
1691 ( (mStaticImageRaw->getComponents() == 1) && getInfo()->mStaticImageIsMask ) )
1692 {
1693 success &= renderImageRaw(
1694 mStaticImageRaw->getData(),
1695 mStaticImageRaw->getWidth(),
1696 mStaticImageRaw->getHeight(),
1697 mStaticImageRaw->getComponents(), width, height, getInfo()->mStaticImageIsMask );
1698 }
1699 }
1700 else
1701 {
1702 success = FALSE;
1703 }
1704 }
1705 } 1574 }
1706 1575
1707 // Draw a rectangle with the layer color to multiply the alpha by that color's alpha. 1576 // Draw a rectangle with the layer color to multiply the alpha by that color's alpha.
@@ -2106,8 +1975,7 @@ BOOL LLTexLayerParamAlpha::render( S32 x, S32 y, S32 width, S32 height )
2106 if( !mCachedProcessedImageGL || 1975 if( !mCachedProcessedImageGL ||
2107 (mCachedProcessedImageGL->getWidth() != image_tga_width) || 1976 (mCachedProcessedImageGL->getWidth() != image_tga_width) ||
2108 (mCachedProcessedImageGL->getHeight() != image_tga_height) || 1977 (mCachedProcessedImageGL->getHeight() != image_tga_height) ||
2109 (weight_changed && !(gGLManager.mHasPalettedTextures && gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_PALETTE))) || 1978 (weight_changed && !(gGLManager.mHasPalettedTextures && gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_PALETTE))) )
2110 (!gUseAvatarGLCache) )
2111 { 1979 {
2112// llinfos << "Building Cached Alpha: " << mName << ": (" << mStaticImageRaw->getWidth() << ", " << mStaticImageRaw->getHeight() << ") " << effective_weight << llendl; 1980// llinfos << "Building Cached Alpha: " << mName << ": (" << mStaticImageRaw->getWidth() << ", " << mStaticImageRaw->getHeight() << ") " << effective_weight << llendl;
2113 mCachedEffectiveWeight = effective_weight; 1981 mCachedEffectiveWeight = effective_weight;
@@ -2149,7 +2017,6 @@ BOOL LLTexLayerParamAlpha::render( S32 x, S32 y, S32 width, S32 height )
2149 2017
2150 if( mCachedProcessedImageGL ) 2018 if( mCachedProcessedImageGL )
2151 { 2019 {
2152 if( gUseAvatarGLCache ) // 64 MB
2153 { 2020 {
2154 if (gGLManager.mHasPalettedTextures && gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_PALETTE)) 2021 if (gGLManager.mHasPalettedTextures && gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_PALETTE))
2155 { 2022 {
@@ -2187,94 +2054,6 @@ BOOL LLTexLayerParamAlpha::render( S32 x, S32 y, S32 width, S32 height )
2187 } 2054 }
2188 stop_glerror(); 2055 stop_glerror();
2189 } 2056 }
2190 else
2191 {
2192 if( (mCachedProcessedImageGL->getWidth() != VOAVATAR_SCRATCH_TEX_WIDTH) ||
2193 (mCachedProcessedImageGL->getHeight() != VOAVATAR_SCRATCH_TEX_HEIGHT) )
2194 {
2195 if (gGLManager.mHasPalettedTextures && gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_PALETTE))
2196 {
2197 mCachedProcessedImageGL->createGLTexture(0, mStaticImageRaw);
2198
2199 LLGLSNoAlphaTest gls_no_alpha_test;
2200
2201 mCachedProcessedImageGL->bind();
2202 mCachedProcessedImageGL->setClamp(TRUE, TRUE);
2203
2204 gGradientPaletteList.setHardwarePalette( getInfo()->mDomain, effective_weight );
2205 gl_rect_2d_simple_tex( width, height );
2206 LLImageGL::unbindTexture(0, GL_TEXTURE_2D);
2207 mCachedProcessedImageGL->destroyGLTexture();
2208 }
2209 else
2210 {
2211 // Create the GL texture, bind it and draw a rect, and then immediately destroy it.
2212 mCachedProcessedImageGL->createGLTexture(0, mStaticImageRaw);
2213
2214 LLGLSNoAlphaTest gls_no_alpha_test;
2215
2216 mCachedProcessedImageGL->bind();
2217 mCachedProcessedImageGL->setClamp(TRUE, TRUE);
2218
2219 gl_rect_2d_simple_tex( width, height );
2220
2221 LLImageGL::unbindTexture(0, GL_TEXTURE_2D);
2222
2223 mCachedProcessedImageGL->destroyGLTexture();
2224 }
2225 stop_glerror();
2226 }
2227 else
2228 {
2229 if (gGLManager.mHasPalettedTextures && gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_PALETTE))
2230 {
2231 // Write into a pre-existing GL Image, and then bind and render that.
2232 // Faster than creating a new GL Image and then destroying it.
2233 if( mTexLayer->getTexLayerSet()->getAvatar()->bindScratchTexture( GL_COLOR_INDEX ) )
2234 {
2235 glTexSubImage2D( GL_TEXTURE_2D, 0, 0, 0,
2236 mCachedProcessedImageGL->getWidth(),
2237 mCachedProcessedImageGL->getHeight(),
2238 GL_COLOR_INDEX, GL_UNSIGNED_BYTE,
2239 mStaticImageRaw->getData() );
2240 stop_glerror();
2241
2242 LLGLSNoAlphaTest gls_no_alpha_test;
2243 gGradientPaletteList.setHardwarePalette( getInfo()->mDomain, effective_weight );
2244 gl_rect_2d_simple_tex( width, height );
2245
2246 LLImageGL::unbindTexture(0, GL_TEXTURE_2D);
2247 }
2248 else
2249 {
2250 success = FALSE;
2251 }
2252 }
2253 else
2254 {
2255 // Write into a pre-existing GL Image, and then bind and render that.
2256 // Faster than creating a new GL Image and then destroying it.
2257 if( mTexLayer->getTexLayerSet()->getAvatar()->bindScratchTexture( GL_ALPHA ) )
2258 {
2259 glTexSubImage2D( GL_TEXTURE_2D, 0, 0, 0,
2260 mCachedProcessedImageGL->getWidth(),
2261 mCachedProcessedImageGL->getHeight(),
2262 GL_ALPHA, GL_UNSIGNED_BYTE,
2263 mStaticImageRaw->getData() );
2264 stop_glerror();
2265
2266 LLGLSNoAlphaTest gls_no_alpha_test;
2267 gl_rect_2d_simple_tex( width, height );
2268
2269 LLImageGL::unbindTexture(0, GL_TEXTURE_2D);
2270 }
2271 else
2272 {
2273 success = FALSE;
2274 }
2275 }
2276 }
2277 }
2278 } 2057 }
2279 2058
2280 // Don't keep the cache for other people's avatars 2059 // Don't keep the cache for other people's avatars
@@ -2625,7 +2404,6 @@ LLStringTable LLTexStaticImageList::sImageNames(16384);
2625 2404
2626LLTexStaticImageList::LLTexStaticImageList() 2405LLTexStaticImageList::LLTexStaticImageList()
2627 : 2406 :
2628 mRawBytes( 0 ),
2629 mGLBytes( 0 ), 2407 mGLBytes( 0 ),
2630 mTGABytes( 0 ) 2408 mTGABytes( 0 )
2631{} 2409{}
@@ -2638,36 +2416,31 @@ LLTexStaticImageList::~LLTexStaticImageList()
2638void LLTexStaticImageList::dumpByteCount() 2416void LLTexStaticImageList::dumpByteCount()
2639{ 2417{
2640 llinfos << "Avatar Static Textures " << 2418 llinfos << "Avatar Static Textures " <<
2641 " Raw:" << (mRawBytes / 1024) <<
2642 "KB GL:" << (mGLBytes / 1024) << 2419 "KB GL:" << (mGLBytes / 1024) <<
2643 "KB TGA:" << (mTGABytes / 1024) << "KB" << llendl; 2420 "KB TGA:" << (mTGABytes / 1024) << "KB" << llendl;
2644} 2421}
2645 2422
2646void LLTexStaticImageList::deleteCachedImages() 2423void LLTexStaticImageList::deleteCachedImages()
2647{ 2424{
2648 if( mRawBytes || mGLBytes || mTGABytes ) 2425 if( mGLBytes || mTGABytes )
2649 { 2426 {
2650 llinfos << "Clearing Static Textures " << 2427 llinfos << "Clearing Static Textures " <<
2651 " Raw:" << (mRawBytes / 1024) <<
2652 "KB GL:" << (mGLBytes / 1024) << 2428 "KB GL:" << (mGLBytes / 1024) <<
2653 "KB TGA:" << (mTGABytes / 1024) << "KB" << llendl; 2429 "KB TGA:" << (mTGABytes / 1024) << "KB" << llendl;
2654 2430
2655 //mStaticImageLists uses LLPointers, clear() will cause deletion 2431 //mStaticImageLists uses LLPointers, clear() will cause deletion
2656 2432
2657 mStaticImageListRaw.clear();
2658 mStaticImageListTGA.clear(); 2433 mStaticImageListTGA.clear();
2659 mStaticImageListGL.clear(); 2434 mStaticImageListGL.clear();
2660 2435
2661 mRawBytes = 0;
2662 mGLBytes = 0; 2436 mGLBytes = 0;
2663 mTGABytes = 0; 2437 mTGABytes = 0;
2664 } 2438 }
2665} 2439}
2666 2440
2667// Note: in general, for a given image image we'll call either getImageTga(), getImageRaw() or getImageGL(). 2441// Note: in general, for a given image image we'll call either getImageTga() or getImageGL().
2668// We call getImageTga() if the image is used as an alpha gradient. 2442// We call getImageTga() if the image is used as an alpha gradient.
2669// Otherwise, we call getImageRaw() if we have 32 MB or less of video RAM or less and getImageGL() if we have 2443// Otherwise, we call getImageGL()
2670// more video RAM than that.
2671 2444
2672// Returns an LLImageTGA that contains the encoded data from a tga file named file_name. 2445// Returns an LLImageTGA that contains the encoded data from a tga file named file_name.
2673// Caches the result to speed identical subsequent requests. 2446// Caches the result to speed identical subsequent requests.
@@ -2699,34 +2472,6 @@ LLImageTGA* LLTexStaticImageList::getImageTGA(const LLString& file_name)
2699 2472
2700 2473
2701 2474
2702// Returns an LLImageRaw that contains the decoded data from a tga file named file_name.
2703// Caches the result to speed identical subsequent requests.
2704LLImageRaw* LLTexStaticImageList::getImageRaw(const LLString& file_name)
2705{
2706 LLPointer<LLImageRaw> image_raw;
2707 const char *namekey = sImageNames.addString(file_name);
2708 image_raw_map_t::iterator iter = mStaticImageListRaw.find(namekey);
2709 if( iter != mStaticImageListRaw.end() )
2710 {
2711 image_raw = iter->second;
2712 }
2713 else
2714 {
2715 image_raw = new LLImageRaw();
2716 if( loadImageRaw( file_name, image_raw ) )
2717 {
2718 mStaticImageListRaw[ namekey ] = image_raw;
2719 mRawBytes += image_raw->getDataSize();
2720 }
2721 else
2722 {
2723 image_raw = NULL;
2724 }
2725 }
2726
2727 return image_raw;
2728}
2729
2730// Returns a GL Image (without a backing ImageRaw) that contains the decoded data from a tga file named file_name. 2475// Returns a GL Image (without a backing ImageRaw) that contains the decoded data from a tga file named file_name.
2731// Caches the result to speed identical subsequent requests. 2476// Caches the result to speed identical subsequent requests.
2732LLImageGL* LLTexStaticImageList::getImageGL(const LLString& file_name, BOOL is_mask ) 2477LLImageGL* LLTexStaticImageList::getImageGL(const LLString& file_name, BOOL is_mask )
diff --git a/linden/indra/newview/lltexlayer.h b/linden/indra/newview/lltexlayer.h
index 3db6f96..5d12da5 100644
--- a/linden/indra/newview/lltexlayer.h
+++ b/linden/indra/newview/lltexlayer.h
@@ -341,9 +341,6 @@ public:
341 BOOL hasAlphaParams() { return (!mParamAlphaList.empty());} 341 BOOL hasAlphaParams() { return (!mParamAlphaList.empty());}
342 342
343protected: 343protected:
344 BOOL loadStaticImageRaw();
345
346protected:
347 LLTexLayerSet* mTexLayerSet; 344 LLTexLayerSet* mTexLayerSet;
348 LLPointer<LLImageRaw> mStaticImageRaw; 345 LLPointer<LLImageRaw> mStaticImageRaw;
349 346
@@ -517,15 +514,12 @@ private:
517private: 514private:
518 static LLStringTable sImageNames; 515 static LLStringTable sImageNames;
519 516
520 typedef std::map< const char *, LLPointer<LLImageRaw> > image_raw_map_t;
521 typedef std::map< const char *, LLPointer<LLImageGL> > image_gl_map_t; 517 typedef std::map< const char *, LLPointer<LLImageGL> > image_gl_map_t;
522 typedef std::map< const char *, LLPointer<LLImageTGA> > image_tga_map_t; 518 typedef std::map< const char *, LLPointer<LLImageTGA> > image_tga_map_t;
523 image_raw_map_t mStaticImageListRaw;
524 image_gl_map_t mStaticImageListGL; 519 image_gl_map_t mStaticImageListGL;
525 image_tga_map_t mStaticImageListTGA; 520 image_tga_map_t mStaticImageListTGA;
526 521
527public: 522public:
528 S32 mRawBytes;
529 S32 mGLBytes; 523 S32 mGLBytes;
530 S32 mTGABytes; 524 S32 mTGABytes;
531}; 525};
diff --git a/linden/indra/newview/lltexturebar.cpp b/linden/indra/newview/lltexturebar.cpp
deleted file mode 100644
index d3be39e..0000000
--- a/linden/indra/newview/lltexturebar.cpp
+++ /dev/null
@@ -1,412 +0,0 @@
1/**
2 * @file lltexturebar.cpp
3 * @brief LLTextureBar class implementation
4 *
5 * Copyright (c) 2001-2007, Linden Research, Inc.
6 *
7 * The source code in this file ("Source Code") is provided by Linden Lab
8 * to you under the terms of the GNU General Public License, version 2.0
9 * ("GPL"), unless you have obtained a separate licensing agreement
10 * ("Other License"), formally executed by you and Linden Lab. Terms of
11 * the GPL can be found in doc/GPL-license.txt in this distribution, or
12 * online at http://secondlife.com/developers/opensource/gplv2
13 *
14 * There are special exceptions to the terms and conditions of the GPL as
15 * it is applied to this Source Code. View the full text of the exception
16 * in the file doc/FLOSS-exception.txt in this software distribution, or
17 * online at http://secondlife.com/developers/opensource/flossexception
18 *
19 * By copying, modifying or distributing this software, you acknowledge
20 * that you have read and understood your obligations described above,
21 * and agree to abide by those obligations.
22 *
23 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
24 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
25 * COMPLETENESS OR PERFORMANCE.
26 */
27
28#include "llviewerprecompiledheaders.h"
29
30#include "lltexturebar.h"
31#include "llviewerimage.h"
32#include "lltexturetable.h"
33#include "llfontgl.h"
34#include "llui.h"
35#include "llassetstorage.h"
36#include "llglheaders.h"
37#include "llviewerimagelist.h"
38
39#include "lltexlayer.h"
40
41// colors used for highlighting textures
42const F32 select_colors[][4] = { {1.0f, 1.0f, 1.0f, 0.7f}, // default = white
43 {1.0f, 1.0f, 0.3f, 1.0f}, // selected = yellow
44 {0.3f, 1.0f, 1.0f, 1.0f}, // flagged = cyan
45 {1.0f, 0.3f, 1.0f, 1.0f}, // boosted = magenta
46 {0.5f, 0.5f, 1.0f, 1.0f}, // blue
47 {0.5f, 1.0f, 0.5f, 1.0f}, // green
48 {1.0f, 0.5f, 0.5f, 1.0f}, // updated this frame = red
49 {1.0f, 0.8f, 0.8f, 1.0f}, // nodiscard = pale red
50 {0.8f, 1.0f, 0.8f, 1.0f}, // fullres = pale green
51 {0.8f, 0.8f, 0.8f, 0.7f} // 0 priority = grey
52};
53
54LLTextureBar::LLTextureBar(const std::string& name, const LLRect& r)
55 : LLView(name, r, FALSE)
56{
57 mHilite = 0;
58}
59
60static LLString title_string1("Tex UUID Area DDis(Req) DecodePri(Req) [decode] pkts/max");
61static LLString title_string2("W x H (Dis) Mem");
62
63static S32 pip_base = 480;
64static S32 pip_width = 6;
65
66EWidgetType LLTextureBar::getWidgetType() const
67{
68 return WIDGET_TYPE_TEXTURE_BAR;
69}
70
71LLString LLTextureBar::getWidgetTag() const
72{
73 return LL_TEXTURE_BAR_TAG;
74}
75
76
77void LLTextureBar::draw()
78{
79 if (!mImagep)
80 {
81 return;
82 }
83
84 S32 color;
85 if (mHilite)
86 {
87 color = llclamp(mHilite,0,4);
88 }
89 else if (mImagep->getBoostLevel())
90 {
91 color = 3;
92 }
93 else if (mImagep->mDontDiscard)
94 {
95 color = 7;
96 }
97 else if (!mImagep->getUseMipMaps())
98 {
99 color = 8;
100 }
101 else if (mImagep->getDecodePriority() == 0.0f)
102 {
103 color = 9;
104 }
105 else
106 {
107 color = 0;
108 }
109
110 // We need to draw:
111 // The texture UUID or name
112 // The progress bar for the texture, highlighted if it's being download
113 // Various numerical stats.
114 char tex_str[256];
115 S32 left, right;
116 S32 top = 0;
117 S32 bottom = top + 6;
118
119 // Get the name or UUID of the image.
120 gTextureTable.getName(mImagep->mID);
121
122 // Name, pixel_area, requested pixel area, decode priority
123 char uuid_str[255];
124 mImagep->mID.toString(uuid_str);
125 uuid_str[8] = 0;
126 sprintf(tex_str, "%s %7.0f %d(%d) %8.2f(%8.2f)",
127 uuid_str,
128 mImagep->mMaxVirtualSize,
129 mImagep->mDesiredDiscardLevel,
130 mImagep->mRequestedDiscardLevel,
131 mImagep->getDecodePriority(),
132 mImagep->mRequestedDownloadPriority);
133
134
135 LLGLSUIDefault gls_ui;
136 LLFontGL::sMonospace->renderUTF8(tex_str, 0, 0, mRect.getHeight(),
137 select_colors[color],
138 LLFontGL::LEFT, LLFontGL::TOP);
139
140 LLGLSNoTexture gls_no_texture;
141 F32 last_event;
142 LLColor4 clr;
143
144 // Draw the packet pip
145 last_event = mImagep->mLastPacketTimer.getElapsedTimeF32();
146 if (last_event < 1.f)
147 {
148 clr = LLColor4::white; clr.setAlpha(1.f - last_event);
149 glColor4fv(clr.mV);
150 gl_rect_2d(pip_base, top, pip_base + pip_width, bottom);
151 }
152 else
153 {
154 last_event = mImagep->mRequestTime.getElapsedTimeF32() * 1.f/5.f;
155 if (last_event < 1.f)
156 {
157 clr = LLColor4::green; clr.setAlpha(1.f - last_event);
158 glColor4fv(clr.mV);
159 gl_rect_2d(pip_base, top, pip_base + pip_width, bottom);
160 }
161 }
162
163 // Draw the decode pip
164 if (mImagep->getDiscardLevel() < 0)
165 last_event = 1.f;
166 else
167 last_event = mImagep->mLastDecodeTime.getElapsedTimeF32();
168 if (last_event < 1.f)
169 {
170 clr = LLColor4::yellow; clr.setAlpha(1.f - last_event);
171 glColor4fv(clr.mV);
172 gl_rect_2d(pip_base + pip_width*2, top, pip_base + pip_width*3, bottom);
173 }
174
175 // we don't want to show bind/resident pips for textures using the default texture
176 if (mImagep->getHasGLTexture())
177 {
178 BOOL miss = FALSE;
179 // Draw the bound pip
180 last_event = mImagep->sLastFrameTime - mImagep->mLastBindTime;
181 if (last_event < 1.f)
182 {
183 clr = LLColor4::magenta1; clr.setAlpha(1.f - last_event);
184 glColor4fv(clr.mV);
185 gl_rect_2d(pip_base + pip_width*4, top, pip_base + pip_width*5, bottom);
186
187 miss = mImagep->getMissed();
188 }
189
190 // Draw the miss pip
191 if (miss)
192 {
193 clr = LLColor4::red;
194 glColor4fv(clr.mV);
195 gl_rect_2d(pip_base + pip_width*6, top, pip_base + pip_width*7, bottom);
196 }
197 }
198
199 // Draw the progress bar.
200 S32 bar_width = 100;
201 S32 bar_left = 280;
202 left = bar_left;
203 right = left + bar_width;
204
205 glColor4f(0.f, 0.f, 0.f, 0.75f);
206 gl_rect_2d(left, top, right, bottom);
207
208 F32 data_progress = 0.0f;
209 F32 decode_progress = mImagep->getDecodeProgress(&data_progress);
210
211 if (data_progress > 0.0f)
212 {
213 // Decoded bytes
214 right = left + llfloor(decode_progress * (F32)bar_width);
215
216 if (left < right)
217 {
218 if (mImagep->getDiscardLevel() >= 0)
219 {
220 glColor4f(0.f, 0.f, 1.f, 0.75f);
221 }
222 else
223 {
224 glColor4f(0.5f, 0.0f, 0.5f, 0.75f);
225 }
226 gl_rect_2d(left, top, right, bottom);
227 }
228
229 // Downloaded bytes
230 left = right;
231 right = left + llfloor((data_progress - decode_progress) * (F32)bar_width);
232
233 if (left < right)
234 {
235 glColor4f(1.f, 0.f, 0.f, 0.75f);
236 gl_rect_2d(left, top, right, bottom);
237 }
238 }
239
240 {
241 LLGLSUIDefault gls_ui;
242 // draw the packet data
243 {
244 LLString num_str = llformat("%3d/%3d", mImagep->mLastPacket+1, mImagep->mPackets);
245 LLFontGL::sMonospace->renderUTF8(num_str, 0, bar_left + 100, mRect.getHeight(), select_colors[color],
246 LLFontGL::LEFT, LLFontGL::TOP);
247 }
248
249 // draw the image size at the end
250 {
251 LLString num_str = llformat("%4d x %4d (%d) %7d", mImagep->getWidth(), mImagep->getHeight(),
252 mImagep->getDiscardLevel(), mImagep->mTextureMemory);
253 LLFontGL::sMonospace->renderUTF8(num_str, 0, pip_base + pip_width*8, mRect.getHeight(), select_colors[color],
254 LLFontGL::LEFT, LLFontGL::TOP);
255 }
256 }
257
258}
259
260BOOL LLTextureBar::handleMouseDown(S32 x, S32 y, MASK mask)
261{
262 return FALSE;
263}
264
265LLRect LLTextureBar::getRequiredRect()
266{
267 LLRect rect;
268
269 rect.mTop = 8;
270
271 return rect;
272}
273
274//==============================================================================
275
276LLGLTexMemBar::LLGLTexMemBar(const std::string& name)
277 : LLView(name, FALSE)
278{
279 S32 line_height = (S32)(LLFontGL::sMonospace->getLineHeight() + .5f);
280 setRect(LLRect(0,0,100,line_height * 4));
281 updateRect();
282}
283
284EWidgetType LLGLTexMemBar::getWidgetType() const
285{
286 return WIDGET_TYPE_TEX_MEM_BAR;
287}
288
289LLString LLGLTexMemBar::getWidgetTag() const
290{
291 return LL_GL_TEX_MEM_BAR_TAG;
292}
293
294
295extern F32 texmem_lower_bound_scale;
296
297void LLGLTexMemBar::draw()
298{
299 S32 bound_mem = LLViewerImage::sBoundTextureMemory;
300 S32 max_bound_mem = LLViewerImage::sMaxBoundTextureMem;
301 S32 total_mem = LLViewerImage::sTotalTextureMemory;
302 S32 max_total_mem = LLViewerImage::sMaxTotalTextureMem;
303 F32 discard_bias = LLViewerImage::sDesiredDiscardBias;
304 S32 line_height = (S32)(LLFontGL::sMonospace->getLineHeight() + .5f);
305
306 //----------------------------------------------------------------------------
307 LLGLSUIDefault gls_ui;
308 F32 text_color[] = {1.f, 1.f, 1.f, 0.75f};
309
310 std::string text;
311 text = llformat("GL Tot: %d/%d MB Bound: %d/%d MB Discard Bias: %.2f",
312 total_mem/(1024*1024),
313 max_total_mem/(1024*1024),
314 bound_mem/(1024*1024),
315 max_bound_mem/(1024*1024),
316 discard_bias);
317
318 LLFontGL::sMonospace->renderUTF8(text, 0, 0, line_height*3,
319 text_color, LLFontGL::LEFT, LLFontGL::TOP);
320
321 //----------------------------------------------------------------------------
322 S32 bar_left = 350;
323 S32 bar_width = 200;
324 S32 top = line_height*3 - 2;
325 S32 bottom = top - 6;
326 S32 left = bar_left;
327 S32 right = left + bar_width;
328
329 F32 bar_scale = (F32)bar_width / (max_bound_mem * 1.5f);
330
331 LLGLSNoTexture gls_no_texture;
332
333 glColor4f(0.5f, 0.5f, 0.5f, 0.75f);
334 gl_rect_2d(left, top, right, bottom);
335
336
337 left = bar_left;
338 right = left + llfloor(bound_mem * bar_scale);
339 if (bound_mem < llfloor(max_bound_mem * texmem_lower_bound_scale))
340 {
341 glColor4f(0.f, 1.f, 0.f, 0.75f);
342 }
343 else if (bound_mem < max_bound_mem)
344 {
345 glColor4f(1.f, 1.f, 0.f, 0.75f);
346 }
347 else
348 {
349 glColor4f(1.f, 0.f, 0.f, 0.75f);
350 }
351 gl_rect_2d(left, top, right, bottom);
352
353 bar_scale = (F32)bar_width / (max_total_mem * 1.5f);
354
355 top = bottom - 2;
356 bottom = top - 6;
357 left = bar_left;
358 right = left + llfloor(total_mem * bar_scale);
359 if (total_mem < llfloor(max_total_mem * texmem_lower_bound_scale))
360 {
361 glColor4f(0.f, 1.f, 0.f, 0.75f);
362 }
363 else if (total_mem < max_total_mem)
364 {
365 glColor4f(1.f, 1.f, 0.f, 0.75f);
366 }
367 else
368 {
369 glColor4f(1.f, 0.f, 0.f, 0.75f);
370 }
371 gl_rect_2d(left, top, right, bottom);
372
373 //----------------------------------------------------------------------------
374 text = llformat("TexStaticImageList Raw: %d GL: %d TGA: %d",
375 gTexStaticImageList.mRawBytes, gTexStaticImageList.mGLBytes, gTexStaticImageList.mTGABytes);
376
377 LLGLEnable tex(GL_TEXTURE_2D);
378 LLFontGL::sMonospace->renderUTF8(text, 0, 0, line_height*2,
379 text_color, LLFontGL::LEFT, LLFontGL::TOP);
380
381
382 //----------------------------------------------------------------------------
383
384 S32 x = 0;
385 LLFontGL::sMonospace->renderUTF8(title_string1, 0, x, line_height,
386 text_color, LLFontGL::LEFT, LLFontGL::TOP);
387 S32 dx = 24;
388 x = pip_base - dx;
389 LLFontGL::sMonospace->renderUTF8("pkt", 0, x, line_height, LLColor4::white, LLFontGL::LEFT, LLFontGL::TOP);
390 x += dx;
391 LLFontGL::sMonospace->renderUTF8("dec", 0, x, line_height, LLColor4::yellow, LLFontGL::LEFT, LLFontGL::TOP);
392 x += dx;
393 LLFontGL::sMonospace->renderUTF8("bnd", 0, x, line_height, LLColor4::magenta1, LLFontGL::LEFT, LLFontGL::TOP);
394 x += dx;
395 LLFontGL::sMonospace->renderUTF8("mis", 0, x, line_height, LLColor4::red, LLFontGL::LEFT, LLFontGL::TOP);
396 x += dx;
397 LLFontGL::sMonospace->renderUTF8(title_string2, 0, x, line_height,
398 text_color, LLFontGL::LEFT, LLFontGL::TOP);
399}
400
401BOOL LLGLTexMemBar::handleMouseDown(S32 x, S32 y, MASK mask)
402{
403 return FALSE;
404}
405
406LLRect LLGLTexMemBar::getRequiredRect()
407{
408 LLRect rect;
409 rect.mTop = 8;
410 return rect;
411}
412
diff --git a/linden/indra/newview/lltexturecache.cpp b/linden/indra/newview/lltexturecache.cpp
new file mode 100644
index 0000000..084211a
--- /dev/null
+++ b/linden/indra/newview/lltexturecache.cpp
@@ -0,0 +1,1409 @@
1/**
2 * @file texturecache.cpp
3 * @brief Object which handles local texture caching
4 *
5 * Copyright (c) 2000-2007, Linden Research, Inc.
6 *
7 * The source code in this file ("Source Code") is provided by Linden Lab
8 * to you under the terms of the GNU General Public License, version 2.0
9 * ("GPL"), unless you have obtained a separate licensing agreement
10 * ("Other License"), formally executed by you and Linden Lab. Terms of
11 * the GPL can be found in doc/GPL-license.txt in this distribution, or
12 * online at http://secondlife.com/developers/opensource/gplv2
13 *
14 * There are special exceptions to the terms and conditions of the GPL as
15 * it is applied to this Source Code. View the full text of the exception
16 * in the file doc/FLOSS-exception.txt in this software distribution, or
17 * online at http://secondlife.com/developers/opensource/flossexception
18 *
19 * By copying, modifying or distributing this software, you acknowledge
20 * that you have read and understood your obligations described above,
21 * and agree to abide by those obligations.
22 *
23 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
24 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
25 * COMPLETENESS OR PERFORMANCE.
26 */
27
28#include "llviewerprecompiledheaders.h"
29
30#include "lltexturecache.h"
31
32#include "llapr.h"
33#include "lldir.h"
34#include "llimage.h"
35#include "lllfsthread.h"
36#include "llviewercontrol.h"
37
38#define USE_LFS_READ 0
39#define USE_LFS_WRITE 0
40
41// Note: first 4 bytes store file size, rest is j2c data
42const S32 TEXTURE_CACHE_ENTRY_SIZE = FIRST_PACKET_SIZE; //1024;
43
44class LLTextureCacheWorker : public LLWorkerClass
45{
46 friend class LLTextureCache;
47
48private:
49 enum e_state
50 {
51 INIT = 0,
52 LOCAL = 1,
53 CACHE = 2,
54 HEADER = 3,
55 BODY = 4
56 };
57
58 class ReadResponder : public LLLFSThread::Responder
59 {
60 public:
61 ReadResponder(LLTextureCache* cache, handle_t handle) : mCache(cache), mHandle(handle) {}
62 ~ReadResponder() {}
63 void completed(S32 bytes)
64 {
65 mCache->lockWorkers();
66 LLTextureCacheWorker* reader = mCache->getReader(mHandle);
67 if (reader) reader->ioComplete(bytes);
68 mCache->unlockWorkers();
69 }
70 LLTextureCache* mCache;
71 LLTextureCacheWorker::handle_t mHandle;
72 };
73
74 class WriteResponder : public LLLFSThread::Responder
75 {
76 public:
77 WriteResponder(LLTextureCache* cache, handle_t handle) : mCache(cache), mHandle(handle) {}
78 ~WriteResponder() {}
79 void completed(S32 bytes)
80 {
81 mCache->lockWorkers();
82 LLTextureCacheWorker* writer = mCache->getWriter(mHandle);
83 if (writer) writer->ioComplete(bytes);
84 mCache->unlockWorkers();
85 }
86 LLTextureCache* mCache;
87 LLTextureCacheWorker::handle_t mHandle;
88 };
89
90public:
91 LLTextureCacheWorker(LLTextureCache* cache, U32 priority, const LLUUID& id,
92 U8* data, S32 datasize, S32 offset,
93 S32 imagesize, // for writes
94 LLTextureCache::Responder* responder)
95 : LLWorkerClass(cache, "LLTextureCacheWorker"),
96 mCache(cache),
97 mPriority(priority),
98 mID(id),
99 mState(INIT),
100 mReadData(NULL),
101 mWriteData(data),
102 mDataSize(datasize),
103 mOffset(offset),
104 mImageSize(imagesize),
105 mImageFormat(IMG_CODEC_J2C),
106 mImageLocal(FALSE),
107 mResponder(responder),
108 mFileHandle(LLLFSThread::nullHandle()),
109 mBytesToRead(0),
110 mBytesRead(0)
111 {
112 mPriority &= LLWorkerThread::PRIORITY_LOWBITS;
113 }
114 ~LLTextureCacheWorker()
115 {
116 llassert_always(!haveWork());
117 delete[] mReadData;
118 }
119
120 bool doRead();
121 bool doWrite();
122 virtual bool doWork(S32 param); // Called from LLWorkerThread::processRequest()
123
124 handle_t read() { addWork(0, LLWorkerThread::PRIORITY_HIGH | mPriority); return mRequestHandle; }
125 handle_t write() { addWork(1, LLWorkerThread::PRIORITY_HIGH | mPriority); return mRequestHandle; }
126 bool complete() { return checkWork(); }
127 void ioComplete(S32 bytes)
128 {
129 mBytesRead = bytes;
130 setPriority(LLWorkerThread::PRIORITY_HIGH | mPriority);
131 }
132
133private:
134 virtual void startWork(S32 param); // called from addWork() (MAIN THREAD)
135 virtual void finishWork(S32 param, bool completed); // called from finishRequest() (WORK THREAD)
136 virtual void endWork(S32 param, bool aborted); // called from doWork() (MAIN THREAD)
137
138private:
139 LLTextureCache* mCache;
140 U32 mPriority;
141 LLUUID mID;
142 e_state mState;
143
144 U8* mReadData;
145 U8* mWriteData;
146 S32 mDataSize;
147 S32 mOffset;
148 S32 mImageSize;
149 S32 mImageFormat;
150 BOOL mImageLocal;
151 LLPointer<LLTextureCache::Responder> mResponder;
152 LLLFSThread::handle_t mFileHandle;
153 S32 mBytesToRead;
154 LLAtomicS32 mBytesRead;
155};
156
157//virtual
158void LLTextureCacheWorker::startWork(S32 param)
159{
160}
161
162bool LLTextureCacheWorker::doRead()
163{
164 S32 local_size = 0;
165 std::string local_filename;
166
167 if (mState == INIT)
168 {
169 std::string filename = mCache->getLocalFileName(mID);
170 local_filename = filename + ".j2c";
171 local_size = ll_apr_file_size(local_filename, mCache->getFileAPRPool());
172 if (local_size == 0)
173 {
174 local_filename = filename + ".tga";
175 local_size = ll_apr_file_size(local_filename, mCache->getFileAPRPool());
176 if (local_size > 0)
177 {
178 mImageFormat = IMG_CODEC_TGA;
179 mDataSize = local_size; // Only a complete .tga file is valid
180 }
181 }
182 if (local_size > 0)
183 {
184 mState = LOCAL;
185 }
186 else
187 {
188 mState = CACHE;
189 }
190 }
191
192 if (mState == LOCAL)
193 {
194#if USE_LFS_READ
195 if (mFileHandle == LLLFSThread::nullHandle())
196 {
197 mImageLocal = TRUE;
198 mImageSize = local_size;
199 if (!mDataSize || mDataSize + mOffset > local_size)
200 {
201 mDataSize = local_size - mOffset;
202 }
203 if (mDataSize <= 0)
204 {
205 // no more data to read
206 mDataSize = 0;
207 return true;
208 }
209 mReadData = new U8[mDataSize];
210 mBytesRead = -1;
211 mBytesToRead = mDataSize;
212 setPriority(LLWorkerThread::PRIORITY_LOW | mPriority);
213 mFileHandle = LLLFSThread::sLocal->read(local_filename, mReadData, mOffset, mDataSize,
214 new ReadResponder(mCache, mRequestHandle));
215 return false;
216 }
217 else
218 {
219 if (mBytesRead >= 0)
220 {
221 if (mBytesRead != mBytesToRead)
222 {
223 llwarns << "Error reading file from local cache: " << local_filename
224 << " Bytes: " << mDataSize << " Offset: " << mOffset
225 << " / " << mDataSize << llendl;
226 mDataSize = 0; // failed
227 delete[] mReadData;
228 mReadData = NULL;
229 }
230 return true;
231 }
232 else
233 {
234 return false;
235 }
236 }
237#else
238 if (!mDataSize || mDataSize > local_size)
239 {
240 mDataSize = local_size;
241 }
242 mReadData = new U8[mDataSize];
243 S32 bytes_read = ll_apr_file_read_ex(local_filename, mCache->getFileAPRPool(),
244 mReadData, mOffset, mDataSize);
245 if (bytes_read != mDataSize)
246 {
247 llwarns << "Error reading file from local cache: " << local_filename
248 << " Bytes: " << mDataSize << " Offset: " << mOffset
249 << " / " << mDataSize << llendl;
250 mDataSize = 0;
251 delete[] mReadData;
252 mReadData = NULL;
253 }
254 else
255 {
256 mImageSize = local_size;
257 mImageLocal = TRUE;
258 }
259 return true;
260#endif
261 }
262
263 S32 idx = -1;
264
265 if (mState == CACHE)
266 {
267 llassert_always(mImageSize == 0);
268 idx = mCache->getHeaderCacheEntry(mID, false, &mImageSize);
269 if (idx >= 0 && mImageSize > mOffset)
270 {
271 llassert_always(mImageSize > 0);
272 if (!mDataSize || mDataSize > mImageSize)
273 {
274 mDataSize = mImageSize;
275 }
276 mState = mOffset < TEXTURE_CACHE_ENTRY_SIZE ? HEADER : BODY;
277 }
278 else
279 {
280 mDataSize = 0; // no data
281 return true;
282 }
283 }
284
285 if (mState == HEADER)
286 {
287#if USE_LFS_READ
288 if (mFileHandle == LLLFSThread::nullHandle())
289 {
290 llassert_always(idx >= 0);
291 llassert_always(mOffset < TEXTURE_CACHE_ENTRY_SIZE);
292 S32 offset = idx * TEXTURE_CACHE_ENTRY_SIZE + mOffset;
293 S32 size = TEXTURE_CACHE_ENTRY_SIZE - mOffset;
294 llassert_always(mReadData == NULL);
295 mReadData = new U8[size];
296 mBytesRead = -1;
297 mBytesToRead = size;
298 setPriority(LLWorkerThread::PRIORITY_LOW | mPriority);
299 mFileHandle = LLLFSThread::sLocal->read(mCache->mHeaderDataFileName,
300 mReadData, offset, mBytesToRead,
301 new ReadResponder(mCache, mRequestHandle));
302 return false;
303 }
304 else
305 {
306 if (mBytesRead >= 0)
307 {
308 if (mBytesRead != mBytesToRead)
309 {
310 llwarns << "LLTextureCacheWorker: " << mID
311 << " incorrect number of bytes read from header: " << mBytesRead
312 << " != " << mBytesToRead << llendl;
313 mDataSize = -1; // failed
314 return true;
315 }
316 if (mDataSize <= TEXTURE_CACHE_ENTRY_SIZE)
317 {
318 return true; // done
319 }
320 else
321 {
322 mFileHandle = LLLFSThread::nullHandle();
323 mState = BODY;
324 }
325 }
326 else
327 {
328 return false;
329 }
330 }
331#else
332 llassert_always(idx >= 0);
333 llassert_always(mOffset < TEXTURE_CACHE_ENTRY_SIZE);
334 S32 offset = idx * TEXTURE_CACHE_ENTRY_SIZE + mOffset;
335 S32 size = TEXTURE_CACHE_ENTRY_SIZE - mOffset;
336 mReadData = new U8[size];
337 S32 bytes_read = ll_apr_file_read_ex(mCache->mHeaderDataFileName, mCache->getFileAPRPool(),
338 mReadData, offset, size);
339 if (bytes_read != size)
340 {
341 llwarns << "LLTextureCacheWorker: " << mID
342 << " incorrect number of bytes read from header: " << bytes_read
343 << " / " << size << llendl;
344 mDataSize = -1; // failed
345 return true;
346 }
347 if (mDataSize <= TEXTURE_CACHE_ENTRY_SIZE)
348 {
349 return true; // done
350 }
351 else
352 {
353 mState = BODY;
354 }
355#endif
356 }
357
358 if (mState == BODY)
359 {
360#if USE_LFS_READ
361 if (mFileHandle == LLLFSThread::nullHandle())
362 {
363 std::string filename = mCache->getTextureFileName(mID);
364 S32 filesize = ll_apr_file_size(filename, mCache->getFileAPRPool());
365 if (filesize > mOffset)
366 {
367 S32 datasize = TEXTURE_CACHE_ENTRY_SIZE + filesize;
368 mDataSize = llmin(datasize, mDataSize);
369 S32 data_offset = TEXTURE_CACHE_ENTRY_SIZE - mOffset;
370 data_offset = llmax(data_offset, 0);
371 S32 file_size = mDataSize - data_offset;
372 S32 file_offset = mOffset - TEXTURE_CACHE_ENTRY_SIZE;
373 file_offset = llmax(file_offset, 0);
374
375 llassert_always(mDataSize > 0);
376 U8* data = new U8[mDataSize];
377 if (data_offset > 0)
378 {
379 llassert_always(mReadData);
380 llassert_always(data_offset <= mDataSize);
381 memcpy(data, mReadData, data_offset);
382 delete[] mReadData;
383 mReadData = NULL;
384 }
385 llassert_always(mReadData == NULL);
386 mReadData = data;
387
388 mBytesRead = -1;
389 mBytesToRead = file_size;
390 setPriority(LLWorkerThread::PRIORITY_LOW | mPriority);
391 llassert_always(data_offset + mBytesToRead <= mDataSize);
392 mFileHandle = LLLFSThread::sLocal->read(filename,
393 mReadData + data_offset, file_offset, mBytesToRead,
394 new ReadResponder(mCache, mRequestHandle));
395 return false;
396 }
397 else
398 {
399 mDataSize = TEXTURE_CACHE_ENTRY_SIZE;
400 return true; // done
401 }
402 }
403 else
404 {
405 if (mBytesRead >= 0)
406 {
407 if (mBytesRead != mBytesToRead)
408 {
409 llwarns << "LLTextureCacheWorker: " << mID
410 << " incorrect number of bytes read from body: " << mBytesRead
411 << " != " << mBytesToRead << llendl;
412 mDataSize = -1; // failed
413 }
414 return true;
415 }
416 else
417 {
418 return false;
419 }
420 }
421#else
422 std::string filename = mCache->getTextureFileName(mID);
423 S32 filesize = ll_apr_file_size(filename, mCache->getFileAPRPool());
424 S32 bytes_read = 0;
425 if (filesize > mOffset)
426 {
427 S32 datasize = TEXTURE_CACHE_ENTRY_SIZE + filesize;
428 mDataSize = llmin(datasize, mDataSize);
429 S32 data_offset = TEXTURE_CACHE_ENTRY_SIZE - mOffset;
430 data_offset = llmax(data_offset, 0);
431 S32 file_size = mDataSize - data_offset;
432 S32 file_offset = mOffset - TEXTURE_CACHE_ENTRY_SIZE;
433 file_offset = llmax(file_offset, 0);
434
435 U8* data = new U8[mDataSize];
436 if (data_offset > 0)
437 {
438 llassert_always(mReadData);
439 memcpy(data, mReadData, data_offset);
440 delete[] mReadData;
441 }
442 mReadData = data;
443 bytes_read = ll_apr_file_read_ex(filename, mCache->getFileAPRPool(),
444 mReadData + data_offset,
445 file_offset, file_size);
446 if (bytes_read != file_size)
447 {
448 llwarns << "LLTextureCacheWorker: " << mID
449 << " incorrect number of bytes read from body: " << bytes_read
450 << " / " << file_size << llendl;
451 mDataSize = -1; // failed
452 return true;
453 }
454 }
455 else
456 {
457 mDataSize = TEXTURE_CACHE_ENTRY_SIZE;
458 }
459
460 return true;
461#endif
462 }
463
464 return false;
465}
466
467bool LLTextureCacheWorker::doWrite()
468{
469 S32 idx = -1;
470
471 if (mState == INIT)
472 {
473 llassert_always(mOffset == 0); // Currently don't support offsets
474 mState = CACHE;
475 }
476
477 // No LOCAL state for write()
478
479 if (mState == CACHE)
480 {
481 S32 cur_imagesize = 0;
482 S32 offset = mOffset;
483 idx = mCache->getHeaderCacheEntry(mID, false, &cur_imagesize);
484 if (idx >= 0 && cur_imagesize > 0)
485 {
486 offset = TEXTURE_CACHE_ENTRY_SIZE; // don't re-write header
487 }
488 idx = mCache->getHeaderCacheEntry(mID, true, &mImageSize); // touch entry
489 if (idx >= 0)
490 {
491 llassert_always(cur_imagesize <= 0 || mImageSize == cur_imagesize);
492 mState = offset < TEXTURE_CACHE_ENTRY_SIZE ? HEADER : BODY;
493 }
494 else
495 {
496 mDataSize = -1; // failed
497 return true;
498 }
499 }
500
501 if (mState == HEADER)
502 {
503#if USE_LFS_WRITE
504 if (mFileHandle == LLLFSThread::nullHandle())
505 {
506 llassert_always(idx >= 0);
507 llassert_always(mOffset < TEXTURE_CACHE_ENTRY_SIZE);
508 S32 offset = idx * TEXTURE_CACHE_ENTRY_SIZE + mOffset;
509 S32 size = TEXTURE_CACHE_ENTRY_SIZE - mOffset;
510 mBytesRead = -1;
511 mBytesToRead = size;
512 setPriority(LLWorkerThread::PRIORITY_LOW | mPriority);
513 mFileHandle = LLLFSThread::sLocal->write(mCache->mHeaderDataFileName,
514 mWriteData, offset, mBytesToRead,
515 new WriteResponder(mCache, mRequestHandle));
516 return false;
517 }
518 else
519 {
520 if (mBytesRead >= 0)
521 {
522 if (mBytesRead != mBytesToRead)
523 {
524 llwarns << "LLTextureCacheWorker: " << mID
525 << " incorrect number of bytes written to header: " << mBytesRead
526 << " != " << mBytesToRead << llendl;
527 mDataSize = -1; // failed
528 return true;
529 }
530 if (mDataSize <= mBytesToRead)
531 {
532 return true; // done
533 }
534 else
535 {
536 mFileHandle = LLLFSThread::nullHandle();
537 mState = BODY;
538 }
539 }
540 else
541 {
542 return false;
543 }
544 }
545#else
546 llassert_always(idx >= 0);
547 llassert_always(mOffset < TEXTURE_CACHE_ENTRY_SIZE);
548 S32 offset = idx * TEXTURE_CACHE_ENTRY_SIZE + mOffset;
549 S32 size = TEXTURE_CACHE_ENTRY_SIZE - mOffset;
550 S32 bytes_written = ll_apr_file_write_ex(mCache->mHeaderDataFileName, mCache->getFileAPRPool(),
551 mWriteData, offset, size);
552
553 if (bytes_written <= 0)
554 {
555 llwarns << "LLTextureCacheWorker: missing entry: " << mID << llendl;
556 mDataSize = -1; // failed
557 return true;
558 }
559
560 if (mDataSize <= size)
561 {
562 return true; // done
563 }
564 else
565 {
566 mState = BODY;
567 }
568#endif
569 }
570
571 if (mState == BODY)
572 {
573#if USE_LFS_WRITE
574 if (mFileHandle == LLLFSThread::nullHandle())
575 {
576 S32 data_offset = TEXTURE_CACHE_ENTRY_SIZE - mOffset;
577 data_offset = llmax(data_offset, 0);
578 S32 file_size = mDataSize - data_offset;
579 S32 file_offset = mOffset - TEXTURE_CACHE_ENTRY_SIZE;
580 file_offset = llmax(file_offset, 0);
581 if (file_size > 0 && mCache->appendToTextureEntryList(mID, file_size))
582 {
583 std::string filename = mCache->getTextureFileName(mID);
584 mBytesRead = -1;
585 mBytesToRead = file_size;
586 setPriority(LLWorkerThread::PRIORITY_LOW | mPriority);
587 mFileHandle = LLLFSThread::sLocal->write(filename,
588 mWriteData + data_offset, file_offset, mBytesToRead,
589 new WriteResponder(mCache, mRequestHandle));
590 return false;
591 }
592 else
593 {
594 mDataSize = 0; // no data written
595 return true; // done
596 }
597 }
598 else
599 {
600 if (mBytesRead >= 0)
601 {
602 if (mBytesRead != mBytesToRead)
603 {
604 llwarns << "LLTextureCacheWorker: " << mID
605 << " incorrect number of bytes written to body: " << mBytesRead
606 << " != " << mBytesToRead << llendl;
607 mDataSize = -1; // failed
608 }
609 return true;
610 }
611 else
612 {
613 return false;
614 }
615 }
616#else
617 S32 data_offset = TEXTURE_CACHE_ENTRY_SIZE - mOffset;
618 data_offset = llmax(data_offset, 0);
619 S32 file_size = mDataSize - data_offset;
620 S32 file_offset = mOffset - TEXTURE_CACHE_ENTRY_SIZE;
621 file_offset = llmax(file_offset, 0);
622 S32 bytes_written = 0;
623 if (file_size > 0 && mCache->appendToTextureEntryList(mID, file_size))
624 {
625 std::string filename = mCache->getTextureFileName(mID);
626 bytes_written = ll_apr_file_write_ex(filename, mCache->getFileAPRPool(),
627 mWriteData + data_offset,
628 file_offset, file_size);
629 if (bytes_written <= 0)
630 {
631 mDataSize = -1; // failed
632 }
633 }
634 else
635 {
636 mDataSize = 0; // no data written
637 }
638
639 return true;
640#endif
641 }
642
643 return false;
644}
645
646//virtual
647bool LLTextureCacheWorker::doWork(S32 param)
648{
649 bool res = false;
650 if (param == 0) // read
651 {
652 res = doRead();
653 }
654 else if (param == 1) // write
655 {
656 res = doWrite();
657 }
658 else
659 {
660 llassert_always(0);
661 }
662 return res;
663}
664
665//virtual (WORKER THREAD)
666void LLTextureCacheWorker::finishWork(S32 param, bool completed)
667{
668 if (mResponder.notNull())
669 {
670 bool success = (completed && mDataSize > 0);
671 if (param == 0)
672 {
673 // read
674 if (success)
675 {
676 mResponder->setData(mReadData, mDataSize, mImageSize, mImageFormat, mImageLocal);
677 mReadData = NULL; // responder owns data
678 mDataSize = 0;
679 }
680 else
681 {
682 delete[] mReadData;
683 mReadData = NULL;
684
685 }
686 }
687 else
688 {
689 // write
690 mWriteData = NULL; // we never owned data
691 mDataSize = 0;
692 }
693 mCache->addCompleted(mResponder, success);
694 }
695}
696
697//virtual (MAIN THREAD)
698void LLTextureCacheWorker::endWork(S32 param, bool aborted)
699{
700 if (aborted)
701 {
702 // Let the destructor handle any cleanup
703 return;
704 }
705 switch(param)
706 {
707 default:
708 case 0: // read
709 case 1: // write
710 {
711 if (mDataSize < 0)
712 {
713 // failed
714 mCache->removeFromCache(mID);
715 }
716 break;
717 }
718 }
719}
720
721//////////////////////////////////////////////////////////////////////////////
722
723LLTextureCache::LLTextureCache(bool threaded)
724 : LLWorkerThread("TextureCache", threaded),
725 mWorkersMutex(getAPRPool()),
726 mHeaderMutex(getAPRPool()),
727 mListMutex(getAPRPool()),
728 mFileAPRPool(NULL),
729 mReadOnly(FALSE),
730 mTexturesSizeTotal(0),
731 mDoPurge(FALSE)
732{
733 apr_pool_create(&mFileAPRPool, NULL);
734}
735
736LLTextureCache::~LLTextureCache()
737{
738 apr_pool_destroy(mFileAPRPool);
739}
740
741//////////////////////////////////////////////////////////////////////////////
742
743//virtual
744S32 LLTextureCache::update(U32 max_time_ms)
745{
746 S32 res;
747 res = LLWorkerThread::update(max_time_ms);
748
749 mListMutex.lock();
750 handle_list_t priorty_list = mPrioritizeWriteList; // copy list
751 mPrioritizeWriteList.clear();
752 responder_list_t completed_list = mCompletedList; // copy list
753 mCompletedList.clear();
754 mListMutex.unlock();
755
756 lockWorkers();
757
758 for (handle_list_t::iterator iter1 = priorty_list.begin();
759 iter1 != priorty_list.end(); ++iter1)
760 {
761 handle_t handle = *iter1;
762 handle_map_t::iterator iter2 = mWriters.find(handle);
763 if(iter2 != mWriters.end())
764 {
765 LLTextureCacheWorker* worker = iter2->second;
766 worker->setPriority(LLWorkerThread::PRIORITY_HIGH | worker->mPriority);
767 }
768 }
769
770 for (responder_list_t::iterator iter1 = completed_list.begin();
771 iter1 != completed_list.end(); ++iter1)
772 {
773 Responder *responder = iter1->first;
774 bool success = iter1->second;
775 responder->completed(success);
776 }
777
778 unlockWorkers();
779
780 return res;
781}
782
783//////////////////////////////////////////////////////////////////////////////
784
785std::string LLTextureCache::getLocalFileName(const LLUUID& id)
786{
787 // Does not include extension
788 std::string idstr = id.asString();
789 std::string filename = gDirUtilp->getExpandedFilename(LL_PATH_SKINS, "textures", idstr);
790 return filename;
791}
792
793std::string LLTextureCache::getTextureFileName(const LLUUID& id)
794{
795 std::string idstr = id.asString();
796 std::string delem = gDirUtilp->getDirDelimiter();
797 std::string filename = mTexturesDirName + delem + idstr[0] + delem + idstr;
798 return filename;
799}
800
801bool LLTextureCache::appendToTextureEntryList(const LLUUID& id, S32 bodysize)
802{
803 bool res = false;
804 bool purge = false;
805 // Append UUID to end of texture entries
806 {
807 LLMutexLock lock(&mHeaderMutex);
808 size_map_t::iterator iter = mTexturesSizeMap.find(id);
809 if (iter == mTexturesSizeMap.end() || iter->second < bodysize)
810 {
811 llassert_always(bodysize > 0);
812 Entry* entry = new Entry(id, bodysize, time(NULL));
813 ll_apr_file_write_ex(mTexturesDirEntriesFileName, getFileAPRPool(),
814 (U8*)entry, -1, 1*sizeof(Entry));
815 delete entry;
816 if (iter != mTexturesSizeMap.end())
817 {
818 mTexturesSizeTotal -= iter->second;
819 }
820 mTexturesSizeTotal += bodysize;
821 mTexturesSizeMap[id] = bodysize;
822 if (mTexturesSizeTotal > sCacheMaxTexturesSize)
823 {
824 purge = true;
825 }
826 res = true;
827 }
828 }
829 if (purge)
830 {
831 mDoPurge = TRUE;
832 }
833 return res;
834}
835
836//////////////////////////////////////////////////////////////////////////////
837
838//static
839const S32 MAX_REASONABLE_FILE_SIZE = 512*1024*1024; // 512 MB
840F32 LLTextureCache::sHeaderCacheVersion = 1.0f;
841U32 LLTextureCache::sCacheMaxEntries = MAX_REASONABLE_FILE_SIZE / TEXTURE_CACHE_ENTRY_SIZE;
842S64 LLTextureCache::sCacheMaxTexturesSize = 0; // no limit
843const char* entries_filename = "texture.entries";
844const char* cache_filename = "texture.cache";
845const char* textures_dirname = "textures";
846
847void LLTextureCache::setDirNames(ELLPath location)
848{
849 std::string delem = gDirUtilp->getDirDelimiter();
850 mHeaderEntriesFileName = gDirUtilp->getExpandedFilename(location, entries_filename);
851 mHeaderDataFileName = gDirUtilp->getExpandedFilename(location, cache_filename);
852 mTexturesDirName = gDirUtilp->getExpandedFilename(location, textures_dirname);
853 mTexturesDirEntriesFileName = mTexturesDirName + delem + entries_filename;
854}
855
856void LLTextureCache::purgeCache(ELLPath location)
857{
858 if (!mReadOnly)
859 {
860 setDirNames(location);
861
862 ll_apr_file_remove(mHeaderEntriesFileName, NULL);
863 ll_apr_file_remove(mHeaderDataFileName, NULL);
864 }
865 purgeAllTextures(true);
866}
867
868S64 LLTextureCache::initCache(ELLPath location, S64 max_size, BOOL read_only)
869{
870 mReadOnly = read_only;
871
872 S64 header_size = (max_size * 2) / 10;
873 S64 max_entries = header_size / TEXTURE_CACHE_ENTRY_SIZE;
874 sCacheMaxEntries = (S32)(llmin((S64)sCacheMaxEntries, max_entries));
875 header_size = sCacheMaxEntries * TEXTURE_CACHE_ENTRY_SIZE;
876 max_size -= header_size;
877 if (sCacheMaxTexturesSize > 0)
878 sCacheMaxTexturesSize = llmin(sCacheMaxTexturesSize, max_size);
879 else
880 sCacheMaxTexturesSize = max_size;
881 max_size -= sCacheMaxTexturesSize;
882
883 llinfos << "TEXTURE CACHE: Headers: " << sCacheMaxEntries
884 << " Textures size: " << sCacheMaxTexturesSize/(1024*1024) << " MB" << llendl;
885
886 setDirNames(location);
887
888 if (!mReadOnly)
889 {
890 LLFile::mkdir(mTexturesDirName.c_str());
891 const char* subdirs = "0123456789abcdef";
892 for (S32 i=0; i<16; i++)
893 {
894 std::string dirname = mTexturesDirName + gDirUtilp->getDirDelimiter() + subdirs[i];
895 LLFile::mkdir(dirname.c_str());
896 }
897 }
898 readHeaderCache();
899 purgeTextures(true); // calc mTexturesSize and make some room in the texture cache if we need it
900
901 return max_size; // unused cache space
902}
903
904struct lru_data
905{
906 lru_data(U32 t, S32 i, const LLUUID& id) { time=t; index=i; uuid=id; }
907 U32 time;
908 S32 index;
909 LLUUID uuid;
910 struct Compare
911 {
912 // lhs < rhs
913 typedef const lru_data* lru_data_ptr;
914 bool operator()(const lru_data_ptr& a, const lru_data_ptr& b) const
915 {
916 if (!(a->time < b->time))
917 return true;
918 else if (!(b->time < a->time))
919 return false;
920 else
921 return a->index < b->index;
922 }
923 };
924};
925
926// Called from either the main thread or the worker thread
927void LLTextureCache::readHeaderCache(apr_pool_t* poolp)
928{
929 LLMutexLock lock(&mHeaderMutex);
930 mHeaderEntriesInfo.mVersion = 0.f;
931 mHeaderEntriesInfo.mEntries = 0;
932 if (ll_apr_file_exists(mHeaderEntriesFileName, poolp))
933 {
934 ll_apr_file_read_ex(mHeaderEntriesFileName, poolp,
935 (U8*)&mHeaderEntriesInfo, 0, sizeof(EntriesInfo));
936 }
937 if (mHeaderEntriesInfo.mVersion != sHeaderCacheVersion)
938 {
939 if (!mReadOnly)
940 {
941 // Info with 0 entries
942 mHeaderEntriesInfo.mVersion = sHeaderCacheVersion;
943 ll_apr_file_write_ex(mHeaderEntriesFileName, poolp,
944 (U8*)&mHeaderEntriesInfo, 0, sizeof(EntriesInfo));
945 }
946 }
947 else
948 {
949 S32 num_entries = mHeaderEntriesInfo.mEntries;
950 if (num_entries)
951 {
952 Entry* entries = new Entry[num_entries];
953 ll_apr_file_read_ex(mHeaderEntriesFileName, poolp,
954 (U8*)entries, sizeof(EntriesInfo), num_entries*sizeof(Entry));
955 typedef std::set<lru_data*, lru_data::Compare> lru_set_t;
956 lru_set_t lru;
957 for (S32 i=0; i<num_entries; i++)
958 {
959 if (entries[i].mSize >= 0) // -1 indicates erased entry, skip
960 {
961 const LLUUID& id = entries[i].mID;
962 lru.insert(new lru_data(entries[i].mTime, i, id));
963 mHeaderIDMap[id] = i;
964 }
965 }
966 mLRU.clear();
967 S32 lru_entries = sCacheMaxEntries / 10;
968 for (lru_set_t::iterator iter = lru.begin(); iter != lru.end(); ++iter)
969 {
970 lru_data* data = *iter;
971 mLRU[data->index] = data->uuid;
972 if (--lru_entries <= 0)
973 break;
974 }
975 for_each(lru.begin(), lru.end(), DeletePointer());
976 delete[] entries;
977 }
978 }
979}
980
981//////////////////////////////////////////////////////////////////////////////
982
983void LLTextureCache::purgeAllTextures(bool purge_directories)
984{
985 if (!mReadOnly)
986 {
987 const char* subdirs = "0123456789abcdef";
988 std::string delem = gDirUtilp->getDirDelimiter();
989 std::string mask = delem + "*";
990 for (S32 i=0; i<16; i++)
991 {
992 std::string dirname = mTexturesDirName + delem + subdirs[i];
993 gDirUtilp->deleteFilesInDir(dirname.c_str(),mask);
994 if (purge_directories)
995 {
996 LLFile::rmdir(dirname.c_str());
997 }
998 }
999 ll_apr_file_remove(mTexturesDirEntriesFileName, NULL);
1000 if (purge_directories)
1001 {
1002 LLFile::rmdir(mTexturesDirName.c_str());
1003 }
1004 }
1005 mTexturesSizeMap.clear();
1006}
1007
1008void LLTextureCache::purgeTextures(bool validate)
1009{
1010 if (mReadOnly)
1011 {
1012 return;
1013 }
1014
1015 LLMutexLock lock(&mHeaderMutex);
1016
1017 S32 filesize = ll_apr_file_size(mTexturesDirEntriesFileName, NULL);
1018 S32 num_entries = filesize / sizeof(Entry);
1019 if (num_entries * (S32)sizeof(Entry) != filesize)
1020 {
1021 llwarns << "Bad cache file: " << mTexturesDirEntriesFileName << " Purging." << llendl;
1022 purgeAllTextures(false);
1023 return;
1024 }
1025 if (num_entries == 0)
1026 {
1027 return; // nothing to do
1028 }
1029
1030 Entry* entries = new Entry[num_entries];
1031 S32 bytes_read = ll_apr_file_read_ex(mTexturesDirEntriesFileName, NULL,
1032 (U8*)entries, 0, num_entries*sizeof(Entry));
1033 if (bytes_read != filesize)
1034 {
1035 llwarns << "Bad cache file (2): " << mTexturesDirEntriesFileName << " Purging." << llendl;
1036 purgeAllTextures(false);
1037 return;
1038 }
1039
1040 llinfos << "TEXTURE CACHE: Reading Entries..." << llendl;
1041
1042 std::map<LLUUID, S32> entry_idx_map;
1043 S64 total_size = 0;
1044 for (S32 idx=0; idx<num_entries; idx++)
1045 {
1046 const LLUUID& id = entries[idx].mID;
1047// llinfos << "Entry: " << id << " Size: " << entries[i].mSize << " Time: " << entries[i].mTime << llendl;
1048 std::map<LLUUID, S32>::iterator iter = entry_idx_map.find(id);
1049 if (iter != entry_idx_map.end())
1050 {
1051 // Newer entry replacing older entry
1052 S32 pidx = iter->second;
1053 total_size -= entries[pidx].mSize;
1054 entries[pidx].mSize = 0; // flag: skip older entry
1055 }
1056 entry_idx_map[id] = idx;
1057 total_size += entries[idx].mSize;
1058 }
1059
1060 U32 validate_idx = 0;
1061 if (validate)
1062 {
1063 validate_idx = gSavedSettings.getU32("CacheValidateCounter");
1064 U32 next_idx = (++validate_idx) % 256;
1065 gSavedSettings.setU32("CacheValidateCounter", next_idx);
1066 llinfos << "TEXTURE CACHE: Validating: " << validate_idx << llendl;
1067 }
1068
1069 S64 min_cache_size = (sCacheMaxTexturesSize * 9) / 10;
1070 S32 purge_count = 0;
1071 S32 next_idx = 0;
1072 for (S32 idx=0; idx<num_entries; idx++)
1073 {
1074 if (entries[idx].mSize == 0)
1075 {
1076 continue;
1077 }
1078 bool purge_entry = false;
1079 std::string filename = getTextureFileName(entries[idx].mID);
1080 if (total_size >= min_cache_size)
1081 {
1082 purge_entry = true;
1083 }
1084 else if (validate)
1085 {
1086 // make sure file exists and is the correct size
1087 S32 uuididx = entries[idx].mID.mData[0];
1088 if (uuididx == validate_idx)
1089 {
1090// llinfos << "Validating: " << filename << "Size: " << entries[idx].mSize << llendl;
1091 S32 bodysize = ll_apr_file_size(filename, NULL);
1092 if (bodysize != entries[idx].mSize)
1093 {
1094 llwarns << "TEXTURE CACHE BODY HAS BAD SIZE: " << bodysize << " != " << entries[idx].mSize
1095 << filename << llendl;
1096 purge_entry = true;
1097 }
1098 }
1099 }
1100 if (purge_entry)
1101 {
1102 purge_count++;
1103// llinfos << "PURGING: " << filename << llendl;
1104 ll_apr_file_remove(filename, NULL);
1105 total_size -= entries[idx].mSize;
1106 entries[idx].mSize = 0;
1107 }
1108 else
1109 {
1110 if (next_idx != idx)
1111 {
1112 entries[next_idx] = entries[idx];
1113 }
1114 ++next_idx;
1115 }
1116 }
1117 num_entries = next_idx;
1118
1119 llinfos << "TEXTURE CACHE: Writing Entries: " << num_entries << llendl;
1120
1121 ll_apr_file_remove(mTexturesDirEntriesFileName, NULL);
1122 ll_apr_file_write_ex(mTexturesDirEntriesFileName, NULL,
1123 (U8*)&entries[0], 0, num_entries*sizeof(Entry));
1124
1125 mTexturesSizeTotal = 0;
1126 mTexturesSizeMap.clear();
1127 for (S32 idx=0; idx<num_entries; idx++)
1128 {
1129 mTexturesSizeMap[entries[idx].mID] = entries[idx].mSize;
1130 mTexturesSizeTotal += entries[idx].mSize;
1131 }
1132 llassert(mTexturesSizeTotal == total_size);
1133
1134 delete[] entries;
1135
1136 llinfos << "TEXTURE CACHE:"
1137 << " PURGED: " << purge_count
1138 << " ENTRIES: " << num_entries
1139 << " CACHE SIZE: " << total_size / 1024*1024 << " MB"
1140 << llendl;
1141}
1142
1143//////////////////////////////////////////////////////////////////////////////
1144
1145// call lockWorkers() first!
1146LLTextureCacheWorker* LLTextureCache::getReader(handle_t handle)
1147{
1148 LLTextureCacheWorker* res = NULL;
1149 handle_map_t::iterator iter = mReaders.find(handle);
1150 if (iter != mReaders.end())
1151 {
1152 res = iter->second;
1153 }
1154 return res;
1155}
1156
1157LLTextureCacheWorker* LLTextureCache::getWriter(handle_t handle)
1158{
1159 LLTextureCacheWorker* res = NULL;
1160 handle_map_t::iterator iter = mWriters.find(handle);
1161 if (iter != mWriters.end())
1162 {
1163 res = iter->second;
1164 }
1165 return res;
1166}
1167
1168//////////////////////////////////////////////////////////////////////////////
1169
1170// Called from work thread
1171S32 LLTextureCache::getHeaderCacheEntry(const LLUUID& id, bool touch, S32* imagesize)
1172{
1173 bool retry = false;
1174 S32 idx = -1;
1175
1176 {
1177 LLMutexLock lock(&mHeaderMutex);
1178 id_map_t::iterator iter = mHeaderIDMap.find(id);
1179 if (iter != mHeaderIDMap.end())
1180 {
1181 idx = iter->second;
1182 }
1183 else if (touch && !mReadOnly)
1184 {
1185 if (mHeaderEntriesInfo.mEntries < sCacheMaxEntries)
1186 {
1187 // Add an entry
1188 idx = mHeaderEntriesInfo.mEntries++;
1189 mHeaderIDMap[id] = idx;
1190 // Update Info
1191 ll_apr_file_write_ex(mHeaderEntriesFileName, getFileAPRPool(),
1192 (U8*)&mHeaderEntriesInfo, 0, sizeof(EntriesInfo));
1193 }
1194 else if (!mLRU.empty())
1195 {
1196 idx = mLRU.begin()->first; // will be erased below
1197 const LLUUID& oldid = mLRU.begin()->second;
1198 mHeaderIDMap.erase(oldid);
1199 mTexturesSizeMap.erase(oldid);
1200 mHeaderIDMap[id] = idx;
1201 }
1202 else
1203 {
1204 idx = -1;
1205 retry = true;
1206 }
1207 }
1208 if (idx >= 0)
1209 {
1210 if (touch && !mReadOnly)
1211 {
1212 // Update the lru entry
1213 mLRU.erase(idx);
1214 llassert_always(imagesize && *imagesize > 0);
1215 Entry* entry = new Entry(id, *imagesize, time(NULL));
1216 S32 offset = sizeof(EntriesInfo) + idx * sizeof(Entry);
1217 ll_apr_file_write_ex(mHeaderEntriesFileName, getFileAPRPool(),
1218 (U8*)entry, offset, sizeof(Entry));
1219 delete entry;
1220 }
1221 else if (imagesize)
1222 {
1223 // Get the image size
1224 Entry entry;
1225 S32 offset = sizeof(EntriesInfo) + idx * sizeof(Entry);
1226 ll_apr_file_read_ex(mHeaderEntriesFileName, getFileAPRPool(),
1227 (U8*)&entry, offset, sizeof(Entry));
1228 *imagesize = entry.mSize;
1229 }
1230 }
1231 }
1232 if (retry)
1233 {
1234 readHeaderCache(getFileAPRPool()); // updates the lru
1235 llassert_always(!mLRU.empty() || mHeaderEntriesInfo.mEntries < sCacheMaxEntries);
1236 idx = getHeaderCacheEntry(id, touch, imagesize); // assert above ensures no inf. recursion
1237 }
1238 return idx;
1239}
1240
1241//////////////////////////////////////////////////////////////////////////////
1242
1243// Calls from texture pipeline thread (i.e. LLTextureFetch)
1244
1245LLTextureCache::handle_t LLTextureCache::readFromCache(const LLUUID& id, U32 priority,
1246 S32 offset, S32 size, ReadResponder* responder)
1247{
1248 // Note: checking to see if an entry exists can cause a stall,
1249 // so let the thread handle it
1250 LLMutexLock lock(&mWorkersMutex);
1251 LLTextureCacheWorker* worker = new LLTextureCacheWorker(this, priority, id,
1252 NULL, size, offset, 0,
1253 responder);
1254 handle_t handle = worker->read();
1255 mReaders[handle] = worker;
1256 return handle;
1257}
1258
1259bool LLTextureCache::readComplete(handle_t handle, bool abort)
1260{
1261 lockWorkers();
1262 handle_map_t::iterator iter = mReaders.find(handle);
1263 llassert_always(iter != mReaders.end());
1264 LLTextureCacheWorker* worker = iter->second;
1265 bool res = worker->complete();
1266 if (res || abort)
1267 {
1268 mReaders.erase(handle);
1269 unlockWorkers();
1270 worker->scheduleDelete();
1271 return true;
1272 }
1273 else
1274 {
1275 unlockWorkers();
1276 return false;
1277 }
1278}
1279
1280LLTextureCache::handle_t LLTextureCache::writeToCache(const LLUUID& id, U32 priority,
1281 U8* data, S32 datasize, S32 imagesize,
1282 WriteResponder* responder)
1283{
1284 if (mReadOnly)
1285 {
1286 return LLWorkerThread::nullHandle();
1287 }
1288 if (mDoPurge)
1289 {
1290 // NOTE: This may cause an occasional hiccup,
1291 // but it really needs to be done on the control thread
1292 // (i.e. here)
1293 purgeTextures(false);
1294 mDoPurge = FALSE;
1295 }
1296 if (datasize >= TEXTURE_CACHE_ENTRY_SIZE)
1297 {
1298 LLMutexLock lock(&mWorkersMutex);
1299 llassert_always(imagesize > 0);
1300 LLTextureCacheWorker* worker = new LLTextureCacheWorker(this, priority, id,
1301 data, datasize, 0,
1302 imagesize, responder);
1303 handle_t handle = worker->write();
1304 mWriters[handle] = worker;
1305 return handle;
1306 }
1307 return LLWorkerThread::nullHandle();
1308}
1309
1310bool LLTextureCache::writeComplete(handle_t handle, bool abort)
1311{
1312 lockWorkers();
1313 handle_map_t::iterator iter = mWriters.find(handle);
1314 llassert_always(iter != mWriters.end());
1315 LLTextureCacheWorker* worker = iter->second;
1316 if (worker->complete() || abort)
1317 {
1318 mWriters.erase(handle);
1319 unlockWorkers();
1320 worker->scheduleDelete();
1321 return true;
1322 }
1323 else
1324 {
1325 unlockWorkers();
1326 return false;
1327 }
1328}
1329
1330void LLTextureCache::prioritizeWrite(handle_t handle)
1331{
1332 // Don't prioritize yet, we might be working on this now
1333 // which could create a deadlock
1334 LLMutexLock lock(&mListMutex);
1335 mPrioritizeWriteList.push_back(handle);
1336}
1337
1338void LLTextureCache::addCompleted(Responder* responder, bool success)
1339{
1340 LLMutexLock lock(&mListMutex);
1341 mCompletedList.push_back(std::make_pair(responder,success));
1342}
1343
1344//////////////////////////////////////////////////////////////////////////////
1345
1346// Called from MAIN thread (endWork())
1347
1348bool LLTextureCache::removeHeaderCacheEntry(const LLUUID& id)
1349{
1350 if (mReadOnly)
1351 {
1352 return false;
1353 }
1354 LLMutexLock lock(&mHeaderMutex);
1355 id_map_t::iterator iter = mHeaderIDMap.find(id);
1356 if (iter != mHeaderIDMap.end())
1357 {
1358 S32 idx = iter->second;
1359 if (idx >= 0)
1360 {
1361 Entry* entry = new Entry(id, -1, time(NULL));
1362 S32 offset = sizeof(EntriesInfo) + idx * sizeof(Entry);
1363 ll_apr_file_write_ex(mHeaderEntriesFileName, NULL,
1364 (U8*)entry, offset, sizeof(Entry));
1365 delete entry;
1366 mLRU[idx] = id;
1367 mHeaderIDMap.erase(id);
1368 mTexturesSizeMap.erase(id);
1369 return true;
1370 }
1371 }
1372 return false;
1373}
1374
1375void LLTextureCache::removeFromCache(const LLUUID& id)
1376{
1377 llwarns << "Removing texture from cache: " << id << llendl;
1378 if (!mReadOnly)
1379 {
1380 removeHeaderCacheEntry(id);
1381 ll_apr_file_remove(getTextureFileName(id), NULL);
1382 }
1383}
1384
1385//////////////////////////////////////////////////////////////////////////////
1386
1387LLTextureCache::ReadResponder::ReadResponder()
1388 : mImageSize(0),
1389 mImageLocal(FALSE)
1390{
1391}
1392
1393void LLTextureCache::ReadResponder::setData(U8* data, S32 datasize, S32 imagesize, S32 imageformat, BOOL imagelocal)
1394{
1395 if (mFormattedImage.notNull())
1396 {
1397 llassert_always(mFormattedImage->getCodec() == imageformat);
1398 mFormattedImage->appendData(data, datasize);
1399 }
1400 else
1401 {
1402 mFormattedImage = LLImageFormatted::createFromType(imageformat);
1403 mFormattedImage->setData(data,datasize);
1404 }
1405 mImageSize = imagesize;
1406 mImageLocal = imagelocal;
1407}
1408
1409//////////////////////////////////////////////////////////////////////////////
diff --git a/linden/indra/newview/lltexturecache.h b/linden/indra/newview/lltexturecache.h
new file mode 100644
index 0000000..ec20066
--- /dev/null
+++ b/linden/indra/newview/lltexturecache.h
@@ -0,0 +1,175 @@
1/**
2 * @file lltexturecache.h
3 * @brief Object for managing texture cachees.
4 *
5 * Copyright (c) 2000-2007, Linden Research, Inc.
6 *
7 * The source code in this file ("Source Code") is provided by Linden Lab
8 * to you under the terms of the GNU General Public License, version 2.0
9 * ("GPL"), unless you have obtained a separate licensing agreement
10 * ("Other License"), formally executed by you and Linden Lab. Terms of
11 * the GPL can be found in doc/GPL-license.txt in this distribution, or
12 * online at http://secondlife.com/developers/opensource/gplv2
13 *
14 * There are special exceptions to the terms and conditions of the GPL as
15 * it is applied to this Source Code. View the full text of the exception
16 * in the file doc/FLOSS-exception.txt in this software distribution, or
17 * online at http://secondlife.com/developers/opensource/flossexception
18 *
19 * By copying, modifying or distributing this software, you acknowledge
20 * that you have read and understood your obligations described above,
21 * and agree to abide by those obligations.
22 *
23 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
24 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
25 * COMPLETENESS OR PERFORMANCE.
26 */
27
28#ifndef LL_LLTEXTURECACHE_
29#define LL_LLTEXTURECACHE_H
30
31#include "lldir.h"
32#include "llstl.h"
33#include "llstring.h"
34#include "lluuid.h"
35
36#include "llworkerthread.h"
37
38class LLTextureCacheWorker;
39
40class LLTextureCache : public LLWorkerThread
41{
42 friend class LLTextureCacheWorker;
43
44public:
45
46 class Responder : public LLResponder
47 {
48 public:
49 virtual void setData(U8* data, S32 datasize, S32 imagesize, S32 imageformat, BOOL imagelocal) = 0;
50 };
51
52 class ReadResponder : public Responder
53 {
54 public:
55 ReadResponder();
56 void setData(U8* data, S32 datasize, S32 imagesize, S32 imageformat, BOOL imagelocal);
57 void setImage(LLImageFormatted* image) { mFormattedImage = image; }
58 protected:
59 LLPointer<LLImageFormatted> mFormattedImage;
60 S32 mImageSize;
61 BOOL mImageLocal;
62 };
63
64 class WriteResponder : public Responder
65 {
66 void setData(U8* data, S32 datasize, S32 imagesize, S32 imageformat, BOOL imagelocal)
67 {
68 // not used
69 }
70 };
71
72 LLTextureCache(bool threaded);
73 ~LLTextureCache();
74
75 /*virtual*/ S32 update(U32 max_time_ms);
76
77 void purgeCache(ELLPath location);
78 S64 initCache(ELLPath location, S64 maxsize, BOOL read_only);
79
80 handle_t readFromCache(const LLUUID& id, U32 priority, S32 offset, S32 size,
81 ReadResponder* responder);
82 bool readComplete(handle_t handle, bool abort);
83 handle_t writeToCache(const LLUUID& id, U32 priority, U8* data, S32 datasize, S32 imagesize,
84 WriteResponder* responder);
85 bool writeComplete(handle_t handle, bool abort = false);
86 void prioritizeWrite(handle_t handle);
87
88 void removeFromCache(const LLUUID& id);
89
90 // For LLTextureCacheWorker::Responder
91 LLTextureCacheWorker* getReader(handle_t handle);
92 LLTextureCacheWorker* getWriter(handle_t handle);
93 void lockWorkers() { mWorkersMutex.lock(); }
94 void unlockWorkers() { mWorkersMutex.unlock(); }
95
96 // debug
97 S32 getNumReads() { return mReaders.size(); }
98 S32 getNumWrites() { return mWriters.size(); }
99
100protected:
101 // Accessed by LLTextureCacheWorker
102 apr_pool_t* getFileAPRPool() { return mFileAPRPool; }
103 bool appendToTextureEntryList(const LLUUID& id, S32 size);
104 std::string getLocalFileName(const LLUUID& id);
105 std::string getTextureFileName(const LLUUID& id);
106 void addCompleted(Responder* responder, bool success);
107
108private:
109 void setDirNames(ELLPath location);
110 void readHeaderCache(apr_pool_t* poolp = NULL);
111 void purgeAllTextures(bool purge_directories);
112 void purgeTextures(bool validate);
113 S32 getHeaderCacheEntry(const LLUUID& id, bool touch, S32* imagesize = NULL);
114 bool removeHeaderCacheEntry(const LLUUID& id);
115 void lockHeaders() { mHeaderMutex.lock(); }
116 void unlockHeaders() { mHeaderMutex.unlock(); }
117
118private:
119 // Internal
120 LLMutex mWorkersMutex;
121 LLMutex mHeaderMutex;
122 LLMutex mListMutex;
123 apr_pool_t* mFileAPRPool;
124
125 typedef std::map<handle_t, LLTextureCacheWorker*> handle_map_t;
126 handle_map_t mReaders;
127 handle_map_t mWriters;
128
129 typedef std::vector<handle_t> handle_list_t;
130 handle_list_t mPrioritizeWriteList;
131
132 typedef std::vector<std::pair<LLPointer<Responder>, bool> > responder_list_t;
133 responder_list_t mCompletedList;
134
135 BOOL mReadOnly;
136
137 // Entries
138 struct EntriesInfo
139 {
140 F32 mVersion;
141 U32 mEntries;
142 };
143 struct Entry
144 {
145 Entry() {}
146 Entry(const LLUUID& id, S32 size, U32 time) : mID(id), mSize(size), mTime(time) {}
147 LLUUID mID; // 128 bits
148 S32 mSize; // total size of image if known (NOT size cached)
149 U32 mTime; // seconds since 1/1/1970
150 };
151
152 // HEADERS (Include first mip)
153 std::string mHeaderEntriesFileName;
154 std::string mHeaderDataFileName;
155 EntriesInfo mHeaderEntriesInfo;
156 typedef std::map<S32,LLUUID> index_map_t;
157 index_map_t mLRU; // index, id; stored as a map for fast removal
158 typedef std::map<LLUUID,S32> id_map_t;
159 id_map_t mHeaderIDMap;
160
161 // BODIES (TEXTURES minus headers)
162 std::string mTexturesDirName;
163 std::string mTexturesDirEntriesFileName;
164 typedef std::map<LLUUID,S32> size_map_t;
165 size_map_t mTexturesSizeMap;
166 S64 mTexturesSizeTotal;
167 LLAtomic32<BOOL> mDoPurge;
168
169 // Statics
170 static F32 sHeaderCacheVersion;
171 static U32 sCacheMaxEntries;
172 static S64 sCacheMaxTexturesSize;
173};
174
175#endif // LL_LLTEXTURECACHE_H
diff --git a/linden/indra/newview/lltexturectrl.cpp b/linden/indra/newview/lltexturectrl.cpp
index 9edd0ad..666b5d2 100644
--- a/linden/indra/newview/lltexturectrl.cpp
+++ b/linden/indra/newview/lltexturectrl.cpp
@@ -114,6 +114,7 @@ public:
114 EAcceptance *accept, 114 EAcceptance *accept,
115 LLString& tooltip_msg); 115 LLString& tooltip_msg);
116 virtual void draw(); 116 virtual void draw();
117 virtual BOOL handleKeyHere(KEY key, MASK mask, BOOL called_from_parent);
117 118
118 // LLFloater overrides 119 // LLFloater overrides
119 virtual void onClose(bool app_quitting); 120 virtual void onClose(bool app_quitting);
@@ -175,6 +176,7 @@ protected:
175 BOOL mCanApplyImmediately; 176 BOOL mCanApplyImmediately;
176 BOOL mNoCopyTextureSelected; 177 BOOL mNoCopyTextureSelected;
177 F32 mContextConeOpacity; 178 F32 mContextConeOpacity;
179 LLSaveFolderState mSavedFolderState;
178}; 180};
179 181
180LLFloaterTexturePicker::LLFloaterTexturePicker( 182LLFloaterTexturePicker::LLFloaterTexturePicker(
@@ -229,12 +231,16 @@ LLFloaterTexturePicker::LLFloaterTexturePicker(
229 filter_types |= 0x1 << LLInventoryType::IT_TEXTURE; 231 filter_types |= 0x1 << LLInventoryType::IT_TEXTURE;
230 filter_types |= 0x1 << LLInventoryType::IT_SNAPSHOT; 232 filter_types |= 0x1 << LLInventoryType::IT_SNAPSHOT;
231 233
232 mInventoryPanel->setAutoSelectOverride(true);
233 mInventoryPanel->setFilterTypes(filter_types); 234 mInventoryPanel->setFilterTypes(filter_types);
234 mInventoryPanel->setFilterPermMask(getFilterPermMask()); 235 //mInventoryPanel->setFilterPermMask(getFilterPermMask()); //Commented out due to no-copy texture loss.
236 mInventoryPanel->setFilterPermMask(immediate_filter_perm_mask);
235 mInventoryPanel->setSelectCallback(onSelectionChange, this); 237 mInventoryPanel->setSelectCallback(onSelectionChange, this);
236 mInventoryPanel->setShowFolderState(LLInventoryFilter::SHOW_NON_EMPTY_FOLDERS); 238 mInventoryPanel->setShowFolderState(LLInventoryFilter::SHOW_NON_EMPTY_FOLDERS);
237 mInventoryPanel->setAllowMultiSelect(FALSE); 239 mInventoryPanel->setAllowMultiSelect(FALSE);
240
241 // store this filter as the default one
242 mInventoryPanel->getRootFolder()->getFilter()->markDefault();
243
238 // Commented out to stop opening all folders with textures 244 // Commented out to stop opening all folders with textures
239 // mInventoryPanel->openDefaultFolderForType(LLAssetType::AT_TEXTURE); 245 // mInventoryPanel->openDefaultFolderForType(LLAssetType::AT_TEXTURE);
240 246
@@ -262,6 +268,8 @@ LLFloaterTexturePicker::LLFloaterTexturePicker(
262 updateFilterPermMask(); 268 updateFilterPermMask();
263 269
264 setCanMinimize(FALSE); 270 setCanMinimize(FALSE);
271
272 mSavedFolderState.setApply(FALSE);
265} 273}
266 274
267LLFloaterTexturePicker::~LLFloaterTexturePicker() 275LLFloaterTexturePicker::~LLFloaterTexturePicker()
@@ -315,7 +323,7 @@ void LLFloaterTexturePicker::setCanApplyImmediately(BOOL b)
315 323
316void LLFloaterTexturePicker::stopUsingPipette() 324void LLFloaterTexturePicker::stopUsingPipette()
317{ 325{
318 if (gToolMgr && gToolMgr->getCurrentTool(gKeyboard->currentMask(TRUE)) == gToolPipette) 326 if (gToolMgr && gToolMgr->getCurrentTool() == gToolPipette)
319 { 327 {
320 gToolMgr->clearTransientTool(); 328 gToolMgr->clearTransientTool();
321 } 329 }
@@ -338,7 +346,8 @@ void LLFloaterTexturePicker::updateImageStats()
338 } 346 }
339 if (gAgent.isGodlike()) 347 if (gAgent.isGodlike())
340 { 348 {
341 LLString tstring = "Pick: " + mTexturep->getID().getString(); 349 LLString tstring = "Pick: ";
350 tstring.append(mTexturep->getID().asString());
342 setTitle(tstring); 351 setTitle(tstring);
343 } 352 }
344 } 353 }
@@ -368,7 +377,8 @@ BOOL LLFloaterTexturePicker::handleDragAndDrop(
368 if (mod) item_perm_mask |= PERM_MODIFY; 377 if (mod) item_perm_mask |= PERM_MODIFY;
369 if (xfer) item_perm_mask |= PERM_TRANSFER; 378 if (xfer) item_perm_mask |= PERM_TRANSFER;
370 379
371 PermissionMask filter_perm_mask = getFilterPermMask(); 380 //PermissionMask filter_perm_mask = getFilterPermMask(); Commented out due to no-copy texture loss.
381 PermissionMask filter_perm_mask = mImmediateFilterPermMask;
372 if ( (item_perm_mask & filter_perm_mask) == filter_perm_mask ) 382 if ( (item_perm_mask & filter_perm_mask) == filter_perm_mask )
373 { 383 {
374 if (drop) 384 if (drop)
@@ -395,6 +405,41 @@ BOOL LLFloaterTexturePicker::handleDragAndDrop(
395 return handled; 405 return handled;
396} 406}
397 407
408BOOL LLFloaterTexturePicker::handleKeyHere(KEY key, MASK mask, BOOL called_from_parent)
409{
410 LLFolderView* root_folder = mInventoryPanel->getRootFolder();
411
412 if (!called_from_parent && root_folder &&
413 mSearchEdit && mSearchEdit->hasFocus() &&
414 (key == KEY_RETURN || key == KEY_DOWN) && mask == MASK_NONE)
415 {
416 if (!root_folder->getCurSelectedItem())
417 {
418 LLFolderViewItem* itemp = root_folder->getItemByID(gAgent.getInventoryRootID());
419 if (itemp)
420 {
421 root_folder->setSelection(itemp, FALSE, FALSE);
422 }
423 }
424 root_folder->scrollToShowSelection();
425
426 // move focus to inventory proper
427 root_folder->setFocus(TRUE);
428
429 // treat this as a user selection of the first filtered result
430 commitIfImmediateSet();
431
432 return TRUE;
433 }
434
435 if (root_folder->hasFocus() && key == KEY_UP)
436 {
437 mSearchEdit->focusFirstItem(TRUE);
438 }
439
440 return LLFloater::handleKeyHere(key, mask, called_from_parent);
441}
442
398// virtual 443// virtual
399void LLFloaterTexturePicker::onClose(bool app_quitting) 444void LLFloaterTexturePicker::onClose(bool app_quitting)
400{ 445{
@@ -469,7 +514,7 @@ void LLFloaterTexturePicker::draw()
469 childSetEnabled("show_folders_check", mActive && mCanApplyImmediately && !mNoCopyTextureSelected); 514 childSetEnabled("show_folders_check", mActive && mCanApplyImmediately && !mNoCopyTextureSelected);
470 childSetEnabled("Select", mActive); 515 childSetEnabled("Select", mActive);
471 childSetEnabled("Pipette", gToolMgr != NULL && mActive); 516 childSetEnabled("Pipette", gToolMgr != NULL && mActive);
472 childSetValue("Pipette", gToolMgr && gToolMgr->getCurrentTool(gKeyboard->currentMask(TRUE)) == gToolPipette); 517 childSetValue("Pipette", gToolMgr && gToolMgr->getCurrentTool() == gToolPipette);
473 518
474 //RN: reset search bar to reflect actual search query (all caps, for example) 519 //RN: reset search bar to reflect actual search query (all caps, for example)
475 mSearchEdit->setText(mInventoryPanel->getFilterSubString()); 520 mSearchEdit->setText(mInventoryPanel->getFilterSubString());
@@ -747,60 +792,43 @@ void LLFloaterTexturePicker::onApplyImmediateCheck(LLUICtrl* ctrl, void *user_da
747 792
748void LLFloaterTexturePicker::updateFilterPermMask() 793void LLFloaterTexturePicker::updateFilterPermMask()
749{ 794{
750 mInventoryPanel->setFilterPermMask( getFilterPermMask() ); 795 //mInventoryPanel->setFilterPermMask( getFilterPermMask() ); Commented out due to no-copy texture loss.
751} 796}
752 797
753void LLFloaterTexturePicker::onSearchEdit(const LLString& search_string, void* user_data ) 798void LLFloaterTexturePicker::onSearchEdit(const LLString& search_string, void* user_data )
754{ 799{
755 LLFloaterTexturePicker* picker = (LLFloaterTexturePicker*)user_data; 800 LLFloaterTexturePicker* picker = (LLFloaterTexturePicker*)user_data;
756 801
757 std::string filter_text = search_string; 802 std::string upper_case_search_string = search_string;
758
759 if (filter_text.empty()&& picker->mInventoryPanel->getFilterSubString().empty())
760 {
761 // current filter and new filter empty, do nothing
762 return;
763 }
764 std::string upper_case_search_string = filter_text;
765 LLString::toUpper(upper_case_search_string); 803 LLString::toUpper(upper_case_search_string);
766 804
767 picker->mInventoryPanel->setFilterSubString(upper_case_search_string); 805 if (upper_case_search_string.empty())
768
769 LLFolderView* root_folder = picker->mInventoryPanel->getRootFolder();
770
771 //if (search_string.size())
772 //{
773 // LLSelectFirstFilteredItem filter;
774 // root_folder->applyFunctorRecursively(filter);
775 // //...and scroll to show it
776 // root_folder->scrollToShowSelection();
777 //}
778
779 KEY key = gKeyboard->currentKey();
780
781 if ((key == KEY_RETURN || key == KEY_DOWN) && gKeyboard->currentMask(FALSE) == MASK_NONE)
782 { 806 {
783 if (search_string.size()) 807 if (picker->mInventoryPanel->getFilterSubString().empty())
784 { 808 {
785 LLSelectFirstFilteredItem filter; 809 // current filter and new filter empty, do nothing
786 root_folder->applyFunctorRecursively(filter); 810 return;
787 //...and scroll to show it
788 root_folder->scrollToShowSelection();
789 } 811 }
790 812
791 if (!root_folder->getCurSelectedItem()) 813 picker->mSavedFolderState.setApply(TRUE);
814 picker->mInventoryPanel->getRootFolder()->applyFunctorRecursively(picker->mSavedFolderState);
815 // add folder with current item to list of previously opened folders
816 LLOpenFoldersWithSelection opener;
817 picker->mInventoryPanel->getRootFolder()->applyFunctorRecursively(opener);
818 picker->mInventoryPanel->getRootFolder()->scrollToShowSelection();
819
820 }
821 else if (picker->mInventoryPanel->getFilterSubString().empty())
822 {
823 // first letter in search term, save existing folder open state
824 if (!picker->mInventoryPanel->getRootFolder()->isFilterActive())
792 { 825 {
793 LLFolderViewItem* itemp = root_folder->getItemByID(gAgent.getInventoryRootID()); 826 picker->mSavedFolderState.setApply(FALSE);
794 if (itemp) 827 picker->mInventoryPanel->getRootFolder()->applyFunctorRecursively(picker->mSavedFolderState);
795 {
796 root_folder->setSelection(itemp, FALSE, FALSE);
797 }
798 } 828 }
799
800 // move focus to inventory proper
801 root_folder->setFocus(TRUE);
802 root_folder->scrollToShowSelection();
803 } 829 }
830
831 picker->mInventoryPanel->setFilterSubString(upper_case_search_string);
804} 832}
805 833
806//static 834//static
@@ -1039,7 +1067,7 @@ void LLTextureCtrl::showPicker(BOOL take_focus)
1039 // Show the dialog 1067 // Show the dialog
1040 if( floaterp ) 1068 if( floaterp )
1041 { 1069 {
1042 floaterp->open( ); 1070 floaterp->open( ); /* Flawfinder: ignore */
1043 } 1071 }
1044 else 1072 else
1045 { 1073 {
@@ -1060,7 +1088,7 @@ void LLTextureCtrl::showPicker(BOOL take_focus)
1060 mFloaterHandle = floaterp->getHandle(); 1088 mFloaterHandle = floaterp->getHandle();
1061 1089
1062 gFloaterView->getParentFloater(this)->addDependentFloater(floaterp); 1090 gFloaterView->getParentFloater(this)->addDependentFloater(floaterp);
1063 floaterp->open(); 1091 floaterp->open(); /* Flawfinder: ignore */
1064 } 1092 }
1065 1093
1066 if (take_focus) 1094 if (take_focus)
@@ -1270,8 +1298,9 @@ BOOL LLTextureCtrl::allowDrop(LLInventoryItem* item)
1270 if (mod) item_perm_mask |= PERM_MODIFY; 1298 if (mod) item_perm_mask |= PERM_MODIFY;
1271 if (xfer) item_perm_mask |= PERM_TRANSFER; 1299 if (xfer) item_perm_mask |= PERM_TRANSFER;
1272 1300
1273 PermissionMask filter_perm_mask = mCanApplyImmediately ? 1301// PermissionMask filter_perm_mask = mCanApplyImmediately ? commented out due to no-copy texture loss.
1274 mImmediateFilterPermMask : mNonImmediateFilterPermMask; 1302// mImmediateFilterPermMask : mNonImmediateFilterPermMask;
1303 PermissionMask filter_perm_mask = mImmediateFilterPermMask;
1275 if ( (item_perm_mask & filter_perm_mask) == filter_perm_mask ) 1304 if ( (item_perm_mask & filter_perm_mask) == filter_perm_mask )
1276 { 1305 {
1277 if(mDragCallback) 1306 if(mDragCallback)
diff --git a/linden/indra/newview/lltexturefetch.cpp b/linden/indra/newview/lltexturefetch.cpp
index 9344bbf..54b3f28 100644
--- a/linden/indra/newview/lltexturefetch.cpp
+++ b/linden/indra/newview/lltexturefetch.cpp
@@ -1,6 +1,6 @@
1/** 1/**
2 * @file llviewerimage.cpp 2 * @file lltexturecache.cpp
3 * @brief Object which handles a received image (and associated texture(s)) 3 * @brief Object which fetches textures from the cache and/or network
4 * 4 *
5 * Copyright (c) 2000-2007, Linden Research, Inc. 5 * Copyright (c) 2000-2007, Linden Research, Inc.
6 * 6 *
@@ -31,96 +31,290 @@
31 31
32#include "lltexturefetch.h" 32#include "lltexturefetch.h"
33 33
34#include "llworkerthread.h" 34#include "llcurl.h"
35#include "llhttpclient.h"
35#include "llimage.h" 36#include "llimage.h"
36#include "llvfs.h" 37#include "llimageworker.h"
38#include "llworkerthread.h"
37 39
40#include "llagent.h"
41#include "lltexturecache.h"
42#include "llviewerimagelist.h"
38#include "llviewerimage.h" 43#include "llviewerimage.h"
44#include "llviewerregion.h"
39#include "viewer.h" 45#include "viewer.h"
40 46
41////////////////////////////////////////////////////////////////////////////// 47//////////////////////////////////////////////////////////////////////////////
42 48
49//static
43class LLTextureFetchWorker : public LLWorkerClass 50class LLTextureFetchWorker : public LLWorkerClass
44{ 51{
45 friend class LLTextureFetchImpl; 52 friend class LLTextureFetch;
46
47public:
48 // From LLWorkerClass
49 static void initClass(bool threaded, bool runalways);
50 static void updateClass();
51 static void cleanupClass();
52
53 // New methods
54 static LLTextureFetchWorker* getWorker(const LLUUID& id, const LLHost& host,
55 F32 mPriority, S32 discard,
56 BOOL needs_aux = FALSE);
57 static LLTextureFetchWorker* getActiveWorker(const LLUUID& id);
58 53
59private: 54private:
60 static void sendRequestListToSimulators(); 55 class URLResponder : public LLHTTPClient::Responder
56 {
57 public:
58 URLResponder(LLTextureFetch* fetcher, const LLUUID& id)
59 : mFetcher(fetcher), mID(id)
60 {
61 }
62 ~URLResponder()
63 {
64 }
65 virtual void error(U32 status, const std::string& reason)
66 {
67 mFetcher->lockQueue();
68 LLTextureFetchWorker* worker = mFetcher->getWorker(mID);
69 if (worker)
70 {
71 llinfos << "LLTextureFetchWorker::URLResponder::error " << status << ": " << reason << llendl;
72 worker->callbackURLReceived(LLSD(), false);
73 }
74 mFetcher->unlockQueue();
75 }
76 virtual void result(const LLSD& content)
77 {
78 mFetcher->lockQueue();
79 LLTextureFetchWorker* worker = mFetcher->getWorker(mID);
80 if (worker)
81 {
82 worker->callbackURLReceived(content, true);
83 }
84 mFetcher->unlockQueue();
85 }
86 private:
87 LLTextureFetch* mFetcher;
88 LLUUID mID;
89 };
90
91 class HTTPGetResponder : public LLCurl::Responder
92 {
93 public:
94 HTTPGetResponder(LLTextureFetch* fetcher, const LLUUID& id)
95 : mFetcher(fetcher), mID(id)
96 {
97 }
98 ~HTTPGetResponder()
99 {
100 }
101 virtual void completed(U32 status, const std::stringstream& content)
102 {
103 mFetcher->lockQueue();
104 LLTextureFetchWorker* worker = mFetcher->getWorker(mID);
105 if (worker)
106 {
107 const std::string& cstr = content.str();
108 if (200 <= status && status < 300)
109 {
110 if (203 == status) // partial information (i.e. last block)
111 {
112 worker->callbackHttpGet((U8*)cstr.c_str(), cstr.length(), true);
113 }
114 else
115 {
116 worker->callbackHttpGet((U8*)cstr.c_str(), cstr.length(), false);
117 }
118 }
119 else
120 {
121 llinfos << "LLTextureFetchWorker::HTTPGetResponder::error " << status << ": " << cstr << llendl;
122 worker->callbackHttpGet(NULL, -1, true);
123 }
124 }
125 mFetcher->unlockQueue();
126 }
127 private:
128 LLTextureFetch* mFetcher;
129 LLUUID mID;
130 };
131
132 class CacheReadResponder : public LLTextureCache::ReadResponder
133 {
134 public:
135 CacheReadResponder(LLTextureFetch* fetcher, const LLUUID& id, LLImageFormatted* image)
136 : mFetcher(fetcher), mID(id)
137 {
138 setImage(image);
139 }
140 virtual void completed(bool success)
141 {
142 mFetcher->lockQueue();
143 LLTextureFetchWorker* worker = mFetcher->getWorker(mID);
144 if (worker)
145 {
146 worker->callbackCacheRead(success, mFormattedImage, mImageSize, mImageLocal);
147 }
148 mFetcher->unlockQueue();
149 }
150 private:
151 LLTextureFetch* mFetcher;
152 LLUUID mID;
153 };
154
155 class CacheWriteResponder : public LLTextureCache::WriteResponder
156 {
157 public:
158 CacheWriteResponder(LLTextureFetch* fetcher, const LLUUID& id)
159 : mFetcher(fetcher), mID(id)
160 {
161 }
162 virtual void completed(bool success)
163 {
164 mFetcher->lockQueue();
165 LLTextureFetchWorker* worker = mFetcher->getWorker(mID);
166 if (worker)
167 {
168 worker->callbackCacheWrite(success);
169 }
170 mFetcher->unlockQueue();
171 }
172 private:
173 LLTextureFetch* mFetcher;
174 LLUUID mID;
175 };
176
177 class DecodeResponder : public LLResponder
178 {
179 public:
180 DecodeResponder(LLTextureFetch* fetcher, const LLUUID& id, LLTextureFetchWorker* worker)
181 : mFetcher(fetcher), mID(id), mWorker(worker)
182 {
183 }
184 virtual void completed(bool success)
185 {
186 mFetcher->lockQueue();
187 LLTextureFetchWorker* worker = mFetcher->getWorker(mID);
188 if (worker)
189 {
190 worker->callbackDecoded(success);
191 }
192 mFetcher->unlockQueue();
193 }
194 private:
195 LLTextureFetch* mFetcher;
196 LLUUID mID;
197 LLTextureFetchWorker* mWorker; // debug only (may get deleted from under us, use mFetcher/mID)
198 };
199
200 struct Compare
201 {
202 // lhs < rhs
203 bool operator()(const LLTextureFetchWorker* lhs, const LLTextureFetchWorker* rhs) const
204 {
205 // greater priority is "less"
206 const F32 lpriority = lhs->mImagePriority;
207 const F32 rpriority = rhs->mImagePriority;
208 if (lpriority > rpriority) // higher priority
209 return true;
210 else if (lpriority < rpriority)
211 return false;
212 else
213 return lhs < rhs;
214 }
215 };
61 216
62public: 217public:
63 virtual bool doWork(S32 param); // Called from LLWorkerThread::processRequest() 218 /*virtual*/ bool doWork(S32 param); // Called from LLWorkerThread::processRequest()
219 /*virtual*/ void finishWork(S32 param, bool completed); // called from finishRequest() (WORK THREAD)
220 /*virtual*/ bool deleteOK(); // called from update() (WORK THREAD)
64 221
65 ~LLTextureFetchWorker(); 222 ~LLTextureFetchWorker();
66 void relese() { --mActiveCount; } 223 void relese() { --mActiveCount; }
67 224
68
69protected: 225protected:
70 LLTextureFetchWorker(const LLUUID& id, const LLHost& host, F32 mPriority, S32 discard); 226 LLTextureFetchWorker(LLTextureFetch* fetcher, const LLUUID& id, const LLHost& host,
227 F32 priority, S32 discard, S32 size);
71 228
72private: 229private:
73 virtual void startWork(S32 param); // called from addWork() (MAIN THREAD) 230 /*virtual*/ void startWork(S32 param); // called from addWork() (MAIN THREAD)
74 virtual void endWork(S32 param, bool aborted); // called from doWork() (MAIN THREAD) 231 /*virtual*/ void endWork(S32 param, bool aborted); // called from doWork() (MAIN THREAD)
75 232
233 void resetFormattedData();
234
76 void setImagePriority(F32 priority); 235 void setImagePriority(F32 priority);
77 void setDesiredDiscard(S32 discard); 236 void setDesiredDiscard(S32 discard, S32 size);
78 void insertPacket(S32 index, U8* data, S32 size); 237 bool insertPacket(S32 index, U8* data, S32 size);
79 void clearPackets(); 238 void clearPackets();
80 U32 calcWorkPriority(); 239 U32 calcWorkPriority();
81 bool startVFSLoad(LLVFS* vfs, LLAssetType::EType asset_type); 240 void removeFromCache();
82 bool loadFromVFS();
83 bool processSimulatorPackets(); 241 bool processSimulatorPackets();
84 void startDecode();
85 bool decodeImage(); 242 bool decodeImage();
86 243 bool writeToCacheComplete();
244
87 void lockWorkData() { mWorkMutex.lock(); } 245 void lockWorkData() { mWorkMutex.lock(); }
88 void unlockWorkData() { mWorkMutex.unlock(); } 246 void unlockWorkData() { mWorkMutex.unlock(); }
89 247
90 static void lockQueue() { sDataMutex->lock(); } 248 void callbackURLReceived(const LLSD& data, bool success);
91 static void unlockQueue() { sDataMutex->unlock(); } 249 void callbackHttpGet(U8* data, S32 data_size, bool last_block);
250 void callbackCacheRead(bool success, LLImageFormatted* image,
251 S32 imagesize, BOOL islocal);
252 void callbackCacheWrite(bool success);
253 void callbackDecoded(bool success);
92 254
93private: 255private:
94 enum e_state 256 enum e_state // mState
95 { 257 {
96 INIT = 1, 258 // NOTE: Affects LLTextureBar::draw in lltextureview.cpp (debug hack)
97 LOAD_FROM_CACHE, 259 INVALID = 0,
260 INIT,
261 LOAD_FROM_TEXTURE_CACHE,
262 CACHE_POST,
263 LOAD_FROM_NETWORK,
98 LOAD_FROM_SIMULATOR, 264 LOAD_FROM_SIMULATOR,
99 WRITE_TO_VFS, 265 LOAD_FROM_HTTP_GET_URL,
266 LOAD_FROM_HTTP_GET_DATA,
100 DECODE_IMAGE, 267 DECODE_IMAGE,
101 DECODE_IMAGE_UPDATE, 268 DECODE_IMAGE_UPDATE,
269 WRITE_TO_CACHE,
270 WAIT_ON_WRITE,
102 DONE 271 DONE
103 }; 272 };
273 enum e_request_state // mSentRequest
274 {
275 UNSENT = 0,
276 QUEUED = 1,
277 SENT_SIM = 2,
278 SENT_URL = 3,
279 SENT_HTTP = 4
280 };
281 static const char* sStateDescs[];
104 e_state mState; 282 e_state mState;
283 LLTextureFetch* mFetcher;
284 LLImageWorker* mImageWorker;
105 LLPointer<LLImageFormatted> mFormattedImage; 285 LLPointer<LLImageFormatted> mFormattedImage;
106 LLPointer<LLImageRaw> mRawImage; 286 LLPointer<LLImageRaw> mRawImage;
107 LLPointer<LLImageRaw> mAuxImage; 287 LLPointer<LLImageRaw> mAuxImage;
108 LLUUID mID; 288 LLUUID mID;
109 LLHost mHost; 289 LLHost mHost;
110 F32 mPriority; 290 U8 mType;
291 F32 mImagePriority;
292 U32 mWorkPriority;
293 F32 mRequestedPriority;
111 S32 mDesiredDiscard; 294 S32 mDesiredDiscard;
295 S32 mSimRequestedDiscard;
112 S32 mRequestedDiscard; 296 S32 mRequestedDiscard;
297 S32 mLoadedDiscard;
113 S32 mDecodedDiscard; 298 S32 mDecodedDiscard;
114 LLFrameTimer mRequestedTimer; 299 LLFrameTimer mRequestedTimer;
115 LLFrameTimer mIdleTimer; 300 LLFrameTimer mFetchTimer;
116 LLVFSThread::handle_t mFileHandle; 301 LLTextureCache::handle_t mCacheReadHandle;
302 LLTextureCache::handle_t mCacheWriteHandle;
117 U8* mBuffer; 303 U8* mBuffer;
118 S32 mBufferSize; 304 S32 mBufferSize;
119 S32 mRequestedSize; 305 S32 mRequestedSize;
306 S32 mDesiredSize;
307 S32 mFileSize;
308 S32 mCachedSize;
120 BOOL mLoaded; 309 BOOL mLoaded;
121 BOOL mRequested; 310 e_request_state mSentRequest;
122 BOOL mDecoded; 311 BOOL mDecoded;
312 BOOL mWritten;
123 BOOL mNeedsAux; 313 BOOL mNeedsAux;
314 BOOL mHaveAllData;
315 BOOL mInLocalCache;
316 S32 mRetryAttempt;
317 std::string mURL;
124 S32 mActiveCount; 318 S32 mActiveCount;
125 319
126 // Work Data 320 // Work Data
@@ -129,635 +323,1532 @@ private:
129 { 323 {
130 PacketData(U8* data, S32 size) { mData = data; mSize = size; } 324 PacketData(U8* data, S32 size) { mData = data; mSize = size; }
131 ~PacketData() { clearData(); } 325 ~PacketData() { clearData(); }
132 void clearData() { delete mData; mData = NULL; } 326 void clearData() { delete[] mData; mData = NULL; }
133 U8* mData; 327 U8* mData;
134 U32 mSize; 328 U32 mSize;
135 }; 329 };
136 std::vector<PacketData*> mPackets; 330 std::vector<PacketData*> mPackets;
331 S32 mFirstPacket;
137 S32 mLastPacket; 332 S32 mLastPacket;
138 S32 mTotalPackets; 333 U16 mTotalPackets;
139 S32 mTotalBytes; 334 U8 mImageCodec;
140 335};
141 // Class variables (statics)
142
143 static LLWorkerThread* sWorkerThread;
144 static LLMutex* sDataMutex;
145 336
146 // Map of all requests by UUID 337//static
147 typedef std::map<LLUUID,LLTextureFetchWorker*> map_t; 338const char* LLTextureFetchWorker::sStateDescs[] = {
148 static map_t sRequests; 339 "INVALID",
340 "INIT",
341 "LOAD_FROM_TEXTURE_CACHE",
342 "CACHE_POST",
343 "LOAD_FROM_NETWORK",
344 "LOAD_FROM_SIMULATOR",
345 "LOAD_FROM_HTTP_URL",
346 "LOAD_FROM_HTTP_DATA",
347 "DECODE_IMAGE",
348 "DECODE_IMAGE_UPDATE",
349 "WRITE_TO_CACHE",
350 "WAIT_ON_WRITE",
351 "DONE",
352};
149 353
150 // Set of requests that require network data 354// called from MAIN THREAD
151 typedef std::set<LLTextureFetchWorker*> queue_t ;
152 static queue_t sNetworkQueue;
153 355
154 static LLFrameTimer sNetworkTimer; 356LLTextureFetchWorker::LLTextureFetchWorker(LLTextureFetch* fetcher,
155}; 357 const LLUUID& id, // Image UUID
358 const LLHost& host, // Simulator host
359 F32 priority, // Priority
360 S32 discard, // Desired discard
361 S32 size) // Desired size
362 : LLWorkerClass(fetcher, "TextureFetch"),
363 mState(INIT),
364 mFetcher(fetcher),
365 mImageWorker(NULL),
366 mID(id),
367 mHost(host),
368 mImagePriority(priority),
369 mWorkPriority(0),
370 mRequestedPriority(0.f),
371 mDesiredDiscard(-1),
372 mSimRequestedDiscard(-1),
373 mRequestedDiscard(-1),
374 mLoadedDiscard(-1),
375 mDecodedDiscard(-1),
376 mCacheReadHandle(LLTextureCache::nullHandle()),
377 mCacheWriteHandle(LLTextureCache::nullHandle()),
378 mBuffer(NULL),
379 mBufferSize(0),
380 mRequestedSize(0),
381 mDesiredSize(FIRST_PACKET_SIZE),
382 mFileSize(0),
383 mCachedSize(0),
384 mLoaded(FALSE),
385 mSentRequest(UNSENT),
386 mDecoded(FALSE),
387 mWritten(FALSE),
388 mNeedsAux(FALSE),
389 mHaveAllData(FALSE),
390 mInLocalCache(FALSE),
391 mRetryAttempt(0),
392 mActiveCount(0),
393 mWorkMutex(fetcher->getWorkerAPRPool()),
394 mFirstPacket(0),
395 mLastPacket(-1),
396 mTotalPackets(0),
397 mImageCodec(IMG_CODEC_INVALID)
398{
399 calcWorkPriority();
400 mType = host.isOk() ? LLImageBase::TYPE_AVATAR_BAKE : LLImageBase::TYPE_NORMAL;
401// llinfos << "Create: " << mID << " mHost:" << host << " Discard=" << discard << llendl;
402 if (!mFetcher->mDebugPause)
403 {
404 U32 work_priority = mWorkPriority | LLWorkerThread::PRIORITY_HIGH;
405 addWork(0, work_priority );
406 }
407 setDesiredDiscard(discard, size);
408}
156 409
157//statics 410LLTextureFetchWorker::~LLTextureFetchWorker()
158LLTextureFetchWorker::map_t LLTextureFetchWorker::sRequests; 411{
159LLTextureFetchWorker::queue_t LLTextureFetchWorker::sNetworkQueue; 412// llinfos << "Destroy: " << mID
160LLFrameTimer LLTextureFetchWorker::sNetworkTimer; 413// << " Decoded=" << mDecodedDiscard
161LLWorkerThread* LLTextureFetchWorker::sWorkerThread = NULL; 414// << " Requested=" << mRequestedDiscard
162LLMutex* LLTextureFetchWorker::sDataMutex = NULL; 415// << " Desired=" << mDesiredDiscard << llendl;
416 llassert_always(!haveWork());
417 lockWorkData();
418 if (mCacheReadHandle != LLTextureCache::nullHandle())
419 {
420 mFetcher->mTextureCache->readComplete(mCacheReadHandle, true);
421 }
422 if (mCacheWriteHandle != LLTextureCache::nullHandle())
423 {
424 mFetcher->mTextureCache->writeComplete(mCacheWriteHandle, true);
425 }
426 if (mImageWorker)
427 {
428 mImageWorker->scheduleDelete();
429 }
430 mFormattedImage = NULL;
431 clearPackets();
432 unlockWorkData();
433}
163 434
164// called from MAIN THREAD 435void LLTextureFetchWorker::clearPackets()
165//static
166void LLTextureFetchWorker::initClass(bool threaded, bool runalways)
167{ 436{
168 sWorkerThread = new LLWorkerThread(threaded, runalways); 437 for_each(mPackets.begin(), mPackets.end(), DeletePointer());
169 sDataMutex = new LLMutex(sWorkerThread->getAPRPool()); 438 mPackets.clear();
439 mTotalPackets = 0;
440 mLastPacket = -1;
441 mFirstPacket = 0;
170} 442}
171 443
172// called from MAIN THREAD 444U32 LLTextureFetchWorker::calcWorkPriority()
173//static
174void LLTextureFetchWorker::updateClass()
175{ 445{
176 const F32 REQUEST_TIME = 1.f; 446// llassert_always(mImagePriority >= 0 && mImagePriority <= LLViewerImage::maxDecodePriority());
177 const F32 MIN_IDLE_TIME = 1.f * 60.f; // 1 minute 447 F32 priority_scale = (F32)LLWorkerThread::PRIORITY_LOWBITS / LLViewerImage::maxDecodePriority();
178 const F32 MAX_IDLE_TIME = 5.f * 60.f; // 5 minutes 448 mWorkPriority = (U32)(mImagePriority * priority_scale);
179 const S32 MIN_IDLE_COUNT = 16; // always keep last 16 idle requests 449 return mWorkPriority;
180 const F32 MAX_IDLE_COUNT = 1024; // max number of idle requests 450}
181 451
182 // Periodically, gather the list of textures that need data from the network 452// mWorkMutex is locked
183 // And send the requests out to the simulators 453void LLTextureFetchWorker::setDesiredDiscard(S32 discard, S32 size)
184 if (sNetworkTimer.getElapsedTimeF32() >= REQUEST_TIME) 454{
455 bool prioritize = false;
456 if (mDesiredDiscard != discard)
185 { 457 {
186 sNetworkTimer.reset(); 458 if (!haveWork())
187 sendRequestListToSimulators(); 459 {
460 calcWorkPriority();
461 if (!mFetcher->mDebugPause)
462 {
463 U32 work_priority = mWorkPriority | LLWorkerThread::PRIORITY_HIGH;
464 addWork(0, work_priority);
465 }
466 }
467 else if (mDesiredDiscard < discard)
468 {
469 prioritize = true;
470 }
471 mDesiredDiscard = discard;
472 mDesiredSize = size;
188 } 473 }
189 // Remove any old requests (releasing their raw data) 474 else if (size > mDesiredSize)
190 typedef std::pair<F32, LLTextureFetchWorker*> idle_pair;
191 typedef std::set<idle_pair, compare_pair_greater<F32,LLTextureFetchWorker*> > idle_set;
192 idle_set remove_set;
193 for (map_t::iterator iter = sRequests.begin(); iter != sRequests.end(); ++iter)
194 { 475 {
195 LLTextureFetchWorker* worker = iter->second; 476 mDesiredSize = size;
196 if (worker->mActiveCount > 0) 477 prioritize = true;
197 continue;
198 if (worker->haveWork())
199 continue;
200 F32 idletime = worker->mIdleTimer.getElapsedTimeF32();
201 if (idletime < MIN_IDLE_TIME)
202 continue;
203 remove_set.insert(std::make_pair(idletime, worker));
204 } 478 }
205 S32 num_left = remove_set.size(); 479 if ((prioritize && mState == INIT) || mState == DONE)
206 for (idle_set::iterator iter = remove_set.begin(); iter != remove_set.end(); ++iter)
207 { 480 {
208 if (num_left <= MIN_IDLE_COUNT) 481 mState = INIT;
209 break; 482 U32 work_priority = mWorkPriority | LLWorkerThread::PRIORITY_HIGH;
210 if (iter->first < MAX_IDLE_TIME && 483 setPriority(work_priority);
211 num_left < MAX_IDLE_COUNT)
212 break;
213 num_left--;
214 } 484 }
215} 485}
216 486
217// called from MAIN THREAD 487void LLTextureFetchWorker::setImagePriority(F32 priority)
218//static
219void LLTextureFetchWorker::sendRequestListToSimulators()
220{ 488{
221 const F32 LAZY_FLUSH_TIMEOUT = 60.f; 489// llassert_always(priority >= 0 && priority <= LLViewerImage::maxDecodePriority());
222 const S32 IMAGES_PER_REQUEST = 50; 490 F32 delta = fabs(priority - mImagePriority);
223 // Send requests 491 if (delta > (mImagePriority * .05f) || mState == DONE)
224 typedef std::map< LLHost, std::vector<LLTextureFetchWorker*> > work_request_map_t;
225 work_request_map_t requests;
226 for (queue_t::iterator iter = sNetworkQueue.begin(); iter != sNetworkQueue.end(); ++iter)
227 { 492 {
228 LLTextureFetchWorker* req = *iter; 493 mImagePriority = priority;
229 if (req->haveWork()) 494 calcWorkPriority();
495 U32 work_priority = mWorkPriority | (getPriority() & LLWorkerThread::PRIORITY_HIGHBITS);
496 setPriority(work_priority);
497 }
498}
499
500void LLTextureFetchWorker::resetFormattedData()
501{
502 delete[] mBuffer;
503 mBuffer = NULL;
504 mBufferSize = 0;
505 if (mFormattedImage.notNull())
506 {
507 mFormattedImage->deleteData();
508 }
509 mHaveAllData = FALSE;
510}
511
512// Called from MAIN thread
513void LLTextureFetchWorker::startWork(S32 param)
514{
515 llassert(mImageWorker == NULL);
516 llassert(mFormattedImage.isNull());
517}
518
519#include "llviewerimagelist.h" // debug
520
521// Called from LLWorkerThread::processRequest()
522bool LLTextureFetchWorker::doWork(S32 param)
523{
524 LLMutexLock lock(&mWorkMutex);
525
526 if (mFetcher->mDebugPause)
527 {
528 return false; // debug: don't do any work
529 }
530 if (mID == mFetcher->mDebugID)
531 {
532 mFetcher->mDebugCount++; // for setting breakpoints
533 }
534
535 if (mState != DONE)
536 {
537 mFetchTimer.reset();
538 }
539
540 if (mState == INIT)
541 {
542 mRequestedDiscard = -1;
543 mLoadedDiscard = -1;
544 mDecodedDiscard = -1;
545 mRequestedSize = 0;
546 mFileSize = 0;
547 mCachedSize = 0;
548 mLoaded = FALSE;
549 mSentRequest = UNSENT;
550 mDecoded = FALSE;
551 mWritten = FALSE;
552 delete[] mBuffer;
553 mBuffer = NULL;
554 mBufferSize = 0;
555 mHaveAllData = FALSE;
556 clearPackets(); // TODO: Shouldn't be necessary
557 mCacheReadHandle = LLTextureCache::nullHandle();
558 mCacheWriteHandle = LLTextureCache::nullHandle();
559 mURL.clear();
560 mState = LOAD_FROM_TEXTURE_CACHE;
561 // fall through
562 }
563
564 if (mState == LOAD_FROM_TEXTURE_CACHE)
565 {
566 if (mCacheReadHandle == LLTextureCache::nullHandle())
230 { 567 {
231 continue; // busy 568 U32 cache_priority = mWorkPriority;
569 S32 offset = mFormattedImage.notNull() ? mFormattedImage->getDataSize() : 0;
570 S32 size = mDesiredSize - offset;
571 if (size <= 0)
572 {
573 mState = CACHE_POST;
574 return false;
575 }
576 mFileSize = 0;
577 mLoaded = FALSE;
578 setPriority(LLWorkerThread::PRIORITY_LOW | mWorkPriority); // Set priority first since Responder may change it
579 CacheReadResponder* responder = new CacheReadResponder(mFetcher, mID, mFormattedImage);
580 mCacheReadHandle = mFetcher->mTextureCache->readFromCache(mID, cache_priority,
581 offset, size, responder);
232 } 582 }
233 if ((req->mRequestedDiscard == req->mDesiredDiscard) && 583
234 (req->mRequestedTimer.getElapsedTimeF32() < LAZY_FLUSH_TIMEOUT)) 584 if (mLoaded)
235 { 585 {
236 continue; 586 // Make sure request is complete. *TODO: make this auto-complete
587 if (mFetcher->mTextureCache->readComplete(mCacheReadHandle, false))
588 {
589 mCacheReadHandle = LLTextureCache::nullHandle();
590 mState = CACHE_POST;
591 // fall through
592 }
593 else
594 {
595 return false;
596 }
597 }
598 else
599 {
600 return false;
237 } 601 }
238 req->mRequestedDiscard = req->mDesiredDiscard;
239 req->mRequestedTimer.reset();
240 requests[req->mHost].push_back(req);
241 } 602 }
242 for (work_request_map_t::iterator iter1 = requests.begin(); 603
243 iter1 != requests.end(); ++iter1) 604 if (mState == CACHE_POST)
244 { 605 {
245 LLHost host = iter1->first; 606 mCachedSize = mFormattedImage.notNull() ? mFormattedImage->getDataSize() : 0;
246 // invalid host = load from static VFS 607 // Successfully loaded
247 if (host != LLHost::invalid) 608 if ((mCachedSize >= mDesiredSize) || mHaveAllData)
248 { 609 {
249 S32 request_count = 0; 610 // we have enough data, decode it
250 for (std::vector<LLTextureFetchWorker*>::iterator iter2 = iter1->second.begin(); 611 llassert_always(mFormattedImage->getDataSize() > 0);
251 iter2 != iter1->second.end(); ++iter2) 612 mState = DECODE_IMAGE;
613 // fall through
614 }
615 else
616 {
617 // need more data
618 mState = LOAD_FROM_NETWORK;
619 // fall through
620 }
621 }
622
623 if (mState == LOAD_FROM_NETWORK)
624 {
625 if (mSentRequest == UNSENT)
626 {
627 if (mFormattedImage.isNull())
252 { 628 {
253 LLTextureFetchWorker* req = *iter2; 629 mFormattedImage = new LLImageJ2C;
254 if (0 == request_count) 630 }
631 // Add this to the network queue and sit here.
632 // LLTextureFetch::update() will send off a request which will change our state
633 S32 data_size = mFormattedImage->getDataSize();
634 if (data_size > 0)
635 {
636 // Only used for simulator requests
637 mFirstPacket = (data_size - FIRST_PACKET_SIZE) / MAX_IMG_PACKET_SIZE + 1;
638 if (FIRST_PACKET_SIZE + (mFirstPacket-1) * MAX_IMG_PACKET_SIZE != data_size)
255 { 639 {
256 gMessageSystem->newMessageFast(_PREHASH_RequestImage); 640 llwarns << "Bad CACHED TEXTURE size: " << data_size << " removing." << llendl;
641 removeFromCache();
642 resetFormattedData();
643 clearPackets();
257 } 644 }
258 S32 packet = req->mLastPacket + 1; 645 else
259 gMessageSystem->nextBlockFast(_PREHASH_RequestImage); 646 {
260 gMessageSystem->addUUIDFast(_PREHASH_Image, req->mID); 647 mLastPacket = mFirstPacket-1;
261 gMessageSystem->addS32Fast(_PREHASH_DiscardLevel, req->mDesiredDiscard); 648 mTotalPackets = (mFileSize - FIRST_PACKET_SIZE + MAX_IMG_PACKET_SIZE-1) / MAX_IMG_PACKET_SIZE + 1;
262 gMessageSystem->addF32Fast(_PREHASH_DownloadPriority, req->mPriority); 649 }
263 gMessageSystem->addU32Fast(_PREHASH_Packet, packet); 650 }
651 mRequestedSize = mDesiredSize;
652 mRequestedDiscard = mDesiredDiscard;
653 mSentRequest = QUEUED;
654 mFetcher->lockQueue();
655 mFetcher->addToNetworkQueue(this);
656 mFetcher->unlockQueue();
657 setPriority(LLWorkerThread::PRIORITY_LOW | mWorkPriority);
658 }
659 return false;
660 }
661
662 if (mState == LOAD_FROM_SIMULATOR)
663 {
664 if (processSimulatorPackets())
665 {
666 mFetcher->lockQueue();
667 mFetcher->removeFromNetworkQueue(this);
668 mFetcher->unlockQueue();
669 if (!mFormattedImage->getDataSize())
670 {
671 // processSimulatorPackets() failed
672 llwarns << "processSimulatorPackets() failed to load buffer" << llendl;
673 return true; // failed
674 }
675 setPriority(LLWorkerThread::PRIORITY_HIGH | mWorkPriority);
676 mState = DECODE_IMAGE;
677 }
678 else
679 {
680 setPriority(LLWorkerThread::PRIORITY_LOW | mWorkPriority);
681 }
682 return false;
683 }
684
685#if 0
686 if (mState == LOAD_FROM_HTTP_GET_URL)
687 {
688 if (!mSentRequest)
689 {
690 mSentRequest = TRUE;
691 mLoaded = FALSE;
692 std::string url;
693 LLViewerRegion* region = gAgent.getRegion();
694 if (region)
695 {
696 url = region->getCapability("RequestTextureDownload");
697 }
698 if (!url.empty())
699 {
700 LLSD sd;
701 sd = mID.asString();
702 setPriority(LLWorkerThread::PRIORITY_LOW | mWorkPriority);
703 LLHTTPClient::post(url, sd, new URLResponder(mFetcher, mID));
704 return false;
705 }
706 else
707 {
708 llwarns << mID << ": HTTP get url failed, requesting from simulator" << llendl;
709 mSentRequest = FALSE;
710 mState = LOAD_FROM_SIMULATOR;
711 return false;
712 }
713 }
714 else
715 {
716 if (mLoaded)
717 {
718 if (!mURL.empty())
719 {
720 mState = LOAD_FROM_HTTP_GET_DATA;
721 mSentRequest = FALSE; // reset
722 mLoaded = FALSE; // reset
723 }
724 else
725 {
726 llwarns << mID << ": HTTP get url is empty, requesting from simulator" << llendl;
727 mSentRequest = FALSE;
728 mState = LOAD_FROM_SIMULATOR;
729 return false;
730 }
731 }
732 }
733 // fall through
734 }
735
736 if (mState == LOAD_FROM_HTTP_GET_DATA)
737 {
738 if (!mSentRequest)
739 {
740 mSentRequest = TRUE;
741 S32 cur_size = mFormattedImage->getDataSize(); // amount of data we already have
742 mRequestedSize = mDesiredSize;
743 mRequestedDiscard = mDesiredDiscard;
744#if 1 // *TODO: LLCurl::getByteRange is broken (ignores range)
745 cur_size = 0;
746 mFormattedImage->deleteData();
747#endif
748 mRequestedSize -= cur_size;
749 // F32 priority = mImagePriority / (F32)LLViewerImage::maxDecodePriority(); // 0-1
750 S32 offset = cur_size;
751 mBufferSize = cur_size; // This will get modified by callbackHttpGet()
752 std::string url;
753 if (mURL.empty())
754 {
755 //url = "http://asset.agni/0000002f-38ae-0e17-8e72-712e58964e9c.texture";
756 std::stringstream urlstr;
757 urlstr << "http://asset.agni/" << mID.asString() << ".texture";
758 url = urlstr.str();
759 }
760 else
761 {
762 url = mURL;
763 }
764 mLoaded = FALSE;
765// llinfos << "HTTP GET: " << mID << " Offset: " << offset << " Bytes: " << mRequestedSize << llendl;
766 setPriority(LLWorkerThread::PRIORITY_LOW | mWorkPriority);
767 LLCurl::getByteRange(url, offset, mRequestedSize,
768 new HTTPGetResponder(mFetcher, mID)); // *TODO: use mWorkPriority
769 return false; // not done
770 }
264 771
265 request_count++; 772 if (mLoaded)
266 if (request_count >= IMAGES_PER_REQUEST) 773 {
774 S32 cur_size = mFormattedImage->getDataSize();
775 if (mRequestedSize < 0)
776 {
777 llwarns << "http get failed for: " << mID << llendl;
778 if (cur_size == 0)
267 { 779 {
268 gMessageSystem->sendSemiReliable(host, NULL, NULL); 780 resetFormattedData();
269 request_count = 0; 781 return true; // failed
782 }
783 else
784 {
785 mState = DECODE_IMAGE;
786 return false; // use what we have
270 } 787 }
271 } 788 }
272 if (request_count >= IMAGES_PER_REQUEST) 789 llassert_always(mBufferSize == cur_size + mRequestedSize);
790 if (mHaveAllData)
273 { 791 {
274 gMessageSystem->sendSemiReliable(host, NULL, NULL); 792 mFileSize = mBufferSize;
275 } 793 }
794 U8* buffer = new U8[mBufferSize];
795 if (cur_size > 0)
796 {
797 memcpy(buffer, mFormattedImage->getData(), cur_size);
798 }
799 memcpy(buffer + cur_size, mBuffer, mRequestedSize); // append
800 // NOTE: setData releases current data and owns new data (buffer)
801 mFormattedImage->setData(buffer, mBufferSize);
802 // delete temp data
803 delete[] mBuffer; // Note: not 'buffer' (assigned in setData())
804 mBuffer = NULL;
805 mBufferSize = 0;
806 mLoadedDiscard = mRequestedDiscard;
807 setPriority(LLWorkerThread::PRIORITY_HIGH | mWorkPriority);
808 mState = DECODE_IMAGE;
809 return false;
810 }
811
812 // NOTE: Priority gets updated when the http get completes (in callbackHTTPGet())
813 setPriority(LLWorkerThread::PRIORITY_LOW | mWorkPriority);
814 return false;
815 }
816#endif
817
818 if (mState == DECODE_IMAGE)
819 {
820 llassert_always(mFormattedImage->getDataSize() > 0);
821 setPriority(LLWorkerThread::PRIORITY_LOW | mWorkPriority); // Set priority first since Responder may change it
822 mRawImage = NULL;
823 mAuxImage = NULL;
824 llassert_always(mImageWorker == NULL);
825 llassert_always(mFormattedImage.notNull());
826 S32 discard = mHaveAllData ? 0 : mLoadedDiscard;
827 U32 image_priority = LLWorkerThread::PRIORITY_NORMAL | mWorkPriority;
828 mDecoded = FALSE;
829 mState = DECODE_IMAGE_UPDATE;
830 mImageWorker = new LLImageWorker(mFormattedImage, image_priority, discard, new DecodeResponder(mFetcher, mID, this));
831 // fall though (need to call requestDecodedData() to start work)
832 }
833
834 if (mState == DECODE_IMAGE_UPDATE)
835 {
836 if (decodeImage())
837 {
838 if (mDecodedDiscard < 0)
839 {
840 if (mCachedSize > 0 && !mInLocalCache && mRetryAttempt == 0)
841 {
842 // Cache file should be deleted, try again
843 llwarns << mID << ": Decode of cached file failed (removed), retrying" << llendl;
844 mFormattedImage = NULL;
845 ++mRetryAttempt;
846 setPriority(LLWorkerThread::PRIORITY_HIGH | mWorkPriority);
847 mState = INIT;
848 return false;
849 }
850 else
851 {
852 llwarns << "UNABLE TO LOAD TEXTURE: " << mID << " RETRIES: " << mRetryAttempt << llendl;
853 mState = DONE; // failed
854 }
855 }
856 else
857 {
858 setPriority(LLWorkerThread::PRIORITY_HIGH | mWorkPriority);
859 mState = WRITE_TO_CACHE;
860 }
861 // fall through
862 }
863 else
864 {
865 return false;
276 } 866 }
277 } 867 }
278}
279 868
280//static 869 if (mState == WRITE_TO_CACHE)
281LLTextureFetchWorker* LLTextureFetchWorker::getWorker(const LLUUID& id,
282 const LLHost& host,
283 F32 priority,
284 S32 discard,
285 BOOL needs_aux)
286{
287 LLTextureFetchWorker* res;
288 lockQueue();
289 map_t::iterator iter = sRequests.find(id);
290 if (iter != sRequests.end())
291 { 870 {
292 res = iter->second; 871 if (mInLocalCache || !mFileSize || mSentRequest == UNSENT)
293 if (res->mHost != host)
294 { 872 {
295 llerrs << "LLTextureFetchWorker::getWorker called with multiple hosts" << llendl; 873 // If we're in a local cache or we didn't actually receive any new data, skip
874 mState = DONE;
875 return false;
296 } 876 }
297 res->setImagePriority(priority); 877 S32 datasize = mFormattedImage->getDataSize();
298 res->setDesiredDiscard(discard); 878 llassert_always(datasize);
299 879 setPriority(LLWorkerThread::PRIORITY_LOW | mWorkPriority); // Set priority first since Responder may change it
880 U32 cache_priority = mWorkPriority;
881 mWritten = FALSE;
882 mState = WAIT_ON_WRITE;
883 CacheWriteResponder* responder = new CacheWriteResponder(mFetcher, mID);
884 mCacheWriteHandle = mFetcher->mTextureCache->writeToCache(mID, cache_priority,
885 mFormattedImage->getData(), datasize,
886 mFileSize, responder);
887 // fall through
300 } 888 }
301 else 889
890 if (mState == WAIT_ON_WRITE)
302 { 891 {
303 res = new LLTextureFetchWorker(id, host, priority, discard); 892 if (writeToCacheComplete())
893 {
894 mState = DONE;
895 // fall through
896 }
897 else
898 {
899 if (mDesiredDiscard < mDecodedDiscard)
900 {
901 // We're waiting for this write to complete before we can receive more data
902 // (we can't touch mFormattedImage until the write completes)
903 // Prioritize the write
904 mFetcher->mTextureCache->prioritizeWrite(mCacheWriteHandle);
905 }
906 return false;
907 }
304 } 908 }
305 unlockQueue();
306 res->mActiveCount++;
307 res->mNeedsAux = needs_aux;
308 return res;
309}
310 909
311LLTextureFetchWorker* LLTextureFetchWorker::getActiveWorker(const LLUUID& id) 910 if (mState == DONE)
312{
313 LLTextureFetchWorker* res = NULL;
314 lockQueue();
315 map_t::iterator iter = sRequests.find(id);
316 if (iter != sRequests.end())
317 { 911 {
318 res = iter->second; 912 if (mDecodedDiscard >= 0 && mDesiredDiscard < mDecodedDiscard)
913 {
914 // More data was requested, return to INIT
915 mState = INIT;
916 setPriority(LLWorkerThread::PRIORITY_HIGH | mWorkPriority);
917 return false;
918 }
919 else
920 {
921 setPriority(LLWorkerThread::PRIORITY_LOW | mWorkPriority);
922 return true;
923 }
319 } 924 }
320 unlockQueue(); 925
321 return res; 926 return false;
322} 927}
323 928
324LLTextureFetchWorker::LLTextureFetchWorker(const LLUUID& id, // Image UUID 929// Called from MAIN thread
325 const LLHost& host, // Simulator host 930void LLTextureFetchWorker::endWork(S32 param, bool aborted)
326 F32 priority, // Priority
327 S32 discard) // Desired discard level
328 : LLWorkerClass(sWorkerThread, "TextureFetch"),
329 mState(INIT),
330 mID(id),
331 mHost(host),
332 mPriority(priority),
333 mDesiredDiscard(discard),
334 mRequestedDiscard(-1),
335 mDecodedDiscard(-1),
336 mFileHandle(LLVFSThread::nullHandle()),
337 mBuffer(NULL),
338 mBufferSize(0),
339 mRequestedSize(0),
340 mLoaded(FALSE),
341 mRequested(FALSE),
342 mDecoded(FALSE),
343 mActiveCount(0),
344 mWorkMutex(sWorkerThread->getAPRPool()),
345 mLastPacket(-1),
346 mTotalPackets(0),
347 mTotalBytes(0)
348{ 931{
349 lockQueue(); 932 if (mImageWorker)
350 sRequests[mID] = this; 933 {
351 unlockQueue(); 934 mImageWorker->scheduleDelete();
352 addWork(0, calcWorkPriority()); 935 mImageWorker = NULL;
936 }
937 mFormattedImage = NULL;
353} 938}
354 939
355LLTextureFetchWorker::~LLTextureFetchWorker() 940//////////////////////////////////////////////////////////////////////////////
941
942// virtual
943void LLTextureFetchWorker::finishWork(S32 param, bool completed)
356{ 944{
357 lockQueue(); 945 // The following are required in case the work was aborted
358 mFormattedImage = NULL; 946 if (mCacheReadHandle != LLTextureCache::nullHandle())
359 map_t::iterator iter = sRequests.find(mID);
360 if (iter != sRequests.end() && iter->second == this)
361 { 947 {
362 sRequests.erase(iter); 948 mFetcher->mTextureCache->readComplete(mCacheReadHandle, true);
949 mCacheReadHandle = LLTextureCache::nullHandle();
950 }
951 if (mCacheWriteHandle != LLTextureCache::nullHandle())
952 {
953 mFetcher->mTextureCache->writeComplete(mCacheWriteHandle, true);
954 mCacheWriteHandle = LLTextureCache::nullHandle();
363 } 955 }
364 sNetworkQueue.erase(this);
365 unlockQueue();
366 clearPackets();
367} 956}
368 957
369void LLTextureFetchWorker::clearPackets() 958// virtual
959bool LLTextureFetchWorker::deleteOK()
370{ 960{
371 lockWorkData(); 961 bool delete_ok = true;
372 for_each(mPackets.begin(), mPackets.end(), DeletePointer()); 962 // Allow any pending reads or writes to complete
373 mPackets.clear(); 963 if (mCacheReadHandle != LLTextureCache::nullHandle())
374 unlockWorkData(); 964 {
965 if (mFetcher->mTextureCache->readComplete(mCacheReadHandle, true))
966 {
967 mCacheReadHandle = LLTextureCache::nullHandle();
968 }
969 else
970 {
971 delete_ok = false;
972 }
973 }
974 if (mCacheWriteHandle != LLTextureCache::nullHandle())
975 {
976 if (mFetcher->mTextureCache->writeComplete(mCacheWriteHandle))
977 {
978 mCacheWriteHandle = LLTextureCache::nullHandle();
979 }
980 else
981 {
982 delete_ok = false;
983 }
984 }
985
986 if ((haveWork() &&
987 // not ok to delete from these states
988 ((mState >= LOAD_FROM_HTTP_GET_URL && mState <= LOAD_FROM_HTTP_GET_DATA) ||
989 (mState >= WRITE_TO_CACHE && mState <= WAIT_ON_WRITE))))
990 {
991 delete_ok = false;
992 }
993
994 return delete_ok;
375} 995}
376 996
377U32 LLTextureFetchWorker::calcWorkPriority() 997
998void LLTextureFetchWorker::removeFromCache()
378{ 999{
379 F32 priority_scale = (F32)LLWorkerThread::PRIORITY_LOWBITS / LLViewerImage::maxDecodePriority(); 1000 if (!mInLocalCache)
380 U32 priority = (U32)(mPriority * priority_scale); 1001 {
381 return LLWorkerThread::PRIORITY_NORMAL | priority; 1002 mFetcher->mTextureCache->removeFromCache(mID);
1003 }
382} 1004}
383 1005
384void LLTextureFetchWorker::setDesiredDiscard(S32 discard) 1006
1007//////////////////////////////////////////////////////////////////////////////
1008
1009bool LLTextureFetchWorker::processSimulatorPackets()
385{ 1010{
386 if (mDesiredDiscard != discard) 1011 if (mLastPacket >= mFirstPacket)
387 { 1012 {
388 mDesiredDiscard = discard; 1013 S32 buffer_size = mFormattedImage->getDataSize();
389 if (!haveWork()) 1014 for (S32 i = mFirstPacket; i<=mLastPacket; i++)
1015 {
1016 buffer_size += mPackets[i]->mSize;
1017 }
1018 bool have_all_data = mLastPacket >= mTotalPackets-1;
1019 llassert_always(mRequestedSize > 0);
1020 if (buffer_size >= mRequestedSize || have_all_data)
390 { 1021 {
391 addWork(0, calcWorkPriority()); 1022 /// We have enough (or all) data
1023 if (have_all_data)
1024 {
1025 mHaveAllData = TRUE;
1026 }
1027 S32 cur_size = mFormattedImage->getDataSize();
1028 if (buffer_size > cur_size)
1029 {
1030 /// We have new data
1031 U8* buffer = new U8[buffer_size];
1032 S32 offset = 0;
1033 if (cur_size > 0 && mFirstPacket > 0)
1034 {
1035 memcpy(buffer, mFormattedImage->getData(), cur_size);
1036 offset = cur_size;
1037 }
1038 for (S32 i=mFirstPacket; i<=mLastPacket; i++)
1039 {
1040 memcpy(buffer + offset, mPackets[i]->mData, mPackets[i]->mSize);
1041 offset += mPackets[i]->mSize;
1042 }
1043 // NOTE: setData releases current data
1044 mFormattedImage->setData(buffer, buffer_size);
1045 }
1046 mLoadedDiscard = mRequestedDiscard;
1047 return true;
392 } 1048 }
393 } 1049 }
1050 return false;
394} 1051}
395 1052
396void LLTextureFetchWorker::setImagePriority(F32 priority) 1053//////////////////////////////////////////////////////////////////////////////
1054
1055void LLTextureFetchWorker::callbackURLReceived(const LLSD& data, bool success)
397{ 1056{
398 if (priority != mPriority) 1057#if 0
1058 LLMutexLock lock(&mWorkMutex);
1059 if (!mSentRequest || mState != LOAD_FROM_HTTP_GET_URL)
399 { 1060 {
400 mPriority = priority; 1061 llwarns << "callbackURLReceived for unrequested fetch worker, req="
401 setPriority(calcWorkPriority()); 1062 << mSentRequest << " state= " << mState << llendl;
1063 return;
402 } 1064 }
1065 if (success)
1066 {
1067 mURL = data.asString();
1068 }
1069 mLoaded = TRUE;
1070 setPriority(LLWorkerThread::PRIORITY_HIGH | mWorkPriority);
1071#endif
403} 1072}
404 1073
405void LLTextureFetchWorker::insertPacket(S32 index, U8* data, S32 size) 1074//////////////////////////////////////////////////////////////////////////////
1075
1076void LLTextureFetchWorker::callbackHttpGet(U8* data, S32 data_size, bool last_block)
406{ 1077{
407 PacketData* packet = new PacketData(data, size); 1078#if 0
408 1079 LLMutexLock lock(&mWorkMutex);
409 lockWorkData(); 1080 if (!mSentRequest || mState != LOAD_FROM_HTTP_GET_DATA)
410 if (index >= (S32)mPackets.size())
411 { 1081 {
412 mPackets.resize(index+1, (PacketData*)NULL); // initializes v to NULL pointers 1082 llwarns << "callbackHttpGet for unrequested fetch worker, req="
1083 << mSentRequest << " state= " << mState << llendl;
1084 return;
413 } 1085 }
414 if (mPackets[index] != NULL) 1086// llinfos << "HTTP RECEIVED: " << mID.asString() << " Bytes: " << data_size << llendl;
1087 if (mLoaded)
415 { 1088 {
416 llwarns << "LLTextureFetchWorker::insertPacket called for duplicate packet: " << index << llendl; 1089 llwarns << "Duplicate callback for " << mID.asString() << llendl;
1090 return; // ignore duplicate callback
417 } 1091 }
418 mPackets[index] = packet; 1092 if (data_size >= 0)
419 while (mLastPacket+1 < (S32)mPackets.size() && mPackets[mLastPacket+1] != NULL)
420 { 1093 {
421 ++mLastPacket; 1094 if (data_size > 0)
1095 {
1096 mBuffer = new U8[data_size];
1097 // *TODO: set the formatted image data here
1098 memcpy(mBuffer, data, data_size);
1099 mBufferSize += data_size;
1100 if (data_size < mRequestedSize || last_block == true)
1101 {
1102 mHaveAllData = TRUE;
1103 }
1104 else if (data_size > mRequestedSize)
1105 {
1106 // *TODO: This will happen until we fix LLCurl::getByteRange()
1107 llinfos << "HUH?" << llendl;
1108 mHaveAllData = TRUE;
1109 mFormattedImage->deleteData();
1110 mBufferSize = data_size;
1111 }
1112 }
1113 else
1114 {
1115 // We requested data but received none (and no error),
1116 // so presumably we have all of it
1117 mHaveAllData = TRUE;
1118 }
1119 mRequestedSize = data_size;
422 } 1120 }
423 unlockWorkData(); 1121 else
1122 {
1123 mRequestedSize = -1; // error
1124 }
1125 mLoaded = TRUE;
1126 setPriority(LLWorkerThread::PRIORITY_HIGH | mWorkPriority);
1127#endif
424} 1128}
425 1129
426// Called from LLWorkerThread::processRequest() 1130//////////////////////////////////////////////////////////////////////////////
427bool LLTextureFetchWorker::doWork(S32 param) 1131
1132void LLTextureFetchWorker::callbackCacheRead(bool success, LLImageFormatted* image,
1133 S32 imagesize, BOOL islocal)
428{ 1134{
429 switch(mState) 1135 LLMutexLock lock(&mWorkMutex);
430 { 1136 if (mState != LOAD_FROM_TEXTURE_CACHE)
431 case INIT: 1137 {
432 { 1138 llwarns << "Read callback for " << mID << " with state = " << mState << llendl;
433 // fall through 1139 return;
434 }
435 case LOAD_FROM_CACHE:
436 {
437 // Load any existing data from the cache
438 if (mFileHandle == LLVFSThread::nullHandle())
439 {
440 bool res = startVFSLoad(gVFS, LLAssetType::AT_TEXTURE);
441 if (!res) res = startVFSLoad(gStaticVFS, LLAssetType::AT_TEXTURE_TGA);
442 if (!res) res = startVFSLoad(gStaticVFS, LLAssetType::AT_TEXTURE);
443 if (!res)
444 {
445 // Didn't load from VFS
446 mFormattedImage = new LLImageJ2C;
447 mState = LOAD_FROM_SIMULATOR;
448 }
449 }
450 if (mFileHandle != LLVFSThread::nullHandle())
451 {
452 if (!loadFromVFS())
453 {
454 return false; // not done
455 }
456 if (!mLoaded)
457 {
458 llwarns << "Load from VFS failed on: " << mID << llendl;
459 return true;
460 }
461 bool res = mFormattedImage->setData(mBuffer, mBufferSize);
462 if (!res)
463 {
464 llwarns << "loadLocalImage() - setData() failed" << llendl;
465 mFormattedImage->deleteData();
466 return true;
467 }
468 // Successfully loaded
469 if (mFormattedImage->getDiscardLevel() <= mRequestedDiscard)
470 {
471 // we have enough data, decode it
472 mState = DECODE_IMAGE;
473 mRequestedSize = mBufferSize;
474 }
475 else
476 {
477 // need more data
478 mState = LOAD_FROM_SIMULATOR;
479 mRequestedSize = mFormattedImage->calcDataSize(mRequestedDiscard);
480 }
481 }
482 return false;
483 }
484 case LOAD_FROM_SIMULATOR:
485 {
486 if (!mRequested)
487 {
488 lockQueue();
489 sNetworkQueue.insert(this);
490 unlockQueue();
491 mRequested = TRUE;
492 }
493 if (processSimulatorPackets())
494 {
495 mState = WRITE_TO_VFS;
496 }
497 return false;
498 }
499 case WRITE_TO_VFS:
500 {
501 mState = DECODE_IMAGE;
502 // fall through
503 }
504 case DECODE_IMAGE:
505 {
506 startDecode();
507 mState = DECODE_IMAGE_UPDATE;
508 // fall through
509 }
510 case DECODE_IMAGE_UPDATE:
511 {
512 if (decodeImage())
513 {
514 mState = DONE;
515 }
516 return false;
517 }
518 case DONE:
519 {
520 // Do any cleanup here
521 // Destroy the formatted image, we don't need it any more (raw image is still valid)
522 mFormattedImage = NULL;
523 mIdleTimer.reset();
524 return true;
525 }
526 default:
527 {
528 llerrs << "LLTextureFetchWorker::doWork() has illegal state" << llendl;
529 return true;
530 }
531 } 1140 }
1141 if (success)
1142 {
1143 llassert_always(imagesize > 0);
1144 mFileSize = imagesize;
1145 mFormattedImage = image;
1146 mImageCodec = image->getCodec();
1147 mInLocalCache = islocal;
1148 if (mFileSize != 0 && mFormattedImage->getDataSize() >= mFileSize)
1149 {
1150 mHaveAllData = TRUE;
1151 }
1152 }
1153 mLoaded = TRUE;
1154 setPriority(LLWorkerThread::PRIORITY_HIGH | mWorkPriority);
532} 1155}
533 1156
534// Called from MAIN thread 1157void LLTextureFetchWorker::callbackCacheWrite(bool success)
535void LLTextureFetchWorker::startWork(S32 param)
536{ 1158{
1159 LLMutexLock lock(&mWorkMutex);
1160 if (mState != WAIT_ON_WRITE)
1161 {
1162 llwarns << "Write callback for " << mID << " with state = " << mState << llendl;
1163 return;
1164 }
1165 mWritten = TRUE;
1166 setPriority(LLWorkerThread::PRIORITY_HIGH | mWorkPriority);
537} 1167}
538 1168
539void LLTextureFetchWorker::endWork(S32 param, bool aborted) 1169//////////////////////////////////////////////////////////////////////////////
1170
1171void LLTextureFetchWorker::callbackDecoded(bool success)
540{ 1172{
1173 if (mState != DECODE_IMAGE_UPDATE)
1174 {
1175 llwarns << "Decode callback for " << mID << " with state = " << mState << llendl;
1176 return;
1177 }
1178// llinfos << mID << " : DECODE COMPLETE " << llendl;
1179 setPriority(LLWorkerThread::PRIORITY_HIGH | mWorkPriority);
541} 1180}
542 1181
543////////////////////////////////////////////////////////////////////////////// 1182//////////////////////////////////////////////////////////////////////////////
544 1183
545bool LLTextureFetchWorker::startVFSLoad(LLVFS* vfs, LLAssetType::EType asset_type) 1184bool LLTextureFetchWorker::decodeImage()
546{ 1185{
547 // Start load from VFS if it's there 1186 llassert_always(mImageWorker);
548 if (vfs->getExists(mID, asset_type)) 1187 bool res = true;
1188 if (mRawImage.isNull())
549 { 1189 {
550 mBufferSize = vfs->getSize(mID, asset_type); 1190 res = false;
551 mBuffer = new U8[mBufferSize]; 1191 if (mImageWorker->requestDecodedData(mRawImage, -1))
552 mFileHandle = LLVFSThread::sLocal->read(vfs, mID, asset_type, mBuffer, 0, mBufferSize);
553 if (mFileHandle == LLVFSThread::nullHandle())
554 { 1192 {
555 llwarns << "loadLocalImage() - vfs read failed in static VFS: " << mID << llendl; 1193 res = true;
556 delete mBuffer; 1194// llinfos << mID << " : BASE DECODE FINISHED" << llendl;
557 mBuffer = NULL;
558 return false;
559 } 1195 }
560 if (asset_type == LLAssetType::AT_TEXTURE_TGA) 1196 }
1197 if (res &&
1198 (mRawImage.notNull() && mRawImage->getDataSize() > 0) &&
1199 (mNeedsAux && mAuxImage.isNull()))
1200 {
1201 res = false;
1202 if (mImageWorker->requestDecodedAuxData(mAuxImage, 4, -1))
561 { 1203 {
562 mFormattedImage = new LLImageTGA; 1204 res = true;
1205// llinfos << mID << " : AUX DECODE FINISHED" << llendl;
563 } 1206 }
564 else if (asset_type == LLAssetType::AT_TEXTURE) 1207 }
1208 if (res)
1209 {
1210 if ((mRawImage.notNull() && mRawImage->getDataSize() > 0) &&
1211 (!mNeedsAux || (mAuxImage.notNull() && mAuxImage->getDataSize() > 0)))
565 { 1212 {
566 mFormattedImage = new LLImageJ2C; 1213 mDecodedDiscard = mFormattedImage->getDiscardLevel();
1214// llinfos << mID << " : DECODE FINISHED. DISCARD: " << mDecodedDiscard << llendl;
567 } 1215 }
568 else 1216 else
569 { 1217 {
570 llerrs << "LLTextureFetchWorker::startVFSLoad called with bad asset type: " << asset_type << llendl; 1218 llwarns << "DECODE FAILED: " << mID << " Discard: " << (S32)mFormattedImage->getDiscardLevel() << llendl;
1219 removeFromCache();
571 } 1220 }
572 return true; 1221 mImageWorker->scheduleDelete();
1222 mImageWorker = NULL;
573 } 1223 }
574 return false; 1224 return res;
575} 1225}
576 1226
577bool LLTextureFetchWorker::loadFromVFS() 1227//////////////////////////////////////////////////////////////////////////////
1228
1229bool LLTextureFetchWorker::writeToCacheComplete()
578{ 1230{
579 LLMemType mt1(LLMemType::MTYPE_APPFMTIMAGE); 1231 // Complete write to cache
1232 if (mCacheWriteHandle != LLTextureCache::nullHandle())
1233 {
1234 if (!mWritten)
1235 {
1236 return false;
1237 }
1238 if (mFetcher->mTextureCache->writeComplete(mCacheWriteHandle))
1239 {
1240 mCacheWriteHandle = LLTextureCache::nullHandle();
1241 }
1242 else
1243 {
1244 return false;
1245 }
1246 }
1247 return true;
1248}
580 1249
581 llassert(mLoaded == FALSE); 1250
582 1251//////////////////////////////////////////////////////////////////////////////
583 // Check loading status 1252//////////////////////////////////////////////////////////////////////////////
584 LLVFSThread::status_t status = LLVFSThread::sLocal->getRequestStatus(mFileHandle); 1253// public
585 if (status == LLVFSThread::STATUS_QUEUED || status == LLVFSThread::STATUS_INPROGRESS) 1254
1255LLTextureFetch::LLTextureFetch(LLTextureCache* cache, bool threaded)
1256 : LLWorkerThread("TextureFetch", threaded),
1257 mDebugCount(0),
1258 mDebugPause(FALSE),
1259 mQueueMutex(getAPRPool()),
1260 mTextureCache(cache)
1261{
1262}
1263
1264LLTextureFetch::~LLTextureFetch()
1265{
1266 // ~LLQueuedThread() called here
1267}
1268
1269bool LLTextureFetch::createRequest(const LLUUID& id, const LLHost& host, F32 priority,
1270 S32 w, S32 h, S32 c, S32 discard, bool needs_aux)
1271{
1272 if (mDebugPause)
586 { 1273 {
587 return false; 1274 return false;
588 } 1275 }
589 else if (status == LLVFSThread::STATUS_COMPLETE) 1276
1277 LLTextureFetchWorker* worker = NULL;
1278 LLMutexLock lock(&mQueueMutex);
1279 map_t::iterator iter = mRequestMap.find(id);
1280 if (iter != mRequestMap.end())
590 { 1281 {
591 mLoaded = TRUE; 1282 worker = iter->second;
592 return true; 1283 if (worker->mHost != host)
1284 {
1285 llwarns << "LLTextureFetch::createRequest " << id << " called with multiple hosts: "
1286 << host << " != " << worker->mHost << llendl;
1287 removeRequest(worker, true);
1288 worker = NULL;
1289 return false;
1290 }
1291 }
1292 // If the requester knows the dimentions of the image,
1293 // this will calculate how much data we need without having to parse the header
1294 S32 desired_size;
1295 if (w*h*c > 0)
1296 {
1297 desired_size = LLImageJ2C::calcDataSizeJ2C(w, h, c, discard);
593 } 1298 }
594 else 1299 else
595 { 1300 {
596 llwarns << "loadLocalImage() - vfs read failed" << llendl; 1301 desired_size = FIRST_PACKET_SIZE;
597 LLVFSThread::Request* req = (LLVFSThread::Request*)LLVFSThread::sLocal->getRequest(mFileHandle); 1302 discard = MAX_DISCARD_LEVEL;
598 if (req && mFormattedImage.notNull()) 1303 }
1304 if (worker)
1305 {
1306 if (worker->wasAborted())
599 { 1307 {
600 LLVFS* vfs = req->getVFS(); 1308 return false; // need to wait for previous aborted request to complete
601 LLAssetType::EType asset_type = mFormattedImage->getCodec() == IMG_CODEC_TGA ? LLAssetType::AT_TEXTURE_TGA : LLAssetType::AT_TEXTURE; 1309 }
602 vfs->removeFile(mID, asset_type); 1310 worker->lockWorkData();
1311 worker->setImagePriority(priority);
1312 worker->setDesiredDiscard(discard, desired_size);
1313 worker->unlockWorkData();
1314 if (!worker->haveWork())
1315 {
1316 worker->mState = LLTextureFetchWorker::INIT;
1317 worker->addWork(0, LLWorkerThread::PRIORITY_HIGH | worker->mWorkPriority);
603 } 1318 }
604 return true;
605 } 1319 }
1320 else
1321 {
1322 worker = new LLTextureFetchWorker(this, id, host, priority, discard, desired_size);
1323 mRequestMap[id] = worker;
1324 }
1325 worker->mActiveCount++;
1326 worker->mNeedsAux = needs_aux;
1327// llinfos << "REQUESTED: " << id << " Discard: " << discard << llendl;
1328 return true;
606} 1329}
607 1330
1331void LLTextureFetch::deleteRequest(const LLUUID& id, bool cancel)
1332{
1333 LLMutexLock lock(&mQueueMutex);
1334 LLTextureFetchWorker* worker = getWorker(id);
1335 if (worker)
1336 {
1337 removeRequest(worker, cancel);
1338 }
1339}
608 1340
609////////////////////////////////////////////////////////////////////////////// 1341// protected
610 1342
611bool LLTextureFetchWorker::processSimulatorPackets() 1343// call lockQueue() first!
1344void LLTextureFetch::addToNetworkQueue(LLTextureFetchWorker* worker)
1345{
1346 if (mRequestMap.find(worker->mID) != mRequestMap.end())
1347 {
1348 // only add to the queue if in the request map
1349 // i.e. a delete has not been requested
1350 mNetworkQueue.insert(worker->mID);
1351 }
1352 for (cancel_queue_t::iterator iter1 = mCancelQueue.begin();
1353 iter1 != mCancelQueue.end(); ++iter1)
1354 {
1355 iter1->second.erase(worker->mID);
1356 }
1357}
1358
1359// call lockQueue() first!
1360void LLTextureFetch::removeFromNetworkQueue(LLTextureFetchWorker* worker)
1361{
1362 mNetworkQueue.erase(worker->mID);
1363}
1364
1365// call lockQueue() first!
1366void LLTextureFetch::removeRequest(LLTextureFetchWorker* worker, bool cancel)
1367{
1368 mRequestMap.erase(worker->mID);
1369 size_t erased = mNetworkQueue.erase(worker->mID);
1370 if (cancel && erased > 0)
1371 {
1372 mCancelQueue[worker->mHost].insert(worker->mID);
1373 }
1374 worker->scheduleDelete();
1375}
1376
1377// call lockQueue() first!
1378LLTextureFetchWorker* LLTextureFetch::getWorker(const LLUUID& id)
1379{
1380 LLTextureFetchWorker* res = NULL;
1381 map_t::iterator iter = mRequestMap.find(id);
1382 if (iter != mRequestMap.end())
1383 {
1384 res = iter->second;
1385 }
1386 return res;
1387}
1388
1389
1390bool LLTextureFetch::getRequestFinished(const LLUUID& id, S32& discard_level,
1391 LLPointer<LLImageRaw>& raw, LLPointer<LLImageRaw>& aux)
612{ 1392{
613 bool res = false; 1393 bool res = false;
614 lockWorkData(); 1394 LLMutexLock lock(&mQueueMutex);
615 if (mLastPacket >= 0) 1395 LLTextureFetchWorker* worker = getWorker(id);
1396 if (worker)
616 { 1397 {
617 S32 data_size = 0; 1398 if (worker->wasAborted())
618 for (S32 i = 0; i<=mLastPacket; i++)
619 { 1399 {
620 data_size += mPackets[i]->mSize; 1400 res = true;
621 } 1401 }
622 if (data_size >= mRequestedSize || mLastPacket == mTotalPackets) 1402 else if (!worker->haveWork())
623 { 1403 {
624 /// We have enough (or all) data, copy it into mBuffer 1404 // Should only happen if we set mDebugPause...
625 if (mBufferSize < data_size) 1405 if (!mDebugPause)
626 { 1406 {
627 delete mBuffer; 1407// llwarns << "Adding work for inactive worker: " << id << llendl;
628 mBuffer = new U8[data_size]; 1408 worker->addWork(0, LLWorkerThread::PRIORITY_HIGH | worker->mWorkPriority);
629 mBufferSize = data_size;
630 } 1409 }
631 S32 offset = 0; 1410 }
632 for (S32 i = 0; i<=mLastPacket; i++) 1411 else if (worker->checkWork())
1412 {
1413 discard_level = worker->mDecodedDiscard;
1414 raw = worker->mRawImage; worker->mRawImage = NULL;
1415 aux = worker->mAuxImage; worker->mAuxImage = NULL;
1416 res = true;
1417 }
1418 else
1419 {
1420 worker->lockWorkData();
1421 if ((worker->mDecodedDiscard >= 0) &&
1422 (worker->mDecodedDiscard < discard_level || discard_level < 0) &&
1423 (worker->mState >= LLTextureFetchWorker::WAIT_ON_WRITE))
633 { 1424 {
634 memcpy(mBuffer + offset, mPackets[i]->mData, mPackets[i]->mSize); 1425 // Not finished, but data is ready
635 offset += mPackets[i]->mSize; 1426 discard_level = worker->mDecodedDiscard;
1427 if (worker->mRawImage) raw = worker->mRawImage;
1428 if (worker->mAuxImage) aux = worker->mAuxImage;
636 } 1429 }
637 res = true; 1430 worker->unlockWorkData();
638 } 1431 }
639 } 1432 }
640 unlockWorkData(); 1433 else
1434 {
1435 res = true;
1436 }
1437 return res;
1438}
1439
1440bool LLTextureFetch::updateRequestPriority(const LLUUID& id, F32 priority)
1441{
1442 bool res = false;
1443 LLMutexLock lock(&mQueueMutex);
1444 LLTextureFetchWorker* worker = getWorker(id);
1445 if (worker)
1446 {
1447 worker->lockWorkData();
1448 worker->setImagePriority(priority);
1449 worker->unlockWorkData();
1450 res = true;
1451 }
641 return res; 1452 return res;
642} 1453}
643 1454
644////////////////////////////////////////////////////////////////////////////// 1455//////////////////////////////////////////////////////////////////////////////
645 1456
646void LLTextureFetchWorker::startDecode() 1457//virtual
1458S32 LLTextureFetch::update(U32 max_time_ms)
647{ 1459{
648 mRawImage = NULL; 1460 S32 res;
649 mAuxImage = NULL; 1461 res = LLWorkerThread::update(max_time_ms);
1462
1463 const F32 REQUEST_TIME = 1.f;
1464
1465 // Periodically, gather the list of textures that need data from the network
1466 // And send the requests out to the simulators
1467 if (mNetworkTimer.getElapsedTimeF32() >= REQUEST_TIME)
1468 {
1469 mNetworkTimer.reset();
1470 sendRequestListToSimulators();
1471 }
1472
1473 return res;
650} 1474}
651 1475
652bool LLTextureFetchWorker::decodeImage() 1476//////////////////////////////////////////////////////////////////////////////
1477
1478void LLTextureFetch::sendRequestListToSimulators()
653{ 1479{
654 const F32 MAX_DECODE_TIME = .001f; // 1 ms 1480 const S32 IMAGES_PER_REQUEST = 50;
655 if (mRawImage->getDataSize() == 0) 1481 const F32 LAZY_FLUSH_TIMEOUT = 15.f; // 10.0f // temp
1482 const F32 MIN_REQUEST_TIME = 1.0f;
1483 const F32 MIN_DELTA_PRIORITY = 1000.f;
1484
1485 LLMutexLock lock(&mQueueMutex);
1486
1487 // Send requests
1488 typedef std::set<LLTextureFetchWorker*,LLTextureFetchWorker::Compare> request_list_t;
1489 typedef std::map< LLHost, request_list_t > work_request_map_t;
1490 work_request_map_t requests;
1491 for (queue_t::iterator iter = mNetworkQueue.begin(); iter != mNetworkQueue.end(); )
656 { 1492 {
657 if (!mFormattedImage->requestDecodedData(mRawImage, -1, MAX_DECODE_TIME)) 1493 queue_t::iterator curiter = iter++;
1494 LLTextureFetchWorker* req = getWorker(*curiter);
1495 if (!req)
658 { 1496 {
659 return false; 1497 mNetworkQueue.erase(curiter);
1498 continue; // paranoia
1499 }
1500 if (req->mID == mDebugID)
1501 {
1502 mDebugCount++; // for setting breakpoints
1503 }
1504 if (req->mTotalPackets > 0 && req->mLastPacket >= req->mTotalPackets-1)
1505 {
1506 // We have all the packets... make sure this is high priority
1507// req->setPriority(LLWorkerThread::PRIORITY_HIGH | req->mWorkPriority);
1508 continue;
1509 }
1510 F32 elapsed = req->mRequestedTimer.getElapsedTimeF32();
1511 F32 delta_priority = llabs(req->mRequestedPriority - req->mImagePriority);
1512 if ((req->mSimRequestedDiscard != req->mDesiredDiscard) ||
1513 (delta_priority > MIN_DELTA_PRIORITY && elapsed >= MIN_REQUEST_TIME) ||
1514 (elapsed >= LAZY_FLUSH_TIMEOUT))
1515 {
1516 requests[req->mHost].insert(req);
660 } 1517 }
661 mFormattedImage->releaseDecodedData(); // so that we have the only ref to the raw image
662 } 1518 }
663 if (mNeedsAux && mAuxImage->getDataSize() == 0) 1519
1520 std::string http_url;
1521#if 0
1522 if (gSavedSettings.getBOOL("ImagePipelineUseHTTP"))
664 { 1523 {
665 if (!mFormattedImage->requestDecodedAuxData(mAuxImage, 4, -1, MAX_DECODE_TIME )) 1524 LLViewerRegion* region = gAgent.getRegion();
1525 if (region)
666 { 1526 {
667 return false; 1527 http_url = region->getCapability("RequestTextureDownload");
668 } 1528 }
669 mFormattedImage->releaseDecodedData(); // so that we have the only ref to the raw image
670 } 1529 }
671 mDecodedDiscard = mFormattedImage->getDiscardLevel(); 1530#endif
672 return true; 1531
1532 for (work_request_map_t::iterator iter1 = requests.begin();
1533 iter1 != requests.end(); ++iter1)
1534 {
1535 bool use_http = http_url.empty() ? false : true;
1536 LLHost host = iter1->first;
1537 // invalid host = use agent host
1538 if (host == LLHost::invalid)
1539 {
1540 host = gAgent.getRegionHost();
1541 }
1542 else
1543 {
1544 use_http = false;
1545 }
1546
1547 if (use_http)
1548 {
1549 }
1550 else
1551 {
1552 S32 request_count = 0;
1553 for (request_list_t::iterator iter2 = iter1->second.begin();
1554 iter2 != iter1->second.end(); ++iter2)
1555 {
1556 LLTextureFetchWorker* req = *iter2;
1557 req->mSentRequest = LLTextureFetchWorker::SENT_SIM;
1558 if (0 == request_count)
1559 {
1560 gMessageSystem->newMessageFast(_PREHASH_RequestImage);
1561 gMessageSystem->nextBlockFast(_PREHASH_AgentData);
1562 gMessageSystem->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
1563 gMessageSystem->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
1564 }
1565 S32 packet = req->mLastPacket + 1;
1566 gMessageSystem->nextBlockFast(_PREHASH_RequestImage);
1567 gMessageSystem->addUUIDFast(_PREHASH_Image, req->mID);
1568 gMessageSystem->addS8Fast(_PREHASH_DiscardLevel, (S8)req->mSimRequestedDiscard);
1569 gMessageSystem->addF32Fast(_PREHASH_DownloadPriority, req->mImagePriority);
1570 gMessageSystem->addU32Fast(_PREHASH_Packet, packet);
1571 gMessageSystem->addU8Fast(_PREHASH_Type, req->mType);
1572// llinfos << "IMAGE REQUEST: " << req->mID << " Discard: " << req->mDesiredDiscard
1573// << " Packet: " << packet << " Priority: " << req->mImagePriority << llendl;
1574
1575 req->lockWorkData();
1576 req->mSimRequestedDiscard = req->mDesiredDiscard;
1577 req->mRequestedPriority = req->mImagePriority;
1578 req->mRequestedTimer.reset();
1579 req->unlockWorkData();
1580 request_count++;
1581 if (request_count >= IMAGES_PER_REQUEST)
1582 {
1583// llinfos << "REQUESTING " << request_count << " IMAGES FROM HOST: " << host.getIPString() << llendl;
1584 gMessageSystem->sendSemiReliable(host, NULL, NULL);
1585 request_count = 0;
1586 }
1587 }
1588 if (request_count > 0 && request_count < IMAGES_PER_REQUEST)
1589 {
1590// llinfos << "REQUESTING " << request_count << " IMAGES FROM HOST: " << host.getIPString() << llendl;
1591 gMessageSystem->sendSemiReliable(host, NULL, NULL);
1592 request_count = 0;
1593 }
1594 }
1595 }
1596
1597 // Send cancelations
1598 if (!mCancelQueue.empty())
1599 {
1600 for (cancel_queue_t::iterator iter1 = mCancelQueue.begin();
1601 iter1 != mCancelQueue.end(); ++iter1)
1602 {
1603 LLHost host = iter1->first;
1604 if (host == LLHost::invalid)
1605 {
1606 host = gAgent.getRegionHost();
1607 }
1608 S32 request_count = 0;
1609 for (queue_t::iterator iter2 = iter1->second.begin();
1610 iter2 != iter1->second.end(); ++iter2)
1611 {
1612 if (0 == request_count)
1613 {
1614 gMessageSystem->newMessageFast(_PREHASH_RequestImage);
1615 gMessageSystem->nextBlockFast(_PREHASH_AgentData);
1616 gMessageSystem->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
1617 gMessageSystem->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
1618 }
1619 gMessageSystem->nextBlockFast(_PREHASH_RequestImage);
1620 gMessageSystem->addUUIDFast(_PREHASH_Image, *iter2);
1621 gMessageSystem->addS8Fast(_PREHASH_DiscardLevel, -1);
1622 gMessageSystem->addF32Fast(_PREHASH_DownloadPriority, 0);
1623 gMessageSystem->addU32Fast(_PREHASH_Packet, 0);
1624 gMessageSystem->addU8Fast(_PREHASH_Type, 0);
1625// llinfos << "CANCELING IMAGE REQUEST: " << (*iter2) << llendl;
1626
1627 request_count++;
1628 if (request_count >= IMAGES_PER_REQUEST)
1629 {
1630 gMessageSystem->sendSemiReliable(host, NULL, NULL);
1631 request_count = 0;
1632 }
1633 }
1634 if (request_count > 0 && request_count < IMAGES_PER_REQUEST)
1635 {
1636 gMessageSystem->sendSemiReliable(host, NULL, NULL);
1637 }
1638 }
1639 mCancelQueue.clear();
1640 }
673} 1641}
674 1642
675////////////////////////////////////////////////////////////////////////////// 1643//////////////////////////////////////////////////////////////////////////////
676 1644
677#if 0 1645bool LLTextureFetchWorker::insertPacket(S32 index, U8* data, S32 size)
678// static
679void LLTextureFetchWorker::receiveImageHeader(LLMessageSystem *msg, void **user_data)
680{ 1646{
681 LLFastTimer t(LLFastTimer::FTM_PROCESS_IMAGES); 1647 mRequestedTimer.reset();
1648 if (index >= mTotalPackets)
1649 {
1650// llwarns << "Received Image Packet " << index << " > max: " << mTotalPackets << " for image: " << mID << llendl;
1651 return false;
1652 }
1653 if (index > 0 && index < mTotalPackets-1 && size != MAX_IMG_PACKET_SIZE)
1654 {
1655// llwarns << "Received bad sized packet: " << index << ", " << size << " != " << MAX_IMG_PACKET_SIZE << " for image: " << mID << llendl;
1656 return false;
1657 }
682 1658
683 // Receive image header, copy into image object and decompresses 1659 if (index >= (S32)mPackets.size())
684 // if this is a one-packet image. 1660 {
1661 mPackets.resize(index+1, (PacketData*)NULL); // initializes v to NULL pointers
1662 }
1663 else if (mPackets[index] != NULL)
1664 {
1665// llwarns << "Received duplicate packet: " << index << " for image: " << mID << llendl;
1666 return false;
1667 }
1668
1669 mPackets[index] = new PacketData(data, size);
1670 while (mLastPacket+1 < (S32)mPackets.size() && mPackets[mLastPacket+1] != NULL)
1671 {
1672 ++mLastPacket;
1673 }
1674 return true;
1675}
685 1676
686 gImageList.sTextureBits += msg->getReceiveBytes(); 1677bool LLTextureFetch::receiveImageHeader(const LLHost& host, const LLUUID& id, U8 codec, U16 packets, U32 totalbytes,
687 gImageList.sTexturePackets++; 1678 U16 data_size, U8* data)
1679{
1680 LLMutexLock lock(&mQueueMutex);
1681 LLTextureFetchWorker* worker = getWorker(id);
1682 bool res = true;
688 1683
689 LLUUID id; 1684 ++mPacketCount;
690 msg->getUUIDFast(_PREHASH_ImageID, _PREHASH_ID, id);
691// LLString ip_string(u32_to_ip_string(msg->getSenderIP()));
692 1685
693 LLTextureFetchWorker* worker = getActiveWorker(id);
694 if (!worker) 1686 if (!worker)
695 { 1687 {
696 llwarns << "receiveImageHeader for non active worker: " << id << llendl; 1688// llwarns << "Received header for non active worker: " << id << llendl;
697 return; 1689 res = false;
698 } 1690 }
699 worker->mRequestedTimer.reset(); 1691 else if (worker->mState != LLTextureFetchWorker::LOAD_FROM_NETWORK ||
700 1692 worker->mSentRequest != LLTextureFetchWorker::SENT_SIM)
701 // check to see if we've gotten this packet before
702 if (worker->mLastPacket != -1)
703 { 1693 {
704 llwarns << "Img: " << id << ":" << " Duplicate Image Header" << llendl; 1694// llwarns << "receiveImageHeader for worker: " << id
705 return; 1695// << " in state: " << LLTextureFetchWorker::sStateDescs[worker->mState]
1696// << " sent: " << worker->mSentRequest << llendl;
1697 res = false;
706 } 1698 }
707 1699 else if (worker->mLastPacket != -1)
708 // Copy header data into image object
709 worker->lockWorkData();
710 msg->getU8Fast(_PREHASH_ImageID, _PREHASH_Codec, image->mDataCodec);
711 msg->getU16Fast(_PREHASH_ImageID, _PREHASH_Packets, image->mTotalPackets);
712 msg->getU32Fast(_PREHASH_ImageID, _PREHASH_Size, image->mTotalBytes);
713 if (0 == image->mTotalPackets)
714 { 1700 {
715 llwarns << "Img: " << id << ":" << " Number of packets is 0" << llendl; 1701 // check to see if we've gotten this packet before
1702// llwarns << "Received duplicate header for: " << id << llendl;
1703 res = false;
716 } 1704 }
717 worker->unlockWorkData(); 1705 else if (!data_size)
718 1706 {
719 U16 data_size = msg->getSizeFast(_PREHASH_ImageData, _PREHASH_Data); 1707 llwarns << "Img: " << id << ":" << " Empty Image Header" << llendl;
720 if (data_size) 1708 res = false;
1709 }
1710 if (!res)
721 { 1711 {
722 U8 *data = new U8[data_size]; 1712 ++mBadPacketCount;
723 msg->getBinaryDataFast(_PREHASH_ImageData, _PREHASH_Data, data, data_size); 1713 mCancelQueue[host].insert(id);
724 worker->insertPacket(0, data, data_size) 1714 return false;
725 } 1715 }
1716
1717 worker->lockWorkData();
1718
1719 // Copy header data into image object
1720 worker->mImageCodec = codec;
1721 worker->mTotalPackets = packets;
1722 worker->mFileSize = (S32)totalbytes;
1723 llassert_always(totalbytes > 0);
1724 llassert_always(data_size == FIRST_PACKET_SIZE || data_size == worker->mFileSize);
1725 res = worker->insertPacket(0, data, data_size);
1726 worker->setPriority(LLWorkerThread::PRIORITY_HIGH | worker->mWorkPriority);
1727 worker->mState = LLTextureFetchWorker::LOAD_FROM_SIMULATOR;
1728 worker->unlockWorkData();
1729 return res;
726} 1730}
727 1731
728/////////////////////////////////////////////////////////////////////////////// 1732bool LLTextureFetch::receiveImagePacket(const LLHost& host, const LLUUID& id, U16 packet_num, U16 data_size, U8* data)
729// static
730void LLTextureFetchWorker::receiveImagePacket(LLMessageSystem *msg, void **user_data)
731{ 1733{
732 LLMemType mt1(LLMemType::MTYPE_APPFMTIMAGE); 1734 LLMutexLock lock(&mQueueMutex);
733 LLFastTimer t(LLFastTimer::FTM_PROCESS_IMAGES); 1735 LLTextureFetchWorker* worker = getWorker(id);
1736 bool res = true;
1737
1738 ++mPacketCount;
734 1739
735 gImageList.sTextureBits += msg->getReceiveBytes(); 1740 if (!worker)
736 gImageList.sTexturePackets++; 1741 {
1742// llwarns << "Received packet " << packet_num << " for non active worker: " << id << llendl;
1743 res = false;
1744 }
1745 else if (worker->mLastPacket == -1)
1746 {
1747// llwarns << "Received packet " << packet_num << " before header for: " << id << llendl;
1748 res = false;
1749 }
1750 else if (!data_size)
1751 {
1752 llwarns << "Img: " << id << ":" << " Empty Image Header" << llendl;
1753 res = false;
1754 }
1755 if (!res)
1756 {
1757 ++mBadPacketCount;
1758 mCancelQueue[host].insert(id);
1759 return false;
1760 }
737 1761
738 LLUUID id; 1762 worker->lockWorkData();
739 msg->getUUIDFast(_PREHASH_ImageID, _PREHASH_ID, id); 1763
740// LLString ip_string(u32_to_ip_string(msg->getSenderIP())); 1764 res = worker->insertPacket(packet_num, data, data_size);
1765
1766 if ((worker->mState == LLTextureFetchWorker::LOAD_FROM_SIMULATOR) ||
1767 (worker->mState == LLTextureFetchWorker::LOAD_FROM_NETWORK))
1768 {
1769 worker->setPriority(LLWorkerThread::PRIORITY_HIGH | worker->mWorkPriority);
1770 worker->mState = LLTextureFetchWorker::LOAD_FROM_SIMULATOR;
1771 }
1772 else
1773 {
1774// llwarns << "receiveImagePacket " << packet_num << "/" << worker->mLastPacket << " for worker: " << id
1775// << " in state: " << LLTextureFetchWorker::sStateDescs[worker->mState] << llendl;
1776 removeFromNetworkQueue(worker); // failsafe
1777 mCancelQueue[host].insert(id);
1778 }
1779
1780 worker->unlockWorkData();
741 1781
742 U16 packet_num; 1782 return res;
743 msg->getU16Fast(_PREHASH_ImageID, _PREHASH_Packet, packet_num); 1783}
744 1784
745 LLTextureFetchWorker* worker = getActiveWorker(id); 1785//////////////////////////////////////////////////////////////////////////////
746 if (!worker) 1786
1787S32 LLTextureFetch::getFetchState(const LLUUID& id, F32& data_progress_p, F32& requested_priority_p,
1788 U32& fetch_priority_p, F32& fetch_dtime_p, F32& request_dtime_p)
1789{
1790 S32 state = LLTextureFetchWorker::INVALID;
1791 F32 data_progress = 0.0f;
1792 F32 requested_priority = 0.0f;
1793 F32 fetch_dtime = 999999.f;
1794 F32 request_dtime = 999999.f;
1795 U32 fetch_priority = 0;
1796
1797 LLMutexLock lock(&mQueueMutex);
1798 LLTextureFetchWorker* worker = getWorker(id);
1799 if (worker && worker->haveWork())
747 { 1800 {
748 llwarns << "receiveImageHeader for non active worker: " << id << llendl; 1801 worker->lockWorkData();
749 return; 1802 state = worker->mState;
1803 fetch_dtime = worker->mFetchTimer.getElapsedTimeF32();
1804 request_dtime = worker->mRequestedTimer.getElapsedTimeF32();
1805 if (worker->mFileSize > 0)
1806 {
1807 if (state == LLTextureFetchWorker::LOAD_FROM_SIMULATOR)
1808 {
1809 S32 data_size = FIRST_PACKET_SIZE + (worker->mLastPacket-1) * MAX_IMG_PACKET_SIZE;
1810 data_size = llmax(data_size, 0);
1811 data_progress = (F32)data_size / (F32)worker->mFileSize;
1812 }
1813 else if (worker->mFormattedImage.notNull())
1814 {
1815 data_progress = (F32)worker->mFormattedImage->getDataSize() / (F32)worker->mFileSize;
1816 }
1817 }
1818 if (state >= LLTextureFetchWorker::LOAD_FROM_NETWORK && state <= LLTextureFetchWorker::LOAD_FROM_HTTP_GET_DATA)
1819 {
1820 requested_priority = worker->mRequestedPriority;
1821 }
1822 else
1823 {
1824 requested_priority = worker->mImagePriority;
1825 }
1826 fetch_priority = worker->getPriority();
1827 worker->unlockWorkData();
750 } 1828 }
751 worker->mRequestedTimer.reset(); 1829 data_progress_p = data_progress;
1830 requested_priority_p = requested_priority;
1831 fetch_priority_p = fetch_priority;
1832 fetch_dtime_p = fetch_dtime;
1833 request_dtime_p = request_dtime;
1834 return state;
1835}
752 1836
753 U16 data_size = msg->getSizeFast(_PREHASH_ImageData, _PREHASH_Data); 1837void LLTextureFetch::dump()
754 if (data_size) 1838{
1839 llinfos << "LLTextureFetch REQUESTS:" << llendl;
1840 for (request_queue_t::iterator iter = mRequestQueue.begin();
1841 iter != mRequestQueue.end(); ++iter)
755 { 1842 {
756 U8 *data = new U8[data_size]; 1843 LLQueuedThread::QueuedRequest* qreq = *iter;
757 msg->getBinaryDataFast(_PREHASH_ImageData, _PREHASH_Data, data, data_size); 1844 LLWorkerThread::WorkRequest* wreq = (LLWorkerThread::WorkRequest*)qreq;
758 worker->insertPacket(0, data, data_size) 1845 LLTextureFetchWorker* worker = (LLTextureFetchWorker*)wreq->getWorkerClass();
1846 llinfos << " ID: " << worker->mID
1847 << " PRI: " << llformat("0x%08x",wreq->getPriority())
1848 << " STATE: " << worker->sStateDescs[worker->mState]
1849 << llendl;
759 } 1850 }
760} 1851}
761#endif
762 1852
763 ////////////////////////////////////////////////////////////////////////////// 1853
1854//////////////////////////////////////////////////////////////////////////////
diff --git a/linden/indra/newview/lltexturefetch.h b/linden/indra/newview/lltexturefetch.h
index 29cac99..a53deae 100644
--- a/linden/indra/newview/lltexturefetch.h
+++ b/linden/indra/newview/lltexturefetch.h
@@ -28,20 +28,79 @@
28#ifndef LL_LLTEXTUREFETCH_H 28#ifndef LL_LLTEXTUREFETCH_H
29#define LL_LLTEXTUREFETCH_H 29#define LL_LLTEXTUREFETCH_H
30 30
31#include "lldir.h"
32#include "llimage.h"
33#include "lluuid.h"
31#include "llworkerthread.h" 34#include "llworkerthread.h"
32 35
33class LLViewerImage; 36class LLViewerImage;
37class LLTextureFetchWorker;
38class LLTextureCache;
39class LLHost;
34 40
35// Interface class 41// Interface class
36class LLTextureFetch 42class LLTextureFetch : public LLWorkerThread
37{ 43{
44 friend class LLTextureFetchWorker;
45
38public: 46public:
39 static void initClass(); 47 LLTextureFetch(LLTextureCache* cache, bool threaded);
40 static void updateClass(); 48 ~LLTextureFetch();
41 static void cleanupClass();
42 49
43 static LLWorkerClass::handle_t addRequest(LLImageFormatted* image, S32 discard); 50 /*virtual*/ S32 update(U32 max_time_ms);
44 static bool getRequestFinished(LLWorkerClass::handle_t handle); 51
52 bool createRequest(const LLUUID& id, const LLHost& host, F32 priority,
53 S32 w, S32 h, S32 c, S32 discard, bool needs_aux);
54 void deleteRequest(const LLUUID& id, bool cancel);
55 bool getRequestFinished(const LLUUID& id, S32& discard_level,
56 LLPointer<LLImageRaw>& raw, LLPointer<LLImageRaw>& aux);
57 bool updateRequestPriority(const LLUUID& id, F32 priority);
58
59 bool receiveImageHeader(const LLHost& host, const LLUUID& id, U8 codec, U16 packets, U32 totalbytes, U16 data_size, U8* data);
60 bool receiveImagePacket(const LLHost& host, const LLUUID& id, U16 packet_num, U16 data_size, U8* data);
61
62 // Debug
63 S32 getFetchState(const LLUUID& id, F32& decode_progress_p, F32& requested_priority_p,
64 U32& fetch_priority_p, F32& fetch_dtime_p, F32& request_dtime_p);
65 void dump();
66 S32 getNumRequests() { return mRequestMap.size(); }
67
68 // Public for access by callbacks
69 void lockQueue() { mQueueMutex.lock(); }
70 void unlockQueue() { mQueueMutex.unlock(); }
71 LLTextureFetchWorker* getWorker(const LLUUID& id);
72
73protected:
74 void addToNetworkQueue(LLTextureFetchWorker* worker);
75 void removeFromNetworkQueue(LLTextureFetchWorker* worker);
76 void removeRequest(LLTextureFetchWorker* worker, bool cancel);
77
78private:
79 void sendRequestListToSimulators();
80
81public:
82 LLUUID mDebugID;
83 S32 mDebugCount;
84 BOOL mDebugPause;
85 S32 mPacketCount;
86 S32 mBadPacketCount;
87
88private:
89 LLMutex mQueueMutex;
90
91 LLTextureCache* mTextureCache;
92
93 // Map of all requests by UUID
94 typedef std::map<LLUUID,LLTextureFetchWorker*> map_t;
95 map_t mRequestMap;
96
97 // Set of requests that require network data
98 typedef std::set<LLUUID> queue_t;
99 queue_t mNetworkQueue;
100 typedef std::map<LLHost,std::set<LLUUID> > cancel_queue_t;
101 cancel_queue_t mCancelQueue;
102
103 LLFrameTimer mNetworkTimer;
45}; 104};
46 105
47#endif LL_LLTEXTUREFETCH_H 106#endif // LL_LLTEXTUREFETCH_H
diff --git a/linden/indra/newview/lltextureview.cpp b/linden/indra/newview/lltextureview.cpp
index 75abb39..d28ee74 100644
--- a/linden/indra/newview/lltextureview.cpp
+++ b/linden/indra/newview/lltextureview.cpp
@@ -33,48 +33,509 @@
33 33
34#include "llrect.h" 34#include "llrect.h"
35#include "llerror.h" 35#include "llerror.h"
36 36#include "lllfsthread.h"
37#include "viewer.h"
38#include "llui.h" 37#include "llui.h"
38#include "llimageworker.h"
39 39
40#include "llviewerimagelist.h" 40#include "llhoverview.h"
41#include "llselectmgr.h" 41#include "llselectmgr.h"
42#include "lltexlayer.h"
43#include "lltexturecache.h"
44#include "lltexturefetch.h"
45#include "lltexturetable.h"
42#include "llviewerobject.h" 46#include "llviewerobject.h"
43#include "llviewerimage.h" 47#include "llviewerimage.h"
44#include "llhoverview.h" 48#include "llviewerimagelist.h"
49#include "viewer.h"
50
51extern F32 texmem_lower_bound_scale;
45 52
46LLTextureView *gTextureView = NULL; 53LLTextureView *gTextureView = NULL;
47 54
48//static 55//static
49std::set<LLViewerImage*> LLTextureView::sDebugImages; 56std::set<LLViewerImage*> LLTextureView::sDebugImages;
50 57
58////////////////////////////////////////////////////////////////////////////
59
60static LLString title_string1a("Tex UUID Area DDis(Req) DecodePri(Fetch) [download] pk/max");
61static LLString title_string1b("Tex UUID Area DDis(Req) Fetch(DecodePri) [download] pk/max");
62static LLString title_string2("State");
63static LLString title_string3("Pkt Bnd");
64static LLString title_string4(" W x H (Dis) Mem");
65
66static S32 title_x1 = 0;
67static S32 title_x2 = 440;
68static S32 title_x3 = title_x2 + 40;
69static S32 title_x4 = title_x3 + 50;
70static S32 texture_bar_height = 8;
71
72////////////////////////////////////////////////////////////////////////////
73
74class LLTextureBar : public LLView
75{
76public:
77 LLPointer<LLViewerImage> mImagep;
78 S32 mHilite;
79
80public:
81 LLTextureBar(const std::string& name, const LLRect& r, LLTextureView* texview)
82 : LLView(name, r, FALSE),
83 mHilite(0),
84 mTextureView(texview)
85 {
86 }
87
88 virtual EWidgetType getWidgetType() const { return WIDGET_TYPE_TEXTURE_BAR; }
89 virtual LLString getWidgetTag() const { return LL_TEXTURE_BAR_TAG; }
90
91 virtual void draw();
92 virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask);
93 virtual LLRect getRequiredRect(); // Return the height of this object, given the set options.
94
51// Used for sorting 95// Used for sorting
52struct SortTextureBars 96 struct sort
97 {
98 bool operator()(const LLView* i1, const LLView* i2)
99 {
100 LLTextureBar* bar1p = (LLTextureBar*)i1;
101 LLTextureBar* bar2p = (LLTextureBar*)i2;
102 LLViewerImage *i1p = bar1p->mImagep;
103 LLViewerImage *i2p = bar2p->mImagep;
104 F32 pri1 = i1p->getDecodePriority(); // i1p->mRequestedDownloadPriority
105 F32 pri2 = i2p->getDecodePriority(); // i2p->mRequestedDownloadPriority
106 if (pri1 > pri2)
107 return true;
108 else if (pri2 > pri1)
109 return false;
110 else
111 return i1p->getID() < i2p->getID();
112 }
113 };
114
115 struct sort_fetch
116 {
117 bool operator()(const LLView* i1, const LLView* i2)
118 {
119 LLTextureBar* bar1p = (LLTextureBar*)i1;
120 LLTextureBar* bar2p = (LLTextureBar*)i2;
121 LLViewerImage *i1p = bar1p->mImagep;
122 LLViewerImage *i2p = bar2p->mImagep;
123 U32 pri1 = i1p->mFetchPriority;
124 U32 pri2 = i2p->mFetchPriority;
125 if (pri1 > pri2)
126 return true;
127 else if (pri2 > pri1)
128 return false;
129 else
130 return i1p->getID() < i2p->getID();
131 }
132 };
133private:
134 LLTextureView* mTextureView;
135};
136
137void LLTextureBar::draw()
53{ 138{
54 bool operator()(const LLView* i1, const LLView* i2) 139 if (!mImagep)
55 { 140 {
56 LLTextureBar* bar1p = (LLTextureBar*)i1; 141 return;
57 LLTextureBar* bar2p = (LLTextureBar*)i2; 142 }
58 LLViewerImage *i1p = bar1p->mImagep; 143
59 LLViewerImage *i2p = bar2p->mImagep; 144 LLColor4 color;
60 F32 pri1 = i1p->getDecodePriority(); // i1p->mRequestedDownloadPriority 145 if (mImagep->getID() == gTextureFetch->mDebugID)
61 F32 pri2 = i2p->getDecodePriority(); // i2p->mRequestedDownloadPriority 146 {
62 if (pri1 > pri2) 147 color = LLColor4::cyan2;
63 return true; 148 }
64 else if (pri2 > pri1) 149 else if (mHilite)
65 return false; 150 {
151 S32 idx = llclamp(mHilite,1,3);
152 if (idx==1) color = LLColor4::orange;
153 else if (idx==2) color = LLColor4::yellow;
154 else color = LLColor4::pink2;
155 }
156 else if (mImagep->mDontDiscard)
157 {
158 color = LLColor4::green4;
159 }
160 else if (mImagep->getBoostLevel())
161 {
162 color = LLColor4::magenta;
163 }
164 else if (mImagep->getDecodePriority() == 0.0f)
165 {
166 color = LLColor4::grey; color[VALPHA] = .7f;
167 }
168 else
169 {
170 color = LLColor4::white; color[VALPHA] = .7f;
171 }
172
173 // We need to draw:
174 // The texture UUID or name
175 // The progress bar for the texture, highlighted if it's being download
176 // Various numerical stats.
177 char tex_str[256];
178 S32 left, right;
179 S32 top = 0;
180 S32 bottom = top + 6;
181 LLColor4 clr;
182
183 LLGLSUIDefault gls_ui;
184
185 // Get the name or UUID of the image.
186 gTextureTable.getName(mImagep->mID);
187
188 // Name, pixel_area, requested pixel area, decode priority
189 char uuid_str[255];
190 mImagep->mID.toString(uuid_str);
191 uuid_str[8] = 0;
192 if (mTextureView->mOrderFetch)
193 {
194 sprintf(tex_str, "%s %7.0f %d(%d) 0x%08x(%8.0f)",
195 uuid_str,
196 mImagep->mMaxVirtualSize,
197 mImagep->mDesiredDiscardLevel,
198 mImagep->mRequestedDiscardLevel,
199 mImagep->mFetchPriority,
200 mImagep->getDecodePriority());
201 }
202 else
203 {
204 sprintf(tex_str, "%s %7.0f %d(%d) %8.0f(0x%08x)",
205 uuid_str,
206 mImagep->mMaxVirtualSize,
207 mImagep->mDesiredDiscardLevel,
208 mImagep->mRequestedDiscardLevel,
209 mImagep->getDecodePriority(),
210 mImagep->mFetchPriority);
211 }
212
213 LLFontGL::sMonospace->renderUTF8(tex_str, 0, title_x1, mRect.getHeight(),
214 color, LLFontGL::LEFT, LLFontGL::TOP);
215
216 // State
217 // Hack: mirrored from lltexturefetch.cpp
218 struct { const char* desc; LLColor4 color; } fetch_state_desc[] = {
219 { "---", LLColor4::red }, // INVALID
220 { "INI", LLColor4::white }, // INIT
221 { "DSK", LLColor4::cyan }, // LOAD_FROM_TEXTURE_CACHE
222 { "DSK", LLColor4::blue }, // CACHE_POST
223 { "NET", LLColor4::green }, // LOAD_FROM_NETWORK
224 { "SIM", LLColor4::green }, // LOAD_FROM_SIMULATOR
225 { "URL", LLColor4::green2 },// LOAD_FROM_HTTP_GET_URL
226 { "HTP", LLColor4::green }, // LOAD_FROM_HTTP_GET_DATA
227 { "DEC", LLColor4::yellow },// DECODE_IMAGE
228 { "DEC", LLColor4::yellow },// DECODE_IMAGE_UPDATE
229 { "WRT", LLColor4::purple },// WRITE_TO_CACHE
230 { "WRT", LLColor4::orange },// WAIT_ON_WRITE
231 { "END", LLColor4::red }, // DONE
232#define LAST_STATE 12
233 { "CRE", LLColor4::magenta }, // LAST_STATE+1
234 { "FUL", LLColor4::green }, // LAST_STATE+2
235 { "BAD", LLColor4::red }, // LAST_STATE+3
236 { "MIS", LLColor4::red }, // LAST_STATE+4
237 { "---", LLColor4::white }, // LAST_STATE+5
238 };
239 const S32 fetch_state_desc_size = (S32)(sizeof(fetch_state_desc)/sizeof(fetch_state_desc[0]));
240 S32 state =
241 mImagep->mNeedsCreateTexture ? LAST_STATE+1 :
242 mImagep->mFullyLoaded ? LAST_STATE+2 :
243 mImagep->mMinDiscardLevel > 0 ? LAST_STATE+3 :
244 mImagep->mIsMissingAsset ? LAST_STATE+4 :
245 !mImagep->mIsFetching ? LAST_STATE+5 :
246 mImagep->mFetchState;
247 state = llclamp(state,0,fetch_state_desc_size-1);
248
249 LLFontGL::sMonospace->renderUTF8(fetch_state_desc[state].desc, 0, title_x2, mRect.getHeight(),
250 fetch_state_desc[state].color,
251 LLFontGL::LEFT, LLFontGL::TOP);
252 LLGLSNoTexture gls_no_texture;
253
254 // Draw the progress bar.
255 S32 bar_width = 100;
256 S32 bar_left = 280;
257 left = bar_left;
258 right = left + bar_width;
259
260 glColor4f(0.f, 0.f, 0.f, 0.75f);
261 gl_rect_2d(left, top, right, bottom);
262
263 F32 data_progress = mImagep->mDownloadProgress;
264
265 if (data_progress > 0.0f)
266 {
267 // Downloaded bytes
268 right = left + llfloor(data_progress * (F32)bar_width);
269 if (right > left)
270 {
271 glColor4f(0.f, 0.f, 1.f, 0.75f);
272 gl_rect_2d(left, top, right, bottom);
273 }
274 }
275
276 S32 pip_width = 6;
277 S32 pip_space = 14;
278 S32 pip_x = title_x3 + pip_space/2;
279
280 // Draw the packet pip
281 F32 last_event = mImagep->mLastPacketTimer.getElapsedTimeF32();
282 if (last_event < 1.f)
283 {
284 clr = LLColor4::white;
285 }
286 else
287 {
288 last_event = mImagep->mRequestDeltaTime;
289 if (last_event < 1.f)
290 {
291 clr = LLColor4::green;
292 }
66 else 293 else
67 return i1p->getID() < i2p->getID(); 294 {
295 last_event = mImagep->mFetchDeltaTime;
296 if (last_event < 1.f)
297 {
298 clr = LLColor4::yellow;
299 }
300 }
301 }
302 if (last_event < 1.f)
303 {
304 clr.setAlpha(1.f - last_event);
305 glColor4fv(clr.mV);
306 gl_rect_2d(pip_x, top, pip_x + pip_width, bottom);
68 } 307 }
308 pip_x += pip_width + pip_space;
309
310 // we don't want to show bind/resident pips for textures using the default texture
311 if (mImagep->getHasGLTexture())
312 {
313 // Draw the bound pip
314 last_event = mImagep->sLastFrameTime - mImagep->mLastBindTime;
315 if (last_event < 1.f)
316 {
317 clr = mImagep->getMissed() ? LLColor4::red : LLColor4::magenta1;
318 clr.setAlpha(1.f - last_event);
319 glColor4fv(clr.mV);
320 gl_rect_2d(pip_x, top, pip_x + pip_width, bottom);
321 }
322 }
323 pip_x += pip_width + pip_space;
324
325
326 {
327 LLGLSUIDefault gls_ui;
328 // draw the packet data
329// {
330// LLString num_str = llformat("%3d/%3d", mImagep->mLastPacket+1, mImagep->mPackets);
331// LLFontGL::sMonospace->renderUTF8(num_str, 0, bar_left + 100, mRect.getHeight(), color,
332// LLFontGL::LEFT, LLFontGL::TOP);
333// }
334
335 // draw the image size at the end
336 {
337 LLString num_str = llformat("%3dx%3d (%d) %7d", mImagep->getWidth(), mImagep->getHeight(),
338 mImagep->getDiscardLevel(), mImagep->mTextureMemory);
339 LLFontGL::sMonospace->renderUTF8(num_str, 0, title_x4, mRect.getHeight(), color,
340 LLFontGL::LEFT, LLFontGL::TOP);
341 }
342 }
343
344}
345
346BOOL LLTextureBar::handleMouseDown(S32 x, S32 y, MASK mask)
347{
348 if ((mask & (MASK_CONTROL|MASK_SHIFT|MASK_ALT)) == MASK_ALT)
349 {
350 gTextureFetch->mDebugID = mImagep->getID();
351 return TRUE;
352 }
353 return LLView::handleMouseDown(x,y,mask);
354}
355
356LLRect LLTextureBar::getRequiredRect()
357{
358 LLRect rect;
359
360 rect.mTop = texture_bar_height;
361
362 return rect;
363}
364
365////////////////////////////////////////////////////////////////////////////
366
367class LLGLTexMemBar : public LLView
368{
369public:
370 LLGLTexMemBar(const std::string& name, LLTextureView* texview)
371 : LLView(name, FALSE),
372 mTextureView(texview)
373 {
374 S32 line_height = (S32)(LLFontGL::sMonospace->getLineHeight() + .5f);
375 setRect(LLRect(0,0,100,line_height * 4));
376 updateRect();
377 }
378
379 virtual EWidgetType getWidgetType() const { return WIDGET_TYPE_TEX_MEM_BAR; };
380 virtual LLString getWidgetTag() const { return LL_GL_TEX_MEM_BAR_TAG; };
381
382 virtual void draw();
383 virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask);
384 virtual LLRect getRequiredRect(); // Return the height of this object, given the set options.
385
386private:
387 LLTextureView* mTextureView;
69}; 388};
70 389
390void LLGLTexMemBar::draw()
391{
392 S32 bound_mem = LLViewerImage::sBoundTextureMemory;
393 S32 max_bound_mem = LLViewerImage::sMaxBoundTextureMem;
394 S32 total_mem = LLViewerImage::sTotalTextureMemory;
395 S32 max_total_mem = LLViewerImage::sMaxTotalTextureMem;
396 F32 discard_bias = LLViewerImage::sDesiredDiscardBias;
397 S32 line_height = (S32)(LLFontGL::sMonospace->getLineHeight() + .5f);
398
399 //----------------------------------------------------------------------------
400 LLGLSUIDefault gls_ui;
401 F32 text_color[] = {1.f, 1.f, 1.f, 0.75f};
402
403 std::string text;
404 text = llformat("GL Tot: %d/%d MB Bound: %d/%d MB Discard Bias: %.2f",
405 total_mem/(1024*1024),
406 max_total_mem/(1024*1024),
407 bound_mem/(1024*1024),
408 max_bound_mem/(1024*1024),
409 discard_bias);
410
411 LLFontGL::sMonospace->renderUTF8(text, 0, 0, line_height*3,
412 text_color, LLFontGL::LEFT, LLFontGL::TOP);
413
414 //----------------------------------------------------------------------------
415 S32 bar_left = 380;
416 S32 bar_width = 200;
417 S32 top = line_height*3 - 2;
418 S32 bottom = top - 6;
419 S32 left = bar_left;
420 S32 right = left + bar_width;
421
422 F32 bar_scale = (F32)bar_width / (max_bound_mem * 1.5f);
423
424 LLGLSNoTexture gls_no_texture;
425
426 glColor4f(0.5f, 0.5f, 0.5f, 0.75f);
427 gl_rect_2d(left, top, right, bottom);
428
429
430 left = bar_left;
431 right = left + llfloor(bound_mem * bar_scale);
432 if (bound_mem < llfloor(max_bound_mem * texmem_lower_bound_scale))
433 {
434 glColor4f(0.f, 1.f, 0.f, 0.75f);
435 }
436 else if (bound_mem < max_bound_mem)
437 {
438 glColor4f(1.f, 1.f, 0.f, 0.75f);
439 }
440 else
441 {
442 glColor4f(1.f, 0.f, 0.f, 0.75f);
443 }
444 gl_rect_2d(left, top, right, bottom);
445
446 bar_scale = (F32)bar_width / (max_total_mem * 1.5f);
447
448 top = bottom - 2;
449 bottom = top - 6;
450 left = bar_left;
451 right = left + llfloor(total_mem * bar_scale);
452 if (total_mem < llfloor(max_total_mem * texmem_lower_bound_scale))
453 {
454 glColor4f(0.f, 1.f, 0.f, 0.75f);
455 }
456 else if (total_mem < max_total_mem)
457 {
458 glColor4f(1.f, 1.f, 0.f, 0.75f);
459 }
460 else
461 {
462 glColor4f(1.f, 0.f, 0.f, 0.75f);
463 }
464 gl_rect_2d(left, top, right, bottom);
465
466 //----------------------------------------------------------------------------
467
468 LLGLEnable tex(GL_TEXTURE_2D);
469
470 text = llformat("Textures: Count: %d Fetch: %d(%d) Pkts:%d(%d) Cache R/W: %d/%d LFS:%d IW:%d(%d) RAW:%d",
471 gImageList.getNumImages(),
472 gTextureFetch->getNumRequests(), gTextureFetch->getNumDeletes(),
473 gTextureFetch->mPacketCount, gTextureFetch->mBadPacketCount,
474 gTextureCache->getNumReads(), gTextureCache->getNumWrites(),
475 LLLFSThread::sLocal->getPending(),
476 LLImageWorker::sCount, LLImageWorker::getWorkerThread()->getNumDeletes(),
477 LLImageRaw::sRawImageCount);
478
479 LLFontGL::sMonospace->renderUTF8(text, 0, 0, line_height*2,
480 text_color, LLFontGL::LEFT, LLFontGL::TOP);
481
482 S32 dx1 = 0;
483 if (gTextureFetch->mDebugPause)
484 {
485 LLFontGL::sMonospace->renderUTF8("!", 0, title_x1, line_height,
486 text_color, LLFontGL::LEFT, LLFontGL::TOP);
487 dx1 += 8;
488 }
489 if (mTextureView->mFreezeView)
490 {
491 LLFontGL::sMonospace->renderUTF8("*", 0, title_x1, line_height,
492 text_color, LLFontGL::LEFT, LLFontGL::TOP);
493 dx1 += 8;
494 }
495 if (mTextureView->mOrderFetch)
496 {
497 LLFontGL::sMonospace->renderUTF8(title_string1b, 0, title_x1+dx1, line_height,
498 text_color, LLFontGL::LEFT, LLFontGL::TOP);
499 }
500 else
501 {
502 LLFontGL::sMonospace->renderUTF8(title_string1a, 0, title_x1+dx1, line_height,
503 text_color, LLFontGL::LEFT, LLFontGL::TOP);
504 }
505
506 LLFontGL::sMonospace->renderUTF8(title_string2, 0, title_x2, line_height,
507 text_color, LLFontGL::LEFT, LLFontGL::TOP);
508
509 LLFontGL::sMonospace->renderUTF8(title_string3, 0, title_x3, line_height,
510 text_color, LLFontGL::LEFT, LLFontGL::TOP);
511
512 LLFontGL::sMonospace->renderUTF8(title_string4, 0, title_x4, line_height,
513 text_color, LLFontGL::LEFT, LLFontGL::TOP);
514}
515
516BOOL LLGLTexMemBar::handleMouseDown(S32 x, S32 y, MASK mask)
517{
518 return FALSE;
519}
520
521LLRect LLGLTexMemBar::getRequiredRect()
522{
523 LLRect rect;
524 rect.mTop = 8;
525 return rect;
526}
527
528////////////////////////////////////////////////////////////////////////////
529
71LLTextureView::LLTextureView(const std::string& name, const LLRect& rect) 530LLTextureView::LLTextureView(const std::string& name, const LLRect& rect)
72: LLContainerView(name, rect) 531 : LLContainerView(name, rect),
532 mFreezeView(FALSE),
533 mOrderFetch(FALSE),
534 mPrintList(FALSE),
535 mNumTextureBars(0)
73{ 536{
74 setVisible(FALSE); 537 setVisible(FALSE);
75 mFreezeView = FALSE;
76 538
77 mNumTextureBars = 0;
78 setDisplayChildren(TRUE); 539 setDisplayChildren(TRUE);
79 mGLTexMemBar = 0; 540 mGLTexMemBar = 0;
80} 541}
@@ -122,46 +583,79 @@ void LLTextureView::draw()
122 typedef std::multiset<decode_pair_t, compare_decode_pair > display_list_t; 583 typedef std::multiset<decode_pair_t, compare_decode_pair > display_list_t;
123 display_list_t display_image_list; 584 display_list_t display_image_list;
124 585
125 for (LLViewerImageList::image_list_t::iterator iter = gImageList.mImageList.begin(); 586 if (mPrintList)
587 {
588 llinfos << "ID\tMEM\tBOOST\tPRI\tWIDTH\tHEIGHT\tDISCARD" << llendl;
589 }
590
591 for (LLViewerImageList::image_priority_list_t::iterator iter = gImageList.mImageList.begin();
126 iter != gImageList.mImageList.end(); ) 592 iter != gImageList.mImageList.end(); )
127 { 593 {
128 LLPointer<LLViewerImage> imagep = *iter++; 594 LLPointer<LLViewerImage> imagep = *iter++;
129#if 1 595
596 S32 cur_discard = imagep->getDiscardLevel();
597 S32 desired_discard = imagep->mDesiredDiscardLevel;
598
599 if (mPrintList)
600 {
601 llinfos << imagep->getID()
602 << "\t" << imagep->mTextureMemory
603 << "\t" << imagep->getBoostLevel()
604 << "\t" << imagep->getDecodePriority()
605 << "\t" << imagep->getWidth()
606 << "\t" << imagep->getHeight()
607 << "\t" << cur_discard
608 << llendl;
609 }
610
611#if 0
130 if (imagep->getDontDiscard()) 612 if (imagep->getDontDiscard())
131 { 613 {
132 continue; 614 continue;
133 } 615 }
134#endif 616
135 if (imagep->isMissingAsset()) 617 if (imagep->isMissingAsset())
136 { 618 {
137 continue; 619 continue;
138 } 620 }
139 621#endif
140#define HIGH_PRIORITY 100000000.f
141 F32 pri = imagep->getDecodePriority();
142 622
143 if (sDebugImages.find(imagep) != sDebugImages.end()) 623#define HIGH_PRIORITY 100000000.f
624 F32 pri;
625 if (mOrderFetch)
626 {
627 pri = ((F32)imagep->mFetchPriority)/256.f;
628 }
629 else
144 { 630 {
145 pri += 3*HIGH_PRIORITY; 631 pri = imagep->getDecodePriority();
146 } 632 }
147 633
634 if (sDebugImages.find(imagep) != sDebugImages.end())
635 {
636 pri += 4*HIGH_PRIORITY;
637 }
638
639 if (!mOrderFetch)
640 {
148#if 1 641#if 1
149 if (pri < HIGH_PRIORITY && gSelectMgr) 642 if (pri < HIGH_PRIORITY && gSelectMgr)
150 { 643 {
151 S32 te; 644 S32 te;
152 LLViewerObject *objectp; 645 LLViewerObject *objectp;
153 for (gSelectMgr->getFirstTE(&objectp, &te); objectp; gSelectMgr->getNextTE(&objectp, &te)) 646 LLObjectSelectionHandle selection = gSelectMgr->getSelection();
647 for (selection->getFirstTE(&objectp, &te); objectp; selection->getNextTE(&objectp, &te))
154 { 648 {
155 if (imagep == objectp->getTEImage(te)) 649 if (imagep == objectp->getTEImage(te))
156 { 650 {
157 pri += 2*HIGH_PRIORITY; 651 pri += 3*HIGH_PRIORITY;
158 break; 652 break;
159 } 653 }
160 } 654 }
161 } 655 }
162#endif 656#endif
163#if 1 657#if 1
164 if (pri < HIGH_PRIORITY) 658 if (pri < HIGH_PRIORITY && (cur_discard< 0 || desired_discard < cur_discard))
165 { 659 {
166 LLViewerObject *objectp = gHoverView->getLastHoverObject(); 660 LLViewerObject *objectp = gHoverView->getLastHoverObject();
167 if (objectp) 661 if (objectp)
@@ -178,31 +672,29 @@ void LLTextureView::draw()
178 } 672 }
179 } 673 }
180#endif 674#endif
181#if 0
182 if (pri < HIGH_PRIORITY)
183 {
184 if (imagep->mBoostPriority)
185 {
186 pri += 4*HIGH_PRIORITY;
187 }
188 }
189#endif
190#if 1 675#if 1
191 if (pri > 0.f && pri < HIGH_PRIORITY) 676 if (pri > 0.f && pri < HIGH_PRIORITY)
192 { 677 {
193 if (imagep->mLastPacketTimer.getElapsedTimeF32() < 1.f || 678 if (imagep->mLastPacketTimer.getElapsedTimeF32() < 1.f ||
194 imagep->mLastDecodeTime.getElapsedTimeF32() < 1.f) 679 imagep->mFetchDeltaTime < 0.25f)
195 { 680 {
196 pri += 1*HIGH_PRIORITY; 681 pri += 1*HIGH_PRIORITY;
197 } 682 }
198 } 683 }
199#endif 684#endif
200// if (pri > 0.0f) 685 }
686
687 if (pri > 0.0f)
201 { 688 {
202 display_image_list.insert(std::make_pair(pri, imagep)); 689 display_image_list.insert(std::make_pair(pri, imagep));
203 } 690 }
204 } 691 }
205 692
693 if (mPrintList)
694 {
695 mPrintList = FALSE;
696 }
697
206 static S32 max_count = 50; 698 static S32 max_count = 50;
207 S32 count = 0; 699 S32 count = 0;
208 for (display_list_t::iterator iter = display_image_list.begin(); 700 for (display_list_t::iterator iter = display_image_list.begin();
@@ -224,9 +716,12 @@ void LLTextureView::draw()
224 } 716 }
225 } 717 }
226 718
227 sortChildren(SortTextureBars()); 719 if (mOrderFetch)
228 720 sortChildren(LLTextureBar::sort_fetch());
229 mGLTexMemBar = new LLGLTexMemBar("gl texmem bar"); 721 else
722 sortChildren(LLTextureBar::sort());
723
724 mGLTexMemBar = new LLGLTexMemBar("gl texmem bar", this);
230 addChild(mGLTexMemBar); 725 addChild(mGLTexMemBar);
231 726
232 reshape(mRect.getWidth(), mRect.getHeight(), TRUE); 727 reshape(mRect.getWidth(), mRect.getHeight(), TRUE);
@@ -256,54 +751,46 @@ void LLTextureView::draw()
256 751
257BOOL LLTextureView::addBar(LLViewerImage *imagep, S32 hilite) 752BOOL LLTextureView::addBar(LLViewerImage *imagep, S32 hilite)
258{ 753{
259 if (!imagep) 754 llassert(imagep);
260 { 755
261 return FALSE;
262 }
263
264 LLTextureBar *barp; 756 LLTextureBar *barp;
265 LLRect r; 757 LLRect r;
266 758
267 mNumTextureBars++; 759 mNumTextureBars++;
268 760
269 for (std::vector<LLTextureBar*>::iterator iter = mTextureBars.begin(); 761 barp = new LLTextureBar("texture bar", r, this);
270 iter != mTextureBars.end(); iter++)
271 {
272 LLTextureBar* barp = *iter;
273 if (barp->mImagep == imagep)
274 {
275 barp->mHilite = hilite;
276 return FALSE;
277 }
278 }
279
280 barp = new LLTextureBar("texture bar", r);
281 barp->mImagep = imagep; 762 barp->mImagep = imagep;
282 barp->mHilite = hilite; 763 barp->mHilite = hilite;
283 764
284 addChild(barp); 765 addChild(barp);
285 mTextureBars.push_back(barp); 766 mTextureBars.push_back(barp);
286 767
287 // Rearrange all child bars.
288 reshape(mRect.getWidth(), mRect.getHeight());
289 return TRUE; 768 return TRUE;
290} 769}
291 770
292BOOL LLTextureView::handleMouseDown(S32 x, S32 y, MASK mask) 771BOOL LLTextureView::handleMouseDown(S32 x, S32 y, MASK mask)
293{ 772{
294 if (mask & MASK_SHIFT) 773 if ((mask & (MASK_CONTROL|MASK_SHIFT|MASK_ALT)) == (MASK_ALT|MASK_SHIFT))
295 { 774 {
296 mFreezeView = !mFreezeView; 775 mPrintList = TRUE;
297 return TRUE; 776 return TRUE;
298 } 777 }
299 else if (mask & MASK_CONTROL) 778 if ((mask & (MASK_CONTROL|MASK_SHIFT|MASK_ALT)) == (MASK_CONTROL|MASK_SHIFT))
300 { 779 {
301 return FALSE; 780 gTextureFetch->mDebugPause = !gTextureFetch->mDebugPause;
781 return TRUE;
302 } 782 }
303 else 783 if (mask & MASK_SHIFT)
304 { 784 {
305 return FALSE; 785 mFreezeView = !mFreezeView;
786 return TRUE;
306 } 787 }
788 if (mask & MASK_CONTROL)
789 {
790 mOrderFetch = !mOrderFetch;
791 return TRUE;
792 }
793 return LLView::handleMouseDown(x,y,mask);
307} 794}
308 795
309BOOL LLTextureView::handleMouseUp(S32 x, S32 y, MASK mask) 796BOOL LLTextureView::handleMouseUp(S32 x, S32 y, MASK mask)
@@ -313,11 +800,6 @@ BOOL LLTextureView::handleMouseUp(S32 x, S32 y, MASK mask)
313 800
314BOOL LLTextureView::handleKey(KEY key, MASK mask, BOOL called_from_parent) 801BOOL LLTextureView::handleKey(KEY key, MASK mask, BOOL called_from_parent)
315{ 802{
316 if (key == ' ')
317 {
318 mFreezeView = !mFreezeView;
319 return TRUE;
320 }
321 return FALSE; 803 return FALSE;
322} 804}
323 805
diff --git a/linden/indra/newview/lltextureview.h b/linden/indra/newview/lltextureview.h
index bfeb8f9..70ca39a 100644
--- a/linden/indra/newview/lltextureview.h
+++ b/linden/indra/newview/lltextureview.h
@@ -28,14 +28,17 @@
28#ifndef LL_LLTEXTUREVIEW_H 28#ifndef LL_LLTEXTUREVIEW_H
29#define LL_LLTEXTUREVIEW_H 29#define LL_LLTEXTUREVIEW_H
30 30
31#include "lltexturebar.h"
32#include "llcontainerview.h" 31#include "llcontainerview.h"
33#include "linked_lists.h" 32#include "linked_lists.h"
34 33
35class LLViewerImage; 34class LLViewerImage;
35class LLTextureBar;
36class LLGLTexMemBar;
36 37
37class LLTextureView : public LLContainerView 38class LLTextureView : public LLContainerView
38{ 39{
40 friend class LLTextureBar;
41 friend class LLGLTexMemBar;
39public: 42public:
40 LLTextureView(const std::string& name, const LLRect& rect); 43 LLTextureView(const std::string& name, const LLRect& rect);
41 ~LLTextureView(); 44 ~LLTextureView();
@@ -55,16 +58,18 @@ public:
55private: 58private:
56 BOOL addBar(LLViewerImage *image, BOOL hilight = FALSE); 59 BOOL addBar(LLViewerImage *image, BOOL hilight = FALSE);
57 void removeAllBars(); 60 void removeAllBars();
58 61
59private: 62private:
63 BOOL mFreezeView;
64 BOOL mOrderFetch;
65 BOOL mPrintList;
66
60 LLTextBox *mInfoTextp; 67 LLTextBox *mInfoTextp;
61 68
62 std::vector<LLTextureBar*> mTextureBars; 69 std::vector<LLTextureBar*> mTextureBars;
63 U32 mNumTextureBars; 70 U32 mNumTextureBars;
64 71
65 LLGLTexMemBar* mGLTexMemBar; 72 LLGLTexMemBar* mGLTexMemBar;
66
67 BOOL mFreezeView;
68 73
69public: 74public:
70 static std::set<LLViewerImage*> sDebugImages; 75 static std::set<LLViewerImage*> sDebugImages;
diff --git a/linden/indra/newview/lltool.cpp b/linden/indra/newview/lltool.cpp
index d004a2d..9489a2b 100644
--- a/linden/indra/newview/lltool.cpp
+++ b/linden/indra/newview/lltool.cpp
@@ -35,6 +35,7 @@
35 35
36#include "llviewerwindow.h" 36#include "llviewerwindow.h"
37#include "lltoolcomp.h" 37#include "lltoolcomp.h"
38#include "lltoolfocus.h"
38#include "llfocusmgr.h" 39#include "llfocusmgr.h"
39#include "llagent.h" 40#include "llagent.h"
40#include "llviewborder.h" 41#include "llviewborder.h"
@@ -154,6 +155,14 @@ BOOL LLTool::handleKey(KEY key, MASK mask)
154 return FALSE; 155 return FALSE;
155} 156}
156 157
158LLTool* LLTool::getOverrideTool(MASK mask)
159{
160 if (mask & MASK_ALT)
161 {
162 return gToolCamera;
163 }
164 return NULL;
165}
157 166
158// static 167// static
159void LLTool::onMouseCaptureLost( LLMouseHandler* old_captor ) 168void LLTool::onMouseCaptureLost( LLMouseHandler* old_captor )
diff --git a/linden/indra/newview/lltool.h b/linden/indra/newview/lltool.h
index 3116c72..866755a 100644
--- a/linden/indra/newview/lltool.h
+++ b/linden/indra/newview/lltool.h
@@ -77,6 +77,8 @@ public:
77 virtual void handleSelect() { } // do stuff when your tool is selected 77 virtual void handleSelect() { } // do stuff when your tool is selected
78 virtual void handleDeselect() { } // clean up when your tool is deselected 78 virtual void handleDeselect() { } // clean up when your tool is deselected
79 79
80 virtual LLTool* getOverrideTool(MASK mask);
81
80 // isAlwaysRendered() - return true if this is a tool that should 82 // isAlwaysRendered() - return true if this is a tool that should
81 // always be rendered regardless of selection. 83 // always be rendered regardless of selection.
82 virtual BOOL isAlwaysRendered() { return FALSE; } 84 virtual BOOL isAlwaysRendered() { return FALSE; }
diff --git a/linden/indra/newview/lltoolbrush.cpp b/linden/indra/newview/lltoolbrush.cpp
index 1822c63..210a1e7 100644
--- a/linden/indra/newview/lltoolbrush.cpp
+++ b/linden/indra/newview/lltoolbrush.cpp
@@ -182,7 +182,7 @@ void LLToolBrushLand::modifyLandInSelectionGlobal()
182 return; 182 return;
183 } 183 }
184 184
185 if (gToolMgr->getCurrentTool(gKeyboard->currentMask(TRUE)) == gToolParcel) 185 if (gToolMgr->getCurrentTool() == gToolParcel)
186 { 186 {
187 // selecting land, don't do anything 187 // selecting land, don't do anything
188 return; 188 return;
@@ -301,8 +301,8 @@ void LLToolBrushLand::modifyLandInSelectionGlobal()
301 msg->addF32Fast(_PREHASH_Seconds, seconds); 301 msg->addF32Fast(_PREHASH_Seconds, seconds);
302 msg->addF32Fast(_PREHASH_Height, mStartingZ); 302 msg->addF32Fast(_PREHASH_Height, mStartingZ);
303 303
304 BOOL parcel_selected = gParcelMgr->getWholeParcelSelected(); 304 BOOL parcel_selected = gParcelMgr->getParcelSelection()->getWholeParcelSelected();
305 LLParcel* selected_parcel = gParcelMgr->getSelectedParcel(); 305 LLParcel* selected_parcel = gParcelMgr->getParcelSelection()->getParcel();
306 306
307 if (parcel_selected && selected_parcel) 307 if (parcel_selected && selected_parcel)
308 { 308 {
@@ -535,7 +535,7 @@ void LLToolBrushLand::onIdle( void* brush_tool )
535{ 535{
536 LLToolBrushLand* self = reinterpret_cast<LLToolBrushLand*>(brush_tool); 536 LLToolBrushLand* self = reinterpret_cast<LLToolBrushLand*>(brush_tool);
537 537
538 if( gToolMgr->getCurrentTool( gKeyboard->currentMask(TRUE) ) == self ) 538 if( gToolMgr->getCurrentTool() == self )
539 { 539 {
540 self->brush(); 540 self->brush();
541 } 541 }
diff --git a/linden/indra/newview/lltoolcomp.cpp b/linden/indra/newview/lltoolcomp.cpp
index 0ef710d..8898dcb 100644
--- a/linden/indra/newview/lltoolcomp.cpp
+++ b/linden/indra/newview/lltoolcomp.cpp
@@ -167,7 +167,7 @@ void LLToolCompInspect::pickCallback(S32 x, S32 y, MASK mask)
167 167
168 if( hit_obj ) 168 if( hit_obj )
169 { 169 {
170 if (gSelectMgr->getObjectCount()) 170 if (gSelectMgr->getSelection()->getObjectCount())
171 { 171 {
172 gEditMenuHandler = gSelectMgr; 172 gEditMenuHandler = gSelectMgr;
173 } 173 }
@@ -223,7 +223,7 @@ BOOL LLToolCompTranslate::handleHover(S32 x, S32 y, MASK mask)
223BOOL LLToolCompTranslate::handleMouseDown(S32 x, S32 y, MASK mask) 223BOOL LLToolCompTranslate::handleMouseDown(S32 x, S32 y, MASK mask)
224{ 224{
225 mMouseDown = TRUE; 225 mMouseDown = TRUE;
226 gViewerWindow->hitObjectOrLandGlobalAsync(x, y, mask, pickCallback); 226 gViewerWindow->hitObjectOrLandGlobalAsync(x, y, mask, pickCallback, TRUE);
227 return TRUE; 227 return TRUE;
228} 228}
229 229
@@ -241,7 +241,7 @@ void LLToolCompTranslate::pickCallback(S32 x, S32 y, MASK mask)
241 241
242 if( hit_obj || gToolTranslate->mManip->getHighlightedPart() != LLManip::LL_NO_PART ) 242 if( hit_obj || gToolTranslate->mManip->getHighlightedPart() != LLManip::LL_NO_PART )
243 { 243 {
244 if (gSelectMgr->getObjectCount()) 244 if (gToolTranslate->mManip->getSelection()->getObjectCount())
245 { 245 {
246 gEditMenuHandler = gSelectMgr; 246 gEditMenuHandler = gSelectMgr;
247 } 247 }
@@ -272,9 +272,22 @@ BOOL LLToolCompTranslate::handleMouseUp(S32 x, S32 y, MASK mask)
272 return LLToolComposite::handleMouseUp(x, y, mask); 272 return LLToolComposite::handleMouseUp(x, y, mask);
273} 273}
274 274
275LLTool* LLToolCompTranslate::getOverrideTool(MASK mask)
276{
277 if (mask == MASK_CONTROL)
278 {
279 return gToolRotate;
280 }
281 else if (mask == (MASK_CONTROL | MASK_SHIFT))
282 {
283 return gToolStretch;
284 }
285 return LLToolComposite::getOverrideTool(mask);
286}
287
275BOOL LLToolCompTranslate::handleDoubleClick(S32 x, S32 y, MASK mask) 288BOOL LLToolCompTranslate::handleDoubleClick(S32 x, S32 y, MASK mask)
276{ 289{
277 if (!gSelectMgr->isEmpty() && mManip->getHighlightedPart() == LLManip::LL_NO_PART) 290 if (mManip->getSelection()->isEmpty() && mManip->getHighlightedPart() == LLManip::LL_NO_PART)
278 { 291 {
279 // You should already have an object selected from the mousedown. 292 // You should already have an object selected from the mousedown.
280 // If so, show its properties 293 // If so, show its properties
@@ -350,7 +363,7 @@ void LLToolCompScale::pickCallback(S32 x, S32 y, MASK mask)
350 363
351 if( hit_obj || gToolStretch->mManip->getHighlightedPart() != LLManip::LL_NO_PART) 364 if( hit_obj || gToolStretch->mManip->getHighlightedPart() != LLManip::LL_NO_PART)
352 { 365 {
353 if (gSelectMgr->getObjectCount()) 366 if (gToolStretch->mManip->getSelection()->getObjectCount())
354 { 367 {
355 gEditMenuHandler = gSelectMgr; 368 gEditMenuHandler = gSelectMgr;
356 } 369 }
@@ -378,9 +391,20 @@ BOOL LLToolCompScale::handleMouseUp(S32 x, S32 y, MASK mask)
378 return LLToolComposite::handleMouseUp(x, y, mask); 391 return LLToolComposite::handleMouseUp(x, y, mask);
379} 392}
380 393
394LLTool* LLToolCompScale::getOverrideTool(MASK mask)
395{
396 if (mask == MASK_CONTROL)
397 {
398 return gToolRotate;
399 }
400
401 return LLToolComposite::getOverrideTool(mask);
402}
403
404
381BOOL LLToolCompScale::handleDoubleClick(S32 x, S32 y, MASK mask) 405BOOL LLToolCompScale::handleDoubleClick(S32 x, S32 y, MASK mask)
382{ 406{
383 if (!gSelectMgr->isEmpty() && mManip->getHighlightedPart() == LLManip::LL_NO_PART) 407 if (!mManip->getSelection()->isEmpty() && mManip->getHighlightedPart() == LLManip::LL_NO_PART)
384 { 408 {
385 // You should already have an object selected from the mousedown. 409 // You should already have an object selected from the mousedown.
386 // If so, show its properties 410 // If so, show its properties
@@ -480,6 +504,11 @@ BOOL LLToolCompCreate::handleMouseUp(S32 x, S32 y, MASK mask)
480 mObjectPlacedOnMouseDown = FALSE; 504 mObjectPlacedOnMouseDown = FALSE;
481 mMouseDown = FALSE; 505 mMouseDown = FALSE;
482 506
507 if (!handled)
508 {
509 handled = LLToolComposite::handleMouseUp(x, y, mask);
510 }
511
483 return handled; 512 return handled;
484} 513}
485 514
@@ -534,7 +563,7 @@ void LLToolCompRotate::pickCallback(S32 x, S32 y, MASK mask)
534 563
535 if( hit_obj || gToolRotate->mManip->getHighlightedPart() != LLManip::LL_NO_PART) 564 if( hit_obj || gToolRotate->mManip->getHighlightedPart() != LLManip::LL_NO_PART)
536 { 565 {
537 if (gSelectMgr->getObjectCount()) 566 if (gToolRotate->mManip->getSelection()->getObjectCount())
538 { 567 {
539 gEditMenuHandler = gSelectMgr; 568 gEditMenuHandler = gSelectMgr;
540 } 569 }
@@ -562,10 +591,18 @@ BOOL LLToolCompRotate::handleMouseUp(S32 x, S32 y, MASK mask)
562 return LLToolComposite::handleMouseUp(x, y, mask); 591 return LLToolComposite::handleMouseUp(x, y, mask);
563} 592}
564 593
594LLTool* LLToolCompRotate::getOverrideTool(MASK mask)
595{
596 if (mask == (MASK_CONTROL | MASK_SHIFT))
597 {
598 return gToolStretch;
599 }
600 return LLToolComposite::getOverrideTool(mask);
601}
565 602
566BOOL LLToolCompRotate::handleDoubleClick(S32 x, S32 y, MASK mask) 603BOOL LLToolCompRotate::handleDoubleClick(S32 x, S32 y, MASK mask)
567{ 604{
568 if (!gSelectMgr->isEmpty() && mManip->getHighlightedPart() == LLManip::LL_NO_PART) 605 if (!mManip->getSelection()->isEmpty() && mManip->getHighlightedPart() == LLManip::LL_NO_PART)
569 { 606 {
570 // You should already have an object selected from the mousedown. 607 // You should already have an object selected from the mousedown.
571 // If so, show its properties 608 // If so, show its properties
@@ -668,7 +705,7 @@ BOOL LLToolCompGun::handleMouseDown(S32 x, S32 y, MASK mask)
668 705
669 // On mousedown, start grabbing 706 // On mousedown, start grabbing
670 gGrabTransientTool = this; 707 gGrabTransientTool = this;
671 gCurrentToolset->selectTool( (LLTool*) mGrab ); 708 gToolMgr->getCurrentToolset()->selectTool( (LLTool*) mGrab );
672 709
673 return gToolGrab->handleMouseDown(x, y, mask); 710 return gToolGrab->handleMouseDown(x, y, mask);
674} 711}
@@ -685,7 +722,7 @@ BOOL LLToolCompGun::handleDoubleClick(S32 x, S32 y, MASK mask)
685 722
686 // On mousedown, start grabbing 723 // On mousedown, start grabbing
687 gGrabTransientTool = this; 724 gGrabTransientTool = this;
688 gCurrentToolset->selectTool( (LLTool*) mGrab ); 725 gToolMgr->getCurrentToolset()->selectTool( (LLTool*) mGrab );
689 726
690 return gToolGrab->handleDoubleClick(x, y, mask); 727 return gToolGrab->handleDoubleClick(x, y, mask);
691} 728}
diff --git a/linden/indra/newview/lltoolcomp.h b/linden/indra/newview/lltoolcomp.h
index 143b5b1..d75cd11 100644
--- a/linden/indra/newview/lltoolcomp.h
+++ b/linden/indra/newview/lltoolcomp.h
@@ -129,6 +129,8 @@ public:
129 virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask); // Returns to the default tool 129 virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask); // Returns to the default tool
130 virtual void render(); 130 virtual void render();
131 131
132 virtual LLTool* getOverrideTool(MASK mask);
133
132 static void pickCallback(S32 x, S32 y, MASK mask); 134 static void pickCallback(S32 x, S32 y, MASK mask);
133}; 135};
134 136
@@ -148,8 +150,9 @@ public:
148 virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask); // Returns to the default tool 150 virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask); // Returns to the default tool
149 virtual void render(); 151 virtual void render();
150 152
153 virtual LLTool* getOverrideTool(MASK mask);
154
151 static void pickCallback(S32 x, S32 y, MASK mask); 155 static void pickCallback(S32 x, S32 y, MASK mask);
152
153}; 156};
154 157
155 158
@@ -169,6 +172,8 @@ public:
169 virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask); 172 virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask);
170 virtual void render(); 173 virtual void render();
171 174
175 virtual LLTool* getOverrideTool(MASK mask);
176
172 static void pickCallback(S32 x, S32 y, MASK mask); 177 static void pickCallback(S32 x, S32 y, MASK mask);
173 178
174protected: 179protected:
diff --git a/linden/indra/newview/lltooldraganddrop.cpp b/linden/indra/newview/lltooldraganddrop.cpp
index 398263f..ffa124f 100644
--- a/linden/indra/newview/lltooldraganddrop.cpp
+++ b/linden/indra/newview/lltooldraganddrop.cpp
@@ -601,6 +601,7 @@ LLToolDragAndDrop::LLToolDragAndDrop()
601 LLTool("draganddrop", NULL), 601 LLTool("draganddrop", NULL),
602 mDragStartX(0), 602 mDragStartX(0),
603 mDragStartY(0), 603 mDragStartY(0),
604 mSource(SOURCE_AGENT),
604 mCursor(UI_CURSOR_NO), 605 mCursor(UI_CURSOR_NO),
605 mLastAccept(ACCEPT_NO), 606 mLastAccept(ACCEPT_NO),
606 mDrop(FALSE), 607 mDrop(FALSE),
@@ -1203,6 +1204,8 @@ BOOL LLToolDragAndDrop::handleDropTextureProtections(LLViewerObject* hit_obj,
1203 return TRUE; 1204 return TRUE;
1204 } 1205 }
1205 1206
1207 if (!item) return FALSE;
1208
1206 LLPointer<LLViewerInventoryItem> new_item = new LLViewerInventoryItem(item); 1209 LLPointer<LLViewerInventoryItem> new_item = new LLViewerInventoryItem(item);
1207 if(!item->getPermissions().allowOperationBy(PERM_COPY, gAgent.getID())) 1210 if(!item->getPermissions().allowOperationBy(PERM_COPY, gAgent.getID()))
1208 { 1211 {
@@ -1258,6 +1261,11 @@ void LLToolDragAndDrop::dropTextureAllFaces(LLViewerObject* hit_obj,
1258 LLToolDragAndDrop::ESource source, 1261 LLToolDragAndDrop::ESource source,
1259 const LLUUID& src_id) 1262 const LLUUID& src_id)
1260{ 1263{
1264 if (!item)
1265 {
1266 llwarns << "LLToolDragAndDrop::dropTextureAllFaces no texture item." << llendl;
1267 return;
1268 }
1261 LLUUID asset_id = item->getAssetUUID(); 1269 LLUUID asset_id = item->getAssetUUID();
1262 BOOL success = handleDropTextureProtections(hit_obj, item, source, src_id); 1270 BOOL success = handleDropTextureProtections(hit_obj, item, source, src_id);
1263 if(!success) 1271 if(!success)
@@ -1273,11 +1281,9 @@ void LLToolDragAndDrop::dropTextureAllFaces(LLViewerObject* hit_obj,
1273 // update viewer side image in anticipation of update from simulator 1281 // update viewer side image in anticipation of update from simulator
1274 hit_obj->setTEImage(face, image); 1282 hit_obj->setTEImage(face, image);
1275 dialog_refresh_all(); 1283 dialog_refresh_all();
1276
1277 // send the update to the simulator
1278 hit_obj->sendTEUpdate();
1279 } 1284 }
1280 1285 // send the update to the simulator
1286 hit_obj->sendTEUpdate();
1281} 1287}
1282 1288
1283/* 1289/*
@@ -1480,6 +1486,9 @@ void LLToolDragAndDrop::dropObject(LLViewerObject* raycast_target,
1480 // since it's coming from the library or trash, we want to not 1486 // since it's coming from the library or trash, we want to not
1481 // 'take' it back to the same place. 1487 // 'take' it back to the same place.
1482 item->setParent(LLUUID::null); 1488 item->setParent(LLUUID::null);
1489 // *TODO this code isn't working - the parent (FolderID) is still
1490 // set when the object is "taken". so code on the "take" side is
1491 // checking for trash and library as well (llviewermenu.cpp)
1483 } 1492 }
1484 if (mSource == SOURCE_NOTECARD) 1493 if (mSource == SOURCE_NOTECARD)
1485 { 1494 {
@@ -1662,7 +1671,7 @@ void LLToolDragAndDrop::commitGiveInventoryItem(const LLUUID& to_agent,
1662 const S32 BUCKET_SIZE = sizeof(U8) + UUID_BYTES; 1671 const S32 BUCKET_SIZE = sizeof(U8) + UUID_BYTES;
1663 U8 bucket[BUCKET_SIZE]; 1672 U8 bucket[BUCKET_SIZE];
1664 bucket[0] = (U8)item->getType(); 1673 bucket[0] = (U8)item->getType();
1665 memcpy(&bucket[1], &(item->getUUID().mData), UUID_BYTES); 1674 memcpy(&bucket[1], &(item->getUUID().mData), UUID_BYTES); /* Flawfinder: ignore */
1666 pack_instant_message( 1675 pack_instant_message(
1667 gMessageSystem, 1676 gMessageSystem,
1668 gAgent.getID(), 1677 gAgent.getID(),
@@ -1842,26 +1851,26 @@ void LLToolDragAndDrop::commitGiveInventoryCategory(const LLUUID& to_agent,
1842 U8* bucket = new U8[bucket_size]; 1851 U8* bucket = new U8[bucket_size];
1843 U8* pos = bucket; 1852 U8* pos = bucket;
1844 U8 type = (U8)cat->getType(); 1853 U8 type = (U8)cat->getType();
1845 memcpy(pos, &type, sizeof(U8)); 1854 memcpy(pos, &type, sizeof(U8)); /* Flawfinder: ignore */
1846 pos += sizeof(U8); 1855 pos += sizeof(U8);
1847 memcpy(pos, &(cat->getUUID()), UUID_BYTES); 1856 memcpy(pos, &(cat->getUUID()), UUID_BYTES); /* Flawfinder: ignore */
1848 pos += UUID_BYTES; 1857 pos += UUID_BYTES;
1849 S32 i; 1858 S32 i;
1850 count = cats.count(); 1859 count = cats.count();
1851 for(i = 0; i < count; ++i) 1860 for(i = 0; i < count; ++i)
1852 { 1861 {
1853 memcpy(pos, &type, sizeof(U8)); 1862 memcpy(pos, &type, sizeof(U8)); /* Flawfinder: ignore */
1854 pos += sizeof(U8); 1863 pos += sizeof(U8);
1855 memcpy(pos, &(cats.get(i)->getUUID()), UUID_BYTES); 1864 memcpy(pos, &(cats.get(i)->getUUID()), UUID_BYTES); /* Flawfinder: ignore */
1856 pos += UUID_BYTES; 1865 pos += UUID_BYTES;
1857 } 1866 }
1858 count = items.count(); 1867 count = items.count();
1859 for(i = 0; i < count; ++i) 1868 for(i = 0; i < count; ++i)
1860 { 1869 {
1861 type = (U8)items.get(i)->getType(); 1870 type = (U8)items.get(i)->getType();
1862 memcpy(pos, &type, sizeof(U8)); 1871 memcpy(pos, &type, sizeof(U8)); /* Flawfinder: ignore */
1863 pos += sizeof(U8); 1872 pos += sizeof(U8);
1864 memcpy(pos, &(items.get(i)->getUUID()), UUID_BYTES); 1873 memcpy(pos, &(items.get(i)->getUUID()), UUID_BYTES); /* Flawfinder: ignore */
1865 pos += UUID_BYTES; 1874 pos += UUID_BYTES;
1866 } 1875 }
1867 pack_instant_message( 1876 pack_instant_message(
@@ -2320,6 +2329,12 @@ EAcceptance LLToolDragAndDrop::dad3dTextureObject(
2320 { 2329 {
2321 return ACCEPT_NO_LOCKED; 2330 return ACCEPT_NO_LOCKED;
2322 } 2331 }
2332 //If texture !copyable don't texture or you'll never get it back.
2333 if(!item->getPermissions().allowCopyBy(gAgent.getID()))
2334 {
2335 return ACCEPT_NO;
2336 }
2337
2323 if(drop && (ACCEPT_YES_SINGLE <= rv)) 2338 if(drop && (ACCEPT_YES_SINGLE <= rv))
2324 { 2339 {
2325 if((mask & MASK_SHIFT)) 2340 if((mask & MASK_SHIFT))
diff --git a/linden/indra/newview/lltoolface.cpp b/linden/indra/newview/lltoolface.cpp
index 504a787..b855e0f 100644
--- a/linden/indra/newview/lltoolface.cpp
+++ b/linden/indra/newview/lltoolface.cpp
@@ -61,7 +61,7 @@ LLToolFace::~LLToolFace()
61 61
62BOOL LLToolFace::handleDoubleClick(S32 x, S32 y, MASK mask) 62BOOL LLToolFace::handleDoubleClick(S32 x, S32 y, MASK mask)
63{ 63{
64 if (!gSelectMgr->isEmpty()) 64 if (!gSelectMgr->getSelection()->isEmpty())
65 { 65 {
66 // You should already have an object selected from the mousedown. 66 // You should already have an object selected from the mousedown.
67 // If so, show its properties 67 // If so, show its properties
@@ -109,7 +109,7 @@ void LLToolFace::pickCallback(S32 x, S32 y, MASK mask)
109 // object wasn't selected so add the object and face 109 // object wasn't selected so add the object and face
110 gSelectMgr->selectObjectOnly(hit_obj, hit_face); 110 gSelectMgr->selectObjectOnly(hit_obj, hit_face);
111 } 111 }
112 else if (!gSelectMgr->contains(hit_obj, hit_face) ) 112 else if (!gSelectMgr->getSelection()->contains(hit_obj, hit_face) )
113 { 113 {
114 // object is selected, but not this face, so add it. 114 // object is selected, but not this face, so add it.
115 gSelectMgr->addAsIndividual(hit_obj, hit_face); 115 gSelectMgr->addAsIndividual(hit_obj, hit_face);
diff --git a/linden/indra/newview/lltoolfocus.cpp b/linden/indra/newview/lltoolfocus.cpp
index e57f5fb..479d55c 100644
--- a/linden/indra/newview/lltoolfocus.cpp
+++ b/linden/indra/newview/lltoolfocus.cpp
@@ -62,9 +62,6 @@ BOOL gCameraBtnPan = FALSE;
62const S32 SLOP_RANGE = 4; 62const S32 SLOP_RANGE = 4;
63const F32 FOCUS_OFFSET_FACTOR = 1.f; 63const F32 FOCUS_OFFSET_FACTOR = 1.f;
64 64
65extern void handle_first_tool(void*);
66
67
68// 65//
69// Camera - shared functionality 66// Camera - shared functionality
70// 67//
@@ -91,13 +88,19 @@ LLToolCamera::~LLToolCamera()
91// virtual 88// virtual
92void LLToolCamera::handleSelect() 89void LLToolCamera::handleSelect()
93{ 90{
94 gFloaterTools->setStatusText("Click and drag to change view"); 91 if (gFloaterTools)
92 {
93 gFloaterTools->setStatusText("Click and drag to change view");
94 }
95} 95}
96 96
97// virtual 97// virtual
98void LLToolCamera::handleDeselect() 98void LLToolCamera::handleDeselect()
99{ 99{
100 gFloaterTools->setStatusText(""); 100 if (gFloaterTools)
101 {
102 gFloaterTools->setStatusText("");
103 }
101// gAgent.setLookingAtAvatar(FALSE); 104// gAgent.setLookingAtAvatar(FALSE);
102} 105}
103 106
@@ -155,7 +158,8 @@ void LLToolCamera::pickCallback(S32 x, S32 y, MASK mask)
155 // check for hud attachments 158 // check for hud attachments
156 if (hit_obj && hit_obj->isHUDAttachment()) 159 if (hit_obj && hit_obj->isHUDAttachment())
157 { 160 {
158 if (!gSelectMgr->getObjectCount() || gSelectMgr->getSelectType() != SELECT_TYPE_HUD) 161 LLObjectSelectionHandle selection = gSelectMgr->getSelection();
162 if (!selection->getObjectCount() || selection->getSelectType() != SELECT_TYPE_HUD)
159 { 163 {
160 gToolCamera->mValidClickPoint = FALSE; 164 gToolCamera->mValidClickPoint = FALSE;
161 return; 165 return;
@@ -194,7 +198,7 @@ void LLToolCamera::pickCallback(S32 x, S32 y, MASK mask)
194 } 198 }
195 //RN: check to see if this is mouse-driving as opposed to ALT-zoom or Focus tool 199 //RN: check to see if this is mouse-driving as opposed to ALT-zoom or Focus tool
196 else if (mask & MASK_ALT || 200 else if (mask & MASK_ALT ||
197 (gToolMgr->getCurrentTool(mask)->getName() == "Camera")) 201 (gToolMgr->getCurrentTool()->getName() == "Camera"))
198 { 202 {
199 LLViewerObject* hit_obj = gViewerWindow->lastObjectHit(); 203 LLViewerObject* hit_obj = gViewerWindow->lastObjectHit();
200 if (hit_obj) 204 if (hit_obj)
diff --git a/linden/indra/newview/lltoolfocus.h b/linden/indra/newview/lltoolfocus.h
index 9b15463..26a7085 100644
--- a/linden/indra/newview/lltoolfocus.h
+++ b/linden/indra/newview/lltoolfocus.h
@@ -46,6 +46,8 @@ public:
46 virtual void handleSelect(); 46 virtual void handleSelect();
47 virtual void handleDeselect(); 47 virtual void handleDeselect();
48 48
49 virtual LLTool* getOverrideTool(MASK mask) { return NULL; }
50
49 static void pickCallback(S32 x, S32 y, MASK mask); 51 static void pickCallback(S32 x, S32 y, MASK mask);
50 BOOL mouseSteerMode() { return mMouseSteering; } 52 BOOL mouseSteerMode() { return mMouseSteering; }
51 53
diff --git a/linden/indra/newview/lltoolgrab.cpp b/linden/indra/newview/lltoolgrab.cpp
index 90dbd48..e186e4a 100644
--- a/linden/indra/newview/lltoolgrab.cpp
+++ b/linden/indra/newview/lltoolgrab.cpp
@@ -145,7 +145,7 @@ void LLToolGrab::pickCallback(S32 x, S32 y, MASK mask)
145 145
146 BOOL extend_select = (mask & MASK_SHIFT); 146 BOOL extend_select = (mask & MASK_SHIFT);
147 147
148 if (!extend_select && !gSelectMgr->isEmpty()) 148 if (!extend_select && !gSelectMgr->getSelection()->isEmpty())
149 { 149 {
150 gSelectMgr->deselectAll(); 150 gSelectMgr->deselectAll();
151 gToolGrab->mDeselectedThisClick = TRUE; 151 gToolGrab->mDeselectedThisClick = TRUE;
diff --git a/linden/indra/newview/lltoolgrab.h b/linden/indra/newview/lltoolgrab.h
index db8242c..ad05295 100644
--- a/linden/indra/newview/lltoolgrab.h
+++ b/linden/indra/newview/lltoolgrab.h
@@ -53,7 +53,7 @@ public:
53 53
54 virtual void handleSelect(); 54 virtual void handleSelect();
55 virtual void handleDeselect(); 55 virtual void handleDeselect();
56 56
57 virtual LLViewerObject* getEditingObject(); 57 virtual LLViewerObject* getEditingObject();
58 virtual LLVector3d getEditingPointGlobal(); 58 virtual LLVector3d getEditingPointGlobal();
59 virtual BOOL isEditing(); 59 virtual BOOL isEditing();
diff --git a/linden/indra/newview/lltoolgun.cpp b/linden/indra/newview/lltoolgun.cpp
index e4ec56a..dfe97ae 100644
--- a/linden/indra/newview/lltoolgun.cpp
+++ b/linden/indra/newview/lltoolgun.cpp
@@ -67,7 +67,7 @@ void LLToolGun::handleDeselect()
67BOOL LLToolGun::handleMouseDown(S32 x, S32 y, MASK mask) 67BOOL LLToolGun::handleMouseDown(S32 x, S32 y, MASK mask)
68{ 68{
69 gGrabTransientTool = this; 69 gGrabTransientTool = this;
70 gCurrentToolset->selectTool( gToolGrab ); 70 gToolMgr->getCurrentToolset()->selectTool( gToolGrab );
71 71
72 return gToolGrab->handleMouseDown(x, y, mask); 72 return gToolGrab->handleMouseDown(x, y, mask);
73} 73}
diff --git a/linden/indra/newview/lltoolgun.h b/linden/indra/newview/lltoolgun.h
index 38854a3..6884cb6 100644
--- a/linden/indra/newview/lltoolgun.h
+++ b/linden/indra/newview/lltoolgun.h
@@ -45,6 +45,7 @@ public:
45 virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask); 45 virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask);
46 virtual BOOL handleHover(S32 x, S32 y, MASK mask); 46 virtual BOOL handleHover(S32 x, S32 y, MASK mask);
47 47
48 virtual LLTool* getOverrideTool(MASK mask) { return NULL; }
48 virtual BOOL clipMouseWhenDown() { return FALSE; } 49 virtual BOOL clipMouseWhenDown() { return FALSE; }
49 50
50private: 51private:
diff --git a/linden/indra/newview/lltoolindividual.cpp b/linden/indra/newview/lltoolindividual.cpp
index e17a2a1..96bd89e 100644
--- a/linden/indra/newview/lltoolindividual.cpp
+++ b/linden/indra/newview/lltoolindividual.cpp
@@ -85,7 +85,7 @@ void LLToolIndividual::pickCallback(S32 x, S32 y, MASK mask)
85 85
86BOOL LLToolIndividual::handleDoubleClick(S32 x, S32 y, MASK mask) 86BOOL LLToolIndividual::handleDoubleClick(S32 x, S32 y, MASK mask)
87{ 87{
88 if(!gSelectMgr->isEmpty()) 88 if(!gSelectMgr->getSelection()->isEmpty())
89 { 89 {
90 // You should already have an object selected from the mousedown. 90 // You should already have an object selected from the mousedown.
91 // If so, show its inventory. 91 // If so, show its inventory.
@@ -104,10 +104,10 @@ BOOL LLToolIndividual::handleDoubleClick(S32 x, S32 y, MASK mask)
104 104
105void LLToolIndividual::handleSelect() 105void LLToolIndividual::handleSelect()
106{ 106{
107 LLViewerObject* obj = gSelectMgr->getFirstRootObject(); 107 LLViewerObject* obj = gSelectMgr->getSelection()->getFirstRootObject();
108 if(!obj) 108 if(!obj)
109 { 109 {
110 obj = gSelectMgr->getFirstObject(); 110 obj = gSelectMgr->getSelection()->getFirstObject();
111 } 111 }
112 gSelectMgr->deselectAll(); 112 gSelectMgr->deselectAll();
113 if(obj) 113 if(obj)
diff --git a/linden/indra/newview/lltoolmgr.cpp b/linden/indra/newview/lltoolmgr.cpp
index 68a3e77..b6e14a2 100644
--- a/linden/indra/newview/lltoolmgr.cpp
+++ b/linden/indra/newview/lltoolmgr.cpp
@@ -53,7 +53,6 @@ LLToolMgr* gToolMgr = NULL;
53// Used when app not active to avoid processing hover. 53// Used when app not active to avoid processing hover.
54LLTool* gToolNull = NULL; 54LLTool* gToolNull = NULL;
55 55
56LLToolset* gCurrentToolset = NULL;
57LLToolset* gBasicToolset = NULL; 56LLToolset* gBasicToolset = NULL;
58LLToolset* gCameraToolset = NULL; 57LLToolset* gCameraToolset = NULL;
59//LLToolset* gLandToolset = NULL; 58//LLToolset* gLandToolset = NULL;
@@ -65,10 +64,12 @@ LLToolset* gFaceEditToolset = NULL;
65 64
66LLToolMgr::LLToolMgr() 65LLToolMgr::LLToolMgr()
67 : 66 :
68 mCurrentTool(NULL), 67 mBaseTool(NULL),
69 mSavedTool(NULL), 68 mSavedTool(NULL),
70 mTransientTool( NULL ), 69 mTransientTool( NULL ),
71 mOverrideTool( NULL ) 70 mOverrideTool( NULL ),
71 mSelectedTool( NULL ),
72 mCurrentToolset( NULL )
72{ 73{
73 gToolNull = new LLTool(NULL); // Does nothing 74 gToolNull = new LLTool(NULL); // Does nothing
74 setCurrentTool(gToolNull); 75 setCurrentTool(gToolNull);
@@ -78,8 +79,6 @@ LLToolMgr::LLToolMgr()
78// gLandToolset = new LLToolset(); 79// gLandToolset = new LLToolset();
79 gMouselookToolset = new LLToolset(); 80 gMouselookToolset = new LLToolset();
80 gFaceEditToolset = new LLToolset(); 81 gFaceEditToolset = new LLToolset();
81
82 gCurrentToolset = gBasicToolset;
83} 82}
84 83
85void LLToolMgr::initTools() 84void LLToolMgr::initTools()
@@ -197,8 +196,8 @@ void LLToolMgr::initTools()
197 gToolObjPicker = new LLToolObjPicker(); 196 gToolObjPicker = new LLToolObjPicker();
198 197
199 // On startup, use "select" tool 198 // On startup, use "select" tool
199 setCurrentToolset(gBasicToolset);
200 gBasicToolset->selectTool( gToolPie ); 200 gBasicToolset->selectTool( gToolPie );
201 useSelectedTool( gBasicToolset );
202} 201}
203 202
204LLToolMgr::~LLToolMgr() 203LLToolMgr::~LLToolMgr()
@@ -267,138 +266,103 @@ LLToolMgr::~LLToolMgr()
267 gToolNull = NULL; 266 gToolNull = NULL;
268} 267}
269 268
270
271void LLToolMgr::useSelectedTool( LLToolset* vp )
272{
273 setCurrentTool( vp->getSelectedTool() );
274}
275
276BOOL LLToolMgr::usingTransientTool() 269BOOL LLToolMgr::usingTransientTool()
277{ 270{
278 return mTransientTool ? TRUE : FALSE; 271 return mTransientTool ? TRUE : FALSE;
279} 272}
280 273
281void LLToolMgr::setCurrentTool( LLTool* tool ) 274void LLToolMgr::setCurrentToolset(LLToolset* current)
282{ 275{
283 if (tool == mCurrentTool) 276 if (!current) return;
277
278 // switching toolsets?
279 if (current != mCurrentToolset)
284 { 280 {
285 // didn't change tool, so don't mess with 281 // deselect current tool
286 // handleSelect or handleDeselect 282 if (mSelectedTool)
287 return; 283 {
284 mSelectedTool->handleDeselect();
285 }
286 mCurrentToolset = current;
287 // select first tool of new toolset only if toolset changed
288 mCurrentToolset->selectFirstTool();
288 } 289 }
290 // update current tool based on new toolset
291 setCurrentTool( mCurrentToolset->getSelectedTool() );
292}
293
294LLToolset* LLToolMgr::getCurrentToolset()
295{
296 return mCurrentToolset;
297}
289 298
299void LLToolMgr::setCurrentTool( LLTool* tool )
300{
290 if (mTransientTool) 301 if (mTransientTool)
291 { 302 {
292 mTransientTool->handleDeselect();
293 mTransientTool = NULL; 303 mTransientTool = NULL;
294 } 304 }
295 else if( mCurrentTool )
296 {
297 mCurrentTool->handleDeselect();
298 }
299 305
300 mCurrentTool = tool; 306 mBaseTool = tool;
301 if (mCurrentTool) 307 updateToolStatus();
302 {
303 mCurrentTool->handleSelect();
304 }
305} 308}
306 309
307LLTool* LLToolMgr::getCurrentTool(MASK override_mask) 310LLTool* LLToolMgr::getCurrentTool()
308{ 311{
309 // In mid-drag, always keep the current tool 312 MASK override_mask = gKeyboard->currentMask(TRUE);
310 if (gToolTranslate->hasMouseCapture()
311 || gToolRotate->hasMouseCapture()
312 || gToolStretch->hasMouseCapture())
313 {
314 // might have gotten here by overriding another tool
315 if (mOverrideTool)
316 {
317 return mOverrideTool;
318 }
319 else
320 {
321 return mCurrentTool;
322 }
323 }
324 313
314 LLTool* cur_tool = NULL;
315 // always use transient tools if available
325 if (mTransientTool) 316 if (mTransientTool)
326 { 317 {
327 mOverrideTool = NULL; 318 mOverrideTool = NULL;
328 return mTransientTool; 319 cur_tool = mTransientTool;
329 } 320 }
330 321 // tools currently grabbing mouse input will stay active
331 if (mCurrentTool == gToolGun) 322 else if (mSelectedTool && mSelectedTool->hasMouseCapture())
332 { 323 {
333 mOverrideTool = NULL; 324 cur_tool = mSelectedTool;
334 return mCurrentTool;
335 } 325 }
336 326 else
337 // ALT always gets you the camera tool
338 if (override_mask & MASK_ALT)
339 { 327 {
340 mOverrideTool = gToolCamera; 328 mOverrideTool = mBaseTool ? mBaseTool->getOverrideTool(override_mask) : NULL;
341 return mOverrideTool;
342 }
343 329
344 if (mCurrentTool == gToolCamera) 330 // use override tool if available otherwise drop back to base tool
345 { 331 cur_tool = mOverrideTool ? mOverrideTool : mBaseTool;
346 // ...can't switch out of camera
347 mOverrideTool = NULL;
348 return mCurrentTool;
349 }
350 else if (mCurrentTool == gToolGrab)
351 {
352 // ...can't switch out of grab
353 mOverrideTool = NULL;
354 return mCurrentTool;
355 } 332 }
356 else if (mCurrentTool == gToolInspect) 333
357 { 334 //update tool selection status
358 // ...can't switch out of grab 335 if (mSelectedTool != cur_tool)
359 mOverrideTool = NULL;
360 return mCurrentTool;
361 }
362 else
363 { 336 {
364 // ...can switch between editing tools 337 if (mSelectedTool)
365 if (override_mask == MASK_CONTROL)
366 {
367 // Control lifts when in the pie tool, otherwise switches to rotate
368 if (mCurrentTool == gToolPie)
369 {
370 mOverrideTool = gToolGrab;
371 }
372 else
373 {
374 mOverrideTool = gToolRotate;
375 }
376 return mOverrideTool;
377 }
378 else if (override_mask == (MASK_CONTROL | MASK_SHIFT))
379 { 338 {
380 // Shift-Control spins when in the pie tool, otherwise switches to scale 339 mSelectedTool->handleDeselect();
381 if (mCurrentTool == gToolPie)
382 {
383 mOverrideTool = gToolGrab;
384 }
385 else
386 {
387 mOverrideTool = gToolStretch;
388 }
389 return mOverrideTool;
390 } 340 }
391 else 341 if (cur_tool)
392 { 342 {
393 mOverrideTool = NULL; 343 cur_tool->handleSelect();
394 return mCurrentTool;
395 } 344 }
345 mSelectedTool = cur_tool;
396 } 346 }
347
348 return mSelectedTool;
349}
350
351LLTool* LLToolMgr::getBaseTool()
352{
353 return mBaseTool;
354}
355
356void LLToolMgr::updateToolStatus()
357{
358 // call getcurrenttool() to calculate active tool and call handleSelect() and handleDeselect() immediately
359 // when active tool changes
360 getCurrentTool();
397} 361}
398 362
399BOOL LLToolMgr::inEdit() 363BOOL LLToolMgr::inEdit()
400{ 364{
401 return mCurrentTool != gToolPie && mCurrentTool != gToolNull; 365 return mBaseTool != gToolPie && mBaseTool != gToolNull;
402} 366}
403 367
404void LLToolMgr::setTransientTool(LLTool* tool) 368void LLToolMgr::setTransientTool(LLTool* tool)
@@ -411,34 +375,26 @@ void LLToolMgr::setTransientTool(LLTool* tool)
411 { 375 {
412 if (mTransientTool) 376 if (mTransientTool)
413 { 377 {
414 mTransientTool->handleDeselect();
415 mTransientTool = NULL; 378 mTransientTool = NULL;
416 } 379 }
417 else if (mCurrentTool)
418 {
419 mCurrentTool->handleDeselect();
420 }
421 380
422 mTransientTool = tool; 381 mTransientTool = tool;
423 mTransientTool->handleSelect();
424 } 382 }
383
384 updateToolStatus();
425} 385}
426 386
427void LLToolMgr::clearTransientTool() 387void LLToolMgr::clearTransientTool()
428{ 388{
429 if (mTransientTool) 389 if (mTransientTool)
430 { 390 {
431 mTransientTool->handleDeselect();
432 mTransientTool = NULL; 391 mTransientTool = NULL;
433 if (mCurrentTool) 392 if (!mBaseTool)
434 {
435 mCurrentTool->handleSelect();
436 }
437 else
438 { 393 {
439 llwarns << "mCurrentTool is NULL" << llendl; 394 llwarns << "mBaseTool is NULL" << llendl;
440 } 395 }
441 } 396 }
397 updateToolStatus();
442} 398}
443 399
444 400
@@ -447,26 +403,19 @@ void LLToolMgr::clearTransientTool()
447// release this locking. 403// release this locking.
448void LLToolMgr::onAppFocusLost() 404void LLToolMgr::onAppFocusLost()
449{ 405{
450 if (mCurrentTool 406 mSavedTool = mBaseTool;
451 && mCurrentTool == gToolGun) 407 mBaseTool = gToolNull;
452 { 408 updateToolStatus();
453 mCurrentTool->handleDeselect();
454 }
455 mSavedTool = mCurrentTool;
456 mCurrentTool = gToolNull;
457} 409}
458 410
459void LLToolMgr::onAppFocusGained() 411void LLToolMgr::onAppFocusGained()
460{ 412{
461 if (mSavedTool) 413 if (mSavedTool)
462 { 414 {
463 if (mSavedTool == gToolGun) 415 mBaseTool = mSavedTool;
464 {
465 mCurrentTool->handleSelect();
466 }
467 mCurrentTool = mSavedTool;
468 mSavedTool = NULL; 416 mSavedTool = NULL;
469 } 417 }
418 updateToolStatus();
470} 419}
471 420
472///////////////////////////////////////////////////// 421/////////////////////////////////////////////////////
@@ -510,7 +459,10 @@ BOOL LLToolset::isToolSelected( S32 index )
510void LLToolset::selectFirstTool() 459void LLToolset::selectFirstTool()
511{ 460{
512 mSelectedTool = mToolList.getFirstData(); 461 mSelectedTool = mToolList.getFirstData();
513 gToolMgr->setCurrentTool( mSelectedTool ); 462 if (gToolMgr)
463 {
464 gToolMgr->setCurrentTool( mSelectedTool );
465 }
514} 466}
515 467
516 468
@@ -559,5 +511,5 @@ void LLToolset::selectPrevTool()
559void select_tool( void *tool_pointer ) 511void select_tool( void *tool_pointer )
560{ 512{
561 LLTool *tool = (LLTool *)tool_pointer; 513 LLTool *tool = (LLTool *)tool_pointer;
562 gCurrentToolset->selectTool( tool ); 514 gToolMgr->getCurrentToolset()->selectTool( tool );
563} 515}
diff --git a/linden/indra/newview/lltoolmgr.h b/linden/indra/newview/lltoolmgr.h
index 6f0f50b..5cf005a 100644
--- a/linden/indra/newview/lltoolmgr.h
+++ b/linden/indra/newview/lltoolmgr.h
@@ -51,27 +51,33 @@ public:
51 // Must be called after gSavedSettings set up. 51 // Must be called after gSavedSettings set up.
52 void initTools(); 52 void initTools();
53 53
54 LLTool* getCurrentTool(MASK override_mask); 54 LLTool* getCurrentTool(); // returns active tool, taking into account keyboard state
55 LLTool* getBaseTool(); // returns active tool when overrides are deactivated
55 56
56 BOOL inEdit(); 57 BOOL inEdit();
57 void useSelectedTool( LLToolset* vp );
58 58
59 void setTransientTool(LLTool* tool); 59 void setTransientTool(LLTool* tool);
60 void clearTransientTool(); 60 void clearTransientTool();
61 BOOL usingTransientTool(); 61 BOOL usingTransientTool();
62 62
63 void setCurrentToolset(LLToolset* current);
64 LLToolset* getCurrentToolset();
65
63 void onAppFocusGained(); 66 void onAppFocusGained();
64 void onAppFocusLost(); 67 void onAppFocusLost();
65 68
66protected: 69protected:
67 friend class LLToolset; // to allow access to setCurrentTool(); 70 friend class LLToolset; // to allow access to setCurrentTool();
68 void setCurrentTool(LLTool* tool); 71 void setCurrentTool(LLTool* tool);
72 void updateToolStatus();
69 73
70protected: 74protected:
71 LLTool* mCurrentTool; 75 LLTool* mBaseTool;
72 LLTool* mSavedTool; // The current tool at the time application focus was lost. 76 LLTool* mSavedTool; // The current tool at the time application focus was lost.
73 LLTool* mTransientTool; 77 LLTool* mTransientTool;
74 LLTool* mOverrideTool; // Tool triggered by keyboard override 78 LLTool* mOverrideTool; // Tool triggered by keyboard override
79 LLTool* mSelectedTool; // last known active tool
80 LLToolset* mCurrentToolset;
75}; 81};
76 82
77// Sets of tools for various modes 83// Sets of tools for various modes
@@ -106,7 +112,6 @@ void select_tool(void *tool);
106// Globals (created and destroyed by LLViewerWindow) 112// Globals (created and destroyed by LLViewerWindow)
107extern LLToolMgr* gToolMgr; 113extern LLToolMgr* gToolMgr;
108 114
109extern LLToolset* gCurrentToolset;
110extern LLToolset* gBasicToolset; 115extern LLToolset* gBasicToolset;
111extern LLToolset *gCameraToolset; 116extern LLToolset *gCameraToolset;
112//extern LLToolset *gLandToolset; 117//extern LLToolset *gLandToolset;
diff --git a/linden/indra/newview/lltoolmorph.cpp b/linden/indra/newview/lltoolmorph.cpp
index ca3d0e7..a779554 100644
--- a/linden/indra/newview/lltoolmorph.cpp
+++ b/linden/indra/newview/lltoolmorph.cpp
@@ -234,10 +234,7 @@ BOOL LLVisualParamHint::render()
234 { 234 {
235 LLDrawPoolAvatar *avatarPoolp = (LLDrawPoolAvatar *)avatarp->mDrawable->getFace(0)->getPool(); 235 LLDrawPoolAvatar *avatarPoolp = (LLDrawPoolAvatar *)avatarp->mDrawable->getFace(0)->getPool();
236 LLGLDepthTest gls_depth(GL_TRUE, GL_TRUE); 236 LLGLDepthTest gls_depth(GL_TRUE, GL_TRUE);
237 gPipeline.unbindAGP(); 237 avatarPoolp->renderAvatars(avatarp); // renders only one avatar
238 avatarPoolp->syncAGP();
239 gPipeline.bindAGP();
240 avatarPoolp->renderAvatars(avatarp, TRUE); // renders only one avatar (no shaders)
241 } 238 }
242 avatarp->setVisualParamWeight(mVisualParam, mLastParamWeight); 239 avatarp->setVisualParamWeight(mVisualParam, mLastParamWeight);
243 240
diff --git a/linden/indra/newview/lltoolpie.cpp b/linden/indra/newview/lltoolpie.cpp
index e4be8ce..3eaa275 100644
--- a/linden/indra/newview/lltoolpie.cpp
+++ b/linden/indra/newview/lltoolpie.cpp
@@ -62,6 +62,7 @@
62LLToolPie *gToolPie = NULL; 62LLToolPie *gToolPie = NULL;
63 63
64LLViewerObject* LLToolPie::sClickActionObject = NULL; 64LLViewerObject* LLToolPie::sClickActionObject = NULL;
65LLHandle<LLObjectSelection> LLToolPie::sLeftClickSelection = NULL;
65 66
66extern void handle_buy(void*); 67extern void handle_buy(void*);
67 68
@@ -79,8 +80,7 @@ LLToolPie::LLToolPie()
79 80
80BOOL LLToolPie::handleMouseDown(S32 x, S32 y, MASK mask) 81BOOL LLToolPie::handleMouseDown(S32 x, S32 y, MASK mask)
81{ 82{
82 // if buttons swapped, don't pick transparent so users can't "pay" 83 //left mouse down always picks transparent
83 // transparent objects
84 gViewerWindow->hitObjectOrLandGlobalAsync(x, y, mask, leftMouseCallback, 84 gViewerWindow->hitObjectOrLandGlobalAsync(x, y, mask, leftMouseCallback,
85 TRUE, TRUE); 85 TRUE, TRUE);
86 mGrabMouseButtonDown = TRUE; 86 mGrabMouseButtonDown = TRUE;
@@ -188,19 +188,19 @@ BOOL LLToolPie::pickAndShowMenu(S32 x, S32 y, MASK mask, BOOL always_show)
188 || parent && parent->flagTakesMoney()) 188 || parent && parent->flagTakesMoney())
189 { 189 {
190 sClickActionObject = parent; 190 sClickActionObject = parent;
191 LLToolSelect::handleObjectSelection(parent, MASK_NONE, FALSE, TRUE); 191 sLeftClickSelection = LLToolSelect::handleObjectSelection(parent, MASK_NONE, FALSE, TRUE);
192 return TRUE; 192 return TRUE;
193 } 193 }
194 break; 194 break;
195 case CLICK_ACTION_BUY: 195 case CLICK_ACTION_BUY:
196 sClickActionObject = parent; 196 sClickActionObject = parent;
197 LLToolSelect::handleObjectSelection(parent, MASK_NONE, FALSE, TRUE); 197 sLeftClickSelection = LLToolSelect::handleObjectSelection(parent, MASK_NONE, FALSE, TRUE);
198 return TRUE; 198 return TRUE;
199 case CLICK_ACTION_OPEN: 199 case CLICK_ACTION_OPEN:
200 if (parent && parent->allowOpen()) 200 if (parent && parent->allowOpen())
201 { 201 {
202 sClickActionObject = parent; 202 sClickActionObject = parent;
203 LLToolSelect::handleObjectSelection(parent, MASK_NONE, FALSE, TRUE); 203 sLeftClickSelection = LLToolSelect::handleObjectSelection(parent, MASK_NONE, FALSE, TRUE);
204 } 204 }
205 return TRUE; 205 return TRUE;
206 } 206 }
@@ -213,7 +213,7 @@ BOOL LLToolPie::pickAndShowMenu(S32 x, S32 y, MASK mask, BOOL always_show)
213 !always_show) 213 !always_show)
214 { 214 {
215 gGrabTransientTool = this; 215 gGrabTransientTool = this;
216 gCurrentToolset->selectTool( gToolGrab ); 216 gToolMgr->getCurrentToolset()->selectTool( gToolGrab );
217 return gToolGrab->handleObjectHit( object, x, y, mask); 217 return gToolGrab->handleObjectHit( object, x, y, mask);
218 } 218 }
219 219
@@ -272,8 +272,8 @@ BOOL LLToolPie::pickAndShowMenu(S32 x, S32 y, MASK mask, BOOL always_show)
272 // Spawn pie menu 272 // Spawn pie menu
273 if (mHitLand) 273 if (mHitLand)
274 { 274 {
275 gParcelMgr->selectParcelAt( gLastHitPosGlobal ); 275 LLParcelSelectionHandle selection = gParcelMgr->selectParcelAt( gLastHitPosGlobal );
276 276 gMenuHolder->setParcelSelection(selection);
277 gPieLand->show(x, y, mPieMouseButtonDown); 277 gPieLand->show(x, y, mPieMouseButtonDown);
278 278
279 // VEFFECT: ShowPie 279 // VEFFECT: ShowPie
@@ -288,6 +288,8 @@ BOOL LLToolPie::pickAndShowMenu(S32 x, S32 y, MASK mask, BOOL always_show)
288 } 288 }
289 else if (object) 289 else if (object)
290 { 290 {
291 gMenuHolder->setObjectSelection(gSelectMgr->getSelection());
292
291 if (object->isAvatar() 293 if (object->isAvatar()
292 || (object->isAttachment() && !object->isHUDAttachment() && !object->permYouOwner())) 294 || (object->isAttachment() && !object->isHUDAttachment() && !object->permYouOwner()))
293 { 295 {
@@ -321,7 +323,7 @@ BOOL LLToolPie::pickAndShowMenu(S32 x, S32 y, MASK mask, BOOL always_show)
321 { 323 {
322 // BUG: What about chatting child objects? 324 // BUG: What about chatting child objects?
323 LLString name; 325 LLString name;
324 LLSelectNode* node = gSelectMgr->getFirstRootNode(); 326 LLSelectNode* node = gSelectMgr->getSelection()->getFirstRootNode();
325 if (node) 327 if (node)
326 { 328 {
327 name = node->mName; 329 name = node->mName;
@@ -413,10 +415,11 @@ void LLToolPie::selectionPropertiesReceived()
413 return; 415 return;
414 } 416 }
415 417
416 if (sClickActionObject 418 if (!sLeftClickSelection->isEmpty())
417 && !sClickActionObject->isDead())
418 { 419 {
419 LLViewerObject* root = gSelectMgr->getFirstRootObject(); 420 LLViewerObject* root = sLeftClickSelection->getFirstRootObject();
421 // since we don't currently have a way to lock a selection, it could have changed
422 // after we initially clicked on the object
420 if (root == sClickActionObject) 423 if (root == sClickActionObject)
421 { 424 {
422 U8 action = root->getClickAction(); 425 U8 action = root->getClickAction();
@@ -436,6 +439,7 @@ void LLToolPie::selectionPropertiesReceived()
436 } 439 }
437 } 440 }
438 } 441 }
442 sLeftClickSelection = NULL;
439 sClickActionObject = NULL; 443 sClickActionObject = NULL;
440} 444}
441 445
@@ -622,6 +626,19 @@ void LLToolPie::handleDeselect()
622 gSelectMgr->validateSelection(); 626 gSelectMgr->validateSelection();
623} 627}
624 628
629LLTool* LLToolPie::getOverrideTool(MASK mask)
630{
631 if (mask == MASK_CONTROL)
632 {
633 return gToolGrab;
634 }
635 else if (mask == (MASK_CONTROL | MASK_SHIFT))
636 {
637 return gToolGrab;
638 }
639
640 return LLTool::getOverrideTool(mask);
641}
625 642
626void LLToolPie::stopEditing() 643void LLToolPie::stopEditing()
627{ 644{
diff --git a/linden/indra/newview/lltoolpie.h b/linden/indra/newview/lltoolpie.h
index 3a8f85b..dd54b5c 100644
--- a/linden/indra/newview/lltoolpie.h
+++ b/linden/indra/newview/lltoolpie.h
@@ -32,6 +32,7 @@
32#include "lluuid.h" 32#include "lluuid.h"
33 33
34class LLViewerObject; 34class LLViewerObject;
35class LLObjectSelection;
35 36
36class LLToolPie 37class LLToolPie
37: public LLTool 38: public LLTool
@@ -52,6 +53,7 @@ public:
52 53
53 virtual void onMouseCaptureLost(); 54 virtual void onMouseCaptureLost();
54 virtual void handleDeselect(); 55 virtual void handleDeselect();
56 virtual LLTool* getOverrideTool(MASK mask);
55 57
56 static void leftMouseCallback(S32 x, S32 y, MASK mask); 58 static void leftMouseCallback(S32 x, S32 y, MASK mask);
57 static void rightMouseCallback(S32 x, S32 y, MASK mask); 59 static void rightMouseCallback(S32 x, S32 y, MASK mask);
@@ -71,6 +73,7 @@ protected:
71 LLUUID mHitObjectID; 73 LLUUID mHitObjectID;
72 BOOL mMouseOutsideSlop; // for this drag, has mouse moved outside slop region 74 BOOL mMouseOutsideSlop; // for this drag, has mouse moved outside slop region
73 static LLViewerObject* sClickActionObject; 75 static LLViewerObject* sClickActionObject;
76 static LLHandle<LLObjectSelection> sLeftClickSelection;
74}; 77};
75 78
76extern LLToolPie *gToolPie; 79extern LLToolPie *gToolPie;
diff --git a/linden/indra/newview/lltoolplacer.cpp b/linden/indra/newview/lltoolplacer.cpp
index 594be6c..e246546 100644
--- a/linden/indra/newview/lltoolplacer.cpp
+++ b/linden/indra/newview/lltoolplacer.cpp
@@ -129,7 +129,7 @@ BOOL LLToolPlacer::placeObject(S32 x, S32 y, MASK mask)
129 // ...and go back to the default tool 129 // ...and go back to the default tool
130 if (added && !gSavedSettings.getBOOL("CreateToolKeepSelected")) 130 if (added && !gSavedSettings.getBOOL("CreateToolKeepSelected"))
131 { 131 {
132 gCurrentToolset->selectTool( gToolTranslate ); 132 gToolMgr->getCurrentToolset()->selectTool( gToolTranslate );
133 } 133 }
134 134
135 return added; 135 return added;
@@ -171,7 +171,6 @@ LLPCode LLToolPlacerPanel::sSphere = LL_PCODE_SPHERE;
171LLPCode LLToolPlacerPanel::sSphereHemi = LL_PCODE_SPHERE_HEMI; 171LLPCode LLToolPlacerPanel::sSphereHemi = LL_PCODE_SPHERE_HEMI;
172LLPCode LLToolPlacerPanel::sTree = LL_PCODE_LEGACY_TREE; 172LLPCode LLToolPlacerPanel::sTree = LL_PCODE_LEGACY_TREE;
173LLPCode LLToolPlacerPanel::sGrass = LL_PCODE_LEGACY_GRASS; 173LLPCode LLToolPlacerPanel::sGrass = LL_PCODE_LEGACY_GRASS;
174LLPCode LLToolPlacerPanel::sTreeNew = LL_PCODE_TREE_NEW;
175 174
176S32 LLToolPlacerPanel::sButtonsAdded = 0; 175S32 LLToolPlacerPanel::sButtonsAdded = 0;
177LLButton* LLToolPlacerPanel::sButtons[ TOOL_PLACER_NUM_BUTTONS ]; 176LLButton* LLToolPlacerPanel::sButtons[ TOOL_PLACER_NUM_BUTTONS ];
diff --git a/linden/indra/newview/lltoolplacer.h b/linden/indra/newview/lltoolplacer.h
index e4f9c7a..ab90ca1 100644
--- a/linden/indra/newview/lltoolplacer.h
+++ b/linden/indra/newview/lltoolplacer.h
@@ -85,7 +85,6 @@ public:
85 static LLPCode sSphereHemi; 85 static LLPCode sSphereHemi;
86 static LLPCode sTree; 86 static LLPCode sTree;
87 static LLPCode sGrass; 87 static LLPCode sGrass;
88 static LLPCode sTreeNew;
89 88
90private: 89private:
91 void addButton( const LLString& up_state, const LLString& down_state, LLPCode* pcode ); 90 void addButton( const LLString& up_state, const LLString& down_state, LLPCode* pcode );
diff --git a/linden/indra/newview/lltoolselect.cpp b/linden/indra/newview/lltoolselect.cpp
index a557136..924916c 100644
--- a/linden/indra/newview/lltoolselect.cpp
+++ b/linden/indra/newview/lltoolselect.cpp
@@ -93,7 +93,7 @@ BOOL LLToolSelect::handleDoubleClick(S32 x, S32 y, MASK mask)
93} 93}
94 94
95// static 95// static
96void LLToolSelect::handleObjectSelection(LLViewerObject *object, MASK mask, BOOL ignore_group, BOOL temp_select) 96LLHandle<LLObjectSelection> LLToolSelect::handleObjectSelection(LLViewerObject *object, MASK mask, BOOL ignore_group, BOOL temp_select)
97{ 97{
98 BOOL select_owned = gSavedSettings.getBOOL("SelectOwnedOnly"); 98 BOOL select_owned = gSavedSettings.getBOOL("SelectOwnedOnly");
99 BOOL select_movable = gSavedSettings.getBOOL("SelectMovableOnly"); 99 BOOL select_movable = gSavedSettings.getBOOL("SelectMovableOnly");
@@ -193,9 +193,10 @@ void LLToolSelect::handleObjectSelection(LLViewerObject *object, MASK mask, BOOL
193 if (!already_selected) 193 if (!already_selected)
194 { 194 {
195 LLViewerObject* root_object = (LLViewerObject*)object->getRootEdit(); 195 LLViewerObject* root_object = (LLViewerObject*)object->getRootEdit();
196 LLObjectSelectionHandle selection = gSelectMgr->getSelection();
196 197
197 // this is just a temporary selection 198 // this is just a temporary selection
198 LLSelectNode* select_node = gSelectMgr->findSelectNode(root_object); 199 LLSelectNode* select_node = selection->findNode(root_object);
199 if (select_node) 200 if (select_node)
200 { 201 {
201 select_node->setTransient(TRUE); 202 select_node->setTransient(TRUE);
@@ -203,7 +204,7 @@ void LLToolSelect::handleObjectSelection(LLViewerObject *object, MASK mask, BOOL
203 204
204 for (S32 i = 0; i < (S32)root_object->mChildList.size(); i++) 205 for (S32 i = 0; i < (S32)root_object->mChildList.size(); i++)
205 { 206 {
206 select_node = gSelectMgr->findSelectNode(root_object->mChildList[i]); 207 select_node = selection->findNode(root_object->mChildList[i]);
207 if (select_node) 208 if (select_node)
208 { 209 {
209 select_node->setTransient(TRUE); 210 select_node->setTransient(TRUE);
@@ -221,6 +222,8 @@ void LLToolSelect::handleObjectSelection(LLViewerObject *object, MASK mask, BOOL
221 gSavedSettings.setBOOL("SelectMovableOnly", select_movable); 222 gSavedSettings.setBOOL("SelectMovableOnly", select_movable);
222 gSelectMgr->setForceSelection(FALSE); 223 gSelectMgr->setForceSelection(FALSE);
223 } 224 }
225
226 return gSelectMgr->getSelection();
224} 227}
225 228
226BOOL LLToolSelect::handleMouseUp(S32 x, S32 y, MASK mask) 229BOOL LLToolSelect::handleMouseUp(S32 x, S32 y, MASK mask)
diff --git a/linden/indra/newview/lltoolselect.h b/linden/indra/newview/lltoolselect.h
index 5d2cc9d..065e08f 100644
--- a/linden/indra/newview/lltoolselect.h
+++ b/linden/indra/newview/lltoolselect.h
@@ -32,6 +32,8 @@
32#include "v3math.h" 32#include "v3math.h"
33#include "lluuid.h" 33#include "lluuid.h"
34 34
35class LLObjectSelection;
36
35class LLToolSelect : public LLTool 37class LLToolSelect : public LLTool
36{ 38{
37public: 39public:
@@ -43,7 +45,7 @@ public:
43 45
44 virtual void stopEditing(); 46 virtual void stopEditing();
45 47
46 static void handleObjectSelection(LLViewerObject *object, MASK mask, BOOL ignore_group, BOOL temp_select); 48 static LLHandle<LLObjectSelection> handleObjectSelection(LLViewerObject *object, MASK mask, BOOL ignore_group, BOOL temp_select);
47 49
48 virtual void onMouseCaptureLost(); 50 virtual void onMouseCaptureLost();
49 virtual void handleDeselect(); 51 virtual void handleDeselect();
diff --git a/linden/indra/newview/lltoolselectland.cpp b/linden/indra/newview/lltoolselectland.cpp
index c0c0818..eaad28c 100644
--- a/linden/indra/newview/lltoolselectland.cpp
+++ b/linden/indra/newview/lltoolselectland.cpp
@@ -65,6 +65,10 @@ LLToolSelectLand::LLToolSelectLand( )
65 mLastShowParcelOwners(FALSE) 65 mLastShowParcelOwners(FALSE)
66{ } 66{ }
67 67
68LLToolSelectLand::~LLToolSelectLand()
69{
70}
71
68 72
69BOOL LLToolSelectLand::handleMouseDown(S32 x, S32 y, MASK mask) 73BOOL LLToolSelectLand::handleMouseDown(S32 x, S32 y, MASK mask)
70{ 74{
@@ -133,7 +137,7 @@ BOOL LLToolSelectLand::handleMouseUp(S32 x, S32 y, MASK mask)
133 roundXY(mEastNorthTop); 137 roundXY(mEastNorthTop);
134 138
135 // Don't auto-select entire parcel. 139 // Don't auto-select entire parcel.
136 gParcelMgr->selectLand( mWestSouthBottom, mEastNorthTop, FALSE ); 140 mSelection = gParcelMgr->selectLand( mWestSouthBottom, mEastNorthTop, FALSE );
137 } 141 }
138 142
139 mMouseOutsideSlop = FALSE; 143 mMouseOutsideSlop = FALSE;
@@ -220,6 +224,7 @@ void LLToolSelectLand::handleSelect()
220void LLToolSelectLand::handleDeselect() 224void LLToolSelectLand::handleDeselect()
221{ 225{
222 gFloaterTools->setStatusText(""); 226 gFloaterTools->setStatusText("");
227 mSelection = NULL;
223 //gParcelMgr->deselectLand(); 228 //gParcelMgr->deselectLand();
224 gSavedSettings.setBOOL("ShowParcelOwners", mLastShowParcelOwners); 229 gSavedSettings.setBOOL("ShowParcelOwners", mLastShowParcelOwners);
225} 230}
diff --git a/linden/indra/newview/lltoolselectland.h b/linden/indra/newview/lltoolselectland.h
index 9bc1880..06ce1ee 100644
--- a/linden/indra/newview/lltoolselectland.h
+++ b/linden/indra/newview/lltoolselectland.h
@@ -31,11 +31,14 @@
31#include "lltool.h" 31#include "lltool.h"
32#include "v3dmath.h" 32#include "v3dmath.h"
33 33
34class LLParcelSelection;
35
34class LLToolSelectLand 36class LLToolSelectLand
35: public LLTool 37: public LLTool
36{ 38{
37public: 39public:
38 LLToolSelectLand( ); 40 LLToolSelectLand( );
41 virtual ~LLToolSelectLand();
39 42
40 /*virtual*/ BOOL handleMouseDown(S32 x, S32 y, MASK mask); 43 /*virtual*/ BOOL handleMouseDown(S32 x, S32 y, MASK mask);
41 /*virtual*/ BOOL handleDoubleClick(S32 x, S32 y, MASK mask); 44 /*virtual*/ BOOL handleDoubleClick(S32 x, S32 y, MASK mask);
@@ -68,6 +71,7 @@ protected:
68 LLVector3d mEastNorthTop; // global coords, from drag 71 LLVector3d mEastNorthTop; // global coords, from drag
69 72
70 BOOL mLastShowParcelOwners; // store last Show Parcel Owners setting 73 BOOL mLastShowParcelOwners; // store last Show Parcel Owners setting
74 LLHandle<LLParcelSelection> mSelection; // hold on to a parcel selection
71}; 75};
72 76
73extern LLToolSelectLand *gToolParcel; 77extern LLToolSelectLand *gToolParcel;
diff --git a/linden/indra/newview/lltoolview.cpp b/linden/indra/newview/lltoolview.cpp
index 5b80339..fa8d65b 100644
--- a/linden/indra/newview/lltoolview.cpp
+++ b/linden/indra/newview/lltoolview.cpp
@@ -148,7 +148,7 @@ void LLToolView::draw()
148{ 148{
149 // turn off highlighting for all containers 149 // turn off highlighting for all containers
150 // and hide all option panels except for the selected one. 150 // and hide all option panels except for the selected one.
151 LLTool* selected = gCurrentToolset->getSelectedTool(); 151 LLTool* selected = gToolMgr->getCurrentToolset()->getSelectedTool();
152 for( LLToolContainer* contain = mContainList.getFirstData(); 152 for( LLToolContainer* contain = mContainList.getFirstData();
153 contain != NULL; 153 contain != NULL;
154 contain = mContainList.getNextData() 154 contain = mContainList.getNextData()
@@ -188,7 +188,6 @@ void LLToolView::onClickToolButton(void* userdata)
188 LLToolContainer* clicked = (LLToolContainer*) userdata; 188 LLToolContainer* clicked = (LLToolContainer*) userdata;
189 189
190 // Switch to this one 190 // Switch to this one
191 gCurrentToolset->selectTool( clicked->mTool ); 191 gToolMgr->getCurrentToolset()->selectTool( clicked->mTool );
192 gToolMgr->useSelectedTool( gCurrentToolset );
193} 192}
194 193
diff --git a/linden/indra/newview/lltracker.cpp b/linden/indra/newview/lltracker.cpp
index 58ba9b8..80d35dd 100644
--- a/linden/indra/newview/lltracker.cpp
+++ b/linden/indra/newview/lltracker.cpp
@@ -264,7 +264,7 @@ void LLTracker::render3D()
264 else 264 else
265 { 265 {
266 const LLRelationship* buddy = av_tracker.getBuddyInfo(avatar_id); 266 const LLRelationship* buddy = av_tracker.getBuddyInfo(avatar_id);
267 if(buddy && !buddy->isOnline()) 267 if(buddy && !buddy->isOnline() && !gAgent.isGodlike())
268 { 268 {
269 stop_tracking = TRUE; 269 stop_tracking = TRUE;
270 } 270 }
@@ -556,8 +556,8 @@ void LLTracker::renderBeacon(LLVector3d pos_global,
556 //gCylinder.render(1000); 556 //gCylinder.render(1000);
557 glPopMatrix(); 557 glPopMatrix();
558 558
559 char text[1024]; 559 char text[1024]; /* Flawfinder: ignore */
560 sprintf(text, "%.0f m", to_vec.magVec()); 560 snprintf(text, sizeof(text), "%.0f m", to_vec.magVec()); /* Flawfinder: ignore */
561 561
562 LLWString wstr; 562 LLWString wstr;
563 wstr += utf8str_to_wstring(label); 563 wstr += utf8str_to_wstring(label);
diff --git a/linden/indra/newview/lluploaddialog.cpp b/linden/indra/newview/lluploaddialog.cpp
index a67aa7d..620133e 100644
--- a/linden/indra/newview/lluploaddialog.cpp
+++ b/linden/indra/newview/lluploaddialog.cpp
@@ -102,8 +102,13 @@ void LLUploadDialog::setMessage( const std::string& msg)
102 char* temp_msg = new char[size]; 102 char* temp_msg = new char[size];
103 103
104 //strcpy(temp_msg,"Uploading...\n\n"); 104 //strcpy(temp_msg,"Uploading...\n\n");
105 strcpy( temp_msg, msg.c_str()); 105 if (temp_msg == NULL)
106 {
107 llerrs << "Memory Allocation Failed" << llendl;
108 return;
109 }
106 110
111 strcpy( temp_msg, msg.c_str()); /* Flawfinder: ignore */
107 char* token = strtok( temp_msg, "\n" ); 112 char* token = strtok( temp_msg, "\n" );
108 while( token ) 113 while( token )
109 { 114 {
diff --git a/linden/indra/newview/llurl.cpp b/linden/indra/newview/llurl.cpp
index d3ad8e2..0374ec9 100644
--- a/linden/indra/newview/llurl.cpp
+++ b/linden/indra/newview/llurl.cpp
@@ -66,9 +66,10 @@ void LLURL::init(const char * url)
66 mExtension[0] = '\0'; 66 mExtension[0] = '\0';
67 mTag[0] = '\0'; 67 mTag[0] = '\0';
68 68
69 char url_copy[MAX_STRING]; 69 char url_copy[MAX_STRING]; /* Flawfinder: ignore */
70 70
71 strcpy (url_copy,url); 71 strncpy (url_copy,url, MAX_STRING -1); /* Flawfinder: ignore */
72 url_copy[MAX_STRING -1] = '\0';
72 73
73 char *parse; 74 char *parse;
74 char *leftover_url = url_copy; 75 char *leftover_url = url_copy;
@@ -77,7 +78,8 @@ void LLURL::init(const char * url)
77 // copy and lop off tag 78 // copy and lop off tag
78 if ((parse = strchr(url_copy,'#'))) 79 if ((parse = strchr(url_copy,'#')))
79 { 80 {
80 strcpy(mTag,parse+1); 81 strncpy(mTag,parse+1, LL_MAX_PATH -1); /* Flawfinder: ignore */
82 mTag[LL_MAX_PATH -1] = '\0';
81 *parse = '\0'; 83 *parse = '\0';
82 } 84 }
83 85
@@ -85,7 +87,8 @@ void LLURL::init(const char * url)
85 if ((parse = strchr(url_copy,':'))) 87 if ((parse = strchr(url_copy,':')))
86 { 88 {
87 *parse = '\0'; 89 *parse = '\0';
88 strcpy(mURI,leftover_url); 90 strncpy(mURI,leftover_url, LL_MAX_PATH -1); /* Flawfinder: ignore */
91 mURI[LL_MAX_PATH -1] = '\0';
89 leftover_url = parse + 1; 92 leftover_url = parse + 1;
90 } 93 }
91 94
@@ -95,14 +98,15 @@ void LLURL::init(const char * url)
95 leftover_url += 2; // skip the "//" 98 leftover_url += 2; // skip the "//"
96 99
97 span = strcspn(leftover_url, "/"); 100 span = strcspn(leftover_url, "/");
98 strncat(mAuthority,leftover_url,span); 101 strncat(mAuthority,leftover_url,span); /* Flawfinder: ignore */
99 leftover_url += span; 102 leftover_url += span;
100 } 103 }
101 104
102 if ((parse = strrchr(leftover_url,'.'))) 105 if ((parse = strrchr(leftover_url,'.')))
103 { 106 {
104 // copy and lop off extension 107 // copy and lop off extension
105 strcpy(mExtension,parse+1); 108 strncpy(mExtension,parse+1, LL_MAX_PATH -1); /* Flawfinder: ignore */
109 mExtension[LL_MAX_PATH -1] = '\0';
106 *parse = '\0'; 110 *parse = '\0';
107 } 111 }
108 112
@@ -116,11 +120,13 @@ void LLURL::init(const char * url)
116 } 120 }
117 121
118 // copy and lop off filename 122 // copy and lop off filename
119 strcpy(mFilename,parse); 123 strncpy(mFilename,parse, LL_MAX_PATH -1);/* Flawfinder: ignore */
124 mFilename[LL_MAX_PATH -1] = '\0';
120 *parse = '\0'; 125 *parse = '\0';
121 126
122 // what's left should be the path 127 // what's left should be the path
123 strcpy(mPath,leftover_url); 128 strncpy(mPath,leftover_url, LL_MAX_PATH -1); /* Flawfinder: ignore */
129 mPath[LL_MAX_PATH -1] = '\0';
124 130
125// llinfos << url << " decomposed into: " << llendl; 131// llinfos << url << " decomposed into: " << llendl;
126// llinfos << " URI : <" << mURI << ">" << llendl; 132// llinfos << " URI : <" << mURI << ">" << llendl;
@@ -169,42 +175,43 @@ bool LLURL::operator!=(const LLURL& rhs) const
169 175
170const char * LLURL::getFQURL() const 176const char * LLURL::getFQURL() const
171{ 177{
172 char fqurl[LL_MAX_PATH]; 178 char fqurl[LL_MAX_PATH]; /* Flawfinder: ignore */
173 179
174 fqurl[0] = '\0'; 180 fqurl[0] = '\0';
175 181
176 if (mURI[0]) 182 if (mURI[0])
177 { 183 {
178 strcat(fqurl,mURI); 184 strncat(fqurl,mURI, LL_MAX_PATH - strlen(fqurl) -1); /* Flawfinder: ignore */
179 strcat(fqurl,":"); 185 strcat(fqurl,":"); /* Flawfinder: ignore */
180 if (mAuthority[0]) 186 if (mAuthority[0])
181 { 187 {
182 strcat(fqurl,"//"); 188 strcat(fqurl,"//"); /* Flawfinder: ignore */
183 } 189 }
184 } 190 }
185 191
186 if (mAuthority[0]) 192 if (mAuthority[0])
187 { 193 {
188 strcat(fqurl,mAuthority); 194 strncat(fqurl,mAuthority, LL_MAX_PATH - strlen(fqurl) -1); /* Flawfinder: ignore */
189 } 195 }
190 196
191 strcat(fqurl,mPath); 197 strncat(fqurl,mPath, LL_MAX_PATH - strlen(fqurl) -1); /* Flawfinder: ignore */
192 198
193 strcat(fqurl,mFilename); 199 strncat(fqurl,mFilename, LL_MAX_PATH - strlen(fqurl) -1); /* Flawfinder: ignore */
194 200
195 if (mExtension[0]) 201 if (mExtension[0])
196 { 202 {
197 strcat(fqurl,"."); 203 strcat(fqurl,"."); /* Flawfinder: ignore */
198 strcat(fqurl,mExtension); 204 strncat(fqurl,mExtension, LL_MAX_PATH - strlen(fqurl) -1); /* Flawfinder: ignore */
199 } 205 }
200 206
201 if (mTag[0]) 207 if (mTag[0])
202 { 208 {
203 strcat(fqurl,"#"); 209 strcat(fqurl,"#"); /* Flawfinder: ignore */
204 strcat(fqurl,mTag); 210 strncat(fqurl,mTag, LL_MAX_PATH - strlen(fqurl) -1); /* Flawfinder: ignore */
205 } 211 }
206 212
207 strcpy(LLURL::sReturnString,fqurl); 213 strncpy(LLURL::sReturnString,fqurl, LL_MAX_PATH -1); /* Flawfinder: ignore */
214 LLURL::sReturnString[LL_MAX_PATH -1] = '\0';
208 215
209 return(LLURL::sReturnString); 216 return(LLURL::sReturnString);
210} 217}
@@ -212,16 +219,18 @@ const char * LLURL::getFQURL() const
212 219
213const char* LLURL::updateRelativePath(const LLURL &url) 220const char* LLURL::updateRelativePath(const LLURL &url)
214{ 221{
215 char new_path[LL_MAX_PATH]; 222 char new_path[LL_MAX_PATH]; /* Flawfinder: ignore */
216 char tmp_path[LL_MAX_PATH]; 223 char tmp_path[LL_MAX_PATH]; /* Flawfinder: ignore */
217 224
218 char *parse; 225 char *parse;
219 226
220 if (mPath[0] != '/') 227 if (mPath[0] != '/')
221 { 228 {
222 //start with existing path 229 //start with existing path
223 strcpy (new_path,url.mPath); 230 strncpy (new_path,url.mPath, LL_MAX_PATH -1); /* Flawfinder: ignore */
224 strcpy (tmp_path,mPath); 231 new_path[LL_MAX_PATH -1] = '\0';
232 strncpy (tmp_path,mPath, LL_MAX_PATH -1); /* Flawfinder: ignore */
233 tmp_path[LL_MAX_PATH -1] = '\0';
225 234
226 parse = strtok(tmp_path,"/"); 235 parse = strtok(tmp_path,"/");
227 while (parse) 236 while (parse)
@@ -246,28 +255,30 @@ const char* LLURL::updateRelativePath(const LLURL &url)
246 } 255 }
247 else 256 else
248 { 257 {
249 strcat(new_path,"../"); 258 strcat(new_path,"../"); /* Flawfinder: ignore */
250 } 259 }
251 260
252 } 261 }
253 else 262 else
254 { 263 {
255 strcat(new_path,parse); 264 strncat(new_path,parse, LL_MAX_PATH - strlen(new_path) -1 ); /* Flawfinder: ignore */
256 strcat(new_path,"/"); 265 strcat(new_path,"/"); /* Flawfinder: ignore */
257 } 266 }
258 parse = strtok(NULL,"/"); 267 parse = strtok(NULL,"/");
259 } 268 }
260 strcpy(mPath,new_path); 269 strncpy(mPath,new_path, LL_MAX_PATH -1); /* Flawfinder: ignore */
270 mPath[LL_MAX_PATH -1] = '\0';
261 } 271 }
262 return mPath; 272 return mPath;
263} 273}
264 274
265const char * LLURL::getFullPath() 275const char * LLURL::getFullPath()
266{ 276{
267 strcpy(LLURL::sReturnString,mPath); 277 strncpy(LLURL::sReturnString,mPath, LL_MAX_PATH -1); /* Flawfinder: ignore */
268 strcat(LLURL::sReturnString,mFilename); 278 LLURL::sReturnString[LL_MAX_PATH -1] = '\0';
269 strcat(LLURL::sReturnString,"."); 279 strncat(LLURL::sReturnString,mFilename, LL_MAX_PATH - strlen(LLURL::sReturnString) -1); /* Flawfinder: ignore */
270 strcat(LLURL::sReturnString,mExtension); 280 strcat(LLURL::sReturnString,"."); /* Flawfinder: ignore */
281 strncat(LLURL::sReturnString,mExtension, LL_MAX_PATH - strlen(LLURL::sReturnString) -1); /* Flawfinder: ignore */
271 return(sReturnString); 282 return(sReturnString);
272} 283}
273 284
diff --git a/linden/indra/newview/llurl.h b/linden/indra/newview/llurl.h
index 58e8cf0..f60f06b 100644
--- a/linden/indra/newview/llurl.h
+++ b/linden/indra/newview/llurl.h
@@ -81,14 +81,14 @@ public:
81 81
82public: 82public:
83 83
84 char mURI[LL_MAX_PATH]; 84 char mURI[LL_MAX_PATH]; /* Flawfinder: ignore */
85 char mAuthority[LL_MAX_PATH]; 85 char mAuthority[LL_MAX_PATH]; /* Flawfinder: ignore */
86 char mPath[LL_MAX_PATH]; 86 char mPath[LL_MAX_PATH]; /* Flawfinder: ignore */
87 char mFilename[LL_MAX_PATH]; 87 char mFilename[LL_MAX_PATH]; /* Flawfinder: ignore */
88 char mExtension[LL_MAX_PATH]; 88 char mExtension[LL_MAX_PATH]; /* Flawfinder: ignore */
89 char mTag[LL_MAX_PATH]; 89 char mTag[LL_MAX_PATH]; /* Flawfinder: ignore */
90 90
91 static char sReturnString[LL_MAX_PATH]; 91 static char sReturnString[LL_MAX_PATH]; /* Flawfinder: ignore */
92}; 92};
93 93
94#endif // LL_LLURL_H 94#endif // LL_LLURL_H
diff --git a/linden/indra/newview/llurlwhitelist.cpp b/linden/indra/newview/llurlwhitelist.cpp
index 8992146..3a8c952 100644
--- a/linden/indra/newview/llurlwhitelist.cpp
+++ b/linden/indra/newview/llurlwhitelist.cpp
@@ -40,7 +40,7 @@ LLUrlWhiteList::LLUrlWhiteList () :
40 mLoaded ( false ), 40 mLoaded ( false ),
41 mFilename ( "url_whitelist.ini" ), 41 mFilename ( "url_whitelist.ini" ),
42 mUrlList ( 0 ), 42 mUrlList ( 0 ),
43 mUrlListIter ( 0 ) 43 mCurIndex ( 0 )
44{ 44{
45} 45}
46 46
@@ -121,10 +121,10 @@ bool LLUrlWhiteList::save ()
121 if ( file.is_open () ) 121 if ( file.is_open () )
122 { 122 {
123 // for each entry we have 123 // for each entry we have
124 for ( LLStringListIter iter = mUrlList.begin (); iter != mUrlList.end (); ++iter ) 124 for ( string_list_t::iterator iter = mUrlList.begin (); iter != mUrlList.end (); ++iter )
125 { 125 {
126 file << ( *iter ) << std::endl; 126 file << ( *iter ) << std::endl;
127 }; 127 }
128 128
129 file.close (); 129 file.close ();
130 130
@@ -140,8 +140,7 @@ bool LLUrlWhiteList::clear ()
140{ 140{
141 mUrlList.clear (); 141 mUrlList.clear ();
142 142
143 // invalidate iterator since we changed the contents 143 mCurIndex = 0;
144 mUrlListIter = mUrlList.end ();
145 144
146 return true; 145 return true;
147} 146}
@@ -175,7 +174,7 @@ bool LLUrlWhiteList::addItem ( const LLString& itemIn, bool saveAfterAdd )
175{ 174{
176 LLString item = url_cleanup(itemIn); 175 LLString item = url_cleanup(itemIn);
177 176
178 mUrlList.insert ( mUrlList.end (), item ); 177 mUrlList.push_back ( item );
179 178
180 // use this when all you want to do is call addItem ( ... ) where necessary 179 // use this when all you want to do is call addItem ( ... ) where necessary
181 if ( saveAfterAdd ) 180 if ( saveAfterAdd )
@@ -191,11 +190,8 @@ bool LLUrlWhiteList::getFirst ( LLString& valueOut )
191 if ( mUrlList.size () == 0 ) 190 if ( mUrlList.size () == 0 )
192 return false; 191 return false;
193 192
194 mUrlListIter = mUrlList.begin (); 193 mCurIndex = 0;
195 194 valueOut = mUrlList[mCurIndex++];
196 valueOut = * ( mUrlListIter );
197
198 ++mUrlListIter;
199 195
200 return true; 196 return true;
201} 197}
@@ -204,12 +200,10 @@ bool LLUrlWhiteList::getFirst ( LLString& valueOut )
204// 200//
205bool LLUrlWhiteList::getNext ( LLString& valueOut ) 201bool LLUrlWhiteList::getNext ( LLString& valueOut )
206{ 202{
207 if ( mUrlListIter == mUrlList.end () ) 203 if ( mCurIndex >= mUrlList.size () )
208 return false; 204 return false;
209 205
210 valueOut = * ( mUrlListIter ); 206 valueOut = mUrlList[mCurIndex++];
211
212 ++mUrlListIter;
213 207
214 return true; 208 return true;
215} 209}
diff --git a/linden/indra/newview/llurlwhitelist.h b/linden/indra/newview/llurlwhitelist.h
index 18ccf71..6f4289b 100644
--- a/linden/indra/newview/llurlwhitelist.h
+++ b/linden/indra/newview/llurlwhitelist.h
@@ -55,13 +55,12 @@ class LLUrlWhiteList
55 LLUrlWhiteList (); 55 LLUrlWhiteList ();
56 static LLUrlWhiteList* sInstance; 56 static LLUrlWhiteList* sInstance;
57 57
58 typedef std::list < LLString > LLStringList; 58 typedef std::vector < LLString > string_list_t ;
59 typedef std::list < LLString >::iterator LLStringListIter;
60 59
61 bool mLoaded; 60 bool mLoaded;
62 const LLString mFilename; 61 const LLString mFilename;
63 LLStringList mUrlList; 62 string_list_t mUrlList;
64 LLStringListIter mUrlListIter; 63 U32 mCurIndex;
65}; 64};
66 65
67#endif // LL_LLURLWHITELIST_H 66#endif // LL_LLURLWHITELIST_H
diff --git a/linden/indra/newview/lluserauth.cpp b/linden/indra/newview/lluserauth.cpp
index f980aa0..4b554a9 100644
--- a/linden/indra/newview/lluserauth.cpp
+++ b/linden/indra/newview/lluserauth.cpp
@@ -117,14 +117,14 @@ void LLUserAuth::authenticate(
117 XMLRPC_VectorAppendString(params, "last", lastname, 0); 117 XMLRPC_VectorAppendString(params, "last", lastname, 0);
118 XMLRPC_VectorAppendString(params, "passwd", dpasswd.c_str(), 0); 118 XMLRPC_VectorAppendString(params, "passwd", dpasswd.c_str(), 0);
119 XMLRPC_VectorAppendString(params, "start", start, 0); 119 XMLRPC_VectorAppendString(params, "start", start, 0);
120 char buffer[MAX_STRING]; 120 char buffer[MAX_STRING]; /* Flawfinder: ignore */
121 sprintf(buffer, "%d", LL_VERSION_MAJOR); 121 snprintf(buffer, MAX_STRING, "%d", LL_VERSION_MAJOR); /* Flawfinder: ignore */
122 XMLRPC_VectorAppendString(params, "major", buffer, 0); 122 XMLRPC_VectorAppendString(params, "major", buffer, 0);
123 sprintf(buffer, "%d", LL_VERSION_MINOR); 123 snprintf(buffer, MAX_STRING, "%d", LL_VERSION_MINOR); /* Flawfinder: ignore */
124 XMLRPC_VectorAppendString(params, "minor", buffer, 0); 124 XMLRPC_VectorAppendString(params, "minor", buffer, 0);
125 sprintf(buffer, "%d", LL_VERSION_PATCH); 125 snprintf(buffer, MAX_STRING, "%d", LL_VERSION_PATCH); /* Flawfinder: ignore */
126 XMLRPC_VectorAppendString(params, "patch", buffer, 0); 126 XMLRPC_VectorAppendString(params, "patch", buffer, 0);
127 sprintf(buffer, "%d", LL_VIEWER_BUILD); 127 snprintf(buffer, MAX_STRING, "%d", LL_VIEWER_BUILD); /* Flawfinder: ignore */
128 XMLRPC_VectorAppendString(params, "build", buffer, 0); 128 XMLRPC_VectorAppendString(params, "build", buffer, 0);
129 XMLRPC_VectorAppendString(params, "platform", PLATFORM_STRING, 0); 129 XMLRPC_VectorAppendString(params, "platform", PLATFORM_STRING, 0);
130 XMLRPC_VectorAppendString(params, "mac", hashed_mac.c_str(), 0); 130 XMLRPC_VectorAppendString(params, "mac", hashed_mac.c_str(), 0);
@@ -230,7 +230,7 @@ static void parseOptionInto(
230{ 230{
231 std::string key; 231 std::string key;
232 std::string val; 232 std::string val;
233 char buffer[MAX_STRING]; 233 char buffer[MAX_STRING]; /* Flawfinder: ignore */
234 XMLRPC_VALUE_TYPE_EASY type; 234 XMLRPC_VALUE_TYPE_EASY type;
235 XMLRPC_VALUE row = XMLRPC_VectorRewind(option); 235 XMLRPC_VALUE row = XMLRPC_VectorRewind(option);
236 while(row) 236 while(row)
@@ -248,7 +248,7 @@ static void parseOptionInto(
248 } 248 }
249 else if(xmlrpc_type_int == type) 249 else if(xmlrpc_type_int == type)
250 { 250 {
251 sprintf(buffer, "%d", XMLRPC_GetValueInt(opt)); 251 snprintf(buffer, MAX_STRING, "%d", XMLRPC_GetValueInt(opt)); /* Flawfinder: ignore */
252 val.assign(buffer); 252 val.assign(buffer);
253 } 253 }
254 //llinfos "option val: " << val << llendl; 254 //llinfos "option val: " << val << llendl;
@@ -296,8 +296,8 @@ LLUserAuth::UserAuthcode LLUserAuth::parseResponse()
296 } 296 }
297 else if(xmlrpc_type_int == type) 297 else if(xmlrpc_type_int == type)
298 { 298 {
299 char buf[MAX_STRING]; 299 char buf[MAX_STRING]; /* Flawfinder: ignore */
300 snprintf(buf, MAX_STRING, "%d", XMLRPC_GetValueInt(current)); 300 snprintf(buf, MAX_STRING, "%d", XMLRPC_GetValueInt(current)); /* Flawfinder: ignore */
301 val.assign(buf); 301 val.assign(buf);
302 lldebugs << "val: " << val << llendl; 302 lldebugs << "val: " << val << llendl;
303 mResponses.insert(response_t::value_type(key, val)); 303 mResponses.insert(response_t::value_type(key, val));
diff --git a/linden/indra/newview/llvelocitybar.cpp b/linden/indra/newview/llvelocitybar.cpp
index d285733..403ff4f 100644
--- a/linden/indra/newview/llvelocitybar.cpp
+++ b/linden/indra/newview/llvelocitybar.cpp
@@ -121,8 +121,8 @@ void LLVelocityBar::draw()
121 121
122 top = BAR_TOP + 15; 122 top = BAR_TOP + 15;
123 left = 0; 123 left = 0;
124 char str[80]; 124 char str[80]; /* Flawfinder: ignore */
125 sprintf(str, "Velocity %.3fm/s", velocity); 125 snprintf(str, sizeof(str), "Velocity %.3fm/s", velocity); /* Flawfinder: ignore */
126 LLFontGL::sMonospace->renderUTF8(str, 0, left, top, color, LLFontGL::LEFT, LLFontGL::TOP); 126 LLFontGL::sMonospace->renderUTF8(str, 0, left, top, color, LLFontGL::LEFT, LLFontGL::TOP);
127 127
128 top = TICK_BOTTOM; 128 top = TICK_BOTTOM;
diff --git a/linden/indra/newview/llviewerassetstorage.cpp b/linden/indra/newview/llviewerassetstorage.cpp
index 72af419..fd92d75 100644
--- a/linden/indra/newview/llviewerassetstorage.cpp
+++ b/linden/indra/newview/llviewerassetstorage.cpp
@@ -101,7 +101,7 @@ void LLViewerAssetStorage::storeAssetData(
101 // Read the data from the VFS if it'll fit in this packet. 101 // Read the data from the VFS if it'll fit in this packet.
102 if (asset_size + 100 < MTUBYTES) 102 if (asset_size + 100 < MTUBYTES)
103 { 103 {
104 BOOL res = vfile.read(buffer, asset_size); 104 BOOL res = vfile.read(buffer, asset_size); /* Flawfinder: ignore */
105 S32 bytes_read = res ? vfile.getLastBytesRead() : 0; 105 S32 bytes_read = res ? vfile.getLastBytesRead() : 0;
106 106
107 if( bytes_read == asset_size ) 107 if( bytes_read == asset_size )
@@ -162,6 +162,11 @@ void LLViewerAssetStorage::storeAssetData(
162 bool temp_file, 162 bool temp_file,
163 bool is_priority) 163 bool is_priority)
164{ 164{
165 if(!filename)
166 {
167 llerrs << "No filename specified" << llendl;
168 }
169
165 LLAssetID asset_id = tid.makeAssetID(gAgent.getSecureSessionID()); 170 LLAssetID asset_id = tid.makeAssetID(gAgent.getSecureSessionID());
166 llinfos << "LLViewerAssetStorage::storeAssetData (legacy)" << asset_id << ":" << LLAssetType::lookup(asset_type) << llendl; 171 llinfos << "LLViewerAssetStorage::storeAssetData (legacy)" << asset_id << ":" << LLAssetType::lookup(asset_type) << llendl;
167 172
@@ -172,7 +177,7 @@ void LLViewerAssetStorage::storeAssetData(
172 legacy->mUpCallback = callback; 177 legacy->mUpCallback = callback;
173 legacy->mUserData = user_data; 178 legacy->mUserData = user_data;
174 179
175 FILE *fp = LLFile::fopen(filename, "rb"); 180 FILE* fp = LLFile::fopen(filename, "rb"); /* Flawfinder: ignore */
176 if (fp) 181 if (fp)
177 { 182 {
178 LLVFile file(mVFS, asset_id, asset_type, LLVFile::WRITE); 183 LLVFile file(mVFS, asset_id, asset_type, LLVFile::WRITE);
diff --git a/linden/indra/newview/llviewercamera.cpp b/linden/indra/newview/llviewercamera.cpp
index 62fa0ef..598046a 100644
--- a/linden/indra/newview/llviewercamera.cpp
+++ b/linden/indra/newview/llviewercamera.cpp
@@ -138,7 +138,8 @@ void LLViewerCamera::calcProjection(const F32 far_distance) const
138 138
139LLMatrix4 gProjectionMat; 139LLMatrix4 gProjectionMat;
140 140
141void LLViewerCamera::updateFrustumPlanes() 141//static
142void LLViewerCamera::updateFrustumPlanes(LLCamera& camera, BOOL ortho)
142{ 143{
143 GLint viewport[4]; 144 GLint viewport[4];
144 GLdouble model[16]; 145 GLdouble model[16];
@@ -159,23 +160,26 @@ void LLViewerCamera::updateFrustumPlanes()
159 frust[2].setVec((F32)objX,(F32)objY,(F32)objZ); 160 frust[2].setVec((F32)objX,(F32)objY,(F32)objZ);
160 gluUnProject(viewport[0],viewport[1]+viewport[3],0,model,proj,viewport,&objX,&objY,&objZ); 161 gluUnProject(viewport[0],viewport[1]+viewport[3],0,model,proj,viewport,&objX,&objY,&objZ);
161 frust[3].setVec((F32)objX,(F32)objY,(F32)objZ); 162 frust[3].setVec((F32)objX,(F32)objY,(F32)objZ);
162 /*gluUnProject(viewport[0],viewport[1],1,model,proj,viewport,&objX,&objY,&objZ);
163 frust[4].setVec((F32)objX,(F32)objY,(F32)objZ);
164 gluUnProject(viewport[0]+viewport[2],viewport[1],1,model,proj,viewport,&objX,&objY,&objZ);
165 frust[5].setVec((F32)objX,(F32)objY,(F32)objZ);
166 gluUnProject(viewport[0]+viewport[2],viewport[1]+viewport[3],1,model,proj,viewport,&objX,&objY,&objZ);
167 frust[6].setVec((F32)objX,(F32)objY,(F32)objZ);
168 gluUnProject(viewport[0],viewport[1]+viewport[3],1,model,proj,viewport,&objX,&objY,&objZ);
169 frust[7].setVec((F32)objX,(F32)objY,(F32)objZ);*/
170 163
171 for (U32 i = 0; i < 4; i++) 164 if (ortho)
172 { 165 {
173 LLVector3 vec = frust[i] - getOrigin(); 166 LLVector3 far_shift = LLVector3(camera.getFar()*2.0f,0,0);
174 vec.normVec(); 167 for (U32 i = 0; i < 4; i++)
175 frust[i+4] = getOrigin() + vec*getFar()*2.0; 168 {
169 frust[i+4] = frust[i] + far_shift;
170 }
171 }
172 else
173 {
174 for (U32 i = 0; i < 4; i++)
175 {
176 LLVector3 vec = frust[i] - camera.getOrigin();
177 vec.normVec();
178 frust[i+4] = camera.getOrigin() + vec*camera.getFar()*2.0f;
179 }
176 } 180 }
177 181
178 calcAgentFrustumPlanes(frust); 182 camera.calcAgentFrustumPlanes(frust);
179} 183}
180 184
181void LLViewerCamera::setPerspective(BOOL for_selection, 185void LLViewerCamera::setPerspective(BOOL for_selection,
@@ -274,7 +278,7 @@ void LLViewerCamera::setPerspective(BOOL for_selection,
274 glGetIntegerv(GL_VIEWPORT, (GLint*)gGLViewport); 278 glGetIntegerv(GL_VIEWPORT, (GLint*)gGLViewport);
275 } 279 }
276 280
277 updateFrustumPlanes(); 281 updateFrustumPlanes(*this);
278 282
279 if (gSavedSettings.getBOOL("CameraOffset")) 283 if (gSavedSettings.getBOOL("CameraOffset"))
280 { 284 {
@@ -602,22 +606,34 @@ BOOL LLViewerCamera::areVertsVisible(LLViewerObject* volumep, BOOL all_verts)
602 return FALSE; 606 return FALSE;
603 } 607 }
604 608
605 num_faces = drawablep->getNumFaces(); 609 LLVolume* volume = volumep->getVolume();
610 if (!volume)
611 {
612 return FALSE;
613 }
614
615 LLVOVolume* vo_volume = (LLVOVolume*) volumep;
616
617 vo_volume->updateRelativeXform();
618 LLMatrix4 mat = vo_volume->getRelativeXform();
619
620 LLMatrix4 render_mat(vo_volume->getRenderRotation(), LLVector4(vo_volume->getRenderPosition()));
621
622 num_faces = volume->getNumFaces();
606 for (i = 0; i < num_faces; i++) 623 for (i = 0; i < num_faces; i++)
607 { 624 {
608 LLStrider<LLVector3> vertices; 625 const LLVolumeFace& face = volume->getVolumeFace(i);
609 LLFace* face = drawablep->getFace(i); 626
610 face->getVertices(vertices); 627 for (U32 v = 0; v < face.mVertices.size(); v++)
611
612 for (S32 v = 0; v < (S32)drawablep->getFace(i)->getGeomCount(); v++)
613 { 628 {
614 LLVector3 vec = vertices[v]; 629 LLVector4 vec = LLVector4(face.mVertices[v].mPosition) * mat;
615 if (!face->isState(LLFace::GLOBAL)) 630
631 if (drawablep->isActive())
616 { 632 {
617 vec = vec*face->getRenderMatrix(); 633 vec = vec * render_mat;
618 } 634 }
619 635
620 BOOL in_frustum = pointInFrustum(vec) > 0; 636 BOOL in_frustum = pointInFrustum(LLVector3(vec)) > 0;
621 637
622 if ( !in_frustum && all_verts || 638 if ( !in_frustum && all_verts ||
623 in_frustum && !all_verts) 639 in_frustum && !all_verts)
diff --git a/linden/indra/newview/llviewercamera.h b/linden/indra/newview/llviewercamera.h
index 8ea2738..a7e600b 100644
--- a/linden/indra/newview/llviewercamera.h
+++ b/linden/indra/newview/llviewercamera.h
@@ -55,7 +55,7 @@ public:
55 const LLVector3 &up_direction, 55 const LLVector3 &up_direction,
56 const LLVector3 &point_of_interest); 56 const LLVector3 &point_of_interest);
57 57
58 void updateFrustumPlanes(); 58 static void updateFrustumPlanes(LLCamera& camera, BOOL ortho = FALSE);
59 void setPerspective(BOOL for_selection, S32 x, S32 y_from_bot, S32 width, S32 height, BOOL limit_select_distance, F32 z_near = 0, F32 z_far = 0); 59 void setPerspective(BOOL for_selection, S32 x, S32 y_from_bot, S32 width, S32 height, BOOL limit_select_distance, F32 z_near = 0, F32 z_far = 0);
60 60
61 const LLMatrix4 &getProjection() const; 61 const LLMatrix4 &getProjection() const;
diff --git a/linden/indra/newview/llviewercontrol.cpp b/linden/indra/newview/llviewercontrol.cpp
index 86e58d1..e1aa3ae 100644
--- a/linden/indra/newview/llviewercontrol.cpp
+++ b/linden/indra/newview/llviewercontrol.cpp
@@ -105,7 +105,7 @@ BOOL LLFloaterSettingsDebug::postBuild()
105 childSetUserData("boolean_combo", this); 105 childSetUserData("boolean_combo", this);
106 childSetCommitCallback("color_swatch", onCommitSettings); 106 childSetCommitCallback("color_swatch", onCommitSettings);
107 childSetUserData("color_swatch", this); 107 childSetUserData("color_swatch", this);
108 108 childSetAction("default_btn", onClickDefault, this);
109 mComment = (LLTextEditor*)getChildByName("comment_text"); 109 mComment = (LLTextEditor*)getChildByName("comment_text");
110 return TRUE; 110 return TRUE;
111} 111}
@@ -129,7 +129,7 @@ void LLFloaterSettingsDebug::show(void*)
129 gUICtrlFactory->buildFloater(sInstance, "floater_settings_debug.xml"); 129 gUICtrlFactory->buildFloater(sInstance, "floater_settings_debug.xml");
130 } 130 }
131 131
132 sInstance->open(); 132 sInstance->open(); /* Flawfinder: ignore */
133} 133}
134 134
135//static 135//static
@@ -217,6 +217,20 @@ void LLFloaterSettingsDebug::onCommitSettings(LLUICtrl* ctrl, void* user_data)
217 } 217 }
218} 218}
219 219
220// static
221void LLFloaterSettingsDebug::onClickDefault(void* user_data)
222{
223 LLFloaterSettingsDebug* floaterp = (LLFloaterSettingsDebug*)user_data;
224 LLComboBox* settings_combo = (LLComboBox*)floaterp->getChildByName("settings_combo");
225 LLControlBase* controlp = (LLControlBase*)settings_combo->getCurrentUserdata();
226
227 if (controlp)
228 {
229 controlp->resetToDefault();
230 floaterp->updateControl(controlp);
231 }
232}
233
220// we've switched controls, or doing per-frame update, so update spinners, etc. 234// we've switched controls, or doing per-frame update, so update spinners, etc.
221void LLFloaterSettingsDebug::updateControl(LLControlBase* controlp) 235void LLFloaterSettingsDebug::updateControl(LLControlBase* controlp)
222{ 236{
@@ -440,6 +454,8 @@ void LLFloaterSettingsDebug::updateControl(LLControlBase* controlp)
440 if (!spinner4->hasFocus()) 454 if (!spinner4->hasFocus())
441 { 455 {
442 spinner4->setPrecision(3); 456 spinner4->setPrecision(3);
457 spinner4->setMinValue(0.0);
458 spinner4->setMaxValue(1.f);
443 spinner4->setValue(clr.mV[VALPHA]); 459 spinner4->setValue(clr.mV[VALPHA]);
444 } 460 }
445 break; 461 break;
diff --git a/linden/indra/newview/llviewercontrol.h b/linden/indra/newview/llviewercontrol.h
index 4be4313..d9a2682 100644
--- a/linden/indra/newview/llviewercontrol.h
+++ b/linden/indra/newview/llviewercontrol.h
@@ -46,6 +46,7 @@ public:
46 static void show(void*); 46 static void show(void*);
47 static void onSettingSelect(LLUICtrl* ctrl, void* user_data); 47 static void onSettingSelect(LLUICtrl* ctrl, void* user_data);
48 static void onCommitSettings(LLUICtrl* ctrl, void* user_data); 48 static void onCommitSettings(LLUICtrl* ctrl, void* user_data);
49 static void onClickDefault(void* user_data);
49 50
50protected: 51protected:
51 static LLFloaterSettingsDebug* sInstance; 52 static LLFloaterSettingsDebug* sInstance;
@@ -54,6 +55,7 @@ protected:
54 55
55//setting variables are declared in this function 56//setting variables are declared in this function
56void declare_settings(); 57void declare_settings();
58void settings_version_fixup();
57 59
58// saved at end of session 60// saved at end of session
59extern LLControlGroup gSavedSettings; 61extern LLControlGroup gSavedSettings;
diff --git a/linden/indra/newview/llviewerdisplay.cpp b/linden/indra/newview/llviewerdisplay.cpp
index f09e34c..071b699 100644
--- a/linden/indra/newview/llviewerdisplay.cpp
+++ b/linden/indra/newview/llviewerdisplay.cpp
@@ -63,6 +63,9 @@
63#include "llfloatertools.h" 63#include "llfloatertools.h"
64#include "llviewerimagelist.h" 64#include "llviewerimagelist.h"
65#include "llfocusmgr.h" 65#include "llfocusmgr.h"
66#include "llcubemap.h"
67#include "llviewerregion.h"
68#include "lldrawpoolwater.h"
66 69
67extern U32 gFrameCount; 70extern U32 gFrameCount;
68extern LLPointer<LLImageGL> gStartImageGL; 71extern LLPointer<LLImageGL> gStartImageGL;
@@ -103,8 +106,12 @@ void display_startup()
103 return; 106 return;
104 } 107 }
105 108
106 LLDynamicTexture::updateAllInstances(); 109 // Required for HTML update in login screen
107 110 static S32 frame_count = 0;
111 if (frame_count++ > 1) // make sure we have rendered a frame first
112 {
113 LLDynamicTexture::updateAllInstances();
114 }
108 glClear(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); 115 glClear(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
109 LLGLSDefault gls_default; 116 LLGLSDefault gls_default;
110 LLGLSUIDefault gls_ui; 117 LLGLSUIDefault gls_ui;
@@ -174,11 +181,8 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield)
174 // Clean up memory the pools may have allocated 181 // Clean up memory the pools may have allocated
175 if (rebuild) 182 if (rebuild)
176 { 183 {
177 if (!gViewerWindow->renderingFastFrame()) 184 gFrameStats.start(LLFrameStats::REBUILD);
178 { 185 gPipeline.rebuildPools();
179 gFrameStats.start(LLFrameStats::REBUILD);
180 gPipeline.rebuildPools();
181 }
182 } 186 }
183 return; 187 return;
184 } 188 }
@@ -378,14 +382,6 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield)
378 } 382 }
379 } 383 }
380 384
381 if (rebuild)
382 {
383 if (gViewerWindow->renderingFastFrame())
384 {
385 gFrameStats.start(LLFrameStats::STATE_SORT);
386 gFrameStats.start(LLFrameStats::REBUILD);
387 }
388 }
389 385
390 ///////////////////////////// 386 /////////////////////////////
391 // 387 //
@@ -394,6 +390,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield)
394 // 390 //
395 391
396 gCamera->setZoomParameters(zoom_factor, subfield); 392 gCamera->setZoomParameters(zoom_factor, subfield);
393 gCamera->setNear(MIN_NEAR_PLANE);
397 394
398 ////////////////////////// 395 //////////////////////////
399 // 396 //
@@ -409,6 +406,8 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield)
409 else if (!gViewerWindow->isPickPending()) 406 else if (!gViewerWindow->isPickPending())
410 { 407 {
411 glClear( GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT ); 408 glClear( GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT );
409 //DEBUG TEMPORARY
410 glClear(GL_COLOR_BUFFER_BIT);
412 } 411 }
413 gViewerWindow->setupViewport(); 412 gViewerWindow->setupViewport();
414 413
@@ -429,7 +428,13 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield)
429 glClearColor(0.5f, 0.5f, 0.5f, 0.f); 428 glClearColor(0.5f, 0.5f, 0.5f, 0.f);
430 glClear(GL_COLOR_BUFFER_BIT); 429 glClear(GL_COLOR_BUFFER_BIT);
431 glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); 430 glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
431 LLPipeline::sUseOcclusion = FALSE;
432 } 432 }
433 else
434 {
435 LLPipeline::sUseOcclusion = gSavedSettings.getBOOL("UseOcclusion") && gGLManager.mHasOcclusionQuery;
436 }
437
433 stop_glerror(); 438 stop_glerror();
434 439
435 /////////////////////////////////////// 440 ///////////////////////////////////////
@@ -442,7 +447,8 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield)
442 glLightModelfv (GL_LIGHT_MODEL_AMBIENT,one); 447 glLightModelfv (GL_LIGHT_MODEL_AMBIENT,one);
443 stop_glerror(); 448 stop_glerror();
444 449
445 //LLGLState::verify(); 450 //Increment drawable frame counter
451 LLDrawable::incrementVisible();
446 452
447 ///////////////////////////////////// 453 /////////////////////////////////////
448 // 454 //
@@ -452,6 +458,11 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield)
452 // 458 //
453 if (!gDisconnected) 459 if (!gDisconnected)
454 { 460 {
461 if (gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_HUD))
462 { //don't draw hud objects in this frame
463 gPipeline.toggleRenderType(LLPipeline::RENDER_TYPE_HUD);
464 }
465
455 LLFastTimer t(LLFastTimer::FTM_WORLD_UPDATE); 466 LLFastTimer t(LLFastTimer::FTM_WORLD_UPDATE);
456 stop_glerror(); 467 stop_glerror();
457 display_update_camera(); 468 display_update_camera();
@@ -467,34 +478,41 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield)
467 gPipeline.updateGeom(max_geom_update_time); 478 gPipeline.updateGeom(max_geom_update_time);
468 stop_glerror(); 479 stop_glerror();
469 480
481 LLSpatialPartition* part = gPipeline.getSpatialPartition(LLPipeline::PARTITION_VOLUME);
482 part->processImagery(gCamera);
483
484 display_update_camera();
485
470 gFrameStats.start(LLFrameStats::UPDATE_CULL); 486 gFrameStats.start(LLFrameStats::UPDATE_CULL);
471 gPipeline.updateCull(); 487 gPipeline.updateCull(*gCamera);
472 stop_glerror(); 488 stop_glerror();
473 489
474 if (rebuild && !gViewerWindow->renderingFastFrame()) 490 ///////////////////////////////////
491 //
492 // StateSort
493 //
494 // Responsible for taking visible objects, and adding them to the appropriate draw orders.
495 // In the case of alpha objects, z-sorts them first.
496 // Also creates special lists for outlines and selected face rendering.
497 //
475 { 498 {
476 LLFastTimer t(LLFastTimer::FTM_REBUILD); 499 LLFastTimer t(LLFastTimer::FTM_REBUILD);
477
478 ///////////////////////////////////
479 //
480 // StateSort
481 //
482 // Responsible for taking visible objects, and adding them to the appropriate draw orders.
483 // In the case of alpha objects, z-sorts them first.
484 // Also creates special lists for outlines and selected face rendering.
485 //
486 gFrameStats.start(LLFrameStats::STATE_SORT);
487 gPipeline.stateSort();
488 stop_glerror();
489 500
490 ////////////////////////////////////// 501 gFrameStats.start(LLFrameStats::STATE_SORT);
491 // 502 gPipeline.stateSort(*gCamera);
492 // rebuildPools
493 //
494 //
495 gFrameStats.start(LLFrameStats::REBUILD);
496 gPipeline.rebuildPools();
497 stop_glerror(); 503 stop_glerror();
504
505 if (rebuild)
506 {
507 //////////////////////////////////////
508 //
509 // rebuildPools
510 //
511 //
512 gFrameStats.start(LLFrameStats::REBUILD);
513 gPipeline.rebuildPools();
514 stop_glerror();
515 }
498 } 516 }
499 } 517 }
500 518
@@ -535,19 +553,74 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield)
535 // glPopMatrix(); 553 // glPopMatrix();
536 //} 554 //}
537 555
538 if (gViewerWindow->renderingFastFrame()) 556 if (!(gLogoutRequestSent && gHaveSavedSnapshot)
539 {
540 gFrameStats.start(LLFrameStats::RENDER_SYNC);
541 gFrameStats.start(LLFrameStats::RENDER_GEOM);
542 }
543 else if (!(gLogoutRequestSent && gHaveSavedSnapshot)
544 && !gRestoreGL 557 && !gRestoreGL
545 && !gDisconnected) 558 && !gDisconnected)
546 { 559 {
547 gPipeline.renderGeom(); 560 gPipeline.renderGeom(*gCamera);
548 stop_glerror(); 561 stop_glerror();
549 } 562 }
550 563
564 //render hud attachments
565 glMatrixMode(GL_PROJECTION);
566 glPushMatrix();
567 glMatrixMode(GL_MODELVIEW);
568 glPushMatrix();
569 if (LLPipeline::sShowHUDAttachments && !gDisconnected && setup_hud_matrices(FALSE))
570 {
571 LLCamera hud_cam = *gCamera;
572 glClear(GL_DEPTH_BUFFER_BIT);
573 LLVector3 origin = hud_cam.getOrigin();
574 hud_cam.setOrigin(-1.f,0,0);
575 hud_cam.setAxes(LLVector3(1,0,0), LLVector3(0,1,0), LLVector3(0,0,1));
576 LLViewerCamera::updateFrustumPlanes(hud_cam, TRUE);
577 //only render hud objects
578 U32 mask = gPipeline.getRenderTypeMask();
579 gPipeline.setRenderTypeMask(0);
580 gPipeline.toggleRenderType(LLPipeline::RENDER_TYPE_HUD);
581
582 BOOL has_ui = gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_UI);
583 if (has_ui)
584 {
585 gPipeline.toggleRenderDebugFeature((void*) LLPipeline::RENDER_DEBUG_FEATURE_UI);
586 }
587
588 BOOL use_occlusion = gSavedSettings.getBOOL("UseOcclusion");
589 gSavedSettings.setBOOL("UseOcclusion", FALSE);
590
591 //cull, sort, and render hud objects
592 gPipeline.updateCull(hud_cam);
593
594 gPipeline.toggleRenderType(LLDrawPool::POOL_ALPHA_POST_WATER);
595 gPipeline.toggleRenderType(LLPipeline::RENDER_TYPE_BUMP);
596 gPipeline.toggleRenderType(LLPipeline::RENDER_TYPE_SIMPLE);
597 gPipeline.toggleRenderType(LLPipeline::RENDER_TYPE_VOLUME);
598
599 {
600 LLFastTimer ftm(LLFastTimer::FTM_REBUILD);
601 gPipeline.stateSort(hud_cam);
602 }
603
604 if (LLVertexBuffer::sEnableVBOs)
605 {
606 LLImageGL::sBoundTextureMemory += LLVertexBuffer::sAllocatedBytes;
607 }
608
609 gPipeline.renderGeom(hud_cam);
610
611 //restore type mask
612 gPipeline.setRenderTypeMask(mask);
613 if (has_ui)
614 {
615 gPipeline.toggleRenderDebugFeature((void*) LLPipeline::RENDER_DEBUG_FEATURE_UI);
616 }
617 gSavedSettings.setBOOL("UseOcclusion", use_occlusion);
618 }
619 glMatrixMode(GL_PROJECTION);
620 glPopMatrix();
621 glMatrixMode(GL_MODELVIEW);
622 glPopMatrix();
623
551 gFrameStats.start(LLFrameStats::RENDER_UI); 624 gFrameStats.start(LLFrameStats::RENDER_UI);
552 625
553 if (gHandleKeysAsync) 626 if (gHandleKeysAsync)
@@ -570,6 +643,64 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield)
570 643
571} 644}
572 645
646BOOL setup_hud_matrices(BOOL for_select)
647{
648 LLVOAvatar* my_avatarp = gAgent.getAvatarObject();
649 if (my_avatarp && my_avatarp->hasHUDAttachment())
650 {
651 if (!for_select)
652 {
653 // clamp target zoom level to reasonable values
654 my_avatarp->mHUDTargetZoom = llclamp(my_avatarp->mHUDTargetZoom, 0.1f, 1.f);
655 // smoothly interpolate current zoom level
656 my_avatarp->mHUDCurZoom = lerp(my_avatarp->mHUDCurZoom, my_avatarp->mHUDTargetZoom, LLCriticalDamp::getInterpolant(0.03f));
657 }
658
659 F32 zoom_level = my_avatarp->mHUDCurZoom;
660 // clear z buffer and set up transform for hud
661 if (!for_select)
662 {
663 glClear(GL_DEPTH_BUFFER_BIT);
664 }
665 LLBBox hud_bbox = my_avatarp->getHUDBBox();
666
667 // set up transform to encompass bounding box of HUD
668 glMatrixMode(GL_PROJECTION);
669 glLoadIdentity();
670 F32 hud_depth = llmax(1.f, hud_bbox.getExtentLocal().mV[VX] * 1.1f);
671 if (for_select)
672 {
673 //RN: reset viewport to window extents so ortho screen is calculated with proper reference frame
674 gViewerWindow->setupViewport();
675 }
676 glOrtho(-0.5f * gCamera->getAspect(), 0.5f * gCamera->getAspect(), -0.5f, 0.5f, 0.f, hud_depth);
677
678 // apply camera zoom transform (for high res screenshots)
679 F32 zoom_factor = gCamera->getZoomFactor();
680 S16 sub_region = gCamera->getZoomSubRegion();
681 if (zoom_factor > 1.f)
682 {
683 float offset = zoom_factor - 1.f;
684 int pos_y = sub_region / llceil(zoom_factor);
685 int pos_x = sub_region - (pos_y*llceil(zoom_factor));
686 glTranslatef(gCamera->getAspect() * 0.5f * (offset - (F32)pos_x * 2.f), 0.5f * (offset - (F32)pos_y * 2.f), 0.f);
687 glScalef(zoom_factor, zoom_factor, 1.f);
688 }
689
690 glMatrixMode(GL_MODELVIEW);
691 glLoadIdentity();
692 glLoadMatrixf(OGL_TO_CFR_ROTATION); // Load Cory's favorite reference frame
693 glTranslatef(-hud_bbox.getCenterLocal().mV[VX] + (hud_depth * 0.5f), 0.f, 0.f);
694 glScalef(zoom_level, zoom_level, zoom_level);
695
696 return TRUE;
697 }
698 else
699 {
700 return FALSE;
701 }
702}
703
573 704
574void render_ui_and_swap() 705void render_ui_and_swap()
575{ 706{
@@ -581,11 +712,11 @@ void render_ui_and_swap()
581 { 712 {
582 LLGLSUIDefault gls_ui; 713 LLGLSUIDefault gls_ui;
583 gPipeline.disableLights(); 714 gPipeline.disableLights();
584 715 LLVertexBuffer::startRender();
585 if (gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_UI)) 716 if (gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_UI))
586 { 717 {
587 LLFastTimer t(LLFastTimer::FTM_RENDER_UI); 718 LLFastTimer t(LLFastTimer::FTM_RENDER_UI);
588 if (!gViewerWindow->renderingFastFrame() && !gDisconnected) 719 if (!gDisconnected)
589 { 720 {
590 render_ui_3d(); 721 render_ui_3d();
591#ifndef LL_RELEASE_FOR_DOWNLOAD 722#ifndef LL_RELEASE_FOR_DOWNLOAD
@@ -598,6 +729,8 @@ void render_ui_and_swap()
598 LLGLState::checkStates(); 729 LLGLState::checkStates();
599#endif 730#endif
600 } 731 }
732 LLVertexBuffer::stopRender();
733 glFlush();
601 734
602 // now do the swap buffer 735 // now do the swap buffer
603 if (gDisplaySwapBuffers) 736 if (gDisplaySwapBuffers)
@@ -605,9 +738,13 @@ void render_ui_and_swap()
605 LLFastTimer t(LLFastTimer::FTM_SWAP); 738 LLFastTimer t(LLFastTimer::FTM_SWAP);
606 gViewerWindow->mWindow->swapBuffers(); 739 gViewerWindow->mWindow->swapBuffers();
607 } 740 }
608 }
609 741
610 gViewerWindow->finishFirstFastFrame(); 742 {
743 LLFastTimer ftm(LLFastTimer::FTM_CLIENT_COPY);
744 LLVertexBuffer::clientCopy(0.016);
745 }
746
747 }
611} 748}
612 749
613void render_ui_3d() 750void render_ui_3d()
@@ -622,8 +759,6 @@ void render_ui_3d()
622 // 759 //
623 760
624 // Render selections 761 // Render selections
625
626 glDisableClientState(GL_VERTEX_ARRAY);
627 glDisableClientState(GL_COLOR_ARRAY); 762 glDisableClientState(GL_COLOR_ARRAY);
628 glDisableClientState(GL_TEXTURE_COORD_ARRAY); 763 glDisableClientState(GL_TEXTURE_COORD_ARRAY);
629 glDisableClientState(GL_NORMAL_ARRAY); 764 glDisableClientState(GL_NORMAL_ARRAY);
@@ -680,7 +815,6 @@ void render_ui_2d()
680 LLFontGL::sCurOrigin.mY -= llround((F32)gViewerWindow->getWindowHeight() * (F32)pos_y / zoom_factor); 815 LLFontGL::sCurOrigin.mY -= llround((F32)gViewerWindow->getWindowHeight() * (F32)pos_y / zoom_factor);
681 } 816 }
682 817
683
684 stop_glerror(); 818 stop_glerror();
685 glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); 819 glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
686 820
@@ -781,11 +915,12 @@ void render_disconnected_background()
781 { 915 {
782 llinfos << "Loading last bitmap..." << llendl; 916 llinfos << "Loading last bitmap..." << llendl;
783 917
784 char temp_str[MAX_PATH]; 918 char temp_str[MAX_PATH]; /* Flawfinder: ignore */
785 strcpy(temp_str, gDirUtilp->getLindenUserDir().c_str()); 919 strncpy(temp_str, gDirUtilp->getLindenUserDir().c_str(), MAX_PATH -1); /* Flawfinder: ignore */
786 strcat(temp_str, gDirUtilp->getDirDelimiter().c_str()); 920 temp_str[MAX_PATH -1] = '\0';
921 strncat(temp_str, gDirUtilp->getDirDelimiter().c_str(), MAX_PATH - strlen(temp_str) -1); /* Flawfinder: ignore */
787 922
788 strcat(temp_str, SCREEN_LAST_FILENAME); 923 strcat(temp_str, SCREEN_LAST_FILENAME); /* Flawfinder: ignore */
789 924
790 LLPointer<LLImageBMP> image_bmp = new LLImageBMP; 925 LLPointer<LLImageBMP> image_bmp = new LLImageBMP;
791 if( !image_bmp->load(temp_str) ) 926 if( !image_bmp->load(temp_str) )
diff --git a/linden/indra/newview/llviewergesture.cpp b/linden/indra/newview/llviewergesture.cpp
index d4201c0..fd98070 100644
--- a/linden/indra/newview/llviewergesture.cpp
+++ b/linden/indra/newview/llviewergesture.cpp
@@ -156,18 +156,18 @@ void LLViewerGestureList::saveToServer()
156 //U64 xfer_id = gXferManager->registerXfer(buffer, end - buffer); 156 //U64 xfer_id = gXferManager->registerXfer(buffer, end - buffer);
157 // write to a file because mem<->mem xfer isn't implemented 157 // write to a file because mem<->mem xfer isn't implemented
158 LLUUID random_uuid; 158 LLUUID random_uuid;
159 char filename[LL_MAX_PATH]; 159 char filename[LL_MAX_PATH]; /* Flawfinder: ignore */
160 random_uuid.generate(); 160 random_uuid.generate();
161 random_uuid.toString(filename); 161 random_uuid.toString(filename);
162 strcat(filename,".tmp"); 162 strcat(filename,".tmp"); /* Flawfinder: ignore */
163 163
164 char filename_and_path[LL_MAX_PATH]; 164 char filename_and_path[LL_MAX_PATH]; /* Flawfinder: ignore */
165 sprintf(filename_and_path, "%s%s%s", 165 snprintf(filename_and_path, LL_MAX_PATH, "%s%s%s", /* Flawfinder: ignore */
166 gDirUtilp->getTempDir().c_str(), 166 gDirUtilp->getTempDir().c_str(),
167 gDirUtilp->getDirDelimiter().c_str(), 167 gDirUtilp->getDirDelimiter().c_str(),
168 filename); 168 filename);
169 169
170 FILE *fp = LLFile::fopen(filename_and_path, "wb"); 170 FILE* fp = LLFile::fopen(filename_and_path, "wb"); /* Flawfinder: ignore */
171 171
172 if (fp) 172 if (fp)
173 { 173 {
@@ -270,7 +270,7 @@ void LLViewerGestureList::xferCallback(void *data, S32 size, void** /*user_data*
270// static 270// static
271void LLViewerGestureList::processGestureUpdate(LLMessageSystem *msg, void** /*user_data*/) 271void LLViewerGestureList::processGestureUpdate(LLMessageSystem *msg, void** /*user_data*/)
272{ 272{
273 char remote_filename[MAX_STRING]; 273 char remote_filename[MAX_STRING]; /* Flawfinder: ignore */
274 msg->getStringFast(_PREHASH_AgentBlock, _PREHASH_Filename, MAX_STRING, remote_filename); 274 msg->getStringFast(_PREHASH_AgentBlock, _PREHASH_Filename, MAX_STRING, remote_filename);
275 275
276 276
diff --git a/linden/indra/newview/llviewerimage.cpp b/linden/indra/newview/llviewerimage.cpp
index 7500ada..5a745ae 100644
--- a/linden/indra/newview/llviewerimage.cpp
+++ b/linden/indra/newview/llviewerimage.cpp
@@ -34,11 +34,13 @@
34#include "llmath.h" 34#include "llmath.h"
35#include "llerror.h" 35#include "llerror.h"
36#include "llgl.h" 36#include "llgl.h"
37#include "llglheaders.h"
37#include "llhost.h" 38#include "llhost.h"
38#include "llimage.h" 39#include "llimage.h"
39#include "llimagebmp.h" 40#include "llimagebmp.h"
40#include "llimagej2c.h" 41#include "llimagej2c.h"
41#include "llimagetga.h" 42#include "llimagetga.h"
43#include "llmemtype.h"
42#include "llstl.h" 44#include "llstl.h"
43#include "lltexturetable.h" 45#include "lltexturetable.h"
44#include "llvfile.h" 46#include "llvfile.h"
@@ -47,41 +49,12 @@
47#include "lltimer.h" 49#include "lltimer.h"
48 50
49// viewer includes 51// viewer includes
52#include "lldrawpool.h"
53#include "lltexturefetch.h"
50#include "llviewerimagelist.h" 54#include "llviewerimagelist.h"
51#include "llviewercontrol.h" 55#include "llviewercontrol.h"
52#include "viewer.h"
53#include "llglheaders.h"
54#include "pipeline.h" 56#include "pipeline.h"
55#include "lldrawpool.h" 57#include "viewer.h"
56
57const S32 IMAGE_HEADER_SIZE = 27;
58const S32 PACKET_HEADER_SIZE = 4;
59
60///////////////////////////////////////////////////////////////////////////////
61
62class LLViewerImagePacket
63{
64public:
65 LLViewerImagePacket(U8 *data, U16 data_size, U16 packet_num, BOOL wrote_to_disk)
66 {
67 mData = data;
68 mDataSize = data_size;
69 mPacketNum = packet_num;
70 mWroteToDisk = wrote_to_disk;
71 }
72
73 ~LLViewerImagePacket()
74 {
75 delete[] mData;
76 }
77
78public:
79 U8 *mData;
80 U16 mDataSize;
81 U16 mPacketNum;
82 BOOL mWroteToDisk;
83};
84
85 58
86/////////////////////////////////////////////////////////////////////////////// 59///////////////////////////////////////////////////////////////////////////////
87 60
@@ -95,6 +68,8 @@ LLPointer<LLImageGL> LLViewerImage::sNullImagep = NULL;
95S32 LLViewerImage::sImageCount = 0; 68S32 LLViewerImage::sImageCount = 0;
96LLTimer LLViewerImage::sEvaluationTimer; 69LLTimer LLViewerImage::sEvaluationTimer;
97F32 LLViewerImage::sDesiredDiscardBias = 0.f; 70F32 LLViewerImage::sDesiredDiscardBias = 0.f;
71static F32 sDesiredDiscardBiasMin = -2.0f; // -max number of levels to improve image quality by
72static F32 sDesiredDiscardBiasMax = 1.5f; // max number of levels to reduce image quality by
98F32 LLViewerImage::sDesiredDiscardScale = 1.1f; 73F32 LLViewerImage::sDesiredDiscardScale = 1.1f;
99S32 LLViewerImage::sBoundTextureMemory = 0; 74S32 LLViewerImage::sBoundTextureMemory = 0;
100S32 LLViewerImage::sTotalTextureMemory = 0; 75S32 LLViewerImage::sTotalTextureMemory = 0;
@@ -109,6 +84,43 @@ void LLViewerImage::initClass()
109 LLPointer<LLImageRaw> raw = new LLImageRaw(1,1,3); 84 LLPointer<LLImageRaw> raw = new LLImageRaw(1,1,3);
110 raw->clear(0x77, 0x77, 0x77, 0xFF); 85 raw->clear(0x77, 0x77, 0x77, 0xFF);
111 sNullImagep->createGLTexture(0, raw); 86 sNullImagep->createGLTexture(0, raw);
87
88#if 1
89 LLViewerImage* imagep = new LLViewerImage(IMG_DEFAULT, TRUE);
90 sDefaultImagep = imagep;
91 const S32 dim = 128;
92 LLPointer<LLImageRaw> image_raw = new LLImageRaw(dim,dim,3);
93 U8* data = image_raw->getData();
94 for (S32 i = 0; i<dim; i++)
95 {
96 for (S32 j = 0; j<dim; j++)
97 {
98#if 0
99 const S32 border = 2;
100 if (i<border || j<border || i>=(dim-border) || j>=(dim-border))
101 {
102 *data++ = 0xff;
103 *data++ = 0xff;
104 *data++ = 0xff;
105 }
106 else
107#endif
108 {
109 *data++ = 0x7f;
110 *data++ = 0x7f;
111 *data++ = 0x7f;
112 }
113 }
114 }
115 imagep->createGLTexture(0, image_raw);
116 image_raw = NULL;
117 gImageList.addImage(imagep);
118 imagep->dontDiscard();
119#else
120 sDefaultImagep = gImageList.getImage(IMG_DEFAULT, TRUE, TRUE);
121#endif
122 sSmokeImagep = gImageList.getImage(IMG_SMOKE, TRUE, TRUE);
123
112} 124}
113 125
114// static 126// static
@@ -171,6 +183,7 @@ void LLViewerImage::updateClass(const F32 velocity, const F32 angular_velocity)
171 sEvaluationTimer.reset(); 183 sEvaluationTimer.reset();
172 } 184 }
173 } 185 }
186 sDesiredDiscardBias = llclamp(sDesiredDiscardBias, sDesiredDiscardBiasMin, sDesiredDiscardBiasMax);
174} 187}
175 188
176//---------------------------------------------------------------------------- 189//----------------------------------------------------------------------------
@@ -209,35 +222,20 @@ LLViewerImage::LLViewerImage(const LLImageRaw* raw, BOOL usemipmaps)
209 222
210void LLViewerImage::init(bool firstinit) 223void LLViewerImage::init(bool firstinit)
211{ 224{
212 mDataCodec = 0;
213 mFullWidth = 0; 225 mFullWidth = 0;
214 mFullHeight = 0; 226 mFullHeight = 0;
215 mFormattedImagep = NULL;
216 mNeedsAux = FALSE; 227 mNeedsAux = FALSE;
217 mRequested = FALSE;
218 mNeedsDecode = FALSE;
219 mTexelsPerImage = 64.f*64.f; 228 mTexelsPerImage = 64.f*64.f;
220 mMaxVirtualSize = 0.f; 229 mMaxVirtualSize = 0.f;
230 mDiscardVirtualSize = 0.f;
221 mMaxCosAngle = -1.f; 231 mMaxCosAngle = -1.f;
222 mRequestedDiscardLevel = -1; 232 mRequestedDiscardLevel = -1;
223 mRequestedDownloadPriority = 0.f; 233 mRequestedDownloadPriority = 0.f;
224 mPackets = 0;
225 mGotFirstPacket = FALSE;
226 mPacketsReceived = 0;
227 mFullyLoaded = FALSE; 234 mFullyLoaded = FALSE;
228 mDesiredDiscardLevel = MAX_DISCARD_LEVEL + 1; 235 mDesiredDiscardLevel = MAX_DISCARD_LEVEL + 1;
229 mMinDesiredDiscardLevel = MAX_DISCARD_LEVEL + 1; 236 mMinDesiredDiscardLevel = MAX_DISCARD_LEVEL + 1;
230 mStreamFile = NULL; 237 mCalculatedDiscardLevel = -1.f;
231 mCachedData = NULL;
232 mCachedSize = 0;
233 mFormattedFlushed = FALSE;
234 mTotalBytes = 0;
235 238
236 resetPacketData();
237
238 mLastPacketProcessed = -1;
239 mLastBytesProcessed = 0;
240 mLastPacket = -1;
241 mDecodingAux = FALSE; 239 mDecodingAux = FALSE;
242 240
243 mKnownDrawWidth = 0; 241 mKnownDrawWidth = 0;
@@ -247,7 +245,6 @@ void LLViewerImage::init(bool firstinit)
247 { 245 {
248 mDecodePriority = 0.f; 246 mDecodePriority = 0.f;
249 mInImageList = 0; 247 mInImageList = 0;
250 mInStaticVFS = FALSE;
251 } 248 }
252 mIsMediaTexture = FALSE; 249 mIsMediaTexture = FALSE;
253 250
@@ -261,9 +258,18 @@ void LLViewerImage::init(bool firstinit)
261 258
262 mIsRawImageValid = FALSE; 259 mIsRawImageValid = FALSE;
263 mRawDiscardLevel = INVALID_DISCARD_LEVEL; 260 mRawDiscardLevel = INVALID_DISCARD_LEVEL;
264 mRawImage = NULL; 261 mMinDiscardLevel = 0;
265 262
266 mTargetHost = LLHost::invalid; 263 mTargetHost = LLHost::invalid;
264
265 mHasFetcher = FALSE;
266 mIsFetching = FALSE;
267 mFetchState = 0;
268 mFetchPriority = 0;
269 mDownloadProgress = 0.f;
270 mFetchDeltaTime = 999999.f;
271 mDecodeFrame = 0;
272 mVisibleFrame = 0;
267} 273}
268 274
269// virtual 275// virtual
@@ -283,6 +289,10 @@ void LLViewerImage::dump()
283 289
284LLViewerImage::~LLViewerImage() 290LLViewerImage::~LLViewerImage()
285{ 291{
292 if (mHasFetcher)
293 {
294 gTextureFetch->deleteRequest(getID(), true);
295 }
286 // Explicitly call LLViewerImage::cleanup since we're in a destructor and cleanup is virtual 296 // Explicitly call LLViewerImage::cleanup since we're in a destructor and cleanup is virtual
287 LLViewerImage::cleanup(); 297 LLViewerImage::cleanup();
288 sImageCount--; 298 sImageCount--;
@@ -304,27 +314,9 @@ void LLViewerImage::cleanup()
304 } 314 }
305 mLoadedCallbackList.clear(); 315 mLoadedCallbackList.clear();
306 316
307 // Clean up any remaining packet data.
308 std::for_each(mReceivedPacketMap.begin(), mReceivedPacketMap.end(), DeletePairedPointer());
309 mReceivedPacketMap.clear();
310
311 // Clean up the streaming file
312 if (mStreamFile && !mStreamFile->isReadComplete())
313 {
314// llwarns << "Destroying LLViewerImage stream file while still reading data!" << llendl;
315 }
316 delete mStreamFile;
317 mStreamFile = NULL;
318
319 // Clean up image data 317 // Clean up image data
320 setFormattedImage(NULL); 318 destroyRawImage();
321 mRawImage = NULL;
322 mIsRawImageValid = FALSE;
323 mAuxRawImage = NULL;
324 319
325 delete[] mCachedData;
326 mCachedData = NULL;
327
328 // LLImageGL::cleanup will get called more than once when this is used in the destructor. 320 // LLImageGL::cleanup will get called more than once when this is used in the destructor.
329 LLImageGL::cleanup(); 321 LLImageGL::cleanup();
330} 322}
@@ -335,128 +327,25 @@ void LLViewerImage::reinit(BOOL usemipmaps /* = TRUE */)
335 LLImageGL::init(usemipmaps); 327 LLImageGL::init(usemipmaps);
336 init(false); 328 init(false);
337 setSize(0,0,0); 329 setSize(0,0,0);
338 if (mInStaticVFS)
339 {
340 mFormattedFlushed = TRUE;
341 }
342} 330}
343 331
344/////////////////////////////////////////////////////////////////////////////// 332///////////////////////////////////////////////////////////////////////////////
345 333
346void LLViewerImage::setFormattedImage(LLImageFormatted* imagep) 334// ONLY called from LLViewerImageList
347{
348 mFormattedImagep = NULL; // deletes image
349 mFormattedImagep = imagep;
350 if (mFormattedImagep.notNull())
351 {
352 mFormattedImagep->mMemType = LLMemType::MTYPE_APPFMTIMAGE;
353 mFormattedFlushed = FALSE;
354 }
355 else
356 {
357 setNeedsDecode(FALSE);
358 }
359}
360
361BOOL LLViewerImage::loadLocalImage(const LLUUID &image_id)
362{
363 LLMemType mt1(LLMemType::MTYPE_APPFMTIMAGE);
364
365 // first look for this image in the static VFS
366 LLAssetType::EType asset_type = LLAssetType::AT_NONE;
367 // Try TGA first
368 if (gStaticVFS->getExists(image_id, LLAssetType::AT_TEXTURE_TGA))
369 {
370 asset_type = LLAssetType::AT_TEXTURE_TGA;
371 //RN: force disable discards for TGA files because they can't decode at different quality levels
372 dontDiscard();
373 mDataCodec = IMG_CODEC_TGA;
374 }
375 else if (gStaticVFS->getExists(image_id, LLAssetType::AT_TEXTURE))
376 {
377 // then try for a J2C version
378 asset_type = LLAssetType::AT_TEXTURE;
379 mDataCodec = IMG_CODEC_J2C;
380 LLImageJ2C* imagej2c = new LLImageJ2C();
381 setFormattedImage(imagej2c);
382 }
383
384 if (asset_type != LLAssetType::AT_NONE)
385 {
386 S32 size = gStaticVFS->getSize(image_id, asset_type);
387 U8* buffer = new U8[size];
388 BOOL success = LLVFSThread::sLocal->readImmediate(gStaticVFS, image_id, asset_type, buffer, 0, size);
389
390 if (!success)
391 {
392 llwarns << "loadLocalImage() - vfs read failed" << llendl;
393 return FALSE;
394 }
395
396 mInStaticVFS = TRUE;
397 mFullyLoaded = TRUE;
398 setNeedsDecode(TRUE); // Loading a local image
399 mID = image_id;
400 setDecodeData(buffer, size);
401 mTotalBytes = size;
402 mLastBytesProcessed = size;
403 return TRUE;
404 }
405
406 return FALSE;
407}
408
409BOOL LLViewerImage::startVFSLoad()
410{
411 // We're no longer considered "flushed" no matter what happens after here.
412 mFormattedFlushed = FALSE;
413 if (!mStreamFile && mFormattedImagep.isNull())
414 {
415 // Start load from VFS if it's there
416 if (gVFS->getExists(mID, LLAssetType::AT_TEXTURE))
417 {
418// llinfos << "Reading image from disk " << getID() << llendl;
419
420 //llinfos << mID << ": starting VFS load" << llendl;
421 mStreamFile = new LLVFile(gVFS, mID, LLAssetType::AT_TEXTURE, LLVFile::READ_WRITE);
422 mCachedSize = 0;
423 gImageList.mLoadingStreamList.push_back(this);
424 }
425 else
426 {
427 return loadLocalImage(mID);
428 }
429 }
430 return TRUE;
431}
432
433void LLViewerImage::startImageDecode()
434{
435 // We need to load and/or decode the image
436 if (mFormattedImagep.isNull())
437 {
438 startVFSLoad(); // Start the VFS loading
439 }
440 else
441 {
442 setNeedsDecode(TRUE); // Force a new decode of this texture
443 }
444}
445
446
447BOOL LLViewerImage::createTexture(S32 usename/*= 0*/) 335BOOL LLViewerImage::createTexture(S32 usename/*= 0*/)
448{ 336{
449 if (mFormattedImagep.notNull() && mFormattedImagep->isDecoding()) 337 if (!mNeedsCreateTexture)
450 { 338 {
451 llerrs << "Trying to create texture on an image that is currently being decoded: " << mID << llendl; 339 destroyRawImage();
340 return FALSE;
452 } 341 }
453 mNeedsCreateTexture = FALSE; 342 mNeedsCreateTexture = FALSE;
454 if (mRawImage.isNull()) 343 if (mRawImage.isNull())
455 { 344 {
456 llerrs << "LLViewerImage trying to create texture with no Raw Image" << llendl; 345 llerrs << "LLViewerImage trying to create texture with no Raw Image" << llendl;
457 } 346 }
458// llinfos << llformat("IMAGE Creating (%d,%d) [%d x %d] Bytes: %d ", 347// llinfos << llformat("IMAGE Creating (%d) [%d x %d] Bytes: %d ",
459// mRawDiscardLevel, mFormattedImagep ? mFormattedImagep->getDiscardLevel() : -1, 348// mRawDiscardLevel,
460// mRawImage->getWidth(), mRawImage->getHeight(),mRawImage->getDataSize()) 349// mRawImage->getWidth(), mRawImage->getHeight(),mRawImage->getDataSize())
461// << mID.getString() << llendl; 350// << mID.getString() << llendl;
462 BOOL res = TRUE; 351 BOOL res = TRUE;
@@ -471,7 +360,7 @@ BOOL LLViewerImage::createTexture(S32 usename/*= 0*/)
471 // A non power-of-two image was uploaded (through a non standard client) 360 // A non power-of-two image was uploaded (through a non standard client)
472 // We treat these images as missing assets which causes them to 361 // We treat these images as missing assets which causes them to
473 // be renderd as 'missing image' and to stop requesting data 362 // be renderd as 'missing image' and to stop requesting data
474 setIsMissingAsset(TRUE); 363 setIsMissingAsset();
475 destroyRawImage(); 364 destroyRawImage();
476 return FALSE; 365 return FALSE;
477 } 366 }
@@ -481,6 +370,7 @@ BOOL LLViewerImage::createTexture(S32 usename/*= 0*/)
481 // Iterate through the list of image loading callbacks to see 370 // Iterate through the list of image loading callbacks to see
482 // what sort of data they need. 371 // what sort of data they need.
483 // 372 //
373 // *TODO: Fix image callback code
484 BOOL imageraw_callbacks = FALSE; 374 BOOL imageraw_callbacks = FALSE;
485 for(callback_list_t::iterator iter = mLoadedCallbackList.begin(); 375 for(callback_list_t::iterator iter = mLoadedCallbackList.begin();
486 iter != mLoadedCallbackList.end(); ) 376 iter != mLoadedCallbackList.end(); )
@@ -500,292 +390,6 @@ BOOL LLViewerImage::createTexture(S32 usename/*= 0*/)
500 return res; 390 return res;
501} 391}
502 392
503BOOL LLViewerImage::destroyTexture()
504{
505 LLImageGL::destroyGLTexture();
506 return TRUE;
507}
508
509void LLViewerImage::resetPacketData()
510{
511 //llinfos << "resetting packet data for " << getID() << llendl;
512 mPackets = 0;
513 mLastPacket = -1;
514 mPacketsReceived = 0;
515 mGotFirstPacket = FALSE;
516 mRequested = FALSE;
517
518 std::for_each(mReceivedPacketMap.begin(), mReceivedPacketMap.end(), DeletePairedPointer());
519 mReceivedPacketMap.clear();
520 mLastPacketProcessed = -1;
521}
522
523////////////////////////////////////////////////////////////////////////////////
524// This sets up a new formatted image at the requested size, and sets the decode flag
525void LLViewerImage::setDecodeData(U8 * data, U32 size)
526{
527 if (size == mTotalBytes)
528 {
529 mFullyLoaded = TRUE;
530 }
531 if (mDataCodec == IMG_CODEC_J2C)
532 {
533 //Codec 2 = compressed with JPEG2000 (Wavelet)
534 // Create formatted image first, then use it to generate the
535 // raw image.
536 if (mFormattedImagep.isNull())
537 {
538 LLPointer<LLImageJ2C> j2cp = new LLImageJ2C();
539 setFormattedImage(j2cp);
540 }
541 BOOL res = mFormattedImagep->setData(data, size);
542 if (mFullyLoaded)
543 {
544 mFormattedImagep->setDiscardLevel(0); // Force full res if all data is loaded
545 }
546 if ((mFormattedImagep->getWidth() > MAX_IMAGE_SIZE_DEFAULT ||
547 mFormattedImagep->getHeight() > MAX_IMAGE_SIZE_DEFAULT) &&
548 (mFormattedImagep->getDiscardLevel() == 0))
549 {
550 mFormattedImagep->setDiscardLevel(1); // Force x2048 images to x1024
551 }
552
553 if( res )
554 {
555 if (mFormattedImagep->getComponents() > 4)
556 {
557 mNeedsAux = TRUE;
558 }
559 else
560 {
561 mNeedsAux = FALSE;
562 }
563 mFullWidth = mFormattedImagep->getWidth();
564 mFullHeight = mFormattedImagep->getHeight();
565 if ((mFullWidth == 0) || (mFullHeight == 0))
566 {
567 llwarns << "Zero size width/height!" << llendl;
568 }
569 setNeedsDecode(TRUE); // Setting new formatted data
570 }
571 else
572 {
573 llwarns << "Unable to setData() for image " << mID << " Aborting." << llendl;
574 abortDecode();
575 }
576 }
577 else if (mDataCodec == IMG_CODEC_TGA)
578 {
579 //Codec 4 = compressed with TGA
580 // Create formatted image first, then use it to generate the
581 // raw image.
582 if (mFormattedImagep.isNull())
583 {
584 LLPointer<LLImageTGA> tgap = new LLImageTGA();
585 setFormattedImage(tgap);
586 }
587 BOOL res = mFormattedImagep->setData(data, size);
588
589 if( res )
590 {
591 mFullWidth = mFormattedImagep->getWidth();
592 mFullHeight = mFormattedImagep->getHeight();
593 if ((mFullWidth == 0) || (mFullHeight == 0))
594 {
595 llwarns << "Zero size width/height!" << llendl;
596 }
597 setNeedsDecode(TRUE); // Setting new formatted data
598 }
599 else
600 {
601 llwarns << "Unable to setData() for image " << mID << " Aborting." << llendl;
602 abortDecode();
603 }
604 }
605 else
606 {
607 llerrs << "Image " << mID << ": Unknown codec " << (int)mDataCodec << llendl;
608 setNeedsDecode(FALSE); // Unknown codec
609 }
610}
611
612void LLViewerImage::decodeImage(const F32 decode_time)
613{
614 if (!needsDecode())
615 {
616 return;
617 }
618
619 if (mFormattedImagep.isNull())
620 {
621 llerrs << "Decoding image without formatted data!" << llendl;
622 return;
623 }
624
625 //
626 // Only do a decode if we don't already have an image for this resolution.
627 //
628 if (getTexName() != 0 && getDiscardLevel() <= mFormattedImagep->getDiscardLevel()
629 && !mNeedsAux)
630 {
631 // We already have an image this size or larger
632 setNeedsDecode(FALSE);
633 return;
634 }
635
636 // Partial Decode of J2C images:
637 // If this is the first time we are decoding an image,
638 // make sure we limit the amount of data we decode in order not to stall other decodes
639 if (!mFormattedImagep->isDecoding() && mFormattedImagep->getCodec() == IMG_CODEC_J2C)
640 {
641 LLImageJ2C* j2cp = (LLImageJ2C*)((LLImageFormatted*)mFormattedImagep);
642 const S32 INITIAL_DECODE_SIZE = 2048;
643 if (!mDontDiscard &&
644 getUseMipMaps() &&
645 !mNeedsAux &&
646 getDiscardLevel() < 0 &&
647 mFormattedImagep->getDataSize() > INITIAL_DECODE_SIZE * 2)
648 {
649 j2cp->setMaxBytes(INITIAL_DECODE_SIZE);
650 }
651 else
652 {
653 j2cp->setMaxBytes(0); // In case we set it on a previous decode
654 }
655 }
656
657 //
658 // Decode Image
659 //
660 mLastDecodeTime.reset();
661
662 if (mFormattedImagep->getCodec() == 0)
663 {
664 llerrs << "LLViewerImage::decodeImage: mFormattedImagep->getCodec() == 0" << llendl;
665 }
666
667 //
668 // Decode first 4 channels
669 //
670 // Skip over this if we're already in the process of decoding the aux channel,
671 // that means that we've alredy decoded the base channels of this texture.
672 if (!mDecodingAux)
673 {
674 if (!mFormattedImagep->isDecoding())
675 {
676 mNeedsCreateTexture = FALSE; // Raw is no longer valid
677 destroyRawImage();
678 createRawImage(mFormattedImagep->getDiscardLevel());
679 //llinfos << "starting decode at " << (S32)mFormattedImagep->getDiscardLevel() << " for " << getID() << llendl;
680 }
681 else
682 {
683 llassert(mRawImage.notNull());
684 }
685 if (!mFormattedImagep->decode(mRawImage, decode_time, 0, 4))
686 {
687 if (!mFormattedImagep->isDecoding())
688 {
689 // bogus data, delete and try again
690 llwarns << "Failed to decode " << mID << ":" << gTextureTable.getName(mID) << llendl;
691 abortDecode();
692 destroyRawImage();
693 return;
694 }
695 }
696// llinfos << llformat("IMAGE Decode (%d) ", mFormattedImagep->getDiscardLevel()) << mID << llendl;
697
698 // Get the discard level of the decoded raw image,
699 // which may not match the formatted image discard level if a partial decode was done
700 mRawDiscardLevel = mFormattedImagep->getRawDiscardLevel();
701
702 if (mFormattedImagep->isDecoding())
703 {
704 return; // Not done decoding.
705 }
706 }
707
708 //
709 // If we've finished with the main channels and need to decode the aux, do it now.
710 // Aux buffers contain extra data (e.g. cloth maps)
711 //
712 if (mNeedsAux)
713 {
714 mDecodingAux = TRUE;
715
716 // Create the target raw image for the aux channels
717 if (mAuxRawImage.isNull())
718 {
719 S32 discard = mFormattedImagep->getDiscardLevel();
720 mAuxRawImage = new LLImageRaw(getWidth(discard), getHeight(discard), 1);
721 mAuxRawImage->mMemType = LLMemType::MTYPE_APPAUXRAWIMAGE;
722 }
723
724 if (!mFormattedImagep->decode(mAuxRawImage, decode_time, 4, 4))
725 {
726 if (!mFormattedImagep->isDecoding())
727 {
728 llwarns << "Failed to decode high components " << mID << ":" << gTextureTable.getName(mID) << llendl;
729 abortDecode();
730 destroyRawImage();
731 return; // decode failed; re-request
732 }
733 }
734
735 if (mFormattedImagep->isDecoding())
736 {
737 return; // Not done decoding.
738 }
739
740 mDecodingAux = FALSE;
741 }
742
743 if (mRawImage.notNull() && getComponents() != mRawImage->getComponents())
744 {
745 //
746 // We've changed the number of components (presumably this is after
747 // decoding the first packet of an image), so we need to move any
748 // objects using this pool to a different pool.
749 //
750 mComponents = mRawImage->getComponents();
751 gPipeline.dirtyPoolObjectTextures(this);
752 }
753
754 //
755 // We've decoded this image, and no longer need to.
756 //
757 setNeedsDecode(FALSE); // Done decoding image
758 mIsRawImageValid = TRUE;
759
760 //
761 // We have a raw image, and now we need to push the data
762 // from the raw image into the GL image
763 //
764 llassert(mRawImage.notNull());
765 mNeedsCreateTexture = TRUE;
766
767 // Everything's OK...
768#if LL_DEBUG
769 lldebugst(LLERR_IMAGE) << "Img: ";
770 std::string tex_name = gTextureTable.getName(mID);
771 if (!tex_name.empty())
772 {
773 llcont << tex_name;
774 }
775 else
776 {
777 llcont << mID;
778 }
779 llcont << " Discard level " << (S32)getDiscardLevel();
780 llcont << llendl;
781#endif
782}
783
784bool LLViewerImage::isDecoding()
785{
786 return (mFormattedImagep.notNull() && mFormattedImagep->isDecoding());
787}
788
789//============================================================================ 393//============================================================================
790 394
791void LLViewerImage::addTextureStats(F32 pixel_area, 395void LLViewerImage::addTextureStats(F32 pixel_area,
@@ -868,15 +472,23 @@ void LLViewerImage::processTextureStats()
868 } 472 }
869 else 473 else
870 { 474 {
871 // Guess the required scale factor of the image using pixels per texel.. 475 if ((mCalculatedDiscardLevel >= 0.f) &&
872 // Right now, use a safe 1:1 for the tradeoff - we can adjust this later. 476 (llabs(mMaxVirtualSize - mDiscardVirtualSize) < mMaxVirtualSize*.20f))
873 // Actually, it might be nice to generate a float, so we can prioritize which 477 {
874 // ones we can discard quality levels from. 478 // < 20% change in virtual size = no change in desired discard
875 discard_level = (F32)(log(mTexelsPerImage/mMaxVirtualSize) / log_4); 479 discard_level = mCalculatedDiscardLevel;
480 }
481 else
482 {
483 // Calculate the required scale factor of the image using pixels per texel
484 discard_level = (F32)(log(mTexelsPerImage/mMaxVirtualSize) / log_4);
485 mDiscardVirtualSize = mMaxVirtualSize;
486 mCalculatedDiscardLevel = discard_level;
487 }
876 } 488 }
877 if (mBoostLevel < LLViewerImage::BOOST_HIGH) 489 if (mBoostLevel < LLViewerImage::BOOST_HIGH)
878 { 490 {
879 static const F32 discard_bias = 0.5f; // Must be < 1 or highest discard will never load! 491 static const F32 discard_bias = -.5f; // Must be < 1 or highest discard will never load!
880 discard_level += discard_bias; 492 discard_level += discard_bias;
881 discard_level += sDesiredDiscardBias; 493 discard_level += sDesiredDiscardBias;
882 discard_level *= sDesiredDiscardScale; // scale 494 discard_level *= sDesiredDiscardScale; // scale
@@ -901,94 +513,68 @@ void LLViewerImage::processTextureStats()
901 // proper action if we don't. 513 // proper action if we don't.
902 // 514 //
903 515
904 //
905 // Only need to do an actual decode if we don't have the right GL level,
906 // or we don't have raw data and need raw data.
907 //
908 BOOL increase_discard = FALSE; 516 BOOL increase_discard = FALSE;
909 if (getDiscardLevel() < 0 || mDesiredDiscardLevel < getDiscardLevel()) 517 S32 current_discard = getDiscardLevel();
518 if ((sDesiredDiscardBias > 0.0f) &&
519 (current_discard >= 0 && mDesiredDiscardLevel >= current_discard))
910 { 520 {
911 // We need to do a decode of that discard level to get more data. 521 if ( sBoundTextureMemory > sMaxBoundTextureMem*texmem_middle_bound_scale)
912 if (mFormattedImagep.notNull() && !needsDecode())
913 { 522 {
914 if (mFormattedImagep->getDiscardLevel() <= mDesiredDiscardLevel) 523 // Limit the amount of GL memory bound each frame
524 if (mDesiredDiscardLevel > current_discard)
915 { 525 {
916 setNeedsDecode(TRUE); // processTextureStats - Changing discard level of texture 526 increase_discard = TRUE;
917 } 527 }
918 // else let the llviewerimagelist logic do its thing
919 } 528 }
920 else if (mFormattedFlushed) 529 if ( sTotalTextureMemory > sMaxTotalTextureMem*texmem_middle_bound_scale)
921 { 530 {
922 //llinfos << "Attempting vfs reload (a) of " << mID << llendl; 531 // Only allow GL to have 2x the video card memory
923 startVFSLoad(); 532 if (!getBoundRecently())
924 } 533 {
925 } 534 increase_discard = TRUE;
926 else if (sDesiredDiscardBias > 0.0f && sBoundTextureMemory > sMaxBoundTextureMem*texmem_middle_bound_scale) 535 }
927 {
928 // Limit the amount of GL memory bound each frame
929 if (mDesiredDiscardLevel > getDiscardLevel())
930 {
931 increase_discard = TRUE;
932 } 536 }
933 } 537 if (increase_discard)
934 else if (sDesiredDiscardBias > 0.0f && sTotalTextureMemory > sTotalTextureMemory*texmem_middle_bound_scale)
935 {
936 // Only allow GL to have 2x the video card memory
937 if (!getBoundRecently())
938 { 538 {
939 increase_discard = TRUE; 539 // llinfos << "DISCARDED: " << mID << " Discard: " << current_discard << llendl;
540 sBoundTextureMemory -= mTextureMemory;
541 sTotalTextureMemory -= mTextureMemory;
542 // Increase the discard level (reduce the texture res)
543 S32 new_discard = current_discard+1;
544 setDiscardLevel(new_discard);
545 sBoundTextureMemory += mTextureMemory;
546 sTotalTextureMemory += mTextureMemory;
940 } 547 }
941 } 548 }
942 if (increase_discard)
943 {
944 sBoundTextureMemory -= mTextureMemory;
945 sTotalTextureMemory -= mTextureMemory;
946 // Increase the discard level (reduce the texture res)
947 S32 new_discard = getDiscardLevel()+1;
948 setDiscardLevel(new_discard);
949 sBoundTextureMemory += mTextureMemory;
950 sTotalTextureMemory += mTextureMemory;
951 }
952 } 549 }
953
954 //
955 // Flush the formatted data for this image if it hasn't been used in a while.
956 //
957#if 1
958 const F32 FLUSH_TIME = 30.f;
959 if (mFormattedImagep.notNull())
960 {
961 if ((mLastDecodeTime.getElapsedTimeF32() > FLUSH_TIME)
962 && !mStreamFile
963 && (this->mLastPacketTimer.getElapsedTimeF32() > FLUSH_TIME)
964 && !mNeedsDecode
965 && !mFormattedImagep->isDecoding()
966 && (mDesiredDiscardLevel == getDiscardLevel()))
967 {
968 //llinfos << mID << ": flushing formatted image, last processed packet " << mLastPacketProcessed << llendl;
969 // Treat this very similarly to like we haven't gotten any data
970 // Flush all received packets that haven't been processed, they will be readded on reload.
971 resetPacketData();
972
973 setFormattedImage(NULL);
974 mFullyLoaded = FALSE;
975
976 // This flag says that we may have VFS data if we want to reload this texture
977 // (or get network traffic for this texture)
978 mFormattedFlushed = TRUE;
979 }
980 }
981#endif
982} 550}
983 551
984//============================================================================ 552//============================================================================
985 553
986F32 LLViewerImage::calcDecodePriority() 554F32 LLViewerImage::calcDecodePriority()
987{ 555{
988 F32 priority; 556#ifndef LL_RELEASE_FOR_DOWNLOAD
989 S32 gldiscard = getDiscardLevel(); 557 if (mID == gTextureFetch->mDebugID)
990 S32 ddiscard = gldiscard - mDesiredDiscardLevel; 558 {
559 gTextureFetch->mDebugCount++; // for setting breakpoints
560 }
561#endif
562
563 if (mNeedsCreateTexture)
564 {
565 return mDecodePriority; // no change while waiting to create
566 }
991 567
568 F32 priority;
569 S32 cur_discard = getDiscardLevel();
570 F32 pixel_priority = fsqrtf(mMaxVirtualSize) * (1.f + mMaxCosAngle);
571 const S32 MIN_NOT_VISIBLE_FRAMES = 30; // NOTE: this function is not called every frame
572 mDecodeFrame++;
573 if (pixel_priority > 0.f)
574 {
575 mVisibleFrame = mDecodeFrame;
576 }
577
992 if (mIsMissingAsset) 578 if (mIsMissingAsset)
993 { 579 {
994 priority = 0.0f; 580 priority = 0.0f;
@@ -996,50 +582,73 @@ F32 LLViewerImage::calcDecodePriority()
996 else if (mDesiredDiscardLevel > mMaxDiscardLevel) 582 else if (mDesiredDiscardLevel > mMaxDiscardLevel)
997 { 583 {
998 // Don't decode anything we don't need 584 // Don't decode anything we don't need
999 priority = 0.0f; 585 priority = -1.0f;
586 }
587 else if (pixel_priority <= 0.f && (cur_discard < 0 || mDesiredDiscardLevel < cur_discard))
588 {
589 // Not on screen but we might want some data
590 if (mBoostLevel > BOOST_HIGH)
591 {
592 // Always want high boosted images
593 priority = 1.f;
594 }
595 else if (mVisibleFrame == 0 || (mDecodeFrame - mVisibleFrame > MIN_NOT_VISIBLE_FRAMES))
596 {
597 // Don't decode anything that isn't visible unless it's important
598 priority = -2.0f;
599 }
600 else
601 {
602 // Leave the priority as-is
603 return mDecodePriority;
604 }
1000 } 605 }
1001 else if (gldiscard < 0 && mDesiredDiscardLevel >= 0) 606 else if (cur_discard < 0)
1002 { 607 {
1003 // We don't have any data yet, we need something immideately 608 // We don't have any data yet, so we don't know the size of the image, treat as 1024x1024
1004 priority = 200000.f; 609// priority = 900000.f;
610 static const F64 log_2 = log(2.0);
611 F32 desired = (F32)(log(1024.0/pixel_priority) / log_2);
612 S32 ddiscard = MAX_DISCARD_LEVEL - (S32)desired + 1;
613 ddiscard = llclamp(ddiscard, 1, 9);
614 priority = ddiscard*100000.f;
1005 } 615 }
1006 else if (getDiscardLevel() < 0 && mDesiredDiscardLevel < MAX_DISCARD_LEVEL+1) 616 else if (cur_discard <= mMinDiscardLevel)
1007 { 617 {
1008 // We have data, but haven't decoded any of it yet, but it on top 618 // larger mips are corrupted
1009 priority = 300000.f; 619 priority = -3.0f;
1010 } 620 }
1011 else if (gldiscard <= mDesiredDiscardLevel) 621 else if (cur_discard <= mDesiredDiscardLevel)
1012 { 622 {
1013 priority = 0.0f; 623 priority = -4.0f;
1014 } 624 }
1015 else 625 else
1016 { 626 {
1017 // priority range = 0 - 10000 (10 ^ 4) 627 // priority range = 100000-400000
628 S32 ddiscard = cur_discard - mDesiredDiscardLevel;
1018 if (getDontDiscard()) 629 if (getDontDiscard())
1019 { 630 {
1020 ddiscard+=2; 631 ddiscard+=2;
1021 } 632 }
1022 else if (!getBoundRecently()) 633 else if (!getBoundRecently() && mBoostLevel == 0)
1023 { 634 {
1024 ddiscard-=2; 635 ddiscard-=2;
1025 } 636 }
1026 else
1027 {
1028 ddiscard-=1;
1029 }
1030 ddiscard = llclamp(ddiscard, 0, 4); 637 ddiscard = llclamp(ddiscard, 0, 4);
1031 638 priority = ddiscard*100000.f;
1032 priority = powf(10.f,(F32)ddiscard);
1033 } 639 }
1034 if (priority > 0.0f) 640 if (priority > 0.0f)
1035 { 641 {
1036 F32 pixel_priority = llmin(mMaxVirtualSize * (1.5f + mMaxCosAngle) * (100.f / (1024.f*1024.f)), 100.f);
1037 pixel_priority = llclamp(pixel_priority, 0.0f, priority-1.f); 642 pixel_priority = llclamp(pixel_priority, 0.0f, priority-1.f);
1038 priority += pixel_priority; 643 priority += pixel_priority;
1039 if ( mBoostLevel > 0) 644 if ( mBoostLevel > BOOST_HIGH)
1040 { 645 {
1041 priority += 1000000.f + 1000.f * mBoostLevel; 646 priority += 1000000.f + 1000.f * mBoostLevel;
1042 } 647 }
648 else if ( mBoostLevel > 0)
649 {
650 priority += 0.f + 1000.f * mBoostLevel;
651 }
1043 } 652 }
1044 return priority; 653 return priority;
1045} 654}
@@ -1048,7 +657,7 @@ F32 LLViewerImage::calcDecodePriority()
1048//static 657//static
1049F32 LLViewerImage::maxDecodePriority() 658F32 LLViewerImage::maxDecodePriority()
1050{ 659{
1051 return 1400000.f; 660 return 2000000.f;
1052} 661}
1053 662
1054void LLViewerImage::setDecodePriority(F32 priority) 663void LLViewerImage::setDecodePriority(F32 priority)
@@ -1062,10 +671,6 @@ void LLViewerImage::setDecodePriority(F32 priority)
1062 { 671 {
1063 mDecodePriority = priority; 672 mDecodePriority = priority;
1064 } 673 }
1065 if (mStreamFile)
1066 {
1067 mStreamFile->setReadPriority(priority);
1068 }
1069} 674}
1070 675
1071void LLViewerImage::setBoostLevel(S32 level) 676void LLViewerImage::setBoostLevel(S32 level)
@@ -1079,187 +684,219 @@ void LLViewerImage::setBoostLevel(S32 level)
1079 684
1080//============================================================================ 685//============================================================================
1081 686
1082void LLViewerImage::abortDecode() 687bool LLViewerImage::updateFetch()
1083{ 688{
1084 // Don't try to recover, just don't set a formatted image. 689 mFetchState = 0;
1085 // Recovery makes the code MUCH more complex 690 mFetchPriority = 0;
1086 //llinfos << "Reset on abort decode" << llendl; 691 mFetchDeltaTime = 999999.f;
1087 resetPacketData(); 692 mRequestDeltaTime = 999999.f;
1088 693
1089 setFormattedImage(NULL); 694#ifndef LL_RELEASE_FOR_DOWNLOAD
1090 mFullyLoaded = FALSE; 695 if (mID == gTextureFetch->mDebugID)
1091 // Make sure mNeedsAux is false, otherwise it'll try to decode the 5th channel
1092 mNeedsAux = FALSE;
1093 mFullWidth = 0;
1094 mFullHeight = 0;
1095 setNeedsDecode(FALSE); // Aborting setDecodeData
1096 mDecodingAux = FALSE;
1097 if (mStreamFile)
1098 { 696 {
1099 llwarns << "Removing bad texture: " << mID << llendl; 697 gTextureFetch->mDebugCount++; // for setting breakpoints
1100 hoseStreamFile();
1101 } 698 }
1102 else 699#endif
700
701 if (mIsMediaTexture)
1103 { 702 {
1104 llwarns << "Removing bad texture: " << mID << llendl; 703 llassert_always(!mHasFetcher);
1105 LLVFile vf(gVFS, mID, LLAssetType::AT_TEXTURE, LLVFile::READ_WRITE); 704 return false; // skip
1106 vf.remove();
1107 } 705 }
1108 mRequestedDiscardLevel = -1; // make sure we re-request the data 706 if (mNeedsCreateTexture)
1109}
1110
1111void LLViewerImage::hoseStreamFile()
1112{
1113 mStreamFile->remove();
1114
1115 delete mStreamFile;
1116 mStreamFile = NULL;
1117
1118 delete[] mCachedData;
1119 mCachedData = NULL;
1120 mCachedSize = 0;
1121}
1122
1123
1124// Sets mStreamFile to NULL when finishes loading.
1125BOOL LLViewerImage::loadStreamFile()
1126{
1127 LLMemType mt1(LLMemType::MTYPE_APPFMTIMAGE);
1128 // load as much data as possible from the stream cache file
1129 // TODO: unify stream cache with load local
1130
1131 // are we waiting on a file read?
1132 if (mStreamFile)
1133 { 707 {
1134 if (mCachedSize == 0) 708 // We may be fetching still (e.g. waiting on write)
709 // but don't check until we've processed the raw data we have
710 return false;
711 }
712 if (mFullyLoaded)
713 {
714 llassert_always(!mHasFetcher);
715 return false;
716 }
717 if (mIsMissingAsset)
718 {
719 llassert_always(!mHasFetcher);
720 return false; // skip
721 }
722 if (!mLoadedCallbackList.empty() && mRawImage.notNull())
723 {
724 return false; // process any raw image data in callbacks before replacing
725 }
726
727 S32 current_discard = getDiscardLevel();
728 S32 desired_discard = getDesiredDiscardLevel();
729 F32 decode_priority = getDecodePriority();
730
731 if (mIsFetching)
732 {
733 // Sets mRawDiscardLevel, mRawImage, mAuxRawImage
734 S32 fetch_discard = current_discard;
735 bool finished = gTextureFetch->getRequestFinished(getID(), fetch_discard, mRawImage, mAuxRawImage);
736 if (finished)
1135 { 737 {
1136 if (mStreamFile->isLocked(VFSLOCK_APPEND)) 738 mIsFetching = FALSE;
1137 { 739 }
1138 // avoid stalling if we are still writing to the file 740 else
1139 return FALSE; 741 {
1140 } 742 mFetchState = gTextureFetch->getFetchState(mID, mDownloadProgress, mRequestedDownloadPriority,
1141 mCachedSize = mStreamFile->getSize(); 743 mFetchPriority, mFetchDeltaTime, mRequestDeltaTime);
1142 if (mCachedSize >= 27) 744 }
745
746 // We may have data ready regardless of whether or not we are finished (e.g. waiting on write)
747 if (mRawImage.notNull())
748 {
749 mRawDiscardLevel = fetch_discard;
750 if ((mRawImage->getDataSize() > 0 && mRawDiscardLevel >= 0) &&
751 (current_discard < 0 || mRawDiscardLevel < current_discard))
1143 { 752 {
1144 mCachedData = new U8[mCachedSize]; 753 if (getComponents() != mRawImage->getComponents())
1145 mStreamFile->read(mCachedData, mCachedSize, TRUE, 100 + mDecodePriority); 754 {
755 // We've changed the number of components, so we need to move any
756 // objects using this pool to a different pool.
757 mComponents = mRawImage->getComponents();
758 gImageList.dirtyImage(this);
759 }
760 mIsRawImageValid = TRUE;
761 gImageList.mCreateTextureList.insert(this);
762 mNeedsCreateTexture = TRUE;
763 mFullWidth = mRawImage->getWidth() << mRawDiscardLevel;
764 mFullHeight = mRawImage->getHeight() << mRawDiscardLevel;
1146 } 765 }
1147 else 766 else
1148 { 767 {
1149 llwarns << "Cached image " << mID << " has length " << mCachedSize << " not loading" << llendl; 768 // Data is ready but we don't need it
1150 769 // (received it already while fetcher was writing to disk)
1151 mStreamFile->remove(); 770 destroyRawImage();
1152 771 return false; // done
1153 delete mStreamFile;
1154 mStreamFile = NULL;
1155 mCachedSize = 0;
1156 return FALSE;
1157 } 772 }
1158 } 773 }
1159 774
1160 // is it finished? 775 if (!mIsFetching)
1161 if (mStreamFile->isReadComplete())
1162 { 776 {
1163 //llinfos << mID << ": loading from stream file " << llendl; 777 if (mRawDiscardLevel < 0)
1164 U16 packet;
1165 U32 file_version;
1166 LLUUID file_id;
1167
1168 U8 *tmp = mCachedData;
1169 memcpy(&file_version, tmp, 4);
1170 tmp += 4;
1171 memcpy(file_id.mData, tmp, 16);
1172 tmp += 16;
1173
1174 if (file_version != sCurrentFileVersion ||
1175 file_id != mID)
1176 {
1177 // this file is from an old version, failed to open, or is invalid
1178 hoseStreamFile();
1179
1180 return TRUE; // done
1181 }
1182
1183 mGotFirstPacket = TRUE;
1184
1185 memcpy(&mDataCodec, tmp, 1);
1186 tmp += 1;
1187 memcpy(&mPackets, tmp, 2);
1188 tmp += 2;
1189
1190 memcpy(&mTotalBytes, tmp, 4);
1191 tmp += 4;
1192
1193 while (tmp - mCachedData < mCachedSize)
1194 { 778 {
1195 memcpy(&packet, tmp, 2); 779 // We finished but received no data
1196 tmp += 2; 780 if (current_discard < 0)
1197
1198 if (packet >= mPackets)
1199 { 781 {
1200 llwarns << "Cached image " << mID << " has bogus packet " << packet << " of " << mPackets << llendl; 782 llwarns << mID << ": Marking image as missing" << llendl;
1201 783 setIsMissingAsset();
1202 hoseStreamFile(); 784 desired_discard = -1;
1203 return TRUE; // done
1204 }
1205
1206 U16 data_size;
1207 memcpy((U8*)&(data_size), tmp, 2);
1208 tmp += 2;
1209
1210 if (tmp + data_size > mCachedData + mCachedSize)
1211 {
1212 llwarns << "Cached image " << mID << " has bad length " << mCachedSize << ", should be " << (S32)(tmp + data_size - mCachedData) << llendl;
1213
1214 hoseStreamFile();
1215 return TRUE; // done
1216 }
1217
1218 if (mReceivedPacketMap.find(packet) == mReceivedPacketMap.end())
1219 {
1220 U8 *buf = new U8[data_size];
1221 memcpy(buf, tmp, data_size);
1222 mReceivedPacketMap[packet] = new LLViewerImagePacket(buf, data_size, packet, TRUE);
1223 } 785 }
1224 else 786 else
1225 { 787 {
1226 // Technically this assertion is correct, but there may be bogus VFS files out there which invalidate this 788 llwarns << mID << ": Setting min discard to " << current_discard << llendl;
1227 // condition. 789 mMinDiscardLevel = current_discard;
1228 //llassert(!mReceivedPacketMap[packet]->mWroteToDisk); 790 desired_discard = current_discard;
1229 mReceivedPacketMap[packet]->mWroteToDisk = TRUE;
1230 } 791 }
1231 792 destroyRawImage();
1232 tmp += data_size;
1233
1234 mPacketsReceived++;
1235 } 793 }
794 else if (mRawImage.isNull())
795 {
796 // We have data, but our fetch failed to return raw data
797 // *TODO: FIgure out why this is happening and fix it
798 destroyRawImage();
799 }
800 }
801 else if (mDecodePriority >= 0.f)
802 {
803 gTextureFetch->updateRequestPriority(mID, mDecodePriority);
804 }
805 }
1236 806
1237 delete mStreamFile; 807 bool make_request = true;
1238 mStreamFile = NULL; 808
1239 809 if (decode_priority <= 0)
1240 delete[] mCachedData; 810 {
1241 mCachedData = NULL; 811 make_request = false;
1242 mCachedSize = 0; 812 }
1243 813 else if (mNeedsCreateTexture || mIsMissingAsset)
1244 // Make sure we process all of the packet data associated with this texture. 814 {
1245 mLastPacketProcessed = -1; 815 make_request = false;
1246 mLastPacket = -1; 816 }
1247 mLastPacketTimer.reset(); 817 else if (current_discard >= 0 && current_discard <= mMinDiscardLevel)
1248 818 {
1249 // Process the packets and write to disk any that have not been written 819 make_request = false;
1250 checkPacketData(); 820 }
1251 821 else
1252 return TRUE; // done 822 {
823 if (mIsFetching)
824 {
825 if (mRequestedDiscardLevel <= desired_discard)
826 {
827 make_request = false;
828 }
1253 } 829 }
1254 else 830 else
1255 { 831 {
1256 return FALSE; // still loading 832 if (current_discard >= 0 && current_discard <= desired_discard)
833 {
834 make_request = false;
835 }
1257 } 836 }
1258 } 837 }
1259 else 838
839 if (make_request)
840 {
841 S32 w=0, h=0, c=0;
842 if (current_discard >= 0)
843 {
844 w = getWidth(0);
845 h = getHeight(0);
846 c = getComponents();
847 }
848 if (!mDontDiscard)
849 {
850 if (mBoostLevel == 0)
851 {
852 desired_discard = llmax(desired_discard, current_discard-1);
853 }
854 else
855 {
856 desired_discard = llmax(desired_discard, current_discard-2);
857 }
858 }
859 if (gTextureFetch->createRequest(getID(),getTargetHost(), decode_priority,
860 w, h, c, desired_discard,
861 needsAux()))
862 {
863 mHasFetcher = TRUE;
864 mIsFetching = TRUE;
865 mRequestedDiscardLevel = desired_discard;
866 mFetchState = gTextureFetch->getFetchState(mID, mDownloadProgress, mRequestedDownloadPriority,
867 mFetchPriority, mFetchDeltaTime, mRequestDeltaTime);
868 }
869 // if createRequest() failed, we're finishing up a request for this UUID,
870 // wait for it to complete
871 }
872 else if (mHasFetcher && !mIsFetching)
873 {
874 // Only delete requests that haven't receeived any network data for a while
875 const F32 FETCH_IDLE_TIME = 5.f;
876 if (mLastPacketTimer.getElapsedTimeF32() > FETCH_IDLE_TIME)
877 {
878// llinfos << "Deleting request: " << getID() << " Discard: " << current_discard << " <= min:" << mMinDiscardLevel << " or priority == 0: " << decode_priority << llendl;
879 gTextureFetch->deleteRequest(getID(), true);
880 mHasFetcher = FALSE;
881 }
882 }
883
884 llassert_always(mRawImage.notNull() || (!mNeedsCreateTexture && !mIsRawImageValid));
885
886 return mIsFetching ? true : false;
887}
888
889void LLViewerImage::setIsMissingAsset()
890{
891 if (mHasFetcher)
1260 { 892 {
1261 return TRUE; // not loading 893 gTextureFetch->deleteRequest(getID(), true);
894 mHasFetcher = FALSE;
895 mIsFetching = FALSE;
896 mFetchState = 0;
897 mFetchPriority = 0;
1262 } 898 }
899 mIsMissingAsset = TRUE;
1263} 900}
1264 901
1265//============================================================================ 902//============================================================================
@@ -1278,13 +915,14 @@ void LLViewerImage::setLoadedCallback( loaded_callback_func loaded_callback, S32
1278 mLoadedCallbackList.push_back(entryp); 915 mLoadedCallbackList.push_back(entryp);
1279} 916}
1280 917
1281void LLViewerImage::doLoadedCallbacks() 918bool LLViewerImage::doLoadedCallbacks()
1282{ 919{
1283 // Need to make sure we don't do these during the process of a decode or something? 920 if (mNeedsCreateTexture)
1284 if ((mFormattedImagep.notNull() && mFormattedImagep->isDecoding()) || mNeedsCreateTexture)
1285 { 921 {
1286 return; 922 return false;
1287 } 923 }
924
925 bool res = false;
1288 926
1289 if (isMissingAsset()) 927 if (isMissingAsset())
1290 { 928 {
@@ -1311,12 +949,6 @@ void LLViewerImage::doLoadedCallbacks()
1311 gl_discard = MAX_DISCARD_LEVEL + 1; 949 gl_discard = MAX_DISCARD_LEVEL + 1;
1312 } 950 }
1313 951
1314 // assert: We should either have a valid raw image, be decoding one, or not have one at all
1315 llassert(mIsRawImageValid || needsDecode() || mRawImage.isNull());
1316 // assert: We should either not have a raw image, or it's discard level should be <= gl_discard
1317 llassert(!mIsRawImageValid || mRawDiscardLevel <= gl_discard);
1318
1319
1320 // 952 //
1321 // Determine the quality levels of textures that we can provide to callbacks 953 // Determine the quality levels of textures that we can provide to callbacks
1322 // and whether we need to do decompression/readback to get it 954 // and whether we need to do decompression/readback to get it
@@ -1335,18 +967,9 @@ void LLViewerImage::doLoadedCallbacks()
1335 } 967 }
1336 else 968 else
1337 { 969 {
1338 if (mFormattedImagep.notNull()) 970 // We have no data at all, we need to get it
1339 { 971 // Do this by forcing the best aux discard to be 0.
1340 // If we don't have a raw image or a GL image, we need to decode from a formatted image 972 best_aux_discard = 0;
1341 best_aux_discard = llmin(best_aux_discard,
1342 mFormattedImagep->calcDiscardLevelBytes(mFormattedImagep->getDataSize()));
1343 }
1344 else
1345 {
1346 // We have no data at all, we need to get the formatted image.
1347 // Do this by forcing the best aux discard to be 0.
1348 best_aux_discard = 0;
1349 }
1350 } 973 }
1351 974
1352 975
@@ -1357,7 +980,6 @@ void LLViewerImage::doLoadedCallbacks()
1357 bool run_gl_callbacks = false; 980 bool run_gl_callbacks = false;
1358 bool run_raw_callbacks = false; 981 bool run_raw_callbacks = false;
1359 bool need_readback = false; 982 bool need_readback = false;
1360 bool need_decompress = false;
1361 983
1362 for(callback_list_t::iterator iter = mLoadedCallbackList.begin(); 984 for(callback_list_t::iterator iter = mLoadedCallbackList.begin();
1363 iter != mLoadedCallbackList.end(); ) 985 iter != mLoadedCallbackList.end(); )
@@ -1375,12 +997,6 @@ void LLViewerImage::doLoadedCallbacks()
1375 // We have useful data, run the callbacks 997 // We have useful data, run the callbacks
1376 run_raw_callbacks = true; 998 run_raw_callbacks = true;
1377 } 999 }
1378 else if (entryp->mLastUsedDiscard > best_aux_discard)
1379 {
1380 // We need to decompress data, but don't need
1381 // to run the callbacks
1382 need_decompress = true;
1383 }
1384 } 1000 }
1385 else 1001 else
1386 { 1002 {
@@ -1420,10 +1036,8 @@ void LLViewerImage::doLoadedCallbacks()
1420 createRawImage(gl_discard, TRUE); 1036 createRawImage(gl_discard, TRUE);
1421 readBackRaw(gl_discard, mRawImage); 1037 readBackRaw(gl_discard, mRawImage);
1422 mIsRawImageValid = TRUE; 1038 mIsRawImageValid = TRUE;
1423 } 1039 llassert_always(mRawImage.notNull());
1424 if (need_decompress) 1040 llassert_always(!mNeedsAux || mAuxRawImage.notNull());
1425 {
1426 startImageDecode();
1427 } 1041 }
1428 1042
1429 // 1043 //
@@ -1434,10 +1048,6 @@ void LLViewerImage::doLoadedCallbacks()
1434 // Do callbacks which require raw image data. 1048 // Do callbacks which require raw image data.
1435 //llinfos << "doLoadedCallbacks raw for " << getID() << llendl; 1049 //llinfos << "doLoadedCallbacks raw for " << getID() << llendl;
1436 1050
1437 LLImageRaw* raw_image = mRawImage;
1438 LLImageRaw* raw_image_aux = mAuxRawImage;
1439 llassert(!mNeedsAux || mAuxRawImage.notNull());
1440
1441 // Call each party interested in the raw data. 1051 // Call each party interested in the raw data.
1442 for(callback_list_t::iterator iter = mLoadedCallbackList.begin(); 1052 for(callback_list_t::iterator iter = mLoadedCallbackList.begin();
1443 iter != mLoadedCallbackList.end(); ) 1053 iter != mLoadedCallbackList.end(); )
@@ -1450,28 +1060,26 @@ void LLViewerImage::doLoadedCallbacks()
1450 // to satisfy the interested party, then this is the last time that 1060 // to satisfy the interested party, then this is the last time that
1451 // we're going to call them. 1061 // we're going to call them.
1452 1062
1063 llassert_always(mRawImage.notNull());
1064 llassert_always(!mNeedsAux || mAuxRawImage.notNull());
1453 1065
1454 BOOL final = mRawDiscardLevel <= entryp->mDesiredDiscard ? TRUE : FALSE; 1066 BOOL final = mRawDiscardLevel <= entryp->mDesiredDiscard ? TRUE : FALSE;
1455 //llinfos << "Running callback for " << getID() << llendl; 1067 //llinfos << "Running callback for " << getID() << llendl;
1456 //llinfos << raw_image->getWidth() << "x" << raw_image->getHeight() << llendl; 1068 //llinfos << mRawImage->getWidth() << "x" << mRawImage->getHeight() << llendl;
1457 if (final) 1069 if (final)
1458 { 1070 {
1459 //llinfos << "Final!" << llendl; 1071 //llinfos << "Final!" << llendl;
1460 } 1072 }
1461 entryp->mLastUsedDiscard = mRawDiscardLevel; 1073 entryp->mLastUsedDiscard = mRawDiscardLevel;
1462 entryp->mCallback(TRUE, this, raw_image, raw_image_aux, mRawDiscardLevel, final, entryp->mUserData); 1074 entryp->mCallback(TRUE, this, mRawImage, mAuxRawImage, mRawDiscardLevel, final, entryp->mUserData);
1463 if (final) 1075 if (final)
1464 { 1076 {
1465 iter = mLoadedCallbackList.erase(curiter); 1077 iter = mLoadedCallbackList.erase(curiter);
1466 delete entryp; 1078 delete entryp;
1467 } 1079 }
1080 res = true;
1468 } 1081 }
1469 } 1082 }
1470
1471 //
1472 // If you want to keep a copy of the raw image, you better copy it off yourself
1473 //
1474 destroyRawImage();
1475 } 1083 }
1476 1084
1477 // 1085 //
@@ -1497,6 +1105,7 @@ void LLViewerImage::doLoadedCallbacks()
1497 iter = mLoadedCallbackList.erase(curiter); 1105 iter = mLoadedCallbackList.erase(curiter);
1498 delete entryp; 1106 delete entryp;
1499 } 1107 }
1108 res = true;
1500 } 1109 }
1501 } 1110 }
1502 } 1111 }
@@ -1508,450 +1117,14 @@ void LLViewerImage::doLoadedCallbacks()
1508 { 1117 {
1509 gImageList.mCallbackList.erase(this); 1118 gImageList.mCallbackList.erase(this);
1510 } 1119 }
1511}
1512 1120
1513//============================================================================ 1121 // Done with any raw image data at this point (will be re-created if we still have callbacks)
1514 1122 destroyRawImage();
1515// static
1516void LLViewerImage::receiveImage(LLMessageSystem *msg, void **user_data)
1517{
1518 LLFastTimer t(LLFastTimer::FTM_PROCESS_IMAGES);
1519
1520 // Receive image header, copy into image object and decompresses
1521 // if this is a one-packet image.
1522
1523 LLUUID id;
1524
1525 char ip_string[256];
1526 u32_to_ip_string(msg->getSenderIP(),ip_string);
1527
1528 if (msg->getReceiveCompressedSize())
1529 {
1530 gImageList.sTextureBits += msg->getReceiveCompressedSize() * 8;
1531 }
1532 else
1533 {
1534 gImageList.sTextureBits += msg->getReceiveSize() * 8;
1535 }
1536 gImageList.sTexturePackets++;
1537
1538 msg->getUUIDFast(_PREHASH_ImageID, _PREHASH_ID, id);
1539
1540 char id_string[UUID_STR_LENGTH];
1541 id.toString(id_string);
1542
1543 LLViewerImage *image = gImageList.getImage(id); // Look up the correct image
1544
1545 image->mLastPacketTimer.reset();
1546 1123
1547 if (image->mFullyLoaded) 1124 return res;
1548 {
1549// llinfos << id << ":" << " Packet 0 for already loaded image!" << llendl;
1550 return;
1551 }
1552
1553 // check to see if we've gotten this packet before
1554 if (image->mGotFirstPacket)
1555 {
1556 //llinfos << id << ":" << " Duplicate Packet 0" << llendl;
1557 return;
1558 }
1559 if (!image->mRequested)
1560 {
1561// llinfos << id << ":" << " Packet 0 for unrequested image!" << llendl;
1562 return;
1563 }
1564
1565 image->mGotFirstPacket = TRUE;
1566
1567 // Copy header data into image object
1568 msg->getU8Fast(_PREHASH_ImageID, _PREHASH_Codec, image->mDataCodec);
1569 msg->getU16Fast(_PREHASH_ImageID, _PREHASH_Packets, image->mPackets);
1570 msg->getU32Fast(_PREHASH_ImageID, _PREHASH_Size, image->mTotalBytes);
1571
1572 if (0 == image->mPackets)
1573 {
1574 llwarns << "Img: " << (gTextureTable.getName(id).empty() ? id_string : gTextureTable.getName(id)) << ":" << " Number of packets is 0" << llendl;
1575 return;
1576 }
1577
1578 lldebugst(LLERR_IMAGE) << "Img: " << (gTextureTable.getName(id).empty() ? id_string : gTextureTable.getName(id)) << ":" << " Packet 0:" << image->mPackets - 1 << llendl;
1579
1580 U16 data_size = msg->getSizeFast(_PREHASH_ImageData, _PREHASH_Data);
1581
1582 // Got a packet, reset the counter.
1583 image->mRequestTime.reset();
1584 image->mPacketsReceived++;
1585
1586 if (data_size)
1587 {
1588 if (gVFS->getExists(image->mID, LLAssetType::AT_TEXTURE))
1589 {
1590 // We have data in the VFS, but it's not loaded.
1591 // We should start the VFS load on the assumption that we're going to use this data shortly.
1592 image->startVFSLoad();
1593 // We can throw out this data, because we have at least ONE packet on the disk
1594 //llinfos << "Throwing out first packet for " << image->mID << " which we already have a VFS file for!" << llendl;
1595 return;
1596 }
1597
1598 // this buffer gets saved off in the packet list
1599 U8 *data = new U8[data_size];
1600 msg->getBinaryDataFast(_PREHASH_ImageData, _PREHASH_Data, data, data_size);
1601
1602 // output this image data to cache file
1603 // only do this if we don't have old data
1604 LLVFile file(gVFS, image->mID, LLAssetType::AT_TEXTURE, LLVFile::APPEND);
1605 if (! file.getSize())
1606 {
1607 BOOL write_to_vfs = FALSE;
1608 if (image->mPackets == 0)
1609 {
1610 // Uh oh, we don't have packet data size
1611 // This must be something from a local cache
1612 llwarns << "Creating VFS file even though we don't know the number of packets!" << llendl;
1613 }
1614 else
1615 {
1616 write_to_vfs = file.setMaxSize(image->mTotalBytes + IMAGE_HEADER_SIZE + image->mPackets * PACKET_HEADER_SIZE);
1617 }
1618
1619 // to avoid another dynamic allocation, just assume we won't be gettimg image packets > 1 MTU
1620 if (data_size > MTUBYTES)
1621 {
1622 llerrs << "image data chunk too large: " << data_size << " bytes" << llendl;
1623 }
1624
1625 if (write_to_vfs)
1626 {
1627 const S32 WRITE_BUF_SIZE = IMAGE_HEADER_SIZE + PACKET_HEADER_SIZE + MTUBYTES;
1628 U8 buffer[WRITE_BUF_SIZE];
1629 U8 *tmp = buffer;
1630
1631 // write current version byte to file, so we can change the format and detect old files later
1632 memcpy(tmp, &LLViewerImage::sCurrentFileVersion, 4);
1633 tmp += 4;
1634 memcpy(tmp, id.mData, 16);
1635 tmp += 16;
1636 memcpy(tmp, (U8*)&(image->mDataCodec), 1);
1637 tmp += 1;
1638 memcpy(tmp, (U8*)&(image->mPackets), 2);
1639 tmp += 2;
1640 memcpy(tmp, (U8*)&(image->mTotalBytes), 4);
1641 tmp += 4;
1642 U16 zero = 0;
1643 memcpy(tmp, (U8*)&zero, 2);
1644 tmp += 2;
1645 memcpy(tmp, (U8*)&(data_size), 2);
1646 tmp += 2;
1647
1648 // now copy in the image data
1649 // it's a shame we can't use the original data buffer
1650 // but this needs to be a single, atomic write
1651 memcpy(tmp, data, data_size);
1652
1653// llinfos << "Writing packet 0 to disk for " << image->getID() << llendl;
1654 file.write(buffer, IMAGE_HEADER_SIZE + PACKET_HEADER_SIZE + data_size);
1655 }
1656 // do this AFTER writing to the VFS since LLViewerImagePacket may delete 'data'
1657 llassert( image->mReceivedPacketMap.find(0) == image->mReceivedPacketMap.end() );
1658 image->mReceivedPacketMap[0] = new LLViewerImagePacket(data, data_size, 0, TRUE);
1659 }
1660
1661 image->checkPacketData();
1662 }
1663}
1664
1665
1666///////////////////////////////////////////////////////////////////////////////
1667// TODO: lastbytes vs. texturebits?
1668// TODO: is mRequested already used?
1669
1670// static
1671void LLViewerImage::receiveImagePacket(LLMessageSystem *msg, void **user_data)
1672{
1673 LLMemType mt1(LLMemType::MTYPE_APPFMTIMAGE);
1674 LLFastTimer t(LLFastTimer::FTM_PROCESS_IMAGES);
1675
1676 // Receives image packet, copy into image object,
1677 // checks if all packets received, decompresses if so.
1678
1679 LLUUID id;
1680 U16 packet_num;
1681 char id_string[UUID_STR_LENGTH];
1682
1683 char ip_string[256];
1684 u32_to_ip_string(msg->getSenderIP(),ip_string);
1685
1686 if (msg->getReceiveCompressedSize())
1687 {
1688 gImageList.sTextureBits += msg->getReceiveCompressedSize() * 8;
1689 }
1690 else
1691 {
1692 gImageList.sTextureBits += msg->getReceiveSize() * 8;
1693 }
1694 gImageList.sTexturePackets++;
1695
1696 //llprintline("Start decode, image header...");
1697 msg->getUUIDFast(_PREHASH_ImageID, _PREHASH_ID, id);
1698 msg->getU16Fast(_PREHASH_ImageID, _PREHASH_Packet, packet_num);
1699
1700 id.toString(id_string);
1701
1702 LLViewerImage *image = gImageList.hasImage(id); // Look up the correct image
1703 if (!image ||!(image->mRequested))
1704 {
1705 // Getting a packet for an unrequested image.
1706 lldebugst(LLERR_IMAGE) << "Img: " << (gTextureTable.getName(id).empty() ? id_string : gTextureTable.getName(id)) << " Packet ";
1707 llcont << packet_num << " for unrequested from " << ip_string << llendl;
1708
1709 // don't cancel the request - this might just be an out of order packet
1710 return;
1711 }
1712
1713 image->mLastPacketTimer.reset();
1714
1715 if (image->mReceivedPacketMap.find(packet_num) != image->mReceivedPacketMap.end())
1716 {
1717 return;
1718 }
1719
1720 // check to see if we already got this packet
1721 BOOL duplicate = FALSE;
1722 if (packet_num <= image->mLastPacketProcessed)
1723 {
1724 duplicate = TRUE;
1725 }
1726 else if (image->mReceivedPacketMap.find(packet_num) != image->mReceivedPacketMap.end())
1727 {
1728 duplicate = TRUE;
1729 }
1730
1731 if (duplicate)
1732 {
1733 //llinfos << image->mID << ": duplicate packet " << packet_num << " last " << image->mLastPacketProcessed << llendl;
1734 return;
1735 }
1736
1737 // Got a packet, reset the counter.
1738 image->mRequestTime.reset();
1739 image->mPacketsReceived++;
1740
1741 std::string tex_name = gTextureTable.getName(id);
1742 if (image->mPackets == 0)
1743 {
1744 lldebugst(LLERR_IMAGE) << "Img: " << (tex_name.empty() ? id_string : tex_name) << " Packet " << packet_num << " out of order " << llendl;
1745 }
1746 else
1747 {
1748 lldebugst(LLERR_IMAGE) << "Img: " << (tex_name.empty() ? id_string : tex_name) << " Packet " << packet_num << ":" << image->mPackets - 1 << llendl;
1749 }
1750
1751
1752 U16 data_size = msg->getSizeFast(_PREHASH_ImageData, _PREHASH_Data);
1753 if (data_size)
1754 {
1755
1756 U8 *data = new U8[data_size];
1757 msg->getBinaryDataFast(_PREHASH_ImageData, _PREHASH_Data, data, data_size);
1758
1759 // as above assume we won't be gettimg image packets > 1 MTU
1760 if (data_size > MTUBYTES)
1761 {
1762 llerrs << "image data chunk too large: " << data_size << " bytes" << llendl;
1763 }
1764
1765 // We don't want to write it to disk yet, just put it on the queue.
1766 image->mReceivedPacketMap[packet_num] = new LLViewerImagePacket(data, data_size, packet_num, FALSE);
1767 // Process this packet.
1768 image->checkPacketData();
1769 }
1770}
1771
1772
1773BOOL LLViewerImage::checkPacketData()
1774{
1775 LLMemType mt1(LLMemType::MTYPE_APPFMTIMAGE);
1776
1777 S32 cur_size = 0;
1778 S32 next_size = 0;
1779 S32 next_discard = llmax(getDiscardLevel()-1,0);
1780
1781 // 1. Check if we already have formatted data to decode
1782 if (mFormattedImagep.notNull())
1783 {
1784 if ((mFormattedImagep->isDecoding()) || mStreamFile)
1785 {
1786 return TRUE; // we're busy decoding, don't request more data yet
1787 }
1788
1789 cur_size = mFormattedImagep->getDataSize();
1790 next_size = mFormattedImagep->calcDataSize(next_discard);
1791 next_size = llmin(next_size, (S32)mTotalBytes);
1792
1793 if (cur_size >= next_size)
1794 {
1795 setDecodeData(mFormattedImagep->getData(), cur_size);
1796 return TRUE;
1797 }
1798 }
1799
1800 if (mFullyLoaded)
1801 {
1802 // Somehow we think we have new packet data but are flagged as fully loaded
1803 resetPacketData();
1804 return TRUE;
1805 }
1806
1807 // 2. Check if we already have new packets
1808 if (!mPackets || !mGotFirstPacket)
1809 {
1810 return FALSE;
1811 }
1812 if (mReceivedPacketMap.empty() || mReceivedPacketMap.find(mLastPacketProcessed + 1) == mReceivedPacketMap.end())
1813 {
1814 return FALSE;
1815 }
1816
1817 // 3. Decide if we have enough new data to decode
1818 S32 new_size = cur_size;
1819 U16 next_packet_num = mLastPacketProcessed;
1820 for (vip_map_t::iterator iter = mReceivedPacketMap.begin();
1821 iter != mReceivedPacketMap.end() && iter->second->mPacketNum == ++next_packet_num;
1822 iter++)
1823 {
1824 new_size += iter->second->mDataSize;
1825 mLastPacket = iter->second->mPacketNum;
1826 }
1827 mLastBytesProcessed = new_size;
1828
1829 if (new_size < next_size)
1830 {
1831 return FALSE;
1832 }
1833
1834 if (!gVFS->getExists(mID, LLAssetType::AT_TEXTURE))
1835 {
1836 // We must have removed the file, probably because it was corrupted. Abort!
1837 //llinfos << "Reset on no VFS file!" << llendl;
1838 abortDecode();
1839 return FALSE;
1840 }
1841
1842 if (mLastPacketProcessed == -1 && cur_size != 0)
1843 {
1844 llerrs << "LLViewerImage: duplicate first packet!" << llendl;
1845 }
1846
1847 // 4. Append new data to existing data and decode
1848
1849 // 4a. Write the packets to disk
1850 LLVFile file(gVFS, mID, LLAssetType::AT_TEXTURE, LLVFile::APPEND);
1851 vip_map_t::iterator first_iter = mReceivedPacketMap.begin();
1852 S32 first_idx = 0;
1853 while (first_iter != mReceivedPacketMap.end())
1854 {
1855 S32 packet_data_size = 0;
1856 vip_map_t::iterator end_iter = first_iter;
1857 S32 end_idx = first_idx;
1858 while(end_iter != mReceivedPacketMap.end())
1859 {
1860 LLViewerImagePacket *vip = end_iter->second;
1861 if (!vip->mWroteToDisk)
1862 {
1863 packet_data_size += (PACKET_HEADER_SIZE + vip->mDataSize);
1864 }
1865 else
1866 {
1867 break;
1868 }
1869 ++end_iter;
1870 ++end_idx;
1871 }
1872 if (packet_data_size > 0)
1873 {
1874 U8* packet_data_buffer = new U8[packet_data_size];
1875 U8* packet_data = packet_data_buffer;
1876 for (vip_map_t::iterator iter = first_iter; iter != end_iter; ++iter)
1877 {
1878 LLViewerImagePacket *vip = iter->second;
1879
1880 memcpy(packet_data, &vip->mPacketNum, 2);
1881 memcpy(packet_data + 2, &(vip->mDataSize), 2);
1882 memcpy(packet_data + PACKET_HEADER_SIZE, vip->mData, vip->mDataSize);
1883 packet_data += (PACKET_HEADER_SIZE + vip->mDataSize);
1884
1885 vip->mWroteToDisk = TRUE;
1886 }
1887 if (packet_data - packet_data_buffer != packet_data_size) llerrs << "wtf?" << llendl;
1888
1889 // llinfos << mID << " Writing packets " << first_idx << "-" << end_idx << " to file." << llendl;
1890 file.write(packet_data_buffer, packet_data_size);
1891
1892 delete[] packet_data_buffer;
1893 }
1894 if (end_iter == first_iter)
1895 {
1896 ++end_iter;
1897 ++end_idx;
1898 }
1899 first_iter = end_iter;
1900 first_idx = end_idx;
1901 }
1902
1903 // 4b. Append the data
1904 U8* data = new U8[new_size];
1905 if (cur_size > 0)
1906 {
1907 memcpy(data, mFormattedImagep->getData(), cur_size);
1908 }
1909 LLViewerImagePacket *pkt = mReceivedPacketMap.begin()->second;
1910 while (pkt && pkt->mPacketNum == mLastPacketProcessed + 1)
1911 {
1912 memcpy((U8*)(data + cur_size), pkt->mData, pkt->mDataSize);
1913 cur_size += pkt->mDataSize;
1914 mLastPacketProcessed = pkt->mPacketNum;
1915 delete mReceivedPacketMap.begin()->second;
1916 mReceivedPacketMap.erase(mReceivedPacketMap.begin());
1917 pkt = NULL;
1918 if (!mReceivedPacketMap.empty())
1919 {
1920 pkt = mReceivedPacketMap.begin()->second;
1921 }
1922 }
1923
1924 llassert(cur_size == new_size);
1925 lldebugst(LLERR_IMAGE) << "IMAGE RECEIVED: " << mID.getString() << " Bytes: " << cur_size << "/" << mTotalBytes << llendl;
1926
1927 // 4c. Set the data to be decoded, and the number of bytes to use.
1928 setDecodeData(data, new_size);
1929
1930 // 5. Recalculate the image priority
1931 gImageList.removeImageFromList(this);
1932 F32 decode_priority = calcDecodePriority();
1933 setDecodePriority(decode_priority);
1934 gImageList.addImageToList(this);
1935
1936 return TRUE;
1937} 1125}
1938 1126
1939F32 LLViewerImage::getDecodeProgress(F32 *data_progress_p) 1127//============================================================================
1940{
1941 F32 decode_progress = 0.0f;
1942 F32 data_progress = 0.0f;
1943
1944 if (mLastPacket >= 0)
1945 {
1946 S32 max_bytes = mTotalBytes;
1947 S32 data_bytes = mLastBytesProcessed;
1948 S32 decode_bytes = mFormattedImagep.notNull() ? mFormattedImagep->getDataSize() : data_bytes;
1949 data_progress = (F32)data_bytes / (F32)max_bytes;
1950 decode_progress = (F32)decode_bytes / (F32)max_bytes;
1951 }
1952 if (data_progress_p) *data_progress_p = data_progress;
1953 return decode_progress;
1954}
1955 1128
1956// Call with 0,0 to turn this feature off. 1129// Call with 0,0 to turn this feature off.
1957void LLViewerImage::setKnownDrawSize(S32 width, S32 height) 1130void LLViewerImage::setKnownDrawSize(S32 width, S32 height)
@@ -1976,13 +1149,8 @@ BOOL LLViewerImage::bind(S32 stage) const
1976 BOOL res = bindTextureInternal(stage); 1149 BOOL res = bindTextureInternal(stage);
1977 if (res) 1150 if (res)
1978 { 1151 {
1979 if (mIsMissingAsset) 1152 //llassert_always(mIsMissingAsset == FALSE);
1980 { 1153
1981 // If we can bind, clearly we have an asset.
1982 // If mIsMissingAsset was true and we get here, it's likely
1983 // that the asset server was messed up and then it recovered.
1984 mIsMissingAsset = FALSE;
1985 }
1986 } 1154 }
1987 else 1155 else
1988 { 1156 {
@@ -2013,7 +1181,6 @@ BOOL LLViewerImage::bind(S32 stage) const
2013LLImageRaw* LLViewerImage::createRawImage(S8 discard_level, BOOL allocate) 1181LLImageRaw* LLViewerImage::createRawImage(S8 discard_level, BOOL allocate)
2014{ 1182{
2015 llassert(discard_level >= 0); 1183 llassert(discard_level >= 0);
2016 llassert(mFormattedImagep.isNull() || !mFormattedImagep->isDecoding());
2017 if (mRawImage.notNull()) 1184 if (mRawImage.notNull())
2018 { 1185 {
2019 llerrs << "createRawImage() called with existing mRawImage" << llendl; 1186 llerrs << "createRawImage() called with existing mRawImage" << llendl;
diff --git a/linden/indra/newview/llviewerimage.h b/linden/indra/newview/llviewerimage.h
index e2f44e5..54865ff 100644
--- a/linden/indra/newview/llviewerimage.h
+++ b/linden/indra/newview/llviewerimage.h
@@ -41,7 +41,6 @@ class LLViewerImage;
41typedef void (*loaded_callback_func)( BOOL success, LLViewerImage *src_vi, LLImageRaw* src, LLImageRaw* src_aux, S32 discard_level, BOOL final, void* userdata ); 41typedef void (*loaded_callback_func)( BOOL success, LLViewerImage *src_vi, LLImageRaw* src, LLImageRaw* src_aux, S32 discard_level, BOOL final, void* userdata );
42 42
43class LLVFile; 43class LLVFile;
44class LLViewerImagePacket;
45class LLMessageSystem; 44class LLMessageSystem;
46 45
47class LLLoadedCallbackEntry 46class LLLoadedCallbackEntry
@@ -70,7 +69,8 @@ class LLTextureBar;
70 69
71class LLViewerImage : public LLImageGL 70class LLViewerImage : public LLImageGL
72{ 71{
73// friend class LLViewerImageList; 72 LOG_CLASS(LLViewerImage);
73
74 friend class LLTextureBar; // debug info only 74 friend class LLTextureBar; // debug info only
75 friend class LLTextureView; // debug info only 75 friend class LLTextureView; // debug info only
76 76
@@ -78,8 +78,6 @@ public:
78 static void initClass(); 78 static void initClass();
79 static void cleanupClass(); 79 static void cleanupClass();
80 static void updateClass(const F32 velocity, const F32 angular_velocity); 80 static void updateClass(const F32 velocity, const F32 angular_velocity);
81 static void receiveImage(LLMessageSystem *msg, void **user_data);
82 static void receiveImagePacket(LLMessageSystem *msg, void **user_data);
83 static BOOL bindTexture(LLImageGL* image, const U32 stage = 0) 81 static BOOL bindTexture(LLImageGL* image, const U32 stage = 0)
84 { 82 {
85 if (image) 83 if (image)
@@ -188,24 +186,6 @@ public:
188 186
189 const LLUUID& getID() { return mID; } 187 const LLUUID& getID() { return mID; }
190 188
191 void setFormattedImage(LLImageFormatted* imagep);
192
193 // Load an image from the static VFS
194 BOOL loadLocalImage(const LLUUID& uuid);
195
196 // Start loading of data from VFS, if any
197 BOOL startVFSLoad();
198 void startImageDecode();
199
200 // Methods for loading and decoding data
201 void setDecodeData(U8 *data, U32 size);
202 void decodeImage(const F32 decode_time = 0.0);
203 bool isDecoding();
204
205 // Poll the VFS to see if the read is complete. Returns TRUE if
206 // the read is complete (and sets mStreamFile to NULL).
207 BOOL loadStreamFile();
208
209 // New methods for determining image quality/priority 189 // New methods for determining image quality/priority
210 // texel_area_ratio is ("scaled" texel area)/(original texel area), approximately. 190 // texel_area_ratio is ("scaled" texel area)/(original texel area), approximately.
211 void addTextureStats(F32 pixel_area, 191 void addTextureStats(F32 pixel_area,
@@ -216,9 +196,6 @@ public:
216 // Process image stats to determine priority/quality requirements. 196 // Process image stats to determine priority/quality requirements.
217 void processTextureStats(); 197 void processTextureStats();
218 198
219 // Checks image data and decodes if ready. Returns true if packets were decoded or are pending
220 BOOL checkPacketData();
221
222 // Set callbacks to get called when the image gets updated with higher 199 // Set callbacks to get called when the image gets updated with higher
223 // resolution versions. 200 // resolution versions.
224 void setLoadedCallback(loaded_callback_func cb, 201 void setLoadedCallback(loaded_callback_func cb,
@@ -226,13 +203,11 @@ public:
226 BOOL keep_imageraw, 203 BOOL keep_imageraw,
227 void* userdata); 204 void* userdata);
228 205
206 // ONLY call from LLViewerImageList
229 BOOL createTexture(S32 usename = 0); 207 BOOL createTexture(S32 usename = 0);
230 BOOL destroyTexture();
231 208
232 BOOL needsAux() const { return mNeedsAux; } 209 BOOL needsAux() const { return mNeedsAux; }
233 void setNeedsAux(const BOOL needs_aux) { mNeedsAux = needs_aux; } 210 void setNeedsAux(const BOOL needs_aux) { mNeedsAux = needs_aux; }
234 BOOL needsDecode() const { return mNeedsDecode; }
235 void setNeedsDecode(const BOOL needs_decode) { mNeedsDecode = needs_decode; }
236 211
237 // setDesiredDiscardLevel is only used by LLViewerImageList 212 // setDesiredDiscardLevel is only used by LLViewerImageList
238 void setDesiredDiscardLevel(S32 discard) { mDesiredDiscardLevel = discard; } 213 void setDesiredDiscardLevel(S32 discard) { mDesiredDiscardLevel = discard; }
@@ -247,20 +222,20 @@ public:
247 enum 222 enum
248 { 223 {
249 BOOST_NONE = 0, 224 BOOST_NONE = 0,
250 BOOST_TERRAIN = 1, 225 BOOST_AVATAR_BAKED = 1,
251 BOOST_AVATAR_BAKED = 2, 226 BOOST_AVATAR = 2,
252 BOOST_AVATAR = 3, 227 BOOST_CLOUDS = 3,
253 BOOST_CLOUDS = 4,
254 228
255 BOOST_HIGH = 10, 229 BOOST_HIGH = 10,
256 BOOST_SELECTED = 11, 230 BOOST_TERRAIN = 11, // has to be high priority for minimap / low detail
257 BOOST_HUD = 12, 231 BOOST_SELECTED = 12,
258 BOOST_AVATAR_BAKED_SELF = 13, 232 BOOST_HUD = 13,
259 BOOST_UI = 14, 233 BOOST_AVATAR_BAKED_SELF = 14,
260 BOOST_PREVIEW = 15, 234 BOOST_UI = 15,
261 BOOST_MAP = 16, 235 BOOST_PREVIEW = 16,
262 BOOST_MAP_LAYER = 17, 236 BOOST_MAP = 17,
263 BOOST_AVATAR_SELF = 18, // needed for baking avatar 237 BOOST_MAP_LAYER = 18,
238 BOOST_AVATAR_SELF = 19, // needed for baking avatar
264 BOOST_MAX_LEVEL 239 BOOST_MAX_LEVEL
265 }; 240 };
266 void setBoostLevel(S32 level); 241 void setBoostLevel(S32 level);
@@ -275,111 +250,88 @@ public:
275 // the priority list, and cause horrible things to happen. 250 // the priority list, and cause horrible things to happen.
276 void setDecodePriority(F32 priority = -1.0f); 251 void setDecodePriority(F32 priority = -1.0f);
277 252
253 bool updateFetch();
254
278 // Override the computation of discard levels if we know the exact output 255 // Override the computation of discard levels if we know the exact output
279 // size of the image. Used for UI textures to not decode, even if we have 256 // size of the image. Used for UI textures to not decode, even if we have
280 // more data. 257 // more data.
281 void setKnownDrawSize(S32 width, S32 height); 258 void setKnownDrawSize(S32 width, S32 height);
282 259
283 void setIsMissingAsset(BOOL b) { mIsMissingAsset = b; } 260 void setIsMissingAsset();
284 BOOL isMissingAsset() { return mIsMissingAsset; } 261 BOOL isMissingAsset() { return mIsMissingAsset; }
285 262
286 BOOL getNeedsCreateTexture() const { return mNeedsCreateTexture; }
287
288 bool hasCallbacks() { return mLoadedCallbackList.empty() ? false : true; } 263 bool hasCallbacks() { return mLoadedCallbackList.empty() ? false : true; }
289 264
290 void doLoadedCallbacks(); 265 bool doLoadedCallbacks();
291 S32 getLastPacket() { return mLastPacket; }
292 F32 getDecodeProgress(F32 *data_progress_p = 0);
293 266
294 void abortDecode();
295 void destroyRawImage(); // Delete the raw image for this discard level
296
297private: 267private:
298 /*virtual*/ void cleanup(); // Cleanup the LLViewerImage (so we can reinitialize it) 268 /*virtual*/ void cleanup(); // Cleanup the LLViewerImage (so we can reinitialize it)
299 269
300 void init(bool firstinit); 270 void init(bool firstinit);
301 void hoseStreamFile();
302 void resetPacketData();
303 271
304 // Used to be in LLImageGL 272 // Used to be in LLImageGL
305 LLImageRaw* createRawImage(S8 discard_level = 0, BOOL allocate = FALSE); 273 LLImageRaw* createRawImage(S8 discard_level = 0, BOOL allocate = FALSE);
274 void destroyRawImage();
306 275
307public: 276public:
308 S32 mFullWidth; 277 S32 mFullWidth;
309 S32 mFullHeight; 278 S32 mFullHeight;
310 LLVFile *mStreamFile;
311 279
312 // Data used for calculating required image priority/quality level/decimation 280 // Data used for calculating required image priority/quality level/decimation
313 mutable F32 mMaxVirtualSize; // The largest virtual size of the image, in pixels - how much data to we need? 281 mutable F32 mMaxVirtualSize; // The largest virtual size of the image, in pixels - how much data to we need?
314 mutable F32 mMaxCosAngle; // The largest cos of the angle between camera X vector and the object 282 mutable F32 mMaxCosAngle; // The largest cos of the angle between camera X vector and the object
315 283
316 F32 mTexelsPerImage; // Texels per image. 284 F32 mTexelsPerImage; // Texels per image.
285 F32 mDiscardVirtualSize; // Virtual size used to calculate desired discard
317 286
318 S8 mInImageList; // TRUE if image is in list (in which case don't reset priority!) 287 S8 mInImageList; // TRUE if image is in list (in which case don't reset priority!)
319 S8 mIsMediaTexture; // TRUE if image is being replaced by media (in which case don't update) 288 S8 mIsMediaTexture; // TRUE if image is being replaced by media (in which case don't update)
320 S8 mInStaticVFS; // Source data in local VFS
321 S8 mFormattedFlushed;
322 289
323 S8 mRequested; // An image request is currently in process.
324 S8 mFullyLoaded;
325
326 // Various info regarding image requests 290 // Various info regarding image requests
327 LLFrameTimer mRequestTime;
328 S32 mRequestedDiscardLevel; 291 S32 mRequestedDiscardLevel;
329 F32 mRequestedDownloadPriority; 292 F32 mRequestedDownloadPriority;
293 S32 mFetchState;
294 U32 mFetchPriority;
295 F32 mDownloadProgress;
296 F32 mFetchDeltaTime;
297 F32 mRequestDeltaTime;
298 S32 mDecodeFrame;
299 S32 mVisibleFrame; // decode frame where image was last visible
330 300
331 // Timers 301 // Timers
332 LLFrameTimer mLastDecodeTime; // Time since last decode.
333 LLFrameTimer mLastPacketTimer; // Time since last packet. 302 LLFrameTimer mLastPacketTimer; // Time since last packet.
334 LLFrameTimer mLastReferencedTimer; 303 LLFrameTimer mLastReferencedTimer;
335 304
336private: 305private:
337 LLUUID mID; 306 LLUUID mID;
338 LLPointer<LLImageFormatted> mFormattedImagep;
339 307
340 S8 mDesiredDiscardLevel; // The discard level we'd LIKE to have - if we have it and there's space 308 S8 mDesiredDiscardLevel; // The discard level we'd LIKE to have - if we have it and there's space
341 S8 mMinDesiredDiscardLevel; // The minimum discard level we'd like to have 309 S8 mMinDesiredDiscardLevel; // The minimum discard level we'd like to have
342 S8 mGotFirstPacket; 310 S8 mNeedsCreateTexture;
343 S8 mNeedsCreateTexture;
344
345 S8 mNeedsDecode; // We have a compressed image that we want to decode, now.
346 S8 mNeedsAux; // We need to decode the auxiliary channels 311 S8 mNeedsAux; // We need to decode the auxiliary channels
347
348 S8 mDecodingAux; // Are we decoding high components 312 S8 mDecodingAux; // Are we decoding high components
349 mutable S8 mIsMissingAsset; // True if we know that there is no image asset with this image id in the database.
350
351 // Codec of incoming packet data
352 U8 mDataCodec;
353 S8 mIsRawImageValid; 313 S8 mIsRawImageValid;
314 S8 mHasFetcher; // We've made a fecth request
315 S8 mIsFetching; // Fetch request is active
316 S8 mFullyLoaded;
317 mutable S8 mIsMissingAsset; // True if we know that there is no image asset with this image id in the database.
354 318
355 typedef std::map<U16, LLViewerImagePacket *> vip_map_t;
356 vip_map_t mReceivedPacketMap;
357 S32 mLastPacketProcessed;
358 U32 mLastBytesProcessed; // Total bytes including the last packet rec'd
359
360 // Data download/decode info
361 U32 mPacketsReceived;
362 U32 mTotalBytes;
363 S32 mLastPacket; // Last packet received without a gap.
364 U16 mPackets;
365
366 // VFS info
367 U8 *mCachedData;
368 S32 mCachedSize;
369
370 // Override the computation of discard levels if we know the exact output size of the image. 319 // Override the computation of discard levels if we know the exact output size of the image.
371 // Used for UI textures to not decode, even if we have more data. 320 // Used for UI textures to not decode, even if we have more data.
372 S32 mKnownDrawWidth; 321 S32 mKnownDrawWidth;
373 S32 mKnownDrawHeight; 322 S32 mKnownDrawHeight;
374 323
375 F32 mDecodePriority; // The priority for decoding this image. 324 F32 mDecodePriority; // The priority for decoding this image.
376 S32 mBoostLevel; // enum describing priority level 325 S32 mBoostLevel; // enum describing priority level
377 326
378 typedef std::list<LLLoadedCallbackEntry*> callback_list_t; 327 typedef std::list<LLLoadedCallbackEntry*> callback_list_t;
379 callback_list_t mLoadedCallbackList; 328 callback_list_t mLoadedCallbackList;
380 329
381 LLPointer<LLImageRaw> mRawImage; 330 LLPointer<LLImageRaw> mRawImage;
382 S32 mRawDiscardLevel; 331 S32 mRawDiscardLevel;
332 S32 mMinDiscardLevel;
333 F32 mCalculatedDiscardLevel; // Last calculated discard level
334
383 // Used ONLY for cloth meshes right now. Make SURE you know what you're 335 // Used ONLY for cloth meshes right now. Make SURE you know what you're
384 // doing if you use it for anything else! - djs 336 // doing if you use it for anything else! - djs
385 LLPointer<LLImageRaw> mAuxRawImage; 337 LLPointer<LLImageRaw> mAuxRawImage;
diff --git a/linden/indra/newview/llviewerimagelist.cpp b/linden/indra/newview/llviewerimagelist.cpp
index 20ca3bf..456afdb 100644
--- a/linden/indra/newview/llviewerimagelist.cpp
+++ b/linden/indra/newview/llviewerimagelist.cpp
@@ -39,57 +39,30 @@
39#include "llimagejpeg.h" 39#include "llimagejpeg.h"
40#include "llmediaengine.h" 40#include "llmediaengine.h"
41 41
42#include "llsdserialize.h"
43#include "llsys.h"
42#include "llvfs.h" 44#include "llvfs.h"
43#include "llvfile.h" 45#include "llvfile.h"
44#include "llvfsthread.h" 46#include "llvfsthread.h"
45#include "message.h" 47#include "message.h"
46 48
47#include "llagent.h" 49#include "llagent.h"
48#include "llviewercontrol.h" 50#include "lltexturecache.h"
51#include "lltexturefetch.h"
49#include "lltexturetable.h" // For looking up names from uuid's. 52#include "lltexturetable.h" // For looking up names from uuid's.
53#include "llviewercontrol.h"
50#include "llviewerimage.h" 54#include "llviewerimage.h"
51#include "llviewerregion.h" 55#include "llviewerregion.h"
56#include "pipeline.h"
52#include "viewer.h" 57#include "viewer.h"
53#include "llsys.h"
54#include "llpaneldisplay.h" // for LL_MAX_VRAM_INDEX
55 58
56void (*LLViewerImageList::sUUIDCallback)(void **, const LLUUID&) = NULL; 59////////////////////////////////////////////////////////////////////////////
57 60
58const U32 SIXTEEN_MEG = 0x1000000; 61void (*LLViewerImageList::sUUIDCallback)(void **, const LLUUID&) = NULL;
59const F32 MAX_IMAGE_PRIORITY = 100000000.f;
60 62
61U32 LLViewerImageList::sTextureBits = 0; 63U32 LLViewerImageList::sTextureBits = 0;
62U32 LLViewerImageList::sTexturePackets = 0; 64U32 LLViewerImageList::sTexturePackets = 0;
63 65
64struct CodecExtMap
65{
66 CodecExtMap( const char* ext, U8 codec ) : mExt( ext ), mCodec( codec ) {}
67 const char* mExt;
68 U8 mCodec;
69};
70
71// Note: Keep codec extensions in order of likelihood the image
72// will be found.
73const S32 CODEC_EXT_MAP_COUNT = 2;
74const CodecExtMap CODEC_EXT_MAP[CODEC_EXT_MAP_COUNT] =
75{
76 CodecExtMap( "_07", IMG_CODEC_J2C ),
77 CodecExtMap( ".tga", IMG_CODEC_TGA )
78};
79
80const U32 MIN_AVAIL_MEM_FOR_DECODE = 1048576;
81
82// HACK: We have to try to allocate a constant fraction of this
83// memory for AGP. This isn't worthwhile on 128 meg cards.
84// So for 128 meg cards, only alloc 64 megs.
85const S32 VIDEO_CARD_MEM_SIZES[6] = { 0x1000000, // 16MB
86 0x2000000, // 32MB
87 0x4000000, // 64MB+
88 0x8000000, // 128MB
89 0x10000000, // 256MB
90 0x20000000, // 512MB
91 };
92
93const S32 IMAGES_PER_REQUEST = 42; 66const S32 IMAGES_PER_REQUEST = 42;
94const S32 IMAGES_MIN_UPDATES = 4; // Always update the highest N images each frame 67const S32 IMAGES_MIN_UPDATES = 4; // Always update the highest N images each frame
95const S32 IMAGES_MAX_PACKET_UPDATES = 1; // Only send N packets of IMAGES_PER_REQUEST in a frame 68const S32 IMAGES_MAX_PACKET_UPDATES = 1; // Only send N packets of IMAGES_PER_REQUEST in a frame
@@ -105,22 +78,6 @@ LLStat LLViewerImageList::sGLBoundMemStat(32, TRUE);
105LLStat LLViewerImageList::sRawMemStat(32, TRUE); 78LLStat LLViewerImageList::sRawMemStat(32, TRUE);
106LLStat LLViewerImageList::sFormattedMemStat(32, TRUE); 79LLStat LLViewerImageList::sFormattedMemStat(32, TRUE);
107 80
108//static
109S32 LLViewerImageList::calcMaxTextureRAM()
110{
111 // Decide the maximum amount of RAM we should allow the user to allocate to texture cache
112 LLMemoryInfo memory_info;
113 U32 available_memory = memory_info.getPhysicalMemory();
114
115 clamp_rescale((F32)available_memory,
116 (F32)(SIXTEEN_MEG * 16),
117 (F32)U32_MAX,
118 (F32)(SIXTEEN_MEG * 4),
119 (F32)(U32_MAX >> 1));
120 return available_memory;
121}
122
123
124/////////////////////////////////////////////////////////////////////////////// 81///////////////////////////////////////////////////////////////////////////////
125 82
126LLViewerImageList::LLViewerImageList() 83LLViewerImageList::LLViewerImageList()
@@ -145,57 +102,22 @@ void LLViewerImageList::init()
145 return; 102 return;
146 } 103 }
147 104
148 // This stuff is global! Bad behavior if more than one image list.
149
150 // Set the fallback GL texture to smoke...
151 LLViewerImage::sSmokeImagep = getImage(IMG_SMOKE, TRUE, TRUE);
152 // Set the fallback GL texture to gray with a white border...
153#if 0
154 LLViewerImage* imagep = new LLViewerImage(IMG_DEFAULT, TRUE);
155 LLViewerImage::sDefaultImagep = imagep;
156 const S32 dim = 128;
157 const S32 border = 2;
158 LLPointer<LLImageRaw> image_raw = new LLImageRaw(dim,dim,3);
159 U8* data = image_raw->getData();
160 for (S32 i = 0; i<dim; i++)
161 {
162 for (S32 j = 0; j<dim; j++)
163 {
164 if (i<border || j<border || i>=(dim-border) || j>=(dim-border))
165 {
166 *data++ = 0xff;
167 *data++ = 0xff;
168 *data++ = 0xff;
169 }
170 else
171 {
172 *data++ = 0x7f;
173 *data++ = 0x7f;
174 *data++ = 0x7f;
175 }
176 }
177 }
178 imagep->createGLTexture(0, image_raw);
179 image_raw = NULL;
180 addImage(imagep);
181 imagep->dontDiscard();
182#else
183 LLViewerImage::sDefaultImagep = getImage(IMG_DEFAULT, TRUE, TRUE);
184#endif
185
186
187 mUpdateStats = TRUE; 105 mUpdateStats = TRUE;
188 106
189 // Update how much texture RAM we're allowed to use. 107 // Update how much texture RAM we're allowed to use.
190 updateMaxResidentTexMem(); 108 updateMaxResidentTexMem();
191 109
192 mMovieImageHasMips = FALSE; 110 mMovieImageHasMips = FALSE;
111
112 doPreloadImages();
113
114 decodeAllImages(5.f); // decode preloaded images
193} 115}
194 116
195void LLViewerImageList::doPreloadImages() 117void LLViewerImageList::doPreloadImages()
196{ 118{
197 llinfos << "Preloading images..." << llendl; 119 llinfos << "Preloading images..." << llendl;
198 120
199 // Set the "missing asset" image 121 // Set the "missing asset" image
200 LLViewerImage::sMissingAssetImagep = preloadImage("missing_asset.tga" , LLUUID::null, TRUE); 122 LLViewerImage::sMissingAssetImagep = preloadImage("missing_asset.tga" , LLUUID::null, TRUE);
201 123
@@ -335,6 +257,7 @@ void LLViewerImageList::doPreloadImages()
335 preloadImage("spin_up_in_blue.tga", LLUUID::null, FALSE); 257 preloadImage("spin_up_in_blue.tga", LLUUID::null, FALSE);
336 preloadImage("spin_up_out_blue.tga", LLUUID::null, FALSE); 258 preloadImage("spin_up_out_blue.tga", LLUUID::null, FALSE);
337 preloadImage("square_btn_32x128.tga", LLUUID::null, FALSE); 259 preloadImage("square_btn_32x128.tga", LLUUID::null, FALSE);
260 preloadImage("square_btn_selected_32x128.tga", LLUUID::null, FALSE);
338 preloadImage("startup_logo.tga", LLUUID::null, FALSE); 261 preloadImage("startup_logo.tga", LLUUID::null, FALSE);
339 preloadImage("status_build.tga", LLUUID::null, FALSE); 262 preloadImage("status_build.tga", LLUUID::null, FALSE);
340 preloadImage("status_buy_currency.tga", LLUUID::null, FALSE); 263 preloadImage("status_buy_currency.tga", LLUUID::null, FALSE);
@@ -346,6 +269,8 @@ void LLViewerImageList::doPreloadImages()
346 preloadImage("status_scripts.tga", LLUUID::null, FALSE); 269 preloadImage("status_scripts.tga", LLUUID::null, FALSE);
347 preloadImage("tab_bottom_blue.tga", LLUUID::null, FALSE); 270 preloadImage("tab_bottom_blue.tga", LLUUID::null, FALSE);
348 preloadImage("tab_bottom_selected_blue.tga", LLUUID::null, FALSE); 271 preloadImage("tab_bottom_selected_blue.tga", LLUUID::null, FALSE);
272 preloadImage("tab_left.tga", LLUUID::null, FALSE);
273 preloadImage("tab_left_selected.tga", LLUUID::null, FALSE);
349 preloadImage("tab_top_blue.tga", LLUUID::null, FALSE); 274 preloadImage("tab_top_blue.tga", LLUUID::null, FALSE);
350 preloadImage("tab_top_selected_blue.tga", LLUUID::null, FALSE); 275 preloadImage("tab_top_selected_blue.tga", LLUUID::null, FALSE);
351 preloadImage("tool_dozer.tga", LLUUID::null, FALSE); 276 preloadImage("tool_dozer.tga", LLUUID::null, FALSE);
@@ -355,6 +280,45 @@ void LLViewerImageList::doPreloadImages()
355 preloadImage("white.tga", LLUUID::null, TRUE); 280 preloadImage("white.tga", LLUUID::null, TRUE);
356} 281}
357 282
283static std::string get_texture_list_name()
284{
285 BOOL login_last = gSavedSettings.getBOOL("LoginLastLocation");
286 return std::string("texture_list_") + (login_last?"last":"home") + ".xml";
287}
288
289void LLViewerImageList::doPrefetchImages()
290{
291 if (gPurgeCache)
292 {
293 // cache was purged, no point
294 return;
295 }
296
297 // Pre-fetch textures from last logout
298 LLSD imagelist;
299 std::string filename = gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, get_texture_list_name());
300 llifstream file;
301 file.open(filename.c_str());
302 if (file.is_open())
303 {
304 LLSDSerialize::fromXML(imagelist, file);
305 }
306 for (LLSD::array_iterator iter = imagelist.beginArray();
307 iter != imagelist.endArray(); ++iter)
308 {
309 LLSD imagesd = *iter;
310 LLUUID uuid = imagesd["uuid"];
311 S32 pixel_area = imagesd["area"];
312 LLViewerImage* image = getImage(uuid, MIPMAP_TRUE, FALSE);
313 if (image)
314 {
315 image->addTextureStats((F32)pixel_area);
316 }
317 }
318
319
320}
321
358/////////////////////////////////////////////////////////////////////////////// 322///////////////////////////////////////////////////////////////////////////////
359 323
360LLViewerImageList::~LLViewerImageList() 324LLViewerImageList::~LLViewerImageList()
@@ -364,43 +328,70 @@ LLViewerImageList::~LLViewerImageList()
364 328
365void LLViewerImageList::shutdown() 329void LLViewerImageList::shutdown()
366{ 330{
367 // Clean up potential callback data 331 // Write out list of currently loaded textures for precaching on startup
368 // mIRCallbackData is now stl and will clean itself up 332 typedef std::set<std::pair<S32,LLViewerImage*> > image_area_list_t;
333 image_area_list_t image_area_list;
334 for (image_priority_list_t::iterator iter = mImageList.begin();
335 iter != mImageList.end(); ++iter)
336 {
337 LLViewerImage* image = *iter;
338 if (!image->getUseDiscard() ||
339 image->needsAux() ||
340 image->getTargetHost() != LLHost::invalid)
341 {
342 continue; // avoid UI, baked, and other special images
343 }
344 S32 desired = image->getDesiredDiscardLevel();
345 if (desired >= 0 && desired < MAX_DISCARD_LEVEL)
346 {
347 S32 pixel_area = image->getWidth(desired) * image->getHeight(desired);
348 image_area_list.insert(std::make_pair(pixel_area, image));
349 }
350 }
351
352 LLSD imagelist;
353 const S32 max_count = 1000;
354 S32 count = 0;
355 for (image_area_list_t::reverse_iterator riter = image_area_list.rbegin();
356 riter != image_area_list.rend(); ++riter)
357 {
358 LLViewerImage* image = riter->second;
359 imagelist[count]["area"] = riter->first;
360 imagelist[count]["uuid"] = image->getID();
361 if (++count >= max_count)
362 break;
363 }
369 364
365 if (count > 0 && !gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, "").empty())
366 {
367 std::string filename = gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, get_texture_list_name());
368 llofstream file;
369 file.open(filename.c_str());
370 LLSDSerialize::toPrettyXML(imagelist, file);
371 }
372
370 // 373 //
371 // Clean up "loaded" callbacks. 374 // Clean up "loaded" callbacks.
372 // 375 //
373 mCallbackList.clear(); 376 mCallbackList.clear();
374 377 mIRCallbackData.clear();
378
375 // Clean up preloaded images 379 // Clean up preloaded images
376 mPreloadedImages.clear(); 380 mPreloadedImages.clear();
377 381
378 //
379 // If we're working on decoding an image, finish it off so we can clean it up.
380 //
381 LLViewerImage *imagep = mCurrentDecodeImagep;
382 if (imagep)
383 {
384 imagep->abortDecode();
385 imagep->destroyRawImage();
386 mCurrentDecodeImagep = NULL;
387 }
388
389 // Flush all of the references 382 // Flush all of the references
390 mLoadingStreamList.clear(); 383 mLoadingStreamList.clear();
384 mCreateTextureList.clear();
391 385
392 mUUIDMap.clear(); 386 mUUIDMap.clear();
393 387
394 // This stuff is global!
395 LLViewerImage::sDefaultImagep = NULL;
396
397 mImageList.clear(); 388 mImageList.clear();
398} 389}
399 390
400void LLViewerImageList::dump() 391void LLViewerImageList::dump()
401{ 392{
402 llinfos << "LLViewerImageList::dump()" << llendl; 393 llinfos << "LLViewerImageList::dump()" << llendl;
403 for (image_list_t::iterator it = mImageList.begin(); it != mImageList.end(); ++it) 394 for (image_priority_list_t::iterator it = mImageList.begin(); it != mImageList.end(); ++it)
404 { 395 {
405 LLViewerImage* image = *it; 396 LLViewerImage* image = *it;
406 397
@@ -456,20 +447,20 @@ LLViewerImage* LLViewerImageList::preloadImage(const LLString& filename, const L
456 447
457/////////////////////////////////////////////////////////////////////////////// 448///////////////////////////////////////////////////////////////////////////////
458 449
459LLViewerImage * LLViewerImageList::getImage(const LLString& filename, 450LLViewerImage* LLViewerImageList::getImage(const LLString& filename,
460 const LLUUID &image_set_id, 451 const LLUUID &image_set_id,
461 BOOL usemipmaps, 452 BOOL usemipmaps,
462 BOOL level_immediate) 453 BOOL level_immediate)
463{ 454{
464 return getImageFromFile(filename, image_set_id, usemipmaps, level_immediate, 0, 0); 455 return getImageFromFile(filename, image_set_id, usemipmaps, level_immediate, 0, 0);
465} 456}
466 457
467LLViewerImage * LLViewerImageList::getImageFromFile(const LLString& filename, 458LLViewerImage* LLViewerImageList::getImageFromFile(const LLString& filename,
468 const LLUUID &image_set_id, 459 const LLUUID &image_set_id,
469 BOOL usemipmaps, 460 BOOL usemipmaps,
470 BOOL level_immediate, 461 BOOL level_immediate,
471 LLGLint internal_format, 462 LLGLint internal_format,
472 LLGLenum primary_format) 463 LLGLenum primary_format)
473{ 464{
474 if (gNoRender) 465 if (gNoRender)
475 { 466 {
@@ -485,7 +476,7 @@ LLViewerImage * LLViewerImageList::getImageFromFile(const LLString& filename,
485 LLUUID image_id = LLUUID( gViewerArt.getString(filename.c_str()) ); 476 LLUUID image_id = LLUUID( gViewerArt.getString(filename.c_str()) );
486 if (image_id.isNull()) 477 if (image_id.isNull())
487 { 478 {
488 llwarns << "Unable to find inage " << filename << " in gViewerArt" << llendl; 479 llwarns << "Unable to find image " << filename << " in gViewerArt" << llendl;
489 if (image_set_id.notNull()) 480 if (image_set_id.notNull())
490 { 481 {
491 // We *know* that missing_asset.tga exists, 482 // We *know* that missing_asset.tga exists,
@@ -512,58 +503,9 @@ LLViewerImage * LLViewerImageList::getImageFromFile(const LLString& filename,
512 image_id = image_set_id; 503 image_id = image_set_id;
513 } 504 }
514 505
515 // First see if we already have this image loaded. 506 // Load the image
516 LLPointer<LLViewerImage> imagep = hasImage(image_id); 507 LLViewerImage* imagep = getImageFromUUID(image_id, usemipmaps, level_immediate,
517 508 internal_format, primary_format, LLHost());
518 if (imagep.isNull())
519 {
520 // No image loaded. Try to read the filename given.
521 bool success = false;
522 if (!filename.empty())
523 {
524 // This is strictly for local .tga files not in the static VFS
525 LLString image_file = gDirUtilp->getExpandedFilename(LL_PATH_TOP_SKIN, filename);
526 imagep = new LLViewerImage(image_id, usemipmaps);
527 LLPointer<LLImageRaw> image_raw = new LLImageRaw(image_file);
528 if ( image_raw->getDataSize() > 0 )
529 {
530 imagep->createGLTexture(0, image_raw);
531 image_raw = NULL;
532
533 if (usemipmaps == FALSE)
534 {
535 // num mipmaped textures are almost always clamped, so clamp by default
536 imagep->bind();
537 imagep->setClamp(TRUE, TRUE);
538 }
539
540 if (internal_format && primary_format)
541 {
542 imagep->setExplicitFormat(internal_format, primary_format);
543 }
544
545 addImage(imagep);
546
547 if (level_immediate)
548 {
549 imagep->dontDiscard();
550 }
551
552 success = true;
553 }
554 else
555 {
556 imagep = NULL;
557 }
558 }
559
560 if (!success)
561 {
562 // We couldn't load from a file. Try the VFS.
563 imagep = getImageFromUUID(image_id, usemipmaps, level_immediate,
564 internal_format, primary_format, LLHost());
565 }
566 }
567 509
568 return imagep; 510 return imagep;
569} 511}
@@ -609,40 +551,7 @@ LLViewerImage* LLViewerImageList::getImageFromUUID(const LLUUID &image_id,
609 if (level_immediate) 551 if (level_immediate)
610 { 552 {
611 imagep->dontDiscard(); 553 imagep->dontDiscard();
612 } 554 imagep->setBoostLevel(LLViewerImage::BOOST_UI);
613
614 // if rendering enabled, actually try to load this image
615 if (!gNoRender)
616 {
617 // First check the local image cache to see if it's there.
618 if (imagep->loadLocalImage(image_id))
619 {
620// llinfos << "Loading Local Image: " << image_id
621// << llformat(" MIP:%d IMM:%d",usemipmaps,level_immediate)
622// << llendl;
623 if( level_immediate )
624 {
625 if (imagep->needsDecode())
626 {
627 imagep->decodeImage(0.f); // getImage (local image)
628 }
629
630 if (imagep->getNeedsCreateTexture())
631 {
632 imagep->createTexture();
633 }
634 }
635 }
636 else
637 {
638 // if we don't have this locally, we'll want to start on the highest discard
639 if (!imagep->getDontDiscard())
640 {
641 imagep->setDesiredDiscardLevel(imagep->getMaxDiscardLevel());
642 }
643
644 imagep->startVFSLoad();
645 }
646 } 555 }
647 } 556 }
648 557
@@ -695,13 +604,6 @@ void LLViewerImageList::addImage(LLViewerImage *new_image)
695 } 604 }
696 sNumImages++; 605 sNumImages++;
697 606
698#if 0
699 // Add this image to the viewer image list.
700 if (new_image->getDecodePriority() == 0.0f)
701 {
702 new_image->setDecodePriority(MAX_IMAGE_PRIORITY); // Initially put in front of list
703 }
704#endif
705 addImageToList(new_image); 607 addImageToList(new_image);
706 mUUIDMap[image_id] = new_image; 608 mUUIDMap[image_id] = new_image;
707} 609}
@@ -721,35 +623,6 @@ void LLViewerImageList::deleteImage(LLViewerImage *image)
721 } 623 }
722} 624}
723 625
724
725
726
727///////////////////////////////////////////////////////////////////////////////
728
729void image_request_callback(void **data, S32 number)
730{
731 gImageList.handleIRCallback(data, number);
732}
733
734void LLViewerImageList::handleIRCallback(void **data, const S32 number)
735{
736 callback_data_t* requested_images = (callback_data_t*)data;
737 if (number == LL_ERR_TCP_TIMEOUT)
738 {
739 for (callback_data_t::iterator iter = requested_images->begin();
740 iter != requested_images->end();)
741 {
742 LLViewerImage* image = *iter++;
743 image->mRequested = FALSE;
744 image->mRequestedDiscardLevel = -1; // Indicates we need to re-request this
745 }
746 }
747
748 // Delete and remove from our list of callback data
749 delete requested_images;
750 llverify(mIRCallbackData.erase(requested_images) == 1);
751}
752
753/////////////////////////////////////////////////////////////////////////////// 626///////////////////////////////////////////////////////////////////////////////
754 627
755void LLViewerImageList::updateMovieImage(const LLUUID& uuid, BOOL active) 628void LLViewerImageList::updateMovieImage(const LLUUID& uuid, BOOL active)
@@ -785,7 +658,16 @@ void LLViewerImageList::updateMovieImage(const LLUUID& uuid, BOOL active)
785 } 658 }
786} 659}
787 660
788void LLViewerImageList::updateImages(const F32 decode_time_max) 661////////////////////////////////////////////////////////////////////////////
662
663void LLViewerImageList::dirtyImage(LLViewerImage *image)
664{
665 mDirtyTextureList.insert(image);
666}
667
668////////////////////////////////////////////////////////////////////////////
669
670void LLViewerImageList::updateImages(F32 max_time)
789{ 671{
790 sNumImagesStat.addValue(sNumImages); 672 sNumImagesStat.addValue(sNumImages);
791 sNumRawImagesStat.addValue(LLImageRaw::sRawImageCount); 673 sNumRawImagesStat.addValue(LLImageRaw::sRawImageCount);
@@ -795,28 +677,40 @@ void LLViewerImageList::updateImages(const F32 decode_time_max)
795 sFormattedMemStat.addValue(LLImageFormatted::sGlobalFormattedMemory/(1024.f*1024.f)); 677 sFormattedMemStat.addValue(LLImageFormatted::sGlobalFormattedMemory/(1024.f*1024.f));
796 678
797 updateImagesDecodePriorities(); 679 updateImagesDecodePriorities();
798 updateImagesSendRequests(); 680 max_time -= updateImagesFetchTextures(max_time);
799 681 max_time = llmax(max_time, 0.001f);
800 if (gGLManager.mIsDisabled) 682 max_time -= updateImagesCreateTextures(max_time);
683 max_time = llmax(max_time, 0.001f);
684
685 if (!mDirtyTextureList.empty())
801 { 686 {
802 // We don't want to run this part of the texture system while we don't have 687 LLFastTimer t(LLFastTimer::FTM_IMAGE_MARK_DIRTY);
803 // a GL context - we COULD probably do some of it, but that's tricky - djs 10/29/03 688 gPipeline.dirtyPoolObjectTextures(mDirtyTextureList);
804 return; 689 mDirtyTextureList.clear();
805 } 690 }
806 691
807 updateImagesDecodeTextures(decode_time_max); 692 for (image_list_t::iterator iter = mCallbackList.begin();
693 iter != mCallbackList.end(); )
694 {
695 LLViewerImage* image = *iter++;
696 // Do stuff to handle callbacks, update priorities, etc.
697 bool res = image->doLoadedCallbacks();
698 if (res)
699 {
700 break; // only actually do one callback per frame
701 }
702 }
703
808 updateImagesMediaStreams(); 704 updateImagesMediaStreams();
809 updateImagesPollVFS();
810 updateImagesUpdateStats(); 705 updateImagesUpdateStats();
811} 706}
812 707
813
814void LLViewerImageList::updateImagesDecodePriorities() 708void LLViewerImageList::updateImagesDecodePriorities()
815{ 709{
816 // Update the decode priority for N images each frame 710 // Update the decode priority for N images each frame
817 { 711 {
818 const size_t max_update_count = 256; 712 const size_t max_update_count = 256;
819 S32 update_counter = llmin(max_update_count, mUUIDMap.size()); 713 S32 update_counter = llmin(max_update_count, mUUIDMap.size()/10);
820 uuid_map_t::iterator iter = mUUIDMap.upper_bound(mLastUpdateUUID); 714 uuid_map_t::iterator iter = mUUIDMap.upper_bound(mLastUpdateUUID);
821 while(update_counter > 0) 715 while(update_counter > 0)
822 { 716 {
@@ -826,6 +720,33 @@ void LLViewerImageList::updateImagesDecodePriorities()
826 } 720 }
827 mLastUpdateUUID = iter->first; 721 mLastUpdateUUID = iter->first;
828 LLPointer<LLViewerImage> imagep = iter->second; 722 LLPointer<LLViewerImage> imagep = iter->second;
723 ++iter; // safe to incrament now
724
725 //
726 // Flush formatted images using a lazy flush
727 //
728 const F32 LAZY_FLUSH_TIMEOUT = 30.f;
729 S32 min_refs = 3; // 1 for mImageList, 1 for mUUIDMap, 1 for local reference
730 if (imagep->hasCallbacks())
731 {
732 min_refs++; // Add an extra reference if we're on the loaded callback list
733 }
734 S32 num_refs = imagep->getNumRefs();
735 if (num_refs == min_refs)
736 {
737 if (imagep->mLastReferencedTimer.getElapsedTimeF32() > LAZY_FLUSH_TIMEOUT)
738 {
739 // Remove the unused image from the image list
740 deleteImage(imagep);
741 imagep = NULL; // should destroy the image
742 continue;
743 }
744 }
745 else
746 {
747 imagep->mLastReferencedTimer.reset();
748 }
749
829 imagep->processTextureStats(); 750 imagep->processTextureStats();
830 F32 old_priority = imagep->getDecodePriority(); 751 F32 old_priority = imagep->getDecodePriority();
831 F32 decode_priority = imagep->calcDecodePriority(); 752 F32 decode_priority = imagep->calcDecodePriority();
@@ -836,12 +757,12 @@ void LLViewerImageList::updateImagesDecodePriorities()
836 imagep->setDecodePriority(decode_priority); 757 imagep->setDecodePriority(decode_priority);
837 addImageToList(imagep); 758 addImageToList(imagep);
838 } 759 }
839 iter++;
840 update_counter--; 760 update_counter--;
841 } 761 }
842 } 762 }
843} 763}
844 764
765/*
845static U8 get_image_type(LLViewerImage* imagep, LLHost target_host) 766static U8 get_image_type(LLViewerImage* imagep, LLHost target_host)
846{ 767{
847 // Having a target host implies this is a baked image. I don't 768 // Having a target host implies this is a baked image. I don't
@@ -866,478 +787,90 @@ static U8 get_image_type(LLViewerImage* imagep, LLHost target_host)
866 } 787 }
867 return type_from_host; 788 return type_from_host;
868} 789}
790*/
869 791
870void LLViewerImageList::updateImagesSendRequests() 792F32 LLViewerImageList::updateImagesCreateTextures(F32 max_time)
871{ 793{
872 // Send requests for images based on priority. 794 if (gNoRender || gGLManager.mIsDisabled) return 0.0f;
873 {
874 S32 request_count = 0;
875 S32 request_packets_sent = 0;
876 S32 update_count = 0;
877 795
878 callback_data_t *requested_images = NULL; 796 //
879 797 // Create GL textures for all textures that need them (images which have been
880 // Baked texture images may live on a separate host. JC 798 // decoded, but haven't been pushed into GL).
881 std::vector< LLPointer<LLViewerImage> > images_on_other_hosts; 799 //
882 LLHost agent_host = gAgent.getRegionHost(); 800 LLFastTimer t(LLFastTimer::FTM_IMAGE_CREATE);
883
884 for (image_list_t::iterator iter = mImageList.begin();
885 iter != mImageList.end(); )
886 {
887 image_list_t::iterator curiter = iter++;
888 LLPointer<LLViewerImage> imagep = *curiter;
889
890 if (imagep->mIsMediaTexture)
891 {
892 continue; // skip
893 }
894
895 F32 decode_priority = imagep->getDecodePriority();
896
897 update_count++;
898 if (mUpdateStats == FALSE &&
899 update_count >= IMAGES_MIN_UPDATES &&
900 decode_priority < MAX_IMAGE_PRIORITY)
901 {
902 break;
903 }
904
905 //
906 // Flush formatted images using a lazy flush
907 //
908 const F32 LAZY_FLUSH_TIMEOUT = 30.f;
909 S32 min_refs = 3; // 1 for mImageList, 1 for mUUIDMap, 1 for local reference
910 if (imagep->hasCallbacks())
911 {
912 min_refs++; // Add an extra reference if we're on the loaded callback list
913 }
914 S32 num_refs = imagep->getNumRefs();
915 if (num_refs == min_refs)
916 {
917 if (!(imagep->isDecoding()))
918 {
919 if (imagep->mLastReferencedTimer.getElapsedTimeF32() > LAZY_FLUSH_TIMEOUT)
920 {
921 if (imagep->mStreamFile && !imagep->mStreamFile->isReadComplete())
922 {
923 llwarns << "Stream file is still reading data, delaying flush!" << llendl;
924 }
925 else
926 {
927 // Remove the unused image from the image list
928 deleteImage(imagep);
929 imagep = NULL; // should destroy the image
930 continue;
931 }
932 }
933 }
934 }
935 else
936 {
937 imagep->mLastReferencedTimer.reset();
938 }
939
940 if (decode_priority <= 0)
941 {
942 continue;
943 }
944 if (imagep->isMissingAsset())
945 {
946 continue;
947 }
948 if (imagep->checkPacketData())
949 {
950 // New packets have been processed, re-evaluate next time
951 continue;
952 }
953 if (request_packets_sent >= IMAGES_MAX_PACKET_UPDATES)
954 {
955 continue;
956 }
957 if (!gAgent.getRegion())
958 {
959 //llinfos << "Skipping request for " << imagep->getID() << " while waiting for a region" << llendl;
960 continue;
961 }
962
963 F32 old_priority = imagep->mRequestedDownloadPriority;
964 S32 current_discard = imagep->getDiscardLevel();
965 S32 desired_discard = imagep->getDesiredDiscardLevel();
966
967 if (current_discard >= 0 && current_discard <= desired_discard)
968 {
969 continue;
970 }
971
972 if (imagep->mRequestTime.getElapsedTimeF32() <= RESEND_IMAGE_REQUEST_TIME)
973 {
974 // Ignore < 20% difference, or no change in requested discard level
975 if ((decode_priority > old_priority * .8f && decode_priority < old_priority * 1.25f) &&
976 (desired_discard == imagep->mRequestedDiscardLevel))
977 {
978 continue;
979 }
980 }
981
982 // Send the request
983 {
984 // Baked avatar textures may live on other hosts. JC
985 LLHost target_host = imagep->getTargetHost();
986
987 // This file is in the static VFS, we don't ever need to request it from the network.
988 if (imagep->mInStaticVFS && imagep->mFormattedFlushed)
989 {
990 // Unneeded? JC 8/2006
991 imagep->mRequestedDiscardLevel = desired_discard;
992 imagep->mRequestedDownloadPriority = decode_priority;
993
994 // It's in the static VFS but not loaded, just load it from disk instead of sending a request.
995 imagep->startVFSLoad();
996 }
997 else if (target_host.isOk() && target_host != agent_host)
998 {
999 // This is a special texture to request off a sim other than
1000 // the one the agent is on. We'll deal with it later.
1001 images_on_other_hosts.push_back(imagep);
1002 }
1003 else
1004 {
1005 imagep->mRequestedDiscardLevel = desired_discard;
1006 imagep->mRequestedDownloadPriority = decode_priority;
1007
1008 if (0 == request_count)
1009 {
1010 // Create a message if this is the first image request.
1011 gMessageSystem->newMessageFast(_PREHASH_RequestImage);
1012 gMessageSystem->nextBlockFast(_PREHASH_AgentData);
1013 gMessageSystem->addUUIDFast(
1014 _PREHASH_AgentID, gAgent.getID());
1015 gMessageSystem->addUUIDFast(
1016 _PREHASH_SessionID, gAgent.getSessionID());
1017 requested_images = new callback_data_t;
1018 // verify that requested_images is placed uniquely in the list
1019 llverify((mIRCallbackData.insert(requested_images)).second);
1020 }
1021
1022 requested_images->push_back(imagep);
1023 request_count++;
1024
1025 gMessageSystem->nextBlockFast(_PREHASH_RequestImage);
1026 S32 packet = imagep->getLastPacket() + 1;
1027 gMessageSystem->addUUIDFast(_PREHASH_Image, imagep->getID());
1028 gMessageSystem->addS8Fast(_PREHASH_DiscardLevel, (S8)desired_discard);
1029 gMessageSystem->addF32Fast(_PREHASH_DownloadPriority, decode_priority);
1030 gMessageSystem->addU32Fast(_PREHASH_Packet, packet);
1031 U8 type = get_image_type(imagep, target_host);
1032 gMessageSystem->addU8Fast(_PREHASH_Type, type);
1033
1034 lldebugst(LLERR_IMAGE)
1035 << "IMAGE REQUEST: " << imagep->getID().getString()
1036 << " discard: " << desired_discard
1037 << " old_pri: " << old_priority
1038 << " dld_pri: " << decode_priority
1039 << " dec_pri: " << imagep->getDecodePriority()
1040 << llendl;
1041
1042 }
1043
1044 imagep->mRequested = TRUE;
1045 imagep->mRequestTime.reset();
1046
1047 if (request_count >= IMAGES_PER_REQUEST)
1048 {
1049 // IMAGES_PER_REQUEST packets combined, send packet.
1050 gMessageSystem->sendSemiReliable(gAgent.getRegion()->getHost(), image_request_callback, (void **)requested_images);
1051 801
1052 requested_images = NULL; 802 LLTimer create_timer;
1053 request_count = 0; 803 image_list_t::iterator enditer = mCreateTextureList.begin();
1054 ++request_packets_sent; 804 for (image_list_t::iterator iter = mCreateTextureList.begin();
1055 } 805 iter != mCreateTextureList.end();)
1056 } 806 {
1057 } 807 image_list_t::iterator curiter = iter++;
1058 808 enditer = iter;
1059 if (request_count != 0) 809 LLViewerImage *imagep = *curiter;
1060 { 810 imagep->createTexture();
1061 // fill in the unused requested_images w/ NULL 811 if (create_timer.getElapsedTimeF32() > max_time)
1062 gMessageSystem->sendSemiReliable(gAgent.getRegion()->getHost(), image_request_callback, (void **)requested_images);
1063 requested_images = NULL;
1064 ++request_packets_sent;
1065 }
1066
1067 // We might have picked up some images on other hosts.
1068 if (!images_on_other_hosts.empty())
1069 { 812 {
1070 // llinfos << "TAT: images_on_other_hosts " << images_on_other_hosts.size() << llendl; 813 break;
1071
1072 std::sort(images_on_other_hosts.begin(), images_on_other_hosts.end(), LLViewerImage::CompareByHostAndPriority());
1073
1074 LLMessageSystem* msg = gMessageSystem;
1075 LLHost current_host = images_on_other_hosts[0]->getTargetHost();
1076 request_count = 0;
1077
1078 for (std::vector<LLPointer<LLViewerImage> >::iterator it = images_on_other_hosts.begin();
1079 it != images_on_other_hosts.end();
1080 ++it)
1081 {
1082 LLPointer<LLViewerImage> imagep = *it;
1083
1084 F32 decode_priority = imagep->getDecodePriority();
1085 S32 desired_discard = imagep->getDesiredDiscardLevel();
1086
1087 imagep->mRequestedDiscardLevel = desired_discard;
1088 imagep->mRequestedDownloadPriority = decode_priority;
1089
1090 if ((current_host != imagep->getTargetHost() || request_count >= IMAGES_PER_REQUEST) && request_count)
1091 {
1092 // llinfos << "TAT: Sending " << request_count << " image requests for host: " << current_host << llendl;
1093
1094 // Need to flush to current host.
1095 gMessageSystem->sendSemiReliable(current_host, image_request_callback, (void **)requested_images);
1096
1097 requested_images = NULL;
1098 current_host = imagep->getTargetHost();
1099 request_count = 0;
1100 }
1101
1102 if (request_count == 0)
1103 {
1104 // Start a packet and build a new callback list for dropped
1105 // packet handler.
1106 msg->newMessageFast(_PREHASH_RequestImage);
1107 msg->nextBlockFast(_PREHASH_AgentData);
1108 msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
1109 msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
1110 requested_images = new callback_data_t;
1111 mIRCallbackData.insert(requested_images);
1112 current_host = imagep->getTargetHost();
1113 }
1114
1115 requested_images->push_back(imagep);
1116 request_count++;
1117
1118 msg->nextBlockFast(_PREHASH_RequestImage);
1119 S32 packet = imagep->getLastPacket() + 1;
1120 msg->addUUIDFast(_PREHASH_Image, imagep->getID());
1121 msg->addS8Fast(_PREHASH_DiscardLevel, (S8)desired_discard);
1122 msg->addF32Fast(_PREHASH_DownloadPriority, decode_priority);
1123 msg->addU32Fast(_PREHASH_Packet, packet);
1124 U8 type = get_image_type(imagep, current_host);
1125 gMessageSystem->addU8Fast(_PREHASH_Type, type);
1126
1127 if (!gMessageSystem->checkCircuitAlive(current_host))
1128 {
1129 llinfos << "TAT: Image request for dead circuit " << current_host << ", " << imagep->getID() << llendl;
1130 imagep->setTargetHost(agent_host);
1131 }
1132
1133 if (!gMessageSystem->checkCircuitAlive(current_host))
1134 {
1135 llinfos << "TAT: Image request for dead circuit " << current_host << ", " << imagep->getID() << llendl;
1136 imagep->setTargetHost(agent_host);
1137 }
1138
1139 imagep->mRequested = TRUE;
1140 imagep->mRequestTime.reset();
1141 }
1142
1143 if (request_count != 0)
1144 {
1145 // fill in the unused requested_images w/ NULL
1146 msg->sendSemiReliable(current_host, image_request_callback, (void **)requested_images);
1147 requested_images = NULL;
1148 }
1149 } 814 }
1150 } 815 }
816 mCreateTextureList.erase(mCreateTextureList.begin(), enditer);
817 return create_timer.getElapsedTimeF32();
1151} 818}
1152 819
1153 820F32 LLViewerImageList::updateImagesFetchTextures(F32 max_time)
1154
1155void LLViewerImageList::updateImagesDecodeTextures(F32 decode_time_max)
1156{ 821{
1157 if (gNoRender) return; 822 LLTimer image_op_timer;
1158 823
1159 LLTimer image_op_timer; 824 // Update the decode priority for N images each frame
1160 825 // Make a list with 32 high priority entries + 256 cycled entries
1161 BOOL done_one = FALSE; 826 const size_t max_priority_count = 32;
1162 image_op_timer.reset(); 827 const size_t max_update_count = 256;
1163 828
1164 S32 create_count = 0; 829 // 32 high priority entries
1165 830 std::set<LLViewerImage*> entries;
1166 // added by IW to help track down a bug 831 size_t update_counter = llmin(max_priority_count, mImageList.size());
1167 stop_glerror(); 832 image_priority_list_t::iterator iter1 = mImageList.begin();
1168 833 while(update_counter > 0)
1169 // 834 {
1170 // Create GL textures for all textures that need them (images which have been 835 entries.insert(*iter1);
1171 // decoded, but haven't been pushed into GL). 836 ++iter1;
1172 // 837 update_counter--;
1173 { 838 }
1174 LLFastTimer t(LLFastTimer::FTM_IMAGE_CREATE); 839
1175 840 // 256 cycled entries
1176 for (image_list_t::iterator iter = mImageList.begin(); 841 update_counter = llmin(max_update_count, mUUIDMap.size());
1177 iter != mImageList.end(); ) 842 uuid_map_t::iterator iter2 = mUUIDMap.upper_bound(mLastFetchUUID);
1178 { 843 while(update_counter > 0)
1179 LLPointer<LLViewerImage> imagep = *iter++; 844 {
1180 if (imagep->getNeedsCreateTexture()) 845 if (iter2 == mUUIDMap.end())
1181 {
1182 create_count++;
1183 imagep->createTexture();
1184 if (decode_time_max != 0.f)
1185 {
1186 if (image_op_timer.getElapsedTimeF32() > decode_time_max)
1187 {
1188 lldebugst(LLERR_IMAGE) << "Broke out of create texture!" << llendl;
1189 break;
1190 }
1191 }
1192 }
1193 }
1194 }
1195
1196 //
1197 // Work on decoding any image that's partially decoded, first
1198 //
1199 // Everything after here is time-sliced
1200 //
1201
1202 if (mCurrentDecodeImagep.notNull()
1203 && mCurrentDecodeImagep->needsDecode()
1204 && mCurrentDecodeImagep->isDecoding())
1205 {
1206 //llinfos << "Continue decoding " << mCurrentDecodeImagep->getID() << llendl;
1207 LLFastTimer t(LLFastTimer::FTM_IMAGE_DECODE);
1208 if (decode_time_max != 0.f)
1209 {
1210 if (done_one && image_op_timer.getElapsedTimeF32() >= decode_time_max)
1211 {
1212 lldebugst(LLERR_IMAGE) << "Broke out of partial decode!" << llendl;
1213 }
1214 else
1215 {
1216 F32 decode_time = decode_time_max - image_op_timer.getElapsedTimeF32();
1217 decode_time = llmax(decode_time, .0001f); // min .1 ms
1218 mCurrentDecodeImagep->decodeImage(decode_time); // Partial decode
1219 done_one = TRUE;
1220 }
1221 }
1222 else
1223 {
1224 mCurrentDecodeImagep->decodeImage(0.0f); // Partial decode
1225 done_one = TRUE;
1226 }
1227 }
1228
1229 //
1230 // Reprioritize any image that we just finished decoding
1231 //
1232 if (mCurrentDecodeImagep.notNull()
1233 && (!mCurrentDecodeImagep->needsDecode()
1234 || !mCurrentDecodeImagep->isDecoding()))
1235 { 846 {
1236 // Reprioritize this image 847 iter2 = mUUIDMap.begin();
1237 if (mCurrentDecodeImagep->mInImageList)
1238 {
1239 removeImageFromList(mCurrentDecodeImagep);
1240 mCurrentDecodeImagep->setDecodePriority();
1241 addImageToList(mCurrentDecodeImagep);
1242 }
1243 mCurrentDecodeImagep = NULL;
1244 } 848 }
849 mLastFetchUUID = iter2->first;
850 entries.insert(iter2->second);
851 ++iter2;
852 update_counter--;
853 }
1245 854
1246 // 855 S32 min_count = max_priority_count + max_update_count/4;
1247 // At this point, we're going to check out the status of anything that's 856 for (std::set<LLViewerImage*>::iterator iter3 = entries.begin();
1248 // on our callback list. Instead of calling the callback lists from a 857 iter3 != entries.end(); )
1249 // billion different places, we're ONLY going to handle them here. 858 {
1250 // 859 LLPointer<LLViewerImage> imagep = *iter3++;
1251 // Do this here so if the callbacks take a lot of time, it counts
1252 // against our decode timer totals
1253
1254 // For right now, just be really lame and just iterate through all images.
1255 // This WILL be optimized soon.
1256
1257 if (mUpdateStats)
1258 {
1259 // This is somewhat intensive, and it doesn't need to happen
1260 // immediately, so only do it when we update stats.
1261 for (image_callback_list_t::iterator iter = mCallbackList.begin();
1262 iter != mCallbackList.end(); )
1263 {
1264 LLViewerImage* image = *iter++;
1265 // Do stuff to handle callbacks, update priorities, etc.
1266 image->doLoadedCallbacks();
1267 }
1268 }
1269 860
1270 // 861 imagep->updateFetch();
1271 // Decode as many images as we can at this point. 862 if (min_count <= 0 && image_op_timer.getElapsedTimeF32() > max_time)
1272 // If we're in the middle of finishing up one still,
1273 // don't decode any more textures
1274 //
1275 if (mCurrentDecodeImagep.isNull() || mCurrentDecodeImagep->getBoostLevel())
1276 { 863 {
1277 LLFastTimer t(LLFastTimer::FTM_IMAGE_DECODE); 864 break;
1278 do
1279 {
1280 BOOL did_decode = FALSE;
1281 BOOL have_map_image = FALSE;
1282 for (image_list_t::iterator iter = mImageList.begin();
1283 iter != mImageList.end(); )
1284 {
1285 image_list_t::iterator curiter = iter++;
1286 LLPointer<LLViewerImage> imagep = *curiter;
1287 if (imagep->needsDecode())
1288 {
1289 if (decode_time_max != 0.f)
1290 {
1291 if (!imagep->getBoostLevel() && done_one &&
1292 image_op_timer.getElapsedTimeF32() >= decode_time_max)
1293 {
1294 break;
1295 }
1296 F32 decode_time = decode_time_max - image_op_timer.getElapsedTimeF32();
1297 decode_time = llmax(decode_time, .0001f); // min .1 ms
1298 imagep->decodeImage(decode_time);
1299 }
1300 else
1301 {
1302 imagep->decodeImage(0.0f);
1303 }
1304
1305 if (imagep->needsDecode())
1306 {
1307 mCurrentDecodeImagep = imagep;
1308 }
1309 else
1310 {
1311 // Reprioritize this image
1312 removeImageFromList(imagep);
1313 imagep->setDecodePriority();
1314 addImageToList(imagep);
1315
1316 mCurrentDecodeImagep = NULL;
1317 }
1318 done_one = TRUE;
1319 did_decode = TRUE;
1320 }
1321 if (imagep->getBoostLevel() >= LLViewerImage::BOOST_MAP)
1322 {
1323 have_map_image = TRUE;
1324 }
1325 else if (have_map_image)
1326 {
1327 break; // skip other images if we are decoding map images
1328 }
1329 }
1330 if (!did_decode)
1331 {
1332 break;
1333 }
1334 } while (image_op_timer.getElapsedTimeF32() < decode_time_max);
1335 } 865 }
866 min_count--;
867 }
868 return image_op_timer.getElapsedTimeF32();
1336} 869}
1337 870
1338void LLViewerImageList::updateImagesMediaStreams() 871void LLViewerImageList::updateImagesMediaStreams()
1339{ 872{
1340 if (gNoRender) return; 873 if (gNoRender || gGLManager.mIsDisabled) return;
1341 874
1342 // update media stream if required 875 // update media stream if required
1343 LLMediaEngine* media_engine = LLMediaEngine::getInstance(); 876 LLMediaEngine* media_engine = LLMediaEngine::getInstance();
@@ -1358,8 +891,6 @@ void LLViewerImageList::updateImagesMediaStreams()
1358 (renderer->getTextureDepth() != viewerImage->getComponents()) || 891 (renderer->getTextureDepth() != viewerImage->getComponents()) ||
1359 (viewerImage->getHasGLTexture() == FALSE)) 892 (viewerImage->getHasGLTexture() == FALSE))
1360 { 893 {
1361 llassert(!viewerImage->getUseMipMaps());
1362
1363 // destroy existing GL image 894 // destroy existing GL image
1364 viewerImage->destroyGLTexture(); 895 viewerImage->destroyGLTexture();
1365 896
@@ -1380,14 +911,15 @@ void LLViewerImageList::updateImagesMediaStreams()
1380 renderer->getTextureFormatPrimary(), 911 renderer->getTextureFormatPrimary(),
1381 renderer->getTextureFormatType(), 912 renderer->getTextureFormatType(),
1382 renderer->getTextureFormatSwapBytes()); 913 renderer->getTextureFormatSwapBytes());
914 // This should be redundant, but just in case:
915 viewerImage->setUseMipMaps(FALSE);
1383 916
1384 LLImageRaw* rawImage = media_engine->getImageRaw(); 917 LLImageRaw* rawImage = media_engine->getImageRaw();
1385
1386 if ( rawImage ) 918 if ( rawImage )
1387 { 919 {
1388 ((LLImageGL*)viewerImage)->setSubImage(rawImage, 0, 0, 920 viewerImage->setSubImage(rawImage, 0, 0,
1389 renderer->getMediaWidth(), 921 renderer->getMediaWidth(),
1390 renderer->getMediaHeight()); 922 renderer->getMediaHeight());
1391 } 923 }
1392 } 924 }
1393 else 925 else
@@ -1404,89 +936,76 @@ void LLViewerImageList::updateImagesMediaStreams()
1404 } 936 }
1405} 937}
1406 938
1407void LLViewerImageList::updateImagesPollVFS()
1408{
1409 // Sigh, VFS stuff has to be polled. The VFS really needs some sort
1410 // of mechanism to avoid this issue.
1411 for (image_loading_list_t::iterator iter = mLoadingStreamList.begin();
1412 iter != mLoadingStreamList.end();)
1413 {
1414 image_loading_list_t::iterator curiter = iter++;
1415 LLViewerImage *imagep = *curiter;
1416 imagep->loadStreamFile();
1417 if (!imagep->mStreamFile)
1418 {
1419 iter = mLoadingStreamList.erase(curiter);
1420 }
1421 }
1422}
1423
1424void LLViewerImageList::updateImagesUpdateStats() 939void LLViewerImageList::updateImagesUpdateStats()
1425{ 940{
1426 if (mUpdateStats) 941 if (mUpdateStats)
1427 { 942 {
1428 for (image_list_t::iterator iter = mImageList.begin(); 943 for (image_priority_list_t::iterator iter = mImageList.begin();
1429 iter != mImageList.end(); ) 944 iter != mImageList.end(); )
1430 { 945 {
1431 LLViewerImage* imagep = *iter++; 946 LLViewerImage* imagep = *iter++;
1432 imagep->resetTextureStats(mForceResetTextureStats); 947 imagep->resetTextureStats(mForceResetTextureStats);
1433 } 948 }
1434#if 0
1435 S32 needs_decode_count = 0;
1436 for (image_list_t::iterator iter = mImageList.begin();
1437 iter != mImageList.end(); )
1438 {
1439 LLViewerImage* imagep = *iter++;
1440 // count priority images in need of decode (10000 ~= 100x100 pixels)
1441 if (imagep->getDecodePriority() > 10000.f && (imagep->needsDecode() || imagep->getNeedsCreateTexture()))
1442 {
1443 needs_decode_count++;
1444 }
1445 }
1446
1447 // If we have a lot of priority decodes pending, take some time to decode them
1448 const S32 force_decode_count = 20;
1449 const F32 force_decode_time = 2.f; // seconds
1450 const F32 force_decode_delay = 30.f; // seconds
1451 if (needs_decode_count > force_decode_count && mForceDecodeTimer.hasExpired())
1452 {
1453 decodeAllImages(force_decode_time); // spend some time decoding images
1454 mForceDecodeTimer.setTimerExpirySec(force_decode_delay); // wait 10 seconds
1455 }
1456#endif
1457 mUpdateStats = FALSE; 949 mUpdateStats = FALSE;
1458 mForceResetTextureStats = FALSE; 950 mForceResetTextureStats = FALSE;
1459 } 951 }
1460} 952}
1461 953
1462void LLViewerImageList::decodeAllImages(F32 max_decode_time) 954void LLViewerImageList::decodeAllImages(F32 max_time)
1463{ 955{
1464 LLTimer timer; 956 LLTimer timer;
1465 if(!gNoRender) 957 if(!gNoRender)
1466 { 958 {
1467 for (image_list_t::iterator iter = mImageList.begin(); 959 // Update texture stats and priorities
960 std::vector<LLPointer<LLViewerImage> > image_list;
961 for (image_priority_list_t::iterator iter = mImageList.begin();
1468 iter != mImageList.end(); ) 962 iter != mImageList.end(); )
1469 { 963 {
1470 LLViewerImage* imagep = *iter++; 964 LLViewerImage* imagep = *iter++;
1471 if (imagep->needsDecode()) 965 image_list.push_back(imagep);
1472 { 966 imagep->mInImageList = FALSE;
1473 imagep->decodeImage(0.f); // LLViewerImageList::decodeAllImages 967 }
1474 } 968 mImageList.clear();
1475 if (max_decode_time > 0.0f && timer.getElapsedTimeF32() > max_decode_time) 969 for (std::vector<LLPointer<LLViewerImage> >::iterator iter = image_list.begin();
970 iter != image_list.end(); ++iter)
971 {
972 LLViewerImage* imagep = *iter;
973 imagep->processTextureStats();
974 F32 decode_priority = imagep->calcDecodePriority();
975 imagep->setDecodePriority(decode_priority);
976 mImageList.insert(imagep);
977 imagep->mInImageList = TRUE;
978 }
979 image_list.clear();
980
981 // Update fetch (decode)
982 for (image_priority_list_t::iterator iter = mImageList.begin();
983 iter != mImageList.end(); )
984 {
985 LLViewerImage* imagep = *iter++;
986 imagep->updateFetch();
987 }
988 // Run threads
989 while (1)
990 {
991 gTextureCache->update(1); // unpauses the texture cache thread
992 gImageDecodeThread->update(1); // unpauses the image thread
993 S32 fetch_pending = gTextureFetch->update(1); // unpauses the texture fetch thread
994 if (fetch_pending == 0 || timer.getElapsedTimeF32() > max_time)
1476 { 995 {
1477 break; 996 break;
1478 } 997 }
1479 } 998 }
1480 999 // Update fetch again
1481 for (image_list_t::iterator iter = mImageList.begin(); 1000 for (image_priority_list_t::iterator iter = mImageList.begin();
1482 iter != mImageList.end(); ) 1001 iter != mImageList.end(); )
1483 { 1002 {
1484 LLViewerImage* imagep = *iter++; 1003 LLViewerImage* imagep = *iter++;
1485 if (imagep->getNeedsCreateTexture()) 1004 imagep->updateFetch();
1486 {
1487 imagep->createTexture();
1488 }
1489 } 1005 }
1006 max_time -= timer.getElapsedTimeF32();
1007 max_time = llmax(max_time, .01f);
1008 updateImagesCreateTextures(max_time);
1490 } 1009 }
1491 if (timer.getElapsedTimeF32() > .5f) // seconds 1010 if (timer.getElapsedTimeF32() > .5f) // seconds
1492 { 1011 {
@@ -1560,12 +1079,8 @@ BOOL LLViewerImageList::createUploadFile(const LLString& filename,
1560 return FALSE; 1079 return FALSE;
1561 } 1080 }
1562 1081
1563 raw_image->biasedScaleToPowerOfTwo(LLViewerImage::MAX_IMAGE_SIZE_DEFAULT); 1082 LLPointer<LLImageJ2C> compressedImage = convertToUploadFile(raw_image);
1564
1565 LLPointer<LLImageJ2C> compressedImage = new LLImageJ2C;
1566 1083
1567 compressedImage->setRate(0.f);
1568 compressedImage->encode(raw_image);
1569 if( !compressedImage->save(out_filename) ) 1084 if( !compressedImage->save(out_filename) )
1570 { 1085 {
1571 llinfos << "Couldn't create output file " << out_filename << llendl; 1086 llinfos << "Couldn't create output file " << out_filename << llendl;
@@ -1583,6 +1098,17 @@ BOOL LLViewerImageList::createUploadFile(const LLString& filename,
1583 return TRUE; 1098 return TRUE;
1584} 1099}
1585 1100
1101// note: modifies the argument raw_image!!!!
1102LLPointer<LLImageJ2C> LLViewerImageList::convertToUploadFile(LLPointer<LLImageRaw> raw_image)
1103{
1104 raw_image->biasedScaleToPowerOfTwo(LLViewerImage::MAX_IMAGE_SIZE_DEFAULT);
1105 LLPointer<LLImageJ2C> compressedImage = new LLImageJ2C();
1106 compressedImage->setRate(0.f);
1107 compressedImage->encode(raw_image);
1108
1109 return compressedImage;
1110}
1111
1586//static 1112//static
1587S32 LLViewerImageList::getMaxVideoRamSetting(S32 max) 1113S32 LLViewerImageList::getMaxVideoRamSetting(S32 max)
1588{ 1114{
@@ -1606,7 +1132,7 @@ S32 LLViewerImageList::getMaxVideoRamSetting(S32 max)
1606 llwarns << "VRAM amount not detected, defaulting to " << max_vram/(double)(1<<20) << " MB" << llendl; 1132 llwarns << "VRAM amount not detected, defaulting to " << max_vram/(double)(1<<20) << " MB" << llendl;
1607 } 1133 }
1608 U32 system_ram = gSysMemory.getPhysicalMemory(); 1134 U32 system_ram = gSysMemory.getPhysicalMemory();
1609 llinfos << "*** DETECTED " << system_ram/(double)(1<<20) << " MB of system memory." << llendl; // TomY TESTING DNCI 1135 //llinfos << "*** DETECTED " << system_ram/(double)(1<<20) << " MB of system memory." << llendl; // TomY TESTING DNCI
1610 if (max == -2) 1136 if (max == -2)
1611 { 1137 {
1612 max_vram = llmin(max_vram, (U32)(system_ram/2)); // max recommended setting 1138 max_vram = llmin(max_vram, (U32)(system_ram/2)); // max recommended setting
@@ -1629,6 +1155,16 @@ S32 LLViewerImageList::getMaxVideoRamSetting(S32 max)
1629 return idx; 1155 return idx;
1630} 1156}
1631 1157
1158const S32 VIDEO_CARD_MEM_SIZES[6] = { 0x1000000, // 16MB
1159 0x2000000, // 32MB
1160 0x4000000, // 64MB
1161 0x8000000, // 128MB
1162 0x10000000, // 256MB
1163 0x20000000, // 512MB
1164 };
1165
1166const S32 VIDEO_CARD_FRAMEBUFFER_MEM = 0xC00000; // 12MB
1167
1632void LLViewerImageList::updateMaxResidentTexMem(S32 max, U32 fudge) 1168void LLViewerImageList::updateMaxResidentTexMem(S32 max, U32 fudge)
1633{ 1169{
1634 // Initialize the image pipeline VRAM settings 1170 // Initialize the image pipeline VRAM settings
@@ -1651,15 +1187,127 @@ void LLViewerImageList::updateMaxResidentTexMem(S32 max, U32 fudge)
1651 } 1187 }
1652 mVideoMemorySetting = cur_setting; 1188 mVideoMemorySetting = cur_setting;
1653 // TODO: set available resident texture mem based on use by other subsystems 1189 // TODO: set available resident texture mem based on use by other subsystems
1654 // currently 12MB assumed... 1190 // currently max(12MB, VRAM/4) assumed...
1191
1192 S32 vram_amt = VIDEO_CARD_MEM_SIZES[cur_setting];
1193 S32 fb_mem = llmax(VIDEO_CARD_FRAMEBUFFER_MEM, vram_amt/4);
1194 mMaxResidentTexMem = vram_amt - fb_mem - fudge;
1655 1195
1656 mMaxResidentTexMem = VIDEO_CARD_MEM_SIZES[cur_setting] - 0xC00000 - fudge; // - 12MB 1196// llinfos << "Graphics Card memory set to " << (VIDEO_CARD_MEM_SIZES[cur_setting]>>20)
1657 mMaxResidentTexMem -= mMaxResidentTexMem/8; 1197// << " MB" << llendl;
1198}
1199
1200///////////////////////////////////////////////////////////////////////////////
1201
1202// static
1203void LLViewerImageList::receiveImageHeader(LLMessageSystem *msg, void **user_data)
1204{
1205 LLFastTimer t(LLFastTimer::FTM_PROCESS_IMAGES);
1206
1207 // Receive image header, copy into image object and decompresses
1208 // if this is a one-packet image.
1209
1210 LLUUID id;
1211
1212 char ip_string[256];
1213 u32_to_ip_string(msg->getSenderIP(),ip_string);
1214
1215 if (msg->getReceiveCompressedSize())
1216 {
1217 gImageList.sTextureBits += msg->getReceiveCompressedSize() * 8;
1218 }
1219 else
1220 {
1221 gImageList.sTextureBits += msg->getReceiveSize() * 8;
1222 }
1223 gImageList.sTexturePackets++;
1224
1225 U8 codec;
1226 U16 packets;
1227 U32 totalbytes;
1228 msg->getUUIDFast(_PREHASH_ImageID, _PREHASH_ID, id);
1229 msg->getU8Fast(_PREHASH_ImageID, _PREHASH_Codec, codec);
1230 msg->getU16Fast(_PREHASH_ImageID, _PREHASH_Packets, packets);
1231 msg->getU32Fast(_PREHASH_ImageID, _PREHASH_Size, totalbytes);
1232
1233 U16 data_size = msg->getSizeFast(_PREHASH_ImageData, _PREHASH_Data);
1234 if (!data_size)
1235 {
1236 return;
1237 }
1658 1238
1659 llinfos << "Graphics Card memory set to " << (VIDEO_CARD_MEM_SIZES[cur_setting]>>20) 1239 // this buffer gets saved off in the packet list
1660 << " MB" << llendl; 1240 U8 *data = new U8[data_size];
1241 msg->getBinaryDataFast(_PREHASH_ImageData, _PREHASH_Data, data, data_size);
1242
1243 LLViewerImage *image = gImageList.getImage(id);
1244 if (!image)
1245 {
1246 return;
1247 }
1248 image->mLastPacketTimer.reset();
1249 bool res = gTextureFetch->receiveImageHeader(msg->getSender(), id, codec, packets, totalbytes, data_size, data);
1250 if (!res)
1251 {
1252 delete[] data;
1253 }
1661} 1254}
1662 1255
1256// static
1257void LLViewerImageList::receiveImagePacket(LLMessageSystem *msg, void **user_data)
1258{
1259 LLMemType mt1(LLMemType::MTYPE_APPFMTIMAGE);
1260 LLFastTimer t(LLFastTimer::FTM_PROCESS_IMAGES);
1261
1262 // Receives image packet, copy into image object,
1263 // checks if all packets received, decompresses if so.
1264
1265 LLUUID id;
1266 U16 packet_num;
1267
1268 char ip_string[256];
1269 u32_to_ip_string(msg->getSenderIP(),ip_string);
1270
1271 if (msg->getReceiveCompressedSize())
1272 {
1273 gImageList.sTextureBits += msg->getReceiveCompressedSize() * 8;
1274 }
1275 else
1276 {
1277 gImageList.sTextureBits += msg->getReceiveSize() * 8;
1278 }
1279 gImageList.sTexturePackets++;
1280
1281 //llprintline("Start decode, image header...");
1282 msg->getUUIDFast(_PREHASH_ImageID, _PREHASH_ID, id);
1283 msg->getU16Fast(_PREHASH_ImageID, _PREHASH_Packet, packet_num);
1284 U16 data_size = msg->getSizeFast(_PREHASH_ImageData, _PREHASH_Data);
1285
1286 if (!data_size)
1287 {
1288 return;
1289 }
1290 if (data_size > MTUBYTES)
1291 {
1292 llerrs << "image data chunk too large: " << data_size << " bytes" << llendl;
1293 }
1294 U8 *data = new U8[data_size];
1295 msg->getBinaryDataFast(_PREHASH_ImageData, _PREHASH_Data, data, data_size);
1296
1297 LLViewerImage *image = gImageList.getImage(id);
1298 if (!image)
1299 {
1300 return;
1301 }
1302 image->mLastPacketTimer.reset();
1303 bool res = gTextureFetch->receiveImagePacket(msg->getSender(), id, packet_num, data_size, data);
1304 if (!res)
1305 {
1306 delete[] data;
1307 }
1308}
1309
1310
1663// We've been that the asset server does not contain the requested image id. 1311// We've been that the asset server does not contain the requested image id.
1664// static 1312// static
1665void LLViewerImageList::processImageNotInDatabase(LLMessageSystem *msg,void **user_data) 1313void LLViewerImageList::processImageNotInDatabase(LLMessageSystem *msg,void **user_data)
@@ -1671,6 +1319,26 @@ void LLViewerImageList::processImageNotInDatabase(LLMessageSystem *msg,void **us
1671 LLViewerImage* image = gImageList.hasImage( image_id ); 1319 LLViewerImage* image = gImageList.hasImage( image_id );
1672 if( image ) 1320 if( image )
1673 { 1321 {
1674 image->setIsMissingAsset( TRUE ); 1322 image->setIsMissingAsset();
1675 } 1323 }
1676} 1324}
1325
1326///////////////////////////////////////////////////////////////////////////////
1327
1328//static
1329const U32 SIXTEEN_MEG = 0x1000000;
1330S32 LLViewerImageList::calcMaxTextureRAM()
1331{
1332 // Decide the maximum amount of RAM we should allow the user to allocate to texture cache
1333 LLMemoryInfo memory_info;
1334 U32 available_memory = memory_info.getPhysicalMemory();
1335
1336 clamp_rescale((F32)available_memory,
1337 (F32)(SIXTEEN_MEG * 16),
1338 (F32)U32_MAX,
1339 (F32)(SIXTEEN_MEG * 4),
1340 (F32)(U32_MAX >> 1));
1341 return available_memory;
1342}
1343
1344///////////////////////////////////////////////////////////////////////////////
diff --git a/linden/indra/newview/llviewerimagelist.h b/linden/indra/newview/llviewerimagelist.h
index 68cfcaf..3f3e521 100644
--- a/linden/indra/newview/llviewerimagelist.h
+++ b/linden/indra/newview/llviewerimagelist.h
@@ -58,12 +58,17 @@ typedef void (*LLImageCallback)(BOOL success,
58 58
59class LLViewerImageList : public LLImageProviderInterface 59class LLViewerImageList : public LLImageProviderInterface
60{ 60{
61 LOG_CLASS(LLViewerImageList);
62
61 friend class LLTextureView; 63 friend class LLTextureView;
62 64
63public: 65public:
64 static BOOL createUploadFile(const LLString& filename, const LLString& out_filename, const U8 codec); 66 static BOOL createUploadFile(const LLString& filename, const LLString& out_filename, const U8 codec);
67 static LLPointer<LLImageJ2C> convertToUploadFile(LLPointer<LLImageRaw> raw_image);
65 static void processImageNotInDatabase( LLMessageSystem *msg, void **user_data ); 68 static void processImageNotInDatabase( LLMessageSystem *msg, void **user_data );
66 static S32 calcMaxTextureRAM(); 69 static S32 calcMaxTextureRAM();
70 static void receiveImageHeader(LLMessageSystem *msg, void **user_data);
71 static void receiveImagePacket(LLMessageSystem *msg, void **user_data);
67 72
68public: 73public:
69 LLViewerImageList(); 74 LLViewerImageList();
@@ -117,12 +122,13 @@ public:
117 void removeImageFromList(LLViewerImage *image); 122 void removeImageFromList(LLViewerImage *image);
118 123
119 void updateMovieImage(const LLUUID& image_id, BOOL active); 124 void updateMovieImage(const LLUUID& image_id, BOOL active);
125 void dirtyImage(LLViewerImage *image);
120 126
121 // Using image stats, determine what images are necessary, and perform image updates. 127 // Using image stats, determine what images are necessary, and perform image updates.
122 void updateImages(F32 decode_time); 128 void updateImages(F32 max_time);
123 129
124 // Decode and create textures for all images currently in list. 130 // Decode and create textures for all images currently in list.
125 void decodeAllImages(F32 max_decode_time = 0.f); 131 void decodeAllImages(F32 max_decode_time);
126 132
127 void handleIRCallback(void **data, const S32 number); 133 void handleIRCallback(void **data, const S32 number);
128 134
@@ -136,40 +142,35 @@ public:
136 void updateMaxResidentTexMem(S32 max = -1, U32 fudge = 0); 142 void updateMaxResidentTexMem(S32 max = -1, U32 fudge = 0);
137 143
138 void doPreloadImages(); 144 void doPreloadImages();
145 void doPrefetchImages();
139 146
140private: 147private:
141 LLViewerImage* preloadImage(const LLString& filename, const LLUUID &image_set_id, BOOL use_mips); 148 LLViewerImage* preloadImage(const LLString& filename, const LLUUID &image_set_id, BOOL use_mips);
142 void updateImagesDecodePriorities(); 149 void updateImagesDecodePriorities();
143 void updateImagesSendRequests(); 150 F32 updateImagesCreateTextures(F32 max_time);
144 void updateImagesDecodeTextures(F32 decode_max_time); 151 F32 updateImagesFetchTextures(F32 max_time);
145 void updateImagesMediaStreams(); 152 void updateImagesMediaStreams();
146 void updateImagesPollVFS();
147 void updateImagesUpdateStats(); 153 void updateImagesUpdateStats();
148 154
149public: 155public:
150 typedef std::set<LLPointer<LLViewerImage>, LLViewerImage::Compare> image_list_t; 156 typedef std::set<LLPointer<LLViewerImage> > image_list_t;
151 typedef std::set<LLPointer<LLViewerImage>, LLViewerImage::CompareForRemoval> image_removal_list_t; 157 image_list_t mLoadingStreamList;
152 typedef std::set<LLPointer<LLViewerImage>, LLViewerImage::CompareForWorstVisibility> image_visibility_list_t; 158 image_list_t mCreateTextureList;
153 159 image_list_t mCallbackList;
154 // List of pending texture loads, waiting for the VFS.
155 // The asynchronous read has been initiated for all images in the list.
156 typedef std::list<LLPointer<LLViewerImage> > image_loading_list_t;
157 image_loading_list_t mLoadingStreamList;
158
159 // Images with "loaded" callbacks
160 typedef std::set<LLPointer<LLViewerImage> > image_callback_list_t;
161 image_callback_list_t mCallbackList;
162 160
161 // Note: just raw pointers because they are never referenced, just compared against
162 std::set<LLViewerImage*> mDirtyTextureList;
163
163 BOOL mForceResetTextureStats; 164 BOOL mForceResetTextureStats;
164 165
165private: 166private:
166 typedef std::map< LLUUID, LLPointer<LLViewerImage> > uuid_map_t; 167 typedef std::map< LLUUID, LLPointer<LLViewerImage> > uuid_map_t;
167 uuid_map_t mUUIDMap; 168 uuid_map_t mUUIDMap;
168 LLUUID mLastUpdateUUID; 169 LLUUID mLastUpdateUUID;
170 LLUUID mLastFetchUUID;
169 171
170 image_list_t mImageList; 172 typedef std::set<LLPointer<LLViewerImage>, LLViewerImage::Compare> image_priority_list_t;
171 173 image_priority_list_t mImageList;
172 LLPointer<LLViewerImage> mCurrentDecodeImagep;
173 174
174 typedef std::vector<LLPointer<LLViewerImage> > callback_data_t; 175 typedef std::vector<LLPointer<LLViewerImage> > callback_data_t;
175 typedef std::set< callback_data_t* > callback_data_list_t; 176 typedef std::set< callback_data_t* > callback_data_list_t;
diff --git a/linden/indra/newview/llviewerinventory.cpp b/linden/indra/newview/llviewerinventory.cpp
index 487a9f8..7c12f56 100644
--- a/linden/indra/newview/llviewerinventory.cpp
+++ b/linden/indra/newview/llviewerinventory.cpp
@@ -268,7 +268,7 @@ bool LLViewerInventoryItem::importFileLocal(FILE* fp)
268 268
269bool LLViewerInventoryItem::exportFileLocal(FILE* fp) const 269bool LLViewerInventoryItem::exportFileLocal(FILE* fp) const
270{ 270{
271 char uuid_str[UUID_STR_LENGTH]; 271 char uuid_str[UUID_STR_LENGTH]; /* Flawfinder: ignore */
272 fprintf(fp, "\tinv_item\t0\n\t{\n"); 272 fprintf(fp, "\tinv_item\t0\n\t{\n");
273 mUUID.toString(uuid_str); 273 mUUID.toString(uuid_str);
274 fprintf(fp, "\t\titem_id\t%s\n", uuid_str); 274 fprintf(fp, "\t\titem_id\t%s\n", uuid_str);
@@ -450,16 +450,17 @@ bool LLViewerInventoryCategory::fetchDescendents()
450bool LLViewerInventoryCategory::importFileLocal(FILE* fp) 450bool LLViewerInventoryCategory::importFileLocal(FILE* fp)
451{ 451{
452 // *NOTE: This buffer size is hard coded into scanf() below. 452 // *NOTE: This buffer size is hard coded into scanf() below.
453 char buffer[MAX_STRING]; 453 char buffer[MAX_STRING]; /* Flawfinder: ignore */
454 char keyword[MAX_STRING]; 454 char keyword[MAX_STRING]; /* Flawfinder: ignore */
455 char valuestr[MAX_STRING]; 455 char valuestr[MAX_STRING]; /* Flawfinder: ignore */
456 456
457 keyword[0] = '\0'; 457 keyword[0] = '\0';
458 valuestr[0] = '\0'; 458 valuestr[0] = '\0';
459 while(!feof(fp)) 459 while(!feof(fp))
460 { 460 {
461 fgets(buffer, MAX_STRING, fp); 461 fgets(buffer, MAX_STRING, fp);
462 sscanf(buffer, " %254s %254s", keyword, valuestr); 462 sscanf( /* Flawfinder: ignore */
463 buffer, " %254s %254s", keyword, valuestr);
463 if(!keyword) 464 if(!keyword)
464 { 465 {
465 continue; 466 continue;
@@ -492,7 +493,8 @@ bool LLViewerInventoryCategory::importFileLocal(FILE* fp)
492 { 493 {
493 //strcpy(valuestr, buffer + strlen(keyword) + 3); 494 //strcpy(valuestr, buffer + strlen(keyword) + 3);
494 // *NOTE: Not ANSI C, but widely supported. 495 // *NOTE: Not ANSI C, but widely supported.
495 sscanf(buffer, " %254s %254[^|]", keyword, valuestr); 496 sscanf( /* Flawfinder: ignore */
497 buffer, " %254s %254[^|]", keyword, valuestr);
496 mName.assign(valuestr); 498 mName.assign(valuestr);
497 LLString::replaceNonstandardASCII(mName, ' '); 499 LLString::replaceNonstandardASCII(mName, ' ');
498 LLString::replaceChar(mName, '|', ' '); 500 LLString::replaceChar(mName, '|', ' ');
@@ -516,7 +518,7 @@ bool LLViewerInventoryCategory::importFileLocal(FILE* fp)
516 518
517bool LLViewerInventoryCategory::exportFileLocal(FILE* fp) const 519bool LLViewerInventoryCategory::exportFileLocal(FILE* fp) const
518{ 520{
519 char uuid_str[UUID_STR_LENGTH]; 521 char uuid_str[UUID_STR_LENGTH]; /* Flawfinder: ignore */
520 fprintf(fp, "\tinv_category\t0\n\t{\n"); 522 fprintf(fp, "\tinv_category\t0\n\t{\n");
521 mUUID.toString(uuid_str); 523 mUUID.toString(uuid_str);
522 fprintf(fp, "\t\tcat_id\t%s\n", uuid_str); 524 fprintf(fp, "\t\tcat_id\t%s\n", uuid_str);
@@ -672,7 +674,7 @@ void copy_inventory_item(
672 msg->addUUIDFast(_PREHASH_OldAgentID, current_owner); 674 msg->addUUIDFast(_PREHASH_OldAgentID, current_owner);
673 msg->addUUIDFast(_PREHASH_OldItemID, item_id); 675 msg->addUUIDFast(_PREHASH_OldItemID, item_id);
674 msg->addUUIDFast(_PREHASH_NewFolderID, parent_id); 676 msg->addUUIDFast(_PREHASH_NewFolderID, parent_id);
675 msg->addString("NewName", new_name); 677 msg->addStringFast(_PREHASH_NewName, new_name);
676 gAgent.sendReliableMessage(); 678 gAgent.sendReliableMessage();
677} 679}
678 680
@@ -689,11 +691,11 @@ void move_inventory_item(
689 msg->nextBlockFast(_PREHASH_AgentData); 691 msg->nextBlockFast(_PREHASH_AgentData);
690 msg->addUUIDFast(_PREHASH_AgentID, agent_id); 692 msg->addUUIDFast(_PREHASH_AgentID, agent_id);
691 msg->addUUIDFast(_PREHASH_SessionID, session_id); 693 msg->addUUIDFast(_PREHASH_SessionID, session_id);
692 msg->addBOOLFast(_PREHASH_Stamp, false); 694 msg->addBOOLFast(_PREHASH_Stamp, FALSE);
693 msg->nextBlockFast(_PREHASH_InventoryData); 695 msg->nextBlockFast(_PREHASH_InventoryData);
694 msg->addUUIDFast(_PREHASH_ItemID, item_id); 696 msg->addUUIDFast(_PREHASH_ItemID, item_id);
695 msg->addUUIDFast(_PREHASH_FolderID, parent_id); 697 msg->addUUIDFast(_PREHASH_FolderID, parent_id);
696 msg->addString("NewName", new_name); 698 msg->addStringFast(_PREHASH_NewName, new_name);
697 gAgent.sendReliableMessage(); 699 gAgent.sendReliableMessage();
698} 700}
699 701
diff --git a/linden/indra/newview/llviewerjoint.cpp b/linden/indra/newview/llviewerjoint.cpp
index f8fed01..a1294be 100644
--- a/linden/indra/newview/llviewerjoint.cpp
+++ b/linden/indra/newview/llviewerjoint.cpp
@@ -101,10 +101,10 @@ void LLViewerJoint::setValid( BOOL valid, BOOL recursive )
101 //---------------------------------------------------------------- 101 //----------------------------------------------------------------
102 if (recursive) 102 if (recursive)
103 { 103 {
104 for ( LLViewerJoint *joint = (LLViewerJoint*)mChildren.getFirstData(); 104 for (child_list_t::iterator iter = mChildren.begin();
105 joint != NULL; 105 iter != mChildren.end(); ++iter)
106 joint = (LLViewerJoint*)mChildren.getNextData() )
107 { 106 {
107 LLViewerJoint* joint = (LLViewerJoint*)(*iter);
108 joint->setValid(valid, TRUE); 108 joint->setValid(valid, TRUE);
109 } 109 }
110 } 110 }
@@ -217,10 +217,10 @@ void LLViewerJoint::renderSkeleton(BOOL recursive)
217 //---------------------------------------------------------------- 217 //----------------------------------------------------------------
218 if (recursive) 218 if (recursive)
219 { 219 {
220 for ( LLViewerJoint *joint = (LLViewerJoint*)mChildren.getFirstData(); 220 for (child_list_t::iterator iter = mChildren.begin();
221 joint != NULL; 221 iter != mChildren.end(); ++iter)
222 joint = (LLViewerJoint*)mChildren.getNextData() )
223 { 222 {
223 LLViewerJoint* joint = (LLViewerJoint*)(*iter);
224 joint->renderSkeleton(); 224 joint->renderSkeleton();
225 } 225 }
226 } 226 }
@@ -235,7 +235,7 @@ void LLViewerJoint::renderSkeleton(BOOL recursive)
235//-------------------------------------------------------------------- 235//--------------------------------------------------------------------
236// render() 236// render()
237//-------------------------------------------------------------------- 237//--------------------------------------------------------------------
238U32 LLViewerJoint::render( F32 pixelArea ) 238U32 LLViewerJoint::render( F32 pixelArea, BOOL first_pass )
239{ 239{
240 U32 triangle_count = 0; 240 U32 triangle_count = 0;
241 241
@@ -245,73 +245,68 @@ U32 LLViewerJoint::render( F32 pixelArea )
245 if ( mValid ) 245 if ( mValid )
246 { 246 {
247 247
248
248 //---------------------------------------------------------------- 249 //----------------------------------------------------------------
249 // if object is transparent, defer it, otherwise 250 // if object is transparent, defer it, otherwise
250 // give the joint subclass a chance to draw itself 251 // give the joint subclass a chance to draw itself
251 //---------------------------------------------------------------- 252 //----------------------------------------------------------------
252 if ( gRenderForSelect ) 253 if ( gRenderForSelect )
253 { 254 {
254 triangle_count += drawShape( pixelArea ); 255 triangle_count += drawShape( pixelArea, first_pass );
255 } 256 }
256 else if ( isTransparent() ) 257 else if ( isTransparent() )
257 { 258 {
258 LLGLEnable blend(GL_BLEND);
259 // Hair and Skirt 259 // Hair and Skirt
260 if ((pixelArea > MIN_PIXEL_AREA_3PASS_HAIR)) 260 if ((pixelArea > MIN_PIXEL_AREA_3PASS_HAIR))
261 { 261 {
262 // render all three passes 262 // render all three passes
263 LLGLEnable alpha_test(GL_ALPHA_TEST);
264 LLGLDisable cull(GL_CULL_FACE); 263 LLGLDisable cull(GL_CULL_FACE);
265 // first pass renders without writing to the z buffer 264 // first pass renders without writing to the z buffer
266 { 265 {
267 LLGLDepthTest gls_depth(GL_TRUE, GL_FALSE); 266 LLGLDepthTest gls_depth(GL_TRUE, GL_FALSE);
268 triangle_count += drawShape( pixelArea ); 267 triangle_count += drawShape( pixelArea, first_pass);
269 } 268 }
270 // second pass writes to z buffer only 269 // second pass writes to z buffer only
271 glColorMask(FALSE, FALSE, FALSE, FALSE); 270 glColorMask(FALSE, FALSE, FALSE, FALSE);
272 { 271 {
273 triangle_count += drawShape( pixelArea ); 272 triangle_count += drawShape( pixelArea, FALSE );
274 } 273 }
275 // third past respects z buffer and writes color 274 // third past respects z buffer and writes color
276 glColorMask(TRUE, TRUE, TRUE, TRUE); 275 glColorMask(TRUE, TRUE, TRUE, TRUE);
277 { 276 {
278 LLGLDepthTest gls_depth(GL_TRUE, GL_FALSE); 277 LLGLDepthTest gls_depth(GL_TRUE, GL_FALSE);
279 triangle_count += drawShape( pixelArea ); 278 triangle_count += drawShape( pixelArea, FALSE );
280 } 279 }
281 } 280 }
282 else 281 else
283 { 282 {
284 LLGLEnable alpha_test(GL_ALPHA_TEST);
285 // Render Inside (no Z buffer write) 283 // Render Inside (no Z buffer write)
286 glCullFace(GL_FRONT); 284 glCullFace(GL_FRONT);
287 { 285 {
288 LLGLDepthTest gls_depth(GL_TRUE, GL_FALSE); 286 LLGLDepthTest gls_depth(GL_TRUE, GL_FALSE);
289 triangle_count += drawShape( pixelArea ); 287 triangle_count += drawShape( pixelArea, first_pass );
290 } 288 }
291 // Render Outside (write to the Z buffer) 289 // Render Outside (write to the Z buffer)
292 glCullFace(GL_BACK); 290 glCullFace(GL_BACK);
293 { 291 {
294 triangle_count += drawShape( pixelArea ); 292 triangle_count += drawShape( pixelArea, FALSE );
295 } 293 }
296 } 294 }
297 } 295 }
298 else 296 else
299 { 297 {
300 // set up render state 298 // set up render state
301 LLGLDisable blend(GL_BLEND); 299 triangle_count += drawShape( pixelArea, first_pass );
302 LLGLSPipelineAvatar gls_pipeline_avatar;
303 triangle_count += drawShape( pixelArea );
304 } 300 }
305 } 301 }
306 302
307 //---------------------------------------------------------------- 303 //----------------------------------------------------------------
308 // render children 304 // render children
309 //---------------------------------------------------------------- 305 //----------------------------------------------------------------
310 LLViewerJoint *joint; 306 for (child_list_t::iterator iter = mChildren.begin();
311 for ( joint = (LLViewerJoint *)mChildren.getFirstData(); 307 iter != mChildren.end(); ++iter)
312 joint != NULL;
313 joint = (LLViewerJoint *)mChildren.getNextData() )
314 { 308 {
309 LLViewerJoint* joint = (LLViewerJoint*)(*iter);
315 F32 jointLOD = joint->getLOD(); 310 F32 jointLOD = joint->getLOD();
316 if (pixelArea >= jointLOD || sDisableLOD) 311 if (pixelArea >= jointLOD || sDisableLOD)
317 { 312 {
@@ -324,7 +319,6 @@ U32 LLViewerJoint::render( F32 pixelArea )
324 } 319 }
325 } 320 }
326 321
327 glColorMask(TRUE, TRUE, TRUE, TRUE);
328 return triangle_count; 322 return triangle_count;
329} 323}
330 324
@@ -396,7 +390,7 @@ BOOL LLViewerJoint::isTransparent()
396//-------------------------------------------------------------------- 390//--------------------------------------------------------------------
397// drawShape() 391// drawShape()
398//-------------------------------------------------------------------- 392//--------------------------------------------------------------------
399U32 LLViewerJoint::drawShape( F32 pixelArea ) 393U32 LLViewerJoint::drawShape( F32 pixelArea, BOOL first_pass )
400{ 394{
401 return 0; 395 return 0;
402} 396}
@@ -409,65 +403,75 @@ void LLViewerJoint::setSkeletonComponents( U32 comp, BOOL recursive )
409 mComponents = comp; 403 mComponents = comp;
410 if (recursive) 404 if (recursive)
411 { 405 {
412 for ( LLViewerJoint *joint = (LLViewerJoint *)mChildren.getFirstData(); 406 for (child_list_t::iterator iter = mChildren.begin();
413 joint != NULL; 407 iter != mChildren.end(); ++iter)
414 joint = (LLViewerJoint *)mChildren.getNextData() )
415 { 408 {
409 LLViewerJoint* joint = (LLViewerJoint*)(*iter);
416 joint->setSkeletonComponents(comp, recursive); 410 joint->setSkeletonComponents(comp, recursive);
417 } 411 }
418 } 412 }
419} 413}
420 414
421void LLViewerJoint::updateFaceSizes(U32 &num_vertices, F32 pixel_area) 415void LLViewerJoint::updateFaceSizes(U32 &num_vertices, U32& num_indices, F32 pixel_area)
422{ 416{
423 for ( LLViewerJoint *joint = (LLViewerJoint*)mChildren.getFirstData(); 417 for (child_list_t::iterator iter = mChildren.begin();
424 joint != NULL; 418 iter != mChildren.end(); ++iter)
425 joint = (LLViewerJoint*)mChildren.getNextData() )
426 { 419 {
427 F32 jointLOD = joint->getLOD(); 420 LLViewerJoint* joint = (LLViewerJoint*)(*iter);
428 if (pixel_area >= jointLOD || sDisableLOD) 421 //F32 jointLOD = joint->getLOD();
422 //if (pixel_area >= jointLOD || sDisableLOD)
429 { 423 {
430 joint->updateFaceSizes(num_vertices, pixel_area); 424 joint->updateFaceSizes(num_vertices, num_indices, pixel_area);
431 425
432 if (jointLOD != DEFAULT_LOD) 426 // if (jointLOD != DEFAULT_LOD)
433 { 427 // {
434 break; 428 // break;
435 } 429 // }
436 } 430 }
437 } 431 }
438} 432}
439 433
440void LLViewerJoint::updateFaceData(LLFace *face, F32 pixel_area, BOOL damp_wind) 434void LLViewerJoint::updateFaceData(LLFace *face, F32 pixel_area, BOOL damp_wind)
441{ 435{
442 for ( LLViewerJoint *joint = (LLViewerJoint*)mChildren.getFirstData(); 436 for (child_list_t::iterator iter = mChildren.begin();
443 joint != NULL; 437 iter != mChildren.end(); ++iter)
444 joint = (LLViewerJoint*)mChildren.getNextData() )
445 { 438 {
446 F32 jointLOD = joint->getLOD(); 439 LLViewerJoint* joint = (LLViewerJoint*)(*iter);
447 if (pixel_area >= jointLOD || sDisableLOD) 440 //F32 jointLOD = joint->getLOD();
441 //if (pixel_area >= jointLOD || sDisableLOD)
448 { 442 {
449 joint->updateFaceData(face, pixel_area, damp_wind); 443 joint->updateFaceData(face, pixel_area, damp_wind);
450 444
451 if (jointLOD != DEFAULT_LOD) 445 // if (jointLOD != DEFAULT_LOD)
452 { 446 // {
453 break; 447 // break;
454 } 448 // }
455 } 449 }
456 } 450 }
457} 451}
458 452
453void LLViewerJoint::updateGeometry()
454{
455 for (child_list_t::iterator iter = mChildren.begin();
456 iter != mChildren.end(); ++iter)
457 {
458 LLViewerJoint* joint = (LLViewerJoint*)(*iter);
459 joint->updateGeometry();
460 }
461}
462
459 463
460BOOL LLViewerJoint::updateLOD(F32 pixel_area, BOOL activate) 464BOOL LLViewerJoint::updateLOD(F32 pixel_area, BOOL activate)
461{ 465{
462 BOOL lod_changed = FALSE; 466 BOOL lod_changed = FALSE;
463 BOOL found_lod = FALSE; 467 BOOL found_lod = FALSE;
464 468
465 for ( LLViewerJoint *joint = (LLViewerJoint*)mChildren.getFirstData(); 469 for (child_list_t::iterator iter = mChildren.begin();
466 joint != NULL; 470 iter != mChildren.end(); ++iter)
467 joint = (LLViewerJoint*)mChildren.getNextData() )
468 { 471 {
472 LLViewerJoint* joint = (LLViewerJoint*)(*iter);
469 F32 jointLOD = joint->getLOD(); 473 F32 jointLOD = joint->getLOD();
470 474
471 if (found_lod || jointLOD == DEFAULT_LOD) 475 if (found_lod || jointLOD == DEFAULT_LOD)
472 { 476 {
473 // we've already found a joint to enable, so enable the rest as alternatives 477 // we've already found a joint to enable, so enable the rest as alternatives
@@ -491,12 +495,12 @@ BOOL LLViewerJoint::updateLOD(F32 pixel_area, BOOL activate)
491 495
492void LLViewerJoint::dump() 496void LLViewerJoint::dump()
493{ 497{
494 for ( LLViewerJoint *joint = (LLViewerJoint*)mChildren.getFirstData(); 498 for (child_list_t::iterator iter = mChildren.begin();
495 joint != NULL; 499 iter != mChildren.end(); ++iter)
496 joint = (LLViewerJoint*)mChildren.getNextData() ) 500 {
497 { 501 LLViewerJoint* joint = (LLViewerJoint*)(*iter);
498 joint->dump(); 502 joint->dump();
499 } 503 }
500} 504}
501 505
502void LLViewerJoint::setVisible(BOOL visible, BOOL recursive) 506void LLViewerJoint::setVisible(BOOL visible, BOOL recursive)
@@ -505,12 +509,12 @@ void LLViewerJoint::setVisible(BOOL visible, BOOL recursive)
505 509
506 if (recursive) 510 if (recursive)
507 { 511 {
508 for ( LLViewerJoint *joint = (LLViewerJoint*)mChildren.getFirstData(); 512 for (child_list_t::iterator iter = mChildren.begin();
509 joint != NULL; 513 iter != mChildren.end(); ++iter)
510 joint = (LLViewerJoint*)mChildren.getNextData() ) 514 {
511 { 515 LLViewerJoint* joint = (LLViewerJoint*)(*iter);
512 joint->setVisible(visible, recursive); 516 joint->setVisible(visible, recursive);
513 } 517 }
514 } 518 }
515} 519}
516 520
@@ -530,10 +534,10 @@ void LLViewerJoint::writeCAL3D(apr_file_t* fp)
530 LLQuaternion bone_rot; 534 LLQuaternion bone_rot;
531 535
532 S32 num_children = 0; 536 S32 num_children = 0;
533 for (LLViewerJoint *joint = (LLViewerJoint*)mChildren.getFirstData(); 537 for (child_list_t::iterator iter = mChildren.begin();
534 joint != NULL; 538 iter != mChildren.end(); ++iter)
535 joint = (LLViewerJoint*)mChildren.getNextData() )
536 { 539 {
540 LLViewerJoint* joint = (LLViewerJoint*)(*iter);
537 if (joint->mJointNum != -1) 541 if (joint->mJointNum != -1)
538 { 542 {
539 num_children++; 543 num_children++;
@@ -560,10 +564,10 @@ void LLViewerJoint::writeCAL3D(apr_file_t* fp)
560 apr_file_printf(fp, " <LOCALROTATION>0 0 0 1</LOCALROTATION>\n"); 564 apr_file_printf(fp, " <LOCALROTATION>0 0 0 1</LOCALROTATION>\n");
561 apr_file_printf(fp, " <PARENTID>%d</PARENTID>\n", mParent ? mParent->mJointNum + 1 : -1); 565 apr_file_printf(fp, " <PARENTID>%d</PARENTID>\n", mParent ? mParent->mJointNum + 1 : -1);
562 566
563 for (LLViewerJoint *joint = (LLViewerJoint*)mChildren.getFirstData(); 567 for (child_list_t::iterator iter = mChildren.begin();
564 joint != NULL; 568 iter != mChildren.end(); ++iter)
565 joint = (LLViewerJoint*)mChildren.getNextData() )
566 { 569 {
570 LLViewerJoint* joint = (LLViewerJoint*)(*iter);
567 if (joint->mJointNum != -1) 571 if (joint->mJointNum != -1)
568 { 572 {
569 apr_file_printf(fp, " <CHILDID>%d</CHILDID>\n", joint->mJointNum + 1); 573 apr_file_printf(fp, " <CHILDID>%d</CHILDID>\n", joint->mJointNum + 1);
@@ -572,10 +576,10 @@ void LLViewerJoint::writeCAL3D(apr_file_t* fp)
572 apr_file_printf(fp, " </BONE>\n"); 576 apr_file_printf(fp, " </BONE>\n");
573 577
574 // recurse 578 // recurse
575 for (LLViewerJoint *joint = (LLViewerJoint*)mChildren.getFirstData(); 579 for (child_list_t::iterator iter = mChildren.begin();
576 joint != NULL; 580 iter != mChildren.end(); ++iter)
577 joint = (LLViewerJoint*)mChildren.getNextData() )
578 { 581 {
582 LLViewerJoint* joint = (LLViewerJoint*)(*iter);
579 if (joint->mJointNum != -1) 583 if (joint->mJointNum != -1)
580 { 584 {
581 joint->writeCAL3D(fp); 585 joint->writeCAL3D(fp);
diff --git a/linden/indra/newview/llviewerjoint.h b/linden/indra/newview/llviewerjoint.h
index 44ad8e7..148f3a6 100644
--- a/linden/indra/newview/llviewerjoint.h
+++ b/linden/indra/newview/llviewerjoint.h
@@ -62,7 +62,7 @@ public:
62 // Traverses the entire joint hierarchy, setting up 62 // Traverses the entire joint hierarchy, setting up
63 // transforms and calling the drawShape(). 63 // transforms and calling the drawShape().
64 // Derived classes may add text/graphic output. 64 // Derived classes may add text/graphic output.
65 virtual U32 render( F32 pixelArea ); // Returns triangle count 65 virtual U32 render( F32 pixelArea, BOOL first_pass = TRUE ); // Returns triangle count
66 66
67 // Draws a bone graphic to the parent joint. 67 // Draws a bone graphic to the parent joint.
68 // Derived classes may add text/graphic output. 68 // Derived classes may add text/graphic output.
@@ -78,7 +78,7 @@ public:
78 78
79 // Draws the shape attached to a joint. 79 // Draws the shape attached to a joint.
80 // Called by render(). 80 // Called by render().
81 virtual U32 drawShape( F32 pixelArea ); 81 virtual U32 drawShape( F32 pixelArea, BOOL first_pass = TRUE );
82 virtual void drawNormals() {} 82 virtual void drawNormals() {}
83 83
84 enum Components 84 enum Components
@@ -97,9 +97,9 @@ public:
97 // Sets the level of detail for this node as a minimum 97 // Sets the level of detail for this node as a minimum
98 // pixel area threshold. If the current pixel area for this 98 // pixel area threshold. If the current pixel area for this
99 // object is less than the specified threshold, the node is 99 // object is less than the specified threshold, the node is
100 // not traversed. In additin, if a value is specified (not 100 // not traversed. In addition, if a value is specified (not
101 // default of 0.0), and the pixel area is larger than the 101 // default of 0.0), and the pixel area is larger than the
102 // specified miniumn, the node is rendered, but no other siblings 102 // specified minimum, the node is rendered, but no other siblings
103 // of this node under the same parent will be. 103 // of this node under the same parent will be.
104 F32 getLOD() { return mMinPixelArea; } 104 F32 getLOD() { return mMinPixelArea; }
105 void setLOD( F32 pixelArea ) { mMinPixelArea = pixelArea; } 105 void setLOD( F32 pixelArea ) { mMinPixelArea = pixelArea; }
@@ -120,9 +120,10 @@ public:
120 void setPickName(PickName name) { mPickName = name; } 120 void setPickName(PickName name) { mPickName = name; }
121 PickName getPickName() { return mPickName; } 121 PickName getPickName() { return mPickName; }
122 122
123 virtual void updateFaceSizes(U32 &num_vertices, F32 pixel_area); 123 virtual void updateFaceSizes(U32 &num_vertices, U32& num_indices, F32 pixel_area);
124 virtual void updateFaceData(LLFace *face, F32 pixel_area, BOOL damp_wind = FALSE); 124 virtual void updateFaceData(LLFace *face, F32 pixel_area, BOOL damp_wind = FALSE);
125 virtual BOOL updateLOD(F32 pixel_area, BOOL activate); 125 virtual BOOL updateLOD(F32 pixel_area, BOOL activate);
126 virtual void updateGeometry();
126 virtual void dump(); 127 virtual void dump();
127 128
128 void setVisible( BOOL visible, BOOL recursive ); 129 void setVisible( BOOL visible, BOOL recursive );
@@ -154,3 +155,4 @@ public:
154 155
155#endif // LL_LLVIEWERJOINT_H 156#endif // LL_LLVIEWERJOINT_H
156 157
158
diff --git a/linden/indra/newview/llviewerjointattachment.cpp b/linden/indra/newview/llviewerjointattachment.cpp
index 89db44d..2a54a47 100644
--- a/linden/indra/newview/llviewerjointattachment.cpp
+++ b/linden/indra/newview/llviewerjointattachment.cpp
@@ -79,7 +79,7 @@ BOOL LLViewerJointAttachment::isTransparent()
79//----------------------------------------------------------------------------- 79//-----------------------------------------------------------------------------
80// drawShape() 80// drawShape()
81//----------------------------------------------------------------------------- 81//-----------------------------------------------------------------------------
82U32 LLViewerJointAttachment::drawShape( F32 pixelArea ) 82U32 LLViewerJointAttachment::drawShape( F32 pixelArea, BOOL first_pass )
83{ 83{
84 if (LLVOAvatar::sShowAttachmentPoints) 84 if (LLVOAvatar::sShowAttachmentPoints)
85 { 85 {
@@ -296,47 +296,20 @@ void LLViewerJointAttachment::removeObject(LLViewerObject *object)
296//----------------------------------------------------------------------------- 296//-----------------------------------------------------------------------------
297void LLViewerJointAttachment::setAttachmentVisibility(BOOL visible) 297void LLViewerJointAttachment::setAttachmentVisibility(BOOL visible)
298{ 298{
299 if (!mAttachedObject || mAttachedObject->mDrawable.isNull()) 299 if (!mAttachedObject || mAttachedObject->mDrawable.isNull() ||
300 !(mAttachedObject->mDrawable->getSpatialBridge()))
300 return; 301 return;
301 302
302 if (visible) 303 if (visible)
303 { 304 {
304 // Hack to make attachments not visible by disabling their type mask! 305 // Hack to make attachments not visible by disabling their type mask!
305 // This will break if you can ever attach non-volumes! - djs 02/14/03 306 // This will break if you can ever attach non-volumes! - djs 02/14/03
306 mAttachedObject->mDrawable->setRenderType(LLPipeline::RENDER_TYPE_VOLUME); 307 mAttachedObject->mDrawable->getSpatialBridge()->mDrawableType =
307 for (LLViewerObject::child_list_t::iterator iter = mAttachedObject->mChildList.begin(); 308 mAttachedObject->isHUDAttachment() ? LLPipeline::RENDER_TYPE_HUD : LLPipeline::RENDER_TYPE_VOLUME;
308 iter != mAttachedObject->mChildList.end(); ++iter)
309 {
310 LLViewerObject* childp = *iter;
311 if (childp && childp->mDrawable.notNull())
312 {
313 childp->mDrawable->setRenderType(LLPipeline::RENDER_TYPE_VOLUME);
314 }
315 }
316 } 309 }
317 else 310 else
318 { 311 {
319 //RN: sometimes we call this on objects that are already invisible, so check for that case 312 mAttachedObject->mDrawable->getSpatialBridge()->mDrawableType = 0;
320 if (!mAttachedObject->mDrawable->isRenderType(LLPipeline::RENDER_TYPE_VOLUME) &&
321 !mAttachedObject->mDrawable->isRenderType(0))
322 {
323 llerrs << "Tried to attach non-volume to a joint, visibility hack dangerous!" << llendl;
324 }
325 mAttachedObject->mDrawable->setRenderType(0);
326 for (LLViewerObject::child_list_t::iterator iter = mAttachedObject->mChildList.begin();
327 iter != mAttachedObject->mChildList.end(); ++iter)
328 {
329 LLViewerObject* childp = *iter;
330 if (childp && childp->mDrawable.notNull())
331 {
332 if (!childp->mDrawable->isRenderType(LLPipeline::RENDER_TYPE_VOLUME) &&
333 !mAttachedObject->mDrawable->isRenderType(0))
334 {
335 llerrs << "Tried to attach non-volume to a joint, visibility hack dangerous!" << llendl;
336 }
337 childp->mDrawable->setRenderType(0);
338 }
339 }
340 } 313 }
341} 314}
342 315
diff --git a/linden/indra/newview/llviewerjointattachment.h b/linden/indra/newview/llviewerjointattachment.h
index 3d5f914..be671fb 100644
--- a/linden/indra/newview/llviewerjointattachment.h
+++ b/linden/indra/newview/llviewerjointattachment.h
@@ -56,7 +56,7 @@ public:
56 56
57 // Draws the shape attached to a joint. 57 // Draws the shape attached to a joint.
58 // Called by render(). 58 // Called by render().
59 /*virtual*/ U32 drawShape( F32 pixelArea ); 59 /*virtual*/ U32 drawShape( F32 pixelArea, BOOL first_pass );
60 60
61 /*virtual*/ BOOL updateLOD(F32 pixel_area, BOOL activate); 61 /*virtual*/ BOOL updateLOD(F32 pixel_area, BOOL activate);
62 62
@@ -79,7 +79,7 @@ public:
79 S32 getGroup() { return mGroup; } 79 S32 getGroup() { return mGroup; }
80 S32 getPieSlice() { return mPieSlice; } 80 S32 getPieSlice() { return mPieSlice; }
81 BOOL getAttachmentDirty() { return mAttachmentDirty && mAttachedObject; } 81 BOOL getAttachmentDirty() { return mAttachmentDirty && mAttachedObject; }
82 LLViewerObject *getObject(S32 i) { return mAttachedObject; } 82 LLViewerObject *getObject() { return mAttachedObject; }
83 S32 getNumObjects() { return (mAttachedObject ? 1 : 0); } 83 S32 getNumObjects() { return (mAttachedObject ? 1 : 0); }
84 const LLUUID& getItemID() { return mItemID; } 84 const LLUUID& getItemID() { return mItemID; }
85 85
diff --git a/linden/indra/newview/llviewerjointmesh.cpp b/linden/indra/newview/llviewerjointmesh.cpp
index 96cdb88..3070cb4 100644
--- a/linden/indra/newview/llviewerjointmesh.cpp
+++ b/linden/indra/newview/llviewerjointmesh.cpp
@@ -38,7 +38,6 @@
38#include "llfasttimer.h" 38#include "llfasttimer.h"
39 39
40#include "llagent.h" 40#include "llagent.h"
41#include "llagparray.h"
42#include "llbox.h" 41#include "llbox.h"
43#include "lldrawable.h" 42#include "lldrawable.h"
44#include "lldrawpoolavatar.h" 43#include "lldrawpoolavatar.h"
@@ -62,6 +61,10 @@ extern PFNGLVERTEXBLENDARBPROC glVertexBlendARB;
62#endif 61#endif
63extern BOOL gRenderForSelect; 62extern BOOL gRenderForSelect;
64 63
64static LLPointer<LLVertexBuffer> sRenderBuffer = NULL;
65static const U32 sRenderMask = LLVertexBuffer::MAP_VERTEX |
66 LLVertexBuffer::MAP_NORMAL |
67 LLVertexBuffer::MAP_TEXCOORD;
65LLMatrix4 gBlendMat; 68LLMatrix4 gBlendMat;
66 69
67//----------------------------------------------------------------------------- 70//-----------------------------------------------------------------------------
@@ -394,11 +397,11 @@ void LLViewerJointMesh::setupJoint(LLViewerJoint* current_joint)
394 } 397 }
395 398
396 // depth-first traversal 399 // depth-first traversal
397 for (LLJoint *child_joint = current_joint->mChildren.getFirstData(); 400 for (LLJoint::child_list_t::iterator iter = current_joint->mChildren.begin();
398 child_joint; 401 iter != current_joint->mChildren.end(); ++iter)
399 child_joint = current_joint->mChildren.getNextData())
400 { 402 {
401 setupJoint((LLViewerJoint*)child_joint); 403 LLViewerJoint* child_joint = (LLViewerJoint*)(*iter);
404 setupJoint(child_joint);
402 } 405 }
403} 406}
404 407
@@ -431,7 +434,7 @@ void LLViewerJointMesh::uploadJointMatrices()
431 434
432 if (hardware_skinning) 435 if (hardware_skinning)
433 { 436 {
434 joint_mat *= gCamera->getModelview(); 437 joint_mat *= LLDrawPoolAvatar::getModelView();
435 } 438 }
436 gJointMat[joint_num] = joint_mat; 439 gJointMat[joint_num] = joint_mat;
437 gJointRot[joint_num] = joint_mat.getMat3(); 440 gJointRot[joint_num] = joint_mat.getMat3();
@@ -532,620 +535,39 @@ int compare_int(const void *a, const void *b)
532 else return 0; 535 else return 0;
533} 536}
534 537
535#if LL_WINDOWS || (LL_DARWIN && __i386__) // SSE optimizations in avatar code 538void llDrawRangeElements(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices)
536
537#if LL_DARWIN
538#include <xmmintrin.h>
539
540 // On Windows, this class is defined in fvec.h. I've only reproduced the parts of it we use here for now.
541 #pragma pack(push,16) /* Must ensure class & union 16-B aligned */
542 class F32vec4
543 {
544 protected:
545 __m128 vec;
546 public:
547
548 /* Constructors: __m128, 4 floats, 1 float */
549 F32vec4() {}
550
551 /* initialize 4 SP FP with __m128 data type */
552 F32vec4(__m128 m) { vec = m;}
553
554 /* Explicitly initialize each of 4 SP FPs with same float */
555 explicit F32vec4(float f) { vec = _mm_set_ps1(f); }
556 };
557 #pragma pack(pop) /* 16-B aligned */
558
559
560#endif
561
562void blend_SSE_32_32_batch(const int vert_offset, const int vert_count, float* output,
563 LLStrider<LLVector3>& vertices, LLStrider<LLVector2>& texcoords, LLStrider<LLVector3>& normals, LLStrider<F32>& weights)
564{ 539{
565 F32 last_weight = F32_MAX; 540 if (end-start+1 > (U32) gGLManager.mGLMaxVertexRange ||
566 LLMatrix4 *blend_mat = &gBlendMat; 541 count > gGLManager.mGLMaxIndexRange)
567
568 for (S32 index = vert_offset; index < vert_offset + vert_count; index++)
569 { 542 {
570 F32 w = weights [index]; // register copy of weight 543 glDrawElements(mode,count,type,indices);
571 F32 *vin = &vertices[index].mV[0]; // pointer to input vertex data, assumed to be V3+T2+N3+whatever
572 F32 *vout = output + index * (AVATAR_VERTEX_BYTES/sizeof(F32)); // pointer to the output vertex data, assumed to be 16 byte aligned
573
574 if (w == last_weight)
575 {
576 // load input and output vertices, and last blended matrix
577 __asm {
578 mov esi, vin
579 mov edi, vout
580
581 mov edx, blend_mat
582 movaps xmm4, [edx]
583 movaps xmm5, [edx+0x10]
584 movaps xmm6, [edx+0x20]
585 movaps xmm7, [edx+0x30]
586 }
587 }
588 else
589 {
590 last_weight = w;
591 S32 joint = llfloor(w);
592 w -= joint;
593
594 LLMatrix4 *m0 = &(gJointMat[joint+1]);
595 LLMatrix4 *m1 = &(gJointMat[joint+0]);
596
597 // some initial code to load Matrix 0 into SSE registers
598 __asm {
599 mov esi, vin
600 mov edi, vout
601
602 //matrix2
603 mov edx, m0
604 movaps xmm4, [edx]
605 movaps xmm5, [edx+0x10]
606 movaps xmm6, [edx+0x20]
607 movaps xmm7, [edx+0x30]
608 };
609
610 // if w == 1.0f, we don't need to blend.
611 // but since we do the trick of blending the matrices, here, if w != 1.0,
612 // we load Matrix 1 into the other 4 SSE registers and blend both matrices
613 // based on the weight (which we load ingo a 16-byte aligned vector: w,w,w,w)
614
615 if (w != 1.0f)
616 {
617 F32vec4 weight(w);
618
619 __asm { // do blending of matrices instead of verts and normals -- faster
620 mov edx, m1
621 movaps xmm0, [edx]
622 movaps xmm1, [edx+0x10]
623 movaps xmm2, [edx+0x20]
624 movaps xmm3, [edx+0x30]
625
626 subps xmm4, xmm0 // do blend for each matrix column
627 subps xmm5, xmm1 // diff, then multiply weight and re-add
628 subps xmm6, xmm2
629 subps xmm7, xmm3
630
631 mulps xmm4, weight
632 mulps xmm5, weight
633 mulps xmm6, weight
634 mulps xmm7, weight
635
636 addps xmm4, xmm0
637 addps xmm5, xmm1
638 addps xmm6, xmm2
639 addps xmm7, xmm3
640 };
641 }
642
643 __asm {
644 // save off blended matrix
645 mov edx, blend_mat;
646 movaps [edx], xmm4;
647 movaps [edx+0x10], xmm5;
648 movaps [edx+0x20], xmm6;
649 movaps [edx+0x30], xmm7;
650 }
651 }
652
653 // now, we have either a blended matrix in xmm4-7 or the original Matrix 0
654 // we then multiply each vertex and normal by this one matrix.
655
656 // For SSE2, we would try to keep the original two matrices in other registers
657 // and avoid reloading them. However, they should ramain in L1 cache in the
658 // current case.
659
660 // One possible optimization would be to sort the vertices by weight instead
661 // of just index (we still want to uniqify). If we note when two or more vertices
662 // share the same weight, we can avoid doing the middle SSE code above and just
663 // re-use the blended matrix for those vertices
664
665
666 // now, we do the actual vertex blending
667 __asm {
668 // load Vertex into xmm0.
669 movaps xmm0, [esi] // change aps to ups when input is no longer 16-baligned
670 movaps xmm1, xmm0 // copy vector into xmm0 through xmm2 (x,y,z)
671 movaps xmm2, xmm0
672 shufps xmm0, xmm0, _MM_SHUFFLE(0,0,0,0); // clone vertex (x) across vector
673 shufps xmm1, xmm1, _MM_SHUFFLE(1,1,1,1); // clone vertex (y) across vector
674 shufps xmm2, xmm2, _MM_SHUFFLE(2,2,2,2); // same for Z
675 mulps xmm0, xmm4 // do the actual matrix multipication for r0
676 mulps xmm1, xmm5 // for r1
677 mulps xmm2, xmm6 // for r2
678 addps xmm0, xmm1 // accumulate
679 addps xmm0, xmm2 // accumulate
680 addps xmm0, xmm7 // add in the row 4 which holds the x,y,z translation. assumes w=1 (vertex-w, not weight)
681
682 movaps [edi], xmm0 // store aligned in output array
683
684 // load Normal into xmm0.
685 movaps xmm0, [esi + 0x10] // change aps to ups when input no longer 16-byte aligned
686 movaps xmm1, xmm0 //
687 movaps xmm2, xmm0
688 shufps xmm0, xmm0, _MM_SHUFFLE(0,0,0,0); // since UV sits between vertex and normal, normal starts at element 1, not 0
689 shufps xmm1, xmm1, _MM_SHUFFLE(1,1,1,1);
690 shufps xmm2, xmm2, _MM_SHUFFLE(2,2,2,2);
691 mulps xmm0, xmm4 // multiply by matrix
692 mulps xmm1, xmm5 // multiply
693 mulps xmm2, xmm6 // multiply
694 addps xmm0, xmm1 // accumulate
695 addps xmm0, xmm2 // accumulate. note: do not add translation component to normals, save time too
696 movaps [edi + 0x10], xmm0 // store aligned
697 }
698
699 *(LLVector2*)(vout + (AVATAR_OFFSET_TEX0/sizeof(F32))) = texcoords[index]; // write texcoord into appropriate spot.
700 }
701}
702
703#elif LL_LINUX
704
705void blend_SSE_32_32_batch(const int vert_offset, const int vert_count, float* output,
706 LLStrider<LLVector3>& vertices, LLStrider<LLVector2>& texcoords, LLStrider<LLVector3>& normals, LLStrider<F32>& weights)
707{
708 assert(0);
709}
710
711#elif LL_DARWIN
712// AltiVec versions of the same...
713
714static inline vector float loadAlign(int offset, vector float *addr)
715{
716 vector float in0 = vec_ld(offset, addr);
717 vector float in1 = vec_ld(offset + 16, addr);
718 vector unsigned char perm = vec_lvsl(0, (unsigned char*)addr);
719
720 return(vec_perm(in0, in1, perm));
721}
722
723static inline void storeAlign(vector float v, int offset, vector float *addr)
724{
725 vector float in0 = vec_ld(offset, addr);
726 vector float in1 = vec_ld(offset + 16, addr);
727 vector unsigned char perm = vec_lvsr(0, (unsigned char *)addr);
728 vector float temp = vec_perm(v, v, perm);
729 vector unsigned char mask = (vector unsigned char)vec_cmpgt(perm, vec_splat_u8(15));
730
731 in0 = vec_sel(in0, temp, (vector unsigned int)mask);
732 in1 = vec_sel(temp, in1, (vector unsigned int)mask);
733
734 vec_st(in0, offset, addr);
735 vec_st(in1, offset + 16, addr);
736}
737
738void blend_SSE_32_32_batch(const int vert_offset, const int vert_count, float* output,
739 LLStrider<LLVector3>& vertices, LLStrider<LLVector2>& texcoords, LLStrider<LLVector3>& normals, LLStrider<F32>& weights)
740{
741 F32 last_weight = F32_MAX;
742// LLMatrix4 &blend_mat = gBlendMat;
743
744 vector float matrix0_0, matrix0_1, matrix0_2, matrix0_3;
745 vector unsigned char out0perm = (vector unsigned char) ( 0x10,0x11,0x12,0x13, 0x14,0x15,0x16,0x17, 0x18,0x19,0x1A,0x1B, 0x0C,0x0D,0x0E,0x0F );
746// vector unsigned char out1perm = (vector unsigned char) ( 0x00,0x01,0x02,0x03, 0x10,0x11,0x12,0x13, 0x14,0x15,0x16,0x17, 0x18,0x19,0x1A,0x1B );
747 vector unsigned char out1perm = (vector unsigned char) ( 0x10,0x11,0x12,0x13, 0x14,0x15,0x16,0x17, 0x18,0x19,0x1A,0x1B, 0x0C,0x0D,0x0E,0x0F );
748
749 vector float zero = (vector float)vec_splat_u32(0);
750
751 for (U32 index = vert_offset; index < vert_offset + vert_count; index++)
752 {
753 F32 w = weights [index]; // register copy of weight
754 F32 *vin = &vertices[index].mV[0]; // pointer to input vertex data, assumed to be V3+T2+N3+whatever
755 F32 *vout = output + index * (AVATAR_VERTEX_BYTES/sizeof(F32)); // pointer to the output vertex data, assumed to be 16 byte aligned
756
757 // MBW -- XXX -- If this isn't the case, this code gets more complicated.
758 if(0x0000000F & (U32)vin)
759 {
760 llerrs << "blend_SSE_batch: input not 16-byte aligned!" << llendl;
761 }
762 if(0x0000000F & (U32)vout)
763 {
764 llerrs << "blend_SSE_batch: output not 16-byte aligned!" << llendl;
765 }
766// if(0x0000000F & (U32)&(blend_mat.mMatrix))
767// {
768// llerrs << "blend_SSE_batch: blend_mat not 16-byte aligned!" << llendl;
769// }
770
771 if (w == last_weight)
772 {
773 // load last blended matrix
774 // Still loaded from last time through the loop.
775// matrix0_0 = vec_ld(0x00, (vector float*)&(blend_mat.mMatrix));
776// matrix0_1 = vec_ld(0x10, (vector float*)&(blend_mat.mMatrix));
777// matrix0_2 = vec_ld(0x20, (vector float*)&(blend_mat.mMatrix));
778// matrix0_3 = vec_ld(0x30, (vector float*)&(blend_mat.mMatrix));
779 }
780 else
781 {
782 last_weight = w;
783 S32 joint = llfloor(w);
784 w -= joint;
785
786 LLMatrix4 &m0 = gJointMat[joint+1];
787 LLMatrix4 &m1 = gJointMat[joint+0];
788
789 // load Matrix 0 into vector registers
790 matrix0_0 = vec_ld(0x00, (vector float*)&(m0.mMatrix));
791 matrix0_1 = vec_ld(0x10, (vector float*)&(m0.mMatrix));
792 matrix0_2 = vec_ld(0x20, (vector float*)&(m0.mMatrix));
793 matrix0_3 = vec_ld(0x30, (vector float*)&(m0.mMatrix));
794
795 // if w == 1.0f, we don't need to blend.
796 // but since we do the trick of blending the matrices, here, if w != 1.0,
797 // we load Matrix 1 into the other 4 SSE registers and blend both matrices
798 // based on the weight (which we load ingo a 16-byte aligned vector: w,w,w,w)
799
800 if (w != 1.0f)
801 {
802 vector float matrix1_0, matrix1_1, matrix1_2, matrix1_3;
803
804 // This loads the weight somewhere in the vector register
805 vector float weight = vec_lde(0, &(w));
806 // and this splats it to all elements.
807 weight = vec_splat(vec_perm(weight, weight, vec_lvsl(0, &(w))), 0);
808
809 // do blending of matrices instead of verts and normals -- faster
810 matrix1_0 = vec_ld(0x00, (vector float*)&(m1.mMatrix));
811 matrix1_1 = vec_ld(0x10, (vector float*)&(m1.mMatrix));
812 matrix1_2 = vec_ld(0x20, (vector float*)&(m1.mMatrix));
813 matrix1_3 = vec_ld(0x30, (vector float*)&(m1.mMatrix));
814
815 // m0[col] = ((m0[col] - m1[col]) * weight) + m1[col];
816 matrix0_0 = vec_madd(vec_sub(matrix0_0, matrix1_0), weight, matrix1_0);
817 matrix0_1 = vec_madd(vec_sub(matrix0_1, matrix1_1), weight, matrix1_1);
818 matrix0_2 = vec_madd(vec_sub(matrix0_2, matrix1_2), weight, matrix1_2);
819 matrix0_3 = vec_madd(vec_sub(matrix0_3, matrix1_3), weight, matrix1_3);
820 }
821
822 // save off blended matrix
823// vec_st(matrix0_0, 0x00, (vector float*)&(blend_mat.mMatrix));
824// vec_st(matrix0_1, 0x10, (vector float*)&(blend_mat.mMatrix));
825// vec_st(matrix0_2, 0x20, (vector float*)&(blend_mat.mMatrix));
826// vec_st(matrix0_3, 0x30, (vector float*)&(blend_mat.mMatrix));
827 }
828
829 // now, we have either a blended matrix in matrix0_0-3 or the original Matrix 0
830 // we then multiply each vertex and normal by this one matrix.
831
832 // For SSE2, we would try to keep the original two matrices in other registers
833 // and avoid reloading them. However, they should ramain in L1 cache in the
834 // current case.
835
836 // One possible optimization would be to sort the vertices by weight instead
837 // of just index (we still want to uniqify). If we note when two or more vertices
838 // share the same weight, we can avoid doing the middle SSE code above and just
839 // re-use the blended matrix for those vertices
840
841
842 // now, we do the actual vertex blending
843
844 vector float in0 = vec_ld(AVATAR_OFFSET_POS, (vector float*)vin);
845 vector float in1 = vec_ld(AVATAR_OFFSET_NORMAL, (vector float*)vin);
846
847 // Matrix multiply vertex
848 vector float out0 = vec_madd
849 (
850 vec_splat(in0, 0),
851 matrix0_0,
852 vec_madd
853 (
854 vec_splat(in0, 1),
855 matrix0_1,
856 vec_madd
857 (
858 vec_splat(in0, 2),
859 matrix0_2,
860 matrix0_3
861 )
862 )
863 );
864
865 // Matrix multiply normal
866 vector float out1 = vec_madd
867 (
868 vec_splat(in1, 0),
869 matrix0_0,
870 vec_madd
871 (
872 vec_splat(in1, 1),
873 matrix0_1,
874 vec_madd
875 (
876 vec_splat(in1, 2),
877 matrix0_2,
878 // no translation for normals
879 (vector float)vec_splat_u32(0)
880 )
881 )
882 );
883
884 // indexed store
885 vec_stl(vec_perm(in0, out0, out0perm), AVATAR_OFFSET_POS, (vector float*)vout); // Pos
886 vec_stl(vec_perm(in1, out1, out1perm), AVATAR_OFFSET_NORMAL, (vector float*)vout); // Norm
887 *(LLVector2*)(vout + (AVATAR_OFFSET_TEX0/sizeof(F32))) = texcoords[index]; // write texcoord into appropriate spot.
888 }
889}
890
891#endif
892
893
894void llDrawElementsBatchBlend(const U32 vert_offset, const U32 vert_count, LLFace *face, const S32 index_count, const U32 *indices)
895{
896 U8* gAGPVertices = gPipeline.bufferGetScratchMemory();
897
898 if (gAGPVertices)
899 {
900 LLStrider<LLVector3> vertices;
901 LLStrider<LLVector3> normals;
902 LLStrider<LLVector2> tcoords0;
903 LLStrider<F32> weights;
904
905 LLStrider<LLVector3> o_vertices;
906 LLStrider<LLVector3> o_normals;
907 LLStrider<LLVector2> o_texcoords0;
908
909
910 LLStrider<LLVector3> binormals;
911 LLStrider<LLVector2> o_texcoords1;
912 // get the source vertices from the draw pool. We index these ourselves, as there was
913 // no guarantee the indices for a single jointmesh were contigious
914
915 LLDrawPool *pool = face->getPool();
916 pool->getVertexStrider (vertices, 0);
917 pool->getTexCoordStrider (tcoords0, 0, 0);
918 pool->getNormalStrider (normals, 0);
919 pool->getBinormalStrider (binormals, 0);
920 pool->getVertexWeightStrider(weights, 0);
921
922 // load the addresses of the output striders
923 o_vertices = (LLVector3*)(gAGPVertices + AVATAR_OFFSET_POS); o_vertices.setStride( AVATAR_VERTEX_BYTES);
924 o_normals = (LLVector3*)(gAGPVertices + AVATAR_OFFSET_NORMAL); o_normals.setStride( AVATAR_VERTEX_BYTES);
925 o_texcoords0= (LLVector2*)(gAGPVertices + AVATAR_OFFSET_TEX0); o_texcoords0.setStride(AVATAR_VERTEX_BYTES);
926 o_texcoords1= (LLVector2*)(gAGPVertices + AVATAR_OFFSET_TEX1); o_texcoords1.setStride(AVATAR_VERTEX_BYTES);
927
928#if !LL_LINUX // !!! *TODO: do the linux implementation
929 if (gGLManager.mSoftwareBlendSSE)
930 {
931 // do SSE blend without binormals or extra texcoords
932 blend_SSE_32_32_batch(vert_offset, vert_count, (float*)gAGPVertices,
933 vertices, tcoords0, normals, weights);
934 }
935 else // fully backwards compatible software blending, no SSE
936#endif
937 {
938 LLVector4 tpos0, tnorm0, tpos1, tnorm1, tbinorm0, tbinorm1;
939 F32 last_weight = F32_MAX;
940 LLMatrix3 gBlendRotMat;
941
942 {
943 for (U32 index=vert_offset; index < vert_offset + vert_count; index++)
944 {
945 // blend by first matrix
946 F32 w = weights [index];
947
948 if (w != last_weight)
949 {
950 last_weight = w;
951
952 S32 joint = llfloor(w);
953 w -= joint;
954
955 LLMatrix4 &m0 = gJointMat[joint+1];
956 LLMatrix4 &m1 = gJointMat[joint+0];
957 LLMatrix3 &n0 = gJointRot[joint+1];
958 LLMatrix3 &n1 = gJointRot[joint+0];
959
960 if (w == 1.0f)
961 {
962 gBlendMat = m0;
963 gBlendRotMat = n0;
964 }
965 else
966 {
967 gBlendMat.mMatrix[VX][VX] = lerp(m1.mMatrix[VX][VX], m0.mMatrix[VX][VX], w);
968 gBlendMat.mMatrix[VX][VY] = lerp(m1.mMatrix[VX][VY], m0.mMatrix[VX][VY], w);
969 gBlendMat.mMatrix[VX][VZ] = lerp(m1.mMatrix[VX][VZ], m0.mMatrix[VX][VZ], w);
970
971 gBlendMat.mMatrix[VY][VX] = lerp(m1.mMatrix[VY][VX], m0.mMatrix[VY][VX], w);
972 gBlendMat.mMatrix[VY][VY] = lerp(m1.mMatrix[VY][VY], m0.mMatrix[VY][VY], w);
973 gBlendMat.mMatrix[VY][VZ] = lerp(m1.mMatrix[VY][VZ], m0.mMatrix[VY][VZ], w);
974
975 gBlendMat.mMatrix[VZ][VX] = lerp(m1.mMatrix[VZ][VX], m0.mMatrix[VZ][VX], w);
976 gBlendMat.mMatrix[VZ][VY] = lerp(m1.mMatrix[VZ][VY], m0.mMatrix[VZ][VY], w);
977 gBlendMat.mMatrix[VZ][VZ] = lerp(m1.mMatrix[VZ][VZ], m0.mMatrix[VZ][VZ], w);
978
979 gBlendMat.mMatrix[VW][VX] = lerp(m1.mMatrix[VW][VX], m0.mMatrix[VW][VX], w);
980 gBlendMat.mMatrix[VW][VY] = lerp(m1.mMatrix[VW][VY], m0.mMatrix[VW][VY], w);
981 gBlendMat.mMatrix[VW][VZ] = lerp(m1.mMatrix[VW][VZ], m0.mMatrix[VW][VZ], w);
982
983 gBlendRotMat.mMatrix[VX][VX] = lerp(n1.mMatrix[VX][VX], n0.mMatrix[VX][VX], w);
984 gBlendRotMat.mMatrix[VX][VY] = lerp(n1.mMatrix[VX][VY], n0.mMatrix[VX][VY], w);
985 gBlendRotMat.mMatrix[VX][VZ] = lerp(n1.mMatrix[VX][VZ], n0.mMatrix[VX][VZ], w);
986
987 gBlendRotMat.mMatrix[VY][VX] = lerp(n1.mMatrix[VY][VX], n0.mMatrix[VY][VX], w);
988 gBlendRotMat.mMatrix[VY][VY] = lerp(n1.mMatrix[VY][VY], n0.mMatrix[VY][VY], w);
989 gBlendRotMat.mMatrix[VY][VZ] = lerp(n1.mMatrix[VY][VZ], n0.mMatrix[VY][VZ], w);
990
991 gBlendRotMat.mMatrix[VZ][VX] = lerp(n1.mMatrix[VZ][VX], n0.mMatrix[VZ][VX], w);
992 gBlendRotMat.mMatrix[VZ][VY] = lerp(n1.mMatrix[VZ][VY], n0.mMatrix[VZ][VY], w);
993 gBlendRotMat.mMatrix[VZ][VZ] = lerp(n1.mMatrix[VZ][VZ], n0.mMatrix[VZ][VZ], w);
994 }
995 }
996
997 // write result
998 o_vertices [index] = vertices[index] * gBlendMat;
999 o_normals [index] = normals [index] * gBlendRotMat;
1000 o_texcoords0[index] = tcoords0[index];
1001
1002 /*
1003 // Verification code. Leave this here. It's useful for keeping the SSE and non-SSE versions in sync.
1004 LLVector3 temp;
1005 temp = tpos0;
1006 if( (o_vertices[index] - temp).magVecSquared() > 0.001f )
1007 {
1008 llerrs << "V SSE: " << o_vertices[index] << " v. " << temp << llendl;
1009 }
1010
1011 temp = tnorm0;
1012 if( (o_normals[index] - temp).magVecSquared() > 0.001f )
1013 {
1014 llerrs << "N SSE: " << o_normals[index] << " v. " << temp << llendl;
1015 }
1016
1017 if( (o_texcoords0[index] - tcoords0[index]).magVecSquared() > 0.001f )
1018 {
1019 llerrs << "T0 SSE: " << o_texcoords0[index] << " v. " << tcoords0[index] << llendl;
1020 }
1021 */
1022 }
1023 }
1024 }
1025
1026#if LL_DARWIN
1027 // *HACK* *CHOKE* *PUKE*
1028 // No way does this belong here.
1029 glFlushVertexArrayRangeAPPLE(AVATAR_VERTEX_BYTES * vert_count, gAGPVertices + (AVATAR_VERTEX_BYTES * vert_offset));
1030#endif
1031 glDrawElements(GL_TRIANGLES, index_count, GL_UNSIGNED_INT, indices); // draw it!
1032 } 544 }
1033 else 545 else
1034 { 546 {
1035 glDrawElements(GL_TRIANGLES, index_count, GL_UNSIGNED_INT, indices); 547 glDrawRangeElements(mode,start,end,count,type,indices);
1036 } 548 }
1037} 549}
1038 550
1039
1040
1041//--------------------------------------------------------------------
1042// DrawElements
1043
1044// works just like glDrawElements, except it assumes GL_TRIANGLES and GL_UNSIGNED_INT indices
1045
1046// why? because the destination buffer may not be the AGP buffer and the eyes do not use blending
1047// separate the eyes into their own drawpools and this code goes away.
1048
1049//--------------------------------------------------------------------
1050
1051void llDrawElements(const S32 count, const U32 *indices, LLFace *face)
1052{
1053 U8* gAGPVertices = gPipeline.bufferGetScratchMemory();
1054
1055 if (gAGPVertices)
1056 {
1057#if LL_DARWIN
1058 U32 minIndex = indices[0];
1059 U32 maxIndex = indices[0];
1060#endif
1061 {
1062 LLStrider<LLVector3> vertices;
1063 LLStrider<LLVector3> normals;
1064 LLStrider<LLVector2> tcoords;
1065 LLStrider<F32> weights;
1066
1067 LLStrider<LLVector3> o_vertices;
1068 LLStrider<LLVector3> o_normals;
1069 LLStrider<LLVector2> o_texcoords0;
1070
1071 LLDrawPool *pool = face->getPool();
1072 pool->getVertexStrider (vertices,0);
1073 pool->getNormalStrider (normals, 0);
1074 pool->getTexCoordStrider (tcoords, 0);
1075
1076 o_vertices = (LLVector3*)(gAGPVertices + AVATAR_OFFSET_POS); o_vertices.setStride( AVATAR_VERTEX_BYTES);
1077 o_normals = (LLVector3*)(gAGPVertices + AVATAR_OFFSET_NORMAL); o_normals.setStride( AVATAR_VERTEX_BYTES);
1078 o_texcoords0= (LLVector2*)(gAGPVertices + AVATAR_OFFSET_TEX0); o_texcoords0.setStride(AVATAR_VERTEX_BYTES);
1079
1080 for (S32 i=0; i < count; i++)
1081 {
1082 U32 index = indices[i];
1083
1084 o_vertices [index] = vertices[index];
1085 o_normals [index] = normals [index];
1086 o_texcoords0[index] = tcoords [index];
1087
1088#if LL_DARWIN
1089 maxIndex = llmax(index, maxIndex);
1090 minIndex = llmin(index, minIndex);
1091#endif
1092 }
1093 }
1094
1095#if LL_DARWIN
1096 // *HACK* *CHOKE* *PUKE*
1097 // No way does this belong here.
1098 glFlushVertexArrayRangeAPPLE(AVATAR_VERTEX_BYTES * (maxIndex + 1 - minIndex), gAGPVertices + (AVATAR_VERTEX_BYTES * minIndex));
1099#endif
1100
1101 glDrawElements(GL_TRIANGLES, count, GL_UNSIGNED_INT, indices);
1102 }
1103 else
1104 {
1105 glDrawElements(GL_TRIANGLES, count, GL_UNSIGNED_INT, indices);
1106 }
1107}
1108
1109
1110//-------------------------------------------------------------------- 551//--------------------------------------------------------------------
1111// LLViewerJointMesh::drawShape() 552// LLViewerJointMesh::drawShape()
1112//-------------------------------------------------------------------- 553//--------------------------------------------------------------------
1113U32 LLViewerJointMesh::drawShape( F32 pixelArea ) 554U32 LLViewerJointMesh::drawShape( F32 pixelArea, BOOL first_pass)
1114{ 555{
1115 if (!mValid || !mVisible) return 0; 556 if (!mValid || !mMesh || !mFace || !mVisible ||
1116 557 mFace->mVertexBuffer.isNull() ||
1117 U32 triangle_count = 0; 558 mMesh->getNumFaces() == 0)
1118
1119 //----------------------------------------------------------------
1120 // if no mesh bail out now
1121 //----------------------------------------------------------------
1122 if ( !mMesh || !mFace)
1123 { 559 {
1124 return 0; 560 return 0;
1125 } 561 }
1126 562
1127 //---------------------------------------------------------------- 563 U32 triangle_count = 0;
1128 // if we have no faces, bail out now
1129 //----------------------------------------------------------------
1130 if ( mMesh->getNumFaces() == 0 )
1131 {
1132 return 0;
1133 }
1134 564
1135 stop_glerror(); 565 stop_glerror();
1136 566
1137 //---------------------------------------------------------------- 567 //----------------------------------------------------------------
1138 // setup current color 568 // setup current color
1139 //---------------------------------------------------------------- 569 //----------------------------------------------------------------
1140 if (gRenderForSelect) 570 if (!gRenderForSelect)
1141 {
1142 S32 name = mFace->getDrawable() ? mFace->getDrawable()->getVObj()->mGLName : 0;
1143 LLColor4U color((U8)(name >> 16), (U8)(name >> 8), (U8)name, 0xff);
1144 LLColor4 color_float(color);
1145
1146 glColor4f(color_float.mV[0], color_float.mV[1], color_float.mV[2], 1.f);
1147 }
1148 else
1149 { 571 {
1150 if ((mFace->getPool()->getVertexShaderLevel() > 0)) 572 if ((mFace->getPool()->getVertexShaderLevel() > 0))
1151 { 573 {
@@ -1169,7 +591,6 @@ U32 LLViewerJointMesh::drawShape( F32 pixelArea )
1169 591
1170 stop_glerror(); 592 stop_glerror();
1171 593
1172// LLGLSSpecular specular(mSpecular, gRenderForSelect ? 0.0f : mShiny);
1173 LLGLSSpecular specular(LLColor4(1.f,1.f,1.f,1.f), gRenderForSelect ? 0.0f : mShiny && !(mFace->getPool()->getVertexShaderLevel() > 0)); 594 LLGLSSpecular specular(LLColor4(1.f,1.f,1.f,1.f), gRenderForSelect ? 0.0f : mShiny && !(mFace->getPool()->getVertexShaderLevel() > 0));
1174 595
1175 LLGLEnable texture_2d((gRenderForSelect && isTransparent()) ? GL_TEXTURE_2D : 0); 596 LLGLEnable texture_2d((gRenderForSelect && isTransparent()) ? GL_TEXTURE_2D : 0);
@@ -1179,11 +600,6 @@ U32 LLViewerJointMesh::drawShape( F32 pixelArea )
1179 //---------------------------------------------------------------- 600 //----------------------------------------------------------------
1180 llassert( !(mTexture.notNull() && mLayerSet) ); // mutually exclusive 601 llassert( !(mTexture.notNull() && mLayerSet) ); // mutually exclusive
1181 602
1182 //GLuint test_image_name = 0;
1183
1184 //
1185 LLGLState force_alpha_test(GL_ALPHA_TEST, isTransparent());
1186
1187 if (mTestImageName) 603 if (mTestImageName)
1188 { 604 {
1189 LLImageGL::bindExternalTexture( mTestImageName, 0, GL_TEXTURE_2D ); 605 LLImageGL::bindExternalTexture( mTestImageName, 0, GL_TEXTURE_2D );
@@ -1236,11 +652,12 @@ U32 LLViewerJointMesh::drawShape( F32 pixelArea )
1236 gImageList.getImage(IMG_DEFAULT_AVATAR)->bind(); 652 gImageList.getImage(IMG_DEFAULT_AVATAR)->bind();
1237 } 653 }
1238 654
655 LLGLDisable tex(gRenderForSelect && !isTransparent() ? GL_TEXTURE_2D : 0);
656
1239 if (gRenderForSelect) 657 if (gRenderForSelect)
1240 { 658 {
1241 if (isTransparent()) 659 if (isTransparent())
1242 { 660 {
1243 //gGLSObjectSelectDepthAlpha.set();
1244 glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_ARB); 661 glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_ARB);
1245 glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_RGB_ARB, GL_REPLACE); 662 glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_RGB_ARB, GL_REPLACE);
1246 glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_ALPHA_ARB, GL_MODULATE); 663 glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_ALPHA_ARB, GL_MODULATE);
@@ -1251,19 +668,14 @@ U32 LLViewerJointMesh::drawShape( F32 pixelArea )
1251 glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_ALPHA_ARB, GL_TEXTURE); // GL_TEXTURE_ENV_COLOR is set in renderPass1 668 glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_ALPHA_ARB, GL_TEXTURE); // GL_TEXTURE_ENV_COLOR is set in renderPass1
1252 glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_ALPHA_ARB, GL_SRC_ALPHA); 669 glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_ALPHA_ARB, GL_SRC_ALPHA);
1253 } 670 }
1254 else
1255 {
1256 //gGLSObjectSelectDepth.set();
1257 }
1258 } 671 }
1259 else 672 else
1260 { 673 {
1261 //---------------------------------------------------------------- 674 //----------------------------------------------------------------
1262 // by default, backface culling is enabled 675 // by default, backface culling is enabled
1263 //---------------------------------------------------------------- 676 //----------------------------------------------------------------
1264 if (sRenderPass == AVATAR_RENDER_PASS_CLOTHING_INNER) 677 /*if (sRenderPass == AVATAR_RENDER_PASS_CLOTHING_INNER)
1265 { 678 {
1266 //LLGLSPipelineAvatar gls_pipeline_avatar;
1267 LLImageGL::bindExternalTexture( sClothingMaskImageName, 1, GL_TEXTURE_2D ); 679 LLImageGL::bindExternalTexture( sClothingMaskImageName, 1, GL_TEXTURE_2D );
1268 680
1269 glClientActiveTextureARB(GL_TEXTURE0_ARB); 681 glClientActiveTextureARB(GL_TEXTURE0_ARB);
@@ -1303,7 +715,6 @@ U32 LLViewerJointMesh::drawShape( F32 pixelArea )
1303 } 715 }
1304 else if (sRenderPass == AVATAR_RENDER_PASS_CLOTHING_OUTER) 716 else if (sRenderPass == AVATAR_RENDER_PASS_CLOTHING_OUTER)
1305 { 717 {
1306 //gGLSPipelineAvatarAlphaPass1.set();
1307 glAlphaFunc(GL_GREATER, 0.1f); 718 glAlphaFunc(GL_GREATER, 0.1f);
1308 LLImageGL::bindExternalTexture( sClothingMaskImageName, 1, GL_TEXTURE_2D ); 719 LLImageGL::bindExternalTexture( sClothingMaskImageName, 1, GL_TEXTURE_2D );
1309 720
@@ -1334,81 +745,48 @@ U32 LLViewerJointMesh::drawShape( F32 pixelArea )
1334 745
1335 glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_ALPHA_ARB, GL_TEXTURE); 746 glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_ALPHA_ARB, GL_TEXTURE);
1336 glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_ALPHA_ARB, GL_SRC_ALPHA); 747 glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_ALPHA_ARB, GL_SRC_ALPHA);
1337 } 748 }*/
1338 else if ( isTransparent())
1339 {
1340 //gGLSNoCullFaces.set();
1341 }
1342 else
1343 {
1344 //gGLSCullFaces.set();
1345 }
1346 } 749 }
1347 750
1348 if (mMesh->hasWeights()) 751 mFace->mVertexBuffer->setBuffer(sRenderMask);
1349 {
1350 uploadJointMatrices();
1351 752
753 U32 start = mMesh->mFaceVertexOffset;
754 U32 end = start + mMesh->mFaceVertexCount - 1;
755 U32 count = mMesh->mFaceIndexCount;
756 U32* indicesp = ((U32*) mFace->mVertexBuffer->getIndicesPointer()) + mMesh->mFaceIndexOffset;
1352 757
758 if (mMesh->hasWeights())
759 {
1353 if ((mFace->getPool()->getVertexShaderLevel() > 0)) 760 if ((mFace->getPool()->getVertexShaderLevel() > 0))
1354 { 761 {
1355 glMatrixMode(GL_MODELVIEW); 762 if (first_pass)
1356 glPushMatrix(); 763 {
1357 glLoadIdentity(); 764 uploadJointMatrices();
1358 765 }
1359 glDrawElements(GL_TRIANGLES, mMesh->mFaceIndexCount, GL_UNSIGNED_INT, mMesh->getIndices()); 766 llDrawRangeElements(GL_TRIANGLES, start, end, count, GL_UNSIGNED_INT, indicesp);
1360
1361 glPopMatrix();
1362 } 767 }
1363 else 768 else
1364 { 769 {
1365 if (mFace->getGeomIndex() < 0) 770 llDrawRangeElements(GL_TRIANGLES, start, end, count, GL_UNSIGNED_INT, indicesp);
1366 {
1367 llerrs << "Invalid geometry index in LLViewerJointMesh::drawShape() " << mFace->getGeomIndex() << llendl;
1368 }
1369
1370 if ((S32)(mMesh->mFaceVertexOffset + mMesh->mFaceVertexCount) > mFace->getGeomCount())
1371 {
1372 ((LLVOAvatar*)mFace->getDrawable()->getVObj())->mRoot.dump();
1373 llerrs << "Rendering outside of vertex bounds with mesh " << mName << " at pixel area " << pixelArea << llendl;
1374 }
1375 llDrawElementsBatchBlend(mMesh->mFaceVertexOffset, mMesh->mFaceVertexCount,
1376 mFace, mMesh->mFaceIndexCount, mMesh->getIndices());
1377 } 771 }
1378
1379 } 772 }
1380 else 773 else
1381 { 774 {
1382 glPushMatrix(); 775 glPushMatrix();
1383 LLMatrix4 jointToWorld = getWorldMatrix(); 776 LLMatrix4 jointToWorld = getWorldMatrix();
1384 jointToWorld *= gCamera->getModelview(); 777 glMultMatrixf((GLfloat*)jointToWorld.mMatrix);
1385 glLoadMatrixf((GLfloat*)jointToWorld.mMatrix); 778 llDrawRangeElements(GL_TRIANGLES, start, end, count, GL_UNSIGNED_INT, indicesp);
1386
1387 if ((mFace->getPool()->getVertexShaderLevel() > 0))
1388 {
1389 glDrawElements(GL_TRIANGLES, mMesh->mFaceIndexCount, GL_UNSIGNED_INT, mMesh->getIndices());
1390 }
1391 else // this else clause handles non-weighted vertices. llDrawElements just copies and draws
1392 {
1393 llDrawElements(mMesh->mFaceIndexCount, mMesh->getIndices(), mFace);
1394 }
1395
1396 glPopMatrix(); 779 glPopMatrix();
1397 } 780 }
1398 781
1399 triangle_count += mMesh->mFaceIndexCount; 782 triangle_count += mMesh->mFaceIndexCount;
1400 783
1401 if (gRenderForSelect)
1402 {
1403 glColor4fv(mColor.mV);
1404 }
1405
1406 if (mTestImageName) 784 if (mTestImageName)
1407 { 785 {
1408 glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); 786 glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
1409 } 787 }
1410 788
1411 if (sRenderPass != AVATAR_RENDER_PASS_SINGLE) 789 /*if (sRenderPass != AVATAR_RENDER_PASS_SINGLE)
1412 { 790 {
1413 LLImageGL::unbindTexture(1, GL_TEXTURE_2D); 791 LLImageGL::unbindTexture(1, GL_TEXTURE_2D);
1414 glActiveTextureARB(GL_TEXTURE1_ARB); 792 glActiveTextureARB(GL_TEXTURE1_ARB);
@@ -1421,7 +799,7 @@ U32 LLViewerJointMesh::drawShape( F32 pixelArea )
1421 799
1422 glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_RGB_ARB, GL_MODULATE); 800 glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_RGB_ARB, GL_MODULATE);
1423 glAlphaFunc(GL_GREATER, 0.01f); 801 glAlphaFunc(GL_GREATER, 0.01f);
1424 } 802 }*/
1425 803
1426 if (mTexture.notNull()) { 804 if (mTexture.notNull()) {
1427 if (!mTexture->getClampS()) { 805 if (!mTexture->getClampS()) {
@@ -1438,19 +816,20 @@ U32 LLViewerJointMesh::drawShape( F32 pixelArea )
1438//----------------------------------------------------------------------------- 816//-----------------------------------------------------------------------------
1439// updateFaceSizes() 817// updateFaceSizes()
1440//----------------------------------------------------------------------------- 818//-----------------------------------------------------------------------------
1441void LLViewerJointMesh::updateFaceSizes(U32 &num_vertices, F32 pixel_area) 819void LLViewerJointMesh::updateFaceSizes(U32 &num_vertices, U32& num_indices, F32 pixel_area)
1442{ 820{
1443 // Do a pre-alloc pass to determine sizes of data. 821 // Do a pre-alloc pass to determine sizes of data.
1444 if (mMesh && mValid) 822 if (mMesh && mValid)
1445 { 823 {
1446 mMesh->mFaceVertexOffset = num_vertices; 824 mMesh->mFaceVertexOffset = num_vertices;
1447 mMesh->mFaceVertexCount = mMesh->getNumVertices(); 825 mMesh->mFaceVertexCount = mMesh->getNumVertices();
826 mMesh->mFaceIndexOffset = num_indices;
827 mMesh->mFaceIndexCount = mMesh->getSharedData()->mNumTriangleIndices;
828
1448 mMesh->getReferenceMesh()->mCurVertexCount = mMesh->mFaceVertexCount; 829 mMesh->getReferenceMesh()->mCurVertexCount = mMesh->mFaceVertexCount;
1449 num_vertices += mMesh->getNumVertices();
1450 830
1451 mMesh->mFaceIndexCount = mMesh->getSharedData()->mNumTriangleIndices; 831 num_vertices += mMesh->getNumVertices();
1452 832 num_indices += mMesh->mFaceIndexCount;
1453 mMesh->getSharedData()->genIndices(mMesh->mFaceVertexOffset);
1454 } 833 }
1455} 834}
1456 835
@@ -1460,9 +839,7 @@ void LLViewerJointMesh::updateFaceSizes(U32 &num_vertices, F32 pixel_area)
1460void LLViewerJointMesh::updateFaceData(LLFace *face, F32 pixel_area, BOOL damp_wind) 839void LLViewerJointMesh::updateFaceData(LLFace *face, F32 pixel_area, BOOL damp_wind)
1461{ 840{
1462 U32 i; 841 U32 i;
1463 842
1464 if (!mValid) return;
1465
1466 mFace = face; 843 mFace = face;
1467 844
1468 LLStrider<LLVector3> verticesp; 845 LLStrider<LLVector3> verticesp;
@@ -1471,13 +848,15 @@ void LLViewerJointMesh::updateFaceData(LLFace *face, F32 pixel_area, BOOL damp_w
1471 LLStrider<LLVector2> tex_coordsp; 848 LLStrider<LLVector2> tex_coordsp;
1472 LLStrider<F32> vertex_weightsp; 849 LLStrider<F32> vertex_weightsp;
1473 LLStrider<LLVector4> clothing_weightsp; 850 LLStrider<LLVector4> clothing_weightsp;
851 LLStrider<U32> indicesp;
1474 852
1475 // Copy data into the faces from the polymesh data. 853 // Copy data into the faces from the polymesh data.
1476 if (mMesh) 854 if (mMesh && mValid)
1477 { 855 {
1478 if (mMesh->getNumVertices()) 856 if (mMesh->getNumVertices())
1479 { 857 {
1480 S32 index = face->getGeometryAvatar(verticesp, normalsp, binormalsp, tex_coordsp, vertex_weightsp, clothing_weightsp); 858 S32 index = face->getGeometryAvatar(verticesp, normalsp, binormalsp, tex_coordsp, vertex_weightsp, clothing_weightsp);
859 face->mVertexBuffer->getIndexStrider(indicesp);
1481 860
1482 if (-1 == index) 861 if (-1 == index)
1483 { 862 {
@@ -1493,11 +872,20 @@ void LLViewerJointMesh::updateFaceData(LLFace *face, F32 pixel_area, BOOL damp_w
1493 vertex_weightsp[mMesh->mFaceVertexOffset + i] = *(mMesh->getWeights() + i); 872 vertex_weightsp[mMesh->mFaceVertexOffset + i] = *(mMesh->getWeights() + i);
1494 if (damp_wind) 873 if (damp_wind)
1495 { 874 {
1496 clothing_weightsp[mMesh->mFaceVertexOffset + i].setVec(0,0,0,0); 875 clothing_weightsp[mMesh->mFaceVertexOffset + i] = LLVector4(0,0,0,0);
1497 } 876 }
1498 else 877 else
1499 { 878 {
1500 clothing_weightsp[mMesh->mFaceVertexOffset + i].setVec(*(mMesh->getClothingWeights() + i)); 879 clothing_weightsp[mMesh->mFaceVertexOffset + i] = (*(mMesh->getClothingWeights() + i));
880 }
881 }
882
883 for (S32 i = 0; i < mMesh->getNumFaces(); i++)
884 {
885 for (U32 j = 0; j < 3; j++)
886 {
887 U32 k = i*3+j+mMesh->mFaceIndexOffset;
888 indicesp[k] = mMesh->getFaces()[i][j] + mMesh->mFaceVertexOffset;
1501 } 889 }
1502 } 890 }
1503 } 891 }
@@ -1514,6 +902,92 @@ BOOL LLViewerJointMesh::updateLOD(F32 pixel_area, BOOL activate)
1514 return (valid != activate); 902 return (valid != activate);
1515} 903}
1516 904
905void LLViewerJointMesh::updateGeometry()
906{
907 if (mValid && mMesh && mFace &&
908 mMesh->hasWeights() &&
909 mFace->mVertexBuffer.notNull() &&
910 gPipeline.getVertexShaderLevel(LLPipeline::SHADER_AVATAR) == 0)
911 {
912 uploadJointMatrices();
913 LLStrider<LLVector3> o_vertices;
914 LLStrider<LLVector3> o_normals;
915
916 //get vertex and normal striders
917 LLVertexBuffer *buffer = mFace->mVertexBuffer;
918 buffer->getVertexStrider(o_vertices, 0);
919 buffer->getNormalStrider(o_normals, 0);
920
921 {
922 LLVector4 tpos0, tnorm0, tpos1, tnorm1, tbinorm0, tbinorm1;
923 F32 last_weight = F32_MAX;
924 LLMatrix3 gBlendRotMat;
925
926
927 for (U32 index= 0; index < mMesh->getNumVertices(); index++)
928 {
929 // blend by first matrix
930 F32 w = mMesh->getWeights()[index];
931
932 if (w != last_weight)
933 {
934 last_weight = w;
935
936 S32 joint = llfloor(w);
937 w -= joint;
938
939 LLMatrix4 &m0 = gJointMat[joint+1];
940 LLMatrix4 &m1 = gJointMat[joint+0];
941 LLMatrix3 &n0 = gJointRot[joint+1];
942 LLMatrix3 &n1 = gJointRot[joint+0];
943
944 if (w == 1.0f)
945 {
946 gBlendMat = m0;
947 gBlendRotMat = n0;
948 }
949 else
950 {
951 gBlendMat.mMatrix[VX][VX] = lerp(m1.mMatrix[VX][VX], m0.mMatrix[VX][VX], w);
952 gBlendMat.mMatrix[VX][VY] = lerp(m1.mMatrix[VX][VY], m0.mMatrix[VX][VY], w);
953 gBlendMat.mMatrix[VX][VZ] = lerp(m1.mMatrix[VX][VZ], m0.mMatrix[VX][VZ], w);
954
955 gBlendMat.mMatrix[VY][VX] = lerp(m1.mMatrix[VY][VX], m0.mMatrix[VY][VX], w);
956 gBlendMat.mMatrix[VY][VY] = lerp(m1.mMatrix[VY][VY], m0.mMatrix[VY][VY], w);
957 gBlendMat.mMatrix[VY][VZ] = lerp(m1.mMatrix[VY][VZ], m0.mMatrix[VY][VZ], w);
958
959 gBlendMat.mMatrix[VZ][VX] = lerp(m1.mMatrix[VZ][VX], m0.mMatrix[VZ][VX], w);
960 gBlendMat.mMatrix[VZ][VY] = lerp(m1.mMatrix[VZ][VY], m0.mMatrix[VZ][VY], w);
961 gBlendMat.mMatrix[VZ][VZ] = lerp(m1.mMatrix[VZ][VZ], m0.mMatrix[VZ][VZ], w);
962
963 gBlendMat.mMatrix[VW][VX] = lerp(m1.mMatrix[VW][VX], m0.mMatrix[VW][VX], w);
964 gBlendMat.mMatrix[VW][VY] = lerp(m1.mMatrix[VW][VY], m0.mMatrix[VW][VY], w);
965 gBlendMat.mMatrix[VW][VZ] = lerp(m1.mMatrix[VW][VZ], m0.mMatrix[VW][VZ], w);
966
967 gBlendRotMat.mMatrix[VX][VX] = lerp(n1.mMatrix[VX][VX], n0.mMatrix[VX][VX], w);
968 gBlendRotMat.mMatrix[VX][VY] = lerp(n1.mMatrix[VX][VY], n0.mMatrix[VX][VY], w);
969 gBlendRotMat.mMatrix[VX][VZ] = lerp(n1.mMatrix[VX][VZ], n0.mMatrix[VX][VZ], w);
970
971 gBlendRotMat.mMatrix[VY][VX] = lerp(n1.mMatrix[VY][VX], n0.mMatrix[VY][VX], w);
972 gBlendRotMat.mMatrix[VY][VY] = lerp(n1.mMatrix[VY][VY], n0.mMatrix[VY][VY], w);
973 gBlendRotMat.mMatrix[VY][VZ] = lerp(n1.mMatrix[VY][VZ], n0.mMatrix[VY][VZ], w);
974
975 gBlendRotMat.mMatrix[VZ][VX] = lerp(n1.mMatrix[VZ][VX], n0.mMatrix[VZ][VX], w);
976 gBlendRotMat.mMatrix[VZ][VY] = lerp(n1.mMatrix[VZ][VY], n0.mMatrix[VZ][VY], w);
977 gBlendRotMat.mMatrix[VZ][VZ] = lerp(n1.mMatrix[VZ][VZ], n0.mMatrix[VZ][VZ], w);
978 }
979 }
980
981 // write result
982 U32 bidx = index + mMesh->mFaceVertexOffset;
983
984 o_vertices[bidx] = mMesh->getCoords()[index] * gBlendMat;
985 o_normals[bidx] = mMesh->getNormals()[index] * gBlendRotMat;
986 }
987 }
988 }
989}
990
1517void LLViewerJointMesh::dump() 991void LLViewerJointMesh::dump()
1518{ 992{
1519 if (mValid) 993 if (mValid)
diff --git a/linden/indra/newview/llviewerjointmesh.h b/linden/indra/newview/llviewerjointmesh.h
index 30b2f29..591b21c 100644
--- a/linden/indra/newview/llviewerjointmesh.h
+++ b/linden/indra/newview/llviewerjointmesh.h
@@ -133,11 +133,12 @@ public:
133 // overloaded from base class 133 // overloaded from base class
134 /*virtual*/ void drawBone(); 134 /*virtual*/ void drawBone();
135 /*virtual*/ BOOL isTransparent(); 135 /*virtual*/ BOOL isTransparent();
136 /*virtual*/ U32 drawShape( F32 pixelArea ); 136 /*virtual*/ U32 drawShape( F32 pixelArea, BOOL first_pass );
137 137
138 /*virtual*/ void updateFaceSizes(U32 &num_vertices, F32 pixel_area); 138 /*virtual*/ void updateFaceSizes(U32 &num_vertices, U32& num_indices, F32 pixel_area);
139 /*virtual*/ void updateFaceData(LLFace *face, F32 pixel_area, BOOL damp_wind = FALSE); 139 /*virtual*/ void updateFaceData(LLFace *face, F32 pixel_area, BOOL damp_wind = FALSE);
140 /*virtual*/ BOOL updateLOD(F32 pixel_area, BOOL activate); 140 /*virtual*/ BOOL updateLOD(F32 pixel_area, BOOL activate);
141 /*virtual*/ void updateGeometry();
141 /*virtual*/ void dump(); 142 /*virtual*/ void dump();
142 143
143 void setIsTransparent(BOOL is_transparent) { mIsTransparent = is_transparent; } 144 void setIsTransparent(BOOL is_transparent) { mIsTransparent = is_transparent; }
diff --git a/linden/indra/newview/llviewerjointshape.cpp b/linden/indra/newview/llviewerjointshape.cpp
index d40d8c3..c22cfbe 100644
--- a/linden/indra/newview/llviewerjointshape.cpp
+++ b/linden/indra/newview/llviewerjointshape.cpp
@@ -155,7 +155,7 @@ BOOL LLViewerJointShape::isTransparent()
155//-------------------------------------------------------------------- 155//--------------------------------------------------------------------
156// drawShape() 156// drawShape()
157//-------------------------------------------------------------------- 157//--------------------------------------------------------------------
158U32 LLViewerJointShape::drawShape( F32 pixelArea ) 158U32 LLViewerJointShape::drawShape( F32 pixelArea, BOOL first_pass )
159{ 159{
160 U32 triangle_count = 0; 160 U32 triangle_count = 0;
161 161
diff --git a/linden/indra/newview/llviewerjointshape.h b/linden/indra/newview/llviewerjointshape.h
index 029c588..28d2c09 100644
--- a/linden/indra/newview/llviewerjointshape.h
+++ b/linden/indra/newview/llviewerjointshape.h
@@ -86,7 +86,7 @@ public:
86 virtual void drawBone(); 86 virtual void drawBone();
87 virtual BOOL isTransparent(); 87 virtual BOOL isTransparent();
88 /*virutal*/ BOOL isAnimatable() { return FALSE; } 88 /*virutal*/ BOOL isAnimatable() { return FALSE; }
89 /*virtual*/ U32 drawShape( F32 pixelArea ); 89 /*virtual*/ U32 drawShape( F32 pixelArea, BOOL first_pass );
90}; 90};
91 91
92#endif // LL_LLVIEWERJOINTSHAPE_H 92#endif // LL_LLVIEWERJOINTSHAPE_H
diff --git a/linden/indra/newview/llviewerkeyboard.cpp b/linden/indra/newview/llviewerkeyboard.cpp
index c5ada54..30fa19a 100644
--- a/linden/indra/newview/llviewerkeyboard.cpp
+++ b/linden/indra/newview/llviewerkeyboard.cpp
@@ -703,12 +703,12 @@ S32 LLViewerKeyboard::loadBindings(const char *filename)
703{ 703{
704 FILE *fp; 704 FILE *fp;
705 const S32 BUFFER_SIZE = 2048; 705 const S32 BUFFER_SIZE = 2048;
706 char buffer[BUFFER_SIZE]; 706 char buffer[BUFFER_SIZE]; /* Flawfinder: ignore */
707 // *NOTE: This buffer size is hard coded into scanf() below. 707 // *NOTE: This buffer size is hard coded into scanf() below.
708 char mode_string[MAX_STRING]; 708 char mode_string[MAX_STRING]; /* Flawfinder: ignore */
709 char key_string[MAX_STRING]; 709 char key_string[MAX_STRING]; /* Flawfinder: ignore */
710 char mask_string[MAX_STRING]; 710 char mask_string[MAX_STRING]; /* Flawfinder: ignore */
711 char function_string[MAX_STRING]; 711 char function_string[MAX_STRING]; /* Flawfinder: ignore */
712 S32 mode = MODE_THIRD_PERSON; 712 S32 mode = MODE_THIRD_PERSON;
713 KEY key = 0; 713 KEY key = 0;
714 MASK mask = 0; 714 MASK mask = 0;
@@ -716,10 +716,15 @@ S32 LLViewerKeyboard::loadBindings(const char *filename)
716 S32 binding_count = 0; 716 S32 binding_count = 0;
717 S32 line_count = 0; 717 S32 line_count = 0;
718 718
719 fp = LLFile::fopen(filename, "r"); 719 fp = LLFile::fopen(filename, "r"); /* Flawfinder: ignore */
720 720
721 if (!fp) 721 if (!fp)
722 { 722 {
723 if(!filename)
724 {
725 llerrs << " No filename specified" << llendl;
726 return 0;
727 }
723 return 0; 728 return 0;
724 } 729 }
725 730
@@ -734,7 +739,13 @@ S32 LLViewerKeyboard::loadBindings(const char *filename)
734 if (buffer[0] == '#' || buffer[0] == '\n') continue; 739 if (buffer[0] == '#' || buffer[0] == '\n') continue;
735 740
736 // grab the binding strings 741 // grab the binding strings
737 tokens_read = sscanf(buffer, "%254s %254s %254s %254s", mode_string, key_string, mask_string, function_string); 742 tokens_read = sscanf( /* Flawfinder: ignore */
743 buffer,
744 "%254s %254s %254s %254s",
745 mode_string,
746 key_string,
747 mask_string,
748 function_string);
738 749
739 if (tokens_read == EOF) 750 if (tokens_read == EOF)
740 { 751 {
diff --git a/linden/indra/newview/llviewermenu.cpp b/linden/indra/newview/llviewermenu.cpp
index ab400de..217fb80 100644
--- a/linden/indra/newview/llviewermenu.cpp
+++ b/linden/indra/newview/llviewermenu.cpp
@@ -63,6 +63,7 @@
63 63
64// newview includes 64// newview includes
65#include "llagent.h" 65#include "llagent.h"
66
66#include "llagentpilot.h" 67#include "llagentpilot.h"
67#include "llbox.h" 68#include "llbox.h"
68#include "llcallingcard.h" 69#include "llcallingcard.h"
@@ -75,7 +76,6 @@
75#include "lldir.h" 76#include "lldir.h"
76#include "lldrawable.h" 77#include "lldrawable.h"
77#include "lldrawpoolalpha.h" 78#include "lldrawpoolalpha.h"
78#include "lldrawpoolhud.h"
79#include "lldrawpooltree.h" 79#include "lldrawpooltree.h"
80#include "llface.h" 80#include "llface.h"
81#include "llfirstuse.h" 81#include "llfirstuse.h"
@@ -107,7 +107,6 @@
107#include "llfloaterland.h" 107#include "llfloaterland.h"
108#include "llfloaterlandholdings.h" 108#include "llfloaterlandholdings.h"
109#include "llfloatermap.h" 109#include "llfloatermap.h"
110#include "llfloateraccounthistory.h"
111#include "llfloaterimagepreview.h" 110#include "llfloaterimagepreview.h"
112#include "llfloatermute.h" 111#include "llfloatermute.h"
113#include "llfloaternamedesc.h" 112#include "llfloaternamedesc.h"
@@ -282,7 +281,6 @@ typedef LLMemberListener<LLView> view_listener_t;
282// 281//
283// Local prototypes 282// Local prototypes
284// 283//
285BOOL enable_attach(void*);
286void handle_leave_group(void *); 284void handle_leave_group(void *);
287 285
288// File Menu 286// File Menu
@@ -294,6 +292,7 @@ BOOL enable_save_as(void *);
294 292
295// Edit menu 293// Edit menu
296void handle_dump_group_info(void *); 294void handle_dump_group_info(void *);
295void handle_dump_capabilities_info(void *);
297void handle_dump_focus(void*); 296void handle_dump_focus(void*);
298 297
299void handle_region_dump_settings(void*); 298void handle_region_dump_settings(void*);
@@ -354,9 +353,6 @@ BOOL check_toggle_hacked_godmode(void*);
354void toggle_glow(void *); 353void toggle_glow(void *);
355BOOL check_glow(void *); 354BOOL check_glow(void *);
356 355
357void toggle_vbo(void *);
358BOOL check_vbo(void *);
359
360void toggle_vertex_shaders(void *); 356void toggle_vertex_shaders(void *);
361BOOL check_vertex_shaders(void *); 357BOOL check_vertex_shaders(void *);
362 358
@@ -438,9 +434,6 @@ BOOL get_visibility(void*);
438void request_friendship(const LLUUID& agent_id); 434void request_friendship(const LLUUID& agent_id);
439 435
440// Tools menu 436// Tools menu
441void handle_first_tool(void*);
442void handle_next_tool(void*);
443void handle_previous_tool(void*);
444void handle_force_unlock(void*); 437void handle_force_unlock(void*);
445void handle_selected_texture_info(void*); 438void handle_selected_texture_info(void*);
446void handle_dump_image_list(void*); 439void handle_dump_image_list(void*);
@@ -448,8 +441,6 @@ void handle_dump_image_list(void*);
448void handle_fullscreen_debug(void*); 441void handle_fullscreen_debug(void*);
449void handle_crash(void*); 442void handle_crash(void*);
450void handle_dump_followcam(void*); 443void handle_dump_followcam(void*);
451void handle_viewer_enable_circuit_log(void*);
452void handle_viewer_disable_circuit_log(void*);
453void handle_viewer_enable_message_log(void*); 444void handle_viewer_enable_message_log(void*);
454void handle_viewer_disable_message_log(void*); 445void handle_viewer_disable_message_log(void*);
455void handle_send_postcard(void*); 446void handle_send_postcard(void*);
@@ -565,52 +556,14 @@ void init_menus()
565 // Main menu bar 556 // Main menu bar
566 // 557 //
567 gMenuHolder = new LLViewerMenuHolderGL(); 558 gMenuHolder = new LLViewerMenuHolderGL();
568 gMenuHolder->setRect(LLRect(0, top - MENU_BAR_HEIGHT, width, STATUS_BAR_HEIGHT)); 559 gMenuHolder->setRect(LLRect(0, top, width, 0));
569 gMenuHolder->setFollowsAll(); 560 gMenuHolder->setFollowsAll();
570 561
571 LLMenuGL::sDefaultMenuContainer = gMenuHolder; 562 LLMenuGL::sMenuContainer = gMenuHolder;
572 563
573 // Initialize actions 564 // Initialize actions
574 initialize_menu_actions(); 565 initialize_menu_actions();
575 566
576 gMenuBarView = (LLMenuBarGL*)gUICtrlFactory->buildMenu("menu_viewer.xml", gMenuHolder);
577 gMenuBarView->setRect(LLRect(0, top, width, top - MENU_BAR_HEIGHT));
578 gViewerWindow->getRootView()->addChild(gMenuBarView);
579
580 // menu holder appears on top of menu bar so you can see the menu title
581 // flash when an item is triggered (the flash occurs in the holder)
582 gViewerWindow->getRootView()->addChild(gMenuHolder);
583
584 gMenuHolder->childSetLabelArg("Upload Image", "[COST]", "10");
585 gMenuHolder->childSetLabelArg("Upload Sound", "[COST]", "10");
586 gMenuHolder->childSetLabelArg("Upload Animation", "[COST]", "10");
587 gMenuHolder->childSetLabelArg("Bulk Upload", "[COST]", "10");
588
589 gAFKMenu = (LLMenuItemCallGL*)gMenuBarView->getChildByName("Set Away", TRUE);
590 gBusyMenu = (LLMenuItemCallGL*)gMenuBarView->getChildByName("Set Busy", TRUE);
591 gAttachSubMenu = gMenuBarView->getChildMenuByName("Attach Object", TRUE);
592 gDetachSubMenu = gMenuBarView->getChildMenuByName("Detach Object", TRUE);
593
594 if (gAgent.mAccess < SIM_ACCESS_MATURE)
595 {
596 gMenuBarView->getChildByName("Menu Underpants", TRUE)->setVisible(FALSE);
597 gMenuBarView->getChildByName("Menu Undershirt", TRUE)->setVisible(FALSE);
598 }
599
600 // TomY TODO convert these two
601 LLMenuGL*menu;
602 menu = new LLMenuGL(CLIENT_MENU_NAME);
603 init_client_menu(menu);
604 gMenuBarView->appendMenu( menu );
605 menu->updateParent(gMenuHolder);
606
607 menu = new LLMenuGL(SERVER_MENU_NAME);
608 init_server_menu(menu);
609 gMenuBarView->appendMenu( menu );
610 menu->updateParent(gMenuHolder);
611
612 gMenuBarView->createJumpKeys();
613
614 /// 567 ///
615 /// Popup menu 568 /// Popup menu
616 /// 569 ///
@@ -653,6 +606,16 @@ void init_menus()
653 /// 606 ///
654 LLColor4 color; 607 LLColor4 color;
655 608
609 LLColor4 pie_color = gColors.getColor("PieMenuBgColor");
610 gPieSelf->setBackgroundColor( pie_color );
611 gPieAvatar->setBackgroundColor( pie_color );
612 gPieObject->setBackgroundColor( pie_color );
613 gPieAttachment->setBackgroundColor( pie_color );
614 gPieLand->setBackgroundColor( pie_color );
615
616 color = gColors.getColor( "MenuPopupBgColor" );
617 gPopupMenuView->setBackgroundColor( color );
618
656 // If we are not in production, use a different color to make it apparent. 619 // If we are not in production, use a different color to make it apparent.
657 if (gInProductionGrid) 620 if (gInProductionGrid)
658 { 621 {
@@ -662,18 +625,45 @@ void init_menus()
662 { 625 {
663 color = gColors.getColor( "MenuNonProductionBgColor" ); 626 color = gColors.getColor( "MenuNonProductionBgColor" );
664 } 627 }
665 628 gMenuBarView = (LLMenuBarGL*)gUICtrlFactory->buildMenu("menu_viewer.xml", gMenuHolder);
629 gMenuBarView->setRect(LLRect(0, top, 0, top - MENU_BAR_HEIGHT));
666 gMenuBarView->setBackgroundColor( color ); 630 gMenuBarView->setBackgroundColor( color );
667 631
668 LLColor4 pie_color = gColors.getColor("PieMenuBgColor"); 632 gMenuHolder->addChild(gMenuBarView);
669 gPieSelf->setBackgroundColor( pie_color ); 633
670 gPieAvatar->setBackgroundColor( pie_color ); 634 // menu holder appears on top of menu bar so you can see the menu title
671 gPieObject->setBackgroundColor( pie_color ); 635 // flash when an item is triggered (the flash occurs in the holder)
672 gPieAttachment->setBackgroundColor( pie_color ); 636 gViewerWindow->getRootView()->addChild(gMenuHolder);
673 gPieLand->setBackgroundColor( pie_color );
674 637
675 color = gColors.getColor( "MenuPopupBgColor" ); 638 gMenuHolder->childSetLabelArg("Upload Image", "[COST]", "10");
676 gPopupMenuView->setBackgroundColor( color ); 639 gMenuHolder->childSetLabelArg("Upload Sound", "[COST]", "10");
640 gMenuHolder->childSetLabelArg("Upload Animation", "[COST]", "10");
641 gMenuHolder->childSetLabelArg("Bulk Upload", "[COST]", "10");
642
643 gAFKMenu = (LLMenuItemCallGL*)gMenuBarView->getChildByName("Set Away", TRUE);
644 gBusyMenu = (LLMenuItemCallGL*)gMenuBarView->getChildByName("Set Busy", TRUE);
645 gAttachSubMenu = gMenuBarView->getChildMenuByName("Attach Object", TRUE);
646 gDetachSubMenu = gMenuBarView->getChildMenuByName("Detach Object", TRUE);
647
648 if (gAgent.mAccess < SIM_ACCESS_MATURE)
649 {
650 gMenuBarView->getChildByName("Menu Underpants", TRUE)->setVisible(FALSE);
651 gMenuBarView->getChildByName("Menu Undershirt", TRUE)->setVisible(FALSE);
652 }
653
654 // TomY TODO convert these two
655 LLMenuGL*menu;
656 menu = new LLMenuGL(CLIENT_MENU_NAME);
657 init_client_menu(menu);
658 gMenuBarView->appendMenu( menu );
659 menu->updateParent(LLMenuGL::sMenuContainer);
660
661 menu = new LLMenuGL(SERVER_MENU_NAME);
662 init_server_menu(menu);
663 gMenuBarView->appendMenu( menu );
664 menu->updateParent(LLMenuGL::sMenuContainer);
665
666 gMenuBarView->createJumpKeys();
677 667
678 // Let land based option enable when parcel changes 668 // Let land based option enable when parcel changes
679 gMenuParcelObserver = new LLMenuParcelObserver(); 669 gMenuParcelObserver = new LLMenuParcelObserver();
@@ -746,6 +736,8 @@ void init_client_menu(LLMenuGL* menu)
746 &handle_region_dump_settings, NULL)); 736 &handle_region_dump_settings, NULL));
747 sub->append(new LLMenuItemCallGL("Group Info to Debug Console", 737 sub->append(new LLMenuItemCallGL("Group Info to Debug Console",
748 &handle_dump_group_info, NULL, NULL)); 738 &handle_dump_group_info, NULL, NULL));
739 sub->append(new LLMenuItemCallGL("Capabilities Info to Debug Console",
740 &handle_dump_capabilities_info, NULL, NULL));
749 sub->createJumpKeys(); 741 sub->createJumpKeys();
750 } 742 }
751 743
@@ -783,6 +775,12 @@ void init_client_menu(LLMenuGL* menu)
783 menu->append(new LLMenuItemToggleGL("Quiet Snapshots to Disk", 775 menu->append(new LLMenuItemToggleGL("Quiet Snapshots to Disk",
784 &gQuietSnapshot)); 776 &gQuietSnapshot));
785 777
778 menu->append(new LLMenuItemCheckGL( "Compress Snapshots to Disk",
779 &menu_toggle_control,
780 NULL,
781 &menu_check_control,
782 (void*)"CompressSnapshotsToDisk"));
783
786 menu->append(new LLMenuItemCheckGL("Show Mouselook Crosshairs", 784 menu->append(new LLMenuItemCheckGL("Show Mouselook Crosshairs",
787 &menu_toggle_control, 785 &menu_toggle_control,
788 NULL, 786 NULL,
@@ -836,10 +834,6 @@ void init_client_menu(LLMenuGL* menu)
836 LLMenuGL* sub = NULL; 834 LLMenuGL* sub = NULL;
837 sub = new LLMenuGL("Network"); 835 sub = new LLMenuGL("Network");
838 836
839 sub->append(new LLMenuItemCallGL("Enable Circuit Log",
840 &handle_viewer_enable_circuit_log, NULL));
841 sub->append(new LLMenuItemCallGL("Disable Circuit Log",
842 &handle_viewer_disable_circuit_log, NULL));
843 sub->append(new LLMenuItemCallGL("Enable Message Log", 837 sub->append(new LLMenuItemCallGL("Enable Message Log",
844 &handle_viewer_enable_message_log, NULL)); 838 &handle_viewer_enable_message_log, NULL));
845 sub->append(new LLMenuItemCallGL("Disable Message Log", 839 sub->append(new LLMenuItemCallGL("Disable Message Log",
@@ -909,6 +903,11 @@ void init_client_menu(LLMenuGL* menu)
909 menu->append(new LLMenuItemToggleGL("Disable Camera Constraints", 903 menu->append(new LLMenuItemToggleGL("Disable Camera Constraints",
910 &LLViewerCamera::sDisableCameraConstraints)); 904 &LLViewerCamera::sDisableCameraConstraints));
911 905
906 menu->append(new LLMenuItemCheckGL("Mouse Smoothing",
907 &menu_toggle_control,
908 NULL,
909 &menu_check_control,
910 (void*) "MouseSmooth"));
912 menu->appendSeparator(); 911 menu->appendSeparator();
913 912
914 menu->append(new LLMenuItemCheckGL( "Console Window", 913 menu->append(new LLMenuItemCheckGL( "Console Window",
@@ -1004,6 +1003,7 @@ void init_debug_ui_menu(LLMenuGL* menu)
1004 menu->append(new LLMenuItemToggleGL("Debug SelectMgr", &gDebugSelectMgr)); 1003 menu->append(new LLMenuItemToggleGL("Debug SelectMgr", &gDebugSelectMgr));
1005 menu->append(new LLMenuItemToggleGL("Debug Clicks", &gDebugClicks)); 1004 menu->append(new LLMenuItemToggleGL("Debug Clicks", &gDebugClicks));
1006 menu->append(new LLMenuItemToggleGL("Debug Views", &LLView::sDebugRects)); 1005 menu->append(new LLMenuItemToggleGL("Debug Views", &LLView::sDebugRects));
1006 menu->append(new LLMenuItemCheckGL("Show Name Tooltips", toggle_show_xui_names, NULL, check_show_xui_names, NULL));
1007 menu->append(new LLMenuItemToggleGL("Debug Mouse Events", &LLView::sDebugMouseHandling)); 1007 menu->append(new LLMenuItemToggleGL("Debug Mouse Events", &LLView::sDebugMouseHandling));
1008 menu->append(new LLMenuItemToggleGL("Debug Keys", &LLView::sDebugKeys)); 1008 menu->append(new LLMenuItemToggleGL("Debug Keys", &LLView::sDebugKeys));
1009 menu->append(new LLMenuItemToggleGL("Debug WindowProc", &gDebugWindowProc)); 1009 menu->append(new LLMenuItemToggleGL("Debug WindowProc", &gDebugWindowProc));
@@ -1036,56 +1036,56 @@ void init_debug_rendering_menu(LLMenuGL* menu)
1036 menu->appendMenu(sub_menu); 1036 menu->appendMenu(sub_menu);
1037 1037
1038 sub_menu->append(new LLMenuItemCheckGL("Simple", 1038 sub_menu->append(new LLMenuItemCheckGL("Simple",
1039 &LLPipeline::toggleRenderType, NULL, 1039 &LLPipeline::toggleRenderTypeControl, NULL,
1040 &LLPipeline::toggleRenderTypeControl, 1040 &LLPipeline::hasRenderTypeControl,
1041 (void*)LLPipeline::RENDER_TYPE_SIMPLE, '1', MASK_CONTROL|MASK_ALT|MASK_SHIFT)); 1041 (void*)LLPipeline::RENDER_TYPE_SIMPLE, '1', MASK_CONTROL|MASK_ALT|MASK_SHIFT));
1042 sub_menu->append(new LLMenuItemCheckGL("Alpha", 1042 sub_menu->append(new LLMenuItemCheckGL("Alpha",
1043 &LLPipeline::toggleRenderType, NULL, 1043 &LLPipeline::toggleRenderTypeControl, NULL,
1044 &LLPipeline::toggleRenderTypeControl, 1044 &LLPipeline::hasRenderTypeControl,
1045 (void*)LLPipeline::RENDER_TYPE_ALPHA, '2', MASK_CONTROL|MASK_ALT|MASK_SHIFT)); 1045 (void*)LLPipeline::RENDER_TYPE_ALPHA, '2', MASK_CONTROL|MASK_ALT|MASK_SHIFT));
1046 sub_menu->append(new LLMenuItemCheckGL("Tree", 1046 sub_menu->append(new LLMenuItemCheckGL("Tree",
1047 &LLPipeline::toggleRenderType, NULL, 1047 &LLPipeline::toggleRenderTypeControl, NULL,
1048 &LLPipeline::toggleRenderTypeControl, 1048 &LLPipeline::hasRenderTypeControl,
1049 (void*)LLPipeline::RENDER_TYPE_TREE, '3', MASK_CONTROL|MASK_ALT|MASK_SHIFT)); 1049 (void*)LLPipeline::RENDER_TYPE_TREE, '3', MASK_CONTROL|MASK_ALT|MASK_SHIFT));
1050 sub_menu->append(new LLMenuItemCheckGL("Character", 1050 sub_menu->append(new LLMenuItemCheckGL("Character",
1051 &LLPipeline::toggleRenderType, NULL, 1051 &LLPipeline::toggleRenderTypeControl, NULL,
1052 &LLPipeline::toggleRenderTypeControl, 1052 &LLPipeline::hasRenderTypeControl,
1053 (void*)LLPipeline::RENDER_TYPE_AVATAR, '4', MASK_CONTROL|MASK_ALT|MASK_SHIFT)); 1053 (void*)LLPipeline::RENDER_TYPE_AVATAR, '4', MASK_CONTROL|MASK_ALT|MASK_SHIFT));
1054 sub_menu->append(new LLMenuItemCheckGL("SurfacePatch", 1054 sub_menu->append(new LLMenuItemCheckGL("SurfacePatch",
1055 &LLPipeline::toggleRenderType, NULL, 1055 &LLPipeline::toggleRenderTypeControl, NULL,
1056 &LLPipeline::toggleRenderTypeControl, 1056 &LLPipeline::hasRenderTypeControl,
1057 (void*)LLPipeline::RENDER_TYPE_TERRAIN, '5', MASK_CONTROL|MASK_ALT|MASK_SHIFT)); 1057 (void*)LLPipeline::RENDER_TYPE_TERRAIN, '5', MASK_CONTROL|MASK_ALT|MASK_SHIFT));
1058 sub_menu->append(new LLMenuItemCheckGL("Sky", 1058 sub_menu->append(new LLMenuItemCheckGL("Sky",
1059 &LLPipeline::toggleRenderType, NULL, 1059 &LLPipeline::toggleRenderTypeControl, NULL,
1060 &LLPipeline::toggleRenderTypeControl, 1060 &LLPipeline::hasRenderTypeControl,
1061 (void*)LLPipeline::RENDER_TYPE_SKY, '6', MASK_CONTROL|MASK_ALT|MASK_SHIFT)); 1061 (void*)LLPipeline::RENDER_TYPE_SKY, '6', MASK_CONTROL|MASK_ALT|MASK_SHIFT));
1062 sub_menu->append(new LLMenuItemCheckGL("Water", 1062 sub_menu->append(new LLMenuItemCheckGL("Water",
1063 &LLPipeline::toggleRenderType, NULL, 1063 &LLPipeline::toggleRenderTypeControl, NULL,
1064 &LLPipeline::toggleRenderTypeControl, 1064 &LLPipeline::hasRenderTypeControl,
1065 (void*)LLPipeline::RENDER_TYPE_WATER, '7', MASK_CONTROL|MASK_ALT|MASK_SHIFT)); 1065 (void*)LLPipeline::RENDER_TYPE_WATER, '7', MASK_CONTROL|MASK_ALT|MASK_SHIFT));
1066 sub_menu->append(new LLMenuItemCheckGL("Ground", 1066 sub_menu->append(new LLMenuItemCheckGL("Ground",
1067 &LLPipeline::toggleRenderType, NULL, 1067 &LLPipeline::toggleRenderTypeControl, NULL,
1068 &LLPipeline::toggleRenderTypeControl, 1068 &LLPipeline::hasRenderTypeControl,
1069 (void*)LLPipeline::RENDER_TYPE_GROUND, '8', MASK_CONTROL|MASK_ALT|MASK_SHIFT)); 1069 (void*)LLPipeline::RENDER_TYPE_GROUND, '8', MASK_CONTROL|MASK_ALT|MASK_SHIFT));
1070 sub_menu->append(new LLMenuItemCheckGL("Volume", 1070 sub_menu->append(new LLMenuItemCheckGL("Volume",
1071 &LLPipeline::toggleRenderType, NULL, 1071 &LLPipeline::toggleRenderTypeControl, NULL,
1072 &LLPipeline::toggleRenderTypeControl, 1072 &LLPipeline::hasRenderTypeControl,
1073 (void*)LLPipeline::RENDER_TYPE_VOLUME, '9', MASK_CONTROL|MASK_ALT|MASK_SHIFT)); 1073 (void*)LLPipeline::RENDER_TYPE_VOLUME, '9', MASK_CONTROL|MASK_ALT|MASK_SHIFT));
1074 sub_menu->append(new LLMenuItemCheckGL("Grass", 1074 sub_menu->append(new LLMenuItemCheckGL("Grass",
1075 &LLPipeline::toggleRenderType, NULL, 1075 &LLPipeline::toggleRenderTypeControl, NULL,
1076 &LLPipeline::toggleRenderTypeControl, 1076 &LLPipeline::hasRenderTypeControl,
1077 (void*)LLPipeline::RENDER_TYPE_GRASS, '0', MASK_CONTROL|MASK_ALT|MASK_SHIFT)); 1077 (void*)LLPipeline::RENDER_TYPE_GRASS, '0', MASK_CONTROL|MASK_ALT|MASK_SHIFT));
1078 sub_menu->append(new LLMenuItemCheckGL("Clouds", 1078 sub_menu->append(new LLMenuItemCheckGL("Clouds",
1079 &LLPipeline::toggleRenderType, NULL, 1079 &LLPipeline::toggleRenderTypeControl, NULL,
1080 &LLPipeline::toggleRenderTypeControl, 1080 &LLPipeline::hasRenderTypeControl,
1081 (void*)LLPipeline::RENDER_TYPE_CLOUDS, '-', MASK_CONTROL|MASK_ALT| MASK_SHIFT)); 1081 (void*)LLPipeline::RENDER_TYPE_CLOUDS, '-', MASK_CONTROL|MASK_ALT| MASK_SHIFT));
1082 sub_menu->append(new LLMenuItemCheckGL("Particles", 1082 sub_menu->append(new LLMenuItemCheckGL("Particles",
1083 &LLPipeline::toggleRenderType, NULL, 1083 &LLPipeline::toggleRenderTypeControl, NULL,
1084 &LLPipeline::toggleRenderTypeControl, 1084 &LLPipeline::hasRenderTypeControl,
1085 (void*)LLPipeline::RENDER_TYPE_PARTICLES, '=', MASK_CONTROL|MASK_ALT|MASK_SHIFT)); 1085 (void*)LLPipeline::RENDER_TYPE_PARTICLES, '=', MASK_CONTROL|MASK_ALT|MASK_SHIFT));
1086 sub_menu->append(new LLMenuItemCheckGL("Bump", 1086 sub_menu->append(new LLMenuItemCheckGL("Bump",
1087 &LLPipeline::toggleRenderType, NULL, 1087 &LLPipeline::toggleRenderTypeControl, NULL,
1088 &LLPipeline::toggleRenderTypeControl, 1088 &LLPipeline::hasRenderTypeControl,
1089 (void*)LLPipeline::RENDER_TYPE_BUMP, '\\', MASK_CONTROL|MASK_ALT|MASK_SHIFT)); 1089 (void*)LLPipeline::RENDER_TYPE_BUMP, '\\', MASK_CONTROL|MASK_ALT|MASK_SHIFT));
1090 sub_menu->createJumpKeys(); 1090 sub_menu->createJumpKeys();
1091 sub_menu = new LLMenuGL("Features"); 1091 sub_menu = new LLMenuGL("Features");
@@ -1106,6 +1106,10 @@ void init_debug_rendering_menu(LLMenuGL* menu)
1106 &LLPipeline::toggleRenderDebugFeature, NULL, 1106 &LLPipeline::toggleRenderDebugFeature, NULL,
1107 &LLPipeline::toggleRenderDebugFeatureControl, 1107 &LLPipeline::toggleRenderDebugFeatureControl,
1108 (void*)LLPipeline::RENDER_DEBUG_FEATURE_DYNAMIC_TEXTURES, '4', MASK_ALT|MASK_CONTROL)); 1108 (void*)LLPipeline::RENDER_DEBUG_FEATURE_DYNAMIC_TEXTURES, '4', MASK_ALT|MASK_CONTROL));
1109 sub_menu->append(new LLMenuItemCheckGL( "Foot Shadows",
1110 &LLPipeline::toggleRenderDebugFeature, NULL,
1111 &LLPipeline::toggleRenderDebugFeatureControl,
1112 (void*)LLPipeline::RENDER_DEBUG_FEATURE_FOOT_SHADOWS, '5', MASK_ALT|MASK_CONTROL));
1109 sub_menu->append(new LLMenuItemCheckGL("Fog", 1113 sub_menu->append(new LLMenuItemCheckGL("Fog",
1110 &LLPipeline::toggleRenderDebugFeature, NULL, 1114 &LLPipeline::toggleRenderDebugFeature, NULL,
1111 &LLPipeline::toggleRenderDebugFeatureControl, 1115 &LLPipeline::toggleRenderDebugFeatureControl,
@@ -1119,13 +1123,9 @@ void init_debug_rendering_menu(LLMenuGL* menu)
1119 &LLPipeline::toggleRenderDebugFeatureControl, 1123 &LLPipeline::toggleRenderDebugFeatureControl,
1120 (void*)LLPipeline::RENDER_DEBUG_FEATURE_FR_INFO, '8', MASK_ALT|MASK_CONTROL)); 1124 (void*)LLPipeline::RENDER_DEBUG_FEATURE_FR_INFO, '8', MASK_ALT|MASK_CONTROL));
1121 sub_menu->append(new LLMenuItemCheckGL( "Flexible Objects", 1125 sub_menu->append(new LLMenuItemCheckGL( "Flexible Objects",
1122 &LLPipeline::toggleRenderDebugFeature, NULL, 1126 &LLPipeline::toggleRenderDebugFeature, NULL,
1123 &LLPipeline::toggleRenderDebugFeatureControl, 1127 &LLPipeline::toggleRenderDebugFeatureControl,
1124 (void*)LLPipeline::RENDER_DEBUG_FEATURE_FLEXIBLE, '9', MASK_ALT|MASK_CONTROL)); 1128 (void*)LLPipeline::RENDER_DEBUG_FEATURE_FLEXIBLE, '9', MASK_ALT|MASK_CONTROL));
1125 sub_menu->append(new LLMenuItemCheckGL( "Chain Faces",
1126 &LLPipeline::toggleRenderDebugFeature, NULL,
1127 &LLPipeline::toggleRenderDebugFeatureControl,
1128 (void*)LLPipeline::RENDER_DEBUG_FEATURE_CHAIN_FACES, '0', MASK_ALT|MASK_CONTROL));
1129 sub_menu->createJumpKeys(); 1129 sub_menu->createJumpKeys();
1130 1130
1131 ///////////////////////////// 1131 /////////////////////////////
@@ -1138,9 +1138,6 @@ void init_debug_rendering_menu(LLMenuGL* menu)
1138 sub_menu->append(new LLMenuItemCheckGL("Verify", &LLPipeline::toggleRenderDebug, NULL, 1138 sub_menu->append(new LLMenuItemCheckGL("Verify", &LLPipeline::toggleRenderDebug, NULL,
1139 &LLPipeline::toggleRenderDebugControl, 1139 &LLPipeline::toggleRenderDebugControl,
1140 (void*)LLPipeline::RENDER_DEBUG_VERIFY)); 1140 (void*)LLPipeline::RENDER_DEBUG_VERIFY));
1141 sub_menu->append(new LLMenuItemCheckGL("AGP Map", &LLPipeline::toggleRenderDebug, NULL,
1142 &LLPipeline::toggleRenderDebugControl,
1143 (void*)LLPipeline::RENDER_DEBUG_AGP_MEM));
1144 sub_menu->append(new LLMenuItemCheckGL("BBoxes", &LLPipeline::toggleRenderDebug, NULL, 1141 sub_menu->append(new LLMenuItemCheckGL("BBoxes", &LLPipeline::toggleRenderDebug, NULL,
1145 &LLPipeline::toggleRenderDebugControl, 1142 &LLPipeline::toggleRenderDebugControl,
1146 (void*)LLPipeline::RENDER_DEBUG_BBOXES)); 1143 (void*)LLPipeline::RENDER_DEBUG_BBOXES));
@@ -1153,12 +1150,24 @@ void init_debug_rendering_menu(LLMenuGL* menu)
1153 sub_menu->append(new LLMenuItemCheckGL("Occlusion", &LLPipeline::toggleRenderDebug, NULL, 1150 sub_menu->append(new LLMenuItemCheckGL("Occlusion", &LLPipeline::toggleRenderDebug, NULL,
1154 &LLPipeline::toggleRenderDebugControl, 1151 &LLPipeline::toggleRenderDebugControl,
1155 (void*)LLPipeline::RENDER_DEBUG_OCCLUSION)); 1152 (void*)LLPipeline::RENDER_DEBUG_OCCLUSION));
1156 sub_menu->append(new LLMenuItemCheckGL("Face Chains", &LLPipeline::toggleRenderDebug, NULL, 1153 sub_menu->append(new LLMenuItemCheckGL("Animated Textures", &LLPipeline::toggleRenderDebug, NULL,
1157 &LLPipeline::toggleRenderDebugControl, 1154 &LLPipeline::toggleRenderDebugControl,
1158 (void*)LLPipeline::RENDER_DEBUG_FACE_CHAINS)); 1155 (void*)LLPipeline::RENDER_DEBUG_TEXTURE_ANIM));
1159 sub_menu->append(new LLMenuItemCheckGL("Texture Priority", &LLPipeline::toggleRenderDebug, NULL, 1156 sub_menu->append(new LLMenuItemCheckGL("Texture Priority", &LLPipeline::toggleRenderDebug, NULL,
1160 &LLPipeline::toggleRenderDebugControl, 1157 &LLPipeline::toggleRenderDebugControl,
1161 (void*)LLPipeline::RENDER_DEBUG_TEXTURE_PRIORITY)); 1158 (void*)LLPipeline::RENDER_DEBUG_TEXTURE_PRIORITY));
1159 sub_menu->append(new LLMenuItemCheckGL("Texture Area (sqrt(A))",&LLPipeline::toggleRenderDebug, NULL,
1160 &LLPipeline::toggleRenderDebugControl,
1161 (void*)LLPipeline::RENDER_DEBUG_TEXTURE_AREA));
1162 sub_menu->append(new LLMenuItemCheckGL("Face Area (sqrt(A))",&LLPipeline::toggleRenderDebug, NULL,
1163 &LLPipeline::toggleRenderDebugControl,
1164 (void*)LLPipeline::RENDER_DEBUG_FACE_AREA));
1165 sub_menu->append(new LLMenuItemCheckGL("Pick Render", &LLPipeline::toggleRenderDebug, NULL,
1166 &LLPipeline::toggleRenderDebugControl,
1167 (void*)LLPipeline::RENDER_DEBUG_PICKING));
1168 sub_menu->append(new LLMenuItemCheckGL("Particles", &LLPipeline::toggleRenderDebug, NULL,
1169 &LLPipeline::toggleRenderDebugControl,
1170 (void*)LLPipeline::RENDER_DEBUG_PARTICLES));
1162 sub_menu->append(new LLMenuItemCheckGL("Composition", &LLPipeline::toggleRenderDebug, NULL, 1171 sub_menu->append(new LLMenuItemCheckGL("Composition", &LLPipeline::toggleRenderDebug, NULL,
1163 &LLPipeline::toggleRenderDebugControl, 1172 &LLPipeline::toggleRenderDebugControl,
1164 (void*)LLPipeline::RENDER_DEBUG_COMPOSITION)); 1173 (void*)LLPipeline::RENDER_DEBUG_COMPOSITION));
@@ -1168,16 +1177,7 @@ void init_debug_rendering_menu(LLMenuGL* menu)
1168 sub_menu->append(new LLMenuItemCheckGL("LightTrace",&LLPipeline::toggleRenderDebug, NULL, 1177 sub_menu->append(new LLMenuItemCheckGL("LightTrace",&LLPipeline::toggleRenderDebug, NULL,
1169 &LLPipeline::toggleRenderDebugControl, 1178 &LLPipeline::toggleRenderDebugControl,
1170 (void*)LLPipeline::RENDER_DEBUG_LIGHT_TRACE)); 1179 (void*)LLPipeline::RENDER_DEBUG_LIGHT_TRACE));
1171 sub_menu->append(new LLMenuItemCheckGL("Pools", &LLPipeline::toggleRenderDebug, NULL, 1180
1172 &LLPipeline::toggleRenderDebugControl,
1173 (void*)LLPipeline::RENDER_DEBUG_POOLS));
1174 sub_menu->append(new LLMenuItemCheckGL("Queues", &LLPipeline::toggleRenderDebug, NULL,
1175 &LLPipeline::toggleRenderDebugControl,
1176 (void*)LLPipeline::RENDER_DEBUG_QUEUES));
1177 sub_menu->append(new LLMenuItemCheckGL("Map", &LLPipeline::toggleRenderDebug, NULL,
1178 LLPipeline::toggleRenderDebugControl,
1179 (void*)LLPipeline::RENDER_DEBUG_MAP));
1180
1181 sub_menu->append(new LLMenuItemCheckGL("Show Depth Buffer", 1181 sub_menu->append(new LLMenuItemCheckGL("Show Depth Buffer",
1182 &menu_toggle_control, 1182 &menu_toggle_control,
1183 NULL, 1183 NULL,
@@ -1202,8 +1202,6 @@ void init_debug_rendering_menu(LLMenuGL* menu)
1202 1202
1203 menu->appendSeparator(); 1203 menu->appendSeparator();
1204 menu->append(new LLMenuItemCheckGL("Axes", menu_toggle_control, NULL, menu_check_control, (void*)"ShowAxes")); 1204 menu->append(new LLMenuItemCheckGL("Axes", menu_toggle_control, NULL, menu_check_control, (void*)"ShowAxes"));
1205 menu->append(new LLMenuItemCheckGL("Use VBO", toggle_vbo, NULL, check_vbo, NULL));
1206 menu->append(new LLMenuItemCheckGL("Light Glows", toggle_glow, NULL, check_glow, NULL));
1207// menu->append(new LLMenuItemCheckGL("Cull Small Objects", toggle_cull_small, NULL, menu_check_control, (void*)"RenderCullBySize")); 1205// menu->append(new LLMenuItemCheckGL("Cull Small Objects", toggle_cull_small, NULL, menu_check_control, (void*)"RenderCullBySize"));
1208 1206
1209 menu->appendSeparator(); 1207 menu->appendSeparator();
@@ -1228,6 +1226,19 @@ void init_debug_rendering_menu(LLMenuGL* menu)
1228 item = new LLMenuItemCheckGL("Disable Textures", menu_toggle_variable, NULL, menu_check_variable, (void*)&LLViewerImage::sDontLoadVolumeTextures); 1226 item = new LLMenuItemCheckGL("Disable Textures", menu_toggle_variable, NULL, menu_check_variable, (void*)&LLViewerImage::sDontLoadVolumeTextures);
1229 menu->append(item); 1227 menu->append(item);
1230 1228
1229#ifndef LL_RELEASE_FOR_DOWNLOAD
1230 item = new LLMenuItemCheckGL("HTTP Get Textures", menu_toggle_control, NULL, menu_check_control, (void*)"ImagePipelineUseHTTP");
1231 menu->append(item);
1232#endif
1233
1234 item = new LLMenuItemCheckGL("Run Multiple Threads", menu_toggle_control, NULL, menu_check_control, (void*)"RunMultipleThreads");
1235 menu->append(item);
1236
1237#ifndef LL_RELEASE_FOR_DOWNLOAD
1238 item = new LLMenuItemCheckGL("Dynamic Reflections", menu_toggle_control, NULL, menu_check_control, (void*)"RenderDynamicReflections");
1239 menu->append(item);
1240#endif
1241
1231 item = new LLMenuItemCheckGL("Cheesy Beacon", menu_toggle_control, NULL, menu_check_control, (void*)"CheesyBeacon"); 1242 item = new LLMenuItemCheckGL("Cheesy Beacon", menu_toggle_control, NULL, menu_check_control, (void*)"CheesyBeacon");
1232 menu->append(item); 1243 menu->append(item);
1233 1244
@@ -1284,10 +1295,6 @@ void init_debug_avatar_menu(LLMenuGL* menu)
1284 //menu->append(new LLMenuItemToggleGL("Show Attachment Points", &LLVOAvatar::sShowAttachmentPoints)); 1295 //menu->append(new LLMenuItemToggleGL("Show Attachment Points", &LLVOAvatar::sShowAttachmentPoints));
1285 menu->append(new LLMenuItemToggleGL("Show Collision Plane", &LLVOAvatar::sShowFootPlane)); 1296 menu->append(new LLMenuItemToggleGL("Show Collision Plane", &LLVOAvatar::sShowFootPlane));
1286 menu->append(new LLMenuItemToggleGL("Show Collision Skeleton", &LLVOAvatar::sShowCollisionVolumes)); 1297 menu->append(new LLMenuItemToggleGL("Show Collision Skeleton", &LLVOAvatar::sShowCollisionVolumes));
1287 menu->append(new LLMenuItemToggleGL("Software Blending SSE", &gGLManager.mSoftwareBlendSSE));
1288#if 0 // Removed since this feature doesn't actually work as of 1.9.1 --TomY
1289 menu->append(new LLMenuItemToggleGL("Character Load Test", &LLVOAvatar::sAvatarLoadTest));
1290#endif
1291 menu->append(new LLMenuItemToggleGL( "Display Agent Target", &LLAgent::sDebugDisplayTarget)); 1298 menu->append(new LLMenuItemToggleGL( "Display Agent Target", &LLAgent::sDebugDisplayTarget));
1292 menu->append(new LLMenuItemToggleGL( "Debug Rotation", &gDebugAvatarRotation)); 1299 menu->append(new LLMenuItemToggleGL( "Debug Rotation", &gDebugAvatarRotation));
1293 menu->append(new LLMenuItemCallGL("Dump Attachments", handle_dump_attachments)); 1300 menu->append(new LLMenuItemCallGL("Dump Attachments", handle_dump_attachments));
@@ -1325,11 +1332,6 @@ void init_server_menu(LLMenuGL* menu)
1325 &handle_normal_llinfo_log, &enable_god_customer_service)); 1332 &handle_normal_llinfo_log, &enable_god_customer_service));
1326 1333
1327 sub_menu->appendSeparator(); 1334 sub_menu->appendSeparator();
1328 sub_menu->append(new LLMenuItemCallGL("Enable Circuit Log",
1329 &handle_sim_enable_circuit_log, &enable_god_customer_service));
1330 sub_menu->append(new LLMenuItemCallGL("Disable Circuit Log",
1331 &handle_sim_disable_circuit_log, &enable_god_customer_service));
1332 sub_menu->appendSeparator();
1333 sub_menu->append(new LLMenuItemCallGL("Enable Message Log", 1335 sub_menu->append(new LLMenuItemCallGL("Enable Message Log",
1334 &handle_sim_enable_message_log, &enable_god_customer_service)); 1336 &handle_sim_enable_message_log, &enable_god_customer_service));
1335 sub_menu->append(new LLMenuItemCallGL("Disable Message Log", 1337 sub_menu->append(new LLMenuItemCallGL("Disable Message Log",
@@ -1352,7 +1354,8 @@ void init_server_menu(LLMenuGL* menu)
1352 menu->appendMenu(sub); 1354 menu->appendMenu(sub);
1353 1355
1354 sub->append(new LLMenuItemCallGL( "Take Copy", 1356 sub->append(new LLMenuItemCallGL( "Take Copy",
1355 &force_take_copy, &enable_god_customer_service, NULL)); 1357 &force_take_copy, &enable_god_customer_service, NULL,
1358 'O', MASK_SHIFT | MASK_ALT | MASK_CONTROL));
1356#ifdef _CORY_TESTING 1359#ifdef _CORY_TESTING
1357 sub->append(new LLMenuItemCallGL( "Export Copy", 1360 sub->append(new LLMenuItemCallGL( "Export Copy",
1358 &force_export_copy, NULL, NULL)); 1361 &force_export_copy, NULL, NULL));
@@ -1456,7 +1459,7 @@ class LLObjectRateOwner : public view_listener_t
1456 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) 1459 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
1457 { 1460 {
1458 // Don't allow rating of group owned objects. 1461 // Don't allow rating of group owned objects.
1459 LLSelectNode* node = gSelectMgr->getFirstRootNode(); 1462 LLSelectNode* node = gSelectMgr->getSelection()->getFirstRootNode();
1460 if (!node) return true; 1463 if (!node) return true;
1461 if (node->mPermissions->isGroupOwned()) 1464 if (node->mPermissions->isGroupOwned())
1462 { 1465 {
@@ -1542,36 +1545,6 @@ class LLObjectEnableReportAbuse : public view_listener_t
1542 } 1545 }
1543}; 1546};
1544 1547
1545
1546BOOL enable_attach(void*)
1547{
1548 // All root objects must be owned by agent.
1549 BOOL rv = FALSE;
1550 LLViewerObject* obj = gSelectMgr->getFirstRootObject();
1551 if(obj)
1552 {
1553 rv = TRUE;
1554 for(obj = gSelectMgr->getFirstRootObject() ; obj != NULL; obj = gSelectMgr->getNextRootObject())
1555 {
1556 for (U32 child_num = 0; child_num < obj->mChildList.size(); child_num++ )
1557 {
1558 LLViewerObject *child = obj->mChildList[child_num];
1559 if (child->isAvatar())
1560 {
1561 return FALSE;
1562 }
1563 }
1564 if(!obj->permMove())
1565 {
1566 rv = FALSE;
1567 break;
1568 }
1569 }
1570 }
1571 return rv;
1572}
1573
1574
1575class LLObjectTouch : public view_listener_t 1548class LLObjectTouch : public view_listener_t
1576{ 1549{
1577 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) 1550 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
@@ -1601,7 +1574,6 @@ class LLObjectTouch : public view_listener_t
1601 msg->addU32Fast(_PREHASH_LocalID, object->mLocalID); 1574 msg->addU32Fast(_PREHASH_LocalID, object->mLocalID);
1602 msg->sendMessage(object->getRegion()->getHost()); 1575 msg->sendMessage(object->getRegion()->getHost());
1603 1576
1604 gSelectMgr->deselectTransient();
1605 return true; 1577 return true;
1606 } 1578 }
1607}; 1579};
@@ -1617,7 +1589,7 @@ class LLObjectEnableTouch : public view_listener_t
1617 gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); 1589 gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value);
1618 1590
1619 // Update label based on the node touch name if available. 1591 // Update label based on the node touch name if available.
1620 LLSelectNode* node = gSelectMgr->getFirstRootNode(); 1592 LLSelectNode* node = gSelectMgr->getSelection()->getFirstRootNode();
1621 if (node && node->mValid && !node->mTouchName.empty()) 1593 if (node && node->mValid && !node->mTouchName.empty())
1622 { 1594 {
1623 gMenuHolder->childSetText("Object Touch", node->mTouchName); 1595 gMenuHolder->childSetText("Object Touch", node->mTouchName);
@@ -1633,7 +1605,7 @@ class LLObjectEnableTouch : public view_listener_t
1633 1605
1634void label_touch(LLString& label, void*) 1606void label_touch(LLString& label, void*)
1635{ 1607{
1636 LLSelectNode* node = gSelectMgr->getFirstRootNode(); 1608 LLSelectNode* node = gSelectMgr->getSelection()->getFirstRootNode();
1637 if (node && node->mValid && !node->mTouchName.empty()) 1609 if (node && node->mValid && !node->mTouchName.empty())
1638 { 1610 {
1639 label.assign(node->mTouchName); 1611 label.assign(node->mTouchName);
@@ -1649,8 +1621,6 @@ bool handle_object_open()
1649 LLViewerObject* obj = gObjectList.findObject(gLastHitObjectID); 1621 LLViewerObject* obj = gObjectList.findObject(gLastHitObjectID);
1650 if(!obj) return true; 1622 if(!obj) return true;
1651 1623
1652 // transient selection must be made permanent
1653 gSelectMgr->convertTransient();
1654 LLFloaterOpenObject::show(); 1624 LLFloaterOpenObject::show();
1655 return true; 1625 return true;
1656} 1626}
@@ -1711,8 +1681,8 @@ bool toggle_build_mode()
1711 gAgent.cameraOrbitOver( 30.f * DEG_TO_RAD ); 1681 gAgent.cameraOrbitOver( 30.f * DEG_TO_RAD );
1712 } 1682 }
1713 1683
1714 gCurrentToolset = gBasicToolset; 1684 gToolMgr->setCurrentToolset(gBasicToolset);
1715 gCurrentToolset->selectTool( gToolCreate ); 1685 gToolMgr->getCurrentToolset()->selectTool( gToolCreate );
1716 1686
1717 // Could be first use 1687 // Could be first use
1718 LLFirstUse::useBuild(); 1688 LLFirstUse::useBuild();
@@ -1748,8 +1718,8 @@ class LLObjectBuild : public view_listener_t
1748 gViewerWindow->moveCursorToCenter(); 1718 gViewerWindow->moveCursorToCenter();
1749 } 1719 }
1750 1720
1751 gCurrentToolset = gBasicToolset; 1721 gToolMgr->setCurrentToolset(gBasicToolset);
1752 gCurrentToolset->selectTool( gToolCreate ); 1722 gToolMgr->getCurrentToolset()->selectTool( gToolCreate );
1753 1723
1754 // Could be first use 1724 // Could be first use
1755 LLFirstUse::useBuild(); 1725 LLFirstUse::useBuild();
@@ -1762,12 +1732,12 @@ class LLObjectEdit : public view_listener_t
1762 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) 1732 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
1763 { 1733 {
1764 gParcelMgr->deselectLand(); 1734 gParcelMgr->deselectLand();
1765 // convert transient selections to permanent
1766 gSelectMgr->convertTransient();
1767 1735
1768 if (gAgent.getFocusOnAvatar() && !gToolMgr->inEdit()) 1736 if (gAgent.getFocusOnAvatar() && !gToolMgr->inEdit())
1769 { 1737 {
1770 if (gSelectMgr->getSelectType() == SELECT_TYPE_HUD || !gSavedSettings.getBOOL("EditCameraMovement")) 1738 LLObjectSelectionHandle selection = gSelectMgr->getSelection();
1739
1740 if (selection->getSelectType() == SELECT_TYPE_HUD || !gSavedSettings.getBOOL("EditCameraMovement"))
1771 { 1741 {
1772 // always freeze camera in space, even if camera doesn't move 1742 // always freeze camera in space, even if camera doesn't move
1773 // so, for example, follow cam scripts can't affect you when in build mode 1743 // so, for example, follow cam scripts can't affect you when in build mode
@@ -1785,9 +1755,9 @@ class LLObjectEdit : public view_listener_t
1785 } 1755 }
1786 } 1756 }
1787 1757
1788 gFloaterTools->open(); 1758 gFloaterTools->open(); /* Flawfinder: ignore */
1789 1759
1790 gCurrentToolset = gBasicToolset; 1760 gToolMgr->setCurrentToolset(gBasicToolset);
1791 gFloaterTools->setEditTool( gToolTranslate ); 1761 gFloaterTools->setEditTool( gToolTranslate );
1792 1762
1793 // Could be first use 1763 // Could be first use
@@ -1800,7 +1770,6 @@ class LLObjectInspect : public view_listener_t
1800{ 1770{
1801 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) 1771 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
1802 { 1772 {
1803 gSelectMgr->convertTransient();
1804 LLFloaterInspect::show(); 1773 LLFloaterInspect::show();
1805 return true; 1774 return true;
1806 } 1775 }
@@ -1833,8 +1802,8 @@ class LLLandBuild : public view_listener_t
1833 } 1802 }
1834 1803
1835 1804
1836 gCurrentToolset = gBasicToolset; 1805 gToolMgr->setCurrentToolset(gBasicToolset);
1837 gCurrentToolset->selectTool( gToolCreate ); 1806 gToolMgr->getCurrentToolset()->selectTool( gToolCreate );
1838 1807
1839 // Could be first use 1808 // Could be first use
1840 LLFirstUse::useBuild(); 1809 LLFirstUse::useBuild();
@@ -1922,7 +1891,7 @@ class LLSelfEnableRemoveAllAttachments : public view_listener_t
1922 attachmentp; 1891 attachmentp;
1923 attachmentp = avatarp->mAttachmentPoints.getNextData()) 1892 attachmentp = avatarp->mAttachmentPoints.getNextData())
1924 { 1893 {
1925 if (attachmentp->getObject(0)) 1894 if (attachmentp->getObject())
1926 { 1895 {
1927 new_value = true; 1896 new_value = true;
1928 break; 1897 break;
@@ -2003,7 +1972,7 @@ class LLObjectMute : public view_listener_t
2003 // it's an object 1972 // it's an object
2004 id = object->getID(); 1973 id = object->getID();
2005 1974
2006 LLSelectNode* node = gSelectMgr->getFirstRootNode(); 1975 LLSelectNode* node = gSelectMgr->getSelection()->getFirstRootNode();
2007 if (node) 1976 if (node)
2008 { 1977 {
2009 name = node->mName; 1978 name = node->mName;
@@ -2023,7 +1992,6 @@ class LLObjectMute : public view_listener_t
2023 gFloaterMute->show(); 1992 gFloaterMute->show();
2024 } 1993 }
2025 1994
2026 gSelectMgr->deselectAll();
2027 return true; 1995 return true;
2028 } 1996 }
2029}; 1997};
@@ -2041,9 +2009,6 @@ bool handle_go_to()
2041 strings.push_back(val); 2009 strings.push_back(val);
2042 send_generic_message("autopilot", strings); 2010 send_generic_message("autopilot", strings);
2043 2011
2044 // Don't select anything
2045 gSelectMgr->deselectTransient();
2046
2047 gParcelMgr->deselectLand(); 2012 gParcelMgr->deselectLand();
2048 2013
2049 if (gAgent.getAvatarObject() && !gSavedSettings.getBOOL("AutoPilotLocksCamera")) 2014 if (gAgent.getAvatarObject() && !gSavedSettings.getBOOL("AutoPilotLocksCamera"))
@@ -2153,7 +2118,7 @@ class LLAvatarDebug : public view_listener_t
2153 } 2118 }
2154 llinfos << "Dumping temporary asset data to simulator logs for avatar " << avatar->getID() << llendl; 2119 llinfos << "Dumping temporary asset data to simulator logs for avatar " << avatar->getID() << llendl;
2155 std::vector<std::string> strings; 2120 std::vector<std::string> strings;
2156 strings.push_back( avatar->getID().getString() ); 2121 strings.push_back(avatar->getID().asString());
2157 LLUUID invoice; 2122 LLUUID invoice;
2158 send_generic_message("dumptempassetdata", strings, invoice); 2123 send_generic_message("dumptempassetdata", strings, invoice);
2159 LLFloaterAvatarTextures::show( avatar->getID() ); 2124 LLFloaterAvatarTextures::show( avatar->getID() );
@@ -2336,18 +2301,18 @@ void handle_leave_group(void *)
2336void append_aggregate(LLString& string, const LLAggregatePermissions& ag_perm, PermissionBit bit, const char* txt) 2301void append_aggregate(LLString& string, const LLAggregatePermissions& ag_perm, PermissionBit bit, const char* txt)
2337{ 2302{
2338 LLAggregatePermissions::EValue val = ag_perm.getValue(bit); 2303 LLAggregatePermissions::EValue val = ag_perm.getValue(bit);
2339 char buffer[MAX_STRING]; 2304 char buffer[MAX_STRING]; /* Flawfinder: ignore */
2340 buffer[0] = '\0'; 2305 buffer[0] = '\0';
2341 switch(val) 2306 switch(val)
2342 { 2307 {
2343 case LLAggregatePermissions::AP_NONE: 2308 case LLAggregatePermissions::AP_NONE:
2344 sprintf(buffer, "* %s None\n", txt); 2309 snprintf(buffer, MAX_STRING, "* %s None\n", txt); /* Flawfinder: ignore */
2345 break; 2310 break;
2346 case LLAggregatePermissions::AP_SOME: 2311 case LLAggregatePermissions::AP_SOME:
2347 sprintf(buffer, "* %s Some\n", txt); 2312 snprintf(buffer, MAX_STRING, "* %s Some\n", txt); /* Flawfinder: ignore */
2348 break; 2313 break;
2349 case LLAggregatePermissions::AP_ALL: 2314 case LLAggregatePermissions::AP_ALL:
2350 sprintf(buffer, "* %s All\n", txt); 2315 snprintf(buffer, MAX_STRING, "* %s All\n", txt); /* Flawfinder: ignore */
2351 break; 2316 break;
2352 case LLAggregatePermissions::AP_EMPTY: 2317 case LLAggregatePermissions::AP_EMPTY:
2353 default: 2318 default:
@@ -2388,9 +2353,9 @@ BOOL enable_buy(void*)
2388{ 2353{
2389 // In order to buy, there must only be 1 purchaseable object in 2354 // In order to buy, there must only be 1 purchaseable object in
2390 // the selection manger. 2355 // the selection manger.
2391 if(gSelectMgr->getRootObjectCount() != 1) return FALSE; 2356 if(gSelectMgr->getSelection()->getRootObjectCount() != 1) return FALSE;
2392 LLViewerObject* obj = NULL; 2357 LLViewerObject* obj = NULL;
2393 LLSelectNode* node = gSelectMgr->getFirstRootNode(); 2358 LLSelectNode* node = gSelectMgr->getSelection()->getFirstRootNode();
2394 if(node) 2359 if(node)
2395 { 2360 {
2396 obj = node->getObject(); 2361 obj = node->getObject();
@@ -2451,14 +2416,12 @@ void handle_buy_object(LLSaleInfo sale_info)
2451 return; 2416 return;
2452 } 2417 }
2453 2418
2454 gSelectMgr->convertTransient();
2455 LLFloaterBuy::show(sale_info); 2419 LLFloaterBuy::show(sale_info);
2456} 2420}
2457 2421
2458 2422
2459void handle_buy_contents(LLSaleInfo sale_info) 2423void handle_buy_contents(LLSaleInfo sale_info)
2460{ 2424{
2461 gSelectMgr->convertTransient();
2462 LLFloaterBuyContents::show(sale_info); 2425 LLFloaterBuyContents::show(sale_info);
2463} 2426}
2464 2427
@@ -2513,6 +2476,14 @@ void handle_dump_group_info(void *)
2513 //llinfos << "insig " << gAgent.mGroupInsigniaID << llendl; 2476 //llinfos << "insig " << gAgent.mGroupInsigniaID << llendl;
2514} 2477}
2515 2478
2479void handle_dump_capabilities_info(void *)
2480{
2481 LLViewerRegion* regionp = gAgent.getRegion();
2482 if (regionp)
2483 {
2484 regionp->logActiveCapabilities();
2485 }
2486}
2516 2487
2517void handle_dump_focus(void *) 2488void handle_dump_focus(void *)
2518{ 2489{
@@ -2590,10 +2561,12 @@ void set_god_level(U8 god_level)
2590 if (gInProductionGrid) 2561 if (gInProductionGrid)
2591 { 2562 {
2592 gMenuBarView->setBackgroundColor( gColors.getColor( "MenuBarGodBgColor" ) ); 2563 gMenuBarView->setBackgroundColor( gColors.getColor( "MenuBarGodBgColor" ) );
2564 gStatusBar->setBackgroundColor( gColors.getColor( "MenuBarGodBgColor" ) );
2593 } 2565 }
2594 else 2566 else
2595 { 2567 {
2596 gMenuBarView->setBackgroundColor( gColors.getColor( "MenuNonProductionGodBgColor" ) ); 2568 gMenuBarView->setBackgroundColor( gColors.getColor( "MenuNonProductionGodBgColor" ) );
2569 gStatusBar->setBackgroundColor( gColors.getColor( "MenuNonProductionGodBgColor" ) );
2597 } 2570 }
2598 LLNotifyBox::showXml("EnteringGodMode", args); 2571 LLNotifyBox::showXml("EnteringGodMode", args);
2599 } 2572 }
@@ -2603,10 +2576,12 @@ void set_god_level(U8 god_level)
2603 if (gInProductionGrid) 2576 if (gInProductionGrid)
2604 { 2577 {
2605 gMenuBarView->setBackgroundColor( gColors.getColor( "MenuBarBgColor" ) ); 2578 gMenuBarView->setBackgroundColor( gColors.getColor( "MenuBarBgColor" ) );
2579 gStatusBar->setBackgroundColor( gColors.getColor( "MenuBarBgColor" ) );
2606 } 2580 }
2607 else 2581 else
2608 { 2582 {
2609 gMenuBarView->setBackgroundColor( gColors.getColor( "MenuNonProductionBgColor" ) ); 2583 gMenuBarView->setBackgroundColor( gColors.getColor( "MenuNonProductionBgColor" ) );
2584 gStatusBar->setBackgroundColor( gColors.getColor( "MenuNonProductionBgColor" ) );
2610 } 2585 }
2611 LLNotifyBox::showXml("LeavingGodMode", args); 2586 LLNotifyBox::showXml("LeavingGodMode", args);
2612 } 2587 }
@@ -2801,7 +2776,6 @@ bool handle_sit_or_stand()
2801 if (sitting_on_selection()) 2776 if (sitting_on_selection())
2802 { 2777 {
2803 gAgent.setControlFlags(AGENT_CONTROL_STAND_UP); 2778 gAgent.setControlFlags(AGENT_CONTROL_STAND_UP);
2804 gSelectMgr->deselectTransient();
2805 return true; 2779 return true;
2806 } 2780 }
2807 2781
@@ -2822,8 +2796,6 @@ bool handle_sit_or_stand()
2822 gMessageSystem->addVector3Fast(_PREHASH_Offset, offset_single); 2796 gMessageSystem->addVector3Fast(_PREHASH_Offset, offset_single);
2823 2797
2824 object->getRegion()->sendReliableMessage(); 2798 object->getRegion()->sendReliableMessage();
2825
2826 gSelectMgr->deselectTransient();
2827 } 2799 }
2828 return true; 2800 return true;
2829} 2801}
@@ -2838,11 +2810,14 @@ class LLObjectSitOrStand : public view_listener_t
2838 2810
2839void near_sit_down_point(BOOL success, void *) 2811void near_sit_down_point(BOOL success, void *)
2840{ 2812{
2841 gAgent.setFlying(FALSE); 2813 if (success)
2842 gAgent.setControlFlags(AGENT_CONTROL_SIT_ON_GROUND); 2814 {
2815 gAgent.setFlying(FALSE);
2816 gAgent.setControlFlags(AGENT_CONTROL_SIT_ON_GROUND);
2843 2817
2844 // Might be first sit 2818 // Might be first sit
2845 LLFirstUse::useSit(); 2819 LLFirstUse::useSit();
2820 }
2846} 2821}
2847 2822
2848class LLLandSit : public view_listener_t 2823class LLLandSit : public view_listener_t
@@ -3182,13 +3157,12 @@ void reset_view_final( BOOL proceed, void* )
3182 gAgent.changeCameraToDefault(); 3157 gAgent.changeCameraToDefault();
3183 3158
3184 gAgent.resetView(!gFloaterTools->getVisible()); 3159 gAgent.resetView(!gFloaterTools->getVisible());
3160 gFloaterTools->close();
3185 3161
3186 gViewerWindow->showCursor(); 3162 gViewerWindow->showCursor();
3187 3163
3188 // Switch back to basic toolset 3164 // Switch back to basic toolset
3189 gCurrentToolset = gBasicToolset; 3165 gToolMgr->setCurrentToolset(gBasicToolset);
3190 gBasicToolset->selectFirstTool();
3191 gToolMgr->useSelectedTool( gBasicToolset );
3192} 3166}
3193 3167
3194class LLViewLookAtLastChatter : public view_listener_t 3168class LLViewLookAtLastChatter : public view_listener_t
@@ -3261,7 +3235,7 @@ class LLEditEnableDuplicate : public view_listener_t
3261 3235
3262void disabled_duplicate(void*) 3236void disabled_duplicate(void*)
3263{ 3237{
3264 if (gSelectMgr->getFirstObject()) 3238 if (gSelectMgr->getSelection()->getFirstObject())
3265 { 3239 {
3266 LLNotifyBox::showXml("CopyFailed"); 3240 LLNotifyBox::showXml("CopyFailed");
3267 } 3241 }
@@ -3291,7 +3265,7 @@ void handle_deed_object_to_group(void*)
3291 3265
3292BOOL enable_deed_object_to_group(void*) 3266BOOL enable_deed_object_to_group(void*)
3293{ 3267{
3294 if(gSelectMgr->isEmpty()) return FALSE; 3268 if(gSelectMgr->getSelection()->isEmpty()) return FALSE;
3295 LLPermissions perm; 3269 LLPermissions perm;
3296 LLUUID group_id; 3270 LLUUID group_id;
3297 3271
@@ -3350,8 +3324,8 @@ void handle_object_owner_permissive(void*)
3350 if(gAgent.isGodlike()) 3324 if(gAgent.isGodlike())
3351 { 3325 {
3352 // do the objects. 3326 // do the objects.
3353 gSelectMgr->setObjectPermissions(PERM_BASE, TRUE, PERM_ALL, TRUE); 3327 gSelectMgr->selectionSetObjectPermissions(PERM_BASE, TRUE, PERM_ALL, TRUE);
3354 gSelectMgr->setObjectPermissions(PERM_OWNER, TRUE, PERM_ALL, TRUE); 3328 gSelectMgr->selectionSetObjectPermissions(PERM_OWNER, TRUE, PERM_ALL, TRUE);
3355 } 3329 }
3356} 3330}
3357 3331
@@ -3367,7 +3341,7 @@ void handle_object_owner_self(void*)
3367// Shortcut to set owner permissions to not editable. 3341// Shortcut to set owner permissions to not editable.
3368void handle_object_lock(void*) 3342void handle_object_lock(void*)
3369{ 3343{
3370 gSelectMgr->setObjectPermissions(PERM_OWNER, FALSE, PERM_MODIFY); 3344 gSelectMgr->selectionSetObjectPermissions(PERM_OWNER, FALSE, PERM_MODIFY);
3371} 3345}
3372 3346
3373void handle_object_asset_ids(void*) 3347void handle_object_asset_ids(void*)
@@ -3412,17 +3386,17 @@ void handle_claim_public_land(void*)
3412 msg->nextBlock("MethodData"); 3386 msg->nextBlock("MethodData");
3413 msg->addString("Method", "claimpublicland"); 3387 msg->addString("Method", "claimpublicland");
3414 msg->addUUID("Invoice", LLUUID::null); 3388 msg->addUUID("Invoice", LLUUID::null);
3415 char buffer[32]; 3389 char buffer[32]; /* Flawfinder: ignore */
3416 sprintf(buffer, "%f", west_south.mV[VX]); 3390 snprintf(buffer, sizeof(buffer), "%f", west_south.mV[VX]); /* Flawfinder: ignore */
3417 msg->nextBlock("ParamList"); 3391 msg->nextBlock("ParamList");
3418 msg->addString("Parameter", buffer); 3392 msg->addString("Parameter", buffer);
3419 sprintf(buffer, "%f", west_south.mV[VY]); 3393 snprintf(buffer, sizeof(buffer), "%f", west_south.mV[VY]); /* Flawfinder: ignore */
3420 msg->nextBlock("ParamList"); 3394 msg->nextBlock("ParamList");
3421 msg->addString("Parameter", buffer); 3395 msg->addString("Parameter", buffer);
3422 sprintf(buffer, "%f", east_north.mV[VX]); 3396 snprintf(buffer, sizeof(buffer), "%f", east_north.mV[VX]); /* Flawfinder: ignore */
3423 msg->nextBlock("ParamList"); 3397 msg->nextBlock("ParamList");
3424 msg->addString("Parameter", buffer); 3398 msg->addString("Parameter", buffer);
3425 sprintf(buffer, "%f", east_north.mV[VY]); 3399 snprintf(buffer, sizeof(buffer), "%f", east_north.mV[VY]); /* Flawfinder: ignore */
3426 msg->nextBlock("ParamList"); 3400 msg->nextBlock("ParamList");
3427 msg->addString("Parameter", buffer); 3401 msg->addString("Parameter", buffer);
3428 gAgent.sendReliableMessage(); 3402 gAgent.sendReliableMessage();
@@ -3519,8 +3493,9 @@ void derez_objects(EDeRezDestination dest, const LLUUID& dest_id)
3519 } 3493 }
3520 //gInventoryView->setPanelOpen(TRUE); 3494 //gInventoryView->setPanelOpen(TRUE);
3521 3495
3496 LLObjectSelectionHandle selection = gSelectMgr->getSelection();
3522 LLViewerObject* object = NULL; 3497 LLViewerObject* object = NULL;
3523 LLSelectNode* node = gSelectMgr->getFirstRootNode(); 3498 LLSelectNode* node = selection->getFirstRootNode();
3524 if(!node) return; 3499 if(!node) return;
3525 object = node->getObject(); 3500 object = node->getObject();
3526 if(!object) return; 3501 if(!object) return;
@@ -3531,7 +3506,7 @@ void derez_objects(EDeRezDestination dest, const LLUUID& dest_id)
3531 // everything that we'll actually be derezzing. 3506 // everything that we'll actually be derezzing.
3532 LLDynamicArray<LLViewerObject*> derez_objects; 3507 LLDynamicArray<LLViewerObject*> derez_objects;
3533 BOOL can_derez_current; 3508 BOOL can_derez_current;
3534 for( ; node != NULL; node = gSelectMgr->getNextRootNode()) 3509 for( ; node != NULL; node = selection->getNextRootNode())
3535 { 3510 {
3536 object = node->getObject(); 3511 object = node->getObject();
3537 if(!object || !node->mValid) continue; 3512 if(!object || !node->mValid) continue;
@@ -3665,42 +3640,47 @@ class LLToolsTakeCopy : public view_listener_t
3665{ 3640{
3666 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) 3641 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
3667 { 3642 {
3668 if (gSelectMgr->isEmpty()) return true; 3643 if (gSelectMgr->getSelection()->isEmpty()) return true;
3669 3644
3670 const LLUUID& category_id = gInventory.findCategoryUUIDForType(LLAssetType::AT_OBJECT); 3645 const LLUUID& category_id = gInventory.findCategoryUUIDForType(LLAssetType::AT_OBJECT);
3671 derez_objects(DRD_ACQUIRE_TO_AGENT_INVENTORY, category_id); 3646 derez_objects(DRD_ACQUIRE_TO_AGENT_INVENTORY, category_id);
3672 3647
3673 // Only deselect if we're not building
3674 if (!gToolMgr->inEdit())
3675 {
3676 gSelectMgr->deselectTransient();
3677 }
3678 return true; 3648 return true;
3679 } 3649 }
3680}; 3650};
3681 3651
3682 3652
3683void callback_return_to_owner(S32 option, void* data)
3684{
3685 if (0 == option)
3686 {
3687 // Ignore category ID for this derez destination.
3688 derez_objects(DRD_RETURN_TO_OWNER, LLUUID::null);
3689 }
3690}
3691
3692// You can return an object to its owner if it is on your land. 3653// You can return an object to its owner if it is on your land.
3693class LLObjectReturn : public view_listener_t 3654class LLObjectReturn : public view_listener_t
3694{ 3655{
3695 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) 3656 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
3696 { 3657 {
3697 if (gSelectMgr->isEmpty()) return true; 3658 if (gSelectMgr->getSelection()->isEmpty()) return true;
3659
3660 mObjectSelection = gSelectMgr->getEditSelection();
3698 3661
3699 gViewerWindow->alertXml("ReturnToOwner", 3662 gViewerWindow->alertXml("ReturnToOwner",
3700 callback_return_to_owner, 3663 onReturnToOwner,
3701 NULL); 3664 (void*)this);
3702 return true; 3665 return true;
3703 } 3666 }
3667
3668 static void onReturnToOwner(S32 option, void* data)
3669 {
3670 LLObjectReturn* object_return = (LLObjectReturn*)data;
3671
3672 if (0 == option)
3673 {
3674 // Ignore category ID for this derez destination.
3675 derez_objects(DRD_RETURN_TO_OWNER, LLUUID::null);
3676 }
3677
3678 // drop reference to current selection
3679 object_return->mObjectSelection = NULL;
3680 }
3681
3682protected:
3683 LLObjectSelectionHandle mObjectSelection;
3704}; 3684};
3705 3685
3706 3686
@@ -3730,10 +3710,11 @@ class LLObjectEnableReturn : public view_listener_t
3730 } 3710 }
3731 else 3711 else
3732 { 3712 {
3713 LLObjectSelectionHandle selection = gSelectMgr->getSelection();
3733 LLViewerObject* obj = NULL; 3714 LLViewerObject* obj = NULL;
3734 for(obj = gSelectMgr->getFirstRootObject(); 3715 for(obj = selection->getFirstRootObject();
3735 obj; 3716 obj;
3736 obj = gSelectMgr->getNextRootObject()) 3717 obj = selection->getNextRootObject())
3737 { 3718 {
3738 if (obj->isOverAgentOwnedLand() 3719 if (obj->isOverAgentOwnedLand()
3739 || obj->isOverGroupOwnedLand() 3720 || obj->isOverGroupOwnedLand()
@@ -3754,22 +3735,16 @@ class LLObjectEnableReturn : public view_listener_t
3754 3735
3755void force_take_copy(void*) 3736void force_take_copy(void*)
3756{ 3737{
3757 if (gSelectMgr->isEmpty()) return; 3738 if (gSelectMgr->getSelection()->isEmpty()) return;
3758 const LLUUID& category_id = gInventory.findCategoryUUIDForType(LLAssetType::AT_OBJECT); 3739 const LLUUID& category_id = gInventory.findCategoryUUIDForType(LLAssetType::AT_OBJECT);
3759 derez_objects(DRD_FORCE_TO_GOD_INVENTORY, category_id); 3740 derez_objects(DRD_FORCE_TO_GOD_INVENTORY, category_id);
3760
3761 // Only deselect if we're not building
3762 if (!gToolMgr->inEdit())
3763 {
3764 gSelectMgr->deselectTransient();
3765 }
3766} 3741}
3767#ifdef _CORY_TESTING 3742#ifdef _CORY_TESTING
3768 3743
3769void force_export_copy(void*) 3744void force_export_copy(void*)
3770{ 3745{
3771 LLViewerObject* object = NULL; 3746 LLViewerObject* object = NULL;
3772 LLSelectNode* node = gSelectMgr->getFirstNode(); 3747 LLSelectNode* node = gSelectMgr->getSelection()->getFirstNode();
3773 if(!node) return; 3748 if(!node) return;
3774 object = node->getObject(); 3749 object = node->getObject();
3775 if(!object) return; 3750 if(!object) return;
@@ -3790,7 +3765,7 @@ void force_export_copy(void*)
3790 3765
3791 S32 object_index = 0; 3766 S32 object_index = 0;
3792 3767
3793 for( ; node != NULL; node = gSelectMgr->getNextNode()) 3768 for( ; node != NULL; node = gSelectMgr->getSelection()->getNextNode())
3794 { 3769 {
3795 object = node->getObject(); 3770 object = node->getObject();
3796 if(!object || !node->mValid) 3771 if(!object || !node->mValid)
@@ -3831,8 +3806,9 @@ void force_export_copy(void*)
3831 } 3806 }
3832 3807
3833 // Copy the directory + file name 3808 // Copy the directory + file name
3834 char filepath[LL_MAX_PATH]; 3809 char filepath[LL_MAX_PATH]; /* Flawfinder: ignore */
3835 strcpy(filepath, picker.getFirstFile()); 3810 strncpy(filepath, picker.getFirstFile(), LL_MAX_PATH -1); /* Flawfinder: ignore */
3811 filepath[LL_MAX_PATH -1] = '\0';
3836 3812
3837 apr_file_t* fp = ll_apr_file_open(filepath, LL_APR_W); 3813 apr_file_t* fp = ll_apr_file_open(filepath, LL_APR_W);
3838 3814
@@ -3876,7 +3852,7 @@ void force_export_copy(void*)
3876 LLColor4 color = te->getColor(); 3852 LLColor4 color = te->getColor();
3877 apr_file_printf(fp, "\t<Face\n\t\tFaceColor='%d %5f %5f %5f %5f'\n", face, color.mV[VX], color.mV[VY], color.mV[VZ], color.mV[VW]); 3853 apr_file_printf(fp, "\t<Face\n\t\tFaceColor='%d %5f %5f %5f %5f'\n", face, color.mV[VX], color.mV[VY], color.mV[VZ], color.mV[VW]);
3878 3854
3879 char texture[UUID_STR_LENGTH]; 3855 char texture[UUID_STR_LENGTH]; /* Flawfinder: ignore */
3880 LLUUID texid = te->getID(); 3856 LLUUID texid = te->getID();
3881 texid.toString(texture); 3857 texid.toString(texture);
3882 F32 sx, sy, ox, oy; 3858 F32 sx, sy, ox, oy;
@@ -3942,8 +3918,9 @@ void force_import_geometry(void*)
3942 return; 3918 return;
3943 } 3919 }
3944 3920
3945 char directory[LL_MAX_PATH]; 3921 char directory[LL_MAX_PATH]; /* Flawfinder: ignore */
3946 strcpy(directory, picker.getFirstFile()); 3922 strncpy(directory, picker.getFirstFile(), LL_MAX_PATH -1); /* Flawfinder: ignore */
3923 directory[LL_MAX_PATH -1] = '\0';
3947 3924
3948 llinfos << "Loading LSG file " << directory << llendl; 3925 llinfos << "Loading LSG file " << directory << llendl;
3949 LLXmlTree *xmlparser = new LLXmlTree(); 3926 LLXmlTree *xmlparser = new LLXmlTree();
@@ -3966,8 +3943,8 @@ void force_import_geometry(void*)
3966 { 3943 {
3967 // get object data 3944 // get object data
3968 // *NOTE: This buffer size is hard coded into scanf() below. 3945 // *NOTE: This buffer size is hard coded into scanf() below.
3969 char name[255]; // Shape 3946 char name[255]; /* Flawfinder: ignore */ // Shape
3970 char description[255]; // Description 3947 char description[255]; /* Flawfinder: ignore */ // Description
3971 U32 material; // Material 3948 U32 material; // Material
3972 F32 sx, sy, sz; // Scale 3949 F32 sx, sy, sz; // Scale
3973 LLVector3 scale; 3950 LLVector3 scale;
@@ -3998,9 +3975,11 @@ void force_import_geometry(void*)
3998 child->getAttributeString("PCode", &attribute); 3975 child->getAttributeString("PCode", &attribute);
3999 pcode = atoi(attribute.c_str()); 3976 pcode = atoi(attribute.c_str());
4000 child->getAttributeString("Shape", &attribute); 3977 child->getAttributeString("Shape", &attribute);
4001 sscanf(attribute.c_str(), "%254s", name); 3978 sscanf( /* Flawfinder: ignore */
3979 attribute.c_str(), "%254s", name);
4002 child->getAttributeString("Description", &attribute); 3980 child->getAttributeString("Description", &attribute);
4003 sscanf(attribute.c_str(), "%254s", description); 3981 sscanf( /* Flawfinder: ignore */
3982 attribute.c_str(), "%254s", description);
4004 child->getAttributeString("Material", &attribute); 3983 child->getAttributeString("Material", &attribute);
4005 material = atoi(attribute.c_str()); 3984 material = atoi(attribute.c_str());
4006 child->getAttributeString("Scale", &attribute); 3985 child->getAttributeString("Scale", &attribute);
@@ -4115,16 +4094,16 @@ void handle_take()
4115{ 4094{
4116 // we want to use the folder this was derezzed from if it's 4095 // we want to use the folder this was derezzed from if it's
4117 // available. Otherwise, derez to the normal place. 4096 // available. Otherwise, derez to the normal place.
4118 if(gSelectMgr->isEmpty()) return; 4097 if(gSelectMgr->getSelection()->isEmpty()) return;
4119 LLSelectNode* node = NULL; 4098 LLSelectNode* node = NULL;
4120 LLViewerObject* object = NULL; 4099 LLViewerObject* object = NULL;
4121 BOOL you_own_everything = TRUE; 4100 BOOL you_own_everything = TRUE;
4122 4101
4123 BOOL locked_but_takeable_object = FALSE; 4102 BOOL locked_but_takeable_object = FALSE;
4124 LLUUID category_id; 4103 LLUUID category_id;
4125 for(node = gSelectMgr->getFirstRootNode(); 4104 for(node = gSelectMgr->getSelection()->getFirstRootNode();
4126 node != NULL; 4105 node != NULL;
4127 node = gSelectMgr->getNextRootNode()) 4106 node = gSelectMgr->getSelection()->getNextRootNode())
4128 { 4107 {
4129 object = node->getObject(); 4108 object = node->getObject();
4130 if(object) 4109 if(object)
@@ -4160,7 +4139,7 @@ void handle_take()
4160 if(category_id.notNull()) 4139 if(category_id.notNull())
4161 { 4140 {
4162 // there is an unambiguous destination. See if this agent has 4141 // there is an unambiguous destination. See if this agent has
4163 // such a location and it is not in the trash. 4142 // such a location and it is not in the trash or library
4164 if(!gInventory.getCategory(category_id)) 4143 if(!gInventory.getCategory(category_id))
4165 { 4144 {
4166 // nope, set to NULL. 4145 // nope, set to NULL.
@@ -4168,12 +4147,20 @@ void handle_take()
4168 } 4147 }
4169 if(category_id.notNull()) 4148 if(category_id.notNull())
4170 { 4149 {
4150 // check trash
4171 LLUUID trash; 4151 LLUUID trash;
4172 trash = gInventory.findCategoryUUIDForType(LLAssetType::AT_TRASH); 4152 trash = gInventory.findCategoryUUIDForType(LLAssetType::AT_TRASH);
4173 if(category_id == trash || gInventory.isObjectDescendentOf(category_id, trash)) 4153 if(category_id == trash || gInventory.isObjectDescendentOf(category_id, trash))
4174 { 4154 {
4175 category_id.setNull(); 4155 category_id.setNull();
4176 } 4156 }
4157
4158 // check library
4159 if(gInventory.isObjectDescendentOf(category_id, gInventoryLibraryRoot))
4160 {
4161 category_id.setNull();
4162 }
4163
4177 } 4164 }
4178 } 4165 }
4179 if(category_id.isNull()) 4166 if(category_id.isNull())
@@ -4185,10 +4172,8 @@ void handle_take()
4185 4172
4186 !you_own_everything) 4173 !you_own_everything)
4187 { 4174 {
4188
4189 if(locked_but_takeable_object && you_own_everything) 4175 if(locked_but_takeable_object && you_own_everything)
4190 { 4176 {
4191
4192 gViewerWindow->alertXml("ConfirmObjectTakeLock", 4177 gViewerWindow->alertXml("ConfirmObjectTakeLock",
4193 confirm_take, 4178 confirm_take,
4194 (void*)cat_id); 4179 (void*)cat_id);
@@ -4196,7 +4181,6 @@ void handle_take()
4196 } 4181 }
4197 else if(!locked_but_takeable_object && !you_own_everything) 4182 else if(!locked_but_takeable_object && !you_own_everything)
4198 { 4183 {
4199
4200 gViewerWindow->alertXml("ConfirmObjectTakeNoOwn", 4184 gViewerWindow->alertXml("ConfirmObjectTakeNoOwn",
4201 confirm_take, 4185 confirm_take,
4202 (void*)cat_id); 4186 (void*)cat_id);
@@ -4239,9 +4223,9 @@ BOOL enable_take()
4239 } 4223 }
4240 4224
4241 LLViewerObject* object = NULL; 4225 LLViewerObject* object = NULL;
4242 for(LLSelectNode* node = gSelectMgr->getFirstRootNode(); 4226 for(LLSelectNode* node = gSelectMgr->getSelection()->getFirstRootNode();
4243 node != NULL; 4227 node != NULL;
4244 node = gSelectMgr->getNextRootNode()) 4228 node = gSelectMgr->getSelection()->getNextRootNode())
4245 { 4229 {
4246 object = node->getObject(); 4230 object = node->getObject();
4247 if(!object || !node->mValid) continue; 4231 if(!object || !node->mValid) continue;
@@ -4275,7 +4259,7 @@ class LLToolsBuyOrTake : public view_listener_t
4275{ 4259{
4276 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) 4260 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
4277 { 4261 {
4278 if (gSelectMgr->isEmpty()) 4262 if (gSelectMgr->getSelection()->isEmpty())
4279 { 4263 {
4280 return true; 4264 return true;
4281 } 4265 }
@@ -4355,9 +4339,9 @@ class LLToolsEnableBuyOrTake : public view_listener_t
4355BOOL is_selection_buy_not_take() 4339BOOL is_selection_buy_not_take()
4356{ 4340{
4357 LLViewerObject* obj = NULL; 4341 LLViewerObject* obj = NULL;
4358 for(LLSelectNode* node = gSelectMgr->getFirstRootNode(); 4342 for(LLSelectNode* node = gSelectMgr->getSelection()->getFirstRootNode();
4359 node != NULL; 4343 node != NULL;
4360 node = gSelectMgr->getNextRootNode()) 4344 node = gSelectMgr->getSelection()->getNextRootNode())
4361 { 4345 {
4362 obj = node->getObject(); 4346 obj = node->getObject();
4363 if(obj && !(obj->permYouOwner()) && (node->mSaleInfo.isForSale())) 4347 if(obj && !(obj->permYouOwner()) && (node->mSaleInfo.isForSale()))
@@ -4374,9 +4358,9 @@ S32 selection_price()
4374{ 4358{
4375 LLViewerObject* obj = NULL; 4359 LLViewerObject* obj = NULL;
4376 S32 total_price = 0; 4360 S32 total_price = 0;
4377 for(LLSelectNode* node = gSelectMgr->getFirstRootNode(); 4361 for(LLSelectNode* node = gSelectMgr->getSelection()->getFirstRootNode();
4378 node != NULL; 4362 node != NULL;
4379 node = gSelectMgr->getNextRootNode()) 4363 node = gSelectMgr->getSelection()->getNextRootNode())
4380 { 4364 {
4381 obj = node->getObject(); 4365 obj = node->getObject();
4382 if(obj && !(obj->permYouOwner()) && (node->mSaleInfo.isForSale())) 4366 if(obj && !(obj->permYouOwner()) && (node->mSaleInfo.isForSale()))
@@ -4425,7 +4409,7 @@ void handle_buy_currency(void*)
4425 4409
4426void handle_buy(void*) 4410void handle_buy(void*)
4427{ 4411{
4428 if (gSelectMgr->isEmpty()) return; 4412 if (gSelectMgr->getSelection()->isEmpty()) return;
4429 4413
4430 LLSaleInfo sale_info; 4414 LLSaleInfo sale_info;
4431 BOOL valid = gSelectMgr->selectGetSaleInfo(sale_info); 4415 BOOL valid = gSelectMgr->selectGetSaleInfo(sale_info);
@@ -4452,7 +4436,7 @@ class LLObjectBuy : public view_listener_t
4452 4436
4453BOOL sitting_on_selection() 4437BOOL sitting_on_selection()
4454{ 4438{
4455 LLSelectNode* node = gSelectMgr->getFirstRootNode(); 4439 LLSelectNode* node = gSelectMgr->getSelection()->getFirstRootNode();
4456 if (!node) 4440 if (!node)
4457 { 4441 {
4458 return FALSE; 4442 return FALSE;
@@ -4497,7 +4481,7 @@ class LLToolsSaveToObjectInventory : public view_listener_t
4497 { 4481 {
4498 if(gSelectMgr) 4482 if(gSelectMgr)
4499 { 4483 {
4500 LLSelectNode* node = gSelectMgr->getFirstRootNode(); 4484 LLSelectNode* node = gSelectMgr->getSelection()->getFirstRootNode();
4501 if(node && (node->mValid) && (!node->mFromTaskID.isNull())) 4485 if(node && (node->mValid) && (!node->mFromTaskID.isNull()))
4502 { 4486 {
4503 // *TODO: check to see if the fromtaskid object exists. 4487 // *TODO: check to see if the fromtaskid object exists.
@@ -4516,9 +4500,10 @@ class LLToolsSnapObjectXY : public view_listener_t
4516 F64 snap_size = (F64)gSavedSettings.getF32("GridResolution"); 4500 F64 snap_size = (F64)gSavedSettings.getF32("GridResolution");
4517 4501
4518 LLViewerObject* obj; 4502 LLViewerObject* obj;
4519 for (obj = gSelectMgr->getFirstRootObject(); 4503 LLObjectSelectionHandle selection = gSelectMgr->getSelection();
4504 for (obj = selection->getFirstRootObject();
4520 obj != NULL; 4505 obj != NULL;
4521 obj = gSelectMgr->getNextRootObject()) 4506 obj = selection->getNextRootObject())
4522 { 4507 {
4523 if (obj->permModify()) 4508 if (obj->permModify())
4524 { 4509 {
@@ -4574,11 +4559,12 @@ class LLToolsEnableLink : public view_listener_t
4574 // in component mode, can't link 4559 // in component mode, can't link
4575 if (gSavedSettings.getBOOL("SelectLinkedSet")) 4560 if (gSavedSettings.getBOOL("SelectLinkedSet"))
4576 { 4561 {
4577 if(gSelectMgr->selectGetAllRootsValid() && gSelectMgr->getRootObjectCount() >= 2) 4562 if(gSelectMgr->selectGetAllRootsValid() && gSelectMgr->getSelection()->getRootObjectCount() >= 2)
4578 { 4563 {
4579 for(LLViewerObject* object = gSelectMgr->getFirstRootObject(); 4564 LLObjectSelectionHandle selection = gSelectMgr->getSelection();
4565 for(LLViewerObject* object = selection->getFirstRootObject();
4580 object != NULL; 4566 object != NULL;
4581 object = gSelectMgr->getNextRootObject()) 4567 object = selection->getNextRootObject())
4582 { 4568 {
4583 if(object->permModify()) 4569 if(object->permModify())
4584 { 4570 {
@@ -4603,7 +4589,7 @@ class LLToolsLink : public view_listener_t
4603 return true; 4589 return true;
4604 } 4590 }
4605 4591
4606 S32 object_count = gSelectMgr->getObjectCount(); 4592 S32 object_count = gSelectMgr->getSelection()->getObjectCount();
4607 if (object_count > MAX_CHILDREN_PER_TASK + 1) 4593 if (object_count > MAX_CHILDREN_PER_TASK + 1)
4608 { 4594 {
4609 LLStringBase<char>::format_map_t args; 4595 LLStringBase<char>::format_map_t args;
@@ -4614,7 +4600,7 @@ class LLToolsLink : public view_listener_t
4614 return true; 4600 return true;
4615 } 4601 }
4616 4602
4617 if(gSelectMgr->getRootObjectCount() < 2) 4603 if(gSelectMgr->getSelection()->getRootObjectCount() < 2)
4618 { 4604 {
4619 gViewerWindow->alertXml("CannotLinkIncompleteSet"); 4605 gViewerWindow->alertXml("CannotLinkIncompleteSet");
4620 return true; 4606 return true;
@@ -4644,8 +4630,8 @@ class LLToolsEnableUnlink : public view_listener_t
4644 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) 4630 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
4645 { 4631 {
4646 bool new_value = gSelectMgr->selectGetAllRootsValid() && 4632 bool new_value = gSelectMgr->selectGetAllRootsValid() &&
4647 gSelectMgr->getFirstEditableObject() && 4633 gSelectMgr->getSelection()->getFirstEditableObject() &&
4648 !gSelectMgr->getFirstEditableObject()->isAttachment(); 4634 !gSelectMgr->getSelection()->getFirstEditableObject()->isAttachment();
4649 gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); 4635 gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value);
4650 return true; 4636 return true;
4651 } 4637 }
@@ -4707,7 +4693,7 @@ void handle_dehinge(void*)
4707 4693
4708BOOL enable_dehinge(void*) 4694BOOL enable_dehinge(void*)
4709{ 4695{
4710 LLViewerObject* obj = gSelectMgr->getFirstEditableObject(); 4696 LLViewerObject* obj = gSelectMgr->getSelection()->getFirstEditableObject();
4711 return obj && !obj->isAttachment(); 4697 return obj && !obj->isAttachment();
4712} 4698}
4713 4699
@@ -5003,7 +4989,7 @@ void toggle_map( void* user_data )
5003 } 4989 }
5004 else 4990 else
5005 { 4991 {
5006 gFloaterMap->open(); 4992 gFloaterMap->open(); /* Flawfinder: ignore */
5007 } 4993 }
5008} 4994}
5009 4995
@@ -5082,8 +5068,8 @@ const char* upload_pick(void* data)
5082 { 5068 {
5083 const char* cur_token = token_iter->c_str(); 5069 const char* cur_token = token_iter->c_str();
5084 5070
5085 if (0 == strnicmp(cur_token, ext, strlen(cur_token)) || 5071 if (0 == strnicmp(cur_token, ext, strlen(cur_token)) || /* Flawfinder: ignore */
5086 0 == strnicmp(cur_token, "*.*", strlen(cur_token))) 5072 0 == strnicmp(cur_token, "*.*", strlen(cur_token))) /* Flawfinder: ignore */
5087 { 5073 {
5088 //valid extension 5074 //valid extension
5089 //or the acceptable extension is any 5075 //or the acceptable extension is any
@@ -5110,7 +5096,7 @@ const char* upload_pick(void* data)
5110 if (type == LLFilePicker::FFLOAD_WAV) 5096 if (type == LLFilePicker::FFLOAD_WAV)
5111 { 5097 {
5112 // pre-qualify wavs to make sure the format is acceptable 5098 // pre-qualify wavs to make sure the format is acceptable
5113 char error_msg[MAX_STRING]; 5099 char error_msg[MAX_STRING]; /* Flawfinder: ignore */
5114 if (check_for_invalid_wav_formats(filename,error_msg)) 5100 if (check_for_invalid_wav_formats(filename,error_msg))
5115 { 5101 {
5116 llinfos << error_msg << ": " << filename << llendl; 5102 llinfos << error_msg << ": " << filename << llendl;
@@ -5213,7 +5199,7 @@ class LLFileUploadBulk : public view_listener_t
5213 char* end_p = strrchr(asset_name_str, '.'); // strip extension if exists 5199 char* end_p = strrchr(asset_name_str, '.'); // strip extension if exists
5214 if( !end_p ) 5200 if( !end_p )
5215 { 5201 {
5216 end_p = asset_name_str + strlen( asset_name_str ); 5202 end_p = asset_name_str + strlen( asset_name_str ); /* Flawfinder: ignore */
5217 } 5203 }
5218 5204
5219 S32 len = llmin( (S32) (DB_INV_ITEM_NAME_STR_LEN), (S32) (end_p - asset_name_str) ); 5205 S32 len = llmin( (S32) (DB_INV_ITEM_NAME_STR_LEN), (S32) (end_p - asset_name_str) );
@@ -5241,15 +5227,23 @@ void upload_error(const char* error_message, const char* label, const std::strin
5241 LLFilePicker::instance().reset(); 5227 LLFilePicker::instance().reset();
5242} 5228}
5243 5229
5230class LLFileEnableCloseWindow : public view_listener_t
5231{
5232 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
5233 {
5234 bool new_value = gFloaterView->getFocusedFloater() != NULL || gSnapshotFloaterView->getFocusedFloater() != NULL;
5235 // horrendously opaque, this code
5236 gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value);
5237 return true;
5238 }
5239};
5240
5244class LLFileCloseWindow : public view_listener_t 5241class LLFileCloseWindow : public view_listener_t
5245{ 5242{
5246 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) 5243 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
5247 { 5244 {
5248 LLFloater *top = gFloaterView->getFrontmost(); 5245 LLFloater::closeFocusedFloater();
5249 if (top && top->hasFocus()) 5246
5250 {
5251 LLFloater::closeByMenu( top );
5252 }
5253 return true; 5247 return true;
5254 } 5248 }
5255}; 5249};
@@ -5394,7 +5388,7 @@ void upload_new_resource(const LLString& src_filename, std::string name,
5394 5388
5395 LLString ext = src_filename.substr(src_filename.find_last_of('.')); 5389 LLString ext = src_filename.substr(src_filename.find_last_of('.'));
5396 LLAssetType::EType asset_type = LLAssetType::AT_NONE; 5390 LLAssetType::EType asset_type = LLAssetType::AT_NONE;
5397 char error_message[MAX_STRING]; 5391 char error_message[MAX_STRING]; /* Flawfinder: ignore */
5398 error_message[0] = '\0'; 5392 error_message[0] = '\0';
5399 LLString temp_str; 5393 LLString temp_str;
5400 5394
@@ -5408,7 +5402,8 @@ void upload_new_resource(const LLString& src_filename, std::string name,
5408 LLString short_name = filename.substr(offset); 5402 LLString short_name = filename.substr(offset);
5409 5403
5410 // No extension 5404 // No extension
5411 sprintf(error_message, 5405 snprintf(error_message, /* Flawfinder: ignore */
5406 MAX_STRING,
5412 "No file extension for the file: '%s'\nPlease make sure the file has a correct file extension", 5407 "No file extension for the file: '%s'\nPlease make sure the file has a correct file extension",
5413 short_name.c_str()); 5408 short_name.c_str());
5414 args["[FILE]"] = short_name; 5409 args["[FILE]"] = short_name;
@@ -5422,7 +5417,7 @@ void upload_new_resource(const LLString& src_filename, std::string name,
5422 filename, 5417 filename,
5423 IMG_CODEC_BMP )) 5418 IMG_CODEC_BMP ))
5424 { 5419 {
5425 sprintf(error_message, "Problem with file %s:\n\n%s\n", 5420 snprintf(error_message, MAX_STRING, "Problem with file %s:\n\n%s\n", /* Flawfinder: ignore */
5426 src_filename.c_str(), LLImageBase::getLastError().c_str()); 5421 src_filename.c_str(), LLImageBase::getLastError().c_str());
5427 args["[FILE]"] = src_filename; 5422 args["[FILE]"] = src_filename;
5428 args["[ERROR]"] = LLImageBase::getLastError(); 5423 args["[ERROR]"] = LLImageBase::getLastError();
@@ -5437,7 +5432,7 @@ void upload_new_resource(const LLString& src_filename, std::string name,
5437 filename, 5432 filename,
5438 IMG_CODEC_TGA )) 5433 IMG_CODEC_TGA ))
5439 { 5434 {
5440 sprintf(error_message, "Problem with file %s:\n\n%s\n", 5435 snprintf(error_message, MAX_STRING, "Problem with file %s:\n\n%s\n", /* Flawfinder: ignore */
5441 src_filename.c_str(), LLImageBase::getLastError().c_str()); 5436 src_filename.c_str(), LLImageBase::getLastError().c_str());
5442 args["[FILE]"] = src_filename; 5437 args["[FILE]"] = src_filename;
5443 args["[ERROR]"] = LLImageBase::getLastError(); 5438 args["[ERROR]"] = LLImageBase::getLastError();
@@ -5452,7 +5447,7 @@ void upload_new_resource(const LLString& src_filename, std::string name,
5452 filename, 5447 filename,
5453 IMG_CODEC_JPEG )) 5448 IMG_CODEC_JPEG ))
5454 { 5449 {
5455 sprintf(error_message, "Problem with file %s:\n\n%s\n", 5450 snprintf(error_message, MAX_STRING, "Problem with file %s:\n\n%s\n", /* Flawfinder: ignore */
5456 src_filename.c_str(), LLImageBase::getLastError().c_str()); 5451 src_filename.c_str(), LLImageBase::getLastError().c_str());
5457 args["[FILE]"] = src_filename; 5452 args["[FILE]"] = src_filename;
5458 args["[ERROR]"] = LLImageBase::getLastError(); 5453 args["[ERROR]"] = LLImageBase::getLastError();
@@ -5480,13 +5475,13 @@ void upload_new_resource(const LLString& src_filename, std::string name,
5480 switch(encode_result) 5475 switch(encode_result)
5481 { 5476 {
5482 case LLVORBISENC_DEST_OPEN_ERR: 5477 case LLVORBISENC_DEST_OPEN_ERR:
5483 sprintf(error_message, "Couldn't open temporary compressed sound file for writing: %s\n", filename.c_str()); 5478 snprintf(error_message, MAX_STRING, "Couldn't open temporary compressed sound file for writing: %s\n", filename.c_str()); /* Flawfinder: ignore */
5484 args["[FILE]"] = filename; 5479 args["[FILE]"] = filename;
5485 upload_error(error_message, "CannotOpenTemporarySoundFile", filename, args); 5480 upload_error(error_message, "CannotOpenTemporarySoundFile", filename, args);
5486 break; 5481 break;
5487 5482
5488 default: 5483 default:
5489 sprintf(error_message, "Unknown vorbis encode failure on: %s\n", src_filename.c_str()); 5484 snprintf(error_message, MAX_STRING, "Unknown vorbis encode failure on: %s\n", src_filename.c_str()); /* Flawfinder: ignore */
5490 args["[FILE]"] = src_filename; 5485 args["[FILE]"] = src_filename;
5491 upload_error(error_message, "UnknownVorbisEncodeFailure", filename, args); 5486 upload_error(error_message, "UnknownVorbisEncodeFailure", filename, args);
5492 break; 5487 break;
@@ -5498,26 +5493,29 @@ void upload_new_resource(const LLString& src_filename, std::string name,
5498 { 5493 {
5499 // This is a generic .lin resource file 5494 // This is a generic .lin resource file
5500 asset_type = LLAssetType::AT_OBJECT; 5495 asset_type = LLAssetType::AT_OBJECT;
5501 FILE *in = LLFile::fopen(src_filename.c_str(), "rb"); 5496 FILE* in = LLFile::fopen(src_filename.c_str(), "rb"); /* Flawfinder: ignore */
5502 if (in) 5497 if (in)
5503 { 5498 {
5504 // read in the file header 5499 // read in the file header
5505 char buf[16384]; 5500 char buf[16384]; /* Flawfinder: ignore */
5506 S32 read; 5501 S32 read; /* Flawfinder: ignore */
5507 S32 version; 5502 S32 version;
5508 if (fscanf(in, "LindenResource\nversion %d\n", &version)) 5503 if (fscanf(in, "LindenResource\nversion %d\n", &version))
5509 { 5504 {
5510 if (2 == version) 5505 if (2 == version)
5511 { 5506 {
5512 // *NOTE: This buffer size is hard coded into scanf() below. 5507 // *NOTE: This buffer size is hard coded into scanf() below.
5513 char label[MAX_STRING]; 5508 char label[MAX_STRING]; /* Flawfinder: ignore */
5514 char value[MAX_STRING]; 5509 char value[MAX_STRING]; /* Flawfinder: ignore */
5515 S32 tokens_read; 5510 S32 tokens_read;
5516 while (fgets(buf, 1024, in)) 5511 while (fgets(buf, 1024, in))
5517 { 5512 {
5518 label[0] = '\0'; 5513 label[0] = '\0';
5519 value[0] = '\0'; 5514 value[0] = '\0';
5520 tokens_read = sscanf(buf, "%254s %254s\n", label, value); 5515 tokens_read = sscanf( /* Flawfinder: ignore */
5516 buf,
5517 "%254s %254s\n",
5518 label, value);
5521 5519
5522 llinfos << "got: " << label << " = " << value 5520 llinfos << "got: " << label << " = " << value
5523 << llendl; 5521 << llendl;
@@ -5525,7 +5523,7 @@ void upload_new_resource(const LLString& src_filename, std::string name,
5525 if (EOF == tokens_read) 5523 if (EOF == tokens_read)
5526 { 5524 {
5527 fclose(in); 5525 fclose(in);
5528 sprintf(error_message, "corrupt resource file: %s", src_filename.c_str()); 5526 snprintf(error_message, MAX_STRING, "corrupt resource file: %s", src_filename.c_str()); /* Flawfinder: ignore */
5529 args["[FILE]"] = src_filename; 5527 args["[FILE]"] = src_filename;
5530 upload_error(error_message, "CorruptResourceFile", filename, args); 5528 upload_error(error_message, "CorruptResourceFile", filename, args);
5531 return; 5529 return;
@@ -5553,7 +5551,7 @@ void upload_new_resource(const LLString& src_filename, std::string name,
5553 else 5551 else
5554 { 5552 {
5555 fclose(in); 5553 fclose(in);
5556 sprintf(error_message, "unknown linden resource file version in file: %s", src_filename.c_str()); 5554 snprintf(error_message, MAX_STRING, "unknown linden resource file version in file: %s", src_filename.c_str()); /* Flawfinder: ignore */
5557 args["[FILE]"] = src_filename; 5555 args["[FILE]"] = src_filename;
5558 upload_error(error_message, "UnknownResourceFileVersion", filename, args); 5556 upload_error(error_message, "UnknownResourceFileVersion", filename, args);
5559 return; 5557 return;
@@ -5572,24 +5570,24 @@ void upload_new_resource(const LLString& src_filename, std::string name,
5572 5570
5573 // read in and throw out most of the header except for the type 5571 // read in and throw out most of the header except for the type
5574 fread(buf, header_size, 1, in); 5572 fread(buf, header_size, 1, in);
5575 memcpy(&type_num, buf + 16, sizeof(S16)); 5573 memcpy(&type_num, buf + 16, sizeof(S16)); /* Flawfinder: ignore */
5576 asset_type = (LLAssetType::EType)type_num; 5574 asset_type = (LLAssetType::EType)type_num;
5577 } 5575 }
5578 5576
5579 // copy the file's data segment into another file for uploading 5577 // copy the file's data segment into another file for uploading
5580 FILE *out = LLFile::fopen(filename.c_str(), "wb"); 5578 FILE* out = LLFile::fopen(filename.c_str(), "wb"); /* Flawfinder: ignore */
5581 if (out) 5579 if (out)
5582 { 5580 {
5583 while((read = fread(buf, 1, 16384, in))) 5581 while((read = fread(buf, 1, 16384, in))) /* Flawfinder: ignore */
5584 { 5582 {
5585 fwrite(buf, 1, read, out); 5583 fwrite(buf, 1, read, out); /* Flawfinder: ignore */
5586 } 5584 }
5587 fclose(out); 5585 fclose(out);
5588 } 5586 }
5589 else 5587 else
5590 { 5588 {
5591 fclose(in); 5589 fclose(in);
5592 sprintf(error_message, "Unable to create output file: %s", filename.c_str()); 5590 snprintf(error_message, MAX_STRING, "Unable to create output file: %s", filename.c_str()); /* Flawfinder: ignore */
5593 args["[FILE]"] = filename; 5591 args["[FILE]"] = filename;
5594 upload_error(error_message, "UnableToCreateOutputFile", filename, args); 5592 upload_error(error_message, "UnableToCreateOutputFile", filename, args);
5595 return; 5593 return;
@@ -5604,14 +5602,14 @@ void upload_new_resource(const LLString& src_filename, std::string name,
5604 } 5602 }
5605 else if (LLString::compareInsensitive(ext.c_str(),".bvh") == 0) 5603 else if (LLString::compareInsensitive(ext.c_str(),".bvh") == 0)
5606 { 5604 {
5607 sprintf(error_message, "We do not currently support bulk upload of animation files\n"); 5605 snprintf(error_message, MAX_STRING, "We do not currently support bulk upload of animation files\n"); /* Flawfinder: ignore */
5608 upload_error(error_message, "DoNotSupportBulkAnimationUpload", filename, args); 5606 upload_error(error_message, "DoNotSupportBulkAnimationUpload", filename, args);
5609 return; 5607 return;
5610 } 5608 }
5611 else 5609 else
5612 { 5610 {
5613 // Unknown extension 5611 // Unknown extension
5614 sprintf(error_message, "Unknown file extension %s\nExpected .wav, .tga, .bmp, .jpg, .jpeg, or .bvh", ext.c_str()); 5612 snprintf(error_message, MAX_STRING, "Unknown file extension %s\nExpected .wav, .tga, .bmp, .jpg, .jpeg, or .bvh", ext.c_str()); /* Flawfinder: ignore */
5615 error = TRUE;; 5613 error = TRUE;;
5616 } 5614 }
5617 5615
@@ -5640,7 +5638,7 @@ void upload_new_resource(const LLString& src_filename, std::string name,
5640 } 5638 }
5641 else 5639 else
5642 { 5640 {
5643 sprintf(error_message, "Unable to access output file: %s", filename.c_str()); 5641 snprintf(error_message, MAX_STRING, "Unable to access output file: %s", filename.c_str()); /* Flawfinder: ignore */
5644 error = TRUE; 5642 error = TRUE;
5645 } 5643 }
5646 } 5644 }
@@ -5724,7 +5722,7 @@ void upload_new_resource(const LLTransactionID &tid, LLAssetType::EType asset_ty
5724 llinfos << "Desc: " << desc << llendl; 5722 llinfos << "Desc: " << desc << llendl;
5725 lldebugs << "Folder: " << gInventory.findCategoryUUIDForType(destination_folder_type) << llendl; 5723 lldebugs << "Folder: " << gInventory.findCategoryUUIDForType(destination_folder_type) << llendl;
5726 lldebugs << "Asset Type: " << LLAssetType::lookup(asset_type) << llendl; 5724 lldebugs << "Asset Type: " << LLAssetType::lookup(asset_type) << llendl;
5727 std::string url = gAgent.getRegion()->getCapability("NewAgentInventory"); 5725 std::string url = gAgent.getRegion()->getCapability("NewFileAgentInventory");
5728 if (!url.empty()) 5726 if (!url.empty())
5729 { 5727 {
5730 llinfos << "New Agent Inventory via capability" << llendl; 5728 llinfos << "New Agent Inventory via capability" << llendl;
@@ -5738,7 +5736,7 @@ void upload_new_resource(const LLTransactionID &tid, LLAssetType::EType asset_ty
5738 std::ostringstream llsdxml; 5736 std::ostringstream llsdxml;
5739 LLSDSerialize::toXML(body, llsdxml); 5737 LLSDSerialize::toXML(body, llsdxml);
5740 lldebugs << "posting body to capability: " << llsdxml.str() << llendl; 5738 lldebugs << "posting body to capability: " << llsdxml.str() << llendl;
5741 LLHTTPClient::post(url, body, new LLNewAgentInventoryResponder(uuid, body)); 5739 LLHTTPClient::post(url, body, new LLNewAgentInventoryResponder(body, uuid, asset_type));
5742 } 5740 }
5743 else 5741 else
5744 { 5742 {
@@ -5884,7 +5882,7 @@ void upload_done_callback(const LLUUID& uuid, void* user_data, S32 result) // St
5884 char* end_p = strrchr(asset_name_str, '.'); // strip extension if exists 5882 char* end_p = strrchr(asset_name_str, '.'); // strip extension if exists
5885 if( !end_p ) 5883 if( !end_p )
5886 { 5884 {
5887 end_p = asset_name_str + strlen( asset_name_str ); 5885 end_p = asset_name_str + strlen( asset_name_str ); /* Flawfinder: ignore */
5888 } 5886 }
5889 5887
5890 S32 len = llmin( (S32) (DB_INV_ITEM_NAME_STR_LEN), (S32) (end_p - asset_name_str) ); 5888 S32 len = llmin( (S32) (DB_INV_ITEM_NAME_STR_LEN), (S32) (end_p - asset_name_str) );
@@ -5903,12 +5901,13 @@ LLUploadDialog *gExportDialog = NULL;
5903 5901
5904void handle_export_selected( void * ) 5902void handle_export_selected( void * )
5905{ 5903{
5906 if (gSelectMgr->isEmpty()) 5904 LLObjectSelectionHandle selection = gSelectMgr->getSelection();
5905 if (selection->isEmpty())
5907 { 5906 {
5908 return; 5907 return;
5909 } 5908 }
5910 llinfos << "Exporting selected objects:" << llendl; 5909 llinfos << "Exporting selected objects:" << llendl;
5911 LLViewerObject *object = gSelectMgr->getFirstRootObject(); 5910 LLViewerObject *object = selection->getFirstRootObject();
5912 5911
5913 gExporterRequestID.generate(); 5912 gExporterRequestID.generate();
5914 gExportDirectory = ""; 5913 gExportDirectory = "";
@@ -5920,7 +5919,7 @@ void handle_export_selected( void * )
5920 msg->addUUIDFast(_PREHASH_RequestID, gExporterRequestID); 5919 msg->addUUIDFast(_PREHASH_RequestID, gExporterRequestID);
5921 msg->addS16Fast(_PREHASH_VolumeDetail, 4); 5920 msg->addS16Fast(_PREHASH_VolumeDetail, 4);
5922 5921
5923 for (; object != NULL; object = gSelectMgr->getNextRootObject()) 5922 for (; object != NULL; object = selection->getNextRootObject())
5924 { 5923 {
5925 msg->nextBlockFast(_PREHASH_ObjectData); 5924 msg->nextBlockFast(_PREHASH_ObjectData);
5926 msg->addUUIDFast(_PREHASH_ObjectID, object->getID()); 5925 msg->addUUIDFast(_PREHASH_ObjectID, object->getID());
@@ -5934,7 +5933,7 @@ void handle_export_selected( void * )
5934BOOL menu_check_build_tool( void* user_data ) 5933BOOL menu_check_build_tool( void* user_data )
5935{ 5934{
5936 S32 index = (intptr_t) user_data; 5935 S32 index = (intptr_t) user_data;
5937 return gCurrentToolset->isToolSelected( index ); 5936 return gToolMgr->getCurrentToolset()->isToolSelected( index );
5938} 5937}
5939 5938
5940void handle_reload_settings(void*) 5939void handle_reload_settings(void*)
@@ -6083,7 +6082,7 @@ class LLToolsLookAtSelection : public view_listener_t
6083 { 6082 {
6084 const F32 PADDING_FACTOR = 2.f; 6083 const F32 PADDING_FACTOR = 2.f;
6085 BOOL zoom = (userdata.asString() == "zoom"); 6084 BOOL zoom = (userdata.asString() == "zoom");
6086 if (!gSelectMgr->isEmpty()) 6085 if (!gSelectMgr->getSelection()->isEmpty())
6087 { 6086 {
6088 gAgent.setFocusOnAvatar(FALSE, ANIMATE); 6087 gAgent.setFocusOnAvatar(FALSE, ANIMATE);
6089 6088
@@ -6096,26 +6095,17 @@ class LLToolsLookAtSelection : public view_listener_t
6096 6095
6097 if (zoom) 6096 if (zoom)
6098 { 6097 {
6099 gAgent.setCameraPosAndFocusGlobal(gSelectMgr->getSelectionCenterGlobal() + LLVector3d(obj_to_cam * distance), gSelectMgr->getSelectionCenterGlobal(), gSelectMgr->getFirstObject()->mID ); 6098 gAgent.setCameraPosAndFocusGlobal(gSelectMgr->getSelectionCenterGlobal() + LLVector3d(obj_to_cam * distance), gSelectMgr->getSelectionCenterGlobal(), gSelectMgr->getSelection()->getFirstObject()->mID );
6100 } 6099 }
6101 else 6100 else
6102 { 6101 {
6103 gAgent.setFocusGlobal( gSelectMgr->getSelectionCenterGlobal(), gSelectMgr->getFirstObject()->mID ); 6102 gAgent.setFocusGlobal( gSelectMgr->getSelectionCenterGlobal(), gSelectMgr->getSelection()->getFirstObject()->mID );
6104 } 6103 }
6105 } 6104 }
6106 return true; 6105 return true;
6107 } 6106 }
6108}; 6107};
6109 6108
6110/*
6111void handle_reset_rotation(void*)
6112{
6113 gSelectMgr->selectionResetRotation();
6114
6115 dialog_refresh_all();
6116}
6117*/
6118
6119class LLAvatarAddFriend : public view_listener_t 6109class LLAvatarAddFriend : public view_listener_t
6120{ 6110{
6121 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) 6111 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
@@ -6125,7 +6115,6 @@ class LLAvatarAddFriend : public view_listener_t
6125 { 6115 {
6126 request_friendship(avatar->getID()); 6116 request_friendship(avatar->getID());
6127 } 6117 }
6128 gSelectMgr->deselectTransient();
6129 return true; 6118 return true;
6130 } 6119 }
6131}; 6120};
@@ -6137,54 +6126,47 @@ void complete_give_money(S32 option, void* user_data)
6137 gAgent.clearBusy(); 6126 gAgent.clearBusy();
6138 } 6127 }
6139 6128
6140 LLUUID* object_id = (LLUUID*)user_data; 6129 LLObjectSelectionHandle handle(*(LLObjectSelectionHandle*)user_data);
6130 delete (LLObjectSelectionHandle*)user_data;
6141 6131
6142 LLViewerObject* object = gObjectList.findObject(*object_id); 6132 LLViewerObject* objectp = handle->getPrimaryObject();
6143 if (object) 6133
6134 // Show avatar's name if paying attachment
6135 if (objectp && objectp->isAttachment())
6144 { 6136 {
6145 if (object->isAvatar()) 6137 while (objectp && !objectp->isAvatar())
6138 {
6139 objectp = (LLViewerObject*)objectp->getParent();
6140 }
6141 }
6142
6143 if (objectp)
6144 {
6145 if (objectp->isAvatar())
6146 { 6146 {
6147 const BOOL is_group = FALSE; 6147 const BOOL is_group = FALSE;
6148 LLFloaterPay::payDirectly(&give_money, 6148 LLFloaterPay::payDirectly(&give_money,
6149 *object_id, 6149 objectp->getID(),
6150 is_group); 6150 is_group);
6151 } 6151 }
6152 else 6152 else
6153 { 6153 {
6154 LLFloaterPay::payViaObject(&give_money, *object_id); 6154 LLFloaterPay::payViaObject(&give_money, objectp->getID());
6155 } 6155 }
6156 } 6156 }
6157
6158 delete object_id;
6159} 6157}
6160 6158
6161bool handle_give_money_dialog() 6159bool handle_give_money_dialog()
6162{ 6160{
6163 LLViewerObject *objectp = gViewerWindow->lastObjectHit(); 6161 LLObjectSelectionHandle* handlep = new LLObjectSelectionHandle(gSelectMgr->getSelection());
6164 LLUUID* object_id = new LLUUID();
6165
6166 // Show avatar's name if paying attachment
6167 if (objectp && objectp->isAttachment())
6168 {
6169 while (objectp && !objectp->isAvatar())
6170 {
6171 objectp = (LLViewerObject*)objectp->getParent();
6172 }
6173 }
6174
6175 if (objectp)
6176 {
6177 *object_id = objectp->getID();
6178 }
6179
6180 if (gAgent.getBusy()) 6162 if (gAgent.getBusy())
6181 { 6163 {
6182 // warn users of being in busy mode during a transaction 6164 // warn users of being in busy mode during a transaction
6183 gViewerWindow->alertXml("BusyModePay", complete_give_money, object_id); 6165 gViewerWindow->alertXml("BusyModePay", complete_give_money, handlep);
6184 } 6166 }
6185 else 6167 else
6186 { 6168 {
6187 complete_give_money(1, object_id); 6169 complete_give_money(1, handlep);
6188 } 6170 }
6189 return true; 6171 return true;
6190} 6172}
@@ -6252,7 +6234,7 @@ class LLObjectEnableSitOrStand : public view_listener_t
6252 } 6234 }
6253 else 6235 else
6254 { 6236 {
6255 LLSelectNode* node = gSelectMgr->getFirstRootNode(); 6237 LLSelectNode* node = gSelectMgr->getSelection()->getFirstRootNode();
6256 if (node && node->mValid && !node->mSitName.empty()) 6238 if (node && node->mValid && !node->mSitName.empty())
6257 { 6239 {
6258 label.assign(node->mSitName); 6240 label.assign(node->mSitName);
@@ -6288,25 +6270,6 @@ void dump_inventory(void*)
6288 gInventory.dumpInventory(); 6270 gInventory.dumpInventory();
6289} 6271}
6290 6272
6291
6292void handle_first_tool(void*)
6293{
6294 gCurrentToolset->selectFirstTool();
6295}
6296
6297
6298void handle_next_tool(void*)
6299{
6300 gCurrentToolset->selectNextTool();
6301}
6302
6303
6304void handle_previous_tool(void*)
6305{
6306 gCurrentToolset->selectPrevTool();
6307}
6308
6309
6310// forcibly unlock an object 6273// forcibly unlock an object
6311void handle_force_unlock(void*) 6274void handle_force_unlock(void*)
6312{ 6275{
@@ -6315,7 +6278,7 @@ void handle_force_unlock(void*)
6315 6278
6316 // Second, lie to the viewer and mark it editable and unowned 6279 // Second, lie to the viewer and mark it editable and unowned
6317 LLViewerObject* object; 6280 LLViewerObject* object;
6318 for (object = gSelectMgr->getFirstObject(); object; object = gSelectMgr->getNextObject() ) 6281 for (object = gSelectMgr->getSelection()->getFirstObject(); object; object = gSelectMgr->getSelection()->getNextObject() )
6319 { 6282 {
6320 object->mFlags |= FLAGS_OBJECT_MOVE; 6283 object->mFlags |= FLAGS_OBJECT_MOVE;
6321 object->mFlags |= FLAGS_OBJECT_MODIFY; 6284 object->mFlags |= FLAGS_OBJECT_MODIFY;
@@ -6377,24 +6340,6 @@ void handle_dump_followcam(void*)
6377 LLFollowCamMgr::dump(); 6340 LLFollowCamMgr::dump();
6378} 6341}
6379 6342
6380void handle_viewer_enable_circuit_log(void*)
6381{
6382 llinfos << "Showing circuit information every " << gMessageSystem->mCircuitPrintFreq << " seconds" << llendl;
6383 gErrorStream.setLevel( LLErrorStream::DEBUG );
6384 gErrorStream.setDebugFlag( LLERR_CIRCUIT_INFO );
6385 // and dump stuff out immediately
6386 gMessageSystem->dumpCircuitInfo();
6387}
6388
6389void handle_viewer_disable_circuit_log(void*)
6390{
6391 llinfos << "Hiding circuit information" << llendl;
6392#if !LL_DEBUG
6393 gErrorStream.setLevel( LLErrorStream::INFO );
6394#endif
6395 gErrorStream.clearDebugFlag( LLERR_CIRCUIT_INFO );
6396}
6397
6398void handle_viewer_enable_message_log(void*) 6343void handle_viewer_enable_message_log(void*)
6399{ 6344{
6400 gMessageSystem->startLogging(); 6345 gMessageSystem->startLogging();
@@ -6470,10 +6415,6 @@ class LLShowFloater : public view_listener_t
6470 { 6415 {
6471 gDebugView->mStatViewp->setVisible(!gDebugView->mStatViewp->getVisible()); 6416 gDebugView->mStatViewp->setVisible(!gDebugView->mStatViewp->getVisible());
6472 } 6417 }
6473 else if (floater_name == "account history")
6474 {
6475 LLFloaterAccountHistory::show(NULL);
6476 }
6477 else if (floater_name == "my land") 6418 else if (floater_name == "my land")
6478 { 6419 {
6479 LLFloaterLandHoldings::show(NULL); 6420 LLFloaterLandHoldings::show(NULL);
@@ -6624,7 +6565,15 @@ class LLPromptShowURL : public view_listener_t
6624 LLString alert = param.substr(0, offset); 6565 LLString alert = param.substr(0, offset);
6625 LLString url = param.substr(offset+1); 6566 LLString url = param.substr(offset+1);
6626 char *url_copy = new char[url.size()+1]; 6567 char *url_copy = new char[url.size()+1];
6627 strcpy(url_copy, url.c_str()); 6568 if (url_copy != NULL)
6569 {
6570 strcpy(url_copy, url.c_str()); /* Flawfinder: ignore */
6571 }
6572 else
6573 {
6574 llerrs << "Memory Allocation Failed" << llendl;
6575 return false;
6576 }
6628 gViewerWindow->alertXml(alert, callback_show_url, url_copy); 6577 gViewerWindow->alertXml(alert, callback_show_url, url_copy);
6629 } 6578 }
6630 else 6579 else
@@ -6656,7 +6605,15 @@ class LLPromptShowFile : public view_listener_t
6656 LLString alert = param.substr(0, offset); 6605 LLString alert = param.substr(0, offset);
6657 LLString file = param.substr(offset+1); 6606 LLString file = param.substr(offset+1);
6658 char *file_copy = new char[file.size()+1]; 6607 char *file_copy = new char[file.size()+1];
6659 strcpy(file_copy, file.c_str()); 6608 if (file_copy != NULL)
6609 {
6610 strcpy(file_copy, file.c_str()); /* Flawfinder: ignore */
6611 }
6612 else
6613 {
6614 llerrs << "Memory Allocation Failed" << llendl;
6615 return false;
6616 }
6660 gViewerWindow->alertXml(alert, callback_show_file, file_copy); 6617 gViewerWindow->alertXml(alert, callback_show_file, file_copy);
6661 } 6618 }
6662 else 6619 else
@@ -6737,8 +6694,8 @@ void handle_focus(void *)
6737 gViewerWindow->moveCursorToCenter(); 6694 gViewerWindow->moveCursorToCenter();
6738 6695
6739 // Switch to camera toolset 6696 // Switch to camera toolset
6740// gCurrentToolset = gCameraToolset; 6697// gToolMgr->setCurrentToolset(gCameraToolset);
6741 gCurrentToolset->selectTool( gToolCamera ); 6698 gToolMgr->getCurrentToolset()->selectTool( gToolCamera );
6742} 6699}
6743 6700
6744class LLLandEdit : public view_listener_t 6701class LLLandEdit : public view_listener_t
@@ -6764,10 +6721,10 @@ class LLLandEdit : public view_listener_t
6764 gParcelMgr->selectParcelAt( gLastHitPosGlobal ); 6721 gParcelMgr->selectParcelAt( gLastHitPosGlobal );
6765 6722
6766 gFloaterTools->showMore(TRUE); 6723 gFloaterTools->showMore(TRUE);
6767 gFloaterView->bringToFront( gFloaterTools ); 6724 gFloaterView->bringToFront( gFloaterTools );
6768 6725
6769 // Switch to land edit toolset 6726 // Switch to land edit toolset
6770 gCurrentToolset->selectTool( gToolParcel ); 6727 gToolMgr->getCurrentToolset()->selectTool( gToolParcel );
6771 return true; 6728 return true;
6772 } 6729 }
6773}; 6730};
@@ -6779,7 +6736,7 @@ class LLWorldEnableBuyLand : public view_listener_t
6779 bool new_value = gParcelMgr->canAgentBuyParcel( 6736 bool new_value = gParcelMgr->canAgentBuyParcel(
6780 gParcelMgr->selectionEmpty() 6737 gParcelMgr->selectionEmpty()
6781 ? gParcelMgr->getAgentParcel() 6738 ? gParcelMgr->getAgentParcel()
6782 : gParcelMgr->getSelectedParcel(), 6739 : gParcelMgr->getParcelSelection()->getParcel(),
6783 false); 6740 false);
6784 gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); 6741 gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value);
6785 return true; 6742 return true;
@@ -6789,7 +6746,7 @@ class LLWorldEnableBuyLand : public view_listener_t
6789BOOL enable_buy_land(void*) 6746BOOL enable_buy_land(void*)
6790{ 6747{
6791 return gParcelMgr->canAgentBuyParcel( 6748 return gParcelMgr->canAgentBuyParcel(
6792 gParcelMgr->getSelectedParcel(), false); 6749 gParcelMgr->getParcelSelection()->getParcel(), false);
6793} 6750}
6794 6751
6795 6752
@@ -6810,66 +6767,63 @@ void handle_move(void*)
6810 6767
6811 gViewerWindow->moveCursorToCenter(); 6768 gViewerWindow->moveCursorToCenter();
6812 6769
6813 gCurrentToolset = gBasicToolset; 6770 gToolMgr->setCurrentToolset(gBasicToolset);
6814 gCurrentToolset->selectTool( gToolGrab ); 6771 gToolMgr->getCurrentToolset()->selectTool( gToolGrab );
6815}
6816
6817
6818void near_attach_object(BOOL success, void *user_data)
6819{
6820 LLViewerJointAttachment *attachment = (LLViewerJointAttachment *)user_data;
6821
6822 U8 attachment_id;
6823 if (attachment)
6824 {
6825 attachment_id = gAgent.getAvatarObject()->mAttachmentPoints.reverseLookup(attachment);
6826 }
6827 else
6828 {
6829 // interpret 0 as "default location"
6830 attachment_id = 0;
6831 }
6832
6833 gSelectMgr->sendAttach(attachment_id);
6834} 6772}
6835 6773
6836class LLObjectAttachToAvatar : public view_listener_t 6774class LLObjectAttachToAvatar : public view_listener_t
6837{ 6775{
6776public:
6777 static void setObjectSelection(LLObjectSelectionHandle selection) { sObjectSelection = selection; }
6778
6779private:
6838 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) 6780 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
6839 { 6781 {
6840 LLViewerObject* selectedObject = gSelectMgr->getFirstRootObject(); 6782 setObjectSelection(gSelectMgr->getSelection());
6783 LLViewerObject* selectedObject = sObjectSelection->getFirstRootObject();
6841 if (selectedObject) 6784 if (selectedObject)
6842 { 6785 {
6843 confirm_replace_attachment(0, NULL); 6786 S32 index = userdata.asInteger();
6787 LLViewerJointAttachment* attachment_point = index > 0 ?
6788 gAgent.getAvatarObject()->mAttachmentPoints[index] :
6789 NULL;
6790 confirm_replace_attachment(0, attachment_point);
6844 } 6791 }
6845 return true; 6792 return true;
6846 } 6793 }
6794
6795protected:
6796 static LLObjectSelectionHandle sObjectSelection;
6847}; 6797};
6848 6798
6849// move this somewhere global 6799LLObjectSelectionHandle LLObjectAttachToAvatar::sObjectSelection;
6850void handle_attach_to_avatar(void* user_data)
6851{
6852 LLViewerObject* selectedObject = gSelectMgr->getFirstRootObject();
6853 if (selectedObject)
6854 {
6855 LLViewerJointAttachment *attachment = (LLViewerJointAttachment *)user_data;
6856 6800
6857 if (attachment && attachment->getObject(0)) 6801void near_attach_object(BOOL success, void *user_data)
6858 { 6802{
6859 gViewerWindow->alertXml("ReplaceAttachment", confirm_replace_attachment, user_data); 6803 if (success)
6860 } 6804 {
6861 else 6805 LLViewerJointAttachment *attachment = (LLViewerJointAttachment *)user_data;
6862 { 6806
6863 confirm_replace_attachment(0, user_data); 6807 U8 attachment_id;
6864 } 6808 if (attachment)
6865 } 6809 {
6810 attachment_id = gAgent.getAvatarObject()->mAttachmentPoints.reverseLookup(attachment);
6811 }
6812 else
6813 {
6814 // interpret 0 as "default location"
6815 attachment_id = 0;
6816 }
6817 gSelectMgr->sendAttach(attachment_id);
6818 }
6819 LLObjectAttachToAvatar::setObjectSelection(NULL);
6866} 6820}
6821
6867void confirm_replace_attachment(S32 option, void* user_data) 6822void confirm_replace_attachment(S32 option, void* user_data)
6868{ 6823{
6869 if (option == 0/*YES*/) 6824 if (option == 0/*YES*/)
6870 { 6825 {
6871 gSelectMgr->convertTransient(); 6826 LLViewerObject* selectedObject = gSelectMgr->getSelection()->getFirstRootObject();
6872 LLViewerObject* selectedObject = gSelectMgr->getFirstRootObject();
6873 if (selectedObject) 6827 if (selectedObject)
6874 { 6828 {
6875 const F32 MIN_STOP_DISTANCE = 1.f; // meters 6829 const F32 MIN_STOP_DISTANCE = 1.f; // meters
@@ -6936,12 +6890,7 @@ class LLAttachmentDrop : public view_listener_t
6936 // objects. Thus we need to clear the list, make sure it only 6890 // objects. Thus we need to clear the list, make sure it only
6937 // contains the object the user clicked, send the message, 6891 // contains the object the user clicked, send the message,
6938 // then clear the list. 6892 // then clear the list.
6939 // We use deselectAll to update the simulator's notion of what's
6940 // selected, and removeAll just to change things locally.
6941 //gSelectMgr->deselectAll();
6942 //gSelectMgr->selectObjectAndFamily(object);
6943 gSelectMgr->sendDropAttachment(); 6893 gSelectMgr->sendDropAttachment();
6944 gSelectMgr->deselectTransient();
6945 return true; 6894 return true;
6946 } 6895 }
6947}; 6896};
@@ -6951,7 +6900,7 @@ void handle_detach_from_avatar(void* user_data)
6951{ 6900{
6952 LLViewerJointAttachment *attachment = (LLViewerJointAttachment *)user_data; 6901 LLViewerJointAttachment *attachment = (LLViewerJointAttachment *)user_data;
6953 6902
6954 LLViewerObject* attached_object = attachment->getObject(0); 6903 LLViewerObject* attached_object = attachment->getObject();
6955 6904
6956 if (attached_object) 6905 if (attached_object)
6957 { 6906 {
@@ -6972,7 +6921,7 @@ void attach_label(LLString& label, void* user_data)
6972 if (attachmentp) 6921 if (attachmentp)
6973 { 6922 {
6974 label = attachmentp->getName(); 6923 label = attachmentp->getName();
6975 if (attachmentp->getObject(0)) 6924 if (attachmentp->getObject())
6976 { 6925 {
6977 LLViewerInventoryItem* itemp = gInventory.getItem(attachmentp->getItemID()); 6926 LLViewerInventoryItem* itemp = gInventory.getItem(attachmentp->getItemID());
6978 if (itemp) 6927 if (itemp)
@@ -6989,7 +6938,7 @@ void detach_label(LLString& label, void* user_data)
6989 if (attachmentp) 6938 if (attachmentp)
6990 { 6939 {
6991 label = attachmentp->getName(); 6940 label = attachmentp->getName();
6992 if (attachmentp->getObject(0)) 6941 if (attachmentp->getObject())
6993 { 6942 {
6994 LLViewerInventoryItem* itemp = gInventory.getItem(attachmentp->getItemID()); 6943 LLViewerInventoryItem* itemp = gInventory.getItem(attachmentp->getItemID());
6995 if (itemp) 6944 if (itemp)
@@ -7044,10 +6993,9 @@ class LLAttachmentDetach : public view_listener_t
7044 // We use deselectAll to update the simulator's notion of what's 6993 // We use deselectAll to update the simulator's notion of what's
7045 // selected, and removeAll just to change things locally. 6994 // selected, and removeAll just to change things locally.
7046 //RN: I thought it was more useful to detach everything that was selected 6995 //RN: I thought it was more useful to detach everything that was selected
7047 if (gSelectMgr->selectionIsAttachment()) 6996 if (gSelectMgr->getSelection()->isAttachment())
7048 { 6997 {
7049 gSelectMgr->sendDetach(); 6998 gSelectMgr->sendDetach();
7050 gSelectMgr->deselectAll();
7051 } 6999 }
7052 return true; 7000 return true;
7053 } 7001 }
@@ -7164,8 +7112,10 @@ class LLAttachmentEnableDetach : public view_listener_t
7164BOOL object_selected_and_point_valid(void *user_data) 7112BOOL object_selected_and_point_valid(void *user_data)
7165{ 7113{
7166 //LLViewerJointAttachment *attachment = (LLViewerJointAttachment *)user_data; 7114 //LLViewerJointAttachment *attachment = (LLViewerJointAttachment *)user_data;
7115 if (gSelectMgr == NULL) return FALSE;
7167 7116
7168 for (LLViewerObject *object = gSelectMgr->getFirstRootObject(); object; object = gSelectMgr->getNextRootObject()) 7117 LLObjectSelectionHandle selection = gSelectMgr->getSelection();
7118 for (LLViewerObject *object = selection->getFirstRootObject(); object; object = selection->getNextRootObject())
7169 { 7119 {
7170 for (U32 child_num = 0; child_num < object->mChildList.size(); child_num++ ) 7120 for (U32 child_num = 0; child_num < object->mChildList.size(); child_num++ )
7171 { 7121 {
@@ -7176,12 +7126,11 @@ BOOL object_selected_and_point_valid(void *user_data)
7176 } 7126 }
7177 } 7127 }
7178 7128
7179 return ((gSelectMgr != NULL) && 7129 return (selection->getRootObjectCount() == 1) &&
7180 (gSelectMgr->getRootObjectCount() == 1) && 7130 (selection->getFirstRootObject()->getPCode() == LL_PCODE_VOLUME) &&
7181 (gSelectMgr->getFirstRootObject()->getPCode() == LL_PCODE_VOLUME) && 7131 selection->getFirstRootObject()->permYouOwner() &&
7182 gSelectMgr->getFirstRootObject()->permYouOwner() && 7132 !((LLViewerObject*)selection->getFirstRootObject()->getRoot())->isAvatar() &&
7183 !((LLViewerObject*)gSelectMgr->getFirstRootObject()->getRoot())->isAvatar() && 7133 (selection->getFirstRootObject()->getNVPair("AssetContainer") == NULL);
7184 (gSelectMgr->getFirstRootObject()->getNVPair("AssetContainer") == NULL));
7185} 7134}
7186 7135
7187// Also for seeing if object can be attached. See above. 7136// Also for seeing if object can be attached. See above.
@@ -7189,22 +7138,7 @@ class LLObjectEnableWear : public view_listener_t
7189{ 7138{
7190 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) 7139 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
7191 { 7140 {
7192 bool new_value = false; 7141 return object_selected_and_point_valid(NULL);
7193 if (gSelectMgr)
7194 {
7195 LLViewerObject* first_root = gSelectMgr->getFirstRootObject();
7196 if (first_root)
7197 {
7198 new_value = gSelectMgr->getRootObjectCount() == 1
7199 && first_root->getPCode() == LL_PCODE_VOLUME
7200 && first_root->permYouOwner()
7201 && !((LLViewerObject*)gSelectMgr->getFirstRootObject()->getRoot())->isAvatar()
7202 && (first_root->getNVPair("AssetContainer") == NULL);
7203 }
7204 }
7205
7206 gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value);
7207 return true;
7208 } 7142 }
7209}; 7143};
7210 7144
@@ -7213,7 +7147,7 @@ BOOL object_attached(void *user_data)
7213{ 7147{
7214 LLViewerJointAttachment *attachment = (LLViewerJointAttachment *)user_data; 7148 LLViewerJointAttachment *attachment = (LLViewerJointAttachment *)user_data;
7215 7149
7216 return attachment->getObject(0) != NULL; 7150 return attachment->getObject() != NULL;
7217} 7151}
7218 7152
7219class LLAvatarSendIM : public view_listener_t 7153class LLAvatarSendIM : public view_listener_t
@@ -7281,9 +7215,9 @@ class LLToolsSelectedScriptAction : public view_listener_t
7281 BOOL scripted = FALSE; 7215 BOOL scripted = FALSE;
7282 BOOL modifiable = FALSE; 7216 BOOL modifiable = FALSE;
7283 7217
7284 for(LLViewerObject* obj = gSelectMgr->getFirstObject(); 7218 for(LLViewerObject* obj = gSelectMgr->getSelection()->getFirstObject();
7285 obj; 7219 obj;
7286 obj = gSelectMgr->getNextObject()) 7220 obj = gSelectMgr->getSelection()->getNextObject())
7287 { 7221 {
7288 scripted = obj->flagScripted(); 7222 scripted = obj->flagScripted();
7289 modifiable = obj->permModify(); 7223 modifiable = obj->permModify();
@@ -7316,9 +7250,9 @@ void handle_reset_selection(void*)
7316 BOOL scripted = FALSE; 7250 BOOL scripted = FALSE;
7317 BOOL modifiable = FALSE; 7251 BOOL modifiable = FALSE;
7318 7252
7319 for(LLViewerObject* obj = gSelectMgr->getFirstObject(); 7253 for(LLViewerObject* obj = gSelectMgr->getSelection()->getFirstObject();
7320 obj; 7254 obj;
7321 obj = gSelectMgr->getNextObject()) 7255 obj = gSelectMgr->getSelection()->getNextObject())
7322 { 7256 {
7323 scripted = obj->flagScripted(); 7257 scripted = obj->flagScripted();
7324 modifiable = obj->permModify(); 7258 modifiable = obj->permModify();
@@ -7349,9 +7283,9 @@ void handle_set_run_selection(void*)
7349 BOOL scripted = FALSE; 7283 BOOL scripted = FALSE;
7350 BOOL modifiable = FALSE; 7284 BOOL modifiable = FALSE;
7351 7285
7352 for(LLViewerObject* obj = gSelectMgr->getFirstObject(); 7286 for(LLViewerObject* obj = gSelectMgr->getSelection()->getFirstObject();
7353 obj; 7287 obj;
7354 obj = gSelectMgr->getNextObject()) 7288 obj = gSelectMgr->getSelection()->getNextObject())
7355 { 7289 {
7356 scripted = obj->flagScripted(); 7290 scripted = obj->flagScripted();
7357 modifiable = obj->permModify(); 7291 modifiable = obj->permModify();
@@ -7382,9 +7316,9 @@ void handle_set_not_run_selection(void*)
7382 BOOL scripted = FALSE; 7316 BOOL scripted = FALSE;
7383 BOOL modifiable = FALSE; 7317 BOOL modifiable = FALSE;
7384 7318
7385 for(LLViewerObject* obj = gSelectMgr->getFirstObject(); 7319 for(LLViewerObject* obj = gSelectMgr->getSelection()->getFirstObject();
7386 obj; 7320 obj;
7387 obj = gSelectMgr->getNextObject()) 7321 obj = gSelectMgr->getSelection()->getNextObject())
7388 { 7322 {
7389 scripted = obj->flagScripted(); 7323 scripted = obj->flagScripted();
7390 modifiable = obj->permModify(); 7324 modifiable = obj->permModify();
@@ -7411,7 +7345,7 @@ void handle_set_not_run_selection(void*)
7411void handle_selected_texture_info(void*) 7345void handle_selected_texture_info(void*)
7412{ 7346{
7413 LLSelectNode* node = NULL; 7347 LLSelectNode* node = NULL;
7414 for (node = gSelectMgr->getFirstNode(); node != NULL; node = gSelectMgr->getNextNode()) 7348 for (node = gSelectMgr->getSelection()->getFirstNode(); node != NULL; node = gSelectMgr->getSelection()->getNextNode())
7415 { 7349 {
7416 if (!node->mValid) continue; 7350 if (!node->mValid) continue;
7417 7351
@@ -7446,7 +7380,7 @@ void handle_selected_texture_info(void*)
7446 std::string image_id_string; 7380 std::string image_id_string;
7447 if (gAgent.isGodlike()) 7381 if (gAgent.isGodlike())
7448 { 7382 {
7449 image_id_string = image_id.getString() + " "; 7383 image_id_string = image_id.asString() + " ";
7450 } 7384 }
7451 msg = llformat("%s%dx%d %s on face ", 7385 msg = llformat("%s%dx%d %s on face ",
7452 image_id_string.c_str(), 7386 image_id_string.c_str(),
@@ -7510,16 +7444,16 @@ void handle_dump_attachments(void*)
7510 attachment = avatar->mAttachmentPoints.getNextData() ) 7444 attachment = avatar->mAttachmentPoints.getNextData() )
7511 { 7445 {
7512 S32 key = avatar->mAttachmentPoints.getCurrentKeyWithoutIncrement(); 7446 S32 key = avatar->mAttachmentPoints.getCurrentKeyWithoutIncrement();
7513 BOOL visible = (attachment->getObject(0) != NULL && 7447 BOOL visible = (attachment->getObject() != NULL &&
7514 attachment->getObject(0)->mDrawable.notNull() && 7448 attachment->getObject()->mDrawable.notNull() &&
7515 !attachment->getObject(0)->mDrawable->isRenderType(0)); 7449 !attachment->getObject()->mDrawable->isRenderType(0));
7516 LLVector3 pos; 7450 LLVector3 pos;
7517 if (visible) pos = attachment->getObject(0)->mDrawable->getPosition(); 7451 if (visible) pos = attachment->getObject()->mDrawable->getPosition();
7518 llinfos << "ATTACHMENT " << key << ": item_id=" << attachment->getItemID() 7452 llinfos << "ATTACHMENT " << key << ": item_id=" << attachment->getItemID()
7519 << (attachment->getObject(0) ? " present " : " absent ") 7453 << (attachment->getObject() ? " present " : " absent ")
7520 << (visible ? "visible " : "invisible ") 7454 << (visible ? "visible " : "invisible ")
7521 << " at " << pos 7455 << " at " << pos
7522 << " and " << (visible ? attachment->getObject(0)->getPosition() : LLVector3::zero) 7456 << " and " << (visible ? attachment->getObject()->getPosition() : LLVector3::zero)
7523 << llendl; 7457 << llendl;
7524 } 7458 }
7525} 7459}
@@ -7598,7 +7532,7 @@ class LLSomethingSelected : public view_listener_t
7598{ 7532{
7599 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) 7533 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
7600 { 7534 {
7601 bool new_value = !(gSelectMgr->isEmpty()); 7535 bool new_value = !(gSelectMgr->getSelection()->isEmpty());
7602 gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); 7536 gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value);
7603 return true; 7537 return true;
7604 } 7538 }
@@ -7608,7 +7542,8 @@ class LLSomethingSelectedNoHUD : public view_listener_t
7608{ 7542{
7609 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) 7543 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
7610 { 7544 {
7611 bool new_value = !(gSelectMgr->isEmpty()) && !(gSelectMgr->getSelectType() == SELECT_TYPE_HUD); 7545 LLObjectSelectionHandle selection = gSelectMgr->getSelection();
7546 bool new_value = !(selection->isEmpty()) && !(selection->getSelectType() == SELECT_TYPE_HUD);
7612 gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); 7547 gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value);
7613 return true; 7548 return true;
7614 } 7549 }
@@ -7616,14 +7551,14 @@ class LLSomethingSelectedNoHUD : public view_listener_t
7616 7551
7617BOOL enable_more_than_one_selected(void* ) 7552BOOL enable_more_than_one_selected(void* )
7618{ 7553{
7619 return (gSelectMgr->getObjectCount() > 1); 7554 return (gSelectMgr->getSelection()->getObjectCount() > 1);
7620} 7555}
7621 7556
7622class LLEditableSelected : public view_listener_t 7557class LLEditableSelected : public view_listener_t
7623{ 7558{
7624 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) 7559 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
7625 { 7560 {
7626 bool new_value = (gSelectMgr->getFirstEditableObject() != NULL); 7561 bool new_value = (gSelectMgr->getSelection()->getFirstEditableObject() != NULL);
7627 gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); 7562 gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value);
7628 return true; 7563 return true;
7629 } 7564 }
@@ -7642,10 +7577,11 @@ class LLToolsEnableTakeCopy : public view_listener_t
7642 if (gInProductionGrid || !gAgent.isGodlike()) 7577 if (gInProductionGrid || !gAgent.isGodlike())
7643# endif 7578# endif
7644 { 7579 {
7645 LLViewerObject* obj = gSelectMgr->getFirstRootObject(); 7580 LLObjectSelectionHandle selection = gSelectMgr->getSelection();
7581 LLViewerObject* obj = selection->getFirstRootObject();
7646 if(obj) 7582 if(obj)
7647 { 7583 {
7648 for( ; obj; obj = gSelectMgr->getNextRootObject()) 7584 for( ; obj; obj = selection->getNextRootObject())
7649 { 7585 {
7650 if(!(obj->permCopy()) || obj->isAttachment()) 7586 if(!(obj->permCopy()) || obj->isAttachment())
7651 { 7587 {
@@ -7665,11 +7601,15 @@ class LLToolsEnableTakeCopy : public view_listener_t
7665BOOL enable_selection_you_own_all(void*) 7601BOOL enable_selection_you_own_all(void*)
7666{ 7602{
7667 LLViewerObject *obj; 7603 LLViewerObject *obj;
7668 for (obj = gSelectMgr->getFirstRootObject(); obj; obj = gSelectMgr->getNextRootObject()) 7604 if (gSelectMgr)
7669 { 7605 {
7670 if (!obj->permYouOwner()) 7606 LLObjectSelectionHandle selection = gSelectMgr->getSelection();
7607 for (obj = selection->getFirstRootObject(); obj; obj = selection->getNextRootObject())
7671 { 7608 {
7672 return FALSE; 7609 if (!obj->permYouOwner())
7610 {
7611 return FALSE;
7612 }
7673 } 7613 }
7674 } 7614 }
7675 7615
@@ -7678,15 +7618,18 @@ BOOL enable_selection_you_own_all(void*)
7678 7618
7679BOOL enable_selection_you_own_one(void*) 7619BOOL enable_selection_you_own_one(void*)
7680{ 7620{
7681 LLViewerObject *obj; 7621 if (gSelectMgr)
7682 for (obj = gSelectMgr->getFirstRootObject(); obj; obj = gSelectMgr->getNextRootObject())
7683 { 7622 {
7684 if (obj->permYouOwner()) 7623 LLObjectSelectionHandle selection = gSelectMgr->getSelection();
7624 LLViewerObject *obj;
7625 for (obj = selection->getFirstRootObject(); obj; obj = selection->getNextRootObject())
7685 { 7626 {
7686 return TRUE; 7627 if (obj->permYouOwner())
7628 {
7629 return TRUE;
7630 }
7687 } 7631 }
7688 } 7632 }
7689
7690 return FALSE; 7633 return FALSE;
7691} 7634}
7692 7635
@@ -7720,9 +7663,9 @@ BOOL enable_save_into_inventory(void*)
7720 { 7663 {
7721 // find the last root 7664 // find the last root
7722 LLSelectNode* last_node = NULL; 7665 LLSelectNode* last_node = NULL;
7723 for(LLSelectNode* node = gSelectMgr->getFirstRootNode(); 7666 for(LLSelectNode* node = gSelectMgr->getSelection()->getFirstRootNode();
7724 node != NULL; 7667 node != NULL;
7725 node = gSelectMgr->getNextRootNode()) 7668 node = gSelectMgr->getSelection()->getNextRootNode())
7726 { 7669 {
7727 last_node = node; 7670 last_node = node;
7728 } 7671 }
@@ -7766,7 +7709,7 @@ BOOL enable_save_into_task_inventory(void*)
7766{ 7709{
7767 if(gSelectMgr) 7710 if(gSelectMgr)
7768 { 7711 {
7769 LLSelectNode* node = gSelectMgr->getFirstRootNode(); 7712 LLSelectNode* node = gSelectMgr->getSelection()->getFirstRootNode();
7770 if(node && (node->mValid) && (!node->mFromTaskID.isNull())) 7713 if(node && (node->mValid) && (!node->mFromTaskID.isNull()))
7771 { 7714 {
7772 // *TODO: check to see if the fromtaskid object exists. 7715 // *TODO: check to see if the fromtaskid object exists.
@@ -7807,7 +7750,7 @@ class LLFileEnableUpload : public view_listener_t
7807 7750
7808BOOL enable_export_selected(void *) 7751BOOL enable_export_selected(void *)
7809{ 7752{
7810 if (gSelectMgr->isEmpty()) 7753 if (gSelectMgr->getSelection()->isEmpty())
7811 { 7754 {
7812 return FALSE; 7755 return FALSE;
7813 } 7756 }
@@ -7838,7 +7781,7 @@ class LLToolsEnableToolNotPie : public view_listener_t
7838{ 7781{
7839 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) 7782 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
7840 { 7783 {
7841 bool new_value = ( gToolMgr->getCurrentTool(MASK_NONE) != gToolPie ); 7784 bool new_value = ( gToolMgr->getBaseTool() != gToolPie );
7842 gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); 7785 gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value);
7843 return true; 7786 return true;
7844 } 7787 }
@@ -7866,6 +7809,18 @@ class LLWorldEnableSetHomeLocation : public view_listener_t
7866 } 7809 }
7867}; 7810};
7868 7811
7812class LLWorldEnableTeleportHome : public view_listener_t
7813{
7814 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
7815 {
7816 LLViewerRegion* regionp = gAgent.getRegion();
7817 bool agent_on_prelude = (regionp && regionp->isPrelude());
7818 bool enable_teleport_home = gAgent.isGodlike() || !agent_on_prelude;
7819 gMenuHolder->findControl(userdata["control"].asString())->setValue(enable_teleport_home);
7820 return true;
7821 }
7822};
7823
7869BOOL enable_region_owner(void*) 7824BOOL enable_region_owner(void*)
7870{ 7825{
7871 if(gAgent.getRegion() && gAgent.getRegion()->getOwner() == gAgent.getID()) 7826 if(gAgent.getRegion() && gAgent.getRegion()->getOwner() == gAgent.getID())
@@ -7893,26 +7848,6 @@ BOOL enable_god_basic(void*)
7893 return gAgent.getGodLevel() > GOD_NOT; 7848 return gAgent.getGodLevel() > GOD_NOT;
7894} 7849}
7895 7850
7896void toggle_vbo(void *)
7897{
7898 gPipeline.mUseVBO = !gPipeline.mUseVBO;
7899
7900 if (!gPipeline.usingAGP())
7901 {
7902 return;
7903 }
7904
7905 gPipeline.setUseAGP(FALSE);
7906 gPipeline.setUseAGP(TRUE);
7907
7908 gSavedSettings.setBOOL("RenderUseVBO", gPipeline.mUseVBO);
7909}
7910
7911BOOL check_vbo(void *)
7912{
7913 return gPipeline.mUseVBO;
7914}
7915
7916#if 0 // 1.9.2 7851#if 0 // 1.9.2
7917void toggle_vertex_shaders(void *) 7852void toggle_vertex_shaders(void *)
7918{ 7853{
@@ -7926,19 +7861,6 @@ BOOL check_vertex_shaders(void *)
7926} 7861}
7927#endif 7862#endif
7928 7863
7929void toggle_glow(void *)
7930{
7931 gRenderLightGlows = !gRenderLightGlows;
7932
7933 gSavedSettings.setBOOL("RenderLightGlows", gRenderLightGlows);
7934}
7935
7936BOOL check_glow(void *)
7937{
7938 return gRenderLightGlows;
7939}
7940
7941
7942void toggle_show_xui_names(void *) 7864void toggle_show_xui_names(void *)
7943{ 7865{
7944 BOOL showXUINames = gSavedSettings.getBOOL("ShowXUINames"); 7866 BOOL showXUINames = gSavedSettings.getBOOL("ShowXUINames");
@@ -8213,10 +8135,10 @@ LLVOAvatar* find_avatar_from_object( const LLUUID& object_id )
8213 8135
8214void handle_disconnect_viewer(void *) 8136void handle_disconnect_viewer(void *)
8215{ 8137{
8216 char message[2048]; 8138 char message[2048]; /* Flawfinder: ignore */
8217 message[0] = '\0'; 8139 message[0] = '\0';
8218 8140
8219 sprintf(message, "Testing viewer disconnect"); 8141 snprintf(message, sizeof(message), "Testing viewer disconnect"); /* Flawfinder: ignore */
8220 8142
8221 do_disconnect(message); 8143 do_disconnect(message);
8222} 8144}
@@ -8227,10 +8149,10 @@ class LLToolsUseSelectionForGrid : public view_listener_t
8227 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) 8149 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
8228 { 8150 {
8229 gSelectMgr->clearGridObjects(); 8151 gSelectMgr->clearGridObjects();
8230 8152 LLObjectSelectionHandle selection = gSelectMgr->getSelection();
8231 for (LLViewerObject* objectp = gSelectMgr->getFirstRootObject(); 8153 for (LLViewerObject* objectp = selection->getFirstRootObject();
8232 objectp; 8154 objectp;
8233 objectp = gSelectMgr->getNextRootObject()) 8155 objectp = selection->getNextRootObject())
8234 { 8156 {
8235 gSelectMgr->addGridObject(objectp); 8157 gSelectMgr->addGridObject(objectp);
8236 } 8158 }
@@ -8255,23 +8177,40 @@ void handle_test_load_url(void*)
8255// LLViewerMenuHolderGL 8177// LLViewerMenuHolderGL
8256// 8178//
8257 8179
8180LLViewerMenuHolderGL::LLViewerMenuHolderGL() : LLMenuHolderGL()
8181{
8182}
8183
8258BOOL LLViewerMenuHolderGL::hideMenus() 8184BOOL LLViewerMenuHolderGL::hideMenus()
8259{ 8185{
8260 BOOL handled = LLMenuHolderGL::hideMenus(); 8186 BOOL handled = LLMenuHolderGL::hideMenus();
8261 if (handled) 8187
8262 { 8188 // drop pie menu selection
8263 gSelectMgr->deselectTransient(); 8189 mParcelSelection = NULL;
8264 if (!gFloaterTools->getVisible() && !LLFloaterLand::floaterVisible()) 8190 mObjectSelection = NULL;
8265 { 8191
8266 gParcelMgr->deselectLand();
8267 }
8268 }
8269 gMenuBarView->clearHoverItem(); 8192 gMenuBarView->clearHoverItem();
8270 gMenuBarView->resetMenuTrigger(); 8193 gMenuBarView->resetMenuTrigger();
8271 8194
8272 return handled; 8195 return handled;
8273} 8196}
8274 8197
8198void LLViewerMenuHolderGL::setParcelSelection(LLHandle<LLParcelSelection> selection)
8199{
8200 mParcelSelection = selection;
8201}
8202
8203void LLViewerMenuHolderGL::setObjectSelection(LLHandle<LLObjectSelection> selection)
8204{
8205 mObjectSelection = selection;
8206}
8207
8208
8209const LLRect LLViewerMenuHolderGL::getMenuRect() const
8210{
8211 return LLRect(0, mRect.getHeight() - MENU_BAR_HEIGHT, mRect.getWidth(), STATUS_BAR_HEIGHT);
8212}
8213
8275void handle_save_to_xml(void*) 8214void handle_save_to_xml(void*)
8276{ 8215{
8277 LLFloater* frontmost = gFloaterView->getFrontmost(); 8216 LLFloater* frontmost = gFloaterView->getFrontmost();
@@ -8431,7 +8370,7 @@ class LLViewToggleRenderType : public view_listener_t
8431 LLString type = userdata.asString(); 8370 LLString type = userdata.asString();
8432 if (type == "particles") 8371 if (type == "particles")
8433 { 8372 {
8434 LLPipeline::toggleRenderType((void *)(S32)LLPipeline::RENDER_TYPE_PARTICLES); 8373 LLPipeline::toggleRenderType(LLPipeline::RENDER_TYPE_PARTICLES);
8435 } 8374 }
8436 return true; 8375 return true;
8437 } 8376 }
@@ -8452,12 +8391,11 @@ class LLViewCheckRenderType : public view_listener_t
8452 } 8391 }
8453}; 8392};
8454 8393
8455// TomY TODO: Get rid of these?
8456class LLViewShowHUDAttachments : public view_listener_t 8394class LLViewShowHUDAttachments : public view_listener_t
8457{ 8395{
8458 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) 8396 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
8459 { 8397 {
8460 LLDrawPoolHUD::sShowHUDAttachments = !LLDrawPoolHUD::sShowHUDAttachments; 8398 LLPipeline::sShowHUDAttachments = !LLPipeline::sShowHUDAttachments;
8461 return true; 8399 return true;
8462 } 8400 }
8463}; 8401};
@@ -8466,7 +8404,7 @@ class LLViewCheckHUDAttachments : public view_listener_t
8466{ 8404{
8467 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) 8405 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
8468 { 8406 {
8469 bool new_value = LLDrawPoolHUD::sShowHUDAttachments; 8407 bool new_value = LLPipeline::sShowHUDAttachments;
8470 gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); 8408 gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value);
8471 return true; 8409 return true;
8472 } 8410 }
@@ -8594,23 +8532,23 @@ class LLToolsSelectTool : public view_listener_t
8594 LLString tool_name = userdata.asString(); 8532 LLString tool_name = userdata.asString();
8595 if (tool_name == "focus") 8533 if (tool_name == "focus")
8596 { 8534 {
8597 gCurrentToolset->selectToolByIndex(1); 8535 gToolMgr->getCurrentToolset()->selectToolByIndex(1);
8598 } 8536 }
8599 else if (tool_name == "move") 8537 else if (tool_name == "move")
8600 { 8538 {
8601 gCurrentToolset->selectToolByIndex(2); 8539 gToolMgr->getCurrentToolset()->selectToolByIndex(2);
8602 } 8540 }
8603 else if (tool_name == "edit") 8541 else if (tool_name == "edit")
8604 { 8542 {
8605 gCurrentToolset->selectToolByIndex(3); 8543 gToolMgr->getCurrentToolset()->selectToolByIndex(3);
8606 } 8544 }
8607 else if (tool_name == "create") 8545 else if (tool_name == "create")
8608 { 8546 {
8609 gCurrentToolset->selectToolByIndex(4); 8547 gToolMgr->getCurrentToolset()->selectToolByIndex(4);
8610 } 8548 }
8611 else if (tool_name == "land") 8549 else if (tool_name == "land")
8612 { 8550 {
8613 gCurrentToolset->selectToolByIndex(5); 8551 gToolMgr->getCurrentToolset()->selectToolByIndex(5);
8614 } 8552 }
8615 return true; 8553 return true;
8616 } 8554 }
@@ -8624,6 +8562,7 @@ void initialize_menu_actions()
8624 (new LLFileUploadAnim())->registerListener(gMenuHolder, "File.UploadAnim"); 8562 (new LLFileUploadAnim())->registerListener(gMenuHolder, "File.UploadAnim");
8625 (new LLFileUploadBulk())->registerListener(gMenuHolder, "File.UploadBulk"); 8563 (new LLFileUploadBulk())->registerListener(gMenuHolder, "File.UploadBulk");
8626 (new LLFileCloseWindow())->registerListener(gMenuHolder, "File.CloseWindow"); 8564 (new LLFileCloseWindow())->registerListener(gMenuHolder, "File.CloseWindow");
8565 (new LLFileEnableCloseWindow())->registerListener(gMenuHolder, "File.EnableCloseWindow");
8627 (new LLFileSaveTexture())->registerListener(gMenuHolder, "File.SaveTexture"); 8566 (new LLFileSaveTexture())->registerListener(gMenuHolder, "File.SaveTexture");
8628 (new LLFileTakeSnapshot())->registerListener(gMenuHolder, "File.TakeSnapshot"); 8567 (new LLFileTakeSnapshot())->registerListener(gMenuHolder, "File.TakeSnapshot");
8629 (new LLFileTakeSnapshotToDisk())->registerListener(gMenuHolder, "File.TakeSnapshotToDisk"); 8568 (new LLFileTakeSnapshotToDisk())->registerListener(gMenuHolder, "File.TakeSnapshotToDisk");
@@ -8698,6 +8637,7 @@ void initialize_menu_actions()
8698 8637
8699 (new LLWorldEnableCreateLandmark())->registerListener(gMenuHolder, "World.EnableCreateLandmark"); 8638 (new LLWorldEnableCreateLandmark())->registerListener(gMenuHolder, "World.EnableCreateLandmark");
8700 (new LLWorldEnableSetHomeLocation())->registerListener(gMenuHolder, "World.EnableSetHomeLocation"); 8639 (new LLWorldEnableSetHomeLocation())->registerListener(gMenuHolder, "World.EnableSetHomeLocation");
8640 (new LLWorldEnableTeleportHome())->registerListener(gMenuHolder, "World.EnableTeleportHome");
8701 (new LLWorldEnableBuyLand())->registerListener(gMenuHolder, "World.EnableBuyLand"); 8641 (new LLWorldEnableBuyLand())->registerListener(gMenuHolder, "World.EnableBuyLand");
8702 8642
8703 (new LLWorldCheckAlwaysRun())->registerListener(gMenuHolder, "World.CheckAlwaysRun"); 8643 (new LLWorldCheckAlwaysRun())->registerListener(gMenuHolder, "World.CheckAlwaysRun");
diff --git a/linden/indra/newview/llviewermenu.h b/linden/indra/newview/llviewermenu.h
index 9847e41..0c42426 100644
--- a/linden/indra/newview/llviewermenu.h
+++ b/linden/indra/newview/llviewermenu.h
@@ -37,6 +37,8 @@
37 37
38class LLUICtrl; 38class LLUICtrl;
39class LLView; 39class LLView;
40class LLParcelSelection;
41class LLObjectSelection;
40 42
41struct LLResourceData 43struct LLResourceData
42{ 44{
@@ -85,7 +87,6 @@ BOOL is_agent_mappable(const LLUUID& agent_id);
85 87
86void menu_toggle_control( void* user_data ); 88void menu_toggle_control( void* user_data );
87void check_toggle_control( LLUICtrl *, void* user_data ); 89void check_toggle_control( LLUICtrl *, void* user_data );
88void handle_attach_to_avatar(void* user_data);
89void confirm_replace_attachment(S32 option, void* user_data); 90void confirm_replace_attachment(S32 option, void* user_data);
90void handle_detach_from_avatar(void* user_data); 91void handle_detach_from_avatar(void* user_data);
91void attach_label(LLString& label, void* user_data); 92void attach_label(LLString& label, void* user_data);
@@ -145,10 +146,18 @@ class LLPermissions;
145class LLViewerMenuHolderGL : public LLMenuHolderGL 146class LLViewerMenuHolderGL : public LLMenuHolderGL
146{ 147{
147public: 148public:
148 LLViewerMenuHolderGL() : LLMenuHolderGL() {}; 149 LLViewerMenuHolderGL();
149 150
150 virtual BOOL hideMenus(); 151 virtual BOOL hideMenus();
151 //virtual BOOL handleKey(KEY key, MASK mask, BOOL called_from_parent); 152
153 void setParcelSelection(LLHandle<LLParcelSelection> selection);
154 void setObjectSelection(LLHandle<LLObjectSelection> selection);
155
156 virtual const LLRect getMenuRect() const;
157
158protected:
159 LLHandle<LLParcelSelection> mParcelSelection;
160 LLHandle<LLObjectSelection> mObjectSelection;
152}; 161};
153 162
154extern const LLString SAVE_INTO_INVENTORY; 163extern const LLString SAVE_INTO_INVENTORY;
diff --git a/linden/indra/newview/llviewermessage.cpp b/linden/indra/newview/llviewermessage.cpp
index 1b91f9d..41d24fd 100644
--- a/linden/indra/newview/llviewermessage.cpp
+++ b/linden/indra/newview/llviewermessage.cpp
@@ -314,7 +314,7 @@ void export_complete()
314 gExporterRequestID.setNull(); 314 gExporterRequestID.setNull();
315 gExportDirectory = ""; 315 gExportDirectory = "";
316 316
317 FILE *fXML = LLFile::fopen(gExportedFile.c_str(), "rb"); 317 FILE* fXML = LLFile::fopen(gExportedFile.c_str(), "rb"); /* Flawfinder: ignore */
318 fseek(fXML, 0, SEEK_END); 318 fseek(fXML, 0, SEEK_END);
319 U32 length = ftell(fXML); 319 U32 length = ftell(fXML);
320 fseek(fXML, 0, SEEK_SET); 320 fseek(fXML, 0, SEEK_SET);
@@ -330,8 +330,8 @@ void export_complete()
330 330
331 if (pos_check && pos_uuid) 331 if (pos_check && pos_uuid)
332 { 332 {
333 char image_uuid_str[UUID_STR_SIZE]; 333 char image_uuid_str[UUID_STR_SIZE]; /* Flawfinder: ignore */
334 memcpy(image_uuid_str, pos_uuid+2, UUID_STR_SIZE-1); 334 memcpy(image_uuid_str, pos_uuid+2, UUID_STR_SIZE-1); /* Flawfinder: ignore */
335 image_uuid_str[UUID_STR_SIZE-1] = 0; 335 image_uuid_str[UUID_STR_SIZE-1] = 0;
336 336
337 LLUUID image_uuid(image_uuid_str); 337 LLUUID image_uuid(image_uuid_str);
@@ -342,12 +342,15 @@ void export_complete()
342 if (itor != gImageChecksums.end()) 342 if (itor != gImageChecksums.end())
343 { 343 {
344 llinfos << "Replacing with checksum: " << itor->second << llendl; 344 llinfos << "Replacing with checksum: " << itor->second << llendl;
345 memcpy(&pos_check[10], itor->second.c_str(), 32); 345 if (itor->second.c_str() != NULL)
346 {
347 memcpy(&pos_check[10], itor->second.c_str(), 32); /* Flawfinder: ignore */
348 }
346 } 349 }
347 } 350 }
348 } 351 }
349 352
350 FILE *fXMLOut = LLFile::fopen(gExportedFile.c_str(), "wb"); 353 FILE* fXMLOut = LLFile::fopen(gExportedFile.c_str(), "wb"); /* Flawfinder: ignore */
351 fwrite(buffer, 1, length, fXMLOut); 354 fwrite(buffer, 1, length, fXMLOut);
352 fclose(fXMLOut); 355 fclose(fXMLOut);
353 356
@@ -400,7 +403,7 @@ void exported_j2c_complete(const LLTSCode status, void *user_data)
400 } 403 }
401 else 404 else
402 { 405 {
403 FILE *fIn = LLFile::fopen(filename.c_str(), "rb"); 406 FILE* fIn = LLFile::fopen(filename.c_str(), "rb"); /* Flawfinder: ignore */
404 if (fIn) 407 if (fIn)
405 { 408 {
406 LLPointer<LLImageJ2C> ImageUtility = new LLImageJ2C; 409 LLPointer<LLImageJ2C> ImageUtility = new LLImageJ2C;
@@ -425,22 +428,22 @@ void exported_j2c_complete(const LLTSCode status, void *user_data)
425 S32 data_size = TargaUtility->getDataSize(); 428 S32 data_size = TargaUtility->getDataSize();
426 429
427 char *file_path = new char[filename.size()+1]; 430 char *file_path = new char[filename.size()+1];
428 strcpy(file_path, filename.c_str()); 431 strcpy(file_path, filename.c_str()); /* Flawfinder: ignore */
429 char *end = strrchr(file_path, gDirUtilp->getDirDelimiter()[0]); 432 char *end = strrchr(file_path, gDirUtilp->getDirDelimiter()[0]);
430 end[0] = 0; 433 end[0] = 0;
431 LLString output_file = llformat("%s/image-%03d.tga", file_path, image_num);//filename; 434 LLString output_file = llformat("%s/image-%03d.tga", file_path, image_num);//filename;
432 delete file_path; 435 delete file_path;
433 //S32 name_len = output_file.length(); 436 //S32 name_len = output_file.length();
434 //strcpy(&output_file[name_len-3], "tga"); 437 //strcpy(&output_file[name_len-3], "tga");
435 FILE *fOut = LLFile::fopen(output_file.c_str(), "wb"); 438 FILE* fOut = LLFile::fopen(output_file.c_str(), "wb"); /* Flawfinder: ignore */
436 char md5_hash_string[33]; 439 char md5_hash_string[33]; /* Flawfinder: ignore */
437 strcpy(md5_hash_string, "00000000000000000000000000000000"); 440 strcpy(md5_hash_string, "00000000000000000000000000000000"); /* Flawfinder: ignore */
438 if (fOut) 441 if (fOut)
439 { 442 {
440 fwrite(data, 1, data_size, fOut); 443 fwrite(data, 1, data_size, fOut);
441 fseek(fOut, 0, SEEK_SET); 444 fseek(fOut, 0, SEEK_SET);
442 fclose(fOut); 445 fclose(fOut);
443 fOut = LLFile::fopen(output_file.c_str(), "rb"); 446 fOut = LLFile::fopen(output_file.c_str(), "rb"); /* Flawfinder: ignore */
444 LLMD5 my_md5_hash(fOut); 447 LLMD5 my_md5_hash(fOut);
445 my_md5_hash.hex_digest(md5_hash_string); 448 my_md5_hash.hex_digest(md5_hash_string);
446 } 449 }
@@ -801,7 +804,7 @@ void inventory_offer_callback(S32 option, void* user_data)
801 { 804 {
802 if (info->mFromGroup) 805 if (info->mFromGroup)
803 { 806 {
804 char group_name[MAX_STRING]; 807 char group_name[MAX_STRING]; /* Flawfinder: ignore */
805 if (gCacheName->getGroupName(info->mFromID, group_name)) 808 if (gCacheName->getGroupName(info->mFromID, group_name))
806 { 809 {
807 from_string = LLString("An object named ") + info->mFromName + " owned by the group '" + group_name + "'"; 810 from_string = LLString("An object named ") + info->mFromName + " owned by the group '" + group_name + "'";
@@ -813,8 +816,8 @@ void inventory_offer_callback(S32 option, void* user_data)
813 } 816 }
814 else 817 else
815 { 818 {
816 char first_name[MAX_STRING]; 819 char first_name[MAX_STRING]; /* Flawfinder: ignore */
817 char last_name[MAX_STRING]; 820 char last_name[MAX_STRING]; /* Flawfinder: ignore */
818 if (gCacheName->getName(info->mFromID, first_name, last_name)) 821 if (gCacheName->getName(info->mFromID, first_name, last_name))
819 { 822 {
820 from_string = LLString("An object named ") + info->mFromName + " owned by " + first_name + " " + last_name; 823 from_string = LLString("An object named ") + info->mFromName + " owned by " + first_name + " " + last_name;
@@ -938,9 +941,9 @@ void inventory_offer_callback(S32 option, void* user_data)
938 } 941 }
939 942
940 } 943 }
941 if (!info->mFromGroup) 944 if (!info->mFromGroup && !info->mFromObject)
942 { 945 {
943 busy_message(msg,info->mFromID); 946 busy_message(msg,info->mFromID);
944 } 947 }
945 break; 948 break;
946 } 949 }
@@ -1000,8 +1003,8 @@ void inventory_offer_handler(LLOfferInfo* info, BOOL from_task)
1000 // Name cache callbacks don't store userdata, so can't save 1003 // Name cache callbacks don't store userdata, so can't save
1001 // off the LLOfferInfo. Argh. JC 1004 // off the LLOfferInfo. Argh. JC
1002 BOOL name_found = FALSE; 1005 BOOL name_found = FALSE;
1003 char first_name[MAX_STRING]; 1006 char first_name[MAX_STRING]; /* Flawfinder: ignore */
1004 char last_name[MAX_STRING]; 1007 char last_name[MAX_STRING]; /* Flawfinder: ignore */
1005 if (info->mFromGroup) 1008 if (info->mFromGroup)
1006 { 1009 {
1007 if (gCacheName->getGroupName(info->mFromID, first_name)) 1010 if (gCacheName->getGroupName(info->mFromID, first_name))
@@ -1133,12 +1136,12 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
1133 U8 d = 0; 1136 U8 d = 0;
1134 LLUUID session_id; 1137 LLUUID session_id;
1135 U32 t; 1138 U32 t;
1136 char name[DB_FULL_NAME_BUF_SIZE]; 1139 char name[DB_FULL_NAME_BUF_SIZE]; /* Flawfinder: ignore */
1137 char message[DB_IM_MSG_BUF_SIZE]; 1140 char message[DB_IM_MSG_BUF_SIZE]; /* Flawfinder: ignore */
1138 U32 parent_estate_id = 0; 1141 U32 parent_estate_id = 0;
1139 LLUUID region_id; 1142 LLUUID region_id;
1140 LLVector3 position; 1143 LLVector3 position;
1141 char buffer[DB_IM_MSG_BUF_SIZE * 2]; 1144 char buffer[DB_IM_MSG_BUF_SIZE * 2]; /* Flawfinder: ignore */
1142 U8 binary_bucket[MTUBYTES]; 1145 U8 binary_bucket[MTUBYTES];
1143 S32 binary_bucket_size; 1146 S32 binary_bucket_size;
1144 LLChat chat; 1147 LLChat chat;
@@ -1171,19 +1174,19 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
1171 chat.mFromID = from_id; 1174 chat.mFromID = from_id;
1172 chat.mFromName = name; 1175 chat.mFromName = name;
1173 1176
1174 LLViewerObject *source = gObjectList.findObject(session_id); 1177 LLViewerObject *source = gObjectList.findObject(session_id); //Session ID is probably the wrong thing.
1175 if (source) 1178 if (source)
1176 { 1179 {
1177 is_owned_by_me = source->permYouOwner(); 1180 is_owned_by_me = source->permYouOwner();
1178 } 1181 }
1179 1182
1180 char separator_string[3]=": "; 1183 char separator_string[3]=": "; /* Flawfinder: ignore */
1181 int message_offset=0; 1184 int message_offset=0;
1182 1185
1183 //Handle IRC styled /me messages. 1186 //Handle IRC styled /me messages.
1184 if (!strncmp(message, "/me ", 4) || !strncmp(message, "/me'", 4)) 1187 if (!strncmp(message, "/me ", 4) || !strncmp(message, "/me'", 4))
1185 { 1188 {
1186 strcpy(separator_string,""); 1189 strcpy(separator_string,""); /* Flawfinder: ignore */
1187 message_offset=3; 1190 message_offset=3;
1188 } 1191 }
1189 1192
@@ -1237,7 +1240,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
1237 1240
1238 // now store incoming IM in chat history 1241 // now store incoming IM in chat history
1239 1242
1240 sprintf(buffer, "%s%s%s", name, separator_string, (message+message_offset)); 1243 snprintf(buffer, sizeof(buffer), "%s%s%s", name, separator_string, (message+message_offset)); /* Flawfinder: ignore */
1241 1244
1242 if(from_id == gAgentID) 1245 if(from_id == gAgentID)
1243 { 1246 {
@@ -1258,14 +1261,14 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
1258 position); 1261 position);
1259 1262
1260 // pretend this is chat generated by self, so it does not show up on screen 1263 // pretend this is chat generated by self, so it does not show up on screen
1261 sprintf(buffer, "IM: %s%s%s", name, separator_string, (message+message_offset)); 1264 snprintf(buffer, sizeof(buffer), "IM: %s%s%s", name, separator_string, (message+message_offset)); /* Flawfinder: ignore */
1262 chat.mText = buffer; 1265 chat.mText = buffer;
1263 LLFloaterChat::addChat( chat, TRUE, TRUE ); 1266 LLFloaterChat::addChat( chat, TRUE, TRUE );
1264 } 1267 }
1265 else if (from_id.isNull()) 1268 else if (from_id.isNull())
1266 { 1269 {
1267 // Messages from "Second Life" don't go to IM history 1270 // Messages from "Second Life" don't go to IM history
1268 sprintf(buffer, "%s: %s", name, message); 1271 snprintf(buffer, sizeof(buffer), "%s: %s", name, message); /* Flawfinder: ignore */
1269 chat.mText = buffer; 1272 chat.mText = buffer;
1270 LLFloaterChat::addChat(chat, FALSE, FALSE); 1273 LLFloaterChat::addChat(chat, FALSE, FALSE);
1271 } 1274 }
@@ -1279,7 +1282,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
1279 // Treat like a system message and put in chat history. 1282 // Treat like a system message and put in chat history.
1280 // Claim to be from a local agent so it doesn't go into 1283 // Claim to be from a local agent so it doesn't go into
1281 // console. 1284 // console.
1282 sprintf(buffer, "%s%s%s", name, separator_string, (message+message_offset)); 1285 snprintf(buffer, sizeof(buffer), "%s%s%s", name, separator_string, (message+message_offset)); /* Flawfinder: ignore */
1283 chat.mText = buffer; 1286 chat.mText = buffer;
1284 BOOL local_agent = TRUE; 1287 BOOL local_agent = TRUE;
1285 LLFloaterChat::addChat(chat, FALSE, local_agent); 1288 LLFloaterChat::addChat(chat, FALSE, local_agent);
@@ -1287,15 +1290,15 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
1287 else 1290 else
1288 { 1291 {
1289 // standard message, not from system 1292 // standard message, not from system
1290 char saved[MAX_STRING]; 1293 char saved[MAX_STRING]; /* Flawfinder: ignore */
1291 saved[0] = '\0'; 1294 saved[0] = '\0';
1292 if(offline == IM_OFFLINE) 1295 if(offline == IM_OFFLINE)
1293 { 1296 {
1294 char time_buf[TIME_STR_LENGTH]; 1297 char time_buf[TIME_STR_LENGTH]; /* Flawfinder: ignore */
1295 sprintf(saved, "(Saved %s) ", 1298 snprintf(saved, MAX_STRING, "(Saved %s) ", /* Flawfinder: ignore */
1296 formatted_time(timestamp, time_buf)); 1299 formatted_time(timestamp, time_buf));
1297 } 1300 }
1298 sprintf(buffer, "%s%s%s%s", name, separator_string, saved,(message+message_offset)); 1301 snprintf(buffer, sizeof(buffer), "%s%s%s%s", name, separator_string, saved,(message+message_offset)); /* Flawfinder: ignore */
1299 if(from_id == gAgentID) 1302 if(from_id == gAgentID)
1300 { 1303 {
1301 from_id = LLUUID::null; 1304 from_id = LLUUID::null;
@@ -1314,7 +1317,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
1314 parent_estate_id, 1317 parent_estate_id,
1315 region_id, 1318 region_id,
1316 position); 1319 position);
1317 sprintf(buffer, "IM: %s%s%s%s", name, separator_string, saved, (message+message_offset)); 1320 snprintf(buffer, sizeof(buffer), "IM: %s%s%s%s", name, separator_string, saved, (message+message_offset)); /* Flawfinder: ignore */
1318 1321
1319 chat.mText = buffer; 1322 chat.mText = buffer;
1320 BOOL local_agent = FALSE; 1323 BOOL local_agent = FALSE;
@@ -1373,7 +1376,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
1373 1376
1374 // Make sure the binary bucket is big enough to hold the header 1377 // Make sure the binary bucket is big enough to hold the header
1375 // and a null terminated item name. 1378 // and a null terminated item name.
1376 if ( (binary_bucket_size < (sizeof(notice_bucket_header_t) + sizeof(U8))) 1379 if ( (binary_bucket_size < (S32)((sizeof(notice_bucket_header_t) + sizeof(U8))))
1377 || (binary_bucket[binary_bucket_size - 1] != '\0') ) 1380 || (binary_bucket[binary_bucket_size - 1] != '\0') )
1378 { 1381 {
1379 llwarns << "Malformed group notice binary bucket" << llendl; 1382 llwarns << "Malformed group notice binary bucket" << llendl;
@@ -1527,8 +1530,8 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
1527 info->mFromName = name; 1530 info->mFromName = name;
1528 info->mDesc = message; 1531 info->mDesc = message;
1529 info->mHost = msg->getSender(); 1532 info->mHost = msg->getSender();
1530 //if (!is_linden && ((is_busy && !is_owned_by_me) || is_muted)) 1533 //if (((is_busy && !is_owned_by_me) || is_muted))
1531 if (((is_busy && !is_owned_by_me) || is_muted)) 1534 if ( is_muted )
1532 { 1535 {
1533 // Same as closing window 1536 // Same as closing window
1534 inventory_offer_callback(-1, info); 1537 inventory_offer_callback(-1, info);
@@ -1578,16 +1581,17 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
1578 } 1581 }
1579 1582
1580 // standard message, not from system 1583 // standard message, not from system
1581 char saved[MAX_STRING]; 1584 char saved[MAX_STRING]; /* Flawfinder: ignore */
1582 saved[0] = '\0'; 1585 saved[0] = '\0';
1583 if(offline == IM_OFFLINE) 1586 if(offline == IM_OFFLINE)
1584 { 1587 {
1585 char time_buf[TIME_STR_LENGTH]; 1588 char time_buf[TIME_STR_LENGTH]; /* Flawfinder: ignore */
1586 sprintf(saved, 1589 snprintf(saved, /* Flawfinder: ignore */
1590 MAX_STRING,
1587 "(Saved %s) ", 1591 "(Saved %s) ",
1588 formatted_time(timestamp, time_buf)); 1592 formatted_time(timestamp, time_buf));
1589 } 1593 }
1590 sprintf(buffer, "%s%s%s%s", name, separator_string, saved, (message+message_offset)); 1594 snprintf(buffer, sizeof(buffer), "%s%s%s%s", name, separator_string, saved, (message+message_offset)); /* Flawfinder: ignore */
1591 BOOL is_this_agent = FALSE; 1595 BOOL is_this_agent = FALSE;
1592 if(from_id == gAgentID) 1596 if(from_id == gAgentID)
1593 { 1597 {
@@ -1605,7 +1609,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
1605 region_id, 1609 region_id,
1606 position); 1610 position);
1607 1611
1608 sprintf(buffer, "IM: %s%s%s%s", name, separator_string, saved, (message+message_offset)); 1612 snprintf(buffer, sizeof(buffer), "IM: %s%s%s%s", name, separator_string, saved, (message+message_offset)); /* Flawfinder: ignore */
1609 chat.mText = buffer; 1613 chat.mText = buffer;
1610 LLFloaterChat::addChat(chat, TRUE, is_this_agent); 1614 LLFloaterChat::addChat(chat, TRUE, is_this_agent);
1611 } 1615 }
@@ -1616,7 +1620,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
1616 { 1620 {
1617 return; 1621 return;
1618 } 1622 }
1619 sprintf(buffer, "%s%s%s", name, separator_string, (message+message_offset)); 1623 snprintf(buffer, sizeof(buffer), "%s%s%s", name, separator_string, (message+message_offset)); /* Flawfinder: ignore */
1620 // Note: lie to LLFloaterChat::addChat(), pretending that this is NOT an IM, because 1624 // Note: lie to LLFloaterChat::addChat(), pretending that this is NOT an IM, because
1621 // IMs from objcts don't open IM sessions. 1625 // IMs from objcts don't open IM sessions.
1622 chat.mText = buffer; 1626 chat.mText = buffer;
@@ -1636,7 +1640,17 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
1636 } 1640 }
1637 break; 1641 break;
1638 case IM_BUSY_AUTO_RESPONSE: 1642 case IM_BUSY_AUTO_RESPONSE:
1639 gIMView->addMessage(session_id, from_id, name, message); 1643 // fix for JIRA issue VWR-20 submitted 13-JAN-2007 - Paul Churchill
1644 if (is_muted)
1645 {
1646 lldebugs << "Ignoring busy response from " << from_id << llendl;
1647 return;
1648 }
1649 else
1650 {
1651 // original code resumes
1652 gIMView->addMessage(session_id, from_id, name, message);
1653 }
1640 break; 1654 break;
1641 1655
1642 case IM_LURE_USER: 1656 case IM_LURE_USER:
@@ -1688,7 +1702,14 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
1688 case IM_GOTO_URL: 1702 case IM_GOTO_URL:
1689 { 1703 {
1690 char* url = new char[binary_bucket_size]; 1704 char* url = new char[binary_bucket_size];
1691 strcpy(url, (char*)binary_bucket); 1705 if (url == NULL)
1706 {
1707 llerrs << "Memory Allocation failed" << llendl;
1708 return;
1709 }
1710
1711 strncpy(url, (char*)binary_bucket, binary_bucket_size-1); /* Flawfinder: ignore */
1712 url[binary_bucket_size-1] = '\0';
1692 args["[MESSAGE]"] = message; 1713 args["[MESSAGE]"] = message;
1693 args["[URL]"] = url; 1714 args["[URL]"] = url;
1694 LLNotifyBox::showXml("GotoURL", args, 1715 LLNotifyBox::showXml("GotoURL", args,
@@ -1730,7 +1751,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
1730 LLAvatarTracker::formFriendship(from_id); 1751 LLAvatarTracker::formFriendship(from_id);
1731 1752
1732 std::vector<std::string> strings; 1753 std::vector<std::string> strings;
1733 strings.push_back( from_id.getString() ); 1754 strings.push_back(from_id.asString());
1734 send_generic_message("requestonlinenotification", strings); 1755 send_generic_message("requestonlinenotification", strings);
1735 1756
1736 args["[NAME]"] = name; 1757 args["[NAME]"] = name;
@@ -1931,8 +1952,8 @@ void process_decline_callingcard(LLMessageSystem* msg, void**)
1931void process_chat_from_simulator(LLMessageSystem *msg, void **user_data) 1952void process_chat_from_simulator(LLMessageSystem *msg, void **user_data)
1932{ 1953{
1933 LLChat chat; 1954 LLChat chat;
1934 char mesg[DB_CHAT_MSG_BUF_SIZE]; 1955 char mesg[DB_CHAT_MSG_BUF_SIZE]; /* Flawfinder: ignore */
1935 char from_name[DB_FULL_NAME_BUF_SIZE]; 1956 char from_name[DB_FULL_NAME_BUF_SIZE]; /* Flawfinder: ignore */
1936 U8 source_temp; 1957 U8 source_temp;
1937 U8 type_temp; 1958 U8 type_temp;
1938 U8 audible_temp; 1959 U8 audible_temp;
@@ -1976,6 +1997,7 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data)
1976 is_linden = gMuteListp->isLinden(from_name); 1997 is_linden = gMuteListp->isLinden(from_name);
1977 } 1998 }
1978 1999
2000 BOOL is_audible = (CHAT_AUDIBLE_FULLY == chat.mAudible);
1979 chatter = gObjectList.findObject(from_id); 2001 chatter = gObjectList.findObject(from_id);
1980 if (chatter) 2002 if (chatter)
1981 { 2003 {
@@ -1995,7 +2017,8 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data)
1995 } 2017 }
1996 2018
1997 // only pay attention to other people chatting 2019 // only pay attention to other people chatting
1998 if ((is_linden || (!is_muted && !is_busy)) 2020 if (is_audible
2021 && (is_linden || (!is_muted && !is_busy))
1999 && chatter != gAgent.getAvatarObject()) 2022 && chatter != gAgent.getAvatarObject())
2000 { 2023 {
2001 gAgent.heardChat(chat); 2024 gAgent.heardChat(chat);
@@ -2008,7 +2031,6 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data)
2008 is_owned_by_me = chatter->permYouOwner(); 2031 is_owned_by_me = chatter->permYouOwner();
2009 } 2032 }
2010 2033
2011 BOOL is_audible = (CHAT_AUDIBLE_FULLY == chat.mAudible);
2012 if (is_audible) 2034 if (is_audible)
2013 { 2035 {
2014 BOOL visible_in_chat_bubble = FALSE; 2036 BOOL visible_in_chat_bubble = FALSE;
@@ -2283,7 +2305,7 @@ void process_teleport_progress(LLMessageSystem* msg, void**)
2283 { 2305 {
2284 gViewerWindow->setProgressCancelButtonVisible(TRUE, "Cancel"); 2306 gViewerWindow->setProgressCancelButtonVisible(TRUE, "Cancel");
2285 } 2307 }
2286 char buffer[MAX_STRING]; 2308 char buffer[MAX_STRING]; /* Flawfinder: ignore */
2287 msg->getString("Info", "Message", MAX_STRING, buffer); 2309 msg->getString("Info", "Message", MAX_STRING, buffer);
2288 lldebugs << "teleport progress: " << buffer << llendl; 2310 lldebugs << "teleport progress: " << buffer << llendl;
2289 gAgent.setTeleportMessage(buffer); 2311 gAgent.setTeleportMessage(buffer);
@@ -2373,7 +2395,7 @@ void process_teleport_finish(LLMessageSystem* msg, void**)
2373 msg->getU32Fast(_PREHASH_Info, _PREHASH_TeleportFlags, teleport_flags); 2395 msg->getU32Fast(_PREHASH_Info, _PREHASH_TeleportFlags, teleport_flags);
2374 2396
2375 2397
2376 char seedCap[STD_STRING_BUF_SIZE]; 2398 char seedCap[STD_STRING_BUF_SIZE]; /* Flawfinder: ignore */
2377 msg->getStringFast(_PREHASH_Info, _PREHASH_SeedCapability, 2399 msg->getStringFast(_PREHASH_Info, _PREHASH_SeedCapability,
2378 STD_STRING_BUF_SIZE, seedCap); 2400 STD_STRING_BUF_SIZE, seedCap);
2379 2401
@@ -2657,7 +2679,7 @@ void process_crossed_region(LLMessageSystem* msg, void**)
2657 U64 region_handle; 2679 U64 region_handle;
2658 msg->getU64Fast(_PREHASH_RegionData, _PREHASH_RegionHandle, region_handle); 2680 msg->getU64Fast(_PREHASH_RegionData, _PREHASH_RegionHandle, region_handle);
2659 2681
2660 char seedCap[STD_STRING_BUF_SIZE]; 2682 char seedCap[STD_STRING_BUF_SIZE]; /* Flawfinder: ignore */
2661 msg->getStringFast(_PREHASH_RegionData, _PREHASH_SeedCapability, STD_STRING_BUF_SIZE, seedCap); 2683 msg->getStringFast(_PREHASH_RegionData, _PREHASH_SeedCapability, STD_STRING_BUF_SIZE, seedCap);
2662 2684
2663 send_complete_agent_movement(sim_host); 2685 send_complete_agent_movement(sim_host);
@@ -2891,7 +2913,8 @@ void send_agent_update(BOOL force_send, BOOL send_reliable)
2891extern U32 gObjectBits; 2913extern U32 gObjectBits;
2892 2914
2893void process_object_update(LLMessageSystem *mesgsys, void **user_data) 2915void process_object_update(LLMessageSystem *mesgsys, void **user_data)
2894{ 2916{
2917 LLMemType mt(LLMemType::MTYPE_OBJECT);
2895 // Update the data counters 2918 // Update the data counters
2896 if (mesgsys->getReceiveCompressedSize()) 2919 if (mesgsys->getReceiveCompressedSize())
2897 { 2920 {
@@ -2909,6 +2932,7 @@ void process_object_update(LLMessageSystem *mesgsys, void **user_data)
2909 2932
2910void process_compressed_object_update(LLMessageSystem *mesgsys, void **user_data) 2933void process_compressed_object_update(LLMessageSystem *mesgsys, void **user_data)
2911{ 2934{
2935 LLMemType mt(LLMemType::MTYPE_OBJECT);
2912 // Update the data counters 2936 // Update the data counters
2913 if (mesgsys->getReceiveCompressedSize()) 2937 if (mesgsys->getReceiveCompressedSize())
2914 { 2938 {
@@ -2926,6 +2950,7 @@ void process_compressed_object_update(LLMessageSystem *mesgsys, void **user_data
2926 2950
2927void process_cached_object_update(LLMessageSystem *mesgsys, void **user_data) 2951void process_cached_object_update(LLMessageSystem *mesgsys, void **user_data)
2928{ 2952{
2953 LLMemType mt(LLMemType::MTYPE_OBJECT);
2929 // Update the data counters 2954 // Update the data counters
2930 if (mesgsys->getReceiveCompressedSize()) 2955 if (mesgsys->getReceiveCompressedSize())
2931 { 2956 {
@@ -2944,6 +2969,7 @@ void process_cached_object_update(LLMessageSystem *mesgsys, void **user_data)
2944 2969
2945void process_terse_object_update_improved(LLMessageSystem *mesgsys, void **user_data) 2970void process_terse_object_update_improved(LLMessageSystem *mesgsys, void **user_data)
2946{ 2971{
2972 LLMemType mt(LLMemType::MTYPE_OBJECT);
2947 if (mesgsys->getReceiveCompressedSize()) 2973 if (mesgsys->getReceiveCompressedSize())
2948 { 2974 {
2949 gObjectBits += mesgsys->getReceiveCompressedSize() * 8; 2975 gObjectBits += mesgsys->getReceiveCompressedSize() * 8;
@@ -2988,7 +3014,7 @@ void process_kill_object(LLMessageSystem *mesgsys, void **user_data)
2988 //llinfos << "Kill message for local " << local_id << llendl; 3014 //llinfos << "Kill message for local " << local_id << llendl;
2989 } 3015 }
2990 3016
2991 gSelectMgr->selectionRemoveObject(id); 3017 gSelectMgr->removeObjectFromSelections(id);
2992 3018
2993 // ...don't kill the avatar 3019 // ...don't kill the avatar
2994 if (!(id == gAgentID)) 3020 if (!(id == gAgentID))
@@ -3470,12 +3496,15 @@ void process_camera_constraint(LLMessageSystem *mesgsys, void **user_data)
3470 3496
3471void near_sit_object(BOOL success, void *data) 3497void near_sit_object(BOOL success, void *data)
3472{ 3498{
3473 // Send message to sit on object 3499 if (success)
3474 gMessageSystem->newMessageFast(_PREHASH_AgentSit); 3500 {
3475 gMessageSystem->nextBlockFast(_PREHASH_AgentData); 3501 // Send message to sit on object
3476 gMessageSystem->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); 3502 gMessageSystem->newMessageFast(_PREHASH_AgentSit);
3477 gMessageSystem->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); 3503 gMessageSystem->nextBlockFast(_PREHASH_AgentData);
3478 gAgent.sendReliableMessage(); 3504 gMessageSystem->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
3505 gMessageSystem->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
3506 gAgent.sendReliableMessage();
3507 }
3479} 3508}
3480 3509
3481void process_avatar_sit_response(LLMessageSystem *mesgsys, void **user_data) 3510void process_avatar_sit_response(LLMessageSystem *mesgsys, void **user_data)
@@ -3516,9 +3545,6 @@ void process_avatar_sit_response(LLMessageSystem *mesgsys, void **user_data)
3516 { 3545 {
3517 gAgent.startAutoPilotGlobal(gAgent.getPosGlobalFromAgent(sit_spot), "Sit", &sitRotation, near_sit_object, NULL, 0.5f); 3546 gAgent.startAutoPilotGlobal(gAgent.getPosGlobalFromAgent(sit_spot), "Sit", &sitRotation, near_sit_object, NULL, 0.5f);
3518 } 3547 }
3519
3520 // deselect transient selections (pie menu) when sitting
3521 gSelectMgr->deselectTransient();
3522 } 3548 }
3523 else 3549 else
3524 { 3550 {
@@ -3658,7 +3684,7 @@ void process_set_follow_cam_properties(LLMessageSystem *mesgsys, void **user_dat
3658// Culled from newsim lltask.cpp 3684// Culled from newsim lltask.cpp
3659void process_name_value(LLMessageSystem *mesgsys, void **user_data) 3685void process_name_value(LLMessageSystem *mesgsys, void **user_data)
3660{ 3686{
3661 char temp_str[NAME_VALUE_BUF_SIZE]; 3687 char temp_str[NAME_VALUE_BUF_SIZE]; /* Flawfinder: ignore */
3662 LLUUID id; 3688 LLUUID id;
3663 S32 i, num_blocks; 3689 S32 i, num_blocks;
3664 3690
@@ -3684,7 +3710,7 @@ void process_name_value(LLMessageSystem *mesgsys, void **user_data)
3684 3710
3685void process_remove_name_value(LLMessageSystem *mesgsys, void **user_data) 3711void process_remove_name_value(LLMessageSystem *mesgsys, void **user_data)
3686{ 3712{
3687 char temp_str[NAME_VALUE_BUF_SIZE]; 3713 char temp_str[NAME_VALUE_BUF_SIZE]; /* Flawfinder: ignore */
3688 LLUUID id; 3714 LLUUID id;
3689 S32 i, num_blocks; 3715 S32 i, num_blocks;
3690 3716
@@ -3710,7 +3736,7 @@ void process_remove_name_value(LLMessageSystem *mesgsys, void **user_data)
3710 3736
3711void process_kick_user(LLMessageSystem *msg, void** /*user_data*/) 3737void process_kick_user(LLMessageSystem *msg, void** /*user_data*/)
3712{ 3738{
3713 char message[2048]; 3739 char message[2048]; /* Flawfinder: ignore */
3714 message[0] = '\0'; 3740 message[0] = '\0';
3715 3741
3716 msg->getStringFast(_PREHASH_UserInfo, _PREHASH_Reason, 2048, message); 3742 msg->getStringFast(_PREHASH_UserInfo, _PREHASH_Reason, 2048, message);
@@ -3778,7 +3804,7 @@ void process_money_balance_reply( LLMessageSystem* msg, void** )
3778 S32 balance = 0; 3804 S32 balance = 0;
3779 S32 credit = 0; 3805 S32 credit = 0;
3780 S32 committed = 0; 3806 S32 committed = 0;
3781 char desc[STD_STRING_BUF_SIZE] = ""; 3807 char desc[STD_STRING_BUF_SIZE] = ""; /* Flawfinder: ignore */
3782 3808
3783 msg->getS32("MoneyData", "MoneyBalance", balance); 3809 msg->getS32("MoneyData", "MoneyBalance", balance);
3784 msg->getS32("MoneyData", "SquareMetersCredit", credit); 3810 msg->getS32("MoneyData", "SquareMetersCredit", credit);
@@ -3839,7 +3865,7 @@ void process_money_balance_reply( LLMessageSystem* msg, void** )
3839 3865
3840void process_agent_alert_message(LLMessageSystem* msgsystem, void** user_data) 3866void process_agent_alert_message(LLMessageSystem* msgsystem, void** user_data)
3841{ 3867{
3842 char buffer[MAX_STRING]; 3868 char buffer[MAX_STRING]; /* Flawfinder: ignore */
3843 msgsystem->getStringFast(_PREHASH_AlertData, _PREHASH_Message, MAX_STRING, buffer); 3869 msgsystem->getStringFast(_PREHASH_AlertData, _PREHASH_Message, MAX_STRING, buffer);
3844 BOOL modal = FALSE; 3870 BOOL modal = FALSE;
3845 msgsystem->getBOOL("AlertData", "Modal", modal); 3871 msgsystem->getBOOL("AlertData", "Modal", modal);
@@ -3848,7 +3874,7 @@ void process_agent_alert_message(LLMessageSystem* msgsystem, void** user_data)
3848 3874
3849void process_alert_message(LLMessageSystem *msgsystem, void **user_data) 3875void process_alert_message(LLMessageSystem *msgsystem, void **user_data)
3850{ 3876{
3851 char buffer[MAX_STRING]; 3877 char buffer[MAX_STRING]; /* Flawfinder: ignore */
3852 msgsystem->getStringFast(_PREHASH_AlertData, _PREHASH_Message, MAX_STRING, buffer); 3878 msgsystem->getStringFast(_PREHASH_AlertData, _PREHASH_Message, MAX_STRING, buffer);
3853 BOOL modal = FALSE; 3879 BOOL modal = FALSE;
3854 process_alert_core(buffer, modal); 3880 process_alert_core(buffer, modal);
@@ -3868,10 +3894,11 @@ void process_alert_core(const char* buffer, BOOL modal)
3868 else if( !strcmp( buffer, "Home position set." ) ) 3894 else if( !strcmp( buffer, "Home position set." ) )
3869 { 3895 {
3870 // save the home location image to disk 3896 // save the home location image to disk
3871 char temp_str[LL_MAX_PATH]; 3897 char temp_str[LL_MAX_PATH]; /* Flawfinder: ignore */
3872 strcpy(temp_str, gDirUtilp->getLindenUserDir().c_str()); 3898 strncpy(temp_str, gDirUtilp->getLindenUserDir().c_str(), LL_MAX_PATH -1); /* Flawfinder: ignore */
3873 strcat(temp_str, "/"); 3899 temp_str[LL_MAX_PATH -1] = '\0';
3874 strcat(temp_str,SCREEN_HOME_FILENAME); 3900 strcat(temp_str, "/"); /* Flawfinder: ignore */
3901 strcat(temp_str,SCREEN_HOME_FILENAME); /* Flawfinder: ignore */
3875 gViewerWindow->saveSnapshot(temp_str, gViewerWindow->getWindowWidth(), gViewerWindow->getWindowHeight(), FALSE, FALSE); 3902 gViewerWindow->saveSnapshot(temp_str, gViewerWindow->getWindowWidth(), gViewerWindow->getWindowHeight(), FALSE, FALSE);
3876 } 3903 }
3877 3904
@@ -3949,8 +3976,10 @@ void mean_name_callback(const LLUUID &id, const char *first, const char *last, B
3949 { 3976 {
3950 if (mcd->mPerp == id) 3977 if (mcd->mPerp == id)
3951 { 3978 {
3952 strcpy(mcd->mFirstName, first); 3979 strncpy(mcd->mFirstName, first, DB_FIRST_NAME_BUF_SIZE -1); /* Flawfinder: ignore */
3953 strcpy(mcd->mLastName, last); 3980 mcd->mFirstName[DB_FIRST_NAME_BUF_SIZE -1] = '\0';
3981 strncpy(mcd->mLastName, last, DB_LAST_NAME_BUF_SIZE -1); /* Flawfinder: ignore */
3982 mcd->mLastName[DB_LAST_NAME_BUF_SIZE -1] = '\0';
3954 } 3983 }
3955 } 3984 }
3956} 3985}
@@ -4101,8 +4130,8 @@ void process_script_question(LLMessageSystem *msg, void **user_data)
4101 LLUUID taskid; 4130 LLUUID taskid;
4102 LLUUID itemid; 4131 LLUUID itemid;
4103 S32 questions; 4132 S32 questions;
4104 char object_name[255]; 4133 char object_name[255]; /* Flawfinder: ignore */
4105 char owner_name[DB_FULL_NAME_BUF_SIZE]; 4134 char owner_name[DB_FULL_NAME_BUF_SIZE]; /* Flawfinder: ignore */
4106 4135
4107 msg->getUUIDFast(_PREHASH_Data, _PREHASH_TaskID, taskid ); 4136 msg->getUUIDFast(_PREHASH_Data, _PREHASH_TaskID, taskid );
4108 msg->getUUIDFast(_PREHASH_Data, _PREHASH_ItemID, itemid ); 4137 msg->getUUIDFast(_PREHASH_Data, _PREHASH_ItemID, itemid );
@@ -4262,7 +4291,7 @@ char* formatted_time(const time_t& the_time, char* buffer)
4262 4291
4263void process_teleport_failed(LLMessageSystem *msg, void**) 4292void process_teleport_failed(LLMessageSystem *msg, void**)
4264{ 4293{
4265 char reason[STD_STRING_BUF_SIZE]; 4294 char reason[STD_STRING_BUF_SIZE]; /* Flawfinder: ignore */
4266 msg->getStringFast(_PREHASH_Info, _PREHASH_Reason, STD_STRING_BUF_SIZE, reason); 4295 msg->getStringFast(_PREHASH_Info, _PREHASH_Reason, STD_STRING_BUF_SIZE, reason);
4267 4296
4268 LLStringBase<char>::format_map_t args; 4297 LLStringBase<char>::format_map_t args;
@@ -4536,10 +4565,10 @@ void process_user_info_reply(LLMessageSystem* msg, void**)
4536 4565
4537 BOOL im_via_email; 4566 BOOL im_via_email;
4538 msg->getBOOLFast(_PREHASH_UserData, _PREHASH_IMViaEMail, im_via_email); 4567 msg->getBOOLFast(_PREHASH_UserData, _PREHASH_IMViaEMail, im_via_email);
4539 char email[DB_USER_EMAIL_ADDR_BUF_SIZE]; 4568 char email[DB_USER_EMAIL_ADDR_BUF_SIZE]; /* Flawfinder: ignore */
4540 msg->getStringFast(_PREHASH_UserData, _PREHASH_EMail, DB_USER_EMAIL_ADDR_BUF_SIZE, 4569 msg->getStringFast(_PREHASH_UserData, _PREHASH_EMail, DB_USER_EMAIL_ADDR_BUF_SIZE,
4541 email); 4570 email);
4542 char dir_visibility[MAX_STRING]; 4571 char dir_visibility[MAX_STRING]; /* Flawfinder: ignore */
4543 msg->getString( 4572 msg->getString(
4544 "UserData", "DirectoryVisibility", MAX_STRING, dir_visibility); 4573 "UserData", "DirectoryVisibility", MAX_STRING, dir_visibility);
4545 4574
@@ -4596,11 +4625,11 @@ void process_script_dialog(LLMessageSystem* msg, void**)
4596 ScriptDialogInfo* info = new ScriptDialogInfo; 4625 ScriptDialogInfo* info = new ScriptDialogInfo;
4597 4626
4598 const S32 messageLength = SCRIPT_DIALOG_MAX_MESSAGE_SIZE + sizeof(SCRIPT_DIALOG_HEADER); 4627 const S32 messageLength = SCRIPT_DIALOG_MAX_MESSAGE_SIZE + sizeof(SCRIPT_DIALOG_HEADER);
4599 char message[messageLength]; // Account for size of "Script Dialog:\n" 4628 char message[messageLength]; /* Flawfinder: ignore */ // Account for size of "Script Dialog:\n"
4600 4629
4601 char first_name[DB_FIRST_NAME_BUF_SIZE]; 4630 char first_name[DB_FIRST_NAME_BUF_SIZE]; /* Flawfinder: ignore */
4602 char last_name[DB_GROUP_NAME_BUF_SIZE]; 4631 char last_name[DB_GROUP_NAME_BUF_SIZE]; /* Flawfinder: ignore */
4603 char title[DB_INV_ITEM_NAME_BUF_SIZE]; 4632 char title[DB_INV_ITEM_NAME_BUF_SIZE]; /* Flawfinder: ignore */
4604 info->mSender = msg->getSender(); 4633 info->mSender = msg->getSender();
4605 4634
4606 msg->getUUID("Data", "ObjectID", info->mObjectID); 4635 msg->getUUID("Data", "ObjectID", info->mObjectID);
@@ -4622,7 +4651,7 @@ void process_script_dialog(LLMessageSystem* msg, void**)
4622 4651
4623 for (i = 0; i < button_count; i++) 4652 for (i = 0; i < button_count; i++)
4624 { 4653 {
4625 char tdesc[SCRIPT_DIALOG_BUTTON_STR_SIZE+1]; 4654 char tdesc[SCRIPT_DIALOG_BUTTON_STR_SIZE+1]; /* Flawfinder: ignore */
4626 msg->getString("Buttons", "ButtonLabel", SCRIPT_DIALOG_BUTTON_STR_SIZE + 1, tdesc, i); 4655 msg->getString("Buttons", "ButtonLabel", SCRIPT_DIALOG_BUTTON_STR_SIZE + 1, tdesc, i);
4627 info->mButtons.push_back(LLString(tdesc)); 4656 info->mButtons.push_back(LLString(tdesc));
4628 } 4657 }
@@ -4630,7 +4659,7 @@ void process_script_dialog(LLMessageSystem* msg, void**)
4630 LLStringBase<char>::format_map_t args; 4659 LLStringBase<char>::format_map_t args;
4631 args["[TITLE]"] = title; 4660 args["[TITLE]"] = title;
4632 args["[MESSAGE]"] = message; 4661 args["[MESSAGE]"] = message;
4633 if (strlen(first_name) > 0) 4662 if (strlen(first_name) > 0) /* Flawfinder: ignore */
4634 { 4663 {
4635 args["[FIRST]"] = first_name; 4664 args["[FIRST]"] = first_name;
4636 args["[LAST]"] = last_name; 4665 args["[LAST]"] = last_name;
@@ -4656,9 +4685,9 @@ struct LoadUrlInfo
4656 LLUUID mObjectID; 4685 LLUUID mObjectID;
4657 LLUUID mOwnerID; 4686 LLUUID mOwnerID;
4658 BOOL mOwnerIsGroup; 4687 BOOL mOwnerIsGroup;
4659 char mObjectName[256]; 4688 char mObjectName[256]; /* Flawfinder: ignore */
4660 char mMessage[256]; 4689 char mMessage[256]; /* Flawfinder: ignore */
4661 char mUrl[256]; 4690 char mUrl[256]; /* Flawfinder: ignore */
4662}; 4691};
4663 4692
4664std::vector<LoadUrlInfo*> gLoadUrlList; 4693std::vector<LoadUrlInfo*> gLoadUrlList;
@@ -4770,8 +4799,8 @@ void process_initiate_download(LLMessageSystem* msg, void**)
4770 return; 4799 return;
4771 } 4800 }
4772 4801
4773 char sim_filename[MAX_PATH]; 4802 char sim_filename[MAX_PATH]; /* Flawfinder: ignore */
4774 char viewer_filename[MAX_PATH]; 4803 char viewer_filename[MAX_PATH]; /* Flawfinder: ignore */
4775 msg->getString("FileData", "SimFilename", MAX_PATH, sim_filename); 4804 msg->getString("FileData", "SimFilename", MAX_PATH, sim_filename);
4776 msg->getString("FileData", "ViewerFilename", MAX_PATH, viewer_filename); 4805 msg->getString("FileData", "ViewerFilename", MAX_PATH, viewer_filename);
4777 4806
@@ -4787,8 +4816,8 @@ void process_initiate_download(LLMessageSystem* msg, void**)
4787 4816
4788void process_script_teleport_request(LLMessageSystem* msg, void**) 4817void process_script_teleport_request(LLMessageSystem* msg, void**)
4789{ 4818{
4790 char object_name[256]; 4819 char object_name[256]; /* Flawfinder: ignore */
4791 char sim_name[256]; 4820 char sim_name[256]; /* Flawfinder: ignore */
4792 LLVector3 pos; 4821 LLVector3 pos;
4793 LLVector3 look_at; 4822 LLVector3 look_at;
4794 4823
@@ -4804,7 +4833,7 @@ void process_script_teleport_request(LLMessageSystem* msg, void**)
4804void process_covenant_reply(LLMessageSystem* msg, void**) 4833void process_covenant_reply(LLMessageSystem* msg, void**)
4805{ 4834{
4806 LLUUID covenant_id, estate_owner_id; 4835 LLUUID covenant_id, estate_owner_id;
4807 char estate_name[MAX_STRING]; 4836 char estate_name[MAX_STRING]; /* Flawfinder: ignore */
4808 U32 covenant_timestamp; 4837 U32 covenant_timestamp;
4809 msg->getUUID("Data", "CovenantID", covenant_id); 4838 msg->getUUID("Data", "CovenantID", covenant_id);
4810 msg->getU32("Data", "CovenantTimestamp", covenant_timestamp); 4839 msg->getU32("Data", "CovenantTimestamp", covenant_timestamp);
@@ -4816,10 +4845,10 @@ void process_covenant_reply(LLMessageSystem* msg, void**)
4816 LLFloaterBuyLand::updateEstateName(estate_name); 4845 LLFloaterBuyLand::updateEstateName(estate_name);
4817 4846
4818 // standard message, not from system 4847 // standard message, not from system
4819 char last_modified[MAX_STRING]; 4848 char last_modified[MAX_STRING]; /* Flawfinder: ignore */
4820 last_modified[0] = '\0'; 4849 last_modified[0] = '\0';
4821 char time_buf[TIME_STR_LENGTH]; 4850 char time_buf[TIME_STR_LENGTH]; /* Flawfinder: ignore */
4822 sprintf(last_modified, "Last Modified %s", 4851 snprintf(last_modified, MAX_STRING, "Last Modified %s", /* Flawfinder: ignore */
4823 formatted_time((time_t)covenant_timestamp, time_buf)); 4852 formatted_time((time_t)covenant_timestamp, time_buf));
4824 4853
4825 LLPanelEstateCovenant::updateLastModified(last_modified); 4854 LLPanelEstateCovenant::updateLastModified(last_modified);
@@ -4898,7 +4927,13 @@ void onCovenantLoadComplete(LLVFS *vfs,
4898 S32 file_length = file.getSize(); 4927 S32 file_length = file.getSize();
4899 4928
4900 char* buffer = new char[file_length+1]; 4929 char* buffer = new char[file_length+1];
4901 file.read((U8*)buffer, file_length); 4930 if (buffer == NULL)
4931 {
4932 llerrs << "Memory Allocation failed" << llendl;
4933 return;
4934 }
4935
4936 file.read((U8*)buffer, file_length); /* Flawfinder: ignore */
4902 4937
4903 // put a EOS at the end 4938 // put a EOS at the end
4904 buffer[file_length] = 0; 4939 buffer[file_length] = 0;
@@ -5009,7 +5044,7 @@ void process_feature_disabled_message(LLMessageSystem* msg, void**)
5009 // Handle Blacklisted feature simulator response... 5044 // Handle Blacklisted feature simulator response...
5010 LLUUID agentID; 5045 LLUUID agentID;
5011 LLUUID transactionID; 5046 LLUUID transactionID;
5012 char messageText[MAX_STRING]; 5047 char messageText[MAX_STRING]; /* Flawfinder: ignore */
5013 msg->getStringFast(_PREHASH_FailureInfo,_PREHASH_ErrorMessage,MAX_STRING,&messageText[0],0); 5048 msg->getStringFast(_PREHASH_FailureInfo,_PREHASH_ErrorMessage,MAX_STRING,&messageText[0],0);
5014 msg->getUUIDFast(_PREHASH_FailureInfo,_PREHASH_AgentID,agentID); 5049 msg->getUUIDFast(_PREHASH_FailureInfo,_PREHASH_AgentID,agentID);
5015 msg->getUUIDFast(_PREHASH_FailureInfo,_PREHASH_TransactionID,transactionID); 5050 msg->getUUIDFast(_PREHASH_FailureInfo,_PREHASH_TransactionID,transactionID);
diff --git a/linden/indra/newview/llviewernetwork.cpp b/linden/indra/newview/llviewernetwork.cpp
index 84c5833..d870871 100644
--- a/linden/indra/newview/llviewernetwork.cpp
+++ b/linden/indra/newview/llviewernetwork.cpp
@@ -65,6 +65,10 @@ LLUserServerData gUserServerDomainName[USERSERVER_COUNT] =
65 "userserver.ganga.lindenlab.com", 65 "userserver.ganga.lindenlab.com",
66 "https://login.ganga.lindenlab.com/cgi-bin/login.cgi", 66 "https://login.ganga.lindenlab.com/cgi-bin/login.cgi",
67 "http://ganga-secondlife.webdev.lindenlab.com/helpers/" }, 67 "http://ganga-secondlife.webdev.lindenlab.com/helpers/" },
68 { "Vaak",
69 "userserver.vaak.lindenlab.com",
70 "https://login.vaak.lindenlab.com/cgi-bin/login.cgi",
71 "http://vaak-secondlife.webdev.lindenlab.com/helpers/" },
68 { "Uma", 72 { "Uma",
69 "userserver.uma.lindenlab.com", 73 "userserver.uma.lindenlab.com",
70 "https://login.uma.lindenlab.com/cgi-bin/login.cgi", 74 "https://login.uma.lindenlab.com/cgi-bin/login.cgi",
@@ -82,7 +86,7 @@ LLUserServerData gUserServerDomainName[USERSERVER_COUNT] =
82// Use this to figure out which domain name and login URI to use. 86// Use this to figure out which domain name and login URI to use.
83 87
84EUserServerDomain gUserServerChoice = USERSERVER_NONE; 88EUserServerDomain gUserServerChoice = USERSERVER_NONE;
85char gUserServerName[MAX_STRING]; 89char gUserServerName[MAX_STRING]; /* Flawfinder: ignore */
86 90
87LLHost gUserServer; 91LLHost gUserServer;
88 92
@@ -90,4 +94,4 @@ F32 gPacketDropPercentage = 0.f;
90F32 gInBandwidth = 0.f; 94F32 gInBandwidth = 0.f;
91F32 gOutBandwidth = 0.f; 95F32 gOutBandwidth = 0.f;
92 96
93unsigned char gMACAddress[MAC_ADDRESS_BYTES]; 97unsigned char gMACAddress[MAC_ADDRESS_BYTES]; /* Flawfinder: ignore */
diff --git a/linden/indra/newview/llviewernetwork.h b/linden/indra/newview/llviewernetwork.h
index ae5292c..4c90c5b 100644
--- a/linden/indra/newview/llviewernetwork.h
+++ b/linden/indra/newview/llviewernetwork.h
@@ -42,6 +42,7 @@ enum EUserServerDomain
42 USERSERVER_SHAKTI, 42 USERSERVER_SHAKTI,
43 USERSERVER_SOMA, 43 USERSERVER_SOMA,
44 USERSERVER_GANGA, 44 USERSERVER_GANGA,
45 USERSERVER_VAAK,
45 USERSERVER_UMA, 46 USERSERVER_UMA,
46 USERSERVER_LOCAL, 47 USERSERVER_LOCAL,
47 USERSERVER_OTHER, // IP address set via -user or other command line option 48 USERSERVER_OTHER, // IP address set via -user or other command line option
@@ -64,9 +65,9 @@ extern F32 gInBandwidth;
64extern F32 gOutBandwidth; 65extern F32 gOutBandwidth;
65extern EUserServerDomain gUserServerChoice; 66extern EUserServerDomain gUserServerChoice;
66extern LLUserServerData gUserServerDomainName[]; 67extern LLUserServerData gUserServerDomainName[];
67extern char gUserServerName[MAX_STRING]; 68extern char gUserServerName[MAX_STRING]; /* Flawfinder: ignore */
68 69
69const S32 MAC_ADDRESS_BYTES = 6; 70const S32 MAC_ADDRESS_BYTES = 6;
70extern unsigned char gMACAddress[MAC_ADDRESS_BYTES]; 71extern unsigned char gMACAddress[MAC_ADDRESS_BYTES]; /* Flawfinder: ignore */
71 72
72#endif 73#endif
diff --git a/linden/indra/newview/llviewerobject.cpp b/linden/indra/newview/llviewerobject.cpp
index 40930e6..a1a971f 100644
--- a/linden/indra/newview/llviewerobject.cpp
+++ b/linden/indra/newview/llviewerobject.cpp
@@ -80,14 +80,12 @@
80#include "llvoground.h" 80#include "llvoground.h"
81#include "llvolume.h" 81#include "llvolume.h"
82#include "llvolumemessage.h" 82#include "llvolumemessage.h"
83#include "llvopart.h"
84#include "llvopartgroup.h" 83#include "llvopartgroup.h"
85#include "llvosky.h" 84#include "llvosky.h"
86#include "llvostars.h" 85#include "llvostars.h"
87#include "llvosurfacepatch.h" 86#include "llvosurfacepatch.h"
88#include "llvotextbubble.h" 87#include "llvotextbubble.h"
89#include "llvotree.h" 88#include "llvotree.h"
90#include "llvotreenew.h"
91#include "llvovolume.h" 89#include "llvovolume.h"
92#include "llvowater.h" 90#include "llvowater.h"
93#include "llworld.h" 91#include "llworld.h"
@@ -125,14 +123,15 @@ LLViewerObject *LLViewerObject::createObject(const LLUUID &id, const LLPCode pco
125 case LL_PCODE_LEGACY_GRASS: 123 case LL_PCODE_LEGACY_GRASS:
126 res = new LLVOGrass(id, pcode, regionp); break; 124 res = new LLVOGrass(id, pcode, regionp); break;
127 case LL_PCODE_LEGACY_PART_SYS: 125 case LL_PCODE_LEGACY_PART_SYS:
128 res = new LLVOPart(id, pcode, regionp); break; 126// llwarns << "Creating old part sys!" << llendl;
127// res = new LLVOPart(id, pcode, regionp); break;
128 res = NULL; break;
129 case LL_PCODE_LEGACY_TREE: 129 case LL_PCODE_LEGACY_TREE:
130 res = new LLVOTree(id, pcode, regionp); break; 130 res = new LLVOTree(id, pcode, regionp); break;
131 case LL_PCODE_TREE_NEW: 131 case LL_PCODE_TREE_NEW:
132 llwarns << "Creating new tree!" << llendl; 132// llwarns << "Creating new tree!" << llendl;
133// res = new LLVOTree(id, pcode, regionp); break; 133// res = new LLVOTree(id, pcode, regionp); break;
134// res = new LLVOTreeNew(id, pcode, regionp); break; 134 res = NULL; break;
135 res = NULL; break;
136 case LL_PCODE_LEGACY_TEXT_BUBBLE: 135 case LL_PCODE_LEGACY_TEXT_BUBBLE:
137 res = new LLVOTextBubble(id, pcode, regionp); break; 136 res = new LLVOTextBubble(id, pcode, regionp); break;
138 case LL_VO_CLOUDS: 137 case LL_VO_CLOUDS:
@@ -173,10 +172,11 @@ LLViewerObject::LLViewerObject(const LLUUID &id, const LLPCode pcode, LLViewerRe
173 mText(), 172 mText(),
174 mLastInterpUpdateSecs(0.f), 173 mLastInterpUpdateSecs(0.f),
175 mLastMessageUpdateSecs(0.f), 174 mLastMessageUpdateSecs(0.f),
175 mLatestRecvPacketID(0),
176 mData(NULL), 176 mData(NULL),
177 mAudioSourcep(NULL), 177 mAudioSourcep(NULL),
178 mAppAngle(0.f), 178 mAppAngle(0.f),
179 mPixelArea(0.f), 179 mPixelArea(1024.f),
180 mInventory(NULL), 180 mInventory(NULL),
181 mInventorySerialNum(0), 181 mInventorySerialNum(0),
182 mRegionp( regionp ), 182 mRegionp( regionp ),
@@ -188,7 +188,6 @@ LLViewerObject::LLViewerObject(const LLUUID &id, const LLPCode pcode, LLViewerRe
188 mOnActiveList(FALSE), 188 mOnActiveList(FALSE),
189 mOnMap(FALSE), 189 mOnMap(FALSE),
190 mStatic(FALSE), 190 mStatic(FALSE),
191 mFaceIndexOffset(0),
192 mNumFaces(0), 191 mNumFaces(0),
193 mLastUpdateFrame(0), 192 mLastUpdateFrame(0),
194 mTimeDilation(1.f), 193 mTimeDilation(1.f),
@@ -368,10 +367,12 @@ void LLViewerObject::dump() const
368 llinfos << "Velocity: " << getVelocity() << llendl; 367 llinfos << "Velocity: " << getVelocity() << llendl;
369 if (mDrawable.notNull() && mDrawable->getNumFaces()) 368 if (mDrawable.notNull() && mDrawable->getNumFaces())
370 { 369 {
371 LLDrawPool *poolp = mDrawable->getFace(0)->getPool(); 370 LLFacePool *poolp = mDrawable->getFace(0)->getPool();
372 llinfos << "Pool: " << poolp << llendl; 371 if (poolp)
373 llinfos << "Pool reference count: " << poolp->mReferences.size() << llendl; 372 {
374 llinfos << "Pool vertex count: " << poolp->getVertexCount() << llendl; 373 llinfos << "Pool: " << poolp << llendl;
374 llinfos << "Pool reference count: " << poolp->mReferences.size() << llendl;
375 }
375 } 376 }
376 //llinfos << "BoxTree Min: " << mDrawable->getBox()->getMin() << llendl; 377 //llinfos << "BoxTree Min: " << mDrawable->getBox()->getMin() << llendl;
377 //llinfos << "BoxTree Max: " << mDrawable->getBox()->getMin() << llendl; 378 //llinfos << "BoxTree Max: " << mDrawable->getBox()->getMin() << llendl;
@@ -423,7 +424,6 @@ void LLViewerObject::initVOClasses()
423 } 424 }
424 llinfos << "Viewer Object size: " << sizeof(LLViewerObject) << llendl; 425 llinfos << "Viewer Object size: " << sizeof(LLViewerObject) << llendl;
425 LLVOGrass::initClass(); 426 LLVOGrass::initClass();
426 LLVOPart::initClass();
427 LLVOWater::initClass(); 427 LLVOWater::initClass();
428 LLVOSky::initClass(); 428 LLVOSky::initClass();
429 LLVOVolume::initClass(); 429 LLVOVolume::initClass();
@@ -615,11 +615,24 @@ BOOL LLViewerObject::setDrawableParent(LLDrawable* parentp)
615 return FALSE; 615 return FALSE;
616 } 616 }
617 617
618 LLDrawable* old_parent = mDrawable->mParent;
619
618 mDrawable->mParent = parentp; 620 mDrawable->mParent = parentp;
619 621
620 BOOL ret = mDrawable->mXform.setParent(parentp ? &parentp->mXform : NULL); 622 BOOL ret = mDrawable->mXform.setParent(parentp ? &parentp->mXform : NULL);
621 gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_VOLUME, TRUE); 623 gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_VOLUME, TRUE);
622 gPipeline.markMoved(mDrawable, FALSE); 624 if (old_parent || (parentp && parentp->isActive()))
625 {
626 gPipeline.markMoved(mDrawable, FALSE);
627 }
628 else
629 {
630 mDrawable->updateXform(TRUE);
631 if (!mDrawable->getSpatialGroup())
632 {
633 mDrawable->movePartition();
634 }
635 }
623 636
624 return ret; 637 return ret;
625} 638}
@@ -674,7 +687,7 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys,
674 LLVector3 new_acc; 687 LLVector3 new_acc;
675 LLVector3 new_angv; 688 LLVector3 new_angv;
676 LLQuaternion new_rot; 689 LLQuaternion new_rot;
677 LLVector3 new_scale; 690 LLVector3 new_scale = getScale();
678 691
679 U32 parent_id = 0; 692 U32 parent_id = 0;
680 U8 material = 0; 693 U8 material = 0;
@@ -900,13 +913,6 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys,
900 // ...new objects that should come in selected need to be added to the selected list 913 // ...new objects that should come in selected need to be added to the selected list
901 mCreateSelected = ((flags & FLAGS_CREATE_SELECTED) != 0); 914 mCreateSelected = ((flags & FLAGS_CREATE_SELECTED) != 0);
902 915
903 // Set the change flags for scale
904 if (new_scale != getScale())
905 {
906 setChanged(SCALED | SILHOUETTE);
907 setScale(new_scale); // Must follow setting permYouOwner()
908 }
909
910 // Set all name value pairs 916 // Set all name value pairs
911 S32 nv_size = mesgsys->getSizeFast(_PREHASH_ObjectData, block_num, _PREHASH_NameValue); 917 S32 nv_size = mesgsys->getSizeFast(_PREHASH_ObjectData, block_num, _PREHASH_NameValue);
912 if (nv_size > 0) 918 if (nv_size > 0)
@@ -952,7 +958,7 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys,
952 mText->setOnHUDAttachment(isHUDAttachment()); 958 mText->setOnHUDAttachment(isHUDAttachment());
953 } 959 }
954 960
955 char temp_string[256]; // not MAX_STRING, must hold 255 chars + \0 961 char temp_string[256]; /* Flawfinder: ignore */ // not MAX_STRING, must hold 255 chars + \0
956 mesgsys->getStringFast(_PREHASH_ObjectData, _PREHASH_Text, 256, temp_string, block_num ); 962 mesgsys->getStringFast(_PREHASH_ObjectData, _PREHASH_Text, 256, temp_string, block_num );
957 963
958 LLColor4U coloru; 964 LLColor4U coloru;
@@ -975,7 +981,7 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys,
975 mText = NULL; 981 mText = NULL;
976 } 982 }
977 983
978 char media_url[MAX_STRING+1]; 984 char media_url[MAX_STRING+1]; /* Flawfinder: ignore */
979 mesgsys->getStringFast(_PREHASH_ObjectData, _PREHASH_MediaURL, MAX_STRING+1, media_url, block_num); 985 mesgsys->getStringFast(_PREHASH_ObjectData, _PREHASH_MediaURL, MAX_STRING+1, media_url, block_num);
980 //if (media_url[0]) 986 //if (media_url[0])
981 //{ 987 //{
@@ -1419,8 +1425,14 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys,
1419 // Unpack particle system data 1425 // Unpack particle system data
1420 // 1426 //
1421 if (value & 0x8) 1427 if (value & 0x8)
1428 {
1422 unpackParticleSource(*dp, owner_id); 1429 unpackParticleSource(*dp, owner_id);
1423 1430 }
1431 else
1432 {
1433 deleteParticleSource();
1434 }
1435
1424 // Mark all extra parameters not used 1436 // Mark all extra parameters not used
1425 std::map<U16, ExtraParameter*>::iterator iter; 1437 std::map<U16, ExtraParameter*>::iterator iter;
1426 for (iter = mExtraParameterList.begin(); iter != mExtraParameterList.end(); ++iter) 1438 for (iter = mExtraParameterList.begin(); iter != mExtraParameterList.end(); ++iter)
@@ -1484,14 +1496,6 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys,
1484 1496
1485 // ...new objects that should come in selected need to be added to the selected list 1497 // ...new objects that should come in selected need to be added to the selected list
1486 mCreateSelected = ((flags & FLAGS_CREATE_SELECTED) != 0); 1498 mCreateSelected = ((flags & FLAGS_CREATE_SELECTED) != 0);
1487
1488 // Set the change flags for scale
1489 if (new_scale != getScale())
1490 {
1491 setChanged(SCALED | SILHOUETTE);
1492 setScale(new_scale); // Must follow setting permYouOwner()
1493 }
1494
1495 } 1499 }
1496 break; 1500 break;
1497 1501
@@ -1763,6 +1767,23 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys,
1763 // 1767 //
1764 // 1768 //
1765 1769
1770 U32 packet_id = mesgsys->getCurrentRecvPacketID();
1771 if (packet_id < mLatestRecvPacketID &&
1772 mLatestRecvPacketID - packet_id < 65536)
1773 {
1774 //skip application of this message, it's old
1775 return retval;
1776 }
1777
1778 mLatestRecvPacketID = packet_id;
1779
1780 // Set the change flags for scale
1781 if (new_scale != getScale())
1782 {
1783 setChanged(SCALED | SILHOUETTE);
1784 setScale(new_scale); // Must follow setting permYouOwner()
1785 }
1786
1766 // first, let's see if the new position is actually a change 1787 // first, let's see if the new position is actually a change
1767 1788
1768 //static S32 counter = 0; 1789 //static S32 counter = 0;
@@ -1790,14 +1811,10 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys,
1790 1811
1791 if (new_rot != mLastRot) 1812 if (new_rot != mLastRot)
1792 { 1813 {
1793 // if (getAngularVelocity().isExactlyZero() || 1814 mLastRot = new_rot;
1794 // new_angv != getAngularVelocity()) 1815 setChanged(ROTATED | SILHOUETTE);
1795 { 1816 setRotation(new_rot);
1796 mLastRot = new_rot; 1817 resetRot();
1797 setChanged(ROTATED | SILHOUETTE);
1798 setRotation(new_rot);
1799 resetRot();
1800 }
1801 } 1818 }
1802 1819
1803 1820
@@ -2048,7 +2065,7 @@ BOOL LLViewerObject::setData(const U8 *datap, const U32 data_size)
2048 { 2065 {
2049 return FALSE; 2066 return FALSE;
2050 } 2067 }
2051 memcpy(mData, datap, data_size); 2068 memcpy(mData, datap, data_size); /* Flawfinder: ignore */
2052 } 2069 }
2053 return TRUE; 2070 return TRUE;
2054} 2071}
@@ -2300,7 +2317,7 @@ void LLViewerObject::requestInventory()
2300struct LLFilenameAndTask 2317struct LLFilenameAndTask
2301{ 2318{
2302 LLUUID mTaskID; 2319 LLUUID mTaskID;
2303 char mFilename[MAX_STRING]; // Just the filename, not the path 2320 char mFilename[MAX_STRING]; /* Flawfinder: ignore */ // Just the filename, not the path
2304#ifdef _DEBUG 2321#ifdef _DEBUG
2305 static S32 sCount; 2322 static S32 sCount;
2306 LLFilenameAndTask() 2323 LLFilenameAndTask()
@@ -2331,41 +2348,45 @@ void LLViewerObject::processTaskInv(LLMessageSystem* msg, void** user_data)
2331 LLUUID task_id; 2348 LLUUID task_id;
2332 msg->getUUIDFast(_PREHASH_InventoryData, _PREHASH_TaskID, task_id); 2349 msg->getUUIDFast(_PREHASH_InventoryData, _PREHASH_TaskID, task_id);
2333 LLViewerObject* object = gObjectList.findObject(task_id); 2350 LLViewerObject* object = gObjectList.findObject(task_id);
2334 if(object) 2351 if(!object)
2352 {
2353 llwarns << "LLViewerObject::processTaskInv object "
2354 << task_id << " does not exist." << llendl;
2355 return;
2356 }
2357
2358 msg->getS16Fast(_PREHASH_InventoryData, _PREHASH_Serial, object->mInventorySerialNum);
2359 LLFilenameAndTask* ft = new LLFilenameAndTask;
2360 ft->mTaskID = task_id;
2361 msg->getStringFast(_PREHASH_InventoryData, _PREHASH_Filename, MAX_STRING, ft->mFilename);
2362 if(!ft->mFilename[0])
2335 { 2363 {
2336 msg->getS16Fast(_PREHASH_InventoryData, _PREHASH_Serial, object->mInventorySerialNum); 2364 lldebugs << "Task has no inventory" << llendl;
2337 LLFilenameAndTask* ft = new LLFilenameAndTask; 2365 // mock up some inventory to make a drop target.
2338 ft->mTaskID = task_id; 2366 if(object->mInventory)
2339 msg->getStringFast(_PREHASH_InventoryData, _PREHASH_Filename, MAX_STRING, ft->mFilename);
2340 if(!ft->mFilename[0])
2341 { 2367 {
2342 lldebugs << "Task has no inventory" << llendl; 2368 object->mInventory->clear(); // will deref and delete it
2343 // mock up some inventory to make a drop target.
2344 if(object->mInventory)
2345 {
2346 object->mInventory->clear(); // will deref and delete it
2347 }
2348 else
2349 {
2350 object->mInventory = new InventoryObjectList();
2351 }
2352 LLPointer<LLInventoryObject> obj;
2353 obj = new LLInventoryObject(object->mID, LLUUID::null,
2354 LLAssetType::AT_CATEGORY,
2355 "Contents");
2356 object->mInventory->push_front(obj);
2357 object->doInventoryCallback();
2358 delete ft;
2359 return;
2360 } 2369 }
2361 gXferManager->requestFile(gDirUtilp->getExpandedFilename(LL_PATH_CACHE, ft->mFilename).c_str(), 2370 else
2362 ft->mFilename, LL_PATH_CACHE, 2371 {
2363 object->mRegionp->getHost(), 2372 object->mInventory = new InventoryObjectList();
2364 TRUE, 2373 }
2365 &LLViewerObject::processTaskInvFile, 2374 LLPointer<LLInventoryObject> obj;
2366 (void**)ft, 2375 obj = new LLInventoryObject(object->mID, LLUUID::null,
2367 LLXferManager::HIGH_PRIORITY); 2376 LLAssetType::AT_CATEGORY,
2377 "Contents");
2378 object->mInventory->push_front(obj);
2379 object->doInventoryCallback();
2380 delete ft;
2381 return;
2368 } 2382 }
2383 gXferManager->requestFile(gDirUtilp->getExpandedFilename(LL_PATH_CACHE, ft->mFilename).c_str(),
2384 ft->mFilename, LL_PATH_CACHE,
2385 object->mRegionp->getHost(),
2386 TRUE,
2387 &LLViewerObject::processTaskInvFile,
2388 (void**)ft,
2389 LLXferManager::HIGH_PRIORITY);
2369} 2390}
2370 2391
2371void LLViewerObject::processTaskInvFile(void** user_data, S32 error_code) 2392void LLViewerObject::processTaskInvFile(void** user_data, S32 error_code)
@@ -2395,9 +2416,9 @@ void LLViewerObject::loadTaskInvFile(const char* filename)
2395 llifstream ifs(filename_and_local_path.c_str()); 2416 llifstream ifs(filename_and_local_path.c_str());
2396 if(ifs.good()) 2417 if(ifs.good())
2397 { 2418 {
2398 char buffer[MAX_STRING]; 2419 char buffer[MAX_STRING]; /* Flawfinder: ignore */
2399 // *NOTE: This buffer size is hard coded into scanf() below. 2420 // *NOTE: This buffer size is hard coded into scanf() below.
2400 char keyword[MAX_STRING]; 2421 char keyword[MAX_STRING]; /* Flawfinder: ignore */
2401 if(mInventory) 2422 if(mInventory)
2402 { 2423 {
2403 mInventory->clear(); // will deref and delete it 2424 mInventory->clear(); // will deref and delete it
@@ -2409,7 +2430,7 @@ void LLViewerObject::loadTaskInvFile(const char* filename)
2409 while(ifs.good()) 2430 while(ifs.good())
2410 { 2431 {
2411 ifs.getline(buffer, MAX_STRING); 2432 ifs.getline(buffer, MAX_STRING);
2412 sscanf(buffer, " %254s", keyword); 2433 sscanf(buffer, " %254s", keyword); /* Flawfinder: ignore */
2413 if(0 == strcmp("inv_item", keyword)) 2434 if(0 == strcmp("inv_item", keyword))
2414 { 2435 {
2415 LLPointer<LLInventoryObject> inv = new LLViewerInventoryItem; 2436 LLPointer<LLInventoryObject> inv = new LLViewerInventoryItem;
@@ -2590,6 +2611,18 @@ LLViewerInventoryItem* LLViewerObject::getInventoryItemByAsset(const LLUUID& ass
2590 return rv; 2611 return rv;
2591} 2612}
2592 2613
2614void LLViewerObject::updateViewerInventoryAsset(
2615 const LLViewerInventoryItem* item,
2616 const LLUUID& new_asset)
2617{
2618 LLPointer<LLViewerInventoryItem> task_item =
2619 new LLViewerInventoryItem(item);
2620 task_item->setAssetUUID(new_asset);
2621
2622 // do the internal logic
2623 doUpdateInventory(task_item, TASK_INVENTORY_ITEM_KEY, false);
2624}
2625
2593void LLViewerObject::setPixelAreaAndAngle(LLAgent &agent) 2626void LLViewerObject::setPixelAreaAndAngle(LLAgent &agent)
2594{ 2627{
2595 if (getVolume()) 2628 if (getVolume())
@@ -2644,6 +2677,11 @@ BOOL LLViewerObject::updateGeometry(LLDrawable *drawable)
2644 return TRUE; 2677 return TRUE;
2645} 2678}
2646 2679
2680void LLViewerObject::updateFaceSize(S32 idx)
2681{
2682
2683}
2684
2647LLDrawable* LLViewerObject::createDrawable(LLPipeline *pipeline) 2685LLDrawable* LLViewerObject::createDrawable(LLPipeline *pipeline)
2648{ 2686{
2649 return NULL; 2687 return NULL;
@@ -2684,13 +2722,23 @@ void LLViewerObject::setScale(const LLVector3 &scale, BOOL damped)
2684void LLViewerObject::updateSpatialExtents(LLVector3& newMin, LLVector3 &newMax) 2722void LLViewerObject::updateSpatialExtents(LLVector3& newMin, LLVector3 &newMax)
2685{ 2723{
2686 LLVector3 center = getRenderPosition(); 2724 LLVector3 center = getRenderPosition();
2687 F32 sz = llmin(mDrawable->getRadius(), 256.f); 2725 LLVector3 size = getScale();
2688 LLVector3 size = LLVector3(sz,sz,sz);
2689 newMin.setVec(center-size); 2726 newMin.setVec(center-size);
2690 newMax.setVec(center+size); 2727 newMax.setVec(center+size);
2691 mDrawable->setPositionGroup((newMin + newMax) * 0.5f); 2728 mDrawable->setPositionGroup((newMin + newMax) * 0.5f);
2692} 2729}
2693 2730
2731F32 LLViewerObject::getBinRadius()
2732{
2733 if (mDrawable.notNull())
2734 {
2735 const LLVector3* ext = mDrawable->getSpatialExtents();
2736 return (ext[1]-ext[0]).magVec();
2737 }
2738
2739 return getScale().magVec();
2740}
2741
2694F32 LLViewerObject::getMaxScale() const 2742F32 LLViewerObject::getMaxScale() const
2695{ 2743{
2696 return llmax(getScale().mV[VX],getScale().mV[VY], getScale().mV[VZ]); 2744 return llmax(getScale().mV[VX],getScale().mV[VY], getScale().mV[VZ]);
@@ -3593,11 +3641,6 @@ S32 LLViewerObject::setTETexGen(const U8 te, const U8 texgen)
3593 { 3641 {
3594 retval = LLPrimitive::setTETexGen(te, texgen); 3642 retval = LLPrimitive::setTETexGen(te, texgen);
3595 setChanged(TEXTURE); 3643 setChanged(TEXTURE);
3596 if (mDrawable.notNull() && retval)
3597 {
3598 gPipeline.markTextured(mDrawable);
3599 gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_ALL, TRUE);
3600 }
3601 } 3644 }
3602 return retval; 3645 return retval;
3603} 3646}
@@ -3614,11 +3657,6 @@ S32 LLViewerObject::setTEShiny(const U8 te, const U8 shiny)
3614 { 3657 {
3615 retval = LLPrimitive::setTEShiny(te, shiny); 3658 retval = LLPrimitive::setTEShiny(te, shiny);
3616 setChanged(TEXTURE); 3659 setChanged(TEXTURE);
3617 if (mDrawable.notNull() && retval)
3618 {
3619 gPipeline.markTextured(mDrawable);
3620 gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_GEOMETRY, TRUE);
3621 }
3622 } 3660 }
3623 return retval; 3661 return retval;
3624} 3662}
@@ -3763,7 +3801,7 @@ LLViewerImage *LLViewerObject::getTEImage(const U8 face) const
3763 } 3801 }
3764 } 3802 }
3765 3803
3766 llerrs << "Requested invalid face!" << llendl; 3804 llerrs << llformat("Requested Image from invalid face: %d/%d",face,getNumTEs()) << llendl;
3767 3805
3768 return NULL; 3806 return NULL;
3769} 3807}
@@ -3857,6 +3895,11 @@ void LLViewerObject::setCanSelect(BOOL canSelect)
3857 3895
3858void LLViewerObject::setDebugText(const std::string &utf8text) 3896void LLViewerObject::setDebugText(const std::string &utf8text)
3859{ 3897{
3898 if (utf8text.empty() && !mText)
3899 {
3900 return;
3901 }
3902
3860 if (!mText) 3903 if (!mText)
3861 { 3904 {
3862 mText = (LLHUDText *)LLHUDObject::addHUDObject(LLHUDObject::LL_HUD_TEXT); 3905 mText = (LLHUDText *)LLHUDObject::addHUDObject(LLHUDObject::LL_HUD_TEXT);
@@ -4045,6 +4088,15 @@ void LLViewerObject::unpackParticleSource(LLDataPacker &dp, const LLUUID& owner_
4045 } 4088 }
4046} 4089}
4047 4090
4091void LLViewerObject::deleteParticleSource()
4092{
4093 if (mPartSourcep.notNull())
4094 {
4095 mPartSourcep->setDead();
4096 mPartSourcep = NULL;
4097 }
4098}
4099
4048// virtual 4100// virtual
4049void LLViewerObject::updateDrawable(BOOL force_damped) 4101void LLViewerObject::updateDrawable(BOOL force_damped)
4050{ 4102{
@@ -4577,6 +4629,7 @@ void LLViewerObject::markForUpdate(BOOL priority)
4577void LLViewerObject::setRegion(LLViewerRegion *regionp) 4629void LLViewerObject::setRegion(LLViewerRegion *regionp)
4578{ 4630{
4579 llassert(regionp); 4631 llassert(regionp);
4632 mLatestRecvPacketID = 0;
4580 mRegionp = regionp; 4633 mRegionp = regionp;
4581 setChanged(MOVED | SILHOUETTE); 4634 setChanged(MOVED | SILHOUETTE);
4582 updateDrawable(FALSE); 4635 updateDrawable(FALSE);
@@ -4665,3 +4718,30 @@ void LLViewerObject::resetRot()
4665{ 4718{
4666 mRotTime = 0.0f; 4719 mRotTime = 0.0f;
4667} 4720}
4721
4722U32 LLViewerObject::getPartitionType() const
4723{
4724 return LLPipeline::PARTITION_NONE;
4725}
4726
4727BOOL LLAlphaObject::isParticle()
4728{
4729 return FALSE;
4730}
4731
4732F32 LLAlphaObject::getPartSize(S32 idx)
4733{
4734 return 0.f;
4735}
4736
4737// virtual
4738void LLStaticViewerObject::updateDrawable(BOOL force_damped)
4739{
4740 // Force an immediate rebuild on any update
4741 if (mDrawable.notNull())
4742 {
4743 mDrawable->updateXform(TRUE);
4744 gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_ALL, TRUE);
4745 }
4746 clearChanged(SHIFTED);
4747}
diff --git a/linden/indra/newview/llviewerobject.h b/linden/indra/newview/llviewerobject.h
index a439a01..7176d24 100644
--- a/linden/indra/newview/llviewerobject.h
+++ b/linden/indra/newview/llviewerobject.h
@@ -37,6 +37,7 @@
37#include "llhudicon.h" 37#include "llhudicon.h"
38#include "llinventory.h" 38#include "llinventory.h"
39#include "llmemory.h" 39#include "llmemory.h"
40#include "llmemtype.h"
40#include "llprimitive.h" 41#include "llprimitive.h"
41#include "lluuid.h" 42#include "lluuid.h"
42#include "llvoinventorylistener.h" 43#include "llvoinventorylistener.h"
@@ -44,6 +45,7 @@
44#include "llquaternion.h" 45#include "llquaternion.h"
45#include "v3dmath.h" 46#include "v3dmath.h"
46#include "v3math.h" 47#include "v3math.h"
48#include "llvertexbuffer.h"
47 49
48class LLAgent; // TODO: Get rid of this. 50class LLAgent; // TODO: Get rid of this.
49class LLAudioSource; 51class LLAudioSource;
@@ -187,6 +189,7 @@ public:
187 189
188 virtual LLDrawable* createDrawable(LLPipeline *pipeline); 190 virtual LLDrawable* createDrawable(LLPipeline *pipeline);
189 virtual BOOL updateGeometry(LLDrawable *drawable); 191 virtual BOOL updateGeometry(LLDrawable *drawable);
192 virtual void updateFaceSize(S32 idx);
190 virtual BOOL updateLOD(); 193 virtual BOOL updateLOD();
191 virtual BOOL setDrawableParent(LLDrawable* parentp); 194 virtual BOOL setDrawableParent(LLDrawable* parentp);
192 virtual BOOL updateLighting(BOOL do_lighting) { return TRUE; }; 195 virtual BOOL updateLighting(BOOL do_lighting) { return TRUE; };
@@ -203,7 +206,7 @@ public:
203 LLViewerRegion* getRegion() const { return mRegionp; } 206 LLViewerRegion* getRegion() const { return mRegionp; }
204 207
205 BOOL isSelected() const { return mUserSelected; } 208 BOOL isSelected() const { return mUserSelected; }
206 void setSelected(BOOL sel) { mUserSelected = sel; mRotTime = 0.f;} 209 virtual void setSelected(BOOL sel) { mUserSelected = sel; mRotTime = 0.f;}
207 210
208 const LLUUID &getID() const { return mID; } 211 const LLUUID &getID() const { return mID; }
209 U32 getLocalID() const { return mLocalID; } 212 U32 getLocalID() const { return mLocalID; }
@@ -293,8 +296,6 @@ public:
293 /*virtual*/ BOOL setMaterial(const U8 material); 296 /*virtual*/ BOOL setMaterial(const U8 material);
294 virtual void setTEImage(const U8 te, LLViewerImage *imagep); // Not derived from LLPrimitive 297 virtual void setTEImage(const U8 te, LLViewerImage *imagep); // Not derived from LLPrimitive
295 LLViewerImage *getTEImage(const U8 te) const; 298 LLViewerImage *getTEImage(const U8 te) const;
296
297 S32 getFaceIndexOffset() { return mFaceIndexOffset; }
298 299
299 void fitFaceTexture(const U8 face); 300 void fitFaceTexture(const U8 face);
300 void sendTEUpdate() const; // Sends packed representation of all texture entry information 301 void sendTEUpdate() const; // Sends packed representation of all texture entry information
@@ -307,6 +308,8 @@ public:
307 U8 getState() { return mState; } 308 U8 getState() { return mState; }
308 309
309 F32 getAppAngle() const { return mAppAngle; } 310 F32 getAppAngle() const { return mAppAngle; }
311 F32 getPixelArea() const { return mPixelArea; }
312 void setPixelArea(F32 area) { mPixelArea = area; }
310 F32 getMaxScale() const; 313 F32 getMaxScale() const;
311 F32 getMidScale() const; 314 F32 getMidScale() const;
312 F32 getMinScale() const; 315 F32 getMinScale() const;
@@ -339,6 +342,7 @@ public:
339 void markForUpdate(BOOL priority); 342 void markForUpdate(BOOL priority);
340 void updateVolume(const LLVolumeParams& volume_params); 343 void updateVolume(const LLVolumeParams& volume_params);
341 virtual void updateSpatialExtents(LLVector3& min, LLVector3& max); 344 virtual void updateSpatialExtents(LLVector3& min, LLVector3& max);
345 virtual F32 getBinRadius();
342 346
343 LLBBox getBoundingBoxAgent() const; 347 LLBBox getBoundingBoxAgent() const;
344 348
@@ -378,6 +382,11 @@ public:
378 LLViewerInventoryItem* getInventoryItemByAsset(const LLUUID& asset_id); 382 LLViewerInventoryItem* getInventoryItemByAsset(const LLUUID& asset_id);
379 S16 getInventorySerial() const { return mInventorySerialNum; } 383 S16 getInventorySerial() const { return mInventorySerialNum; }
380 384
385 // These functions does viewer-side only object inventory modifications
386 void updateViewerInventoryAsset(
387 const LLViewerInventoryItem* item,
388 const LLUUID& new_asset);
389
381 // This function will make sure that we refresh the inventory. 390 // This function will make sure that we refresh the inventory.
382 void dirtyInventory(); 391 void dirtyInventory();
383 BOOL isInventoryDirty() { return mInventoryDirty; } 392 BOOL isInventoryDirty() { return mInventoryDirty; }
@@ -436,6 +445,7 @@ public:
436 void printNameValuePairs() const; 445 void printNameValuePairs() const;
437 446
438 virtual S32 getLOD() const { return 3; } 447 virtual S32 getLOD() const { return 3; }
448 virtual U32 getPartitionType() const;
439 449
440 virtual LLNetworkData* getParameterEntry(U16 param_type) const; 450 virtual LLNetworkData* getParameterEntry(U16 param_type) const;
441 virtual bool setParameterEntry(U16 param_type, const LLNetworkData& new_value, bool local_origin); 451 virtual bool setParameterEntry(U16 param_type, const LLNetworkData& new_value, bool local_origin);
@@ -536,6 +546,7 @@ protected:
536 546
537 void unpackParticleSource(const S32 block_num, const LLUUID& owner_id); 547 void unpackParticleSource(const S32 block_num, const LLUUID& owner_id);
538 void unpackParticleSource(LLDataPacker &dp, const LLUUID& owner_id); 548 void unpackParticleSource(LLDataPacker &dp, const LLUUID& owner_id);
549 void deleteParticleSource();
539 550
540private: 551private:
541 void setNameValueList(const std::string& list); // clears nv pairs and then individually adds \n separated NV pairs from \0 terminated string 552 void setNameValueList(const std::string& list); // clears nv pairs and then individually adds \n separated NV pairs from \0 terminated string
@@ -547,7 +558,7 @@ protected:
547 558
548 F64 mLastInterpUpdateSecs; // Last update for purposes of interpolation 559 F64 mLastInterpUpdateSecs; // Last update for purposes of interpolation
549 F64 mLastMessageUpdateSecs; // Last update from a message from the simulator 560 F64 mLastMessageUpdateSecs; // Last update from a message from the simulator
550 561 TPACKETID mLatestRecvPacketID; // Latest time stamp on message from simulator
551 // extra data sent from the sim...currently only used for tree species info 562 // extra data sent from the sim...currently only used for tree species info
552 U8* mData; 563 U8* mData;
553 564
@@ -578,7 +589,6 @@ protected:
578 BOOL mOnActiveList; 589 BOOL mOnActiveList;
579 BOOL mOnMap; // On the map. 590 BOOL mOnMap; // On the map.
580 BOOL mStatic; // Object doesn't move. 591 BOOL mStatic; // Object doesn't move.
581 S32 mFaceIndexOffset; // offset into drawable's faces, zero except in special cases
582 S32 mNumFaces; 592 S32 mNumFaces;
583 593
584 S32 mLastUpdateFrame; // frames in which an object had last moved for smart coalescing of drawables 594 S32 mLastUpdateFrame; // frames in which an object had last moved for smart coalescing of drawables
@@ -611,7 +621,6 @@ private:
611 static S32 sNumObjects; 621 static S32 sNumObjects;
612}; 622};
613 623
614
615/////////////////// 624///////////////////
616// 625//
617// Inlines 626// Inlines
@@ -642,4 +651,34 @@ public:
642 U8 mMediaType; // see LLTextureEntry::WEB_PAGE, etc. 651 U8 mMediaType; // see LLTextureEntry::WEB_PAGE, etc.
643}; 652};
644 653
654// subclass of viewer object that can be added to particle partitions
655class LLAlphaObject : public LLViewerObject
656{
657public:
658 LLAlphaObject(const LLUUID &id, const LLPCode type, LLViewerRegion *regionp)
659 : LLViewerObject(id,type,regionp)
660 { mDepth = 0.f; }
661
662 virtual BOOL isParticle();
663 virtual F32 getPartSize(S32 idx);
664 virtual void getGeometry(S32 idx,
665 LLStrider<LLVector3>& verticesp,
666 LLStrider<LLVector3>& normalsp,
667 LLStrider<LLVector2>& texcoordsp,
668 LLStrider<LLColor4U>& colorsp,
669 LLStrider<U32>& indicesp) = 0;
670
671 F32 mDepth;
672};
673
674class LLStaticViewerObject : public LLViewerObject
675{
676public:
677 LLStaticViewerObject(const LLUUID& id, const LLPCode type, LLViewerRegion* regionp)
678 : LLViewerObject(id,type,regionp)
679 { }
680
681 virtual void updateDrawable(BOOL force_damped);
682};
683
645#endif 684#endif
diff --git a/linden/indra/newview/llviewerobjectlist.cpp b/linden/indra/newview/llviewerobjectlist.cpp
index 49f2aae..8c15906 100644
--- a/linden/indra/newview/llviewerobjectlist.cpp
+++ b/linden/indra/newview/llviewerobjectlist.cpp
@@ -230,7 +230,7 @@ void LLViewerObjectList::processUpdateCore(LLViewerObject* objectp,
230 && update_type != OUT_TERSE_IMPROVED 230 && update_type != OUT_TERSE_IMPROVED
231 && objectp->mCreateSelected) 231 && objectp->mCreateSelected)
232 { 232 {
233 if ( gToolMgr->getCurrentTool( gKeyboard->currentMask(TRUE) ) != gToolPie ) 233 if ( gToolMgr->getCurrentTool() != gToolPie )
234 { 234 {
235 //llinfos << "DEBUG selecting " << objectp->mID << " " 235 //llinfos << "DEBUG selecting " << objectp->mID << " "
236 // << objectp->mLocalID << llendl; 236 // << objectp->mLocalID << llendl;
@@ -584,7 +584,8 @@ void LLViewerObjectList::updateApparentAngles(LLAgent &agent)
584 } 584 }
585 585
586 // Selected 586 // Selected
587 for (objectp = gSelectMgr->getFirstRootObject(); objectp; objectp = gSelectMgr->getNextRootObject()) 587 LLObjectSelectionHandle selection = gSelectMgr->getSelection();
588 for (objectp = selection->getFirstRootObject(); objectp; objectp = selection->getNextRootObject())
588 { 589 {
589 objectp->boostTexturePriority(); 590 objectp->boostTexturePriority();
590 } 591 }
@@ -749,6 +750,15 @@ void LLViewerObjectList::update(LLAgent &agent, LLWorld &world)
749 mNumVisCulledStat.addValue(mNumVisCulled); 750 mNumVisCulledStat.addValue(mNumVisCulled);
750} 751}
751 752
753void LLViewerObjectList::clearDebugText()
754{
755 for (S32 i = 0; i < mObjects.count(); i++)
756 {
757 mObjects[i]->setDebugText("");
758 }
759}
760
761
752void LLViewerObjectList::cleanupReferences(LLViewerObject *objectp) 762void LLViewerObjectList::cleanupReferences(LLViewerObject *objectp)
753{ 763{
754 LLMemType mt(LLMemType::MTYPE_OBJECT); 764 LLMemType mt(LLMemType::MTYPE_OBJECT);
@@ -1070,7 +1080,15 @@ U32 LLViewerObjectList::renderObjectsForSelect(LLCamera &camera, BOOL pick_parce
1070 mSelectPickList.clear(); 1080 mSelectPickList.clear();
1071 1081
1072 std::vector<LLDrawable*> pick_drawables; 1082 std::vector<LLDrawable*> pick_drawables;
1073 gPipeline.mObjectPartition->cull(camera, &pick_drawables, TRUE); 1083
1084 for (i = 0; i < LLPipeline::NUM_PARTITIONS-1; i++)
1085 {
1086 LLSpatialPartition* part = gPipeline.getSpatialPartition(i);
1087 if (part)
1088 {
1089 part->cull(camera, &pick_drawables, TRUE);
1090 }
1091 }
1074 1092
1075 for (std::vector<LLDrawable*>::iterator iter = pick_drawables.begin(); 1093 for (std::vector<LLDrawable*>::iterator iter = pick_drawables.begin();
1076 iter != pick_drawables.end(); iter++) 1094 iter != pick_drawables.end(); iter++)
@@ -1092,10 +1110,10 @@ U32 LLViewerObjectList::renderObjectsForSelect(LLCamera &camera, BOOL pick_parce
1092 1110
1093 LLHUDText::addPickable(mSelectPickList); 1111 LLHUDText::addPickable(mSelectPickList);
1094 1112
1095 for (objectp = (LLVOAvatar*)LLCharacter::sInstances.getFirstData(); 1113 for (std::vector<LLCharacter*>::iterator iter = LLCharacter::sInstances.begin();
1096 objectp; 1114 iter != LLCharacter::sInstances.end(); ++iter)
1097 objectp = (LLVOAvatar*)LLCharacter::sInstances.getNextData())
1098 { 1115 {
1116 objectp = (LLVOAvatar*) *iter;
1099 if (!objectp->isDead()) 1117 if (!objectp->isDead())
1100 { 1118 {
1101 if (objectp->mDrawable.notNull() && objectp->mDrawable->isVisible()) 1119 if (objectp->mDrawable.notNull() && objectp->mDrawable->isVisible())
@@ -1116,7 +1134,7 @@ U32 LLViewerObjectList::renderObjectsForSelect(LLCamera &camera, BOOL pick_parce
1116 { 1134 {
1117 if (attachmentp->getIsHUDAttachment()) 1135 if (attachmentp->getIsHUDAttachment())
1118 { 1136 {
1119 LLViewerObject* objectp = attachmentp->getObject(0); 1137 LLViewerObject* objectp = attachmentp->getObject();
1120 if (objectp) 1138 if (objectp)
1121 { 1139 {
1122 mSelectPickList.insert(objectp); 1140 mSelectPickList.insert(objectp);
@@ -1132,32 +1150,36 @@ U32 LLViewerObjectList::renderObjectsForSelect(LLCamera &camera, BOOL pick_parce
1132 } 1150 }
1133 } 1151 }
1134 } 1152 }
1135 1153
1136 S32 num_pickables = (S32)mSelectPickList.size() + LLHUDIcon::getNumInstances(); 1154 S32 num_pickables = (S32)mSelectPickList.size() + LLHUDIcon::getNumInstances();
1137 1155
1138 S32 step = (0x000fffff - GL_NAME_INDEX_OFFSET) / num_pickables; 1156 if (num_pickables != 0)
1139
1140 std::set<LLViewerObject*>::iterator pick_it;
1141 i = 0;
1142 for (pick_it = mSelectPickList.begin(); pick_it != mSelectPickList.end();)
1143 { 1157 {
1144 LLViewerObject* objp = (*pick_it); 1158 S32 step = (0x000fffff - GL_NAME_INDEX_OFFSET) / num_pickables;
1145 if (!objp || objp->isDead() || !objp->mbCanSelect) 1159
1160 std::set<LLViewerObject*>::iterator pick_it;
1161 i = 0;
1162 for (pick_it = mSelectPickList.begin(); pick_it != mSelectPickList.end();)
1146 { 1163 {
1147 mSelectPickList.erase(pick_it++); 1164 LLViewerObject* objp = (*pick_it);
1148 continue; 1165 if (!objp || objp->isDead() || !objp->mbCanSelect)
1166 {
1167 mSelectPickList.erase(pick_it++);
1168 continue;
1169 }
1170
1171 objp->mGLName = (i * step) + GL_NAME_INDEX_OFFSET;
1172 i++;
1173 ++pick_it;
1149 } 1174 }
1150 1175
1151 objp->mGLName = (i * step) + GL_NAME_INDEX_OFFSET; 1176 LLHUDIcon::generatePickIDs(i * step, step);
1152 i++; 1177
1153 ++pick_it; 1178 // At this point, we should only have live drawables/viewer objects
1179 gPipeline.renderForSelect(mSelectPickList);
1154 } 1180 }
1155
1156 LLHUDIcon::generatePickIDs(i * step, step);
1157 } 1181 }
1158 1182
1159 // At this point, we should only have live drawables/viewer objects
1160 gPipeline.renderForSelect();
1161 // 1183 //
1162 // Render pass for selected objects 1184 // Render pass for selected objects
1163 // 1185 //
@@ -1214,7 +1236,7 @@ LLViewerObject *LLViewerObjectList::createObjectViewer(const LLPCode pcode, LLVi
1214 LLViewerObject *objectp = LLViewerObject::createObject(fullid, pcode, regionp); 1236 LLViewerObject *objectp = LLViewerObject::createObject(fullid, pcode, regionp);
1215 if (!objectp) 1237 if (!objectp)
1216 { 1238 {
1217 llwarns << "Couldn't create object of type " << LLPrimitive::pCodeToString(pcode) << llendl; 1239// llwarns << "Couldn't create object of type " << LLPrimitive::pCodeToString(pcode) << llendl;
1218 return NULL; 1240 return NULL;
1219 } 1241 }
1220 1242
@@ -1248,7 +1270,7 @@ LLViewerObject *LLViewerObjectList::createObject(const LLPCode pcode, LLViewerRe
1248 LLViewerObject *objectp = LLViewerObject::createObject(fullid, pcode, regionp); 1270 LLViewerObject *objectp = LLViewerObject::createObject(fullid, pcode, regionp);
1249 if (!objectp) 1271 if (!objectp)
1250 { 1272 {
1251 llwarns << "Couldn't create object of type " << LLPrimitive::pCodeToString(pcode) << " id:" << fullid << llendl; 1273// llwarns << "Couldn't create object of type " << LLPrimitive::pCodeToString(pcode) << " id:" << fullid << llendl;
1252 return NULL; 1274 return NULL;
1253 } 1275 }
1254 1276
@@ -1440,7 +1462,7 @@ void LLViewerObjectList::findOrphans(LLViewerObject* objectp, U32 ip, U32 port)
1440 1462
1441 if (orphans_found && objectp->isSelected()) 1463 if (orphans_found && objectp->isSelected())
1442 { 1464 {
1443 LLSelectNode* nodep = gSelectMgr->findSelectNode(objectp); 1465 LLSelectNode* nodep = gSelectMgr->getSelection()->findNode(objectp);
1444 if (nodep && !nodep->mIndividualSelection) 1466 if (nodep && !nodep->mIndividualSelection)
1445 { 1467 {
1446 // rebuild selection with orphans 1468 // rebuild selection with orphans
@@ -1450,6 +1472,7 @@ void LLViewerObjectList::findOrphans(LLViewerObject* objectp, U32 ip, U32 port)
1450 } 1472 }
1451} 1473}
1452 1474
1475////////////////////////////////////////////////////////////////////////////
1453 1476
1454LLViewerObjectList::OrphanInfo::OrphanInfo() 1477LLViewerObjectList::OrphanInfo::OrphanInfo()
1455{ 1478{
diff --git a/linden/indra/newview/llviewerobjectlist.h b/linden/indra/newview/llviewerobjectlist.h
index 3122d9d..f92c989 100644
--- a/linden/indra/newview/llviewerobjectlist.h
+++ b/linden/indra/newview/llviewerobjectlist.h
@@ -115,6 +115,7 @@ public:
115 void addToMap(LLViewerObject *objectp); 115 void addToMap(LLViewerObject *objectp);
116 void removeFromMap(LLViewerObject *objectp); 116 void removeFromMap(LLViewerObject *objectp);
117 117
118 void clearDebugText();
118 119
119 //////////////////////////////////////////// 120 ////////////////////////////////////////////
120 // 121 //
diff --git a/linden/indra/newview/llviewerparcelmgr.cpp b/linden/indra/newview/llviewerparcelmgr.cpp
index af910e8..a21d2f7 100644
--- a/linden/indra/newview/llviewerparcelmgr.cpp
+++ b/linden/indra/newview/llviewerparcelmgr.cpp
@@ -65,6 +65,7 @@
65 65
66const F32 PARCEL_COLLISION_DRAW_SECS = 1.f; 66const F32 PARCEL_COLLISION_DRAW_SECS = 1.f;
67 67
68
68// Globals 69// Globals
69LLViewerParcelMgr *gParcelMgr = NULL; 70LLViewerParcelMgr *gParcelMgr = NULL;
70 71
@@ -72,6 +73,12 @@ U8* LLViewerParcelMgr::sPackedOverlay = NULL;
72 73
73LLUUID gCurrentMovieID = LLUUID::null; 74LLUUID gCurrentMovieID = LLUUID::null;
74 75
76static LLParcelSelection* get_null_parcel_selection();
77template<>
78 const LLHandle<LLParcelSelection>::NullFunc
79 LLHandle<LLParcelSelection>::sNullFunc = get_null_parcel_selection;
80
81
75// Local functions 82// Local functions
76void optionally_start_music(const LLString& music_url); 83void optionally_start_music(const LLString& music_url);
77void callback_start_music(S32 option, void* data); 84void callback_start_music(S32 option, void* data);
@@ -102,8 +109,6 @@ struct LLGodForceOwnerData
102// 109//
103LLViewerParcelMgr::LLViewerParcelMgr() 110LLViewerParcelMgr::LLViewerParcelMgr()
104: mSelected(FALSE), 111: mSelected(FALSE),
105 mSelectedMultipleOwners(FALSE),
106 mWholeParcelSelected(FALSE),
107 mWestSouth(), 112 mWestSouth(),
108 mEastNorth(), 113 mEastNorth(),
109 mSelectedDwell(0.f), 114 mSelectedDwell(0.f),
@@ -113,11 +118,12 @@ LLViewerParcelMgr::LLViewerParcelMgr()
113 mRenderCollision(FALSE), 118 mRenderCollision(FALSE),
114 mRenderSelection(TRUE), 119 mRenderSelection(TRUE),
115 mCollisionBanned(0), 120 mCollisionBanned(0),
116 mCollisionTimer(), 121 mCollisionTimer()
117 mMediaParcelId(0),
118 mMediaRegionId(0)
119{ 122{
120 mParcel = new LLParcel(); 123 mCurrentParcel = new LLParcel();
124 mCurrentParcelSelection = new LLParcelSelection(mCurrentParcel);
125 mFloatingParcelSelection = new LLParcelSelection(mCurrentParcel);
126
121 mAgentParcel = new LLParcel(); 127 mAgentParcel = new LLParcel();
122 mHoverParcel = new LLParcel(); 128 mHoverParcel = new LLParcel();
123 mCollisionParcel = new LLParcel(); 129 mCollisionParcel = new LLParcel();
@@ -149,8 +155,14 @@ LLViewerParcelMgr::LLViewerParcelMgr()
149 155
150LLViewerParcelMgr::~LLViewerParcelMgr() 156LLViewerParcelMgr::~LLViewerParcelMgr()
151{ 157{
152 delete mParcel; 158 mCurrentParcelSelection->setParcel(NULL);
153 mParcel = NULL; 159 mCurrentParcelSelection = NULL;
160
161 mFloatingParcelSelection->setParcel(NULL);
162 mFloatingParcelSelection = NULL;
163
164 delete mCurrentParcel;
165 mCurrentParcel = NULL;
154 166
155 delete mAgentParcel; 167 delete mAgentParcel;
156 mAgentParcel = NULL; 168 mAgentParcel = NULL;
@@ -175,32 +187,17 @@ LLViewerParcelMgr::~LLViewerParcelMgr()
175 mAgentParcelOverlay = NULL; 187 mAgentParcelOverlay = NULL;
176} 188}
177 189
178
179void LLViewerParcelMgr::destroyGL()
180{
181 mBlockedImage = NULL;
182 mPassImage = NULL;
183}
184
185
186void LLViewerParcelMgr::restoreGL()
187{
188 mBlockedImage = gImageList.getImage(mBlockedImageID, TRUE, TRUE);
189 mPassImage = gImageList.getImage(mPassImageID, TRUE, TRUE);
190}
191
192
193void LLViewerParcelMgr::dump() 190void LLViewerParcelMgr::dump()
194{ 191{
195 llinfos << "Parcel Manager Dump" << llendl; 192 llinfos << "Parcel Manager Dump" << llendl;
196 llinfos << "mSelected " << S32(mSelected) << llendl; 193 llinfos << "mSelected " << S32(mSelected) << llendl;
197 llinfos << "Selected parcel: " << llendl; 194 llinfos << "Selected parcel: " << llendl;
198 llinfos << mWestSouth << " to " << mEastNorth << llendl; 195 llinfos << mWestSouth << " to " << mEastNorth << llendl;
199 mParcel->dump(); 196 mCurrentParcel->dump();
200 llinfos << "banning " << mParcel->mBanList.size() << llendl; 197 llinfos << "banning " << mCurrentParcel->mBanList.size() << llendl;
201 198
202 access_map_const_iterator cit = mParcel->mBanList.begin(); 199 access_map_const_iterator cit = mCurrentParcel->mBanList.begin();
203 access_map_const_iterator end = mParcel->mBanList.end(); 200 access_map_const_iterator end = mCurrentParcel->mBanList.end();
204 for ( ; cit != end; ++cit) 201 for ( ; cit != end; ++cit)
205 { 202 {
206 llinfos << "ban id " << (*cit).first << llendl; 203 llinfos << "ban id " << (*cit).first << llendl;
@@ -233,27 +230,27 @@ void LLViewerParcelMgr::getDisplayInfo(S32* area_out, S32* claim_out,
233 230
234 if (mSelected) 231 if (mSelected)
235 { 232 {
236 if (mSelectedMultipleOwners) 233 if (mCurrentParcelSelection->mSelectedMultipleOwners)
237 { 234 {
238 area = getClaimableArea(); 235 area = mCurrentParcelSelection->getClaimableArea();
239 } 236 }
240 else 237 else
241 { 238 {
242 area = getSelectedArea(); 239 area = getSelectedArea();
243 } 240 }
244 241
245 if (mParcel->getForSale()) 242 if (mCurrentParcel->getForSale())
246 { 243 {
247 price = mParcel->getSalePrice(); 244 price = mCurrentParcel->getSalePrice();
248 for_sale = TRUE; 245 for_sale = TRUE;
249 } 246 }
250 else 247 else
251 { 248 {
252 price = area * mParcel->getClaimPricePerMeter(); 249 price = area * mCurrentParcel->getClaimPricePerMeter();
253 for_sale = FALSE; 250 for_sale = FALSE;
254 } 251 }
255 252
256 rent = mParcel->getTotalRent(); 253 rent = mCurrentParcel->getTotalRent();
257 254
258 dwell = mSelectedDwell; 255 dwell = mSelectedDwell;
259 } 256 }
@@ -267,51 +264,27 @@ void LLViewerParcelMgr::getDisplayInfo(S32* area_out, S32* claim_out,
267 264
268void LLViewerParcelMgr::getPrimInfo(S32 &sw_max, S32 &sw_total, S32 &max, S32 &total, S32 &owner, S32 &group, S32 &other, S32& selected, F32 &parcel_object_bonus, S32 &other_clean) 265void LLViewerParcelMgr::getPrimInfo(S32 &sw_max, S32 &sw_total, S32 &max, S32 &total, S32 &owner, S32 &group, S32 &other, S32& selected, F32 &parcel_object_bonus, S32 &other_clean)
269{ 266{
270 if (mSelected && mParcel) 267 if (mSelected && mCurrentParcel)
271 { 268 {
272 sw_max = mParcel->getSimWideMaxPrimCapacity(); 269 sw_max = mCurrentParcel->getSimWideMaxPrimCapacity();
273 sw_total = mParcel->getSimWidePrimCount(); 270 sw_total = mCurrentParcel->getSimWidePrimCount();
274 max = llround(mParcel->getMaxPrimCapacity()*mParcel->getParcelPrimBonus()); 271 max = llround(mCurrentParcel->getMaxPrimCapacity()*mCurrentParcel->getParcelPrimBonus());
275 total = mParcel->getPrimCount(); 272 total = mCurrentParcel->getPrimCount();
276 owner = mParcel->getOwnerPrimCount(); 273 owner = mCurrentParcel->getOwnerPrimCount();
277 group = mParcel->getGroupPrimCount(); 274 group = mCurrentParcel->getGroupPrimCount();
278 other = mParcel->getOtherPrimCount(); 275 other = mCurrentParcel->getOtherPrimCount();
279 selected = mParcel->getSelectedPrimCount(); 276 selected = mCurrentParcel->getSelectedPrimCount();
280 parcel_object_bonus = mParcel->getParcelPrimBonus(); 277 parcel_object_bonus = mCurrentParcel->getParcelPrimBonus();
281 other_clean = mParcel->getCleanOtherTime(); 278 other_clean = mCurrentParcel->getCleanOtherTime();
282 } 279 }
283} 280}
284 281
285BOOL LLViewerParcelMgr::getMultipleOwners() const
286{
287 return mSelectedMultipleOwners;
288}
289
290
291BOOL LLViewerParcelMgr::getWholeParcelSelected() const
292{
293 return mWholeParcelSelected;
294}
295
296
297S32 LLViewerParcelMgr::getClaimableArea() const
298{
299 const S32 UNIT_AREA = S32( PARCEL_GRID_STEP_METERS * PARCEL_GRID_STEP_METERS );
300 return mSelectedPublicCount * UNIT_AREA;
301}
302
303bool LLViewerParcelMgr::hasOthersSelected() const
304{
305 return mSelectedOtherCount != 0;
306}
307
308
309S32 LLViewerParcelMgr::getSelectedArea() const 282S32 LLViewerParcelMgr::getSelectedArea() const
310{ 283{
311 S32 rv = 0; 284 S32 rv = 0;
312 if(mSelected && mParcel && mWholeParcelSelected) 285 if(mSelected && mCurrentParcel && mCurrentParcelSelection->mWholeParcelSelected)
313 { 286 {
314 rv = mParcel->getArea(); 287 rv = mCurrentParcel->getArea();
315 } 288 }
316 else if(mSelected) 289 else if(mSelected)
317 { 290 {
@@ -447,7 +420,7 @@ void LLViewerParcelMgr::writeAgentParcelFromBitmap(U8* bitmap)
447 420
448// Given a point, find the PARCEL_GRID_STEP x PARCEL_GRID_STEP block 421// Given a point, find the PARCEL_GRID_STEP x PARCEL_GRID_STEP block
449// containing it and select that. 422// containing it and select that.
450void LLViewerParcelMgr::selectParcelAt(const LLVector3d& pos_global) 423LLParcelSelectionHandle LLViewerParcelMgr::selectParcelAt(const LLVector3d& pos_global)
451{ 424{
452 LLVector3d southwest = pos_global; 425 LLVector3d southwest = pos_global;
453 LLVector3d northeast = pos_global; 426 LLVector3d northeast = pos_global;
@@ -461,14 +434,14 @@ void LLViewerParcelMgr::selectParcelAt(const LLVector3d& pos_global)
461 northeast.mdV[VY] = llround( northeast.mdV[VY], (F64)PARCEL_GRID_STEP_METERS ); 434 northeast.mdV[VY] = llround( northeast.mdV[VY], (F64)PARCEL_GRID_STEP_METERS );
462 435
463 // Snap to parcel 436 // Snap to parcel
464 selectLand( southwest, northeast, TRUE ); 437 return selectLand( southwest, northeast, TRUE );
465} 438}
466 439
467 440
468// Tries to select the parcel inside the rectangle 441// Tries to select the parcel inside the rectangle
469void LLViewerParcelMgr::selectParcelInRectangle() 442LLParcelSelectionHandle LLViewerParcelMgr::selectParcelInRectangle()
470{ 443{
471 selectLand(mWestSouth, mEastNorth, TRUE); 444 return selectLand(mWestSouth, mEastNorth, TRUE);
472} 445}
473 446
474 447
@@ -498,28 +471,32 @@ void LLViewerParcelMgr::selectCollisionParcel()
498 mRequestResult = PARCEL_RESULT_NO_DATA; 471 mRequestResult = PARCEL_RESULT_NO_DATA;
499 472
500 // Hack: Copy some data over temporarily 473 // Hack: Copy some data over temporarily
501 mParcel->setName( mCollisionParcel->getName() ); 474 mCurrentParcel->setName( mCollisionParcel->getName() );
502 mParcel->setDesc( mCollisionParcel->getDesc() ); 475 mCurrentParcel->setDesc( mCollisionParcel->getDesc() );
503 mParcel->setPassPrice(mCollisionParcel->getPassPrice()); 476 mCurrentParcel->setPassPrice(mCollisionParcel->getPassPrice());
504 mParcel->setPassHours(mCollisionParcel->getPassHours()); 477 mCurrentParcel->setPassHours(mCollisionParcel->getPassHours());
505 478
506 // clear the list of segments to prevent flashing 479 // clear the list of segments to prevent flashing
507 resetSegments(mHighlightSegments); 480 resetSegments(mHighlightSegments);
508 481
482 mFloatingParcelSelection->setParcel(mCurrentParcel);
483 mCurrentParcelSelection->setParcel(NULL);
484 mCurrentParcelSelection = new LLParcelSelection(mCurrentParcel);
485
509 mSelected = TRUE; 486 mSelected = TRUE;
510 mWholeParcelSelected = TRUE; 487 mCurrentParcelSelection->mWholeParcelSelected = TRUE;
511 notifyObservers(); 488 notifyObservers();
512 return; 489 return;
513} 490}
514 491
515 492
516// snap_selection = auto-select the hit parcel, if there is exactly one 493// snap_selection = auto-select the hit parcel, if there is exactly one
517void LLViewerParcelMgr::selectLand(const LLVector3d &corner1, const LLVector3d &corner2, 494LLParcelSelectionHandle LLViewerParcelMgr::selectLand(const LLVector3d &corner1, const LLVector3d &corner2,
518 BOOL snap_selection) 495 BOOL snap_selection)
519{ 496{
520 if (!gWorldp) 497 if (!gWorldp)
521 { 498 {
522 return; 499 return NULL;
523 } 500 }
524 501
525 sanitize_corners( corner1, corner2, mWestSouth, mEastNorth ); 502 sanitize_corners( corner1, corner2, mWestSouth, mEastNorth );
@@ -530,7 +507,7 @@ void LLViewerParcelMgr::selectLand(const LLVector3d &corner1, const LLVector3d &
530 { 507 {
531 mSelected = FALSE; 508 mSelected = FALSE;
532 notifyObservers(); 509 notifyObservers();
533 return; 510 return NULL;
534 } 511 }
535 512
536 // ...y isn't more than one meter away 513 // ...y isn't more than one meter away
@@ -539,7 +516,7 @@ void LLViewerParcelMgr::selectLand(const LLVector3d &corner1, const LLVector3d &
539 { 516 {
540 mSelected = FALSE; 517 mSelected = FALSE;
541 notifyObservers(); 518 notifyObservers();
542 return; 519 return NULL;
543 } 520 }
544 521
545 // Can't select across region boundary 522 // Can't select across region boundary
@@ -556,7 +533,7 @@ void LLViewerParcelMgr::selectLand(const LLVector3d &corner1, const LLVector3d &
556 { 533 {
557 // just in case they somehow selected no land. 534 // just in case they somehow selected no land.
558 mSelected = FALSE; 535 mSelected = FALSE;
559 return; 536 return NULL;
560 } 537 }
561 538
562 if (region != region_other) 539 if (region != region_other)
@@ -564,50 +541,13 @@ void LLViewerParcelMgr::selectLand(const LLVector3d &corner1, const LLVector3d &
564 LLNotifyBox::showXml("CantSelectLandFromMultipleRegions"); 541 LLNotifyBox::showXml("CantSelectLandFromMultipleRegions");
565 mSelected = FALSE; 542 mSelected = FALSE;
566 notifyObservers(); 543 notifyObservers();
567 return; 544 return NULL;
568 } 545 }
569 546
570 // Build region global copies of corners 547 // Build region global copies of corners
571 LLVector3 wsb_region = region->getPosRegionFromGlobal( mWestSouth ); 548 LLVector3 wsb_region = region->getPosRegionFromGlobal( mWestSouth );
572 LLVector3 ent_region = region->getPosRegionFromGlobal( mEastNorth ); 549 LLVector3 ent_region = region->getPosRegionFromGlobal( mEastNorth );
573 550
574 /*
575 // Check land to make sure all is either public, owned, or self
576 LLViewerParcelOverlay* overlay = region->getParcelOverlay();
577 if (!overlay)
578 {
579 llerrs << "No overlay in LLViewerParcelMgr::selectLand" << llendl;
580 return;
581 }
582
583 U8 start_ownership = overlay->ownership( wsb_region );
584 BOOL identical = TRUE;
585 S32 x_steps = S32( getSelectionWidth() / PARCEL_GRID_STEP_METERS );
586 S32 y_steps = S32( getSelectionHeight() / PARCEL_GRID_STEP_METERS );
587
588 for (S32 x = 0; x < x_steps && identical; x++ )
589 {
590 for (S32 y = 0; y < y_steps && identical; y++ )
591 {
592 // strange recomputation each time to avoid error accumulation
593 LLVector3 check = wsb_region;
594 check.mV[VX] += x * PARCEL_GRID_STEP_METERS;
595 check.mV[VY] += y * PARCEL_GRID_STEP_METERS;
596
597 identical = (start_ownership == overlay->ownership(check));
598 }
599 }
600
601 if (!identical)
602 {
603 add_chat("Can't select mix of your own, other people's and public land.", FALSE, "", FALSE, CHAT_SOURCE_SYSTEM);
604 add_chat("Try selecting a smaller piece of land.", FALSE, "", FALSE, CHAT_SOURCE_SYSTEM);
605 mSelected = FALSE;
606 notifyObservers();
607 return;
608 }
609 */
610
611 // Send request message 551 // Send request message
612 LLMessageSystem *msg = gMessageSystem; 552 LLMessageSystem *msg = gMessageSystem;
613 msg->newMessageFast(_PREHASH_ParcelPropertiesRequest); 553 msg->newMessageFast(_PREHASH_ParcelPropertiesRequest);
@@ -628,12 +568,24 @@ void LLViewerParcelMgr::selectLand(const LLVector3d &corner1, const LLVector3d &
628 // clear the list of segments to prevent flashing 568 // clear the list of segments to prevent flashing
629 resetSegments(mHighlightSegments); 569 resetSegments(mHighlightSegments);
630 570
571 mFloatingParcelSelection->setParcel(mCurrentParcel);
572 mCurrentParcelSelection->setParcel(NULL);
573 mCurrentParcelSelection = new LLParcelSelection(mCurrentParcel);
574
631 mSelected = TRUE; 575 mSelected = TRUE;
632 mWholeParcelSelected = snap_selection; 576 mCurrentParcelSelection->mWholeParcelSelected = snap_selection;
633 notifyObservers(); 577 notifyObservers();
634 return; 578 return mCurrentParcelSelection;
635} 579}
636 580
581void LLViewerParcelMgr::deselectUnused()
582{
583 // no more outstanding references to this selection, other than our own
584 if (mCurrentParcelSelection->getNumRefs() == 1 && mFloatingParcelSelection->getNumRefs() == 1)
585 {
586 deselectLand();
587 }
588}
637 589
638void LLViewerParcelMgr::deselectLand() 590void LLViewerParcelMgr::deselectLand()
639{ 591{
@@ -642,14 +594,20 @@ void LLViewerParcelMgr::deselectLand()
642 mSelected = FALSE; 594 mSelected = FALSE;
643 595
644 // Invalidate the selected parcel 596 // Invalidate the selected parcel
645 mParcel->setLocalID(-1); 597 mCurrentParcel->setLocalID(-1);
646 mParcel->mAccessList.clear(); 598 mCurrentParcel->mAccessList.clear();
647 mParcel->mBanList.clear(); 599 mCurrentParcel->mBanList.clear();
648 //mParcel->mRenterList.reset(); 600 //mCurrentParcel->mRenterList.reset();
649 601
650 mSelectedDwell = 0.f; 602 mSelectedDwell = 0.f;
651 603
652 notifyObservers(); 604 notifyObservers();
605
606 // invalidate parcel selection so that existing users of this selection can clean up
607 mCurrentParcelSelection->setParcel(NULL);
608 mFloatingParcelSelection->setParcel(NULL);
609 // create new parcel selection
610 mCurrentParcelSelection = new LLParcelSelection(mCurrentParcel);
653 } 611 }
654} 612}
655 613
@@ -694,18 +652,15 @@ BOOL LLViewerParcelMgr::selectionEmpty() const
694} 652}
695 653
696 654
697LLParcel *LLViewerParcelMgr::getSelectedParcel() const 655LLParcelSelectionHandle LLViewerParcelMgr::getParcelSelection() const
698{ 656{
699 if (mSelected) 657 return mCurrentParcelSelection;
700 {
701 return mParcel;
702 }
703 else
704 {
705 return NULL;
706 }
707} 658}
708 659
660LLParcelSelectionHandle LLViewerParcelMgr::getFloatingParcelSelection() const
661{
662 return mFloatingParcelSelection;
663}
709 664
710LLParcel *LLViewerParcelMgr::getAgentParcel() const 665LLParcel *LLViewerParcelMgr::getAgentParcel() const
711{ 666{
@@ -717,9 +672,10 @@ BOOL LLViewerParcelMgr::agentCanBuild() const
717{ 672{
718 if (mAgentParcel) 673 if (mAgentParcel)
719 { 674 {
720 return gAgent.isGodlike() 675 return (gAgent.isGodlike()
721 || (mAgentParcel->getOwnerID() == gAgent.getID()) 676 || (mAgentParcel->allowModifyBy(
722 || (mAgentParcel->getAllowModify()); 677 gAgent.getID(),
678 gAgent.getGroupID())));
723 } 679 }
724 else 680 else
725 { 681 {
@@ -923,11 +879,11 @@ void LLViewerParcelMgr::sendParcelAccessListRequest(U32 flags)
923 879
924 if (flags & AL_BAN) 880 if (flags & AL_BAN)
925 { 881 {
926 mParcel->mBanList.clear(); 882 mCurrentParcel->mBanList.clear();
927 } 883 }
928 if (flags & AL_ACCESS) 884 if (flags & AL_ACCESS)
929 { 885 {
930 mParcel->mAccessList.clear(); 886 mCurrentParcel->mAccessList.clear();
931 } 887 }
932 888
933 // Only the headers differ 889 // Only the headers differ
@@ -938,7 +894,7 @@ void LLViewerParcelMgr::sendParcelAccessListRequest(U32 flags)
938 msg->nextBlockFast(_PREHASH_Data); 894 msg->nextBlockFast(_PREHASH_Data);
939 msg->addS32Fast(_PREHASH_SequenceID, 0); 895 msg->addS32Fast(_PREHASH_SequenceID, 0);
940 msg->addU32Fast(_PREHASH_Flags, flags); 896 msg->addU32Fast(_PREHASH_Flags, flags);
941 msg->addS32("LocalID", mParcel->getLocalID() ); 897 msg->addS32("LocalID", mCurrentParcel->getLocalID() );
942 msg->sendReliable( region->getHost() ); 898 msg->sendReliable( region->getHost() );
943} 899}
944 900
@@ -961,7 +917,7 @@ void LLViewerParcelMgr::sendParcelDwellRequest()
961 msg->addUUID("AgentID", gAgent.getID() ); 917 msg->addUUID("AgentID", gAgent.getID() );
962 msg->addUUID("SessionID", gAgent.getSessionID()); 918 msg->addUUID("SessionID", gAgent.getSessionID());
963 msg->nextBlock("Data"); 919 msg->nextBlock("Data");
964 msg->addS32("LocalID", mParcel->getLocalID()); 920 msg->addS32("LocalID", mCurrentParcel->getLocalID());
965 msg->addUUID("ParcelID", LLUUID::null); // filled in on simulator 921 msg->addUUID("ParcelID", LLUUID::null); // filled in on simulator
966 msg->sendReliable( region->getHost() ); 922 msg->sendReliable( region->getHost() );
967} 923}
@@ -1000,8 +956,8 @@ void LLViewerParcelMgr::sendParcelGodForceOwner(const LLUUID& owner_id)
1000 956
1001 llinfos << "Region " << region->getOriginGlobal() << llendl; 957 llinfos << "Region " << region->getOriginGlobal() << llendl;
1002 958
1003 LLGodForceOwnerData* data = new LLGodForceOwnerData(owner_id, mParcel->getLocalID(), region->getHost()); 959 LLGodForceOwnerData* data = new LLGodForceOwnerData(owner_id, mCurrentParcel->getLocalID(), region->getHost());
1004 if(mParcel->getAuctionID()) 960 if(mCurrentParcel->getAuctionID())
1005 { 961 {
1006 gViewerWindow->alertXml("ForceOwnerAuctionWarning", 962 gViewerWindow->alertXml("ForceOwnerAuctionWarning",
1007 callback_god_force_owner, 963 callback_god_force_owner,
@@ -1051,7 +1007,7 @@ void LLViewerParcelMgr::sendParcelGodForceToContent()
1051 msg->addUUID("AgentID", gAgent.getID()); 1007 msg->addUUID("AgentID", gAgent.getID());
1052 msg->addUUID("SessionID", gAgent.getSessionID()); 1008 msg->addUUID("SessionID", gAgent.getSessionID());
1053 msg->nextBlock("ParcelData"); 1009 msg->nextBlock("ParcelData");
1054 msg->addS32("LocalID", mParcel->getLocalID()); 1010 msg->addS32("LocalID", mCurrentParcel->getLocalID());
1055 msg->sendReliable(region->getHost()); 1011 msg->sendReliable(region->getHost());
1056} 1012}
1057 1013
@@ -1079,7 +1035,7 @@ void LLViewerParcelMgr::sendParcelRelease()
1079 msg->addUUID("AgentID", gAgent.getID() ); 1035 msg->addUUID("AgentID", gAgent.getID() );
1080 msg->addUUID("SessionID", gAgent.getSessionID() ); 1036 msg->addUUID("SessionID", gAgent.getSessionID() );
1081 msg->nextBlock("Data"); 1037 msg->nextBlock("Data");
1082 msg->addS32("LocalID", mParcel->getLocalID() ); 1038 msg->addS32("LocalID", mCurrentParcel->getLocalID() );
1083 //msg->addU32("Flags", flags); 1039 //msg->addU32("Flags", flags);
1084 msg->sendReliable( region->getHost() ); 1040 msg->sendReliable( region->getHost() );
1085 1041
@@ -1117,7 +1073,7 @@ LLViewerParcelMgr::ParcelBuyInfo* LLViewerParcelMgr::setupParcelBuy(
1117 BOOL is_claim, 1073 BOOL is_claim,
1118 BOOL remove_contribution) 1074 BOOL remove_contribution)
1119{ 1075{
1120 if (!mSelected || !mParcel) 1076 if (!mSelected || !mCurrentParcel)
1121 { 1077 {
1122 gViewerWindow->alertXml("CannotBuyLandNothingSelected"); 1078 gViewerWindow->alertXml("CannotBuyLandNothingSelected");
1123 return NULL; 1079 return NULL;
@@ -1162,7 +1118,7 @@ LLViewerParcelMgr::ParcelBuyInfo* LLViewerParcelMgr::setupParcelBuy(
1162 1118
1163 if (!is_claim) 1119 if (!is_claim)
1164 { 1120 {
1165 info->mParcelID = mParcel->getLocalID(); 1121 info->mParcelID = mCurrentParcel->getLocalID();
1166 } 1122 }
1167 else 1123 else
1168 { 1124 {
@@ -1215,7 +1171,7 @@ void LLViewerParcelMgr::deleteParcelBuy(ParcelBuyInfo*& info)
1215 1171
1216void LLViewerParcelMgr::sendParcelDeed(const LLUUID& group_id) 1172void LLViewerParcelMgr::sendParcelDeed(const LLUUID& group_id)
1217{ 1173{
1218 if (!mSelected || !mParcel) 1174 if (!mSelected || !mCurrentParcel)
1219 { 1175 {
1220 gViewerWindow->alertXml("CannotDeedLandNothingSelected"); 1176 gViewerWindow->alertXml("CannotDeedLandNothingSelected");
1221 return; 1177 return;
@@ -1239,7 +1195,7 @@ void LLViewerParcelMgr::sendParcelDeed(const LLUUID& group_id)
1239 msg->addUUID("SessionID", gAgent.getSessionID() ); 1195 msg->addUUID("SessionID", gAgent.getSessionID() );
1240 msg->nextBlock("Data"); 1196 msg->nextBlock("Data");
1241 msg->addUUID("GroupID", group_id ); 1197 msg->addUUID("GroupID", group_id );
1242 msg->addS32("LocalID", mParcel->getLocalID() ); 1198 msg->addS32("LocalID", mCurrentParcel->getLocalID() );
1243 //msg->addU32("JoinNeighbors", join); 1199 //msg->addU32("JoinNeighbors", join);
1244 msg->sendReliable( region->getHost() ); 1200 msg->sendReliable( region->getHost() );
1245} 1201}
@@ -1253,7 +1209,7 @@ void LLViewerParcelMgr::sendParcelDeed(const LLUUID& group_id)
1253void LLViewerParcelMgr::makeLandmarkAtSelection() 1209void LLViewerParcelMgr::makeLandmarkAtSelection()
1254{ 1210{
1255 // Don't create for parcels you don't own 1211 // Don't create for parcels you don't own
1256 if (gAgent.getID() != mParcel->getOwnerID()) 1212 if (gAgent.getID() != mCurrentParcel->getOwnerID())
1257 { 1213 {
1258 return; 1214 return;
1259 } 1215 }
@@ -1289,7 +1245,7 @@ const char* LLViewerParcelMgr::getAgentParcelName() const
1289} 1245}
1290 1246
1291 1247
1292void LLViewerParcelMgr::sendParcelPropertiesUpdate(LLParcel* parcel, BOOL want_reply_to_update) 1248void LLViewerParcelMgr::sendParcelPropertiesUpdate(LLParcel* parcel)
1293{ 1249{
1294 if (!parcel) return; 1250 if (!parcel) return;
1295 1251
@@ -1306,7 +1262,8 @@ void LLViewerParcelMgr::sendParcelPropertiesUpdate(LLParcel* parcel, BOOL want_r
1306 msg->addS32Fast(_PREHASH_LocalID, parcel->getLocalID() ); 1262 msg->addS32Fast(_PREHASH_LocalID, parcel->getLocalID() );
1307 1263
1308 U32 flags = 0x0; 1264 U32 flags = 0x0;
1309 if (want_reply_to_update) flags |= 0x01; 1265 // request new properties update from simulator
1266 flags |= 0x01;
1310 msg->addU32("Flags", flags); 1267 msg->addU32("Flags", flags);
1311 1268
1312 parcel->packMessage(msg); 1269 parcel->packMessage(msg);
@@ -1450,7 +1407,7 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use
1450 { 1407 {
1451 // ...selected parcels report this sequence id 1408 // ...selected parcels report this sequence id
1452 gParcelMgr->mRequestResult = PARCEL_RESULT_SUCCESS; 1409 gParcelMgr->mRequestResult = PARCEL_RESULT_SUCCESS;
1453 parcel = gParcelMgr->mParcel; 1410 parcel = gParcelMgr->mCurrentParcel;
1454 } 1411 }
1455 else if (sequence_id == HOVERED_PARCEL_SEQ_ID) 1412 else if (sequence_id == HOVERED_PARCEL_SEQ_ID)
1456 { 1413 {
@@ -1559,11 +1516,11 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use
1559 if (sequence_id == SELECTED_PARCEL_SEQ_ID) 1516 if (sequence_id == SELECTED_PARCEL_SEQ_ID)
1560 { 1517 {
1561 // Update selected counts 1518 // Update selected counts
1562 gParcelMgr->mSelectedSelfCount = self_count; 1519 gParcelMgr->mCurrentParcelSelection->mSelectedSelfCount = self_count;
1563 gParcelMgr->mSelectedOtherCount = other_count; 1520 gParcelMgr->mCurrentParcelSelection->mSelectedOtherCount = other_count;
1564 gParcelMgr->mSelectedPublicCount = public_count; 1521 gParcelMgr->mCurrentParcelSelection->mSelectedPublicCount = public_count;
1565 1522
1566 gParcelMgr->mSelectedMultipleOwners = 1523 gParcelMgr->mCurrentParcelSelection->mSelectedMultipleOwners =
1567 (request_result == PARCEL_RESULT_MULTIPLE); 1524 (request_result == PARCEL_RESULT_MULTIPLE);
1568 1525
1569 // Select the whole parcel 1526 // Select the whole parcel
@@ -1583,7 +1540,7 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use
1583 west_south.mV[VY], 1540 west_south.mV[VY],
1584 east_north.mV[VX], 1541 east_north.mV[VX],
1585 east_north.mV[VY] ); 1542 east_north.mV[VY] );
1586 gParcelMgr->mWholeParcelSelected = FALSE; 1543 gParcelMgr->mCurrentParcelSelection->mWholeParcelSelected = FALSE;
1587 } 1544 }
1588 else if (0 == local_id) 1545 else if (0 == local_id)
1589 { 1546 {
@@ -1597,7 +1554,7 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use
1597 aabb_min.mV[VY], 1554 aabb_min.mV[VY],
1598 aabb_max.mV[VX], 1555 aabb_max.mV[VX],
1599 aabb_max.mV[VY] ); 1556 aabb_max.mV[VY] );
1600 gParcelMgr->mWholeParcelSelected = TRUE; 1557 gParcelMgr->mCurrentParcelSelection->mWholeParcelSelected = TRUE;
1601 } 1558 }
1602 else 1559 else
1603 { 1560 {
@@ -1614,10 +1571,10 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use
1614 gParcelMgr->resetSegments(gParcelMgr->mHighlightSegments); 1571 gParcelMgr->resetSegments(gParcelMgr->mHighlightSegments);
1615 gParcelMgr->writeSegmentsFromBitmap( bitmap, gParcelMgr->mHighlightSegments ); 1572 gParcelMgr->writeSegmentsFromBitmap( bitmap, gParcelMgr->mHighlightSegments );
1616 1573
1617 delete bitmap; 1574 delete[] bitmap;
1618 bitmap = NULL; 1575 bitmap = NULL;
1619 1576
1620 gParcelMgr->mWholeParcelSelected = TRUE; 1577 gParcelMgr->mCurrentParcelSelection->mWholeParcelSelected = TRUE;
1621 } 1578 }
1622 1579
1623 // Request access list information for this land 1580 // Request access list information for this land
@@ -1666,7 +1623,7 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use
1666 gParcelMgr->resetSegments(gParcelMgr->mCollisionSegments); 1623 gParcelMgr->resetSegments(gParcelMgr->mCollisionSegments);
1667 gParcelMgr->writeSegmentsFromBitmap( bitmap, gParcelMgr->mCollisionSegments ); 1624 gParcelMgr->writeSegmentsFromBitmap( bitmap, gParcelMgr->mCollisionSegments );
1668 1625
1669 delete bitmap; 1626 delete[] bitmap;
1670 bitmap = NULL; 1627 bitmap = NULL;
1671 1628
1672 } 1629 }
@@ -1815,10 +1772,10 @@ void optionally_start_music(const LLString& music_url)
1815{ 1772{
1816 if (gSavedSettings.getWarning("FirstStreamingMusic")) 1773 if (gSavedSettings.getWarning("FirstStreamingMusic"))
1817 { 1774 {
1818 void* data = (void*)strdup(music_url.c_str()); 1775 std::string* newstring = new std::string(music_url);
1819 gViewerWindow->alertXml("ParcelCanPlayMusic", 1776 gViewerWindow->alertXml("ParcelCanPlayMusic",
1820 callback_start_music, 1777 callback_start_music,
1821 (void*)data); 1778 (void*)newstring);
1822 1779
1823 } 1780 }
1824 else if (gSavedSettings.getBOOL("AudioStreamingMusic")) 1781 else if (gSavedSettings.getBOOL("AudioStreamingMusic"))
@@ -1841,7 +1798,7 @@ void optionally_start_music(const LLString& music_url)
1841 1798
1842void callback_start_music(S32 option, void* data) 1799void callback_start_music(S32 option, void* data)
1843{ 1800{
1844 const char* music_url = (const char*)data; 1801 std::string* music_url = (std::string*)data;
1845 1802
1846 if (0 == option) 1803 if (0 == option)
1847 { 1804 {
@@ -1849,7 +1806,7 @@ void callback_start_music(S32 option, void* data)
1849 llinfos << "Starting first parcel music " << music_url << llendl; 1806 llinfos << "Starting first parcel music " << music_url << llendl;
1850 if (gAudiop) 1807 if (gAudiop)
1851 { 1808 {
1852 gAudiop->startInternetStream(music_url); 1809 gAudiop->startInternetStream(music_url->c_str());
1853 LLMediaRemoteCtrl* ctrl = gOverlayBar->getMusicRemoteControl(); 1810 LLMediaRemoteCtrl* ctrl = gOverlayBar->getMusicRemoteControl();
1854 ctrl->setTransportState( LLMediaRemoteCtrl::Play, FALSE ); 1811 ctrl->setTransportState( LLMediaRemoteCtrl::Play, FALSE );
1855 } 1812 }
@@ -1861,7 +1818,7 @@ void callback_start_music(S32 option, void* data)
1861 1818
1862 gSavedSettings.setWarning("FirstStreamingMusic", FALSE); 1819 gSavedSettings.setWarning("FirstStreamingMusic", FALSE);
1863 1820
1864 delete [] music_url; 1821 delete music_url;
1865 music_url = NULL; 1822 music_url = NULL;
1866} 1823}
1867 1824
@@ -1962,7 +1919,7 @@ void LLViewerParcelMgr::processParcelAccessListReply(LLMessageSystem *msg, void
1962 msg->getU32Fast( _PREHASH_Data, _PREHASH_Flags, message_flags); 1919 msg->getU32Fast( _PREHASH_Data, _PREHASH_Flags, message_flags);
1963 msg->getS32Fast( _PREHASH_Data, _PREHASH_LocalID, parcel_id); 1920 msg->getS32Fast( _PREHASH_Data, _PREHASH_LocalID, parcel_id);
1964 1921
1965 LLParcel* parcel = gParcelMgr->mParcel; 1922 LLParcel* parcel = gParcelMgr->mCurrentParcel;
1966 if (!parcel) return; 1923 if (!parcel) return;
1967 1924
1968 if (parcel_id != parcel->getLocalID()) 1925 if (parcel_id != parcel->getLocalID())
@@ -2004,7 +1961,7 @@ void LLViewerParcelMgr::processParcelDwellReply(LLMessageSystem* msg, void**)
2004 F32 dwell; 1961 F32 dwell;
2005 msg->getF32("Data", "Dwell", dwell); 1962 msg->getF32("Data", "Dwell", dwell);
2006 1963
2007 if (local_id == gParcelMgr->mParcel->getLocalID()) 1964 if (local_id == gParcelMgr->mCurrentParcel->getLocalID())
2008 { 1965 {
2009 gParcelMgr->mSelectedDwell = dwell; 1966 gParcelMgr->mSelectedDwell = dwell;
2010 gParcelMgr->notifyObservers(); 1967 gParcelMgr->notifyObservers();
@@ -2028,7 +1985,7 @@ void LLViewerParcelMgr::sendParcelAccessListUpdate(U32 which)
2028 1985
2029 LLMessageSystem* msg = gMessageSystem; 1986 LLMessageSystem* msg = gMessageSystem;
2030 1987
2031 LLParcel* parcel = mParcel; 1988 LLParcel* parcel = mCurrentParcel;
2032 if (!parcel) return; 1989 if (!parcel) return;
2033 1990
2034 if (which & AL_ACCESS) 1991 if (which & AL_ACCESS)
@@ -2148,18 +2105,18 @@ void LLViewerParcelMgr::sendParcelAccessListUpdate(U32 which)
2148 2105
2149void LLViewerParcelMgr::deedLandToGroup() 2106void LLViewerParcelMgr::deedLandToGroup()
2150{ 2107{
2151 char group_name[MAX_STRING]; 2108 char group_name[MAX_STRING]; /* Flawfinder: ignore */
2152 gCacheName->getGroupName(mParcel->getGroupID(), group_name); 2109 gCacheName->getGroupName(mCurrentParcel->getGroupID(), group_name);
2153 LLString::format_map_t args; 2110 LLString::format_map_t args;
2154 args["[AREA]"] = llformat("%d", mParcel->getArea()); 2111 args["[AREA]"] = llformat("%d", mCurrentParcel->getArea());
2155 args["[GROUP_NAME]"] = group_name; 2112 args["[GROUP_NAME]"] = group_name;
2156 if(mParcel->getContributeWithDeed()) 2113 if(mCurrentParcel->getContributeWithDeed())
2157 { 2114 {
2158 char first_name[DB_FIRST_NAME_BUF_SIZE]; 2115 char first_name[DB_FIRST_NAME_BUF_SIZE]; /* Flawfinder: ignore */
2159 first_name[0] = '\0'; 2116 first_name[0] = '\0';
2160 char last_name[DB_FIRST_NAME_BUF_SIZE]; 2117 char last_name[DB_FIRST_NAME_BUF_SIZE]; /* Flawfinder: ignore */
2161 last_name[0] = '\0'; 2118 last_name[0] = '\0';
2162 gCacheName->getName(mParcel->getOwnerID(), first_name, last_name); 2119 gCacheName->getName(mCurrentParcel->getOwnerID(), first_name, last_name);
2163 args["[FIRST_NAME]"] = first_name; 2120 args["[FIRST_NAME]"] = first_name;
2164 args["[LAST_NAME]"] = last_name; 2121 args["[LAST_NAME]"] = last_name;
2165 gViewerWindow->alertXml("DeedLandToGroupWithContribution",args, deedAlertCB, NULL); 2122 gViewerWindow->alertXml("DeedLandToGroupWithContribution",args, deedAlertCB, NULL);
@@ -2175,7 +2132,7 @@ void LLViewerParcelMgr::deedAlertCB(S32 option, void*)
2175{ 2132{
2176 if (option == 0) 2133 if (option == 0)
2177 { 2134 {
2178 LLParcel* parcel = gParcelMgr->getSelectedParcel(); 2135 LLParcel* parcel = gParcelMgr->getParcelSelection()->getParcel();
2179 LLUUID group_id; 2136 LLUUID group_id;
2180 if(parcel) 2137 if(parcel)
2181 { 2138 {
@@ -2206,7 +2163,7 @@ void LLViewerParcelMgr::startReleaseLand()
2206 return; 2163 return;
2207 } 2164 }
2208 2165
2209 if (!isParcelOwnedByAgent(mParcel, GP_LAND_RELEASE) 2166 if (!isParcelOwnedByAgent(mCurrentParcel, GP_LAND_RELEASE)
2210 && !(gAgent.canManageEstate())) 2167 && !(gAgent.canManageEstate()))
2211 { 2168 {
2212 gViewerWindow->alertXml("CannotReleaseLandDontOwn"); 2169 gViewerWindow->alertXml("CannotReleaseLandDontOwn");
@@ -2231,7 +2188,7 @@ void LLViewerParcelMgr::startReleaseLand()
2231 } 2188 }
2232*/ 2189*/
2233 2190
2234 if (!mWholeParcelSelected) 2191 if (!mCurrentParcelSelection->mWholeParcelSelected)
2235 { 2192 {
2236 gViewerWindow->alertXml("CannotReleaseLandPartialSelection"); 2193 gViewerWindow->alertXml("CannotReleaseLandPartialSelection");
2237 return; 2194 return;
@@ -2239,7 +2196,7 @@ void LLViewerParcelMgr::startReleaseLand()
2239 2196
2240 // Compute claim price 2197 // Compute claim price
2241 LLStringBase<char>::format_map_t args; 2198 LLStringBase<char>::format_map_t args;
2242 args["[AREA]"] = llformat("%d",mParcel->getArea()); 2199 args["[AREA]"] = llformat("%d",mCurrentParcel->getArea());
2243 gViewerWindow->alertXml("ReleaseLandWarning", args, 2200 gViewerWindow->alertXml("ReleaseLandWarning", args,
2244 releaseAlertCB, this); 2201 releaseAlertCB, this);
2245} 2202}
@@ -2251,7 +2208,7 @@ bool LLViewerParcelMgr::canAgentBuyParcel(LLParcel* parcel, bool forGroup) const
2251 return false; 2208 return false;
2252 } 2209 }
2253 2210
2254 if (mSelected && parcel == mParcel) 2211 if (mSelected && parcel == mCurrentParcel)
2255 { 2212 {
2256 if (mRequestResult == PARCEL_RESULT_NO_DATA) 2213 if (mRequestResult == PARCEL_RESULT_NO_DATA)
2257 { 2214 {
@@ -2291,12 +2248,12 @@ bool LLViewerParcelMgr::canAgentBuyParcel(LLParcel* parcel, bool forGroup) const
2291 2248
2292void LLViewerParcelMgr::startBuyLand(BOOL is_for_group) 2249void LLViewerParcelMgr::startBuyLand(BOOL is_for_group)
2293{ 2250{
2294 LLFloaterBuyLand::buyLand(getSelectionRegion(), mParcel, is_for_group == TRUE); 2251 LLFloaterBuyLand::buyLand(getSelectionRegion(), mCurrentParcelSelection, is_for_group == TRUE);
2295} 2252}
2296 2253
2297void LLViewerParcelMgr::startSellLand() 2254void LLViewerParcelMgr::startSellLand()
2298{ 2255{
2299 LLFloaterSellLand::sellLand(getSelectionRegion(), mParcel); 2256 LLFloaterSellLand::sellLand(getSelectionRegion(), mCurrentParcelSelection);
2300} 2257}
2301 2258
2302void LLViewerParcelMgr::startDivideLand() 2259void LLViewerParcelMgr::startDivideLand()
@@ -2307,7 +2264,7 @@ void LLViewerParcelMgr::startDivideLand()
2307 return; 2264 return;
2308 } 2265 }
2309 2266
2310 if (mWholeParcelSelected) 2267 if (mCurrentParcelSelection->mWholeParcelSelected)
2311 { 2268 {
2312 gViewerWindow->alertXml("CannotDivideLandPartialSelection"); 2269 gViewerWindow->alertXml("CannotDivideLandPartialSelection");
2313 return; 2270 return;
@@ -2359,13 +2316,13 @@ void LLViewerParcelMgr::startJoinLand()
2359 return; 2316 return;
2360 } 2317 }
2361 2318
2362 if (mWholeParcelSelected) 2319 if (mCurrentParcelSelection->mWholeParcelSelected)
2363 { 2320 {
2364 gViewerWindow->alertXml("CannotJoinLandEntireParcelSelected"); 2321 gViewerWindow->alertXml("CannotJoinLandEntireParcelSelected");
2365 return; 2322 return;
2366 } 2323 }
2367 2324
2368 if (!mSelectedMultipleOwners) 2325 if (!mCurrentParcelSelection->mSelectedMultipleOwners)
2369 { 2326 {
2370 gViewerWindow->alertXml("CannotJoinLandSelection"); 2327 gViewerWindow->alertXml("CannotJoinLandSelection");
2371 return; 2328 return;
@@ -2411,7 +2368,7 @@ void LLViewerParcelMgr::callbackJoinLand(S32 option, void* data)
2411 2368
2412void LLViewerParcelMgr::startDeedLandToGroup() 2369void LLViewerParcelMgr::startDeedLandToGroup()
2413{ 2370{
2414 if (!mSelected || !mParcel) 2371 if (!mSelected || !mCurrentParcel)
2415 { 2372 {
2416 gViewerWindow->alertXml("CannotDeedLandNothingSelected"); 2373 gViewerWindow->alertXml("CannotDeedLandNothingSelected");
2417 return; 2374 return;
@@ -2441,7 +2398,7 @@ void LLViewerParcelMgr::startDeedLandToGroup()
2441 if(!gAgent.isGodlike()) 2398 if(!gAgent.isGodlike())
2442 { 2399 {
2443 if((region->getRegionFlags() & REGION_FLAGS_BLOCK_LAND_RESELL) 2400 if((region->getRegionFlags() & REGION_FLAGS_BLOCK_LAND_RESELL)
2444 && (mParcel->getOwnerID() != region->getOwner())) 2401 && (mCurrentParcel->getOwnerID() != region->getOwner()))
2445 { 2402 {
2446 LLStringBase<char>::format_map_t args; 2403 LLStringBase<char>::format_map_t args;
2447 args["[REGION]"] = region->getName(); 2404 args["[REGION]"] = region->getName();
@@ -2455,7 +2412,7 @@ void LLViewerParcelMgr::startDeedLandToGroup()
2455} 2412}
2456void LLViewerParcelMgr::reclaimParcel() 2413void LLViewerParcelMgr::reclaimParcel()
2457{ 2414{
2458 LLParcel* parcel = gParcelMgr->getSelectedParcel(); 2415 LLParcel* parcel = gParcelMgr->getParcelSelection()->getParcel();
2459 LLViewerRegion* regionp = gParcelMgr->getSelectionRegion(); 2416 LLViewerRegion* regionp = gParcelMgr->getSelectionRegion();
2460 if(parcel && parcel->getOwnerID().notNull() 2417 if(parcel && parcel->getOwnerID().notNull()
2461 && (parcel->getOwnerID() != gAgent.getID()) 2418 && (parcel->getOwnerID() != gAgent.getID())
@@ -2484,7 +2441,7 @@ void LLViewerParcelMgr::releaseAlertCB(S32 option, void *)
2484 2441
2485void LLViewerParcelMgr::buyPass() 2442void LLViewerParcelMgr::buyPass()
2486{ 2443{
2487 LLParcel* parcel = getSelectedParcel(); 2444 LLParcel* parcel = getParcelSelection()->getParcel();
2488 if (!parcel) return; 2445 if (!parcel) return;
2489 2446
2490 LLViewerRegion* region = getSelectionRegion(); 2447 LLViewerRegion* region = getSelectionRegion();
@@ -2578,3 +2535,58 @@ void sanitize_corners(const LLVector3d &corner1,
2578 east_north_top.mdV[VZ] = llmax( corner1.mdV[VZ], corner2.mdV[VZ] ); 2535 east_north_top.mdV[VZ] = llmax( corner1.mdV[VZ], corner2.mdV[VZ] );
2579} 2536}
2580 2537
2538//
2539// LLParcelSelection
2540//
2541LLParcelSelection::LLParcelSelection() :
2542 mParcel(NULL),
2543 mSelectedMultipleOwners(FALSE),
2544 mWholeParcelSelected(FALSE),
2545 mSelectedSelfCount(0),
2546 mSelectedOtherCount(0),
2547 mSelectedPublicCount(0)
2548{
2549}
2550
2551LLParcelSelection::LLParcelSelection(LLParcel* parcel) :
2552 mParcel(parcel),
2553 mSelectedMultipleOwners(FALSE),
2554 mWholeParcelSelected(FALSE),
2555 mSelectedSelfCount(0),
2556 mSelectedOtherCount(0),
2557 mSelectedPublicCount(0)
2558{
2559}
2560
2561LLParcelSelection::~LLParcelSelection()
2562{
2563}
2564
2565BOOL LLParcelSelection::getMultipleOwners() const
2566{
2567 return mSelectedMultipleOwners;
2568}
2569
2570
2571BOOL LLParcelSelection::getWholeParcelSelected() const
2572{
2573 return mWholeParcelSelected;
2574}
2575
2576
2577S32 LLParcelSelection::getClaimableArea() const
2578{
2579 const S32 UNIT_AREA = S32( PARCEL_GRID_STEP_METERS * PARCEL_GRID_STEP_METERS );
2580 return mSelectedPublicCount * UNIT_AREA;
2581}
2582
2583bool LLParcelSelection::hasOthersSelected() const
2584{
2585 return mSelectedOtherCount != 0;
2586}
2587
2588LLParcelSelection* get_null_parcel_selection()
2589{
2590 static LLParcelSelectionHandle null_ptr = new LLParcelSelection();
2591 return null_ptr;
2592}
diff --git a/linden/indra/newview/llviewerparcelmgr.h b/linden/indra/newview/llviewerparcelmgr.h
index 781ba15..c970611 100644
--- a/linden/indra/newview/llviewerparcelmgr.h
+++ b/linden/indra/newview/llviewerparcelmgr.h
@@ -68,15 +68,56 @@ public:
68 virtual void changed() = 0; 68 virtual void changed() = 0;
69}; 69};
70 70
71class LLParcelSelection : public LLRefCount
72{
73 friend class LLViewerParcelMgr;
74
75public:
76 LLParcelSelection(LLParcel* parcel);
77 LLParcelSelection();
78
79 ~LLParcelSelection();
80
81 // this can return NULL at any time, as parcel selection
82 // might have been invalidated.
83 LLParcel* getParcel() { return mParcel; }
84
85 // Return the number of grid units that are owned by you within
86 // the selection (computed by server).
87 S32 getSelfCount() const { return mSelectedSelfCount; }
88
89 // Returns area that will actually be claimed in meters squared.
90 S32 getClaimableArea() const;
91 bool hasOthersSelected() const;
92
93 // Does the selection have multiple land owners in it?
94 BOOL getMultipleOwners() const;
95
96 // Is the entire parcel selected, or just a part?
97 BOOL getWholeParcelSelected() const;
98
99protected:
100 void setParcel(LLParcel* parcel) { mParcel = parcel; }
101
102protected:
103
104 LLParcel* mParcel;
105 BOOL mSelectedMultipleOwners;
106 BOOL mWholeParcelSelected;
107 S32 mSelectedSelfCount;
108 S32 mSelectedOtherCount;
109 S32 mSelectedPublicCount;
110};
111
112typedef LLHandle<LLParcelSelection> LLParcelSelectionHandle;
113
71class LLViewerParcelMgr 114class LLViewerParcelMgr
72{ 115{
116
73public: 117public:
74 LLViewerParcelMgr(); 118 LLViewerParcelMgr();
75 ~LLViewerParcelMgr(); 119 ~LLViewerParcelMgr();
76 120
77 void destroyGL();
78 void restoreGL();
79
80 BOOL selectionEmpty() const; 121 BOOL selectionEmpty() const;
81 F32 getSelectionWidth() const { return F32(mEastNorth.mdV[VX] - mWestSouth.mdV[VX]); } 122 F32 getSelectionWidth() const { return F32(mEastNorth.mdV[VX] - mWestSouth.mdV[VX]); }
82 F32 getSelectionHeight() const { return F32(mEastNorth.mdV[VY] - mWestSouth.mdV[VY]); } 123 F32 getSelectionHeight() const { return F32(mEastNorth.mdV[VY] - mWestSouth.mdV[VY]); }
@@ -87,16 +128,6 @@ public:
87 128
88 void getPrimInfo(S32 &sw_max, S32 &sw_total, S32 &max, S32 &total, S32 &owner, S32 &group, S32 &other, S32& selected, F32 &parcel_object_bonus, S32 &other_clean); 129 void getPrimInfo(S32 &sw_max, S32 &sw_total, S32 &max, S32 &total, S32 &owner, S32 &group, S32 &other, S32& selected, F32 &parcel_object_bonus, S32 &other_clean);
89 130
90 // Does the selection have multiple land owners in it?
91 BOOL getMultipleOwners() const;
92
93 // Is the entire parcel selected, or just a part?
94 BOOL getWholeParcelSelected() const;
95
96 // Returns area that will actually be claimed in meters squared.
97 S32 getClaimableArea() const;
98 bool hasOthersSelected() const;
99
100 // Returns selected area 131 // Returns selected area
101 S32 getSelectedArea() const; 132 S32 getSelectedArea() const;
102 133
@@ -115,18 +146,19 @@ public:
115 void selectCollisionParcel(); 146 void selectCollisionParcel();
116 147
117 // Select the parcel at a specific point 148 // Select the parcel at a specific point
118 void selectParcelAt(const LLVector3d& pos_global); 149 LLHandle<LLParcelSelection> selectParcelAt(const LLVector3d& pos_global);
119 150
120 // Take the current rectangle select, and select the parcel contained 151 // Take the current rectangle select, and select the parcel contained
121 // within it. 152 // within it.
122 void selectParcelInRectangle(); 153 LLParcelSelectionHandle selectParcelInRectangle();
123 154
124 // Select a piece of land 155 // Select a piece of land
125 void selectLand(const LLVector3d &corner1, const LLVector3d &corner2, 156 LLParcelSelectionHandle selectLand(const LLVector3d &corner1, const LLVector3d &corner2,
126 BOOL snap_to_parcel); 157 BOOL snap_to_parcel);
127 158
128 // Clear the selection, and stop drawing the highlight. 159 // Clear the selection, and stop drawing the highlight.
129 void deselectLand(); 160 void deselectLand();
161 void deselectUnused();
130 162
131 void addObserver(LLParcelObserver* observer); 163 void addObserver(LLParcelObserver* observer);
132 void removeObserver(LLParcelObserver* observer); 164 void removeObserver(LLParcelObserver* observer);
@@ -141,15 +173,23 @@ public:
141 173
142 BOOL canHearSound(const LLVector3d &pos_global) const; 174 BOOL canHearSound(const LLVector3d &pos_global) const;
143 175
144 LLParcel *getSelectedParcel() const; 176 // Returns a reference counted pointer to current parcel selection.
177 // Selection does not change to reflect new selections made by user
178 // Use this when implementing a task UI that refers to a specific
179 // selection.
180 LLParcelSelectionHandle getParcelSelection() const;
181
182 // Returns a reference counted pointer to current parcel selection.
183 // Pointer tracks whatever the user has currently selected.
184 // Use this when implementing an inspector UI.
185 // http://en.wikipedia.org/wiki/Inspector_window
186 LLParcelSelectionHandle getFloatingParcelSelection() const;
187
188 //LLParcel *getParcelSelection() const;
145 LLParcel *getAgentParcel() const; 189 LLParcel *getAgentParcel() const;
146 190
147 BOOL inAgentParcel(const LLVector3d &pos_global) const; 191 BOOL inAgentParcel(const LLVector3d &pos_global) const;
148 192
149 // Return the number of grid units that are owned by you within
150 // the selection (computed by server).
151 S32 getSelfCount() const { return mSelectedSelfCount; }
152
153 // Returns a pointer only when it has valid data. 193 // Returns a pointer only when it has valid data.
154 LLParcel* getHoverParcel() const; 194 LLParcel* getHoverParcel() const;
155 195
@@ -191,7 +231,7 @@ public:
191 // containing the southwest corner of the selection. 231 // containing the southwest corner of the selection.
192 // If want_reply_to_update, simulator will send back a ParcelProperties 232 // If want_reply_to_update, simulator will send back a ParcelProperties
193 // message. 233 // message.
194 void sendParcelPropertiesUpdate(LLParcel* parcel, BOOL want_reply_to_update); 234 void sendParcelPropertiesUpdate(LLParcel* parcel);
195 235
196 // Takes an Access List flag, like AL_ACCESS or AL_BAN 236 // Takes an Access List flag, like AL_ACCESS or AL_BAN
197 void sendParcelAccessListUpdate(U32 which); 237 void sendParcelAccessListUpdate(U32 which);
@@ -284,26 +324,23 @@ protected:
284 //void finishClaim(BOOL user_to_user_sale, U32 join); 324 //void finishClaim(BOOL user_to_user_sale, U32 join);
285 325
286private: 326private:
287 BOOL mSelected; 327 BOOL mSelected;
288 BOOL mSelectedMultipleOwners;
289 BOOL mWholeParcelSelected;
290 S32 mSelectedSelfCount;
291 S32 mSelectedOtherCount;
292 S32 mSelectedPublicCount;
293 328
294 LLParcel *mParcel; // selected parcel info 329 LLParcel* mCurrentParcel; // selected parcel info
295 S32 mRequestResult; // result of last parcel request 330 LLParcelSelectionHandle mCurrentParcelSelection;
296 LLVector3d mWestSouth; 331 LLParcelSelectionHandle mFloatingParcelSelection;
297 LLVector3d mEastNorth; 332 S32 mRequestResult; // result of last parcel request
298 F32 mSelectedDwell; 333 LLVector3d mWestSouth;
334 LLVector3d mEastNorth;
335 F32 mSelectedDwell;
299 336
300 LLParcel *mAgentParcel; // info for parcel agent is in 337 LLParcel *mAgentParcel; // info for parcel agent is in
301 S32 mAgentParcelSequenceID; // incrementing counter to suppress out of order updates 338 S32 mAgentParcelSequenceID; // incrementing counter to suppress out of order updates
302 339
303 LLParcel* mHoverParcel; 340 LLParcel* mHoverParcel;
304 S32 mHoverRequestResult; 341 S32 mHoverRequestResult;
305 LLVector3d mHoverWestSouth; 342 LLVector3d mHoverWestSouth;
306 LLVector3d mHoverEastNorth; 343 LLVector3d mHoverEastNorth;
307 344
308 LLDynamicArray<LLParcelObserver*> mObservers; 345 LLDynamicArray<LLParcelObserver*> mObservers;
309 346
@@ -312,30 +349,30 @@ private:
312 // we can represent edges of the grid. 349 // we can represent edges of the grid.
313 // WEST_MASK = draw west edge 350 // WEST_MASK = draw west edge
314 // SOUTH_MASK = draw south edge 351 // SOUTH_MASK = draw south edge
315 S32 mParcelsPerEdge; 352 S32 mParcelsPerEdge;
316 U8* mHighlightSegments; 353 U8* mHighlightSegments;
317 U8* mAgentParcelOverlay; 354 U8* mAgentParcelOverlay;
318 355
319 // Raw data buffer for unpacking parcel overlay chunks 356 // Raw data buffer for unpacking parcel overlay chunks
320 // Size = parcels_per_edge * parcels_per_edge / parcel_overlay_chunks 357 // Size = parcels_per_edge * parcels_per_edge / parcel_overlay_chunks
321 static U8* sPackedOverlay; 358 static U8* sPackedOverlay;
322 359
323 // Watch for pending collisions with a parcel you can't access. 360 // Watch for pending collisions with a parcel you can't access.
324 // If it's coming, draw the parcel's boundaries. 361 // If it's coming, draw the parcel's boundaries.
325 LLParcel* mCollisionParcel; 362 LLParcel* mCollisionParcel;
326 U8* mCollisionSegments; 363 U8* mCollisionSegments;
327 BOOL mRenderCollision; 364 BOOL mRenderCollision;
328 BOOL mRenderSelection; 365 BOOL mRenderSelection;
329 S32 mCollisionBanned; 366 S32 mCollisionBanned;
330 LLFrameTimer mCollisionTimer; 367 LLFrameTimer mCollisionTimer;
331 LLUUID mBlockedImageID; 368 LLUUID mBlockedImageID;
332 LLUUID mPassImageID; 369 LLUUID mPassImageID;
333 LLPointer<LLViewerImage> mBlockedImage; 370 LLPointer<LLViewerImage> mBlockedImage;
334 LLPointer<LLViewerImage> mPassImage; 371 LLPointer<LLViewerImage> mPassImage;
335 372
336 // Media 373 // Media
337 S32 mMediaParcelId; 374 S32 mMediaParcelId;
338 U64 mMediaRegionId; 375 U64 mMediaRegionId;
339}; 376};
340 377
341extern LLViewerParcelMgr *gParcelMgr; 378extern LLViewerParcelMgr *gParcelMgr;
diff --git a/linden/indra/newview/llviewerparceloverlay.cpp b/linden/indra/newview/llviewerparceloverlay.cpp
index 91159f0..36a4449 100644
--- a/linden/indra/newview/llviewerparceloverlay.cpp
+++ b/linden/indra/newview/llviewerparceloverlay.cpp
@@ -293,7 +293,7 @@ void LLViewerParcelOverlay::uncompressLandOverlay(S32 chunk, U8 *packed_overlay)
293 S32 size = mParcelGridsPerEdge * mParcelGridsPerEdge; 293 S32 size = mParcelGridsPerEdge * mParcelGridsPerEdge;
294 S32 chunk_size = size / PARCEL_OVERLAY_CHUNKS; 294 S32 chunk_size = size / PARCEL_OVERLAY_CHUNKS;
295 295
296 memcpy(mOwnership + chunk*chunk_size, packed_overlay, chunk_size); 296 memcpy(mOwnership + chunk*chunk_size, packed_overlay, chunk_size); /*Flawfinder: ignore*/
297 297
298 // Force property lines and overlay texture to update 298 // Force property lines and overlay texture to update
299 setDirty(); 299 setDirty();
@@ -780,27 +780,6 @@ S32 LLViewerParcelOverlay::renderPropertyLines ()
780 const S32 GRID_STEP = S32( PARCEL_GRID_STEP_METERS ); 780 const S32 GRID_STEP = S32( PARCEL_GRID_STEP_METERS );
781 const S32 vertex_per_edge = 3 + 2 * (GRID_STEP-1) + 3; 781 const S32 vertex_per_edge = 3 + 2 * (GRID_STEP-1) + 3;
782 782
783 /* JC - Don't do this. Unbinding AGP stalls the draw process,
784 dropping frame rate. Not unbinding AGP causes random crashes
785 on nVidia cards due to binding non-AGP arrays.
786
787 gPipeline.unbindAGP();
788 glEnableClientState(GL_VERTEX_ARRAY);
789 glEnableClientState(GL_COLOR_ARRAY);
790 glVertexPointer(3, GL_FLOAT, 0, mVertexArray );
791 glColorPointer( 4, GL_UNSIGNED_BYTE, 0, mColorArray );
792
793 S32 i;
794 for (i = 0; i < mVertexCount; i += vertex_per_edge)
795 {
796 // Each edge is several vertices
797 glDrawArrays(GL_LINE_STRIP, i, vertex_per_edge);
798 }
799
800 glDisableClientState(GL_COLOR_ARRAY);
801 glDisableClientState(GL_VERTEX_ARRAY);
802 */
803
804 // Stomp the camera into two dimensions 783 // Stomp the camera into two dimensions
805 LLVector3 camera_region = mRegion->getPosRegionFromGlobal( gAgent.getCameraPositionGlobal() ); 784 LLVector3 camera_region = mRegion->getPosRegionFromGlobal( gAgent.getCameraPositionGlobal() );
806 785
diff --git a/linden/indra/newview/llviewerpartsim.cpp b/linden/indra/newview/llviewerpartsim.cpp
index be2c90f..2658e67 100644
--- a/linden/indra/newview/llviewerpartsim.cpp
+++ b/linden/indra/newview/llviewerpartsim.cpp
@@ -32,6 +32,7 @@
32#include "llviewercontrol.h" 32#include "llviewercontrol.h"
33 33
34#include "llagent.h" 34#include "llagent.h"
35#include "llviewercamera.h"
35#include "llviewerobjectlist.h" 36#include "llviewerobjectlist.h"
36#include "llviewerpartsource.h" 37#include "llviewerpartsource.h"
37#include "llviewerregion.h" 38#include "llviewerregion.h"
@@ -41,7 +42,7 @@
41 42
42const S32 MAX_PART_COUNT = 4096; 43const S32 MAX_PART_COUNT = 4096;
43 44
44const F32 PART_SIM_BOX_SIDE = 32.f; 45const F32 PART_SIM_BOX_SIDE = 16.f;
45const F32 PART_SIM_BOX_OFFSET = 0.5f*PART_SIM_BOX_SIDE; 46const F32 PART_SIM_BOX_OFFSET = 0.5f*PART_SIM_BOX_SIDE;
46const F32 PART_SIM_BOX_RAD = 0.5f*F_SQRT3*PART_SIM_BOX_SIDE; 47const F32 PART_SIM_BOX_RAD = 0.5f*F_SQRT3*PART_SIM_BOX_SIDE;
47 48
@@ -52,18 +53,28 @@ S32 LLViewerPartSim::sParticleCount = 0;
52 53
53U32 LLViewerPart::sNextPartID = 1; 54U32 LLViewerPart::sNextPartID = 1;
54 55
56F32 calc_desired_size(LLVector3 pos, LLVector2 scale)
57{
58 F32 desired_size = (pos-gCamera->getOrigin()).magVec();
59 desired_size /= 4;
60 return llclamp(desired_size, scale.magVec()*0.5f, PART_SIM_BOX_SIDE*2);
61}
62
55LLViewerPart::LLViewerPart() 63LLViewerPart::LLViewerPart()
56{ 64{
65 LLMemType mt(LLMemType::MTYPE_PARTICLES);
57 mPartSourcep = NULL; 66 mPartSourcep = NULL;
58} 67}
59 68
60LLViewerPart::~LLViewerPart() 69LLViewerPart::~LLViewerPart()
61{ 70{
71 LLMemType mt(LLMemType::MTYPE_PARTICLES);
62 mPartSourcep = NULL; 72 mPartSourcep = NULL;
63} 73}
64 74
65LLViewerPart &LLViewerPart::operator=(const LLViewerPart &part) 75LLViewerPart &LLViewerPart::operator=(const LLViewerPart &part)
66{ 76{
77 LLMemType mt(LLMemType::MTYPE_PARTICLES);
67 mPartID = part.mPartID; 78 mPartID = part.mPartID;
68 mFlags = part.mFlags; 79 mFlags = part.mFlags;
69 mMaxAge = part.mMaxAge; 80 mMaxAge = part.mMaxAge;
@@ -93,6 +104,7 @@ LLViewerPart &LLViewerPart::operator=(const LLViewerPart &part)
93 104
94void LLViewerPart::init(LLViewerPartSource *sourcep, LLViewerImage *imagep, LLVPCallback cb) 105void LLViewerPart::init(LLViewerPartSource *sourcep, LLViewerImage *imagep, LLVPCallback cb)
95{ 106{
107 LLMemType mt(LLMemType::MTYPE_PARTICLES);
96 mPartID = LLViewerPart::sNextPartID; 108 mPartID = LLViewerPart::sNextPartID;
97 LLViewerPart::sNextPartID++; 109 LLViewerPart::sNextPartID++;
98 mFlags = 0x00f; 110 mFlags = 0x00f;
@@ -115,8 +127,13 @@ void LLViewerPart::init(LLViewerPartSource *sourcep, LLViewerImage *imagep, LLVP
115 127
116LLViewerPartGroup::LLViewerPartGroup(const LLVector3 &center_agent, const F32 box_side) 128LLViewerPartGroup::LLViewerPartGroup(const LLVector3 &center_agent, const F32 box_side)
117{ 129{
130 LLMemType mt(LLMemType::MTYPE_PARTICLES);
118 mVOPartGroupp = NULL; 131 mVOPartGroupp = NULL;
132 mUniformParticles = TRUE;
133
119 mRegionp = gWorldPointer->getRegionFromPosAgent(center_agent); 134 mRegionp = gWorldPointer->getRegionFromPosAgent(center_agent);
135 llassert_always(center_agent.isFinite());
136
120 if (!mRegionp) 137 if (!mRegionp)
121 { 138 {
122 //llwarns << "No region at position, using agent region!" << llendl; 139 //llwarns << "No region at position, using agent region!" << llendl;
@@ -125,28 +142,39 @@ LLViewerPartGroup::LLViewerPartGroup(const LLVector3 &center_agent, const F32 bo
125 mCenterAgent = center_agent; 142 mCenterAgent = center_agent;
126 mBoxRadius = F_SQRT3*box_side*0.5f; 143 mBoxRadius = F_SQRT3*box_side*0.5f;
127 144
128 LLVector3 rad_vec(box_side*0.5f, box_side*0.5f, box_side*0.5f); 145 mVOPartGroupp = (LLVOPartGroup *)gObjectList.createObjectViewer(LLViewerObject::LL_VO_PART_GROUP, getRegion());
129 rad_vec += LLVector3(0.001f, 0.001f, 0.001f); 146 mVOPartGroupp->setViewerPartGroup(this);
130 mMinObjPos = mCenterAgent - rad_vec; 147 mVOPartGroupp->setPositionAgent(getCenterAgent());
131 mMaxObjPos = mCenterAgent + rad_vec; 148 F32 scale = box_side * 0.5f;
149 mVOPartGroupp->setScale(LLVector3(scale,scale,scale));
150 gPipeline.addObject(mVOPartGroupp);
151
152 LLSpatialGroup* group = mVOPartGroupp->mDrawable->getSpatialGroup();
153
154 LLVector3 center(group->mOctreeNode->getCenter());
155 LLVector3 size(group->mOctreeNode->getSize());
156 size += LLVector3(0.01f, 0.01f, 0.01f);
157 mMinObjPos = center - size;
158 mMaxObjPos = center + size;
159
160 static U32 id_seed = 0;
161 mID = ++id_seed;
132} 162}
133 163
134LLViewerPartGroup::~LLViewerPartGroup() 164LLViewerPartGroup::~LLViewerPartGroup()
135{ 165{
166 LLMemType mt(LLMemType::MTYPE_PARTICLES);
136 cleanup(); 167 cleanup();
137 S32 count = mParticles.count(); 168
138 S32 i; 169 S32 count = (S32) mParticles.size();
139 170 mParticles.clear();
140 for (i = 0; i < count; i++) 171
141 {
142 mParticles[i].mPartSourcep = NULL;
143 }
144 mParticles.reset();
145 LLViewerPartSim::decPartCount(count); 172 LLViewerPartSim::decPartCount(count);
146} 173}
147 174
148void LLViewerPartGroup::cleanup() 175void LLViewerPartGroup::cleanup()
149{ 176{
177 LLMemType mt(LLMemType::MTYPE_PARTICLES);
150 if (mVOPartGroupp) 178 if (mVOPartGroupp)
151 { 179 {
152 if (!mVOPartGroupp->isDead()) 180 if (!mVOPartGroupp->isDead())
@@ -157,8 +185,9 @@ void LLViewerPartGroup::cleanup()
157 } 185 }
158} 186}
159 187
160BOOL LLViewerPartGroup::posInGroup(const LLVector3 &pos) 188BOOL LLViewerPartGroup::posInGroup(const LLVector3 &pos, const F32 desired_size)
161{ 189{
190 LLMemType mt(LLMemType::MTYPE_PARTICLES);
162 if ((pos.mV[VX] < mMinObjPos.mV[VX]) 191 if ((pos.mV[VX] < mMinObjPos.mV[VX])
163 || (pos.mV[VY] < mMinObjPos.mV[VY]) 192 || (pos.mV[VY] < mMinObjPos.mV[VY])
164 || (pos.mV[VZ] < mMinObjPos.mV[VZ])) 193 || (pos.mV[VZ] < mMinObjPos.mV[VZ]))
@@ -173,29 +202,33 @@ BOOL LLViewerPartGroup::posInGroup(const LLVector3 &pos)
173 return FALSE; 202 return FALSE;
174 } 203 }
175 204
205 if (desired_size > 0 &&
206 (desired_size < mBoxRadius*0.5f ||
207 desired_size > mBoxRadius*2.f))
208 {
209 return FALSE;
210 }
211
176 return TRUE; 212 return TRUE;
177} 213}
178 214
179 215
180BOOL LLViewerPartGroup::addPart(LLViewerPart &part) 216BOOL LLViewerPartGroup::addPart(LLViewerPart* part, F32 desired_size)
181{ 217{
182 if (!posInGroup(part.mPosAgent) || 218 LLMemType mt(LLMemType::MTYPE_PARTICLES);
183 (mVOPartGroupp.notNull() && (part.mImagep != mVOPartGroupp->getTEImage(0)))) 219 BOOL uniform_part = part->mScale.mV[0] == part->mScale.mV[1] &&
220 !(part->mFlags & LLPartData::LL_PART_FOLLOW_VELOCITY_MASK);
221
222 if (!posInGroup(part->mPosAgent, desired_size) ||
223 (mUniformParticles && !uniform_part) ||
224 (!mUniformParticles && uniform_part))
184 { 225 {
185 return FALSE; 226 return FALSE;
186 } 227 }
187 228
188 if (!mVOPartGroupp) 229 gPipeline.markRebuild(mVOPartGroupp->mDrawable, LLDrawable::REBUILD_ALL, TRUE);
189 {
190 mVOPartGroupp = (LLVOPartGroup *)gObjectList.createObjectViewer(LLViewerObject::LL_VO_PART_GROUP, getRegion());
191 mVOPartGroupp->setViewerPartGroup(this);
192 mVOPartGroupp->setPositionAgent(getCenterAgent());
193 mVOPartGroupp->setScale(LLVector3(PART_SIM_BOX_SIDE, PART_SIM_BOX_SIDE, PART_SIM_BOX_SIDE));
194 mVOPartGroupp->setTEImage(0, part.mImagep);
195 gPipeline.addObject(mVOPartGroupp);
196 }
197 230
198 mParticles.put(part); 231 mParticles.push_back(part);
199 LLViewerPartSim::incPartCount(1); 232 LLViewerPartSim::incPartCount(1);
200 return TRUE; 233 return TRUE;
201} 234}
@@ -203,33 +236,29 @@ BOOL LLViewerPartGroup::addPart(LLViewerPart &part)
203 236
204void LLViewerPartGroup::removePart(const S32 part_num) 237void LLViewerPartGroup::removePart(const S32 part_num)
205{ 238{
239 LLMemType mt(LLMemType::MTYPE_PARTICLES);
206 // Remove the entry for the particle we just deleted. 240 // Remove the entry for the particle we just deleted.
207 LLPointer<LLViewerPartSource> ps = mParticles[mParticles.count() - 1].mPartSourcep; 241 mParticles.erase(mParticles.begin() + part_num);
208 242 if (mVOPartGroupp.notNull())
209 mParticles[mParticles.count() - 1].mPartSourcep = NULL;
210 mParticles.remove(part_num);
211 if (part_num < mParticles.count())
212 { 243 {
213 mParticles[part_num].mPartSourcep = ps; 244 gPipeline.markRebuild(mVOPartGroupp->mDrawable, LLDrawable::REBUILD_ALL, TRUE);
214 } 245 }
215
216 LLViewerPartSim::decPartCount(1); 246 LLViewerPartSim::decPartCount(1);
217} 247}
218 248
219
220void LLViewerPartGroup::updateParticles(const F32 dt) 249void LLViewerPartGroup::updateParticles(const F32 dt)
221{ 250{
251 LLMemType mt(LLMemType::MTYPE_PARTICLES);
222 S32 i, count; 252 S32 i, count;
223 253
224
225 LLVector3 gravity(0.f, 0.f, -9.8f); 254 LLVector3 gravity(0.f, 0.f, -9.8f);
226 255
227 LLViewerRegion *regionp = getRegion(); 256 LLViewerRegion *regionp = getRegion();
228 count = mParticles.count(); 257 count = (S32) mParticles.size();
229 for (i = 0; i < count; i++) 258 for (i = 0; i < count; i++)
230 { 259 {
231 LLVector3 a(0.f, 0.f, 0.f); 260 LLVector3 a(0.f, 0.f, 0.f);
232 LLViewerPart &part = mParticles[i]; 261 LLViewerPart& part = *((LLViewerPart*) mParticles[i]);
233 262
234 // Update current time 263 // Update current time
235 const F32 cur_time = part.mLastUpdateTime + dt; 264 const F32 cur_time = part.mLastUpdateTime + dt;
@@ -271,8 +300,6 @@ void LLViewerPartGroup::updateParticles(const F32 dt)
271 300
272 part.mVelocity *= (1.f - step); 301 part.mVelocity *= (1.f - step);
273 part.mVelocity += step*delta_pos; 302 part.mVelocity += step*delta_pos;
274 //part.mPosAgent *= 1.f - to_target_frac;
275 //part.mPosAgent += to_target_frac*part.mPartSourcep->mTargetPosAgent;
276 } 303 }
277 304
278 305
@@ -341,18 +368,22 @@ void LLViewerPartGroup::updateParticles(const F32 dt)
341 i--; 368 i--;
342 count--; 369 count--;
343 } 370 }
344 else if (!posInGroup(part.mPosAgent)) 371 else
345 { 372 {
346 // Transfer particles between groups 373 F32 desired_size = calc_desired_size(part.mPosAgent, part.mScale);
347 gWorldPointer->mPartSim.put(part); 374 if (!posInGroup(part.mPosAgent, desired_size))
348 removePart(i); 375 {
349 i--; 376 // Transfer particles between groups
350 count--; 377 gWorldPointer->mPartSim.put(&part);
378 removePart(i);
379 i--;
380 count--;
381 }
351 } 382 }
352 } 383 }
353 384
354 // Kill the viewer object if this particle group is empty 385 // Kill the viewer object if this particle group is empty
355 if (!mParticles.count()) 386 if (mParticles.empty())
356 { 387 {
357 gObjectList.killObject(mVOPartGroupp); 388 gObjectList.killObject(mVOPartGroupp);
358 mVOPartGroupp = NULL; 389 mVOPartGroupp = NULL;
@@ -362,15 +393,16 @@ void LLViewerPartGroup::updateParticles(const F32 dt)
362 393
363void LLViewerPartGroup::shift(const LLVector3 &offset) 394void LLViewerPartGroup::shift(const LLVector3 &offset)
364{ 395{
396 LLMemType mt(LLMemType::MTYPE_PARTICLES);
365 mCenterAgent += offset; 397 mCenterAgent += offset;
366 mMinObjPos += offset; 398 mMinObjPos += offset;
367 mMaxObjPos += offset; 399 mMaxObjPos += offset;
368 400
369 S32 count = mParticles.count(); 401 S32 count = (S32) mParticles.size();
370 S32 i; 402 S32 i;
371 for (i = 0; i < count; i++) 403 for (i = 0; i < count; i++)
372 { 404 {
373 mParticles[i].mPosAgent += offset; 405 mParticles[i]->mPosAgent += offset;
374 } 406 }
375} 407}
376 408
@@ -384,34 +416,34 @@ void LLViewerPartGroup::shift(const LLVector3 &offset)
384 416
385LLViewerPartSim::LLViewerPartSim() 417LLViewerPartSim::LLViewerPartSim()
386{ 418{
419 LLMemType mt(LLMemType::MTYPE_PARTICLES);
387 sMaxParticleCount = gSavedSettings.getS32("RenderMaxPartCount"); 420 sMaxParticleCount = gSavedSettings.getS32("RenderMaxPartCount");
421 static U32 id_seed = 0;
422 mID = ++id_seed;
388} 423}
389 424
390 425
391LLViewerPartSim::~LLViewerPartSim() 426LLViewerPartSim::~LLViewerPartSim()
392{ 427{
428 LLMemType mt(LLMemType::MTYPE_PARTICLES);
393 S32 i; 429 S32 i;
394 S32 count; 430 S32 count;
395 431
396 // Kill all of the groups (and particles) 432 // Kill all of the groups (and particles)
397 count = mViewerPartGroups.count(); 433 count = (S32) mViewerPartGroups.size();
398 for (i = 0; i < count; i++) 434 for (i = 0; i < count; i++)
399 { 435 {
400 delete mViewerPartGroups[i]; 436 delete mViewerPartGroups[i];
401 } 437 }
402 mViewerPartGroups.reset(); 438 mViewerPartGroups.clear();
403 439
404 // Kill all of the sources 440 // Kill all of the sources
405 count = mViewerPartSources.count(); 441 mViewerPartSources.clear();
406 for (i = 0; i < count; i++)
407 {
408 mViewerPartSources[i] = NULL;
409 }
410 mViewerPartSources.reset();
411} 442}
412 443
413BOOL LLViewerPartSim::shouldAddPart() 444BOOL LLViewerPartSim::shouldAddPart()
414{ 445{
446 LLMemType mt(LLMemType::MTYPE_PARTICLES);
415 if (sParticleCount > 0.75f*sMaxParticleCount) 447 if (sParticleCount > 0.75f*sMaxParticleCount)
416 { 448 {
417 449
@@ -432,33 +464,35 @@ BOOL LLViewerPartSim::shouldAddPart()
432 return TRUE; 464 return TRUE;
433} 465}
434 466
435void LLViewerPartSim::addPart(LLViewerPart &part) 467void LLViewerPartSim::addPart(LLViewerPart* part)
436{ 468{
469 LLMemType mt(LLMemType::MTYPE_PARTICLES);
437 if (sParticleCount < MAX_PART_COUNT) 470 if (sParticleCount < MAX_PART_COUNT)
438 { 471 {
439 put(part); 472 put(part);
440 } 473 }
441} 474}
442 475
443LLViewerPartGroup *LLViewerPartSim::put(LLViewerPart &part) 476
477LLViewerPartGroup *LLViewerPartSim::put(LLViewerPart* part)
444{ 478{
479 LLMemType mt(LLMemType::MTYPE_PARTICLES);
445 const F32 MAX_MAG = 1000000.f*1000000.f; // 1 million 480 const F32 MAX_MAG = 1000000.f*1000000.f; // 1 million
446 if (part.mPosAgent.magVecSquared() > MAX_MAG) 481 if (part->mPosAgent.magVecSquared() > MAX_MAG || !part->mPosAgent.isFinite())
447 { 482 {
448#ifndef LL_RELEASE_FOR_DOWNLOAD 483#if !LL_RELEASE_FOR_DOWNLOAD
449 llwarns << "LLViewerPartSim::put Part out of range!" << llendl; 484 llwarns << "LLViewerPartSim::put Part out of range!" << llendl;
450 llwarns << part.mPosAgent << llendl; 485 llwarns << part->mPosAgent << llendl;
451#endif 486#endif
452 return NULL; 487 return NULL;
453 } 488 }
489
490 F32 desired_size = calc_desired_size(part->mPosAgent, part->mScale);
454 491
455 S32 i; 492 S32 count = (S32) mViewerPartGroups.size();
456 S32 count; 493 for (S32 i = 0; i < count; i++)
457
458 count = mViewerPartGroups.count();
459 for (i = 0; i < count; i++)
460 { 494 {
461 if (mViewerPartGroups[i]->addPart(part)) 495 if (mViewerPartGroups[i]->addPart(part, desired_size))
462 { 496 {
463 // We found a spatial group that we fit into, add us and exit 497 // We found a spatial group that we fit into, add us and exit
464 return mViewerPartGroups[i]; 498 return mViewerPartGroups[i];
@@ -467,43 +501,27 @@ LLViewerPartGroup *LLViewerPartSim::put(LLViewerPart &part)
467 501
468 // Hmm, we didn't fit in any of the existing spatial groups 502 // Hmm, we didn't fit in any of the existing spatial groups
469 // Create a new one... 503 // Create a new one...
470 LLViewerPartGroup *groupp = createViewerPartGroup(part.mPosAgent); 504 llassert_always(part->mPosAgent.isFinite());
505 LLViewerPartGroup *groupp = createViewerPartGroup(part->mPosAgent, desired_size);
506 groupp->mUniformParticles = (part->mScale.mV[0] == part->mScale.mV[1] &&
507 !(part->mFlags & LLPartData::LL_PART_FOLLOW_VELOCITY_MASK));
471 if (!groupp->addPart(part)) 508 if (!groupp->addPart(part))
472 { 509 {
473 llwarns << "LLViewerPartSim::put - Particle didn't go into its box!" << llendl; 510 llwarns << "LLViewerPartSim::put - Particle didn't go into its box!" << llendl;
474 llinfos << groupp->getCenterAgent() << llendl; 511 llinfos << groupp->getCenterAgent() << llendl;
475 llinfos << part.mPosAgent << llendl; 512 llinfos << part->mPosAgent << llendl;
476 return NULL; 513 return NULL;
477 } 514 }
478 return groupp; 515 return groupp;
479} 516}
480 517
481LLViewerPartGroup *LLViewerPartSim::createViewerPartGroup(const LLVector3 &pos_agent) 518LLViewerPartGroup *LLViewerPartSim::createViewerPartGroup(const LLVector3 &pos_agent, const F32 desired_size)
482{ 519{
483 F32 x_origin = ((S32)(pos_agent.mV[VX]/PART_SIM_BOX_SIDE))*PART_SIM_BOX_SIDE; 520 LLMemType mt(LLMemType::MTYPE_PARTICLES);
484 if (x_origin > pos_agent.mV[VX]) 521 //find a box that has a center position divisible by PART_SIM_BOX_SIDE that encompasses
485 { 522 //pos_agent
486 x_origin -= PART_SIM_BOX_SIDE; 523 LLViewerPartGroup *groupp = new LLViewerPartGroup(pos_agent, desired_size);
487 } 524 mViewerPartGroups.push_back(groupp);
488
489 F32 y_origin = ((S32)(pos_agent.mV[VY]/PART_SIM_BOX_SIDE))*PART_SIM_BOX_SIDE;
490 if (y_origin > pos_agent.mV[VY])
491 {
492 y_origin -= PART_SIM_BOX_SIDE;
493 }
494
495 F32 z_origin = ((S32)(pos_agent.mV[VZ]/PART_SIM_BOX_SIDE))*PART_SIM_BOX_SIDE;
496 if (z_origin > pos_agent.mV[VZ])
497 {
498 z_origin -= PART_SIM_BOX_SIDE;
499 }
500
501 LLVector3 group_center(x_origin + PART_SIM_BOX_OFFSET,
502 y_origin + PART_SIM_BOX_OFFSET,
503 z_origin + PART_SIM_BOX_OFFSET);
504
505 LLViewerPartGroup *groupp = new LLViewerPartGroup(group_center, PART_SIM_BOX_SIDE);
506 mViewerPartGroups.put(groupp);
507 return groupp; 525 return groupp;
508} 526}
509 527
@@ -513,7 +531,7 @@ void LLViewerPartSim::shift(const LLVector3 &offset)
513 S32 i; 531 S32 i;
514 S32 count; 532 S32 count;
515 533
516 count = mViewerPartSources.count(); 534 count = (S32) mViewerPartSources.size();
517 for (i = 0; i < count; i++) 535 for (i = 0; i < count; i++)
518 { 536 {
519 mViewerPartSources[i]->mPosAgent += offset; 537 mViewerPartSources[i]->mPosAgent += offset;
@@ -521,13 +539,20 @@ void LLViewerPartSim::shift(const LLVector3 &offset)
521 mViewerPartSources[i]->mLastUpdatePosAgent += offset; 539 mViewerPartSources[i]->mLastUpdatePosAgent += offset;
522 } 540 }
523 541
524 count = mViewerPartGroups.count(); 542 count = (S32) mViewerPartGroups.size();
525 for (i = 0; i < count; i++) 543 for (i = 0; i < count; i++)
526 { 544 {
527 mViewerPartGroups[i]->shift(offset); 545 mViewerPartGroups[i]->shift(offset);
528 } 546 }
529} 547}
530 548
549S32 dist_rate_func(F32 distance)
550{
551 //S32 dist = (S32) sqrtf(distance);
552 //dist /= 2;
553 //return llmax(dist,1);
554 return 1;
555}
531 556
532void LLViewerPartSim::updateSimulation() 557void LLViewerPartSim::updateSimulation()
533{ 558{
@@ -542,13 +567,15 @@ void LLViewerPartSim::updateSimulation()
542 return; 567 return;
543 } 568 }
544 569
570 LLFastTimer ftm(LLFastTimer::FTM_SIMULATE_PARTICLES);
571
545 // Start at a random particle system so the same 572 // Start at a random particle system so the same
546 // particle system doesn't always get first pick at the 573 // particle system doesn't always get first pick at the
547 // particles. Theoretically we'd want to do this in distance 574 // particles. Theoretically we'd want to do this in distance
548 // order or something, but sorting particle sources will be a big 575 // order or something, but sorting particle sources will be a big
549 // pain. 576 // pain.
550 S32 i; 577 S32 i;
551 S32 count = mViewerPartSources.count(); 578 S32 count = (S32) mViewerPartSources.size();
552 S32 start = (S32)ll_frand((F32)count); 579 S32 start = (S32)ll_frand((F32)count);
553 S32 dir = 1; 580 S32 dir = 1;
554 if (ll_frand() > 0.5f) 581 if (ll_frand() > 0.5f)
@@ -570,12 +597,24 @@ void LLViewerPartSim::updateSimulation()
570 597
571 if (!mViewerPartSources[i]->isDead()) 598 if (!mViewerPartSources[i]->isDead())
572 { 599 {
573 mViewerPartSources[i]->update(dt); 600 LLViewerObject* source_object = mViewerPartSources[i]->mSourceObjectp;
601 if (source_object && source_object->mDrawable.notNull())
602 {
603 S32 dist = dist_rate_func(source_object->mDrawable->mDistanceWRTCamera);
604 if ((LLDrawable::getCurrentFrame()+mViewerPartSources[i]->mID)%dist == 0)
605 {
606 mViewerPartSources[i]->update(dt*dist);
607 }
608 }
609 else
610 {
611 mViewerPartSources[i]->update(dt);
612 }
574 } 613 }
575 614
576 if (mViewerPartSources[i]->isDead()) 615 if (mViewerPartSources[i]->isDead())
577 { 616 {
578 mViewerPartSources.remove(i); 617 mViewerPartSources.erase(mViewerPartSources.begin() + i);
579 count--; 618 count--;
580 } 619 }
581 else 620 else
@@ -586,16 +625,36 @@ void LLViewerPartSim::updateSimulation()
586 } 625 }
587 626
588 627
589 count = mViewerPartGroups.count(); 628 count = (S32) mViewerPartGroups.size();
590 for (i = 0; i < count; i++) 629 for (i = 0; i < count; i++)
591 { 630 {
592 mViewerPartGroups[i]->updateParticles(dt); 631 LLViewerObject* vobj = mViewerPartGroups[i]->mVOPartGroupp;
593 if (!mViewerPartGroups[i]->getCount()) 632
633 S32 dist = vobj && !vobj->mDrawable->isState(LLDrawable::IN_REBUILD_Q1) ?
634 dist_rate_func(vobj->mDrawable->mDistanceWRTCamera) : 1;
635 if (vobj)
594 { 636 {
595 delete mViewerPartGroups[i]; 637 LLSpatialGroup* group = vobj->mDrawable->getSpatialGroup();
596 mViewerPartGroups.remove(i); 638 if (group && !group->isVisible()) // && !group->isState(LLSpatialGroup::OBJECT_DIRTY))
597 i--; 639 {
598 count--; 640 dist *= 8;
641 }
642 }
643
644 if ((LLDrawable::getCurrentFrame()+mViewerPartGroups[i]->mID)%dist == 0)
645 {
646 if (vobj)
647 {
648 gPipeline.markRebuild(vobj->mDrawable, LLDrawable::REBUILD_ALL, TRUE);
649 }
650 mViewerPartGroups[i]->updateParticles(dt*dist);
651 if (!mViewerPartGroups[i]->getCount())
652 {
653 delete mViewerPartGroups[i];
654 mViewerPartGroups.erase(mViewerPartGroups.begin() + i);
655 i--;
656 count--;
657 }
599 } 658 }
600 } 659 }
601 //llinfos << "Particles: " << sParticleCount << llendl; 660 //llinfos << "Particles: " << sParticleCount << llendl;
@@ -604,42 +663,40 @@ void LLViewerPartSim::updateSimulation()
604 663
605void LLViewerPartSim::addPartSource(LLViewerPartSource *sourcep) 664void LLViewerPartSim::addPartSource(LLViewerPartSource *sourcep)
606{ 665{
666 LLMemType mt(LLMemType::MTYPE_PARTICLES);
607 if (!sourcep) 667 if (!sourcep)
608 { 668 {
609 llwarns << "Null part source!" << llendl; 669 llwarns << "Null part source!" << llendl;
610 return; 670 return;
611 } 671 }
612 mViewerPartSources.put(sourcep); 672 mViewerPartSources.push_back(sourcep);
613} 673}
614 674
615 675
616void LLViewerPartSim::cleanupRegion(LLViewerRegion *regionp) 676void LLViewerPartSim::cleanupRegion(LLViewerRegion *regionp)
617{ 677{
618 S32 i, count; 678 LLMemType mt(LLMemType::MTYPE_PARTICLES);
619 count = mViewerPartGroups.count(); 679 for (group_list_t::iterator i = mViewerPartGroups.begin(); i != mViewerPartGroups.end(); )
620 for (i = 0; i < count; i++)
621 { 680 {
622 if (mViewerPartGroups[i]->getRegion() == regionp) 681 group_list_t::iterator iter = i++;
682
683 if ((*iter)->getRegion() == regionp)
623 { 684 {
624 delete mViewerPartGroups[i]; 685 i = mViewerPartGroups.erase(iter);
625 mViewerPartGroups.remove(i);
626 i--;
627 count--;
628 } 686 }
629 } 687 }
630} 688}
631 689
632void LLViewerPartSim::cleanMutedParticles(const LLUUID& task_id) 690void LLViewerPartSim::cleanMutedParticles(const LLUUID& task_id)
633{ 691{
634 S32 i; 692 LLMemType mt(LLMemType::MTYPE_PARTICLES);
635 S32 count = mViewerPartSources.count(); 693 for (source_list_t::iterator i = mViewerPartSources.begin(); i != mViewerPartSources.end(); )
636 for (i = 0; i < count; ++i)
637 { 694 {
638 if (mViewerPartSources[i]->getOwnerUUID() == task_id) 695 source_list_t::iterator iter = i++;
696
697 if ((*iter)->getOwnerUUID() == task_id)
639 { 698 {
640 mViewerPartSources.remove(i); 699 i = mViewerPartSources.erase(iter);
641 i--;
642 count--;
643 } 700 }
644 } 701 }
645} 702}
diff --git a/linden/indra/newview/llviewerpartsim.h b/linden/indra/newview/llviewerpartsim.h
index 7983838..c1ef43b 100644
--- a/linden/indra/newview/llviewerpartsim.h
+++ b/linden/indra/newview/llviewerpartsim.h
@@ -50,7 +50,7 @@ typedef void (*LLVPCallback)(LLViewerPart &part, const F32 dt);
50// 50//
51 51
52 52
53class LLViewerPart : public LLPartData 53class LLViewerPart : public LLPartData, public LLRefCount
54{ 54{
55public: 55public:
56 LLViewerPart(); 56 LLViewerPart();
@@ -90,19 +90,26 @@ public:
90 90
91 void cleanup(); 91 void cleanup();
92 92
93 BOOL addPart(LLViewerPart &part); 93 BOOL addPart(LLViewerPart* part, const F32 desired_size = -1.f);
94 94
95 void updateParticles(const F32 dt); 95 void updateParticles(const F32 dt);
96 96
97 BOOL posInGroup(const LLVector3 &pos); 97 BOOL posInGroup(const LLVector3 &pos, const F32 desired_size = -1.f);
98 98
99 void shift(const LLVector3 &offset); 99 void shift(const LLVector3 &offset);
100 100
101 LLDynamicArray<LLViewerPart> mParticles; 101 typedef std::vector<LLPointer<LLViewerPart> > part_list_t;
102 part_list_t mParticles;
102 103
103 const LLVector3 &getCenterAgent() const { return mCenterAgent; } 104 const LLVector3 &getCenterAgent() const { return mCenterAgent; }
104 S32 getCount() const { return mParticles.count(); } 105 S32 getCount() const { return (S32) mParticles.size(); }
105 LLViewerRegion *getRegion() const { return mRegionp; } 106 LLViewerRegion *getRegion() const { return mRegionp; }
107
108 LLPointer<LLVOPartGroup> mVOPartGroupp;
109
110 BOOL mUniformParticles;
111 U32 mID;
112
106protected: 113protected:
107 void removePart(const S32 part_num); 114 void removePart(const S32 part_num);
108 115
@@ -112,11 +119,9 @@ protected:
112 LLVector3 mMinObjPos; 119 LLVector3 mMinObjPos;
113 LLVector3 mMaxObjPos; 120 LLVector3 mMaxObjPos;
114 121
115 LLPointer<LLVOPartGroup> mVOPartGroupp;
116 LLViewerRegion *mRegionp; 122 LLViewerRegion *mRegionp;
117}; 123};
118 124
119
120class LLViewerPartSim 125class LLViewerPartSim
121{ 126{
122public: 127public:
@@ -132,7 +137,7 @@ public:
132 void cleanupRegion(LLViewerRegion *regionp); 137 void cleanupRegion(LLViewerRegion *regionp);
133 138
134 BOOL shouldAddPart(); // Just decides whether this particle should be added or not (for particle count capping) 139 BOOL shouldAddPart(); // Just decides whether this particle should be added or not (for particle count capping)
135 void addPart(LLViewerPart &part); 140 void addPart(LLViewerPart* part);
136 void cleanMutedParticles(const LLUUID& task_id); 141 void cleanMutedParticles(const LLUUID& task_id);
137 142
138 friend class LLViewerPartGroup; 143 friend class LLViewerPartGroup;
@@ -144,15 +149,18 @@ public:
144 static void incPartCount(const S32 count) { sParticleCount += count; } 149 static void incPartCount(const S32 count) { sParticleCount += count; }
145 static void decPartCount(const S32 count) { sParticleCount -= count; } 150 static void decPartCount(const S32 count) { sParticleCount -= count; }
146 151
152 U32 mID;
153
147protected: 154protected:
148 LLViewerPartGroup *createViewerPartGroup(const LLVector3 &pos_agent); 155 LLViewerPartGroup *createViewerPartGroup(const LLVector3 &pos_agent, const F32 desired_size);
149 LLViewerPartGroup *put(LLViewerPart &part); 156 LLViewerPartGroup *put(LLViewerPart* part);
150 157
151protected: 158protected:
152 LLDynamicArray<LLViewerPartGroup *> mViewerPartGroups; 159 typedef std::vector<LLViewerPartGroup *> group_list_t;
153 LLDynamicArrayPtr<LLPointer<LLViewerPartSource> > mViewerPartSources; 160 typedef std::vector<LLPointer<LLViewerPartSource> > source_list_t;
161 group_list_t mViewerPartGroups;
162 source_list_t mViewerPartSources;
154 LLFrameTimer mSimulationTimer; 163 LLFrameTimer mSimulationTimer;
155
156 static S32 sMaxParticleCount; 164 static S32 sMaxParticleCount;
157 static S32 sParticleCount; 165 static S32 sParticleCount;
158}; 166};
diff --git a/linden/indra/newview/llviewerpartsource.cpp b/linden/indra/newview/llviewerpartsource.cpp
index 39869e2..33e6df4 100644
--- a/linden/indra/newview/llviewerpartsource.cpp
+++ b/linden/indra/newview/llviewerpartsource.cpp
@@ -37,6 +37,7 @@
37#include "llviewerobjectlist.h" 37#include "llviewerobjectlist.h"
38#include "llvoavatar.h" 38#include "llvoavatar.h"
39#include "llworld.h" 39#include "llworld.h"
40#include "pipeline.h"
40 41
41LLViewerPartSource::LLViewerPartSource(const U32 type) : 42LLViewerPartSource::LLViewerPartSource(const U32 type) :
42 mType(type), 43 mType(type),
@@ -45,6 +46,8 @@ LLViewerPartSource::LLViewerPartSource(const U32 type) :
45 mLastUpdateTime = 0.f; 46 mLastUpdateTime = 0.f;
46 mLastPartTime = 0.f; 47 mLastPartTime = 0.f;
47 mIsDead = FALSE; 48 mIsDead = FALSE;
49 static U32 id_seed = 0;
50 mID = ++id_seed;
48} 51}
49 52
50void LLViewerPartSource::setDead() 53void LLViewerPartSource::setDead()
@@ -67,6 +70,7 @@ void LLViewerPartSource::update(const F32 dt)
67LLViewerPartSourceScript::LLViewerPartSourceScript(LLViewerObject *source_objp) : 70LLViewerPartSourceScript::LLViewerPartSourceScript(LLViewerObject *source_objp) :
68 LLViewerPartSource(LL_PART_SOURCE_SCRIPT) 71 LLViewerPartSource(LL_PART_SOURCE_SCRIPT)
69{ 72{
73 LLMemType mt(LLMemType::MTYPE_PARTICLES);
70 llassert(source_objp); 74 llassert(source_objp);
71 mSourceObjectp = source_objp; 75 mSourceObjectp = source_objp;
72 mPosAgent = mSourceObjectp->getPositionAgent(); 76 mPosAgent = mSourceObjectp->getPositionAgent();
@@ -80,18 +84,18 @@ LLViewerPartSourceScript::LLViewerPartSourceScript(LLViewerObject *source_objp)
80 84
81void LLViewerPartSourceScript::setDead() 85void LLViewerPartSourceScript::setDead()
82{ 86{
87 LLMemType mt(LLMemType::MTYPE_PARTICLES);
83 mIsDead = TRUE; 88 mIsDead = TRUE;
84 mSourceObjectp = NULL; 89 mSourceObjectp = NULL;
85 mTargetObjectp = NULL; 90 mTargetObjectp = NULL;
86} 91}
87 92
88
89
90void LLViewerPartSourceScript::update(const F32 dt) 93void LLViewerPartSourceScript::update(const F32 dt)
91{ 94{
95 LLMemType mt(LLMemType::MTYPE_PARTICLES);
92 F32 old_update_time = mLastUpdateTime; 96 F32 old_update_time = mLastUpdateTime;
93 mLastUpdateTime += dt; 97 mLastUpdateTime += dt;
94 98
95 F32 dt_update = mLastUpdateTime - mLastPartTime; 99 F32 dt_update = mLastUpdateTime - mLastPartTime;
96 100
97 // Update this for objects which have the follow flag set... 101 // Update this for objects which have the follow flag set...
@@ -142,6 +146,17 @@ void LLViewerPartSourceScript::update(const F32 dt)
142 return; 146 return;
143 } 147 }
144 148
149
150 if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_PARTICLES))
151 {
152 if (mSourceObjectp.notNull())
153 {
154 std::ostringstream ostr;
155 ostr << mPartSysData;
156 mSourceObjectp->setDebugText(ostr.str());
157 }
158 }
159
145 BOOL first_run = FALSE; 160 BOOL first_run = FALSE;
146 if (old_update_time <= 0.f) 161 if (old_update_time <= 0.f)
147 { 162 {
@@ -153,21 +168,7 @@ void LLViewerPartSourceScript::update(const F32 dt)
153 while ((dt_update > mPartSysData.mBurstRate) || first_run) 168 while ((dt_update > mPartSysData.mBurstRate) || first_run)
154 { 169 {
155 first_run = FALSE; 170 first_run = FALSE;
156 LLViewerPart part; 171
157
158 part.init(this, mImagep, NULL);
159 part.mFlags = mPartSysData.mPartData.mFlags;
160 part.mMaxAge = mPartSysData.mPartData.mMaxAge;
161 part.mStartColor = mPartSysData.mPartData.mStartColor;
162 part.mEndColor = mPartSysData.mPartData.mEndColor;
163 part.mColor = part.mStartColor;
164
165 part.mStartScale = mPartSysData.mPartData.mStartScale;
166 part.mEndScale = mPartSysData.mPartData.mEndScale;
167 part.mScale = part.mStartScale;
168
169 part.mAccel = mPartSysData.mPartAccel;
170
171 // Update the rotation of the particle source by the angular velocity 172 // Update the rotation of the particle source by the angular velocity
172 // First check to see if there is still an angular velocity. 173 // First check to see if there is still an angular velocity.
173 F32 angular_velocity_mag = mPartSysData.mAngularVelocity.magVec(); 174 F32 angular_velocity_mag = mPartSysData.mAngularVelocity.magVec();
@@ -200,14 +201,29 @@ void LLViewerPartSourceScript::update(const F32 dt)
200 continue; 201 continue;
201 } 202 }
202 203
204 LLPointer<LLViewerPart> part = new LLViewerPart();
205
206 part->init(this, mImagep, NULL);
207 part->mFlags = mPartSysData.mPartData.mFlags;
208 part->mMaxAge = mPartSysData.mPartData.mMaxAge;
209 part->mStartColor = mPartSysData.mPartData.mStartColor;
210 part->mEndColor = mPartSysData.mPartData.mEndColor;
211 part->mColor = part->mStartColor;
212
213 part->mStartScale = mPartSysData.mPartData.mStartScale;
214 part->mEndScale = mPartSysData.mPartData.mEndScale;
215 part->mScale = part->mStartScale;
216
217 part->mAccel = mPartSysData.mPartAccel;
218
203 if (mPartSysData.mPattern & LLPartSysData::LL_PART_SRC_PATTERN_DROP) 219 if (mPartSysData.mPattern & LLPartSysData::LL_PART_SRC_PATTERN_DROP)
204 { 220 {
205 part.mPosAgent = mPosAgent; 221 part->mPosAgent = mPosAgent;
206 part.mVelocity.setVec(0.f, 0.f, 0.f); 222 part->mVelocity.setVec(0.f, 0.f, 0.f);
207 } 223 }
208 else if (mPartSysData.mPattern & LLPartSysData::LL_PART_SRC_PATTERN_EXPLODE) 224 else if (mPartSysData.mPattern & LLPartSysData::LL_PART_SRC_PATTERN_EXPLODE)
209 { 225 {
210 part.mPosAgent = mPosAgent; 226 part->mPosAgent = mPosAgent;
211 LLVector3 part_dir_vector; 227 LLVector3 part_dir_vector;
212 228
213 F32 mvs; 229 F32 mvs;
@@ -221,19 +237,18 @@ void LLViewerPartSourceScript::update(const F32 dt)
221 while ((mvs > 1.f) || (mvs < 0.01f)); 237 while ((mvs > 1.f) || (mvs < 0.01f));
222 238
223 part_dir_vector.normVec(); 239 part_dir_vector.normVec();
224 part.mPosAgent += mPartSysData.mBurstRadius*part_dir_vector; 240 part->mPosAgent += mPartSysData.mBurstRadius*part_dir_vector;
225 part.mVelocity = part_dir_vector; 241 part->mVelocity = part_dir_vector;
226 F32 speed = mPartSysData.mBurstSpeedMin + ll_frand(mPartSysData.mBurstSpeedMax - mPartSysData.mBurstSpeedMin); 242 F32 speed = mPartSysData.mBurstSpeedMin + ll_frand(mPartSysData.mBurstSpeedMax - mPartSysData.mBurstSpeedMin);
227 part.mVelocity *= speed; 243 part->mVelocity *= speed;
228 } 244 }
229 else if (mPartSysData.mPattern & LLPartSysData::LL_PART_SRC_PATTERN_ANGLE 245 else if (mPartSysData.mPattern & LLPartSysData::LL_PART_SRC_PATTERN_ANGLE
230 || mPartSysData.mPattern & LLPartSysData::LL_PART_SRC_PATTERN_ANGLE_CONE) 246 || mPartSysData.mPattern & LLPartSysData::LL_PART_SRC_PATTERN_ANGLE_CONE)
231 { 247 {
232 part.mPosAgent = mPosAgent; 248 part->mPosAgent = mPosAgent;
233 249
234 // original implemenetation for part_dir_vector was just: 250 // original implemenetation for part_dir_vector was just:
235 LLVector3 part_dir_vector(0.0, 0.0, 1.0); 251 LLVector3 part_dir_vector(0.0, 0.0, 1.0);
236
237 // params from the script... 252 // params from the script...
238 // outer = outer cone angle 253 // outer = outer cone angle
239 // inner = inner cone angle 254 // inner = inner cone angle
@@ -243,13 +258,11 @@ void LLViewerPartSourceScript::update(const F32 dt)
243 258
244 // generate a random angle within the given space... 259 // generate a random angle within the given space...
245 F32 angle = innerAngle + ll_frand(outerAngle - innerAngle); 260 F32 angle = innerAngle + ll_frand(outerAngle - innerAngle);
246
247 // split which side it will go on randomly... 261 // split which side it will go on randomly...
248 if (ll_frand() < 0.5) 262 if (ll_frand() < 0.5)
249 { 263 {
250 angle = -angle; 264 angle = -angle;
251 } 265 }
252
253 // Both patterns rotate around the x-axis first: 266 // Both patterns rotate around the x-axis first:
254 part_dir_vector.rotVec(angle, 1.0, 0.0, 0.0); 267 part_dir_vector.rotVec(angle, 1.0, 0.0, 0.0);
255 268
@@ -258,31 +271,32 @@ void LLViewerPartSourceScript::update(const F32 dt)
258 { 271 {
259 part_dir_vector.rotVec(ll_frand(4*F_PI), 0.0, 0.0, 1.0); 272 part_dir_vector.rotVec(ll_frand(4*F_PI), 0.0, 0.0, 1.0);
260 } 273 }
261 274
262 // Only apply this rotation if using the deprecated angles. 275 // Only apply this rotation if using the deprecated angles.
263 if (! (mPartSysData.mFlags & LLPartSysData::LL_PART_USE_NEW_ANGLE)) 276 if (! (mPartSysData.mFlags & LLPartSysData::LL_PART_USE_NEW_ANGLE))
264 { 277 {
265 // Deprecated... 278 // Deprecated...
266 part_dir_vector.rotVec(outerAngle, 1.0, 0.0, 0.0); 279 part_dir_vector.rotVec(outerAngle, 1.0, 0.0, 0.0);
267 } 280 }
268 281
269 if (mSourceObjectp) 282 if (mSourceObjectp)
270 { 283 {
271 part_dir_vector = part_dir_vector * mSourceObjectp->getRenderRotation(); 284 part_dir_vector = part_dir_vector * mSourceObjectp->getRenderRotation();
272 } 285 }
286
273 part_dir_vector = part_dir_vector * mRotation; 287 part_dir_vector = part_dir_vector * mRotation;
288
289 part->mPosAgent += mPartSysData.mBurstRadius*part_dir_vector;
274 290
275 part.mPosAgent += mPartSysData.mBurstRadius*part_dir_vector; 291 part->mVelocity = part_dir_vector;
276
277 part.mVelocity = part_dir_vector;
278 292
279 F32 speed = mPartSysData.mBurstSpeedMin + ll_frand(mPartSysData.mBurstSpeedMax - mPartSysData.mBurstSpeedMin); 293 F32 speed = mPartSysData.mBurstSpeedMin + ll_frand(mPartSysData.mBurstSpeedMax - mPartSysData.mBurstSpeedMin);
280 part.mVelocity *= speed; 294 part->mVelocity *= speed;
281 } 295 }
282 else 296 else
283 { 297 {
284 part.mPosAgent = mPosAgent; 298 part->mPosAgent = mPosAgent;
285 part.mVelocity.setVec(0.f, 0.f, 0.f); 299 part->mVelocity.setVec(0.f, 0.f, 0.f);
286 //llwarns << "Unknown source pattern " << (S32)mPartSysData.mPattern << llendl; 300 //llwarns << "Unknown source pattern " << (S32)mPartSysData.mPattern << llendl;
287 } 301 }
288 302
@@ -297,6 +311,7 @@ void LLViewerPartSourceScript::update(const F32 dt)
297// static 311// static
298LLViewerPartSourceScript *LLViewerPartSourceScript::unpackPSS(LLViewerObject *source_objp, LLViewerPartSourceScript *pssp, const S32 block_num) 312LLViewerPartSourceScript *LLViewerPartSourceScript::unpackPSS(LLViewerObject *source_objp, LLViewerPartSourceScript *pssp, const S32 block_num)
299{ 313{
314 LLMemType mt(LLMemType::MTYPE_PARTICLES);
300 if (!pssp) 315 if (!pssp)
301 { 316 {
302 if (LLPartSysData::isNullPS(block_num)) 317 if (LLPartSysData::isNullPS(block_num))
@@ -338,6 +353,7 @@ LLViewerPartSourceScript *LLViewerPartSourceScript::unpackPSS(LLViewerObject *so
338 353
339LLViewerPartSourceScript *LLViewerPartSourceScript::unpackPSS(LLViewerObject *source_objp, LLViewerPartSourceScript *pssp, LLDataPacker &dp) 354LLViewerPartSourceScript *LLViewerPartSourceScript::unpackPSS(LLViewerObject *source_objp, LLViewerPartSourceScript *pssp, LLDataPacker &dp)
340{ 355{
356 LLMemType mt(LLMemType::MTYPE_PARTICLES);
341 if (!pssp) 357 if (!pssp)
342 { 358 {
343 LLViewerPartSourceScript *new_pssp = new LLViewerPartSourceScript(source_objp); 359 LLViewerPartSourceScript *new_pssp = new LLViewerPartSourceScript(source_objp);
@@ -369,11 +385,13 @@ LLViewerPartSourceScript *LLViewerPartSourceScript::unpackPSS(LLViewerObject *so
369 385
370void LLViewerPartSourceScript::setImage(LLViewerImage *imagep) 386void LLViewerPartSourceScript::setImage(LLViewerImage *imagep)
371{ 387{
388 LLMemType mt(LLMemType::MTYPE_PARTICLES);
372 mImagep = imagep; 389 mImagep = imagep;
373} 390}
374 391
375void LLViewerPartSourceScript::setTargetObject(LLViewerObject *objp) 392void LLViewerPartSourceScript::setTargetObject(LLViewerObject *objp)
376{ 393{
394 LLMemType mt(LLMemType::MTYPE_PARTICLES);
377 mTargetObjectp = objp; 395 mTargetObjectp = objp;
378} 396}
379 397
@@ -389,6 +407,7 @@ LLViewerPartSourceSpiral::LLViewerPartSourceSpiral(const LLVector3 &pos) :
389 407
390void LLViewerPartSourceSpiral::setDead() 408void LLViewerPartSourceSpiral::setDead()
391{ 409{
410 LLMemType mt(LLMemType::MTYPE_PARTICLES);
392 mIsDead = TRUE; 411 mIsDead = TRUE;
393 mSourceObjectp = NULL; 412 mSourceObjectp = NULL;
394} 413}
@@ -396,6 +415,7 @@ void LLViewerPartSourceSpiral::setDead()
396 415
397void LLViewerPartSourceSpiral::updatePart(LLViewerPart &part, const F32 dt) 416void LLViewerPartSourceSpiral::updatePart(LLViewerPart &part, const F32 dt)
398{ 417{
418 LLMemType mt(LLMemType::MTYPE_PARTICLES);
399 F32 frac = part.mLastUpdateTime/part.mMaxAge; 419 F32 frac = part.mLastUpdateTime/part.mMaxAge;
400 420
401 LLVector3 center_pos; 421 LLVector3 center_pos;
@@ -420,6 +440,7 @@ void LLViewerPartSourceSpiral::updatePart(LLViewerPart &part, const F32 dt)
420 440
421void LLViewerPartSourceSpiral::update(const F32 dt) 441void LLViewerPartSourceSpiral::update(const F32 dt)
422{ 442{
443 LLMemType mt(LLMemType::MTYPE_PARTICLES);
423 if (!mImagep) 444 if (!mImagep)
424 { 445 {
425 LLUUID id; 446 LLUUID id;
@@ -448,18 +469,18 @@ void LLViewerPartSourceSpiral::update(const F32 dt)
448 { 469 {
449 mPosAgent = mSourceObjectp->getRenderPosition(); 470 mPosAgent = mSourceObjectp->getRenderPosition();
450 } 471 }
451 LLViewerPart part; 472 LLPointer<LLViewerPart> part = new LLViewerPart();
452 part.init(this, mImagep, updatePart); 473 part->init(this, mImagep, updatePart);
453 part.mStartColor = mColor; 474 part->mStartColor = mColor;
454 part.mEndColor = mColor; 475 part->mEndColor = mColor;
455 part.mEndColor.mV[3] = 0.f; 476 part->mEndColor.mV[3] = 0.f;
456 part.mPosAgent = mPosAgent; 477 part->mPosAgent = mPosAgent;
457 part.mMaxAge = 1.f; 478 part->mMaxAge = 1.f;
458 part.mFlags = LLViewerPart::LL_PART_INTERP_COLOR_MASK; 479 part->mFlags = LLViewerPart::LL_PART_INTERP_COLOR_MASK;
459 part.mLastUpdateTime = 0.f; 480 part->mLastUpdateTime = 0.f;
460 part.mScale.mV[0] = 0.25f; 481 part->mScale.mV[0] = 0.25f;
461 part.mScale.mV[1] = 0.25f; 482 part->mScale.mV[1] = 0.25f;
462 part.mParameter = ll_frand(F_TWO_PI); 483 part->mParameter = ll_frand(F_TWO_PI);
463 484
464 gWorldPointer->mPartSim.addPart(part); 485 gWorldPointer->mPartSim.addPart(part);
465 } 486 }
@@ -467,6 +488,7 @@ void LLViewerPartSourceSpiral::update(const F32 dt)
467 488
468void LLViewerPartSourceSpiral::setSourceObject(LLViewerObject *objp) 489void LLViewerPartSourceSpiral::setSourceObject(LLViewerObject *objp)
469{ 490{
491 LLMemType mt(LLMemType::MTYPE_PARTICLES);
470 mSourceObjectp = objp; 492 mSourceObjectp = objp;
471} 493}
472 494
@@ -490,6 +512,7 @@ LLViewerPartSourceBeam::~LLViewerPartSourceBeam()
490 512
491void LLViewerPartSourceBeam::setDead() 513void LLViewerPartSourceBeam::setDead()
492{ 514{
515 LLMemType mt(LLMemType::MTYPE_PARTICLES);
493 mIsDead = TRUE; 516 mIsDead = TRUE;
494 mSourceObjectp = NULL; 517 mSourceObjectp = NULL;
495 mTargetObjectp = NULL; 518 mTargetObjectp = NULL;
@@ -503,6 +526,7 @@ void LLViewerPartSourceBeam::setColor(const LLColor4 &color)
503 526
504void LLViewerPartSourceBeam::updatePart(LLViewerPart &part, const F32 dt) 527void LLViewerPartSourceBeam::updatePart(LLViewerPart &part, const F32 dt)
505{ 528{
529 LLMemType mt(LLMemType::MTYPE_PARTICLES);
506 F32 frac = part.mLastUpdateTime/part.mMaxAge; 530 F32 frac = part.mLastUpdateTime/part.mMaxAge;
507 531
508 LLViewerPartSource *ps = (LLViewerPartSource*)part.mPartSourcep; 532 LLViewerPartSource *ps = (LLViewerPartSource*)part.mPartSourcep;
@@ -547,7 +571,7 @@ void LLViewerPartSourceBeam::updatePart(LLViewerPart &part, const F32 dt)
547 571
548void LLViewerPartSourceBeam::update(const F32 dt) 572void LLViewerPartSourceBeam::update(const F32 dt)
549{ 573{
550 574 LLMemType mt(LLMemType::MTYPE_PARTICLES);
551 const F32 RATE = 0.025f; 575 const F32 RATE = 0.025f;
552 576
553 mLastUpdateTime += dt; 577 mLastUpdateTime += dt;
@@ -595,25 +619,25 @@ void LLViewerPartSourceBeam::update(const F32 dt)
595 mImagep = gImageList.getImage(id); 619 mImagep = gImageList.getImage(id);
596 } 620 }
597 621
598 LLViewerPart part; 622 LLPointer<LLViewerPart> part = new LLViewerPart();
599 part.init(this, mImagep, NULL); 623 part->init(this, mImagep, NULL);
600 624
601 part.mFlags = LLPartData::LL_PART_INTERP_COLOR_MASK | 625 part->mFlags = LLPartData::LL_PART_INTERP_COLOR_MASK |
602 LLPartData::LL_PART_INTERP_SCALE_MASK | 626 LLPartData::LL_PART_INTERP_SCALE_MASK |
603 LLPartData::LL_PART_TARGET_POS_MASK | 627 LLPartData::LL_PART_TARGET_POS_MASK |
604 LLPartData::LL_PART_FOLLOW_VELOCITY_MASK; 628 LLPartData::LL_PART_FOLLOW_VELOCITY_MASK;
605 part.mMaxAge = 0.5f; 629 part->mMaxAge = 0.5f;
606 part.mStartColor = mColor; 630 part->mStartColor = mColor;
607 part.mEndColor = part.mStartColor; 631 part->mEndColor = part->mStartColor;
608 part.mEndColor.mV[3] = 0.4f; 632 part->mEndColor.mV[3] = 0.4f;
609 part.mColor = part.mStartColor; 633 part->mColor = part->mStartColor;
610 634
611 part.mStartScale = LLVector2(0.1f, 0.1f); 635 part->mStartScale = LLVector2(0.1f, 0.1f);
612 part.mEndScale = LLVector2(0.1f, 0.1f); 636 part->mEndScale = LLVector2(0.1f, 0.1f);
613 part.mScale = part.mStartScale; 637 part->mScale = part->mStartScale;
614 638
615 part.mPosAgent = mPosAgent; 639 part->mPosAgent = mPosAgent;
616 part.mVelocity = mTargetPosAgent - mPosAgent; 640 part->mVelocity = mTargetPosAgent - mPosAgent;
617 641
618 gWorldPointer->mPartSim.addPart(part); 642 gWorldPointer->mPartSim.addPart(part);
619 } 643 }
@@ -621,11 +645,13 @@ void LLViewerPartSourceBeam::update(const F32 dt)
621 645
622void LLViewerPartSourceBeam::setSourceObject(LLViewerObject* objp) 646void LLViewerPartSourceBeam::setSourceObject(LLViewerObject* objp)
623{ 647{
648 LLMemType mt(LLMemType::MTYPE_PARTICLES);
624 mSourceObjectp = objp; 649 mSourceObjectp = objp;
625} 650}
626 651
627void LLViewerPartSourceBeam::setTargetObject(LLViewerObject* objp) 652void LLViewerPartSourceBeam::setTargetObject(LLViewerObject* objp)
628{ 653{
654 LLMemType mt(LLMemType::MTYPE_PARTICLES);
629 mTargetObjectp = objp; 655 mTargetObjectp = objp;
630} 656}
631 657
@@ -640,6 +666,7 @@ LLViewerPartSourceChat::LLViewerPartSourceChat(const LLVector3 &pos) :
640 666
641void LLViewerPartSourceChat::setDead() 667void LLViewerPartSourceChat::setDead()
642{ 668{
669 LLMemType mt(LLMemType::MTYPE_PARTICLES);
643 mIsDead = TRUE; 670 mIsDead = TRUE;
644 mSourceObjectp = NULL; 671 mSourceObjectp = NULL;
645} 672}
@@ -647,6 +674,7 @@ void LLViewerPartSourceChat::setDead()
647 674
648void LLViewerPartSourceChat::updatePart(LLViewerPart &part, const F32 dt) 675void LLViewerPartSourceChat::updatePart(LLViewerPart &part, const F32 dt)
649{ 676{
677 LLMemType mt(LLMemType::MTYPE_PARTICLES);
650 F32 frac = part.mLastUpdateTime/part.mMaxAge; 678 F32 frac = part.mLastUpdateTime/part.mMaxAge;
651 679
652 LLVector3 center_pos; 680 LLVector3 center_pos;
@@ -671,6 +699,7 @@ void LLViewerPartSourceChat::updatePart(LLViewerPart &part, const F32 dt)
671 699
672void LLViewerPartSourceChat::update(const F32 dt) 700void LLViewerPartSourceChat::update(const F32 dt)
673{ 701{
702 LLMemType mt(LLMemType::MTYPE_PARTICLES);
674 if (!mImagep) 703 if (!mImagep)
675 { 704 {
676 LLUUID id; 705 LLUUID id;
@@ -709,18 +738,18 @@ void LLViewerPartSourceChat::update(const F32 dt)
709 { 738 {
710 mPosAgent = mSourceObjectp->getRenderPosition(); 739 mPosAgent = mSourceObjectp->getRenderPosition();
711 } 740 }
712 LLViewerPart part; 741 LLPointer<LLViewerPart> part = new LLViewerPart();
713 part.init(this, mImagep, updatePart); 742 part->init(this, mImagep, updatePart);
714 part.mStartColor = mColor; 743 part->mStartColor = mColor;
715 part.mEndColor = mColor; 744 part->mEndColor = mColor;
716 part.mEndColor.mV[3] = 0.f; 745 part->mEndColor.mV[3] = 0.f;
717 part.mPosAgent = mPosAgent; 746 part->mPosAgent = mPosAgent;
718 part.mMaxAge = 1.f; 747 part->mMaxAge = 1.f;
719 part.mFlags = LLViewerPart::LL_PART_INTERP_COLOR_MASK; 748 part->mFlags = LLViewerPart::LL_PART_INTERP_COLOR_MASK;
720 part.mLastUpdateTime = 0.f; 749 part->mLastUpdateTime = 0.f;
721 part.mScale.mV[0] = 0.25f; 750 part->mScale.mV[0] = 0.25f;
722 part.mScale.mV[1] = 0.25f; 751 part->mScale.mV[1] = 0.25f;
723 part.mParameter = ll_frand(F_TWO_PI); 752 part->mParameter = ll_frand(F_TWO_PI);
724 753
725 gWorldPointer->mPartSim.addPart(part); 754 gWorldPointer->mPartSim.addPart(part);
726 } 755 }
@@ -728,6 +757,7 @@ void LLViewerPartSourceChat::update(const F32 dt)
728 757
729void LLViewerPartSourceChat::setSourceObject(LLViewerObject *objp) 758void LLViewerPartSourceChat::setSourceObject(LLViewerObject *objp)
730{ 759{
760 LLMemType mt(LLMemType::MTYPE_PARTICLES);
731 mSourceObjectp = objp; 761 mSourceObjectp = objp;
732} 762}
733 763
diff --git a/linden/indra/newview/llviewerpartsource.h b/linden/indra/newview/llviewerpartsource.h
index 66de36b..15f7ba2 100644
--- a/linden/indra/newview/llviewerpartsource.h
+++ b/linden/indra/newview/llviewerpartsource.h
@@ -70,13 +70,16 @@ public:
70 LLVector3 mPosAgent; // Location of the particle source 70 LLVector3 mPosAgent; // Location of the particle source
71 LLVector3 mTargetPosAgent; // Location of the target position 71 LLVector3 mTargetPosAgent; // Location of the target position
72 LLVector3 mLastUpdatePosAgent; 72 LLVector3 mLastUpdatePosAgent;
73 LLPointer<LLViewerObject> mSourceObjectp;
74 U32 mID;
75
73protected: 76protected:
74 U32 mType; 77 U32 mType;
75 BOOL mIsDead; 78 BOOL mIsDead;
76 F32 mLastUpdateTime; 79 F32 mLastUpdateTime;
77 F32 mLastPartTime; 80 F32 mLastPartTime;
78 LLUUID mOwnerUUID; 81 LLUUID mOwnerUUID;
79 82
80 // Particle information 83 // Particle information
81 U32 mPartFlags; // Flags for the particle 84 U32 mPartFlags; // Flags for the particle
82}; 85};
@@ -115,7 +118,6 @@ public:
115protected: 118protected:
116 LLQuaternion mRotation; // Current rotation for particle source 119 LLQuaternion mRotation; // Current rotation for particle source
117 LLPointer<LLViewerImage> mImagep; // Cached image pointer of the mPartSysData UUID 120 LLPointer<LLViewerImage> mImagep; // Cached image pointer of the mPartSysData UUID
118 LLPointer<LLViewerObject> mSourceObjectp; // Source object that this particle system is attached to
119 LLPointer<LLViewerObject> mTargetObjectp; // Target object for the particle source 121 LLPointer<LLViewerObject> mTargetObjectp; // Target object for the particle source
120}; 122};
121 123
@@ -141,7 +143,6 @@ public:
141 LLColor4 mColor; 143 LLColor4 mColor;
142protected: 144protected:
143 LLPointer<LLViewerImage> mImagep; 145 LLPointer<LLViewerImage> mImagep;
144 LLPointer<LLViewerObject> mSourceObjectp;
145 LLVector3d mLKGSourcePosGlobal; 146 LLVector3d mLKGSourcePosGlobal;
146}; 147};
147 148
@@ -169,7 +170,6 @@ public:
169 170
170 static void updatePart(LLViewerPart &part, const F32 dt); 171 static void updatePart(LLViewerPart &part, const F32 dt);
171 LLPointer<LLViewerImage> mImagep; 172 LLPointer<LLViewerImage> mImagep;
172 LLPointer<LLViewerObject> mSourceObjectp;
173 LLPointer<LLViewerObject> mTargetObjectp; 173 LLPointer<LLViewerObject> mTargetObjectp;
174 LLVector3d mLKGTargetPosGlobal; 174 LLVector3d mLKGTargetPosGlobal;
175 LLColor4 mColor; 175 LLColor4 mColor;
@@ -199,7 +199,6 @@ public:
199 LLColor4 mColor; 199 LLColor4 mColor;
200protected: 200protected:
201 LLPointer<LLViewerImage> mImagep; 201 LLPointer<LLViewerImage> mImagep;
202 LLPointer<LLViewerObject> mSourceObjectp;
203 LLVector3d mLKGSourcePosGlobal; 202 LLVector3d mLKGSourcePosGlobal;
204}; 203};
205 204
diff --git a/linden/indra/newview/llviewerprecompiledheaders.h b/linden/indra/newview/llviewerprecompiledheaders.h
index 5478129..8ba45fc 100644
--- a/linden/indra/newview/llviewerprecompiledheaders.h
+++ b/linden/indra/newview/llviewerprecompiledheaders.h
@@ -82,8 +82,6 @@
82#include "lldqueueptr.h" 82#include "lldqueueptr.h"
83#include "llendianswizzle.h" 83#include "llendianswizzle.h"
84#include "llerror.h" 84#include "llerror.h"
85#include "llerrorbuffer.h"
86#include "llerrorstream.h"
87#include "llfasttimer.h" 85#include "llfasttimer.h"
88#include "llfixedbuffer.h" 86#include "llfixedbuffer.h"
89#include "llframetimer.h" 87#include "llframetimer.h"
@@ -165,7 +163,6 @@
165#include "llcachename.h" 163#include "llcachename.h"
166#include "llcallbacklisth.h" 164#include "llcallbacklisth.h"
167#include "llcircuit.h" 165#include "llcircuit.h"
168#include "llcrypto.h"
169#include "lldatapacker.h" 166#include "lldatapacker.h"
170#include "lldbstrings.h" 167#include "lldbstrings.h"
171#include "lldispatcher.h" 168#include "lldispatcher.h"
diff --git a/linden/indra/newview/llviewerregion.cpp b/linden/indra/newview/llviewerregion.cpp
index 9c741b4..88d8a40 100644
--- a/linden/indra/newview/llviewerregion.cpp
+++ b/linden/indra/newview/llviewerregion.cpp
@@ -178,14 +178,14 @@ void LLViewerRegion::loadCache()
178 178
179 LLVOCacheEntry *entry; 179 LLVOCacheEntry *entry;
180 180
181 char filename[256]; 181 char filename[256]; /* Flawfinder: ignore */
182 sprintf(filename, "%s%sobjects_%d_%d.slc", 182 snprintf(filename, sizeof(filename), "%s%sobjects_%d_%d.slc", /* Flawfinder: ignore */
183 gDirUtilp->getExpandedFilename(LL_PATH_CACHE,"").c_str(), 183 gDirUtilp->getExpandedFilename(LL_PATH_CACHE,"").c_str(),
184 gDirUtilp->getDirDelimiter().c_str(), 184 gDirUtilp->getDirDelimiter().c_str(),
185 U32(mHandle>>32)/REGION_WIDTH_UNITS, 185 U32(mHandle>>32)/REGION_WIDTH_UNITS,
186 U32(mHandle)/REGION_WIDTH_UNITS ); 186 U32(mHandle)/REGION_WIDTH_UNITS );
187 187
188 FILE *fp = LLFile::fopen(filename, "rb"); 188 FILE* fp = LLFile::fopen(filename, "rb"); /* Flawfinder: ignore */
189 if (!fp) 189 if (!fp)
190 { 190 {
191 // might not have a file, which is normal 191 // might not have a file, which is normal
@@ -259,14 +259,14 @@ void LLViewerRegion::saveCache()
259 return; 259 return;
260 } 260 }
261 261
262 char filename[256]; 262 char filename[256]; /* Flawfinder: ignore */
263 sprintf(filename, "%s%sobjects_%d_%d.slc", 263 snprintf(filename, sizeof(filename), "%s%sobjects_%d_%d.slc", /* Flawfinder: ignore */
264 gDirUtilp->getExpandedFilename(LL_PATH_CACHE,"").c_str(), 264 gDirUtilp->getExpandedFilename(LL_PATH_CACHE,"").c_str(),
265 gDirUtilp->getDirDelimiter().c_str(), 265 gDirUtilp->getDirDelimiter().c_str(),
266 U32(mHandle>>32)/REGION_WIDTH_UNITS, 266 U32(mHandle>>32)/REGION_WIDTH_UNITS,
267 U32(mHandle)/REGION_WIDTH_UNITS ); 267 U32(mHandle)/REGION_WIDTH_UNITS );
268 268
269 FILE *fp = LLFile::fopen(filename, "wb"); 269 FILE* fp = LLFile::fopen(filename, "wb"); /* Flawfinder: ignore */
270 if (!fp) 270 if (!fp)
271 { 271 {
272 llwarns << "Unable to write cache file " << filename << llendl; 272 llwarns << "Unable to write cache file " << filename << llendl;
@@ -500,9 +500,9 @@ char* SIM_ACCESS_STR[] = { "Free Trial",
500 "Unknown" }; 500 "Unknown" };
501 501
502// static 502// static
503const char* LLViewerRegion::accessToString(U8 access) 503const char* LLViewerRegion::accessToString(U8 access) /* Flawfinder: ignore */
504{ 504{
505 switch(access) 505 switch(access) /* Flawfinder: ignore */
506 { 506 {
507 case SIM_ACCESS_TRIAL: 507 case SIM_ACCESS_TRIAL:
508 return SIM_ACCESS_STR[0]; 508 return SIM_ACCESS_STR[0];
@@ -538,13 +538,13 @@ U8 LLViewerRegion::stringToAccess(const char* access_str)
538 { 538 {
539 access = SIM_ACCESS_MATURE; 539 access = SIM_ACCESS_MATURE;
540 } 540 }
541 return access; 541 return access; /* Flawfinder: ignore */
542} 542}
543 543
544// static 544// static
545const char* LLViewerRegion::accessToShortString(U8 access) 545const char* LLViewerRegion::accessToShortString(U8 access) /* Flawfinder: ignore */
546{ 546{
547 switch(access) 547 switch(access) /* Flawfinder: ignore */
548 { 548 {
549 case SIM_ACCESS_PG: 549 case SIM_ACCESS_PG:
550 return "PG"; 550 return "PG";
@@ -594,23 +594,25 @@ void LLViewerRegion::dirtyHeights()
594 } 594 }
595} 595}
596 596
597BOOL LLViewerRegion::idleUpdate(LLTimer &timer, const F32 max_time) 597BOOL LLViewerRegion::idleUpdate(F32 max_update_time)
598{ 598{
599 BOOL done = mLandp->idleUpdate(); 599 // did_update returns TRUE if we did at least one significant update
600 600 BOOL did_update = mLandp->idleUpdate(max_update_time);
601
601 if (mParcelOverlay) 602 if (mParcelOverlay)
602 { 603 {
604 // Hopefully not a significant time sink...
603 mParcelOverlay->idleUpdate(); 605 mParcelOverlay->idleUpdate();
604 } 606 }
605 607
606 return done; 608 return did_update;
607} 609}
608 610
609 611
610// As above, but forcibly do the update. 612// As above, but forcibly do the update.
611void LLViewerRegion::forceUpdate() 613void LLViewerRegion::forceUpdate()
612{ 614{
613 mLandp->idleUpdate(); 615 mLandp->idleUpdate(0.f);
614 616
615 if (mParcelOverlay) 617 if (mParcelOverlay)
616 { 618 {
@@ -845,7 +847,7 @@ LLVector3 LLViewerRegion::getPosAgentFromRegion(const LLVector3 &pos_region) con
845 847
846LLVector3 LLViewerRegion::getPosRegionFromAgent(const LLVector3 &pos_agent) const 848LLVector3 LLViewerRegion::getPosRegionFromAgent(const LLVector3 &pos_agent) const
847{ 849{
848 return getPosRegionFromGlobal(gAgent.getPosGlobalFromAgent(pos_agent)); 850 return pos_agent - getOriginAgent();
849} 851}
850 852
851F32 LLViewerRegion::getLandHeightRegion(const LLVector3& region_pos) 853F32 LLViewerRegion::getLandHeightRegion(const LLVector3& region_pos)
@@ -916,7 +918,7 @@ void LLViewerRegion::updateCoarseLocations(LLMessageSystem* msg)
916 918
917LLString LLViewerRegion::getInfoString() 919LLString LLViewerRegion::getInfoString()
918{ 920{
919 char tmp_buf[256]; 921 char tmp_buf[256]; /* Flawfinder: ignore */
920 LLString info; 922 LLString info;
921 923
922 info = "Region: "; 924 info = "Region: ";
@@ -928,7 +930,7 @@ LLString LLViewerRegion::getInfoString()
928 930
929 U32 x, y; 931 U32 x, y;
930 from_region_handle(getHandle(), &x, &y); 932 from_region_handle(getHandle(), &x, &y);
931 sprintf(tmp_buf, "%d:%d", x, y); 933 snprintf(tmp_buf, sizeof(tmp_buf), "%d:%d", x, y); /* Flawfinder: ignore */
932 info += "Handle:"; 934 info += "Handle:";
933 info += tmp_buf; 935 info += tmp_buf;
934 info += "\n"; 936 info += "\n";
@@ -1140,7 +1142,7 @@ void LLViewerRegion::unpackRegionHandshake()
1140 const S32 SIM_NAME_BUF = 256; 1142 const S32 SIM_NAME_BUF = 256;
1141 U32 region_flags; 1143 U32 region_flags;
1142 U8 sim_access; 1144 U8 sim_access;
1143 char sim_name[SIM_NAME_BUF]; 1145 char sim_name[SIM_NAME_BUF]; /* Flawfinder: ignore */
1144 LLUUID sim_owner; 1146 LLUUID sim_owner;
1145 BOOL is_estate_manager; 1147 BOOL is_estate_manager;
1146 F32 water_height; 1148 F32 water_height;
@@ -1277,8 +1279,20 @@ void LLViewerRegion::setSeedCapability(const std::string& url)
1277 LLSD capabilityNames = LLSD::emptyArray(); 1279 LLSD capabilityNames = LLSD::emptyArray();
1278 capabilityNames.append("MapLayer"); 1280 capabilityNames.append("MapLayer");
1279 capabilityNames.append("MapLayerGod"); 1281 capabilityNames.append("MapLayerGod");
1280 capabilityNames.append("NewAgentInventory"); 1282 capabilityNames.append("NewFileAgentInventory");
1281 capabilityNames.append("EventQueueGet"); 1283 capabilityNames.append("EventQueueGet");
1284 capabilityNames.append("UpdateGestureAgentInventory");
1285 capabilityNames.append("UpdateNotecardAgentInventory");
1286 capabilityNames.append("UpdateScriptAgentInventory");
1287 capabilityNames.append("UpdateGestureTaskInventory");
1288 capabilityNames.append("UpdateNotecardTaskInventory");
1289 capabilityNames.append("UpdateScriptTaskInventory");
1290 capabilityNames.append("SendPostcard");
1291 capabilityNames.append("ViewerStartAuction");
1292 capabilityNames.append("ParcelGodReserveForNewbie");
1293 capabilityNames.append("SendUserReport");
1294 capabilityNames.append("SendUserReportWithScreenshot");
1295 capabilityNames.append("RequestTextureDownload");
1282 LLHTTPClient::post(url, capabilityNames, BaseCapabilitiesComplete::build(this)); 1296 LLHTTPClient::post(url, capabilityNames, BaseCapabilitiesComplete::build(this));
1283} 1297}
1284 1298
@@ -1320,3 +1334,16 @@ std::string LLViewerRegion::getCapability(const std::string& name) const
1320 return iter->second; 1334 return iter->second;
1321} 1335}
1322 1336
1337void LLViewerRegion::logActiveCapabilities() const
1338{
1339 CapabilityMap::const_iterator iter;
1340 for (iter = mCapabilities.begin(); iter != mCapabilities.end(); iter++)
1341 {
1342 if (!iter->second.empty())
1343 {
1344 // llinfos << "Active capability is " << iter->first << llendl;
1345 llinfos << iter->first << " URL is " << iter->second << llendl;
1346 }
1347 }
1348}
1349
diff --git a/linden/indra/newview/llviewerregion.h b/linden/indra/newview/llviewerregion.h
index 76b9aaf..69a8f19 100644
--- a/linden/indra/newview/llviewerregion.h
+++ b/linden/indra/newview/llviewerregion.h
@@ -162,7 +162,7 @@ public:
162 static U8 stringToAccess(const char* access_str); 162 static U8 stringToAccess(const char* access_str);
163 163
164 // Returns "M", "PG", etc. 164 // Returns "M", "PG", etc.
165 static const char* accessToShortString(U8 access); 165 static const char* accessToShortString(U8 access); /* Flawfinder: ignore */
166 166
167 // helper function which just makes sure all interested parties 167 // helper function which just makes sure all interested parties
168 // can process the message. 168 // can process the message.
@@ -172,7 +172,7 @@ public:
172 172
173 F32 getWidth() const { return mWidth; } 173 F32 getWidth() const { return mWidth; }
174 174
175 BOOL idleUpdate(LLTimer &timer, const F32 max_time); 175 BOOL idleUpdate(F32 max_update_time);
176 176
177 // Like idleUpdate, but forces everything to complete regardless of 177 // Like idleUpdate, but forces everything to complete regardless of
178 // how long it takes. 178 // how long it takes.
@@ -188,6 +188,7 @@ public:
188 void setSeedCapability(const std::string& url); 188 void setSeedCapability(const std::string& url);
189 void setCapability(const std::string& name, const std::string& url); 189 void setCapability(const std::string& name, const std::string& url);
190 std::string getCapability(const std::string& name) const; 190 std::string getCapability(const std::string& name) const;
191 void logActiveCapabilities() const;
191 192
192 const LLHost &getHost() const { return mHost; } 193 const LLHost &getHost() const { return mHost; }
193 const U64 &getHandle() const { return mHandle; } 194 const U64 &getHandle() const { return mHandle; }
diff --git a/linden/indra/newview/llviewerreputation.cpp b/linden/indra/newview/llviewerreputation.cpp
index 8cccb6b..3ee4ab3 100644
--- a/linden/indra/newview/llviewerreputation.cpp
+++ b/linden/indra/newview/llviewerreputation.cpp
@@ -90,7 +90,7 @@ void send_reputation_agent_assign(const LLUUID& rator_id,
90 message.append(" rated you: "); 90 message.append(" rated you: ");
91 } 91 }
92 92
93 if (text && strlen(text) > 0) 93 if (text && strlen(text) > 0) /* Flawfinder: ignore */
94 { 94 {
95 message.append(text); 95 message.append(text);
96 } 96 }
diff --git a/linden/indra/newview/llviewerstats.cpp b/linden/indra/newview/llviewerstats.cpp
index e04918e..f09b297 100644
--- a/linden/indra/newview/llviewerstats.cpp
+++ b/linden/indra/newview/llviewerstats.cpp
@@ -122,13 +122,13 @@ const StatAttributes STAT_INFO[LLViewerStats::ST_COUNT] =
122 // ST_SIM_FPS_20_SECONDS 122 // ST_SIM_FPS_20_SECONDS
123 StatAttributes("Seconds with sim FPS below 20", TRUE, TRUE), 123 StatAttributes("Seconds with sim FPS below 20", TRUE, TRUE),
124 // ST_PHYS_FPS_20_SECONDS 124 // ST_PHYS_FPS_20_SECONDS
125 StatAttributes("Seconds with physics FPS below 20", TRUE, TRUE), 125 StatAttributes("Seconds with physics FPS below 20", FALSE, TRUE),
126 // ST_LOSS_05_SECONDS 126 // ST_LOSS_05_SECONDS
127 StatAttributes("Seconds with packet loss > 5%", TRUE, TRUE), 127 StatAttributes("Seconds with packet loss > 5%", TRUE, TRUE),
128 // ST_FPS_DROP_50_RATIO 128 // ST_FPS_DROP_50_RATIO
129 StatAttributes("Ratio of frames 2x longer than previous", TRUE, FALSE), 129 StatAttributes("Ratio of frames 2x longer than previous", FALSE, FALSE),
130 // ST_MEDIA_OBJECT_LIST_LENGTH 130 // ST_ENABLE_VBO
131 StatAttributes("Number of objects that want to display web pages", TRUE, FALSE), 131 StatAttributes("Vertex Buffers Enabled", TRUE, FALSE),
132 // ST_DELTA_BANDWIDTH 132 // ST_DELTA_BANDWIDTH
133 StatAttributes("Increase/Decrease in bandwidth based on packet loss", TRUE, FALSE), 133 StatAttributes("Increase/Decrease in bandwidth based on packet loss", TRUE, FALSE),
134 // ST_MAX_BANDWIDTH 134 // ST_MAX_BANDWIDTH
diff --git a/linden/indra/newview/llviewerstats.h b/linden/indra/newview/llviewerstats.h
index a3eb4c1..22f6e57 100644
--- a/linden/indra/newview/llviewerstats.h
+++ b/linden/indra/newview/llviewerstats.h
@@ -133,7 +133,7 @@ public:
133 ST_PHYS_FPS_20_SECONDS = 32, 133 ST_PHYS_FPS_20_SECONDS = 32,
134 ST_LOSS_05_SECONDS = 33, 134 ST_LOSS_05_SECONDS = 33,
135 ST_FPS_DROP_50_RATIO = 34, 135 ST_FPS_DROP_50_RATIO = 34,
136 ST_MEDIA_OBJECT_LIST_LENGTH = 35, 136 ST_ENABLE_VBO = 35,
137 ST_DELTA_BANDWIDTH = 36, 137 ST_DELTA_BANDWIDTH = 36,
138 ST_MAX_BANDWIDTH = 37, 138 ST_MAX_BANDWIDTH = 37,
139 ST_LIGHTING_DETAIL = 38, 139 ST_LIGHTING_DETAIL = 38,
diff --git a/linden/indra/newview/llviewertexteditor.cpp b/linden/indra/newview/llviewertexteditor.cpp
index 00e25af..f84c875 100644
--- a/linden/indra/newview/llviewertexteditor.cpp
+++ b/linden/indra/newview/llviewertexteditor.cpp
@@ -72,6 +72,9 @@ public:
72 LLEmbeddedItems(const LLViewerTextEditor* editor); 72 LLEmbeddedItems(const LLViewerTextEditor* editor);
73 ~LLEmbeddedItems(); 73 ~LLEmbeddedItems();
74 void clear(); 74 void clear();
75
76 // return true if there are no embedded items.
77 bool empty();
75 78
76 void bindEmbeddedChars(const LLFontGL* font); 79 void bindEmbeddedChars(const LLFontGL* font);
77 void unbindEmbeddedChars(const LLFontGL* font); 80 void unbindEmbeddedChars(const LLFontGL* font);
@@ -134,6 +137,13 @@ void LLEmbeddedItems::clear()
134 removeEmbeddedItem(*nextiter); 137 removeEmbeddedItem(*nextiter);
135 } 138 }
136 mEmbeddedUsedChars.clear(); 139 mEmbeddedUsedChars.clear();
140 mEmbeddedIndexedChars.clear();
141}
142
143bool LLEmbeddedItems::empty()
144{
145 removeUnusedChars();
146 return mEmbeddedUsedChars.empty();
137} 147}
138 148
139// Inserts a new unique entry 149// Inserts a new unique entry
@@ -1386,10 +1396,11 @@ S32 LLViewerTextEditor::insertEmbeddedItem( S32 pos, LLInventoryItem* item )
1386 1396
1387bool LLViewerTextEditor::importStream(std::istream& str) 1397bool LLViewerTextEditor::importStream(std::istream& str)
1388{ 1398{
1389 LLNotecard nc(MAX_NOTECARD_SIZE); 1399 LLNotecard nc(LLNotecard::MAX_SIZE);
1390 bool success = nc.importStream(str); 1400 bool success = nc.importStream(str);
1391 if (success) 1401 if (success)
1392 { 1402 {
1403 mEmbeddedItemList->clear();
1393 const std::vector<LLPointer<LLInventoryItem> >& items = nc.getItems(); 1404 const std::vector<LLPointer<LLInventoryItem> >& items = nc.getItems();
1394 mEmbeddedItemList->addItems(items); 1405 mEmbeddedItemList->addItems(items);
1395 // Actually set the text 1406 // Actually set the text
@@ -1415,6 +1426,11 @@ void LLViewerTextEditor::copyInventory(LLInventoryItem* item)
1415 item); 1426 item);
1416} 1427}
1417 1428
1429bool LLViewerTextEditor::hasEmbeddedInventory()
1430{
1431 return (!(mEmbeddedItemList->empty()));
1432}
1433
1418//////////////////////////////////////////////////////////////////////////// 1434////////////////////////////////////////////////////////////////////////////
1419 1435
1420BOOL LLViewerTextEditor::importBuffer( const LLString& buffer ) 1436BOOL LLViewerTextEditor::importBuffer( const LLString& buffer )
@@ -1425,7 +1441,7 @@ BOOL LLViewerTextEditor::importBuffer( const LLString& buffer )
1425 1441
1426BOOL LLViewerTextEditor::exportBuffer( LLString& buffer ) 1442BOOL LLViewerTextEditor::exportBuffer( LLString& buffer )
1427{ 1443{
1428 LLNotecard nc(MAX_NOTECARD_SIZE); 1444 LLNotecard nc(LLNotecard::MAX_SIZE);
1429 1445
1430 std::vector<LLPointer<LLInventoryItem> > embedded_items; 1446 std::vector<LLPointer<LLInventoryItem> > embedded_items;
1431 mEmbeddedItemList->getEmbeddedItemList(embedded_items); 1447 mEmbeddedItemList->getEmbeddedItemList(embedded_items);
diff --git a/linden/indra/newview/llviewertexteditor.h b/linden/indra/newview/llviewertexteditor.h
index b8452e3..da980d1 100644
--- a/linden/indra/newview/llviewertexteditor.h
+++ b/linden/indra/newview/llviewertexteditor.h
@@ -86,7 +86,14 @@ public:
86 // If this starts a line, you need to prepend a newline. 86 // If this starts a line, you need to prepend a newline.
87 87
88 void copyInventory(LLInventoryItem* item); 88 void copyInventory(LLInventoryItem* item);
89 89
90 // returns true if there is embedded inventory.
91 // *HACK: This is only useful because the notecard verifier may
92 // change the asset if there is embedded inventory. This mechanism
93 // should be changed to get a different asset id from the verifier
94 // rather than checking if a re-load is necessary. Phoenix 2007-02-27
95 bool hasEmbeddedInventory();
96
90protected: 97protected:
91 // Embedded object operations 98 // Embedded object operations
92 virtual llwchar pasteEmbeddedItem(llwchar ext_char); 99 virtual llwchar pasteEmbeddedItem(llwchar ext_char);
diff --git a/linden/indra/newview/llviewertextureanim.cpp b/linden/indra/newview/llviewertextureanim.cpp
index 0766b83..bd4d0ef 100644
--- a/linden/indra/newview/llviewertextureanim.cpp
+++ b/linden/indra/newview/llviewertextureanim.cpp
@@ -36,6 +36,9 @@ LLViewerTextureAnim::LLViewerTextureAnim() : LLTextureAnim()
36{ 36{
37 mLastFrame = -1.f; // Force an update initially 37 mLastFrame = -1.f; // Force an update initially
38 mLastTime = 0.f; 38 mLastTime = 0.f;
39 mOffS = mOffT = 0;
40 mScaleS = mScaleT = 1;
41 mRot = 0;
39} 42}
40 43
41LLViewerTextureAnim::~LLViewerTextureAnim() 44LLViewerTextureAnim::~LLViewerTextureAnim()
@@ -167,13 +170,13 @@ S32 LLViewerTextureAnim::animateTextures(F32 &off_s, F32 &off_t,
167 if (mMode & ROTATE) 170 if (mMode & ROTATE)
168 { 171 {
169 result |= ROTATE; 172 result |= ROTATE;
170 rot = frame_counter; 173 mRot = rot = frame_counter;
171 } 174 }
172 else if (mMode & SCALE) 175 else if (mMode & SCALE)
173 { 176 {
174 result |= SCALE; 177 result |= SCALE;
175 scale_s = frame_counter; 178 mScaleS = scale_s = frame_counter;
176 scale_t = frame_counter; 179 mScaleT = scale_t = frame_counter;
177 } 180 }
178 else 181 else
179 { 182 {
@@ -187,22 +190,22 @@ S32 LLViewerTextureAnim::animateTextures(F32 &off_s, F32 &off_t,
187 &&(mSizeY)) 190 &&(mSizeY))
188 { 191 {
189 result |= SCALE; 192 result |= SCALE;
190 scale_s = 1.f/mSizeX; 193 mScaleS = scale_s = 1.f/mSizeX;
191 scale_t = 1.f/mSizeY; 194 mScaleT = scale_t = 1.f/mSizeY;
192 x_frame = fmod(frame_counter, mSizeX); 195 x_frame = fmod(frame_counter, mSizeX);
193 y_frame = (S32)(frame_counter / mSizeX); 196 y_frame = (S32)(frame_counter / mSizeX);
194 x_pos = x_frame * scale_s; 197 x_pos = x_frame * scale_s;
195 y_pos = y_frame * scale_t; 198 y_pos = y_frame * scale_t;
196 off_s = (-0.5f + 0.5f*scale_s)+ x_pos; 199 mOffS = off_s = (-0.5f + 0.5f*scale_s)+ x_pos;
197 off_t = (0.5f - 0.5f*scale_t) - y_pos; 200 mOffT = off_t = (0.5f - 0.5f*scale_t) - y_pos;
198 } 201 }
199 else 202 else
200 { 203 {
201 scale_s = 1.f; 204 mScaleS = scale_s = 1.f;
202 scale_t = 1.f; 205 mScaleT = scale_t = 1.f;
203 x_pos = frame_counter * scale_s; 206 x_pos = frame_counter * scale_s;
204 off_s = (-0.5f + 0.5f*scale_s)+ x_pos; 207 mOffS = off_s = (-0.5f + 0.5f*scale_s)+ x_pos;
205 off_t = 0.f; 208 mOffT = off_t = 0.f;
206 } 209 }
207 } 210 }
208 } 211 }
diff --git a/linden/indra/newview/llviewertextureanim.h b/linden/indra/newview/llviewertextureanim.h
index 2f95cae..c5b4e84 100644
--- a/linden/indra/newview/llviewertextureanim.h
+++ b/linden/indra/newview/llviewertextureanim.h
@@ -44,6 +44,13 @@ public:
44 { 44 {
45 TRANSLATE = 0x01 // Result code JUST for animateTextures 45 TRANSLATE = 0x01 // Result code JUST for animateTextures
46 }; 46 };
47
48 F32 mOffS;
49 F32 mOffT;
50 F32 mScaleS;
51 F32 mScaleT;
52 F32 mRot;
53
47protected: 54protected:
48 LLFrameTimer mTimer; 55 LLFrameTimer mTimer;
49 F64 mLastTime; 56 F64 mLastTime;
diff --git a/linden/indra/newview/llviewerthrottle.h b/linden/indra/newview/llviewerthrottle.h
index 1ccef63..c9157bd 100644
--- a/linden/indra/newview/llviewerthrottle.h
+++ b/linden/indra/newview/llviewerthrottle.h
@@ -73,7 +73,7 @@ public:
73 73
74 LLViewerThrottleGroup getThrottleGroup(const F32 bandwidth_kbps); 74 LLViewerThrottleGroup getThrottleGroup(const F32 bandwidth_kbps);
75 75
76 static const char *sNames[TC_EOF]; 76 static const char* sNames[TC_EOF]; /* Flawfinder: ignore */
77protected: 77protected:
78 F32 mMaxBandwidth; 78 F32 mMaxBandwidth;
79 F32 mCurrentBandwidth; 79 F32 mCurrentBandwidth;
diff --git a/linden/indra/newview/llviewerwindow.cpp b/linden/indra/newview/llviewerwindow.cpp
index dc2db19..a4d38f8 100644
--- a/linden/indra/newview/llviewerwindow.cpp
+++ b/linden/indra/newview/llviewerwindow.cpp
@@ -133,6 +133,8 @@
133#include "llimview.h" 133#include "llimview.h"
134#include "lltexlayer.h" 134#include "lltexlayer.h"
135#include "lltextbox.h" 135#include "lltextbox.h"
136#include "lltexturecache.h"
137#include "lltexturefetch.h"
136#include "lltextureview.h" 138#include "lltextureview.h"
137#include "lltool.h" 139#include "lltool.h"
138#include "lltoolbar.h" 140#include "lltoolbar.h"
@@ -397,7 +399,7 @@ BOOL LLViewerWindow::handleMouseDown(LLWindow *window, LLCoordGL pos, MASK mask
397 if (gToolMgr) 399 if (gToolMgr)
398 { 400 {
399 // Don't let the user move the mouse out of the window until mouse up. 401 // Don't let the user move the mouse out of the window until mouse up.
400 if( gToolMgr->getCurrentTool(mask)->clipMouseWhenDown() ) 402 if( gToolMgr->getCurrentTool()->clipMouseWhenDown() )
401 { 403 {
402 mWindow->setMouseClipping(TRUE); 404 mWindow->setMouseClipping(TRUE);
403 } 405 }
@@ -448,7 +450,7 @@ BOOL LLViewerWindow::handleMouseDown(LLWindow *window, LLCoordGL pos, MASK mask
448 450
449 if (gToolMgr) 451 if (gToolMgr)
450 { 452 {
451 if(gToolMgr->getCurrentTool(mask)->handleMouseDown( x, y, mask ) ) 453 if(gToolMgr->getCurrentTool()->handleMouseDown( x, y, mask ) )
452 { 454 {
453 // This is necessary to force clicks in the world to cause edit 455 // This is necessary to force clicks in the world to cause edit
454 // boxes that might have keyboard focus to relinquish it, and hence 456 // boxes that might have keyboard focus to relinquish it, and hence
@@ -526,7 +528,7 @@ BOOL LLViewerWindow::handleDoubleClick(LLWindow *window, LLCoordGL pos, MASK ma
526 528
527 if (gToolMgr) 529 if (gToolMgr)
528 { 530 {
529 if(gToolMgr->getCurrentTool(mask)->handleDoubleClick( x, y, mask ) ) 531 if(gToolMgr->getCurrentTool()->handleDoubleClick( x, y, mask ) )
530 { 532 {
531 return TRUE; 533 return TRUE;
532 } 534 }
@@ -569,7 +571,7 @@ BOOL LLViewerWindow::handleMouseUp(LLWindow *window, LLCoordGL pos, MASK mask)
569 LLTool *tool = NULL; 571 LLTool *tool = NULL;
570 if (gToolMgr) 572 if (gToolMgr)
571 { 573 {
572 tool = gToolMgr->getCurrentTool(mask); 574 tool = gToolMgr->getCurrentTool();
573 575
574 if( tool->clipMouseWhenDown() ) 576 if( tool->clipMouseWhenDown() )
575 { 577 {
@@ -668,7 +670,7 @@ BOOL LLViewerWindow::handleRightMouseDown(LLWindow *window, LLCoordGL pos, MASK
668 if (gToolMgr) 670 if (gToolMgr)
669 { 671 {
670 // Don't let the user move the mouse out of the window until mouse up. 672 // Don't let the user move the mouse out of the window until mouse up.
671 if( gToolMgr->getCurrentTool(mask)->clipMouseWhenDown() ) 673 if( gToolMgr->getCurrentTool()->clipMouseWhenDown() )
672 { 674 {
673 mWindow->setMouseClipping(TRUE); 675 mWindow->setMouseClipping(TRUE);
674 } 676 }
@@ -711,7 +713,7 @@ BOOL LLViewerWindow::handleRightMouseDown(LLWindow *window, LLCoordGL pos, MASK
711 713
712 if (gToolMgr) 714 if (gToolMgr)
713 { 715 {
714 if(gToolMgr->getCurrentTool(mask)->handleRightMouseDown( x, y, mask ) ) 716 if(gToolMgr->getCurrentTool()->handleRightMouseDown( x, y, mask ) )
715 { 717 {
716 // This is necessary to force clicks in the world to cause edit 718 // This is necessary to force clicks in the world to cause edit
717 // boxes that might have keyboard focus to relinquish it, and hence 719 // boxes that might have keyboard focus to relinquish it, and hence
@@ -769,7 +771,7 @@ BOOL LLViewerWindow::handleRightMouseUp(LLWindow *window, LLCoordGL pos, MASK m
769 LLTool *tool = NULL; 771 LLTool *tool = NULL;
770 if (gToolMgr) 772 if (gToolMgr)
771 { 773 {
772 tool = gToolMgr->getCurrentTool(mask); 774 tool = gToolMgr->getCurrentTool();
773 775
774 if( tool->clipMouseWhenDown() ) 776 if( tool->clipMouseWhenDown() )
775 { 777 {
@@ -1080,19 +1082,19 @@ BOOL LLViewerWindow::handlePaint(LLWindow *window, S32 x, S32 y, S32 width, S
1080 gAgent.getName(name_str); 1082 gAgent.getName(name_str);
1081 1083
1082 S32 len; 1084 S32 len;
1083 char temp_str[255]; 1085 char temp_str[255]; /* Flawfinder: ignore */
1084 sprintf(temp_str, "%s FPS %3.1f Phy FPS %2.1f Time Dil %1.3f", 1086 snprintf(temp_str, sizeof(temp_str), "%s FPS %3.1f Phy FPS %2.1f Time Dil %1.3f", /* Flawfinder: ignore */
1085 name_str.c_str(), 1087 name_str.c_str(),
1086 gViewerStats->mFPSStat.getMeanPerSec(), 1088 gViewerStats->mFPSStat.getMeanPerSec(),
1087 gViewerStats->mSimPhysicsFPS.getPrev(0), 1089 gViewerStats->mSimPhysicsFPS.getPrev(0),
1088 gViewerStats->mSimTimeDilation.getPrev(0)); 1090 gViewerStats->mSimTimeDilation.getPrev(0));
1089 len = strlen(temp_str); 1091 len = strlen(temp_str); /* Flawfinder: ignore */
1090 TextOutA(hdc, 0, 0, temp_str, len); 1092 TextOutA(hdc, 0, 0, temp_str, len);
1091 1093
1092 1094
1093 LLVector3d pos_global = gAgent.getPositionGlobal(); 1095 LLVector3d pos_global = gAgent.getPositionGlobal();
1094 sprintf(temp_str, "Avatar pos %6.1lf %6.1lf %6.1lf", pos_global.mdV[0], pos_global.mdV[1], pos_global.mdV[2]); 1096 snprintf(temp_str, sizeof(temp_str), "Avatar pos %6.1lf %6.1lf %6.1lf", pos_global.mdV[0], pos_global.mdV[1], pos_global.mdV[2]); /* Flawfinder: ignore */
1095 len = strlen(temp_str); 1097 len = strlen(temp_str); /* Flawfinder: ignore */
1096 TextOutA(hdc, 0, 25, temp_str, len); 1098 TextOutA(hdc, 0, 25, temp_str, len);
1097 1099
1098 TextOutA(hdc, 0, 50, "Set \"DisableRendering FALSE\" in settings.ini file to reenable", 61); 1100 TextOutA(hdc, 0, 50, "Set \"DisableRendering FALSE\" in settings.ini file to reenable", 61);
@@ -1169,15 +1171,13 @@ LLViewerWindow::LLViewerWindow(
1169 mSuppressToolbox( FALSE ), 1171 mSuppressToolbox( FALSE ),
1170 mHideCursorPermanent( FALSE ), 1172 mHideCursorPermanent( FALSE ),
1171 mPickPending(FALSE), 1173 mPickPending(FALSE),
1172 mIgnoreActivate( FALSE ), 1174 mIgnoreActivate( FALSE )
1173 mRenderFullFrame(FALSE)
1174{ 1175{
1175 // Default to application directory. 1176 // Default to application directory.
1176 strcpy(LLViewerWindow::sSnapshotBaseName, "Snapshot"); 1177 strcpy(LLViewerWindow::sSnapshotBaseName, "Snapshot"); /* Flawfinder: ignore */
1177 strcpy(LLViewerWindow::sMovieBaseName, "SLmovie"); 1178 strcpy(LLViewerWindow::sMovieBaseName, "SLmovie"); /* Flawfinder: ignore */
1178 LLViewerWindow::sSnapshotDir[0] = '\0'; 1179 LLViewerWindow::sSnapshotDir[0] = '\0';
1179 1180
1180 mFastFrameTimer.stop();
1181 1181
1182 // create window 1182 // create window
1183 mWindow = LLWindowManager::createWindow( 1183 mWindow = LLWindowManager::createWindow(
@@ -1224,6 +1224,13 @@ LLViewerWindow::LLViewerWindow(
1224 1224
1225 LLFontManager::initClass(); 1225 LLFontManager::initClass();
1226 1226
1227 if (!gFeatureManagerp->isFeatureAvailable("RenderVBO") ||
1228 !gGLManager.mHasVertexBufferObject)
1229 {
1230 gSavedSettings.setBOOL("RenderVBOEnable", FALSE);
1231 }
1232 LLVertexBuffer::initClass(gSavedSettings.getBOOL("RenderVBOEnable"));
1233
1227 // 1234 //
1228 // We want to set this stuff up BEFORE we initialize the pipeline, so we can turn off 1235 // We want to set this stuff up BEFORE we initialize the pipeline, so we can turn off
1229 // stuff like AGP if we think that it'll crash the viewer. 1236 // stuff like AGP if we think that it'll crash the viewer.
@@ -1252,7 +1259,6 @@ LLViewerWindow::LLViewerWindow(
1252 gPipeline.init(); 1259 gPipeline.init();
1253 stop_glerror(); 1260 stop_glerror();
1254 initGLDefaults(); 1261 initGLDefaults();
1255 LLViewerImage::initClass();
1256 } 1262 }
1257 1263
1258 // 1264 //
@@ -1265,11 +1271,11 @@ LLViewerWindow::LLViewerWindow(
1265 // Init the image list. Must happen after GL is initialized and before the images that 1271 // Init the image list. Must happen after GL is initialized and before the images that
1266 // LLViewerWindow needs are requested. 1272 // LLViewerWindow needs are requested.
1267 gImageList.init(); 1273 gImageList.init();
1274 LLViewerImage::initClass();
1268 gBumpImageList.init(); 1275 gBumpImageList.init();
1269 1276
1270 // Create container for all sub-views 1277 // Create container for all sub-views
1271 mRootView = new LLRootView("root", mVirtualWindowRect, FALSE); 1278 mRootView = new LLRootView("root", mVirtualWindowRect, FALSE);
1272 mRootView->setRenderInFastFrame(FALSE);
1273 1279
1274 if (!gNoRender) 1280 if (!gNoRender)
1275 { 1281 {
@@ -1632,8 +1638,14 @@ void LLViewerWindow::initWorldUI()
1632 1638
1633 gStatusBar->reshape(root_rect.getWidth(), gStatusBar->getRect().getHeight(), TRUE); 1639 gStatusBar->reshape(root_rect.getWidth(), gStatusBar->getRect().getHeight(), TRUE);
1634 gStatusBar->translate(0, root_rect.getHeight() - gStatusBar->getRect().getHeight()); 1640 gStatusBar->translate(0, root_rect.getHeight() - gStatusBar->getRect().getHeight());
1641 // sync bg color with menu bar
1642 gStatusBar->setBackgroundColor( gMenuBarView->getBackgroundColor() );
1643
1635 1644
1636 gViewerWindow->getRootView()->addChild(gStatusBar); 1645 gViewerWindow->getRootView()->addChild(gStatusBar);
1646
1647 // menu holder appears on top to get first pass at all mouse events
1648 gViewerWindow->getRootView()->sendChildToFront(gMenuHolder);
1637} 1649}
1638 1650
1639 1651
@@ -1693,11 +1705,23 @@ LLViewerWindow::~LLViewerWindow()
1693 1705
1694 LLWorldMapView::cleanupTextures(); 1706 LLWorldMapView::cleanupTextures();
1695 1707
1708 llinfos << "Cleaning up pipeline" << llendl;
1709 gPipeline.cleanup();
1710 stop_glerror();
1711
1696 LLViewerImage::cleanupClass(); 1712 LLViewerImage::cleanupClass();
1697 1713
1698 delete[] mPickBuffer; 1714 delete[] mPickBuffer;
1699 mPickBuffer = NULL; 1715 mPickBuffer = NULL;
1700 1716
1717 if (gSelectMgr)
1718 {
1719 llinfos << "Cleaning up select manager" << llendl;
1720 gSelectMgr->cleanup();
1721 }
1722
1723 LLVertexBuffer::cleanupClass();
1724
1701 llinfos << "Stopping GL during shutdown" << llendl; 1725 llinfos << "Stopping GL during shutdown" << llendl;
1702 if (!gNoRender) 1726 if (!gNoRender)
1703 { 1727 {
@@ -1705,15 +1729,7 @@ LLViewerWindow::~LLViewerWindow()
1705 stop_glerror(); 1729 stop_glerror();
1706 } 1730 }
1707 1731
1708 if (gSelectMgr)
1709 {
1710 llinfos << "Cleaning up select manager" << llendl;
1711 gSelectMgr->cleanup();
1712 }
1713 1732
1714 llinfos << "Cleaning up pipeline" << llendl;
1715 gPipeline.cleanup();
1716 stop_glerror();
1717 llinfos << "Destroying Window" << llendl; 1733 llinfos << "Destroying Window" << llendl;
1718 destroyWindow(); 1734 destroyWindow();
1719} 1735}
@@ -1876,7 +1892,7 @@ void LLViewerWindow::draw()
1876 if (gSavedSettings.getBOOL("DisplayTimecode")) 1892 if (gSavedSettings.getBOOL("DisplayTimecode"))
1877 { 1893 {
1878 // draw timecode block 1894 // draw timecode block
1879 char text[256]; 1895 char text[256]; /* Flawfinder: ignore */
1880 1896
1881 glLoadIdentity(); 1897 glLoadIdentity();
1882 1898
@@ -1925,7 +1941,7 @@ void LLViewerWindow::draw()
1925 if (gToolMgr) 1941 if (gToolMgr)
1926 { 1942 {
1927 // Draw tool specific overlay on world 1943 // Draw tool specific overlay on world
1928 gToolMgr->getCurrentTool( gKeyboard->currentMask(TRUE) )->draw(); 1944 gToolMgr->getCurrentTool()->draw();
1929 } 1945 }
1930 1946
1931 if( gAgent.cameraMouselook() ) 1947 if( gAgent.cameraMouselook() )
@@ -2113,7 +2129,7 @@ BOOL LLViewerWindow::handleKey(KEY key, MASK mask)
2113 2129
2114 if (gToolMgr) 2130 if (gToolMgr)
2115 { 2131 {
2116 if( gToolMgr->getCurrentTool(mask)->handleKey(key, mask) ) 2132 if( gToolMgr->getCurrentTool()->handleKey(key, mask) )
2117 { 2133 {
2118 return TRUE; 2134 return TRUE;
2119 } 2135 }
@@ -2175,7 +2191,9 @@ BOOL LLViewerWindow::handleKey(KEY key, MASK mask)
2175 } 2191 }
2176 2192
2177 // don't pass keys on to world when something in ui has focus 2193 // don't pass keys on to world when something in ui has focus
2178 return gFocusMgr.childHasKeyboardFocus(mRootView) || (gMenuBarView && gMenuBarView->getHighlightedItem()); 2194 return gFocusMgr.childHasKeyboardFocus(mRootView)
2195 || LLMenuGL::getKeyboardMode()
2196 || (gMenuBarView && gMenuBarView->getHighlightedItem() && gMenuBarView->getHighlightedItem()->isActive());
2179} 2197}
2180 2198
2181 2199
@@ -2279,44 +2297,15 @@ void LLViewerWindow::handleScrollWheel(S32 clicks)
2279 2297
2280void LLViewerWindow::moveCursorToCenter() 2298void LLViewerWindow::moveCursorToCenter()
2281{ 2299{
2282#if 1 // old version
2283
2284#if 0 // Dave's changes - this reportedly is making the drift worse on some systems?
2285 S32 x = llround((F32) mVirtualWindowRect.getWidth() / 2);
2286 S32 y = llround((F32) mVirtualWindowRect.getHeight() / 2);
2287#else
2288 S32 x = mVirtualWindowRect.getWidth() / 2; 2300 S32 x = mVirtualWindowRect.getWidth() / 2;
2289 S32 y = mVirtualWindowRect.getHeight() / 2; 2301 S32 y = mVirtualWindowRect.getHeight() / 2;
2290#endif
2291 2302
2292 //on a forced move, all deltas get zeroed out to prevent jumping 2303 //on a forced move, all deltas get zeroed out to prevent jumping
2293 mCurrentMousePoint.set(x,y); 2304 mCurrentMousePoint.set(x,y);
2294 mLastMousePoint.set(x,y); 2305 mLastMousePoint.set(x,y);
2295 mCurrentMouseDelta.set(0,0); 2306 mCurrentMouseDelta.set(0,0);
2296 2307
2297 LLUI::setCursorPositionScreen(x, y); 2308 LLUI::setCursorPositionScreen(x, y);
2298
2299#else // Richard's version - fails on intel macs
2300
2301 S32 x = llround((F32) mWindowRect.getWidth() / 2);
2302 S32 y = llround((F32) mWindowRect.getHeight() / 2);
2303
2304 LLCoordWindow window_point;
2305 mWindow->convertCoords(LLCoordGL(x, y), &window_point);
2306 mWindow->setCursorPosition(window_point);
2307
2308 // read back cursor position
2309 mWindow->getCursorPosition(&window_point);
2310 LLCoordGL new_mouse_pos;
2311 mWindow->convertCoords(window_point, &new_mouse_pos);
2312 new_mouse_pos.mX = llround((F32)new_mouse_pos.mX / mDisplayScale.mV[VX]);
2313 new_mouse_pos.mY = llround((F32)new_mouse_pos.mY / mDisplayScale.mV[VY]);
2314
2315 //on a forced move, all deltas get zeroed out to prevent jumping
2316 mCurrentMousePoint = new_mouse_pos;
2317 mLastMousePoint = new_mouse_pos;
2318 mCurrentMouseDelta.set(0,0);
2319#endif
2320} 2309}
2321 2310
2322////////////////////////////////////////////////////////////////////// 2311//////////////////////////////////////////////////////////////////////
@@ -2345,10 +2334,29 @@ BOOL LLViewerWindow::handlePerFrameHover()
2345 mMouseInWindow = TRUE; 2334 mMouseInWindow = TRUE;
2346 } 2335 }
2347 2336
2348 S32 dx = mCurrentMousePoint.mX - mLastMousePoint.mX; 2337 S32 dx = lltrunc((F32) (mCurrentMousePoint.mX - mLastMousePoint.mX) * LLUI::sGLScaleFactor.mV[VX]);
2349 S32 dy = mCurrentMousePoint.mY - mLastMousePoint.mY; 2338 S32 dy = lltrunc((F32) (mCurrentMousePoint.mY - mLastMousePoint.mY) * LLUI::sGLScaleFactor.mV[VY]);
2350 mCurrentMouseDelta.set(dx,dy); 2339
2351 LLVector2 mouse_vel((F32)dx, (F32)dy); 2340 LLVector2 mouse_vel;
2341
2342 if (gSavedSettings.getBOOL("MouseSmooth"))
2343 {
2344 static F32 fdx = 0.f;
2345 static F32 fdy = 0.f;
2346
2347 F32 amount = 16.f;
2348 fdx = fdx + ((F32) dx - fdx) * llmin(gFrameIntervalSeconds*amount,1.f);
2349 fdy = fdy + ((F32) dy - fdy) * llmin(gFrameIntervalSeconds*amount,1.f);
2350
2351 mCurrentMouseDelta.set(llround(fdx), llround(fdy));
2352 mouse_vel.setVec(fdx,fdy);
2353 }
2354 else
2355 {
2356 mCurrentMouseDelta.set(dx, dy);
2357 mouse_vel.setVec((F32) dx, (F32) dy);
2358 }
2359
2352 mMouseVelocityStat.addValue(mouse_vel.magVec()); 2360 mMouseVelocityStat.addValue(mouse_vel.magVec());
2353 2361
2354 if (gNoRender) 2362 if (gNoRender)
@@ -2473,7 +2481,7 @@ BOOL LLViewerWindow::handlePerFrameHover()
2473 LLTool *tool = NULL; 2481 LLTool *tool = NULL;
2474 if (gToolMgr && gHoverView) 2482 if (gToolMgr && gHoverView)
2475 { 2483 {
2476 tool = gToolMgr->getCurrentTool(mask); 2484 tool = gToolMgr->getCurrentTool();
2477 2485
2478 if(!handled && tool) 2486 if(!handled && tool)
2479 { 2487 {
@@ -2493,8 +2501,8 @@ BOOL LLViewerWindow::handlePerFrameHover()
2493 // Suppress the toolbox view if our source tool was the pie tool, 2501 // Suppress the toolbox view if our source tool was the pie tool,
2494 // and we've overridden to something else. 2502 // and we've overridden to something else.
2495 mSuppressToolbox = 2503 mSuppressToolbox =
2496 (gToolMgr->getCurrentTool(MASK_NONE) == gToolPie) && 2504 (gToolMgr->getBaseTool() == gToolPie) &&
2497 (gToolMgr->getCurrentTool(mask) != gToolPie); 2505 (gToolMgr->getCurrentTool() != gToolPie);
2498 2506
2499 } 2507 }
2500 2508
@@ -2555,15 +2563,15 @@ BOOL LLViewerWindow::handlePerFrameHover()
2555 (tool != gToolPie // not default tool 2563 (tool != gToolPie // not default tool
2556 && tool != gToolGun // not coming out of mouselook 2564 && tool != gToolGun // not coming out of mouselook
2557 && !mSuppressToolbox // not override in third person 2565 && !mSuppressToolbox // not override in third person
2558 && gCurrentToolset != gFaceEditToolset // not special mode 2566 && gToolMgr->getCurrentToolset() != gFaceEditToolset // not special mode
2559 && gCurrentToolset != gMouselookToolset 2567 && gToolMgr->getCurrentToolset() != gMouselookToolset
2560 && (!captor || captor->isView())) // not dragging 2568 && (!captor || captor->isView())) // not dragging
2561 ) 2569 )
2562 { 2570 {
2563 // Force floater tools to be visible (unless minimized) 2571 // Force floater tools to be visible (unless minimized)
2564 if (!gFloaterTools->getVisible()) 2572 if (!gFloaterTools->getVisible())
2565 { 2573 {
2566 gFloaterTools->open(); 2574 gFloaterTools->open(); /* Flawfinder: ignore */
2567 } 2575 }
2568 // Update the location of the blue box tool popup 2576 // Update the location of the blue box tool popup
2569 LLCoordGL select_center_screen; 2577 LLCoordGL select_center_screen;
@@ -2669,7 +2677,7 @@ BOOL LLViewerWindow::handlePerFrameHover()
2669 mLastMousePoint = mCurrentMousePoint; 2677 mLastMousePoint = mCurrentMousePoint;
2670 2678
2671 // last ditch force of edit menu to selection manager 2679 // last ditch force of edit menu to selection manager
2672 if (gEditMenuHandler == NULL && gSelectMgr && gSelectMgr->getObjectCount()) 2680 if (gEditMenuHandler == NULL && gSelectMgr && gSelectMgr->getSelection()->getObjectCount())
2673 { 2681 {
2674 gEditMenuHandler = gSelectMgr; 2682 gEditMenuHandler = gSelectMgr;
2675 } 2683 }
@@ -2705,15 +2713,15 @@ BOOL LLViewerWindow::handlePerFrameHover()
2705 gChatBar->startChat(NULL); 2713 gChatBar->startChat(NULL);
2706 } 2714 }
2707 2715
2708 // sync land selection with edit and about land dialogs 2716 // cleanup unused selections when no modal dialogs are open
2709 if (gParcelMgr 2717 if (gParcelMgr && LLModalDialog::activeCount() == 0)
2710 && !gMenuHolder->hasVisibleMenu() 2718 {
2711 && !LLFloaterLand::floaterVisible() 2719 gParcelMgr->deselectUnused();
2712 && !LLFloaterBuyLand::isOpen() 2720 }
2713 && !LLPanelLandGeneral::buyPassDialogVisible() 2721
2714 && (!gFloaterTools || !gFloaterTools->getVisible())) 2722 if (gSelectMgr && LLModalDialog::activeCount() == 0)
2715 { 2723 {
2716 gParcelMgr->deselectLand(); 2724 gSelectMgr->deselectUnused();
2717 } 2725 }
2718 2726
2719 return handled; 2727 return handled;
@@ -2761,6 +2769,7 @@ void LLViewerWindow::saveLastMouse(const LLCoordGL &point)
2761void LLViewerWindow::renderSelections( BOOL for_gl_pick, BOOL pick_parcel_walls, BOOL for_hud ) 2769void LLViewerWindow::renderSelections( BOOL for_gl_pick, BOOL pick_parcel_walls, BOOL for_hud )
2762{ 2770{
2763 LLViewerObject* object; 2771 LLViewerObject* object;
2772 LLObjectSelectionHandle selection = gSelectMgr->getSelection();
2764 2773
2765 if (!for_hud && !for_gl_pick) 2774 if (!for_hud && !for_gl_pick)
2766 { 2775 {
@@ -2776,15 +2785,15 @@ void LLViewerWindow::renderSelections( BOOL for_gl_pick, BOOL pick_parcel_walls,
2776 gParcelMgr->renderParcelCollision(); 2785 gParcelMgr->renderParcelCollision();
2777 } 2786 }
2778 } 2787 }
2779 else if (( for_hud && gSelectMgr->getSelectType() == SELECT_TYPE_HUD) || 2788 else if (( for_hud && selection->getSelectType() == SELECT_TYPE_HUD) ||
2780 (!for_hud && gSelectMgr->getSelectType() != SELECT_TYPE_HUD)) 2789 (!for_hud && selection->getSelectType() != SELECT_TYPE_HUD))
2781 { 2790 {
2782 gSelectMgr->renderSilhouettes(for_hud); 2791 gSelectMgr->renderSilhouettes(for_hud);
2783 2792
2784 stop_glerror(); 2793 stop_glerror();
2785 2794
2786 // setup HUD render 2795 // setup HUD render
2787 if (gSelectMgr->getSelectType() == SELECT_TYPE_HUD && gSelectMgr->getObjectCount()) 2796 if (selection->getSelectType() == SELECT_TYPE_HUD && gSelectMgr->getSelection()->getObjectCount())
2788 { 2797 {
2789 LLBBox hud_bbox = gAgent.getAvatarObject()->getHUDBBox(); 2798 LLBBox hud_bbox = gAgent.getAvatarObject()->getHUDBBox();
2790 2799
@@ -2810,12 +2819,12 @@ void LLViewerWindow::renderSelections( BOOL for_gl_pick, BOOL pick_parcel_walls,
2810 LLGLDepthTest gls_depth(GL_TRUE, GL_TRUE); 2819 LLGLDepthTest gls_depth(GL_TRUE, GL_TRUE);
2811 glMatrixMode(GL_MODELVIEW); 2820 glMatrixMode(GL_MODELVIEW);
2812 glPushMatrix(); 2821 glPushMatrix();
2813 if (gSelectMgr->getSelectType() == SELECT_TYPE_HUD) 2822 if (selection->getSelectType() == SELECT_TYPE_HUD)
2814 { 2823 {
2815 F32 zoom = gAgent.getAvatarObject()->mHUDCurZoom; 2824 F32 zoom = gAgent.getAvatarObject()->mHUDCurZoom;
2816 glScalef(zoom, zoom, zoom); 2825 glScalef(zoom, zoom, zoom);
2817 } 2826 }
2818 for( object = gSelectMgr->getFirstObject(); object; object = gSelectMgr->getNextObject() ) 2827 for( object = gSelectMgr->getSelection()->getFirstObject(); object; object = gSelectMgr->getSelection()->getNextObject() )
2819 { 2828 {
2820 LLDrawable* drawable = object->mDrawable; 2829 LLDrawable* drawable = object->mDrawable;
2821 if (drawable && drawable->isLight()) 2830 if (drawable && drawable->isLight())
@@ -2850,7 +2859,7 @@ void LLViewerWindow::renderSelections( BOOL for_gl_pick, BOOL pick_parcel_walls,
2850 // not be recalculated at this time. If they are, then group rotations will break. 2859 // not be recalculated at this time. If they are, then group rotations will break.
2851 2860
2852 // Draw arrows at average center of all selected objects 2861 // Draw arrows at average center of all selected objects
2853 LLTool* tool = gToolMgr->getCurrentTool( gKeyboard->currentMask(TRUE) ); 2862 LLTool* tool = gToolMgr->getCurrentTool();
2854 if (tool) 2863 if (tool)
2855 { 2864 {
2856 if(tool->isAlwaysRendered()) 2865 if(tool->isAlwaysRendered())
@@ -2859,13 +2868,13 @@ void LLViewerWindow::renderSelections( BOOL for_gl_pick, BOOL pick_parcel_walls,
2859 } 2868 }
2860 else 2869 else
2861 { 2870 {
2862 if( !gSelectMgr->isEmpty() ) 2871 if( !gSelectMgr->getSelection()->isEmpty() )
2863 { 2872 {
2864 BOOL moveable_object_selected = FALSE; 2873 BOOL moveable_object_selected = FALSE;
2865 BOOL all_selected_objects_move = TRUE; 2874 BOOL all_selected_objects_move = TRUE;
2866 BOOL all_selected_objects_modify = TRUE; 2875 BOOL all_selected_objects_modify = TRUE;
2867 BOOL selecting_linked_set = gSavedSettings.getBOOL("SelectLinkedSet"); 2876 BOOL selecting_linked_set = gSavedSettings.getBOOL("SelectLinkedSet");
2868 for( object = gSelectMgr->getFirstObject(); object; object = gSelectMgr->getNextObject() ) 2877 for( object = gSelectMgr->getSelection()->getFirstObject(); object; object = gSelectMgr->getSelection()->getNextObject() )
2869 { 2878 {
2870 BOOL this_object_movable = FALSE; 2879 BOOL this_object_movable = FALSE;
2871 if (object->permMove() && (object->permModify() || selecting_linked_set)) 2880 if (object->permMove() && (object->permModify() || selecting_linked_set))
@@ -2900,7 +2909,7 @@ void LLViewerWindow::renderSelections( BOOL for_gl_pick, BOOL pick_parcel_walls,
2900 } 2909 }
2901 } 2910 }
2902 } 2911 }
2903 if (gSelectMgr->getSelectType() == SELECT_TYPE_HUD && gSelectMgr->getObjectCount()) 2912 if (selection->getSelectType() == SELECT_TYPE_HUD && selection->getObjectCount())
2904 { 2913 {
2905 glMatrixMode(GL_PROJECTION); 2914 glMatrixMode(GL_PROJECTION);
2906 glPopMatrix(); 2915 glPopMatrix();
@@ -2963,8 +2972,6 @@ void LLViewerWindow::hitObjectOrLandGlobalAsync(S32 x, S32 y_from_bot, MASK mask
2963 S32 scaled_x = llround((F32)x * mDisplayScale.mV[VX]); 2972 S32 scaled_x = llround((F32)x * mDisplayScale.mV[VX]);
2964 S32 scaled_y = llround((F32)y_from_bot * mDisplayScale.mV[VY]); 2973 S32 scaled_y = llround((F32)y_from_bot * mDisplayScale.mV[VY]);
2965 2974
2966 F32 delta_time = gAlphaFadeTimer.getElapsedTimeAndResetF32();
2967
2968 BOOL in_build_mode = gFloaterTools && gFloaterTools->getVisible(); 2975 BOOL in_build_mode = gFloaterTools && gFloaterTools->getVisible();
2969 if (in_build_mode || LLDrawPoolAlpha::sShowDebugAlpha) 2976 if (in_build_mode || LLDrawPoolAlpha::sShowDebugAlpha)
2970 { 2977 {
@@ -2974,17 +2981,6 @@ void LLViewerWindow::hitObjectOrLandGlobalAsync(S32 x, S32 y_from_bot, MASK mask
2974 } 2981 }
2975 gPickTransparent = pick_transparent; 2982 gPickTransparent = pick_transparent;
2976 2983
2977 if (gPickTransparent)
2978 {
2979 gPickAlphaTargetThreshold = 0.f;
2980 gPickAlphaThreshold = llmax(gPickAlphaTargetThreshold, gPickAlphaThreshold - (delta_time * 0.7f));
2981 }
2982 else
2983 {
2984 gPickAlphaTargetThreshold = 1.f;
2985 gPickAlphaThreshold = llmin(gPickAlphaTargetThreshold, gPickAlphaThreshold + (delta_time * 0.7f));
2986 }
2987
2988 gUseGLPick = FALSE; 2984 gUseGLPick = FALSE;
2989 mPickCallback = callback; 2985 mPickCallback = callback;
2990 2986
@@ -3151,8 +3147,6 @@ void LLViewerWindow::performPick()
3151 return; 3147 return;
3152 } 3148 }
3153 3149
3154 finishFastFrame();
3155
3156 mPickPending = FALSE; 3150 mPickPending = FALSE;
3157 U32 te_offset = NO_FACE; 3151 U32 te_offset = NO_FACE;
3158 3152
@@ -3407,8 +3401,8 @@ void LLViewerWindow::analyzeHit(
3407 const S32 UV_PICK_WIDTH = 41; 3401 const S32 UV_PICK_WIDTH = 41;
3408 const S32 UV_PICK_HALF_WIDTH = (UV_PICK_WIDTH - 1) / 2; 3402 const S32 UV_PICK_HALF_WIDTH = (UV_PICK_WIDTH - 1) / 2;
3409 U8 uv_pick_buffer[UV_PICK_WIDTH * UV_PICK_WIDTH * 4]; 3403 U8 uv_pick_buffer[UV_PICK_WIDTH * UV_PICK_WIDTH * 4];
3410 S32 pick_face = ((LLVOVolume*)objectp)->getAllTEsSame() ? 0 : face; 3404 S32 pick_face = face;
3411 LLFace* facep = objectp->mDrawable->getFace(objectp->getFaceIndexOffset() + pick_face); 3405 LLFace* facep = objectp->mDrawable->getFace(pick_face);
3412 gCamera->setPerspective(FOR_SELECTION, scaled_x - UV_PICK_HALF_WIDTH, scaled_y - UV_PICK_HALF_WIDTH, UV_PICK_WIDTH, UV_PICK_WIDTH, FALSE); 3406 gCamera->setPerspective(FOR_SELECTION, scaled_x - UV_PICK_HALF_WIDTH, scaled_y - UV_PICK_HALF_WIDTH, UV_PICK_WIDTH, UV_PICK_WIDTH, FALSE);
3413 glViewport(scaled_x - UV_PICK_HALF_WIDTH, scaled_y - UV_PICK_HALF_WIDTH, UV_PICK_WIDTH, UV_PICK_WIDTH); 3407 glViewport(scaled_x - UV_PICK_HALF_WIDTH, scaled_y - UV_PICK_HALF_WIDTH, UV_PICK_WIDTH, UV_PICK_WIDTH);
3414 gPipeline.renderFaceForUVSelect(facep); 3408 gPipeline.renderFaceForUVSelect(facep);
@@ -3438,45 +3432,6 @@ void LLViewerWindow::analyzeHit(
3438 //llinfos << "DEBUG Hit Nothing " << llendl; 3432 //llinfos << "DEBUG Hit Nothing " << llendl;
3439} 3433}
3440 3434
3441
3442void LLViewerWindow::requestFastFrame(LLView *view)
3443{
3444 if (!mPickPending &&
3445 mWindow->getSwapMethod() != LLWindow::SWAP_METHOD_UNDEFINED &&
3446 gStartupState >= STATE_STARTED &&
3447 gSavedSettings.getBOOL("RenderFastUI") &&
3448 !gbCapturing)
3449 {
3450 if (!mFastFrameTimer.getStarted())
3451 {
3452 // we're double buffered, so when first requesting a fast ui update
3453 // we need to render the scene again so that the front and back buffers
3454 // are synced
3455 mRenderFullFrame = TRUE;
3456 }
3457 // calculation new expiration time and reset timer
3458 F32 expiration;
3459 if (mFastFrameTimer.hasExpired())
3460 {
3461 expiration = FAST_FRAME_INCREMENT;
3462 }
3463 else
3464 {
3465 expiration = llmin(MAX_FAST_FRAME_TIME, mFastFrameTimer.getTimeToExpireF32() + FAST_FRAME_INCREMENT);
3466 }
3467
3468 mFastFrameTimer.start();
3469 mFastFrameTimer.setTimerExpirySec(expiration);
3470
3471 LLView::sFastFrameView = view->getRootMostFastFrameView();
3472 if (!LLView::sFastFrameView)
3473 {
3474 LLView::sFastFrameView = view;
3475 }
3476 }
3477}
3478
3479
3480// Returns unit vector relative to camera 3435// Returns unit vector relative to camera
3481// indicating direction of point on screen x,y 3436// indicating direction of point on screen x,y
3482LLVector3 LLViewerWindow::mouseDirectionGlobal(const S32 x, const S32 y) const 3437LLVector3 LLViewerWindow::mouseDirectionGlobal(const S32 x, const S32 y) const
@@ -3673,37 +3628,54 @@ BOOL LLViewerWindow::mousePointOnLandGlobal(const S32 x, const S32 y, LLVector3d
3673} 3628}
3674 3629
3675// Saves an image to the harddrive as "SnapshotX" where X >= 1. 3630// Saves an image to the harddrive as "SnapshotX" where X >= 1.
3676BOOL LLViewerWindow::saveImageNumbered(LLImageRaw *raw) 3631BOOL LLViewerWindow::saveImageNumbered(LLImageRaw *raw, const LLString& extension_in)
3677{ 3632{
3678 if (! raw) 3633 if (! raw)
3679 { 3634 {
3680 return FALSE; 3635 return FALSE;
3681 } 3636 }
3637
3638 LLString extension(extension_in);
3639 if (extension.empty())
3640 {
3641 extension = (gSavedSettings.getBOOL("CompressSnapshotsToDisk")) ? ".j2c" : ".bmp";
3642 }
3643
3644 LLFilePicker::ESaveFilter pick_type;
3645 if (extension == ".j2c")
3646 pick_type = LLFilePicker::FFSAVE_J2C;
3647 else if (extension == ".bmp")
3648 pick_type = LLFilePicker::FFSAVE_BMP;
3649 else if (extension == ".tga")
3650 pick_type = LLFilePicker::FFSAVE_TGA;
3651 else
3652 pick_type = LLFilePicker::FFSAVE_ALL; // ???
3682 3653
3683 // Get a directory if this is the first time. 3654 // Get a directory if this is the first time.
3684 if (strlen(sSnapshotDir) == 0) 3655 if (strlen(sSnapshotDir) == 0) /* Flawfinder: ignore */
3685 { 3656 {
3686 LLString proposed_name( sSnapshotBaseName ); 3657 LLString proposed_name( sSnapshotBaseName );
3687 proposed_name.append( ".bmp" ); 3658 proposed_name.append( extension );
3688 3659
3689 // pick a directory in which to save 3660 // pick a directory in which to save
3690 LLFilePicker& picker = LLFilePicker::instance(); 3661 LLFilePicker& picker = LLFilePicker::instance();
3691 if (!picker.getSaveFile(LLFilePicker::FFSAVE_BMP, proposed_name.c_str())) 3662 if (!picker.getSaveFile(pick_type, proposed_name.c_str()))
3692 { 3663 {
3693 // Clicked cancel 3664 // Clicked cancel
3694 return FALSE; 3665 return FALSE;
3695 } 3666 }
3696 3667
3697 // Copy the directory + file name 3668 // Copy the directory + file name
3698 char directory[LL_MAX_PATH]; 3669 char directory[LL_MAX_PATH]; /* Flawfinder: ignore */
3699 strcpy(directory, picker.getFirstFile()); 3670 strncpy(directory, picker.getFirstFile(), LL_MAX_PATH -1); /* Flawfinder: ignore */
3671 directory[LL_MAX_PATH -1] = '\0';
3700 3672
3701 // Smash the file extension 3673 // Smash the file extension
3702 S32 length = strlen(directory); 3674 S32 length = strlen(directory); /* Flawfinder: ignore */
3703 S32 index = length; 3675 S32 index = length;
3704 3676
3705 // Back up over ".bmp" 3677 // Back up over extension
3706 index -= 4; 3678 index -= extension.length();
3707 if (index >= 0 && directory[index] == '.') 3679 if (index >= 0 && directory[index] == '.')
3708 { 3680 {
3709 directory[index] = '\0'; 3681 directory[index] = '\0';
@@ -3724,12 +3696,14 @@ BOOL LLViewerWindow::saveImageNumbered(LLImageRaw *raw)
3724 { 3696 {
3725 if (index + 1 <= length) 3697 if (index + 1 <= length)
3726 { 3698 {
3727 strcpy(LLViewerWindow::sSnapshotBaseName, directory + index + 1); 3699 strncpy(LLViewerWindow::sSnapshotBaseName, directory + index + 1, LL_MAX_PATH -1); /* Flawfinder: ignore */
3700 LLViewerWindow::sSnapshotBaseName[LL_MAX_PATH -1] = '\0';
3728 } 3701 }
3729 3702
3730 index++; 3703 index++;
3731 directory[index] = '\0'; 3704 directory[index] = '\0';
3732 strcpy(LLViewerWindow::sSnapshotDir, directory); 3705 strncpy(LLViewerWindow::sSnapshotDir, directory, LL_MAX_PATH -1); /* Flawfinder: ignore */
3706 LLViewerWindow::sSnapshotDir[LL_MAX_PATH -1] = '\0';
3733 } 3707 }
3734 } 3708 }
3735 3709
@@ -3740,10 +3714,9 @@ BOOL LLViewerWindow::saveImageNumbered(LLImageRaw *raw)
3740 3714
3741 do 3715 do
3742 { 3716 {
3743 char extension[100];
3744 sprintf( extension, "_%.3d.bmp", i );
3745 filepath = sSnapshotDir; 3717 filepath = sSnapshotDir;
3746 filepath += sSnapshotBaseName; 3718 filepath += sSnapshotBaseName;
3719 filepath += llformat("_%.3d",i);
3747 filepath += extension; 3720 filepath += extension;
3748 3721
3749 struct stat stat_info; 3722 struct stat stat_info;
@@ -3752,12 +3725,12 @@ BOOL LLViewerWindow::saveImageNumbered(LLImageRaw *raw)
3752 } 3725 }
3753 while( -1 != err ); // search until the file is not found (i.e., stat() gives an error). 3726 while( -1 != err ); // search until the file is not found (i.e., stat() gives an error).
3754 3727
3755 LLPointer<LLImageBMP> bmp_image = new LLImageBMP; 3728 LLPointer<LLImageFormatted> formatted_image = LLImageFormatted::createFromExtension(extension);
3756 LLImageBase::setSizeOverride(TRUE); 3729 LLImageBase::setSizeOverride(TRUE);
3757 BOOL success = bmp_image->encode(raw); 3730 BOOL success = formatted_image->encode(raw);
3758 if( success ) 3731 if( success )
3759 { 3732 {
3760 success = bmp_image->save(filepath); 3733 success = formatted_image->save(filepath);
3761 } 3734 }
3762 else 3735 else
3763 { 3736 {
@@ -3773,7 +3746,7 @@ void LLViewerWindow::saveMovieNumbered(void*)
3773 if (!gbCapturing) 3746 if (!gbCapturing)
3774 { 3747 {
3775 // Get a directory if this is the first time. 3748 // Get a directory if this is the first time.
3776 if (strlen(sSnapshotDir) == 0) 3749 if (strlen(sSnapshotDir) == 0) /* Flawfinder: ignore */
3777 { 3750 {
3778 LLString proposed_name( sMovieBaseName ); 3751 LLString proposed_name( sMovieBaseName );
3779#if LL_DARWIN 3752#if LL_DARWIN
@@ -3791,11 +3764,12 @@ void LLViewerWindow::saveMovieNumbered(void*)
3791 } 3764 }
3792 3765
3793 // Copy the directory + file name 3766 // Copy the directory + file name
3794 char directory[LL_MAX_PATH]; 3767 char directory[LL_MAX_PATH]; /* Flawfinder: ignore */
3795 strcpy(directory, picker.getFirstFile()); 3768 strncpy(directory, picker.getFirstFile(), LL_MAX_PATH -1); /* Flawfinder: ignore */
3769 directory[LL_MAX_PATH -1] = '\0';
3796 3770
3797 // Smash the file extension 3771 // Smash the file extension
3798 S32 length = strlen(directory); 3772 S32 length = strlen(directory); /* Flawfinder: ignore */
3799 S32 index = length; 3773 S32 index = length;
3800 3774
3801 // Back up over ".bmp" 3775 // Back up over ".bmp"
@@ -3820,12 +3794,14 @@ void LLViewerWindow::saveMovieNumbered(void*)
3820 { 3794 {
3821 if (index + 1 <= length) 3795 if (index + 1 <= length)
3822 { 3796 {
3823 strcpy(LLViewerWindow::sMovieBaseName, directory + index + 1); 3797 strncpy(LLViewerWindow::sMovieBaseName, directory + index + 1, LL_MAX_PATH -1); /* Flawfinder: ignore */
3798 LLViewerWindow::sMovieBaseName[LL_MAX_PATH -1] = '\0';
3824 } 3799 }
3825 3800
3826 index++; 3801 index++;
3827 directory[index] = '\0'; 3802 directory[index] = '\0';
3828 strcpy(LLViewerWindow::sSnapshotDir, directory); 3803 strncpy(LLViewerWindow::sSnapshotDir, directory, LL_MAX_PATH -1); /* Flawfinder: ignore */
3804 LLViewerWindow::sSnapshotDir[LL_MAX_PATH -1] = '\0';
3829 } 3805 }
3830 } 3806 }
3831 3807
@@ -3836,11 +3812,11 @@ void LLViewerWindow::saveMovieNumbered(void*)
3836 3812
3837 do 3813 do
3838 { 3814 {
3839 char extension[100]; 3815 char extension[100]; /* Flawfinder: ignore */
3840#if LL_DARWIN 3816#if LL_DARWIN
3841 sprintf( extension, "_%.3d.mov", i ); 3817 snprintf( extension, sizeof(extension), "_%.3d.mov", i ); /* Flawfinder: ignore */
3842#else 3818#else
3843 sprintf( extension, "_%.3d.avi", i ); 3819 snprintf( extension, sizeof(extension), "_%.3d.avi", i ); /* Flawfinder: ignore */
3844#endif 3820#endif
3845 filepath.assign( sSnapshotDir ); 3821 filepath.assign( sSnapshotDir );
3846 filepath.append( sMovieBaseName ); 3822 filepath.append( sMovieBaseName );
@@ -3944,9 +3920,6 @@ BOOL LLViewerWindow::rawSnapshot(LLImageRaw *raw, S32 image_width, S32 image_hei
3944 return FALSE; 3920 return FALSE;
3945 } 3921 }
3946 3922
3947 // IW 3/5/04 We don'a wan' nunna yer fest frumes har!
3948 finishFastFrame();
3949
3950 // PRE SNAPSHOT 3923 // PRE SNAPSHOT
3951 3924
3952 glClear(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); 3925 glClear(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
@@ -3960,10 +3933,11 @@ BOOL LLViewerWindow::rawSnapshot(LLImageRaw *raw, S32 image_width, S32 image_hei
3960 LLPipeline::toggleRenderDebugFeature((void*)LLPipeline::RENDER_DEBUG_FEATURE_UI); 3933 LLPipeline::toggleRenderDebugFeature((void*)LLPipeline::RENDER_DEBUG_FEATURE_UI);
3961 } 3934 }
3962 3935
3963 BOOL hide_hud = !gSavedSettings.getBOOL("RenderHUDInSnapshot") && gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_HUD); 3936
3937 BOOL hide_hud = !gSavedSettings.getBOOL("RenderHUDInSnapshot") && LLPipeline::sShowHUDAttachments;
3964 if (hide_hud) 3938 if (hide_hud)
3965 { 3939 {
3966 LLPipeline::toggleRenderType((void*)LLPipeline::RENDER_TYPE_HUD); 3940 LLPipeline::sShowHUDAttachments = FALSE;
3967 } 3941 }
3968 3942
3969 // Copy screen to a buffer 3943 // Copy screen to a buffer
@@ -4027,7 +4001,6 @@ BOOL LLViewerWindow::rawSnapshot(LLImageRaw *raw, S32 image_width, S32 image_hei
4027 setupViewport(); 4001 setupViewport();
4028 BOOL first_time_through = (subimage_x + subimage_y == 0); 4002 BOOL first_time_through = (subimage_x + subimage_y == 0);
4029 gPickTransparent = FALSE; 4003 gPickTransparent = FALSE;
4030 gPickAlphaThreshold = 0.1f;
4031 gObjectList.renderObjectsForSelect(*gCamera, FALSE, !first_time_through); 4004 gObjectList.renderObjectsForSelect(*gCamera, FALSE, !first_time_through);
4032 } 4005 }
4033 else 4006 else
@@ -4101,7 +4074,7 @@ BOOL LLViewerWindow::rawSnapshot(LLImageRaw *raw, S32 image_width, S32 image_hei
4101 4074
4102 if (hide_hud) 4075 if (hide_hud)
4103 { 4076 {
4104 LLPipeline::toggleRenderType((void*)LLPipeline::RENDER_TYPE_HUD); 4077 LLPipeline::sShowHUDAttachments = TRUE;
4105 } 4078 }
4106 4079
4107 if (high_res) 4080 if (high_res)
@@ -4363,6 +4336,12 @@ void LLViewerWindow::stopGL(BOOL save_state)
4363 if (!gGLManager.mIsDisabled) 4336 if (!gGLManager.mIsDisabled)
4364 { 4337 {
4365 llinfos << "Shutting down GL..." << llendl; 4338 llinfos << "Shutting down GL..." << llendl;
4339
4340 // Pause texture decode threads (will get unpaused during main loop)
4341 gTextureCache->pause();
4342 gImageDecodeThread->pause();
4343 gTextureFetch->pause();
4344
4366 gSky.destroyGL(); 4345 gSky.destroyGL();
4367 stop_glerror(); 4346 stop_glerror();
4368 4347
@@ -4381,8 +4360,6 @@ void LLViewerWindow::stopGL(BOOL save_state)
4381 LLDynamicTexture::destroyGL(); 4360 LLDynamicTexture::destroyGL();
4382 stop_glerror(); 4361 stop_glerror();
4383 4362
4384 if(gParcelMgr) gParcelMgr->destroyGL();
4385
4386 gPipeline.destroyGL(); 4363 gPipeline.destroyGL();
4387 4364
4388 gCone.cleanupGL(); 4365 gCone.cleanupGL();
@@ -4415,10 +4392,8 @@ void LLViewerWindow::restoreGL(const LLString& progress_message)
4415 LLManipTranslate::restoreGL(); 4392 LLManipTranslate::restoreGL();
4416 gImageList.restoreGL(); 4393 gImageList.restoreGL();
4417 gBumpImageList.restoreGL(); 4394 gBumpImageList.restoreGL();
4418 gPipeline.setUseAGP(gSavedSettings.getBOOL("RenderUseAGP"));
4419 LLDynamicTexture::restoreGL(); 4395 LLDynamicTexture::restoreGL();
4420 LLVOAvatar::restoreGL(); 4396 LLVOAvatar::restoreGL();
4421 if (gParcelMgr) gParcelMgr->restoreGL();
4422 4397
4423 if (gFloaterCustomize && gFloaterCustomize->getVisible()) 4398 if (gFloaterCustomize && gFloaterCustomize->getVisible())
4424 { 4399 {
diff --git a/linden/indra/newview/llviewerwindow.h b/linden/indra/newview/llviewerwindow.h
index 8c6d812..debe509 100644
--- a/linden/indra/newview/llviewerwindow.h
+++ b/linden/indra/newview/llviewerwindow.h
@@ -208,7 +208,7 @@ public:
208 BOOL saveSnapshot(const LLString& filename, S32 image_width, S32 image_height, BOOL show_ui = TRUE, BOOL do_rebuild = FALSE, ESnapshotType type = SNAPSHOT_TYPE_COLOR); 208 BOOL saveSnapshot(const LLString& filename, S32 image_width, S32 image_height, BOOL show_ui = TRUE, BOOL do_rebuild = FALSE, ESnapshotType type = SNAPSHOT_TYPE_COLOR);
209 BOOL rawSnapshot(LLImageRaw *raw, S32 image_width, S32 image_height, BOOL keep_window_aspect = TRUE, 209 BOOL rawSnapshot(LLImageRaw *raw, S32 image_width, S32 image_height, BOOL keep_window_aspect = TRUE,
210 BOOL show_ui = TRUE, BOOL do_rebuild = FALSE, ESnapshotType type = SNAPSHOT_TYPE_COLOR ); 210 BOOL show_ui = TRUE, BOOL do_rebuild = FALSE, ESnapshotType type = SNAPSHOT_TYPE_COLOR );
211 BOOL saveImageNumbered(LLImageRaw *raw); 211 BOOL saveImageNumbered(LLImageRaw *raw, const LLString& extension = "");
212 212
213 void playSnapshotAnimAndSound(); 213 void playSnapshotAnimAndSound();
214 214
@@ -224,12 +224,6 @@ public:
224 224
225 LLViewerObject* getObjectUnderCursor(const F32 depth = 16.0f); 225 LLViewerObject* getObjectUnderCursor(const F32 depth = 16.0f);
226 226
227 void requestFastFrame(LLView* view);
228 BOOL renderingFastFrame() { return mFastFrameTimer.getStarted() && !firstFastFrame(); }
229 void finishFastFrame() { mFastFrameTimer.stop(); mRenderFullFrame = FALSE; }
230 BOOL firstFastFrame() { return mRenderFullFrame; }
231 void finishFirstFastFrame() { mRenderFullFrame = FALSE; }
232
233 // Returns a pointer to the last object hit 227 // Returns a pointer to the last object hit
234 LLViewerObject *lastObjectHit(); 228 LLViewerObject *lastObjectHit();
235 LLViewerObject *lastNonFloraObjectHit(); 229 LLViewerObject *lastNonFloraObjectHit();
@@ -339,14 +333,12 @@ protected:
339 333
340 LLString mOverlayTitle; // Used for special titles such as "Second Life - Special E3 2003 Beta" 334 LLString mOverlayTitle; // Used for special titles such as "Second Life - Special E3 2003 Beta"
341 335
342 static char sSnapshotBaseName[LL_MAX_PATH]; 336 static char sSnapshotBaseName[LL_MAX_PATH]; /* Flawfinder: ignore */
343 static char sSnapshotDir[LL_MAX_PATH]; 337 static char sSnapshotDir[LL_MAX_PATH]; /* Flawfinder: ignore */
344 338
345 static char sMovieBaseName[LL_MAX_PATH]; 339 static char sMovieBaseName[LL_MAX_PATH]; /* Flawfinder: ignore */
346 340
347 BOOL mIgnoreActivate; 341 BOOL mIgnoreActivate;
348 LLFrameTimer mFastFrameTimer;
349 BOOL mRenderFullFrame;
350 U8* mPickBuffer; 342 U8* mPickBuffer;
351}; 343};
352 344
diff --git a/linden/indra/newview/llvoavatar.cpp b/linden/indra/newview/llvoavatar.cpp
index ece24e0..7113177 100644
--- a/linden/indra/newview/llvoavatar.cpp
+++ b/linden/indra/newview/llvoavatar.cpp
@@ -47,7 +47,6 @@
47#include "timing.h" 47#include "timing.h"
48 48
49#include "llagent.h" // Get state values from here 49#include "llagent.h" // Get state values from here
50#include "llagparray.h"
51#include "llviewercontrol.h" 50#include "llviewercontrol.h"
52#include "llcriticaldamp.h" 51#include "llcriticaldamp.h"
53#include "lldir.h" 52#include "lldir.h"
@@ -210,7 +209,7 @@ const F32 UNDERWATER_FREQUENCY_DAMP = 0.33f;
210const F32 APPEARANCE_MORPH_TIME = 0.65f; 209const F32 APPEARANCE_MORPH_TIME = 0.65f;
211const F32 CAMERA_SHAKE_ACCEL_THRESHOLD_SQUARED = 5.f * 5.f; 210const F32 CAMERA_SHAKE_ACCEL_THRESHOLD_SQUARED = 5.f * 5.f;
212const F32 TIME_BEFORE_MESH_CLEANUP = 5.f; // seconds 211const F32 TIME_BEFORE_MESH_CLEANUP = 5.f; // seconds
213const S32 AVATAR_AGP_RELEASE_THRESHOLD = 10; // number of avatar instances before releasing AGP memory 212const S32 AVATAR_RELEASE_THRESHOLD = 10; // number of avatar instances before releasing memory
214const F32 FOOT_GROUND_COLLISION_TOLERANCE = 0.25f; 213const F32 FOOT_GROUND_COLLISION_TOLERANCE = 0.25f;
215const F32 AVATAR_LOD_TWEAK_RANGE = 0.7f; 214const F32 AVATAR_LOD_TWEAK_RANGE = 0.7f;
216const S32 MAX_LOD_CHANGES_PER_FRAME = 2; 215const S32 MAX_LOD_CHANGES_PER_FRAME = 2;
@@ -768,9 +767,9 @@ LLVOAvatar::LLVOAvatar(
768 mLastSkirtBakedID( IMG_DEFAULT_AVATAR ), 767 mLastSkirtBakedID( IMG_DEFAULT_AVATAR ),
769 mIsDummy(FALSE), 768 mIsDummy(FALSE),
770 mSpecialRenderMode(0), 769 mSpecialRenderMode(0),
770 mTurning(FALSE),
771 mPelvisToFoot(0.f), 771 mPelvisToFoot(0.f),
772 mLastSkeletonSerialNum( 0 ), 772 mLastSkeletonSerialNum( 0 ),
773 mTurning(FALSE),
774 mHeadOffset(), 773 mHeadOffset(),
775 mIsSitting(FALSE), 774 mIsSitting(FALSE),
776 mTimeVisible(), 775 mTimeVisible(),
@@ -789,7 +788,6 @@ LLVOAvatar::LLVOAvatar(
789 mEyesLayerSet( NULL ), 788 mEyesLayerSet( NULL ),
790 mSkirtLayerSet( NULL ), 789 mSkirtLayerSet( NULL ),
791 mRenderPriority(1.0f), 790 mRenderPriority(1.0f),
792 mNumAGPVertices(0),
793 mNameString(), 791 mNameString(),
794 mTitle(), 792 mTitle(),
795 mNameAway(FALSE), 793 mNameAway(FALSE),
@@ -848,7 +846,7 @@ LLVOAvatar::LLVOAvatar(
848 mSpeed = 0.f; 846 mSpeed = 0.f;
849 setAnimationData("Speed", &mSpeed); 847 setAnimationData("Speed", &mSpeed);
850 848
851 strcpy(mAvatarDefinition, AVATAR_DEFAULT_CHAR); 849 strcpy(mAvatarDefinition, AVATAR_DEFAULT_CHAR); /* Flawfinder: ignore */
852 850
853 if (id == gAgentID) 851 if (id == gAgentID)
854 { 852 {
@@ -1007,7 +1005,7 @@ LLVOAvatar::LLVOAvatar(
1007 //------------------------------------------------------------------------- 1005 //-------------------------------------------------------------------------
1008 // register motions 1006 // register motions
1009 //------------------------------------------------------------------------- 1007 //-------------------------------------------------------------------------
1010 if (LLCharacter::sInstances.getLength() == 1) 1008 if (LLCharacter::sInstances.size() == 1)
1011 { 1009 {
1012 LLKeyframeMotion::setVFS(gStaticVFS); 1010 LLKeyframeMotion::setVFS(gStaticVFS);
1013 addMotion( ANIM_AGENT_BUSY, LLNullMotion::create ); 1011 addMotion( ANIM_AGENT_BUSY, LLNullMotion::create );
@@ -1151,7 +1149,8 @@ void LLVOAvatar::markDead()
1151BOOL LLVOAvatar::isFullyBaked() 1149BOOL LLVOAvatar::isFullyBaked()
1152{ 1150{
1153 if (mIsDummy) return TRUE; 1151 if (mIsDummy) return TRUE;
1154 1152 if (getNumTEs() == 0) return FALSE;
1153
1155 BOOL head_baked = ( getTEImage( TEX_HEAD_BAKED )->getID() != IMG_DEFAULT_AVATAR ); 1154 BOOL head_baked = ( getTEImage( TEX_HEAD_BAKED )->getID() != IMG_DEFAULT_AVATAR );
1156 BOOL upper_baked = ( getTEImage( TEX_UPPER_BAKED )->getID() != IMG_DEFAULT_AVATAR ); 1155 BOOL upper_baked = ( getTEImage( TEX_UPPER_BAKED )->getID() != IMG_DEFAULT_AVATAR );
1157 BOOL lower_baked = ( getTEImage( TEX_LOWER_BAKED )->getID() != IMG_DEFAULT_AVATAR ); 1156 BOOL lower_baked = ( getTEImage( TEX_LOWER_BAKED )->getID() != IMG_DEFAULT_AVATAR );
@@ -1180,10 +1179,10 @@ void LLVOAvatar::deleteLayerSetCaches()
1180// static 1179// static
1181BOOL LLVOAvatar::areAllNearbyInstancesBaked() 1180BOOL LLVOAvatar::areAllNearbyInstancesBaked()
1182{ 1181{
1183 for( LLVOAvatar* inst = (LLVOAvatar*)LLCharacter::sInstances.getFirstData(); 1182 for (std::vector<LLCharacter*>::iterator iter = LLCharacter::sInstances.begin();
1184 inst; 1183 iter != LLCharacter::sInstances.end(); ++iter)
1185 inst = (LLVOAvatar*)LLCharacter::sInstances.getNextData() )
1186 { 1184 {
1185 LLVOAvatar* inst = (LLVOAvatar*) *iter;
1187 if( inst->isDead() ) 1186 if( inst->isDead() )
1188 { 1187 {
1189 continue; 1188 continue;
@@ -1213,10 +1212,10 @@ void LLVOAvatar::dumpBakedStatus()
1213{ 1212{
1214 LLVector3d camera_pos_global = gAgent.getCameraPositionGlobal(); 1213 LLVector3d camera_pos_global = gAgent.getCameraPositionGlobal();
1215 1214
1216 for( LLVOAvatar* inst = (LLVOAvatar*)LLCharacter::sInstances.getFirstData(); 1215 for (std::vector<LLCharacter*>::iterator iter = LLCharacter::sInstances.begin();
1217 inst; 1216 iter != LLCharacter::sInstances.end(); ++iter)
1218 inst = (LLVOAvatar*)LLCharacter::sInstances.getNextData() )
1219 { 1217 {
1218 LLVOAvatar* inst = (LLVOAvatar*) *iter;
1220 llinfos << "Avatar "; 1219 llinfos << "Avatar ";
1221 1220
1222 LLNameValue* firstname = inst->getNVPair("FirstName"); 1221 LLNameValue* firstname = inst->getNVPair("FirstName");
@@ -1405,11 +1404,10 @@ void LLVOAvatar::initVertexPrograms()
1405//static 1404//static
1406void LLVOAvatar::restoreGL() 1405void LLVOAvatar::restoreGL()
1407{ 1406{
1408 LLVOAvatar* inst; 1407 for (std::vector<LLCharacter*>::iterator iter = LLCharacter::sInstances.begin();
1409 for( inst = (LLVOAvatar*)LLCharacter::sInstances.getFirstData(); 1408 iter != LLCharacter::sInstances.end(); ++iter)
1410 inst;
1411 inst = (LLVOAvatar*)LLCharacter::sInstances.getNextData() )
1412 { 1409 {
1410 LLVOAvatar* inst = (LLVOAvatar*) *iter;
1413 inst->setCompositeUpdatesEnabled( TRUE ); 1411 inst->setCompositeUpdatesEnabled( TRUE );
1414 inst->invalidateComposite( inst->mHeadLayerSet, FALSE ); 1412 inst->invalidateComposite( inst->mHeadLayerSet, FALSE );
1415 inst->invalidateComposite( inst->mLowerBodyLayerSet, FALSE ); 1413 inst->invalidateComposite( inst->mLowerBodyLayerSet, FALSE );
@@ -1433,10 +1431,10 @@ void LLVOAvatar::deleteCachedImages()
1433 if (LLTexLayerSet::sHasCaches) 1431 if (LLTexLayerSet::sHasCaches)
1434 { 1432 {
1435 lldebugs << "Deleting layer set caches" << llendl; 1433 lldebugs << "Deleting layer set caches" << llendl;
1436 for( LLVOAvatar* inst = (LLVOAvatar*)LLCharacter::sInstances.getFirstData(); 1434 for (std::vector<LLCharacter*>::iterator iter = LLCharacter::sInstances.begin();
1437 inst; 1435 iter != LLCharacter::sInstances.end(); ++iter)
1438 inst = (LLVOAvatar*)LLCharacter::sInstances.getNextData() )
1439 { 1436 {
1437 LLVOAvatar* inst = (LLVOAvatar*) *iter;
1440 inst->deleteLayerSetCaches(); 1438 inst->deleteLayerSetCaches();
1441 } 1439 }
1442 LLTexLayerSet::sHasCaches = FALSE; 1440 LLTexLayerSet::sHasCaches = FALSE;
@@ -1472,9 +1470,9 @@ void LLVOAvatar::initClass()
1472{ 1470{
1473 LLVOAvatar::sMaxOtherAvatarsToComposite = gSavedSettings.getS32("AvatarCompositeLimit"); 1471 LLVOAvatar::sMaxOtherAvatarsToComposite = gSavedSettings.getS32("AvatarCompositeLimit");
1474 1472
1475 char xmlFile[MAX_PATH]; 1473 char xmlFile[MAX_PATH]; /* Flawfinder: ignore */
1476 1474
1477 sprintf(xmlFile, "%s_lad.xml", gDirUtilp->getExpandedFilename(LL_PATH_CHARACTER,AVATAR_DEFAULT_CHAR).c_str()); 1475 snprintf(xmlFile, MAX_PATH, "%s_lad.xml", gDirUtilp->getExpandedFilename(LL_PATH_CHARACTER,AVATAR_DEFAULT_CHAR).c_str()); /* Flawfinder: ignore */
1478 BOOL success = sXMLTree.parseFile( xmlFile, FALSE ); 1476 BOOL success = sXMLTree.parseFile( xmlFile, FALSE );
1479 if (!success) 1477 if (!success)
1480 { 1478 {
@@ -1537,30 +1535,30 @@ void LLVOAvatar::initClass()
1537 sSkeletonInfo = new LLVOAvatarSkeletonInfo; 1535 sSkeletonInfo = new LLVOAvatarSkeletonInfo;
1538 if (!sSkeletonInfo->parseXml(sSkeletonXMLTree.getRoot())) 1536 if (!sSkeletonInfo->parseXml(sSkeletonXMLTree.getRoot()))
1539 { 1537 {
1540 llerrs << "Error parsing skeleton XML file" << llendl; 1538 llerrs << "Error parsing skeleton XML file: " << skeleton_path << llendl;
1541 } 1539 }
1542 // parse avatar_lad.xml 1540 // parse avatar_lad.xml
1543 llassert(!sAvatarInfo); 1541 llassert(!sAvatarInfo);
1544 sAvatarInfo = new LLVOAvatarInfo; 1542 sAvatarInfo = new LLVOAvatarInfo;
1545 if (!sAvatarInfo->parseXmlSkeletonNode(root)) 1543 if (!sAvatarInfo->parseXmlSkeletonNode(root))
1546 { 1544 {
1547 llerrs << "Error parsing skeleton node in avatar XML file" << llendl; 1545 llerrs << "Error parsing skeleton node in avatar XML file: " << skeleton_path << llendl;
1548 } 1546 }
1549 if (!sAvatarInfo->parseXmlMeshNodes(root)) 1547 if (!sAvatarInfo->parseXmlMeshNodes(root))
1550 { 1548 {
1551 llerrs << "Error parsing skeleton node in avatar XML file" << llendl; 1549 llerrs << "Error parsing skeleton node in avatar XML file: " << skeleton_path << llendl;
1552 } 1550 }
1553 if (!sAvatarInfo->parseXmlColorNodes(root)) 1551 if (!sAvatarInfo->parseXmlColorNodes(root))
1554 { 1552 {
1555 llerrs << "Error parsing skeleton node in avatar XML file" << llendl; 1553 llerrs << "Error parsing skeleton node in avatar XML file: " << skeleton_path << llendl;
1556 } 1554 }
1557 if (!sAvatarInfo->parseXmlLayerNodes(root)) 1555 if (!sAvatarInfo->parseXmlLayerNodes(root))
1558 { 1556 {
1559 llerrs << "Error parsing skeleton node in avatar XML file" << llendl; 1557 llerrs << "Error parsing skeleton node in avatar XML file: " << skeleton_path << llendl;
1560 } 1558 }
1561 if (!sAvatarInfo->parseXmlDriverNodes(root)) 1559 if (!sAvatarInfo->parseXmlDriverNodes(root))
1562 { 1560 {
1563 llerrs << "Error parsing skeleton node in avatar XML file" << llendl; 1561 llerrs << "Error parsing skeleton node in avatar XML file: " << skeleton_path << llendl;
1564 } 1562 }
1565} 1563}
1566 1564
@@ -1576,6 +1574,19 @@ void LLVOAvatar::cleanupClass()
1576} 1574}
1577 1575
1578 1576
1577void LLVOAvatar::updateSpatialExtents(LLVector3& newMin, LLVector3 &newMax)
1578{
1579 LLVector3 center = getRenderPosition();
1580 LLVector3 size = getScale();
1581 //maximum amount an animation can move avatar from drawable position
1582 LLVector3 animation_buffer(5, 5, 5);
1583
1584 newMin.setVec((center-size)-animation_buffer);
1585 newMax.setVec(center+size+animation_buffer);
1586 mDrawable->setPositionGroup((newMin + newMax) * 0.5f);
1587}
1588
1589
1579//----------------------------------------------------------------------------- 1590//-----------------------------------------------------------------------------
1580// parseSkeletonFile() 1591// parseSkeletonFile()
1581//----------------------------------------------------------------------------- 1592//-----------------------------------------------------------------------------
@@ -1728,10 +1739,16 @@ BOOL LLVOAvatar::buildSkeleton(LLVOAvatarSkeletonInfo *info)
1728 } 1739 }
1729 1740
1730 // add special-purpose "screen" joint 1741 // add special-purpose "screen" joint
1731 mScreenp = new LLViewerJoint("mScreen", NULL); 1742 if (mIsSelf)
1732 // for now, put screen at origin, as it is only used during special 1743 {
1733 // HUD rendering mode 1744 mScreenp = new LLViewerJoint("mScreen", NULL);
1734 mScreenp->setWorldPosition(LLVector3::zero); 1745 // for now, put screen at origin, as it is only used during special
1746 // HUD rendering mode
1747 F32 aspect = gCamera->getAspect();
1748 LLVector3 scale(1.f, aspect, 1.f);
1749 mScreenp->setScale(scale);
1750 mScreenp->setWorldPosition(LLVector3::zero);
1751 }
1735 1752
1736 return TRUE; 1753 return TRUE;
1737} 1754}
@@ -1812,7 +1829,7 @@ void LLVOAvatar::buildCharacter()
1812 return; 1829 return;
1813 } 1830 }
1814 1831
1815 gPrintMessagesThisFrame = TRUE; 1832// gPrintMessagesThisFrame = TRUE;
1816 lldebugs << "Avatar load took " << timer.getElapsedTimeF32() << " seconds." << llendl; 1833 lldebugs << "Avatar load took " << timer.getElapsedTimeF32() << " seconds." << llendl;
1817 1834
1818 if ( ! status ) 1835 if ( ! status )
@@ -1944,9 +1961,10 @@ void LLVOAvatar::buildCharacter()
1944 { 1961 {
1945 LLMenuItemCallGL* item; 1962 LLMenuItemCallGL* item;
1946 item = new LLMenuItemCallGL(attachment->getName(), 1963 item = new LLMenuItemCallGL(attachment->getName(),
1947 &handle_attach_to_avatar, 1964 NULL,
1948 object_selected_and_point_valid, 1965 object_selected_and_point_valid);
1949 attachment); 1966 item->addListener(gMenuHolder->getListenerByName("Object.AttachToAvatar"), "on_click", mAttachmentPoints.reverseLookup(attachment));
1967
1950 gAttachPieMenu->append(item); 1968 gAttachPieMenu->append(item);
1951 1969
1952 attachment_found = TRUE; 1970 attachment_found = TRUE;
@@ -1998,9 +2016,9 @@ void LLVOAvatar::buildCharacter()
1998 { 2016 {
1999 LLMenuItemCallGL* item; 2017 LLMenuItemCallGL* item;
2000 item = new LLMenuItemCallGL(attachment->getName(), 2018 item = new LLMenuItemCallGL(attachment->getName(),
2001 &handle_attach_to_avatar, 2019 NULL,
2002 object_selected_and_point_valid, 2020 object_selected_and_point_valid);
2003 attachment); 2021 item->addListener(gMenuHolder->getListenerByName("Object.AttachToAvatar"), "on_click", mAttachmentPoints.reverseLookup(attachment));
2004 gAttachScreenPieMenu->append(item); 2022 gAttachScreenPieMenu->append(item);
2005 gDetachScreenPieMenu->append(new LLMenuItemCallGL(attachment->getName(), 2023 gDetachScreenPieMenu->append(new LLMenuItemCallGL(attachment->getName(),
2006 &handle_detach_from_avatar, object_attached, attachment)); 2024 &handle_detach_from_avatar, object_attached, attachment));
@@ -2017,8 +2035,11 @@ void LLVOAvatar::buildCharacter()
2017 { 2035 {
2018 continue; 2036 continue;
2019 } 2037 }
2020 gAttachSubMenu->append(new LLMenuItemCallGL(attachment->getName(), 2038 LLMenuItemCallGL* item = new LLMenuItemCallGL(attachment->getName(),
2021 &handle_attach_to_avatar, object_selected_and_point_valid, &attach_label, attachment)); 2039 NULL, &object_selected_and_point_valid, &attach_label, attachment);
2040 item->addListener(gMenuHolder->getListenerByName("Object.AttachToAvatar"), "on_click", mAttachmentPoints.reverseLookup(attachment));
2041 gAttachSubMenu->append(item);
2042
2022 gDetachSubMenu->append(new LLMenuItemCallGL(attachment->getName(), 2043 gDetachSubMenu->append(new LLMenuItemCallGL(attachment->getName(),
2023 &handle_detach_from_avatar, object_attached, &detach_label, attachment)); 2044 &handle_detach_from_avatar, object_attached, &detach_label, attachment));
2024 2045
@@ -2068,8 +2089,10 @@ void LLVOAvatar::buildCharacter()
2068 2089
2069 LLViewerJointAttachment* attachment = attach_it->second; 2090 LLViewerJointAttachment* attachment = attach_it->second;
2070 2091
2071 gAttachBodyPartPieMenus[group]->append(new LLMenuItemCallGL(attachment->getName(), 2092 LLMenuItemCallGL* item = new LLMenuItemCallGL(attachment->getName(),
2072 &handle_attach_to_avatar, object_selected_and_point_valid, attachment)); 2093 NULL, object_selected_and_point_valid);
2094 gAttachBodyPartPieMenus[group]->append(item);
2095 item->addListener(gMenuHolder->getListenerByName("Object.AttachToAvatar"), "on_click", mAttachmentPoints.reverseLookup(attachment));
2073 gDetachBodyPartPieMenus[group]->append(new LLMenuItemCallGL(attachment->getName(), 2096 gDetachBodyPartPieMenus[group]->append(new LLMenuItemCallGL(attachment->getName(),
2074 &handle_detach_from_avatar, object_attached, attachment)); 2097 &handle_detach_from_avatar, object_attached, attachment));
2075 2098
@@ -2089,7 +2112,7 @@ void LLVOAvatar::releaseMeshData()
2089{ 2112{
2090 LLMemType mt(LLMemType::MTYPE_AVATAR); 2113 LLMemType mt(LLMemType::MTYPE_AVATAR);
2091 2114
2092 if (sInstances.getLength() < AVATAR_AGP_RELEASE_THRESHOLD || mIsDummy) 2115 if (sInstances.size() < AVATAR_RELEASE_THRESHOLD || mIsDummy)
2093 { 2116 {
2094 return; 2117 return;
2095 } 2118 }
@@ -2106,18 +2129,11 @@ void LLVOAvatar::releaseMeshData()
2106 mEyeBallRightLOD.setValid(FALSE, TRUE); 2129 mEyeBallRightLOD.setValid(FALSE, TRUE);
2107 mSkirtLOD.setValid(FALSE, TRUE); 2130 mSkirtLOD.setValid(FALSE, TRUE);
2108 2131
2109 //cleanup AGP data 2132 //cleanup data
2110 if (mDrawable.notNull()) 2133 if (mDrawable.notNull())
2111 { 2134 {
2112 LLFace* facep = mDrawable->getFace(0); 2135 LLFace* facep = mDrawable->getFace(0);
2113 facep->setSize(0, 0); 2136 facep->setSize(0, 0);
2114 mNumAGPVertices = 0;
2115
2116 // You need to reset the vertex data in order to guarantee
2117 // that the data is deallocated, AND you start at the 0 index
2118 // when you restore the face. We're assuming ONLY ONE FACE per
2119 // avatar pool, this logic is broken if that isn't the case!
2120 facep->getPool()->resetVertexData(0);
2121 } 2137 }
2122 2138
2123 for (LLViewerJointAttachment *attachmentPoint = mAttachmentPoints.getFirstData(); 2139 for (LLViewerJointAttachment *attachmentPoint = mAttachmentPoints.getFirstData();
@@ -2161,7 +2177,7 @@ void LLVOAvatar::restoreMeshData()
2161 } 2177 }
2162 2178
2163 // force mesh update as LOD might not have changed to trigger this 2179 // force mesh update as LOD might not have changed to trigger this
2164 updateMeshData(); 2180 gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_GEOMETRY, TRUE);
2165} 2181}
2166 2182
2167//----------------------------------------------------------------------------- 2183//-----------------------------------------------------------------------------
@@ -2174,29 +2190,28 @@ void LLVOAvatar::updateMeshData()
2174 LLFace* facep = mDrawable->getFace(0); 2190 LLFace* facep = mDrawable->getFace(0);
2175 2191
2176 U32 num_vertices = 0; 2192 U32 num_vertices = 0;
2193 U32 num_indices = 0;
2177 2194
2178 // this order is determined by number of LODS 2195 // this order is determined by number of LODS
2179 // if a mesh earlier in this list changed LODs while a later mesh doesn't, 2196 // if a mesh earlier in this list changed LODs while a later mesh doesn't,
2180 // the later mesh's index offset will be inaccurate 2197 // the later mesh's index offset will be inaccurate
2181 mEyeBallLeftLOD.updateFaceSizes(num_vertices, mAdjustedPixelArea); 2198 mEyeBallLeftLOD.updateFaceSizes(num_vertices, num_indices, mAdjustedPixelArea);
2182 mEyeBallRightLOD.updateFaceSizes(num_vertices, mAdjustedPixelArea); 2199 mEyeBallRightLOD.updateFaceSizes(num_vertices, num_indices, mAdjustedPixelArea);
2183 mEyeLashLOD.updateFaceSizes(num_vertices, mAdjustedPixelArea); 2200 mEyeLashLOD.updateFaceSizes(num_vertices, num_indices, mAdjustedPixelArea);
2184 mHeadLOD.updateFaceSizes(num_vertices, mAdjustedPixelArea); 2201 mHeadLOD.updateFaceSizes(num_vertices, num_indices, mAdjustedPixelArea);
2185 mLowerBodyLOD.updateFaceSizes(num_vertices, mAdjustedPixelArea); 2202 mLowerBodyLOD.updateFaceSizes(num_vertices, num_indices, mAdjustedPixelArea);
2186 mSkirtLOD.updateFaceSizes(num_vertices, mAdjustedPixelArea); 2203 mSkirtLOD.updateFaceSizes(num_vertices, num_indices, mAdjustedPixelArea);
2187 mUpperBodyLOD.updateFaceSizes(num_vertices, mAdjustedPixelArea); 2204 mUpperBodyLOD.updateFaceSizes(num_vertices, num_indices, mAdjustedPixelArea);
2188 mHairLOD.updateFaceSizes(num_vertices, mAdjustedPixelArea); 2205 mHairLOD.updateFaceSizes(num_vertices, num_indices, mAdjustedPixelArea);
2189 2206
2190 if (num_vertices != mNumAGPVertices) 2207 // resize immediately
2191 { 2208 facep->setSize(num_vertices, num_indices);
2192 // resize immediately 2209
2193// llinfos << "Resizing avatar AGP buffer!" << llendl; 2210 facep->mVertexBuffer = new LLVertexBufferAvatar();
2194 facep->getPool()->resetVertexData(num_vertices); 2211 facep->mVertexBuffer->allocateBuffer(num_vertices, num_indices, TRUE);
2195 facep->setSize(0,0); 2212 facep->setGeomIndex(0);
2196 facep->setSize(num_vertices, 0); 2213 facep->setIndicesIndex(0);
2197 mNumAGPVertices = num_vertices; 2214
2198 }
2199
2200 // This is a hack! Avatars have their own pool, so we are detecting 2215 // This is a hack! Avatars have their own pool, so we are detecting
2201 // the case of more than one avatar in the pool (thus > 0 instead of >= 0) 2216 // the case of more than one avatar in the pool (thus > 0 instead of >= 0)
2202 if (facep->getGeomIndex() > 0) 2217 if (facep->getGeomIndex() > 0)
@@ -2379,13 +2394,8 @@ BOOL LLVOAvatar::idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time)
2379 setPixelAreaAndAngle(gAgent); 2394 setPixelAreaAndAngle(gAgent);
2380 2395
2381 // Update the LOD of the joints 2396 // Update the LOD of the joints
2382 static const F32 UPDATE_TIME = .5f; 2397 //static const F32 UPDATE_TIME = .5f;
2383 if (mUpdateLODTimer.hasExpired()) 2398
2384 {
2385 mUpdateLODTimer.setTimerExpirySec(UPDATE_TIME * (.75f + ll_frand(0.5f)));
2386 updateJointLODs();
2387 }
2388
2389 // force asynchronous drawable update 2399 // force asynchronous drawable update
2390 if(mDrawable.notNull() && !gNoRender) 2400 if(mDrawable.notNull() && !gNoRender)
2391 { 2401 {
@@ -2445,6 +2455,17 @@ BOOL LLVOAvatar::idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time)
2445 2455
2446 updateCharacter(agent); 2456 updateCharacter(agent);
2447 2457
2458
2459
2460 if (LLVOAvatar::sJointDebug)
2461 {
2462 llinfos << getNVPair("FirstName")->getString() << getNVPair("LastName")->getString() << ": joint touches: " << LLJoint::sNumTouches << " updates: " << LLJoint::sNumUpdates << llendl;
2463 }
2464
2465 LLJoint::sNumUpdates = 0;
2466 LLJoint::sNumTouches = 0;
2467
2468
2448 if (gNoRender) 2469 if (gNoRender)
2449 { 2470 {
2450 return TRUE; 2471 return TRUE;
@@ -2453,7 +2474,7 @@ BOOL LLVOAvatar::idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time)
2453 // *NOTE: this is necessary for the floating name text above your head. 2474 // *NOTE: this is necessary for the floating name text above your head.
2454 if (mDrawable.notNull()) 2475 if (mDrawable.notNull())
2455 { 2476 {
2456 gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_VOLUME, TRUE); 2477 gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_SHADOW, TRUE);
2457 } 2478 }
2458 2479
2459 // update attachments positions 2480 // update attachments positions
@@ -2463,11 +2484,15 @@ BOOL LLVOAvatar::idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time)
2463 attachment; 2484 attachment;
2464 attachment = mAttachmentPoints.getNextData()) 2485 attachment = mAttachmentPoints.getNextData())
2465 { 2486 {
2466 LLViewerObject *attached_object = attachment->getObject(0); 2487 LLViewerObject *attached_object = attachment->getObject();
2467 if (attached_object && !attached_object->isDead() && attachment->getValid()) 2488
2489 BOOL visibleAttachment = isVisible() || !(attached_object && attached_object->mDrawable->getSpatialBridge()
2490 && (attached_object->mDrawable->getSpatialBridge()->getRadius() < 2.0));
2491
2492 if (visibleAttachment && attached_object && !attached_object->isDead() && attachment->getValid())
2468 { 2493 {
2469 // if selecting any attachments, update all of them as non-damped 2494 // if selecting any attachments, update all of them as non-damped
2470 if (gSelectMgr->getObjectCount() && gSelectMgr->selectionIsAttachment()) 2495 if (gSelectMgr->getSelection()->getObjectCount() && gSelectMgr->getSelection()->isAttachment())
2471 { 2496 {
2472 gPipeline.updateMoveNormalAsync(attached_object->mDrawable); 2497 gPipeline.updateMoveNormalAsync(attached_object->mDrawable);
2473 } 2498 }
@@ -2618,9 +2643,9 @@ BOOL LLVOAvatar::idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time)
2618 const F32 FADE_DURATION = gSavedSettings.getF32("RenderNameFadeDuration"); // seconds 2643 const F32 FADE_DURATION = gSavedSettings.getF32("RenderNameFadeDuration"); // seconds
2619 BOOL visible_chat = gSavedSettings.getBOOL("UseChatBubbles") && (mChats.size() || mTyping); 2644 BOOL visible_chat = gSavedSettings.getBOOL("UseChatBubbles") && (mChats.size() || mTyping);
2620 BOOL render_name = visible_chat || 2645 BOOL render_name = visible_chat ||
2621 (mVisible && 2646 (isVisible() &&
2622 (sRenderName == RENDER_NAME_ALWAYS) || 2647 ((sRenderName == RENDER_NAME_ALWAYS) ||
2623 (sRenderName == RENDER_NAME_FADE && time_visible < NAME_SHOW_TIME)); 2648 (sRenderName == RENDER_NAME_FADE && time_visible < NAME_SHOW_TIME)));
2624 // If it's your own avatar, don't draw in mouselook, and don't 2649 // If it's your own avatar, don't draw in mouselook, and don't
2625 // draw if we're specifically hiding our own name. 2650 // draw if we're specifically hiding our own name.
2626 if (mIsSelf) 2651 if (mIsSelf)
@@ -2737,53 +2762,55 @@ BOOL LLVOAvatar::idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time)
2737 (is_away != mNameAway || is_busy != mNameBusy || is_muted != mNameMute) 2762 (is_away != mNameAway || is_busy != mNameBusy || is_muted != mNameMute)
2738 || is_appearance != mNameAppearance) 2763 || is_appearance != mNameAppearance)
2739 { 2764 {
2740 char line[MAX_STRING]; 2765 char line[MAX_STRING]; /* Flawfinder: ignore */
2741 if (title && title->getString() && title->getString()[0] != '\0') 2766 if (title && title->getString() && title->getString()[0] != '\0')
2742 { 2767 {
2743 strcpy(line, title->getString() ); 2768 strncpy(line, title->getString(), MAX_STRING -1 ); /* Flawfinder: ignore */
2744 strcat(line, "\n"); 2769 line[MAX_STRING -1] = '\0';
2745 strcat(line, firstname->getString() ); 2770 strcat(line, "\n"); /* Flawfinder: ignore */
2771 strncat(line, firstname->getString(), MAX_STRING - strlen(line) -1 ); /* Flawfinder: ignore */
2746 } 2772 }
2747 else 2773 else
2748 { 2774 {
2749 strcpy(line, firstname->getString() ); 2775 strncpy(line, firstname->getString(), MAX_STRING -1 ); /* Flawfinder: ignore */
2776 line[MAX_STRING -1] = '\0';
2750 } 2777 }
2751 2778
2752 strcat(line, " "); 2779 strcat(line, " "); /* Flawfinder: ignore */
2753 strcat(line, lastname->getString()); 2780 strncat(line, lastname->getString(), MAX_STRING - strlen(line) -1); /* Flawfinder: ignore */
2754 BOOL need_comma = FALSE; 2781 BOOL need_comma = FALSE;
2755 2782
2756 if (is_away || is_muted || is_busy) 2783 if (is_away || is_muted || is_busy)
2757 { 2784 {
2758 strcat(line, " ("); 2785 strcat(line, " ("); /* Flawfinder: ignore */
2759 if (is_away) 2786 if (is_away)
2760 { 2787 {
2761 strcat(line, "Away"); 2788 strcat(line, "Away"); /* Flawfinder: ignore */
2762 need_comma = TRUE; 2789 need_comma = TRUE;
2763 } 2790 }
2764 if (is_busy) 2791 if (is_busy)
2765 { 2792 {
2766 if (need_comma) 2793 if (need_comma)
2767 { 2794 {
2768 strcat(line, ", "); 2795 strcat(line, ", "); /* Flawfinder: ignore */
2769 } 2796 }
2770 strcat(line, "Busy"); 2797 strcat(line, "Busy"); /* Flawfinder: ignore */
2771 need_comma = TRUE; 2798 need_comma = TRUE;
2772 } 2799 }
2773 if (is_muted) 2800 if (is_muted)
2774 { 2801 {
2775 if (need_comma) 2802 if (need_comma)
2776 { 2803 {
2777 strcat(line, ", "); 2804 strcat(line, ", "); /* Flawfinder: ignore */
2778 } 2805 }
2779 strcat(line, "Muted"); 2806 strcat(line, "Muted"); /* Flawfinder: ignore */
2780 need_comma = TRUE; 2807 need_comma = TRUE;
2781 } 2808 }
2782 strcat(line,")"); 2809 strcat(line,")"); /* Flawfinder: ignore */
2783 } 2810 }
2784 if (is_appearance) 2811 if (is_appearance)
2785 { 2812 {
2786 strcat(line, "\n(Editing Appearance)"); 2813 strcat(line, "\n(Editing Appearance)"); /* Flawfinder: ignore */
2787 } 2814 }
2788 mNameAway = is_away; 2815 mNameAway = is_away;
2789 mNameBusy = is_busy; 2816 mNameBusy = is_busy;
@@ -2805,7 +2832,7 @@ BOOL LLVOAvatar::idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time)
2805 mNameText->setLabel(mNameString); 2832 mNameText->setLabel(mNameString);
2806 } 2833 }
2807 2834
2808 char line[MAX_STRING]; 2835 char line[MAX_STRING]; /* Flawfinder: ignore */
2809 line[0] = '\0'; 2836 line[0] = '\0';
2810 std::deque<LLChat>::iterator chat_iter = mChats.begin(); 2837 std::deque<LLChat>::iterator chat_iter = mChats.begin();
2811 mNameText->clearString(); 2838 mNameText->clearString();
@@ -2922,22 +2949,24 @@ BOOL LLVOAvatar::idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time)
2922 2949
2923 if (!mBeam.isNull()) 2950 if (!mBeam.isNull())
2924 { 2951 {
2952 LLObjectSelectionHandle selection = gSelectMgr->getSelection();
2953
2925 if (gAgent.mPointAt.notNull()) 2954 if (gAgent.mPointAt.notNull())
2926 { 2955 {
2927 // get point from pointat effect 2956 // get point from pointat effect
2928 mBeam->setPositionGlobal(gAgent.mPointAt->getPointAtPosGlobal()); 2957 mBeam->setPositionGlobal(gAgent.mPointAt->getPointAtPosGlobal());
2929 mBeam->triggerLocal(); 2958 mBeam->triggerLocal();
2930 } 2959 }
2931 else if (gSelectMgr->getFirstRootObject() && 2960 else if (selection->getFirstRootObject() &&
2932 gSelectMgr->getSelectType() != SELECT_TYPE_HUD) 2961 selection->getSelectType() != SELECT_TYPE_HUD)
2933 { 2962 {
2934 LLViewerObject* objectp = gSelectMgr->getFirstRootObject(); 2963 LLViewerObject* objectp = selection->getFirstRootObject();
2935 mBeam->setTargetObject(objectp); 2964 mBeam->setTargetObject(objectp);
2936 } 2965 }
2937 else 2966 else
2938 { 2967 {
2939 mBeam->setTargetObject(NULL); 2968 mBeam->setTargetObject(NULL);
2940 LLTool *tool = gToolMgr->getCurrentTool( gKeyboard->currentMask(TRUE) ); 2969 LLTool *tool = gToolMgr->getCurrentTool();
2941 if (tool->isEditing()) 2970 if (tool->isEditing())
2942 { 2971 {
2943 if (tool->getEditingObject()) 2972 if (tool->getEditingObject())
@@ -2993,6 +3022,16 @@ void LLVOAvatar::updateCharacter(LLAgent &agent)
2993{ 3022{
2994 LLMemType mt(LLMemType::MTYPE_AVATAR); 3023 LLMemType mt(LLMemType::MTYPE_AVATAR);
2995 3024
3025 // update screen joint size
3026 if (mScreenp)
3027 {
3028 F32 aspect = gCamera->getAspect();
3029 LLVector3 scale(1.f, aspect, 1.f);
3030 mScreenp->setScale(scale);
3031 mScreenp->updateWorldMatrixChildren();
3032 resetHUDAttachments();
3033 }
3034
2996 // clear debug text 3035 // clear debug text
2997 mDebugText.clear(); 3036 mDebugText.clear();
2998 3037
@@ -3005,28 +3044,30 @@ void LLVOAvatar::updateCharacter(LLAgent &agent)
3005 { 3044 {
3006 if (motionp->getMinPixelArea() < getPixelArea()) 3045 if (motionp->getMinPixelArea() < getPixelArea())
3007 { 3046 {
3008 char output[256]; 3047 char output[MAX_STRING]; /* Flawfinder: ignore */
3009 if (motionp->getName().empty()) 3048 if (motionp->getName().empty())
3010 { 3049 {
3011 sprintf(output, "%s - %d", motionp->getID().getString().c_str(), (U32)motionp->getPriority()); 3050 snprintf( /* Flawfinder: ignore */
3051 output,
3052 MAX_STRING,
3053 "%s - %d",
3054 motionp->getID().asString().c_str(),
3055 (U32)motionp->getPriority());
3012 } 3056 }
3013 else 3057 else
3014 { 3058 {
3015 sprintf(output, "%s - %d", motionp->getName().c_str(), (U32)motionp->getPriority()); 3059 snprintf( /* Flawfinder: ignore */
3060 output,
3061 MAX_STRING,
3062 "%s - %d",
3063 motionp->getName().c_str(),
3064 (U32)motionp->getPriority());
3016 } 3065 }
3017 addDebugText(output); 3066 addDebugText(output);
3018 } 3067 }
3019 } 3068 }
3020 } 3069 }
3021 3070
3022 if (LLVOAvatar::sJointDebug)
3023 {
3024 llinfos << getNVPair("FirstName")->getString() << ": joint touches: " << LLJoint::sNumTouches << " updates: " << LLJoint::sNumUpdates << llendl;
3025
3026 LLJoint::sNumUpdates = 0;
3027 LLJoint::sNumTouches = 0;
3028 }
3029// llinfos << mPixelArea << llendl;
3030 if (gNoRender) 3071 if (gNoRender)
3031 { 3072 {
3032 // Hack if we're running drones... 3073 // Hack if we're running drones...
@@ -3045,10 +3086,15 @@ void LLVOAvatar::updateCharacter(LLAgent &agent)
3045 return; 3086 return;
3046 } 3087 }
3047 3088
3089 if (!mIsSelf && !isVisible())
3090 {
3091 return;
3092 }
3093
3048 // change animation time quanta based on avatar render load 3094 // change animation time quanta based on avatar render load
3049 if (!mIsSelf) 3095 if (!mIsSelf)
3050 { 3096 {
3051 F32 time_quantum = clamp_rescale((F32)sInstances.getLength(), 10.f, 35.f, 0.f, 0.25f); 3097 F32 time_quantum = clamp_rescale((F32)sInstances.size(), 10.f, 35.f, 0.f, 0.25f);
3052 F32 pixel_area_scale = clamp_rescale(mPixelArea, 100, 5000, 1.f, 0.f); 3098 F32 pixel_area_scale = clamp_rescale(mPixelArea, 100, 5000, 1.f, 0.f);
3053 F32 time_step = time_quantum * pixel_area_scale; 3099 F32 time_step = time_quantum * pixel_area_scale;
3054 if (time_step != 0.f) 3100 if (time_step != 0.f)
@@ -3077,10 +3123,6 @@ void LLVOAvatar::updateCharacter(LLAgent &agent)
3077 mTimeVisible.reset(); 3123 mTimeVisible.reset();
3078 } 3124 }
3079 3125
3080 // update screen joint size
3081 mScreenp->setScale(LLVector3(1.f, gCamera->getAspect(), 1.f));
3082 mScreenp->updateWorldMatrixChildren();
3083
3084 //-------------------------------------------------------------------- 3126 //--------------------------------------------------------------------
3085 // create local variables in world coords for region position values 3127 // create local variables in world coords for region position values
3086 //-------------------------------------------------------------------- 3128 //--------------------------------------------------------------------
@@ -3091,6 +3133,8 @@ void LLVOAvatar::updateCharacter(LLAgent &agent)
3091 xyVel.mV[VZ] = 0.0f; 3133 xyVel.mV[VZ] = 0.0f;
3092 speed = xyVel.magVec(); 3134 speed = xyVel.magVec();
3093 3135
3136 BOOL throttle = TRUE;
3137
3094 if (!(mIsSitting && getParent())) 3138 if (!(mIsSitting && getParent()))
3095 { 3139 {
3096 //-------------------------------------------------------------------- 3140 //--------------------------------------------------------------------
@@ -3101,6 +3145,7 @@ void LLVOAvatar::updateCharacter(LLAgent &agent)
3101 if (mTimeLast == 0.0f) 3145 if (mTimeLast == 0.0f)
3102 { 3146 {
3103 mTimeLast = animation_time; 3147 mTimeLast = animation_time;
3148 throttle = FALSE;
3104 3149
3105 // put the pelvis at slaved position/mRotation 3150 // put the pelvis at slaved position/mRotation
3106 mRoot.setWorldPosition( getPositionAgent() ); // first frame 3151 mRoot.setWorldPosition( getPositionAgent() ); // first frame
@@ -3144,7 +3189,16 @@ void LLVOAvatar::updateCharacter(LLAgent &agent)
3144 // correct for the fact that the pelvis is not necessarily the center 3189 // correct for the fact that the pelvis is not necessarily the center
3145 // of the agent's physical representation 3190 // of the agent's physical representation
3146 root_pos.mdV[VZ] -= (0.5f * mBodySize.mV[VZ]) - mPelvisToFoot; 3191 root_pos.mdV[VZ] -= (0.5f * mBodySize.mV[VZ]) - mPelvisToFoot;
3147 mRoot.setWorldPosition(gAgent.getPosAgentFromGlobal(root_pos) ); // regular update 3192
3193
3194 LLVector3 newPosition = gAgent.getPosAgentFromGlobal(root_pos);
3195
3196 if (newPosition != mRoot.getXform()->getWorldPosition())
3197 {
3198 mRoot.touch();
3199 mRoot.setWorldPosition(newPosition ); // regular update
3200 }
3201
3148 3202
3149 //-------------------------------------------------------------------- 3203 //--------------------------------------------------------------------
3150 // Propagate viewer object rotation to root of avatar 3204 // Propagate viewer object rotation to root of avatar
@@ -3314,9 +3368,10 @@ void LLVOAvatar::updateCharacter(LLAgent &agent)
3314 //} 3368 //}
3315 //end Ventrella 3369 //end Ventrella
3316 3370
3317 F32 u = llclamp((deltaTime / pelvis_lag_time), 0.0f, 1.0f); 3371 F32 u = llclamp((deltaTime / pelvis_lag_time), 0.0f, 1.0f);
3318 3372
3319 mRoot.setWorldRotation( slerp(u, mRoot.getWorldRotation(), wQv) ); 3373 mRoot.setWorldRotation( slerp(u, mRoot.getWorldRotation(), wQv) );
3374
3320 } 3375 }
3321 } 3376 }
3322 else if (mDrawable.notNull()) 3377 else if (mDrawable.notNull())
@@ -3328,8 +3383,17 @@ void LLVOAvatar::updateCharacter(LLAgent &agent)
3328 //-------------------------------------------------------------------- 3383 //--------------------------------------------------------------------
3329 // the rest should only be done when close enough to see it 3384 // the rest should only be done when close enough to see it
3330 //-------------------------------------------------------------------- 3385 //--------------------------------------------------------------------
3386
3387
3388 if (mPixelArea > 12.0f)
3389 throttle = FALSE;
3390 if (mPixelArea < 400.0f)
3391 {
3392 throttle = (LLDrawable::getCurrentFrame()+mID.mData[0])%2 != 0;
3393 }
3394
3331 if ( !(mIsSitting && getParent()) && 3395 if ( !(mIsSitting && getParent()) &&
3332 ((mPixelArea < 12.0f) || 3396 (throttle ||
3333 (!isVisible() && (mPixelArea < MIN_PIXEL_AREA_FOR_COMPOSITE))) ) 3397 (!isVisible() && (mPixelArea < MIN_PIXEL_AREA_FOR_COMPOSITE))) )
3334 { 3398 {
3335 mRoot.setWorldRotation( getRotation() ); 3399 mRoot.setWorldRotation( getRotation() );
@@ -3433,7 +3497,7 @@ void LLVOAvatar::updateCharacter(LLAgent &agent)
3433 } 3497 }
3434 } 3498 }
3435 } 3499 }
3436 3500
3437 mRoot.updateWorldMatrixChildren(); 3501 mRoot.updateWorldMatrixChildren();
3438 3502
3439 if (!mDebugText.size() && mText.notNull()) 3503 if (!mDebugText.size() && mText.notNull())
@@ -3490,10 +3554,8 @@ void LLVOAvatar::updateVisibility(BOOL force_invisible)
3490 else if (!force_invisible) 3554 else if (!force_invisible)
3491 { 3555 {
3492 // calculate avatar distance wrt head 3556 // calculate avatar distance wrt head
3493 LLVector3 pos = mDrawable->getPositionAgent(); 3557 mDrawable->updateDistance(*gCamera);
3494 pos -= gCamera->getOrigin(); 3558
3495 mDrawable->mDistanceWRTCamera = pos.magVec();
3496
3497 if (!mDrawable->getSpatialGroup() || mDrawable->getSpatialGroup()->isVisible()) 3559 if (!mDrawable->getSpatialGroup() || mDrawable->getSpatialGroup()->isVisible())
3498 { 3560 {
3499 visible = TRUE; 3561 visible = TRUE;
@@ -3565,9 +3627,9 @@ void LLVOAvatar::updateVisibility(BOOL force_invisible)
3565 attachment; 3627 attachment;
3566 attachment = mAttachmentPoints.getNextData()) 3628 attachment = mAttachmentPoints.getNextData())
3567 { 3629 {
3568 if (attachment->getObject(0)) 3630 if (attachment->getObject())
3569 { 3631 {
3570 if(attachment->getObject(0)->mDrawable->isVisible()) 3632 if(attachment->getObject()->mDrawable->isVisible())
3571 { 3633 {
3572 llinfos << attachment->getName() << " visible" << llendl; 3634 llinfos << attachment->getName() << " visible" << llendl;
3573 } 3635 }
@@ -3591,7 +3653,6 @@ void LLVOAvatar::updateVisibility(BOOL force_invisible)
3591 { 3653 {
3592 restoreMeshData(); 3654 restoreMeshData();
3593 } 3655 }
3594 gPipeline.markVisible(mDrawable);
3595 } 3656 }
3596 else 3657 else
3597 { 3658 {
@@ -3618,11 +3679,12 @@ void LLVOAvatar::updateVisibility(BOOL force_invisible)
3618void LLVOAvatar::updateAllAvatarVisiblity() 3679void LLVOAvatar::updateAllAvatarVisiblity()
3619{ 3680{
3620 LLVOAvatar::sNumVisibleAvatars = 0; 3681 LLVOAvatar::sNumVisibleAvatars = 0;
3621 LLVOAvatar *avatarp; 3682
3622
3623 F32 render_priority = (F32)LLVOAvatar::sMaxVisible; 3683 F32 render_priority = (F32)LLVOAvatar::sMaxVisible;
3624 for (avatarp = (LLVOAvatar*)sInstances.getFirstData(); avatarp; avatarp = (LLVOAvatar*)sInstances.getNextData()) 3684 for (std::vector<LLCharacter*>::iterator iter = LLCharacter::sInstances.begin();
3685 iter != LLCharacter::sInstances.end(); ++iter)
3625 { 3686 {
3687 LLVOAvatar* avatarp = (LLVOAvatar*) *iter;
3626 if (avatarp->isDead()) 3688 if (avatarp->isDead())
3627 { 3689 {
3628 continue; 3690 continue;
@@ -3661,7 +3723,7 @@ BOOL LLVOAvatar::needsRenderBeam()
3661 { 3723 {
3662 return FALSE; 3724 return FALSE;
3663 } 3725 }
3664 LLTool *tool = gToolMgr->getCurrentTool( gKeyboard->currentMask(TRUE) ); 3726 LLTool *tool = gToolMgr->getCurrentTool();
3665 3727
3666 BOOL is_touching_or_grabbing = (tool == gToolGrab && gToolGrab->isEditing()); 3728 BOOL is_touching_or_grabbing = (tool == gToolGrab && gToolGrab->isEditing());
3667 if (gToolGrab->getEditingObject() && 3729 if (gToolGrab->getEditingObject() &&
@@ -3760,26 +3822,22 @@ U32 LLVOAvatar::renderSkinned(EAvatarRenderPass pass)
3760 3822
3761 if (pass == AVATAR_RENDER_PASS_SINGLE) 3823 if (pass == AVATAR_RENDER_PASS_SINGLE)
3762 { 3824 {
3825 BOOL first_pass = TRUE;
3763 if (!mIsSelf || gAgent.needsRenderHead()) 3826 if (!mIsSelf || gAgent.needsRenderHead())
3764 { 3827 {
3765 num_indices += mHeadLOD.render(mAdjustedPixelArea); 3828 num_indices += mHeadLOD.render(mAdjustedPixelArea);
3829 first_pass = FALSE;
3766 } 3830 }
3767 num_indices += mUpperBodyLOD.render(mAdjustedPixelArea); 3831 num_indices += mUpperBodyLOD.render(mAdjustedPixelArea, first_pass);
3768 num_indices += mLowerBodyLOD.render(mAdjustedPixelArea); 3832 num_indices += mLowerBodyLOD.render(mAdjustedPixelArea, FALSE);
3769 if( isWearingWearableType( WT_SKIRT ) )
3770 {
3771 glAlphaFunc(GL_GREATER,0.25f);
3772 num_indices += mSkirtLOD.render(mAdjustedPixelArea);
3773 glAlphaFunc(GL_GREATER,0.01f);
3774 }
3775 3833
3776 if (!mIsSelf || gAgent.needsRenderHead())
3777 { 3834 {
3778 num_indices += mEyeLashLOD.render(mAdjustedPixelArea); 3835 LLGLEnable blend(GL_BLEND);
3779 num_indices += mHairLOD.render(mAdjustedPixelArea); 3836 LLGLEnable test(GL_ALPHA_TEST);
3837 num_indices += renderTransparent();
3780 } 3838 }
3781 } 3839 }
3782 else if (pass == AVATAR_RENDER_PASS_CLOTHING_INNER) 3840 /*else if (pass == AVATAR_RENDER_PASS_CLOTHING_INNER)
3783 { 3841 {
3784 if (!mIsSelf || gAgent.needsRenderHead()) 3842 if (!mIsSelf || gAgent.needsRenderHead())
3785 { 3843 {
@@ -3812,7 +3870,7 @@ U32 LLVOAvatar::renderSkinned(EAvatarRenderPass pass)
3812 LLViewerJointMesh::sClothingMaskImageName = mLowerMaskTexName; 3870 LLViewerJointMesh::sClothingMaskImageName = mLowerMaskTexName;
3813 num_indices += mLowerBodyLOD.render(mAdjustedPixelArea); 3871 num_indices += mLowerBodyLOD.render(mAdjustedPixelArea);
3814 LLViewerJointMesh::sClothingMaskImageName = 0; 3872 LLViewerJointMesh::sClothingMaskImageName = 0;
3815 } 3873 }*/
3816 3874
3817 LLViewerJointMesh::sRenderPass = AVATAR_RENDER_PASS_SINGLE; 3875 LLViewerJointMesh::sRenderPass = AVATAR_RENDER_PASS_SINGLE;
3818 3876
@@ -3823,6 +3881,27 @@ U32 LLVOAvatar::renderSkinned(EAvatarRenderPass pass)
3823 return num_indices; 3881 return num_indices;
3824} 3882}
3825 3883
3884U32 LLVOAvatar::renderTransparent()
3885{
3886 U32 num_indices = 0;
3887 BOOL first_pass = FALSE;
3888 if( isWearingWearableType( WT_SKIRT ) )
3889 {
3890 glAlphaFunc(GL_GREATER,0.25f);
3891 num_indices += mSkirtLOD.render(mAdjustedPixelArea, FALSE);
3892 first_pass = FALSE;
3893 glAlphaFunc(GL_GREATER,0.01f);
3894 }
3895
3896 if (!mIsSelf || gAgent.needsRenderHead())
3897 {
3898 num_indices += mEyeLashLOD.render(mAdjustedPixelArea, first_pass);
3899 num_indices += mHairLOD.render(mAdjustedPixelArea, FALSE);
3900 }
3901
3902 return num_indices;
3903}
3904
3826//----------------------------------------------------------------------------- 3905//-----------------------------------------------------------------------------
3827// renderRigid() 3906// renderRigid()
3828//----------------------------------------------------------------------------- 3907//-----------------------------------------------------------------------------
@@ -3851,6 +3930,39 @@ U32 LLVOAvatar::renderRigid()
3851 return num_indices; 3930 return num_indices;
3852} 3931}
3853 3932
3933U32 LLVOAvatar::renderFootShadows()
3934{
3935 U32 num_indices = 0;
3936
3937 if (!mIsBuilt)
3938 {
3939 return 0;
3940 }
3941
3942 if (mIsSelf && (!gAgent.needsRenderAvatar() || !gAgent.needsRenderHead()))
3943 {
3944 return 0;
3945 }
3946
3947 if (!mIsBuilt)
3948 {
3949 return 0;
3950 }
3951
3952 U32 foot_mask = LLVertexBuffer::MAP_VERTEX |
3953 LLVertexBuffer::MAP_TEXCOORD;
3954
3955 //render foot shadows
3956 LLGLEnable blend(GL_BLEND);
3957 mShadowImagep->bind();
3958 glColor4fv(mShadow0Facep->getRenderColor().mV);
3959 mShadow0Facep->renderIndexed(foot_mask);
3960 glColor4fv(mShadow1Facep->getRenderColor().mV);
3961 mShadow1Facep->renderIndexed(foot_mask);
3962
3963 return num_indices;
3964}
3965
3854//----------------------------------------------------------------------------- 3966//-----------------------------------------------------------------------------
3855// renderCollisionVolumes() 3967// renderCollisionVolumes()
3856//----------------------------------------------------------------------------- 3968//-----------------------------------------------------------------------------
@@ -3867,6 +3979,7 @@ void LLVOAvatar::renderCollisionVolumes()
3867//------------------------------------------------------------------------ 3979//------------------------------------------------------------------------
3868void LLVOAvatar::updateTextures(LLAgent &agent) 3980void LLVOAvatar::updateTextures(LLAgent &agent)
3869{ 3981{
3982// LLFastTimer ftm(LLFastTimer::FTM_TEMP5);
3870 BOOL render_avatar = TRUE; 3983 BOOL render_avatar = TRUE;
3871 3984
3872 if (mIsDummy || gNoRender) 3985 if (mIsDummy || gNoRender)
@@ -3941,6 +4054,8 @@ void LLVOAvatar::updateTextures(LLAgent &agent)
3941 } 4054 }
3942 */ 4055 */
3943 4056
4057 mMaxPixelArea = 0.f;
4058 mMinPixelArea = 99999999.f;
3944 for (U32 i = 0; i < getNumTEs(); i++) 4059 for (U32 i = 0; i < getNumTEs(); i++)
3945 { 4060 {
3946 LLViewerImage *imagep = getTEImage(i); 4061 LLViewerImage *imagep = getTEImage(i);
@@ -3965,9 +4080,10 @@ void LLVOAvatar::updateTextures(LLAgent &agent)
3965 && imagep->getID() != IMG_DEFAULT_AVATAR 4080 && imagep->getID() != IMG_DEFAULT_AVATAR
3966 && !imagep->getTargetHost().isOk()) 4081 && !imagep->getTargetHost().isOk())
3967 { 4082 {
3968 llwarns << "LLVOAvatar::updateTextures No host for texture " << imagep->getID() 4083 llwarns << "LLVOAvatar::updateTextures No host for texture "
3969 << " for avatar " << (mIsSelf ? "<myself>" : getID().getString()) 4084 << imagep->getID() << " for avatar "
3970 << " on host " << getRegion()->getHost() << llendl; 4085 << (mIsSelf ? "<myself>" : getID().asString().c_str())
4086 << " on host " << getRegion()->getHost() << llendl;
3971 } 4087 }
3972 4088
3973 switch( i ) 4089 switch( i )
@@ -4037,40 +4153,35 @@ void LLVOAvatar::updateTextures(LLAgent &agent)
4037 case TEX_HEAD_BAKED: 4153 case TEX_HEAD_BAKED:
4038 if (head_baked) 4154 if (head_baked)
4039 { 4155 {
4040 imagep->setBoostLevel(boost_level); 4156 addBakedTextureStats( imagep, mPixelArea, texel_area_ratio, boost_level );
4041 imagep->addTextureStats(mPixelArea, texel_area_ratio);
4042 } 4157 }
4043 break; 4158 break;
4044 4159
4045 case TEX_UPPER_BAKED: 4160 case TEX_UPPER_BAKED:
4046 if (upper_baked) 4161 if (upper_baked)
4047 { 4162 {
4048 imagep->setBoostLevel(boost_level); 4163 addBakedTextureStats( imagep, mPixelArea, texel_area_ratio, boost_level );
4049 imagep->addTextureStats(mPixelArea, texel_area_ratio);
4050 } 4164 }
4051 break; 4165 break;
4052 4166
4053 case TEX_LOWER_BAKED: 4167 case TEX_LOWER_BAKED:
4054 if (lower_baked) 4168 if (lower_baked)
4055 { 4169 {
4056 imagep->setBoostLevel(boost_level); 4170 addBakedTextureStats( imagep, mPixelArea, texel_area_ratio, boost_level );
4057 imagep->addTextureStats(mPixelArea, texel_area_ratio);
4058 } 4171 }
4059 break; 4172 break;
4060 4173
4061 case TEX_EYES_BAKED: 4174 case TEX_EYES_BAKED:
4062 if (eyes_baked) 4175 if (eyes_baked)
4063 { 4176 {
4064 imagep->setBoostLevel(boost_level); 4177 addBakedTextureStats( imagep, mPixelArea, texel_area_ratio, boost_level );
4065 imagep->addTextureStats(mPixelArea, texel_area_ratio);
4066 } 4178 }
4067 break; 4179 break;
4068 4180
4069 case TEX_SKIRT_BAKED: 4181 case TEX_SKIRT_BAKED:
4070 if (skirt_baked) 4182 if (skirt_baked)
4071 { 4183 {
4072 imagep->setBoostLevel(boost_level); 4184 addBakedTextureStats( imagep, mPixelArea, texel_area_ratio, boost_level );
4073 imagep->addTextureStats(mPixelArea, texel_area_ratio);
4074 } 4185 }
4075 break; 4186 break;
4076 4187
@@ -4078,15 +4189,8 @@ void LLVOAvatar::updateTextures(LLAgent &agent)
4078 // Hair is neither a local texture used for baking, nor the output 4189 // Hair is neither a local texture used for baking, nor the output
4079 // of the baking process. It's just a texture that happens to be 4190 // of the baking process. It's just a texture that happens to be
4080 // used to draw avatars. Hence BOOST_AVATAR. JC 4191 // used to draw avatars. Hence BOOST_AVATAR. JC
4081 if (mIsSelf) 4192 boost_level = mIsSelf ? LLViewerImage::BOOST_AVATAR_SELF : LLViewerImage::BOOST_AVATAR;
4082 { 4193 addBakedTextureStats( imagep, mPixelArea, texel_area_ratio, boost_level );
4083 imagep->setBoostLevel(LLViewerImage::BOOST_AVATAR_SELF);
4084 }
4085 else
4086 {
4087 imagep->setBoostLevel(LLViewerImage::BOOST_AVATAR);
4088 }
4089 imagep->addTextureStats(mPixelArea, texel_area_ratio);
4090 break; 4194 break;
4091 4195
4092 default: 4196 default:
@@ -4096,6 +4200,11 @@ void LLVOAvatar::updateTextures(LLAgent &agent)
4096 } 4200 }
4097 } 4201 }
4098 4202
4203 if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_TEXTURE_AREA))
4204 {
4205 setDebugText(llformat("%4.0f:%4.0f", fsqrtf(mMinPixelArea),fsqrtf(mMaxPixelArea)));
4206 }
4207
4099 if( render_avatar ) 4208 if( render_avatar )
4100 { 4209 {
4101 mShadowImagep->addTextureStats(mPixelArea, 1.f); 4210 mShadowImagep->addTextureStats(mPixelArea, 1.f);
@@ -4125,6 +4234,15 @@ void LLVOAvatar::addLocalTextureStats( LLVOAvatar::ELocTexIndex idx, LLViewerIma
4125 } 4234 }
4126} 4235}
4127 4236
4237
4238void LLVOAvatar::addBakedTextureStats( LLViewerImage* imagep, F32 pixel_area, F32 texel_area_ratio, S32 boost_level)
4239{
4240 mMaxPixelArea = llmax(pixel_area, mMaxPixelArea);
4241 mMinPixelArea = llmin(pixel_area, mMinPixelArea);
4242 imagep->addTextureStats(pixel_area, texel_area_ratio);
4243 imagep->setBoostLevel(boost_level);
4244}
4245
4128//----------------------------------------------------------------------------- 4246//-----------------------------------------------------------------------------
4129// resolveHeight() 4247// resolveHeight()
4130//----------------------------------------------------------------------------- 4248//-----------------------------------------------------------------------------
@@ -4409,14 +4527,7 @@ BOOL LLVOAvatar::stopMotion(const LLUUID& id, BOOL stop_immediate)
4409{ 4527{
4410 if (mIsSelf) 4528 if (mIsSelf)
4411 { 4529 {
4412 if (id == ANIM_AGENT_STAND) 4530 gAgent.onAnimStop(id);
4413 {
4414 LLAgent::stopFidget();
4415 }
4416 else if (id == ANIM_AGENT_AWAY)
4417 {
4418 gAgent.clearAFK();
4419 }
4420 } 4531 }
4421 4532
4422 if (id == ANIM_AGENT_WALK) 4533 if (id == ANIM_AGENT_WALK)
@@ -4609,7 +4720,7 @@ F32 LLVOAvatar::getTimeDilation()
4609//----------------------------------------------------------------------------- 4720//-----------------------------------------------------------------------------
4610// LLVOAvatar::getPixelArea() 4721// LLVOAvatar::getPixelArea()
4611//----------------------------------------------------------------------------- 4722//-----------------------------------------------------------------------------
4612F32 LLVOAvatar::getPixelArea() 4723F32 LLVOAvatar::getPixelArea() const
4613{ 4724{
4614 if (mIsDummy) 4725 if (mIsDummy)
4615 { 4726 {
@@ -4971,6 +5082,11 @@ BOOL LLVOAvatar::loadSkeletonNode ()
4971 iter != sAvatarInfo->mAttachmentInfoList.end(); iter++) 5082 iter != sAvatarInfo->mAttachmentInfoList.end(); iter++)
4972 { 5083 {
4973 LLVOAvatarInfo::LLVOAvatarAttachmentInfo *info = *iter; 5084 LLVOAvatarInfo::LLVOAvatarAttachmentInfo *info = *iter;
5085 if (!isSelf() && info->mJointName == "mScreen")
5086 { //don't process screen joint for other avatars
5087 continue;
5088 }
5089
4974 LLViewerJointAttachment* attachment = new LLViewerJointAttachment(); 5090 LLViewerJointAttachment* attachment = new LLViewerJointAttachment();
4975 5091
4976 attachment->setName(info->mName); 5092 attachment->setName(info->mName);
@@ -5321,15 +5437,6 @@ void LLVOAvatar::setPixelAreaAndAngle(LLAgent &agent)
5321{ 5437{
5322 LLMemType mt(LLMemType::MTYPE_AVATAR); 5438 LLMemType mt(LLMemType::MTYPE_AVATAR);
5323 5439
5324 LLVector3 viewer_pos_agent = agent.getCameraPositionAgent();
5325 LLVector3 pos_agent;
5326
5327 pos_agent = getRenderPosition();
5328
5329 F32 dx = viewer_pos_agent.mV[VX] - pos_agent.mV[VX];
5330 F32 dy = viewer_pos_agent.mV[VY] - pos_agent.mV[VY];
5331 F32 dz = viewer_pos_agent.mV[VZ] - pos_agent.mV[VZ];
5332
5333 F32 max_scale = getMaxScale(); 5440 F32 max_scale = getMaxScale();
5334 F32 mid_scale = getMidScale(); 5441 F32 mid_scale = getMidScale();
5335 F32 min_scale = llmin( getScale().mV[VX], llmin( getScale().mV[VY], getScale().mV[VZ] ) ); 5442 F32 min_scale = llmin( getScale().mV[VX], llmin( getScale().mV[VY], getScale().mV[VZ] ) );
@@ -5338,7 +5445,7 @@ void LLVOAvatar::setPixelAreaAndAngle(LLAgent &agent)
5338 // to try to get a min distance from face, subtract min_scale/2 from the range. 5445 // to try to get a min distance from face, subtract min_scale/2 from the range.
5339 // This means we'll load too much detail sometimes, but that's better than not enough 5446 // This means we'll load too much detail sometimes, but that's better than not enough
5340 // I don't think there's a better way to do this without calculating distance per-poly 5447 // I don't think there's a better way to do this without calculating distance per-poly
5341 F32 range = sqrt(dx*dx + dy*dy + dz*dz) - min_scale/2; 5448 F32 range = (getRenderPosition()-gCamera->getOrigin()).magVec() - min_scale/2;
5342 5449
5343 if (range < 0.001f) // range == zero 5450 if (range < 0.001f) // range == zero
5344 { 5451 {
@@ -5373,17 +5480,11 @@ void LLVOAvatar::setPixelAreaAndAngle(LLAgent &agent)
5373//----------------------------------------------------------------------------- 5480//-----------------------------------------------------------------------------
5374// updateJointLODs() 5481// updateJointLODs()
5375//----------------------------------------------------------------------------- 5482//-----------------------------------------------------------------------------
5376void LLVOAvatar::updateJointLODs() 5483BOOL LLVOAvatar::updateJointLODs()
5377{ 5484{
5378 if (!mMeshValid)
5379 {
5380 return;
5381 }
5382
5383 F32 lod_factor = (sLODFactor * AVATAR_LOD_TWEAK_RANGE + (1.f - AVATAR_LOD_TWEAK_RANGE)); 5485 F32 lod_factor = (sLODFactor * AVATAR_LOD_TWEAK_RANGE + (1.f - AVATAR_LOD_TWEAK_RANGE));
5384 F32 avatar_num_min_factor = clamp_rescale(sLODFactor, 0.f, 1.f, 0.25f, 0.6f); 5486 F32 avatar_num_min_factor = clamp_rescale(sLODFactor, 0.f, 1.f, 0.25f, 0.6f);
5385 F32 avatar_num_factor = clamp_rescale((F32)sNumVisibleAvatars, 8, 25, 1.f, avatar_num_min_factor); 5487 F32 avatar_num_factor = clamp_rescale((F32)sNumVisibleAvatars, 8, 25, 1.f, avatar_num_min_factor);
5386
5387 { 5488 {
5388 if (mIsSelf) 5489 if (mIsSelf)
5389 { 5490 {
@@ -5406,16 +5507,17 @@ void LLVOAvatar::updateJointLODs()
5406 mAdjustedPixelArea = (F32)mPixelArea * lod_factor * lod_factor * avatar_num_factor * avatar_num_factor; 5507 mAdjustedPixelArea = (F32)mPixelArea * lod_factor * lod_factor * avatar_num_factor * avatar_num_factor;
5407 } 5508 }
5408 5509
5409 // now select meshes to render based on adjusted pixel area, and perform AGP data push as necessary 5510 // now select meshes to render based on adjusted pixel area
5410 BOOL res = mRoot.updateLOD(mAdjustedPixelArea, TRUE); 5511 BOOL res = mRoot.updateLOD(mAdjustedPixelArea, TRUE);
5411 if (res) 5512 if (res)
5412 { 5513 {
5413 sNumLODChangesThisFrame++; 5514 sNumLODChangesThisFrame++;
5414 updateMeshData(); 5515 dirtyMesh();
5516 return TRUE;
5415 } 5517 }
5416 } 5518 }
5417 5519
5418 return; 5520 return FALSE;
5419} 5521}
5420 5522
5421//----------------------------------------------------------------------------- 5523//-----------------------------------------------------------------------------
@@ -5426,24 +5528,22 @@ LLDrawable *LLVOAvatar::createDrawable(LLPipeline *pipeline)
5426 pipeline->allocDrawable(this); 5528 pipeline->allocDrawable(this);
5427 mDrawable->setLit(FALSE); 5529 mDrawable->setLit(FALSE);
5428 5530
5429 LLDrawPool *poolp = gPipeline.getPool(LLDrawPool::POOL_AVATAR); 5531 LLDrawPoolAvatar *poolp = (LLDrawPoolAvatar*) gPipeline.getPool(LLDrawPool::POOL_AVATAR);
5430 5532
5431 // Only a single face (one per avatar) 5533 // Only a single face (one per avatar)
5432 mDrawable->setState(LLDrawable::ACTIVE); 5534 mDrawable->setState(LLDrawable::ACTIVE);
5433 mDrawable->addFace(poolp, NULL); 5535 mDrawable->addFace(poolp, NULL);
5536 mDrawable->setRenderType(LLPipeline::RENDER_TYPE_AVATAR);
5434 5537
5435 poolp = gPipeline.getPool(LLDrawPool::POOL_ALPHA);
5436
5437 LLFace *facep; 5538 LLFace *facep;
5438 5539
5439 // Add faces for the foot shadows 5540 // Add faces for the foot shadows
5440 facep = mDrawable->addFace(poolp, mShadowImagep); 5541 facep = mDrawable->addFace((LLFacePool*) NULL, mShadowImagep);
5441 mShadow0Facep = facep; 5542 mShadow0Facep = facep;
5442 5543
5443 facep = mDrawable->addFace(poolp, mShadowImagep); 5544 facep = mDrawable->addFace((LLFacePool*) NULL, mShadowImagep);
5444 mShadow1Facep = facep; 5545 mShadow1Facep = facep;
5445 5546
5446 gPipeline.markMaterialed(mDrawable);
5447 dirtyMesh(); 5547 dirtyMesh();
5448 return mDrawable; 5548 return mDrawable;
5449} 5549}
@@ -5454,6 +5554,7 @@ LLDrawable *LLVOAvatar::createDrawable(LLPipeline *pipeline)
5454//----------------------------------------------------------------------------- 5554//-----------------------------------------------------------------------------
5455BOOL LLVOAvatar::updateGeometry(LLDrawable *drawable) 5555BOOL LLVOAvatar::updateGeometry(LLDrawable *drawable)
5456{ 5556{
5557 LLFastTimer ftm(LLFastTimer::FTM_UPDATE_AVATAR);
5457 if (!(gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_AVATAR))) 5558 if (!(gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_AVATAR)))
5458 { 5559 {
5459 return TRUE; 5560 return TRUE;
@@ -5469,30 +5570,9 @@ BOOL LLVOAvatar::updateGeometry(LLDrawable *drawable)
5469 llerrs << "LLVOAvatar::updateGeometry() called with NULL drawable" << llendl; 5570 llerrs << "LLVOAvatar::updateGeometry() called with NULL drawable" << llendl;
5470 } 5571 }
5471 5572
5472 // Update the shadow, tractor, and text label geometry.
5473
5474 updateShadowFaces();
5475
5476 if (!drawable->isVisible())
5477 {
5478 return TRUE;
5479 }
5480
5481 LLFace* facep = drawable->getFace(0);
5482 if (!mDirtyMesh && !facep->getDirty())
5483 {
5484 return TRUE;
5485 }
5486
5487 // U32 num_vertices = 0;
5488
5489 updateMeshData();
5490
5491 mDirtyMesh = FALSE;
5492 return TRUE; 5573 return TRUE;
5493} 5574}
5494 5575
5495
5496//----------------------------------------------------------------------------- 5576//-----------------------------------------------------------------------------
5497// updateShadowFaces() 5577// updateShadowFaces()
5498//----------------------------------------------------------------------------- 5578//-----------------------------------------------------------------------------
@@ -5708,28 +5788,26 @@ void LLVOAvatar::removeChild(LLViewerObject *childp)
5708 detachObject(childp); 5788 detachObject(childp);
5709} 5789}
5710 5790
5711//----------------------------------------------------------------------------- 5791LLViewerJointAttachment* LLVOAvatar::getTargetAttachmentPoint(LLViewerObject* viewer_object)
5712// attachObject()
5713//-----------------------------------------------------------------------------
5714BOOL LLVOAvatar::attachObject(LLViewerObject *viewer_object)
5715{ 5792{
5716 S32 attachmentID = ATTACHMENT_ID_FROM_STATE(viewer_object->getState()); 5793 S32 attachmentID = ATTACHMENT_ID_FROM_STATE(viewer_object->getState());
5717 //clamp((S32)(viewer_object->getState() & AGENT_ATTACH_MASK) >> AGENT_ATTACH_OFFSET, 1, 0xff);
5718
5719 //if (mIsSelf)
5720 //{
5721 // gSelectMgr->deselectObjectAndFamily(viewer_object);
5722 //}
5723 5794
5724 LLViewerJointAttachment* attachment = mAttachmentPoints.getIfThere(attachmentID); 5795 LLViewerJointAttachment* attachment = mAttachmentPoints.getIfThere(attachmentID);
5725 5796
5726 if (!attachment) 5797 if (!attachment)
5727 { 5798 {
5728 llwarns << "Tried to attach object to invalid attachment point: " << attachmentID << llendl; 5799 llwarns << "Object attachment point invalid: " << attachmentID << llendl;
5729 return FALSE;
5730 } 5800 }
5731 5801
5732// LLQuaternion object_world_rot = viewer_object->getWorldRotation(); 5802 return attachment;
5803}
5804
5805//-----------------------------------------------------------------------------
5806// attachObject()
5807//-----------------------------------------------------------------------------
5808BOOL LLVOAvatar::attachObject(LLViewerObject *viewer_object)
5809{
5810 LLViewerJointAttachment* attachment = getTargetAttachmentPoint(viewer_object);
5733 5811
5734 if (!attachment->addObject(viewer_object)) 5812 if (!attachment->addObject(viewer_object))
5735 { 5813 {
@@ -5742,10 +5820,6 @@ BOOL LLVOAvatar::attachObject(LLViewerObject *viewer_object)
5742 gSelectMgr->updatePointAt(); 5820 gSelectMgr->updatePointAt();
5743 } 5821 }
5744 5822
5745// LLQuaternion desired_rot = (object_world_rot * ~attachment->getWorldRotation());
5746
5747 lldebugs << "Attaching object (" << attachmentID << ") item_id=" << attachment->getItemID() << " task_id=" << viewer_object->getID() << "to " << attachment->getName() << llendl;
5748
5749 if (mIsSelf) 5823 if (mIsSelf)
5750 { 5824 {
5751 updateAttachmentVisibility(gAgent.getCameraMode()); 5825 updateAttachmentVisibility(gAgent.getCameraMode());
@@ -5778,6 +5852,23 @@ void LLVOAvatar::lazyAttach()
5778 } 5852 }
5779} 5853}
5780 5854
5855void LLVOAvatar::resetHUDAttachments()
5856{
5857 for(LLViewerJointAttachment* attachment = mAttachmentPoints.getFirstData();
5858 attachment;
5859 attachment = mAttachmentPoints.getNextData())
5860 {
5861 if (attachment->getIsHUDAttachment())
5862 {
5863 LLViewerObject* obj = attachment->getObject();
5864 if (obj && obj->mDrawable.notNull())
5865 {
5866 gPipeline.markMoved(obj->mDrawable);
5867 }
5868 }
5869 }
5870}
5871
5781//----------------------------------------------------------------------------- 5872//-----------------------------------------------------------------------------
5782// detachObject() 5873// detachObject()
5783//----------------------------------------------------------------------------- 5874//-----------------------------------------------------------------------------
@@ -5788,7 +5879,7 @@ BOOL LLVOAvatar::detachObject(LLViewerObject *viewer_object)
5788 attachment = mAttachmentPoints.getNextData()) 5879 attachment = mAttachmentPoints.getNextData())
5789 { 5880 {
5790 // only one object per attachment point for now 5881 // only one object per attachment point for now
5791 if (attachment->getObject(0) == viewer_object) 5882 if (attachment->getObject() == viewer_object)
5792 { 5883 {
5793 LLUUID item_id = attachment->getItemID(); 5884 LLUUID item_id = attachment->getItemID();
5794 attachment->removeObject(viewer_object); 5885 attachment->removeObject(viewer_object);
@@ -5981,7 +6072,7 @@ LLViewerObject* LLVOAvatar::getWornAttachment( const LLUUID& inv_item_id )
5981 { 6072 {
5982 if( attachment_point->getItemID() == inv_item_id ) 6073 if( attachment_point->getItemID() == inv_item_id )
5983 { 6074 {
5984 return attachment_point->getObject(0); 6075 return attachment_point->getObject();
5985 } 6076 }
5986 } 6077 }
5987 return NULL; 6078 return NULL;
@@ -6319,10 +6410,10 @@ const LLUUID& LLVOAvatar::getLocalTextureID( S32 index )
6319void LLVOAvatar::dumpTotalLocalTextureByteCount() 6410void LLVOAvatar::dumpTotalLocalTextureByteCount()
6320{ 6411{
6321 S32 total_gl_bytes = 0; 6412 S32 total_gl_bytes = 0;
6322 for( LLVOAvatar* cur = (LLVOAvatar*)LLCharacter::sInstances.getFirstData(); 6413 for (std::vector<LLCharacter*>::iterator iter = LLCharacter::sInstances.begin();
6323 cur; 6414 iter != LLCharacter::sInstances.end(); ++iter)
6324 cur = (LLVOAvatar*)LLCharacter::sInstances.getNextData() )
6325 { 6415 {
6416 LLVOAvatar* cur = (LLVOAvatar*) *iter;
6326 S32 gl_bytes = 0; 6417 S32 gl_bytes = 0;
6327 cur->getLocalTextureByteCount(&gl_bytes ); 6418 cur->getLocalTextureByteCount(&gl_bytes );
6328 total_gl_bytes += gl_bytes; 6419 total_gl_bytes += gl_bytes;
@@ -7722,7 +7813,7 @@ BOOL LLVOAvatar::hasHUDAttachment()
7722 attachment; 7813 attachment;
7723 attachment = mAttachmentPoints.getNextData()) 7814 attachment = mAttachmentPoints.getNextData())
7724 { 7815 {
7725 if (attachment->getIsHUDAttachment() && attachment->getObject(0)) 7816 if (attachment->getIsHUDAttachment() && attachment->getObject())
7726 { 7817 {
7727 return TRUE; 7818 return TRUE;
7728 } 7819 }
@@ -7737,9 +7828,9 @@ LLBBox LLVOAvatar::getHUDBBox()
7737 attachment; 7828 attachment;
7738 attachment = mAttachmentPoints.getNextData()) 7829 attachment = mAttachmentPoints.getNextData())
7739 { 7830 {
7740 if (attachment->getIsHUDAttachment() && attachment->getObject(0)) 7831 if (attachment->getIsHUDAttachment() && attachment->getObject())
7741 { 7832 {
7742 LLViewerObject* hud_object = attachment->getObject(0); 7833 LLViewerObject* hud_object = attachment->getObject();
7743 7834
7744 // initialize bounding box to contain identity orientation and center point for attached object 7835 // initialize bounding box to contain identity orientation and center point for attached object
7745 bbox.addPointLocal(hud_object->getPosition()); 7836 bbox.addPointLocal(hud_object->getPosition());
@@ -7757,52 +7848,6 @@ LLBBox LLVOAvatar::getHUDBBox()
7757 7848
7758void LLVOAvatar::rebuildHUD() 7849void LLVOAvatar::rebuildHUD()
7759{ 7850{
7760 if (!mIsSelf)
7761 {
7762 return;
7763 }
7764
7765 for(LLViewerJointAttachment *attachment = mAttachmentPoints.getFirstData();
7766 attachment;
7767 attachment = mAttachmentPoints.getNextData())
7768 {
7769 if (attachment->getIsHUDAttachment() && attachment->getObject(0))
7770 {
7771 LLViewerObject* hud_object = attachment->getObject(0);
7772 LLDrawable* hud_drawable = hud_object->mDrawable;
7773
7774 if (hud_drawable)
7775 {
7776 // this assumes that an AGP sync will happen because face has been backlisted,
7777 // so that pool has been rebuilt this frame and is scheduled for a sync
7778 for(S32 face_index = 0; face_index < hud_drawable->getNumFaces(); ++face_index)
7779 {
7780 LLFace* facep = hud_drawable->getFace(face_index);
7781 if (facep->isState(LLFace::BACKLIST))
7782 {
7783 facep->restore();
7784 }
7785 }
7786 }
7787 for (U32 child_num = 0; child_num < hud_object->mChildList.size(); ++child_num)
7788 {
7789 LLViewerObject* childp = hud_object->mChildList[child_num];
7790 LLDrawable* child_drawable = childp->mDrawable;
7791
7792 if (child_drawable)
7793 {
7794 for(S32 face_index = 0; face_index < child_drawable->getNumFaces(); ++face_index)
7795 {
7796 LLFace* facep = child_drawable->getFace(face_index);
7797 if (facep->isState(LLFace::BACKLIST))
7798 {
7799 facep->restore();
7800 }
7801 }
7802 }
7803 }
7804 }
7805 }
7806} 7851}
7807 7852
7808//----------------------------------------------------------------------------- 7853//-----------------------------------------------------------------------------
@@ -8059,8 +8104,7 @@ void LLVOAvatar::onBakedTextureMasksLoaded( BOOL success, LLViewerImage *src_vi,
8059 { 8104 {
8060 if (!aux_src->getData()) 8105 if (!aux_src->getData())
8061 { 8106 {
8062 llwarns << "No auxiliary source data for onBakedTextureMasksLoaded" << llendl; 8107 llerrs << "No auxiliary source data for onBakedTextureMasksLoaded" << llendl;
8063 src_vi->startImageDecode();
8064 return; 8108 return;
8065 } 8109 }
8066 8110
@@ -8351,7 +8395,7 @@ void LLVOAvatar::dumpArchetypeXML( void* )
8351 LLViewerImage* te_image = avatar->getTEImage( te ); 8395 LLViewerImage* te_image = avatar->getTEImage( te );
8352 if( te_image ) 8396 if( te_image )
8353 { 8397 {
8354 char uuid_str[UUID_STR_LENGTH]; 8398 char uuid_str[UUID_STR_LENGTH]; /* Flawfinder: ignore */
8355 te_image->getID().toString( uuid_str ); 8399 te_image->getID().toString( uuid_str );
8356 apr_file_printf( file, "\t\t<texture te=\"%i\" uuid=\"%s\"/>\n", te, uuid_str); 8400 apr_file_printf( file, "\t\t<texture te=\"%i\" uuid=\"%s\"/>\n", te, uuid_str);
8357 } 8401 }
@@ -8368,10 +8412,10 @@ void LLVOAvatar::dumpArchetypeXML( void* )
8368S32 LLVOAvatar::getUnbakedPixelAreaRank() 8412S32 LLVOAvatar::getUnbakedPixelAreaRank()
8369{ 8413{
8370 S32 rank = 1; 8414 S32 rank = 1;
8371 for( LLVOAvatar* inst = (LLVOAvatar*)LLCharacter::sInstances.getFirstData(); 8415 for (std::vector<LLCharacter*>::iterator iter = LLCharacter::sInstances.begin();
8372 inst; 8416 iter != LLCharacter::sInstances.end(); ++iter)
8373 inst = (LLVOAvatar*)LLCharacter::sInstances.getNextData() )
8374 { 8417 {
8418 LLVOAvatar* inst = (LLVOAvatar*) *iter;
8375 if( inst == this ) 8419 if( inst == this )
8376 { 8420 {
8377 return rank; 8421 return rank;
@@ -8390,16 +8434,15 @@ S32 LLVOAvatar::getUnbakedPixelAreaRank()
8390// static 8434// static
8391void LLVOAvatar::cullAvatarsByPixelArea() 8435void LLVOAvatar::cullAvatarsByPixelArea()
8392{ 8436{
8393 LLVOAvatar::sInstances.bubbleSortList(); 8437 std::sort(LLCharacter::sInstances.begin(), LLCharacter::sInstances.end(), CompareScreenAreaGreater());
8394 8438
8395
8396 // Update the avatars that have changed status 8439 // Update the avatars that have changed status
8397 S32 rank = 1; 8440 S32 rank = 1;
8398 8441
8399 for( LLVOAvatar* inst = (LLVOAvatar*)LLCharacter::sInstances.getFirstData(); 8442 for (std::vector<LLCharacter*>::iterator iter = LLCharacter::sInstances.begin();
8400 inst; 8443 iter != LLCharacter::sInstances.end(); ++iter)
8401 inst = (LLVOAvatar*)LLCharacter::sInstances.getNextData() )
8402 { 8444 {
8445 LLVOAvatar* inst = (LLVOAvatar*) *iter;
8403 BOOL culled; 8446 BOOL culled;
8404 if( inst->isDead() ) 8447 if( inst->isDead() )
8405 { 8448 {
@@ -8589,8 +8632,6 @@ void LLVOAvatar::dumpLocalTextures()
8589 else 8632 else
8590 { 8633 {
8591 LLViewerImage* image = mLocalTexture[i]; 8634 LLViewerImage* image = mLocalTexture[i];
8592 F32 data_progress = 0.0f;
8593 F32 decode_progress = image->getDecodeProgress(&data_progress);
8594 8635
8595 llinfos << "LocTex " << names[i] << ": " 8636 llinfos << "LocTex " << names[i] << ": "
8596 << "Discard " << image->getDiscardLevel() << ", " 8637 << "Discard " << image->getDiscardLevel() << ", "
@@ -8600,10 +8641,7 @@ void LLVOAvatar::dumpLocalTextures()
8600 // makes textures easier to steal 8641 // makes textures easier to steal
8601 << image->getID() << " " 8642 << image->getID() << " "
8602#endif 8643#endif
8603 << "Data: " << (data_progress * 100) << "% " 8644 << "Priority: " << image->getDecodePriority()
8604 << "Decode: " << (decode_progress * 100) << "% "
8605 << "Priority: " << image->getDecodePriority() << " "
8606 << (image->needsDecode() ? "pending decode" : "not pending decode")
8607 << llendl; 8645 << llendl;
8608 } 8646 }
8609 } 8647 }
@@ -8705,7 +8743,7 @@ BOOL LLVOAvatarBoneInfo::parseXml(LLXmlTreeNode* node)
8705 } 8743 }
8706 else 8744 else
8707 { 8745 {
8708 llerrs << "Invalid node " << node->getName() << llendl; 8746 llwarns << "Invalid node " << node->getName() << llendl;
8709 return FALSE; 8747 return FALSE;
8710 } 8748 }
8711 8749
@@ -8763,7 +8801,7 @@ BOOL LLVOAvatarSkeletonInfo::parseXml(LLXmlTreeNode* node)
8763 static LLStdStringHandle num_bones_string = LLXmlTree::addAttributeString("num_bones"); 8801 static LLStdStringHandle num_bones_string = LLXmlTree::addAttributeString("num_bones");
8764 if (!node->getFastAttributeS32(num_bones_string, mNumBones)) 8802 if (!node->getFastAttributeS32(num_bones_string, mNumBones))
8765 { 8803 {
8766 llerrs << "Couldn't find number of bones." << llendl; 8804 llwarns << "Couldn't find number of bones." << llendl;
8767 return FALSE; 8805 return FALSE;
8768 } 8806 }
8769 8807
@@ -8777,7 +8815,8 @@ BOOL LLVOAvatarSkeletonInfo::parseXml(LLXmlTreeNode* node)
8777 if (!info->parseXml(child)) 8815 if (!info->parseXml(child))
8778 { 8816 {
8779 delete info; 8817 delete info;
8780 llerrs << "Error parsing bone in skeleton file" << llendl; 8818 llwarns << "Error parsing bone in skeleton file" << llendl;
8819 return FALSE;
8781 } 8820 }
8782 mBoneInfoList.push_back(info); 8821 mBoneInfoList.push_back(info);
8783 } 8822 }
@@ -9099,7 +9138,7 @@ BOOL LLVOAvatarInfo::parseXmlDriverNodes(LLXmlTreeNode* root)
9099 9138
9100void LLVOAvatar::writeCAL3D(std::string& path, std::string& file_base) 9139void LLVOAvatar::writeCAL3D(std::string& path, std::string& file_base)
9101{ 9140{
9102 char filename[MAX_PATH]; 9141 char filename[MAX_PATH]; /* Flawfinder: ignore */
9103 9142
9104 // reset animated morphs 9143 // reset animated morphs
9105 setVisualParamWeight("Blink_Left", 0.f); 9144 setVisualParamWeight("Blink_Left", 0.f);
@@ -9119,7 +9158,7 @@ void LLVOAvatar::writeCAL3D(std::string& path, std::string& file_base)
9119 setVisualParamWeight("Hands_Spread_R", 0.f); 9158 setVisualParamWeight("Hands_Spread_R", 0.f);
9120 updateVisualParams(); 9159 updateVisualParams();
9121 9160
9122 sprintf(filename, "%s\\%s_skeleton.xsf", path.c_str(), file_base.c_str()); 9161 snprintf(filename, MAX_PATH, "%s\\%s_skeleton.xsf", path.c_str(), file_base.c_str()); /* Flawfinder: ignore */
9123 apr_file_t* fp = ll_apr_file_open(filename, LL_APR_W); 9162 apr_file_t* fp = ll_apr_file_open(filename, LL_APR_W);
9124 if (!fp) 9163 if (!fp)
9125 { 9164 {
@@ -9131,7 +9170,7 @@ void LLVOAvatar::writeCAL3D(std::string& path, std::string& file_base)
9131 apr_file_printf(fp, "</SKELETON>\n"); 9170 apr_file_printf(fp, "</SKELETON>\n");
9132 apr_file_close(fp); 9171 apr_file_close(fp);
9133 9172
9134 sprintf(filename, "%s\\%s_mesh_body.xmf", path.c_str(), file_base.c_str()); 9173 snprintf(filename, MAX_PATH, "%s\\%s_mesh_body.xmf", path.c_str(), file_base.c_str()); /* Flawfinder: ignore */
9135 //gDirUtilp->getExpandedFilename(LL_PATH_CHARACTER,"avatar.cal").c_str() 9174 //gDirUtilp->getExpandedFilename(LL_PATH_CHARACTER,"avatar.cal").c_str()
9136 fp = ll_apr_file_open(filename, LL_APR_W); 9175 fp = ll_apr_file_open(filename, LL_APR_W);
9137 if (!fp) 9176 if (!fp)
@@ -9162,7 +9201,7 @@ void LLVOAvatar::writeCAL3D(std::string& path, std::string& file_base)
9162 9201
9163 for (S32 i = 0; i < (has_skirt ? BAKED_TEXTURE_COUNT : BAKED_TEXTURE_COUNT - 1); i++) 9202 for (S32 i = 0; i < (has_skirt ? BAKED_TEXTURE_COUNT : BAKED_TEXTURE_COUNT - 1); i++)
9164 { 9203 {
9165 sprintf(filename, "%s\\%s_material_tex_%d.tga", path.c_str(), file_base.c_str(), i); 9204 snprintf(filename, MAX_PATH, "%s\\%s_material_tex_%d.tga", path.c_str(), file_base.c_str(), i); /* Flawfinder: ignore */
9166 9205
9167 LLViewerImage* viewer_imagep = mTEImages[sBakedTextureIndices[i]]; 9206 LLViewerImage* viewer_imagep = mTEImages[sBakedTextureIndices[i]];
9168 if (!viewer_imagep->getHasGLTexture()) 9207 if (!viewer_imagep->getHasGLTexture())
@@ -9177,7 +9216,7 @@ void LLVOAvatar::writeCAL3D(std::string& path, std::string& file_base)
9177 } 9216 }
9178 9217
9179 // output image for hair 9218 // output image for hair
9180 sprintf(filename, "%s\\%s_material_tex_5.tga", path.c_str(), file_base.c_str()); 9219 snprintf(filename, MAX_PATH, "%s\\%s_material_tex_5.tga", path.c_str(), file_base.c_str()); /* Flawfinder: ignore */
9181 LLViewerImage* viewer_imagep = mTEImages[TEX_HAIR]; 9220 LLViewerImage* viewer_imagep = mTEImages[TEX_HAIR];
9182 if (!viewer_imagep->getHasGLTexture()) 9221 if (!viewer_imagep->getHasGLTexture())
9183 { 9222 {
@@ -9192,7 +9231,7 @@ void LLVOAvatar::writeCAL3D(std::string& path, std::string& file_base)
9192 } 9231 }
9193 9232
9194 // save out attachments 9233 // save out attachments
9195 sprintf(filename, "%s\\%s_mesh_attachments.xmf", path.c_str(), file_base.c_str()); 9234 snprintf(filename, MAX_PATH, "%s\\%s_mesh_attachments.xmf", path.c_str(), file_base.c_str()); /* Flawfinder: ignore */
9196 fp = ll_apr_file_open(filename, LL_APR_W); 9235 fp = ll_apr_file_open(filename, LL_APR_W);
9197 if (!fp) 9236 if (!fp)
9198 { 9237 {
@@ -9208,7 +9247,7 @@ void LLVOAvatar::writeCAL3D(std::string& path, std::string& file_base)
9208 attachment; 9247 attachment;
9209 attachment = mAttachmentPoints.getNextData()) 9248 attachment = mAttachmentPoints.getNextData())
9210 { 9249 {
9211 LLViewerObject *attached_object = attachment->getObject(0); 9250 LLViewerObject *attached_object = attachment->getObject();
9212 if (attached_object && !attached_object->isDead() && attached_object->mDrawable.notNull() && 9251 if (attached_object && !attached_object->isDead() && attached_object->mDrawable.notNull() &&
9213 attached_object->getPCode() == LL_PCODE_VOLUME) 9252 attached_object->getPCode() == LL_PCODE_VOLUME)
9214 { 9253 {
@@ -9229,7 +9268,7 @@ void LLVOAvatar::writeCAL3D(std::string& path, std::string& file_base)
9229 attachment; 9268 attachment;
9230 attachment = mAttachmentPoints.getNextData()) 9269 attachment = mAttachmentPoints.getNextData())
9231 { 9270 {
9232 LLViewerObject *attached_object = attachment->getObject(0); 9271 LLViewerObject *attached_object = attachment->getObject();
9233 if (attached_object && !attached_object->isDead() && attached_object->getPCode() == LL_PCODE_VOLUME) 9272 if (attached_object && !attached_object->isDead() && attached_object->getPCode() == LL_PCODE_VOLUME)
9234 { 9273 {
9235 LLVOVolume* attached_volume = (LLVOVolume*)attached_object; 9274 LLVOVolume* attached_volume = (LLVOVolume*)attached_object;
@@ -9254,7 +9293,7 @@ void LLVOAvatar::writeCAL3D(std::string& path, std::string& file_base)
9254 getSex() == SEX_MALE ? (LLKeyframeMotion*)findMotion(ANIM_AGENT_WALK) : (LLKeyframeMotion*)findMotion(ANIM_AGENT_FEMALE_WALK); 9293 getSex() == SEX_MALE ? (LLKeyframeMotion*)findMotion(ANIM_AGENT_WALK) : (LLKeyframeMotion*)findMotion(ANIM_AGENT_FEMALE_WALK);
9255 if (FALSE)//(walk_motion) 9294 if (FALSE)//(walk_motion)
9256 { 9295 {
9257 sprintf(filename, "%s\\%s_anim.xaf", path.c_str(), file_base.c_str()); 9296 snprintf(filename, MAX_PATH, "%s\\%s_anim.xaf", path.c_str(), file_base.c_str()); /* Flawfinder: ignore */
9258 apr_file_t* fp = ll_apr_file_open(filename, LL_APR_W); 9297 apr_file_t* fp = ll_apr_file_open(filename, LL_APR_W);
9259 if (!fp) 9298 if (!fp)
9260 { 9299 {
@@ -9268,7 +9307,7 @@ void LLVOAvatar::writeCAL3D(std::string& path, std::string& file_base)
9268 } 9307 }
9269 9308
9270 // finally, write out .cfg file 9309 // finally, write out .cfg file
9271 sprintf(filename, "%s\\%s_avatar.cfg", path.c_str(), file_base.c_str()); 9310 snprintf(filename, MAX_PATH, "%s\\%s_avatar.cfg", path.c_str(), file_base.c_str()); /* Flawfinder: ignore */
9272 fp = ll_apr_file_open(filename, LL_APR_W); 9311 fp = ll_apr_file_open(filename, LL_APR_W);
9273 if (!fp) 9312 if (!fp)
9274 { 9313 {
@@ -9289,7 +9328,7 @@ void LLVOAvatar::writeCAL3D(std::string& path, std::string& file_base)
9289 9328
9290 for(S32 i = 0; i < 6; i++) 9329 for(S32 i = 0; i < 6; i++)
9291 { 9330 {
9292 sprintf(filename, "%s\\%s_material_%d.xrf", path.c_str(), file_base.c_str(), i); 9331 snprintf(filename, MAX_PATH, "%s\\%s_material_%d.xrf", path.c_str(), file_base.c_str(), i); /* Flawfinder: ignore */
9293 apr_file_t* fp = ll_apr_file_open(filename, LL_APR_W); 9332 apr_file_t* fp = ll_apr_file_open(filename, LL_APR_W);
9294 if (!fp) 9333 if (!fp)
9295 { 9334 {
@@ -9316,7 +9355,7 @@ void LLVOAvatar::writeCAL3D(std::string& path, std::string& file_base)
9316 { 9355 {
9317 LLMaterialExportInfo* export_info = material_it->second; 9356 LLMaterialExportInfo* export_info = material_it->second;
9318 9357
9319 sprintf(filename, "%s\\%s_material_%d.xrf", path.c_str(), file_base.c_str(), export_info->mMaterialIndex); 9358 snprintf(filename, MAX_PATH, "%s\\%s_material_%d.xrf", path.c_str(), file_base.c_str(), export_info->mMaterialIndex); /* Flawfinder: ignore */
9320 apr_file_t* fp = ll_apr_file_open(filename, LL_APR_W); 9359 apr_file_t* fp = ll_apr_file_open(filename, LL_APR_W);
9321 if (!fp) 9360 if (!fp)
9322 { 9361 {
@@ -9441,3 +9480,58 @@ LLHost LLVOAvatar::getObjectHost() const
9441 return LLHost::invalid; 9480 return LLHost::invalid;
9442 } 9481 }
9443} 9482}
9483
9484BOOL LLVOAvatar::updateLOD()
9485{
9486 BOOL res = updateJointLODs();
9487
9488 LLFace* facep = mDrawable->getFace(0);
9489 if (facep->mVertexBuffer.isNull() ||
9490 LLVertexBuffer::sEnableVBOs &&
9491 ((facep->mVertexBuffer->getUsage() == GL_STATIC_DRAW ? TRUE : FALSE) !=
9492 (facep->getPool()->getVertexShaderLevel() > 0 ? TRUE : FALSE)))
9493 {
9494 mDirtyMesh = TRUE;
9495 }
9496
9497 if (mDirtyMesh || mDrawable->isState(LLDrawable::REBUILD_GEOMETRY))
9498 { //LOD changed or new mesh created, allocate new vertex buffer if needed
9499 updateMeshData();
9500 mDirtyMesh = FALSE;
9501 mDrawable->clearState(LLDrawable::REBUILD_GEOMETRY);
9502 }
9503
9504 if (facep->getPool()->getVertexShaderLevel() <= 0)
9505 {
9506 //generate animated mesh
9507 mLowerBodyLOD.updateGeometry();
9508 mUpperBodyLOD.updateGeometry();
9509
9510 if( isWearingWearableType( WT_SKIRT ) )
9511 {
9512 mSkirtLOD.updateGeometry();
9513 }
9514
9515 if (!mIsSelf || gAgent.needsRenderHead())
9516 {
9517 mEyeLashLOD.updateGeometry();
9518 mHeadLOD.updateGeometry();
9519 mHairLOD.updateGeometry();
9520 }
9521 }
9522
9523 // Update the shadow, tractor, and text label geometry.
9524 if (mDrawable->isState(LLDrawable::REBUILD_SHADOW))
9525 {
9526 updateShadowFaces();
9527 mDrawable->clearState(LLDrawable::REBUILD_SHADOW);
9528 }
9529
9530 return res;
9531}
9532
9533U32 LLVOAvatar::getPartitionType() const
9534{ //avatars merely exist as drawables in the bridge partition
9535 return LLPipeline::PARTITION_BRIDGE;
9536}
9537
diff --git a/linden/indra/newview/llvoavatar.h b/linden/indra/newview/llvoavatar.h
index f942273..ff37848 100644
--- a/linden/indra/newview/llvoavatar.h
+++ b/linden/indra/newview/llvoavatar.h
@@ -76,6 +76,13 @@ class LLDriverParamInfo;
76class LLHUDText; 76class LLHUDText;
77class LLHUDEffectSpiral; 77class LLHUDEffectSpiral;
78 78
79class LLVertexBufferAvatar : public LLVertexBuffer
80{
81public:
82 LLVertexBufferAvatar();
83 virtual void setupVertexBuffer(U32 data_mask) const;
84};
85
79typedef enum e_mesh_id 86typedef enum e_mesh_id
80{ 87{
81 MESH_ID_HAIR, 88 MESH_ID_HAIR,
@@ -232,6 +239,25 @@ protected:
232 virtual ~LLVOAvatar(); 239 virtual ~LLVOAvatar();
233 240
234public: 241public:
242
243 struct CompareScreenAreaGreater
244 {
245 bool operator()(const LLCharacter* const& lhs, const LLCharacter* const& rhs)
246 {
247 return lhs->getPixelArea() > rhs->getPixelArea();
248 }
249 };
250
251 enum
252 {
253 VERTEX_DATA_MASK = (1 << LLVertexBuffer::TYPE_VERTEX) |
254 (1 << LLVertexBuffer::TYPE_NORMAL) |
255 (1 << LLVertexBuffer::TYPE_TEXCOORD) |
256 (1 << LLVertexBuffer::TYPE_WEIGHT) |
257 (1 << LLVertexBuffer::TYPE_CLOTHWEIGHT)
258 }
259 eVertexDataMask;
260
235 LLVOAvatar(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp); 261 LLVOAvatar(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp);
236 /*virtual*/ void markDead(); 262 /*virtual*/ void markDead();
237 263
@@ -247,20 +273,24 @@ public:
247 const EObjectUpdateType update_type, 273 const EObjectUpdateType update_type,
248 LLDataPacker *dp); 274 LLDataPacker *dp);
249 virtual BOOL idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time); 275 virtual BOOL idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time);
276 virtual BOOL updateLOD();
250 void setFootPlane(const LLVector4 &plane) { mFootPlane = plane; } 277 void setFootPlane(const LLVector4 &plane) { mFootPlane = plane; }
251 /*virtual*/ BOOL isActive() const; // Whether this object needs to do an idleUpdate. 278 /*virtual*/ BOOL isActive() const; // Whether this object needs to do an idleUpdate.
252 279
253 // Graphical stuff for objects - maybe broken out into render class later? 280 // Graphical stuff for objects - maybe broken out into render class later?
254 281
255 U32 renderSkinned(EAvatarRenderPass pass); 282 U32 renderFootShadows();
256 U32 renderRigid(); 283 U32 renderRigid();
257 284 U32 renderSkinned(EAvatarRenderPass pass);
285 U32 renderTransparent();
258 void renderCollisionVolumes(); 286 void renderCollisionVolumes();
259 287
260 /*virtual*/ void updateTextures(LLAgent &agent); 288 /*virtual*/ void updateTextures(LLAgent &agent);
261 // If setting a baked texture, need to request it from a non-local sim. 289 // If setting a baked texture, need to request it from a non-local sim.
262 /*virtual*/ S32 setTETexture(const U8 te, const LLUUID& uuid); 290 /*virtual*/ S32 setTETexture(const U8 te, const LLUUID& uuid);
263 291
292 virtual U32 getPartitionType() const;
293
264 void updateVisibility(BOOL force_invisible); 294 void updateVisibility(BOOL force_invisible);
265 void updateAttachmentVisibility(U32 camera_mode); 295 void updateAttachmentVisibility(U32 camera_mode);
266 void clampAttachmentPositions(); 296 void clampAttachmentPositions();
@@ -278,11 +308,14 @@ public:
278 void updateShadowFaces(); 308 void updateShadowFaces();
279 309
280 /*virtual*/ void setPixelAreaAndAngle(LLAgent &agent); 310 /*virtual*/ void setPixelAreaAndAngle(LLAgent &agent);
281 void updateJointLODs(); 311 BOOL updateJointLODs();
282 312
283 void writeCAL3D(std::string& path, std::string& file_base); 313 void writeCAL3D(std::string& path, std::string& file_base);
284 314
285 virtual void updateRegion(LLViewerRegion *regionp); 315 virtual void updateRegion(LLViewerRegion *regionp);
316
317
318 void updateSpatialExtents(LLVector3& newMin, LLVector3 &newMax);
286 319
287 //-------------------------------------------------------------------- 320 //--------------------------------------------------------------------
288 // texture entry assignment 321 // texture entry assignment
@@ -342,7 +375,7 @@ public:
342 virtual BOOL allocateCharacterJoints( U32 num ); 375 virtual BOOL allocateCharacterJoints( U32 num );
343 virtual LLJoint *getCharacterJoint( U32 num ); 376 virtual LLJoint *getCharacterJoint( U32 num );
344 virtual void requestStopMotion( LLMotion* motion ); 377 virtual void requestStopMotion( LLMotion* motion );
345 virtual F32 getPixelArea(); 378 virtual F32 getPixelArea() const;
346 virtual LLPolyMesh* getHeadMesh(); 379 virtual LLPolyMesh* getHeadMesh();
347 virtual LLPolyMesh* getUpperBodyMesh(); 380 virtual LLPolyMesh* getUpperBodyMesh();
348 virtual LLVector3d getPosGlobalFromAgent(const LLVector3 &position); 381 virtual LLVector3d getPosGlobalFromAgent(const LLVector3 &position);
@@ -362,7 +395,7 @@ public:
362 // Other public functions 395 // Other public functions
363 //-------------------------------------------------------------------- 396 //--------------------------------------------------------------------
364 BOOL allocateCollisionVolumes( U32 num ); 397 BOOL allocateCollisionVolumes( U32 num );
365 398 void resetHUDAttachments();
366 static void getAnimLabels( LLDynamicArray<const char*>* labels ); 399 static void getAnimLabels( LLDynamicArray<const char*>* labels );
367 static void getAnimNames( LLDynamicArray<const char*>* names ); 400 static void getAnimNames( LLDynamicArray<const char*>* names );
368 401
@@ -439,6 +472,7 @@ public:
439 virtual void addChild(LLViewerObject *childp); 472 virtual void addChild(LLViewerObject *childp);
440 virtual void removeChild(LLViewerObject *childp); 473 virtual void removeChild(LLViewerObject *childp);
441 474
475 LLViewerJointAttachment* getTargetAttachmentPoint(LLViewerObject* viewer_object);
442 BOOL attachObject(LLViewerObject *viewer_object); 476 BOOL attachObject(LLViewerObject *viewer_object);
443 BOOL detachObject(LLViewerObject *viewer_object); 477 BOOL detachObject(LLViewerObject *viewer_object);
444 void lazyAttach(); 478 void lazyAttach();
@@ -543,7 +577,7 @@ public:
543 //-------------------------------------------------------------------- 577 //--------------------------------------------------------------------
544 // avatar definition name 578 // avatar definition name
545 //-------------------------------------------------------------------- 579 //--------------------------------------------------------------------
546 char mAvatarDefinition[64]; 580 char mAvatarDefinition[64]; /* Flawfinder: ignore */
547 581
548 //-------------------------------------------------------------------- 582 //--------------------------------------------------------------------
549 // skeleton for skinned avatar 583 // skeleton for skinned avatar
@@ -836,7 +870,6 @@ protected:
836 870
837 F32 mRenderPriority; 871 F32 mRenderPriority;
838 F32 mAdjustedPixelArea; 872 F32 mAdjustedPixelArea;
839 S32 mNumAGPVertices;
840 873
841 LLWString mNameString; 874 LLWString mNameString;
842 LLString mTitle; 875 LLString mTitle;
@@ -877,6 +910,8 @@ protected:
877 U32 mLowerMaskTexName; 910 U32 mLowerMaskTexName;
878 911
879 BOOL mCulled; 912 BOOL mCulled;
913 F32 mMinPixelArea; // debug
914 F32 mMaxPixelArea; // debug
880 915
881 //-------------------------------------------------------------------- 916 //--------------------------------------------------------------------
882 // Global Colors 917 // Global Colors
@@ -903,6 +938,7 @@ protected:
903 938
904 void requestLayerSetUpdate(LLVOAvatar::ELocTexIndex i); 939 void requestLayerSetUpdate(LLVOAvatar::ELocTexIndex i);
905 void addLocalTextureStats(LLVOAvatar::ELocTexIndex i, LLViewerImage* imagep, F32 texel_area_ratio, BOOL rendered, BOOL covered_by_baked); 940 void addLocalTextureStats(LLVOAvatar::ELocTexIndex i, LLViewerImage* imagep, F32 texel_area_ratio, BOOL rendered, BOOL covered_by_baked);
941 void addBakedTextureStats( LLViewerImage* imagep, F32 pixel_area, F32 texel_area_ratio, S32 boost_level);
906 static void onInitialBakedTextureLoaded( BOOL success, LLViewerImage *src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, BOOL final, void* userdata ); 942 static void onInitialBakedTextureLoaded( BOOL success, LLViewerImage *src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, BOOL final, void* userdata );
907 static void onBakedTextureLoaded(BOOL success, LLViewerImage *src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, BOOL final, void* userdata); 943 static void onBakedTextureLoaded(BOOL success, LLViewerImage *src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, BOOL final, void* userdata);
908 void useBakedTexture(const LLUUID& id); 944 void useBakedTexture(const LLUUID& id);
diff --git a/linden/indra/newview/llvoclouds.cpp b/linden/indra/newview/llvoclouds.cpp
index a4e424a..7d1d958 100644
--- a/linden/indra/newview/llvoclouds.cpp
+++ b/linden/indra/newview/llvoclouds.cpp
@@ -29,6 +29,8 @@
29 29
30#include "llvoclouds.h" 30#include "llvoclouds.h"
31 31
32#include "lldrawpoolalpha.h"
33
32#include "llviewercontrol.h" 34#include "llviewercontrol.h"
33 35
34#include "llagent.h" // to get camera position 36#include "llagent.h" // to get camera position
@@ -46,7 +48,7 @@
46#include "viewer.h" 48#include "viewer.h"
47 49
48LLVOClouds::LLVOClouds(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp) 50LLVOClouds::LLVOClouds(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp)
49: LLViewerObject(id, LL_VO_CLOUDS, regionp) 51: LLAlphaObject(id, LL_VO_CLOUDS, regionp)
50{ 52{
51 mCloudGroupp = NULL; 53 mCloudGroupp = NULL;
52 mbCanSelect = FALSE; 54 mbCanSelect = FALSE;
@@ -99,77 +101,132 @@ LLDrawable* LLVOClouds::createDrawable(LLPipeline *pipeline)
99 mDrawable->setLit(FALSE); 101 mDrawable->setLit(FALSE);
100 mDrawable->setRenderType(LLPipeline::RENDER_TYPE_CLOUDS); 102 mDrawable->setRenderType(LLPipeline::RENDER_TYPE_CLOUDS);
101 103
102 LLDrawPool *pool = gPipeline.getPool(LLDrawPool::POOL_CLOUDS);
103
104 mDrawable->setNumFaces(1, pool, getTEImage(0));
105
106 return mDrawable; 104 return mDrawable;
107} 105}
108 106
109BOOL LLVOClouds::updateGeometry(LLDrawable *drawable) 107BOOL LLVOClouds::updateGeometry(LLDrawable *drawable)
110{ 108{
109 LLFastTimer ftm(LLFastTimer::FTM_UPDATE_CLOUDS);
111 if (!(gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_CLOUDS))) 110 if (!(gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_CLOUDS)))
112 return TRUE; 111 return TRUE;
113 112
114 LLVector3 at;
115 LLVector3 up;
116 LLVector3 right;
117 LLVector3 normal(0.f,0.f,-1.f);
118 LLVector3 position_agent;
119 //LLVector3 v[4];
120 LLFace *facep; 113 LLFace *facep;
121 const LLVector3 region_pos_agent = mRegionp->getOriginAgent(); 114
122 const LLVector3 camera_agent = gAgent.getCameraPositionAgent();
123 LLVector3 center_offset = getPositionRegion();
124 LLVector2 uvs[4];
125
126 uvs[0].setVec(0.f, 1.f);
127 uvs[1].setVec(0.f, 0.f);
128 uvs[2].setVec(1.f, 1.f);
129 uvs[3].setVec(1.f, 0.f);
130
131 LLVector3 vtx[4];
132
133 S32 num_faces = mCloudGroupp->getNumPuffs(); 115 S32 num_faces = mCloudGroupp->getNumPuffs();
134 116
135 drawable->setNumFacesFast(num_faces, gPipeline.getPool(LLDrawPool::POOL_CLOUDS), getTEImage(0)); 117 if (num_faces > drawable->getNumFaces())
118 {
119 drawable->setNumFacesFast(num_faces, NULL, getTEImage(0));
120 }
121
122 mDepth = (getPositionAgent()-gCamera->getOrigin())*gCamera->getAtAxis();
136 123
137 S32 face_indx = 0; 124 S32 face_indx = 0;
138 for ( ; face_indx < num_faces; face_indx++) 125 for ( ; face_indx < num_faces; face_indx++)
139 { 126 {
140 facep = drawable->getFace(face_indx); 127 facep = drawable->getFace(face_indx);
141 128 if (isParticle())
142 LLStrider<LLVector3> verticesp, normalsp;
143 LLStrider<LLVector2> texCoordsp;
144 U32 *indicesp;
145 S32 index_offset;
146
147 facep->setPrimType(LLTriangles);
148 facep->setSize(4, 6);
149 index_offset = facep->getGeometry(verticesp,normalsp,texCoordsp, indicesp);
150 if (-1 == index_offset)
151 { 129 {
152 return TRUE; 130 facep->setSize(1,1);
153 } 131 }
154 132 else
133 {
134 facep->setSize(4, 6);
135 }
136 facep->setTEOffset(face_indx);
137 facep->setTexture(getTEImage(0));
155 const LLCloudPuff &puff = mCloudGroupp->getPuff(face_indx); 138 const LLCloudPuff &puff = mCloudGroupp->getPuff(face_indx);
156 const LLVector3 puff_pos_agent = gAgent.getPosAgentFromGlobal(puff.getPositionGlobal()); 139 const LLVector3 puff_pos_agent = gAgent.getPosAgentFromGlobal(puff.getPositionGlobal());
157 facep->mCenterAgent = puff_pos_agent; 140 facep->mCenterLocal = puff_pos_agent;
141 }
142 for ( ; face_indx < drawable->getNumFaces(); face_indx++)
143 {
144 facep = drawable->getFace(face_indx);
145 facep->setTEOffset(face_indx);
146 facep->setSize(0,0);
147 }
148
149 drawable->movePartition();
150
151 return TRUE;
152}
153
154BOOL LLVOClouds::isParticle()
155{
156 return FALSE; // gGLManager.mHasPointParameters;
157}
158
159F32 LLVOClouds::getPartSize(S32 idx)
160{
161 return (CLOUD_PUFF_HEIGHT+CLOUD_PUFF_WIDTH)*0.5f;
162}
163
164void LLVOClouds::getGeometry(S32 te,
165 LLStrider<LLVector3>& verticesp,
166 LLStrider<LLVector3>& normalsp,
167 LLStrider<LLVector2>& texcoordsp,
168 LLStrider<LLColor4U>& colorsp,
169 LLStrider<U32>& indicesp)
170{
158 171
159 LLVector3 from_camera_vec = gCamera->getAtAxis();//puff_pos_agent - camera_agent; 172 if (te >= mCloudGroupp->getNumPuffs())
160 at = from_camera_vec; 173 {
174 return;
175 }
176
177 LLDrawable* drawable = mDrawable;
178 LLFace *facep = drawable->getFace(te);
179
180 if (!facep->hasGeometry())
181 {
182 return;
183 }
184
185 LLVector3 normal(0.f,0.f,-1.f);
186
187 const LLCloudPuff &puff = mCloudGroupp->getPuff(te);
188 S32 index_offset = facep->getGeomIndex();
189 LLColor4U color(255, 255, 255, (U8) (puff.getAlpha()*255));
190 facep->setFaceColor(LLColor4(color));
191
192
193 if (isParticle())
194 {
195 *verticesp++ = facep->mCenterLocal;
196 *texcoordsp++ = LLVector2(0.5f, 0.5f);
197 *colorsp++ = color;
198 *normalsp++ = normal;
199 *indicesp++ = facep->getGeomIndex();
200 }
201 else
202 {
203 LLVector3 up;
204 LLVector3 right;
205 LLVector3 at;
206
207 const LLVector3& puff_pos_agent = facep->mCenterLocal;
208 LLVector2 uvs[4];
209
210 uvs[0].setVec(0.f, 1.f);
211 uvs[1].setVec(0.f, 0.f);
212 uvs[2].setVec(1.f, 1.f);
213 uvs[3].setVec(1.f, 0.f);
214
215 LLVector3 vtx[4];
216
217 at = gCamera->getAtAxis();
161 right = at % LLVector3(0.f, 0.f, 1.f); 218 right = at % LLVector3(0.f, 0.f, 1.f);
162 right.normVec(); 219 right.normVec();
163 up = right % at; 220 up = right % at;
164 up.normVec(); 221 up.normVec();
165 right *= 0.5f*CLOUD_PUFF_WIDTH; 222 right *= 0.5f*CLOUD_PUFF_WIDTH;
166 up *= 0.5f*CLOUD_PUFF_HEIGHT;; 223 up *= 0.5f*CLOUD_PUFF_HEIGHT;;
167
168 facep->mCenterAgent = puff_pos_agent;
169
170 LLColor4 color(1.f, 1.f, 1.f, puff.getAlpha());
171 facep->setFaceColor(color);
172 224
225 *colorsp++ = color;
226 *colorsp++ = color;
227 *colorsp++ = color;
228 *colorsp++ = color;
229
173 vtx[0] = puff_pos_agent - right + up; 230 vtx[0] = puff_pos_agent - right + up;
174 vtx[1] = puff_pos_agent - right - up; 231 vtx[1] = puff_pos_agent - right - up;
175 vtx[2] = puff_pos_agent + right + up; 232 vtx[2] = puff_pos_agent + right + up;
@@ -180,10 +237,10 @@ BOOL LLVOClouds::updateGeometry(LLDrawable *drawable)
180 *verticesp++ = vtx[2]; 237 *verticesp++ = vtx[2];
181 *verticesp++ = vtx[3]; 238 *verticesp++ = vtx[3];
182 239
183 *texCoordsp++ = uvs[0]; 240 *texcoordsp++ = uvs[0];
184 *texCoordsp++ = uvs[1]; 241 *texcoordsp++ = uvs[1];
185 *texCoordsp++ = uvs[2]; 242 *texcoordsp++ = uvs[2];
186 *texCoordsp++ = uvs[3]; 243 *texcoordsp++ = uvs[3];
187 244
188 *normalsp++ = normal; 245 *normalsp++ = normal;
189 *normalsp++ = normal; 246 *normalsp++ = normal;
@@ -198,10 +255,28 @@ BOOL LLVOClouds::updateGeometry(LLDrawable *drawable)
198 *indicesp++ = index_offset + 3; 255 *indicesp++ = index_offset + 3;
199 *indicesp++ = index_offset + 2; 256 *indicesp++ = index_offset + 2;
200 } 257 }
201 for ( ; face_indx < drawable->getNumFaces(); face_indx++) 258}
259
260U32 LLVOClouds::getPartitionType() const
261{
262 return LLPipeline::PARTITION_CLOUD;
263}
264
265// virtual
266void LLVOClouds::updateDrawable(BOOL force_damped)
267{
268 // Force an immediate rebuild on any update
269 if (mDrawable.notNull())
202 { 270 {
203 drawable->getFace(face_indx)->setSize(0,0); 271 mDrawable->updateXform(TRUE);
272 gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_ALL, TRUE);
204 } 273 }
274 clearChanged(SHIFTED);
275}
205 276
206 return TRUE; 277LLCloudPartition::LLCloudPartition()
278{
279 mDrawableType = LLPipeline::RENDER_TYPE_CLOUDS;
280 mPartitionType = LLPipeline::PARTITION_CLOUD;
207} 281}
282
diff --git a/linden/indra/newview/llvoclouds.h b/linden/indra/newview/llvoclouds.h
index 1618ab6..a8846e9 100644
--- a/linden/indra/newview/llvoclouds.h
+++ b/linden/indra/newview/llvoclouds.h
@@ -38,7 +38,7 @@ class LLViewerCloudGroup;
38class LLCloudGroup; 38class LLCloudGroup;
39 39
40 40
41class LLVOClouds : public LLViewerObject 41class LLVOClouds : public LLAlphaObject
42{ 42{
43public: 43public:
44 LLVOClouds(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp ); 44 LLVOClouds(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp );
@@ -47,16 +47,29 @@ public:
47 // Initialize data that's only inited once per class. 47 // Initialize data that's only inited once per class.
48 static void initClass(); 48 static void initClass();
49 49
50 void updateDrawable(BOOL force_damped);
51
50 /*virtual*/ LLDrawable* createDrawable(LLPipeline *pipeline); 52 /*virtual*/ LLDrawable* createDrawable(LLPipeline *pipeline);
51 /*virtual*/ BOOL updateGeometry(LLDrawable *drawable); 53 /*virtual*/ BOOL updateGeometry(LLDrawable *drawable);
54 /*virtual*/ void getGeometry(S32 te,
55 LLStrider<LLVector3>& verticesp,
56 LLStrider<LLVector3>& normalsp,
57 LLStrider<LLVector2>& texcoordsp,
58 LLStrider<LLColor4U>& colorsp,
59 LLStrider<U32>& indicesp);
52 60
53 /*virtual*/ BOOL isActive() const; // Whether this object needs to do an idleUpdate. 61 /*virtual*/ BOOL isActive() const; // Whether this object needs to do an idleUpdate.
62 BOOL isParticle();
63 F32 getPartSize(S32 idx);
54 64
55 /*virtual*/ void updateTextures(LLAgent &agent); 65 /*virtual*/ void updateTextures(LLAgent &agent);
56 /*virtual*/ void setPixelAreaAndAngle(LLAgent &agent); // generate accurate apparent angle and area 66 /*virtual*/ void setPixelAreaAndAngle(LLAgent &agent); // generate accurate apparent angle and area
57 67
68 void updateFaceSize(S32 idx) { }
58 BOOL idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time); 69 BOOL idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time);
59 70
71 virtual U32 getPartitionType() const;
72
60 void setCloudGroup(LLCloudGroup *cgp) { mCloudGroupp = cgp; } 73 void setCloudGroup(LLCloudGroup *cgp) { mCloudGroupp = cgp; }
61protected: 74protected:
62 LLCloudGroup *mCloudGroupp; 75 LLCloudGroup *mCloudGroupp;
diff --git a/linden/indra/newview/llvograss.cpp b/linden/indra/newview/llvograss.cpp
index 58e5378..9201549 100644
--- a/linden/indra/newview/llvograss.cpp
+++ b/linden/indra/newview/llvograss.cpp
@@ -68,7 +68,7 @@ S32 LLVOGrass::sMaxGrassSpecies = 0;
68 68
69 69
70LLVOGrass::LLVOGrass(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp) 70LLVOGrass::LLVOGrass(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp)
71: LLViewerObject(id, pcode, regionp) 71: LLAlphaObject(id, pcode, regionp)
72{ 72{
73 mPatch = NULL; 73 mPatch = NULL;
74 mLastPatchUpdateTime = 0; 74 mLastPatchUpdateTime = 0;
@@ -206,13 +206,13 @@ void LLVOGrass::initClass()
206 206
207 BOOL have_all_grass = TRUE; 207 BOOL have_all_grass = TRUE;
208 LLString err; 208 LLString err;
209 char buffer[10]; 209 char buffer[10]; /* Flawfinder: ignore */
210 210
211 for (S32 i=0;i<sMaxGrassSpecies;++i) 211 for (S32 i=0;i<sMaxGrassSpecies;++i)
212 { 212 {
213 if (!sSpeciesTable.count(i)) 213 if (!sSpeciesTable.count(i))
214 { 214 {
215 snprintf(buffer,10," %d",i); 215 snprintf(buffer,10," %d",i); /* Flawfinder: ignore */
216 err.append(buffer); 216 err.append(buffer);
217 have_all_grass = FALSE; 217 have_all_grass = FALSE;
218 } 218 }
@@ -318,38 +318,45 @@ void LLVOGrass::setPixelAreaAndAngle(LLAgent &agent)
318{ 318{
319 // This should be the camera's center, as soon as we move to all region-local. 319 // This should be the camera's center, as soon as we move to all region-local.
320 LLVector3 relative_position = getPositionAgent() - agent.getCameraPositionAgent(); 320 LLVector3 relative_position = getPositionAgent() - agent.getCameraPositionAgent();
321 F32 range = relative_position.magVec(); // ugh, square root 321 F32 range = relative_position.magVec();
322 322
323 F32 max_scale = getMaxScale(); 323 F32 max_scale = getMaxScale();
324 324
325 mAppAngle = (F32) atan2( max_scale, range) * RAD_TO_DEG; 325 mAppAngle = (F32) atan2( max_scale, range) * RAD_TO_DEG;
326 326
327 // Compute pixels per meter at the given range 327 // Compute pixels per meter at the given range
328 F32 pixels_per_meter = gCamera->getViewHeightInPixels() / 328 F32 pixels_per_meter = gCamera->getViewHeightInPixels() / (tan(gCamera->getView()) * range);
329 (tan(gCamera->getView()) * range);
330 329
331 // Assume grass texture is a 1 meter by 1 meter sprite at the grass object's center 330 // Assume grass texture is a 5 meter by 5 meter sprite at the grass object's center
332 mPixelArea = (pixels_per_meter) * (pixels_per_meter); 331 mPixelArea = (pixels_per_meter) * (pixels_per_meter) * 25.f;
333} 332}
334 333
335 334
336// BUG could speed this up by caching the relative_position and range calculations 335// BUG could speed this up by caching the relative_position and range calculations
337void LLVOGrass::updateTextures(LLAgent &agent) 336void LLVOGrass::updateTextures(LLAgent &agent)
338{ 337{
339 // dot_product = A B cos T 338 F32 texel_area_ratio = 1.f;
340 // BUT at_axis is unit, so dot_product = B cos T 339 F32 cos_angle = 1.f;
341 LLVector3 relative_position = getPositionAgent() - agent.getCameraPositionAgent();
342 F32 dot_product = relative_position * agent.getFrameAgent().getAtAxis();
343 F32 cos_angle = dot_product / relative_position.magVec();
344 340
345 if (getTEImage(0)) 341 if (getTEImage(0))
346 { 342 {
347 getTEImage(0)->addTextureStats(mPixelArea*20.f, 1.f, cos_angle); 343 if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_TEXTURE_AREA))
344 {
345 setDebugText(llformat("%4.0f", fsqrtf(mPixelArea)));
346 }
347 getTEImage(0)->addTextureStats(mPixelArea, texel_area_ratio, cos_angle);
348 } 348 }
349} 349}
350 350
351BOOL LLVOGrass::updateLOD() 351BOOL LLVOGrass::updateLOD()
352{ 352{
353 if (mDrawable->getNumFaces() <= 0)
354 {
355 return FALSE;
356 }
357
358 LLFace* face = mDrawable->getFace(0);
359
353 F32 tan_angle = 0.f; 360 F32 tan_angle = 0.f;
354 S32 num_blades = 0; 361 S32 num_blades = 0;
355 362
@@ -363,6 +370,7 @@ BOOL LLVOGrass::updateLOD()
363 mNumBlades <<= 1; 370 mNumBlades <<= 1;
364 } 371 }
365 372
373 face->setSize(mNumBlades*8, mNumBlades*12);
366 gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_ALL, TRUE); 374 gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_ALL, TRUE);
367 } 375 }
368 else if (num_blades <= (mNumBlades >> 1)) 376 else if (num_blades <= (mNumBlades >> 1))
@@ -372,6 +380,7 @@ BOOL LLVOGrass::updateLOD()
372 mNumBlades >>=1; 380 mNumBlades >>=1;
373 } 381 }
374 382
383 face->setSize(mNumBlades*8, mNumBlades*12);
375 gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_ALL, TRUE); 384 gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_ALL, TRUE);
376 return TRUE; 385 return TRUE;
377 } 386 }
@@ -382,53 +391,20 @@ BOOL LLVOGrass::updateLOD()
382LLDrawable* LLVOGrass::createDrawable(LLPipeline *pipeline) 391LLDrawable* LLVOGrass::createDrawable(LLPipeline *pipeline)
383{ 392{
384 pipeline->allocDrawable(this); 393 pipeline->allocDrawable(this);
385// mDrawable->setLit(FALSE);
386 mDrawable->setRenderType(LLPipeline::RENDER_TYPE_GRASS); 394 mDrawable->setRenderType(LLPipeline::RENDER_TYPE_GRASS);
387 395
388 LLDrawPool *pool = gPipeline.getPool(LLDrawPool::POOL_ALPHA);
389
390 mDrawable->setNumFaces(1, pool, getTEImage(0));
391
392 return mDrawable; 396 return mDrawable;
393} 397}
394 398
395BOOL LLVOGrass::updateGeometry(LLDrawable *drawable) 399BOOL LLVOGrass::updateGeometry(LLDrawable *drawable)
396{ 400{
401 LLFastTimer ftm(LLFastTimer::FTM_UPDATE_GRASS);
397 plantBlades(); 402 plantBlades();
398 return TRUE; 403 return TRUE;
399} 404}
400 405
401void LLVOGrass::plantBlades() 406void LLVOGrass::plantBlades()
402{ 407{
403 mPatch = mRegionp->getLand().resolvePatchRegion(getPositionRegion());
404 mLastPatchUpdateTime = mPatch->getLastUpdateTime();
405
406 LLVector3 position;
407 // Create random blades of grass with gaussian distribution
408 F32 x,y,xf,yf,dzx,dzy;
409
410 LLVector3 normal(0,0,1);
411 LLColor4U color(0,0,0,1);
412
413 LLFace *face = mDrawable->getFace(0);
414
415 LLStrider<LLVector3> verticesp;
416 LLStrider<LLVector3> normalsp;
417 LLStrider<LLVector2> texCoordsp;
418 LLStrider<LLColor4U> colorsp;
419
420 U32 *indicesp;
421
422 face->setPool(face->getPool(), getTEImage(0));
423 face->setState(LLFace::GLOBAL);
424 face->setSize(mNumBlades * 4, mNumBlades * 12);
425 face->setPrimType(LLTriangles);
426 S32 index_offset = face->getGeometryColors(verticesp,normalsp,texCoordsp,colorsp,indicesp);
427 if (-1 == index_offset)
428 {
429 return;
430 }
431
432 // It is possible that the species of a grass is not defined 408 // It is possible that the species of a grass is not defined
433 // This is bad, but not the end of the world. 409 // This is bad, but not the end of the world.
434 if (!sSpeciesTable.count(mSpecies)) 410 if (!sSpeciesTable.count(mSpecies))
@@ -437,9 +413,49 @@ void LLVOGrass::plantBlades()
437 return; 413 return;
438 } 414 }
439 415
416 if (mDrawable->getNumFaces() < 1)
417 {
418 mDrawable->setNumFaces(1, NULL, getTEImage(0));
419 }
420
421 LLFace *face = mDrawable->getFace(0);
422
423 face->setTexture(getTEImage(0));
424 face->setState(LLFace::GLOBAL);
425 face->setSize(mNumBlades * 8, mNumBlades * 12);
426 face->mVertexBuffer = NULL;
427 face->setTEOffset(0);
428 face->mCenterLocal = mPosition + mRegionp->getOriginAgent();
429
430 mDepth = (face->mCenterLocal - gCamera->getOrigin())*gCamera->getAtAxis();
431 mDrawable->setPosition(face->mCenterLocal);
432 mDrawable->movePartition();
433 LLPipeline::sCompiles++;
434}
435
436void LLVOGrass::getGeometry(S32 idx,
437 LLStrider<LLVector3>& verticesp,
438 LLStrider<LLVector3>& normalsp,
439 LLStrider<LLVector2>& texcoordsp,
440 LLStrider<LLColor4U>& colorsp,
441 LLStrider<U32>& indicesp)
442{
443 mPatch = mRegionp->getLand().resolvePatchRegion(getPositionRegion());
444 mLastPatchUpdateTime = mPatch->getLastUpdateTime();
445
446 LLVector3 position;
447 // Create random blades of grass with gaussian distribution
448 F32 x,y,xf,yf,dzx,dzy;
449
450 LLColor4U color(255,255,255,255);
451
452 LLFace *face = mDrawable->getFace(idx);
453
440 F32 width = sSpeciesTable[mSpecies]->mBladeSizeX; 454 F32 width = sSpeciesTable[mSpecies]->mBladeSizeX;
441 F32 height = sSpeciesTable[mSpecies]->mBladeSizeY; 455 F32 height = sSpeciesTable[mSpecies]->mBladeSizeY;
442 456
457 U32 index_offset = face->getGeomIndex();
458
443 for (S32 i = 0; i < mNumBlades; i++) 459 for (S32 i = 0; i < mNumBlades; i++)
444 { 460 {
445 x = exp_x[i] * mScale.mV[VX]; 461 x = exp_x[i] * mScale.mV[VX];
@@ -449,70 +465,113 @@ void LLVOGrass::plantBlades()
449 dzx = dz_x [i]; 465 dzx = dz_x [i];
450 dzy = dz_y [i]; 466 dzy = dz_y [i];
451 467
468 LLVector3 v1,v2,v3;
452 F32 blade_height= GRASS_BLADE_HEIGHT * height * w_mod[i]; 469 F32 blade_height= GRASS_BLADE_HEIGHT * height * w_mod[i];
453 470
454 *texCoordsp++ = LLVector2(0, 0); 471 *texcoordsp++ = LLVector2(0, 0);
455 *texCoordsp++ = LLVector2(0, 0.98f); 472 *texcoordsp++ = LLVector2(0, 0);
456 *texCoordsp++ = LLVector2(1, 0); 473 *texcoordsp++ = LLVector2(0, 0.98f);
457 *texCoordsp++ = LLVector2(1, 0.98f); 474 *texcoordsp++ = LLVector2(0, 0.98f);
475 *texcoordsp++ = LLVector2(1, 0);
476 *texcoordsp++ = LLVector2(1, 0);
477 *texcoordsp++ = LLVector2(1, 0.98f);
478 *texcoordsp++ = LLVector2(1, 0.98f);
458 479
459 position.mV[0] = mPosition.mV[VX] + x + xf; 480 position.mV[0] = mPosition.mV[VX] + x + xf;
460 position.mV[1] = mPosition.mV[VY] + y + yf; 481 position.mV[1] = mPosition.mV[VY] + y + yf;
461 position.mV[2] = 0.f;
462 position.mV[2] = mRegionp->getLand().resolveHeightRegion(position); 482 position.mV[2] = mRegionp->getLand().resolveHeightRegion(position);
463 *verticesp++ = position + mRegionp->getOriginAgent(); 483 *verticesp++ = v1 = position + mRegionp->getOriginAgent();
484 *verticesp++ = v1;
485
464 486
465 position.mV[0] += dzx; 487 position.mV[0] += dzx;
466 position.mV[1] += dzy; 488 position.mV[1] += dzy;
467 position.mV[2] += blade_height; 489 position.mV[2] += blade_height;
468 *verticesp++ = position + mRegionp->getOriginAgent(); 490 *verticesp++ = v2 = position + mRegionp->getOriginAgent();
491 *verticesp++ = v2;
469 492
470 position.mV[0] = mPosition.mV[VX] + x - xf; 493 position.mV[0] = mPosition.mV[VX] + x - xf;
471 position.mV[1] = mPosition.mV[VY] + y - xf; 494 position.mV[1] = mPosition.mV[VY] + y - xf;
472 position.mV[2] = 0.f;
473 position.mV[2] = mRegionp->getLand().resolveHeightRegion(position); 495 position.mV[2] = mRegionp->getLand().resolveHeightRegion(position);
474 *verticesp++ = position + mRegionp->getOriginAgent(); 496 *verticesp++ = v3 = position + mRegionp->getOriginAgent();
497 *verticesp++ = v3;
498
499 LLVector3 normal1 = (v1-v2) % (v2-v3);
500 normal1.mV[VZ] = 0.75f;
501 normal1.normVec();
502 LLVector3 normal2 = -normal1;
503 normal2.mV[VZ] = -normal2.mV[VZ];
475 504
476 position.mV[0] += dzx; 505 position.mV[0] += dzx;
477 position.mV[1] += dzy; 506 position.mV[1] += dzy;
478 position.mV[2] += blade_height; 507 position.mV[2] += blade_height;
479 *verticesp++ = position + mRegionp->getOriginAgent(); 508 *verticesp++ = v1 = position + mRegionp->getOriginAgent();
509 *verticesp++ = v1;
510
511 *(normalsp++) = normal1;
512 *(normalsp++) = normal2;
513 *(normalsp++) = normal1;
514 *(normalsp++) = normal2;
480 515
481 *(normalsp++) = normal; 516 *(normalsp++) = normal1;
482 *(normalsp++) = normal; 517 *(normalsp++) = normal2;
483 *(normalsp++) = normal; 518 *(normalsp++) = normal1;
484 *(normalsp++) = normal; 519 *(normalsp++) = normal2;
485 520
486 *(colorsp++) = color; 521 *(colorsp++) = color;
487 *(colorsp++) = color; 522 *(colorsp++) = color;
488 *(colorsp++) = color; 523 *(colorsp++) = color;
489 *(colorsp++) = color; 524 *(colorsp++) = color;
525 *(colorsp++) = color;
526 *(colorsp++) = color;
527 *(colorsp++) = color;
528 *(colorsp++) = color;
490 529
491 *indicesp++ = index_offset + 0; 530 *indicesp++ = index_offset + 0;
492 *indicesp++ = index_offset + 1;
493 *indicesp++ = index_offset + 2; 531 *indicesp++ = index_offset + 2;
532 *indicesp++ = index_offset + 4;
494 533
495 *indicesp++ = index_offset + 1;
496 *indicesp++ = index_offset + 3;
497 *indicesp++ = index_offset + 2; 534 *indicesp++ = index_offset + 2;
535 *indicesp++ = index_offset + 6;
536 *indicesp++ = index_offset + 4;
498 537
499 *indicesp++ = index_offset + 0;
500 *indicesp++ = index_offset + 2;
501 *indicesp++ = index_offset + 1; 538 *indicesp++ = index_offset + 1;
539 *indicesp++ = index_offset + 5;
540 *indicesp++ = index_offset + 3;
502 541
503 *indicesp++ = index_offset + 1;
504 *indicesp++ = index_offset + 2;
505 *indicesp++ = index_offset + 3; 542 *indicesp++ = index_offset + 3;
506 index_offset += 4; 543 *indicesp++ = index_offset + 5;
544 *indicesp++ = index_offset + 7;
545 index_offset += 8;
507 } 546 }
508 547
509 LLPipeline::sCompiles++; 548 LLPipeline::sCompiles++;
510
511 face->mCenterLocal = mPosition;
512
513} 549}
514 550
551U32 LLVOGrass::getPartitionType() const
552{
553 return LLPipeline::PARTITION_GRASS;
554}
515 555
556LLGrassPartition::LLGrassPartition()
557{
558 mDrawableType = LLPipeline::RENDER_TYPE_GRASS;
559 mPartitionType = LLPipeline::PARTITION_GRASS;
560 mLODPeriod = 16;
561 mDepthMask = TRUE;
562 mSlopRatio = 0.1f;
563 mRenderPass = LLRenderPass::PASS_GRASS;
564 mBufferUsage = GL_DYNAMIC_DRAW_ARB;
565}
516 566
517 567// virtual
518 568void LLVOGrass::updateDrawable(BOOL force_damped)
569{
570 // Force an immediate rebuild on any update
571 if (mDrawable.notNull())
572 {
573 mDrawable->updateXform(TRUE);
574 gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_ALL, TRUE);
575 }
576 clearChanged(SHIFTED);
577}
diff --git a/linden/indra/newview/llvograss.h b/linden/indra/newview/llvograss.h
index 50d5460..023db03 100644
--- a/linden/indra/newview/llvograss.h
+++ b/linden/indra/newview/llvograss.h
@@ -36,7 +36,7 @@ class LLSurfacePatch;
36class LLViewerImage; 36class LLViewerImage;
37 37
38 38
39class LLVOGrass : public LLViewerObject 39class LLVOGrass : public LLAlphaObject
40{ 40{
41public: 41public:
42 LLVOGrass(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp); 42 LLVOGrass(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp);
@@ -46,6 +46,8 @@ public:
46 static void initClass(); 46 static void initClass();
47 static void cleanupClass(); 47 static void cleanupClass();
48 48
49 virtual U32 getPartitionType() const;
50
49 /*virtual*/ U32 processUpdateMessage(LLMessageSystem *mesgsys, 51 /*virtual*/ U32 processUpdateMessage(LLMessageSystem *mesgsys,
50 void **user_data, 52 void **user_data,
51 U32 block_num, 53 U32 block_num,
@@ -53,11 +55,19 @@ public:
53 LLDataPacker *dp); 55 LLDataPacker *dp);
54 static void import(FILE *file, LLMessageSystem *mesgsys, const LLVector3 &pos); 56 static void import(FILE *file, LLMessageSystem *mesgsys, const LLVector3 &pos);
55 /*virtual*/ void exportFile(FILE *file, const LLVector3 &position); 57 /*virtual*/ void exportFile(FILE *file, const LLVector3 &position);
56 58
59 void updateDrawable(BOOL force_damped);
57 60
58 /*virtual*/ LLDrawable* createDrawable(LLPipeline *pipeline); 61 /*virtual*/ LLDrawable* createDrawable(LLPipeline *pipeline);
59 /*virtual*/ BOOL updateGeometry(LLDrawable *drawable); 62 /*virtual*/ BOOL updateGeometry(LLDrawable *drawable);
60 63 /*virtual*/ void getGeometry(S32 idx,
64 LLStrider<LLVector3>& verticesp,
65 LLStrider<LLVector3>& normalsp,
66 LLStrider<LLVector2>& texcoordsp,
67 LLStrider<LLColor4U>& colorsp,
68 LLStrider<U32>& indicesp);
69
70 void updateFaceSize(S32 idx) { }
61 /*virtual*/ void updateTextures(LLAgent &agent); 71 /*virtual*/ void updateTextures(LLAgent &agent);
62 /*virtual*/ BOOL updateLOD(); 72 /*virtual*/ BOOL updateLOD();
63 /*virtual*/ void setPixelAreaAndAngle(LLAgent &agent); // generate accurate apparent angle and area 73 /*virtual*/ void setPixelAreaAndAngle(LLAgent &agent); // generate accurate apparent angle and area
diff --git a/linden/indra/newview/llvoground.cpp b/linden/indra/newview/llvoground.cpp
index 7001cb8..0ae6ed8 100644
--- a/linden/indra/newview/llvoground.cpp
+++ b/linden/indra/newview/llvoground.cpp
@@ -28,6 +28,7 @@
28#include "llviewerprecompiledheaders.h" 28#include "llviewerprecompiledheaders.h"
29 29
30#include "llvoground.h" 30#include "llvoground.h"
31#include "lldrawpoolground.h"
31 32
32#include "llviewercontrol.h" 33#include "llviewercontrol.h"
33 34
@@ -40,7 +41,7 @@
40#include "pipeline.h" 41#include "pipeline.h"
41 42
42LLVOGround::LLVOGround(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp) 43LLVOGround::LLVOGround(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp)
43: LLViewerObject(id, pcode, regionp) 44: LLStaticViewerObject(id, pcode, regionp)
44{ 45{
45 mbCanSelect = FALSE; 46 mbCanSelect = FALSE;
46} 47}
@@ -57,10 +58,10 @@ BOOL LLVOGround::idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time)
57 return TRUE; 58 return TRUE;
58 } 59 }
59 60
60 if (mDrawable) 61 /*if (mDrawable)
61 { 62 {
62 gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_VOLUME, TRUE); 63 gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_VOLUME, TRUE);
63 } 64 }*/
64 return TRUE; 65 return TRUE;
65} 66}
66 67
@@ -75,7 +76,8 @@ LLDrawable *LLVOGround::createDrawable(LLPipeline *pipeline)
75 pipeline->allocDrawable(this); 76 pipeline->allocDrawable(this);
76 mDrawable->setLit(FALSE); 77 mDrawable->setLit(FALSE);
77 78
78 LLDrawPool *poolp = gPipeline.getPool(LLDrawPool::POOL_GROUND); 79 mDrawable->setRenderType(LLPipeline::RENDER_TYPE_GROUND);
80 LLDrawPoolGround *poolp = (LLDrawPoolGround*) gPipeline.getPool(LLDrawPool::POOL_GROUND);
79 81
80 mDrawable->addFace(poolp, NULL); 82 mDrawable->addFace(poolp, NULL);
81 83
@@ -87,15 +89,25 @@ BOOL LLVOGround::updateGeometry(LLDrawable *drawable)
87 LLStrider<LLVector3> verticesp; 89 LLStrider<LLVector3> verticesp;
88 LLStrider<LLVector3> normalsp; 90 LLStrider<LLVector3> normalsp;
89 LLStrider<LLVector2> texCoordsp; 91 LLStrider<LLVector2> texCoordsp;
90 U32 *indicesp; 92 LLStrider<U32> indicesp;
91 S32 index_offset; 93 S32 index_offset;
92 LLFace *face; 94 LLFace *face;
93 95
96 LLDrawPoolGround *poolp = (LLDrawPoolGround*) gPipeline.getPool(LLDrawPool::POOL_GROUND);
97
94 if (drawable->getNumFaces() < 1) 98 if (drawable->getNumFaces() < 1)
95 drawable->addFace(gPipeline.getPool(LLDrawPool::POOL_GROUND), NULL); 99 drawable->addFace(poolp, NULL);
96 face = drawable->getFace(0); 100 face = drawable->getFace(0);
97 face->setPrimType(LLTriangles); 101
98 face->setSize(6, 12); 102 if (face->mVertexBuffer.isNull())
103 {
104 face->setSize(5, 12);
105 face->mVertexBuffer = new LLVertexBuffer(LLDrawPoolGround::VERTEX_DATA_MASK, GL_STREAM_DRAW_ARB);
106 face->mVertexBuffer->allocateBuffer(face->getGeomCount(), face->getIndicesCount(), TRUE);
107 face->setGeomIndex(0);
108 face->setIndicesIndex(0);
109 }
110
99 index_offset = face->getGeometry(verticesp,normalsp,texCoordsp, indicesp); 111 index_offset = face->getGeometry(verticesp,normalsp,texCoordsp, indicesp);
100 if (-1 == index_offset) 112 if (-1 == index_offset)
101 { 113 {
@@ -117,68 +129,40 @@ BOOL LLVOGround::updateGeometry(LLDrawable *drawable)
117 left_dir.normVec(); 129 left_dir.normVec();
118 130
119 // Our center top point 131 // Our center top point
120 LLVector3 center_top, center_bottom;
121
122 LLColor4 ground_color = gSky.getFogColor(); 132 LLColor4 ground_color = gSky.getFogColor();
123 ground_color.mV[3] = 1.f; 133 ground_color.mV[3] = 1.f;
124 face->setFaceColor(ground_color); 134 face->setFaceColor(ground_color);
125 135
126 if (gCamera->getOrigin().mV[VZ] < gAgent.getRegion()->getWaterHeight()) 136 *(verticesp++) = LLVector3(64, 64, 0);
127 { 137 *(verticesp++) = LLVector3(-64, 64, 0);
128 // Underwater 138 *(verticesp++) = LLVector3(-64, -64, 0);
129 //center_top = gCamera->getOrigin() + at_dir*gCamera->getFar(); 139 *(verticesp++) = LLVector3(64, -64, 0);
130 center_top = gCamera->getOrigin() - LLVector3(0, 0, 5); 140 *(verticesp++) = LLVector3(0, 0, -1024);
131 center_bottom = gCamera->getOrigin() + at_dir*gCamera->getFar();;
132 //center_top.mV[VZ] = gAgent.getRegion()->getWaterHeight() + 0.5f;
133 center_bottom.mV[VZ] = -100.f;
134 }
135 else
136 {
137 // Above water
138 center_top = gCamera->getOrigin() - LLVector3(0, 0, 30);
139 if ((gPipeline.getVertexShaderLevel(LLPipeline::SHADER_ENVIRONMENT) > 0))
140 {
141 center_top.mV[VZ] = gAgent.getRegion()->getWaterHeight();
142 }
143 //center_top = gCamera->getOrigin() + at_dir*9000.f;
144 center_bottom = gCamera->getOrigin() - at_dir*gCamera->getFar();
145 //center_top.mV[VZ] = 0.f;
146 //center_bottom.mV[VZ] = gAgent.getRegion()->getWaterHeight();
147 }
148
149 *(verticesp++) = center_top + LLVector3(6000, 6000, 0);
150 *(verticesp++) = center_top + LLVector3(-6000, 6000, 0);
151 *(verticesp++) = center_top + LLVector3(-6000, -6000, 0);
152
153 *(verticesp++) = center_top + LLVector3(-6000, -6000, 0);
154 *(verticesp++) = center_top + LLVector3(6000, -6000, 0);
155 *(verticesp++) = center_top + LLVector3(6000, 6000, 0);
156 141
157 142
158 // Triangles for each side 143 // Triangles for each side
159 *indicesp++ = index_offset + 0; 144 *indicesp++ = index_offset + 0;
160 *indicesp++ = index_offset + 1; 145 *indicesp++ = index_offset + 1;
161 *indicesp++ = index_offset + 3; 146 *indicesp++ = index_offset + 4;
162 147
163 *indicesp++ = index_offset + 0; 148 *indicesp++ = index_offset + 1;
164 *indicesp++ = index_offset + 3;
165 *indicesp++ = index_offset + 2; 149 *indicesp++ = index_offset + 2;
150 *indicesp++ = index_offset + 4;
166 151
167 *indicesp++ = index_offset + 2; 152 *indicesp++ = index_offset + 2;
168 *indicesp++ = index_offset + 3; 153 *indicesp++ = index_offset + 3;
169 *indicesp++ = index_offset + 5; 154 *indicesp++ = index_offset + 4;
170 155
171 *indicesp++ = index_offset + 2; 156 *indicesp++ = index_offset + 3;
172 *indicesp++ = index_offset + 5; 157 *indicesp++ = index_offset + 0;
173 *indicesp++ = index_offset + 4; 158 *indicesp++ = index_offset + 4;
174 159
175 *(texCoordsp++) = LLVector2(0.f, 0.f); 160 *(texCoordsp++) = LLVector2(0.f, 0.f);
176 *(texCoordsp++) = LLVector2(1.f, 0.f); 161 *(texCoordsp++) = LLVector2(1.f, 0.f);
177 *(texCoordsp++) = LLVector2(0.f, 1.f);
178 *(texCoordsp++) = LLVector2(1.f, 1.f); 162 *(texCoordsp++) = LLVector2(1.f, 1.f);
179 *(texCoordsp++) = LLVector2(0.f, 2.f); 163 *(texCoordsp++) = LLVector2(0.f, 1.f);
180 *(texCoordsp++) = LLVector2(1.f, 2.f); 164 *(texCoordsp++) = LLVector2(0.5f, 0.5f);
181 165
182 LLPipeline::sCompiles++; 166 LLPipeline::sCompiles++;
183 return TRUE; 167 return TRUE;
184} 168}
diff --git a/linden/indra/newview/llvoground.h b/linden/indra/newview/llvoground.h
index e0d4700..5b995f8 100644
--- a/linden/indra/newview/llvoground.h
+++ b/linden/indra/newview/llvoground.h
@@ -34,7 +34,7 @@
34#include "llviewerimage.h" 34#include "llviewerimage.h"
35#include "llviewerobject.h" 35#include "llviewerobject.h"
36 36
37class LLVOGround : public LLViewerObject 37class LLVOGround : public LLStaticViewerObject
38{ 38{
39protected: 39protected:
40public: 40public:
diff --git a/linden/indra/newview/llvopart.cpp b/linden/indra/newview/llvopart.cpp
deleted file mode 100644
index 6b38cf9..0000000
--- a/linden/indra/newview/llvopart.cpp
+++ /dev/null
@@ -1,1358 +0,0 @@
1/**
2 * @file llvopart.cpp
3 * @brief Viewer-object derived particle system.
4 *
5 * Copyright (c) 2001-2007, Linden Research, Inc.
6 *
7 * The source code in this file ("Source Code") is provided by Linden Lab
8 * to you under the terms of the GNU General Public License, version 2.0
9 * ("GPL"), unless you have obtained a separate licensing agreement
10 * ("Other License"), formally executed by you and Linden Lab. Terms of
11 * the GPL can be found in doc/GPL-license.txt in this distribution, or
12 * online at http://secondlife.com/developers/opensource/gplv2
13 *
14 * There are special exceptions to the terms and conditions of the GPL as
15 * it is applied to this Source Code. View the full text of the exception
16 * in the file doc/FLOSS-exception.txt in this software distribution, or
17 * online at http://secondlife.com/developers/opensource/flossexception
18 *
19 * By copying, modifying or distributing this software, you acknowledge
20 * that you have read and understood your obligations described above,
21 * and agree to abide by those obligations.
22 *
23 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
24 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
25 * COMPLETENESS OR PERFORMANCE.
26 */
27
28#include "llviewerprecompiledheaders.h"
29
30#include "llvopart.h"
31
32#include "llfasttimer.h"
33#include "message.h"
34
35#include "llagent.h"
36#include "lldrawable.h"
37#include "llface.h"
38#include "llsky.h"
39#include "llviewercamera.h"
40#include "llviewerimagelist.h"
41#include "llviewerregion.h"
42#include "pipeline.h"
43
44const F32 MAX_PART_LIFETIME = 120.f;
45
46extern U64 gFrameTime;
47
48LLVOPart::LLVOPart(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp)
49: LLViewerObject(id, pcode, regionp)
50{
51 mParticlesDead = FALSE;
52 setNumTEs(1);
53 setDefaultValues();
54
55 mbCanSelect = FALSE; // users can't select particle systems
56 mNumLiveParticles = 0;
57}
58
59
60LLVOPart::~LLVOPart()
61{
62 delete [] mParticleState;
63 mParticleState = NULL;
64
65 delete [] mDeadArr;
66 mDeadArr = NULL;
67}
68
69void LLVOPart::initClass()
70{
71}
72
73U32 LLVOPart::processUpdateMessage(LLMessageSystem *mesgsys,
74 void **user_data,
75 U32 block_num,
76 const EObjectUpdateType update_type,
77 LLDataPacker *dp)
78{
79 S32 dataSize;
80 U8 packed_psys_data[180];
81 // Do base class updates...
82 mTimeLastFrame = gFrameTime;
83 U32 retval = LLViewerObject::processUpdateMessage(mesgsys, user_data, block_num, update_type, dp);
84
85 if (update_type == OUT_TERSE_IMPROVED)
86 {
87 // Nothing else needs to be done for the terse message.
88 return retval;
89 }
90
91 dataSize = mesgsys->getSizeFast(_PREHASH_ObjectData, block_num, _PREHASH_Data);
92
93 if(dataSize == sizeof(LLPartInitData))
94 {
95 // Uncompressed particle. Is this used? JC
96 mesgsys->getBinaryDataFast(_PREHASH_ObjectData, _PREHASH_Data, &mInitSysData, dataSize, block_num);
97
98 if(mInitSysData.createMe)
99 {
100 if (mInitSysData.initialParticles >= mInitSysData.maxParticles)
101 {
102 mInitSysData.initialParticles = mInitSysData.maxParticles - 1;
103 }
104 setParticleParams(mInitSysData.bounce_b,
105 getPositionRegion().mV,
106 getRotation().mQ,
107 mInitSysData.maxParticles,
108 mInitSysData.mImageUuid,
109 mInitSysData.mFlags);
110 initializeParticlesAndConstraints(mInitSysData.initialParticles,
111 mInitSysData.diffEqAlpha,
112 mInitSysData.diffEqScale,
113 mInitSysData.scale_range,
114 mInitSysData.alpha_range,
115 mInitSysData.vel_offset,
116 mInitSysData.killPlaneZ,
117 mInitSysData.killPlaneNormal,
118 mInitSysData.bouncePlaneZ,
119 mInitSysData.bouncePlaneNormal,
120 mInitSysData.spawnRange,
121 mInitSysData.spawnFrequency,
122 mInitSysData.spawnFreqencyRange,
123 mInitSysData.spawnDirection,
124 mInitSysData.spawnDirectionRange,
125 mInitSysData.spawnVelocity,
126 mInitSysData.spawnVelocityRange,
127 mInitSysData.speedLimit,
128 mInitSysData.windWeight,
129 mInitSysData.currentGravity,
130 mInitSysData.gravityWeight,
131 mInitSysData.globalLifetime,
132 mInitSysData.individualLifetime,
133 mInitSysData.individualLifetimeRange,
134 mInitSysData.alphaDecay,
135 mInitSysData.scaleDecay,
136 mInitSysData.distanceDeath,
137 mInitSysData.dampMotionFactor,
138 mInitSysData.windDiffusionFactor);
139 setParticlesDistFadeout(mInitSysData.mDistBeginFadeout,
140 mInitSysData.mDistEndFadeout);
141 }
142 }
143 else if(dataSize > 4)
144 {
145 mesgsys->getBinaryDataFast(_PREHASH_ObjectData, _PREHASH_Data, packed_psys_data, dataSize, block_num);
146
147 LLPartSysCompressedPacket CompObjectData;
148 U32 sizeUsed;
149
150 CompObjectData.fromUnsignedBytes(packed_psys_data, dataSize);
151 CompObjectData.toLLPartInitData(&mInitSysData, &sizeUsed);
152
153 if(mInitSysData.createMe)
154 {
155 if (mInitSysData.initialParticles >= mInitSysData.maxParticles)
156 {
157 mInitSysData.initialParticles = mInitSysData.maxParticles - 1;
158 }
159 setParticleParams(mInitSysData.bounce_b,
160 getPositionRegion().mV,
161 getRotation().mQ,
162 mInitSysData.maxParticles,
163 mInitSysData.mImageUuid,
164 mInitSysData.mFlags);
165 initializeParticlesAndConstraints(mInitSysData.initialParticles,
166 mInitSysData.diffEqAlpha,
167 mInitSysData.diffEqScale,
168 mInitSysData.scale_range,
169 mInitSysData.alpha_range,
170 mInitSysData.vel_offset,
171 mInitSysData.killPlaneZ,
172 mInitSysData.killPlaneNormal,
173 mInitSysData.bouncePlaneZ,
174 mInitSysData.bouncePlaneNormal,
175 mInitSysData.spawnRange,
176 mInitSysData.spawnFrequency,
177 mInitSysData.spawnFreqencyRange,
178 mInitSysData.spawnDirection,
179 mInitSysData.spawnDirectionRange,
180 mInitSysData.spawnVelocity,
181 mInitSysData.spawnVelocityRange,
182 mInitSysData.speedLimit,
183 mInitSysData.windWeight,
184 mInitSysData.currentGravity,
185 mInitSysData.gravityWeight,
186 mInitSysData.globalLifetime,
187 mInitSysData.individualLifetime,
188 mInitSysData.individualLifetimeRange,
189 mInitSysData.alphaDecay,
190 mInitSysData.scaleDecay,
191 mInitSysData.distanceDeath,
192 mInitSysData.dampMotionFactor,
193 mInitSysData.windDiffusionFactor);
194 setParticlesDistFadeout(mInitSysData.mDistBeginFadeout,
195 mInitSysData.mDistEndFadeout);
196 }
197 }
198
199 translateParticlesTo(getPositionRegion());
200 rotateParticlesTo(getRotation());
201 return retval;
202}
203
204
205BOOL LLVOPart::isActive() const
206{
207 return TRUE;
208}
209
210BOOL LLVOPart::idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time)
211{
212 if (mDeathTimer.getElapsedTimeF32() > MAX_PART_LIFETIME)
213 {
214 //llinfos << "LLVOPart dead due to extended lifetime" << llendl;
215 return FALSE;
216 }
217
218 if (gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_PARTICLES))
219 {
220 if (!mDrawable)
221 {
222 llwarns << "LLVOPart idle with no drawable!" << llendl;
223 return FALSE;
224 }
225 // I don't know why you'd want to do ANYTHING with invisible particles. ??? - Doug
226 if(mFlags[PART_SYS_INVISIBLE_BYTE] & PART_SYS_INVISIBLE_BIT)
227 {
228 llwarns << "Invisible particle, killing" << llendl;
229 return FALSE;
230 }
231
232 F64 delta_time = ((S64)(gFrameTime - mTimeLastFrame))*(1.0/((F64)USEC_PER_SEC));
233 mParticlesDead = !iterateParticles((F32)delta_time);
234
235 if(mParticlesDead)
236 {
237 return FALSE;
238 }
239
240 translateParticlesTo(getPositionRegion());
241
242 mTimeLastFrame = gFrameTime;
243 setChanged(GEOMETRY);
244 gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_VOLUME, TRUE);
245
246 }
247 LLViewerObject::idleUpdate(agent, world, time);
248 return TRUE;
249}
250
251
252void LLVOPart::updateTextures(LLAgent &agent)
253{
254 if (getTEImage(0))
255 {
256 LLVector3 relative_position = getPositionAgent() - agent.getCameraPositionAgent();
257 F32 dot_product = relative_position * agent.getFrameAgent().getAtAxis();
258 F32 cos_angle = dot_product / relative_position.magVec();
259
260 if (cos_angle > 1.f)
261 {
262 cos_angle = 1.f;
263 }
264
265 getTEImage(0)->addTextureStats(mPixelArea, 1.f, cos_angle);
266 }
267}
268
269
270LLDrawable* LLVOPart::createDrawable(LLPipeline *pipeline)
271{
272 pipeline->allocDrawable(this);
273 mDrawable->setLit(FALSE);
274 mDrawable->setRenderType(LLPipeline::RENDER_TYPE_PARTICLES);
275
276 LLDrawPool *pool = gPipeline.getPool(LLDrawPool::POOL_ALPHA);
277 mDrawable->setNumFaces(mNumPart, pool, getTEImage(0));
278 return mDrawable;
279}
280
281BOOL LLVOPart::updateGeometry(LLDrawable *drawable)
282{
283 if (isChanged(LLPrimitive::GEOMETRY))
284 {
285 LLFace *face;
286
287 ///////////////////////
288 //
289 // Allocate/deallocate faces based on number of particles we need to render
290 //
291 //
292 if (drawable->getNumFaces())
293 {
294 face = drawable->getFace(0);
295 drawable->setNumFaces(mNumPart, face->getPool(), getTEImage(0));
296 }
297 else
298 {
299 LLDrawPool *pool = gPipeline.getPool(LLDrawPool::POOL_ALPHA);
300 drawable->setNumFaces(mNumPart, pool, getTEImage(0));
301 }
302
303 LLVector3 light_norm;
304
305 if (gSky.sunUp())
306 {
307 light_norm = -gSky.getSunDirection();
308 }
309 else
310 {
311 light_norm = -gSky.getMoonDirection();
312 }
313 light_norm.normVec();
314
315 // Figure out the lighting for the particle system.
316 LLColor4 color(1.f,1.f,1.f,1.f);
317 LLVector3 at, left, up;
318
319 at = gCamera->getAtAxis();
320 left = gCamera->getLeftAxis();
321 up = gCamera->getUpAxis();
322
323 LLVector3 v_agent[4];
324
325 LLMatrix3 cached_oo;
326 cached_oo.setRot(mOriginOrientation);
327 U32 i;
328 U32 cur_face = 0;
329 for (i = 0; i < mNumPart; i++)
330 {
331 face = drawable->getFace(cur_face++);
332
333 if (0 != mDeadArr[i])
334 {
335 face->setSize(0);
336 continue; // if this particle is dead, don't render it
337 }
338
339
340 LLStrider<LLVector3> verticesp;
341 LLStrider<LLVector3> normalsp;
342 LLStrider<LLVector2> texCoordsp;
343 U32 *indicesp;
344 S32 index_offset;
345
346 face->setPrimType(LLTriangles);
347 face->setSize(4, 6);
348 index_offset = face->getGeometry(verticesp,normalsp,texCoordsp, indicesp);
349 if (-1 == index_offset)
350 {
351 llerrs << "Error allocating geometry!" << llendl;
352 }
353
354 LLVector3 position_agent;
355 LLVector3 part_pos_local;
356 F32 alpha = 1.0f;
357 F32 scale = 1.0f; // elements of the particle system have random scales too! -- MDS
358
359 position_agent = mSpawnPoint + getRegion()->getOriginAgent();
360
361 if(mFlags[PART_SYS_FOLLOW_VEL_BYTE] & PART_SYS_FOLLOW_VEL_BIT)
362 {
363 part_pos_local.mV[0] = mParticleState[i].position[0]*cached_oo.mMatrix[0][0]+
364 mParticleState[i].position[1]*cached_oo.mMatrix[0][1]+
365 mParticleState[i].position[2]*cached_oo.mMatrix[0][2];
366
367 part_pos_local.mV[1] = mParticleState[i].position[0]*cached_oo.mMatrix[1][0]+
368 mParticleState[i].position[1]*cached_oo.mMatrix[1][1]+
369 mParticleState[i].position[2]*cached_oo.mMatrix[1][2];
370
371 part_pos_local.mV[2] = mParticleState[i].position[0]*cached_oo.mMatrix[2][0]+
372 mParticleState[i].position[1]*cached_oo.mMatrix[2][1]+
373 mParticleState[i].position[2]*cached_oo.mMatrix[2][2];
374
375 scale = mParticleState[i].scale[0];
376 alpha = mParticleState[i].alpha[0];
377
378 //26 September 2001 - alter alpha and scale as approach death
379 //j = death_offset_i(i);
380 scale *= ((1.f - mScaleDecay) + (mScaleDecay * mParticleState[i].deathOffset));
381 alpha *= ((1.f - mAlphaDecay) + (mAlphaDecay * mParticleState[i].deathOffset));
382
383 up.mV[0] = -mParticleState[i].position[0];
384 up.mV[1] = -mParticleState[i].position[1];
385 up.mV[2] = -mParticleState[i].position[2]; // set "up" to trail velocity
386
387 if(up.magVec() == 0.0f) // alleviate potential divide by zero bug
388 {
389 up.mV[2] += 1.0f;
390 }
391
392 up.normVec();
393 up = up - (up*at) * at;
394
395 left = up % at;
396
397 up *= scale * 0.5f;
398 left *= scale * 0.5f;
399 position_agent += part_pos_local;
400 face->mCenterAgent = position_agent;
401 v_agent[0] = position_agent + left + up;
402 v_agent[1] = position_agent - left + up;
403 v_agent[2] = position_agent - left - up;
404 v_agent[3] = position_agent + left - up;
405 *(texCoordsp) = LLVector2(0.f, 1.f);
406 texCoordsp++;
407 *(texCoordsp) = LLVector2(0.f, 0.f);
408 texCoordsp++;
409 *(texCoordsp) = LLVector2(1.f, 1.f);
410 texCoordsp++;
411 *(texCoordsp) = LLVector2(1.f, 0.f);
412 texCoordsp++;
413 }
414 else
415 {
416 part_pos_local.mV[0] = mParticleState[i].position[0]*cached_oo.mMatrix[0][0]+
417 mParticleState[i].position[1]*cached_oo.mMatrix[0][1]+
418 mParticleState[i].position[2]*cached_oo.mMatrix[0][2];
419
420 part_pos_local.mV[1] = mParticleState[i].position[0]*cached_oo.mMatrix[1][0]+
421 mParticleState[i].position[1]*cached_oo.mMatrix[1][1]+
422 mParticleState[i].position[2]*cached_oo.mMatrix[1][2];
423
424 part_pos_local.mV[2] = mParticleState[i].position[0]*cached_oo.mMatrix[2][0]+
425 mParticleState[i].position[1]*cached_oo.mMatrix[2][1]+
426 mParticleState[i].position[2]*cached_oo.mMatrix[2][2];
427
428
429 scale = mParticleState[i].scale[0];
430 alpha = mParticleState[i].alpha[0];
431
432 //26 September 2001 - alter alpha and scale as approach death
433 scale *= ((1.f - mScaleDecay) + (mScaleDecay * mParticleState[i].deathOffset));
434 alpha *= ((1.f - mAlphaDecay) + (mAlphaDecay * mParticleState[i].deathOffset));
435
436 LLVector3 part_up = scale * 0.5f * up;
437 LLVector3 part_left = scale * 0.5f * left;
438
439 position_agent += part_pos_local;
440 face->mCenterAgent = position_agent;
441 v_agent[0] = position_agent + part_left + part_up;
442 v_agent[1] = position_agent - part_left + part_up;
443 v_agent[2] = position_agent - part_left - part_up;
444 v_agent[3] = position_agent + part_left - part_up;
445 *(texCoordsp) = LLVector2(0.f, 1.f);
446 texCoordsp++;
447 *(texCoordsp) = LLVector2(0.f, 0.f);
448 texCoordsp++;
449 *(texCoordsp) = LLVector2(1.f, 1.f);
450 texCoordsp++;
451 *(texCoordsp) = LLVector2(1.f, 0.f);
452 texCoordsp++;
453 }
454
455 color.mV[3] = alpha;
456 face->setFaceColor(color);
457
458 *(verticesp++) = v_agent[1];
459 *(verticesp++) = v_agent[2];
460 *(verticesp++) = v_agent[0];
461 *(verticesp++) = v_agent[3];
462
463 *(indicesp++) = index_offset + 0;
464 *(indicesp++) = index_offset + 2;
465 *(indicesp++) = index_offset + 1;
466
467 *(indicesp++) = index_offset + 1;
468 *(indicesp++) = index_offset + 2;
469 *(indicesp++) = index_offset + 3;
470 }
471 LLPipeline::sCompiles++;
472 }
473
474 return TRUE;
475}
476
477
478void LLVOPart::setDefaultValues()
479{
480 U32 i;
481
482 // initialize to safe but meaningless values : no other constructors
483 mParticleState = NULL;
484 mNumPart = 0;
485 mAlpha = 1.0f;
486 mLastTime = mCurrTime = 0.0f;
487 //mOriginPosition[0] = mOriginPosition[1] = mOriginPosition[2] = 0.0f;
488 mOriginOrientation.setQuatInit(0.0f, 0.0f, 0.0f, 1.0f);
489 mDeadArr = NULL;
490
491 mKillPlaneNormal.mV[VX] = 0.0f;//Straight up - needs to be unit
492 mKillPlaneNormal.mV[VY] = 0.0f;
493 mKillPlaneNormal.mV[VZ] = 1.0f;
494
495 mBouncePlaneNormal.mV[VX] = 0.0f;//Straight up - needs to be unit
496 mBouncePlaneNormal.mV[VY] = 0.0f;
497 mBouncePlaneNormal.mV[VZ] = 1.0f;
498
499 mSpawnPoint.mV[VX] = 0.0f;
500 mSpawnPoint.mV[VY] = 0.0f;
501 mSpawnPoint.mV[VZ] = 0.0f;
502
503 mSpawnDirection.mV[VX] = 0.0f;//Straight up - needs to be unit
504 mSpawnDirection.mV[VY] = 0.0f;
505 mSpawnDirection.mV[VZ] = 1.0f;
506
507 mCurrentWind.mV[VX] = 0.0f;
508 mCurrentWind.mV[VY] = 0.0f;
509 mCurrentWind.mV[VZ] = 0.0f;
510
511 mCurrentWindMagnitude = 0.0f;
512 mCurrentWindMagnitudeSquareRoot = 0.0f;
513
514 mCurrentGravity.mV[VX] = 0.0f;//Straight down
515 mCurrentGravity.mV[VY] = 0.0f;
516 mCurrentGravity.mV[VZ] = -9.81f;
517
518 mVelocityOffset.mV[VX] = 0.0f;
519 mVelocityOffset.mV[VY] = 0.0f;
520 mVelocityOffset.mV[VZ] = 0.0f;
521
522 for(i = 0; i < PART_SYS_BYTES_OF_FLAGS; i++)
523 {
524 mFlags[i] = 0x00;
525 }
526
527 //set default action and kill flags
528 //These defaults are for an explosion - a short lived set of debris affected by gravity.
529 //Action flags default to PART_SYS_AFFECTED_BY_WIND + PART_SYS_AFFECTED_BY_GRAVITY + PART_SYS_DISTANCE_DEATH
530 mFlags[PART_SYS_ACTION_BYTE] = PART_SYS_AFFECTED_BY_WIND | PART_SYS_AFFECTED_BY_GRAVITY | PART_SYS_DISTANCE_DEATH;
531 mFlags[PART_SYS_KILL_BYTE] = PART_SYS_DISTANCE_DEATH + PART_SYS_TIME_DEATH;
532
533 for (i = 0; i < 3; i++)
534 {
535 mDiffEqAlpha[i] = 0.0f;
536 mDiffEqScale[i] = 0.0f;
537 }
538
539 mScale_range[0] = 1.00f;
540 mScale_range[1] = 5.00f;
541 mScale_range[2] = mScale_range[3] = 0.0f;
542
543 mAlpha_range[0] = mAlpha_range[1] = 1.0f;
544 mAlpha_range[2] = mAlpha_range[3] = 0.0f;
545
546
547 mKillPlaneZ = 0.0f;
548 mBouncePlaneZ = 0.0f;
549
550 mSpawnRange = 1.0f;
551 mSpawnFrequency = 0.0f;
552 mSpawnFrequencyRange = 0.0f;
553 mSpawnDirectionRange = 1.0f; //everywhere
554 mSpawnVelocity = 0.75f;
555 mSpawnVelocityRange = 0.25f; //velocity +/- 0.25
556 mSpeedLimitSquared = 1.0f;
557 mWindWeight = 0.5f; //0.0f means looks like a heavy object (if gravity is on), 1.0f means light and fluffy
558 mGravityWeight = 0.5f; //0.0f means boyed by air, 1.0f means it's a lead weight
559 mGlobalLifetime = 0.0f; //Arbitrary, but default is no global die, so doesn't matter
560 mOriginalGlobalLifetime = 0.0f;
561 mIndividualLifetime = 5.0f;
562 if (mIndividualLifetime > 0.0f)
563 {
564 mOneOverIndividualLifetime = 1.0f / mIndividualLifetime;
565 }
566 else
567 {
568 mOneOverIndividualLifetime = 0.0f;
569 }
570 mIndividualLifetimeRange = 1.0f; //Particles last 5 secs +/- 1
571 mAlphaDecay = 1.0f; //normal alpha fadeout
572 mScaleDecay = 0.0f; //no scale decay
573 mDistanceDeathSquared = 10.0f; //die if hit unit radius
574 if (mDistanceDeathSquared > 0.0f)
575 {
576 mOneOverDistanceDeathSquared = 1.0f / mDistanceDeathSquared;
577 }
578 else
579 {
580 mOneOverDistanceDeathSquared = 0.0f;
581 }
582 mDampMotionFactor = 0.0f;
583
584 mWindDiffusionFactor.mV[VX] = 0.0f;
585 mWindDiffusionFactor.mV[VY] = 0.0f;
586 mWindDiffusionFactor.mV[VZ] = 0.0f;
587
588 mUpdatePhysicsInputsTime = mCurrTime;
589}
590
591
592U8 LLVOPart::setParticlesDistFadeout(F32 beginFadeout, F32 endFadeout)
593{
594 // This doesn't do anything...
595 return 1;
596}
597
598unsigned char LLVOPart::setParticleParams(F32 bounce_b,
599 const F32 o_pos[3],
600 const F32 o_or[3],
601 U32 n,
602 LLUUID image_uuid,
603 U8 flags[PART_SYS_BYTES_OF_FLAGS])
604{
605 mBounceBehavior = bounce_b;
606 mSpawnPoint.setVec(o_pos[0], o_pos[1], o_pos[2]);
607
608 mOriginOrientation.setQuatInit(o_or[0], o_or[1], o_or[2],
609 (F32)sqrt(1.0f - o_or[0]*o_or[0] - o_or[1]*o_or[1] - o_or[2]*o_or[2]));
610
611 if(mNumPart < n )
612 {
613 // this crazy logic is just in case "setParams" gets called multiple times
614 if(mNumPart != 0)
615 {
616 if(mParticleState != NULL)
617 {
618 delete [] mParticleState;
619 }
620 if(mDeadArr != NULL)
621 {
622 delete [] mDeadArr;
623 }
624
625 mParticleState = NULL;
626 mDeadArr = NULL;
627 mNumPart = 0;
628 }
629 mNumPart = n;
630 //state_arr = new F32[n*FLOATS_PER_PARTICLE];
631 mParticleState = new OneParticleData[n];
632 mDeadArr = new U8[n];
633 memset(mDeadArr,1,n); // initialize these to 1;
634 }
635 else
636 {
637 mNumPart = n;
638 }
639
640 setTETexture(0, image_uuid);
641
642 for(U32 i = 0; i< PART_SYS_BYTES_OF_FLAGS; i++)
643 {
644 mFlags[i] = flags[i];
645 }
646
647 return '\0'; // success
648}
649
650
651void LLVOPart::setParticleCountdownStateWaitingDead(const U32 particleNumber)
652{
653 F32 frequency;
654
655 frequency = mSpawnFrequency;
656 // **** Hack! remainingLifetime counts up from negative, to avoid subtracts! - djs
657 mParticleState[particleNumber].remainingLifetime = -(((mSpawnFrequencyRange * 2.0f)*ll_frand()) + frequency - mSpawnFrequencyRange);
658}
659
660//Can override later
661void LLVOPart::spawnParticle(const U32 particleNumber)
662{
663 F32 randomUnitValue;
664 LLVector3 direction;
665
666 if (particleNumber >= mNumPart)
667 {
668 llinfos << "Trying to spawn particle beyond initialized particles! " << particleNumber << " : " << mNumPart << llendl;
669 return;
670 }
671
672 mDeadArr[particleNumber] = 0; // not dead yet!
673
674 //j = pos_offset_i(particleNumber);
675 mParticleState[particleNumber].position[0] = 2.f*mSpawnRange*(ll_frand()) - mSpawnRange;
676 mParticleState[particleNumber].position[1] = 2.f*mSpawnRange*(ll_frand()) - mSpawnRange;
677 mParticleState[particleNumber].position[2] = 2.f*mSpawnRange*(ll_frand()) - mSpawnRange;
678
679 //mParticleStateArray[j] = (pos_ranges[1] - pos_ranges[0])*(F32)rand()/((F32)RAND_MAX) + pos_ranges[0];
680 //j++;
681
682 //mParticleStateArray[j] = (pos_ranges[3] - pos_ranges[2])*(F32)rand()/((F32)RAND_MAX) + pos_ranges[2];
683 //j++;
684
685 //mParticleStateArray[j] = (pos_ranges[5] - pos_ranges[4])*(F32)rand()/((F32)RAND_MAX) + pos_ranges[4];
686
687 //Create the ranged direction vector first - then rotate by the actual direction and then scale
688 //Creating a random value about 1,0,0
689 //1. pick a random angle YZ orientation through full circle.
690 randomUnitValue = (ll_frand());
691 direction.mV[VY] = sinf(randomUnitValue * 2.0 * F_PI);
692 direction.mV[VZ] = cosf(randomUnitValue * 2.0 * F_PI);
693
694 //2. pick a rotation to this angle to project into z which is scaled by mSpawnDirectionRange
695 randomUnitValue = (ll_frand());
696 randomUnitValue *= mSpawnDirectionRange;
697 direction.mV[VY] = direction.mV[VY] * sinf(randomUnitValue * F_PI);
698 direction.mV[VZ] = direction.mV[VZ] * sinf(randomUnitValue * F_PI);
699 direction.mV[VX] = cosf(randomUnitValue * F_PI); //works as still dealing with a unit vector
700
701 //3.To rotate into the spawn direction coord system, derive a yaw and pitch (roll doesnt matter)
702 //from the offset between the unit vector 1,0,0 and random direction.
703 {F32 length;
704
705 //TODO - math behind this may be incorrect
706 //Assume the initial axis is +ve x
707 //derive pitch using the XZ or XY components.
708 //derive yaw using YZ components.
709 length = (mSpawnDirection.mV[VY]*mSpawnDirection.mV[VY]) +
710 (mSpawnDirection.mV[VZ]*mSpawnDirection.mV[VZ]);
711 if (length > 0.0f)
712 {//Only happens when spawn a particle, so can afford some heavy math.
713 F32 xYaw, yYaw, xPitch, yPitch;
714 LLVector3 tempResult, tempResult2;
715
716 //Pitch is the XZ component (but if Z is 0 and Y is not, switch)
717 tempResult.setVec(mSpawnDirection.mV[VX], mSpawnDirection.mV[VY], mSpawnDirection.mV[VZ]);
718 if (0.0f != mSpawnDirection.mV[VZ])
719 {
720 length = sqrtf((mSpawnDirection.mV[VX]*mSpawnDirection.mV[VX]) +
721 (mSpawnDirection.mV[VZ]*mSpawnDirection.mV[VZ]));
722 if (length > 0.0f)
723 {
724 xPitch = tempResult.mV[VX] / length;
725 yPitch = -tempResult.mV[VZ] / length;
726 }
727 else
728 {//length is 0, so no x component, so pitch must be PI/2
729 xPitch = 0.0f;
730 yPitch = 1.0f;
731 }
732
733 //To obtain yaw, remove pitch from the direction vector by inverse rotation (negate the yPitch)
734 tempResult2.mV[VX] = (tempResult.mV[VX] * xPitch) + (tempResult.mV[VZ] * (-yPitch));
735 tempResult2.mV[VY] = tempResult.mV[VY];
736 tempResult2.mV[VZ] = (tempResult.mV[VZ] * xPitch) - (tempResult.mV[VX] * (-yPitch));
737 }
738 else
739 {//Need XY, because if XZ is zero there is no pitch, and yaw may not pick up the discrepancy.
740 //This also avoids roll, so less math.
741 length = sqrtf((mSpawnDirection.mV[VX]*mSpawnDirection.mV[VX]) +
742 (mSpawnDirection.mV[VY]*mSpawnDirection.mV[VY]));
743 if (length > 0.0f)
744 {
745 xPitch = tempResult.mV[VX] / length;
746 yPitch = -tempResult.mV[VY] / length;
747 }
748 else
749 {//length is 0, so no x component, so pitch must be PI/2
750 xPitch = 0.0f;
751 yPitch = 1.0f;
752 }
753
754 //To obtain yaw, remove pitch from the direction vector by inverse rotation (negate the yPitch)
755 tempResult2.mV[VX] = (tempResult.mV[VX] * xPitch) + (tempResult.mV[VY] * (-yPitch));
756 tempResult2.mV[VY] = (tempResult.mV[VY] * xPitch) - (tempResult.mV[VX] * (-yPitch));
757 tempResult2.mV[VZ] = tempResult.mV[VZ];
758 }
759
760 //Yaw is the YZ component
761 length = sqrtf((tempResult2.mV[VZ]*tempResult2.mV[VZ]) +
762 (tempResult2.mV[VY]*tempResult2.mV[VY]));
763 if (length > 0.0f)
764 {
765 xYaw = tempResult2.mV[VZ] / length;
766 yYaw = tempResult2.mV[VY] / length;
767 }
768 else
769 {
770 xYaw = 1.0f;
771 yYaw = 0.0f;
772 }
773
774 //Now apply the rotations to the actual data in the same order as derived above (pitch first)
775 tempResult.setVec(direction.mV[VX], direction.mV[VY], direction.mV[VZ]);
776 //Remember which axis pitch was on, as need to apply in the same manner here for consistency.
777 if (0.0f != mSpawnDirection.mV[VZ])
778 {
779 tempResult2.mV[VX] = (tempResult.mV[VX] * xPitch) + (tempResult.mV[VZ] * yPitch);
780 tempResult2.mV[VY] = tempResult.mV[VY];
781 tempResult2.mV[VZ] = (tempResult.mV[VZ] * xPitch) - (tempResult.mV[VX] * yPitch);
782 }
783 else
784 {
785 tempResult2.mV[VX] = (tempResult.mV[VX] * xPitch) + (tempResult.mV[VY] * yPitch);
786 tempResult2.mV[VY] = (tempResult.mV[VY] * xPitch) - (tempResult.mV[VX] * yPitch);
787 tempResult2.mV[VZ] = tempResult.mV[VZ];
788 }
789 direction.mV[VX] = tempResult2.mV[VX];
790 direction.mV[VY] = (tempResult2.mV[VY] * xYaw) + (tempResult2.mV[VZ] * yYaw);
791 direction.mV[VZ] = (tempResult2.mV[VZ] * xYaw) - (tempResult2.mV[VY] * yYaw);
792 }
793 else
794 {//The is no YZ component, so we a pointing straight along X axis (default) & therefore no rotation
795 //However, direction may be reversed
796 if (mSpawnDirection.mV[VX] < 0.0f)
797 {
798 direction.mV[VX] = -direction.mV[VX];
799 direction.mV[VZ] = -direction.mV[VZ];
800 }
801
802 }
803 }
804
805
806 //4. scale the vector by a random scale by mSpawnVelocityRange and offset by mSpawnVelocity
807 randomUnitValue = (ll_frand());
808 randomUnitValue = (randomUnitValue * mSpawnVelocityRange) + mSpawnVelocity;
809
810 mParticleState[particleNumber].velocity[0] = direction.mV[VX] * randomUnitValue;
811 mParticleState[particleNumber].velocity[1] = direction.mV[VY] * randomUnitValue;
812 mParticleState[particleNumber].velocity[2] = direction.mV[VZ] * randomUnitValue;
813
814 //add in velocity offset to match what spawned these particles
815 mParticleState[particleNumber].velocity[0] += mVelocityOffset.mV[VX];
816 mParticleState[particleNumber].velocity[1] += mVelocityOffset.mV[VY];
817 mParticleState[particleNumber].velocity[2] += mVelocityOffset.mV[VZ];
818
819 mParticleState[particleNumber].acceleration[0] = 0.0f;
820
821 mParticleState[particleNumber].acceleration[1] = 0.0f;
822
823 mParticleState[particleNumber].acceleration[2] = 0.0f;
824
825 mParticleState[particleNumber].scale[0] = (mScale_range[1] - mScale_range[0])*ll_frand() + mScale_range[0];
826 mParticleState[particleNumber].scale[1] = (mScale_range[3] - mScale_range[2])*ll_frand() + mScale_range[2];
827 mParticleState[particleNumber].scale[2] = 0.0f;
828
829 mParticleState[particleNumber].alpha[0] = (mAlpha_range[1] - mAlpha_range[0])*ll_frand() + mAlpha_range[0];
830 mParticleState[particleNumber].alpha[1] = (mAlpha_range[3] - mAlpha_range[2])*ll_frand() + mAlpha_range[2];
831 mParticleState[particleNumber].alpha[2] = 0.0f;
832
833 // **** Hack! remainingLifetime counts up from negative, to avoid subtracts! - djs
834 mParticleState[particleNumber].remainingLifetime = -((mIndividualLifetimeRange*2.0f)*ll_frand() + mIndividualLifetime - mIndividualLifetimeRange);
835
836 //rest of the state - 0 for now
837 mParticleState[particleNumber].deathOffset = 0.0f;
838 mParticleState[particleNumber].localWind[0] = 0.0f;
839 mParticleState[particleNumber].localWind[1] = 0.0f;
840 mParticleState[particleNumber].localWind[2] = 0.0f;
841}
842
843//Can override later
844void LLVOPart::onParticleBounce(const U32 particleNumber)
845{
846 mParticleState[particleNumber].velocity[0] += - (1.0f + mBounceBehavior) * mBouncePlaneNormal.mV[0] * mParticleState[particleNumber].velocity[0];
847 mParticleState[particleNumber].velocity[1] += - (1.0f + mBounceBehavior) * mBouncePlaneNormal.mV[1] * mParticleState[particleNumber].velocity[1];
848 mParticleState[particleNumber].velocity[2] += - (1.0f + mBounceBehavior) * mBouncePlaneNormal.mV[2] * mParticleState[particleNumber].velocity[2];
849
850
851 //Need to offset particle so above the plane, so it doesn't oscillate!
852 if (mParticleState[particleNumber].position[2] < mBouncePlaneZ)
853 {
854 mParticleState[particleNumber].position[2] = mBouncePlaneZ;
855 }
856}
857
858
859unsigned char LLVOPart::initializeParticlesAndConstraints(U32 initialParticles,
860 F32 diffEqAlpha[3],
861 F32 diffEqScale[3],
862 F32 scale_ranges[4],
863 F32 alpha_ranges[4],
864 F32 velocityOffset[3],
865 F32 killPlaneZ,
866 F32 killPlaneNormal[3],
867 F32 bouncePlaneZ,
868 F32 bouncePlaneNormal[3],
869 F32 spawnRange,
870 F32 spawnFrequency,
871 F32 spawnFrequencyRange,
872 F32 spawnDirection[3],
873 F32 spawnDirectionRange,
874 F32 spawnVelocity,
875 F32 spawnVelocityRange,
876 F32 speedLimit,
877 F32 windWeight,
878 F32 currentGravity[3],
879 F32 gravityWeight,
880 F32 globalLifetime,
881 F32 individualLifetime,
882 F32 individualLifetimeRange,
883 F32 alphaDecay,
884 F32 scaleDecay,
885 F32 distanceDeath,
886 F32 dampMotionFactor,
887 F32 windDiffusionFactor[3])
888{
889 // initializes particles randomly within these ranges
890 // scale ranges and alpha ranges contain initial conditions plus rates of change
891 // of initial conditions My naming is incosistent (passing alpha derivatives with alpha
892 // values), but this class is wrapped by another one, and this function is called only once
893 U32 i;
894
895
896 for (i = 0; i < 3; i++)
897 {
898 mDiffEqAlpha[i] = diffEqAlpha[i];
899 mDiffEqScale[i] = diffEqScale[i];
900 }
901
902 //First - store the initial conditions
903 for (i = 0; i < 4; i++)
904 {
905 mScale_range[i] = scale_ranges[i];
906 mAlpha_range[i] = alpha_ranges[i];
907 }
908
909 mVelocityOffset.setVec(velocityOffset[0], velocityOffset[1], velocityOffset[2]);
910
911 mKillPlaneZ = killPlaneZ;
912 mKillPlaneNormal.setVec(killPlaneNormal[0], killPlaneNormal[1], killPlaneNormal[2]);
913 mKillPlaneNormal.normVec();
914 mBouncePlaneZ = bouncePlaneZ;
915 mBouncePlaneNormal.setVec(bouncePlaneNormal[0], bouncePlaneNormal[1], bouncePlaneNormal[2]);
916 mBouncePlaneNormal.normVec();
917
918 mSpawnRange = spawnRange;
919
920 mSpawnFrequency = spawnFrequency;
921 mSpawnFrequencyRange = spawnFrequencyRange;
922
923 mSpawnDirection.setVec(spawnDirection[0], spawnDirection[1], spawnDirection[2]);
924 mSpawnDirection.normVec();
925 mSpawnDirectionRange = spawnDirectionRange;
926
927 mSpawnVelocity = spawnVelocity;
928 mSpawnVelocityRange = spawnVelocityRange;
929 mSpeedLimitSquared = speedLimit * speedLimit;
930 if (mSpeedLimitSquared < 0.0000001f)
931 {
932 mSpeedLimitSquared = 0.0000001f; //speed must be finite +ve to avoid divide by zero
933 }
934
935 mWindWeight = windWeight;
936 mCurrentGravity.setVec(currentGravity[0], currentGravity[1], currentGravity[2]);
937 mGravityWeight = gravityWeight;
938
939 mGlobalLifetime = globalLifetime;
940 mOriginalGlobalLifetime = mGlobalLifetime;
941 mIndividualLifetime = individualLifetime;
942 if (mIndividualLifetime > 0.0f)
943 {
944 mOneOverIndividualLifetime = 1.0f / mIndividualLifetime;
945 }
946 else
947 {
948 mOneOverIndividualLifetime = 0.0f;
949 }
950 mIndividualLifetimeRange = individualLifetimeRange;
951
952 mAlphaDecay = alphaDecay;
953 mScaleDecay = scaleDecay;
954 mDistanceDeathSquared = distanceDeath * distanceDeath;
955 if (mDistanceDeathSquared > 0.0f)
956 {
957 mOneOverDistanceDeathSquared = 1.0f / mDistanceDeathSquared;
958 }
959 else
960 {
961 mOneOverDistanceDeathSquared = 0.0f;
962 }
963 mDampMotionFactor = dampMotionFactor;
964
965 mWindDiffusionFactor.setVec(windDiffusionFactor[0], windDiffusionFactor[1], windDiffusionFactor[2]);
966 //Scale the values down a lot, as can expand sprites incredibly fast
967 mWindDiffusionFactor *= 0.02f;
968 if (mWindDiffusionFactor.mV[VX] > 0.02f)
969 {
970 mWindDiffusionFactor.mV[VX] = 0.02f;
971 }
972 if (mWindDiffusionFactor.mV[VY] > 0.02f)
973 {
974 mWindDiffusionFactor.mV[VY] = 0.02f;
975 }
976 if (mWindDiffusionFactor.mV[VZ] > 0.02f)
977 {
978 mWindDiffusionFactor.mV[VZ] = 0.02f;
979 }
980 //llinfos << "Made a particle system" << llendl;
981
982 for(i = 0; i < initialParticles; i++)
983 {
984 spawnParticle(i);
985 }
986
987 for(i = initialParticles; i < mNumPart; i++)
988 {
989 //create initial conditions - dead waiting to live timer
990 setParticleCountdownStateWaitingDead(i);
991 }
992 return '\0'; // success
993}
994
995U8 LLVOPart::iterateParticles(F32 deltaT)
996{
997 const F32 PART_SYS_UPDATE_PHYSICS_INPUTS_TIME = 0.2f; //How many seconds between querying wind force on a particle
998
999 U32 i; //, pos_off, vel_off, scale_off, alpha_off, lifetime_off, death_off, local_wind_off;
1000 F32 weightedDeathSum;
1001 U8 any_leftQ = 0;
1002
1003 F32 windWeightDT = mWindWeight*deltaT;
1004 F32 gravityWeightDT = mGravityWeight*deltaT;
1005
1006 mLastTime = mCurrTime;
1007 mCurrTime += deltaT;
1008
1009 if ((mCurrTime - mUpdatePhysicsInputsTime) > PART_SYS_UPDATE_PHYSICS_INPUTS_TIME)
1010 {
1011 // If needed, obtain latest wind for the whole system
1012 mCurrentWind = mRegionp->mWind.getVelocity(getPositionRegion());
1013 mCurrentWindMagnitude = sqrt((mCurrentWind.mV[VX] * mCurrentWind.mV[VX]) +
1014 (mCurrentWind.mV[VY] * mCurrentWind.mV[VY]) +
1015 (mCurrentWind.mV[VZ] * mCurrentWind.mV[VZ]));
1016 //don't know a max, so just make up a reasonably large value for now and cap.
1017 mCurrentWindMagnitude = mCurrentWindMagnitude * 0.05f;
1018 if (mCurrentWindMagnitude > 1.0f)
1019 {
1020 mCurrentWindMagnitude = 1.0f;
1021 }
1022 mCurrentWindMagnitudeSquareRoot = sqrtf(mCurrentWindMagnitude);
1023 }
1024
1025 //TO DO - LOD algorithm (as with display??)
1026 for(i = 0; i < mNumPart; i++)
1027 {
1028 //lifetime_off = remaining_lifetime_offset_i(i);
1029 if(0 != mDeadArr[i])
1030 {
1031 //test for spawns amongst the dead as follows
1032 if (mFlags[PART_SYS_ACTION_BYTE] & PART_SYS_SPAWN)
1033 {
1034 // **** Hack! remainingLifetime counts up from negative, to avoid subtracts! - djs
1035 //if die below and spawn flag set, set mParticleState[i].remainingLifetime to a respawn random time
1036 //based on mSpawnFrequency and mSpawnFrequencyRange
1037 //in this section, if spawn flag set, count down - deltaT. If time is negative, call Spawn method, else continue
1038 mParticleState[i].remainingLifetime += deltaT;
1039 if (mParticleState[i].remainingLifetime > 0.0f)
1040 {
1041 spawnParticle(i);
1042 }
1043 }
1044
1045 if(0 != mDeadArr[i])
1046 {
1047 continue; // stop animating dead particles -- else they might come back alive!
1048 // since we're not alive, do nothing to "any_leftQ"
1049 }
1050 }
1051
1052
1053 //New way - apply external forces to each particle and then update
1054 // position at ....
1055 mParticleState[i].position[0] += mParticleState[i].velocity[0]*deltaT; // x position
1056 mParticleState[i].position[1] += mParticleState[i].velocity[1]*deltaT; // y position
1057 mParticleState[i].position[2] += mParticleState[i].velocity[2]*deltaT; // z position
1058
1059 //then apply force if required
1060 if (mFlags[PART_SYS_ACTION_BYTE] & PART_SYS_AFFECTED_BY_WIND)
1061 {
1062 mParticleState[i].velocity[0] += mCurrentWind.mV[0]*windWeightDT;
1063 mParticleState[i].velocity[1] += mCurrentWind.mV[1]*windWeightDT;
1064 mParticleState[i].velocity[2] += mCurrentWind.mV[2]*windWeightDT;
1065 }
1066 if (mFlags[PART_SYS_ACTION_BYTE] & PART_SYS_AFFECTED_BY_GRAVITY)
1067 {
1068 mParticleState[i].velocity[0] += mCurrentGravity.mV[0]*gravityWeightDT;
1069 mParticleState[i].velocity[1] += mCurrentGravity.mV[1]*gravityWeightDT;
1070 mParticleState[i].velocity[2] += mCurrentGravity.mV[2]*gravityWeightDT;
1071 }
1072 if (mFlags[PART_SYS_ACTION_BYTE] & PART_SYS_EVALUATE_WIND_PER_PARTICLE)
1073 {
1074 if ((mCurrTime - mUpdatePhysicsInputsTime) > PART_SYS_UPDATE_PHYSICS_INPUTS_TIME)
1075 {
1076 LLVector3 wind, current_position_region;
1077 // If needed, obtain latest wind per particle
1078 //Particle positions are relative to the object center.
1079 current_position_region.setVec(getPositionRegion());
1080 current_position_region.mV[VX] += (mParticleState[i].position[0]);
1081 current_position_region.mV[VY] += (mParticleState[i].position[1]);
1082 current_position_region.mV[VZ] += (mParticleState[i].position[2]);
1083
1084 wind = mRegionp->mWind.getVelocity(current_position_region);
1085 mParticleState[i].localWind[0] = wind.mV[0];
1086 mParticleState[i].localWind[1] = wind.mV[1];
1087 mParticleState[i].localWind[2] = wind.mV[2];
1088 }
1089 mParticleState[i].velocity[0] += mParticleState[i].localWind[0]*windWeightDT;
1090 mParticleState[i].velocity[1] += mParticleState[i].localWind[1]*windWeightDT;
1091 mParticleState[i].velocity[2] += mParticleState[i].localWind[2]*windWeightDT;
1092 }
1093
1094 //then apply drag if required
1095 if (mFlags[PART_SYS_ACTION_BYTE] & PART_SYS_DAMP_MOTION)
1096 {
1097 F32 dampAmount;
1098
1099 dampAmount = (mParticleState[i].velocity[0] * mParticleState[i].velocity[0]) +
1100 (mParticleState[i].velocity[1] * mParticleState[i].velocity[1]) +
1101 (mParticleState[i].velocity[2] * mParticleState[i].velocity[2]);
1102 dampAmount = 1.0f - ((mSpeedLimitSquared - dampAmount) / mSpeedLimitSquared);
1103 if (dampAmount < 0.0f)
1104 {
1105 dampAmount = 0.0f;
1106 }
1107 else if (dampAmount > 1.0f)
1108 {
1109 dampAmount = 1.0f;
1110 }
1111
1112 //Damp prop to deltaT
1113 dampAmount = -1.f * dampAmount * mDampMotionFactor * deltaT;
1114
1115 mParticleState[i].velocity[0] += dampAmount * mParticleState[i].velocity[0];
1116 mParticleState[i].velocity[1] += dampAmount * mParticleState[i].velocity[1];
1117 mParticleState[i].velocity[2] += dampAmount * mParticleState[i].velocity[2];
1118 }
1119
1120 //check for bounces if required
1121 if (mFlags[PART_SYS_ACTION_BYTE] & PART_SYS_BOUNCE)
1122 {//Is the particle below the bounce plane??
1123 LLVector3 tempBounceTest;
1124 tempBounceTest.setVec(mParticleState[i].position[0], mParticleState[i].position[1], mParticleState[i].position[2]);
1125 tempBounceTest.mV[VZ] -= mBouncePlaneZ;
1126
1127 //This is simplistic for now
1128 if ((tempBounceTest.mV[VZ] < 0.0f) && (mParticleState[i].velocity[2] < 0.0f))
1129 {
1130 onParticleBounce(i);
1131 }
1132 }
1133
1134 //maintain the old way of updating scale and alpha
1135 // clamp scale and alpha to reasonable values
1136 // should this section of code only be called if we're *actually* animating scale and alpha?
1137 mParticleState[i].alpha[2] = mDiffEqAlpha[0] + // constant term
1138 mDiffEqAlpha[1]*mParticleState[i].alpha[0] + // zeroth derivative term
1139 mDiffEqAlpha[2]*mParticleState[i].alpha[1]; // first derivative term
1140
1141 mParticleState[i].scale[2] = mDiffEqScale[0] + // constant term
1142 mDiffEqScale[1]*mParticleState[i].scale[0] + // zeroth derivative term
1143 mDiffEqScale[2]*mParticleState[i].scale[1]; // first derivative term
1144
1145 mParticleState[i].scale[0] += mParticleState[i].scale[1]*deltaT; // scale
1146
1147 mParticleState[i].alpha[0] += mParticleState[i].alpha[1]*deltaT; // alpha
1148 if (mParticleState[i].scale[0] < 0.0f)
1149 {
1150 mParticleState[i].scale[0] = 0.01f;
1151 }
1152
1153 if (mParticleState[i].alpha[0] < 0.0f)
1154 {
1155 mParticleState[i].alpha[0] = 0.0f;
1156 }
1157 else if (mParticleState[i].alpha[0] > 1.0f)
1158 {
1159 mParticleState[i].alpha[0] = 1.0f;
1160 }
1161 mParticleState[i].scale[1] += mParticleState[i].scale[2]*deltaT;
1162 mParticleState[i].alpha[1] += mParticleState[i].alpha[2]*deltaT;
1163
1164 //Is particle appearance affected by wind?
1165 if (mFlags[PART_SYS_ACTION_BYTE] & PART_SYS_WIND_DIFFUSION)
1166 {
1167 F32 windMagnitude, windMagnitudeSqrt;
1168
1169 if (mFlags[PART_SYS_ACTION_BYTE] & PART_SYS_EVALUATE_WIND_PER_PARTICLE)
1170 {
1171 windMagnitude = sqrt((mParticleState[i].localWind[0] * mParticleState[i].localWind[0]) +
1172 (mParticleState[i].localWind[1] * mParticleState[i].localWind[1]) +
1173 (mParticleState[i].localWind[2] * mParticleState[i].localWind[2]));
1174 //don't know a max, so just make up a reasonably large value for now and cap.
1175 windMagnitude = windMagnitude * 0.05f;
1176 if (windMagnitude > 1.0f)
1177 {
1178 windMagnitude = 1.0f;
1179 }
1180 windMagnitudeSqrt = sqrt(mCurrentWindMagnitude);
1181 }
1182 else
1183 {
1184 windMagnitude = mCurrentWindMagnitude;
1185 windMagnitudeSqrt = mCurrentWindMagnitudeSquareRoot;
1186 }
1187
1188 //ignore alpha for now, as it is reduced by distance death and life expectancy in any case.
1189 //mParticleState[i].alpha[0] *= (1.0 - (windMagnitude * mWindDiffusionFactor.mV[VX]));
1190 //Scaling prop to sqr root. Should really be cube root, as we are dealing with a volume, but
1191 //heavy math, and sqr looks OK.
1192 mParticleState[i].scale[0] *= (1.f + (windMagnitudeSqrt * mWindDiffusionFactor.mV[VX]));
1193 }
1194
1195 // we have to store the death of the particle somewhere
1196
1197 //now test for death if life expires or hits edge of death radius (given flags enabled)
1198 //aapply alpha and scale fade proportional to proximity to death - test for death flags and produce a weighted sum
1199 //taking into account time to live and distance to death.
1200 weightedDeathSum = 1.0f;
1201
1202 if (mFlags[PART_SYS_KILL_BYTE] & PART_SYS_TIME_DEATH)
1203 {
1204 // **** Hack! remainingLifetime counts up from negative, to avoid subtracts! - djs
1205 mParticleState[i].remainingLifetime += deltaT;
1206 weightedDeathSum *= -1.f * (mParticleState[i].remainingLifetime * mOneOverIndividualLifetime);
1207 if (mParticleState[i].remainingLifetime > 0.0f)
1208 {
1209 mDeadArr[i] = 1;
1210 if (mFlags[PART_SYS_ACTION_BYTE] & PART_SYS_SPAWN)
1211 {
1212 setParticleCountdownStateWaitingDead(i);
1213 }
1214 weightedDeathSum = 0.0f;
1215 }
1216 else if (weightedDeathSum > 1.0f)
1217 {
1218 weightedDeathSum = 1.0f;
1219 }
1220 }
1221 if (mFlags[PART_SYS_KILL_BYTE] & PART_SYS_DISTANCE_DEATH)
1222 {
1223 F32 radius;
1224 radius = (mParticleState[i].position[0]*mParticleState[i].position[0] +
1225 mParticleState[i].position[1]*mParticleState[i].position[1] +
1226 mParticleState[i].position[2]*mParticleState[i].position[2]);
1227 radius = (mDistanceDeathSquared - radius) * mOneOverDistanceDeathSquared;
1228 weightedDeathSum = weightedDeathSum * radius;
1229 if (radius <= 0.0f)
1230 {
1231 mDeadArr[i] = 1;
1232 if (mFlags[PART_SYS_ACTION_BYTE] & PART_SYS_SPAWN)
1233 {
1234 setParticleCountdownStateWaitingDead(i);
1235 }
1236 weightedDeathSum = 0.0f;
1237 }
1238 else if (weightedDeathSum > 1.0f)
1239 {
1240 weightedDeathSum = 1.0f;
1241 }
1242 }
1243 if (mFlags[PART_SYS_KILL_BYTE] & PART_SYS_KILL_PLANE)
1244 {
1245 if (mParticleState[i].position[2] <= mKillPlaneZ)
1246 {
1247 llinfos << "kill plane" << llendl;
1248 mDeadArr[i] = 1;
1249 if (mFlags[PART_SYS_ACTION_BYTE] & PART_SYS_SPAWN)
1250 {
1251 setParticleCountdownStateWaitingDead(i);
1252 }
1253 weightedDeathSum = 0.0f;
1254 }
1255 }
1256 if (mFlags[PART_SYS_KILL_BYTE] & PART_SYS_GLOBAL_DIE)
1257 {
1258 weightedDeathSum = weightedDeathSum * (mGlobalLifetime / mOriginalGlobalLifetime);
1259 }
1260
1261
1262 mParticleState[i].deathOffset = weightedDeathSum;
1263
1264 any_leftQ |= (1 - mDeadArr[i]);
1265 }
1266
1267 if (mFlags[PART_SYS_ACTION_BYTE] & PART_SYS_SPAWN)
1268 {//May be just waiting for new particles to be born, with none around currently
1269 any_leftQ = TRUE;
1270 }
1271
1272
1273 if (mFlags[PART_SYS_KILL_BYTE] & PART_SYS_GLOBAL_DIE)
1274 {
1275 mGlobalLifetime -= deltaT;
1276 if (mGlobalLifetime < 0.0f)
1277 {
1278 any_leftQ = FALSE;
1279 }
1280 }
1281
1282
1283 if ((mCurrTime - mUpdatePhysicsInputsTime) > PART_SYS_UPDATE_PHYSICS_INPUTS_TIME)
1284 {//Have to execute this at end of itterate, as several independent processes rely on the test being true.
1285 mUpdatePhysicsInputsTime = mCurrTime;
1286 }
1287
1288 mNumLiveParticles = 0;
1289 for ( i = 0; i < mNumPart; i++)
1290 {
1291 if (!mDeadArr[i])
1292 {
1293 mNumLiveParticles++;
1294 }
1295 }
1296 return any_leftQ;
1297}
1298
1299void LLVOPart::reverseTranslateParticlesAndPotentiallyKill(const LLVector3 &moveBy)
1300{
1301 U32 i;//pos_off;
1302
1303 for(i = 0; i < mNumPart; i++)
1304 {
1305 if(0 == mDeadArr[i])
1306 {
1307 //pos_off = pos_offset_i(i);
1308 mParticleState[i].position[0] += moveBy.mV[VX];
1309 mParticleState[i].position[1] += moveBy.mV[VY];
1310 mParticleState[i].position[2] += moveBy.mV[VZ];
1311
1312 }
1313 }
1314}
1315
1316void LLVOPart::translateParticlesBy(const LLVector3 &moveBy)
1317{
1318 if (!(mFlags[PART_SYS_ACTION_BYTE] & PART_SYS_BOUNCE))
1319 {//Do not translate if bouncing is on, as the whole system shifts adding or subtractiong potential energy
1320
1321 //If the object moves, the particles should not, otherwise will look like a rigid structure
1322 reverseTranslateParticlesAndPotentiallyKill(moveBy);
1323
1324 mSpawnPoint.mV[VX] += moveBy.mV[VX];
1325 mSpawnPoint.mV[VY] += moveBy.mV[VY];
1326 mSpawnPoint.mV[VZ] += moveBy.mV[VZ];
1327 }
1328}
1329
1330
1331void LLVOPart::translateParticlesTo(const LLVector3 &moveTo)
1332{
1333 LLVector3 moveBy;
1334
1335 if (!(mFlags[PART_SYS_ACTION_BYTE] & PART_SYS_BOUNCE))
1336 {//Do not translate if bouncing is on, as the whole system shifts adding or subtractiong potential energy
1337
1338 //If the object moves, the particles should not, otherwise will look like a rigid structure
1339 moveBy.setVec(moveTo.mV[VX] - mSpawnPoint.mV[VX], moveTo.mV[VY] - mSpawnPoint.mV[VY], moveTo.mV[VZ] - mSpawnPoint.mV[VZ]);
1340 reverseTranslateParticlesAndPotentiallyKill(moveBy);
1341
1342 mSpawnPoint.mV[VX] = moveTo.mV[VX];
1343 mSpawnPoint.mV[VY] = moveTo.mV[VY];
1344 mSpawnPoint.mV[VZ] = moveTo.mV[VZ];
1345 }
1346}
1347
1348
1349void LLVOPart::rotateParticlesBy(const LLQuaternion &q)
1350{
1351 mOriginOrientation *= q;
1352}
1353
1354
1355void LLVOPart::rotateParticlesTo(const LLQuaternion &q)
1356{
1357 mOriginOrientation.setQuatInit(q.mQ[VX], q.mQ[VY], q.mQ[VZ], q.mQ[VW]);
1358}
diff --git a/linden/indra/newview/llvopart.h b/linden/indra/newview/llvopart.h
deleted file mode 100644
index 3f31de6..0000000
--- a/linden/indra/newview/llvopart.h
+++ /dev/null
@@ -1,281 +0,0 @@
1/**
2 * @file llvopart.h
3 * @brief Description of LLVOPart class
4 *
5 * Copyright (c) 2001-2007, Linden Research, Inc.
6 *
7 * The source code in this file ("Source Code") is provided by Linden Lab
8 * to you under the terms of the GNU General Public License, version 2.0
9 * ("GPL"), unless you have obtained a separate licensing agreement
10 * ("Other License"), formally executed by you and Linden Lab. Terms of
11 * the GPL can be found in doc/GPL-license.txt in this distribution, or
12 * online at http://secondlife.com/developers/opensource/gplv2
13 *
14 * There are special exceptions to the terms and conditions of the GPL as
15 * it is applied to this Source Code. View the full text of the exception
16 * in the file doc/FLOSS-exception.txt in this software distribution, or
17 * online at http://secondlife.com/developers/opensource/flossexception
18 *
19 * By copying, modifying or distributing this software, you acknowledge
20 * that you have read and understood your obligations described above,
21 * and agree to abide by those obligations.
22 *
23 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
24 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
25 * COMPLETENESS OR PERFORMANCE.
26 */
27
28#ifndef LL_LLVOPART_H
29#define LL_LLVOPART_H
30
31#include "llviewerobject.h"
32#include "v3math.h"
33#include "llframetimer.h"
34#include "partsyspacket.h" // for compressing / decompressing particle system data
35
36//28 September 2001 - try and make the internal structs more meaningful than a huge array of floats!
37typedef struct OneParticleData
38{
39 F32 position[3];
40 F32 velocity[3];
41 F32 acceleration[3];
42 F32 scale[3];
43 F32 alpha[3];
44 F32 remainingLifetime;
45 F32 deathOffset;
46 F32 localWind[3];
47}OneParticleData;
48
49
50
51
52
53/* viewer object for a particle system */
54const U32 PART_SYS_BYTES_OF_FLAGS = 8;
55
56class LLVOPart : public LLViewerObject
57{
58public:
59 LLVOPart(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp);
60
61 ~LLVOPart();
62
63 // Initialize data that's only inited once per class.
64 static void initClass();
65
66 /*virtual*/ BOOL isActive() const; // Whether this object needs to do an idleUpdate.
67 BOOL idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time);
68
69
70 /*virtual*/ U32 processUpdateMessage(LLMessageSystem *mesgsys,
71 void **user_data,
72 U32 block_num,
73 const EObjectUpdateType update_type,
74 LLDataPacker *dp);
75
76 /*virtual*/ void updateTextures(LLAgent &agent);
77
78 /*virtual*/ LLDrawable* createDrawable(LLPipeline *pipeline);
79 /*virtual*/ BOOL updateGeometry(LLDrawable *drawable);
80
81protected:
82 void setParticleCountdownStateWaitingDead(U32 particleNumber);
83
84 //Override these methods for new particle classes
85 void spawnParticle(const U32 particleNumber);
86 void onParticleBounce(const U32 particleNumber);
87
88 void setDefaultValues();
89
90 U8 setParticleParams(F32 bounce_b,
91 const F32 o_pos[3], const F32 o_or[3], U32 n, LLUUID image_uuid, U8 flags[PART_SYS_BYTES_OF_FLAGS]);
92
93 U8 initializeParticlesAndConstraints(U32 initialNumberOfParticles,
94 F32 diffEqAlpha[3],
95 F32 diffEqScale[3],
96 F32 scale_ranges[4],
97 F32 alpha_ranges[4],
98 F32 velocityOffset[3],
99 F32 killPlaneZ,
100 F32 killPlaneNormal[3],
101 F32 bouncePlaneZ,
102 F32 bouncePlaneNormal[3],
103 F32 spawnRange,
104 F32 spawnFrequency,
105 F32 spawnFreqencyRange,
106 F32 spawnDirection[3],
107 F32 spawnDirectionRange,
108 F32 spawnVelocity,
109 F32 spawnVelocityRange,
110 F32 speedLimit,
111 F32 windWeight,
112 F32 currentGravity[3],
113 F32 gravityWeight,
114 F32 globalLifetime,
115 F32 individualLifetime,
116 F32 individualLifetimeRange,
117 F32 alphaDecay,
118 F32 scaleDecay,
119 F32 distanceDeath,
120 F32 dampMotionFactor,
121 F32 windDiffusionFactor[3]);
122 // initializes particles randomly within these ranges
123 // scale ranges and alpha ranges contain initial conditions plus rates of change
124 // of initial conditions My naming is inconsistent (passing alpha derivatives with alpha
125 // values), but this class is wrapped by another one, and this function is called only once
126
127 U8 iterateParticles(F32 deltaT); // step by one deltaT, check for bounces and particle deaths
128
129 void reverseTranslateParticlesAndPotentiallyKill(const LLVector3 &moveBy);
130
131 void translateParticlesBy(const LLVector3 &moveBy);
132 void translateParticlesTo(const LLVector3 &moveTo);
133 void rotateParticlesBy(const LLQuaternion &q);
134 void rotateParticlesTo(const LLQuaternion &q);
135
136 ///////////////////////
137 //
138 // Legacy, "dead" methods
139 U8 setParticlesDistFadeout(F32 beginFadeout, F32 endFadeout);
140
141protected:
142 LLFrameTimer mDeathTimer;
143 U32 mNumPart; // number of particles
144 U32 mNumLiveParticles;
145 BOOL mParticlesDead; // am I dead yet? (i.e. should I keep rendering?)
146 LLPartInitData mInitSysData; // data for initializing the particle system.
147
148 U64 mTimeLastFrame;
149
150 //27 September 2001 - LLParticleSystem no longer a seperate class, as does not allow access to all object facilities
151 //the following private data and methods used to be in LLParticleSystem
152
153 F32 mCurrTime; // time value in simulator for particle system -- note: may be independent of simulator time
154 F32 mLastTime; // time last frame
155
156 //26 September - these are replaced by alpha and scale parameters below
157 //F32 mDiffEq[18]; // constants for second-order differential equation describing particle motion
158 // MDS -- july, doubled the number of constants to handle scale, alpha and rotation
159 //26 September - just use mKillPlaneZ, as the rest really confusing to set sometimes
160 //F32 mKillParameters[6]; // take a dot-product of a particle's <x,y,z,t, 1, mag^2> values
161 // with this and compare to zero to determine if its killed
162 // computational trick, only call it a "kill" when the dot product of
163 // the velocity with the first three values of this is below zero
164
165 //26 September - use mBouncePlaneZ as the parameters are interesting but hard to manipulate predictably
166 //F32 mBounceParams[5]; // same as "mKillParameters" only they determine when an object bounces
167 // this is actually for generalized bouncing, might indicate decayed bouncing, or sliding behavior
168
169 F32 mBounceBehavior; // first three are multiplied pointwise with x,y and z velocities,
170 // next three are added pointwise to x, y and z positions
171
172 F32 mAlpha; // so I can fade out the whole system
173
174 LLQuaternion mOriginOrientation; // quaternion for origin orientation
175
176 // geometry / image data for particles visual representation
177
178 //F32 *state_arr; // big array of velocity and position and acceleration
179 OneParticleData *mParticleState; // big array of velocity and position and acceleration
180 U8 *mDeadArr; // mDeadArr[i] == true if particle i is dead
181
182 U8 mFlags[PART_SYS_BYTES_OF_FLAGS]; // just copy the flags from the initialization data
183
184
185 //New structures added as of 26 September 2001
186
187 //Have to remember the states if are to spawn new particles.
188 //These are from the original implementation, but now remembered!
189 F32 mDiffEqAlpha[3];
190 F32 mDiffEqScale[3];
191 F32 mScale_range[4];
192 F32 mAlpha_range[4];
193 LLVector3 mVelocityOffset;
194
195
196 //Incorporated in mFlags[PART_SYS_ACTION_BYTE]
197 //What actions will this system perform - bit mask of flags so can perform multiple operations.
198 //PART_SYS_SPAWN,
199 //PART_SYS_BOUNCE,
200 //PART_SYS_AFFECTED_BY_WIND,
201 //PART_SYS_AFFECTED_BY_GRAVITY,
202 //PART_SYS_EVALUATE_WIND_PER_PARTICLE,
203 //PART_SYS_APPLY_FORCE
204 //PART_SYS_DAMP_MOTION
205 //are valid flags.
206
207 //Incorporated in mFlags[PART_SYS_KILL_BYTE]
208 //What actions will this system perform - bit mask of flags so can perform multiple operations.
209 //PART_SYS_KILL_PLANE,
210 //PART_SYS_GLOBAL_DIE,
211 //PART_SYS_DISTANCE_DEATH
212 //are valid flags.
213
214 F32 mKillPlaneZ;
215 //For simplicity assume the XY plane, so this sets an altitude at which to die
216 LLVector3 mKillPlaneNormal;
217 //Normal direction to the kill plane - UNIT vector
218 F32 mBouncePlaneZ;
219 //For simplicity assume the XY plane, so this sets an altitude at which to bounce
220 LLVector3 mBouncePlaneNormal;
221 //Normal direction to the bounce plane - UNIT vector
222 LLVector3 mSpawnPoint;
223 //If new particles are created, this is where they come from
224 F32 mSpawnRange;
225 //Range of emission points about the mSpawnPoint
226 F32 mSpawnFrequency;
227 //Required if the system is to spawn new particles.
228 //This variable determines the time after a particle dies when it is respawned.
229 F32 mSpawnFrequencyRange;
230 //Determines the random range of time until a new particle is spawned.
231 LLVector3 mSpawnDirection;
232 //Direction vector giving the mean direction in which particles are spawned
233 F32 mSpawnDirectionRange;
234 //Direction limiting the angular range of emissions about the mean direction. 1.0f means everywhere, 0.0f means uni-directional
235 F32 mSpawnVelocity;
236 //The mean speed at which particles are emitted
237 F32 mSpawnVelocityRange;
238 //The range of speeds about the mean at which particles are emitted.
239 F32 mSpeedLimitSquared;
240 //Used to constrain particle maximum velocity (squared to minimize calcs)
241 LLVector3 mCurrentWind;
242 //Wind direction used in update calculations
243 F32 mCurrentWindMagnitude, mCurrentWindMagnitudeSquareRoot;
244 //Velocity of current wind and square root of it to save calculations
245 F32 mWindWeight;
246 //How much of an effect does wind have
247 LLVector3 mCurrentGravity;
248 //Gravity direction used in update calculations
249 F32 mGravityWeight;
250 //How much of an effect does gravity have
251 F32 mGlobalLifetime, mOriginalGlobalLifetime;
252 //If particles re-spawn, a system can exist forever.
253 //If (ActionFlags & PART_SYS_GLOBAL_DIE) is TRUE this variable is used to determine how long the system lasts.
254 F32 mIndividualLifetime;
255 //How long does each particle last if nothing else happens to it
256 F32 mOneOverIndividualLifetime;
257 //For fast reciprocals
258 F32 mIndividualLifetimeRange;
259 //Range of variation in individual lifetimes
260 F32 mAlphaDecay;
261 //By what factor does alpha decrease as the lifetime of a particle is approached.
262 F32 mScaleDecay;
263 //By what factor does scale decrease as the lifetime of a particle is approached.
264 F32 mDistanceDeathSquared;
265 //With the increased functionality, particle systems can expand to indefinite size
266 //(e.g. wind can chaotically move particles into a wide spread).
267 //To avoid particles exceeding normal object size constraints,
268 //set the PART_SYS_DISTANCE_DEATH flag, and set a distance value here, representing a radius around the spawn point.
269 //Square to reduce computation.
270 F32 mOneOverDistanceDeathSquared;
271 //For fast reciprocals
272 F32 mDampMotionFactor;
273 //How much to damp motion
274 LLVector3 mWindDiffusionFactor;
275 //How does wind affect the apearance of sprites
276
277 F32 mUpdatePhysicsInputsTime;
278 //Internal value to determine whether the time is right to update physical environmental effects
279};
280
281#endif // LL_VO_PART_H
diff --git a/linden/indra/newview/llvopartgroup.cpp b/linden/indra/newview/llvopartgroup.cpp
index 150f5cd..a51ae9c 100644
--- a/linden/indra/newview/llvopartgroup.cpp
+++ b/linden/indra/newview/llvopartgroup.cpp
@@ -29,6 +29,8 @@
29 29
30#include "llvopartgroup.h" 30#include "llvopartgroup.h"
31 31
32#include "lldrawpoolalpha.h"
33
32#include "llfasttimer.h" 34#include "llfasttimer.h"
33#include "message.h" 35#include "message.h"
34#include "v2math.h" 36#include "v2math.h"
@@ -47,7 +49,7 @@ const F32 MAX_PART_LIFETIME = 120.f;
47extern U64 gFrameTime; 49extern U64 gFrameTime;
48 50
49LLVOPartGroup::LLVOPartGroup(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp) 51LLVOPartGroup::LLVOPartGroup(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp)
50 : LLViewerObject(id, pcode, regionp), 52 : LLAlphaObject(id, pcode, regionp),
51 mViewerPartGroupp(NULL) 53 mViewerPartGroupp(NULL)
52{ 54{
53 setNumTEs(1); 55 setNumTEs(1);
@@ -61,37 +63,37 @@ LLVOPartGroup::~LLVOPartGroup()
61{ 63{
62} 64}
63 65
66
64BOOL LLVOPartGroup::isActive() const 67BOOL LLVOPartGroup::isActive() const
65{ 68{
66 return TRUE; 69 return TRUE;
67} 70}
68 71
72F32 LLVOPartGroup::getBinRadius()
73{
74 return mScale.mV[0]*2.f;
75}
76
77void LLVOPartGroup::updateSpatialExtents(LLVector3& newMin, LLVector3& newMax)
78{
79 LLVector3 pos_agent = getPositionAgent();
80 mExtents[0] = pos_agent - mScale;
81 mExtents[1] = pos_agent + mScale;
82 newMin = mExtents[0];
83 newMax = mExtents[1];
84 mDrawable->setPositionGroup(pos_agent);
85}
86
69BOOL LLVOPartGroup::idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time) 87BOOL LLVOPartGroup::idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time)
70{ 88{
71 if (gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_PARTICLES))
72 {
73 gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_VOLUME, TRUE);
74 }
75
76 // Particle groups don't need any of default idleUpdate velocity interpolation stuff.
77 //LLViewerObject::idleUpdate(agent, world, time);
78 return TRUE; 89 return TRUE;
79} 90}
80 91
81
82void LLVOPartGroup::setPixelAreaAndAngle(LLAgent &agent) 92void LLVOPartGroup::setPixelAreaAndAngle(LLAgent &agent)
83{ 93{
84 // mPixelArea is calculated during render 94 // mPixelArea is calculated during render
85
86 LLVector3 viewer_pos_agent = agent.getCameraPositionAgent();
87 LLVector3 pos_agent = getRenderPosition();
88
89 F32 dx = viewer_pos_agent.mV[VX] - pos_agent.mV[VX];
90 F32 dy = viewer_pos_agent.mV[VY] - pos_agent.mV[VY];
91 F32 dz = viewer_pos_agent.mV[VZ] - pos_agent.mV[VZ];
92
93 F32 mid_scale = getMidScale(); 95 F32 mid_scale = getMidScale();
94 F32 range = sqrt(dx*dx + dy*dy + dz*dz); 96 F32 range = (getRenderPosition()-gCamera->getOrigin()).magVec();
95 97
96 if (range < 0.001f || isHUDAttachment()) // range == zero 98 if (range < 0.001f || isHUDAttachment()) // range == zero
97 { 99 {
@@ -105,7 +107,7 @@ void LLVOPartGroup::setPixelAreaAndAngle(LLAgent &agent)
105 107
106void LLVOPartGroup::updateTextures(LLAgent &agent) 108void LLVOPartGroup::updateTextures(LLAgent &agent)
107{ 109{
108 // Texture stats for particles will need to be updated in a different way... 110 // Texture stats for particles need to be updated in a different way...
109} 111}
110 112
111 113
@@ -114,37 +116,45 @@ LLDrawable* LLVOPartGroup::createDrawable(LLPipeline *pipeline)
114 pipeline->allocDrawable(this); 116 pipeline->allocDrawable(this);
115 mDrawable->setLit(FALSE); 117 mDrawable->setLit(FALSE);
116 mDrawable->setRenderType(LLPipeline::RENDER_TYPE_PARTICLES); 118 mDrawable->setRenderType(LLPipeline::RENDER_TYPE_PARTICLES);
117
118 LLDrawPool *pool = gPipeline.getPool(LLDrawPool::POOL_ALPHA);
119 mDrawable->setNumFaces(mViewerPartGroupp->getCount(), pool, getTEImage(0));
120 return mDrawable; 119 return mDrawable;
121} 120}
122 121
123 const F32 MAX_PARTICLE_AREA_SCALE = 0.02f; // some tuned constant, limits on how much particle area to draw 122 const F32 MAX_PARTICLE_AREA_SCALE = 0.02f; // some tuned constant, limits on how much particle area to draw
124 123
125BOOL LLVOPartGroup::updateGeometry(LLDrawable *drawable) 124F32 LLVOPartGroup::getPartSize(S32 idx)
126{ 125{
127 LLFastTimer t(LLFastTimer::FTM_UPDATE_PARTICLES); 126 if (idx < (S32) mViewerPartGroupp->mParticles.size())
128 127 {
129 LLVector3 at; 128 return mViewerPartGroupp->mParticles[idx]->mScale.mV[0];
130 LLVector3 up; 129 }
131 LLVector3 right; 130
132 LLVector3 position_agent; 131 return 0.f;
133 LLVector3 camera_agent = gAgent.getCameraPositionAgent(); 132}
134 LLVector2 uvs[4];
135 133
136 uvs[0].setVec(0.f, 1.f); 134BOOL LLVOPartGroup::updateGeometry(LLDrawable *drawable)
137 uvs[1].setVec(0.f, 0.f); 135{
138 uvs[2].setVec(1.f, 1.f); 136 LLFastTimer ftm(LLFastTimer::FTM_UPDATE_PARTICLES);
139 uvs[3].setVec(1.f, 0.f);
140 137
141 LLDrawPool *drawpool = gPipeline.getPool(LLDrawPool::POOL_ALPHA); 138 LLVector3 at;
139 LLVector3 position_agent;
140 LLVector3 camera_agent = gCamera->getOrigin();
141
142 S32 num_parts = mViewerPartGroupp->getCount(); 142 S32 num_parts = mViewerPartGroupp->getCount();
143 LLFace *facep; 143 LLFace *facep;
144 144 LLSpatialGroup* group = drawable->getSpatialGroup();
145 if (!group && num_parts)
146 {
147 drawable->movePartition();
148 group = drawable->getSpatialGroup();
149 }
150
145 if (!num_parts) 151 if (!num_parts)
146 { 152 {
147 drawable->setNumFaces(0, drawpool, getTEImage(0)); 153 if (drawable->getNumFaces())
154 {
155 group->dirtyGeom();
156 }
157 drawable->setNumFaces(0, NULL, getTEImage(0));
148 LLPipeline::sCompiles++; 158 LLPipeline::sCompiles++;
149 return TRUE; 159 return TRUE;
150 } 160 }
@@ -154,30 +164,30 @@ BOOL LLVOPartGroup::updateGeometry(LLDrawable *drawable)
154 return TRUE; 164 return TRUE;
155 } 165 }
156 166
157// drawable->setNumFaces(num_parts, drawpool, getTEImage(0)); 167 if (num_parts > drawable->getNumFaces())
158 drawable->setNumFacesFast(num_parts, drawpool, getTEImage(0)); 168 {
159 169 drawable->setNumFacesFast(num_parts+num_parts/4, NULL, getTEImage(0));
160 LLVector3 normal(-gCamera->getXAxis()); // make point agent face camera 170 }
161
162 LLStrider<LLVector3> verticesp;
163 LLStrider<LLVector3> normalsp;
164 LLStrider<LLVector2> texCoordsp;
165 U32 *indicesp = 0;
166 171
167 S32 vert_offset;
168 F32 tot_area = 0; 172 F32 tot_area = 0;
173 BOOL is_particle = isParticle();
174
169 F32 max_area = LLViewerPartSim::getMaxPartCount() * MAX_PARTICLE_AREA_SCALE; 175 F32 max_area = LLViewerPartSim::getMaxPartCount() * MAX_PARTICLE_AREA_SCALE;
170 176 F32 pixel_meter_ratio = gCamera->getPixelMeterRatio();
177 pixel_meter_ratio *= pixel_meter_ratio;
178
171 S32 count=0; 179 S32 count=0;
172 for (S32 i = 0; i < num_parts; i++) 180 S32 i;
181 F32 max_width = 0.f;
182 mDepth = 0.f;
183
184 for (i = 0; i < num_parts; i++)
173 { 185 {
174 const LLViewerPart &part = mViewerPartGroupp->mParticles[i]; 186 const LLViewerPart &part = *((LLViewerPart*) mViewerPartGroupp->mParticles[i]);
175 187
176 LLVector3 part_pos_agent(part.mPosAgent); 188 LLVector3 part_pos_agent(part.mPosAgent);
177 at = part_pos_agent - camera_agent; 189 at = part_pos_agent - camera_agent;
178 190
179 //F32 invcamdist = 1.0f / at.magVec();
180 //area += (part.mScale.mV[0]*invcamdist)*(part.mScale.mV[1]*invcamdist);
181 F32 camera_dist_squared = at.magVecSquared(); 191 F32 camera_dist_squared = at.magVecSquared();
182 F32 inv_camera_dist_squared; 192 F32 inv_camera_dist_squared;
183 if (camera_dist_squared > 1.f) 193 if (camera_dist_squared > 1.f)
@@ -186,29 +196,124 @@ BOOL LLVOPartGroup::updateGeometry(LLDrawable *drawable)
186 inv_camera_dist_squared = 1.f; 196 inv_camera_dist_squared = 1.f;
187 F32 area = part.mScale.mV[0] * part.mScale.mV[1] * inv_camera_dist_squared; 197 F32 area = part.mScale.mV[0] * part.mScale.mV[1] * inv_camera_dist_squared;
188 tot_area += area; 198 tot_area += area;
189 if (tot_area > max_area) 199
200 if (!is_particle && tot_area > max_area)
190 { 201 {
191 break; 202 break;
192 } 203 }
193 204
194 count++; 205 count++;
195 206
196 facep = drawable->getFace(i); 207 facep = drawable->getFace(i);
208 facep->setTEOffset(i);
197 const F32 NEAR_PART_DIST_SQ = 5.f*5.f; // Only discard particles > 5 m from the camera 209 const F32 NEAR_PART_DIST_SQ = 5.f*5.f; // Only discard particles > 5 m from the camera
198 const F32 MIN_PART_AREA = .005f*.005f; // only less than 5 mm x 5 mm at 1 m from camera 210 const F32 MIN_PART_AREA = .005f*.005f; // only less than 5 mm x 5 mm at 1 m from camera
199 if (camera_dist_squared > NEAR_PART_DIST_SQ && area < MIN_PART_AREA) 211
212 if (!is_particle)
200 { 213 {
201 facep->setSize(0, 0); 214 if (camera_dist_squared > NEAR_PART_DIST_SQ && area < MIN_PART_AREA)
202 continue; 215 {
216 facep->setSize(0, 0);
217 continue;
218 }
219
220 facep->setSize(4, 6);
221 }
222 else
223 {
224 facep->setSize(1,1);
225 }
226
227 facep->setViewerObject(this);
228
229 if (part.mFlags & LLPartData::LL_PART_EMISSIVE_MASK)
230 {
231 facep->setState(LLFace::FULLBRIGHT);
203 } 232 }
204 facep->setSize(4, 6); 233 else
205 facep->mCenterAgent = part_pos_agent;
206 vert_offset = facep->getGeometry(verticesp,normalsp,texCoordsp, indicesp);
207 if (-1 == vert_offset)
208 { 234 {
209 return TRUE; 235 facep->clearState(LLFace::FULLBRIGHT);
210 } 236 }
237
238 facep->mCenterLocal = part.mPosAgent;
239 facep->setFaceColor(part.mColor);
240 facep->setTexture(part.mImagep);
211 241
242 if (i == 0)
243 {
244 mExtents[0] = mExtents[1] = part.mPosAgent;
245 }
246 else
247 {
248 update_min_max(mExtents[0], mExtents[1], part.mPosAgent);
249 }
250
251 max_width = llmax(max_width, part.mScale.mV[0]);
252 max_width = llmax(max_width, part.mScale.mV[1]);
253
254 mPixelArea = tot_area * pixel_meter_ratio;
255 const F32 area_scale = 10.f; // scale area to increase priority a bit
256 facep->setVirtualSize(mPixelArea*area_scale);
257 }
258 for (i = count; i < drawable->getNumFaces(); i++)
259 {
260 LLFace* facep = drawable->getFace(i);
261 facep->setTEOffset(i);
262 facep->setSize(0,0);
263 }
264
265 LLVector3 y = gCamera->mYAxis;
266 LLVector3 z = gCamera->mZAxis;
267
268 LLVector3 pad;
269 for (i = 0; i < 3; i++)
270 {
271 pad.mV[i] = llmax(max_width, max_width * (fabsf(y.mV[i]) + fabsf(z.mV[i])));
272 }
273
274 mExtents[0] -= pad;
275 mExtents[1] += pad;
276
277 mDrawable->movePartition();
278 LLPipeline::sCompiles++;
279 return TRUE;
280}
281
282void LLVOPartGroup::getGeometry(S32 idx,
283 LLStrider<LLVector3>& verticesp,
284 LLStrider<LLVector3>& normalsp,
285 LLStrider<LLVector2>& texcoordsp,
286 LLStrider<LLColor4U>& colorsp,
287 LLStrider<U32>& indicesp)
288{
289 if (idx >= (S32) mViewerPartGroupp->mParticles.size())
290 {
291 return;
292 }
293
294 const LLViewerPart &part = *((LLViewerPart*) (mViewerPartGroupp->mParticles[idx]));
295
296 U32 vert_offset = mDrawable->getFace(idx)->getGeomIndex();
297
298 if (isParticle())
299 {
300 LLVector3 part_pos_agent(part.mPosAgent);
301
302 const LLVector3& normal = -gCamera->getXAxis();
303
304 *verticesp++ = part_pos_agent;
305 *normalsp++ = normal;
306 *colorsp++ = part.mColor;
307 *texcoordsp++ = LLVector2(0.5f, 0.5f);
308 *indicesp++ = vert_offset;
309 }
310 else
311 {
312 LLVector3 part_pos_agent(part.mPosAgent);
313 LLVector3 camera_agent = gAgent.getCameraPositionAgent();
314 LLVector3 at = part_pos_agent - camera_agent;
315 LLVector3 up, right;
316
212 right = at % LLVector3(0.f, 0.f, 1.f); 317 right = at % LLVector3(0.f, 0.f, 1.f);
213 right.normVec(); 318 right.normVec();
214 up = right % at; 319 up = right % at;
@@ -236,31 +341,28 @@ BOOL LLVOPartGroup::updateGeometry(LLDrawable *drawable)
236 right *= 0.5f*part.mScale.mV[0]; 341 right *= 0.5f*part.mScale.mV[0];
237 up *= 0.5f*part.mScale.mV[1]; 342 up *= 0.5f*part.mScale.mV[1];
238 343
344 const LLVector3& normal = -gCamera->getXAxis();
345
239 *verticesp++ = part_pos_agent + up - right; 346 *verticesp++ = part_pos_agent + up - right;
240 *verticesp++ = part_pos_agent - up - right; 347 *verticesp++ = part_pos_agent - up - right;
241 *verticesp++ = part_pos_agent + up + right; 348 *verticesp++ = part_pos_agent + up + right;
242 *verticesp++ = part_pos_agent - up + right; 349 *verticesp++ = part_pos_agent - up + right;
243 350
244 *texCoordsp++ = uvs[0]; 351 *colorsp++ = part.mColor;
245 *texCoordsp++ = uvs[1]; 352 *colorsp++ = part.mColor;
246 *texCoordsp++ = uvs[2]; 353 *colorsp++ = part.mColor;
247 *texCoordsp++ = uvs[3]; 354 *colorsp++ = part.mColor;
355
356 *texcoordsp++ = LLVector2(0.f, 1.f);
357 *texcoordsp++ = LLVector2(0.f, 0.f);
358 *texcoordsp++ = LLVector2(1.f, 1.f);
359 *texcoordsp++ = LLVector2(1.f, 0.f);
248 360
249 *normalsp++ = normal; 361 *normalsp++ = normal;
250 *normalsp++ = normal; 362 *normalsp++ = normal;
251 *normalsp++ = normal; 363 *normalsp++ = normal;
252 *normalsp++ = normal; 364 *normalsp++ = normal;
253 365
254 if (part.mFlags & LLPartData::LL_PART_EMISSIVE_MASK)
255 {
256 facep->setState(LLFace::FULLBRIGHT);
257 }
258 else
259 {
260 facep->clearState(LLFace::FULLBRIGHT);
261 }
262 facep->setFaceColor(part.mColor);
263
264 *indicesp++ = vert_offset + 0; 366 *indicesp++ = vert_offset + 0;
265 *indicesp++ = vert_offset + 1; 367 *indicesp++ = vert_offset + 1;
266 *indicesp++ = vert_offset + 2; 368 *indicesp++ = vert_offset + 2;
@@ -269,17 +371,149 @@ BOOL LLVOPartGroup::updateGeometry(LLDrawable *drawable)
269 *indicesp++ = vert_offset + 3; 371 *indicesp++ = vert_offset + 3;
270 *indicesp++ = vert_offset + 2; 372 *indicesp++ = vert_offset + 2;
271 } 373 }
272 for (S32 j = count; j < drawable->getNumFaces(); j++) 374}
375
376BOOL LLVOPartGroup::isParticle()
377{
378 return FALSE; //gGLManager.mHasPointParameters && mViewerPartGroupp->mUniformParticles;
379}
380
381U32 LLVOPartGroup::getPartitionType() const
382{
383 return LLPipeline::PARTITION_PARTICLE;
384}
385
386LLParticlePartition::LLParticlePartition()
387: LLSpatialPartition(LLDrawPoolAlpha::VERTEX_DATA_MASK)
388{
389 mRenderPass = LLRenderPass::PASS_ALPHA;
390 mDrawableType = LLPipeline::RENDER_TYPE_PARTICLES;
391 mPartitionType = LLPipeline::PARTITION_PARTICLE;
392 mBufferUsage = GL_DYNAMIC_DRAW_ARB;
393 mSlopRatio = 0.f;
394 mLODPeriod = 1;
395}
396
397void LLParticlePartition::addGeometryCount(LLSpatialGroup* group, U32& vertex_count, U32& index_count)
398{
399 group->mBufferUsage = mBufferUsage;
400
401 mFaceList.clear();
402
403 for (LLSpatialGroup::element_iter i = group->getData().begin(); i != group->getData().end(); ++i)
273 { 404 {
274 drawable->getFace(j)->setSize(0,0); 405 LLDrawable* drawablep = *i;
406
407 if (drawablep->isDead())
408 {
409 continue;
410 }
411
412 LLAlphaObject* obj = (LLAlphaObject*) drawablep->getVObj();
413 obj->mDepth = 0.f;
414
415 if (drawablep->isAnimating())
416 {
417 group->mBufferUsage = GL_STREAM_DRAW_ARB;
418 }
419
420 U32 count = 0;
421 for (S32 j = 0; j < drawablep->getNumFaces(); ++j)
422 {
423 drawablep->updateFaceSize(j);
424
425 LLFace* facep = drawablep->getFace(j);
426 if (!facep->hasGeometry())
427 {
428 continue;
429 }
430
431 count++;
432 facep->mDistance = (facep->mCenterLocal - gCamera->getOrigin()) * gCamera->getAtAxis();
433 obj->mDepth += facep->mDistance;
434
435 mFaceList.push_back(facep);
436 vertex_count += facep->getGeomCount();
437 index_count += facep->getIndicesCount();
438 }
439
440 obj->mDepth /= count;
275 } 441 }
276 442}
277 mPixelArea = tot_area * gCamera->getPixelMeterRatio() * gCamera->getPixelMeterRatio();
278 const F32 area_scale = 10.f; // scale area to increase priority a bit
279 getTEImage(0)->addTextureStats(mPixelArea * area_scale);
280 443
281 LLPipeline::sCompiles++; 444void LLParticlePartition::getGeometry(LLSpatialGroup* group)
445{
446 LLMemType mt(LLMemType::MTYPE_SPACE_PARTITION);
282 447
283 return TRUE; 448 std::sort(mFaceList.begin(), mFaceList.end(), LLFace::CompareDistanceGreater());
449
450 U32 index_count = 0;
451 U32 vertex_count = 0;
452
453 group->clearDrawMap();
454
455 LLVertexBuffer* buffer = group->mVertexBuffer;
456
457 LLStrider<U32> indicesp;
458 LLStrider<LLVector3> verticesp;
459 LLStrider<LLVector3> normalsp;
460 LLStrider<LLVector2> texcoordsp;
461 LLStrider<LLColor4U> colorsp;
462
463 buffer->getVertexStrider(verticesp);
464 buffer->getNormalStrider(normalsp);
465 buffer->getColorStrider(colorsp);
466 buffer->getTexCoordStrider(texcoordsp);
467 buffer->getIndexStrider(indicesp);
468
469 std::vector<LLDrawInfo*>& draw_vec = group->mDrawMap[mRenderPass];
470
471 for (std::vector<LLFace*>::iterator i = mFaceList.begin(); i != mFaceList.end(); ++i)
472 {
473 LLFace* facep = *i;
474 LLAlphaObject* object = (LLAlphaObject*) facep->getViewerObject();
475 facep->setGeomIndex(vertex_count);
476 facep->setIndicesIndex(index_count);
477 facep->mVertexBuffer = buffer;
478 facep->setPoolType(LLDrawPool::POOL_ALPHA);
479 object->getGeometry(facep->getTEOffset(), verticesp, normalsp, texcoordsp, colorsp, indicesp);
480
481 vertex_count += facep->getGeomCount();
482 index_count += facep->getIndicesCount();
483
484 S32 idx = draw_vec.size()-1;
485
486 BOOL fullbright = facep->isState(LLFace::FULLBRIGHT);
487 F32 vsize = facep->getVirtualSize();
488
489 if (idx >= 0 && draw_vec[idx]->mEnd == facep->getGeomIndex()-1 &&
490 draw_vec[idx]->mTexture == facep->getTexture() &&
491 draw_vec[idx]->mEnd - draw_vec[idx]->mStart + facep->getGeomCount() <= (U32) gGLManager.mGLMaxVertexRange &&
492 draw_vec[idx]->mCount + facep->getIndicesCount() <= (U32) gGLManager.mGLMaxIndexRange &&
493 draw_vec[idx]->mEnd - draw_vec[idx]->mStart + facep->getGeomCount() < 4096 &&
494 draw_vec[idx]->mFullbright == fullbright)
495 {
496 draw_vec[idx]->mCount += facep->getIndicesCount();
497 draw_vec[idx]->mEnd += facep->getGeomCount();
498 draw_vec[idx]->mVSize = llmax(draw_vec[idx]->mVSize, vsize);
499 }
500 else
501 {
502 U32 start = facep->getGeomIndex();
503 U32 end = start + facep->getGeomCount()-1;
504 U32 offset = facep->getIndicesStart();
505 U32 count = facep->getIndicesCount();
506 LLDrawInfo* info = new LLDrawInfo(start,end,count,offset,facep->getTexture(), buffer, fullbright);
507 info->mVSize = vsize;
508 draw_vec.push_back(info);
509 }
510 }
511
512 mFaceList.clear();
513}
514
515F32 LLParticlePartition::calcPixelArea(LLSpatialGroup* group, LLCamera& camera)
516{
517 return 1024.f;
284} 518}
285 519
diff --git a/linden/indra/newview/llvopartgroup.h b/linden/indra/newview/llvopartgroup.h
index fc6c1f3..3dc07c0 100644
--- a/linden/indra/newview/llvopartgroup.h
+++ b/linden/indra/newview/llvopartgroup.h
@@ -35,26 +35,50 @@
35 35
36class LLViewerPartGroup; 36class LLViewerPartGroup;
37 37
38class LLVOPartGroup : public LLViewerObject 38class LLVOPartGroup : public LLAlphaObject
39{ 39{
40public: 40public:
41 enum
42 {
43 VERTEX_DATA_MASK = (1 << LLVertexBuffer::TYPE_VERTEX) |
44 (1 << LLVertexBuffer::TYPE_NORMAL) |
45 (1 << LLVertexBuffer::TYPE_TEXCOORD) |
46 (1 << LLVertexBuffer::TYPE_COLOR)
47 }
48 eVertexDataMask;
49
41 LLVOPartGroup(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp); 50 LLVOPartGroup(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp);
42 51
43 ~LLVOPartGroup(); 52 ~LLVOPartGroup();
44 53
45 /*virtual*/ BOOL isActive() const; // Whether this object needs to do an idleUpdate. 54 /*virtual*/ BOOL isActive() const; // Whether this object needs to do an idleUpdate.
46 BOOL idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time); 55 BOOL idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time);
56 BOOL isParticle();
47 57
58 virtual F32 getBinRadius();
59 virtual void updateSpatialExtents(LLVector3& newMin, LLVector3& newMax);
60 virtual U32 getPartitionType() const;
61
48 /*virtual*/ void setPixelAreaAndAngle(LLAgent &agent); 62 /*virtual*/ void setPixelAreaAndAngle(LLAgent &agent);
49 /*virtual*/ void updateTextures(LLAgent &agent); 63 /*virtual*/ void updateTextures(LLAgent &agent);
50 64
51 /*virtual*/ LLDrawable* createDrawable(LLPipeline *pipeline); 65 /*virtual*/ LLDrawable* createDrawable(LLPipeline *pipeline);
52 /*virtual*/ BOOL updateGeometry(LLDrawable *drawable); 66 /*virtual*/ BOOL updateGeometry(LLDrawable *drawable);
67 void getGeometry(S32 idx,
68 LLStrider<LLVector3>& verticesp,
69 LLStrider<LLVector3>& normalsp,
70 LLStrider<LLVector2>& texcoordsp,
71 LLStrider<LLColor4U>& colorsp,
72 LLStrider<U32>& indicesp);
53 73
74 void updateFaceSize(S32 idx) { }
75 F32 getPartSize(S32 idx);
54 void setViewerPartGroup(LLViewerPartGroup *part_groupp) { mViewerPartGroupp = part_groupp; } 76 void setViewerPartGroup(LLViewerPartGroup *part_groupp) { mViewerPartGroupp = part_groupp; }
77 LLViewerPartGroup* getViewerPartGroup() { return mViewerPartGroupp; }
78
55protected: 79protected:
56 LLViewerPartGroup *mViewerPartGroupp; 80 LLViewerPartGroup *mViewerPartGroupp;
57 81 LLVector3 mExtents[2];
58 LLColor4 mDebugColor; 82 LLColor4 mDebugColor;
59}; 83};
60 84
diff --git a/linden/indra/newview/llvosky.cpp b/linden/indra/newview/llvosky.cpp
index 559e846..4ed5353 100644
--- a/linden/indra/newview/llvosky.cpp
+++ b/linden/indra/newview/llvosky.cpp
@@ -440,7 +440,7 @@ void LLSkyTex::initEmpty(const S32 tex)
440 } 440 }
441 } 441 }
442 442
443 createTexture(tex); 443 createGLImage(tex);
444} 444}
445 445
446 446
@@ -467,10 +467,10 @@ void LLSkyTex::create(const F32 brightness_scale, const LLColor3& multiscatt)
467 *pix = temp1.mAll; 467 *pix = temp1.mAll;
468 } 468 }
469 } 469 }
470 createTexture(sCurrent); 470 createGLImage(sCurrent);
471} 471}
472 472
473void LLSkyTex::createTexture(S32 which) 473void LLSkyTex::createGLImage(S32 which)
474{ 474{
475 mImageGL[which]->createGLTexture(0, mImageRaw[which]); 475 mImageGL[which]->createGLTexture(0, mImageRaw[which]);
476 mImageGL[which]->setClamp(TRUE, TRUE); 476 mImageGL[which]->setClamp(TRUE, TRUE);
@@ -494,7 +494,7 @@ S32 LLVOSky::sTileResX = sResolution/NUM_TILES_X;
494S32 LLVOSky::sTileResY = sResolution/NUM_TILES_Y; 494S32 LLVOSky::sTileResY = sResolution/NUM_TILES_Y;
495 495
496LLVOSky::LLVOSky(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp) 496LLVOSky::LLVOSky(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp)
497: LLViewerObject(id, pcode, regionp), 497: LLStaticViewerObject(id, pcode, regionp),
498 mSun(SUN_DISK_RADIUS), mMoon(MOON_DISK_RADIUS), 498 mSun(SUN_DISK_RADIUS), mMoon(MOON_DISK_RADIUS),
499 mBrightnessScale(1.f), 499 mBrightnessScale(1.f),
500 mBrightnessScaleNew(0.f), 500 mBrightnessScaleNew(0.f),
@@ -1054,11 +1054,9 @@ void LLVOSky::calcBrightnessScaleAndColors()
1054 } 1054 }
1055 1055
1056 calculateColors(); // MSMSM Moved this down here per Milo Lindens suggestion, to fix orange flashing bug at sunset. 1056 calculateColors(); // MSMSM Moved this down here per Milo Lindens suggestion, to fix orange flashing bug at sunset.
1057 generateScatterMap();
1058} 1057}
1059 1058
1060 1059
1061
1062void LLVOSky::calculateColors() 1060void LLVOSky::calculateColors()
1063{ 1061{
1064 const F32 h = -0.1f; 1062 const F32 h = -0.1f;
@@ -1068,14 +1066,13 @@ void LLVOSky::calculateColors()
1068 F32 sun_factor = 1; 1066 F32 sun_factor = 1;
1069 1067
1070 // Sun Diffuse 1068 // Sun Diffuse
1071 if (calcHitsEarth(mCameraPosAgent, tosun) < 0) 1069 F32 sun_height = tosun.mV[2];
1072 { 1070
1073 mSunDiffuse = mBrightnessScaleGuess * mSun.getIntensity() * mTransp.calcTransp(tosun.mV[2], h); 1071 if (sun_height <= 0.0)
1074 } 1072 sun_height = 0.0;
1075 else 1073
1076 { 1074 mSunDiffuse = mBrightnessScaleGuess * mSun.getIntensity() * mTransp.calcTransp(sun_height, h);
1077 mSunDiffuse = mBrightnessScaleGuess * mSun.getIntensity() * mTransp.calcTransp(0, h); 1075
1078 }
1079 mSunDiffuse = 1.0f * color_norm(mSunDiffuse); 1076 mSunDiffuse = 1.0f * color_norm(mSunDiffuse);
1080 1077
1081 // Sun Ambient 1078 // Sun Ambient
@@ -1188,8 +1185,6 @@ BOOL LLVOSky::updateSky()
1188 return TRUE; 1185 return TRUE;
1189 } 1186 }
1190 1187
1191 setPositionAgent(gAgent.getCameraPositionAgent());
1192
1193 static S32 next_frame = 0; 1188 static S32 next_frame = 0;
1194 const S32 total_no_tiles = 6 * NUM_TILES; 1189 const S32 total_no_tiles = 6 * NUM_TILES;
1195 const S32 cycle_frame_no = total_no_tiles + 1; 1190 const S32 cycle_frame_no = total_no_tiles + 1;
@@ -1253,21 +1248,27 @@ BOOL LLVOSky::updateSky()
1253 LLImageRaw* raw1 = mSkyTex[side].getImageRaw(TRUE); 1248 LLImageRaw* raw1 = mSkyTex[side].getImageRaw(TRUE);
1254 LLImageRaw* raw2 = mSkyTex[side].getImageRaw(FALSE); 1249 LLImageRaw* raw2 = mSkyTex[side].getImageRaw(FALSE);
1255 raw2->copy(raw1); 1250 raw2->copy(raw1);
1256 mSkyTex[side].createTexture(mSkyTex[side].getWhich(FALSE)); 1251 mSkyTex[side].createGLImage(mSkyTex[side].getWhich(FALSE));
1257 } 1252 }
1258 next_frame = 0; 1253 next_frame = 0;
1259 //llSkyTex::stepCurrent(); 1254 //llSkyTex::stepCurrent();
1260 } 1255 }
1261 1256
1262 std::vector<LLPointer<LLImageRaw> > images; 1257 if (!gSavedSettings.getBOOL("RenderDynamicReflections"))
1263 for (S32 side = 0; side < 6; side++)
1264 { 1258 {
1265 images.push_back(mSkyTex[side].getImageRaw(FALSE)); 1259 std::vector<LLPointer<LLImageRaw> > images;
1260 for (S32 side = 0; side < 6; side++)
1261 {
1262 images.push_back(mSkyTex[side].getImageRaw(FALSE));
1263 }
1264 mCubeMap->init(images);
1266 } 1265 }
1267 mCubeMap->init(images);
1268 } 1266 }
1269 } 1267 }
1270 1268
1269 gPipeline.markRebuild(gSky.mVOGroundp->mDrawable, LLDrawable::REBUILD_ALL, TRUE);
1270 gPipeline.markRebuild(gSky.mVOStarsp->mDrawable, LLDrawable::REBUILD_ALL, TRUE);
1271
1271 mForceUpdate = FALSE; 1272 mForceUpdate = FALSE;
1272 } 1273 }
1273 else 1274 else
@@ -1306,7 +1307,8 @@ LLDrawable *LLVOSky::createDrawable(LLPipeline *pipeline)
1306 poolp->setSkyTex(mSkyTex); 1307 poolp->setSkyTex(mSkyTex);
1307 poolp->setSun(&mSun); 1308 poolp->setSun(&mSun);
1308 poolp->setMoon(&mMoon); 1309 poolp->setMoon(&mMoon);
1309 1310 mDrawable->setRenderType(LLPipeline::RENDER_TYPE_SKY);
1311
1310 for (S32 i = 0; i < 6; ++i) 1312 for (S32 i = 0; i < 6; ++i)
1311 { 1313 {
1312 mFace[FACE_SIDE0 + i] = mDrawable->addFace(poolp, NULL); 1314 mFace[FACE_SIDE0 + i] = mDrawable->addFace(poolp, NULL);
@@ -1316,9 +1318,6 @@ LLDrawable *LLVOSky::createDrawable(LLPipeline *pipeline)
1316 mFace[FACE_MOON] = mDrawable->addFace(poolp, mMoonTexturep); 1318 mFace[FACE_MOON] = mDrawable->addFace(poolp, mMoonTexturep);
1317 mFace[FACE_BLOOM] = mDrawable->addFace(poolp, mBloomTexturep); 1319 mFace[FACE_BLOOM] = mDrawable->addFace(poolp, mBloomTexturep);
1318 1320
1319 //mDrawable->addFace(poolp, LLViewerImage::sDefaultImagep);
1320 gPipeline.markMaterialed(mDrawable);
1321
1322 return mDrawable; 1321 return mDrawable;
1323} 1322}
1324 1323
@@ -1326,70 +1325,74 @@ BOOL LLVOSky::updateGeometry(LLDrawable *drawable)
1326{ 1325{
1327 if (mFace[FACE_REFLECTION] == NULL) 1326 if (mFace[FACE_REFLECTION] == NULL)
1328 { 1327 {
1329 mFace[FACE_REFLECTION] = drawable->addFace(gPipeline.getPool(LLDrawPool::POOL_WATER), NULL); 1328 LLDrawPoolWater *poolp = (LLDrawPoolWater*) gPipeline.getPool(LLDrawPool::POOL_WATER);
1329 mFace[FACE_REFLECTION] = drawable->addFace(poolp, NULL);
1330 } 1330 }
1331 1331
1332 mCameraPosAgent = drawable->getPositionAgent(); 1332 mCameraPosAgent = drawable->getPositionAgent();
1333 mEarthCenter.mV[0] = mCameraPosAgent.mV[0]; 1333 mEarthCenter.mV[0] = mCameraPosAgent.mV[0];
1334 mEarthCenter.mV[1] = mCameraPosAgent.mV[1]; 1334 mEarthCenter.mV[1] = mCameraPosAgent.mV[1];
1335 1335
1336
1337 LLVector3 v_agent[8]; 1336 LLVector3 v_agent[8];
1338 for (S32 i = 0; i < 8; ++i) 1337 for (S32 i = 0; i < 8; ++i)
1339 { 1338 {
1340 F32 x_sgn = (i&1) ? 1.f : -1.f; 1339 F32 x_sgn = (i&1) ? 1.f : -1.f;
1341 F32 y_sgn = (i&2) ? 1.f : -1.f; 1340 F32 y_sgn = (i&2) ? 1.f : -1.f;
1342 F32 z_sgn = (i&4) ? 1.f : -1.f; 1341 F32 z_sgn = (i&4) ? 1.f : -1.f;
1343 v_agent[i] = mCameraPosAgent + HORIZON_DIST * LLVector3(x_sgn, y_sgn, z_sgn); 1342 v_agent[i] = HORIZON_DIST*0.25f * LLVector3(x_sgn, y_sgn, z_sgn);
1344 } 1343 }
1345 1344
1346 LLStrider<LLVector3> verticesp; 1345 LLStrider<LLVector3> verticesp;
1347 LLStrider<LLVector3> normalsp; 1346 LLStrider<LLVector3> normalsp;
1348 LLStrider<LLVector2> texCoordsp; 1347 LLStrider<LLVector2> texCoordsp;
1349 U32 *indicesp; 1348 LLStrider<U32> indicesp;
1350 S32 index_offset; 1349 S32 index_offset;
1351 LLFace *face; 1350 LLFace *face;
1352 1351
1353 for (S32 side = 0; side < 6; ++side) 1352 for (S32 side = 0; side < 6; ++side)
1354 { 1353 {
1355 face = mFace[FACE_SIDE0 + side]; 1354 face = mFace[FACE_SIDE0 + side];
1356 face->setPrimType(LLTriangles); 1355
1357 face->setSize(4, 6); 1356 if (face->mVertexBuffer.isNull())
1358 index_offset = face->getGeometry(verticesp,normalsp,texCoordsp, indicesp);
1359 if (-1 == index_offset)
1360 { 1357 {
1361 return TRUE; 1358 face->setSize(4, 6);
1359 face->setGeomIndex(0);
1360 face->setIndicesIndex(0);
1361 face->mVertexBuffer = new LLVertexBuffer(LLDrawPoolSky::VERTEX_DATA_MASK, GL_STREAM_DRAW_ARB);
1362 face->mVertexBuffer->allocateBuffer(4, 6, TRUE);
1363
1364 index_offset = face->getGeometry(verticesp,normalsp,texCoordsp, indicesp);
1365
1366 S32 vtx = 0;
1367 S32 curr_bit = side >> 1; // 0/1 = Z axis, 2/3 = Y, 4/5 = X
1368 S32 side_dir = side & 1; // even - 0, odd - 1
1369 S32 i_bit = (curr_bit + 2) % 3;
1370 S32 j_bit = (i_bit + 2) % 3;
1371
1372 LLVector3 axis;
1373 axis.mV[curr_bit] = 1;
1374 face->mCenterAgent = (F32)((side_dir << 1) - 1) * axis * HORIZON_DIST;
1375
1376 vtx = side_dir << curr_bit;
1377 *(verticesp++) = v_agent[vtx];
1378 *(verticesp++) = v_agent[vtx | 1 << j_bit];
1379 *(verticesp++) = v_agent[vtx | 1 << i_bit];
1380 *(verticesp++) = v_agent[vtx | 1 << i_bit | 1 << j_bit];
1381
1382 *(texCoordsp++) = TEX00;
1383 *(texCoordsp++) = TEX01;
1384 *(texCoordsp++) = TEX10;
1385 *(texCoordsp++) = TEX11;
1386
1387 // Triangles for each side
1388 *indicesp++ = index_offset + 0;
1389 *indicesp++ = index_offset + 1;
1390 *indicesp++ = index_offset + 3;
1391
1392 *indicesp++ = index_offset + 0;
1393 *indicesp++ = index_offset + 3;
1394 *indicesp++ = index_offset + 2;
1362 } 1395 }
1363
1364 S32 vtx = 0;
1365 S32 curr_bit = side >> 1; // 0/1 = Z axis, 2/3 = Y, 4/5 = X
1366 S32 side_dir = side & 1; // even - 0, odd - 1
1367 S32 i_bit = (curr_bit + 2) % 3;
1368 S32 j_bit = (i_bit + 2) % 3;
1369
1370 LLVector3 axis;
1371 axis.mV[curr_bit] = 1;
1372 face->mCenterAgent = mCameraPosAgent + (F32)((side_dir << 1) - 1) * axis * HORIZON_DIST;
1373
1374 vtx = side_dir << curr_bit;
1375 *(verticesp++) = v_agent[vtx];
1376 *(verticesp++) = v_agent[vtx | 1 << j_bit];
1377 *(verticesp++) = v_agent[vtx | 1 << i_bit];
1378 *(verticesp++) = v_agent[vtx | 1 << i_bit | 1 << j_bit];
1379
1380 *(texCoordsp++) = TEX00;
1381 *(texCoordsp++) = TEX01;
1382 *(texCoordsp++) = TEX10;
1383 *(texCoordsp++) = TEX11;
1384
1385 // Triangles for each side
1386 *indicesp++ = index_offset + 0;
1387 *indicesp++ = index_offset + 1;
1388 *indicesp++ = index_offset + 3;
1389
1390 *indicesp++ = index_offset + 0;
1391 *indicesp++ = index_offset + 3;
1392 *indicesp++ = index_offset + 2;
1393 } 1396 }
1394 1397
1395 const LLVector3 &look_at = gCamera->getAtAxis(); 1398 const LLVector3 &look_at = gCamera->getAtAxis();
@@ -1464,7 +1467,7 @@ BOOL LLVOSky::updateHeavenlyBodyGeometry(LLDrawable *drawable, const S32 f, cons
1464 LLStrider<LLVector3> verticesp; 1467 LLStrider<LLVector3> verticesp;
1465 LLStrider<LLVector3> normalsp; 1468 LLStrider<LLVector3> normalsp;
1466 LLStrider<LLVector2> texCoordsp; 1469 LLStrider<LLVector2> texCoordsp;
1467 U32 *indicesp; 1470 LLStrider<U32> indicesp;
1468 S32 index_offset; 1471 S32 index_offset;
1469 LLFace *facep; 1472 LLFace *facep;
1470 1473
@@ -1512,8 +1515,16 @@ BOOL LLVOSky::updateHeavenlyBodyGeometry(LLDrawable *drawable, const S32 f, cons
1512 hb.setVisible(TRUE); 1515 hb.setVisible(TRUE);
1513 1516
1514 facep = mFace[f]; 1517 facep = mFace[f];
1515 facep->setPrimType(LLTriangles); 1518
1516 facep->setSize(4, 6); 1519 if (facep->mVertexBuffer.isNull())
1520 {
1521 facep->setSize(4, 6);
1522 facep->mVertexBuffer = new LLVertexBuffer(LLDrawPoolWater::VERTEX_DATA_MASK, GL_STREAM_DRAW_ARB);
1523 facep->mVertexBuffer->allocateBuffer(facep->getGeomCount(), facep->getIndicesCount(), TRUE);
1524 facep->setGeomIndex(0);
1525 facep->setIndicesIndex(0);
1526 }
1527
1517 index_offset = facep->getGeometry(verticesp,normalsp,texCoordsp, indicesp); 1528 index_offset = facep->getGeometry(verticesp,normalsp,texCoordsp, indicesp);
1518 if (-1 == index_offset) 1529 if (-1 == index_offset)
1519 { 1530 {
@@ -1642,7 +1653,7 @@ void LLVOSky::updateSunHaloGeometry(LLDrawable *drawable )
1642 LLStrider<LLVector3> verticesp; 1653 LLStrider<LLVector3> verticesp;
1643 LLStrider<LLVector3> normalsp; 1654 LLStrider<LLVector3> normalsp;
1644 LLStrider<LLVector2> texCoordsp; 1655 LLStrider<LLVector2> texCoordsp;
1645 U32 *indicesp; 1656 LLStrider<U32> indicesp;
1646 S32 index_offset; 1657 S32 index_offset;
1647 LLFace *face; 1658 LLFace *face;
1648 1659
@@ -1661,8 +1672,16 @@ void LLVOSky::updateSunHaloGeometry(LLDrawable *drawable )
1661 v_glow_corner[3] = draw_pos + right - up; 1672 v_glow_corner[3] = draw_pos + right - up;
1662 1673
1663 face = mFace[FACE_BLOOM]; 1674 face = mFace[FACE_BLOOM];
1664 face->setPrimType(LLTriangles); 1675
1665 face->setSize(4, 6); 1676 if (face->mVertexBuffer.isNull())
1677 {
1678 face->setSize(4, 6);
1679 face->setGeomIndex(0);
1680 face->setIndicesIndex(0);
1681 face->mVertexBuffer = new LLVertexBuffer(LLDrawPoolWater::VERTEX_DATA_MASK, GL_STREAM_DRAW_ARB);
1682 face->mVertexBuffer->allocateBuffer(4, 6, TRUE);
1683 }
1684
1666 index_offset = face->getGeometry(verticesp,normalsp,texCoordsp, indicesp); 1685 index_offset = face->getGeometry(verticesp,normalsp,texCoordsp, indicesp);
1667 if (-1 == index_offset) 1686 if (-1 == index_offset)
1668 { 1687 {
@@ -1896,15 +1915,23 @@ void LLVOSky::updateReflectionGeometry(LLDrawable *drawable, F32 H,
1896 dt_clip = -0.1f; 1915 dt_clip = -0.1f;
1897 } 1916 }
1898 1917
1918 LLFace *face = mFace[FACE_REFLECTION];
1919
1920 if (face->mVertexBuffer.isNull() || quads*4 != face->getGeomCount())
1921 {
1922 face->setSize(quads * 4, quads * 6);
1923 face->mVertexBuffer = new LLVertexBuffer(LLDrawPoolWater::VERTEX_DATA_MASK, GL_STREAM_DRAW_ARB);
1924 face->mVertexBuffer->allocateBuffer(face->getGeomCount(), face->getIndicesCount(), TRUE);
1925 face->setIndicesIndex(0);
1926 face->setGeomIndex(0);
1927 }
1928
1899 LLStrider<LLVector3> verticesp; 1929 LLStrider<LLVector3> verticesp;
1900 LLStrider<LLVector3> normalsp; 1930 LLStrider<LLVector3> normalsp;
1901 LLStrider<LLVector2> texCoordsp; 1931 LLStrider<LLVector2> texCoordsp;
1902 U32 *indicesp; 1932 LLStrider<U32> indicesp;
1903 S32 index_offset; 1933 S32 index_offset;
1904 LLFace *face = mFace[FACE_REFLECTION]; 1934
1905
1906 face->setPrimType(LLTriangles);
1907 face->setSize(quads * 4, quads * 6);
1908 index_offset = face->getGeometry(verticesp,normalsp,texCoordsp, indicesp); 1935 index_offset = face->getGeometry(verticesp,normalsp,texCoordsp, indicesp);
1909 if (-1 == index_offset) 1936 if (-1 == index_offset)
1910 { 1937 {
@@ -2132,16 +2159,14 @@ void LLVOSky::updateFog(const F32 distance)
2132 2159
2133 color_gamma_correct(sky_fog_color); 2160 color_gamma_correct(sky_fog_color);
2134 2161
2135 if (!(gPipeline.getVertexShaderLevel(LLPipeline::SHADER_ENVIRONMENT) > LLDrawPool::SHADER_LEVEL_SCATTERING)) 2162 render_fog_color = sky_fog_color;
2136 { 2163
2137 render_fog_color = sky_fog_color;
2138 }
2139
2140 if (camera_height > water_height) 2164 if (camera_height > water_height)
2141 { 2165 {
2142 fog_distance = mFogRatio * distance; 2166 fog_distance = mFogRatio * distance;
2143 LLColor4 fog(render_fog_color); 2167 LLColor4 fog(render_fog_color);
2144 glFogfv(GL_FOG_COLOR, fog.mV); 2168 glFogfv(GL_FOG_COLOR, fog.mV);
2169 mGLFogCol = fog;
2145 } 2170 }
2146 else 2171 else
2147 { 2172 {
@@ -2161,6 +2186,7 @@ void LLVOSky::updateFog(const F32 distance)
2161 LLColor4 fogCol = brightness * (color_frac * render_fog_color + (1.f - color_frac) * LLColor4(0.f, 0.2f, 0.3f, 1.f)); 2186 LLColor4 fogCol = brightness * (color_frac * render_fog_color + (1.f - color_frac) * LLColor4(0.f, 0.2f, 0.3f, 1.f));
2162 fogCol.setAlpha(1); 2187 fogCol.setAlpha(1);
2163 glFogfv(GL_FOG_COLOR, (F32 *) &fogCol.mV); 2188 glFogfv(GL_FOG_COLOR, (F32 *) &fogCol.mV);
2189 mGLFogCol = fogCol;
2164 } 2190 }
2165 2191
2166 mFogColor = sky_fog_color; 2192 mFogColor = sky_fog_color;
diff --git a/linden/indra/newview/llvosky.h b/linden/indra/newview/llvosky.h
index 1617c2a..0ca56dc 100644
--- a/linden/indra/newview/llvosky.h
+++ b/linden/indra/newview/llvosky.h
@@ -197,7 +197,7 @@ protected:
197 } 197 }
198 198
199 LLImageRaw* getImageRaw(BOOL curr=TRUE) { return mImageRaw[getWhich(curr)]; } 199 LLImageRaw* getImageRaw(BOOL curr=TRUE) { return mImageRaw[getWhich(curr)]; }
200 void createTexture(BOOL curr=TRUE); 200 void createGLImage(BOOL curr=TRUE);
201}; 201};
202 202
203 203
@@ -511,7 +511,7 @@ public:
511class LLCubeMap; 511class LLCubeMap;
512 512
513 513
514class LLVOSky : public LLViewerObject 514class LLVOSky : public LLStaticViewerObject
515{ 515{
516public: 516public:
517 enum 517 enum
@@ -593,6 +593,7 @@ public:
593 LLColor4 getMoonAmbientColor() const { return mMoonAmbient; } 593 LLColor4 getMoonAmbientColor() const { return mMoonAmbient; }
594 const LLColor4& getTotalAmbientColor() const { return mTotalAmbient; } 594 const LLColor4& getTotalAmbientColor() const { return mTotalAmbient; }
595 LLColor4 getFogColor() const { return mFogColor; } 595 LLColor4 getFogColor() const { return mFogColor; }
596 LLColor4 getGLFogColor() const { return mGLFogCol; }
596 597
597 LLVector3 calcUpVec(const LLVector3 &pos) const 598 LLVector3 calcUpVec(const LLVector3 &pos) const
598 { 599 {
@@ -729,6 +730,8 @@ protected:
729 F32 sInterpVal; 730 F32 sInterpVal;
730 731
731 LLColor4 mFogColor; 732 LLColor4 mFogColor;
733 LLColor4 mGLFogCol;
734
732 F32 mFogRatio; 735 F32 mFogRatio;
733 F32 mWorldScale; 736 F32 mWorldScale;
734 737
@@ -739,7 +742,7 @@ protected:
739 LLColor3 mMoonDiffuse; 742 LLColor3 mMoonDiffuse;
740 LLColor4U mFadeColor; // Color to fade in from 743 LLColor4U mFadeColor; // Color to fade in from
741 744
742 LLCubeMap *mCubeMap; // Cube map for the sky 745 LLCubeMap *mCubeMap; // Cube map for the environment
743 S32 mDrawRefl; 746 S32 mDrawRefl;
744 747
745 LLFrameTimer mUpdateTimer; 748 LLFrameTimer mUpdateTimer;
diff --git a/linden/indra/newview/llvostars.cpp b/linden/indra/newview/llvostars.cpp
index 3fd3b91..a4568ce 100644
--- a/linden/indra/newview/llvostars.cpp
+++ b/linden/indra/newview/llvostars.cpp
@@ -37,11 +37,11 @@
37#include "pipeline.h" 37#include "pipeline.h"
38 38
39const U32 NUMBER_OF_STARS = 1000; 39const U32 NUMBER_OF_STARS = 1000;
40const F32 DISTANCE_TO_STARS = HORIZON_DIST - 10.f; 40const F32 DISTANCE_TO_STARS = (HORIZON_DIST - 10.f)*0.25f;
41 41
42 42
43LLVOStars::LLVOStars(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp) 43LLVOStars::LLVOStars(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp)
44 : LLViewerObject(id, pcode, regionp) 44 : LLStaticViewerObject(id, pcode, regionp)
45{ 45{
46 initStars(); 46 initStars();
47} 47}
@@ -64,7 +64,7 @@ LLDrawable *LLVOStars::createDrawable(LLPipeline *pipeline)
64 LLDrawPoolStars *poolp = (LLDrawPoolStars*) gPipeline.getPool(LLDrawPool::POOL_STARS); 64 LLDrawPoolStars *poolp = (LLDrawPoolStars*) gPipeline.getPool(LLDrawPool::POOL_STARS);
65 65
66 mFace = mDrawable->addFace(poolp, NULL); 66 mFace = mDrawable->addFace(poolp, NULL);
67 mFace->setPrimType(GL_POINTS); 67 mDrawable->setRenderType(LLPipeline::RENDER_TYPE_STARS);
68 mFace->setSize(NUMBER_OF_STARS, NUMBER_OF_STARS); 68 mFace->setSize(NUMBER_OF_STARS, NUMBER_OF_STARS);
69 69
70 return mDrawable; 70 return mDrawable;
@@ -90,19 +90,27 @@ BOOL LLVOStars::updateStarGeometry(LLDrawable *drawable)
90 LLStrider<LLVector3> normalsp; 90 LLStrider<LLVector3> normalsp;
91 LLStrider<LLVector2> texCoordsp; 91 LLStrider<LLVector2> texCoordsp;
92 LLStrider<LLColor4U> colorsp; 92 LLStrider<LLColor4U> colorsp;
93 U32 *indicesp; 93 LLStrider<U32> indicesp;
94 S32 index_offset; 94 S32 index_offset;
95 95
96 if (mFace->mVertexBuffer.isNull())
97 {
98 mFace->mVertexBuffer = new LLVertexBuffer(LLDrawPoolStars::VERTEX_DATA_MASK, GL_STREAM_DRAW_ARB);
99 mFace->mVertexBuffer->allocateBuffer(mFace->getGeomCount(), mFace->getIndicesCount(), TRUE);
100 mFace->setGeomIndex(0);
101 mFace->setIndicesIndex(0);
102 }
103
96 index_offset = mFace->getGeometryColors(verticesp,normalsp,texCoordsp,colorsp, indicesp); 104 index_offset = mFace->getGeometryColors(verticesp,normalsp,texCoordsp,colorsp, indicesp);
97 105
98 if (-1 == index_offset) 106 if (-1 == index_offset)
99 { 107 {
100 return TRUE; 108 return TRUE;
101 } 109 }
102 LLVector3 cam_pos = gSky.mVOSkyp ? gSky.mVOSkyp->getPositionAgent() : drawable->getPositionAgent(); 110
103 for (U32 vtx = 0; vtx < NUMBER_OF_STARS; ++vtx) 111 for (U32 vtx = 0; vtx < NUMBER_OF_STARS; ++vtx)
104 { 112 {
105 *(verticesp++) = mStarVertices[vtx] + cam_pos; 113 *(verticesp++) = mStarVertices[vtx];
106 *(colorsp++) = LLColor4U(mStarColors[vtx]); 114 *(colorsp++) = LLColor4U(mStarColors[vtx]);
107 *(indicesp++) = index_offset + vtx; 115 *(indicesp++) = index_offset + vtx;
108 } 116 }
@@ -173,7 +181,7 @@ void LLVOStars::updateStarColors()
173 F32 sundir_factor = 1; 181 F32 sundir_factor = 1;
174 LLVector3 tostar = *v_p; 182 LLVector3 tostar = *v_p;
175 tostar.normVec(); 183 tostar.normVec();
176 const F32 how_close_to_sun = tostar * gSky.mVOSkyp->getToSun(); 184 const F32 how_close_to_sun = tostar * gSky.mVOSkyp->getToSunLast();
177 if (how_close_to_sun > sunclose_max) 185 if (how_close_to_sun > sunclose_max)
178 { 186 {
179 sundir_factor = (1 - how_close_to_sun) / sunclose_range; 187 sundir_factor = (1 - how_close_to_sun) / sunclose_range;
diff --git a/linden/indra/newview/llvostars.h b/linden/indra/newview/llvostars.h
index 88e792c..10b644e 100644
--- a/linden/indra/newview/llvostars.h
+++ b/linden/indra/newview/llvostars.h
@@ -35,7 +35,7 @@
35 35
36class LLFace; 36class LLFace;
37 37
38class LLVOStars : public LLViewerObject 38class LLVOStars : public LLStaticViewerObject
39{ 39{
40public: 40public:
41 LLVOStars(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp); 41 LLVOStars(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp);
diff --git a/linden/indra/newview/llvosurfacepatch.cpp b/linden/indra/newview/llvosurfacepatch.cpp
index d49d78c..88e610b 100644
--- a/linden/indra/newview/llvosurfacepatch.cpp
+++ b/linden/indra/newview/llvosurfacepatch.cpp
@@ -29,6 +29,8 @@
29 29
30#include "llvosurfacepatch.h" 30#include "llvosurfacepatch.h"
31 31
32#include "lldrawpoolterrain.h"
33
32#include "lldrawable.h" 34#include "lldrawable.h"
33#include "llface.h" 35#include "llface.h"
34#include "llprimitive.h" 36#include "llprimitive.h"
@@ -41,8 +43,52 @@
41#include "llvovolume.h" 43#include "llvovolume.h"
42#include "pipeline.h" 44#include "pipeline.h"
43 45
46//============================================================================
47
48class LLVertexBufferTerrain : public LLVertexBuffer
49{
50public:
51 LLVertexBufferTerrain() :
52 LLVertexBuffer(MAP_VERTEX | MAP_NORMAL | MAP_TEXCOORD | MAP_TEXCOORD2 | MAP_COLOR, GL_DYNAMIC_DRAW_ARB)
53 {
54 };
55
56 // virtual
57 void setupVertexBuffer(U32 data_mask) const
58 {
59 if (LLDrawPoolTerrain::getDetailMode() == 0)
60 {
61 LLVertexBuffer::setupVertexBuffer(data_mask);
62 }
63 else if (data_mask & LLVertexBuffer::MAP_TEXCOORD2)
64 {
65 U8* base = useVBOs() ? NULL : mMappedData;
66
67 glVertexPointer(3,GL_FLOAT, mStride, (void*)(base + 0));
68 glNormalPointer(GL_FLOAT, mStride, (void*)(base + mOffsets[TYPE_NORMAL]));
69 glColorPointer(4, GL_UNSIGNED_BYTE, mStride, (void*)(base + mOffsets[TYPE_COLOR]));
70
71 glClientActiveTextureARB(GL_TEXTURE3_ARB);
72 glTexCoordPointer(2,GL_FLOAT, mStride, (void*)(base + mOffsets[TYPE_TEXCOORD2]));
73 glClientActiveTextureARB(GL_TEXTURE2_ARB);
74 glTexCoordPointer(2,GL_FLOAT, mStride, (void*)(base + mOffsets[TYPE_TEXCOORD2]));
75 glClientActiveTextureARB(GL_TEXTURE1_ARB);
76 glTexCoordPointer(2,GL_FLOAT, mStride, (void*)(base + mOffsets[TYPE_TEXCOORD2]));
77 glClientActiveTextureARB(GL_TEXTURE0_ARB);
78 glTexCoordPointer(2,GL_FLOAT, mStride, (void*)(base + mOffsets[TYPE_TEXCOORD2]));
79 }
80 else
81 {
82 LLVertexBuffer::setupVertexBuffer(data_mask);
83 }
84 llglassertok();
85 }
86};
87
88//============================================================================
89
44LLVOSurfacePatch::LLVOSurfacePatch(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp) 90LLVOSurfacePatch::LLVOSurfacePatch(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp)
45: LLViewerObject(id, LL_VO_SURFACE_PATCH, regionp) 91: LLStaticViewerObject(id, LL_VO_SURFACE_PATCH, regionp)
46{ 92{
47 // Terrain must draw during selection passes so it can block objects behind it. 93 // Terrain must draw during selection passes so it can block objects behind it.
48 mbCanSelect = TRUE; 94 mbCanSelect = TRUE;
@@ -95,9 +141,9 @@ void LLVOSurfacePatch::updateTextures(LLAgent &agent)
95} 141}
96 142
97 143
98LLDrawPool *LLVOSurfacePatch::getPool() 144LLFacePool *LLVOSurfacePatch::getPool()
99{ 145{
100 mPool = gPipeline.getPool(LLDrawPool::POOL_TERRAIN, mPatchp->getSurface()->getSTexture()); 146 mPool = (LLDrawPoolTerrain*) gPipeline.getPool(LLDrawPool::POOL_TERRAIN, mPatchp->getSurface()->getSTexture());
101 147
102 return mPool; 148 return mPool;
103} 149}
@@ -125,15 +171,18 @@ LLDrawable *LLVOSurfacePatch::createDrawable(LLPipeline *pipeline)
125 range = 3; 171 range = 3;
126 } 172 }
127 173
128 LLDrawPool *poolp = getPool(); 174 LLFacePool *poolp = getPool();
129 175
130 mDrawable->addFace(poolp, NULL); 176 mDrawable->addFace(poolp, NULL);
177
131 return mDrawable; 178 return mDrawable;
132} 179}
133 180
134 181
135BOOL LLVOSurfacePatch::updateGeometry(LLDrawable *drawable) 182BOOL LLVOSurfacePatch::updateGeometry(LLDrawable *drawable)
136{ 183{
184 LLFastTimer ftm(LLFastTimer::FTM_UPDATE_TERRAIN);
185
137 S32 min_comp, max_comp, range; 186 S32 min_comp, max_comp, range;
138 min_comp = lltrunc(mPatchp->getMinComposition()); 187 min_comp = lltrunc(mPatchp->getMinComposition());
139 max_comp = lltrunc(ceil(mPatchp->getMaxComposition())); 188 max_comp = lltrunc(ceil(mPatchp->getMaxComposition()));
@@ -185,57 +234,63 @@ BOOL LLVOSurfacePatch::updateGeometry(LLDrawable *drawable)
185 east_stride = render_stride; 234 east_stride = render_stride;
186 } 235 }
187 236
237 mLastLength = length;
238 mLastStride = render_stride;
239 mLastNorthStride = north_stride;
240 mLastEastStride = east_stride;
241
242 return TRUE;
243}
244
245void LLVOSurfacePatch::updateFaceSize(S32 idx)
246{
247 if (idx != 0)
248 {
249 llwarns << "Terrain partition requested invalid face!!!" << llendl;
250 return;
251 }
252
253 LLFace* facep = mDrawable->getFace(idx);
254
188 S32 num_vertices = 0; 255 S32 num_vertices = 0;
189 S32 num_indices = 0; 256 S32 num_indices = 0;
190 S32 new_north_offset = 0; 257
191 S32 new_east_offset = 0; 258 if (mLastStride)
192
193 getGeomSizesMain(render_stride, num_vertices, num_indices);
194 new_north_offset = num_vertices;
195 getGeomSizesNorth(render_stride, north_stride, num_vertices, num_indices);
196 new_east_offset = num_vertices;
197 getGeomSizesEast(render_stride, east_stride, num_vertices, num_indices);
198 S32 new_num_vertices = num_vertices;
199 S32 new_num_indices = num_indices;
200
201 LLFace *facep = NULL;
202
203 // Update the allocated face
204 LLStrider<LLVector3> verticesp;
205 LLStrider<LLVector3> normalsp;
206 LLStrider<LLVector2> texCoords0p;
207 LLStrider<LLVector2> texCoords1p;
208 LLStrider<LLColor4U> colorsp;
209 U32* indicesp = NULL;
210 S32 index_offset;
211
212 facep = mDrawable->getFace(0);
213
214 facep->setSize(new_num_vertices, new_num_indices);
215 facep->setPrimType(LLTriangles);
216
217 index_offset = facep->getGeometryTerrain(
218 verticesp,
219 normalsp,
220 colorsp,
221 texCoords0p,
222 texCoords1p,
223 indicesp);
224 if (-1 == index_offset)
225 { 259 {
226 return TRUE; 260 getGeomSizesMain(mLastStride, num_vertices, num_indices);
261 getGeomSizesNorth(mLastStride, mLastNorthStride, num_vertices, num_indices);
262 getGeomSizesEast(mLastStride, mLastEastStride, num_vertices, num_indices);
227 } 263 }
228 264
229 mDrawable->updateLightSet(); 265 facep->setSize(num_vertices, num_indices);
266}
267
268BOOL LLVOSurfacePatch::updateLOD()
269{
270 //mDrawable->updateLightSet();
271 mDrawable->setState(LLDrawable::LIGHTING_BUILT);
272 return TRUE;
273}
274
275void LLVOSurfacePatch::getGeometry(LLStrider<LLVector3> &verticesp,
276 LLStrider<LLVector3> &normalsp,
277 LLStrider<LLColor4U> &colorsp,
278 LLStrider<LLVector2> &texCoords0p,
279 LLStrider<LLVector2> &texCoords1p,
280 LLStrider<U32> &indicesp)
281{
282 LLFace* facep = mDrawable->getFace(0);
283
284 U32 index_offset = facep->getGeomIndex();
230 285
231 updateMainGeometry(facep, 286 updateMainGeometry(facep,
232 verticesp, 287 verticesp,
233 normalsp, 288 normalsp,
234 colorsp, 289 colorsp,
235 texCoords0p, 290 texCoords0p,
236 texCoords1p, 291 texCoords1p,
237 indicesp, 292 indicesp,
238 index_offset); 293 index_offset);
239 updateNorthGeometry(facep, 294 updateNorthGeometry(facep,
240 verticesp, 295 verticesp,
241 normalsp, 296 normalsp,
@@ -252,24 +307,6 @@ BOOL LLVOSurfacePatch::updateGeometry(LLDrawable *drawable)
252 texCoords1p, 307 texCoords1p,
253 indicesp, 308 indicesp,
254 index_offset); 309 index_offset);
255
256 if (mLastLength != 0)
257 {
258 // lazy, should cache the geom sizes so we know the offsets.
259 num_vertices = 0;
260 num_indices = 0;
261
262 }
263
264 mLastLength = length;
265 mLastStride = render_stride;
266 mLastNorthStride = north_stride;
267 mLastEastStride = east_stride;
268
269 mDrawable->setState(LLDrawable::LIGHTING_BUILT);
270
271 LLPipeline::sCompiles++;
272 return TRUE;
273} 310}
274 311
275void LLVOSurfacePatch::updateMainGeometry(LLFace *facep, 312void LLVOSurfacePatch::updateMainGeometry(LLFace *facep,
@@ -278,8 +315,8 @@ void LLVOSurfacePatch::updateMainGeometry(LLFace *facep,
278 LLStrider<LLColor4U> &colorsp, 315 LLStrider<LLColor4U> &colorsp,
279 LLStrider<LLVector2> &texCoords0p, 316 LLStrider<LLVector2> &texCoords0p,
280 LLStrider<LLVector2> &texCoords1p, 317 LLStrider<LLVector2> &texCoords1p,
281 U32* &indicesp, 318 LLStrider<U32> &indicesp,
282 S32 &index_offset) 319 U32 &index_offset)
283{ 320{
284 S32 i, j, x, y; 321 S32 i, j, x, y;
285 322
@@ -287,7 +324,7 @@ void LLVOSurfacePatch::updateMainGeometry(LLFace *facep,
287 S32 num_vertices, num_indices; 324 S32 num_vertices, num_indices;
288 U32 index; 325 U32 index;
289 326
290 render_stride = mPatchp->getRenderStride(); 327 render_stride = mLastStride;
291 patch_size = mPatchp->getSurface()->getGridsPerPatchEdge(); 328 patch_size = mPatchp->getSurface()->getGridsPerPatchEdge();
292 S32 vert_size = patch_size / render_stride; 329 S32 vert_size = patch_size / render_stride;
293 330
@@ -383,29 +420,20 @@ void LLVOSurfacePatch::updateNorthGeometry(LLFace *facep,
383 LLStrider<LLColor4U> &colorsp, 420 LLStrider<LLColor4U> &colorsp,
384 LLStrider<LLVector2> &texCoords0p, 421 LLStrider<LLVector2> &texCoords0p,
385 LLStrider<LLVector2> &texCoords1p, 422 LLStrider<LLVector2> &texCoords1p,
386 U32* &indicesp, 423 LLStrider<U32> &indicesp,
387 S32 &index_offset) 424 U32 &index_offset)
388{ 425{
389 S32 vertex_count = 0; 426 S32 vertex_count = 0;
390 S32 i, x, y; 427 S32 i, x, y;
391 428
392 S32 num_vertices, num_indices; 429 S32 num_vertices, num_indices;
393 430
394 U32 render_stride = mPatchp->getRenderStride(); 431 U32 render_stride = mLastStride;
395 S32 patch_size = mPatchp->getSurface()->getGridsPerPatchEdge(); 432 S32 patch_size = mPatchp->getSurface()->getGridsPerPatchEdge();
396 S32 length = patch_size / render_stride; 433 S32 length = patch_size / render_stride;
397 S32 half_length = length / 2; 434 S32 half_length = length / 2;
398 435 U32 north_stride = mLastNorthStride;
399 U32 north_stride; 436
400 if (mPatchp->getNeighborPatch(NORTH))
401 {
402 north_stride = mPatchp->getNeighborPatch(NORTH)->getRenderStride();
403 }
404 else
405 {
406 north_stride = render_stride;
407 }
408
409 /////////////////////////// 437 ///////////////////////////
410 // 438 //
411 // Render the north strip 439 // Render the north strip
@@ -605,27 +633,19 @@ void LLVOSurfacePatch::updateEastGeometry(LLFace *facep,
605 LLStrider<LLColor4U> &colorsp, 633 LLStrider<LLColor4U> &colorsp,
606 LLStrider<LLVector2> &texCoords0p, 634 LLStrider<LLVector2> &texCoords0p,
607 LLStrider<LLVector2> &texCoords1p, 635 LLStrider<LLVector2> &texCoords1p,
608 U32* &indicesp, 636 LLStrider<U32> &indicesp,
609 S32 &index_offset) 637 U32 &index_offset)
610{ 638{
611 S32 i, x, y; 639 S32 i, x, y;
612 640
613 S32 num_vertices, num_indices; 641 S32 num_vertices, num_indices;
614 642
615 U32 render_stride = mPatchp->getRenderStride(); 643 U32 render_stride = mLastStride;
616 S32 patch_size = mPatchp->getSurface()->getGridsPerPatchEdge(); 644 S32 patch_size = mPatchp->getSurface()->getGridsPerPatchEdge();
617 S32 length = patch_size / render_stride; 645 S32 length = patch_size / render_stride;
618 S32 half_length = length / 2; 646 S32 half_length = length / 2;
619 647
620 U32 east_stride; 648 U32 east_stride = mLastEastStride;
621 if (mPatchp->getNeighborPatch(EAST))
622 {
623 east_stride = mPatchp->getNeighborPatch(EAST)->getRenderStride();
624 }
625 else
626 {
627 east_stride = render_stride;
628 }
629 649
630 // Stride lengths are the same 650 // Stride lengths are the same
631 if (east_stride == render_stride) 651 if (east_stride == render_stride)
@@ -844,10 +864,6 @@ void LLVOSurfacePatch::setPatch(LLSurfacePatch *patchp)
844 864
845void LLVOSurfacePatch::dirtyPatch() 865void LLVOSurfacePatch::dirtyPatch()
846{ 866{
847 if (mDrawable)
848 {
849 gPipeline.markMoved(mDrawable);
850 }
851 mDirtiedPatch = TRUE; 867 mDirtiedPatch = TRUE;
852 dirtyGeom(); 868 dirtyGeom();
853 mDirtyTerrain = TRUE; 869 mDirtyTerrain = TRUE;
@@ -865,6 +881,8 @@ void LLVOSurfacePatch::dirtyGeom()
865 if (mDrawable) 881 if (mDrawable)
866 { 882 {
867 gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_ALL, TRUE); 883 gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_ALL, TRUE);
884 mDrawable->getFace(0)->mVertexBuffer = NULL;
885 mDrawable->movePartition();
868 } 886 }
869} 887}
870 888
@@ -937,7 +955,67 @@ void LLVOSurfacePatch::updateSpatialExtents(LLVector3& newMin, LLVector3 &newMax
937{ 955{
938 LLVector3 posAgent = getPositionAgent(); 956 LLVector3 posAgent = getPositionAgent();
939 LLVector3 scale = getScale(); 957 LLVector3 scale = getScale();
940 newMin = posAgent-scale; 958 newMin = posAgent-scale*0.5f;
941 newMax = posAgent+scale; 959 newMax = posAgent+scale*0.5f;
942 mDrawable->setPositionGroup((newMin+newMax)*0.5f); 960 mDrawable->setPositionGroup((newMin+newMax)*0.5f);
943} 961}
962
963U32 LLVOSurfacePatch::getPartitionType() const
964{
965 return LLPipeline::PARTITION_TERRAIN;
966}
967
968LLTerrainPartition::LLTerrainPartition()
969: LLSpatialPartition(LLDrawPoolTerrain::VERTEX_DATA_MASK)
970{
971 mRenderByGroup = FALSE;
972 mBufferUsage = GL_DYNAMIC_DRAW_ARB;
973 mDrawableType = LLPipeline::RENDER_TYPE_TERRAIN;
974 mPartitionType = LLPipeline::PARTITION_TERRAIN;
975}
976
977LLVertexBuffer* LLTerrainPartition::createVertexBuffer(U32 type_mask, U32 usage)
978{
979 return new LLVertexBufferTerrain();
980}
981
982void LLTerrainPartition::getGeometry(LLSpatialGroup* group)
983{
984 LLVertexBuffer* buffer = group->mVertexBuffer;
985
986 //get vertex buffer striders
987 LLStrider<LLVector3> vertices;
988 LLStrider<LLVector3> normals;
989 LLStrider<LLVector2> texcoords2;
990 LLStrider<LLVector2> texcoords;
991 LLStrider<LLColor4U> colors;
992 LLStrider<U32> indices;
993
994 buffer->getVertexStrider(vertices);
995 buffer->getNormalStrider(normals);
996 buffer->getTexCoordStrider(texcoords);
997 buffer->getTexCoord2Strider(texcoords2);
998 buffer->getColorStrider(colors);
999 buffer->getIndexStrider(indices);
1000
1001 U32 indices_index = 0;
1002 U32 index_offset = 0;
1003
1004 for (std::vector<LLFace*>::iterator i = mFaceList.begin(); i != mFaceList.end(); ++i)
1005 {
1006 LLFace* facep = *i;
1007
1008 facep->setIndicesIndex(indices_index);
1009 facep->setGeomIndex(index_offset);
1010 facep->mVertexBuffer = buffer;
1011
1012 LLVOSurfacePatch* patchp = (LLVOSurfacePatch*) facep->getViewerObject();
1013 patchp->getGeometry(vertices, normals, colors, texcoords, texcoords2, indices);
1014
1015 indices_index += facep->getIndicesCount();
1016 index_offset += facep->getGeomCount();
1017 }
1018
1019 mFaceList.clear();
1020}
1021
diff --git a/linden/indra/newview/llvosurfacepatch.h b/linden/indra/newview/llvosurfacepatch.h
index 3549571..75d57cb 100644
--- a/linden/indra/newview/llvosurfacepatch.h
+++ b/linden/indra/newview/llvosurfacepatch.h
@@ -35,9 +35,19 @@ class LLSurfacePatch;
35class LLDrawPool; 35class LLDrawPool;
36class LLVector2; 36class LLVector2;
37 37
38class LLVOSurfacePatch : public LLViewerObject 38class LLVOSurfacePatch : public LLStaticViewerObject
39{ 39{
40public: 40public:
41 enum
42 {
43 VERTEX_DATA_MASK = (1 << LLVertexBuffer::TYPE_VERTEX) |
44 (1 << LLVertexBuffer::TYPE_NORMAL) |
45 (1 << LLVertexBuffer::TYPE_TEXCOORD) |
46 (1 << LLVertexBuffer::TYPE_TEXCOORD2) |
47 (1 << LLVertexBuffer::TYPE_COLOR)
48 }
49 eVertexDataMask;
50
41 LLVOSurfacePatch(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp); 51 LLVOSurfacePatch(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp);
42 virtual ~LLVOSurfacePatch(); 52 virtual ~LLVOSurfacePatch();
43 53
@@ -46,8 +56,18 @@ public:
46 // Initialize data that's only inited once per class. 56 // Initialize data that's only inited once per class.
47 static void initClass(); 57 static void initClass();
48 58
59 virtual U32 getPartitionType() const;
60
49 /*virtual*/ LLDrawable* createDrawable(LLPipeline *pipeline); 61 /*virtual*/ LLDrawable* createDrawable(LLPipeline *pipeline);
50 /*virtual*/ BOOL updateGeometry(LLDrawable *drawable); 62 /*virtual*/ BOOL updateGeometry(LLDrawable *drawable);
63 /*virtual*/ BOOL updateLOD();
64 /*virtual*/ void updateFaceSize(S32 idx);
65 void getGeometry(LLStrider<LLVector3> &verticesp,
66 LLStrider<LLVector3> &normalsp,
67 LLStrider<LLColor4U> &colorsp,
68 LLStrider<LLVector2> &texCoords0p,
69 LLStrider<LLVector2> &texCoords1p,
70 LLStrider<U32> &indicesp);
51 71
52 /*virtual*/ void updateTextures(LLAgent &agent); 72 /*virtual*/ void updateTextures(LLAgent &agent);
53 /*virtual*/ void setPixelAreaAndAngle(LLAgent &agent); // generate accurate apparent angle and area 73 /*virtual*/ void setPixelAreaAndAngle(LLAgent &agent); // generate accurate apparent angle and area
@@ -63,8 +83,8 @@ public:
63 83
64 BOOL mDirtiedPatch; 84 BOOL mDirtiedPatch;
65protected: 85protected:
66 LLDrawPool *mPool; 86 LLFacePool *mPool;
67 LLDrawPool *getPool(); 87 LLFacePool *getPool();
68 S32 mBaseComp; 88 S32 mBaseComp;
69 LLSurfacePatch *mPatchp; 89 LLSurfacePatch *mPatchp;
70 BOOL mDirtyTexture; 90 BOOL mDirtyTexture;
@@ -89,24 +109,24 @@ protected:
89 LLStrider<LLColor4U> &colorsp, 109 LLStrider<LLColor4U> &colorsp,
90 LLStrider<LLVector2> &texCoords0p, 110 LLStrider<LLVector2> &texCoords0p,
91 LLStrider<LLVector2> &texCoords1p, 111 LLStrider<LLVector2> &texCoords1p,
92 U32* &indicesp, 112 LLStrider<U32> &indicesp,
93 S32 &index_offset); 113 U32 &index_offset);
94 void updateNorthGeometry(LLFace *facep, 114 void updateNorthGeometry(LLFace *facep,
95 LLStrider<LLVector3> &verticesp, 115 LLStrider<LLVector3> &verticesp,
96 LLStrider<LLVector3> &normalsp, 116 LLStrider<LLVector3> &normalsp,
97 LLStrider<LLColor4U> &colorsp, 117 LLStrider<LLColor4U> &colorsp,
98 LLStrider<LLVector2> &texCoords0p, 118 LLStrider<LLVector2> &texCoords0p,
99 LLStrider<LLVector2> &texCoords1p, 119 LLStrider<LLVector2> &texCoords1p,
100 U32* &indicesp, 120 LLStrider<U32> &indicesp,
101 S32 &index_offset); 121 U32 &index_offset);
102 void updateEastGeometry(LLFace *facep, 122 void updateEastGeometry(LLFace *facep,
103 LLStrider<LLVector3> &verticesp, 123 LLStrider<LLVector3> &verticesp,
104 LLStrider<LLVector3> &normalsp, 124 LLStrider<LLVector3> &normalsp,
105 LLStrider<LLColor4U> &colorsp, 125 LLStrider<LLColor4U> &colorsp,
106 LLStrider<LLVector2> &texCoords0p, 126 LLStrider<LLVector2> &texCoords0p,
107 LLStrider<LLVector2> &texCoords1p, 127 LLStrider<LLVector2> &texCoords1p,
108 U32* &indicesp, 128 LLStrider<U32> &indicesp,
109 S32 &index_offset); 129 U32 &index_offset);
110}; 130};
111 131
112#endif // LL_VOSURFACEPATCH_H 132#endif // LL_VOSURFACEPATCH_H
diff --git a/linden/indra/newview/llvotextbubble.cpp b/linden/indra/newview/llvotextbubble.cpp
index 96ffe6b..ee0359b 100644
--- a/linden/indra/newview/llvotextbubble.cpp
+++ b/linden/indra/newview/llvotextbubble.cpp
@@ -43,7 +43,7 @@
43#include "pipeline.h" 43#include "pipeline.h"
44 44
45LLVOTextBubble::LLVOTextBubble(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp) 45LLVOTextBubble::LLVOTextBubble(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp)
46: LLViewerObject(id, pcode, regionp) 46: LLAlphaObject(id, pcode, regionp)
47{ 47{
48 setScale(LLVector3(1.5f, 1.5f, 0.25f)); 48 setScale(LLVector3(1.5f, 1.5f, 0.25f));
49 mbCanSelect = FALSE; 49 mbCanSelect = FALSE;
@@ -102,8 +102,10 @@ BOOL LLVOTextBubble::idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time)
102 for (i = 0; i < getNumTEs(); i++) 102 for (i = 0; i < getNumTEs(); i++)
103 { 103 {
104 setTEColor(i, color); 104 setTEColor(i, color);
105 setTEFullbright(i, TRUE);
105 } 106 }
106 107
108 gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_VOLUME, TRUE);
107 return TRUE; 109 return TRUE;
108} 110}
109 111
@@ -145,15 +147,14 @@ LLDrawable *LLVOTextBubble::createDrawable(LLPipeline *pipeline)
145 pipeline->allocDrawable(this); 147 pipeline->allocDrawable(this);
146 mDrawable->setLit(FALSE); 148 mDrawable->setLit(FALSE);
147 mDrawable->setRenderType(LLPipeline::RENDER_TYPE_VOLUME); 149 mDrawable->setRenderType(LLPipeline::RENDER_TYPE_VOLUME);
148 LLDrawPool *poolp; 150
149 for (U32 i = 0; i < getNumTEs(); i++) 151 for (U32 i = 0; i < getNumTEs(); i++)
150 { 152 {
151 LLViewerImage *imagep; 153 LLViewerImage *imagep;
152 const LLTextureEntry *texture_entry = getTE(i); 154 const LLTextureEntry *texture_entry = getTE(i);
153 imagep = gImageList.getImage(texture_entry->getID()); 155 imagep = gImageList.getImage(texture_entry->getID());
154 156
155 poolp = gPipeline.getPool(LLDrawPool::POOL_ALPHA); 157 mDrawable->addFace((LLFacePool*) NULL, imagep);
156 mDrawable->addFace(poolp, imagep);
157 } 158 }
158 159
159 return mDrawable; 160 return mDrawable;
@@ -200,24 +201,65 @@ BOOL LLVOTextBubble::updateGeometry(LLDrawable *drawable)
200 for (S32 i = 0; i < drawable->getNumFaces(); i++) 201 for (S32 i = 0; i < drawable->getNumFaces(); i++)
201 { 202 {
202 LLFace *face = drawable->getFace(i); 203 LLFace *face = drawable->getFace(i);
203
204 if (i == 0)
205 {
206 face->setSize(0);
207 continue;
208 }
209 if (i == 2)
210 {
211 face->setSize(0);
212 continue;
213 }
214
215 // Need to figure out how to readd logic to determine face dirty vs. entire object dirty.
216 face->setTEOffset(i); 204 face->setTEOffset(i);
217 face->clearState(LLFace::GLOBAL); 205 face->setTexture(LLViewerImage::sSmokeImagep);
218 face->genVolumeTriangles(*getVolume(), i, identity4, identity3); 206 face->setState(LLFace::FULLBRIGHT);
219 } 207 }
208
220 mVolumeChanged = FALSE; 209 mVolumeChanged = FALSE;
221 210
211 mDrawable->movePartition();
222 return TRUE; 212 return TRUE;
223} 213}
214
215void LLVOTextBubble::updateFaceSize(S32 idx)
216{
217 LLFace* face = mDrawable->getFace(idx);
218
219 if (idx == 0 || idx == 2)
220 {
221 face->setSize(0,0);
222 }
223 else
224 {
225 const LLVolumeFace& vol_face = getVolume()->getVolumeFace(idx);
226 face->setSize(vol_face.mVertices.size(), vol_face.mIndices.size());
227 }
228}
229
230void LLVOTextBubble::getGeometry(S32 idx,
231 LLStrider<LLVector3>& verticesp,
232 LLStrider<LLVector3>& normalsp,
233 LLStrider<LLVector2>& texcoordsp,
234 LLStrider<LLColor4U>& colorsp,
235 LLStrider<U32>& indicesp)
236{
237 if (idx == 0 || idx == 2)
238 {
239 return;
240 }
241
242 const LLVolumeFace& face = getVolume()->getVolumeFace(idx);
243
244 LLVector3 pos = getPositionAgent();
245 LLColor4U color = LLColor4U(getTE(idx)->getColor());
246 U32 offset = mDrawable->getFace(idx)->getGeomIndex();
247
248 for (U32 i = 0; i < face.mVertices.size(); i++)
249 {
250 *verticesp++ = face.mVertices[i].mPosition.scaledVec(getScale()) + pos;
251 *normalsp++ = face.mVertices[i].mNormal;
252 *texcoordsp++ = face.mVertices[i].mTexCoord;
253 *colorsp++ = color;
254 }
255
256 for (U32 i = 0; i < face.mIndices.size(); i++)
257 {
258 *indicesp++ = face.mIndices[i] + offset;
259 }
260}
261
262U32 LLVOTextBubble::getPartitionType() const
263{
264 return LLPipeline::PARTITION_PARTICLE;
265}
diff --git a/linden/indra/newview/llvotextbubble.h b/linden/indra/newview/llvotextbubble.h
index b77ed1a..bd1d241 100644
--- a/linden/indra/newview/llvotextbubble.h
+++ b/linden/indra/newview/llvotextbubble.h
@@ -31,7 +31,7 @@
31#include "llviewerobject.h" 31#include "llviewerobject.h"
32#include "llframetimer.h" 32#include "llframetimer.h"
33 33
34class LLVOTextBubble : public LLViewerObject 34class LLVOTextBubble : public LLAlphaObject
35{ 35{
36public: 36public:
37 LLVOTextBubble(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp); 37 LLVOTextBubble(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp);
@@ -44,6 +44,16 @@ public:
44 /*virtual*/ LLDrawable* createDrawable(LLPipeline *pipeline); 44 /*virtual*/ LLDrawable* createDrawable(LLPipeline *pipeline);
45 /*virtual*/ BOOL updateGeometry(LLDrawable *drawable); 45 /*virtual*/ BOOL updateGeometry(LLDrawable *drawable);
46 /*virtual*/ BOOL updateLOD(); 46 /*virtual*/ BOOL updateLOD();
47 /*virtual*/ void updateFaceSize(S32 idx);
48
49 /*virtual*/ void getGeometry(S32 idx,
50 LLStrider<LLVector3>& verticesp,
51 LLStrider<LLVector3>& normalsp,
52 LLStrider<LLVector2>& texcoordsp,
53 LLStrider<LLColor4U>& colorsp,
54 LLStrider<U32>& indicesp);
55
56 virtual U32 getPartitionType() const;
47 57
48 LLColor4 mColor; 58 LLColor4 mColor;
49 S32 mLOD; 59 S32 mLOD;
diff --git a/linden/indra/newview/llvotree.cpp b/linden/indra/newview/llvotree.cpp
index 9808a02..382f9a6 100644
--- a/linden/indra/newview/llvotree.cpp
+++ b/linden/indra/newview/llvotree.cpp
@@ -29,6 +29,8 @@
29 29
30#include "llvotree.h" 30#include "llvotree.h"
31 31
32#include "lldrawpooltree.h"
33
32#include "llviewercontrol.h" 34#include "llviewercontrol.h"
33#include "lldir.h" 35#include "lldir.h"
34#include "llprimitive.h" 36#include "llprimitive.h"
@@ -38,7 +40,6 @@
38#include "object_flags.h" 40#include "object_flags.h"
39 41
40#include "llagent.h" 42#include "llagent.h"
41#include "llagparray.h"
42#include "llcylinder.h" 43#include "llcylinder.h"
43#include "lldrawable.h" 44#include "lldrawable.h"
44#include "llface.h" 45#include "llface.h"
@@ -231,13 +232,13 @@ void LLVOTree::initClass()
231 232
232 BOOL have_all_trees = TRUE; 233 BOOL have_all_trees = TRUE;
233 LLString err; 234 LLString err;
234 char buffer[10]; 235 char buffer[10]; /* Flawfinder: ignore */
235 236
236 for (S32 i=0;i<sMaxTreeSpecies;++i) 237 for (S32 i=0;i<sMaxTreeSpecies;++i)
237 { 238 {
238 if (!sSpeciesTable.count(i)) 239 if (!sSpeciesTable.count(i))
239 { 240 {
240 snprintf(buffer,10," %d",i); 241 snprintf(buffer,10," %d",i); /* Flawfinder: ignore */
241 err.append(buffer); 242 err.append(buffer);
242 have_all_trees = FALSE; 243 have_all_trees = FALSE;
243 } 244 }
@@ -408,6 +409,10 @@ void LLVOTree::updateTextures(LLAgent &agent)
408 F32 cos_angle = 1.f; 409 F32 cos_angle = 1.f;
409 if (mTreeImagep) 410 if (mTreeImagep)
410 { 411 {
412 if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_TEXTURE_AREA))
413 {
414 setDebugText(llformat("%4.0f", fsqrtf(mPixelArea)));
415 }
411 mTreeImagep->addTextureStats(mPixelArea, texel_area_ratio, cos_angle); 416 mTreeImagep->addTextureStats(mPixelArea, texel_area_ratio, cos_angle);
412 } 417 }
413 418
@@ -421,14 +426,12 @@ LLDrawable* LLVOTree::createDrawable(LLPipeline *pipeline)
421 426
422 mDrawable->setRenderType(LLPipeline::RENDER_TYPE_TREE); 427 mDrawable->setRenderType(LLPipeline::RENDER_TYPE_TREE);
423 428
424 LLDrawPool *poolp = gPipeline.getPool(LLDrawPool::POOL_TREE, mTreeImagep); 429 LLDrawPoolTree *poolp = (LLDrawPoolTree*) gPipeline.getPool(LLDrawPool::POOL_TREE, mTreeImagep);
425 430
426 // Just a placeholder for an actual object... 431 // Just a placeholder for an actual object...
427 LLFace *facep = mDrawable->addFace(poolp, mTreeImagep, TRUE); 432 LLFace *facep = mDrawable->addFace(poolp, mTreeImagep);
428 facep->setSize(1, 3); 433 facep->setSize(1, 3);
429 434
430 gPipeline.markMaterialed(mDrawable);
431
432 updateRadius(); 435 updateRadius();
433 436
434 return mDrawable; 437 return mDrawable;
@@ -441,6 +444,7 @@ const S32 LEAF_VERTICES = 16;
441 444
442BOOL LLVOTree::updateGeometry(LLDrawable *drawable) 445BOOL LLVOTree::updateGeometry(LLDrawable *drawable)
443{ 446{
447 LLFastTimer ftm(LLFastTimer::FTM_UPDATE_TREE);
444 U32 i, j; 448 U32 i, j;
445 const S32 MAX_SLICES = 32; 449 const S32 MAX_SLICES = 32;
446 450
@@ -463,20 +467,6 @@ BOOL LLVOTree::updateGeometry(LLDrawable *drawable)
463 face->mCenterAgent = getPositionAgent(); 467 face->mCenterAgent = getPositionAgent();
464 face->mCenterLocal = face->mCenterAgent; 468 face->mCenterLocal = face->mCenterAgent;
465 469
466 LLDrawPool *poolp = face->getPool();
467
468 if (poolp->getVertexCount())
469 {
470 return TRUE;
471 }
472
473 if (!face->getDirty())
474 {
475 return FALSE;
476 }
477
478 poolp->setDirty();
479
480 for (lod = 0; lod < 4; lod++) 470 for (lod = 0; lod < 4; lod++)
481 { 471 {
482 slices = sLODSlices[lod]; 472 slices = sLODSlices[lod];
@@ -491,10 +481,17 @@ BOOL LLVOTree::updateGeometry(LLDrawable *drawable)
491 LLStrider<LLVector3> vertices; 481 LLStrider<LLVector3> vertices;
492 LLStrider<LLVector3> normals; 482 LLStrider<LLVector3> normals;
493 LLStrider<LLVector2> tex_coords; 483 LLStrider<LLVector2> tex_coords;
494 U32 *indicesp; 484 LLStrider<U32> indicesp;
495 485
496 face->setSize(max_vertices, max_indices); 486 face->setSize(max_vertices, max_indices);
487
488 face->mVertexBuffer = new LLVertexBuffer(LLDrawPoolTree::VERTEX_DATA_MASK, GL_STATIC_DRAW_ARB);
489 face->mVertexBuffer->allocateBuffer(max_vertices, max_indices, TRUE);
490 face->setGeomIndex(0);
491 face->setIndicesIndex(0);
492
497 face->getGeometry(vertices, normals, tex_coords, indicesp); 493 face->getGeometry(vertices, normals, tex_coords, indicesp);
494
498 495
499 S32 vertex_count = 0; 496 S32 vertex_count = 0;
500 S32 index_count = 0; 497 S32 index_count = 0;
@@ -793,17 +790,13 @@ BOOL LLVOTree::updateGeometry(LLDrawable *drawable)
793 return TRUE; 790 return TRUE;
794} 791}
795 792
796void LLVOTree::drawBranchPipeline(LLDrawPool *draw_pool, S32 trunk_LOD, S32 stop_level, U16 depth, U16 trunk_depth, F32 scale, F32 twist, F32 droop, F32 branches, F32 alpha) 793U32 LLVOTree::drawBranchPipeline(U32* indicesp, S32 trunk_LOD, S32 stop_level, U16 depth, U16 trunk_depth, F32 scale, F32 twist, F32 droop, F32 branches, F32 alpha)
797{ 794{
795 U32 ret = 0;
798 // 796 //
799 // Draws a tree by recursing, drawing branches and then a 'leaf' texture. 797 // Draws a tree by recursing, drawing branches and then a 'leaf' texture.
800 // If stop_level = -1, simply draws the whole tree as a billboarded texture 798 // If stop_level = -1, simply draws the whole tree as a billboarded texture
801 // 799 //
802
803 if (!draw_pool->getIndexCount())
804 {
805 return; // safety net
806 }
807 800
808 static F32 constant_twist; 801 static F32 constant_twist;
809 static F32 width = 0; 802 static F32 width = 0;
@@ -827,15 +820,15 @@ void LLVOTree::drawBranchPipeline(LLDrawPool *draw_pool, S32 trunk_LOD, S32 stop
827 width = scale * length * aspect; 820 width = scale * length * aspect;
828 glPushMatrix(); 821 glPushMatrix();
829 glScalef(width,width,scale * length); 822 glScalef(width,width,scale * length);
830 //glDrawElements(GL_TRIANGLES, sLODIndexCount[trunk_LOD], GL_UNSIGNED_INT, draw_pool.getRawIndices() + sLODIndexOffset[trunk_LOD]); 823 glDrawElements(GL_TRIANGLES, sLODIndexCount[trunk_LOD], GL_UNSIGNED_INT, indicesp + sLODIndexOffset[trunk_LOD]);
831 glDrawRangeElements(GL_TRIANGLES, 824 /*glDrawRangeElements(GL_TRIANGLES,
832 sLODVertexOffset[trunk_LOD], 825 sLODVertexOffset[trunk_LOD],
833 sLODVertexOffset[trunk_LOD] + sLODVertexCount[trunk_LOD]-1, 826 sLODVertexOffset[trunk_LOD] + sLODVertexCount[trunk_LOD]-1,
834 sLODIndexCount[trunk_LOD], 827 sLODIndexCount[trunk_LOD],
835 GL_UNSIGNED_INT, 828 GL_UNSIGNED_INT,
836 draw_pool->getRawIndices() + sLODIndexOffset[trunk_LOD]); 829 indicesp + sLODIndexOffset[trunk_LOD]);*/
837 stop_glerror(); 830 stop_glerror();
838 draw_pool->addIndicesDrawn(sLODIndexCount[trunk_LOD]); 831 ret += sLODIndexCount[trunk_LOD];
839 glPopMatrix(); 832 glPopMatrix();
840 } 833 }
841 834
@@ -847,7 +840,7 @@ void LLVOTree::drawBranchPipeline(LLDrawPool *draw_pool, S32 trunk_LOD, S32 stop
847 glRotatef((constant_twist + ((i%2==0)?twist:-twist))*i, 0.f, 0.f, 1.f); 840 glRotatef((constant_twist + ((i%2==0)?twist:-twist))*i, 0.f, 0.f, 1.f);
848 glRotatef(droop, 0.f, 1.f, 0.f); 841 glRotatef(droop, 0.f, 1.f, 0.f);
849 glRotatef(20.f, 0.f, 0.f, 1.f); // rotate 20deg about axis of new branch to add some random variation 842 glRotatef(20.f, 0.f, 0.f, 1.f); // rotate 20deg about axis of new branch to add some random variation
850 drawBranchPipeline(draw_pool, trunk_LOD, stop_level, depth - 1, 0, scale*mScaleStep, twist, droop, branches, alpha); 843 ret += drawBranchPipeline(indicesp, trunk_LOD, stop_level, depth - 1, 0, scale*mScaleStep, twist, droop, branches, alpha);
851 glPopMatrix(); 844 glPopMatrix();
852 } 845 }
853 // Recurse to continue trunk 846 // Recurse to continue trunk
@@ -856,7 +849,7 @@ void LLVOTree::drawBranchPipeline(LLDrawPool *draw_pool, S32 trunk_LOD, S32 stop
856 glPushMatrix(); 849 glPushMatrix();
857 glTranslatef(0.f, 0.f, scale * length); 850 glTranslatef(0.f, 0.f, scale * length);
858 glRotatef(70.5f, 0.f, 0.f, 1.f); // rotate a bit around Z when ascending 851 glRotatef(70.5f, 0.f, 0.f, 1.f); // rotate a bit around Z when ascending
859 drawBranchPipeline(draw_pool, trunk_LOD, stop_level, depth, trunk_depth-1, scale*mScaleStep, twist, droop, branches, alpha); 852 ret += drawBranchPipeline(indicesp, trunk_LOD, stop_level, depth, trunk_depth-1, scale*mScaleStep, twist, droop, branches, alpha);
860 glPopMatrix(); 853 glPopMatrix();
861 } 854 }
862 } 855 }
@@ -871,15 +864,15 @@ void LLVOTree::drawBranchPipeline(LLDrawPool *draw_pool, S32 trunk_LOD, S32 stop
871 //width = scale * (TREE_BRANCH_ASPECT + TREE_LEAF_ASPECT); 864 //width = scale * (TREE_BRANCH_ASPECT + TREE_LEAF_ASPECT);
872 glScalef(scale*mLeafScale, scale*mLeafScale, scale*mLeafScale); 865 glScalef(scale*mLeafScale, scale*mLeafScale, scale*mLeafScale);
873 //glScalef(1.5f*width*mLeafScale,1,1.5f*scale*mLeafScale); 866 //glScalef(1.5f*width*mLeafScale,1,1.5f*scale*mLeafScale);
874// glDrawElements(GL_TRIANGLES, LEAF_INDICES, GL_UNSIGNED_INT, draw_pool.getRawIndices()); 867 glDrawElements(GL_TRIANGLES, LEAF_INDICES, GL_UNSIGNED_INT, indicesp);
875 glDrawRangeElements(GL_TRIANGLES, 868 /*glDrawRangeElements(GL_TRIANGLES,
876 0, 869 0,
877 LEAF_VERTICES-1, 870 LEAF_VERTICES-1,
878 LEAF_INDICES, 871 LEAF_INDICES,
879 GL_UNSIGNED_INT, 872 GL_UNSIGNED_INT,
880 draw_pool->getRawIndices()); 873 indicesp);*/
881 stop_glerror(); 874 stop_glerror();
882 draw_pool->addIndicesDrawn(LEAF_INDICES); 875 ret += LEAF_INDICES;
883 glPopMatrix(); 876 glPopMatrix();
884 } 877 }
885 } 878 }
@@ -897,21 +890,23 @@ void LLVOTree::drawBranchPipeline(LLDrawPool *draw_pool, S32 trunk_LOD, S32 stop
897 { 890 {
898 glPushMatrix(); 891 glPushMatrix();
899 glScalef(mBillboardScale*mBillboardRatio, mBillboardScale*mBillboardRatio, mBillboardScale); 892 glScalef(mBillboardScale*mBillboardRatio, mBillboardScale*mBillboardRatio, mBillboardScale);
900// glDrawElements(GL_TRIANGLES, LEAF_INDICES, GL_UNSIGNED_INT, draw_pool.getRawIndices()); 893 glDrawElements(GL_TRIANGLES, LEAF_INDICES, GL_UNSIGNED_INT, indicesp);
901 glDrawRangeElements(GL_TRIANGLES, 894/* glDrawRangeElements(GL_TRIANGLES,
902 0, 895 0,
903 LEAF_VERTICES-1, 896 LEAF_VERTICES-1,
904 LEAF_INDICES, 897 LEAF_INDICES,
905 GL_UNSIGNED_INT, 898 GL_UNSIGNED_INT,
906 draw_pool->getRawIndices()); 899 indicesp);*/
907 stop_glerror(); 900 stop_glerror();
908 draw_pool->addIndicesDrawn(LEAF_INDICES); 901 ret += LEAF_INDICES;
909 glPopMatrix(); 902 glPopMatrix();
910 } 903 }
911 glMatrixMode(GL_TEXTURE); 904 glMatrixMode(GL_TEXTURE);
912 glPopMatrix(); 905 glPopMatrix();
913 glMatrixMode(GL_MODELVIEW); 906 glMatrixMode(GL_MODELVIEW);
914 } 907 }
908
909 return ret;
915} 910}
916 911
917void LLVOTree::updateRadius() 912void LLVOTree::updateRadius()
@@ -923,3 +918,30 @@ void LLVOTree::updateRadius()
923 918
924 mDrawable->setRadius(32.0f); 919 mDrawable->setRadius(32.0f);
925} 920}
921
922void LLVOTree::updateSpatialExtents(LLVector3& newMin, LLVector3& newMax)
923{
924 LLVector3 center = getRenderPosition();
925 LLVector3 size = getScale();
926 center.mV[2] += size.mV[2];
927
928 newMin.setVec(center-size);
929 newMax.setVec(center+size);
930 mDrawable->setPositionGroup((newMin + newMax) * 0.5f);
931}
932
933U32 LLVOTree::getPartitionType() const
934{
935 return LLPipeline::PARTITION_TREE;
936}
937
938LLTreePartition::LLTreePartition()
939: LLSpatialPartition(0)
940{
941 mRenderByGroup = FALSE;
942 mDrawableType = LLPipeline::RENDER_TYPE_TREE;
943 mPartitionType = LLPipeline::PARTITION_TREE;
944 mSlopRatio = 0.f;
945 mLODPeriod = 1;
946}
947
diff --git a/linden/indra/newview/llvotree.h b/linden/indra/newview/llvotree.h
index 4d11d20..fb35dd9 100644
--- a/linden/indra/newview/llvotree.h
+++ b/linden/indra/newview/llvotree.h
@@ -39,6 +39,14 @@ class LLDrawPool;
39class LLVOTree : public LLViewerObject 39class LLVOTree : public LLViewerObject
40{ 40{
41public: 41public:
42 enum
43 {
44 VERTEX_DATA_MASK = (1 << LLVertexBuffer::TYPE_VERTEX) |
45 (1 << LLVertexBuffer::TYPE_NORMAL) |
46 (1 << LLVertexBuffer::TYPE_TEXCOORD)
47 }
48 eVertexDataMask;
49
42 LLVOTree(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp); 50 LLVOTree(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp);
43 virtual ~LLVOTree(); 51 virtual ~LLVOTree();
44 52
@@ -59,10 +67,13 @@ public:
59 67
60 /*virtual*/ LLDrawable* createDrawable(LLPipeline *pipeline); 68 /*virtual*/ LLDrawable* createDrawable(LLPipeline *pipeline);
61 /*virtual*/ BOOL updateGeometry(LLDrawable *drawable); 69 /*virtual*/ BOOL updateGeometry(LLDrawable *drawable);
70 /*virtual*/ void updateSpatialExtents(LLVector3 &min, LLVector3 &max);
71
72 virtual U32 getPartitionType() const;
62 73
63 void updateRadius(); 74 void updateRadius();
64 75
65 void drawBranchPipeline(LLDrawPool *draw_pool, S32 trunk_LOD, S32 stop_level, U16 depth, U16 trunk_depth, F32 scale, F32 twist, F32 droop, F32 branches, F32 alpha); 76 U32 drawBranchPipeline(U32* indicesp, S32 trunk_LOD, S32 stop_level, U16 depth, U16 trunk_depth, F32 scale, F32 twist, F32 droop, F32 branches, F32 alpha);
66 77
67 void drawBranch(S32 stop_level, U16 depth, U16 trunk_depth, F32 scale, F32 twist, F32 droop, F32 branches, F32 alpha, BOOL draw_leaves); 78 void drawBranch(S32 stop_level, U16 depth, U16 trunk_depth, F32 scale, F32 twist, F32 droop, F32 branches, F32 alpha, BOOL draw_leaves);
68 79
diff --git a/linden/indra/newview/llvotreenew.cpp b/linden/indra/newview/llvotreenew.cpp
deleted file mode 100644
index d7fc635..0000000
--- a/linden/indra/newview/llvotreenew.cpp
+++ /dev/null
@@ -1,1470 +0,0 @@
1/**
2 * @file llvotreenew.cpp
3 * @brief LLVOTreeNew class implementation
4 *
5 * Copyright (c) 2003-2007, Linden Research, Inc.
6 *
7 * The source code in this file ("Source Code") is provided by Linden Lab
8 * to you under the terms of the GNU General Public License, version 2.0
9 * ("GPL"), unless you have obtained a separate licensing agreement
10 * ("Other License"), formally executed by you and Linden Lab. Terms of
11 * the GPL can be found in doc/GPL-license.txt in this distribution, or
12 * online at http://secondlife.com/developers/opensource/gplv2
13 *
14 * There are special exceptions to the terms and conditions of the GPL as
15 * it is applied to this Source Code. View the full text of the exception
16 * in the file doc/FLOSS-exception.txt in this software distribution, or
17 * online at http://secondlife.com/developers/opensource/flossexception
18 *
19 * By copying, modifying or distributing this software, you acknowledge
20 * that you have read and understood your obligations described above,
21 * and agree to abide by those obligations.
22 *
23 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
24 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
25 * COMPLETENESS OR PERFORMANCE.
26 */
27
28#include "llviewerprecompiledheaders.h"
29
30#include "llvotreenew.h"
31
32#include "llgl.h"
33#include "llglheaders.h"
34#include "lltree_common.h"
35#include "lltreeparams.h"
36#include "material_codes.h"
37#include "object_flags.h"
38
39#include "llagent.h"
40#include "llagparray.h"
41#include "llviewercontrol.h"
42#include "llcylinder.h"
43#include "lldrawable.h"
44#include "llface.h"
45#include "llprimitive.h"
46#include "llviewerimagelist.h"
47#include "llviewerobjectlist.h"
48#include "llviewerregion.h"
49#include "llworld.h"
50#include "noise.h"
51#include "pipeline.h"
52
53U32 LLVOTreeNew::sNextVertexIndex[MAX_SPECIES];
54U32 LLVOTreeNew::sNextIndiceIndex[MAX_SPECIES];
55U32 LLVOTreeNew::sNextPartIndex[MAX_PARTS];
56LLVOTreeNew::TreePart LLVOTreeNew::sTreeParts[MAX_SPECIES][MAX_PARTS];
57LLUUID LLVOTreeNew::sTreeImageIDs[MAX_SPECIES];
58U32 LLVOTreeNew::sTreePartsUsed[MAX_SPECIES][MAX_PARTS][MAX_VARS];
59LLTreeParams LLVOTreeNew::sParameters;
60F32 LLVOTreeNew::sRandNums[MAX_RAND_NUMS];
61
62extern LLPipeline gPipeline;
63
64// Tree variables and functions
65
66LLVOTreeNew::LLVOTreeNew(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp):
67 LLViewerObject(id, pcode, regionp)
68{
69 mTotalIndices = 0;
70 mTotalVerts = 0;
71 mSpecies = 0;
72}
73
74
75LLVOTreeNew::~LLVOTreeNew()
76{
77 if (mData)
78 {
79 delete[] mData;
80 mData = NULL;
81 }
82}
83
84
85void LLVOTreeNew::initClass()
86{
87 U8 i;
88
89 // for now just load the same texture in for every tree...
90
91 for (i = 0; i < MAX_SPECIES; i++)
92 {
93 switch (i) {
94 case (0):
95 sTreeImageIDs[i] = LLUUID( gViewerArt.getString("tree_pine_1.tga") );
96 //LLVOTreeNew::sTreeImagep[i] = gImageList.getImage(LLUUID( gViewerArt.getString("tree_pine_1.tga") ));
97 break;
98 case (1):
99 sTreeImageIDs[i] = LLUUID( gViewerArt.getString("tree_oak.tga") );
100 //LLVOTreeNew::sTreeImagep[i] = gImageList.getImage(LLUUID( gViewerArt.getString("tree_oak.tga") ));
101 break;
102 case (2):
103 sTreeImageIDs[i] = LLUUID( gViewerArt.getString("tree_tropical_1.tga") );
104 //LLVOTreeNew::sTreeImagep[i] = gImageList.getImage(LLUUID( gViewerArt.getString("tree_tropical_1.tga") ));
105 break;
106 case (3):
107 sTreeImageIDs[i] = LLUUID( gViewerArt.getString("tree_palm_1.tga") );
108 //LLVOTreeNew::sTreeImagep[i] = gImageList.getImage(LLUUID( gViewerArt.getString("tree_palm_1.tga") ));
109 break;
110 case (4):
111 sTreeImageIDs[i] = LLUUID( gViewerArt.getString("tree_dogwood.tga") );
112 //LLVOTreeNew::sTreeImagep[i] = gImageList.getImage(LLUUID( gViewerArt.getString("tree_dogwood.tga") ));
113 break;
114 case (5):
115 sTreeImageIDs[i] = LLUUID( gViewerArt.getString("tree_tropical_2.tga") );
116 //LLVOTreeNew::sTreeImagep[i] = gImageList.getImage(LLUUID( gViewerArt.getString("tree_tropical_2.tga") ));
117 break;
118 case (6):
119 sTreeImageIDs[i] = LLUUID( gViewerArt.getString("tree_palm_2.tga") );
120 //LLVOTreeNew::sTreeImagep[i] = gImageList.getImage(LLUUID( gViewerArt.getString("tree_palm_2.tga") ));
121 break;
122 case (7):
123 sTreeImageIDs[i] = LLUUID( gViewerArt.getString("tree_cypress_1.tga") );
124 //LLVOTreeNew::sTreeImagep[i] = gImageList.getImage(LLUUID( gViewerArt.getString("tree_cypress_1.tga") ));
125 break;
126 case (8):
127 sTreeImageIDs[i] = LLUUID( gViewerArt.getString("tree_cypress_2.tga") );
128 //LLVOTreeNew::sTreeImagep[i] = gImageList.getImage(LLUUID( gViewerArt.getString("tree_cypress_2.tga") ));
129 break;
130 default:
131 sTreeImageIDs[i] = LLUUID( gViewerArt.getString("tree_pine_2.tga") );
132 //LLVOTreeNew::sTreeImagep[i] = gImageList.getImage(LLUUID( gViewerArt.getString("tree_pine_2.tga") ));
133 break;
134 }
135 }
136
137
138 //LLVOTreeNew::sParameters = LLTreeParams();
139
140 // initialize an array of random numbers that we'll be using
141 LLRandLagFib607 tree_rand;
142 for (i = 0; i < MAX_RAND_NUMS; i++)
143 sRandNums[i] = (F32)tree_rand();
144}
145
146/*
147void LLVOTreeNew::cleanupTextures()
148{
149 S32 i;
150 for (i = 0; i < MAX_SPECIES; i++)
151 {
152 mTreeImagep = NULL;
153 }
154}
155*/
156
157U32 LLVOTreeNew::processUpdateMessage(LLMessageSystem *mesgsys,
158 void **user_data,
159 U32 block_num, EObjectUpdateType update_type,
160 LLDataPacker *dp)
161{
162 // Do base class updates...
163 U32 retval = LLViewerObject::processUpdateMessage(mesgsys, user_data, block_num, update_type, dp);
164
165 if ( (getVelocity().magVecSquared() > 0.f)
166 ||(getAcceleration().magVecSquared() > 0.f)
167 ||(getAngularVelocity().magVecSquared() > 0.f))
168 {
169 llinfos << "ACK! Moving tree!" << llendl;
170 setVelocity(LLVector3::zero);
171 setAcceleration(LLVector3::zero);
172 setAngularVelocity(LLVector3::zero);
173 }
174
175 mSpecies = ((U8 *)mData)[0];
176 mSpecies = 1;
177
178 if (mSpecies >= MAX_SPECIES)
179 {
180 mSpecies = 0;
181 }
182
183
184 mTreeImagep = gImageList.getImage(sTreeImageIDs[mSpecies]);
185 if (mTreeImagep)
186 {
187 mTreeImagep->bindTexture(0);
188 mTreeImagep->setClamp(TRUE, TRUE);
189 }
190
191 return retval;
192}
193
194
195BOOL LLVOTreeNew::idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time)
196{
197 return TRUE;
198}
199
200
201void LLVOTreeNew::render(LLAgent &agent)
202{
203 // nothing
204}
205
206
207void LLVOTreeNew::updateTextures(LLAgent &agent)
208{
209 LLVector3 position_local = getPositionAgent() - agent.getCameraPositionAgent();
210 F32 dot_product = position_local * agent.getFrameAgent().getAtAxis();
211 F32 cos_angle = dot_product / position_local.magVec();
212
213 if (cos_angle > 1.f)
214 {
215 cos_angle = 1.f;
216 }
217
218 // temporary aggregate texture scale calculation
219 // this is less correct than the code above!
220 F32 texel_area_ratio = 0.5f; // When we're billboarded, we use less than the whole texture (about half?)
221 if (mTreeImagep)
222 {
223 mTreeImagep->addTextureStats(mPixelArea, texel_area_ratio, cos_angle);
224 }
225
226}
227
228
229LLDrawable* LLVOTreeNew::createDrawable(LLPipeline *pipeline)
230{
231
232 pipeline->allocDrawable(this);
233 mDrawable->setLit(FALSE);
234
235 mDrawable->setRenderType(LLPipeline::RENDER_TYPE_TREE);
236 //llinfos << "tree type: " << LLPipeline::RENDER_TYPE_TREE << llendl;
237
238 //!! add the leaf texture to this
239 LLDrawPool *poolp = gPipeline.getPool(LLDrawPool::POOL_TREE_NEW, mTreeImagep);
240
241
242 //!! add a face for the bark texture...
243 //LLFace *facep = mDrawable->addFace(poolp, mTreeImagep, TRUE);
244 mDrawable->addFace(poolp, mTreeImagep, TRUE);
245 //facep->setSize(1, 3);
246
247 //!! add a face for the leaf texture ??
248 //
249
250 gPipeline.markMaterialed(mDrawable);
251
252 return mDrawable;
253}
254
255
256
257BOOL LLVOTreeNew::updateGeometry(LLDrawable *drawable)
258{
259
260 llinfos << "TREE SPECIES " << U32(mSpecies) << llendl;
261
262 // create the basic geometry of the trunk and branch
263
264 // get the face for the branches...
265 LLFace *face = drawable->getFace(0);
266 LLDrawPool *poolp = face->getPool();
267
268 if (!face->getDirty())
269 {
270 return TRUE;
271 }
272
273 poolp->setDirty();
274
275 U32 curVertexIndex, curTexCoordIndex, curNormalIndex;
276 U32 curIndiceIndex;
277// U32 numVertsCreated = LLVOTreeNew::sNextVertexIndex[mSpecies];
278
279 //U32 vertexCount = poolp->getVertexCount();
280 //llinfos << "TREE vertexCount = " << vertexCount << ", nextVertexIndex = " << mNextVertexIndex[mSpecies] << llendl;
281 //U32 indiceCount = poolp->getIndexCount();
282 //llinfos << "TREE indiceCount = " << indiceCount << ", nextIndiceIndex = " << mNextIndiceIndex[mSpecies] << llendl;
283
284
285 if (poolp->getVertexCount() > 0)
286 {
287 //llinfos << "TREE not creating the arrays..." << llendl;
288 }
289 else
290 {
291 // create the drawpool arrays
292 // using some rough estimates
293 U32 numVerts = NUM_INIT_VERTS;
294 U32 numIndices = NUM_INIT_INDICES;
295
296 face->setPrimType(LLTriangles);
297 face->setSize(numVerts, numIndices);
298
299 // reset the next's since they may have been previously initialized...
300 LLVOTreeNew::sNextIndiceIndex[mSpecies] = 0;
301 LLVOTreeNew::sNextVertexIndex[mSpecies] = 0;
302 LLVOTreeNew::sNextPartIndex[mSpecies] = 0;
303
304 //llinfos << "TREE creating the arrays..." << llendl;
305 }
306
307 curVertexIndex = LLVOTreeNew::sNextVertexIndex[mSpecies];
308 curTexCoordIndex = curVertexIndex;
309 curNormalIndex = curVertexIndex;
310 curIndiceIndex = LLVOTreeNew::sNextIndiceIndex[mSpecies];
311
312 //vertexCount = poolp->getVertexCount();
313 //llinfos << "TREE vertexCount = " << vertexCount << ", nextVertexIndex = " << mNextVertexIndex[mSpecies] << llendl;
314 //indiceCount = poolp->getIndexCount();
315 //llinfos << "TREE indiceCount = " << indiceCount << ", nextIndiceIndex = " << mNextIndiceIndex[mSpecies] << llendl;
316
317 //llinfos << "TREE \t" << "\t curVertexIndex: \t" << curVertexIndex << llendl;
318 //llinfos << "TREE \t" << "\t curIndiceIndex: \t" << curIndiceIndex << llendl;
319
320 LLStrider<LLVector3> vertices;
321 LLStrider<LLVector3> normals;
322 LLStrider<LLVector2> tex_coords;
323 U32 *indices;
324
325 face->getGeometry(vertices, normals, tex_coords, indices);
326
327 // create different parts for the levels...
328
329 // create the trunk...
330 F32 length, curve, radius, parentLength, parentRadius;
331
332 length = parentLength = sParameters.mLength[0] * sParameters.mScale;
333 radius = parentRadius = length * sParameters.mRatio * sParameters.mScale0;
334 curve = sParameters.mCurve[0];
335 createPart(0, length, radius, vertices, normals, tex_coords, indices, curVertexIndex, curTexCoordIndex,
336 curNormalIndex, curIndiceIndex);
337
338 // create collection of curved branches...
339 //*
340 for (U8 i = 1; i <= sParameters.mLevels; i++)
341 {
342 length = sParameters.mLength[i] * parentLength;
343 radius = parentRadius * pow((length / parentLength), sParameters.mRatioPower);
344
345 llinfos << "TREE creating (?) part with radius: " << radius << " and length: " << length << llendl;
346
347 createPart(i, length, radius, vertices, normals, tex_coords, indices, curVertexIndex, curTexCoordIndex,
348 curNormalIndex, curIndiceIndex);
349
350 parentRadius = radius;
351 parentLength = length;
352
353 }
354 //*/
355
356 LLVOTreeNew::sNextVertexIndex[mSpecies] = curVertexIndex;
357 LLVOTreeNew::sNextIndiceIndex[mSpecies] = curIndiceIndex;
358
359 // create a leaf...?
360
361 return TRUE;
362}
363
364F32 LLVOTreeNew::CalcZStep(TreePart *part, U8 section)
365{
366 F32 zStep;
367
368 if (part->mLevel == 0 && section < sParameters.mFlareRes)
369 zStep = (sParameters.mFlarePercentage * part->mLength)/sParameters.mFlareRes;
370 else
371 zStep = ((1.f - sParameters.mFlarePercentage)*part->mLength) / (part->mCurveRes);
372
373 return zStep;
374}
375
376S32 LLVOTreeNew::findSimilarPart(U8 level)
377{
378 // see if there's a tree part that's similar...
379 for (U8 i = 0; i < sNextPartIndex[mSpecies]; i++)
380 {
381 TreePart *curPart = &(sTreeParts[mSpecies][i]);
382 // make sure older branch is at same 'level' and has
383 // similar lobe parameters (if at the trunk level)
384 if (curPart->mLevel == level &&
385 (level != 0 || (llabs(curPart->mLobes - sParameters.mLobes) < MAX_LOBES_DIFF && llabs(curPart->mLobeDepth - sParameters.mLobeDepth) < MAX_LOBEDEPTH_DIFF)))
386 {
387 // check to see if older branch's curve, curveBack, and curveV
388 // are all close to the desired branch...
389 F32 curveDiff = llabs(curPart->mCurve - sParameters.mCurve[level]);
390 F32 curveBackDiff = llabs(curPart->mCurveBack - sParameters.mCurveBack[level]);
391 F32 curveVDiff = llabs(curPart->mCurveV - sParameters.mCurveV[level]);
392 if (curveDiff < MAX_CURVE_DIFF
393 && curveVDiff < MAX_CURVE_V_DIFF
394 && (curveBackDiff == 0 || curveBackDiff < MAX_CURVEBACK_DIFF)
395 )
396 {
397 // already have a branch that's close enough
398 return i;
399 }
400 }
401 }
402
403 return -1;
404}
405
406
407void LLVOTreeNew::createPart(U8 level, F32 length, F32 radius, LLStrider<LLVector3> &vertices, LLStrider<LLVector3> &normals,
408 LLStrider<LLVector2> &tex_coords, U32 *indices,
409 U32 &curVertexIndex, U32 &curTexCoordIndex,
410 U32 &curNormalIndex, U32 &curIndiceIndex)
411{
412 U8 i, j, k;
413
414 // check for a similar branch...
415 S32 selectedPart = findSimilarPart(level);
416 if (selectedPart > -1) return;
417
418 // if we didn't find the branch, make different versions of it
419 // depending on how large curveV (curveVariance), make more branches...
420 S32 numVariants = 1;
421 numVariants += (S32)(sParameters.mCurveV[level]/CURVEV_DIVIDER);
422
423 if (numVariants > MAX_VARS) numVariants = MAX_VARS;
424 if (level == 0) numVariants = 1; // just make one trunk
425
426 llinfos << "TREE generating " << numVariants << " variants for curveV of " << sParameters.mCurveV[level] << " on level " << U32(level) << llendl;
427
428
429 // if we've hit the max part limit, just quit...
430 if (sNextPartIndex[mSpecies] == MAX_PARTS)
431 {
432 llinfos << "TREE SPECIES RAN OUT OF DRAWPOOL PART SPACE..." << llendl;
433 return;
434 }
435
436 // put the first variant in its own mTreePart
437 TreePart *part = &(LLVOTreeNew::sTreeParts[mSpecies][LLVOTreeNew::sNextPartIndex[mSpecies]++]);
438
439 // set the tree part params from the basic tree params...
440 part->mCurve = sParameters.mCurve[level];;
441 part->mCurveRes = sParameters.mCurveRes[level];
442 part->mCurveBack = sParameters.mCurveBack[level];
443 part->mCurveV = sParameters.mCurveV[level];
444 part->mLobeDepth = sParameters.mLobeDepth;
445 part->mLobes = sParameters.mLobes;
446 part->mLength = length;
447 part->mRadius = radius;
448 part->mLevel = level;
449 part->mVertsPerSection = sParameters.mVertices[level];
450 part->mNumVariants = 0;
451
452 // enforce constraints on # of resolutions
453 if (sParameters.mFlareRes > MAX_FLARE) sParameters.mFlareRes = MAX_FLARE;
454 if (part->mCurveRes > MAX_RES) part->mCurveRes = MAX_RES;
455
456 for (k = 0; k < numVariants; k++)
457 {
458 part->mNumVariants++;
459
460 // set the part's vertices to the first vertex and first index of its parts
461 part->mIndiceIndex[k] = curIndiceIndex;
462
463 // how many total sections in the branch
464 U8 numSections = (U8)(part->mCurveRes) + (level == 0 ? sParameters.mFlareRes : 0);
465
466 U8 framesUsed = 0;
467 U8 flareFramesUsed = 0;
468 F32 stemZ;
469 F32 startingZ = 0;
470
471 // create curveRes different versions of the branch, with each
472 // one having its origin base be a different flareRes or curveRes base
473
474 U32 oldOffset = mRandOffset[level];
475
476 for (j = 0; j < numSections; j++)
477 {
478 mRandOffset[level] = oldOffset;
479 if (j != 0) part->mOffsets[k][j - (level == 0 ? sParameters.mFlareRes : 0)] = curIndiceIndex;
480
481 F32 sectionRadius;
482 LLMatrix4 curFrame;
483 U8 curSection = 0;
484
485 // our position in the branch
486 stemZ = startingZ;
487
488 // Make branches from
489 // From 0th section...numSections
490 // 1st section...numSections
491 // 2nd section...numSections
492
493 sectionRadius = CalculateSectionRadius(level, stemZ / part->mLength, part->mLength, part->mRadius);
494
495 // create points that make up the bottom of the section...
496 createSection(curFrame, part, sectionRadius, stemZ,
497 vertices, tex_coords, indices,
498 curVertexIndex, curTexCoordIndex, curIndiceIndex, curSection++, j == 0 ? TRUE : FALSE);
499
500 for (i = j; i < numSections; i++)
501 {
502 // do the curving...
503 F32 angle;
504 if (part->mCurveBack != 0)
505 {
506 if (part->mCurveRes / (i + 1.0) < 2)
507 angle = part->mCurve / part->mCurveRes / 2.f;
508 else
509 angle = part->mCurveBack / part->mCurveRes / 2.f;
510 }
511 else
512 {
513 if (part->mLevel == 0)
514 {
515 if (i <= sParameters.mFlareRes) angle = (sParameters.mFlarePercentage*part->mCurve)/sParameters.mFlareRes;
516 else angle = ((1.f - sParameters.mFlarePercentage)*part->mCurve)/part->mCurveRes;
517 }
518 else
519 angle = part->mCurve / part->mCurveRes;
520
521 }
522
523 // add in variance just for kicks...
524 angle += llfrand_signed(part->mCurveV/part->mCurveRes, mRandOffset[level + i]++);
525
526 /* vertical attraction is based on height of branch which is unavailable information
527 if (level > 1)
528 angle += CalculateVerticalAttraction(level, curFrame);
529 //*/
530
531 angle *= DEG_TO_RAD;
532
533 // translation...
534 F32 zStep;
535 zStep = CalcZStep(part, i);
536 stemZ += zStep;
537
538 // set the next startingZ as current stemZ if at first level
539 if (i == j || (level == 0 && j == 0 && i == sParameters.mFlareRes - 1))
540 startingZ = stemZ;
541
542 LLQuaternion rotateQuat, oldRotateQuat, newRotateQuat;
543 LLMatrix4 localFrame, transFrame;
544
545 rotateQuat.setQuat(angle, 1.0f, 0.0f, 0.0f);
546 oldRotateQuat.setQuat(curFrame);
547 newRotateQuat = oldRotateQuat * rotateQuat;
548
549 transFrame.translate(LLVector3(0, 0, zStep));
550 transFrame.rotate(newRotateQuat);
551
552 localFrame.rotate(newRotateQuat);
553 localFrame.translate(curFrame.getTranslation());
554 localFrame.translate(transFrame.getTranslation());
555
556 curFrame = localFrame;
557
558 // store flare frames seperately
559 if (part->mLevel == 0 && i < sParameters.mFlareRes)
560 mTrunkFlareFrames[flareFramesUsed++] = curFrame;
561 else
562 part->mFrames[k][framesUsed++] = curFrame;
563
564 // calc radius of section
565 if (part->mLength == 0)
566 sectionRadius = 0;
567 else
568 sectionRadius = CalculateSectionRadius(level, stemZ / part->mLength, part->mLength, part->mRadius);
569
570 // create points that make up the section
571 createSection(curFrame, part, sectionRadius, stemZ,
572 vertices, tex_coords, indices,
573 curVertexIndex, curTexCoordIndex, curIndiceIndex, curSection++, j == 0 ? TRUE : FALSE);
574 }
575
576 // only do one trunk w/ flaring.
577 if (level == 0 && j == 0) j = sParameters.mFlareRes - 1;
578 }
579
580 // gen vertex normals now that we've created face normals for the first section...
581 genVertexNormals(part, normals, numSections, curNormalIndex);
582 }
583
584}
585
586
587
588
589void LLVOTreeNew::createSection(LLMatrix4 &frame, TreePart *part, F32 sectionRadius, F32 stemZ,
590 LLStrider<LLVector3> &vertices, LLStrider<LLVector2> &tex_coords, U32 *indices,
591 U32 &curVertexIndex, U32 &curTexCoordIndex, U32 &curIndiceIndex, U8 curSection, BOOL firstBranch)
592{
593
594 F32 angle; // Angle holds the angle in radians
595 // between two points in the section.
596
597 LLVector3 localPoint; // LocalPoint is used to hold the points
598 // that are being created and added to
599 // the points list of the section (in
600 // local coordinates)
601
602 LLVector3 globalPoint; // GlobalPoint is used to hold the points
603 // that are being created and added to
604 // the points list of the section (in
605 // global coordinates)
606
607 F32 lobedSectionRadius; // The sectionradius rescaled using
608 // the lobing parameters
609
610 F32 percentX, percentY; // The texture coords
611
612
613
614 U8 numVerts = part->mVertsPerSection;
615
616 // prevent empty triangles
617 if (sectionRadius < 0.0001) {
618 sectionRadius = 0.0001f;
619 }
620
621 // Y texture coordinate
622 // stemZ is current position within mLength...
623 percentY = stemZ;
624 //percentY = stemZ/part->mLength;
625
626 angle = (2 * F_PI) / numVerts;
627 for (U8 i = 0; i <= numVerts; i++)
628 {
629 // last vertex is same as first one...
630 if (i == numVerts)
631 {
632 // make first vertice the last vertice (wrap around so that our texture coords will be ok...
633 globalPoint = vertices[curVertexIndex - numVerts];
634 }
635 else
636 {
637 // lobed = 1.0 + lobeDepth * sin(lobes * angle)
638 lobedSectionRadius = sectionRadius * (1.f + sParameters.mLobeDepth * sin(sParameters.mLobes * (i + 1) * angle));
639
640 localPoint.mV[0] = cos((i + 1.f) * angle) * lobedSectionRadius;
641 localPoint.mV[1] = sin((i + 1.f) * angle) * lobedSectionRadius;
642 localPoint.mV[2] = 0;
643
644 globalPoint = localPoint * frame;
645 }
646
647 if (curVertexIndex > NUM_INIT_VERTS) {
648 llinfos << "TREE ERROR NO MORE VERTS" << llendl;
649 return;
650 }
651
652 // add to instanced data...
653 vertices[curVertexIndex++] = globalPoint;
654 mTotalVerts++;
655
656 /*
657 // update the max x, y, and z of tree
658 if (globalPoint->mV[0] > mTree->mMaxX) { mTree->mMaxX = globalPoint->mV[0]; }
659 if (globalPoint->mV[1] > mTree->mMaxY) { mTree->mMaxY = globalPoint->mV[1]; }
660 if (globalPoint->mV[2] > mTree->mMaxZ) { mTree->mMaxZ = globalPoint->mV[2]; }
661 */
662
663 // TEXTURE COORDS
664 percentX = WIDTH_OF_BARK * (i/F32(numVerts));// * (2.0*F_PI*sectionRadius);
665 //percentX = * (i/F32(numVerts));
666 tex_coords[curTexCoordIndex++] = LLVector2(percentX, percentY);
667 }
668
669 // gen face normals and do texcoords...
670 if (curSection != 0)
671 genIndicesAndFaceNormalsForLastSection(part, numVerts, vertices, curVertexIndex, indices, curIndiceIndex, firstBranch);
672}
673
674
675// generate face normals for the last two cross sections in sectionlist
676void LLVOTreeNew::genIndicesAndFaceNormalsForLastSection(TreePart *part, U8 numVerts, LLStrider<LLVector3> &vertices, U32 curVertexIndex, U32 *indices, U32 &curIndiceIndex, BOOL firstBranch)
677{
678
679 LLVector3 v1, v2;
680 LLVector3 vCross;
681 LLVector3 a, b, c, d;
682
683 // offsets into the vertex array
684 U32 upperOffset = curVertexIndex - (numVerts + 1);
685 U32 lowerOffset = upperOffset - (numVerts + 1);
686
687 // generate the normals for the triangles from the quads
688 // quad is defined by:
689 // upper[i].....upper[i+1]
690 // . .
691 // . .
692 // . .
693 // lower[i].....lower[i+1]
694
695 // 10.......11
696 // . . .
697 // . . .
698 // . . .
699 // 00 . . . 01
700
701 // b . . . d
702 // . . .
703 // . . .
704 // . . .
705 // a . . . c
706
707 for (U8 j = 0; j < numVerts; j++ ) {
708
709 U8 nextVert = j + 1;
710
711 // do face normals for first version only
712 if (firstBranch)
713 {
714 // the points of the quad
715 a = vertices[lowerOffset]; // 00
716 b = vertices[upperOffset]; // 10
717 c = vertices[lowerOffset + nextVert]; // 01
718 d = vertices[upperOffset + nextVert]; // 11
719
720 // 1st triangle
721 v1 = c - b;
722 v2 = a - b;
723 vCross = v1 % v2;
724 vCross.normVec();
725 part->mFaceNormals.put(vCross);
726
727 // 2nd triangle
728 v1 = c - b;
729 v2 = d - b;
730 vCross = v1 % v2;
731 vCross.normVec();
732 part->mFaceNormals.put(vCross);
733 }
734
735 if (curIndiceIndex + 6 > NUM_INIT_INDICES)
736 {
737 llinfos << "TREE ERROR NO MORE INDICES" << llendl;
738 return;
739 }
740
741 indices[curIndiceIndex++] = lowerOffset + j; // 00
742 indices[curIndiceIndex++] = lowerOffset + nextVert; // 01
743 indices[curIndiceIndex++] = upperOffset + j; // 10
744 if (firstBranch) { part->mNumTris++; }
745
746 indices[curIndiceIndex++] = lowerOffset + nextVert; // 01
747 indices[curIndiceIndex++] = upperOffset + nextVert; // 11
748 indices[curIndiceIndex++] = upperOffset + j; // 10
749 if (firstBranch) { part->mNumTris++; }
750
751 mTotalIndices += 6;
752 //*/
753 }
754}
755
756
757
758
759void LLVOTreeNew::genVertexNormals(TreePart *part, LLStrider<LLVector3> &normals, U8 numSections, U32 curNormalIndex)
760{
761 LLVector3 vNormal;
762
763 U8 numVerts = part->mVertsPerSection;
764 U16 numFaces = numVerts * 2;
765
766 U32 curSectionFaceOffset, lowerSectionFaceOffset;
767
768 U8 i;
769 U8 j;
770
771 // for each section...
772 for (i = 0; i < numSections; i++) {
773
774 U32 numFacesStored = part->mFaceNormals.count();
775 // index into face normals for 0-ith face of section i...
776 curSectionFaceOffset = numFacesStored - (numSections - 1 - i)*numFaces;
777 lowerSectionFaceOffset = curSectionFaceOffset - numFaces;
778
779 // for each vertex...
780 for (j = 0; j < numVerts; j++) {
781
782 // if lowest level or highest level...
783 if (i == 0) {
784 // bottom 3 adjacent tris
785 vNormal += part->mFaceNormals[curSectionFaceOffset + (numFaces - j*2 - 2) % numFaces];
786 vNormal += part->mFaceNormals[curSectionFaceOffset + (numFaces - j*2 - 1) % numFaces];
787 vNormal += part->mFaceNormals[curSectionFaceOffset + (numFaces - j*2) % numFaces];
788 vNormal /= 3.0;
789 } else if (i == numSections - 1) {
790 // top 3 adj tris
791 vNormal += part->mFaceNormals[lowerSectionFaceOffset + (numFaces - j*2 - 1) % numFaces];
792 vNormal += part->mFaceNormals[lowerSectionFaceOffset + (numFaces - j*2) % numFaces];
793 vNormal += part->mFaceNormals[lowerSectionFaceOffset + (numFaces - j*2 + 1) % numFaces];
794 vNormal /= 3.0;
795 }
796 else
797 {
798 // otherwise avg the normals from the 6 adjacent tris
799 // avg the 6 normal vectors that are adjacent to it...
800 // vertex 0 is surrounded by...
801 // lower: 0, 1 .... n
802 // upper: n-1, n .... 0
803
804 vNormal += part->mFaceNormals[curSectionFaceOffset + (numFaces - j*2 - 2) % numFaces];
805 vNormal += part->mFaceNormals[curSectionFaceOffset + (numFaces - j*2 - 1) % numFaces];
806 vNormal += part->mFaceNormals[curSectionFaceOffset + (numFaces - j*2) % numFaces];
807
808 vNormal += part->mFaceNormals[lowerSectionFaceOffset + (numFaces - j*2 - 1) % numFaces];
809 vNormal += part->mFaceNormals[lowerSectionFaceOffset + (numFaces - j*2) % numFaces];
810 vNormal += part->mFaceNormals[lowerSectionFaceOffset + (numFaces - j*2 + 1) % numFaces];
811
812 vNormal /= 6.0;
813 }
814 normals[curNormalIndex] = vNormal;
815 curNormalIndex++;
816 }
817 // get first normal and use for the repeated last vertex...
818 normals[curNormalIndex] = normals[curNormalIndex - numVerts];
819 curNormalIndex++;
820 }
821
822
823 // there are mCurveRes - 1 different starting points...
824 U8 offset = 0;
825 U8 curveres8 = (U8)part->mCurveRes;
826 for (i = 0; i < curveres8 - 1; i++)
827 {
828 U8 numSectionsInBranch = curveres8 - i;
829 U8 origOffset = i * numVerts;
830
831 for (j = 0; j <= numSectionsInBranch * numVerts; j++)
832 normals[curNormalIndex + offset + j] = normals[curNormalIndex + origOffset + j];
833
834 offset += numSectionsInBranch * numVerts;
835 }
836
837
838}
839
840
841
842//{ Pre: 0 <= y <= 1
843// Ret: The radius of the stem at the (normalized) y position along the stem.
844// See for the exact calculations the paper "Creation and Rendering of
845// Realistic Trees", by Jason Weber and Joseph Penn. }
846
847
848F32 LLVOTreeNew::CalculateSectionRadius(U8 level, F32 y, F32 stemLength, F32 stemRadius)
849{
850 F32 y2, y3;
851
852 F32 depth; // Scaling factor used for periodic tapering
853 F32 taperY; // Tapered radius along at the (normalized) y
854 // position along the stem
855 F32 unitTaper; // UnitTaper is used to determine the radius of
856 // the stem along a specified (normalized)
857 // position along the stem.
858
859 F32 radius; // radius returned
860
861 // { Calculate UnitTaper, a variable used to determine the radius of the
862 // stem along a specified (normalized) position Z along the stem }
863
864 unitTaper = 0;
865
866 F32 curTaper = sParameters.mTaper[level]; // cur taper for this level
867
868 // 0 <= nTaper < 1
869 // unitTaper = nTaper
870 // 1 <= nTaper < 2
871 // unitTaper = 2 - nTaper
872 // 2 <= nTaper < 3
873 // unitTaper = 0
874
875 if ( (curTaper >= 0) && (curTaper < 1) )
876 unitTaper = curTaper;
877 else if ( (curTaper >= 1) && (curTaper < 2) )
878 unitTaper = 2.f - curTaper;
879 else // should be 2 <= curTaper < 3
880 unitTaper = 0;
881
882
883 // y is ratio of stemY/length...sometimes [something.mumble] / [something.mumble] != 1 when it should...
884 if (y > 1.0)
885 y = 1.0;
886
887 // taperY = radius[stem] * (1 - unitTaper * y)
888 taperY = stemRadius * (1.f - unitTaper * y);
889
890 // 0 <= curTaper <= 1
891 // radius = taperY;
892
893 if ( (curTaper >= 0) && (curTaper < 1) )
894 {
895 radius = taperY;
896 }
897 else
898 {
899 // { (nTaper[ALevel] >= 1) and (nTaper[ALevel] <= 3) }
900
901 // initialize y2
902 y2 = (1 - y) * stemLength;
903
904 // initialize depth
905
906 if ( (curTaper < 2) || (y2 < taperY) )
907 depth = 1;
908 else
909 depth = curTaper - 2;
910
911 // initialize y3
912 if ( curTaper < 2)
913 y3 = y2;
914 else
915 y3 = fabs(y2 - 2 * taperY * floor(y2 / (2 * taperY) + 0.5f));
916
917 // return the radius
918 if ( (curTaper < 2) && (y3 >= taperY) )
919 radius = taperY;
920 else
921 radius = (1 - depth) * taperY + depth * sqrt(pow(taperY, 2) - pow(y3 - taperY, 2));
922 }
923
924 // calculate flaring
925 if (level == 0)
926 {
927 y2 = 1 - 8 * y;
928 if (y2 < 0)
929 y2 = 0;
930
931 // flare = Flare * (100^y - 1) / 100 + 1
932 radius = radius * (sParameters.mFlare * (pow((F32)100, y2) - 1) / 100 + 1);
933 }
934
935 return radius;
936}
937
938/*
939F32 LLVOTreeNew::CalculateVerticalAttraction(U8 level, LLMatrix4 &sectionFrame)
940{
941 LLVector3 transformY, transformZ;
942 LLVector3 unitY(0.0, 1.0, 0.0);
943 LLVector3 unitZ(0.0, 0.0, 1.0);
944 F32 declination, orientation;
945
946 transformY = unitY * sectionFrame;
947 transformZ = unitZ * sectionFrame;
948
949 declination = acos(transformZ.mV[1]);
950 orientation = acos(transformY.mV[1]);
951
952 return (sParameters.mAttractionUp * declination * cos(orientation)) / sParameters.mCurveRes[level];
953}
954//*/
955
956
957void LLVOTreeNew::drawTree(LLDrawPool &draw_pool)
958{
959 U8 i, j;
960
961 // seed the drawtree thing with the object's uuid to make it original but predictable...
962 // don't re-seed the process random number generator. bad.
963 //gLindenLabRandomNumber.seed(0);
964
965 // reset the rand offsets
966 for (i = 0; i < MAX_LEVELS; i++) mRandOffset[i] = 0;
967
968 F32 trunkLength = sParameters.mLength[0] * sParameters.mScale;
969 //F32 trunkLength = sParameters.mLength[0] + llfrand_signed(sParameters.mLengthV[0])) *
970 // (sParameters.mScale + llfrand_signed(sParameters.mScaleV));
971 F32 trunkRad = trunkLength * sParameters.mRatio * sParameters.mScale0;
972
973//* reset usage data on which part is grabbed
974 mNumTrisDrawn = 0;
975 for (i = 0; i < MAX_PARTS; i++)
976 for (j = 0; j < MAX_VARS; j++)
977 sTreePartsUsed[mSpecies][i][j] = 0;
978
979 // reset segsplit error stuff...
980 for (j = 0; j < 3; j++)
981 mSegSplitsError[j] = 0;
982
983 //llinfos << "\nTREE Starting" << llendl;
984 drawTree(draw_pool, LLMatrix4(), 0, 0, trunkLength, 0, trunkRad, 0, 0, 0, 0);
985 //llinfos << "\nTREE Ending" << llendl;
986
987 /*
988 // print part usage info:
989 for (i = 0; i < MAX_PARTS; i++)
990 {
991 llinfos << "TREE part: " << U32(i) << ": " << llendl;
992 for (j = 0; j < MAX_VARS; j++)
993 llinfos << "\t variant " << U32(j) << ": [" << U32(sTreePartsUsed[mSpecies][i][j]) << "], " << llendl;
994 llinfos << "" << llendl;
995 }
996 //*/
997
998/*
999 glTranslatef(0.0, 0.0, 5.0);
1000 for (i = 0; i < sNextPartIndex[mSpecies]; i++)
1001 {
1002 TreePart *selectedPart = &(sTreeParts[mSpecies][i]);
1003 glTranslatef(2.0, 0.0, 0.0);
1004
1005 // draw a variant...
1006 for (U8 k = 0; k < selectedPart->mNumVariants; k++)
1007 {
1008 // start at the indice index
1009 U32 prevOffset = 0;//selectedPart->mIndiceIndex[k];
1010
1011
1012 if (selectedPart->mLevel == 0 && k == 0)
1013 {
1014 // draw the original one with flare...
1015 glTranslatef(1.0, 0.0, 0.0);
1016 glPushMatrix();
1017 glDrawElements(GL_TRIANGLES, selectedPart->mNumTris*3, GL_UNSIGNED_INT, draw_pool.getRawIndices() + selectedPart->mIndiceIndex[k]);
1018 glPopMatrix();
1019 prevOffset += selectedPart->mNumTris*3;
1020 }
1021
1022 // draw each of the curveRes iterations...
1023 for (j = 0; j < selectedPart->mCurveRes; j++)
1024 {
1025 U32 numTris = (selectedPart->mCurveRes - j) * selectedPart->mVertsPerSection * 2;
1026 glTranslatef(0.0, 1.0, 0.0);
1027 glPushMatrix();
1028 glDrawElements(GL_TRIANGLES, numTris*3, GL_UNSIGNED_INT, draw_pool.getRawIndices() + selectedPart->mIndiceIndex[k] + prevOffset);
1029 glPopMatrix();
1030 prevOffset += numTris*3;
1031 }
1032 }
1033 }
1034//*/
1035}
1036
1037void LLVOTreeNew::drawTree(LLDrawPool &draw_pool, const LLMatrix4 &frame, U8 level, F32 offsetChild,
1038 F32 curLength, F32 parentLength, F32 curRadius, F32 parentRadius,
1039 U8 part, U8 variant, U8 startSection)
1040{
1041 U8 i, j, k;
1042
1043 // if startSection != 0, we're doing a segsplit.
1044
1045 // find the tree part most similar (if we're not doing a segsplit)
1046 if (startSection == 0)
1047 {
1048 S32 similarNum = findSimilarPart(level);
1049 if (similarNum < 0) part = level;
1050 else part = similarNum;
1051 }
1052
1053 TreePart *selectedPart;
1054 selectedPart = &(sTreeParts[mSpecies][part]);
1055
1056 // pick a variant if we're not in a segsplit (and therefore already have one chosen)
1057 //if (startSection == 0) variant = llrand_unsigned(selectedPart->mNumVariants + 1, mRandOffset[level]++);
1058 //if (variant == selectedPart->mNumVariants) variant--;
1059 // manual override
1060 variant = 0;
1061
1062 sTreePartsUsed[mSpecies][part][variant]++;
1063
1064 //llinfos << "TREE part desired: " << U32(level) << ", " << sParameters.mLobeDepth << ", " << curAngleInt << llendl;
1065 //llinfos << "TREE part found: " << U32(selectedPart->mLevel) << ", " << selectedPart->mLobeDepth << ", " << selectedPart->mAngle << llendl;
1066
1067 // determine the scalers so that we meet the desired length/radius...
1068 F32 lengthMultiplier = curLength / selectedPart->mLength;
1069 F32 radiusMultiplier = curRadius / selectedPart->mRadius;
1070 LLMatrix4 scaleMatrix;
1071 scaleMatrix.mMatrix[0][0] = radiusMultiplier;
1072 scaleMatrix.mMatrix[1][1] = radiusMultiplier;
1073 scaleMatrix.mMatrix[2][2] = lengthMultiplier;
1074
1075 // the global rotation this branch will take
1076 LLQuaternion frameQuat;
1077 frameQuat.setQuat(frame);
1078 LLMatrix4 scaledFrame = frame;
1079 scaledFrame *= scaleMatrix;
1080
1081 // start from the previous startSection of the curveRes...try to go till we're at the end of the branch
1082 // i is the current section we're looking at for segment splits
1083
1084 F32 otherRotateAngle = llfrand_signed(360.0f, mRandOffset[level]++);
1085
1086 U8 curSection = startSection;
1087 for (i = startSection; i < selectedPart->mCurveRes - 1; i++)
1088 {
1089 curSection = i + 1;
1090
1091 S32 segSplitsEffective = 0;
1092
1093 // seg split code taken from confusing paragraph of Weber + Penn
1094 F32 segSplit = llfrand_unsigned(sParameters.mSegSplits[level], mRandOffset[level]++);
1095 segSplitsEffective = llround(segSplit + mSegSplitsError[level]);
1096 mSegSplitsError[level] += segSplit - lltrunc(segSplit);
1097 mSegSplitsError[level] -= (segSplitsEffective - segSplit);
1098
1099 // if we've got a seg split, figure out the right rotated frames and send them off...
1100 if (segSplitsEffective > 0)
1101 {
1102 // figure out the declination for this height...
1103 LLVector3 unitZ(0.0f, 0.0f, 1.0f);
1104 LLVector3 transformZ = unitZ * frame;
1105 F32 declination = RAD_TO_DEG*acos(transformZ.mV[1]);
1106
1107 F32 splitAngle = (sParameters.mSplitAngle[level] + llfrand_unsigned(sParameters.mSplitAngleV[level], mRandOffset[level]++)) - declination;
1108 if (splitAngle < 0)
1109 splitAngle = 0;
1110 //splitAngle = sParameters.mDownAngle[2];//45.0f;
1111
1112 // do each seg split...
1113 for (j = 0; j < segSplitsEffective; j++)
1114 {
1115 otherRotateAngle += llround(20.0f + 0.75f*(30.0f + fabs(declination - 90.0f)) * pow(fabs((F32)llrand_signed(1, mRandOffset[level]++)), 2.0f));
1116
1117 //otherRotateAngle += sParameters.mDownAngle[1];//((j + 1) * 360.0)/(segSplitsEffective + 1);
1118
1119 U32 frameOffset = 0;
1120 if (startSection != 0)
1121 {
1122 // offset into the branch that begins with that startsection...
1123 if (level == 0) frameOffset += (U32)selectedPart->mCurveRes - 1;
1124 // i is our start section ...
1125 for (k = 0; k < i; k++)
1126 frameOffset += ((U32)selectedPart->mCurveRes - k);
1127
1128 frameOffset--;
1129 }
1130
1131 LLMatrix4 segFrame;
1132 segFrame = selectedPart->mFrames[variant][frameOffset + curSection - 1];
1133 segFrame *= scaleMatrix;
1134
1135 LLVector3 segFrameTrans = segFrame.getTranslation();
1136 segFrameTrans.rotVec(frameQuat);
1137
1138 LLQuaternion splitQuat, rotateQuat;
1139 splitQuat.setQuat(splitAngle*DEG_TO_RAD, 1.0f, 0.0f, 0.0f);
1140 rotateQuat.setQuat(otherRotateAngle*DEG_TO_RAD, 0.0f, 0.0f, 1.0f);
1141
1142 LLMatrix4 splitFrame;
1143 //splitFrame.rotate(splitQuat * rotateQuat * frameQuat); ??
1144 splitFrame.rotate(frameQuat * splitQuat * rotateQuat);
1145 splitFrame.translate(segFrameTrans);
1146 splitFrame.translate(frame.getTranslation());
1147
1148 // recurse from the current endsection as start section and with the new frame as base
1149 drawTree(draw_pool, splitFrame, level, offsetChild,
1150 curLength, parentLength, curRadius, parentRadius,
1151 part, variant, curSection);
1152 }
1153 }
1154 }
1155
1156
1157 U32 startIndexOffset = 0;
1158
1159 if (startSection != 0)
1160 startIndexOffset = selectedPart->mOffsets[variant][startSection];
1161
1162 U32 numTris;
1163 if (level == 0 && startSection == 0)
1164 numTris = selectedPart->mNumTris;
1165 else
1166 numTris = 2 * selectedPart->mVertsPerSection * ((U8)selectedPart->mCurveRes - startSection);
1167
1168 glPushMatrix();
1169 glMultMatrixf((float *)frame.mMatrix);
1170 glScalef(radiusMultiplier, radiusMultiplier, lengthMultiplier);
1171
1172 //glDrawElements(GL_TRIANGLES, selectedPart->mNumTris*3, GL_UNSIGNED_INT, draw_pool.getRawIndices() + selectedPart->mIndiceIndex + 0);
1173 glDrawElements(GL_TRIANGLES, numTris*3, GL_UNSIGNED_INT, draw_pool.getRawIndices() + selectedPart->mIndiceIndex[variant] + startIndexOffset);
1174 glPopMatrix();
1175
1176 mNumTrisDrawn += numTris;
1177
1178 // figure out how many in next level of branches || leaves
1179 U8 total = 0;
1180 F32 baseLength = 0;
1181
1182 if (level < sParameters.mLevels)
1183 {
1184 if (level == 0)
1185 {
1186 baseLength = sParameters.mBaseSize * (sParameters.mScale + llfrand_signed(sParameters.mScaleV, mRandOffset[level]++));
1187 total = llround( (1.f - sParameters.mBaseSize) * sParameters.mBranches[level]);
1188 }
1189 else if (level == 1)
1190 {
1191 F32 maxLength = sParameters.mLength[level] + llfrand_signed(sParameters.mLengthV[level], mRandOffset[level]++);
1192 total = llround(sParameters.mBranches[level] * (0.2f + 0.8f * ( (curLength/parentLength)/maxLength ) ) );
1193 }
1194 else
1195 {
1196 total = (llround(sParameters.mBranches[level] * (1.0f - 0.5f * (offsetChild/parentLength) )));
1197 }
1198 }
1199 else if (sParameters.mLevels == level)
1200 {
1201 // determine leaves
1202 // see paper for more on:
1203 // leaves_per_branch = Leaves *
1204 // ShapeRatio ( 4 (tapered), offset[child]/length[parent] * quality)
1205
1206 //total = (sParameters.mLeaves * sParameters.ShapeRatio(SR_CONICAL, offsetChild / curLength) * sParameters.mLeafQuality);
1207 total = sParameters.mLeaves;
1208
1209 }
1210
1211 F32 fracPos, offsetPos, localPos;
1212 F32 downAngle, rotateAngle;
1213 U8 currentFrameSegment; // index of matrix transform of the closest cross section to new branch
1214 LLMatrix4 localFrame, curPartFrame, nextPartFrame;
1215
1216 // init stem rotate angle...
1217 rotateAngle = llfrand_unsigned(360.0, mRandOffset[level]++);
1218
1219 // grow the leaf or branch...
1220 for (i = 0; i < total; i++)
1221 {
1222 // note: curLength is the 'parentLength' for all of these substems
1223 localFrame.identity();
1224
1225 // find the fractional, offset and then local pos
1226 if (level == 0)
1227 fracPos = sParameters.mBaseSize + (i) * (1.0f - sParameters.mBaseSize) / (total);
1228 else
1229 fracPos = (i) * (1.0f / (total));
1230
1231 // offset into branch
1232 offsetPos = fracPos*curLength;
1233
1234 U32 frameOffset = 0;
1235 if (startSection != 0)
1236 {
1237 if (level == 0) frameOffset = (U32)selectedPart->mCurveRes;
1238
1239 for (k = 0; k < startSection; k++)
1240 frameOffset += ((U32)selectedPart->mCurveRes - k);
1241 }
1242
1243 F32 curSegAt;
1244 if (level == 0 && startSection == 0)
1245 {
1246 F32 effectiveFlarePercentage = sParameters.mFlarePercentage + (1.0f - sParameters.mFlarePercentage)/selectedPart->mCurveRes;
1247
1248 if (fracPos < effectiveFlarePercentage)
1249 {
1250 if (fracPos > sParameters.mFlarePercentage)
1251 currentFrameSegment = sParameters.mFlareRes - 1;
1252 else
1253 currentFrameSegment = lltrunc( (fracPos/sParameters.mFlarePercentage) / (1.0/sParameters.mFlareRes) );
1254
1255 if (currentFrameSegment == 0)
1256 {
1257 curPartFrame.identity();
1258 nextPartFrame = mTrunkFlareFrames[0];
1259 }
1260 else
1261 {
1262 curPartFrame = mTrunkFlareFrames[currentFrameSegment - 1];
1263 if (currentFrameSegment == sParameters.mFlareRes - 1) nextPartFrame = selectedPart->mFrames[variant][0];
1264 else nextPartFrame = mTrunkFlareFrames[currentFrameSegment];
1265 }
1266
1267 curSegAt = currentFrameSegment * (curLength * sParameters.mFlarePercentage)/sParameters.mFlareRes;
1268 localPos = offsetPos - curSegAt;
1269 }
1270 else
1271 {
1272 // want to go from frameSegment 0 to (1-CurveRes)...don't want to have frame at tip
1273 currentFrameSegment = lltrunc( ( (fracPos - effectiveFlarePercentage)/(1.0 - effectiveFlarePercentage) ) / (1.0 / (selectedPart->mCurveRes - 1)) );
1274 curSegAt = (sParameters.mFlarePercentage * curLength) + (currentFrameSegment + 1.0f) * ( (curLength*(1.0f - sParameters.mFlarePercentage)/(selectedPart->mCurveRes)) );
1275 localPos = offsetPos - curSegAt;
1276 curPartFrame = selectedPart->mFrames[variant][currentFrameSegment];
1277 nextPartFrame = selectedPart->mFrames[variant][currentFrameSegment + 1];
1278 }
1279 //llinfos << "TREE startsection: " << U32(startSection) << " currentSeg: " << U32(currentFrameSegment) << ", is at: " << curSegAt << ", fracpos: " << fracPos << ", offset: " << offsetPos << ", localpos: " << localPos << ", final: " << curSegAt + localPos << llendl;
1280 }
1281 else if (level == 0 && startSection != 0)
1282 {
1283 // if level is zero, don't deal with flared branch positions
1284 if (fracPos < sParameters.mFlarePercentage) continue;
1285
1286 // take FlarePercentage out of fracPos
1287 fracPos = (fracPos - sParameters.mFlarePercentage)/(1 - sParameters.mFlarePercentage);
1288
1289 currentFrameSegment = lltrunc(fracPos / (1.0 / selectedPart->mCurveRes));
1290
1291 // don't do branches below our split starting point
1292 if (currentFrameSegment < startSection) continue;
1293
1294 curSegAt = (sParameters.mFlarePercentage * curLength) + currentFrameSegment*((curLength - sParameters.mFlarePercentage*curLength)/(selectedPart->mCurveRes));
1295 localPos = offsetPos - curSegAt;
1296 currentFrameSegment -= startSection;
1297
1298 if (currentFrameSegment == 0)
1299 {
1300 curPartFrame.identity();
1301 nextPartFrame = selectedPart->mFrames[variant][frameOffset];
1302 }
1303 else
1304 {
1305 curPartFrame = selectedPart->mFrames[variant][frameOffset + currentFrameSegment - 1];
1306 nextPartFrame = selectedPart->mFrames[variant][frameOffset + currentFrameSegment];
1307 }
1308 }
1309 else
1310 {
1311 currentFrameSegment = lltrunc(fracPos / (1.0 / selectedPart->mCurveRes));
1312
1313 // don't do branches below our split starting point
1314 if (currentFrameSegment < startSection) continue;
1315
1316 curSegAt = (currentFrameSegment) * (curLength/(selectedPart->mCurveRes));
1317 localPos = offsetPos - curSegAt;
1318 currentFrameSegment -= startSection;
1319
1320 if (currentFrameSegment == 0)
1321 {
1322 curPartFrame.identity();
1323 nextPartFrame = selectedPart->mFrames[variant][frameOffset];
1324 }
1325 else
1326 {
1327 curPartFrame = selectedPart->mFrames[variant][frameOffset + currentFrameSegment - 1];
1328 nextPartFrame = selectedPart->mFrames[variant][frameOffset + currentFrameSegment];
1329 }
1330 }
1331
1332 if (sParameters.mDownAngle[level] >= 0)
1333 downAngle = sParameters.mDownAngle[level] + llfrand_signed(sParameters.mDownAngleV[level], mRandOffset[level]++);
1334 else
1335 downAngle = sParameters.mDownAngle[level] + sParameters.mDownAngleV[level] *
1336 (1 - 2.0f * sParameters.ShapeRatio(SR_CONICAL, (curLength - offsetPos) / (curLength - baseLength)));
1337
1338 if (sParameters.mRotate[level] >= 0)
1339 rotateAngle += (sParameters.mRotate[level] + llfrand_signed(sParameters.mRotateV[level], mRandOffset[level]++));
1340 else
1341 rotateAngle += (180.0f + sParameters.mRotate[level] + llfrand_signed(sParameters.mRotateV[level], mRandOffset[level]++));
1342
1343 if (sParameters.mLevels == level)
1344 {
1345 downAngle = 0.0;
1346 rotateAngle = 0.0;
1347 }
1348
1349// manual overrides
1350// rotateAngle = sParameters.mRotate[0];
1351// downAngle = sParameters.mDownAngle[0];
1352
1353 LLQuaternion downQuat, rotateQuat, nextQuat, curQuat;
1354 downQuat.setQuat(DEG_TO_RAD*downAngle, 1.0, 0.0, 0.0);
1355 rotateQuat.setQuat(DEG_TO_RAD*rotateAngle, 0.0, 0.0, 1.0);
1356 nextQuat.setQuat(nextPartFrame);
1357 curQuat.setQuat(curPartFrame);
1358
1359 localFrame.identity();
1360
1361 // take the home frame, and rotate by the global frame, translate to the global start
1362 curPartFrame.rotate(frameQuat);
1363
1364 // rotate to the final angle and translate to the bottom of the branch
1365
1366 localFrame.rotate(frameQuat * nextQuat * downQuat * rotateQuat);
1367 // scale our parent frame to put stuff in the right location
1368 curPartFrame *= scaleMatrix;
1369 localFrame.translate(curPartFrame.getTranslation());
1370 //localFrame.translate(scaledFrame.getTranslation());
1371 localFrame.translate(frame.getTranslation());
1372
1373 // offset the branch by a bit and then rotate using current position, add the resulting translation
1374 LLVector3 translateUp(0.0, 0.0, localPos);
1375 translateUp.rotVec(nextQuat * frameQuat);
1376 //translateUp.rotVec(nextQuat);
1377 localFrame.translate(translateUp);
1378
1379
1380 // BRANCHES...
1381 if (level < sParameters.mLevels)
1382 {
1383 F32 subStemLength, maxChildLength;
1384 F32 localRadius, subStemRadius;
1385
1386 // determine a maximum length for this stem's children...
1387 maxChildLength = sParameters.mLength[level+1] + llfrand_signed(sParameters.mLengthV[level+1], mRandOffset[level]++);
1388
1389 // length of child branch
1390 if (level == 0)
1391 subStemLength = curLength * maxChildLength *
1392 sParameters.ShapeRatio(sParameters.mShape, (curLength - offsetPos) / (curLength - baseLength));
1393 else
1394 subStemLength = maxChildLength * (curLength - 0.6f * offsetPos);
1395
1396 // radius of child branch
1397 if (curLength == 0)
1398 subStemRadius = 0;
1399 else
1400 subStemRadius = selectedPart->mRadius * pow((subStemLength / curLength), sParameters.mRatioPower);
1401
1402 // don't have a radius that is larger than parent's
1403 localRadius = CalculateSectionRadius(level, fracPos, selectedPart->mLength, selectedPart->mRadius);
1404 localRadius *= radiusMultiplier;
1405
1406 if ( (subStemRadius > localRadius) || (subStemRadius == 0) )
1407 subStemRadius = localRadius;
1408
1409 if (subStemLength != 0)
1410 drawTree(draw_pool, localFrame, level + 1, offsetPos, subStemLength, curLength, subStemRadius, curRadius, 0, 0, 0);
1411
1412 }
1413 // LEAVES
1414 else if (sParameters.mLevels == level)
1415 {
1416 // for now just draw leaves stupidly...
1417
1418 // draw square leaf (two tris) with the texture on it (then do it again for the other side)
1419 mNumTrisDrawn += 4;
1420//*
1421 F32 leafXscale = 1.0f;
1422 F32 leafYscale = 1.0f;
1423
1424 glPushMatrix();
1425 //LLVector3 position = localFrame.getTranslation();
1426
1427 //glTranslatef(position.mV[0], position.mV[1], position.mV[2]);
1428 glMultMatrixf((float *)localFrame.mMatrix);
1429
1430 glBegin(GL_QUADS);
1431
1432 //*
1433 // 00
1434 glTexCoord2f(0.5f, 0.5f);
1435 glVertex3f(0.0f, 0.0f, 0.0f);
1436 // 10
1437 glTexCoord2f(1.0f, 0.5f);
1438 glVertex3f(0.0f, 0.0f, leafXscale);
1439 // 11
1440 glTexCoord2f(1.0f, 1.0f);
1441 glVertex3f(0.0f, leafYscale, leafXscale);
1442 // 01
1443 glTexCoord2f(0.5f, 1.0f);
1444 glVertex3f(0.0f, leafYscale, 0.0f);
1445 //*/
1446
1447 // 10
1448 glTexCoord2f(1.0f, 0.5f);
1449 glVertex3f(0.0f, 0.0f, leafXscale);
1450 // 00
1451 glTexCoord2f(0.5f, 0.5f);
1452 glVertex3f(0.0f, 0.0f, 0.0f);
1453 // 01
1454 glTexCoord2f(0.5f, 1.0f);
1455 glVertex3f(0.0f, leafYscale, 0.0f);
1456 // 11
1457 glTexCoord2f(1.0f, 1.0f);
1458 glVertex3f(0.0f, leafYscale, leafXscale);
1459
1460 glEnd();
1461 glPopMatrix();
1462//*/
1463 }
1464 }
1465
1466}
1467
1468
1469
1470
diff --git a/linden/indra/newview/llvovolume.cpp b/linden/indra/newview/llvovolume.cpp
index 6791acd..f425687 100644
--- a/linden/indra/newview/llvovolume.cpp
+++ b/linden/indra/newview/llvovolume.cpp
@@ -42,7 +42,6 @@
42#include "material_codes.h" 42#include "material_codes.h"
43#include "message.h" 43#include "message.h"
44#include "object_flags.h" 44#include "object_flags.h"
45
46#include "llagent.h" 45#include "llagent.h"
47#include "lldrawable.h" 46#include "lldrawable.h"
48#include "lldrawpoolsimple.h" 47#include "lldrawpoolsimple.h"
@@ -64,14 +63,14 @@
64#include "pipeline.h" 63#include "pipeline.h"
65 64
66const S32 MIN_QUIET_FRAMES_COALESCE = 30; 65const S32 MIN_QUIET_FRAMES_COALESCE = 30;
67 66const F32 FORCE_SIMPLE_RENDER_AREA = 512.f;
68//#define LLDEBUG_DISPLAY_LODS 1 67const F32 FORCE_CULL_AREA = 8.f;
69 68
70BOOL gAnimateTextures = TRUE; 69BOOL gAnimateTextures = TRUE;
70extern BOOL gHideSelectedObjects;
71 71
72F32 LLVOVolume::sLODFactor = 1.f; 72F32 LLVOVolume::sLODFactor = 1.f;
73F32 LLVOVolume::sLODSlopDistanceFactor = 0.5f; //Changing this to zero, effectively disables the LOD transition slop 73F32 LLVOVolume::sLODSlopDistanceFactor = 0.5f; //Changing this to zero, effectively disables the LOD transition slop
74F32 LLVOVolume::sLODComplexityDistanceBias = 0.0f;//Changing this to zero makes all prims LOD equally regardless of complexity
75F32 LLVOVolume::sDistanceFactor = 1.0f; 74F32 LLVOVolume::sDistanceFactor = 1.0f;
76S32 LLVOVolume::sNumLODChanges = 0; 75S32 LLVOVolume::sNumLODChanges = 0;
77 76
@@ -79,17 +78,14 @@ LLVOVolume::LLVOVolume(const LLUUID &id, const LLPCode pcode, LLViewerRegion *re
79 : LLViewerObject(id, pcode, regionp), 78 : LLViewerObject(id, pcode, regionp),
80 mVolumeImpl(NULL) 79 mVolumeImpl(NULL)
81{ 80{
81 mTexAnimMode = 0;
82 mRelativeXform.identity(); 82 mRelativeXform.identity();
83 mRelativeXformInvTrans.identity(); 83 mRelativeXformInvTrans.identity();
84 84
85 mLOD = MIN_LOD; 85 mLOD = MIN_LOD;
86 mInited = FALSE; 86 mInited = FALSE;
87 mAllTEsSame = FALSE;
88 mTextureAnimp = NULL; 87 mTextureAnimp = NULL;
89 mGlobalVolume = FALSE; 88 mGlobalVolume = FALSE;
90
91 mTextureAnimp = NULL;
92 mAllTEsSame = FALSE;
93 mVObjRadius = LLVector3(1,1,0.5f).magVec(); 89 mVObjRadius = LLVector3(1,1,0.5f).magVec();
94 mNumFaces = 0; 90 mNumFaces = 0;
95} 91}
@@ -142,12 +138,19 @@ U32 LLVOVolume::processUpdateMessage(LLMessageSystem *mesgsys,
142 mTextureAnimp->reset(); 138 mTextureAnimp->reset();
143 } 139 }
144 } 140 }
141 mTexAnimMode = 0;
145 mTextureAnimp->unpackTAMessage(mesgsys, block_num); 142 mTextureAnimp->unpackTAMessage(mesgsys, block_num);
146 } 143 }
147 else 144 else
148 { 145 {
149 delete mTextureAnimp; 146 if (mTextureAnimp)
150 mTextureAnimp = NULL; 147 {
148 delete mTextureAnimp;
149 mTextureAnimp = NULL;
150 gPipeline.markTextured(mDrawable);
151 mFaceMappingChanged = TRUE;
152 mTexAnimMode = 0;
153 }
151 } 154 }
152 155
153 // Unpack volume data 156 // Unpack volume data
@@ -193,8 +196,8 @@ U32 LLVOVolume::processUpdateMessage(LLMessageSystem *mesgsys,
193 // Well, crap, there's something bogus in the data that we're unpacking. 196 // Well, crap, there's something bogus in the data that we're unpacking.
194 dp->dumpBufferToLog(); 197 dp->dumpBufferToLog();
195 llwarns << "Flushing cache files" << llendl; 198 llwarns << "Flushing cache files" << llendl;
196 char mask[LL_MAX_PATH]; 199 char mask[LL_MAX_PATH]; /* Flawfinder: ignore */
197 sprintf(mask, "%s*.slc", gDirUtilp->getDirDelimiter().c_str()); 200 snprintf(mask, LL_MAX_PATH, "%s*.slc", gDirUtilp->getDirDelimiter().c_str()); /* Flawfinder: ignore */
198 gDirUtilp->deleteFilesInDir(gDirUtilp->getExpandedFilename(LL_PATH_CACHE,"").c_str(),mask); 201 gDirUtilp->deleteFilesInDir(gDirUtilp->getExpandedFilename(LL_PATH_CACHE,"").c_str(),mask);
199// llerrs << "Bogus TE data in " << getID() << ", crashing!" << llendl; 202// llerrs << "Bogus TE data in " << getID() << ", crashing!" << llendl;
200 llwarns << "Bogus TE data in " << getID() << llendl; 203 llwarns << "Bogus TE data in " << getID() << llendl;
@@ -219,12 +222,16 @@ U32 LLVOVolume::processUpdateMessage(LLMessageSystem *mesgsys,
219 mTextureAnimp->reset(); 222 mTextureAnimp->reset();
220 } 223 }
221 } 224 }
225 mTexAnimMode = 0;
222 mTextureAnimp->unpackTAMessage(*dp); 226 mTextureAnimp->unpackTAMessage(*dp);
223 } 227 }
224 else 228 else if (mTextureAnimp)
225 { 229 {
226 delete mTextureAnimp; 230 delete mTextureAnimp;
227 mTextureAnimp = NULL; 231 mTextureAnimp = NULL;
232 gPipeline.markTextured(mDrawable);
233 mFaceMappingChanged = TRUE;
234 mTexAnimMode = 0;
228 } 235 }
229 } 236 }
230 else 237 else
@@ -247,65 +254,142 @@ U32 LLVOVolume::processUpdateMessage(LLMessageSystem *mesgsys,
247} 254}
248 255
249 256
250BOOL LLVOVolume::idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time) 257void LLVOVolume::animateTextures()
251{ 258{
252 LLViewerObject::idleUpdate(agent, world, time); 259 F32 off_s = 0.f, off_t = 0.f, scale_s = 1.f, scale_t = 1.f, rot = 0.f;
253 260 S32 result;
254 /////////////////////// 261
255 // 262 if (result = mTextureAnimp->animateTextures(off_s, off_t, scale_s, scale_t, rot))
256 // Do texture animation stuff
257 //
258
259 if (mTextureAnimp && gAnimateTextures)
260 { 263 {
261 F32 off_s, off_t, scale_s, scale_t, rot; 264 if (!mTexAnimMode)
262 S32 result; 265 {
263 if ((result = mTextureAnimp->animateTextures(off_s, off_t, scale_s, scale_t, rot))) 266 mFaceMappingChanged = TRUE;
267 gPipeline.markTextured(mDrawable);
268 }
269 mTexAnimMode = result | mTextureAnimp->mMode;
270
271 S32 start=0, end=mDrawable->getNumFaces()-1;
272 if (mTextureAnimp->mFace >= 0 && mTextureAnimp->mFace <= end)
273 {
274 start = end = mTextureAnimp->mFace;
275 }
276
277 for (S32 i = start; i <= end; i++)
264 { 278 {
265 U8 has_bump = 0; 279 LLQuaternion quat;
266 if (mTextureAnimp->mFace <= -1) 280 LLVector3 scale(1,1,1);
281
282 LLFace* facep = mDrawable->getFace(i);
283 const LLTextureEntry* te = facep->getTextureEntry();
284 LLMatrix4& tex_mat = facep->mTextureMatrix;
285
286 if (!te)
287 {
288 continue;
289 }
290 if (!(result & LLViewerTextureAnim::ROTATE))
291 {
292 te->getRotation(&rot);
293 }
294
267 { 295 {
268 S32 face; 296 F32 axis = -1;
269 for (face = 0; face < getNumTEs(); face++) 297 F32 s,t;
298 te->getScale(&s,&t);
299 if (s < 0)
270 { 300 {
271 if (result & LLViewerTextureAnim::TRANSLATE) 301 axis = -axis;
272 {
273 setTEOffset(face, off_s, off_t);
274 }
275 if (result & LLViewerTextureAnim::SCALE)
276 {
277 setTEScale(face, scale_s, scale_t);
278 }
279 if (result & LLViewerTextureAnim::ROTATE)
280 {
281 setTERotation(face, rot);
282 }
283 has_bump |= getTE(face)->getBumpmap();
284 } 302 }
303 if (t < 0)
304 {
305 axis = -axis;
306 }
307 quat.setQuat(rot, 0, 0, axis);
285 } 308 }
286 else if (mTextureAnimp->mFace < getNumTEs()) 309
310 if (!(result & LLViewerTextureAnim::TRANSLATE))
287 { 311 {
288 if (result & LLViewerTextureAnim::TRANSLATE) 312 te->getOffset(&off_s,&off_t);
313 }
314
315 LLVector3 trans(off_s+0.5f, off_t+0.5f, 0.f);
316
317 tex_mat.identity();
318 tex_mat.translate(LLVector3(-0.5f, -0.5f, 0.f));
319 tex_mat.rotate(quat);
320
321 if (!(result & LLViewerTextureAnim::SCALE))
322 {
323 te->getScale(&scale_s, &scale_t);
324 }
325
326 {
327 scale.setVec(scale_s, scale_t, 1.f);
328 LLMatrix4 mat;
329 mat.initAll(scale, LLQuaternion(), LLVector3());
330 tex_mat *= mat;
331 }
332
333 tex_mat.translate(trans);
334 }
335 }
336 else
337 {
338 if (mTexAnimMode && mTextureAnimp->mRate == 0)
339 {
340 U8 start, count;
341
342 if (mTextureAnimp->mFace == -1)
343 {
344 start = 0;
345 count = getNumTEs();
346 }
347 else
348 {
349 start = (U8) mTextureAnimp->mFace;
350 count = 1;
351 }
352
353 for (S32 i = start; i < start + count; i++)
354 {
355 if (mTexAnimMode & LLViewerTextureAnim::TRANSLATE)
289 { 356 {
290 setTEOffset(mTextureAnimp->mFace, off_s, off_t); 357 setTEOffset(i, mTextureAnimp->mOffS, mTextureAnimp->mOffT);
291 } 358 }
292 if (result & LLViewerTextureAnim::SCALE) 359 if (mTexAnimMode & LLViewerTextureAnim::SCALE)
293 { 360 {
294 setTEScale(mTextureAnimp->mFace, scale_s, scale_t); 361 setTEScale(i, mTextureAnimp->mScaleS, mTextureAnimp->mScaleT);
295 } 362 }
296 if (result & LLViewerTextureAnim::ROTATE) 363 if (mTexAnimMode & LLViewerTextureAnim::ROTATE)
297 { 364 {
298 setTERotation(mTextureAnimp->mFace, rot); 365 setTERotation(i, mTextureAnimp->mRot);
299 } 366 }
300 has_bump |= getTE(mTextureAnimp->mFace)->getBumpmap();
301 }
302// mFaceMappingChanged = TRUE;
303 if (mDrawable->isVisible())
304 {
305 gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_TCOORD, TRUE);
306 } 367 }
368
369 gPipeline.markTextured(mDrawable);
370 mFaceMappingChanged = TRUE;
371 mTexAnimMode = 0;
307 } 372 }
308 } 373 }
374}
375BOOL LLVOVolume::idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time)
376{
377 LLViewerObject::idleUpdate(agent, world, time);
378
379 if (mDead || mDrawable.isNull())
380 {
381 return TRUE;
382 }
383
384 ///////////////////////
385 //
386 // Do texture animation stuff
387 //
388
389 if (mTextureAnimp && gAnimateTextures)
390 {
391 animateTextures();
392 }
309 393
310 // Dispatch to implementation 394 // Dispatch to implementation
311 if (mVolumeImpl) 395 if (mVolumeImpl)
@@ -318,75 +402,45 @@ BOOL LLVOVolume::idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time)
318 402
319void LLVOVolume::updateTextures(LLAgent &agent) 403void LLVOVolume::updateTextures(LLAgent &agent)
320{ 404{
321 405// LLFastTimer t(LLFastTimer::FTM_TEMP6);
406 const F32 TEXTURE_AREA_REFRESH_TIME = 5.f; // seconds
407 if (mTextureUpdateTimer.getElapsedTimeF32() > TEXTURE_AREA_REFRESH_TIME)
408 {
409 if (mDrawable->isVisible())
410 {
411 updateTextures();
412 }
413 }
322} 414}
323 415
324//static 416void LLVOVolume::updateTextures()
325F32 LLVOVolume::getTextureVirtualSize(const LLFace* face)
326{ 417{
327 //LLVector2 tdim = face->mTexExtents[1] - face->mTexExtents[0]; 418 // Update the pixel area of all faces
328 //F32 pixel_area = 1.f/llmin(llmax(tdim.mV[0] * tdim.mV[1], 1.f), 10.f);
329 LLVector3 cross_vec = (face->mExtents[1] - face->mExtents[0]);
330
331
332 LLVector3 lookAt = (face->getPositionAgent()-gCamera->getOrigin());
333 F32 dist = lookAt.normVec();
334 419
335 F32 face_area; 420 if (!gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_SIMPLE))
336
337 if (face->isState(LLFace::GLOBAL))
338 { 421 {
339 face_area = cross_vec.mV[0]*cross_vec.mV[1]*fabsf(lookAt.mV[2]) + 422 return;
340 cross_vec.mV[1]*cross_vec.mV[2]*fabsf(lookAt.mV[0]) +
341 cross_vec.mV[0]*cross_vec.mV[2]*fabsf(lookAt.mV[1]);
342 }
343 else
344 {
345 face_area = cross_vec.mV[0]*cross_vec.mV[1] +
346 cross_vec.mV[1]*cross_vec.mV[2] +
347 cross_vec.mV[0]*cross_vec.mV[2];
348 } 423 }
349 424
350 if (face_area <= 0) 425 if (LLViewerImage::sDontLoadVolumeTextures || mDrawable.isNull()) // || !mDrawable->isVisible())
351 { 426 {
352 return 0.f; 427 return;
353 } 428 }
354 429
355 F32 view = llmax(lookAt*gCamera->getAtAxis(), 0.5f); 430 mTextureUpdateTimer.reset();
356 F32 dist_ramp = dist * view/face_area;
357 //ramp down distance for things closer than 16 m * lookAt
358 dist /= dist_ramp;
359 dist *= dist;
360 dist *= dist_ramp;
361
362 F32 dist_ratio = face_area / llmax(dist, 0.1f);
363 F32 pixel_area = dist_ratio*gCamera->getScreenPixelArea();
364 431
365 return view*pixel_area; 432 F32 old_area = mPixelArea;
366} 433 mPixelArea = 0.f;
367
368void LLVOVolume::updateTextures(S32 lod)
369{
370 // Update the image levels of all textures...
371 // First we do some quick checks.
372 434
373 // This doesn't take into account whether the object is in front
374 // or behind...
375
376 if (LLViewerImage::sDontLoadVolumeTextures || mDrawable.isNull() || !mDrawable->isVisible())
377 {
378 return;
379 }
380
381 const S32 num_faces = mDrawable->getNumFaces(); 435 const S32 num_faces = mDrawable->getNumFaces();
382 436 F32 min_vsize=999999999.f, max_vsize=0.f;
383 for (S32 i = 0; i < num_faces; i++) 437 for (S32 i = 0; i < num_faces; i++)
384 { 438 {
385 const LLFace* face = mDrawable->getFace(i); 439 LLFace* face = mDrawable->getFace(i);
386 const LLTextureEntry *te = face->getTextureEntry(); 440 const LLTextureEntry *te = face->getTextureEntry();
387 LLViewerImage *imagep = face->getTexture(); 441 LLViewerImage *imagep = face->getTexture();
388 442 if (!imagep || !te ||
389 if (!imagep || !te) 443 face->mExtents[0] == face->mExtents[1])
390 { 444 {
391 continue; 445 continue;
392 } 446 }
@@ -395,25 +449,87 @@ void LLVOVolume::updateTextures(S32 lod)
395 449
396 if (isHUDAttachment()) 450 if (isHUDAttachment())
397 { 451 {
398 vsize = (F32) (imagep->getWidth(0) * imagep->getHeight(0)); 452 F32 area = (F32) gCamera->getScreenPixelArea();
453 vsize = area;
399 imagep->setBoostLevel(LLViewerImage::BOOST_HUD); 454 imagep->setBoostLevel(LLViewerImage::BOOST_HUD);
455 face->setPixelArea(area); // treat as full screen
400 } 456 }
401 else 457 else
402 { 458 {
403 vsize = getTextureVirtualSize(face); 459 vsize = getTextureVirtualSize(face);
404 } 460 }
405 461
462 mPixelArea = llmax(mPixelArea, face->getPixelArea());
463 face->setVirtualSize(vsize);
406 imagep->addTextureStats(vsize); 464 imagep->addTextureStats(vsize);
407 465 if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_TEXTURE_AREA))
408 466 {
409 U8 bump = te->getBumpmap(); 467 if (vsize < min_vsize) min_vsize = vsize;
410 if( te && bump) 468 if (vsize > max_vsize) max_vsize = vsize;
469 }
470 else if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_TEXTURE_PRIORITY))
411 { 471 {
412 gBumpImageList.addTextureStats( bump, imagep->getID(), vsize, 1, 1); 472 F32 pri = imagep->getDecodePriority();
473 if (pri < min_vsize) min_vsize = pri;
474 if (pri > max_vsize) max_vsize = pri;
413 } 475 }
476 else if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_FACE_AREA))
477 {
478 F32 pri = mPixelArea;
479 if (pri < min_vsize) min_vsize = pri;
480 if (pri > max_vsize) max_vsize = pri;
481 }
482 }
483
484 if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_TEXTURE_AREA))
485 {
486 setDebugText(llformat("%.0f:%.0f", fsqrtf(min_vsize),fsqrtf(max_vsize)));
487 }
488 else if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_TEXTURE_PRIORITY))
489 {
490 setDebugText(llformat("%.0f:%.0f", fsqrtf(min_vsize),fsqrtf(max_vsize)));
491 }
492 else if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_FACE_AREA))
493 {
494 setDebugText(llformat("%.0f:%.0f", fsqrtf(min_vsize),fsqrtf(max_vsize)));
495 }
496
497 if (mPixelArea == 0)
498 { //flexi phasing issues make this happen
499 mPixelArea = old_area;
414 } 500 }
415} 501}
416 502
503F32 LLVOVolume::getTextureVirtualSize(LLFace* face)
504{
505 //get area of circle around face
506 LLVector3 center = face->getPositionAgent();
507 LLVector3 size = (face->mExtents[1] - face->mExtents[0]) * 0.5f;
508
509 F32 face_area = LLPipeline::calcPixelArea(center, size, *gCamera);
510
511 face->setPixelArea(face_area);
512
513 if (face_area <= 0)
514 {
515 return 0.f;
516 }
517
518 //get area of circle in texture space
519 LLVector2 tdim = face->mTexExtents[1] - face->mTexExtents[0];
520 F32 texel_area = (tdim * 0.5f).magVecSquared()*3.14159f;
521 if (texel_area <= 0)
522 {
523 // Probably animated, use default
524 texel_area = 1.f;
525 }
526
527 //apply texel area to face area to get accurate ratio
528 face_area /= llclamp(texel_area, 1.f/64.f, 16.f);
529
530 return face_area;
531}
532
417BOOL LLVOVolume::isActive() const 533BOOL LLVOVolume::isActive() const
418{ 534{
419 return !mStatic || mTextureAnimp || isAttachment() || (mVolumeImpl && mVolumeImpl->isActive()); 535 return !mStatic || mTextureAnimp || isAttachment() || (mVolumeImpl && mVolumeImpl->isActive());
@@ -455,7 +571,7 @@ void LLVOVolume::setScale(const LLVector3 &scale, BOOL damped)
455 571
456 //since drawable transforms do not include scale, changing volume scale 572 //since drawable transforms do not include scale, changing volume scale
457 //requires an immediate rebuild of volume verts. 573 //requires an immediate rebuild of volume verts.
458 gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_VOLUME, TRUE); 574 gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_POSITION, TRUE);
459 } 575 }
460} 576}
461 577
@@ -463,16 +579,7 @@ LLFace* LLVOVolume::addFace(S32 f)
463{ 579{
464 const LLTextureEntry* te = getTE(f); 580 const LLTextureEntry* te = getTE(f);
465 LLViewerImage* imagep = getTEImage(f); 581 LLViewerImage* imagep = getTEImage(f);
466 LLDrawPool* poolp; 582 return mDrawable->addFace(te, imagep);
467 if (isHUDAttachment())
468 {
469 poolp = gPipeline.getPool(LLDrawPool::POOL_HUD);
470 }
471 else
472 {
473 poolp = LLPipeline::getPoolFromTE(te, imagep);
474 }
475 return mDrawable->addFace(poolp, imagep);
476} 583}
477 584
478LLDrawable *LLVOVolume::createDrawable(LLPipeline *pipeline) 585LLDrawable *LLVOVolume::createDrawable(LLPipeline *pipeline)
@@ -480,7 +587,7 @@ LLDrawable *LLVOVolume::createDrawable(LLPipeline *pipeline)
480 pipeline->allocDrawable(this); 587 pipeline->allocDrawable(this);
481 mDrawable->setRenderType(LLPipeline::RENDER_TYPE_VOLUME); 588 mDrawable->setRenderType(LLPipeline::RENDER_TYPE_VOLUME);
482 589
483 S32 max_tes_to_set = calcAllTEsSame() ? 1 : getNumTEs(); 590 S32 max_tes_to_set = getNumTEs();
484 for (S32 i = 0; i < max_tes_to_set; i++) 591 for (S32 i = 0; i < max_tes_to_set; i++)
485 { 592 {
486 LLFace* face = addFace(i); 593 LLFace* face = addFace(i);
@@ -537,10 +644,6 @@ BOOL LLVOVolume::setVolume(const LLVolumeParams &volume_params, const S32 detail
537 } 644 }
538 mGlobalVolume = (mVolumeImpl && mVolumeImpl->isVolumeGlobal()); 645 mGlobalVolume = (mVolumeImpl && mVolumeImpl->isVolumeGlobal());
539 646
540 //MSMSM Recompute LOD here in case the object was just created,
541 // its LOD might be incorrectly set to minumum detail...
542 calcLOD();
543
544 if (LLPrimitive::setVolume(volume_params, mLOD, (mVolumeImpl && mVolumeImpl->isVolumeUnique()))) 647 if (LLPrimitive::setVolume(volume_params, mLOD, (mVolumeImpl && mVolumeImpl->isVolumeUnique())))
545 { 648 {
546 mFaceMappingChanged = TRUE; 649 mFaceMappingChanged = TRUE;
@@ -555,45 +658,12 @@ BOOL LLVOVolume::setVolume(const LLVolumeParams &volume_params, const S32 detail
555 return FALSE; 658 return FALSE;
556} 659}
557 660
558
559F32 LLVOVolume::computeLODProfilePathComplexityBias(){
560 //compute a complexity cost from 0 to 1.0 where the 'simplest' prim has a cost of 0.0
561 // and the 'heaviest' prim has a cost of 1.0
562// LLVolume* volume = getVolume();
563 F32 complexity = 0.0f;
564// const LLVolumeParams& params = volume->getParams();
565// U8 type = volume->getPathType();
566// U8 pcode = this->getPCode();
567// U8 proftype = volume->getProfileType();
568
569 //if(params.getHollow()>0.0f){// || (proftype == 1) || (proftype == 0)){
570 //If it is hollow, or a cube/pyramid(subdivided), the complexity is roughly doubled
571 // complexity+=0.5f;
572 //}
573
574 if(this->getVolume()->getProfile().mParams.getCurveType()==LL_PCODE_PROFILE_SQUARE &&
575 this->getVolume()->getPath().mParams.getCurveType()==LL_PCODE_PATH_LINE)
576 {
577 //Object is a cube so bias it heavily since cubes are subdivided alot.
578// this->setDebugText("CUBE");
579 complexity += 1.0f;
580 }
581
582// if(params.getTwist() != params.getTwistBegin()){
583 //if there is twist.. the complexity is bumped
584// complexity+=0.25f;
585// }
586// if(type != LL_PCODE_PATH_LINE)//If the path is not a line it is more complex
587// complexity+=0.2f;
588 return complexity * sLODComplexityDistanceBias;
589}
590
591S32 LLVOVolume::computeLODDetail(F32 distance, F32 radius) 661S32 LLVOVolume::computeLODDetail(F32 distance, F32 radius)
592{ 662{
593 S32 cur_detail; 663 S32 cur_detail;
594 // We've got LOD in the profile, and in the twist. Use radius. 664 // We've got LOD in the profile, and in the twist. Use radius.
595 F32 tan_angle = (LLVOVolume::sLODFactor*radius)/distance; 665 F32 tan_angle = (LLVOVolume::sLODFactor*radius)/distance;
596 cur_detail = LLVolumeLODGroup::getDetailFromTan(tan_angle); 666 cur_detail = LLVolumeLODGroup::getDetailFromTan(llround(tan_angle, 0.01f));
597 return cur_detail; 667 return cur_detail;
598} 668}
599 669
@@ -603,62 +673,32 @@ BOOL LLVOVolume::calcLOD()
603 { 673 {
604 return FALSE; 674 return FALSE;
605 } 675 }
676
606 S32 cur_detail = 0; 677 S32 cur_detail = 0;
607 /*if (isHUDAttachment()) 678
679 F32 radius = mVolumep->mLODScaleBias.scaledVec(getScale()).magVec();
680 F32 distance = mDrawable->mDistanceWRTCamera;
681 distance *= sDistanceFactor;
682
683 F32 rampDist = LLVOVolume::sLODFactor * 2;
684
685 if (distance < rampDist)
608 { 686 {
609 cur_detail = LLVolumeLODGroup::NUM_LODS-1; // max detail 687 // Boost LOD when you're REALLY close
688 distance *= 1.0f/rampDist;
689 distance *= distance;
690 distance *= rampDist;
610 } 691 }
611 else*/ 692
612 { 693 // DON'T Compensate for field of view changing on FOV zoom.
613 F32 radius = (mVolumep->mLODScaleBias.scaledVec(getScale())).magVec(); 694 distance *= 3.14159f/3.f;
614 F32 distance = mDrawable->mDistanceWRTCamera;
615 distance *= sDistanceFactor;
616
617 F32 rampDist = LLVOVolume::sLODFactor * 2;
618
619 if (distance < rampDist)
620 {
621 // Boost LOD when you're REALLY close
622 distance *= 1.0f/rampDist;
623 distance *= distance;
624 distance *= rampDist;
625 }
626 else
627 {
628 //Now adjust the computed distance by some factor based on the geometric complexity of the primitive
629 distance += computeLODProfilePathComplexityBias();
630 }
631 // Compensate for field of view changing on FOV zoom.
632 distance *= gCamera->getView();
633
634 cur_detail = computeLODDetail(distance, radius);
635 695
636 //update textures with what the real LOD is 696 cur_detail = computeLODDetail(llround(distance, 0.01f),
637 updateTextures(cur_detail); 697 llround(radius, 0.01f));
638
639 if(cur_detail != mLOD)
640 {
641 // Here we test whether the LOD is increasing or decreasing to introduce a slop factor
642 if(cur_detail < mLOD)
643 {
644 // Viewer is moving away from the object
645 // so bias our LOD by adding a fixed amount to the distance.
646 // This will reduce the problem of LOD twitching when the
647 // user makes slight movements near the LOD transition threshhold.
648 F32 test_distance = distance - (distance*sLODSlopDistanceFactor/(1.0f+sLODFactor));
649 if(test_distance < 0.0f) test_distance = 0.0f;
650 S32 potential_detail = computeLODDetail( test_distance, radius );
651 if(potential_detail >= mLOD )
652 { //The LOD has truly not changed
653 cur_detail = mLOD;
654 }
655 }
656 }
657 }
658 698
659 if (cur_detail != mLOD) 699 if (cur_detail != mLOD)
660 { 700 {
661 mAppAngle = (F32) atan2( mDrawable->getRadius(), mDrawable->mDistanceWRTCamera) * RAD_TO_DEG; 701 mAppAngle = llround((F32) atan2( mDrawable->getRadius(), mDrawable->mDistanceWRTCamera) * RAD_TO_DEG, 0.01f);
662 mLOD = cur_detail; 702 mLOD = cur_detail;
663 return TRUE; 703 return TRUE;
664 } 704 }
@@ -676,17 +716,10 @@ BOOL LLVOVolume::updateLOD()
676 } 716 }
677 717
678 BOOL lod_changed = calcLOD(); 718 BOOL lod_changed = calcLOD();
679 719
680#if LLDEBUG_DISPLAY_LODS
681 //MS Enable this to display LOD numbers on objects
682 std::ostringstream msg;
683 msg << cur_detail;//((cur_detail<mLOD)?"-":cur_detail==mLOD?"=":"+") << (int)cur_detail << " , " << mDrawable->mDistanceWRTCamera << " , " << ((LLVOVolume::sLODFactor*mVObjRadius)/mDrawable->mDistanceWRTCamera);
684 this->setDebugText(msg.str());
685#endif
686
687 if (lod_changed) 720 if (lod_changed)
688 { 721 {
689 gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_GEOMETRY, FALSE); 722 gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_VOLUME, FALSE);
690 mLODChanged = TRUE; 723 mLODChanged = TRUE;
691 } 724 }
692 725
@@ -703,8 +736,8 @@ BOOL LLVOVolume::setDrawableParent(LLDrawable* parentp)
703 736
704 if (!mDrawable->isRoot()) 737 if (!mDrawable->isRoot())
705 { 738 {
706 // parent is dynamic, so I'll need to share its drawable, must rebuild to share drawables 739 // rebuild vertices in parent relative space
707 gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_GEOMETRY, TRUE); 740 gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_VOLUME, TRUE);
708 741
709 if (mDrawable->isActive() && !parentp->isActive()) 742 if (mDrawable->isActive() && !parentp->isActive())
710 { 743 {
@@ -723,7 +756,7 @@ void LLVOVolume::updateFaceFlags()
723{ 756{
724 for (S32 i = 0; i < getVolume()->getNumFaces(); i++) 757 for (S32 i = 0; i < getVolume()->getNumFaces(); i++)
725 { 758 {
726 LLFace *face = mDrawable->getFace(i + mFaceIndexOffset); 759 LLFace *face = mDrawable->getFace(i);
727 BOOL fullbright = getTE(i)->getFullbright(); 760 BOOL fullbright = getTE(i)->getFullbright();
728 face->clearState(LLFace::FULLBRIGHT | LLFace::HUD_RENDER | LLFace::LIGHT); 761 face->clearState(LLFace::FULLBRIGHT | LLFace::HUD_RENDER | LLFace::LIGHT);
729 762
@@ -739,10 +772,17 @@ void LLVOVolume::updateFaceFlags()
739 { 772 {
740 face->setState(LLFace::HUD_RENDER); 773 face->setState(LLFace::HUD_RENDER);
741 } 774 }
742 if (getAllTEsSame()) 775 }
743 { 776}
744 break; // only 1 face 777
745 } 778void LLVOVolume::setParent(LLViewerObject* parent)
779{
780 LLViewerObject::setParent(parent);
781 if (mDrawable)
782 {
783 gPipeline.markMoved(mDrawable);
784 mVolumeChanged = TRUE;
785 gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_VOLUME, TRUE);
746 } 786 }
747} 787}
748 788
@@ -750,104 +790,87 @@ void LLVOVolume::updateFaceFlags()
750void LLVOVolume::regenFaces() 790void LLVOVolume::regenFaces()
751{ 791{
752 // remove existing faces 792 // remove existing faces
753 // use mDrawable->getVOVolume() in case of shared drawables 793 BOOL count_changed = mNumFaces != getNumTEs();
754 mDrawable->getVOVolume()->deleteFaces(this); 794
755 mFaceIndexOffset = mDrawable->getNumFaces(); 795 if (count_changed)
756 // add new faces 796 {
757 mNumFaces = getAllTEsSame() ? 1 : getNumTEs(); 797 deleteFaces();
798 // add new faces
799 mNumFaces = getNumTEs();
800 }
801
758 for (S32 i = 0; i < mNumFaces; i++) 802 for (S32 i = 0; i < mNumFaces; i++)
759 { 803 {
760 LLFace* facep = addFace(i); 804 LLFace* facep = count_changed ? addFace(i) : mDrawable->getFace(i);
761 facep->setViewerObject(this);
762 facep->setTEOffset(i); 805 facep->setTEOffset(i);
806 facep->setTexture(getTEImage(i));
807 facep->setViewerObject(this);
808 }
809
810 if (!count_changed)
811 {
812 updateFaceFlags();
763 } 813 }
764 // Need to do this as texture entries may not correspond to faces any more!
765 mDrawable->updateTexture();
766 gPipeline.markMaterialed(mDrawable);
767} 814}
768 815
769BOOL LLVOVolume::genTriangles(BOOL force_global) 816BOOL LLVOVolume::genBBoxes(BOOL force_global)
770{ 817{
771 BOOL res = TRUE; 818 BOOL res = TRUE;
772 819
773 LLVector3 min,max; 820 LLVector3 min,max;
774 821
775 if (getAllTEsSame()) 822 BOOL rebuild = mDrawable->isState(LLDrawable::REBUILD_VOLUME | LLDrawable::REBUILD_POSITION);
823
824 for (S32 i = 0; i < getVolume()->getNumFaces(); i++)
776 { 825 {
777 setupSingleFace(mFaceIndexOffset); 826 LLFace *face = mDrawable->getFace(i);
778 LLFace *face = mDrawable->getFace(mFaceIndexOffset); 827 res &= face->genVolumeBBoxes(*getVolume(), i,
779 S32 num_faces = getVolume()->getNumFaces(); 828 mRelativeXform, mRelativeXformInvTrans,
780 res = face->genVolumeTriangles(*getVolume(), 0, num_faces-1, 829 mGlobalVolume | force_global);
781 mRelativeXform, mRelativeXformInvTrans,
782 mGlobalVolume | force_global);
783 830
784 if (mDrawable->isState(LLDrawable::REBUILD_VOLUME)) 831 if (rebuild)
785 {
786 min = face->mExtents[0];
787 max = face->mExtents[1];
788 }
789 mWereAllTEsSame = TRUE;
790 }
791 else
792 {
793 for (S32 i = 0; i < getVolume()->getNumFaces(); i++)
794 { 832 {
795 LLFace *face = mDrawable->getFace(i + mFaceIndexOffset); 833 if (i == 0)
796 res &= face->genVolumeTriangles(*getVolume(), i,
797 mRelativeXform, mRelativeXformInvTrans,
798 mGlobalVolume | force_global);
799
800 if (mDrawable->isState(LLDrawable::REBUILD_VOLUME))
801 { 834 {
802 if (i == 0) 835 min = face->mExtents[0];
803 { 836 max = face->mExtents[1];
804 min = face->mExtents[0]; 837 }
805 max = face->mExtents[1]; 838 else
806 } 839 {
807 else 840 for (U32 i = 0; i < 3; i++)
808 { 841 {
809 for (U32 i = 0; i < 3; i++) 842 if (face->mExtents[0].mV[i] < min.mV[i])
810 { 843 {
811 if (face->mExtents[0].mV[i] < min.mV[i]) 844 min.mV[i] = face->mExtents[0].mV[i];
812 { 845 }
813 min.mV[i] = face->mExtents[0].mV[i]; 846 if (face->mExtents[1].mV[i] > max.mV[i])
814 } 847 {
815 if (face->mExtents[1].mV[i] > max.mV[i]) 848 max.mV[i] = face->mExtents[1].mV[i];
816 {
817 max.mV[i] = face->mExtents[1].mV[i];
818 }
819 } 849 }
820 } 850 }
821 } 851 }
822 } 852 }
823 mWereAllTEsSame = FALSE;
824 } 853 }
825 854
826 if (mDrawable->isState(LLDrawable::REBUILD_VOLUME)) 855 if (rebuild)
827 { 856 {
828 mDrawable->setSpatialExtents(min,max); 857 mDrawable->setSpatialExtents(min,max);
829 if (!isVolumeGlobal()) 858 mDrawable->setPositionGroup((min+max)*0.5f);
830 { 859 //bounding boxes changed, update texture priorities
831 mDrawable->setPositionGroup((min+max)*0.5f); 860 updateTextures();
832 }
833 else
834 {
835 mDrawable->setPositionGroup(getPosition());
836 }
837
838 updateRadius();
839 mDrawable->updateBinRadius();
840 mDrawable->movePartition();
841 } 861 }
842 862
863 updateRadius();
864 mDrawable->movePartition();
865
843 return res; 866 return res;
844} 867}
845 868
846void LLVOVolume::updateRelativeXform(BOOL global_volume) 869void LLVOVolume::updateRelativeXform()
847{ 870{
848 if (mVolumeImpl) 871 if (mVolumeImpl)
849 { 872 {
850 mVolumeImpl->updateRelativeXform(global_volume); 873 mVolumeImpl->updateRelativeXform();
851 return; 874 return;
852 } 875 }
853 876
@@ -873,12 +896,25 @@ void LLVOVolume::updateRelativeXform(BOOL global_volume)
873 LLVector4(y_axis, 0.f), 896 LLVector4(y_axis, 0.f),
874 LLVector4(z_axis, 0.f), 897 LLVector4(z_axis, 0.f),
875 LLVector4(delta_pos, 1.f)); 898 LLVector4(delta_pos, 1.f));
876 899
877 x_axis.normVec();
878 y_axis.normVec();
879 z_axis.normVec();
880 900
881 mRelativeXformInvTrans.setRows(x_axis, y_axis, z_axis); 901 // compute inverse transpose for normals
902 // mRelativeXformInvTrans.setRows(x_axis, y_axis, z_axis);
903 // mRelativeXformInvTrans.invert();
904 // mRelativeXformInvTrans.setRows(x_axis, y_axis, z_axis);
905 // grumble - invert is NOT a matrix invert, so we do it by hand:
906
907 LLMatrix3 rot_inverse = LLMatrix3(~delta_rot);
908
909 LLMatrix3 scale_inverse;
910 scale_inverse.setRows(LLVector3(1.0, 0.0, 0.0) / delta_scale.mV[VX],
911 LLVector3(0.0, 1.0, 0.0) / delta_scale.mV[VY],
912 LLVector3(0.0, 0.0, 1.0) / delta_scale.mV[VZ]);
913
914
915 mRelativeXformInvTrans = rot_inverse * scale_inverse;
916
917 mRelativeXformInvTrans.transpose();
882 } 918 }
883 else 919 else
884 { 920 {
@@ -905,34 +941,35 @@ void LLVOVolume::updateRelativeXform(BOOL global_volume)
905 LLVector4(z_axis, 0.f), 941 LLVector4(z_axis, 0.f),
906 LLVector4(pos, 1.f)); 942 LLVector4(pos, 1.f));
907 943
908 x_axis.normVec(); 944 // compute inverse transpose for normals
909 y_axis.normVec(); 945 LLMatrix3 rot_inverse = LLMatrix3(~rot);
910 z_axis.normVec(); 946
911 947 LLMatrix3 scale_inverse;
912 mRelativeXformInvTrans.setRows(x_axis, y_axis, z_axis); 948 scale_inverse.setRows(LLVector3(1.0, 0.0, 0.0) / scale.mV[VX],
949 LLVector3(0.0, 1.0, 0.0) / scale.mV[VY],
950 LLVector3(0.0, 0.0, 1.0) / scale.mV[VZ]);
951
952
953 mRelativeXformInvTrans = rot_inverse * scale_inverse;
954
955 mRelativeXformInvTrans.transpose();
913 } 956 }
914} 957}
915 958
916BOOL LLVOVolume::updateGeometry(LLDrawable *drawable) 959BOOL LLVOVolume::updateGeometry(LLDrawable *drawable)
917{ 960{
918 LLFastTimer t(LLFastTimer::FTM_UPDATE_PRIMITIVES); 961 LLFastTimer t(LLFastTimer::FTM_UPDATE_PRIMITIVES);
919 962
920 if (mVolumeImpl != NULL) 963 if (mVolumeImpl != NULL)
921 { 964 {
922 LLFastTimer t(LLFastTimer::FTM_GEN_FLEX); 965 LLFastTimer t(LLFastTimer::FTM_GEN_FLEX);
923 BOOL res = mVolumeImpl->doUpdateGeometry(drawable); 966 BOOL res = mVolumeImpl->doUpdateGeometry(drawable);
924 updateFaceFlags(); 967 updateFaceFlags();
925 if (res)
926 {
927 drawable->clearState(LLDrawable::REBUILD_GEOMETRY);
928 }
929
930 return res; 968 return res;
931 } 969 }
932 970
933 BOOL compiled = FALSE; 971 BOOL compiled = FALSE;
934 BOOL change_shared = FALSE; 972
935
936 updateRelativeXform(); 973 updateRelativeXform();
937 974
938 if (mDrawable.isNull()) // Not sure why this is happening, but it is... 975 if (mDrawable.isNull()) // Not sure why this is happening, but it is...
@@ -940,28 +977,23 @@ BOOL LLVOVolume::updateGeometry(LLDrawable *drawable)
940 return TRUE; // No update to complete 977 return TRUE; // No update to complete
941 } 978 }
942 979
943 calcAllTEsSame(); 980 if (mVolumeChanged || mFaceMappingChanged )
944
945 if (mVolumeChanged || mFaceMappingChanged || change_shared)
946 { 981 {
947 compiled = TRUE; 982 compiled = TRUE;
948 mInited = TRUE; 983 mInited = TRUE;
949 984
985 if (mVolumeChanged)
950 { 986 {
951 LLFastTimer ftm(LLFastTimer::FTM_GEN_VOLUME); 987 LLFastTimer ftm(LLFastTimer::FTM_GEN_VOLUME);
952 LLVolumeParams volume_params = getVolume()->getParams(); 988 LLVolumeParams volume_params = getVolume()->getParams();
953 setVolume(volume_params, 0); 989 setVolume(volume_params, 0);
954 } 990 drawable->setState(LLDrawable::REBUILD_VOLUME);
955 drawable->setState(LLDrawable::REBUILD_GEOMETRY);
956 if (mVolumeChanged || change_shared)
957 {
958 drawable->setState(LLDrawable::REBUILD_LIGHTING);
959 } 991 }
960 992
961 { 993 {
962 LLFastTimer t(LLFastTimer::FTM_GEN_TRIANGLES); 994 LLFastTimer t(LLFastTimer::FTM_GEN_TRIANGLES);
963 regenFaces(); 995 regenFaces();
964 genTriangles(FALSE); 996 genBBoxes(FALSE);
965 } 997 }
966 } 998 }
967 else if (mLODChanged) 999 else if (mLODChanged)
@@ -983,9 +1015,9 @@ BOOL LLVOVolume::updateGeometry(LLDrawable *drawable)
983 if (new_lod != old_lod) 1015 if (new_lod != old_lod)
984 { 1016 {
985 compiled = TRUE; 1017 compiled = TRUE;
986 sNumLODChanges += (getAllTEsSame() ? 1 : getVolume()->getNumFaces()); 1018 sNumLODChanges += getVolume()->getNumFaces();
987 1019
988 drawable->setState(LLDrawable::REBUILD_ALL); // for face->genVolumeTriangles() 1020 drawable->setState(LLDrawable::REBUILD_VOLUME); // for face->genVolumeTriangles()
989 1021
990 { 1022 {
991 LLFastTimer t(LLFastTimer::FTM_GEN_TRIANGLES); 1023 LLFastTimer t(LLFastTimer::FTM_GEN_TRIANGLES);
@@ -993,7 +1025,7 @@ BOOL LLVOVolume::updateGeometry(LLDrawable *drawable)
993 { 1025 {
994 regenFaces(); 1026 regenFaces();
995 } 1027 }
996 genTriangles(FALSE); 1028 genBBoxes(FALSE);
997 } 1029 }
998 } 1030 }
999 } 1031 }
@@ -1003,7 +1035,7 @@ BOOL LLVOVolume::updateGeometry(LLDrawable *drawable)
1003 compiled = TRUE; 1035 compiled = TRUE;
1004 // All it did was move or we changed the texture coordinate offset 1036 // All it did was move or we changed the texture coordinate offset
1005 LLFastTimer t(LLFastTimer::FTM_GEN_TRIANGLES); 1037 LLFastTimer t(LLFastTimer::FTM_GEN_TRIANGLES);
1006 genTriangles(FALSE); 1038 genBBoxes(FALSE);
1007 } 1039 }
1008 1040
1009 // Update face flags 1041 // Update face flags
@@ -1018,11 +1050,16 @@ BOOL LLVOVolume::updateGeometry(LLDrawable *drawable)
1018 mLODChanged = FALSE; 1050 mLODChanged = FALSE;
1019 mFaceMappingChanged = FALSE; 1051 mFaceMappingChanged = FALSE;
1020 1052
1021 drawable->clearState(LLDrawable::REBUILD_GEOMETRY);
1022
1023 return TRUE; 1053 return TRUE;
1024} 1054}
1025 1055
1056void LLVOVolume::updateFaceSize(S32 idx)
1057{
1058 const LLVolumeFace& vol_face = getVolume()->getVolumeFace(idx);
1059 LLFace* facep = mDrawable->getFace(idx);
1060 facep->setSize(vol_face.mVertices.size(), vol_face.mIndices.size());
1061}
1062
1026BOOL LLVOVolume::isRootEdit() const 1063BOOL LLVOVolume::isRootEdit() const
1027{ 1064{
1028 if (mParent && !((LLViewerObject*)mParent)->isAvatar()) 1065 if (mParent && !((LLViewerObject*)mParent)->isAvatar())
@@ -1034,178 +1071,121 @@ BOOL LLVOVolume::isRootEdit() const
1034 1071
1035void LLVOVolume::setTEImage(const U8 te, LLViewerImage *imagep) 1072void LLVOVolume::setTEImage(const U8 te, LLViewerImage *imagep)
1036{ 1073{
1037// llinfos << "SetTEImage:" << llendl;
1038 BOOL changed = (mTEImages[te] != imagep); 1074 BOOL changed = (mTEImages[te] != imagep);
1039 LLViewerObject::setTEImage(te, imagep); 1075 LLViewerObject::setTEImage(te, imagep);
1040 if (mDrawable.notNull()) 1076 if (changed)
1041 { 1077 {
1042 if (changed) 1078 gPipeline.markTextured(mDrawable);
1043 { 1079 mFaceMappingChanged = TRUE;
1044 calcAllTEsSame();
1045 gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_GEOMETRY, TRUE);
1046 mFaceMappingChanged = TRUE;
1047 }
1048 } 1080 }
1049} 1081}
1050 1082
1051S32 LLVOVolume::setTETexture(const U8 te, const LLUUID &uuid) 1083S32 LLVOVolume::setTETexture(const U8 te, const LLUUID &uuid)
1052{ 1084{
1053 BOOL changed = (uuid != getTE(te)->getID() || (uuid == LLUUID::null));
1054
1055 S32 res = LLViewerObject::setTETexture(te, uuid); 1085 S32 res = LLViewerObject::setTETexture(te, uuid);
1056 if (mDrawable.notNull()) 1086 if (res)
1057 { 1087 {
1058 if (changed) 1088 gPipeline.markTextured(mDrawable);
1059 { 1089 mFaceMappingChanged = TRUE;
1060 calcAllTEsSame();
1061 gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_GEOMETRY, TRUE);
1062 mFaceMappingChanged = TRUE;
1063 }
1064 } 1090 }
1065 return res; 1091 return res;
1066} 1092}
1067 1093
1068S32 LLVOVolume::setTEColor(const U8 te, const LLColor4 &color) 1094S32 LLVOVolume::setTEColor(const U8 te, const LLColor4 &color)
1069{ 1095{
1070 BOOL changed = (color != getTE(te)->getColor());
1071 S32 res = LLViewerObject::setTEColor(te, color); 1096 S32 res = LLViewerObject::setTEColor(te, color);
1072 if (mDrawable.notNull()) 1097 if (res)
1073 { 1098 {
1074 if (changed) 1099 gPipeline.markTextured(mDrawable);
1075 { 1100 mFaceMappingChanged = TRUE;
1076 calcAllTEsSame();
1077// mFaceMappingChanged = TRUE;
1078 }
1079 } 1101 }
1080 return res; 1102 return res;
1081} 1103}
1082 1104
1083S32 LLVOVolume::setTEBumpmap(const U8 te, const U8 bumpmap) 1105S32 LLVOVolume::setTEBumpmap(const U8 te, const U8 bumpmap)
1084{ 1106{
1085 BOOL changed = (bumpmap != getTE(te)->getBumpmap());
1086 S32 res = LLViewerObject::setTEBumpmap(te, bumpmap); 1107 S32 res = LLViewerObject::setTEBumpmap(te, bumpmap);
1087 if (mDrawable.notNull()) 1108 if (res)
1088 { 1109 {
1089 if (changed) 1110 gPipeline.markTextured(mDrawable);
1090 { 1111 mFaceMappingChanged = TRUE;
1091 calcAllTEsSame();
1092 mFaceMappingChanged = TRUE;
1093 }
1094 } 1112 }
1095 return res; 1113 return res;
1096} 1114}
1097 1115
1098S32 LLVOVolume::setTETexGen(const U8 te, const U8 texgen) 1116S32 LLVOVolume::setTETexGen(const U8 te, const U8 texgen)
1099{ 1117{
1100 BOOL changed = (texgen != getTE(te)->getTexGen());
1101 S32 res = LLViewerObject::setTETexGen(te, texgen); 1118 S32 res = LLViewerObject::setTETexGen(te, texgen);
1102 if (mDrawable.notNull()) 1119 if (res)
1103 { 1120 {
1104 if (changed) 1121 gPipeline.markTextured(mDrawable);
1105 { 1122 mFaceMappingChanged = TRUE;
1106 calcAllTEsSame();
1107 mFaceMappingChanged = TRUE;
1108 }
1109 } 1123 }
1110 return res; 1124 return res;
1111} 1125}
1112 1126
1113S32 LLVOVolume::setTEShiny(const U8 te, const U8 shiny) 1127S32 LLVOVolume::setTEShiny(const U8 te, const U8 shiny)
1114{ 1128{
1115 BOOL changed = (shiny != getTE(te)->getShiny());
1116 S32 res = LLViewerObject::setTEShiny(te, shiny); 1129 S32 res = LLViewerObject::setTEShiny(te, shiny);
1117 if (mDrawable.notNull()) 1130 if (res)
1118 { 1131 {
1119 if (changed) 1132 gPipeline.markTextured(mDrawable);
1120 { 1133 mFaceMappingChanged = TRUE;
1121 calcAllTEsSame();
1122 mFaceMappingChanged = TRUE;
1123 }
1124 } 1134 }
1125 return res; 1135 return res;
1126} 1136}
1127 1137
1128S32 LLVOVolume::setTEFullbright(const U8 te, const U8 fullbright) 1138S32 LLVOVolume::setTEFullbright(const U8 te, const U8 fullbright)
1129{ 1139{
1130 BOOL changed = (fullbright != getTE(te)->getFullbright());
1131 S32 res = LLViewerObject::setTEFullbright(te, fullbright); 1140 S32 res = LLViewerObject::setTEFullbright(te, fullbright);
1132 if (mDrawable.notNull()) 1141 if (res)
1133 { 1142 {
1134 if (changed) 1143 gPipeline.markTextured(mDrawable);
1135 { 1144 mFaceMappingChanged = TRUE;
1136 calcAllTEsSame();
1137 if (!mDrawable->isState(LLDrawable::REBUILD_VOLUME))
1138 {
1139 updateFaceFlags();
1140 }
1141 mFaceMappingChanged = TRUE;
1142 }
1143 } 1145 }
1144 return res; 1146 return res;
1145} 1147}
1146 1148
1147S32 LLVOVolume::setTEMediaFlags(const U8 te, const U8 media_flags) 1149S32 LLVOVolume::setTEMediaFlags(const U8 te, const U8 media_flags)
1148{ 1150{
1149 bool changed = (media_flags != getTE(te)->getMediaFlags());
1150 S32 res = LLViewerObject::setTEMediaFlags(te, media_flags); 1151 S32 res = LLViewerObject::setTEMediaFlags(te, media_flags);
1151 if (mDrawable.notNull()) 1152 if (res)
1152 { 1153 {
1153 if (changed) 1154 gPipeline.markTextured(mDrawable);
1154 { 1155 mFaceMappingChanged = TRUE;
1155 calcAllTEsSame();
1156 mFaceMappingChanged = TRUE;
1157 }
1158 } 1156 }
1159 return res; 1157 return res;
1160} 1158}
1161 1159
1162S32 LLVOVolume::setTEScale(const U8 te, const F32 s, const F32 t) 1160S32 LLVOVolume::setTEScale(const U8 te, const F32 s, const F32 t)
1163{ 1161{
1164 F32 olds,oldt;
1165 getTE(te)->getScale(&olds, &oldt);
1166 bool changed = (s != olds || t != oldt);
1167 S32 res = LLViewerObject::setTEScale(te, s, t); 1162 S32 res = LLViewerObject::setTEScale(te, s, t);
1168 if (mDrawable.notNull()) 1163 if (res)
1169 { 1164 {
1170 if (changed) 1165 gPipeline.markTextured(mDrawable);
1171 { 1166 mFaceMappingChanged = TRUE;
1172 calcAllTEsSame();
1173 mFaceMappingChanged = TRUE;
1174 }
1175 } 1167 }
1176 return res; 1168 return res;
1177} 1169}
1178 1170
1179S32 LLVOVolume::setTEScaleS(const U8 te, const F32 s) 1171S32 LLVOVolume::setTEScaleS(const U8 te, const F32 s)
1180{ 1172{
1181 F32 olds,oldt;
1182 getTE(te)->getScale(&olds, &oldt);
1183 bool changed = (s != olds);
1184 S32 res = LLViewerObject::setTEScaleS(te, s); 1173 S32 res = LLViewerObject::setTEScaleS(te, s);
1185 if (mDrawable.notNull()) 1174 if (res)
1186 { 1175 {
1187 if (changed) 1176 gPipeline.markTextured(mDrawable);
1188 { 1177 mFaceMappingChanged = TRUE;
1189 calcAllTEsSame();
1190 mFaceMappingChanged = TRUE;
1191 }
1192 } 1178 }
1193 return res; 1179 return res;
1194} 1180}
1195 1181
1196S32 LLVOVolume::setTEScaleT(const U8 te, const F32 t) 1182S32 LLVOVolume::setTEScaleT(const U8 te, const F32 t)
1197{ 1183{
1198 F32 olds,oldt;
1199 getTE(te)->getScale(&olds, &oldt);
1200 bool changed = (t != oldt);
1201 S32 res = LLViewerObject::setTEScaleT(te, t); 1184 S32 res = LLViewerObject::setTEScaleT(te, t);
1202 if (mDrawable.notNull()) 1185 if (res)
1203 { 1186 {
1204 if (changed) 1187 gPipeline.markTextured(mDrawable);
1205 { 1188 mFaceMappingChanged = TRUE;
1206 calcAllTEsSame();
1207 mFaceMappingChanged = TRUE;
1208 }
1209 } 1189 }
1210 return res; 1190 return res;
1211} 1191}
@@ -1214,137 +1194,11 @@ void LLVOVolume::updateTEData()
1214{ 1194{
1215 if (mDrawable.notNull()) 1195 if (mDrawable.notNull())
1216 { 1196 {
1217 calcAllTEsSame();
1218 mFaceMappingChanged = TRUE; 1197 mFaceMappingChanged = TRUE;
1219 gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_GEOMETRY, TRUE); 1198 gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_MATERIAL, TRUE);
1220 } 1199 }
1221} 1200}
1222 1201
1223BOOL LLVOVolume::calcAllTEsSame()
1224{
1225 BOOL is_alpha = FALSE;
1226 BOOL was_same = mAllTEsSame;
1227 BOOL all_same = TRUE;
1228 S32 num_tes = getNumTEs();
1229
1230 LLViewerImage *first_texturep = getTEImage(0);
1231 if (!first_texturep)
1232 {
1233 return FALSE;
1234 }
1235
1236 const LLTextureEntry *tep = getTE(0);
1237 if (!tep)
1238 {
1239 llwarns << "Volume with zero textures!" << llendl;
1240 return FALSE;
1241 }
1242
1243 if (tep->getColor().mV[3] != 1.f)
1244 {
1245 is_alpha = TRUE;
1246 }
1247 const LLColor4 first_color = tep->getColor();
1248 const U8 first_bump = tep->getBumpShinyFullbright();
1249 const U8 first_media_flags = tep->getMediaTexGen();
1250
1251 if (first_texturep->getComponents() == 4)
1252 {
1253 is_alpha = TRUE;
1254 }
1255
1256 F32 s_scale, t_scale;
1257 tep->getScale(&s_scale, &t_scale);
1258
1259 for (S32 f = 1; f < num_tes; f++)
1260 {
1261 LLViewerImage *texturep = getTEImage(f);
1262 if (texturep != first_texturep)
1263 {
1264 all_same = FALSE;
1265 break;
1266 }
1267
1268 tep = getTE(f);
1269
1270 if( tep->getBumpShinyFullbright() != first_bump )
1271 {
1272 all_same = FALSE;
1273 break;
1274 }
1275
1276 if (first_bump)
1277 {
1278 F32 cur_s, cur_t;
1279 tep->getScale(&cur_s, &cur_t);
1280 if ((cur_s != s_scale) || (cur_t != t_scale))
1281 {
1282 all_same = FALSE;
1283 break;
1284 }
1285 }
1286
1287 if ((texturep->getComponents() == 4) || (tep->getColor().mV[3] != 1.f))
1288 {
1289 if (!is_alpha)
1290 {
1291 all_same = FALSE;
1292 break;
1293 }
1294 }
1295 else if (is_alpha)
1296 {
1297 all_same = FALSE;
1298 break;
1299 }
1300
1301 if (tep->getColor() != first_color)
1302 {
1303 all_same = FALSE;
1304 break;
1305 }
1306
1307 if (tep->getMediaTexGen() != first_media_flags)
1308 {
1309 all_same = FALSE;
1310 break;
1311 }
1312 }
1313
1314 mAllTEsSame = all_same;
1315 if (was_same != all_same)
1316 {
1317 gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_ALL, TRUE); // rebuild NOW
1318 mFaceMappingChanged = TRUE;
1319 }
1320 return mAllTEsSame;
1321}
1322
1323void LLVOVolume::setupSingleFace(S32 face_offset)
1324{
1325 S32 num_indices = 0;
1326 S32 num_vertices = 0;
1327
1328 if (mDrawable.isNull())
1329 {
1330 llerrs << "setupSingleFace called with NULL mDrawable" << llendl;
1331 }
1332 if (face_offset >= mDrawable->getNumFaces())
1333 {
1334 llerrs << "setupSingleFace called with invalid face_offset" << llendl;
1335 }
1336
1337 const S32 num_faces = getVolume()->getNumFaces();
1338 for (S32 i = 0; i < num_faces; i++)
1339 {
1340 const LLVolumeFace &vf = getVolume()->getVolumeFace(i);
1341 num_vertices += vf.mVertices.size();
1342 num_indices += vf.mIndices.size();
1343 }
1344 LLFace *facep = mDrawable->getFace(face_offset);
1345 facep->setSize(num_vertices, num_indices);
1346}
1347
1348//---------------------------------------------------------------------------- 1202//----------------------------------------------------------------------------
1349 1203
1350void LLVOVolume::setIsLight(BOOL is_light) 1204void LLVOVolume::setIsLight(BOOL is_light)
@@ -1388,6 +1242,8 @@ void LLVOVolume::setLightColor(const LLColor3& color)
1388 { 1242 {
1389 param_block->setColor(LLColor4(color, param_block->getColor().mV[3])); 1243 param_block->setColor(LLColor4(color, param_block->getColor().mV[3]));
1390 parameterChanged(LLNetworkData::PARAMS_LIGHT, true); 1244 parameterChanged(LLNetworkData::PARAMS_LIGHT, true);
1245 gPipeline.markTextured(mDrawable);
1246 mFaceMappingChanged = TRUE;
1391 } 1247 }
1392 } 1248 }
1393} 1249}
@@ -1551,7 +1407,7 @@ F32 LLVOVolume::calcLightAtPoint(const LLVector3& pos, const LLVector3& norm, LL
1551 LLVector3 light_dir = light_pos - pos; 1407 LLVector3 light_dir = light_pos - pos;
1552 F32 dist = light_dir.normVec(); 1408 F32 dist = light_dir.normVec();
1553 F32 dp = norm * light_dir; 1409 F32 dp = norm * light_dir;
1554 if ((gPipeline.getVertexShaderLevel(LLPipeline::SHADER_OBJECT) >= LLDrawPoolSimple::SHADER_LEVEL_LOCAL_LIGHTS)) 1410 if ((gPipeline.getLightingDetail() > 2))
1555 { 1411 {
1556 if (dp <= 0) 1412 if (dp <= 0)
1557 { 1413 {
@@ -1590,7 +1446,7 @@ F32 LLVOVolume::calcLightAtPoint(const LLVector3& pos, const LLVector3& norm, LL
1590BOOL LLVOVolume::updateLighting(BOOL do_lighting) 1446BOOL LLVOVolume::updateLighting(BOOL do_lighting)
1591{ 1447{
1592 LLMemType mt1(LLMemType::MTYPE_DRAWABLE); 1448 LLMemType mt1(LLMemType::MTYPE_DRAWABLE);
1593 1449#if 0
1594 if (mDrawable->isStatic()) 1450 if (mDrawable->isStatic())
1595 { 1451 {
1596 do_lighting = FALSE; 1452 do_lighting = FALSE;
@@ -1600,31 +1456,31 @@ BOOL LLVOVolume::updateLighting(BOOL do_lighting)
1600 const LLMatrix3& mat_normal = LLMatrix3(mDrawable->getWorldRotation()); 1456 const LLMatrix3& mat_normal = LLMatrix3(mDrawable->getWorldRotation());
1601 1457
1602 LLVolume* volume = getVolume(); 1458 LLVolume* volume = getVolume();
1603 if (getAllTEsSame()) 1459
1460 for (S32 i = 0; i < volume->getNumFaces(); i++)
1604 { 1461 {
1605 LLFace *face = mDrawable->getFace(mFaceIndexOffset); 1462 LLFace *face = mDrawable->getFace(i);
1606 S32 num_faces = volume->getNumFaces();
1607 if (face && face->getGeomCount()) 1463 if (face && face->getGeomCount())
1608 { 1464 {
1609 face->genLighting(volume, mDrawable, 0, num_faces-1, mat_vert, mat_normal, do_lighting); 1465 face->genLighting(volume, mDrawable, i, i, mat_vert, mat_normal, do_lighting);
1610 }
1611 }
1612 else
1613 {
1614 for (S32 i = 0; i < volume->getNumFaces(); i++)
1615 {
1616 LLFace *face = mDrawable->getFace(i + mFaceIndexOffset);
1617 if (face && face->getGeomCount())
1618 {
1619 face->genLighting(volume, mDrawable, i, i, mat_vert, mat_normal, do_lighting);
1620 }
1621 } 1466 }
1622 } 1467 }
1468#endif
1623 return TRUE; 1469 return TRUE;
1624} 1470}
1625 1471
1626//---------------------------------------------------------------------------- 1472//----------------------------------------------------------------------------
1627 1473
1474U32 LLVOVolume::getVolumeInterfaceID() const
1475{
1476 if (mVolumeImpl)
1477 {
1478 return mVolumeImpl->getID();
1479 }
1480
1481 return 0;
1482}
1483
1628BOOL LLVOVolume::isFlexible() const 1484BOOL LLVOVolume::isFlexible() const
1629{ 1485{
1630 if (getParameterEntryInUse(LLNetworkData::PARAMS_FLEXIBLE)) 1486 if (getParameterEntryInUse(LLNetworkData::PARAMS_FLEXIBLE))
@@ -1715,16 +1571,18 @@ void LLVOVolume::generateSilhouette(LLSelectNode* nodep, const LLVector3& view_p
1715 LLVector3 view_vector; 1571 LLVector3 view_vector;
1716 view_vector = view_point; 1572 view_vector = view_point;
1717 1573
1574 //transform view vector into volume space
1575 view_vector -= getRenderPosition();
1576 mDrawable->mDistanceWRTCamera = view_vector.magVec();
1577 LLQuaternion worldRot = getRenderRotation();
1578 view_vector = view_vector * ~worldRot;
1718 if (!isVolumeGlobal()) 1579 if (!isVolumeGlobal())
1719 { //transform view vector into volume space 1580 {
1720 view_vector -= getRenderPosition();
1721 LLQuaternion worldRot = getRenderRotation();
1722 view_vector = view_vector * ~worldRot;
1723 LLVector3 objScale = getScale(); 1581 LLVector3 objScale = getScale();
1724 LLVector3 invObjScale(1.f / objScale.mV[VX], 1.f / objScale.mV[VY], 1.f / objScale.mV[VZ]); 1582 LLVector3 invObjScale(1.f / objScale.mV[VX], 1.f / objScale.mV[VY], 1.f / objScale.mV[VZ]);
1725 view_vector.scaleVec(invObjScale); 1583 view_vector.scaleVec(invObjScale);
1726 } 1584 }
1727 1585
1728 updateRelativeXform(); 1586 updateRelativeXform();
1729 volume->generateSilhouetteVertices(nodep->mSilhouetteVertices, nodep->mSilhouetteNormals, nodep->mSilhouetteSegments, view_vector, mRelativeXform, mRelativeXformInvTrans); 1587 volume->generateSilhouetteVertices(nodep->mSilhouetteVertices, nodep->mSilhouetteNormals, nodep->mSilhouetteSegments, view_vector, mRelativeXform, mRelativeXformInvTrans);
1730 1588
@@ -1732,33 +1590,15 @@ void LLVOVolume::generateSilhouette(LLSelectNode* nodep, const LLVector3& view_p
1732 } 1590 }
1733} 1591}
1734 1592
1735void LLVOVolume::deleteFaces(LLVOVolume* childp) 1593void LLVOVolume::deleteFaces()
1736{ 1594{
1737 S32 face_count = childp->mNumFaces; 1595 S32 face_count = mNumFaces;
1738 S32 start_index = childp->mFaceIndexOffset;
1739 if (mDrawable.notNull()) 1596 if (mDrawable.notNull())
1740 { 1597 {
1741 mDrawable->deleteFaces(start_index, face_count); 1598 mDrawable->deleteFaces(0, face_count);
1742 }
1743 if (mFaceIndexOffset > start_index)
1744 {
1745 mFaceIndexOffset -= face_count;
1746 } 1599 }
1747 1600
1748 for (U32 i = 0; i < mChildList.size(); i++) 1601 mNumFaces = 0;
1749 {
1750 LLViewerObject* siblingp = mChildList[i];
1751 if (siblingp != childp)
1752 {
1753 if (siblingp->getPCode() == LL_PCODE_VOLUME &&
1754 ((LLVOVolume*)siblingp)->mFaceIndexOffset > start_index)
1755 {
1756 ((LLVOVolume*)siblingp)->mFaceIndexOffset -= face_count;
1757 }
1758 }
1759 }
1760 childp->mFaceIndexOffset = 0;
1761 childp->mNumFaces = 0;
1762} 1602}
1763 1603
1764void LLVOVolume::updateRadius() 1604void LLVOVolume::updateRadius()
@@ -1806,7 +1646,8 @@ const LLMatrix4 LLVOVolume::getRenderMatrix() const
1806 1646
1807void LLVOVolume::writeCAL3D(apr_file_t* fp, std::string& path, std::string& file_base, S32 joint_num, LLVector3& pos, LLQuaternion& rot, S32& material_index, S32& texture_index, std::multimap<LLUUID, LLMaterialExportInfo*>& material_map) 1647void LLVOVolume::writeCAL3D(apr_file_t* fp, std::string& path, std::string& file_base, S32 joint_num, LLVector3& pos, LLQuaternion& rot, S32& material_index, S32& texture_index, std::multimap<LLUUID, LLMaterialExportInfo*>& material_map)
1808{ 1648{
1809 LLPointer<LLImageTGA> tga_image = new LLImageTGA; 1649#if 0
1650 LLImageTGA tga_image;
1810 1651
1811 if (mDrawable.isNull()) 1652 if (mDrawable.isNull())
1812 { 1653 {
@@ -1878,8 +1719,8 @@ void LLVOVolume::writeCAL3D(apr_file_t* fp, std::string& path, std::string& file
1878 my_texture = texture_index++; 1719 my_texture = texture_index++;
1879 1720
1880 //...and export texture as image file 1721 //...and export texture as image file
1881 char filename[MAX_PATH]; 1722 char filename[MAX_PATH]; /* Flawfinder: ignore */
1882 sprintf(filename, "%s\\%s_material_tex_%d.tga", path.c_str(), file_base.c_str(), my_texture); 1723 snprintf(filename, MAX_PATH, "%s\\%s_material_tex_%d.tga", path.c_str(), file_base.c_str(), my_texture); /* Flawfinder: ignore */
1883 1724
1884 LLViewerImage* imagep = facep->getTexture(); 1725 LLViewerImage* imagep = facep->getTexture();
1885 if (imagep->getTexName() == 0) 1726 if (imagep->getTexName() == 0)
@@ -1887,10 +1728,10 @@ void LLVOVolume::writeCAL3D(apr_file_t* fp, std::string& path, std::string& file
1887 llinfos << "No image data available for " << filename << llendl; 1728 llinfos << "No image data available for " << filename << llendl;
1888 continue; 1729 continue;
1889 } 1730 }
1890 LLPointer<LLImageRaw> raw_image = new LLImageRaw; 1731 LLImageRaw raw_image;
1891 imagep->readBackRaw(-1, raw_image); 1732 imagep->readBackRaw(-1, raw_image);
1892 BOOL success = tga_image->encode(raw_image); 1733 BOOL success = tga_image.encode(raw_image);
1893 success = tga_image->save(filename); 1734 success = tga_image.save(filename);
1894 } 1735 }
1895 1736
1896 material_info = new LLMaterialExportInfo(my_material, my_texture, face_color); 1737 material_info = new LLMaterialExportInfo(my_material, my_texture, face_color);
@@ -1931,6 +1772,7 @@ void LLVOVolume::writeCAL3D(apr_file_t* fp, std::string& path, std::string& file
1931 { 1772 {
1932 ((LLVOVolume*)(LLViewerObject*)mChildList[i])->writeCAL3D(fp, path, file_base, joint_num, final_pos, final_rot, material_index, texture_index, material_map); 1773 ((LLVOVolume*)(LLViewerObject*)mChildList[i])->writeCAL3D(fp, path, file_base, joint_num, final_pos, final_rot, material_index, texture_index, material_map);
1933 } 1774 }
1775#endif
1934} 1776}
1935 1777
1936//static 1778//static
@@ -1961,10 +1803,67 @@ void LLVOVolume::parameterChanged(U16 param_type, LLNetworkData* data, BOOL in_u
1961 } 1803 }
1962} 1804}
1963 1805
1806void LLVOVolume::setSelected(BOOL sel)
1807{
1808 LLViewerObject::setSelected(sel);
1809 if (mDrawable.notNull())
1810 {
1811 mDrawable->movePartition();
1812 }
1813}
1814
1964void LLVOVolume::updateSpatialExtents(LLVector3& newMin, LLVector3& newMax) 1815void LLVOVolume::updateSpatialExtents(LLVector3& newMin, LLVector3& newMax)
1965{ 1816{
1966} 1817}
1967 1818
1819F32 LLVOVolume::getBinRadius()
1820{
1821 F32 radius;
1822
1823 const LLVector3* ext = mDrawable->getSpatialExtents();
1824
1825 BOOL shrink_wrap = mDrawable->isAnimating();
1826 BOOL alpha_wrap = FALSE;
1827
1828 if (!isHUDAttachment())
1829 {
1830 for (S32 i = 0; i < mDrawable->getNumFaces(); i++)
1831 {
1832 if (mDrawable->getFace(i)->getPoolType() == LLDrawPool::POOL_ALPHA)
1833 {
1834 alpha_wrap = TRUE;
1835 break;
1836 }
1837 }
1838 }
1839 else
1840 {
1841 shrink_wrap = FALSE;
1842 }
1843
1844 if (alpha_wrap)
1845 {
1846 LLVector3 bounds = getScale();
1847 radius = llmin(bounds.mV[1], bounds.mV[2]);
1848 radius = llmin(radius, bounds.mV[0]);
1849 radius *= 0.5f;
1850 }
1851 else if (shrink_wrap)
1852 {
1853 radius = (ext[1]-ext[0]).magVec()*0.5f;
1854 }
1855 else if (mDrawable->isStatic())
1856 {
1857 radius = 32.f;
1858 }
1859 else
1860 {
1861 radius = 8.f;
1862 }
1863
1864 return llclamp(radius, 0.5f, 256.f);
1865}
1866
1968const LLVector3 LLVOVolume::getPivotPositionAgent() const 1867const LLVector3 LLVOVolume::getPivotPositionAgent() const
1969{ 1868{
1970 if (mVolumeImpl) 1869 if (mVolumeImpl)
@@ -1980,6 +1879,8 @@ void LLVOVolume::onShift(const LLVector3 &shift_vector)
1980 { 1879 {
1981 mVolumeImpl->onShift(shift_vector); 1880 mVolumeImpl->onShift(shift_vector);
1982 } 1881 }
1882
1883 updateRelativeXform();
1983} 1884}
1984 1885
1985const LLMatrix4& LLVOVolume::getWorldMatrix(LLXformMatrix* xform) const 1886const LLMatrix4& LLVOVolume::getWorldMatrix(LLXformMatrix* xform) const
@@ -1993,14 +1894,9 @@ const LLMatrix4& LLVOVolume::getWorldMatrix(LLXformMatrix* xform) const
1993 1894
1994LLVector3 LLVOVolume::agentPositionToVolume(const LLVector3& pos) const 1895LLVector3 LLVOVolume::agentPositionToVolume(const LLVector3& pos) const
1995{ 1896{
1996 if (isVolumeGlobal())
1997 {
1998 return pos;
1999 }
2000
2001 LLVector3 ret = pos - getRenderPosition(); 1897 LLVector3 ret = pos - getRenderPosition();
2002 ret = ret * ~getRenderRotation(); 1898 ret = ret * ~getRenderRotation();
2003 LLVector3 objScale = getScale(); 1899 LLVector3 objScale = isVolumeGlobal() ? LLVector3(1,1,1) : getScale();
2004 LLVector3 invObjScale(1.f / objScale.mV[VX], 1.f / objScale.mV[VY], 1.f / objScale.mV[VZ]); 1900 LLVector3 invObjScale(1.f / objScale.mV[VX], 1.f / objScale.mV[VY], 1.f / objScale.mV[VZ]);
2005 ret.scaleVec(invObjScale); 1901 ret.scaleVec(invObjScale);
2006 1902
@@ -2009,7 +1905,7 @@ LLVector3 LLVOVolume::agentPositionToVolume(const LLVector3& pos) const
2009 1905
2010LLVector3 LLVOVolume::agentDirectionToVolume(const LLVector3& dir) const 1906LLVector3 LLVOVolume::agentDirectionToVolume(const LLVector3& dir) const
2011{ 1907{
2012 return isVolumeGlobal() ? dir : (dir * ~getRenderRotation()); 1908 return dir * ~getRenderRotation();
2013} 1909}
2014 1910
2015LLVector3 LLVOVolume::volumePositionToAgent(const LLVector3& dir) const 1911LLVector3 LLVOVolume::volumePositionToAgent(const LLVector3& dir) const
@@ -2024,6 +1920,9 @@ LLVector3 LLVOVolume::volumePositionToAgent(const LLVector3& dir) const
2024 1920
2025BOOL LLVOVolume::lineSegmentIntersect(const LLVector3& start, LLVector3& end) const 1921BOOL LLVOVolume::lineSegmentIntersect(const LLVector3& start, LLVector3& end) const
2026{ 1922{
1923 return FALSE;
1924
1925#if 0 // needs to be rewritten to use face extents instead of volume bounds
2027 LLVolume* volume = getVolume(); 1926 LLVolume* volume = getVolume();
2028 BOOL ret = FALSE; 1927 BOOL ret = FALSE;
2029 if (volume) 1928 if (volume)
@@ -2043,4 +1942,561 @@ BOOL LLVOVolume::lineSegmentIntersect(const LLVector3& start, LLVector3& end) co
2043 } 1942 }
2044 } 1943 }
2045 return ret; 1944 return ret;
1945#endif
1946}
1947
1948U32 LLVOVolume::getPartitionType() const
1949{
1950 if (isHUDAttachment())
1951 {
1952 return LLPipeline::PARTITION_HUD;
1953 }
1954
1955 return LLPipeline::PARTITION_VOLUME;
1956}
1957
1958LLVolumePartition::LLVolumePartition()
1959: LLSpatialPartition(LLVOVolume::VERTEX_DATA_MASK, FALSE)
1960{
1961 mLODPeriod = 16;
1962 mDepthMask = FALSE;
1963 mDrawableType = LLPipeline::RENDER_TYPE_VOLUME;
1964 mPartitionType = LLPipeline::PARTITION_VOLUME;
1965 mSlopRatio = 0.25f;
1966 mBufferUsage = GL_DYNAMIC_DRAW_ARB;
1967 mImageEnabled = TRUE;
1968}
1969
1970LLVolumeBridge::LLVolumeBridge(LLDrawable* drawablep)
1971: LLSpatialBridge(drawablep, LLVOVolume::VERTEX_DATA_MASK)
1972{
1973 mDepthMask = FALSE;
1974 mLODPeriod = 16;
1975 mDrawableType = LLPipeline::RENDER_TYPE_VOLUME;
1976 mPartitionType = LLPipeline::PARTITION_BRIDGE;
1977
1978 mBufferUsage = GL_DYNAMIC_DRAW_ARB;
1979
1980 mSlopRatio = 0.25f;
1981}
1982
1983void LLVolumeGeometryManager::registerFace(LLSpatialGroup* group, LLFace* facep, U32 type)
1984{
1985 LLMemType mt(LLMemType::MTYPE_SPACE_PARTITION);
1986
1987 if (facep->getViewerObject()->isSelected() && gHideSelectedObjects)
1988 {
1989 return;
1990 }
1991
1992 //add face to drawmap
1993 std::vector<LLDrawInfo*>& draw_vec = group->mDrawMap[type];
1994
1995 S32 idx = draw_vec.size()-1;
1996
1997
1998 BOOL fullbright = (type == LLRenderPass::PASS_FULLBRIGHT ||
1999 type == LLRenderPass::PASS_ALPHA) ? facep->isState(LLFace::FULLBRIGHT) : FALSE;
2000
2001 const LLMatrix4* tex_mat = NULL;
2002 if (type != LLRenderPass::PASS_SHINY && facep->isState(LLFace::TEXTURE_ANIM))
2003 {
2004 tex_mat = &(facep->mTextureMatrix);
2005 }
2006
2007 U8 bump = (type == LLRenderPass::PASS_BUMP ? facep->getTextureEntry()->getBumpmap() : 0);
2008
2009 //LLViewerImage* tex = facep->mAppAngle < FORCE_SIMPLE_RENDER_ANGLE ? NULL : facep->getTexture();
2010 LLViewerImage* tex = facep->getTexture();
2011
2012 if (type == LLRenderPass::PASS_GLOW)
2013 {
2014 U32 start = facep->getGeomIndex();
2015 U32 end = start + facep->getGeomCount()-1;
2016 U32 offset = facep->getIndicesStart();
2017 U32 count = facep->getIndicesCount();
2018 LLDrawInfo* draw_info = new LLDrawInfo(start,end,count,offset,tex,
2019 facep->mVertexBuffer, fullbright, bump);
2020 draw_info->mVSize = facep->getVirtualSize();
2021 draw_vec.push_back(draw_info);
2022 LLVOVolume* volume = (LLVOVolume*) facep->getViewerObject();
2023 BOOL is_light = volume->mDrawable->isLight();
2024
2025// U8 alpha = is_light ? 196 : 160;
2026 LLColor3 col = is_light ? volume->getLightColor() : LLColor3(0,0,0);
2027 LLColor4 col2 = facep->getRenderColor();
2028 draw_info->mGlowColor.setVec((U8) (col.mV[0]*col2.mV[0]*255),
2029 (U8) (col.mV[1]*col2.mV[1]*255),
2030 (U8) (col.mV[2]*col2.mV[2]*255),
2031 196);
2032 draw_info->mTextureMatrix = tex_mat;
2033 validate_draw_info(*draw_info);
2034 }
2035 else if (idx >= 0 &&
2036 draw_vec[idx]->mVertexBuffer == facep->mVertexBuffer &&
2037 draw_vec[idx]->mEnd == facep->getGeomIndex()-1 &&
2038 draw_vec[idx]->mTexture == tex &&
2039#if LL_DARWIN
2040 draw_vec[idx]->mEnd - draw_vec[idx]->mStart + facep->getGeomCount() <= (U32) gGLManager.mGLMaxVertexRange &&
2041 draw_vec[idx]->mCount + facep->getIndicesCount() <= (U32) gGLManager.mGLMaxIndexRange &&
2042#endif
2043 draw_vec[idx]->mFullbright == fullbright &&
2044 draw_vec[idx]->mBump == bump &&
2045 draw_vec[idx]->mTextureMatrix == tex_mat)
2046 {
2047 draw_vec[idx]->mCount += facep->getIndicesCount();
2048 draw_vec[idx]->mEnd += facep->getGeomCount();
2049 draw_vec[idx]->mVSize = llmax(draw_vec[idx]->mVSize, facep->getVirtualSize());
2050 validate_draw_info(*draw_vec[idx]);
2051 }
2052 else
2053 {
2054 U32 start = facep->getGeomIndex();
2055 U32 end = start + facep->getGeomCount()-1;
2056 U32 offset = facep->getIndicesStart();
2057 U32 count = facep->getIndicesCount();
2058 LLDrawInfo* draw_info = new LLDrawInfo(start,end,count,offset,tex,
2059 facep->mVertexBuffer, fullbright, bump);
2060 draw_info->mVSize = facep->getVirtualSize();
2061 draw_vec.push_back(draw_info);
2062 draw_info->mReflectionMap = group->mReflectionMap;
2063 draw_info->mTextureMatrix = tex_mat;
2064 validate_draw_info(*draw_info);
2065 }
2066}
2067
2068void LLVolumeGeometryManager::getGeometry(LLSpatialGroup* group)
2069{
2070
2071}
2072
2073void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group)
2074{
2075 if (group->changeLOD())
2076 {
2077 group->mLastUpdateDistance = group->mDistance;
2078 }
2079
2080 group->mLastUpdateViewAngle = group->mViewAngle;
2081
2082 if (!group->isState(LLSpatialGroup::GEOM_DIRTY |
2083 LLSpatialGroup::ALPHA_DIRTY))
2084 {
2085 return;
2086 }
2087
2088 group->mBuilt = 1.f;
2089 LLFastTimer ftm(LLFastTimer::FTM_REBUILD_VBO);
2090
2091 LLFastTimer ftm2(LLFastTimer::FTM_REBUILD_VOLUME_VB);
2092
2093 //find reflection map
2094 if (group->mSpatialPartition->mImageEnabled)
2095 {
2096 if (group->mReflectionMap.isNull())
2097 {
2098 LLSpatialGroup* parent = group->getParent();
2099 while (parent && group->mReflectionMap.isNull())
2100 {
2101 group->mReflectionMap = parent->mReflectionMap;
2102 parent = parent->getParent();
2103 }
2104 }
2105 }
2106
2107 group->clearDrawMap();
2108
2109 mFaceList.clear();
2110
2111 std::vector<LLFace*> alpha_faces;
2112 U32 vertex_count = 0;
2113 U32 index_count = 0;
2114 U32 useage = group->mSpatialPartition->mBufferUsage;
2115
2116 //get all the faces into a list, putting alpha faces in their own list
2117 for (LLSpatialGroup::element_iter drawable_iter = group->getData().begin(); drawable_iter != group->getData().end(); ++drawable_iter)
2118 {
2119 LLDrawable* drawablep = *drawable_iter;
2120
2121 if (drawablep->isDead())
2122 {
2123 continue;
2124 }
2125
2126 if (drawablep->isAnimating())
2127 { //fall back to stream draw for animating verts
2128 useage = GL_STREAM_DRAW_ARB;
2129 }
2130
2131 LLVOVolume* vobj = drawablep->getVOVolume();
2132
2133 //for each face
2134 for (S32 i = 0; i < drawablep->getNumFaces(); i++)
2135 {
2136 //sum up face verts and indices
2137 drawablep->updateFaceSize(i);
2138 LLFace* facep = drawablep->getFace(i);
2139 if (facep->hasGeometry() && facep->mPixelArea > FORCE_CULL_AREA)
2140 {
2141 const LLTextureEntry* te = facep->getTextureEntry();
2142 LLViewerImage* tex = facep->getTexture();
2143
2144 BOOL force_simple = (facep->mPixelArea < FORCE_SIMPLE_RENDER_AREA);
2145 U32 type = gPipeline.getPoolTypeFromTE(te, tex);
2146 if (type != LLDrawPool::POOL_ALPHA && force_simple)
2147 {
2148 type = LLDrawPool::POOL_SIMPLE;
2149 }
2150 facep->setPoolType(type);
2151
2152 if (vobj->isHUDAttachment())
2153 {
2154 facep->setState(LLFace::FULLBRIGHT);
2155 }
2156
2157 if (vobj->mTextureAnimp && vobj->mTexAnimMode)
2158 {
2159 if (vobj->mTextureAnimp->mFace <= -1)
2160 {
2161 S32 face;
2162 for (face = 0; face < vobj->getNumTEs(); face++)
2163 {
2164 drawablep->getFace(face)->setState(LLFace::TEXTURE_ANIM);
2165 }
2166 }
2167 else if (vobj->mTextureAnimp->mFace < vobj->getNumTEs())
2168 {
2169 drawablep->getFace(vobj->mTextureAnimp->mFace)->setState(LLFace::TEXTURE_ANIM);
2170 }
2171 }
2172
2173 if (type == LLDrawPool::POOL_ALPHA)
2174 {
2175 vertex_count += facep->getGeomCount();
2176 index_count += facep->getIndicesCount();
2177 alpha_faces.push_back(facep);
2178 }
2179 else
2180 {
2181 if (drawablep->isState(LLDrawable::REBUILD_VOLUME))
2182 {
2183 facep->mLastUpdateTime = gFrameTimeSeconds;
2184 }
2185 mFaceList.push_back(facep);
2186 }
2187 }
2188 else
2189 { //face has no renderable geometry
2190 facep->mVertexBuffer = NULL;
2191 facep->mLastVertexBuffer = NULL;
2192 //don't alpha wrap drawables that have only tiny tiny alpha faces
2193 facep->setPoolType(LLDrawPool::POOL_SIMPLE);
2194 }
2195
2196 vobj->updateTextures();
2197 }
2198 }
2199
2200 group->mVertexCount = vertex_count;
2201 group->mIndexCount = index_count;
2202 group->mBufferUsage = useage;
2203
2204 LLStrider<LLVector3> vertices;
2205 LLStrider<LLVector3> normals;
2206 LLStrider<LLVector2> texcoords2;
2207 LLStrider<LLVector2> texcoords;
2208 LLStrider<LLColor4U> colors;
2209 LLStrider<U32> indices;
2210
2211 //PROCESS NON-ALPHA FACES
2212 {
2213 //sort faces by texture
2214 std::sort(mFaceList.begin(), mFaceList.end(), LLFace::CompareTextureAndTime());
2215
2216 std::vector<LLFace*>::iterator face_iter = mFaceList.begin();
2217
2218 LLSpatialGroup::buffer_map_t buffer_map;
2219
2220 while (face_iter != mFaceList.end())
2221 {
2222 //pull off next face
2223 LLFace* facep = *face_iter;
2224 LLViewerImage* tex = facep->getTexture();
2225
2226 U32 index_count = facep->getIndicesCount();
2227 U32 geom_count = facep->getGeomCount();
2228
2229 //sum up vertices needed for this texture
2230 std::vector<LLFace*>::iterator i = face_iter;
2231 ++i;
2232 while (i != mFaceList.end() && (*i)->getTexture() == tex)
2233 {
2234 facep = *i;
2235 ++i;
2236 index_count += facep->getIndicesCount();
2237 geom_count += facep->getGeomCount();
2238 }
2239
2240 //create/delete/resize vertex buffer if needed
2241 LLVertexBuffer* buffer = NULL;
2242 LLSpatialGroup::buffer_map_t::iterator found_iter = group->mBufferMap.find(tex);
2243 if (found_iter != group->mBufferMap.end())
2244 {
2245 buffer = found_iter->second;
2246 }
2247
2248 if (!buffer)
2249 { //create new buffer if needed
2250 buffer = createVertexBuffer(group->mSpatialPartition->mVertexDataMask,
2251 group->mBufferUsage);
2252 buffer->allocateBuffer(geom_count, index_count, TRUE);
2253 }
2254 else
2255 {
2256 if (LLVertexBuffer::sEnableVBOs && buffer->getUsage() != group->mBufferUsage)
2257 {
2258 buffer = createVertexBuffer(group->mSpatialPartition->mVertexDataMask,
2259 group->mBufferUsage);
2260 buffer->allocateBuffer(geom_count, index_count, TRUE);
2261 }
2262 else
2263 {
2264 buffer->resizeBuffer(geom_count, index_count);
2265 }
2266 }
2267
2268 BOOL clean = TRUE;
2269 buffer_map[tex] = buffer;
2270
2271 //add face geometry
2272
2273 //get vertex buffer striders
2274 buffer->getVertexStrider(vertices);
2275 buffer->getNormalStrider(normals);
2276 buffer->getTexCoordStrider(texcoords);
2277 buffer->getTexCoord2Strider(texcoords2);
2278 buffer->getColorStrider(colors);
2279 buffer->getIndexStrider(indices);
2280
2281 U32 indices_index = 0;
2282 U32 index_offset = 0;
2283
2284 while (face_iter < i)
2285 {
2286 facep = *face_iter;
2287 LLDrawable* drawablep = facep->getDrawable();
2288 LLVOVolume* vobj = drawablep->getVOVolume();
2289 LLVolume* volume = vobj->getVolume();
2290
2291 U32 te_idx = facep->getTEOffset();
2292 facep->mIndicesIndex = indices_index;
2293 facep->mGeomIndex = index_offset;
2294 facep->mVertexBuffer = buffer;
2295 {
2296 if (facep->getGeometryVolume(*volume, te_idx, vertices, normals, texcoords, texcoords2, colors, indices,
2297 vobj->getRelativeXform(), vobj->getRelativeXformInvTrans(), index_offset))
2298 {
2299 clean = FALSE;
2300 buffer->markDirty(facep->getGeomIndex(), facep->getGeomCount(),
2301 facep->getIndicesStart(), facep->getIndicesCount());
2302 }
2303 }
2304
2305 indices_index += facep->mIndicesCount;
2306
2307 BOOL force_simple = facep->mPixelArea < FORCE_SIMPLE_RENDER_AREA;
2308 BOOL fullbright = facep->isState(LLFace::FULLBRIGHT);
2309 const LLTextureEntry* te = facep->getTextureEntry();
2310
2311 if (tex->getPrimaryFormat() == GL_ALPHA)
2312 {
2313 registerFace(group, facep, LLRenderPass::PASS_INVISIBLE);
2314 }
2315 else if (fullbright)
2316 {
2317 registerFace(group, facep, LLRenderPass::PASS_FULLBRIGHT);
2318 }
2319 else
2320 {
2321 registerFace(group, facep, LLRenderPass::PASS_SIMPLE);
2322 }
2323
2324 facep->setPoolType(LLDrawPool::POOL_SIMPLE);
2325
2326 if (te->getShiny())
2327 {
2328 registerFace(group, facep, LLRenderPass::PASS_SHINY);
2329 }
2330
2331 if (!force_simple && te->getBumpmap())
2332 {
2333 registerFace(group, facep, LLRenderPass::PASS_BUMP);
2334 }
2335
2336 if (vobj->getIsLight())
2337 {
2338 registerFace(group, facep, LLRenderPass::PASS_GLOW);
2339 }
2340
2341
2342 ++face_iter;
2343 }
2344
2345 if (clean)
2346 {
2347 buffer->markClean();
2348 }
2349 }
2350
2351 group->mBufferMap.clear();
2352 for (LLSpatialGroup::buffer_map_t::iterator i = buffer_map.begin(); i != buffer_map.end(); ++i)
2353 {
2354 group->mBufferMap[i->first] = i->second;
2355 }
2356 }
2357
2358 //PROCESS ALPHA FACES
2359 if (!alpha_faces.empty())
2360 {
2361 //sort alpha faces by distance
2362 std::sort(alpha_faces.begin(), alpha_faces.end(), LLFace::CompareDistanceGreater());
2363
2364 //store alpha faces in root vertex buffer
2365 if (group->mVertexBuffer.isNull() || (LLVertexBuffer::sEnableVBOs && group->mBufferUsage != group->mVertexBuffer->getUsage()))
2366 {
2367 group->mVertexBuffer = createVertexBuffer(group->mSpatialPartition->mVertexDataMask,
2368 group->mBufferUsage);
2369 group->mVertexBuffer->allocateBuffer(group->mVertexCount, group->mIndexCount, true);
2370 stop_glerror();
2371 }
2372 else
2373 {
2374 group->mVertexBuffer->resizeBuffer(group->mVertexCount, group->mIndexCount);
2375 stop_glerror();
2376 }
2377
2378 //get vertex buffer striders
2379 LLVertexBuffer* buffer = group->mVertexBuffer;
2380
2381 BOOL clean = TRUE;
2382
2383 buffer->getVertexStrider(vertices);
2384 buffer->getNormalStrider(normals);
2385 buffer->getTexCoordStrider(texcoords);
2386 buffer->getTexCoord2Strider(texcoords2);
2387 buffer->getColorStrider(colors);
2388 buffer->getIndexStrider(indices);
2389
2390 U32 index_offset = 0;
2391 U32 indices_index = 0;
2392
2393 for (std::vector<LLFace*>::iterator i = alpha_faces.begin(); i != alpha_faces.end(); ++i)
2394 {
2395 LLFace* facep = *i;
2396 LLDrawable* drawablep = facep->getDrawable();
2397 LLVOVolume* vobj = drawablep->getVOVolume();
2398 LLVolume* volume = vobj->getVolume();
2399
2400 U32 te_idx = facep->getTEOffset();
2401 facep->mIndicesIndex = indices_index;
2402 facep->mGeomIndex = index_offset;
2403 facep->mVertexBuffer = group->mVertexBuffer;
2404 if (facep->getGeometryVolume(*volume, te_idx, vertices, normals, texcoords, texcoords2, colors, indices,
2405 vobj->getRelativeXform(), vobj->getRelativeXformInvTrans(), index_offset))
2406 {
2407 clean = FALSE;
2408 buffer->markDirty(facep->getGeomIndex(), facep->getGeomCount(),
2409 facep->getIndicesStart(), facep->getIndicesCount());
2410 }
2411
2412 indices_index += facep->mIndicesCount;
2413
2414 registerFace(group, facep, LLRenderPass::PASS_ALPHA);
2415 }
2416
2417 if (clean)
2418 {
2419 buffer->markClean();
2420 }
2421 }
2422 else
2423 {
2424 group->mVertexBuffer = NULL;
2425 }
2426
2427 //get all the faces into a list, putting alpha faces in their own list
2428 for (LLSpatialGroup::element_iter drawable_iter = group->getData().begin(); drawable_iter != group->getData().end(); ++drawable_iter)
2429 {
2430 LLDrawable* drawablep = *drawable_iter;
2431 drawablep->clearState(LLDrawable::REBUILD_ALL);
2432 }
2433
2434 group->mLastUpdateTime = gFrameTimeSeconds;
2435 group->clearState(LLSpatialGroup::GEOM_DIRTY | LLSpatialGroup::MATRIX_DIRTY |
2436 LLSpatialGroup::ALPHA_DIRTY);
2437
2438 mFaceList.clear();
2046} 2439}
2440
2441void LLGeometryManager::addGeometryCount(LLSpatialGroup* group, U32 &vertex_count, U32 &index_count)
2442{
2443 //initialize to default usage for this partition
2444 U32 usage = group->mSpatialPartition->mBufferUsage;
2445
2446 //clear off any old faces
2447 mFaceList.clear();
2448
2449 //for each drawable
2450 for (LLSpatialGroup::element_iter drawable_iter = group->getData().begin(); drawable_iter != group->getData().end(); ++drawable_iter)
2451 {
2452 LLDrawable* drawablep = *drawable_iter;
2453
2454 if (drawablep->isDead())
2455 {
2456 continue;
2457 }
2458
2459 if (drawablep->isAnimating())
2460 { //fall back to stream draw for animating verts
2461 usage = GL_STREAM_DRAW_ARB;
2462 }
2463
2464 //for each face
2465 for (S32 i = 0; i < drawablep->getNumFaces(); i++)
2466 {
2467 //sum up face verts and indices
2468 drawablep->updateFaceSize(i);
2469 LLFace* facep = drawablep->getFace(i);
2470 if (facep->hasGeometry() && facep->mPixelArea > FORCE_CULL_AREA)
2471 {
2472 vertex_count += facep->getGeomCount();
2473 index_count += facep->getIndicesCount();
2474
2475 //remember face (for sorting)
2476 mFaceList.push_back(facep);
2477 }
2478 else
2479 {
2480 facep->mVertexBuffer = NULL;
2481 facep->mLastVertexBuffer = NULL;
2482 }
2483 }
2484 }
2485
2486 group->mBufferUsage = usage;
2487}
2488
2489LLHUDPartition::LLHUDPartition()
2490{
2491 mPartitionType = LLPipeline::PARTITION_HUD;
2492 mDrawableType = LLPipeline::RENDER_TYPE_HUD;
2493 mSlopRatio = 0.f;
2494 mLODPeriod = 16;
2495}
2496
2497void LLHUDPartition::shift(const LLVector3 &offset)
2498{
2499 //HUD objects don't shift with region crossing. That would be silly.
2500}
2501
2502
diff --git a/linden/indra/newview/llvovolume.h b/linden/indra/newview/llvovolume.h
index 2c12f12..9fb8ca4 100644
--- a/linden/indra/newview/llvovolume.h
+++ b/linden/indra/newview/llvovolume.h
@@ -29,6 +29,7 @@
29#define LL_LLVOVOLUME_H 29#define LL_LLVOVOLUME_H
30 30
31#include "llviewerobject.h" 31#include "llviewerobject.h"
32#include "llspatialpartition.h"
32#include "llviewerimage.h" 33#include "llviewerimage.h"
33#include "llframetimer.h" 34#include "llframetimer.h"
34#include "llapr.h" 35#include "llapr.h"
@@ -60,7 +61,8 @@ public:
60 virtual bool isVolumeGlobal() const = 0; // Are we in global space? 61 virtual bool isVolumeGlobal() const = 0; // Are we in global space?
61 virtual bool isActive() const = 0; // Is this object currently active? 62 virtual bool isActive() const = 0; // Is this object currently active?
62 virtual const LLMatrix4& getWorldMatrix(LLXformMatrix* xform) const = 0; 63 virtual const LLMatrix4& getWorldMatrix(LLXformMatrix* xform) const = 0;
63 virtual void updateRelativeXform(BOOL global_volume = FALSE) = 0; 64 virtual void updateRelativeXform() = 0;
65 virtual U32 getID() const = 0;
64}; 66};
65 67
66// Class which embodies all Volume objects (with pcode LL_PCODE_VOLUME) 68// Class which embodies all Volume objects (with pcode LL_PCODE_VOLUME)
@@ -69,18 +71,26 @@ class LLVOVolume : public LLViewerObject
69public: 71public:
70 static void initClass(); 72 static void initClass();
71 static void preUpdateGeom(); 73 static void preUpdateGeom();
72 static F32 getTextureVirtualSize(const LLFace* face);
73
74 BOOL mWereAllTEsSame;
75 74
75 enum
76 {
77 VERTEX_DATA_MASK = (1 << LLVertexBuffer::TYPE_VERTEX) |
78 (1 << LLVertexBuffer::TYPE_NORMAL) |
79 (1 << LLVertexBuffer::TYPE_TEXCOORD) |
80 (1 << LLVertexBuffer::TYPE_TEXCOORD2) |
81 (1 << LLVertexBuffer::TYPE_COLOR)
82 }
83 eVertexDataMask;
84
76public: 85public:
77 LLVOVolume(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp); 86 LLVOVolume(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp);
78 virtual ~LLVOVolume(); 87 virtual ~LLVOVolume();
79 88
80 /*virtual*/ LLDrawable* createDrawable(LLPipeline *pipeline); 89 /*virtual*/ LLDrawable* createDrawable(LLPipeline *pipeline);
81 90
82 void deleteFaces(LLVOVolume* childp); 91 void deleteFaces();
83 92
93 void animateTextures();
84 /*virtual*/ BOOL idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time); 94 /*virtual*/ BOOL idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time);
85 95
86 /*virtual*/ BOOL isActive() const; 96 /*virtual*/ BOOL isActive() const;
@@ -89,8 +99,7 @@ public:
89 /*virtual*/ BOOL isHUDAttachment() const; 99 /*virtual*/ BOOL isHUDAttachment() const;
90 100
91 void generateSilhouette(LLSelectNode* nodep, const LLVector3& view_point); 101 void generateSilhouette(LLSelectNode* nodep, const LLVector3& view_point);
92 102 /*virtual*/ void setParent(LLViewerObject* parent);
93 BOOL getAllTEsSame() const { return mAllTEsSame; }
94 F32 getIndividualRadius() { return mRadius; } 103 F32 getIndividualRadius() { return mRadius; }
95 S32 getLOD() const { return mLOD; } 104 S32 getLOD() const { return mLOD; }
96 const LLVector3 getPivotPositionAgent() const; 105 const LLVector3 getPivotPositionAgent() const;
@@ -105,6 +114,7 @@ public:
105 114
106 115
107 BOOL getVolumeChanged() const { return mVolumeChanged; } 116 BOOL getVolumeChanged() const { return mVolumeChanged; }
117 F32 getTextureVirtualSize(LLFace* face);
108 /*virtual*/ F32 getRadius() const { return mVObjRadius; }; 118 /*virtual*/ F32 getRadius() const { return mVObjRadius; };
109 const LLMatrix4& getWorldMatrix(LLXformMatrix* xform) const; 119 const LLMatrix4& getWorldMatrix(LLXformMatrix* xform) const;
110 120
@@ -120,6 +130,7 @@ public:
120 U32 block_num, const EObjectUpdateType update_type, 130 U32 block_num, const EObjectUpdateType update_type,
121 LLDataPacker *dp); 131 LLDataPacker *dp);
122 132
133 /*virtual*/ void setSelected(BOOL sel);
123 /*virtual*/ BOOL setDrawableParent(LLDrawable* parentp); 134 /*virtual*/ BOOL setDrawableParent(LLDrawable* parentp);
124 135
125 /*virtual*/ void setScale(const LLVector3 &scale, BOOL damped); 136 /*virtual*/ void setScale(const LLVector3 &scale, BOOL damped);
@@ -140,17 +151,19 @@ public:
140 void setTexture(const S32 face); 151 void setTexture(const S32 face);
141 152
142 /*virtual*/ BOOL setVolume(const LLVolumeParams &volume_params, const S32 detail, bool unique_volume = false); 153 /*virtual*/ BOOL setVolume(const LLVolumeParams &volume_params, const S32 detail, bool unique_volume = false);
143 void updateRelativeXform(BOOL global_volume = FALSE); 154 void updateRelativeXform();
144 /*virtual*/ BOOL updateGeometry(LLDrawable *drawable); 155 /*virtual*/ BOOL updateGeometry(LLDrawable *drawable);
156 /*virtual*/ void updateFaceSize(S32 idx);
145 /*virtual*/ BOOL updateLOD(); 157 /*virtual*/ BOOL updateLOD();
146 void updateRadius(); 158 void updateRadius();
147 /*virtual*/ void updateTextures(LLAgent &agent); 159 /*virtual*/ void updateTextures(LLAgent &agent);
148 void updateTextures(S32 lod); 160 void updateTextures();
149 161
150 void updateFaceFlags(); 162 void updateFaceFlags();
151 void regenFaces(); 163 void regenFaces();
152 BOOL genTriangles(BOOL force_global); 164 BOOL genBBoxes(BOOL force_global);
153 virtual void updateSpatialExtents(LLVector3& min, LLVector3& max); 165 virtual void updateSpatialExtents(LLVector3& min, LLVector3& max);
166 virtual F32 getBinRadius();
154 virtual void writeCAL3D(apr_file_t* fp, 167 virtual void writeCAL3D(apr_file_t* fp,
155 std::string& path, 168 std::string& path,
156 std::string& file_base, 169 std::string& file_base,
@@ -161,6 +174,9 @@ public:
161 S32& texture_index, 174 S32& texture_index,
162 std::multimap<LLUUID, LLMaterialExportInfo*>& material_map); 175 std::multimap<LLUUID, LLMaterialExportInfo*>& material_map);
163 176
177
178 virtual U32 getPartitionType() const;
179
164 // For Lights 180 // For Lights
165 void setIsLight(BOOL is_light); 181 void setIsLight(BOOL is_light);
166 void setLightColor(const LLColor3& color); 182 void setLightColor(const LLColor3& color);
@@ -178,6 +194,7 @@ public:
178 F32 getLightDistance(const LLVector3& pos) const; // returns < 0 if inside radius 194 F32 getLightDistance(const LLVector3& pos) const; // returns < 0 if inside radius
179 195
180 // Flexible Objects 196 // Flexible Objects
197 U32 getVolumeInterfaceID() const;
181 virtual BOOL isFlexible() const; 198 virtual BOOL isFlexible() const;
182 BOOL isVolumeGlobal() const; 199 BOOL isVolumeGlobal() const;
183 BOOL canBeFlexible() const; 200 BOOL canBeFlexible() const;
@@ -188,24 +205,21 @@ public:
188 BOOL updateLighting(BOOL do_lighting); 205 BOOL updateLighting(BOOL do_lighting);
189 206
190protected: 207protected:
191 F32 computeLODProfilePathComplexityBias();
192 S32 computeLODDetail(F32 distance, F32 radius); 208 S32 computeLODDetail(F32 distance, F32 radius);
193 BOOL calcLOD(); 209 BOOL calcLOD();
194 void setupSingleFace(S32 face_offset); // Set up the face for combined volumes.
195 LLFace* addFace(S32 face_index); 210 LLFace* addFace(S32 face_index);
196 void updateTEData(); 211 void updateTEData();
197 BOOL calcAllTEsSame();
198 212
199public: 213public:
200 LLViewerTextureAnim *mTextureAnimp; 214 LLViewerTextureAnim *mTextureAnimp;
201 215 U8 mTexAnimMode;
202protected: 216protected:
203 friend class LLDrawable; 217 friend class LLDrawable;
204 218
205 BOOL mAllTEsSame; // All TE's have the same pool/texture
206 BOOL mFaceMappingChanged; 219 BOOL mFaceMappingChanged;
207 BOOL mGlobalVolume; 220 BOOL mGlobalVolume;
208 BOOL mInited; 221 BOOL mInited;
222 LLFrameTimer mTextureUpdateTimer;
209 S32 mLOD; 223 S32 mLOD;
210 BOOL mLODChanged; 224 BOOL mLODChanged;
211 F32 mRadius; 225 F32 mRadius;
@@ -218,8 +232,6 @@ protected:
218 // statics 232 // statics
219public: 233public:
220 static F32 sLODSlopDistanceFactor;// Changing this to zero, effectively disables the LOD transition slop 234 static F32 sLODSlopDistanceFactor;// Changing this to zero, effectively disables the LOD transition slop
221 static F32 sLODComplexityDistanceBias; // Changing this to zero makes all prims LOD at the same distance,
222 // regardless of complexity
223 static F32 sLODFactor; // LOD scale factor 235 static F32 sLODFactor; // LOD scale factor
224 static F32 sDistanceFactor; // LOD distance factor 236 static F32 sDistanceFactor; // LOD distance factor
225 237
diff --git a/linden/indra/newview/llvowater.cpp b/linden/indra/newview/llvowater.cpp
index 55a7020..a57aa8b 100644
--- a/linden/indra/newview/llvowater.cpp
+++ b/linden/indra/newview/llvowater.cpp
@@ -64,22 +64,8 @@ const F32 WAVE_STEP_INV = (1. / WAVE_STEP);
64 64
65const F32 g = 9.81f; // gravitational constant (m/s^2) 65const F32 g = 9.81f; // gravitational constant (m/s^2)
66 66
67///////////////////////////////////
68
69LLWaterSurface::LLWaterSurface() :
70 mInitialized(FALSE),
71 mWind(9, 0, 0),
72 mA(0.2f),
73 mVisc(0.001f),
74 mShininess(8.0f)
75{}
76
77
78LLWaterGrid *LLVOWater::sGrid = 0;
79
80
81LLVOWater::LLVOWater(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp) 67LLVOWater::LLVOWater(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp)
82: LLViewerObject(id, LL_VO_WATER, regionp) 68: LLStaticViewerObject(id, LL_VO_WATER, regionp)
83{ 69{
84 // Terrain must draw during selection passes so it can block objects behind it. 70 // Terrain must draw during selection passes so it can block objects behind it.
85 mbCanSelect = FALSE; 71 mbCanSelect = FALSE;
@@ -113,18 +99,6 @@ void LLVOWater::updateTextures(LLAgent &agent)
113{ 99{
114} 100}
115 101
116// virtual
117void LLVOWater::updateDrawable(BOOL force_damped)
118{
119 // Force an immediate rebuild on any update
120 if (mDrawable.notNull())
121 {
122 gPipeline.updateMoveNormalAsync(mDrawable);
123 gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_ALL, TRUE);
124 }
125 clearChanged(SHIFTED);
126}
127
128// Never gets called 102// Never gets called
129BOOL LLVOWater::idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time) 103BOOL LLVOWater::idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time)
130{ 104{
@@ -161,17 +135,13 @@ LLDrawable *LLVOWater::createDrawable(LLPipeline *pipeline)
161 135
162BOOL LLVOWater::updateGeometry(LLDrawable *drawable) 136BOOL LLVOWater::updateGeometry(LLDrawable *drawable)
163{ 137{
164 return updateGeometryFlat(drawable); 138 LLFastTimer ftm(LLFastTimer::FTM_UPDATE_WATER);
165}
166
167
168BOOL LLVOWater::updateGeometryFlat(LLDrawable *drawable)
169{
170 LLFace *face; 139 LLFace *face;
171 140
172 if (drawable->getNumFaces() < 1) 141 if (drawable->getNumFaces() < 1)
173 { 142 {
174 drawable->addFace(gPipeline.getPool(LLDrawPool::POOL_WATER), NULL); 143 LLDrawPoolWater *poolp = (LLDrawPoolWater*) gPipeline.getPool(LLDrawPool::POOL_WATER);
144 drawable->addFace(poolp, NULL);
175 } 145 }
176 face = drawable->getFace(0); 146 face = drawable->getFace(0);
177 147
@@ -180,15 +150,26 @@ BOOL LLVOWater::updateGeometryFlat(LLDrawable *drawable)
180 150
181 LLStrider<LLVector3> verticesp, normalsp; 151 LLStrider<LLVector3> verticesp, normalsp;
182 LLStrider<LLVector2> texCoordsp; 152 LLStrider<LLVector2> texCoordsp;
183 U32 *indicesp; 153 LLStrider<U32> indicesp;
184 S32 index_offset; 154 S32 index_offset;
185 155
186 S32 size = 16; 156 S32 size = 16;
187 157
188 S32 num_quads = size*size; 158 if (face->mVertexBuffer.isNull())
189 159 {
190 face->setPrimType(LLTriangles); 160 S32 num_quads = size*size;
191 face->setSize(4*num_quads, 6*num_quads); 161 face->setSize(4*num_quads, 6*num_quads);
162
163 face->mVertexBuffer = new LLVertexBuffer(LLDrawPoolWater::VERTEX_DATA_MASK, GL_DYNAMIC_DRAW_ARB);
164 face->mVertexBuffer->allocateBuffer(4*num_quads, 6*num_quads, TRUE);
165 face->setIndicesIndex(0);
166 face->setGeomIndex(0);
167 }
168 else
169 {
170 face->mVertexBuffer->resizeBuffer(face->getGeomCount(), face->getIndicesCount());
171 }
172
192 index_offset = face->getGeometry(verticesp,normalsp,texCoordsp, indicesp); 173 index_offset = face->getGeometry(verticesp,normalsp,texCoordsp, indicesp);
193 if (-1 == index_offset) 174 if (-1 == index_offset)
194 { 175 {
@@ -198,6 +179,7 @@ BOOL LLVOWater::updateGeometryFlat(LLDrawable *drawable)
198 LLVector3 position_agent; 179 LLVector3 position_agent;
199 position_agent = getPositionAgent(); 180 position_agent = getPositionAgent();
200 face->mCenterAgent = position_agent; 181 face->mCenterAgent = position_agent;
182 face->mCenterLocal = position_agent;
201 183
202 S32 x, y; 184 S32 x, y;
203 F32 step_x = getScale().mV[0] / size; 185 F32 step_x = getScale().mV[0] / size;
@@ -256,378 +238,20 @@ BOOL LLVOWater::updateGeometryFlat(LLDrawable *drawable)
256 *indicesp++ = toffset + 2; 238 *indicesp++ = toffset + 2;
257 } 239 }
258 } 240 }
259
260
261 mDrawable->movePartition();
262 LLPipeline::sCompiles++;
263 return TRUE;
264}
265
266
267BOOL LLVOWater::updateGeometryHeightFieldRoam(LLDrawable *drawable)
268{
269 LLVector3 position_agent = getPositionAgent();
270 const LLVector3 region_size = getScale();
271 const LLVector3 region_origin = position_agent - region_size * 0.5f;
272
273 S32 patch_origx = llround(region_origin.mV[VX] - sGrid->mRegionOrigin.mV[VX]) / sGrid->mRegionWidth;
274 S32 patch_origy = llround(region_origin.mV[VY] - sGrid->mRegionOrigin.mV[VY]) / sGrid->mRegionWidth;
275 S32 patch_dimx = llround(region_size.mV[VX]) / sGrid->mRegionWidth;
276 S32 patch_dimy = llround(region_size.mV[VY]) / sGrid->mRegionWidth;
277
278 static S32 res = (S32)sGrid->mPatchRes;
279 if (patch_origx < 0)
280 {
281 patch_dimx -= - patch_origx;
282 if (patch_dimx < 1)
283 {
284 return TRUE;
285 }
286 patch_origx = 0;
287 }
288 if (patch_origy < 0)
289 {
290 patch_dimy -= - patch_origy;
291 if (patch_dimy < 1)
292 {
293 return TRUE;
294 }
295 patch_origy = 0;
296 }
297 if (patch_origx >= res)
298 {
299 return TRUE;
300 }
301 if (patch_origy >= res)
302 {
303 return TRUE;
304 }
305
306 patch_dimx = llmin<U32>(patch_dimx, res - patch_origx);
307 patch_dimy = llmin<U32>(patch_dimy, res - patch_origy);
308
309 U32 num_of_tris = 0;
310 S32 px, py;
311 for (py = patch_origy; py < patch_origy + patch_dimy; py++)
312 {
313 for (px = patch_origx; px < patch_origx + patch_dimx; px++)
314 {
315 const U32 ind = py * sGrid->mPatchRes + px;
316 if (sGrid->mPatches[ind].visible() && sGrid->mTab[px][py] == 0)
317 {
318 num_of_tris += sGrid->mPatches[ind].numTris();
319 sGrid->mTab[px][py] = this;
320 }
321 }
322 }
323
324 if (num_of_tris == 0)
325 {
326 return TRUE;
327 }
328
329 if (drawable->getNumFaces() < 1)
330 {
331 drawable->addFace((LLDrawPoolWater*) gPipeline.getPool(LLDrawPool::POOL_WATER),
332 gWorldp->getDefaultWaterTexture());
333 }
334
335 LLFace *face;
336
337 face = drawable->getFace(0);
338 face->mCenterAgent = position_agent;
339
340 LLStrider<LLVector3> verticesp, normalsp;
341 LLStrider<LLVector2> texCoordsp;
342 U32 *indicesp;
343 S32 index_offset;
344
345 const F32 water_height = getRegion()->getWaterHeight();
346
347 241
348 face->setPrimType(LLTriangles); 242 mDrawable->movePartition();
349 face->setSize(3 * num_of_tris, 3 * num_of_tris);
350 index_offset = face->getGeometry(verticesp,normalsp,texCoordsp, indicesp);
351 if (-1 == index_offset)
352 {
353 return TRUE;
354 }
355
356 U32 num_of_vtx = 0;
357
358 for (py = patch_origy; py < patch_origy + patch_dimy; py++)
359 {
360 for (px = patch_origx; px < patch_origx + patch_dimx; px++)
361 {
362 for (U8 h = 0; h < 2; h++)
363 {
364 const U32 ind = py * sGrid->mPatchRes + px;
365 if (!sGrid->mPatches[ind].visible() || sGrid->mTab[px][py] != this)
366 continue;
367 LLWaterTri* half = (LLWaterTri*) sGrid->mPatches[ind].half(h);
368 for (const LLWaterTri* tri = (LLWaterTri*) half->getFirstLeaf();
369 tri != NULL;
370 tri = (LLWaterTri*) tri->getNextLeaf())
371 {
372 /////// check for coordinates
373 *(verticesp++) = sGrid->vtx(tri->Lvtx(), water_height);
374 *(verticesp++) = sGrid->vtx(tri->Rvtx(), water_height);
375 *(verticesp++) = sGrid->vtx(tri->Tvtx(), water_height);
376
377 *(normalsp++) = sGrid->norm(tri->Lvtx());
378 *(normalsp++) = sGrid->norm(tri->Rvtx());
379 *(normalsp++) = sGrid->norm(tri->Tvtx());
380
381 *(indicesp++) = index_offset + num_of_vtx + 0;
382 *(indicesp++) = index_offset + num_of_vtx + 1;
383 *(indicesp++) = index_offset + num_of_vtx + 2;
384 num_of_vtx += 3;
385 }
386 }
387 }
388 }
389
390
391 LLPipeline::sCompiles++;
392 return TRUE;
393}
394
395
396
397BOOL LLVOWater::updateGeometryHeightFieldSimple(LLDrawable *drawable)
398{
399 LLVector3 position_agent = getPositionAgent();
400 const LLVector3 region_size = getScale();
401 const LLVector3 region_origin = position_agent - region_size * 0.5f;
402
403 S32 patch_origx = llround(region_origin.mV[VX] - sGrid->mRegionOrigin.mV[VX]) / sGrid->mRegionWidth;
404 S32 patch_origy = llround(region_origin.mV[VY] - sGrid->mRegionOrigin.mV[VY]) / sGrid->mRegionWidth;
405 S32 patch_dimx = llround(region_size.mV[VX]) / sGrid->mRegionWidth;
406 S32 patch_dimy = llround(region_size.mV[VY]) / sGrid->mRegionWidth;
407
408 static S32 res = sGrid->mPatchRes;
409 if (patch_origx < 0)
410 {
411 patch_dimx -= - patch_origx;
412 if (patch_dimx < 1)
413 {
414 return TRUE;
415 }
416 patch_origx = 0;
417 }
418 if (patch_origy < 0)
419 {
420 patch_dimy -= - patch_origy;
421 if (patch_dimy < 1)
422 {
423 return TRUE;
424 }
425 patch_origy = 0;
426 }
427 if (patch_origx >= res)
428 {
429 return TRUE;
430 }
431 if (patch_origy >= res)
432 {
433 return TRUE;
434 }
435
436 patch_dimx = llmin<U32>(patch_dimx, res - patch_origx);
437 patch_dimy = llmin<U32>(patch_dimy, res - patch_origy);
438
439
440 U32 num_of_regions = 0;
441 S32 px, py;
442
443 for (py = patch_origy; py < patch_origy + patch_dimy; py++)
444 {
445 for (px = patch_origx; px < patch_origx + patch_dimx; px++)
446 {
447 // if (sGrid->mTab[px][py] != 0)
448 // bool stop = true;
449 if (sGrid->mPatches[py * sGrid->mPatchRes + px].visible() && sGrid->mTab[px][py] == 0)
450 {
451 num_of_regions++;
452 sGrid->mTab[px][py] = this;
453 }
454 }
455 }
456
457 if (num_of_regions == 0)
458 {
459 return TRUE;
460 }
461
462 if (drawable->getNumFaces() < 1)
463 {
464 drawable->addFace((LLDrawPoolWater*) gPipeline.getPool(LLDrawPool::POOL_WATER),
465 gWorldp->getDefaultWaterTexture());
466 }
467
468 LLFace *face;
469
470 face = drawable->getFace(0);
471 face->mCenterAgent = position_agent;
472
473 LLStrider<LLVector3> verticesp, normalsp;
474 LLStrider<LLVector2> texCoordsp;
475 U32 *indicesp;
476 S32 index_offset;
477
478 const F32 water_height = getRegion()->getWaterHeight();
479
480 const U32 steps_in_region = sGrid->mStepsInRegion / sGrid->mResDecrease;
481 const U32 num_quads = steps_in_region * steps_in_region * num_of_regions;
482
483 face->setPrimType(LLTriangles);
484 face->setSize(4*num_quads, 6*num_quads);
485 index_offset = face->getGeometry(verticesp,normalsp,texCoordsp, indicesp);
486 if (-1 == index_offset)
487 {
488 return TRUE;
489 }
490
491 U32 num_of_vtx = 0;
492
493 for (py = patch_origy; py < patch_origy + patch_dimy; py++)
494 {
495 for (px = patch_origx; px < patch_origx + patch_dimx; px++)
496 {
497 if (!sGrid->mPatches[py * sGrid->mPatchRes + px].visible() || sGrid->mTab[px][py] != this)
498 {
499 continue;
500 }
501
502 U32 orig_indx = px * sGrid->mStepsInRegion;
503 U32 orig_indy = py * sGrid->mStepsInRegion;
504
505 for (U32 qy = 0; qy < steps_in_region; qy++)
506 {
507 for (U32 qx = 0; qx < steps_in_region; qx++)
508 {
509 const S32 x0 = orig_indx + qx * sGrid->mResDecrease;
510 const S32 y0 = orig_indy + qy * sGrid->mResDecrease;
511 const S32 x1 = x0 + sGrid->mResDecrease;
512 const S32 y1 = y0 + sGrid->mResDecrease;
513
514 sGrid->setVertex(x0, y1, water_height, *(verticesp));
515 verticesp++;
516 sGrid->setVertex(x0, y0, water_height, *(verticesp));
517 verticesp++;
518 sGrid->setVertex(x1, y1, water_height, *(verticesp));
519 verticesp++;
520 sGrid->setVertex(x1, y0, water_height, *(verticesp));
521 verticesp++;
522 /*
523 *(verticesp++) = sGrid->vtx(x0, y1, water_height);
524 *(verticesp++) = sGrid->vtx(x0, y0, water_height);
525 *(verticesp++) = sGrid->vtx(x1, y1, water_height);
526 *(verticesp++) = sGrid->vtx(x1, y0, water_height);
527 */
528 *(normalsp++) = sGrid->norm(x0, y1);
529 *(normalsp++) = sGrid->norm(x0, y0);
530 *(normalsp++) = sGrid->norm(x1, y1);
531 *(normalsp++) = sGrid->norm(x1, y0);
532
533 const S32 curr_index_offset = index_offset + num_of_vtx;
534
535 *indicesp++ = curr_index_offset + 0;
536 *indicesp++ = curr_index_offset + 1;
537 *indicesp++ = curr_index_offset + 2;
538
539 *indicesp++ = curr_index_offset + 1;
540 *indicesp++ = curr_index_offset + 3;
541 *indicesp++ = curr_index_offset + 2;
542 num_of_vtx += 4;
543 }
544 }
545 }
546 }
547
548
549 LLPipeline::sCompiles++; 243 LLPipeline::sCompiles++;
550 return TRUE; 244 return TRUE;
551} 245}
552 246
553void LLVOWater::initClass() 247void LLVOWater::initClass()
554{ 248{
555 sGrid = new LLWaterGrid;
556} 249}
557 250
558void LLVOWater::cleanupClass() 251void LLVOWater::cleanupClass()
559{ 252{
560 if (sGrid)
561 {
562 sGrid->cleanup();
563 delete sGrid;
564 sGrid = 0;
565 }
566}
567
568
569LLWaterGrid::LLWaterGrid() : mResIncrease(1)//0.5)
570{
571 init();
572} 253}
573 254
574
575void LLWaterGrid::init()
576{
577 //mRegionOrigin = LLVector3(-2 * mRegionWidth, -2 * mRegionWidth, 0);
578 mRegionWidth = 256;
579 mPatchRes = 5;
580 mMaxGridSize = mPatchRes * mRegionWidth;
581 mMinStep = (U32)(WAVE_STEP * mResIncrease);
582
583 LLWaterTri::sMinStep = mMinStep;
584 LLWaterTri::sQueues = &mRoam;
585
586 setGridDim(mMaxGridSize / mMinStep);
587
588 mVtx = new LLVector3[mGridDim1 * mGridDim1];
589 mNorms = new LLVector3[mGridDim1 * mGridDim1];
590
591 mPatches = new LLWaterPatch[mPatchRes * mPatchRes];
592
593 mStepsInRegion = mRegionWidth / mMinStep;
594 const U32 max_div_level = 2 * (U32)(log((F32)mStepsInRegion) / log(2.0f));
595
596 for (U32 y = 0; y < mPatchRes; y++)
597 {
598 for (U32 x = 0; x < mPatchRes; x++)
599 {
600 LLVector3 patch_center(mRegionWidth * (x + 0.5f), mRegionWidth * (y + 0.5f), 0);
601
602 mPatches[y * mPatchRes + x].set(x * mStepsInRegion, y * mStepsInRegion,
603 mStepsInRegion, mRegionWidth, patch_center, max_div_level);
604 if (x > 0)
605 {
606 mPatches[y * mPatchRes + x].left()->setRight(mPatches[y * mPatchRes + x - 1].right());
607 mPatches[y * mPatchRes + x - 1].right()->setRight(mPatches[y * mPatchRes + x].left());
608 }
609 if (y > 0)
610 {
611 mPatches[y * mPatchRes + x].left()->setLeft(mPatches[(y - 1) * mPatchRes + x].right());
612 mPatches[(y - 1) * mPatchRes + x].right()->setLeft(mPatches[y * mPatchRes + x].left());
613 }
614 }
615 }
616}
617
618void LLWaterGrid::cleanup()
619{
620 delete[] mVtx;
621 mVtx = NULL;
622
623 delete[] mNorms;
624 mNorms = NULL;
625
626 delete[] mPatches;
627 mPatches = NULL;
628}
629
630
631void setVecZ(LLVector3& v) 255void setVecZ(LLVector3& v)
632{ 256{
633 v.mV[VX] = 0; 257 v.mV[VX] = 0;
@@ -635,413 +259,31 @@ void setVecZ(LLVector3& v)
635 v.mV[VZ] = 1; 259 v.mV[VZ] = 1;
636} 260}
637 261
638void LLWaterGrid::update()
639{
640 static LLViewerRegion* prev_region = gAgent.getRegion();
641 LLViewerRegion* region = gAgent.getRegion();
642
643 mRegionOrigin = region->getOriginAgent();
644 mRegionOrigin.mV[VX] -= 2 * mRegionWidth;
645 mRegionOrigin.mV[VY] -= 2 * mRegionWidth;
646 mRegionOrigin.mV[VZ] = 0;
647
648 const F32 clip_far = gCamera->getFar() - 31;
649 const F32 clip_far2 = clip_far * clip_far;
650
651 const LLVector3 camera_pos = gAgent.getCameraPositionAgent();
652 const LLVector3 look_at = gCamera->getAtAxis();
653
654
655 if (camera_pos.mV[VZ] > 200)
656 {
657 mResDecrease = 4;
658 }
659 else if (camera_pos.mV[VZ] > 100)
660 {
661 mResDecrease = 2;
662 }
663 else
664 {
665 mResDecrease = 1;
666 }
667
668
669 //U32 mResDecrease = res_decrease;
670 U32 res_decrease = 1;
671
672 const F32 res_change = mResIncrease;// * res_decrease ;
673
674 F32 height;
675
676 // Set the grid
677
678 //U32 fractions = 1;
679 U32 fractions_res = res_decrease;
680 if (res_change < 1)
681 {
682 //fractions = llround(1. / res_change);
683 fractions_res = llround(1.f / mResIncrease);
684 }
685
686
687 //const U32 fractions_res = fractions * res_decrease;
688
689 LLVector3 cur_pos;
690 U32 x, y;
691 U32 ind = 0;
692 for (y = 0; y < mGridDim1; y += fractions_res)
693 {
694 const F32 dispy = (F32)(y * mMinStep);//step;
695 for (x = 0; x < mGridDim1; x += fractions_res)
696 {
697 const F32 dispx = (F32)(x * mMinStep);//step;
698 cur_pos = mRegionOrigin;
699 cur_pos.mV[VX] += dispx;
700 cur_pos.mV[VY] += dispy;
701
702 const F32 x_dist = cur_pos.mV[VX] - camera_pos.mV[VX];
703 const F32 y_dist = cur_pos.mV[VY] - camera_pos.mV[VY];
704
705 if (x_dist * look_at.mV[VX] + y_dist * look_at.mV[VY] < 0)
706 {
707 mVtx[ind] = cur_pos;
708 setVecZ(mNorms[ind]);
709 ind++;
710 continue;
711 }
712
713 const F32 dist_to_vtx2 = x_dist * x_dist + y_dist * y_dist;
714 if (dist_to_vtx2 > .81 * clip_far2)
715 {
716 mVtx[ind] = cur_pos;
717 setVecZ(mNorms[ind]);
718 ind++;
719 continue;
720 }
721
722 mWater.getIntegerHeightAndNormal(llround(WAVE_STEP_INV * dispx),
723 llround(WAVE_STEP_INV * dispy), height, mNorms[ind]);
724
725 cur_pos.mV[VZ] += height;
726 mVtx[ind] = cur_pos;
727 ind++;
728 }
729 }
730
731 if (res_change < 1)
732 {
733 U32 fractions = llround(1.f / mResIncrease);
734 for (y = 0; y < mGridDim1; y += fractions_res)
735 {
736 for (x = 0; x < mGridDim; x += fractions_res)
737 {
738 const U32 ind00 = index(x, y);
739 const U32 ind01 = ind00 + fractions_res;
740 for (U32 frx = 1; frx < fractions; frx += res_decrease)
741 {
742 const U32 ind = ind00 + frx;
743 mNorms[ind] = LERP(mNorms[ind00], mNorms[ind01], frx * res_change);
744 mVtx[ind] = LERP( mVtx[ind00], mVtx[ind01], frx * res_change);
745 }
746 }
747 }
748 for (x = 0; x < mGridDim1; x += res_decrease)
749 {
750 for (y = 0; y < mGridDim; y += fractions_res)
751 {
752 const U32 ind00 = index(x, y);
753 const U32 ind10 = ind00 + fractions_res * mGridDim1;//(y + fractions) * quad_resx1 + x;
754 for (U32 fry = 1; fry < fractions; fry += res_decrease)
755 {
756 const U32 ind = ind00 + fry * mGridDim1;//(y + fry) * quad_resx1 + x;
757 mNorms[ind] = LERP(mNorms[ind00], mNorms[ind10], fry * res_change);
758 mVtx[ind] = LERP( mVtx[ind00], mVtx[ind10], fry * res_change);
759 }
760 }
761 }
762 }
763
764 if (gUseRoam)
765 {
766 updateTree(camera_pos, look_at, clip_far, prev_region != region);
767 }
768 else
769 {
770 updateVisibility(camera_pos, look_at, clip_far);
771 }
772
773 prev_region = region;
774
775
776 //mTab[0][0] = 0;
777 for (y = 0; y < mPatchRes; y++)
778 {
779 for (x = 0; x < mPatchRes; x++)
780 mTab[x][y] = 0;
781 }
782
783}
784
785void LLWaterGrid::updateTree(const LLVector3 &camera_pos, const LLVector3 &look_at, F32 clip_far,
786 BOOL restart = FALSE)
787{
788 static S8 recalculate_frame = 0;
789
790 if (restart)
791 {
792 recalculate_frame = 0;
793 }
794
795 if (recalculate_frame == 0)
796 {
797 LLWaterTri::nextRound();
798 setCamPosition(LLWaterTri::sCam, camera_pos);
799 LLWaterTri::sClipFar = clip_far;
800
801
802 const U32 step = (U32)(WAVE_STEP * mResIncrease * mResDecrease);
803 const U32 steps_in_region = mRegionWidth / step;
804 LLWaterTri::sMaxDivLevel = 2 * llround(log((F32)steps_in_region) / log(2.0f));
805
806 for (U32 y = 0; y < mPatchRes; y++)
807 {
808 for (U32 x = 0; x < mPatchRes; x++)
809 {
810 U32 patch_ind = y * mPatchRes + x;
811 mPatches[patch_ind].updateTree(camera_pos, look_at, mRegionOrigin);
812 }
813 }
814
815 mRoam.process();
816
817 // debug
818 /*
819 for (y = 0; y < mPatchRes; y++)
820 {
821 for (U32 x = 0; x < mPatchRes; x++)
822 {
823 //mPatches[y * mPatchRes + x].checkUpToDate();
824 //mPatches[y * mPatchRes + x].checkConsistensy();
825 mPatches[y * mPatchRes + x].checkCount();
826 }
827 }
828 */
829 }
830 ++recalculate_frame;
831 recalculate_frame = recalculate_frame % 2;
832}
833
834void LLWaterGrid::updateVisibility(const LLVector3 &camera_pos, const LLVector3 &look_at, F32 clip_far)
835{
836 for (U32 y = 0; y < mPatchRes; y++)
837 {
838 for (U32 x = 0; x < mPatchRes; x++)
839 {
840 mPatches[y * mPatchRes + x].updateVisibility(camera_pos, look_at, mRegionOrigin);
841 }
842 }
843}
844
845
846void LLVOWater::setUseTexture(const BOOL use_texture) 262void LLVOWater::setUseTexture(const BOOL use_texture)
847{ 263{
848 mUseTexture = use_texture; 264 mUseTexture = use_texture;
849} 265}
850 266
851F32 LLWaterSurface::agentDepth() const 267void LLVOWater::updateSpatialExtents(LLVector3 &newMin, LLVector3& newMax)
852{ 268{
853 const LLViewerRegion* region = gAgent.getRegion(); 269 LLVector3 pos = getPositionAgent();
854 LLVector3 position_agent = region->getOriginAgent();// getPositionAgent(); 270 LLVector3 scale = getScale();
855 const LLVector3 region_origin = position_agent;
856 const LLVector3 camera_pos = gAgent.getCameraPositionAgent();
857 271
858 F32 height; 272 newMin = pos - scale * 0.5f;
859 LLVector3 normal; 273 newMax = pos + scale * 0.5f;
860 274
861 getHeightAndNormal(WAVE_STEP_INV * camera_pos.mV[VX], 275 mDrawable->setPositionGroup((newMin + newMax) * 0.5f);
862 WAVE_STEP_INV * camera_pos.mV[VY], height, normal);
863 F32 agent_water_height = gAgent.getRegion()->getWaterHeight();
864 return camera_pos.mV[VZ] - (agent_water_height + height);
865} 276}
866 277
867//////////////////////////////////////////////// 278U32 LLVOWater::getPartitionType() const
868 279{
869 280 return LLPipeline::PARTITION_WATER;
870void LLWaterSurface::getHeightAndNormal(F32 i, F32 j, F32& wave_height, LLVector3& normal) const
871{
872 S32 i_ind = llfloor(i);
873 S32 j_ind = llfloor(j);
874 F32 i_fr = i - i_ind;
875 F32 j_fr = j - j_ind;
876
877 i_ind = i_ind % N_RES;
878 j_ind = j_ind % N_RES;
879
880 S32 i_ind_next = i_ind + 1;
881 S32 j_ind_next = j_ind + 1;
882 if (i_ind_next == (S32)N_RES) i_ind_next = 0;
883 if (j_ind_next == (S32)N_RES) j_ind_next = 0;
884
885 const F32 i_fr1 = 1 - i_fr;
886 const F32 j_fr1 = 1 - j_fr;
887
888 const F32 hi0 = i_fr1 * height(i_ind, j_ind) + i_fr * height(i_ind_next, j_ind);
889 const F32 hi1 = i_fr1 * height(i_ind, j_ind_next) + i_fr * height(i_ind_next, j_ind_next);
890 wave_height = j_fr1 * hi0 + j_fr * hi1;
891
892 normal = i_fr1 * mNorms[i_ind][j_ind];
893 normal += i_fr * mNorms[i_ind_next][j_ind];
894 LLVector3 vi1 = i_fr1 * mNorms[i_ind][j_ind_next];
895 vi1 += i_fr * mNorms[i_ind_next][j_ind_next];
896 normal *= j_fr1;
897 normal += j_fr * vi1;
898
899 //normal.normVec();
900}
901
902void LLWaterSurface::getIntegerHeightAndNormal(S32 i, S32 j, F32& wave_height, LLVector3& normal) const
903{
904 S32 i_ind = i % N_RES;
905 S32 j_ind = j % N_RES;
906
907 wave_height = height(i_ind, j_ind);
908 normal = mNorms[i_ind][j_ind];
909} 281}
910 282
911F32 LLWaterSurface::phillips(const LLVector2& k, const LLVector2& wind_n, F32 L, F32 L_small) 283LLWaterPartition::LLWaterPartition()
284: LLSpatialPartition(0)
912{ 285{
913 F32 k2 = k * k; 286 mRenderByGroup = FALSE;
914 F32 k_dot_wind = k * wind_n; 287 mDrawableType = LLPipeline::RENDER_TYPE_WATER;
915 F32 spectrum = mA * (F32) exp(-1 / (L * L * k2)) / (k2 * k2) * (k_dot_wind * k_dot_wind / k2); 288 mPartitionType = LLPipeline::PARTITION_WATER;
916
917 if (k_dot_wind < 0) spectrum *= .25f; // scale down waves that move opposite to the wind
918
919 F32 damp = (F32) exp(- k2 * L_small * L_small);
920
921 return (spectrum * damp);
922} 289}
923
924
925
926void LLWaterSurface::initAmplitudes()
927{
928 U16 i, j;
929 LLVector2 k;
930 F32 sqrtPhillips;
931
932 const LLVector2 wind(mWind.mV);
933
934 LLVector2 wind_n = wind;
935 const F32 wind_vel = wind_n.normVec();
936
937 const F32 L = wind_vel * wind_vel / g; // largest wave arising from constant wind of speed wind_vel
938
939 const F32 L_small = L / 70; // eliminate waves with very small length (L_small << L)
940
941
942 for (i = 0; i <= N_RES; i++)
943 {
944 k.mV[VX] = (- (S32)N_RES_HALF + i) * (F_TWO_PI / WIDTH);
945 for (j = 0; j <= N_RES; j++)
946 {
947 k.mV[VY] = (- (S32)N_RES_HALF + j) * (F_TWO_PI / WIDTH);
948
949 const F32 k_mag = k.magVec();
950 mOmega[i][j] = (F32) sqrt(g * k_mag);
951
952 if (k_mag < F_APPROXIMATELY_ZERO)
953 sqrtPhillips = 0;
954 else
955 sqrtPhillips = (F32) sqrt(phillips(k, wind_n, L, L_small));
956
957 //const F32 r1 = rand() / (F32) RAND_MAX;
958 //const F32 r2 = rand() / (F32) RAND_MAX;
959 const F32 r1 = randGauss(0, 1);
960 const F32 r2 = randGauss(0, 1);
961
962 mHtilda0[i][j].re = sqrtPhillips * r1 * OO_SQRT2;
963 mHtilda0[i][j].im = sqrtPhillips * r2 * OO_SQRT2;
964
965 }
966 }
967
968 mPlan.init(N_RES, N_RES);
969 mInitialized = 1; // initialization complete
970}
971
972void LLWaterSurface::generateWaterHeightField(F64 t)
973{
974 S32 i, j;
975 S32 mi, mj; // -K indices
976 COMPLEX plus, minus;
977
978 if (!mInitialized) initAmplitudes();
979
980 for (i = 0; i < (S32)N_RES_HALF; i++)
981 {
982 mi = N_RES - i;
983 for (j = 0; j < (S32)N_RES ; j++)
984 {
985 mj = N_RES - j;
986
987 const F32 cos_wt = cosf(mOmega[i][j] * t); // = cos(-mOmega[i][j] * t)
988 const F32 sin_wt = sinf(mOmega[i][j] * t); // = -sin(-mOmega[i][j] * t)
989 plus.re = mHtilda0[i][j].re * cos_wt - mHtilda0[i][j].im * sin_wt;
990 plus.im = mHtilda0[i][j].re * sin_wt + mHtilda0[i][j].im * cos_wt;
991 minus.re = mHtilda0[mi][mj].re * cos_wt - mHtilda0[mi][mj].im * sin_wt;
992 minus.im = -mHtilda0[mi][mj].re * sin_wt - mHtilda0[mi][mj].im * cos_wt;
993
994 // now sum the plus and minus waves to get the total wave amplitude h
995 mHtilda[i * N_RES + j].re = plus.re + minus.re;
996 mHtilda[i * N_RES + j].im = plus.im + minus.im;
997 if (mi < (S32)N_RES && mj < (S32)N_RES)
998 {
999 mHtilda[mi * N_RES + mj].re = plus.re + minus.re;
1000 mHtilda[mi * N_RES + mj].im = -plus.im - minus.im;
1001 }
1002 }
1003 }
1004
1005 inverse_fft(mPlan, mHtilda, N_RES, N_RES);
1006
1007 calcNormals();
1008}
1009
1010
1011/*
1012 * Computer normals by taking finite differences.
1013 */
1014
1015void LLWaterSurface::calcNormals()
1016{
1017 LLVector3 n;
1018
1019 for (U32 i = 0; i < N_RES; i++)
1020 {
1021 for (U32 j = 0; j < N_RES; j++)
1022 {
1023 F32 px = heightWrapped(i + 1, j);
1024 F32 mx = heightWrapped(i - 1, j);
1025 F32 py = heightWrapped(i, j + 1);
1026 F32 my = heightWrapped(i, j - 1);
1027 F32 pxpy = heightWrapped(i + 1, j + 1);
1028 F32 pxmy = heightWrapped(i + 1, j - 1);
1029 F32 mxpy = heightWrapped(i - 1, j + 1);
1030 F32 mxmy = heightWrapped(i - 1, j - 1);
1031
1032 n.mV[VX] = -((2 * px + pxpy + pxmy) - (2 * mx + mxpy + mxmy));
1033 n.mV[VY] = -((2 * py + pxpy + mxpy) - (2 * my + pxmy + mxmy));
1034 n.mV[VZ] = 8 * WIDTH / (F32) N_RES;
1035 n.normVec();
1036
1037 mNorms[i][j] = n;
1038 }
1039 }
1040}
1041
1042void LLVOWater::generateNewWaves(F64 time)
1043{
1044 getWaterSurface()->generateWaterHeightField(time);
1045 sGrid->update();
1046}
1047
diff --git a/linden/indra/newview/llvowater.h b/linden/indra/newview/llvowater.h
index 11dc0e5..20fda7e 100644
--- a/linden/indra/newview/llvowater.h
+++ b/linden/indra/newview/llvowater.h
@@ -35,195 +35,25 @@
35 35
36#include "llwaterpatch.h" 36#include "llwaterpatch.h"
37 37
38
39const U32 N_RES = 16; //32 // number of subdivisions of wave tile 38const U32 N_RES = 16; //32 // number of subdivisions of wave tile
40const U8 WAVE_STEP = 8; 39const U8 WAVE_STEP = 8;
41 40
42/*
43#define N_DET 32 // number of subdivisions of wave tile for details
44
45class LLWaterDetail
46{
47protected:
48 S32 mResolution;
49 LLViewerImage *mTex;
50 U8 *mTexData;
51
52public:
53 LLWaterDetail() : mResolution(N_DET), mTex(0), mTexData(0) {init();}
54 void init();
55
56 ~LLWaterDetail()
57 {
58 delete[] mTexData;
59 mTexData = NULL;
60 }
61
62
63 //void initEmpty();
64
65 void setPixel(const LLVector3 &norm, const S32 i, const S32 j)
66 {
67 S32 offset = (i * mResolution + j) * 3;
68 mTexData[offset] = llround(norm.mV[VX] * 255);
69 mTexData[offset+1] = llround(norm.mV[VX] * 255);
70 mTexData[offset+2] = llround(norm.mV[VX] * 255);
71 }
72 void setPixel(F32 x, F32 y, F32 z, const S32 i, const S32 j)
73 {
74 S32 offset = (i * mResolution + j) * 3;
75 mTexData[offset] = llround(x * 255);
76 mTexData[offset+1] = llround(y * 255);
77 mTexData[offset+2] = llround(z * 255);
78 }
79
80 S32 getResolution() { return mResolution; }
81
82 void createDetailBumpmap(F32* u, F32* v);
83 void createTexture() const { mTex->createTexture(); }
84 void bindTexture() const { mTex->bindTexture(); }
85 LLViewerImage* getTexture() const { return mTex; }
86};
87*/
88
89class LLWaterSurface
90{
91protected:
92 BOOL mInitialized;
93 LLVector3 mWind;
94 F32 mA;
95 F32 mVisc; // viscosity of the fluid
96 F32 mShininess;
97
98 //LLWaterDetail* mDetail;
99
100 LLFFTPlan mPlan;
101 F32 mOmega[N_RES+1][N_RES+1]; // wave frequency
102 COMPLEX mHtilda0[N_RES+1][N_RES+1]; // wave amplitudes and phases at time 0.
103 LLVector3 mNorms[N_RES][N_RES];
104 COMPLEX mHtilda[N_RES * N_RES];
105
106public:
107 LLWaterSurface();
108 ~LLWaterSurface() {}
109
110 //void initSpecularLookup();
111
112 F32 phillips(const LLVector2& k, const LLVector2& wind_n, F32 L, F32 L_small);
113
114 void initAmplitudes();
115
116 F32 height(S32 i, S32 j) const { return mHtilda[i * N_RES + j].re; }
117 F32 heightWrapped(S32 i, S32 j) const
118 {
119 return height((i + N_RES) % N_RES, (j + N_RES) % N_RES);
120 }
121
122 void generateWaterHeightField(F64 time);
123 void calcNormals();
124
125 void getHeightAndNormal(F32 i, F32 j, F32& height, LLVector3& normal) const;
126 void getIntegerHeightAndNormal(S32 i, S32 j, F32& height, LLVector3& normal) const;
127 F32 agentDepth() const;
128
129// const LLWaterHeightField* hField() const { return &mHeightField; }
130
131 //void generateDetail(F64 t);
132 //void fluidSolver(F32* u, F32* v, F32* u0, F32* v0, F64 dt);
133
134 const LLVector3& getWind() const { return mWind; }
135 void setWind(const LLVector3& w) { mWind = w; } // initialized = 0?
136 F32 A() const { return mA; }
137 void setA(F32 a) { mA = a; }
138 F32 getShininess() const { return mShininess; }
139 //LLViewerImage* getSpecularLookup() const { return mSpecularLookup; }
140 //LLViewerImage* getDetail() const { return mDetail->getTexture(); }
141};
142
143class LLVOWater;
144
145class LLWaterGrid
146{
147public:
148 LLWaterGrid();
149
150 void init();
151 void cleanup();
152
153 LLWaterSurface* getWaterSurface() { return &mWater; }
154
155 void update();
156 void updateTree(const LLVector3 &camera_pos, const LLVector3 &look_at, F32 clip_far,
157 BOOL restart);
158 void updateVisibility(const LLVector3 &camera_pos, const LLVector3 &look_at, F32 clip_far);
159
160 LLVector3 mRegionOrigin;
161
162 LLVector3* mVtx;
163 LLVector3* mNorms;
164 U32 mRegionWidth;
165 U32 mMaxGridSize;
166 U32 mPatchRes;
167 U32 mMinStep;
168 U32 mStepsInRegion;
169 LLWaterPatch* mPatches;
170 LLRoam mRoam;
171 F32 mResIncrease;
172 U32 mResDecrease;
173
174 LLVOWater* mTab[5][5];
175
176 U32 gridDim() const { return mGridDim; }
177 U32 rowSize() const { return mGridDim1; }
178 void setGridDim(U32 gd) { mGridDim = gd; mGridDim1 = mGridDim + 1; }
179 U32 index(const LL2Coord& c) const { return c.y() * mGridDim1 + c.x(); }
180 U32 index(U32 x, U32 y) const { return y * mGridDim1 + x; }
181
182 LLVector3 vtx(const LL2Coord& c, F32 raised) const
183 {
184 LLVector3 v = mVtx[index(c)];
185 v.mV[VZ] += raised;
186 return v;
187 }
188
189 LLVector3 vtx(U32 x, U32 y, F32 raised) const
190 {
191 LLVector3 v = mVtx[index(x, y)];
192 v.mV[VZ] += raised;
193 return v;
194 }
195
196 void setVertex(const U32 x, const U32 y, const F32 raised, LLVector3 &vertex) const
197 {
198 vertex = mVtx[index(x, y)];
199 vertex.mV[VZ] += raised;
200 }
201
202 void setCamPosition(LL2Coord& cam, const LLVector3& cam_pos)
203 {
204 cam.x() = llround((cam_pos.mV[VX] - mRegionOrigin.mV[VX]) / mMinStep);
205 cam.y() = llround((cam_pos.mV[VY] - mRegionOrigin.mV[VY]) / mMinStep);
206 }
207
208 LLVector3 vtx(const LL2Coord& c) const { return mVtx[index(c)]; }
209 LLVector3 norm(const LL2Coord& c) const { return mNorms[index(c)]; }
210 LLVector3 vtx(U32 x, U32 y) const { return mVtx[index(x, y)]; }
211 LLVector3 norm(U32 x, U32 y) const { return mNorms[index(x, y)]; }
212
213protected:
214 LLWaterSurface mWater;
215 U32 mGridDim;
216 U32 mGridDim1;
217};
218
219class LLSurface; 41class LLSurface;
220class LLHeavenBody; 42class LLHeavenBody;
221class LLVOSky; 43class LLVOSky;
222class LLFace; 44class LLFace;
223 45
224class LLVOWater : public LLViewerObject 46class LLVOWater : public LLStaticViewerObject
225{ 47{
226public: 48public:
49 enum
50 {
51 VERTEX_DATA_MASK = (1 << LLVertexBuffer::TYPE_VERTEX) |
52 (1 << LLVertexBuffer::TYPE_NORMAL) |
53 (1 << LLVertexBuffer::TYPE_TEXCOORD)
54 }
55 eVertexDataMask;
56
227 LLVOWater(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp); 57 LLVOWater(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp);
228 virtual ~LLVOWater() {} 58 virtual ~LLVOWater() {}
229 59
@@ -236,24 +66,19 @@ public:
236 /*virtual*/ BOOL idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time); 66 /*virtual*/ BOOL idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time);
237 /*virtual*/ LLDrawable* createDrawable(LLPipeline *pipeline); 67 /*virtual*/ LLDrawable* createDrawable(LLPipeline *pipeline);
238 /*virtual*/ BOOL updateGeometry(LLDrawable *drawable); 68 /*virtual*/ BOOL updateGeometry(LLDrawable *drawable);
239 BOOL updateGeometryFlat(LLDrawable *drawable); 69 /*virtual*/ void updateSpatialExtents(LLVector3& newMin, LLVector3& newMax);
240 BOOL updateGeometryHeightFieldSimple(LLDrawable *drawable);
241 BOOL updateGeometryHeightFieldRoam(LLDrawable *drawable);
242 70
243 /*virtual*/ void updateDrawable(BOOL force_damped);
244 /*virtual*/ void updateTextures(LLAgent &agent); 71 /*virtual*/ void updateTextures(LLAgent &agent);
245 /*virtual*/ void setPixelAreaAndAngle(LLAgent &agent); // generate accurate apparent angle and area 72 /*virtual*/ void setPixelAreaAndAngle(LLAgent &agent); // generate accurate apparent angle and area
246 73
74 virtual U32 getPartitionType() const;
75
247 /*virtual*/ BOOL isActive() const; // Whether this object needs to do an idleUpdate. 76 /*virtual*/ BOOL isActive() const; // Whether this object needs to do an idleUpdate.
248 77
249 void setUseTexture(const BOOL use_texture); 78 void setUseTexture(const BOOL use_texture);
250 79
251 static void generateNewWaves(F64 time);
252 static LLWaterSurface* getWaterSurface() { return sGrid->getWaterSurface(); }//return &mWater; }
253 static const LLWaterGrid* getGrid() { return sGrid; }
254protected: 80protected:
255 BOOL mUseTexture; 81 BOOL mUseTexture;
256 static LLWaterGrid *sGrid;
257}; 82};
258 83
259#endif // LL_VOSURFACEPATCH_H 84#endif // LL_VOSURFACEPATCH_H
diff --git a/linden/indra/newview/llwearable.cpp b/linden/indra/newview/llwearable.cpp
index 310eae5..3e3f7ab 100644
--- a/linden/indra/newview/llwearable.cpp
+++ b/linden/indra/newview/llwearable.cpp
@@ -34,11 +34,13 @@
34#include "llquantize.h" 34#include "llquantize.h"
35 35
36#include "llagent.h" 36#include "llagent.h"
37#include "llassetuploadresponders.h"
37#include "llviewerwindow.h" 38#include "llviewerwindow.h"
38#include "llfloatercustomize.h" 39#include "llfloatercustomize.h"
39#include "llinventorymodel.h" 40#include "llinventorymodel.h"
40#include "llviewerimagelist.h" 41#include "llviewerimagelist.h"
41#include "llviewerinventory.h" 42#include "llviewerinventory.h"
43#include "llviewerregion.h"
42#include "llvoavatar.h" 44#include "llvoavatar.h"
43#include "llwearable.h" 45#include "llwearable.h"
44 46
@@ -148,10 +150,10 @@ EWearableType LLWearable::typeNameToType( const LLString& type_name )
148} 150}
149 151
150 152
151const char* terse_F32_to_string( F32 f, char s[MAX_STRING] ) 153const char* terse_F32_to_string( F32 f, char s[MAX_STRING] ) /* Flawfinder: ignore */
152{ 154{
153 char* r = s; 155 char* r = s;
154 S32 len = sprintf( s, "%.2f", f ); 156 S32 len = snprintf( s, MAX_STRING, "%.2f", f ); /* Flawfinder: ignore */
155 157
156 // "1.20" -> "1.2" 158 // "1.20" -> "1.2"
157 // "24.00" -> "24." 159 // "24.00" -> "24."
@@ -230,7 +232,7 @@ BOOL LLWearable::exportFile( FILE* file )
230 return FALSE; 232 return FALSE;
231 } 233 }
232 234
233 char s[ MAX_STRING ]; 235 char s[ MAX_STRING ]; /* Flawfinder: ignore */
234 for( F32* param_weightp = mVisualParamMap.getFirstData(); param_weightp; param_weightp = mVisualParamMap.getNextData() ) 236 for( F32* param_weightp = mVisualParamMap.getFirstData(); param_weightp; param_weightp = mVisualParamMap.getNextData() )
235 { 237 {
236 S32 param_id = mVisualParamMap.getCurrentKeyWithoutIncrement(); 238 S32 param_id = mVisualParamMap.getCurrentKeyWithoutIncrement();
@@ -250,7 +252,7 @@ BOOL LLWearable::exportFile( FILE* file )
250 for( LLUUID* image_id = mTEMap.getFirstData(); image_id; image_id = mTEMap.getNextData() ) 252 for( LLUUID* image_id = mTEMap.getFirstData(); image_id; image_id = mTEMap.getNextData() )
251 { 253 {
252 S32 te = mTEMap.getCurrentKeyWithoutIncrement(); 254 S32 te = mTEMap.getCurrentKeyWithoutIncrement();
253 char image_id_string[UUID_STR_LENGTH]; 255 char image_id_string[UUID_STR_LENGTH]; /* Flawfinder: ignore */
254 image_id->toString( image_id_string ); 256 image_id->toString( image_id_string );
255 if( fprintf( file, "%d %s\n", te, image_id_string) < 0 ) 257 if( fprintf( file, "%d %s\n", te, image_id_string) < 0 )
256 { 258 {
@@ -268,7 +270,7 @@ BOOL LLWearable::importFile( FILE* file )
268 // *NOTE: changing the type or size of this buffer will require 270 // *NOTE: changing the type or size of this buffer will require
269 // changes in the fscanf() code below. You would be better off 271 // changes in the fscanf() code below. You would be better off
270 // rewriting this to use streams and not require an open FILE. 272 // rewriting this to use streams and not require an open FILE.
271 char text_buffer[2048]; 273 char text_buffer[2048]; /* Flawfinder: ignore */
272 S32 fields_read = 0; 274 S32 fields_read = 0;
273 275
274 // read header and version 276 // read header and version
@@ -289,7 +291,7 @@ BOOL LLWearable::importFile( FILE* file )
289 } 291 }
290 292
291 // name 293 // name
292 char next_char = fgetc( file ); 294 char next_char = fgetc( file ); /* Flawfinder: ignore */
293 if( '\n' == next_char ) 295 if( '\n' == next_char )
294 { 296 {
295 // no name 297 // no name
@@ -298,8 +300,11 @@ BOOL LLWearable::importFile( FILE* file )
298 else 300 else
299 { 301 {
300 ungetc( next_char, file ); 302 ungetc( next_char, file );
301 fields_read = fscanf( file, "%2047[^\n]", text_buffer ); 303 fields_read = fscanf( /* Flawfinder: ignore */
302 if( (1 != fields_read) || (fgetc( file ) != '\n') ) 304 file,
305 "%2047[^\n]",
306 text_buffer);
307 if( (1 != fields_read) || (fgetc( file ) != '\n') ) /* Flawfinder: ignore */
303 { 308 {
304 llwarns << "Bad Wearable asset: early end of file" << llendl; 309 llwarns << "Bad Wearable asset: early end of file" << llendl;
305 return FALSE; 310 return FALSE;
@@ -309,7 +314,7 @@ BOOL LLWearable::importFile( FILE* file )
309 } 314 }
310 315
311 // description 316 // description
312 next_char = fgetc( file ); 317 next_char = fgetc( file ); /* Flawfinder: ignore */
313 if( '\n' == next_char ) 318 if( '\n' == next_char )
314 { 319 {
315 // no description 320 // no description
@@ -318,8 +323,11 @@ BOOL LLWearable::importFile( FILE* file )
318 else 323 else
319 { 324 {
320 ungetc( next_char, file ); 325 ungetc( next_char, file );
321 fields_read = fscanf( file, "%2047[^\n]", text_buffer ); 326 fields_read = fscanf( /* Flawfinder: ignore */
322 if( (1 != fields_read) || (fgetc( file ) != '\n') ) 327 file,
328 "%2047[^\n]",
329 text_buffer );
330 if( (1 != fields_read) || (fgetc( file ) != '\n') ) /* Flawfinder: ignore */
323 { 331 {
324 llwarns << "Bad Wearable asset: early end of file" << llendl; 332 llwarns << "Bad Wearable asset: early end of file" << llendl;
325 return FALSE; 333 return FALSE;
@@ -425,7 +433,10 @@ BOOL LLWearable::importFile( FILE* file )
425 for( i = 0; i < num_textures; i++ ) 433 for( i = 0; i < num_textures; i++ )
426 { 434 {
427 S32 te = 0; 435 S32 te = 0;
428 fields_read = fscanf( file, "%d %2047s\n", &te, text_buffer); 436 fields_read = fscanf( /* Flawfinder: ignore */
437 file,
438 "%d %2047s\n",
439 &te, text_buffer);
429 if( fields_read != 2 ) 440 if( fields_read != 2 )
430 { 441 {
431 llwarns << "Bad Wearable asset: bad texture, #" << i << llendl; 442 llwarns << "Bad Wearable asset: bad texture, #" << i << llendl;
@@ -863,11 +874,11 @@ void LLWearable::saveNewAsset()
863// llinfos << "LLWearable::saveNewAsset() type: " << getTypeName() << llendl; 874// llinfos << "LLWearable::saveNewAsset() type: " << getTypeName() << llendl;
864 //dump(); 875 //dump();
865 876
866 char new_asset_id_string[UUID_STR_LENGTH]; 877 char new_asset_id_string[UUID_STR_LENGTH]; /* Flawfinder: ignore */
867 mAssetID.toString(new_asset_id_string); 878 mAssetID.toString(new_asset_id_string);
868 char filename[LL_MAX_PATH]; 879 char filename[LL_MAX_PATH]; /* Flawfinder: ignore */
869 sprintf(filename, "%s.wbl", gDirUtilp->getExpandedFilename(LL_PATH_CACHE,new_asset_id_string).c_str()); 880 snprintf(filename, LL_MAX_PATH, "%s.wbl", gDirUtilp->getExpandedFilename(LL_PATH_CACHE,new_asset_id_string).c_str()); /* Flawfinder: ignore */
870 FILE* fp = LLFile::fopen(filename, "wb"); 881 FILE* fp = LLFile::fopen(filename, "wb"); /* Flawfinder: ignore */
871 BOOL successful_save = FALSE; 882 BOOL successful_save = FALSE;
872 if(fp && exportFile(fp)) 883 if(fp && exportFile(fp))
873 { 884 {
@@ -880,8 +891,9 @@ void LLWearable::saveNewAsset()
880 } 891 }
881 if(!successful_save) 892 if(!successful_save)
882 { 893 {
883 char buffer[2*MAX_STRING]; 894 char buffer[2*MAX_STRING]; /* Flawfinder: ignore */
884 sprintf(buffer, 895 snprintf(buffer, /* Flawfinder: ignore */
896 sizeof(buffer),
885 "Unable to save '%s' to wearable file.", 897 "Unable to save '%s' to wearable file.",
886 mName.c_str()); 898 mName.c_str());
887 llwarns << buffer << llendl; 899 llwarns << buffer << llendl;
@@ -895,11 +907,28 @@ void LLWearable::saveNewAsset()
895 // save it out to database 907 // save it out to database
896 if( gAssetStorage ) 908 if( gAssetStorage )
897 { 909 {
898 LLWearableSaveData* data = new LLWearableSaveData; 910 /*
899 data->mType = mType; 911 std::string url = gAgent.getRegion()->getCapability("NewAgentInventory");
900 gAssetStorage->storeAssetData(filename, mTransactionID, getAssetType(), 912 if (!url.empty())
901 &LLWearable::onSaveNewAssetComplete, 913 {
902 (void*)data); 914 llinfos << "Update Agent Inventory via capability" << llendl;
915 LLSD body;
916 body["folder_id"] = gInventory.findCategoryUUIDForType(getAssetType());
917 body["asset_type"] = LLAssetType::lookup(getAssetType());
918 body["inventory_type"] = LLInventoryType::lookup(LLInventoryType::IT_WEARABLE);
919 body["name"] = getName();
920 body["description"] = getDescription();
921 LLHTTPClient::post(url, body, new LLNewAgentInventoryResponder(body, filename));
922 }
923 else
924 {
925 }
926 */
927 LLWearableSaveData* data = new LLWearableSaveData;
928 data->mType = mType;
929 gAssetStorage->storeAssetData(filename, mTransactionID, getAssetType(),
930 &LLWearable::onSaveNewAssetComplete,
931 (void*)data);
903 } 932 }
904} 933}
905 934
@@ -915,8 +944,9 @@ void LLWearable::onSaveNewAssetComplete(const LLUUID& new_asset_id, void* userda
915 } 944 }
916 else 945 else
917 { 946 {
918 char buffer[2*MAX_STRING]; 947 char buffer[2*MAX_STRING]; /* Flawfinder: ignore */
919 sprintf(buffer, 948 snprintf(buffer, /* Flawfinder: ignore */
949 sizeof(buffer),
920 "Unable to save %s to central asset store.", 950 "Unable to save %s to central asset store.",
921 type_name); 951 type_name);
922 llwarns << buffer << " Status: " << status << llendl; 952 llwarns << buffer << " Status: " << status << llendl;
@@ -926,10 +956,10 @@ void LLWearable::onSaveNewAssetComplete(const LLUUID& new_asset_id, void* userda
926 } 956 }
927 957
928 // Delete temp file 958 // Delete temp file
929 char new_asset_id_string[UUID_STR_LENGTH]; 959 char new_asset_id_string[UUID_STR_LENGTH]; /* Flawfinder: ignore */
930 new_asset_id.toString(new_asset_id_string); 960 new_asset_id.toString(new_asset_id_string);
931 char src_filename[LL_MAX_PATH]; 961 char src_filename[LL_MAX_PATH]; /* Flawfinder: ignore */
932 sprintf(src_filename, "%s.wbl", gDirUtilp->getExpandedFilename(LL_PATH_CACHE,new_asset_id_string).c_str()); 962 snprintf(src_filename, LL_MAX_PATH, "%s.wbl", gDirUtilp->getExpandedFilename(LL_PATH_CACHE,new_asset_id_string).c_str()); /* Flawfinder: ignore */
933 LLFile::remove(src_filename); 963 LLFile::remove(src_filename);
934 964
935 // delete the context data 965 // delete the context data
diff --git a/linden/indra/newview/llwearablelist.cpp b/linden/indra/newview/llwearablelist.cpp
index 28af5eb..10079f8 100644
--- a/linden/indra/newview/llwearablelist.cpp
+++ b/linden/indra/newview/llwearablelist.cpp
@@ -105,7 +105,7 @@ void LLWearableList::processGetAssetReply( const char* filename, const LLAssetID
105 if( status >= 0 ) 105 if( status >= 0 )
106 { 106 {
107 // read the file 107 // read the file
108 FILE* fp = LLFile::fopen(filename, "rb"); 108 FILE* fp = LLFile::fopen(filename, "rb"); /*Flawfinder: ignore*/
109 if( !fp ) 109 if( !fp )
110 { 110 {
111 llinfos << "Bad Wearable Asset: unable to open file: '" << filename << "'" << llendl; 111 llinfos << "Bad Wearable Asset: unable to open file: '" << filename << "'" << llendl;
diff --git a/linden/indra/newview/llwebbrowserctrl.cpp b/linden/indra/newview/llwebbrowserctrl.cpp
index 6d1ee28..7df2da4 100644
--- a/linden/indra/newview/llwebbrowserctrl.cpp
+++ b/linden/indra/newview/llwebbrowserctrl.cpp
@@ -45,15 +45,32 @@ const S32 MAX_TEXTURE_DIMENSION = 2048;
45 45
46LLWebBrowserCtrl::LLWebBrowserCtrl( const std::string& name, const LLRect& rect ) : 46LLWebBrowserCtrl::LLWebBrowserCtrl( const std::string& name, const LLRect& rect ) :
47 LLUICtrl( name, rect, FALSE, NULL, NULL ), 47 LLUICtrl( name, rect, FALSE, NULL, NULL ),
48 mEmbeddedBrowserWindowId( 0 ),
49 mTextureDepthBytes( 4 ), 48 mTextureDepthBytes( 4 ),
50 mBorder( 0 ), 49 mEmbeddedBrowserWindowId( 0 ),
50 mBorder(NULL),
51 mFrequentUpdates( true ), 51 mFrequentUpdates( true ),
52 mOpenLinksInExternalBrowser( false ), 52 mOpenLinksInExternalBrowser( false ),
53 mHomePageUrl( "" ) 53 mHomePageUrl( "" ),
54 mIgnoreUIScale( true )
54{ 55{
56 S32 screen_width = mIgnoreUIScale ? llround((F32)mRect.getWidth() * LLUI::sGLScaleFactor.mV[VX]) : mRect.getWidth();
57 S32 screen_height = mIgnoreUIScale ? llround((F32)mRect.getHeight() * LLUI::sGLScaleFactor.mV[VY]) : mRect.getHeight();
58
55 // create a new browser window 59 // create a new browser window
56 mEmbeddedBrowserWindowId = LLMozLib::getInstance()->createBrowserWindow( gViewerWindow->getPlatformWindow(), mRect.getWidth(), mRect.getHeight() ); 60 {
61#if LL_LINUX
62 // Yuck, Mozilla init plays with the locale - push/pop
63 // the locale to protect it, as exotic/non-C locales
64 // causes our code lots of general critical weirdness
65 // and crashness. (SL-35450)
66 char *saved_locale = setlocale(LC_ALL, NULL);
67#endif // LL_LINUX
68 mEmbeddedBrowserWindowId = LLMozLib::getInstance()->createBrowserWindow( gViewerWindow->getPlatformWindow(), screen_width, screen_height );
69#if LL_LINUX
70 if (saved_locale)
71 setlocale(LC_ALL, saved_locale);
72#endif // LL_LINUX
73 }
57 74
58 // change color to black so transisitons aren't so noticable (this should be in XML eventually) 75 // change color to black so transisitons aren't so noticable (this should be in XML eventually)
59 LLMozLib::getInstance()->setBackgroundColor( mEmbeddedBrowserWindowId, 0x00, 0x00, 0x00 ); 76 LLMozLib::getInstance()->setBackgroundColor( mEmbeddedBrowserWindowId, 0x00, 0x00, 0x00 );
@@ -62,7 +79,7 @@ LLWebBrowserCtrl::LLWebBrowserCtrl( const std::string& name, const LLRect& rect
62 LLMozLib::getInstance()->addObserver( mEmbeddedBrowserWindowId, this ); 79 LLMozLib::getInstance()->addObserver( mEmbeddedBrowserWindowId, this );
63 80
64 // create a new texture (based on LLDynamic texture) that will be used to display the output 81 // create a new texture (based on LLDynamic texture) that will be used to display the output
65 mWebBrowserImage = new LLWebBrowserTexture( mRect.getWidth(), mRect.getHeight(), this, mEmbeddedBrowserWindowId ); 82 mWebBrowserImage = new LLWebBrowserTexture( screen_width, screen_height, this, mEmbeddedBrowserWindowId );
66 83
67 LLRect border_rect( 0, mRect.getHeight() + 2, mRect.getWidth() + 2, 0 ); 84 LLRect border_rect( 0, mRect.getHeight() + 2, mRect.getWidth() + 2, 0 );
68 mBorder = new LLViewBorder( "web control border", border_rect, LLViewBorder::BEVEL_IN ); 85 mBorder = new LLViewBorder( "web control border", border_rect, LLViewBorder::BEVEL_IN );
@@ -119,7 +136,8 @@ void LLWebBrowserCtrl::setOpenInExternalBrowser( bool valIn )
119// 136//
120BOOL LLWebBrowserCtrl::handleHover( S32 x, S32 y, MASK mask ) 137BOOL LLWebBrowserCtrl::handleHover( S32 x, S32 y, MASK mask )
121{ 138{
122 LLMozLib::getInstance()->mouseMove( mEmbeddedBrowserWindowId, x, mRect.getHeight() - y ); 139 convertInputCoords(x, y);
140 LLMozLib::getInstance()->mouseMove( mEmbeddedBrowserWindowId, x, y );
123 141
124 return TRUE; 142 return TRUE;
125} 143}
@@ -142,7 +160,8 @@ BOOL LLWebBrowserCtrl::handleScrollWheel( S32 x, S32 y, S32 clicks )
142// 160//
143BOOL LLWebBrowserCtrl::handleMouseUp( S32 x, S32 y, MASK mask ) 161BOOL LLWebBrowserCtrl::handleMouseUp( S32 x, S32 y, MASK mask )
144{ 162{
145 LLMozLib::getInstance()->mouseUp( mEmbeddedBrowserWindowId, x, mRect.getHeight() - y ); 163 convertInputCoords(x, y);
164 LLMozLib::getInstance()->mouseUp( mEmbeddedBrowserWindowId, x, y );
146 165
147 gViewerWindow->setMouseCapture( 0, 0 ); 166 gViewerWindow->setMouseCapture( 0, 0 );
148 167
@@ -153,7 +172,8 @@ BOOL LLWebBrowserCtrl::handleMouseUp( S32 x, S32 y, MASK mask )
153// 172//
154BOOL LLWebBrowserCtrl::handleMouseDown( S32 x, S32 y, MASK mask ) 173BOOL LLWebBrowserCtrl::handleMouseDown( S32 x, S32 y, MASK mask )
155{ 174{
156 LLMozLib::getInstance()->mouseDown( mEmbeddedBrowserWindowId, x, mRect.getHeight() - y ); 175 convertInputCoords(x, y);
176 LLMozLib::getInstance()->mouseDown( mEmbeddedBrowserWindowId, x, y );
157 177
158 gViewerWindow->setMouseCapture( this, 0 ); 178 gViewerWindow->setMouseCapture( this, 0 );
159 179
@@ -184,9 +204,67 @@ void LLWebBrowserCtrl::onFocusLost()
184// 204//
185BOOL LLWebBrowserCtrl::handleKey( KEY key, MASK mask, BOOL called_from_parent ) 205BOOL LLWebBrowserCtrl::handleKey( KEY key, MASK mask, BOOL called_from_parent )
186{ 206{
187 LLMozLib::getInstance()->keyPress( mEmbeddedBrowserWindowId, key ); 207 unsigned long nskey;
208
209 // First, turn SL internal keycode enum into Mozilla keycode enum
210
211 // We don't have to deal with printable characters here - they should
212 // go through handleUnicodeChar(). This table could be more complete
213 // than it is, but I think this covers all of the important
214 // non-printables.
215 switch (key)
216 {
217 case KEY_BACKSPACE:
218 nskey = LL_DOM_VK_BACK_SPACE; break;
219 case KEY_TAB:
220 nskey = LL_DOM_VK_TAB; break;
221 case KEY_RETURN:
222 nskey = LL_DOM_VK_RETURN; break;
223 case KEY_PAD_RETURN:
224 nskey = LL_DOM_VK_ENTER; break;
225 case KEY_ESCAPE:
226 nskey = LL_DOM_VK_ESCAPE; break;
227 case KEY_PAGE_UP:
228 nskey = LL_DOM_VK_PAGE_UP; break;
229 case KEY_PAGE_DOWN:
230 nskey = LL_DOM_VK_PAGE_DOWN; break;
231 case KEY_END:
232 nskey = LL_DOM_VK_END; break;
233 case KEY_HOME:
234 nskey = LL_DOM_VK_HOME; break;
235 case KEY_LEFT:
236 nskey = LL_DOM_VK_LEFT; break;
237 case KEY_UP:
238 nskey = LL_DOM_VK_UP; break;
239 case KEY_RIGHT:
240 nskey = LL_DOM_VK_RIGHT; break;
241 case KEY_DOWN:
242 nskey = LL_DOM_VK_DOWN; break;
243 case KEY_INSERT:
244 nskey = LL_DOM_VK_INSERT; break;
245 case KEY_DELETE:
246 nskey = LL_DOM_VK_DELETE; break;
247 default:
248 llinfos << "Don't know how to map LL keycode " << U32(key)
249 << " to DOM key. Ignoring." << llendl;
250 return FALSE; // don't know how to map this key.
251 }
188 252
189 return FALSE; 253 LLMozLib::getInstance()->keyPress( mEmbeddedBrowserWindowId, nskey );
254
255 return TRUE;
256}
257
258BOOL LLWebBrowserCtrl::handleUnicodeChar(llwchar uni_char, BOOL called_from_parent)
259{
260 // only accept 'printable' characters, sigh...
261 if (uni_char >= 32 // discard 'control' characters
262 && uni_char != 127) // SDL thinks this is 'delete' - yuck.
263 {
264 LLMozLib::getInstance()->unicodeInput( mEmbeddedBrowserWindowId, uni_char );
265 }
266
267 return TRUE;
190} 268}
191 269
192//////////////////////////////////////////////////////////////////////////////// 270////////////////////////////////////////////////////////////////////////////////
@@ -208,9 +286,13 @@ void LLWebBrowserCtrl::onVisibilityChange ( BOOL curVisibilityIn )
208// 286//
209void LLWebBrowserCtrl::reshape( S32 width, S32 height, BOOL called_from_parent ) 287void LLWebBrowserCtrl::reshape( S32 width, S32 height, BOOL called_from_parent )
210{ 288{
289 S32 screen_width = mIgnoreUIScale ? llround((F32)width * LLUI::sGLScaleFactor.mV[VX]) : width;
290 S32 screen_height = mIgnoreUIScale ? llround((F32)height * LLUI::sGLScaleFactor.mV[VX]) : height;
211 // when floater is minimized, these sizes are negative 291 // when floater is minimized, these sizes are negative
212 if ( height > 0 && width > 0 ) 292 if ( screen_height > 0 && screen_width > 0 )
213 mWebBrowserImage->resize( width, height ); 293 {
294 mWebBrowserImage->resize( screen_width, screen_height );
295 }
214 296
215 LLUICtrl::reshape( width, height, called_from_parent ); 297 LLUICtrl::reshape( width, height, called_from_parent );
216} 298}
@@ -310,38 +392,60 @@ void LLWebBrowserCtrl::draw()
310 LLGLSUIDefault gls_ui; 392 LLGLSUIDefault gls_ui;
311 LLGLDisable gls_alphaTest( GL_ALPHA_TEST ); 393 LLGLDisable gls_alphaTest( GL_ALPHA_TEST );
312 394
313 // scale texture to fit the space using texture coords 395 glPushMatrix();
314 mWebBrowserImage->bindTexture();
315 glColor4fv( LLColor4::white.mV );
316 F32 max_u = ( F32 )mWebBrowserImage->getBrowserWidth() / ( F32 )mWebBrowserImage->getWidth();
317 F32 max_v = ( F32 )mWebBrowserImage->getBrowserHeight() / ( F32 )mWebBrowserImage->getHeight();
318
319 // draw the browser
320 glBlendFunc( GL_ONE, GL_ZERO );
321 glBegin( GL_QUADS );
322 { 396 {
323 glTexCoord2f( max_u, 0.f ); 397 if (mIgnoreUIScale)
324 glVertex2i( mRect.getWidth(), mRect.getHeight() ); 398 {
399 glLoadIdentity();
400 // font system stores true screen origin, need to scale this by UI scale factor
401 // to get render origin for this view (with unit scale)
402 glTranslatef(floorf(LLFontGL::sCurOrigin.mX * LLUI::sGLScaleFactor.mV[VX]),
403 floorf(LLFontGL::sCurOrigin.mY * LLUI::sGLScaleFactor.mV[VY]),
404 LLFontGL::sCurOrigin.mZ);
405 }
406
407 // scale texture to fit the space using texture coords
408 mWebBrowserImage->bindTexture();
409 glColor4fv( LLColor4::white.mV );
410 F32 max_u = ( F32 )mWebBrowserImage->getBrowserWidth() / ( F32 )mWebBrowserImage->getWidth();
411 F32 max_v = ( F32 )mWebBrowserImage->getBrowserHeight() / ( F32 )mWebBrowserImage->getHeight();
412
413 // draw the browser
414 glBlendFunc( GL_ONE, GL_ZERO );
415 glBegin( GL_QUADS );
416 {
417 // render using web browser reported width and height, instead of trying to invert GL scale
418 glTexCoord2f( max_u, 0.f );
419 glVertex2i( mWebBrowserImage->getBrowserWidth(), mWebBrowserImage->getBrowserHeight() );
325 420
326 glTexCoord2f( 0.f, 0.f ); 421 glTexCoord2f( 0.f, 0.f );
327 glVertex2i( 0, mRect.getHeight() ); 422 glVertex2i( 0, mWebBrowserImage->getBrowserHeight() );
328 423
329 glTexCoord2f( 0.f, max_v ); 424 glTexCoord2f( 0.f, max_v );
330 glVertex2i( 0, 0 ); 425 glVertex2i( 0, 0 );
331 426
332 glTexCoord2f( max_u, max_v ); 427 glTexCoord2f( max_u, max_v );
333 glVertex2i( mRect.getWidth(), 0 ); 428 glVertex2i( mWebBrowserImage->getBrowserWidth(), 0 );
429 }
430 glEnd();
431 glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA );
334 } 432 }
335 glEnd(); 433 glPopMatrix();
336 glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA );
337 434
338 // highlight if keyboard focus here. (TODO: this needs some work) 435 // highlight if keyboard focus here. (TODO: this needs some work)
339 if ( mBorder->getVisible() ) 436 if ( mBorder->getVisible() )
340 mBorder->setKeyboardFocusHighlight( gFocusMgr.childHasKeyboardFocus( this ) ); 437 mBorder->setKeyboardFocusHighlight( gFocusMgr.childHasKeyboardFocus( this ) );
341 438
439
342 LLUICtrl::draw(); 440 LLUICtrl::draw();
343} 441}
344 442
443void LLWebBrowserCtrl::convertInputCoords(S32& x, S32& y)
444{
445 x = mIgnoreUIScale ? llround((F32)x * LLUI::sGLScaleFactor.mV[VX]) : x;
446 y = mIgnoreUIScale ? llround((F32)(mRect.getHeight() - y) * LLUI::sGLScaleFactor.mV[VY]) : (mRect.getHeight() - y);
447}
448
345//////////////////////////////////////////////////////////////////////////////// 449////////////////////////////////////////////////////////////////////////////////
346// virtual 450// virtual
347void LLWebBrowserCtrl::onNavigateBegin( const EventType& eventIn ) 451void LLWebBrowserCtrl::onNavigateBegin( const EventType& eventIn )
@@ -551,6 +655,8 @@ void LLWebBrowserTexture::resize( S32 new_width, S32 new_height )
551 if ( actual_rowspan < 1 || browser_depth < 2 ) 655 if ( actual_rowspan < 1 || browser_depth < 2 )
552 return; 656 return;
553 657
658 releaseGLTexture();
659
554 S32 pagebuffer_width = actual_rowspan / browser_depth; 660 S32 pagebuffer_width = actual_rowspan / browser_depth;
555 661
556 // calculate the next power of 2 bigger than reqquested size for width and height 662 // calculate the next power of 2 bigger than reqquested size for width and height
@@ -635,6 +741,10 @@ LLView* LLWebBrowserCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFac
635 741
636 LLWebBrowserCtrl* web_browser = new LLWebBrowserCtrl( name, rect ); 742 LLWebBrowserCtrl* web_browser = new LLWebBrowserCtrl( name, rect );
637 743
744 BOOL ignore_ui_scale = web_browser->getIgnoreUIScale();
745 node->getAttributeBOOL("ignore_ui_scale", ignore_ui_scale);
746 web_browser->setIgnoreUIScale((bool)ignore_ui_scale);
747
638 web_browser->initFromXML(node, parent); 748 web_browser->initFromXML(node, parent);
639 749
640 web_browser->setHomePageUrl( start_url ); 750 web_browser->setHomePageUrl( start_url );
diff --git a/linden/indra/newview/llwebbrowserctrl.h b/linden/indra/newview/llwebbrowserctrl.h
index bad6e88..e6f9005 100644
--- a/linden/indra/newview/llwebbrowserctrl.h
+++ b/linden/indra/newview/llwebbrowserctrl.h
@@ -192,8 +192,12 @@ class LLWebBrowserCtrl :
192 bool getFrequentUpdates() { return mFrequentUpdates; }; 192 bool getFrequentUpdates() { return mFrequentUpdates; };
193 void setFrequentUpdates( bool frequentUpdatesIn ) { mFrequentUpdates = frequentUpdatesIn; }; 193 void setFrequentUpdates( bool frequentUpdatesIn ) { mFrequentUpdates = frequentUpdatesIn; };
194 194
195 void setIgnoreUIScale(bool ignore) { mIgnoreUIScale = ignore; }
196 bool getIgnoreUIScale() { return mIgnoreUIScale; }
197
195 // over-rides 198 // over-rides
196 virtual BOOL handleKey( KEY key, MASK mask, BOOL called_from_parent ); 199 virtual BOOL handleKey( KEY key, MASK mask, BOOL called_from_parent );
200 virtual BOOL handleUnicodeChar(llwchar uni_char, BOOL called_from_parent);
197 virtual void reshape( S32 width, S32 height, BOOL called_from_parent ); 201 virtual void reshape( S32 width, S32 height, BOOL called_from_parent );
198 virtual void draw(); 202 virtual void draw();
199 virtual void onVisibilityChange ( BOOL curVisibilityIn ); 203 virtual void onVisibilityChange ( BOOL curVisibilityIn );
@@ -214,6 +218,9 @@ class LLWebBrowserCtrl :
214 virtual void onLocationChange( const EventType& eventIn ); 218 virtual void onLocationChange( const EventType& eventIn );
215 virtual void onClickLinkHref( const EventType& eventIn ); 219 virtual void onClickLinkHref( const EventType& eventIn );
216 virtual void onClickLinkSecondLife( const EventType& eventIn ); 220 virtual void onClickLinkSecondLife( const EventType& eventIn );
221
222 protected:
223 void convertInputCoords(S32& x, S32& y);
217 224
218 private: 225 private:
219 LLWebBrowserCtrlEventEmitter< LLWebBrowserCtrlObserver > mEventEmitter; 226 LLWebBrowserCtrlEventEmitter< LLWebBrowserCtrlObserver > mEventEmitter;
@@ -224,6 +231,7 @@ class LLWebBrowserCtrl :
224 bool mFrequentUpdates; 231 bool mFrequentUpdates;
225 bool mOpenLinksInExternalBrowser; 232 bool mOpenLinksInExternalBrowser;
226 std::string mHomePageUrl; 233 std::string mHomePageUrl;
234 bool mIgnoreUIScale;
227}; 235};
228 236
229//////////////////////////////////////////////////////////////////////////////// 237////////////////////////////////////////////////////////////////////////////////
diff --git a/linden/indra/newview/llworld.cpp b/linden/indra/newview/llworld.cpp
index 18d4e48..cf85eab 100644
--- a/linden/indra/newview/llworld.cpp
+++ b/linden/indra/newview/llworld.cpp
@@ -62,7 +62,6 @@ U32 gAgentPauseSerialNum = 0;
62// Constants 62// Constants
63// 63//
64const S32 MAX_NUMBER_OF_CLOUDS = 750; 64const S32 MAX_NUMBER_OF_CLOUDS = 750;
65const F32 MIN_IDLE_UPDATE_TIME = 0.025f;
66const S32 WORLD_PATCH_SIZE = 16; 65const S32 WORLD_PATCH_SIZE = 16;
67 66
68extern LLColor4U MAX_WATER_COLOR; 67extern LLColor4U MAX_WATER_COLOR;
@@ -82,7 +81,6 @@ LLWorld::LLWorld(const U32 grids_per_region, const F32 meters_per_grid)
82 mLastPacketsOut = 0; 81 mLastPacketsOut = 0;
83 mLastPacketsLost = 0; 82 mLastPacketsLost = 0;
84 mLandFarClip = DEFAULT_FAR_PLANE; 83 mLandFarClip = DEFAULT_FAR_PLANE;
85 mIdleUpdateTime = MIN_IDLE_UPDATE_TIME;
86 84
87 if (gNoRender) 85 if (gNoRender)
88 { 86 {
@@ -635,31 +633,22 @@ void LLWorld::updateVisibilities()
635 gCamera->setFar(cur_far_clip); 633 gCamera->setFar(cur_far_clip);
636} 634}
637 635
638 636void LLWorld::updateRegions(F32 max_update_time)
639void LLWorld::updateRegions()
640{ 637{
641 LLViewerRegion *regionp; 638 LLViewerRegion *regionp;
642 LLTimer update_timer; 639 LLTimer update_timer;
643 640 BOOL did_one = FALSE;
641
644 // Perform idle time updates for the regions (and associated surfaces) 642 // Perform idle time updates for the regions (and associated surfaces)
645 for (regionp = mRegionList.getFirstData(); 643 for (regionp = mRegionList.getFirstData();
646 regionp; 644 regionp;
647 regionp = mRegionList.getNextData()) 645 regionp = mRegionList.getNextData())
648 { 646 {
649 update_timer.reset(); 647 F32 max_time = max_update_time - update_timer.getElapsedTimeF32();
650 if (!regionp->idleUpdate(update_timer, mIdleUpdateTime)) 648 if (did_one && max_time <= 0.f)
651 { 649 break;
652 // Didn't finish all the updates. Slightly increase the idle update time. 650 max_time = llmin(max_time, max_update_time*.1f);
653 mIdleUpdateTime *= 1.05f; 651 did_one |= regionp->idleUpdate(max_update_time);
654 }
655 else
656 {
657 mIdleUpdateTime *= 0.9f;
658 if (mIdleUpdateTime < MIN_IDLE_UPDATE_TIME)
659 {
660 mIdleUpdateTime = MIN_IDLE_UPDATE_TIME;
661 }
662 }
663 } 652 }
664} 653}
665 654
diff --git a/linden/indra/newview/llworld.h b/linden/indra/newview/llworld.h
index 6645b94..b10b287 100644
--- a/linden/indra/newview/llworld.h
+++ b/linden/indra/newview/llworld.h
@@ -114,7 +114,7 @@ public:
114 F32 getRegionMinHeight() const { return -mWidthInMeters; } 114 F32 getRegionMinHeight() const { return -mWidthInMeters; }
115 F32 getRegionMaxHeight() const { return 3.f*mWidthInMeters; } 115 F32 getRegionMaxHeight() const { return 3.f*mWidthInMeters; }
116 116
117 void updateRegions(); 117 void updateRegions(F32 max_update_time);
118 void updateVisibilities(); 118 void updateVisibilities();
119 void updateParticles(); 119 void updateParticles();
120 void updateClouds(const F32 dt); 120 void updateClouds(const F32 dt);
@@ -159,7 +159,6 @@ private:
159 const F32 mWidthInMeters; 159 const F32 mWidthInMeters;
160 160
161 F32 mLandFarClip; // Far clip distance for land. 161 F32 mLandFarClip; // Far clip distance for land.
162 F32 mIdleUpdateTime;
163 LLPatchVertexArray mLandPatch; 162 LLPatchVertexArray mLandPatch;
164 S32 mLastPacketsIn; 163 S32 mLastPacketsIn;
165 S32 mLastPacketsOut; 164 S32 mLastPacketsOut;
diff --git a/linden/indra/newview/llworldmap.cpp b/linden/indra/newview/llworldmap.cpp
index 6e010f7..0bdab0d 100644
--- a/linden/indra/newview/llworldmap.cpp
+++ b/linden/indra/newview/llworldmap.cpp
@@ -266,7 +266,6 @@ void LLWorldMap::setCurrentLayer(S32 layer, bool request_layer)
266 if (!mMapLoaded[layer] || request_layer) 266 if (!mMapLoaded[layer] || request_layer)
267 { 267 {
268 sendMapLayerRequest(); 268 sendMapLayerRequest();
269 sendItemRequest(MAP_ITEM_AGENT_COUNT);
270 } 269 }
271 270
272 if (mTelehubs.size() == 0 || 271 if (mTelehubs.size() == 0 ||
@@ -506,8 +505,8 @@ void LLWorldMap::processMapBlockReply(LLMessageSystem* msg, void**)
506 { 505 {
507 U16 x_regions; 506 U16 x_regions;
508 U16 y_regions; 507 U16 y_regions;
509 char name[MAX_STRING]; 508 char name[MAX_STRING]; /* Flawfinder: ignore */
510 U8 access; 509 U8 access; /* Flawfinder: ignore */
511 U32 region_flags; 510 U32 region_flags;
512 U8 water_height; 511 U8 water_height;
513 U8 agents; 512 U8 agents;
@@ -515,7 +514,7 @@ void LLWorldMap::processMapBlockReply(LLMessageSystem* msg, void**)
515 msg->getU16Fast(_PREHASH_Data, _PREHASH_X, x_regions, block); 514 msg->getU16Fast(_PREHASH_Data, _PREHASH_X, x_regions, block);
516 msg->getU16Fast(_PREHASH_Data, _PREHASH_Y, y_regions, block); 515 msg->getU16Fast(_PREHASH_Data, _PREHASH_Y, y_regions, block);
517 msg->getStringFast(_PREHASH_Data, _PREHASH_Name, MAX_STRING, name, block); 516 msg->getStringFast(_PREHASH_Data, _PREHASH_Name, MAX_STRING, name, block);
518 msg->getU8Fast(_PREHASH_Data, _PREHASH_Access, access, block); 517 msg->getU8Fast(_PREHASH_Data, _PREHASH_Access, access, block); /* Flawfinder: ignore */
519 msg->getU32Fast(_PREHASH_Data, _PREHASH_RegionFlags, region_flags, block); 518 msg->getU32Fast(_PREHASH_Data, _PREHASH_RegionFlags, region_flags, block);
520 msg->getU8Fast(_PREHASH_Data, _PREHASH_WaterHeight, water_height, block); 519 msg->getU8Fast(_PREHASH_Data, _PREHASH_WaterHeight, water_height, block);
521 msg->getU8Fast(_PREHASH_Data, _PREHASH_Agents, agents, block); 520 msg->getU8Fast(_PREHASH_Data, _PREHASH_Agents, agents, block);
@@ -564,7 +563,7 @@ void LLWorldMap::processMapBlockReply(LLMessageSystem* msg, void**)
564 563
565 siminfo->mHandle = handle; 564 siminfo->mHandle = handle;
566 siminfo->mName.assign( name ); 565 siminfo->mName.assign( name );
567 siminfo->mAccess = access; 566 siminfo->mAccess = access; /* Flawfinder: ignore */
568 siminfo->mRegionFlags = region_flags; 567 siminfo->mRegionFlags = region_flags;
569 siminfo->mWaterHeight = (F32) water_height; 568 siminfo->mWaterHeight = (F32) water_height;
570 siminfo->mMapImageID[agent_flags] = image_id; 569 siminfo->mMapImageID[agent_flags] = image_id;
@@ -621,7 +620,7 @@ void LLWorldMap::processMapItemReply(LLMessageSystem* msg, void**)
621 for (S32 block=0; block<num_blocks; ++block) 620 for (S32 block=0; block<num_blocks; ++block)
622 { 621 {
623 U32 X, Y; 622 U32 X, Y;
624 char name[MAX_STRING]; 623 char name[MAX_STRING]; /* Flawfinder: ignore */
625 S32 extra, extra2; 624 S32 extra, extra2;
626 LLUUID uuid; 625 LLUUID uuid;
627 msg->getU32Fast(_PREHASH_Data, _PREHASH_X, X, block); 626 msg->getU32Fast(_PREHASH_Data, _PREHASH_X, X, block);
@@ -671,7 +670,7 @@ void LLWorldMap::processMapItemReply(LLMessageSystem* msg, void**)
671 case MAP_ITEM_PG_EVENT: // events 670 case MAP_ITEM_PG_EVENT: // events
672 case MAP_ITEM_MATURE_EVENT: 671 case MAP_ITEM_MATURE_EVENT:
673 { 672 {
674 char buffer[32]; 673 char buffer[32]; /* Flawfinder: ignore */
675 struct tm* timep; 674 struct tm* timep;
676 // Convert to Pacific, based on server's opinion of whether 675 // Convert to Pacific, based on server's opinion of whether
677 // it's daylight savings time there. 676 // it's daylight savings time there.
@@ -680,7 +679,7 @@ void LLWorldMap::processMapItemReply(LLMessageSystem* msg, void**)
680 S32 display_hour = timep->tm_hour % 12; 679 S32 display_hour = timep->tm_hour % 12;
681 if (display_hour == 0) display_hour = 12; 680 if (display_hour == 0) display_hour = 12;
682 681
683 sprintf(buffer, "%d:%02d %s", 682 snprintf(buffer, sizeof(buffer), "%d:%02d %s", /* Flawfinder: ignore */
684 display_hour, 683 display_hour,
685 timep->tm_min, 684 timep->tm_min,
686 (timep->tm_hour < 12 ? "AM" : "PM") ); 685 (timep->tm_hour < 12 ? "AM" : "PM") );
@@ -717,12 +716,6 @@ void LLWorldMap::processMapItemReply(LLMessageSystem* msg, void**)
717 gWorldMap->mClassifieds.push_back(new_item); 716 gWorldMap->mClassifieds.push_back(new_item);
718 break; 717 break;
719 } 718 }
720 case MAP_ITEM_AGENT_COUNT: // agent counts
721 {
722 // We only ever receive one per region, i.e. this update superceeds any others
723 gWorldMap->mNumAgents[new_item.mRegionHandle] = new_item.mExtra;
724 break;
725 }
726 case MAP_ITEM_AGENT_LOCATIONS: // agent locations 719 case MAP_ITEM_AGENT_LOCATIONS: // agent locations
727 { 720 {
728 if (!siminfo) 721 if (!siminfo)
diff --git a/linden/indra/newview/llworldmapview.cpp b/linden/indra/newview/llworldmapview.cpp
index 83e10d9..65a084d 100644
--- a/linden/indra/newview/llworldmapview.cpp
+++ b/linden/indra/newview/llworldmapview.cpp
@@ -167,8 +167,7 @@ LLWorldMapView::LLWorldMapView(const std::string& name, const LLRect& rect )
167 mMouseDownPanY( 0 ), 167 mMouseDownPanY( 0 ),
168 mMouseDownX( 0 ), 168 mMouseDownX( 0 ),
169 mMouseDownY( 0 ), 169 mMouseDownY( 0 ),
170 mSelectIDStart(0), 170 mSelectIDStart(0)
171 mAgentCountsUpdateTime(0)
172{ 171{
173 sPixelsPerMeter = gMapScale / REGION_WIDTH_METERS; 172 sPixelsPerMeter = gMapScale / REGION_WIDTH_METERS;
174 clearLastClick(); 173 clearLastClick();
@@ -298,12 +297,6 @@ void LLWorldMapView::draw()
298 297
299 F64 current_time = LLTimer::getElapsedSeconds(); 298 F64 current_time = LLTimer::getElapsedSeconds();
300 299
301 if (current_time - mAgentCountsUpdateTime > AGENT_COUNTS_UPDATE_TIME)
302 {
303 gWorldMap->sendItemRequest(MAP_ITEM_AGENT_COUNT);
304 mAgentCountsUpdateTime = current_time;
305 }
306
307 mVisibleRegions.clear(); 300 mVisibleRegions.clear();
308 301
309 // animate pan if necessary 302 // animate pan if necessary
@@ -324,7 +317,6 @@ void LLWorldMapView::draw()
324 { 317 {
325 LLGLSNoTexture no_texture; 318 LLGLSNoTexture no_texture;
326 319
327
328 glMatrixMode(GL_MODELVIEW); 320 glMatrixMode(GL_MODELVIEW);
329 321
330 // Clear the background alpha to 0 322 // Clear the background alpha to 0
@@ -388,14 +380,12 @@ void LLWorldMapView::draw()
388 current_image->setBoostLevel(LLViewerImage::BOOST_MAP_LAYER); 380 current_image->setBoostLevel(LLViewerImage::BOOST_MAP_LAYER);
389 current_image->setKnownDrawSize(llround(pix_width), llround(pix_height)); 381 current_image->setKnownDrawSize(llround(pix_width), llround(pix_height));
390 382
391#if 1 || LL_RELEASE_FOR_DOWNLOAD
392 if (!current_image->getHasGLTexture()) 383 if (!current_image->getHasGLTexture())
393 { 384 {
394 continue; // better to draw nothing than the default image 385 continue; // better to draw nothing than the default image
395 } 386 }
396#endif
397 387
398 LLTextureView::addDebugImage(current_image); 388// LLTextureView::addDebugImage(current_image);
399 389
400 // Draw using the texture. If we don't clamp we get artifact at 390 // Draw using the texture. If we don't clamp we get artifact at
401 // the edge. 391 // the edge.
@@ -548,7 +538,7 @@ void LLWorldMapView::draw()
548 overlayimage->setKnownDrawSize(draw_size, draw_size); 538 overlayimage->setKnownDrawSize(draw_size, draw_size);
549 } 539 }
550 540
551 LLTextureView::addDebugImage(simimage); 541// LLTextureView::addDebugImage(simimage);
552 542
553 if (sim_visible && info->mAlpha > 0.001f) 543 if (sim_visible && info->mAlpha > 0.001f)
554 { 544 {
@@ -640,7 +630,7 @@ void LLWorldMapView::draw()
640 // Draw the region name in the lower left corner 630 // Draw the region name in the lower left corner
641 LLFontGL* font = LLFontGL::sSansSerifSmall; 631 LLFontGL* font = LLFontGL::sSansSerifSmall;
642 632
643 char mesg[MAX_STRING]; 633 char mesg[MAX_STRING]; /* Flawfinder: ignore */
644 if (gMapScale < sThresholdA) 634 if (gMapScale < sThresholdA)
645 { 635 {
646 mesg[0] = '\0'; 636 mesg[0] = '\0';
@@ -658,11 +648,11 @@ void LLWorldMapView::draw()
658 // LLViewerRegion::accessToShortString(info->mAccess) ); 648 // LLViewerRegion::accessToShortString(info->mAccess) );
659 if (info->mAccess == SIM_ACCESS_DOWN) 649 if (info->mAccess == SIM_ACCESS_DOWN)
660 { 650 {
661 sprintf(mesg, "%s (Offline)", info->mName.c_str()); 651 snprintf(mesg, MAX_STRING, "%s (Offline)", info->mName.c_str()); /* Flawfinder: ignore */
662 } 652 }
663 else 653 else
664 { 654 {
665 sprintf(mesg, "%s", info->mName.c_str()); 655 snprintf(mesg, MAX_STRING, "%s", info->mName.c_str()); /* Flawfinder: ignore */
666 } 656 }
667 } 657 }
668 658
@@ -841,6 +831,39 @@ void LLWorldMapView::draw()
841 updateVisibleBlocks(); 831 updateVisibleBlocks();
842} 832}
843 833
834//virtual
835void LLWorldMapView::setVisible(BOOL visible)
836{
837 LLPanel::setVisible(visible);
838 if (!visible && gWorldMap)
839 {
840 for (S32 map = 0; map < MAP_SIM_IMAGE_TYPES; map++)
841 {
842 for (U32 layer_idx=0; layer_idx<gWorldMap->mMapLayers[map].size(); ++layer_idx)
843 {
844 if (gWorldMap->mMapLayers[map][layer_idx].LayerDefined)
845 {
846 LLWorldMapLayer *layer = &gWorldMap->mMapLayers[map][layer_idx];
847 layer->LayerImage->setBoostLevel(0);
848 }
849 }
850 }
851 for (LLWorldMap::sim_info_map_t::iterator it = gWorldMap->mSimInfoMap.begin();
852 it != gWorldMap->mSimInfoMap.end(); ++it)
853 {
854 LLSimInfo* info = (*it).second;
855 if (info->mCurrentImage.notNull())
856 {
857 info->mCurrentImage->setBoostLevel(0);
858 }
859 if (info->mOverlayImage.notNull())
860 {
861 info->mOverlayImage->setBoostLevel(0);
862 }
863 }
864 }
865}
866
844void LLWorldMapView::drawGenericItems(const LLWorldMap::item_info_list_t& items, LLPointer<LLViewerImage> image) 867void LLWorldMapView::drawGenericItems(const LLWorldMap::item_info_list_t& items, LLPointer<LLViewerImage> image)
845{ 868{
846 LLWorldMap::item_info_list_t::const_iterator e; 869 LLWorldMap::item_info_list_t::const_iterator e;
@@ -1912,7 +1935,7 @@ BOOL LLWorldMapView::handleDoubleClick( S32 x, S32 y, MASK mask )
1912 { 1935 {
1913 gFloaterWorldMap->close(); 1936 gFloaterWorldMap->close();
1914 // This is an ungainly hack 1937 // This is an ungainly hack
1915 char uuid_str[38]; 1938 char uuid_str[38]; /* Flawfinder: ignore */
1916 S32 event_id; 1939 S32 event_id;
1917 id.toString(uuid_str); 1940 id.toString(uuid_str);
1918 sscanf(&uuid_str[28], "%X", &event_id); 1941 sscanf(&uuid_str[28], "%X", &event_id);
diff --git a/linden/indra/newview/llworldmapview.h b/linden/indra/newview/llworldmapview.h
index 5c18aab..f2912bd 100644
--- a/linden/indra/newview/llworldmapview.h
+++ b/linden/indra/newview/llworldmapview.h
@@ -52,8 +52,9 @@ class LLTextBox;
52#define SIM_MAP_AGENT_SCALE 20 // width in pixels, where we start drawing agents 52#define SIM_MAP_AGENT_SCALE 20 // width in pixels, where we start drawing agents
53#define SIM_MAP_SCALE 90 // width in pixels, where we start drawing sim tiles 53#define SIM_MAP_SCALE 90 // width in pixels, where we start drawing sim tiles
54 54
55// Updates for agent locations.
55#define AGENTS_UPDATE_TIME 60.0 // in seconds 56#define AGENTS_UPDATE_TIME 60.0 // in seconds
56#define AGENT_COUNTS_UPDATE_TIME 60.0 // in seconds 57
57 58
58class LLWorldMapView : public LLPanel 59class LLWorldMapView : public LLPanel
59{ 60{
@@ -65,12 +66,13 @@ public:
65 virtual ~LLWorldMapView(); 66 virtual ~LLWorldMapView();
66 67
67 virtual void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE ); 68 virtual void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE );
69 virtual void setVisible(BOOL visible);
68 70
69 virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask); 71 virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask);
70 virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask); 72 virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask);
71 virtual BOOL handleDoubleClick( S32 x, S32 y, MASK mask ); 73 virtual BOOL handleDoubleClick( S32 x, S32 y, MASK mask );
72 virtual BOOL handleHover( S32 x, S32 y, MASK mask ); 74 virtual BOOL handleHover( S32 x, S32 y, MASK mask );
73 /*virtual*/ BOOL handleToolTip( S32 x, S32 y, LLString& msg, LLRect* sticky_rect_screen ); 75 virtual BOOL handleToolTip( S32 x, S32 y, LLString& msg, LLRect* sticky_rect_screen );
74 76
75 bool checkItemHit(S32 x, S32 y, LLItemInfo& item, LLUUID* id, bool track); 77 bool checkItemHit(S32 x, S32 y, LLItemInfo& item, LLUUID* id, bool track);
76 void handleClick(S32 x, S32 y, MASK mask, S32* hit_type, LLUUID* id); 78 void handleClick(S32 x, S32 y, MASK mask, S32* hit_type, LLUUID* id);
@@ -183,7 +185,6 @@ public:
183 185
184 static BOOL sHandledLastClick; 186 static BOOL sHandledLastClick;
185 S32 mSelectIDStart; 187 S32 mSelectIDStart;
186 F64 mAgentCountsUpdateTime;
187 188
188 typedef std::vector<U64> handle_list_t; 189 typedef std::vector<U64> handle_list_t;
189 handle_list_t mVisibleRegions; // set every frame 190 handle_list_t mVisibleRegions; // set every frame
diff --git a/linden/indra/newview/llxmlrpctransaction.cpp b/linden/indra/newview/llxmlrpctransaction.cpp
index 9b8a872..d84f5c6 100644
--- a/linden/indra/newview/llxmlrpctransaction.cpp
+++ b/linden/indra/newview/llxmlrpctransaction.cpp
@@ -155,7 +155,7 @@ public:
155 std::string mStatusMessage; 155 std::string mStatusMessage;
156 std::string mStatusURI; 156 std::string mStatusURI;
157 157
158 char mCurlErrorBuffer[CURL_ERROR_SIZE]; 158 char mCurlErrorBuffer[CURL_ERROR_SIZE]; /* Flawfinder: ignore */
159 159
160 std::string mURI; 160 std::string mURI;
161 char* mRequestText; 161 char* mRequestText;
@@ -343,9 +343,9 @@ bool LLXMLRPCTransaction::Impl::process()
343 if (curl_msg->data.result != CURLE_OK) 343 if (curl_msg->data.result != CURLE_OK)
344 { 344 {
345 setCurlStatus(curl_msg->data.result); 345 setCurlStatus(curl_msg->data.result);
346 llalerts << "LLXMLRPCTransaction CURL error " 346 llwarns << "LLXMLRPCTransaction CURL error "
347 << mCurlCode << ": " << mCurlErrorBuffer << llendl; 347 << mCurlCode << ": " << mCurlErrorBuffer << llendl;
348 llalerts << "LLXMLRPCTransaction request URI: " 348 llwarns << "LLXMLRPCTransaction request URI: "
349 << mURI << llendl; 349 << mURI << llendl;
350 350
351 return true; 351 return true;
@@ -379,11 +379,11 @@ bool LLXMLRPCTransaction::Impl::process()
379 { 379 {
380 setStatus(LLXMLRPCTransaction::StatusXMLRPCError); 380 setStatus(LLXMLRPCTransaction::StatusXMLRPCError);
381 381
382 llalerts << "LLXMLRPCTransaction XMLRPC " 382 llwarns << "LLXMLRPCTransaction XMLRPC "
383 << (hasError ? "error " : "fault ") 383 << (hasError ? "error " : "fault ")
384 << faultCode << ": " 384 << faultCode << ": "
385 << faultString << llendl; 385 << faultString << llendl;
386 llalerts << "LLXMLRPCTransaction request URI: " 386 llwarns << "LLXMLRPCTransaction request URI: "
387 << mURI << llendl; 387 << mURI << llendl;
388 } 388 }
389 389
@@ -427,9 +427,9 @@ void LLXMLRPCTransaction::Impl::setStatus(Status status,
427 mStatusMessage = 427 mStatusMessage =
428 "Despite our best efforts, something unexpected has gone wrong. \n" 428 "Despite our best efforts, something unexpected has gone wrong. \n"
429 " \n" 429 " \n"
430 "Please check www.secondlife.com/status and the Second Life \n" 430 "Please check www.secondlife.com/status \n"
431 "Announcements forum to see if there is a known problem with \n" 431 "to see if there is a known problem with the service.";
432 "the service."; 432
433 mStatusURI = "http://secondlife.com/status/"; 433 mStatusURI = "http://secondlife.com/status/";
434 /* 434 /*
435 mStatusMessage = 435 mStatusMessage =
diff --git a/linden/indra/newview/lsl_guide.html b/linden/indra/newview/lsl_guide.html
index e0faf7b..6f3796f 100644
--- a/linden/indra/newview/lsl_guide.html
+++ b/linden/indra/newview/lsl_guide.html
@@ -58,7 +58,7 @@ NAME="AEN16"
58>Donald Kjer</H3 58>Donald Kjer</H3
59><P 59><P
60CLASS="copyright" 60CLASS="copyright"
61>Copyright &copy; 2003 Linden Lab</P 61>Copyright &copy; 2007 Linden Lab</P
62><DIV 62><DIV
63CLASS="legalnotice" 63CLASS="legalnotice"
64><P 64><P
@@ -1623,631 +1623,641 @@ HREF="#AEN3894"
1623><DT 1623><DT
1624>A.234. <A 1624>A.234. <A
1625HREF="#AEN3913" 1625HREF="#AEN3913"
1626>llSetLocalRot</A 1626>llSetLinkPrimitiveParams</A
1627></DT 1627></DT
1628><DT 1628><DT
1629>A.235. <A 1629>A.235. <A
1630HREF="#AEN3922" 1630HREF="#AEN3929"
1631>llSetObjectDesc</A 1631>llSetLinkTexture</A
1632></DT 1632></DT
1633><DT 1633><DT
1634>A.236. <A 1634>A.236. <A
1635HREF="#AEN3932" 1635HREF="#AEN3948"
1636>llSetObjectName</A 1636>llSetLocalRot</A
1637></DT 1637></DT
1638><DT 1638><DT
1639>A.237. <A 1639>A.237. <A
1640HREF="#AEN3942" 1640HREF="#AEN3957"
1641>llSetParcelMusicURL</A 1641>llSetObjectDesc</A
1642></DT 1642></DT
1643><DT 1643><DT
1644>A.238. <A 1644>A.238. <A
1645HREF="#AEN3952" 1645HREF="#AEN3967"
1646>llSetPayPrice</A 1646>llSetObjectName</A
1647></DT 1647></DT
1648><DT 1648><DT
1649>A.239. <A 1649>A.239. <A
1650HREF="#AEN3964" 1650HREF="#AEN3977"
1651>llSetPos</A 1651>llSetParcelMusicURL</A
1652></DT 1652></DT
1653><DT 1653><DT
1654>A.240. <A 1654>A.240. <A
1655HREF="#AEN3973" 1655HREF="#AEN3987"
1656>llSetPrimitiveParams</A 1656>llSetPayPrice</A
1657></DT 1657></DT
1658><DT 1658><DT
1659>A.241. <A 1659>A.241. <A
1660HREF="#AEN3987" 1660HREF="#AEN3999"
1661>llSetRemoteScriptAccessPin</A 1661>llSetPos</A
1662></DT 1662></DT
1663><DT 1663><DT
1664>A.242. <A 1664>A.242. <A
1665HREF="#AEN3996" 1665HREF="#AEN4008"
1666>llSetRot</A 1666>llSetPrimitiveParams</A
1667></DT 1667></DT
1668><DT 1668><DT
1669>A.243. <A 1669>A.243. <A
1670HREF="#AEN4005" 1670HREF="#AEN4022"
1671>llSetScale</A 1671>llSetRemoteScriptAccessPin</A
1672></DT 1672></DT
1673><DT 1673><DT
1674>A.244. <A 1674>A.244. <A
1675HREF="#AEN4014" 1675HREF="#AEN4031"
1676>llSetScriptState</A 1676>llSetRot</A
1677></DT 1677></DT
1678><DT 1678><DT
1679>A.245. <A 1679>A.245. <A
1680HREF="#AEN4025" 1680HREF="#AEN4040"
1681>llSetSitText</A 1681>llSetScale</A
1682></DT 1682></DT
1683><DT 1683><DT
1684>A.246. <A 1684>A.246. <A
1685HREF="#AEN4035" 1685HREF="#AEN4049"
1686>llSetSoundQueueing</A 1686>llSetScriptState</A
1687></DT 1687></DT
1688><DT 1688><DT
1689>A.247. <A 1689>A.247. <A
1690HREF="#AEN4048" 1690HREF="#AEN4060"
1691>llSetStatus</A 1691>llSetSitText</A
1692></DT 1692></DT
1693><DT 1693><DT
1694>A.248. <A 1694>A.248. <A
1695HREF="#AEN4063" 1695HREF="#AEN4070"
1696>llSetText</A 1696>llSetSoundQueueing</A
1697></DT 1697></DT
1698><DT 1698><DT
1699>A.249. <A 1699>A.249. <A
1700HREF="#AEN4079" 1700HREF="#AEN4083"
1701>llSetTexture</A 1701>llSetStatus</A
1702></DT 1702></DT
1703><DT 1703><DT
1704>A.250. <A 1704>A.250. <A
1705HREF="#AEN4093" 1705HREF="#AEN4098"
1706>llSetTextureAnim</A 1706>llSetText</A
1707></DT 1707></DT
1708><DT 1708><DT
1709>A.251. <A 1709>A.251. <A
1710HREF="#AEN4141" 1710HREF="#AEN4114"
1711>llSetTimerEvent</A 1711>llSetTexture</A
1712></DT 1712></DT
1713><DT 1713><DT
1714>A.252. <A 1714>A.252. <A
1715HREF="#AEN4153" 1715HREF="#AEN4128"
1716>llSetTorque</A 1716>llSetTextureAnim</A
1717></DT 1717></DT
1718><DT 1718><DT
1719>A.253. <A 1719>A.253. <A
1720HREF="#AEN4167" 1720HREF="#AEN4176"
1721>llSetTouchText</A 1721>llSetTimerEvent</A
1722></DT 1722></DT
1723><DT 1723><DT
1724>A.254. <A 1724>A.254. <A
1725HREF="#AEN4177" 1725HREF="#AEN4188"
1726>llSetVehicleFlags</A 1726>llSetTorque</A
1727></DT 1727></DT
1728><DT 1728><DT
1729>A.255. <A 1729>A.255. <A
1730HREF="#AEN4188" 1730HREF="#AEN4202"
1731>llSetVehicleFloatParam</A 1731>llSetTouchText</A
1732></DT 1732></DT
1733><DT 1733><DT
1734>A.256. <A 1734>A.256. <A
1735HREF="#AEN4202" 1735HREF="#AEN4212"
1736>llSetVehicleType</A 1736>llSetVehicleFlags</A
1737></DT 1737></DT
1738><DT 1738><DT
1739>A.257. <A 1739>A.257. <A
1740HREF="#AEN4213" 1740HREF="#AEN4223"
1741>llSetVehicleRotationParam</A 1741>llSetVehicleFloatParam</A
1742></DT 1742></DT
1743><DT 1743><DT
1744>A.258. <A 1744>A.258. <A
1745HREF="#AEN4227" 1745HREF="#AEN4237"
1746>llSetVehicleVectorParam</A 1746>llSetVehicleType</A
1747></DT 1747></DT
1748><DT 1748><DT
1749>A.259. <A 1749>A.259. <A
1750HREF="#AEN4241" 1750HREF="#AEN4248"
1751>llShout</A 1751>llSetVehicleRotationParam</A
1752></DT 1752></DT
1753><DT 1753><DT
1754>A.260. <A 1754>A.260. <A
1755HREF="#AEN4255" 1755HREF="#AEN4262"
1756>llSin</A 1756>llSetVehicleVectorParam</A
1757></DT 1757></DT
1758><DT 1758><DT
1759>A.261. <A 1759>A.261. <A
1760HREF="#AEN4265" 1760HREF="#AEN4276"
1761>llSitTarget</A 1761>llShout</A
1762></DT 1762></DT
1763><DT 1763><DT
1764>A.262. <A 1764>A.262. <A
1765HREF="#AEN4278" 1765HREF="#AEN4290"
1766>llSleep</A 1766>llSin</A
1767></DT 1767></DT
1768><DT 1768><DT
1769>A.263. <A 1769>A.263. <A
1770HREF="#AEN4288" 1770HREF="#AEN4300"
1771>llSqrt</A 1771>llSitTarget</A
1772></DT 1772></DT
1773><DT 1773><DT
1774>A.264. <A 1774>A.264. <A
1775HREF="#AEN4299" 1775HREF="#AEN4313"
1776>llStartAnimation</A 1776>llSleep</A
1777></DT 1777></DT
1778><DT 1778><DT
1779>A.265. <A 1779>A.265. <A
1780HREF="#AEN4531" 1780HREF="#AEN4323"
1781>llStopAnimation</A 1781>llSqrt</A
1782></DT 1782></DT
1783><DT 1783><DT
1784>A.266. <A 1784>A.266. <A
1785HREF="#AEN4541" 1785HREF="#AEN4334"
1786>llStopHover</A 1786>llStartAnimation</A
1787></DT 1787></DT
1788><DT 1788><DT
1789>A.267. <A 1789>A.267. <A
1790HREF="#AEN4549" 1790HREF="#AEN4566"
1791>llStopLookAt</A 1791>llStopAnimation</A
1792></DT 1792></DT
1793><DT 1793><DT
1794>A.268. <A 1794>A.268. <A
1795HREF="#AEN4557" 1795HREF="#AEN4576"
1796>llStopMoveToTarget</A 1796>llStopHover</A
1797></DT 1797></DT
1798><DT 1798><DT
1799>A.269. <A 1799>A.269. <A
1800HREF="#AEN4565" 1800HREF="#AEN4584"
1801>llStopPointAt</A 1801>llStopLookAt</A
1802></DT 1802></DT
1803><DT 1803><DT
1804>A.270. <A 1804>A.270. <A
1805HREF="#AEN4573" 1805HREF="#AEN4592"
1806>llStopSound</A 1806>llStopMoveToTarget</A
1807></DT 1807></DT
1808><DT 1808><DT
1809>A.271. <A 1809>A.271. <A
1810HREF="#AEN4584" 1810HREF="#AEN4600"
1811>llStringLength</A 1811>llStopPointAt</A
1812></DT 1812></DT
1813><DT 1813><DT
1814>A.272. <A 1814>A.272. <A
1815HREF="#AEN4594" 1815HREF="#AEN4608"
1816>llSubStringIndex</A 1816>llStopSound</A
1817></DT 1817></DT
1818><DT 1818><DT
1819>A.273. <A 1819>A.273. <A
1820HREF="#AEN4605" 1820HREF="#AEN4619"
1821>llStringToBase64</A 1821>llStringLength</A
1822></DT 1822></DT
1823><DT 1823><DT
1824>A.274. <A 1824>A.274. <A
1825HREF="#AEN4614" 1825HREF="#AEN4629"
1826>llTakeControls</A 1826>llSubStringIndex</A
1827></DT 1827></DT
1828><DT 1828><DT
1829>A.275. <A 1829>A.275. <A
1830HREF="#AEN4631" 1830HREF="#AEN4640"
1831>llTan</A 1831>llStringToBase64</A
1832></DT 1832></DT
1833><DT 1833><DT
1834>A.276. <A 1834>A.276. <A
1835HREF="#AEN4641" 1835HREF="#AEN4649"
1836>llTarget</A 1836>llTakeControls</A
1837></DT 1837></DT
1838><DT 1838><DT
1839>A.277. <A 1839>A.277. <A
1840HREF="#AEN4654" 1840HREF="#AEN4666"
1841>llTargetOmega</A 1841>llTan</A
1842></DT 1842></DT
1843><DT 1843><DT
1844>A.278. <A 1844>A.278. <A
1845HREF="#AEN4671" 1845HREF="#AEN4676"
1846>llTargetRemove</A 1846>llTarget</A
1847></DT 1847></DT
1848><DT 1848><DT
1849>A.279. <A 1849>A.279. <A
1850HREF="#AEN4681" 1850HREF="#AEN4689"
1851>llTeleportAgentHome</A 1851>llTargetOmega</A
1852></DT 1852></DT
1853><DT 1853><DT
1854>A.280. <A 1854>A.280. <A
1855HREF="#AEN4690" 1855HREF="#AEN4706"
1856>llToLower</A 1856>llTargetRemove</A
1857></DT 1857></DT
1858><DT 1858><DT
1859>A.281. <A 1859>A.281. <A
1860HREF="#AEN4699" 1860HREF="#AEN4716"
1861>llToUpper</A 1861>llTeleportAgentHome</A
1862></DT 1862></DT
1863><DT 1863><DT
1864>A.282. <A 1864>A.282. <A
1865HREF="#AEN4709" 1865HREF="#AEN4725"
1866>llTriggerSound</A 1866>llToLower</A
1867></DT 1867></DT
1868><DT 1868><DT
1869>A.283. <A 1869>A.283. <A
1870HREF="#AEN4723" 1870HREF="#AEN4734"
1871>llTriggerSoundLimited</A 1871>llToUpper</A
1872></DT 1872></DT
1873><DT 1873><DT
1874>A.284. <A 1874>A.284. <A
1875HREF="#AEN4743" 1875HREF="#AEN4744"
1876>llUnescapeURL</A 1876>llTriggerSound</A
1877></DT 1877></DT
1878><DT 1878><DT
1879>A.285. <A 1879>A.285. <A
1880HREF="#AEN4753" 1880HREF="#AEN4758"
1881>llUnSit</A 1881>llTriggerSoundLimited</A
1882></DT 1882></DT
1883><DT 1883><DT
1884>A.286. <A 1884>A.286. <A
1885HREF="#AEN4763" 1885HREF="#AEN4778"
1886>llVecDist</A 1886>llUnescapeURL</A
1887></DT 1887></DT
1888><DT 1888><DT
1889>A.287. <A 1889>A.287. <A
1890HREF="#AEN4776" 1890HREF="#AEN4788"
1891>llVecMag</A 1891>llUnSit</A
1892></DT 1892></DT
1893><DT 1893><DT
1894>A.288. <A 1894>A.288. <A
1895HREF="#AEN4786" 1895HREF="#AEN4798"
1896>llVecNorm</A 1896>llVecDist</A
1897></DT 1897></DT
1898><DT 1898><DT
1899>A.289. <A 1899>A.289. <A
1900HREF="#AEN4796" 1900HREF="#AEN4811"
1901>llVolumeDetect</A 1901>llVecMag</A
1902></DT 1902></DT
1903><DT 1903><DT
1904>A.290. <A 1904>A.290. <A
1905HREF="#AEN4805" 1905HREF="#AEN4821"
1906>llWater</A 1906>llVecNorm</A
1907></DT 1907></DT
1908><DT 1908><DT
1909>A.291. <A 1909>A.291. <A
1910HREF="#AEN4815" 1910HREF="#AEN4831"
1911>llWhisper</A 1911>llVolumeDetect</A
1912></DT 1912></DT
1913><DT 1913><DT
1914>A.292. <A 1914>A.292. <A
1915HREF="#AEN4829" 1915HREF="#AEN4840"
1916>llWind</A 1916>llWater</A
1917></DT 1917></DT
1918><DT 1918><DT
1919>A.293. <A 1919>A.293. <A
1920HREF="#AEN4839" 1920HREF="#AEN4850"
1921>llWhisper</A
1922></DT
1923><DT
1924>A.294. <A
1925HREF="#AEN4864"
1926>llWind</A
1927></DT
1928><DT
1929>A.295. <A
1930HREF="#AEN4874"
1921>llXorBase64Strings</A 1931>llXorBase64Strings</A
1922></DT 1932></DT
1923></DL 1933></DL
1924></DD 1934></DD
1925><DT 1935><DT
1926>B. <A 1936>B. <A
1927HREF="#AEN4852" 1937HREF="#AEN4887"
1928>Events</A 1938>Events</A
1929></DT 1939></DT
1930><DD 1940><DD
1931><DL 1941><DL
1932><DT 1942><DT
1933>B.1. <A 1943>B.1. <A
1934HREF="#AEN4855" 1944HREF="#AEN4890"
1935>at_rot_target</A 1945>at_rot_target</A
1936></DT 1946></DT
1937><DT 1947><DT
1938>B.2. <A 1948>B.2. <A
1939HREF="#AEN4869" 1949HREF="#AEN4904"
1940>at_target</A 1950>at_target</A
1941></DT 1951></DT
1942><DT 1952><DT
1943>B.3. <A 1953>B.3. <A
1944HREF="#AEN4883" 1954HREF="#AEN4918"
1945>attach</A 1955>attach</A
1946></DT 1956></DT
1947><DT 1957><DT
1948>B.4. <A 1958>B.4. <A
1949HREF="#AEN4893" 1959HREF="#AEN4928"
1950>changed</A 1960>changed</A
1951></DT 1961></DT
1952><DT 1962><DT
1953>B.5. <A 1963>B.5. <A
1954HREF="#AEN4904" 1964HREF="#AEN4939"
1955>collision</A 1965>collision</A
1956></DT 1966></DT
1957><DT 1967><DT
1958>B.6. <A 1968>B.6. <A
1959HREF="#AEN4914" 1969HREF="#AEN4949"
1960>collision_end</A 1970>collision_end</A
1961></DT 1971></DT
1962><DT 1972><DT
1963>B.7. <A 1973>B.7. <A
1964HREF="#AEN4924" 1974HREF="#AEN4959"
1965>collision_start</A 1975>collision_start</A
1966></DT 1976></DT
1967><DT 1977><DT
1968>B.8. <A 1978>B.8. <A
1969HREF="#AEN4934" 1979HREF="#AEN4969"
1970>control</A 1980>control</A
1971></DT 1981></DT
1972><DT 1982><DT
1973>B.9. <A 1983>B.9. <A
1974HREF="#AEN4950" 1984HREF="#AEN4985"
1975>dataserver</A 1985>dataserver</A
1976></DT 1986></DT
1977><DT 1987><DT
1978>B.10. <A 1988>B.10. <A
1979HREF="#AEN4965" 1989HREF="#AEN5000"
1980>email</A 1990>email</A
1981></DT 1991></DT
1982><DT 1992><DT
1983>B.11. <A 1993>B.11. <A
1984HREF="#AEN4983" 1994HREF="#AEN5018"
1985>land_collision</A 1995>land_collision</A
1986></DT 1996></DT
1987><DT 1997><DT
1988>B.12. <A 1998>B.12. <A
1989HREF="#AEN4992" 1999HREF="#AEN5027"
1990>land_collision_end</A 2000>land_collision_end</A
1991></DT 2001></DT
1992><DT 2002><DT
1993>B.13. <A 2003>B.13. <A
1994HREF="#AEN5001" 2004HREF="#AEN5036"
1995>land_collision_start</A 2005>land_collision_start</A
1996></DT 2006></DT
1997><DT 2007><DT
1998>B.14. <A 2008>B.14. <A
1999HREF="#AEN5010" 2009HREF="#AEN5045"
2000>link_message</A 2010>link_message</A
2001></DT 2011></DT
2002><DT 2012><DT
2003>B.15. <A 2013>B.15. <A
2004HREF="#AEN5026" 2014HREF="#AEN5061"
2005>listen</A 2015>listen</A
2006></DT 2016></DT
2007><DT 2017><DT
2008>B.16. <A 2018>B.16. <A
2009HREF="#AEN5045" 2019HREF="#AEN5080"
2010>money</A 2020>money</A
2011></DT 2021></DT
2012><DT 2022><DT
2013>B.17. <A 2023>B.17. <A
2014HREF="#AEN5058" 2024HREF="#AEN5093"
2015>moving_end</A 2025>moving_end</A
2016></DT 2026></DT
2017><DT 2027><DT
2018>B.18. <A 2028>B.18. <A
2019HREF="#AEN5066" 2029HREF="#AEN5101"
2020>moving_start</A 2030>moving_start</A
2021></DT 2031></DT
2022><DT 2032><DT
2023>B.19. <A 2033>B.19. <A
2024HREF="#AEN5074" 2034HREF="#AEN5109"
2025>no_sensor</A 2035>no_sensor</A
2026></DT 2036></DT
2027><DT 2037><DT
2028>B.20. <A 2038>B.20. <A
2029HREF="#AEN5083" 2039HREF="#AEN5118"
2030>not_at_rot_target</A 2040>not_at_rot_target</A
2031></DT 2041></DT
2032><DT 2042><DT
2033>B.21. <A 2043>B.21. <A
2034HREF="#AEN5092" 2044HREF="#AEN5127"
2035>not_at_target</A 2045>not_at_target</A
2036></DT 2046></DT
2037><DT 2047><DT
2038>B.22. <A 2048>B.22. <A
2039HREF="#AEN5101" 2049HREF="#AEN5136"
2040>object_rez</A 2050>object_rez</A
2041></DT 2051></DT
2042><DT 2052><DT
2043>B.23. <A 2053>B.23. <A
2044HREF="#AEN5112" 2054HREF="#AEN5147"
2045>on_rez</A 2055>on_rez</A
2046></DT 2056></DT
2047><DT 2057><DT
2048>B.24. <A 2058>B.24. <A
2049HREF="#AEN5124" 2059HREF="#AEN5159"
2050>run_time_permissions</A 2060>run_time_permissions</A
2051></DT 2061></DT
2052><DT 2062><DT
2053>B.25. <A 2063>B.25. <A
2054HREF="#AEN5136" 2064HREF="#AEN5171"
2055>sensor</A 2065>sensor</A
2056></DT 2066></DT
2057><DT 2067><DT
2058>B.26. <A 2068>B.26. <A
2059HREF="#AEN5148" 2069HREF="#AEN5183"
2060>state_entry</A 2070>state_entry</A
2061></DT 2071></DT
2062><DT 2072><DT
2063>B.27. <A 2073>B.27. <A
2064HREF="#AEN5156" 2074HREF="#AEN5191"
2065>state_exit</A 2075>state_exit</A
2066></DT 2076></DT
2067><DT 2077><DT
2068>B.28. <A 2078>B.28. <A
2069HREF="#AEN5164" 2079HREF="#AEN5199"
2070>timer</A 2080>timer</A
2071></DT 2081></DT
2072><DT 2082><DT
2073>B.29. <A 2083>B.29. <A
2074HREF="#AEN5173" 2084HREF="#AEN5208"
2075>touch</A 2085>touch</A
2076></DT 2086></DT
2077><DT 2087><DT
2078>B.30. <A 2088>B.30. <A
2079HREF="#AEN5184" 2089HREF="#AEN5219"
2080>touch_end</A 2090>touch_end</A
2081></DT 2091></DT
2082><DT 2092><DT
2083>B.31. <A 2093>B.31. <A
2084HREF="#AEN5195" 2094HREF="#AEN5230"
2085>touch_start</A 2095>touch_start</A
2086></DT 2096></DT
2087><DT 2097><DT
2088>B.32. <A 2098>B.32. <A
2089HREF="#AEN5206" 2099HREF="#AEN5241"
2090>remote_data</A 2100>remote_data</A
2091></DT 2101></DT
2092></DL 2102></DL
2093></DD 2103></DD
2094><DT 2104><DT
2095>C. <A 2105>C. <A
2096HREF="#AEN5245" 2106HREF="#AEN5280"
2097>Constants</A 2107>Constants</A
2098></DT 2108></DT
2099><DD 2109><DD
2100><DL 2110><DL
2101><DT 2111><DT
2102>C.1. <A 2112>C.1. <A
2103HREF="#AEN5248" 2113HREF="#AEN5283"
2104>Boolean Constants</A 2114>Boolean Constants</A
2105></DT 2115></DT
2106><DT 2116><DT
2107>C.2. <A 2117>C.2. <A
2108HREF="#AEN5257" 2118HREF="#AEN5292"
2109>Status Constants</A 2119>Status Constants</A
2110></DT 2120></DT
2111><DT 2121><DT
2112>C.3. <A 2122>C.3. <A
2113HREF="#AEN5291" 2123HREF="#AEN5326"
2114>Object Type Constants</A 2124>Object Type Constants</A
2115></DT 2125></DT
2116><DT 2126><DT
2117>C.4. <A 2127>C.4. <A
2118HREF="#AEN5313" 2128HREF="#AEN5348"
2119>Permission Constants</A 2129>Permission Constants</A
2120></DT 2130></DT
2121><DT 2131><DT
2122>C.5. <A 2132>C.5. <A
2123HREF="#AEN5364" 2133HREF="#AEN5399"
2124>Inventory Constants</A 2134>Inventory Constants</A
2125></DT 2135></DT
2126><DT 2136><DT
2127>C.6. <A 2137>C.6. <A
2128HREF="#AEN5387" 2138HREF="#AEN5422"
2129>Pay Price Constants</A 2139>Pay Price Constants</A
2130></DT 2140></DT
2131><DT 2141><DT
2132>C.7. <A 2142>C.7. <A
2133HREF="#AEN5401" 2143HREF="#AEN5436"
2134>Attachment Constants</A 2144>Attachment Constants</A
2135></DT 2145></DT
2136><DT 2146><DT
2137>C.8. <A 2147>C.8. <A
2138HREF="#AEN5527" 2148HREF="#AEN5562"
2139>Land Constants</A 2149>Land Constants</A
2140></DT 2150></DT
2141><DT 2151><DT
2142>C.9. <A 2152>C.9. <A
2143HREF="#AEN5569" 2153HREF="#AEN5604"
2144>Link Constants</A 2154>Link Constants</A
2145></DT 2155></DT
2146><DT 2156><DT
2147>C.10. <A 2157>C.10. <A
2148HREF="#AEN5596" 2158HREF="#AEN5631"
2149>Control Constants</A 2159>Control Constants</A
2150></DT 2160></DT
2151><DT 2161><DT
2152>C.11. <A 2162>C.11. <A
2153HREF="#AEN5643" 2163HREF="#AEN5678"
2154>Change Constants</A 2164>Change Constants</A
2155></DT 2165></DT
2156><DT 2166><DT
2157>C.12. <A 2167>C.12. <A
2158HREF="#AEN5686" 2168HREF="#AEN5721"
2159>Type Constants</A 2169>Type Constants</A
2160></DT 2170></DT
2161><DT 2171><DT
2162>C.13. <A 2172>C.13. <A
2163HREF="#AEN5720" 2173HREF="#AEN5755"
2164>Agent Info Constants</A 2174>Agent Info Constants</A
2165></DT 2175></DT
2166><DT 2176><DT
2167>C.14. <A 2177>C.14. <A
2168HREF="#AEN5770" 2178HREF="#AEN5805"
2169>Texture Animation 2179>Texture Animation
2170 Constants</A 2180 Constants</A
2171></DT 2181></DT
2172><DT 2182><DT
2173>C.15. <A 2183>C.15. <A
2174HREF="#AEN5804" 2184HREF="#AEN5839"
2175>Particle System Constants</A 2185>Particle System Constants</A
2176></DT 2186></DT
2177><DT 2187><DT
2178>C.16. <A 2188>C.16. <A
2179HREF="#AEN5958" 2189HREF="#AEN5993"
2180>Agent Data Constants</A 2190>Agent Data Constants</A
2181></DT 2191></DT
2182><DT 2192><DT
2183>C.17. <A 2193>C.17. <A
2184HREF="#AEN5994" 2194HREF="#AEN6029"
2185>Float Constants</A 2195>Float Constants</A
2186></DT 2196></DT
2187><DT 2197><DT
2188>C.18. <A 2198>C.18. <A
2189HREF="#AEN6023" 2199HREF="#AEN6058"
2190>Key Constant</A 2200>Key Constant</A
2191></DT 2201></DT
2192><DT 2202><DT
2193>C.19. <A 2203>C.19. <A
2194HREF="#AEN6026" 2204HREF="#AEN6061"
2195>Miscellaneous Integer Constants</A 2205>Miscellaneous Integer Constants</A
2196></DT 2206></DT
2197><DT 2207><DT
2198>C.20. <A 2208>C.20. <A
2199HREF="#AEN6029" 2209HREF="#AEN6064"
2200>Miscellaneous String 2210>Miscellaneous String
2201 Constants</A 2211 Constants</A
2202></DT 2212></DT
2203><DT 2213><DT
2204>C.21. <A 2214>C.21. <A
2205HREF="#AEN6033" 2215HREF="#AEN6068"
2206>Vector Constant</A 2216>Vector Constant</A
2207></DT 2217></DT
2208><DT 2218><DT
2209>C.22. <A 2219>C.22. <A
2210HREF="#AEN6036" 2220HREF="#AEN6071"
2211>Rotation Constant</A 2221>Rotation Constant</A
2212></DT 2222></DT
2213><DT 2223><DT
2214>C.23. <A 2224>C.23. <A
2215HREF="#AEN6039" 2225HREF="#AEN6074"
2216>Simulator Data Constants</A 2226>Simulator Data Constants</A
2217></DT 2227></DT
2218><DT 2228><DT
2219>C.24. <A 2229>C.24. <A
2220HREF="#AEN6065" 2230HREF="#AEN6100"
2221>Vehicle Parameters</A 2231>Vehicle Parameters</A
2222></DT 2232></DT
2223><DT 2233><DT
2224>C.25. <A 2234>C.25. <A
2225HREF="#AEN6184" 2235HREF="#AEN6219"
2226>Vehicle Flags</A 2236>Vehicle Flags</A
2227></DT 2237></DT
2228><DT 2238><DT
2229>C.26. <A 2239>C.26. <A
2230HREF="#AEN6241" 2240HREF="#AEN6276"
2231>Vehicle Types</A 2241>Vehicle Types</A
2232></DT 2242></DT
2233><DT 2243><DT
2234>C.27. <A 2244>C.27. <A
2235HREF="#AEN6276" 2245HREF="#AEN6311"
2236>Primitive Constants</A 2246>Primitive Constants</A
2237></DT 2247></DT
2238><DT 2248><DT
2239>C.28. <A 2249>C.28. <A
2240HREF="#AEN6358" 2250HREF="#AEN6393"
2241>XML-RPC Constants</A 2251>XML-RPC Constants</A
2242></DT 2252></DT
2243><DT 2253><DT
2244>C.29. <A 2254>C.29. <A
2245HREF="#AEN6361" 2255HREF="#AEN6396"
2246>Permission Mask Constants</A 2256>Permission Mask Constants</A
2247></DT 2257></DT
2248><DT 2258><DT
2249>C.30. <A 2259>C.30. <A
2250HREF="#AEN6408" 2260HREF="#AEN6443"
2251>Parcel Media Constants (Movies)</A 2261>Parcel Media Constants (Movies)</A
2252></DT 2262></DT
2253></DL 2263></DL
@@ -2591,12 +2601,12 @@ CLASS="programlisting"
2591></P 2601></P
2592><P 2602><P
2593>There are many <A 2603>There are many <A
2594HREF="#AEN4852" 2604HREF="#AEN4887"
2595>events</A 2605>events</A
2596> that can 2606> that can
2597 be detected in your scripts by declaring a handler. The 2607 be detected in your scripts by declaring a handler. The
2598 <A 2608 <A
2599HREF="#AEN5195" 2609HREF="#AEN5230"
2600> touch_start()</A 2610> touch_start()</A
2601> 2611>
2602 event is raised when a 2612 event is raised when a
@@ -3681,7 +3691,7 @@ CLASS="programlisting"
3681 non-zero integer. Once a conditional is determined to be true 3691 non-zero integer. Once a conditional is determined to be true
3682 (non-zero), no further processing of 'else' conditionals will be 3692 (non-zero), no further processing of 'else' conditionals will be
3683 considered. The <A 3693 considered. The <A
3684HREF="#AEN6023" 3694HREF="#AEN6058"
3685>NULL_KEY</A 3695>NULL_KEY</A
3686> constant 3696> constant
3687 is counted as FALSE by conditional expressions.</P 3697 is counted as FALSE by conditional expressions.</P
@@ -4037,7 +4047,7 @@ NAME="AEN431"
4037></H2 4047></H2
4038><P 4048><P
4039>The <A 4049>The <A
4040HREF="#AEN5148" 4050HREF="#AEN5183"
4041>state_entry</A 4051>state_entry</A
4042> 4052>
4043 event occurs whenever a new state is 4053 event occurs whenever a new state is
@@ -4107,7 +4117,7 @@ NAME="AEN440"
4107></H2 4117></H2
4108><P 4118><P
4109>You will want to provide a <A 4119>You will want to provide a <A
4110HREF="#AEN5156" 4120HREF="#AEN5191"
4111>&#13; state_exit()</A 4121>&#13; state_exit()</A
4112> if you need to clean 4122> if you need to clean
4113 up any events that you have requested in the current state, but do 4123 up any events that you have requested in the current state, but do
@@ -4180,7 +4190,7 @@ state ListenState
4180></P 4190></P
4181><P 4191><P
4182>The <A 4192>The <A
4183HREF="#AEN5156" 4193HREF="#AEN5191"
4184>state_exit()</A 4194>state_exit()</A
4185> 4195>
4186 handler is not called when an object is 4196 handler is not called when an object is
@@ -4318,21 +4328,21 @@ HREF="#AEN3615"
4318><TR 4328><TR
4319><TD 4329><TD
4320><A 4330><A
4321HREF="#AEN4255" 4331HREF="#AEN4290"
4322>llSin</A 4332>llSin</A
4323></TD 4333></TD
4324></TR 4334></TR
4325><TR 4335><TR
4326><TD 4336><TD
4327><A 4337><A
4328HREF="#AEN4288" 4338HREF="#AEN4323"
4329>llSqrt</A 4339>llSqrt</A
4330></TD 4340></TD
4331></TR 4341></TR
4332><TR 4342><TR
4333><TD 4343><TD
4334><A 4344><A
4335HREF="#AEN4631" 4345HREF="#AEN4666"
4336>llTan</A 4346>llTan</A
4337></TD 4347></TD
4338></TR 4348></TR
@@ -4361,21 +4371,21 @@ CLASS="CALSTABLE"
4361><TR 4371><TR
4362><TD 4372><TD
4363><A 4373><A
4364HREF="#AEN4763" 4374HREF="#AEN4798"
4365>llVecDist</A 4375>llVecDist</A
4366></TD 4376></TD
4367></TR 4377></TR
4368><TR 4378><TR
4369><TD 4379><TD
4370><A 4380><A
4371HREF="#AEN4776" 4381HREF="#AEN4811"
4372>llVecMag</A 4382>llVecMag</A
4373></TD 4383></TD
4374></TR 4384></TR
4375><TR 4385><TR
4376><TD 4386><TD
4377><A 4387><A
4378HREF="#AEN4786" 4388HREF="#AEN4821"
4379>llVecNorm</A 4389>llVecNorm</A
4380></TD 4390></TD
4381></TR 4391></TR
@@ -4555,42 +4565,42 @@ HREF="#AEN2902"
4555><TR 4565><TR
4556><TD 4566><TD
4557><A 4567><A
4558HREF="#AEN4584" 4568HREF="#AEN4619"
4559>llStringLength</A 4569>llStringLength</A
4560></TD 4570></TD
4561></TR 4571></TR
4562><TR 4572><TR
4563><TD 4573><TD
4564><A 4574><A
4565HREF="#AEN4594" 4575HREF="#AEN4629"
4566>llSubStringIndex</A 4576>llSubStringIndex</A
4567></TD 4577></TD
4568></TR 4578></TR
4569><TR 4579><TR
4570><TD 4580><TD
4571><A 4581><A
4572HREF="#AEN4605" 4582HREF="#AEN4640"
4573>llStringToBase64</A 4583>llStringToBase64</A
4574></TD 4584></TD
4575></TR 4585></TR
4576><TR 4586><TR
4577><TD 4587><TD
4578><A 4588><A
4579HREF="#AEN4690" 4589HREF="#AEN4725"
4580>llToLower</A 4590>llToLower</A
4581></TD 4591></TD
4582></TR 4592></TR
4583><TR 4593><TR
4584><TD 4594><TD
4585><A 4595><A
4586HREF="#AEN4699" 4596HREF="#AEN4734"
4587>llToUpper</A 4597>llToUpper</A
4588></TD 4598></TD
4589></TR 4599></TR
4590><TR 4600><TR
4591><TD 4601><TD
4592><A 4602><A
4593HREF="#AEN4839" 4603HREF="#AEN4874"
4594>llXorBase64Strings</A 4604>llXorBase64Strings</A
4595></TD 4605></TD
4596></TR 4606></TR
@@ -4829,14 +4839,14 @@ HREF="#AEN3637"
4829><TR 4839><TR
4830><TD 4840><TD
4831><A 4841><A
4832HREF="#AEN4241" 4842HREF="#AEN4276"
4833>llShout</A 4843>llShout</A
4834></TD 4844></TD
4835></TR 4845></TR
4836><TR 4846><TR
4837><TD 4847><TD
4838><A 4848><A
4839HREF="#AEN4815" 4849HREF="#AEN4850"
4840>llWhisper</A 4850>llWhisper</A
4841></TD 4851></TD
4842></TR 4852></TR
@@ -5110,22 +5120,22 @@ NAME="AEN790"
5110><P 5120><P
5111>Each scripted object can have one vehicle behavior that is 5121>Each scripted object can have one vehicle behavior that is
5112 configurable through the <A 5122 configurable through the <A
5113HREF="#AEN4202" 5123HREF="#AEN4237"
5114>llSetVehicleType</A 5124>llSetVehicleType</A
5115>, <A 5125>, <A
5116HREF="#AEN4188" 5126HREF="#AEN4223"
5117>llSetVehicleFloatParam</A 5127>llSetVehicleFloatParam</A
5118>, 5128>,
5119 <A 5129 <A
5120HREF="#AEN4227" 5130HREF="#AEN4262"
5121>llSetVehicleVectorParam</A 5131>llSetVehicleVectorParam</A
5122>, 5132>,
5123 <A 5133 <A
5124HREF="#AEN4213" 5134HREF="#AEN4248"
5125>llSetVehicleRotationParam</A 5135>llSetVehicleRotationParam</A
5126>, 5136>,
5127 <A 5137 <A
5128HREF="#AEN4177" 5138HREF="#AEN4212"
5129>llSetVehicleFlags</A 5139>llSetVehicleFlags</A
5130>, 5140>,
5131 and <A 5141 and <A
@@ -5173,7 +5183,7 @@ HREF="#AEN3770"
5173HREF="#AEN3829" 5183HREF="#AEN3829"
5174>llSetForce</A 5184>llSetForce</A
5175>, <A 5185>, <A
5176HREF="#AEN4153" 5186HREF="#AEN4188"
5177>llSetTorque</A 5187>llSetTorque</A
5178>, and <A 5188>, and <A
5179HREF="#AEN3860" 5189HREF="#AEN3860"
@@ -5192,7 +5202,7 @@ HREF="#AEN3556"
5192HREF="#AEN2980" 5202HREF="#AEN2980"
5193>llMoveToTarget</A 5203>llMoveToTarget</A
5194>, and <A 5204>, and <A
5195HREF="#AEN4654" 5205HREF="#AEN4689"
5196>llTargetOmega</A 5206>llTargetOmega</A
5197> at your own 5207> at your own
5198 risk.</P 5208 risk.</P
@@ -5310,12 +5320,12 @@ NAME="AEN826"
5310><P 5320><P
5311>Before any vehicle parameters can be set the vehicle 5321>Before any vehicle parameters can be set the vehicle
5312 behavior must first be enabled. It is enabled by calling <A 5322 behavior must first be enabled. It is enabled by calling <A
5313HREF="#AEN4202" 5323HREF="#AEN4237"
5314>llSetVehicleType</A 5324>llSetVehicleType</A
5315> with any 5325> with any
5316 VEHICLE_TYPE_*, except VEHICLE_TYPE_NONE which will disable the 5326 VEHICLE_TYPE_*, except VEHICLE_TYPE_NONE which will disable the
5317 vehicle. See the <A 5327 vehicle. See the <A
5318HREF="#AEN6241" 5328HREF="#AEN6276"
5319>vehicle type 5329>vehicle type
5320 constants</A 5330 constants</A
5321> section for currently available types. More types 5331> section for currently available types. More types
@@ -5436,7 +5446,7 @@ HREF="#AEN990"
5436 of linear and/or angular deflection or not. The speed of the 5446 of linear and/or angular deflection or not. The speed of the
5437 deflections are controlled by setting the relevant parameters 5447 deflections are controlled by setting the relevant parameters
5438 using the <A 5448 using the <A
5439HREF="#AEN4188" 5449HREF="#AEN4223"
5440>llSetVehicleFloatParam</A 5450>llSetVehicleFloatParam</A
5441> 5451>
5442 script call. Each variety of deflection has a 5452 script call. Each variety of deflection has a
@@ -5495,7 +5505,7 @@ HREF="#AEN1070"
5495 to make motion smoother and easier to control. 5505 to make motion smoother and easier to control.
5496 Their directions can be set using the 5506 Their directions can be set using the
5497 <A 5507 <A
5498HREF="#AEN4227" 5508HREF="#AEN4262"
5499>llSetVehicleVectorParam</A 5509>llSetVehicleVectorParam</A
5500> 5510>
5501 call. For example, to make the vehicle try to move at 5 5511 call. For example, to make the vehicle try to move at 5
@@ -6391,7 +6401,7 @@ HREF="#AEN2773"
6391>llLoopSound</A 6401>llLoopSound</A
6392>. This function 6402>. This function
6393 Has no effect on sounds started with <A 6403 Has no effect on sounds started with <A
6394HREF="#AEN4709" 6404HREF="#AEN4744"
6395>llTriggerSound</A 6405>llTriggerSound</A
6396>.</P 6406>.</P
6397></DIV 6407></DIV
@@ -6634,7 +6644,7 @@ CLASS="FUNCDEF"
6634CLASS="parameter" 6644CLASS="parameter"
6635>avatar</CODE 6645>avatar</CODE
6636> at point <A 6646> at point <A
6637HREF="#AEN5401" 6647HREF="#AEN5436"
6638><CODE 6648><CODE
6639CLASS="parameter" 6649CLASS="parameter"
6640>attachment</CODE 6650>attachment</CODE
@@ -6674,11 +6684,11 @@ CLASS="FUNCDEF"
6674><P 6684><P
6675>If an avatar is sitting on the sit target, return 6685>If an avatar is sitting on the sit target, return
6676 the avatar's key, <A 6686 the avatar's key, <A
6677HREF="#AEN6023" 6687HREF="#AEN6058"
6678>NULL_KEY</A 6688>NULL_KEY</A
6679> otherwise. 6689> otherwise.
6680 This only will detect avatars sitting on sit targets defined with <A 6690 This only will detect avatars sitting on sit targets defined with <A
6681HREF="#AEN4265" 6691HREF="#AEN4300"
6682>llSitTarget</A 6692>llSitTarget</A
6683>.</P 6693>.</P
6684></DIV 6694></DIV
@@ -7025,7 +7035,7 @@ CLASS="parameter"
7025>id</CODE 7035>id</CODE
7026>. Specify 7036>. Specify
7027 an empty string or <A 7037 an empty string or <A
7028HREF="#AEN6023" 7038HREF="#AEN6058"
7029>NULL_KEY</A 7039>NULL_KEY</A
7030> to 7040> to
7031 not filter on the corresponding parameter.</P 7041 not filter on the corresponding parameter.</P
@@ -7410,7 +7420,7 @@ CLASS="FUNCDEF"
7410CLASS="parameter" 7420CLASS="parameter"
7411>number</CODE 7421>number</CODE
7412>. Returns <A 7422>. Returns <A
7413HREF="#AEN6023" 7423HREF="#AEN6058"
7414>NULL_KEY</A 7424>NULL_KEY</A
7415> if number is not valid sensed 7425> if number is not valid sensed
7416 object.</P 7426 object.</P
@@ -8143,7 +8153,7 @@ CLASS="FUNCDEF"
8143CLASS="parameter" 8153CLASS="parameter"
8144>id</CODE 8154>id</CODE
8145>. Returns a bitfield of <A 8155>. Returns a bitfield of <A
8146HREF="#AEN5720" 8156HREF="#AEN5755"
8147>agent info constants</A 8157>agent info constants</A
8148>.</P 8158>.</P
8149></DIV 8159></DIV
@@ -8214,7 +8224,7 @@ CLASS="parameter"
8214>face</CODE 8224>face</CODE
8215> is 8225> is
8216 <A 8226 <A
8217HREF="#AEN6026" 8227HREF="#AEN6061"
8218>ALL_SIDES</A 8228>ALL_SIDES</A
8219> the value returned is 8229> the value returned is
8220 the mean average of all faces.</P 8230 the mean average of all faces.</P
@@ -8252,7 +8262,7 @@ CLASS="FUNCDEF"
8252HREF="#AEN3423" 8262HREF="#AEN3423"
8253>llResetTime</A 8263>llResetTime</A
8254>. Use <A 8264>. Use <A
8255HREF="#AEN4141" 8265HREF="#AEN4176"
8256>llSetTimerEvent</A 8266>llSetTimerEvent</A
8257> if you want a 8267> if you want a
8258 reliable timing mechanism.</P 8268 reliable timing mechanism.</P
@@ -8417,7 +8427,7 @@ CLASS="parameter"
8417CLASS="parameter" 8427CLASS="parameter"
8418>face</CODE 8428>face</CODE
8419> is <A 8429> is <A
8420HREF="#AEN6026" 8430HREF="#AEN6061"
8421>ALL_SIDES</A 8431>ALL_SIDES</A
8422> the color returned is the 8432> the color returned is the
8423 mean average of each channel.</P 8433 mean average of each channel.</P
@@ -8718,7 +8728,7 @@ CLASS="parameter"
8718>type</CODE 8728>type</CODE
8719>. Use 8729>. Use
8720 the <A 8730 the <A
8721HREF="#AEN5364" 8731HREF="#AEN5399"
8722>inventory constants</A 8732>inventory constants</A
8723> to 8733> to
8724 specify the <CODE 8734 specify the <CODE
@@ -8757,7 +8767,7 @@ CLASS="parameter"
8757>type</CODE 8767>type</CODE
8758> in 8768> in
8759 the object inventory. Use the <A 8769 the object inventory. Use the <A
8760HREF="#AEN5364" 8770HREF="#AEN5399"
8761>inventory constants</A 8771>inventory constants</A
8762> to specify 8772> to specify
8763 the <CODE 8773 the <CODE
@@ -8796,7 +8806,7 @@ CLASS="parameter"
8796>mask</CODE 8806>mask</CODE
8797> for the 8807> for the
8798 specified inventory item. See <A 8808 specified inventory item. See <A
8799HREF="#AEN6361" 8809HREF="#AEN6396"
8800>Permission Mask Constants</A 8810>Permission Mask Constants</A
8801> 8811>
8802 for more information. Example usage: 8812 for more information. Example usage:
@@ -8855,7 +8865,7 @@ CLASS="parameter"
8855CLASS="parameter" 8865CLASS="parameter"
8856>name</CODE 8866>name</CODE
8857> is found. Use the <A 8867> is found. Use the <A
8858HREF="#AEN5364" 8868HREF="#AEN5399"
8859>inventory constants</A 8869>inventory constants</A
8860> to compare 8870> to compare
8861 against the return value.</P 8871 against the return value.</P
@@ -8919,7 +8929,7 @@ CLASS="FUNCDEF"
8919CLASS="parameter" 8929CLASS="parameter"
8920>pos</CODE 8930>pos</CODE
8921> or <A 8931> or <A
8922HREF="#AEN6023" 8932HREF="#AEN6058"
8923>NULL_KEY</A 8933>NULL_KEY</A
8924> if public.</P 8934> if public.</P
8925></DIV 8935></DIV
@@ -9044,7 +9054,7 @@ CLASS="FUNCDEF"
9044></DIV 9054></DIV
9045><P 9055><P
9046>Returns the <A 9056>Returns the <A
9047HREF="#AEN5686" 9057HREF="#AEN5721"
9048>type</A 9058>type</A
9049> of the 9059> of the
9050 variable at <CODE 9060 variable at <CODE
@@ -9281,21 +9291,21 @@ CLASS="parameter"
9281CLASS="parameter" 9291CLASS="parameter"
9282>name</CODE 9292>name</CODE
9283> and returns the data through the <A 9293> and returns the data through the <A
9284HREF="#AEN4950" 9294HREF="#AEN4985"
9285>dataserver</A 9295>dataserver</A
9286> event. The line count 9296> event. The line count
9287 starts at zero. If the requested line is past the end of the 9297 starts at zero. If the requested line is past the end of the
9288 notecard the <A 9298 notecard the <A
9289HREF="#AEN4950" 9299HREF="#AEN4985"
9290>dataserver</A 9300>dataserver</A
9291> 9301>
9292 event will return the constant <A 9302 event will return the constant <A
9293HREF="#AEN6029" 9303HREF="#AEN6064"
9294>EOF</A 9304>EOF</A
9295> string. The key returned by 9305> string. The key returned by
9296 this function is a unique identifier which will be supplied to the 9306 this function is a unique identifier which will be supplied to the
9297 <A 9307 <A
9298HREF="#AEN4950" 9308HREF="#AEN4985"
9299>dataserver</A 9309>dataserver</A
9300> event in the 9310> event in the
9301 <CODE 9311 <CODE
@@ -9334,12 +9344,12 @@ CLASS="parameter"
9334>name</CODE 9344>name</CODE
9335> 9345>
9336 and returns this information through the <A 9346 and returns this information through the <A
9337HREF="#AEN4950" 9347HREF="#AEN4985"
9338>dataserver</A 9348>dataserver</A
9339> event. 9349> event.
9340 The key returned by this function is a unique identifier which will be supplied to the 9350 The key returned by this function is a unique identifier which will be supplied to the
9341 <A 9351 <A
9342HREF="#AEN4950" 9352HREF="#AEN4985"
9343>dataserver</A 9353>dataserver</A
9344> event in the <CODE 9354> event in the <CODE
9345CLASS="parameter" 9355CLASS="parameter"
@@ -9491,7 +9501,7 @@ CLASS="parameter"
9491>mask</CODE 9501>mask</CODE
9492> for the root object the 9502> for the root object the
9493 task is attached to. See <A 9503 task is attached to. See <A
9494HREF="#AEN6361" 9504HREF="#AEN6396"
9495>Permission Mask Constants</A 9505>Permission Mask Constants</A
9496> 9506>
9497 for more information. Example usage: 9507 for more information. Example usage:
@@ -9677,7 +9687,7 @@ CLASS="FUNCDEF"
9677></DIV 9687></DIV
9678><P 9688><P
9679>Returns avatar that has enabled permissions. Returns <A 9689>Returns avatar that has enabled permissions. Returns <A
9680HREF="#AEN6023" 9690HREF="#AEN6058"
9681>NULL_KEY</A 9691>NULL_KEY</A
9682> if not enabled.</P 9692> if not enabled.</P
9683></DIV 9693></DIV
@@ -9743,12 +9753,12 @@ CLASS="parameter"
9743CLASS="parameter" 9753CLASS="parameter"
9744>parameters</CODE 9754>parameters</CODE
9745> are identical to the rules of <A 9755> are identical to the rules of <A
9746HREF="#AEN3973" 9756HREF="#AEN4008"
9747>llSetPrimitiveParams</A 9757>llSetPrimitiveParams</A
9748>, and the returned list is ordered as such. Most requested parameters do not require a value to be associated, except for texture-related requests (PRIM_TEXTURE, PRIM_COLOR, and PRIM_BUMP_SHINY) which require a side number to be specified as well. 9758>, and the returned list is ordered as such. Most requested parameters do not require a value to be associated, except for texture-related requests (PRIM_TEXTURE, PRIM_COLOR, and PRIM_BUMP_SHINY) which require a side number to be specified as well.
9749 9759
9750 Valid parameters can be found in the <A 9760 Valid parameters can be found in the <A
9751HREF="#AEN6276" 9761HREF="#AEN6311"
9752>Primitive Constants</A 9762>Primitive Constants</A
9753>. 9763>.
9754 Here is a simple example: 9764 Here is a simple example:
@@ -10142,7 +10152,7 @@ CLASS="parameter"
10142>status</CODE 10152>status</CODE
10143>. The 10153>. The
10144 value will be one of the <A 10154 value will be one of the <A
10145HREF="#AEN5257" 10155HREF="#AEN5292"
10146>status 10156>status
10147 constants</A 10157 constants</A
10148>.</P 10158>.</P
@@ -10392,7 +10402,7 @@ HREF="#AEN1638"
10392HREF="#AEN3423" 10402HREF="#AEN3423"
10393>llResetTime</A 10403>llResetTime</A
10394>. Use <A 10404>. Use <A
10395HREF="#AEN4141" 10405HREF="#AEN4176"
10396>llSetTimerEvent</A 10406>llSetTimerEvent</A
10397> if you want a 10407> if you want a
10398 reliable timing mechanism.</P 10408 reliable timing mechanism.</P
@@ -10658,7 +10668,7 @@ CLASS="parameter"
10658>destination</CODE 10668>destination</CODE
10659>. This call will fail if 10669>. This call will fail if
10660 <A 10670 <A
10661HREF="#AEN5313" 10671HREF="#AEN5348"
10662>PERMISSION_DEBIT</A 10672>PERMISSION_DEBIT</A
10663> has not 10673> has not
10664 been set.</P 10674 been set.</P
@@ -11502,7 +11512,7 @@ CLASS="parameter"
11502CLASS="parameter" 11512CLASS="parameter"
11503>ascending</CODE 11513>ascending</CODE
11504> is <A 11514> is <A
11505HREF="#AEN5248" 11515HREF="#AEN5283"
11506>TRUE</A 11516>TRUE</A
11507>. Note that sort only works in 11517>. Note that sort only works in
11508 the head of each sort block is the same type.</P 11518 the head of each sort block is the same type.</P
@@ -11597,7 +11607,7 @@ CLASS="parameter"
11597>number</CODE 11607>number</CODE
11598> parameter to specify which 11608> parameter to specify which
11599 event you are controlling. Use <A 11609 event you are controlling. Use <A
11600HREF="#AEN5248" 11610HREF="#AEN5283"
11601>boolean</A 11611>boolean</A
11602> values to specify 11612> values to specify
11603 <CODE 11613 <CODE
@@ -11853,7 +11863,7 @@ HREF="#AEN3181"
11853>, this function plays 11863>, this function plays
11854 a sound attached to an object, but will continuously loop that 11864 a sound attached to an object, but will continuously loop that
11855 sound until <A 11865 sound until <A
11856HREF="#AEN4573" 11866HREF="#AEN4608"
11857>llStopSound</A 11867>llStopSound</A
11858> or 11868> or
11859 <A 11869 <A
@@ -11868,12 +11878,12 @@ CLASS="parameter"
11868>volume</CODE 11878>volume</CODE
11869> 11879>
11870 to 0 is not the same as calling <A 11880 to 0 is not the same as calling <A
11871HREF="#AEN4573" 11881HREF="#AEN4608"
11872>llStopSound</A 11882>llStopSound</A
11873>; a sound with 0 11883>; a sound with 0
11874 volume will continue to loop. To restart the sound from the 11884 volume will continue to loop. To restart the sound from the
11875 beginning, call <A 11885 beginning, call <A
11876HREF="#AEN4573" 11886HREF="#AEN4608"
11877>llStopSound</A 11887>llStopSound</A
11878> 11888>
11879 before calling llLoopSound again.</P 11889 before calling llLoopSound again.</P
@@ -12185,7 +12195,7 @@ CLASS="parameter"
12185HREF="#AEN1867" 12195HREF="#AEN1867"
12186>llGetLinkNumber</A 12196>llGetLinkNumber</A
12187> or a <A 12197> or a <A
12188HREF="#AEN5569" 12198HREF="#AEN5604"
12189>link constant</A 12199>link constant</A
12190>.</P 12200>.</P
12191></DIV 12201></DIV
@@ -12252,7 +12262,7 @@ CLASS="parameter"
12252>size</CODE 12262>size</CODE
12253> area. The parameters can be chosen 12263> area. The parameters can be chosen
12254 from the <A 12264 from the <A
12255HREF="#AEN5527" 12265HREF="#AEN5562"
12256>land constants</A 12266>land constants</A
12257>.</P 12267>.</P
12258></DIV 12268></DIV
@@ -12376,7 +12386,7 @@ CLASS="parameter"
12376>face</CODE 12386>face</CODE
12377> is 12387> is
12378 <A 12388 <A
12379HREF="#AEN6026" 12389HREF="#AEN6061"
12380>ALL_SIDES</A 12390>ALL_SIDES</A
12381> this 12391> this
12382 function sets the texture offsets for all faces.</P 12392 function sets the texture offsets for all faces.</P
@@ -12437,7 +12447,7 @@ CLASS="FUNCDEF"
12437></DIV 12447></DIV
12438><P 12448><P
12439>Returns <A 12449>Returns <A
12440HREF="#AEN5248" 12450HREF="#AEN5283"
12441>TRUE</A 12451>TRUE</A
12442> if 12452> if
12443 <CODE 12453 <CODE
@@ -12445,7 +12455,7 @@ CLASS="parameter"
12445>id</CODE 12455>id</CODE
12446> is over land owned by the object owner, 12456> is over land owned by the object owner,
12447 <A 12457 <A
12448HREF="#AEN5248" 12458HREF="#AEN5283"
12449>FALSE</A 12459>FALSE</A
12450> otherwise.</P 12460> otherwise.</P
12451></DIV 12461></DIV
@@ -12481,43 +12491,43 @@ CLASS="parameter"
12481>command</CODE 12491>command</CODE
12482> can be one of 12492> can be one of
12483 <A 12493 <A
12484HREF="#AEN6408" 12494HREF="#AEN6443"
12485>PARCEL_MEDIA_COMMAND_STOP</A 12495>PARCEL_MEDIA_COMMAND_STOP</A
12486>, 12496>,
12487 <A 12497 <A
12488HREF="#AEN6408" 12498HREF="#AEN6443"
12489>PARCEL_MEDIA_COMMAND_PAUSE</A 12499>PARCEL_MEDIA_COMMAND_PAUSE</A
12490>, 12500>,
12491 <A 12501 <A
12492HREF="#AEN6408" 12502HREF="#AEN6443"
12493>PARCEL_MEDIA_COMMAND_PLAY</A 12503>PARCEL_MEDIA_COMMAND_PLAY</A
12494>, 12504>,
12495 <A 12505 <A
12496HREF="#AEN6408" 12506HREF="#AEN6443"
12497>PARCEL_MEDIA_COMMAND_LOOP</A 12507>PARCEL_MEDIA_COMMAND_LOOP</A
12498>, 12508>,
12499 <A 12509 <A
12500HREF="#AEN6408" 12510HREF="#AEN6443"
12501>PARCEL_MEDIA_COMMAND_TEXTURE</A 12511>PARCEL_MEDIA_COMMAND_TEXTURE</A
12502>, 12512>,
12503 <A 12513 <A
12504HREF="#AEN6408" 12514HREF="#AEN6443"
12505>PARCEL_MEDIA_COMMAND_URL</A 12515>PARCEL_MEDIA_COMMAND_URL</A
12506>, 12516>,
12507 <A 12517 <A
12508HREF="#AEN6408" 12518HREF="#AEN6443"
12509>PARCEL_MEDIA_COMMAND_TIME</A 12519>PARCEL_MEDIA_COMMAND_TIME</A
12510>, 12520>,
12511 <A 12521 <A
12512HREF="#AEN6408" 12522HREF="#AEN6443"
12513>PARCEL_MEDIA_COMMAND_AGENT</A 12523>PARCEL_MEDIA_COMMAND_AGENT</A
12514>, 12524>,
12515 <A 12525 <A
12516HREF="#AEN6408" 12526HREF="#AEN6443"
12517>PARCEL_MEDIA_COMMAND_UNLOAD</A 12527>PARCEL_MEDIA_COMMAND_UNLOAD</A
12518>, or 12528>, or
12519 <A 12529 <A
12520HREF="#AEN6408" 12530HREF="#AEN6443"
12521>PARCEL_MEDIA_COMMAND_AUTO_ALIGN</A 12531>PARCEL_MEDIA_COMMAND_AUTO_ALIGN</A
12522>. 12532>.
12523 </P 12533 </P
@@ -12700,11 +12710,11 @@ CLASS="parameter"
12700>command</CODE 12710>command</CODE
12701> can be one of 12711> can be one of
12702 <A 12712 <A
12703HREF="#AEN6408" 12713HREF="#AEN6443"
12704>PARCEL_MEDIA_COMMAND_TEXTURE</A 12714>PARCEL_MEDIA_COMMAND_TEXTURE</A
12705> or 12715> or
12706 <A 12716 <A
12707HREF="#AEN6408" 12717HREF="#AEN6443"
12708>PARCEL_MEDIA_COMMAND_URL</A 12718>PARCEL_MEDIA_COMMAND_URL</A
12709>. 12719>.
12710 </P 12720 </P
@@ -12907,7 +12917,7 @@ CLASS="parameter"
12907> are specified as an ordered list 12917> are specified as an ordered list
12908 of parameter and value. Valid parameters and their expected values 12918 of parameter and value. Valid parameters and their expected values
12909 can be found in the <A 12919 can be found in the <A
12910HREF="#AEN5804" 12920HREF="#AEN5839"
12911>particle system 12921>particle system
12912 constants</A 12922 constants</A
12913>. Here is a simple example: 12923>. Here is a simple example:
@@ -12959,7 +12969,7 @@ CLASS="FUNCDEF"
12959CLASS="parameter" 12969CLASS="parameter"
12960>pass</CODE 12970>pass</CODE
12961> is <A 12971> is <A
12962HREF="#AEN5248" 12972HREF="#AEN5283"
12963>TRUE</A 12973>TRUE</A
12964>, land and object collisions 12974>, land and object collisions
12965 are passed from children on to parents.</P 12975 are passed from children on to parents.</P
@@ -12994,7 +13004,7 @@ CLASS="FUNCDEF"
12994CLASS="parameter" 13004CLASS="parameter"
12995>pass</CODE 13005>pass</CODE
12996> is <A 13006> is <A
12997HREF="#AEN5248" 13007HREF="#AEN5283"
12998>TRUE</A 13008>TRUE</A
12999>, touches are passed from 13009>, touches are passed from
13000 children on to parents.</P 13010 children on to parents.</P
@@ -13028,7 +13038,7 @@ CLASS="FUNCDEF"
13028>Plays a sound once. The sound will be attached to an object 13038>Plays a sound once. The sound will be attached to an object
13029 and follow object movement. Only one sound may be attached to an 13039 and follow object movement. Only one sound may be attached to an
13030 object at a time, and attaching a new sound or calling <A 13040 object at a time, and attaching a new sound or calling <A
13031HREF="#AEN4573" 13041HREF="#AEN4608"
13032>llStopSound</A 13042>llStopSound</A
13033> will stop the 13043> will stop the
13034 previously attached sound. A second call to llPlaySound with the 13044 previously attached sound. A second call to llPlaySound with the
@@ -13039,7 +13049,7 @@ CLASS="parameter"
13039 the new volume will be used, which allows control over the volume 13049 the new volume will be used, which allows control over the volume
13040 of already playing sounds. To restart the sound from the 13050 of already playing sounds. To restart the sound from the
13041 beginning, call <A 13051 beginning, call <A
13042HREF="#AEN4573" 13052HREF="#AEN4608"
13043>llStopSound</A 13053>llStopSound</A
13044> 13054>
13045 before calling llPlaySound again.</P 13055 before calling llPlaySound again.</P
@@ -13454,7 +13464,7 @@ CLASS="parameter"
13454>flags</CODE 13464>flags</CODE
13455> to 13465> to
13456 FALSE. Valid parameters can be found in the <A 13466 FALSE. Valid parameters can be found in the <A
13457HREF="#AEN6184" 13467HREF="#AEN6219"
13458>vehicle flags constants</A 13468>vehicle flags constants</A
13459> 13469>
13460 section.</P 13470 section.</P
@@ -13491,7 +13501,7 @@ CLASS="parameter"
13491>id</CODE 13501>id</CODE
13492>. If and when the information is 13502>. If and when the information is
13493 collected, the <A 13503 collected, the <A
13494HREF="#AEN4950" 13504HREF="#AEN4985"
13495>dataserver</A 13505>dataserver</A
13496> 13506>
13497 event is called with the returned key returned from this function 13507 event is called with the returned key returned from this function
@@ -13500,7 +13510,7 @@ CLASS="parameter"
13500>requested</CODE 13510>requested</CODE
13501> parameter. See the 13511> parameter. See the
13502 <A 13512 <A
13503HREF="#AEN5958" 13513HREF="#AEN5993"
13504>agent data constants</A 13514>agent data constants</A
13505> for 13515> for
13506 details about valid values of <CODE 13516 details about valid values of <CODE
@@ -13508,7 +13518,7 @@ CLASS="parameter"
13508>data</CODE 13518>data</CODE
13509> and what 13519> and what
13510 each will return in the <A 13520 each will return in the <A
13511HREF="#AEN4950" 13521HREF="#AEN4985"
13512>dataserver</A 13522>dataserver</A
13513> event.</P 13523> event.</P
13514></DIV 13524></DIV
@@ -13543,7 +13553,7 @@ CLASS="FUNCDEF"
13543CLASS="parameter" 13553CLASS="parameter"
13544>name</CODE 13554>name</CODE
13545>. When data is available the <A 13555>. When data is available the <A
13546HREF="#AEN4950" 13556HREF="#AEN4985"
13547>dataserver</A 13557>dataserver</A
13548> event will be raised 13558> event will be raised
13549 with the key returned from this function in the 13559 with the key returned from this function in the
@@ -13597,7 +13607,7 @@ CLASS="parameter"
13597>perm</CODE 13607>perm</CODE
13598> 13608>
13599 parameter should be a <A 13609 parameter should be a <A
13600HREF="#AEN5313" 13610HREF="#AEN5348"
13601>permission 13611>permission
13602 constant</A 13612 constant</A
13603>. Multiple permissions can be requested 13613>. Multiple permissions can be requested
@@ -13605,7 +13615,7 @@ HREF="#AEN5313"
13605 permissions requests can only go to object owner. This call will 13615 permissions requests can only go to object owner. This call will
13606 not stop script execution - if the specified avatar grants the 13616 not stop script execution - if the specified avatar grants the
13607 requested permissions, the <A 13617 requested permissions, the <A
13608HREF="#AEN5124" 13618HREF="#AEN5159"
13609>run_time_permissions</A 13619>run_time_permissions</A
13610> 13620>
13611 event will be called.</P 13621 event will be called.</P
@@ -13642,7 +13652,7 @@ CLASS="parameter"
13642>sim_name</CODE 13652>sim_name</CODE
13643>. When the information is 13653>. When the information is
13644 collected, the <A 13654 collected, the <A
13645HREF="#AEN4950" 13655HREF="#AEN4985"
13646>dataserver</A 13656>dataserver</A
13647> 13657>
13648 event is called with the returned key returned from this function 13658 event is called with the returned key returned from this function
@@ -13651,7 +13661,7 @@ CLASS="parameter"
13651>requested</CODE 13661>requested</CODE
13652> parameter. See the 13662> parameter. See the
13653 <A 13663 <A
13654HREF="#AEN6039" 13664HREF="#AEN6074"
13655>simulator data constants</A 13665>simulator data constants</A
13656> for 13666> for
13657 details about valid values of <CODE 13667 details about valid values of <CODE
@@ -13659,7 +13669,7 @@ CLASS="parameter"
13659>data</CODE 13669>data</CODE
13660> and what 13670> and what
13661 each will return in the <A 13671 each will return in the <A
13662HREF="#AEN4950" 13672HREF="#AEN4985"
13663>dataserver</A 13673>dataserver</A
13664> event.</P 13674> event.</P
13665></DIV 13675></DIV
@@ -13806,7 +13816,7 @@ CLASS="parameter"
13806>param</CODE 13816>param</CODE
13807> value 13817> value
13808 will be available to the newly created object in the <A 13818 will be available to the newly created object in the <A
13809HREF="#AEN5112" 13819HREF="#AEN5147"
13810>on_rez</A 13820>on_rez</A
13811> event or through the <A 13821> event or through the <A
13812HREF="#AEN2164" 13822HREF="#AEN2164"
@@ -13864,7 +13874,7 @@ CLASS="parameter"
13864>param</CODE 13874>param</CODE
13865> value 13875> value
13866 will be available to the newly created object in the <A 13876 will be available to the newly created object in the <A
13867HREF="#AEN5112" 13877HREF="#AEN5147"
13868>on_rez</A 13878>on_rez</A
13869> event or through the <A 13879> event or through the <A
13870HREF="#AEN2164" 13880HREF="#AEN2164"
@@ -14266,7 +14276,7 @@ CLASS="parameter"
14266>face</CODE 14276>face</CODE
14267> 14277>
14268 <A 14278 <A
14269HREF="#AEN6026" 14279HREF="#AEN6061"
14270>ALL_SIDES</A 14280>ALL_SIDES</A
14271>, rotate the 14281>, rotate the
14272 texture of all faces.</P 14282 texture of all faces.</P
@@ -14330,7 +14340,7 @@ CLASS="FUNCDEF"
14330></DIV 14340></DIV
14331><P 14341><P
14332>Returns <A 14342>Returns <A
14333HREF="#AEN5248" 14343HREF="#AEN5283"
14334>TRUE</A 14344>TRUE</A
14335> if the 14345> if the
14336 object or agent <CODE 14346 object or agent <CODE
@@ -14339,7 +14349,7 @@ CLASS="parameter"
14339> is in the same simulator 14349> is in the same simulator
14340 and has the same active group as this object. Otherwise, returns 14350 and has the same active group as this object. Otherwise, returns
14341 <A 14351 <A
14342HREF="#AEN5248" 14352HREF="#AEN5283"
14343>FALSE</A 14353>FALSE</A
14344>.</P 14354>.</P
14345></DIV 14355></DIV
@@ -14422,7 +14432,7 @@ CLASS="parameter"
14422CLASS="parameter" 14432CLASS="parameter"
14423>scale_t</CODE 14433>scale_t</CODE
14424> respectively. If face is <A 14434> respectively. If face is <A
14425HREF="#AEN6026" 14435HREF="#AEN6061"
14426>ALL_SIDES</A 14436>ALL_SIDES</A
14427>, scale the texture 14437>, scale the texture
14428 to all faces.</P 14438 to all faces.</P
@@ -14532,7 +14542,7 @@ CLASS="parameter"
14532>arc</CODE 14542>arc</CODE
14533> 14543>
14534 radians of forward vector. Specifying a blank name or <A 14544 radians of forward vector. Specifying a blank name or <A
14535HREF="#AEN6023" 14545HREF="#AEN6058"
14536>NULL_KEY</A 14546>NULL_KEY</A
14537> id will not filter results for 14547> id will not filter results for
14538 any particular name or id. A range of 0.0 does not perform a 14548 any particular name or id. A range of 0.0 does not perform a
@@ -14540,16 +14550,16 @@ HREF="#AEN6023"
14540CLASS="parameter" 14550CLASS="parameter"
14541>type</CODE 14551>type</CODE
14542> parameter should be an <A 14552> parameter should be an <A
14543HREF="#AEN5291" 14553HREF="#AEN5326"
14544>object type constant</A 14554>object type constant</A
14545> value. If anything is found 14555> value. If anything is found
14546 during the scan, a <A 14556 during the scan, a <A
14547HREF="#AEN5136" 14557HREF="#AEN5171"
14548>sensor</A 14558>sensor</A
14549> event is triggered. A maximum 14559> event is triggered. A maximum
14550 of 16 items are passed to this event. If nothing is found during the scan, a 14560 of 16 items are passed to this event. If nothing is found during the scan, a
14551 <A 14561 <A
14552HREF="#AEN5074" 14562HREF="#AEN5109"
14553>no sensor</A 14563>no sensor</A
14554> event is triggered instead.</P 14564> event is triggered instead.</P
14555></DIV 14565></DIV
@@ -14631,7 +14641,7 @@ CLASS="parameter"
14631>rate</CODE 14641>rate</CODE
14632> seconds. Specifying a blank name or 14642> seconds. Specifying a blank name or
14633 <A 14643 <A
14634HREF="#AEN6023" 14644HREF="#AEN6058"
14635>NULL_KEY</A 14645>NULL_KEY</A
14636> id will not filter 14646> id will not filter
14637 results for any particular name or id. A range of 0.0 cancels the 14647 results for any particular name or id. A range of 0.0 cancels the
@@ -14639,16 +14649,16 @@ HREF="#AEN6023"
14639CLASS="parameter" 14649CLASS="parameter"
14640>type</CODE 14650>type</CODE
14641> parameter should be an <A 14651> parameter should be an <A
14642HREF="#AEN5291" 14652HREF="#AEN5326"
14643>object type constant</A 14653>object type constant</A
14644> 14654>
14645 value. If anything is found during the scan, a <A 14655 value. If anything is found during the scan, a <A
14646HREF="#AEN5136" 14656HREF="#AEN5171"
14647>sensor</A 14657>sensor</A
14648> 14658>
14649 event is triggered. A maximum of 16 items are passed to this event. If nothing is found 14659 event is triggered. A maximum of 16 items are passed to this event. If nothing is found
14650 during the scan, a <A 14660 during the scan, a <A
14651HREF="#AEN5074" 14661HREF="#AEN5109"
14652>no sensor</A 14662>no sensor</A
14653> event is triggered instead.</P 14663> event is triggered instead.</P
14654></DIV 14664></DIV
@@ -14683,7 +14693,7 @@ CLASS="parameter"
14683>face</CODE 14693>face</CODE
14684>. If 14694>. If
14685 face is <A 14695 face is <A
14686HREF="#AEN6026" 14696HREF="#AEN6061"
14687>ALL_SIDES</A 14697>ALL_SIDES</A
14688>, set 14698>, set
14689 the alpha to all faces. The <CODE 14699 the alpha to all faces. The <CODE
@@ -14848,7 +14858,7 @@ CLASS="parameter"
14848CLASS="parameter" 14858CLASS="parameter"
14849>face</CODE 14859>face</CODE
14850>. If face is <A 14860>. If face is <A
14851HREF="#AEN6026" 14861HREF="#AEN6061"
14852>ALL_SIDES</A 14862>ALL_SIDES</A
14853>, set the alpha to 14863>, set the alpha to
14854 all faces.</P 14864 all faces.</P
@@ -14915,11 +14925,11 @@ CLASS="parameter"
14915>force</CODE 14925>force</CODE
14916>. The vector is in local coordinates if 14926>. The vector is in local coordinates if
14917 local is <A 14927 local is <A
14918HREF="#AEN5248" 14928HREF="#AEN5283"
14919>TRUE</A 14929>TRUE</A
14920>, global if 14930>, global if
14921 <A 14931 <A
14922HREF="#AEN5248" 14932HREF="#AEN5283"
14923>FALSE</A 14933>FALSE</A
14924>.</P 14934>.</P
14925></DIV 14935></DIV
@@ -14959,11 +14969,11 @@ CLASS="parameter"
14959>torque</CODE 14969>torque</CODE
14960>. The vectors are in local coordinates 14970>. The vectors are in local coordinates
14961 if local is <A 14971 if local is <A
14962HREF="#AEN5248" 14972HREF="#AEN5283"
14963>TRUE</A 14973>TRUE</A
14964>, global if 14974>, global if
14965 <A 14975 <A
14966HREF="#AEN5248" 14976HREF="#AEN5283"
14967>FALSE</A 14977>FALSE</A
14968>.</P 14978>.</P
14969></DIV 14979></DIV
@@ -14998,7 +15008,7 @@ CLASS="FUNCDEF"
14998CLASS="parameter" 15008CLASS="parameter"
14999>water</CODE 15009>water</CODE
15000> is <A 15010> is <A
15001HREF="#AEN5248" 15011HREF="#AEN5283"
15002>TRUE</A 15012>TRUE</A
15003>.</P 15013>.</P
15004></DIV 15014></DIV
@@ -15031,25 +15041,24 @@ CLASS="FUNCDEF"
15031>Sets the <CODE 15041>Sets the <CODE
15032CLASS="parameter" 15042CLASS="parameter"
15033>alpha</CODE 15043>alpha</CODE
15034> of the linked child 15044> of a prim in the link set.
15035 specified by <CODE 15045 The <CODE
15036CLASS="parameter"
15037>linknumber</CODE
15038>. A value of 0 means
15039 no link, 1 the root, 2 for first child, etc. If
15040 <CODE
15041CLASS="parameter" 15046CLASS="parameter"
15042>linknumber</CODE 15047>linknum</CODE
15043> is <A 15048>
15044HREF="#AEN6026" 15049 parameter is either the linked number available through <A
15045>ALL_SIDES</A 15050HREF="#AEN1867"
15046>, set the alpha of 15051>llGetLinkNumber</A
15047 all objects in the linked set. If <CODE 15052> or a <A
15053HREF="#AEN5604"
15054>link constant</A
15055>.
15056 If <CODE
15048CLASS="parameter" 15057CLASS="parameter"
15049>face</CODE 15058>face</CODE
15050> is 15059> is
15051 <A 15060 <A
15052HREF="#AEN6026" 15061HREF="#AEN6061"
15053>ALL_SIDES</A 15062>ALL_SIDES</A
15054>, set the alpha 15063>, set the alpha
15055 of all faces.</P 15064 of all faces.</P
@@ -15083,25 +15092,24 @@ CLASS="FUNCDEF"
15083>Sets the <CODE 15092>Sets the <CODE
15084CLASS="parameter" 15093CLASS="parameter"
15085>color</CODE 15094>color</CODE
15086> of the linked child 15095> of a prim in the link set.
15087 specified by <CODE 15096 The <CODE
15088CLASS="parameter"
15089>linknumber</CODE
15090>. A value of 0 means
15091 no link, 1 the root, 2 for first child, etc. If
15092 <CODE
15093CLASS="parameter" 15097CLASS="parameter"
15094>linknumber</CODE 15098>linknum</CODE
15095> is <A 15099>
15096HREF="#AEN6026" 15100 parameter is either the linked number available through <A
15097>ALL_SIDES</A 15101HREF="#AEN1867"
15098>, set the color of 15102>llGetLinkNumber</A
15099 all objects in the linked set. If <CODE 15103> or a <A
15104HREF="#AEN5604"
15105>link constant</A
15106>.
15107 If <CODE
15100CLASS="parameter" 15108CLASS="parameter"
15101>face</CODE 15109>face</CODE
15102> is 15110> is
15103 <A 15111 <A
15104HREF="#AEN6026" 15112HREF="#AEN6061"
15105>ALL_SIDES</A 15113>ALL_SIDES</A
15106>, set the color 15114>, set the color
15107 of all faces.</P 15115 of all faces.</P
@@ -15112,7 +15120,7 @@ CLASS="section"
15112CLASS="section" 15120CLASS="section"
15113><A 15121><A
15114NAME="AEN3913" 15122NAME="AEN3913"
15115>A.234. llSetLocalRot</A 15123>A.234. llSetLinkPrimitiveParams</A
15116></H2 15124></H2
15117><DIV 15125><DIV
15118CLASS="funcsynopsis" 15126CLASS="funcsynopsis"
@@ -15125,6 +15133,105 @@ NAME="AEN3915"
15125><CODE 15133><CODE
15126><CODE 15134><CODE
15127CLASS="FUNCDEF" 15135CLASS="FUNCDEF"
15136>llSetLinkPrimitiveParams</CODE
15137>(integer linknumber, list rules);</CODE
15138></P
15139><P
15140></P
15141></DIV
15142><P
15143>Sets the primitive parameters of a prim in the link set.
15144 The <CODE
15145CLASS="parameter"
15146>linknum</CODE
15147>
15148 parameter is either the linked number available through <A
15149HREF="#AEN1867"
15150>llGetLinkNumber</A
15151> or a <A
15152HREF="#AEN5604"
15153>link constant</A
15154>.
15155 The <CODE
15156CLASS="parameter"
15157>rules</CODE
15158>
15159 list is identical to that of
15160 <A
15161HREF="#AEN4008"
15162>llSetPrimitiveParams</A
15163>.</P
15164></DIV
15165><DIV
15166CLASS="section"
15167><HR><H2
15168CLASS="section"
15169><A
15170NAME="AEN3929"
15171>A.235. llSetLinkTexture</A
15172></H2
15173><DIV
15174CLASS="funcsynopsis"
15175><P
15176></P
15177><A
15178NAME="AEN3931"
15179></A
15180><P
15181><CODE
15182><CODE
15183CLASS="FUNCDEF"
15184>llSetLinkTexture</CODE
15185>(integer linknumber, string texture, integer face);</CODE
15186></P
15187><P
15188></P
15189></DIV
15190><P
15191>Sets the <CODE
15192CLASS="parameter"
15193>texture</CODE
15194> of a prim in the link set.
15195 The <CODE
15196CLASS="parameter"
15197>linknum</CODE
15198>
15199 parameter is either the linked number available through <A
15200HREF="#AEN1867"
15201>llGetLinkNumber</A
15202> or a <A
15203HREF="#AEN5604"
15204>link constant</A
15205>.
15206 If <CODE
15207CLASS="parameter"
15208>face</CODE
15209> is
15210 <A
15211HREF="#AEN6061"
15212>ALL_SIDES</A
15213>, set the texture
15214 of all faces.</P
15215></DIV
15216><DIV
15217CLASS="section"
15218><HR><H2
15219CLASS="section"
15220><A
15221NAME="AEN3948"
15222>A.236. llSetLocalRot</A
15223></H2
15224><DIV
15225CLASS="funcsynopsis"
15226><P
15227></P
15228><A
15229NAME="AEN3950"
15230></A
15231><P
15232><CODE
15233><CODE
15234CLASS="FUNCDEF"
15128>llSetLocalRot</CODE 15235>llSetLocalRot</CODE
15129>(rotation rot);</CODE 15236>(rotation rot);</CODE
15130></P 15237></P
@@ -15141,15 +15248,15 @@ CLASS="section"
15141><HR><H2 15248><HR><H2
15142CLASS="section" 15249CLASS="section"
15143><A 15250><A
15144NAME="AEN3922" 15251NAME="AEN3957"
15145>A.235. llSetObjectDesc</A 15252>A.237. llSetObjectDesc</A
15146></H2 15253></H2
15147><DIV 15254><DIV
15148CLASS="funcsynopsis" 15255CLASS="funcsynopsis"
15149><P 15256><P
15150></P 15257></P
15151><A 15258><A
15152NAME="AEN3924" 15259NAME="AEN3959"
15153></A 15260></A
15154><P 15261><P
15155><CODE 15262><CODE
@@ -15172,15 +15279,15 @@ CLASS="section"
15172><HR><H2 15279><HR><H2
15173CLASS="section" 15280CLASS="section"
15174><A 15281><A
15175NAME="AEN3932" 15282NAME="AEN3967"
15176>A.236. llSetObjectName</A 15283>A.238. llSetObjectName</A
15177></H2 15284></H2
15178><DIV 15285><DIV
15179CLASS="funcsynopsis" 15286CLASS="funcsynopsis"
15180><P 15287><P
15181></P 15288></P
15182><A 15289><A
15183NAME="AEN3934" 15290NAME="AEN3969"
15184></A 15291></A
15185><P 15292><P
15186><CODE 15293><CODE
@@ -15203,15 +15310,15 @@ CLASS="section"
15203><HR><H2 15310><HR><H2
15204CLASS="section" 15311CLASS="section"
15205><A 15312><A
15206NAME="AEN3942" 15313NAME="AEN3977"
15207>A.237. llSetParcelMusicURL</A 15314>A.239. llSetParcelMusicURL</A
15208></H2 15315></H2
15209><DIV 15316><DIV
15210CLASS="funcsynopsis" 15317CLASS="funcsynopsis"
15211><P 15318><P
15212></P 15319></P
15213><A 15320><A
15214NAME="AEN3944" 15321NAME="AEN3979"
15215></A 15322></A
15216><P 15323><P
15217><CODE 15324><CODE
@@ -15236,15 +15343,15 @@ CLASS="section"
15236><HR><H2 15343><HR><H2
15237CLASS="section" 15344CLASS="section"
15238><A 15345><A
15239NAME="AEN3952" 15346NAME="AEN3987"
15240>A.238. llSetPayPrice</A 15347>A.240. llSetPayPrice</A
15241></H2 15348></H2
15242><DIV 15349><DIV
15243CLASS="funcsynopsis" 15350CLASS="funcsynopsis"
15244><P 15351><P
15245></P 15352></P
15246><A 15353><A
15247NAME="AEN3954" 15354NAME="AEN3989"
15248></A 15355></A
15249><P 15356><P
15250><CODE 15357><CODE
@@ -15260,7 +15367,7 @@ CLASS="FUNCDEF"
15260>Sets the default pay price and optionally the quick pay buttons 15367>Sets the default pay price and optionally the quick pay buttons
15261 for the 'Pay' window when someone pays this object. 15368 for the 'Pay' window when someone pays this object.
15262 See also <A 15369 See also <A
15263HREF="#AEN5387" 15370HREF="#AEN5422"
15264>Pay Button Constants</A 15371>Pay Button Constants</A
15265>. </P 15372>. </P
15266></DIV 15373></DIV
@@ -15269,15 +15376,15 @@ CLASS="section"
15269><HR><H2 15376><HR><H2
15270CLASS="section" 15377CLASS="section"
15271><A 15378><A
15272NAME="AEN3964" 15379NAME="AEN3999"
15273>A.239. llSetPos</A 15380>A.241. llSetPos</A
15274></H2 15381></H2
15275><DIV 15382><DIV
15276CLASS="funcsynopsis" 15383CLASS="funcsynopsis"
15277><P 15384><P
15278></P 15385></P
15279><A 15386><A
15280NAME="AEN3966" 15387NAME="AEN4001"
15281></A 15388></A
15282><P 15389><P
15283><CODE 15390><CODE
@@ -15300,15 +15407,15 @@ CLASS="section"
15300><HR><H2 15407><HR><H2
15301CLASS="section" 15408CLASS="section"
15302><A 15409><A
15303NAME="AEN3973" 15410NAME="AEN4008"
15304>A.240. llSetPrimitiveParams</A 15411>A.242. llSetPrimitiveParams</A
15305></H2 15412></H2
15306><DIV 15413><DIV
15307CLASS="funcsynopsis" 15414CLASS="funcsynopsis"
15308><P 15415><P
15309></P 15416></P
15310><A 15417><A
15311NAME="AEN3975" 15418NAME="AEN4010"
15312></A 15419></A
15313><P 15420><P
15314><CODE 15421><CODE
@@ -15331,7 +15438,7 @@ CLASS="parameter"
15331> are specified as an ordered list 15438> are specified as an ordered list
15332 of parameter and value(s). Valid parameters and their expected values 15439 of parameter and value(s). Valid parameters and their expected values
15333 can be found in the <A 15440 can be found in the <A
15334HREF="#AEN6276" 15441HREF="#AEN6311"
15335>Primitive Constants</A 15442>Primitive Constants</A
15336>. 15443>.
15337 Here is a simple example: 15444 Here is a simple example:
@@ -15340,7 +15447,7 @@ CLASS="informalexample"
15340><P 15447><P
15341></P 15448></P
15342><A 15449><A
15343NAME="AEN3985" 15450NAME="AEN4020"
15344></A 15451></A
15345><PRE 15452><PRE
15346CLASS="programlisting" 15453CLASS="programlisting"
@@ -15357,15 +15464,15 @@ CLASS="section"
15357><HR><H2 15464><HR><H2
15358CLASS="section" 15465CLASS="section"
15359><A 15466><A
15360NAME="AEN3987" 15467NAME="AEN4022"
15361>A.241. llSetRemoteScriptAccessPin</A 15468>A.243. llSetRemoteScriptAccessPin</A
15362></H2 15469></H2
15363><DIV 15470><DIV
15364CLASS="funcsynopsis" 15471CLASS="funcsynopsis"
15365><P 15472><P
15366></P 15473></P
15367><A 15474><A
15368NAME="AEN3989" 15475NAME="AEN4024"
15369></A 15476></A
15370><P 15477><P
15371><CODE 15478><CODE
@@ -15387,15 +15494,15 @@ CLASS="section"
15387><HR><H2 15494><HR><H2
15388CLASS="section" 15495CLASS="section"
15389><A 15496><A
15390NAME="AEN3996" 15497NAME="AEN4031"
15391>A.242. llSetRot</A 15498>A.244. llSetRot</A
15392></H2 15499></H2
15393><DIV 15500><DIV
15394CLASS="funcsynopsis" 15501CLASS="funcsynopsis"
15395><P 15502><P
15396></P 15503></P
15397><A 15504><A
15398NAME="AEN3998" 15505NAME="AEN4033"
15399></A 15506></A
15400><P 15507><P
15401><CODE 15508><CODE
@@ -15417,15 +15524,15 @@ CLASS="section"
15417><HR><H2 15524><HR><H2
15418CLASS="section" 15525CLASS="section"
15419><A 15526><A
15420NAME="AEN4005" 15527NAME="AEN4040"
15421>A.243. llSetScale</A 15528>A.245. llSetScale</A
15422></H2 15529></H2
15423><DIV 15530><DIV
15424CLASS="funcsynopsis" 15531CLASS="funcsynopsis"
15425><P 15532><P
15426></P 15533></P
15427><A 15534><A
15428NAME="AEN4007" 15535NAME="AEN4042"
15429></A 15536></A
15430><P 15537><P
15431><CODE 15538><CODE
@@ -15445,15 +15552,15 @@ CLASS="section"
15445><HR><H2 15552><HR><H2
15446CLASS="section" 15553CLASS="section"
15447><A 15554><A
15448NAME="AEN4014" 15555NAME="AEN4049"
15449>A.244. llSetScriptState</A 15556>A.246. llSetScriptState</A
15450></H2 15557></H2
15451><DIV 15558><DIV
15452CLASS="funcsynopsis" 15559CLASS="funcsynopsis"
15453><P 15560><P
15454></P 15561></P
15455><A 15562><A
15456NAME="AEN4016" 15563NAME="AEN4051"
15457></A 15564></A
15458><P 15565><P
15459><CODE 15566><CODE
@@ -15473,15 +15580,15 @@ CLASS="section"
15473><HR><H2 15580><HR><H2
15474CLASS="section" 15581CLASS="section"
15475><A 15582><A
15476NAME="AEN4025" 15583NAME="AEN4060"
15477>A.245. llSetSitText</A 15584>A.247. llSetSitText</A
15478></H2 15585></H2
15479><DIV 15586><DIV
15480CLASS="funcsynopsis" 15587CLASS="funcsynopsis"
15481><P 15588><P
15482></P 15589></P
15483><A 15590><A
15484NAME="AEN4027" 15591NAME="AEN4062"
15485></A 15592></A
15486><P 15593><P
15487><CODE 15594><CODE
@@ -15505,15 +15612,15 @@ CLASS="section"
15505><HR><H2 15612><HR><H2
15506CLASS="section" 15613CLASS="section"
15507><A 15614><A
15508NAME="AEN4035" 15615NAME="AEN4070"
15509>A.246. llSetSoundQueueing</A 15616>A.248. llSetSoundQueueing</A
15510></H2 15617></H2
15511><DIV 15618><DIV
15512CLASS="funcsynopsis" 15619CLASS="funcsynopsis"
15513><P 15620><P
15514></P 15621></P
15515><A 15622><A
15516NAME="AEN4037" 15623NAME="AEN4072"
15517></A 15624></A
15518><P 15625><P
15519><CODE 15626><CODE
@@ -15535,11 +15642,11 @@ HREF="#AEN2773"
15535>, etc., (attached 15642>, etc., (attached
15536 sounds) interrupt the playing sound. The default for objects is 15643 sounds) interrupt the playing sound. The default for objects is
15537 <A 15644 <A
15538HREF="#AEN5248" 15645HREF="#AEN5283"
15539>FALSE</A 15646>FALSE</A
15540>. Setting this value to 15647>. Setting this value to
15541 <A 15648 <A
15542HREF="#AEN5248" 15649HREF="#AEN5283"
15543>TRUE</A 15650>TRUE</A
15544> will make the sound wait 15651> will make the sound wait
15545 until the current playing sound reaches its end. The queue is one 15652 until the current playing sound reaches its end. The queue is one
@@ -15550,15 +15657,15 @@ CLASS="section"
15550><HR><H2 15657><HR><H2
15551CLASS="section" 15658CLASS="section"
15552><A 15659><A
15553NAME="AEN4048" 15660NAME="AEN4083"
15554>A.247. llSetStatus</A 15661>A.249. llSetStatus</A
15555></H2 15662></H2
15556><DIV 15663><DIV
15557CLASS="funcsynopsis" 15664CLASS="funcsynopsis"
15558><P 15665><P
15559></P 15666></P
15560><A 15667><A
15561NAME="AEN4050" 15668NAME="AEN4085"
15562></A 15669></A
15563><P 15670><P
15564><CODE 15671><CODE
@@ -15579,7 +15686,7 @@ CLASS="parameter"
15579CLASS="parameter" 15686CLASS="parameter"
15580>value</CODE 15687>value</CODE
15581>. Use <A 15688>. Use <A
15582HREF="#AEN5257" 15689HREF="#AEN5292"
15583>status constants</A 15690>status constants</A
15584> for the values of 15691> for the values of
15585 <CODE 15692 <CODE
@@ -15592,15 +15699,15 @@ CLASS="section"
15592><HR><H2 15699><HR><H2
15593CLASS="section" 15700CLASS="section"
15594><A 15701><A
15595NAME="AEN4063" 15702NAME="AEN4098"
15596>A.248. llSetText</A 15703>A.250. llSetText</A
15597></H2 15704></H2
15598><DIV 15705><DIV
15599CLASS="funcsynopsis" 15706CLASS="funcsynopsis"
15600><P 15707><P
15601></P 15708></P
15602><A 15709><A
15603NAME="AEN4065" 15710NAME="AEN4100"
15604></A 15711></A
15605><P 15712><P
15606><CODE 15713><CODE
@@ -15632,15 +15739,15 @@ CLASS="section"
15632><HR><H2 15739><HR><H2
15633CLASS="section" 15740CLASS="section"
15634><A 15741><A
15635NAME="AEN4079" 15742NAME="AEN4114"
15636>A.249. llSetTexture</A 15743>A.251. llSetTexture</A
15637></H2 15744></H2
15638><DIV 15745><DIV
15639CLASS="funcsynopsis" 15746CLASS="funcsynopsis"
15640><P 15747><P
15641></P 15748></P
15642><A 15749><A
15643NAME="AEN4081" 15750NAME="AEN4116"
15644></A 15751></A
15645><P 15752><P
15646><CODE 15753><CODE
@@ -15661,7 +15768,7 @@ CLASS="parameter"
15661CLASS="parameter" 15768CLASS="parameter"
15662>face</CODE 15769>face</CODE
15663>. If face is <A 15770>. If face is <A
15664HREF="#AEN6026" 15771HREF="#AEN6061"
15665>ALL_SIDES</A 15772>ALL_SIDES</A
15666>, set the texture to 15773>, set the texture to
15667 all faces.</P 15774 all faces.</P
@@ -15671,15 +15778,15 @@ CLASS="section"
15671><HR><H2 15778><HR><H2
15672CLASS="section" 15779CLASS="section"
15673><A 15780><A
15674NAME="AEN4093" 15781NAME="AEN4128"
15675>A.250. llSetTextureAnim</A 15782>A.252. llSetTextureAnim</A
15676></H2 15783></H2
15677><DIV 15784><DIV
15678CLASS="funcsynopsis" 15785CLASS="funcsynopsis"
15679><P 15786><P
15680></P 15787></P
15681><A 15788><A
15682NAME="AEN4095" 15789NAME="AEN4130"
15683></A 15790></A
15684><P 15791><P
15685><CODE 15792><CODE
@@ -15694,7 +15801,7 @@ CLASS="FUNCDEF"
15694><P 15801><P
15695>Animates a texture by setting the texture scale and 15802>Animates a texture by setting the texture scale and
15696 offset. The mode is a mask of <A 15803 offset. The mode is a mask of <A
15697HREF="#AEN5770" 15804HREF="#AEN5805"
15698>texture animation 15805>texture animation
15699 constants</A 15806 constants</A
15700>. You can only have one texture animation on an 15807>. You can only have one texture animation on an
@@ -15702,17 +15809,17 @@ HREF="#AEN5770"
15702 reset it.</P 15809 reset it.</P
15703><P 15810><P
15704>You can only do one traditional animation, <A 15811>You can only do one traditional animation, <A
15705HREF="#AEN5770" 15812HREF="#AEN5805"
15706>ROTATE</A 15813>ROTATE</A
15707> or <A 15814> or <A
15708HREF="#AEN5770" 15815HREF="#AEN5805"
15709>SCALE</A 15816>SCALE</A
15710> at a time, you 15817> at a time, you
15711 cannot combine masks. In the case of <A 15818 cannot combine masks. In the case of <A
15712HREF="#AEN5770" 15819HREF="#AEN5805"
15713>ROTATE</A 15820>ROTATE</A
15714> or <A 15821> or <A
15715HREF="#AEN5770" 15822HREF="#AEN5805"
15716>SCALE</A 15823>SCALE</A
15717>, 15824>,
15718 <CODE 15825 <CODE
@@ -15748,7 +15855,7 @@ CLASS="parameter"
15748CLASS="parameter" 15855CLASS="parameter"
15749>face</CODE 15856>face</CODE
15750> is <A 15857> is <A
15751HREF="#AEN6026" 15858HREF="#AEN6061"
15752>ALL_SIDES</A 15859>ALL_SIDES</A
15753>, all textures on the 15860>, all textures on the
15754 object are animated. </P 15861 object are animated. </P
@@ -15797,15 +15904,15 @@ CLASS="section"
15797><HR><H2 15904><HR><H2
15798CLASS="section" 15905CLASS="section"
15799><A 15906><A
15800NAME="AEN4141" 15907NAME="AEN4176"
15801>A.251. llSetTimerEvent</A 15908>A.253. llSetTimerEvent</A
15802></H2 15909></H2
15803><DIV 15910><DIV
15804CLASS="funcsynopsis" 15911CLASS="funcsynopsis"
15805><P 15912><P
15806></P 15913></P
15807><A 15914><A
15808NAME="AEN4143" 15915NAME="AEN4178"
15809></A 15916></A
15810><P 15917><P
15811><CODE 15918><CODE
@@ -15819,7 +15926,7 @@ CLASS="FUNCDEF"
15819></DIV 15926></DIV
15820><P 15927><P
15821>Sets the <A 15928>Sets the <A
15822HREF="#AEN5164" 15929HREF="#AEN5199"
15823>timer</A 15930>timer</A
15824> event to 15931> event to
15825 be triggered every <CODE 15932 be triggered every <CODE
@@ -15827,7 +15934,7 @@ CLASS="parameter"
15827>sec</CODE 15934>sec</CODE
15828> seconds. Passing in 15935> seconds. Passing in
15829 0.0 stops further <A 15936 0.0 stops further <A
15830HREF="#AEN5164" 15937HREF="#AEN5199"
15831>timer</A 15938>timer</A
15832> 15939>
15833 events.</P 15940 events.</P
@@ -15837,15 +15944,15 @@ CLASS="section"
15837><HR><H2 15944><HR><H2
15838CLASS="section" 15945CLASS="section"
15839><A 15946><A
15840NAME="AEN4153" 15947NAME="AEN4188"
15841>A.252. llSetTorque</A 15948>A.254. llSetTorque</A
15842></H2 15949></H2
15843><DIV 15950><DIV
15844CLASS="funcsynopsis" 15951CLASS="funcsynopsis"
15845><P 15952><P
15846></P 15953></P
15847><A 15954><A
15848NAME="AEN4155" 15955NAME="AEN4190"
15849></A 15956></A
15850><P 15957><P
15851><CODE 15958><CODE
@@ -15864,11 +15971,11 @@ CLASS="parameter"
15864>torque</CODE 15971>torque</CODE
15865>. The vector is in local coordinates 15972>. The vector is in local coordinates
15866 if local is <A 15973 if local is <A
15867HREF="#AEN5248" 15974HREF="#AEN5283"
15868>TRUE</A 15975>TRUE</A
15869>, global if 15976>, global if
15870 <A 15977 <A
15871HREF="#AEN5248" 15978HREF="#AEN5283"
15872>FALSE</A 15979>FALSE</A
15873>.</P 15980>.</P
15874></DIV 15981></DIV
@@ -15877,15 +15984,15 @@ CLASS="section"
15877><HR><H2 15984><HR><H2
15878CLASS="section" 15985CLASS="section"
15879><A 15986><A
15880NAME="AEN4167" 15987NAME="AEN4202"
15881>A.253. llSetTouchText</A 15988>A.255. llSetTouchText</A
15882></H2 15989></H2
15883><DIV 15990><DIV
15884CLASS="funcsynopsis" 15991CLASS="funcsynopsis"
15885><P 15992><P
15886></P 15993></P
15887><A 15994><A
15888NAME="AEN4169" 15995NAME="AEN4204"
15889></A 15996></A
15890><P 15997><P
15891><CODE 15998><CODE
@@ -15909,15 +16016,15 @@ CLASS="section"
15909><HR><H2 16016><HR><H2
15910CLASS="section" 16017CLASS="section"
15911><A 16018><A
15912NAME="AEN4177" 16019NAME="AEN4212"
15913>A.254. llSetVehicleFlags</A 16020>A.256. llSetVehicleFlags</A
15914></H2 16021></H2
15915><DIV 16022><DIV
15916CLASS="funcsynopsis" 16023CLASS="funcsynopsis"
15917><P 16024><P
15918></P 16025></P
15919><A 16026><A
15920NAME="AEN4179" 16027NAME="AEN4214"
15921></A 16028></A
15922><P 16029><P
15923><CODE 16030><CODE
@@ -15935,7 +16042,7 @@ CLASS="parameter"
15935>flags</CODE 16042>flags</CODE
15936> to TRUE. Valid 16043> to TRUE. Valid
15937 parameters can be found in the <A 16044 parameters can be found in the <A
15938HREF="#AEN6184" 16045HREF="#AEN6219"
15939>vehicle flags constants</A 16046>vehicle flags constants</A
15940> 16047>
15941 section.</P 16048 section.</P
@@ -15945,15 +16052,15 @@ CLASS="section"
15945><HR><H2 16052><HR><H2
15946CLASS="section" 16053CLASS="section"
15947><A 16054><A
15948NAME="AEN4188" 16055NAME="AEN4223"
15949>A.255. llSetVehicleFloatParam</A 16056>A.257. llSetVehicleFloatParam</A
15950></H2 16057></H2
15951><DIV 16058><DIV
15952CLASS="funcsynopsis" 16059CLASS="funcsynopsis"
15953><P 16060><P
15954></P 16061></P
15955><A 16062><A
15956NAME="AEN4190" 16063NAME="AEN4225"
15957></A 16064></A
15958><P 16065><P
15959><CODE 16066><CODE
@@ -15976,7 +16083,7 @@ CLASS="parameter"
15976>param_value</CODE 16083>param_value</CODE
15977>. Valid parameters and their 16084>. Valid parameters and their
15978 expected values can be found in the <A 16085 expected values can be found in the <A
15979HREF="#AEN6065" 16086HREF="#AEN6100"
15980>vehicle parameter 16087>vehicle parameter
15981 constants</A 16088 constants</A
15982> section.</P 16089> section.</P
@@ -15986,15 +16093,15 @@ CLASS="section"
15986><HR><H2 16093><HR><H2
15987CLASS="section" 16094CLASS="section"
15988><A 16095><A
15989NAME="AEN4202" 16096NAME="AEN4237"
15990>A.256. llSetVehicleType</A 16097>A.258. llSetVehicleType</A
15991></H2 16098></H2
15992><DIV 16099><DIV
15993CLASS="funcsynopsis" 16100CLASS="funcsynopsis"
15994><P 16101><P
15995></P 16102></P
15996><A 16103><A
15997NAME="AEN4204" 16104NAME="AEN4239"
15998></A 16105></A
15999><P 16106><P
16000><CODE 16107><CODE
@@ -16013,7 +16120,7 @@ CLASS="parameter"
16013>type</CODE 16120>type</CODE
16014>. Valid types and an explanation of 16121>. Valid types and an explanation of
16015 their characteristics can be found in the <A 16122 their characteristics can be found in the <A
16016HREF="#AEN6241" 16123HREF="#AEN6276"
16017>vehicle type constants</A 16124>vehicle type constants</A
16018> 16125>
16019 section.</P 16126 section.</P
@@ -16023,15 +16130,15 @@ CLASS="section"
16023><HR><H2 16130><HR><H2
16024CLASS="section" 16131CLASS="section"
16025><A 16132><A
16026NAME="AEN4213" 16133NAME="AEN4248"
16027>A.257. llSetVehicleRotationParam</A 16134>A.259. llSetVehicleRotationParam</A
16028></H2 16135></H2
16029><DIV 16136><DIV
16030CLASS="funcsynopsis" 16137CLASS="funcsynopsis"
16031><P 16138><P
16032></P 16139></P
16033><A 16140><A
16034NAME="AEN4215" 16141NAME="AEN4250"
16035></A 16142></A
16036><P 16143><P
16037><CODE 16144><CODE
@@ -16054,7 +16161,7 @@ CLASS="parameter"
16054>param_value</CODE 16161>param_value</CODE
16055>. Valid parameters can be found 16162>. Valid parameters can be found
16056 in the <A 16163 in the <A
16057HREF="#AEN6065" 16164HREF="#AEN6100"
16058>vehicle parameter 16165>vehicle parameter
16059 constants</A 16166 constants</A
16060> section.</P 16167> section.</P
@@ -16064,15 +16171,15 @@ CLASS="section"
16064><HR><H2 16171><HR><H2
16065CLASS="section" 16172CLASS="section"
16066><A 16173><A
16067NAME="AEN4227" 16174NAME="AEN4262"
16068>A.258. llSetVehicleVectorParam</A 16175>A.260. llSetVehicleVectorParam</A
16069></H2 16176></H2
16070><DIV 16177><DIV
16071CLASS="funcsynopsis" 16178CLASS="funcsynopsis"
16072><P 16179><P
16073></P 16180></P
16074><A 16181><A
16075NAME="AEN4229" 16182NAME="AEN4264"
16076></A 16183></A
16077><P 16184><P
16078><CODE 16185><CODE
@@ -16095,7 +16202,7 @@ CLASS="parameter"
16095>param_value</CODE 16202>param_value</CODE
16096>. Valid parameters can be found 16203>. Valid parameters can be found
16097 in the <A 16204 in the <A
16098HREF="#AEN6065" 16205HREF="#AEN6100"
16099>vehicle parameter 16206>vehicle parameter
16100 constants</A 16207 constants</A
16101> section.</P 16208> section.</P
@@ -16105,15 +16212,15 @@ CLASS="section"
16105><HR><H2 16212><HR><H2
16106CLASS="section" 16213CLASS="section"
16107><A 16214><A
16108NAME="AEN4241" 16215NAME="AEN4276"
16109>A.259. llShout</A 16216>A.261. llShout</A
16110></H2 16217></H2
16111><DIV 16218><DIV
16112CLASS="funcsynopsis" 16219CLASS="funcsynopsis"
16113><P 16220><P
16114></P 16221></P
16115><A 16222><A
16116NAME="AEN4243" 16223NAME="AEN4278"
16117></A 16224></A
16118><P 16225><P
16119><CODE 16226><CODE
@@ -16146,15 +16253,15 @@ CLASS="section"
16146><HR><H2 16253><HR><H2
16147CLASS="section" 16254CLASS="section"
16148><A 16255><A
16149NAME="AEN4255" 16256NAME="AEN4290"
16150>A.260. llSin</A 16257>A.262. llSin</A
16151></H2 16258></H2
16152><DIV 16259><DIV
16153CLASS="funcsynopsis" 16260CLASS="funcsynopsis"
16154><P 16261><P
16155></P 16262></P
16156><A 16263><A
16157NAME="AEN4257" 16264NAME="AEN4292"
16158></A 16265></A
16159><P 16266><P
16160><CODE 16267><CODE
@@ -16178,15 +16285,15 @@ CLASS="section"
16178><HR><H2 16285><HR><H2
16179CLASS="section" 16286CLASS="section"
16180><A 16287><A
16181NAME="AEN4265" 16288NAME="AEN4300"
16182>A.261. llSitTarget</A 16289>A.263. llSitTarget</A
16183></H2 16290></H2
16184><DIV 16291><DIV
16185CLASS="funcsynopsis" 16292CLASS="funcsynopsis"
16186><P 16293><P
16187></P 16294></P
16188><A 16295><A
16189NAME="AEN4267" 16296NAME="AEN4302"
16190></A 16297></A
16191><P 16298><P
16192><CODE 16299><CODE
@@ -16204,7 +16311,7 @@ CLASS="FUNCDEF"
16204CLASS="parameter" 16311CLASS="parameter"
16205>offset</CODE 16312>offset</CODE
16206> == <A 16313> == <A
16207HREF="#AEN6033" 16314HREF="#AEN6068"
16208>ZERO_VECTOR</A 16315>ZERO_VECTOR</A
16209> 16316>
16210 clear the sit target.</P 16317 clear the sit target.</P
@@ -16214,15 +16321,15 @@ CLASS="section"
16214><HR><H2 16321><HR><H2
16215CLASS="section" 16322CLASS="section"
16216><A 16323><A
16217NAME="AEN4278" 16324NAME="AEN4313"
16218>A.262. llSleep</A 16325>A.264. llSleep</A
16219></H2 16326></H2
16220><DIV 16327><DIV
16221CLASS="funcsynopsis" 16328CLASS="funcsynopsis"
16222><P 16329><P
16223></P 16330></P
16224><A 16331><A
16225NAME="AEN4280" 16332NAME="AEN4315"
16226></A 16333></A
16227><P 16334><P
16228><CODE 16335><CODE
@@ -16246,15 +16353,15 @@ CLASS="section"
16246><HR><H2 16353><HR><H2
16247CLASS="section" 16354CLASS="section"
16248><A 16355><A
16249NAME="AEN4288" 16356NAME="AEN4323"
16250>A.263. llSqrt</A 16357>A.265. llSqrt</A
16251></H2 16358></H2
16252><DIV 16359><DIV
16253CLASS="funcsynopsis" 16360CLASS="funcsynopsis"
16254><P 16361><P
16255></P 16362></P
16256><A 16363><A
16257NAME="AEN4290" 16364NAME="AEN4325"
16258></A 16365></A
16259><P 16366><P
16260><CODE 16367><CODE
@@ -16282,15 +16389,15 @@ CLASS="section"
16282><HR><H2 16389><HR><H2
16283CLASS="section" 16390CLASS="section"
16284><A 16391><A
16285NAME="AEN4299" 16392NAME="AEN4334"
16286>A.264. llStartAnimation</A 16393>A.266. llStartAnimation</A
16287></H2 16394></H2
16288><DIV 16395><DIV
16289CLASS="funcsynopsis" 16396CLASS="funcsynopsis"
16290><P 16397><P
16291></P 16398></P
16292><A 16399><A
16293NAME="AEN4301" 16400NAME="AEN4336"
16294></A 16401></A
16295><P 16402><P
16296><CODE 16403><CODE
@@ -16659,15 +16766,15 @@ CLASS="section"
16659><HR><H2 16766><HR><H2
16660CLASS="section" 16767CLASS="section"
16661><A 16768><A
16662NAME="AEN4531" 16769NAME="AEN4566"
16663>A.265. llStopAnimation</A 16770>A.267. llStopAnimation</A
16664></H2 16771></H2
16665><DIV 16772><DIV
16666CLASS="funcsynopsis" 16773CLASS="funcsynopsis"
16667><P 16774><P
16668></P 16775></P
16669><A 16776><A
16670NAME="AEN4533" 16777NAME="AEN4568"
16671></A 16778></A
16672><P 16779><P
16673><CODE 16780><CODE
@@ -16691,15 +16798,15 @@ CLASS="section"
16691><HR><H2 16798><HR><H2
16692CLASS="section" 16799CLASS="section"
16693><A 16800><A
16694NAME="AEN4541" 16801NAME="AEN4576"
16695>A.266. llStopHover</A 16802>A.268. llStopHover</A
16696></H2 16803></H2
16697><DIV 16804><DIV
16698CLASS="funcsynopsis" 16805CLASS="funcsynopsis"
16699><P 16806><P
16700></P 16807></P
16701><A 16808><A
16702NAME="AEN4543" 16809NAME="AEN4578"
16703></A 16810></A
16704><P 16811><P
16705><CODE 16812><CODE
@@ -16719,15 +16826,15 @@ CLASS="section"
16719><HR><H2 16826><HR><H2
16720CLASS="section" 16827CLASS="section"
16721><A 16828><A
16722NAME="AEN4549" 16829NAME="AEN4584"
16723>A.267. llStopLookAt</A 16830>A.269. llStopLookAt</A
16724></H2 16831></H2
16725><DIV 16832><DIV
16726CLASS="funcsynopsis" 16833CLASS="funcsynopsis"
16727><P 16834><P
16728></P 16835></P
16729><A 16836><A
16730NAME="AEN4551" 16837NAME="AEN4586"
16731></A 16838></A
16732><P 16839><P
16733><CODE 16840><CODE
@@ -16747,15 +16854,15 @@ CLASS="section"
16747><HR><H2 16854><HR><H2
16748CLASS="section" 16855CLASS="section"
16749><A 16856><A
16750NAME="AEN4557" 16857NAME="AEN4592"
16751>A.268. llStopMoveToTarget</A 16858>A.270. llStopMoveToTarget</A
16752></H2 16859></H2
16753><DIV 16860><DIV
16754CLASS="funcsynopsis" 16861CLASS="funcsynopsis"
16755><P 16862><P
16756></P 16863></P
16757><A 16864><A
16758NAME="AEN4559" 16865NAME="AEN4594"
16759></A 16866></A
16760><P 16867><P
16761><CODE 16868><CODE
@@ -16775,15 +16882,15 @@ CLASS="section"
16775><HR><H2 16882><HR><H2
16776CLASS="section" 16883CLASS="section"
16777><A 16884><A
16778NAME="AEN4565" 16885NAME="AEN4600"
16779>A.269. llStopPointAt</A 16886>A.271. llStopPointAt</A
16780></H2 16887></H2
16781><DIV 16888><DIV
16782CLASS="funcsynopsis" 16889CLASS="funcsynopsis"
16783><P 16890><P
16784></P 16891></P
16785><A 16892><A
16786NAME="AEN4567" 16893NAME="AEN4602"
16787></A 16894></A
16788><P 16895><P
16789><CODE 16896><CODE
@@ -16803,15 +16910,15 @@ CLASS="section"
16803><HR><H2 16910><HR><H2
16804CLASS="section" 16911CLASS="section"
16805><A 16912><A
16806NAME="AEN4573" 16913NAME="AEN4608"
16807>A.270. llStopSound</A 16914>A.272. llStopSound</A
16808></H2 16915></H2
16809><DIV 16916><DIV
16810CLASS="funcsynopsis" 16917CLASS="funcsynopsis"
16811><P 16918><P
16812></P 16919></P
16813><A 16920><A
16814NAME="AEN4575" 16921NAME="AEN4610"
16815></A 16922></A
16816><P 16923><P
16817><CODE 16924><CODE
@@ -16832,7 +16939,7 @@ HREF="#AEN2773"
16832>llLoopSound</A 16939>llLoopSound</A
16833>. Has no effect on 16940>. Has no effect on
16834 sounds started with <A 16941 sounds started with <A
16835HREF="#AEN4709" 16942HREF="#AEN4744"
16836>llTriggerSound</A 16943>llTriggerSound</A
16837>.</P 16944>.</P
16838></DIV 16945></DIV
@@ -16841,15 +16948,15 @@ CLASS="section"
16841><HR><H2 16948><HR><H2
16842CLASS="section" 16949CLASS="section"
16843><A 16950><A
16844NAME="AEN4584" 16951NAME="AEN4619"
16845>A.271. llStringLength</A 16952>A.273. llStringLength</A
16846></H2 16953></H2
16847><DIV 16954><DIV
16848CLASS="funcsynopsis" 16955CLASS="funcsynopsis"
16849><P 16956><P
16850></P 16957></P
16851><A 16958><A
16852NAME="AEN4586" 16959NAME="AEN4621"
16853></A 16960></A
16854><P 16961><P
16855><CODE 16962><CODE
@@ -16873,15 +16980,15 @@ CLASS="section"
16873><HR><H2 16980><HR><H2
16874CLASS="section" 16981CLASS="section"
16875><A 16982><A
16876NAME="AEN4594" 16983NAME="AEN4629"
16877>A.272. llSubStringIndex</A 16984>A.274. llSubStringIndex</A
16878></H2 16985></H2
16879><DIV 16986><DIV
16880CLASS="funcsynopsis" 16987CLASS="funcsynopsis"
16881><P 16988><P
16882></P 16989></P
16883><A 16990><A
16884NAME="AEN4596" 16991NAME="AEN4631"
16885></A 16992></A
16886><P 16993><P
16887><CODE 16994><CODE
@@ -16902,15 +17009,15 @@ CLASS="section"
16902><HR><H2 17009><HR><H2
16903CLASS="section" 17010CLASS="section"
16904><A 17011><A
16905NAME="AEN4605" 17012NAME="AEN4640"
16906>A.273. llStringToBase64</A 17013>A.275. llStringToBase64</A
16907></H2 17014></H2
16908><DIV 17015><DIV
16909CLASS="funcsynopsis" 17016CLASS="funcsynopsis"
16910><P 17017><P
16911></P 17018></P
16912><A 17019><A
16913NAME="AEN4607" 17020NAME="AEN4642"
16914></A 17021></A
16915><P 17022><P
16916><CODE 17023><CODE
@@ -16930,15 +17037,15 @@ CLASS="section"
16930><HR><H2 17037><HR><H2
16931CLASS="section" 17038CLASS="section"
16932><A 17039><A
16933NAME="AEN4614" 17040NAME="AEN4649"
16934>A.274. llTakeControls</A 17041>A.276. llTakeControls</A
16935></H2 17042></H2
16936><DIV 17043><DIV
16937CLASS="funcsynopsis" 17044CLASS="funcsynopsis"
16938><P 17045><P
16939></P 17046></P
16940><A 17047><A
16941NAME="AEN4616" 17048NAME="AEN4651"
16942></A 17049></A
16943><P 17050><P
16944><CODE 17051><CODE
@@ -16963,7 +17070,7 @@ CLASS="parameter"
16963CLASS="parameter" 17070CLASS="parameter"
16964>pass_on</CODE 17071>pass_on</CODE
16965> is <A 17072> is <A
16966HREF="#AEN5248" 17073HREF="#AEN5283"
16967>TRUE</A 17074>TRUE</A
16968>, also send input to 17075>, also send input to
16969 avatar.</P 17076 avatar.</P
@@ -16973,15 +17080,15 @@ CLASS="section"
16973><HR><H2 17080><HR><H2
16974CLASS="section" 17081CLASS="section"
16975><A 17082><A
16976NAME="AEN4631" 17083NAME="AEN4666"
16977>A.275. llTan</A 17084>A.277. llTan</A
16978></H2 17085></H2
16979><DIV 17086><DIV
16980CLASS="funcsynopsis" 17087CLASS="funcsynopsis"
16981><P 17088><P
16982></P 17089></P
16983><A 17090><A
16984NAME="AEN4633" 17091NAME="AEN4668"
16985></A 17092></A
16986><P 17093><P
16987><CODE 17094><CODE
@@ -17005,15 +17112,15 @@ CLASS="section"
17005><HR><H2 17112><HR><H2
17006CLASS="section" 17113CLASS="section"
17007><A 17114><A
17008NAME="AEN4641" 17115NAME="AEN4676"
17009>A.276. llTarget</A 17116>A.278. llTarget</A
17010></H2 17117></H2
17011><DIV 17118><DIV
17012CLASS="funcsynopsis" 17119CLASS="funcsynopsis"
17013><P 17120><P
17014></P 17121></P
17015><A 17122><A
17016NAME="AEN4643" 17123NAME="AEN4678"
17017></A 17124></A
17018><P 17125><P
17019><CODE 17126><CODE
@@ -17041,15 +17148,15 @@ CLASS="section"
17041><HR><H2 17148><HR><H2
17042CLASS="section" 17149CLASS="section"
17043><A 17150><A
17044NAME="AEN4654" 17151NAME="AEN4689"
17045>A.277. llTargetOmega</A 17152>A.279. llTargetOmega</A
17046></H2 17153></H2
17047><DIV 17154><DIV
17048CLASS="funcsynopsis" 17155CLASS="funcsynopsis"
17049><P 17156><P
17050></P 17157></P
17051><A 17158><A
17052NAME="AEN4656" 17159NAME="AEN4691"
17053></A 17160></A
17054><P 17161><P
17055><CODE 17162><CODE
@@ -17086,15 +17193,15 @@ CLASS="section"
17086><HR><H2 17193><HR><H2
17087CLASS="section" 17194CLASS="section"
17088><A 17195><A
17089NAME="AEN4671" 17196NAME="AEN4706"
17090>A.278. llTargetRemove</A 17197>A.280. llTargetRemove</A
17091></H2 17198></H2
17092><DIV 17199><DIV
17093CLASS="funcsynopsis" 17200CLASS="funcsynopsis"
17094><P 17201><P
17095></P 17202></P
17096><A 17203><A
17097NAME="AEN4673" 17204NAME="AEN4708"
17098></A 17205></A
17099><P 17206><P
17100><CODE 17207><CODE
@@ -17117,15 +17224,15 @@ CLASS="section"
17117><HR><H2 17224><HR><H2
17118CLASS="section" 17225CLASS="section"
17119><A 17226><A
17120NAME="AEN4681" 17227NAME="AEN4716"
17121>A.279. llTeleportAgentHome</A 17228>A.281. llTeleportAgentHome</A
17122></H2 17229></H2
17123><DIV 17230><DIV
17124CLASS="funcsynopsis" 17231CLASS="funcsynopsis"
17125><P 17232><P
17126></P 17233></P
17127><A 17234><A
17128NAME="AEN4683" 17235NAME="AEN4718"
17129></A 17236></A
17130><P 17237><P
17131><CODE 17238><CODE
@@ -17146,15 +17253,15 @@ CLASS="section"
17146><HR><H2 17253><HR><H2
17147CLASS="section" 17254CLASS="section"
17148><A 17255><A
17149NAME="AEN4690" 17256NAME="AEN4725"
17150>A.280. llToLower</A 17257>A.282. llToLower</A
17151></H2 17258></H2
17152><DIV 17259><DIV
17153CLASS="funcsynopsis" 17260CLASS="funcsynopsis"
17154><P 17261><P
17155></P 17262></P
17156><A 17263><A
17157NAME="AEN4692" 17264NAME="AEN4727"
17158></A 17265></A
17159><P 17266><P
17160><CODE 17267><CODE
@@ -17174,15 +17281,15 @@ CLASS="section"
17174><HR><H2 17281><HR><H2
17175CLASS="section" 17282CLASS="section"
17176><A 17283><A
17177NAME="AEN4699" 17284NAME="AEN4734"
17178>A.281. llToUpper</A 17285>A.283. llToUpper</A
17179></H2 17286></H2
17180><DIV 17287><DIV
17181CLASS="funcsynopsis" 17288CLASS="funcsynopsis"
17182><P 17289><P
17183></P 17290></P
17184><A 17291><A
17185NAME="AEN4701" 17292NAME="AEN4736"
17186></A 17293></A
17187><P 17294><P
17188><CODE 17295><CODE
@@ -17205,15 +17312,15 @@ CLASS="section"
17205><HR><H2 17312><HR><H2
17206CLASS="section" 17313CLASS="section"
17207><A 17314><A
17208NAME="AEN4709" 17315NAME="AEN4744"
17209>A.282. llTriggerSound</A 17316>A.284. llTriggerSound</A
17210></H2 17317></H2
17211><DIV 17318><DIV
17212CLASS="funcsynopsis" 17319CLASS="funcsynopsis"
17213><P 17320><P
17214></P 17321></P
17215><A 17322><A
17216NAME="AEN4711" 17323NAME="AEN4746"
17217></A 17324></A
17218><P 17325><P
17219><CODE 17326><CODE
@@ -17231,7 +17338,7 @@ CLASS="FUNCDEF"
17231 object at the time of the trigger. There is no limit to the number 17338 object at the time of the trigger. There is no limit to the number
17232 of triggered sounds which can be generated by an object, and 17339 of triggered sounds which can be generated by an object, and
17233 calling <A 17340 calling <A
17234HREF="#AEN4709" 17341HREF="#AEN4744"
17235>llTriggerSound</A 17342>llTriggerSound</A
17236> 17343>
17237 does not affect the attached sounds created by <A 17344 does not affect the attached sounds created by <A
@@ -17250,15 +17357,15 @@ CLASS="section"
17250><HR><H2 17357><HR><H2
17251CLASS="section" 17358CLASS="section"
17252><A 17359><A
17253NAME="AEN4723" 17360NAME="AEN4758"
17254>A.283. llTriggerSoundLimited</A 17361>A.285. llTriggerSoundLimited</A
17255></H2 17362></H2
17256><DIV 17363><DIV
17257CLASS="funcsynopsis" 17364CLASS="funcsynopsis"
17258><P 17365><P
17259></P 17366></P
17260><A 17367><A
17261NAME="AEN4725" 17368NAME="AEN4760"
17262></A 17369></A
17263><P 17370><P
17264><CODE 17371><CODE
@@ -17285,7 +17392,7 @@ CLASS="parameter"
17285 the time of the trigger. There is no limit to the number of 17392 the time of the trigger. There is no limit to the number of
17286 triggered sounds which can be generated by an object, and calling 17393 triggered sounds which can be generated by an object, and calling
17287 <A 17394 <A
17288HREF="#AEN4709" 17395HREF="#AEN4744"
17289>llTriggerSound</A 17396>llTriggerSound</A
17290> does not 17397> does not
17291 affect the attached sounds created by <A 17398 affect the attached sounds created by <A
@@ -17304,15 +17411,15 @@ CLASS="section"
17304><HR><H2 17411><HR><H2
17305CLASS="section" 17412CLASS="section"
17306><A 17413><A
17307NAME="AEN4743" 17414NAME="AEN4778"
17308>A.284. llUnescapeURL</A 17415>A.286. llUnescapeURL</A
17309></H2 17416></H2
17310><DIV 17417><DIV
17311CLASS="funcsynopsis" 17418CLASS="funcsynopsis"
17312><P 17419><P
17313></P 17420></P
17314><A 17421><A
17315NAME="AEN4745" 17422NAME="AEN4780"
17316></A 17423></A
17317><P 17424><P
17318><CODE 17425><CODE
@@ -17336,15 +17443,15 @@ CLASS="section"
17336><HR><H2 17443><HR><H2
17337CLASS="section" 17444CLASS="section"
17338><A 17445><A
17339NAME="AEN4753" 17446NAME="AEN4788"
17340>A.285. llUnSit</A 17447>A.287. llUnSit</A
17341></H2 17448></H2
17342><DIV 17449><DIV
17343CLASS="funcsynopsis" 17450CLASS="funcsynopsis"
17344><P 17451><P
17345></P 17452></P
17346><A 17453><A
17347NAME="AEN4755" 17454NAME="AEN4790"
17348></A 17455></A
17349><P 17456><P
17350><CODE 17457><CODE
@@ -17369,15 +17476,15 @@ CLASS="section"
17369><HR><H2 17476><HR><H2
17370CLASS="section" 17477CLASS="section"
17371><A 17478><A
17372NAME="AEN4763" 17479NAME="AEN4798"
17373>A.286. llVecDist</A 17480>A.288. llVecDist</A
17374></H2 17481></H2
17375><DIV 17482><DIV
17376CLASS="funcsynopsis" 17483CLASS="funcsynopsis"
17377><P 17484><P
17378></P 17485></P
17379><A 17486><A
17380NAME="AEN4765" 17487NAME="AEN4800"
17381></A 17488></A
17382><P 17489><P
17383><CODE 17490><CODE
@@ -17404,15 +17511,15 @@ CLASS="section"
17404><HR><H2 17511><HR><H2
17405CLASS="section" 17512CLASS="section"
17406><A 17513><A
17407NAME="AEN4776" 17514NAME="AEN4811"
17408>A.287. llVecMag</A 17515>A.289. llVecMag</A
17409></H2 17516></H2
17410><DIV 17517><DIV
17411CLASS="funcsynopsis" 17518CLASS="funcsynopsis"
17412><P 17519><P
17413></P 17520></P
17414><A 17521><A
17415NAME="AEN4778" 17522NAME="AEN4813"
17416></A 17523></A
17417><P 17524><P
17418><CODE 17525><CODE
@@ -17435,15 +17542,15 @@ CLASS="section"
17435><HR><H2 17542><HR><H2
17436CLASS="section" 17543CLASS="section"
17437><A 17544><A
17438NAME="AEN4786" 17545NAME="AEN4821"
17439>A.288. llVecNorm</A 17546>A.290. llVecNorm</A
17440></H2 17547></H2
17441><DIV 17548><DIV
17442CLASS="funcsynopsis" 17549CLASS="funcsynopsis"
17443><P 17550><P
17444></P 17551></P
17445><A 17552><A
17446NAME="AEN4788" 17553NAME="AEN4823"
17447></A 17554></A
17448><P 17555><P
17449><CODE 17556><CODE
@@ -17466,15 +17573,15 @@ CLASS="section"
17466><HR><H2 17573><HR><H2
17467CLASS="section" 17574CLASS="section"
17468><A 17575><A
17469NAME="AEN4796" 17576NAME="AEN4831"
17470>A.289. llVolumeDetect</A 17577>A.291. llVolumeDetect</A
17471></H2 17578></H2
17472><DIV 17579><DIV
17473CLASS="funcsynopsis" 17580CLASS="funcsynopsis"
17474><P 17581><P
17475></P 17582></P
17476><A 17583><A
17477NAME="AEN4798" 17584NAME="AEN4833"
17478></A 17585></A
17479><P 17586><P
17480><CODE 17587><CODE
@@ -17494,15 +17601,15 @@ CLASS="section"
17494><HR><H2 17601><HR><H2
17495CLASS="section" 17602CLASS="section"
17496><A 17603><A
17497NAME="AEN4805" 17604NAME="AEN4840"
17498>A.290. llWater</A 17605>A.292. llWater</A
17499></H2 17606></H2
17500><DIV 17607><DIV
17501CLASS="funcsynopsis" 17608CLASS="funcsynopsis"
17502><P 17609><P
17503></P 17610></P
17504><A 17611><A
17505NAME="AEN4807" 17612NAME="AEN4842"
17506></A 17613></A
17507><P 17614><P
17508><CODE 17615><CODE
@@ -17526,15 +17633,15 @@ CLASS="section"
17526><HR><H2 17633><HR><H2
17527CLASS="section" 17634CLASS="section"
17528><A 17635><A
17529NAME="AEN4815" 17636NAME="AEN4850"
17530>A.291. llWhisper</A 17637>A.293. llWhisper</A
17531></H2 17638></H2
17532><DIV 17639><DIV
17533CLASS="funcsynopsis" 17640CLASS="funcsynopsis"
17534><P 17641><P
17535></P 17642></P
17536><A 17643><A
17537NAME="AEN4817" 17644NAME="AEN4852"
17538></A 17645></A
17539><P 17646><P
17540><CODE 17647><CODE
@@ -17567,15 +17674,15 @@ CLASS="section"
17567><HR><H2 17674><HR><H2
17568CLASS="section" 17675CLASS="section"
17569><A 17676><A
17570NAME="AEN4829" 17677NAME="AEN4864"
17571>A.292. llWind</A 17678>A.294. llWind</A
17572></H2 17679></H2
17573><DIV 17680><DIV
17574CLASS="funcsynopsis" 17681CLASS="funcsynopsis"
17575><P 17682><P
17576></P 17683></P
17577><A 17684><A
17578NAME="AEN4831" 17685NAME="AEN4866"
17579></A 17686></A
17580><P 17687><P
17581><CODE 17688><CODE
@@ -17599,15 +17706,15 @@ CLASS="section"
17599><HR><H2 17706><HR><H2
17600CLASS="section" 17707CLASS="section"
17601><A 17708><A
17602NAME="AEN4839" 17709NAME="AEN4874"
17603>A.293. llXorBase64Strings</A 17710>A.295. llXorBase64Strings</A
17604></H2 17711></H2
17605><DIV 17712><DIV
17606CLASS="funcsynopsis" 17713CLASS="funcsynopsis"
17607><P 17714><P
17608></P 17715></P
17609><A 17716><A
17610NAME="AEN4841" 17717NAME="AEN4876"
17611></A 17718></A
17612><P 17719><P
17613><CODE 17720><CODE
@@ -17635,7 +17742,7 @@ CLASS="parameter"
17635CLASS="appendix" 17742CLASS="appendix"
17636><HR><H1 17743><HR><H1
17637><A 17744><A
17638NAME="AEN4852" 17745NAME="AEN4887"
17639></A 17746></A
17640>Appendix B. Events</H1 17747>Appendix B. Events</H1
17641><P 17748><P
@@ -17647,7 +17754,7 @@ CLASS="section"
17647><HR><H2 17754><HR><H2
17648CLASS="section" 17755CLASS="section"
17649><A 17756><A
17650NAME="AEN4855" 17757NAME="AEN4890"
17651>B.1. at_rot_target</A 17758>B.1. at_rot_target</A
17652></H2 17759></H2
17653><DIV 17760><DIV
@@ -17655,7 +17762,7 @@ CLASS="funcsynopsis"
17655><P 17762><P
17656></P 17763></P
17657><A 17764><A
17658NAME="AEN4857" 17765NAME="AEN4892"
17659></A 17766></A
17660><P 17767><P
17661><CODE 17768><CODE
@@ -17679,7 +17786,7 @@ CLASS="section"
17679><HR><H2 17786><HR><H2
17680CLASS="section" 17787CLASS="section"
17681><A 17788><A
17682NAME="AEN4869" 17789NAME="AEN4904"
17683>B.2. at_target</A 17790>B.2. at_target</A
17684></H2 17791></H2
17685><DIV 17792><DIV
@@ -17687,7 +17794,7 @@ CLASS="funcsynopsis"
17687><P 17794><P
17688></P 17795></P
17689><A 17796><A
17690NAME="AEN4871" 17797NAME="AEN4906"
17691></A 17798></A
17692><P 17799><P
17693><CODE 17800><CODE
@@ -17703,7 +17810,7 @@ CLASS="FUNCDEF"
17703>This event is triggered when a script comes within a defined 17810>This event is triggered when a script comes within a defined
17704 range from a target position. The range and position are set by a 17811 range from a target position. The range and position are set by a
17705 call to <A 17812 call to <A
17706HREF="#AEN4641" 17813HREF="#AEN4676"
17707>llTarget</A 17814>llTarget</A
17708>.</P 17815>.</P
17709></DIV 17816></DIV
@@ -17712,7 +17819,7 @@ CLASS="section"
17712><HR><H2 17819><HR><H2
17713CLASS="section" 17820CLASS="section"
17714><A 17821><A
17715NAME="AEN4883" 17822NAME="AEN4918"
17716>B.3. attach</A 17823>B.3. attach</A
17717></H2 17824></H2
17718><DIV 17825><DIV
@@ -17720,7 +17827,7 @@ CLASS="funcsynopsis"
17720><P 17827><P
17721></P 17828></P
17722><A 17829><A
17723NAME="AEN4885" 17830NAME="AEN4920"
17724></A 17831></A
17725><P 17832><P
17726><CODE 17833><CODE
@@ -17737,7 +17844,7 @@ CLASS="FUNCDEF"
17737 is attached or detached from an avatar. If it is attached, 17844 is attached or detached from an avatar. If it is attached,
17738 attached is the key of the avatar it is attached to, otherwise 17845 attached is the key of the avatar it is attached to, otherwise
17739 attached is <A 17846 attached is <A
17740HREF="#AEN6023" 17847HREF="#AEN6058"
17741>NULL_KEY</A 17848>NULL_KEY</A
17742>.</P 17849>.</P
17743></DIV 17850></DIV
@@ -17746,7 +17853,7 @@ CLASS="section"
17746><HR><H2 17853><HR><H2
17747CLASS="section" 17854CLASS="section"
17748><A 17855><A
17749NAME="AEN4893" 17856NAME="AEN4928"
17750>B.4. changed</A 17857>B.4. changed</A
17751></H2 17858></H2
17752><DIV 17859><DIV
@@ -17754,7 +17861,7 @@ CLASS="funcsynopsis"
17754><P 17861><P
17755></P 17862></P
17756><A 17863><A
17757NAME="AEN4895" 17864NAME="AEN4930"
17758></A 17865></A
17759><P 17866><P
17760><CODE 17867><CODE
@@ -17772,7 +17879,7 @@ CLASS="FUNCDEF"
17772CLASS="parameter" 17879CLASS="parameter"
17773>changed</CODE 17880>changed</CODE
17774> will be a bitfield of <A 17881> will be a bitfield of <A
17775HREF="#AEN5643" 17882HREF="#AEN5678"
17776>change constants</A 17883>change constants</A
17777>.</P 17884>.</P
17778></DIV 17885></DIV
@@ -17781,7 +17888,7 @@ CLASS="section"
17781><HR><H2 17888><HR><H2
17782CLASS="section" 17889CLASS="section"
17783><A 17890><A
17784NAME="AEN4904" 17891NAME="AEN4939"
17785>B.5. collision</A 17892>B.5. collision</A
17786></H2 17893></H2
17787><DIV 17894><DIV
@@ -17789,7 +17896,7 @@ CLASS="funcsynopsis"
17789><P 17896><P
17790></P 17897></P
17791><A 17898><A
17792NAME="AEN4906" 17899NAME="AEN4941"
17793></A 17900></A
17794><P 17901><P
17795><CODE 17902><CODE
@@ -17817,7 +17924,7 @@ CLASS="section"
17817><HR><H2 17924><HR><H2
17818CLASS="section" 17925CLASS="section"
17819><A 17926><A
17820NAME="AEN4914" 17927NAME="AEN4949"
17821>B.6. collision_end</A 17928>B.6. collision_end</A
17822></H2 17929></H2
17823><DIV 17930><DIV
@@ -17825,7 +17932,7 @@ CLASS="funcsynopsis"
17825><P 17932><P
17826></P 17933></P
17827><A 17934><A
17828NAME="AEN4916" 17935NAME="AEN4951"
17829></A 17936></A
17830><P 17937><P
17831><CODE 17938><CODE
@@ -17853,7 +17960,7 @@ CLASS="section"
17853><HR><H2 17960><HR><H2
17854CLASS="section" 17961CLASS="section"
17855><A 17962><A
17856NAME="AEN4924" 17963NAME="AEN4959"
17857>B.7. collision_start</A 17964>B.7. collision_start</A
17858></H2 17965></H2
17859><DIV 17966><DIV
@@ -17861,7 +17968,7 @@ CLASS="funcsynopsis"
17861><P 17968><P
17862></P 17969></P
17863><A 17970><A
17864NAME="AEN4926" 17971NAME="AEN4961"
17865></A 17972></A
17866><P 17973><P
17867><CODE 17974><CODE
@@ -17889,7 +17996,7 @@ CLASS="section"
17889><HR><H2 17996><HR><H2
17890CLASS="section" 17997CLASS="section"
17891><A 17998><A
17892NAME="AEN4934" 17999NAME="AEN4969"
17893>B.8. control</A 18000>B.8. control</A
17894></H2 18001></H2
17895><DIV 18002><DIV
@@ -17897,7 +18004,7 @@ CLASS="funcsynopsis"
17897><P 18004><P
17898></P 18005></P
17899><A 18006><A
17900NAME="AEN4936" 18007NAME="AEN4971"
17901></A 18008></A
17902><P 18009><P
17903><CODE 18010><CODE
@@ -17920,7 +18027,7 @@ CLASS="parameter"
17920CLASS="parameter" 18027CLASS="parameter"
17921>edges</CODE 18028>edges</CODE
17922> are bitfields of <A 18029> are bitfields of <A
17923HREF="#AEN5596" 18030HREF="#AEN5631"
17924>control constants</A 18031>control constants</A
17925>.</P 18032>.</P
17926></DIV 18033></DIV
@@ -17929,7 +18036,7 @@ CLASS="section"
17929><HR><H2 18036><HR><H2
17930CLASS="section" 18037CLASS="section"
17931><A 18038><A
17932NAME="AEN4950" 18039NAME="AEN4985"
17933>B.9. dataserver</A 18040>B.9. dataserver</A
17934></H2 18041></H2
17935><DIV 18042><DIV
@@ -17937,7 +18044,7 @@ CLASS="funcsynopsis"
17937><P 18044><P
17938></P 18045></P
17939><A 18046><A
17940NAME="AEN4952" 18047NAME="AEN4987"
17941></A 18048></A
17942><P 18049><P
17943><CODE 18050><CODE
@@ -17973,7 +18080,7 @@ CLASS="section"
17973><HR><H2 18080><HR><H2
17974CLASS="section" 18081CLASS="section"
17975><A 18082><A
17976NAME="AEN4965" 18083NAME="AEN5000"
17977>B.10. email</A 18084>B.10. email</A
17978></H2 18085></H2
17979><DIV 18086><DIV
@@ -17981,7 +18088,7 @@ CLASS="funcsynopsis"
17981><P 18088><P
17982></P 18089></P
17983><A 18090><A
17984NAME="AEN4967" 18091NAME="AEN5002"
17985></A 18092></A
17986><P 18093><P
17987><CODE 18094><CODE
@@ -18006,7 +18113,7 @@ CLASS="section"
18006><HR><H2 18113><HR><H2
18007CLASS="section" 18114CLASS="section"
18008><A 18115><A
18009NAME="AEN4983" 18116NAME="AEN5018"
18010>B.11. land_collision</A 18117>B.11. land_collision</A
18011></H2 18118></H2
18012><DIV 18119><DIV
@@ -18014,7 +18121,7 @@ CLASS="funcsynopsis"
18014><P 18121><P
18015></P 18122></P
18016><A 18123><A
18017NAME="AEN4985" 18124NAME="AEN5020"
18018></A 18125></A
18019><P 18126><P
18020><CODE 18127><CODE
@@ -18035,7 +18142,7 @@ CLASS="section"
18035><HR><H2 18142><HR><H2
18036CLASS="section" 18143CLASS="section"
18037><A 18144><A
18038NAME="AEN4992" 18145NAME="AEN5027"
18039>B.12. land_collision_end</A 18146>B.12. land_collision_end</A
18040></H2 18147></H2
18041><DIV 18148><DIV
@@ -18043,7 +18150,7 @@ CLASS="funcsynopsis"
18043><P 18150><P
18044></P 18151></P
18045><A 18152><A
18046NAME="AEN4994" 18153NAME="AEN5029"
18047></A 18154></A
18048><P 18155><P
18049><CODE 18156><CODE
@@ -18064,7 +18171,7 @@ CLASS="section"
18064><HR><H2 18171><HR><H2
18065CLASS="section" 18172CLASS="section"
18066><A 18173><A
18067NAME="AEN5001" 18174NAME="AEN5036"
18068>B.13. land_collision_start</A 18175>B.13. land_collision_start</A
18069></H2 18176></H2
18070><DIV 18177><DIV
@@ -18072,7 +18179,7 @@ CLASS="funcsynopsis"
18072><P 18179><P
18073></P 18180></P
18074><A 18181><A
18075NAME="AEN5003" 18182NAME="AEN5038"
18076></A 18183></A
18077><P 18184><P
18078><CODE 18185><CODE
@@ -18093,7 +18200,7 @@ CLASS="section"
18093><HR><H2 18200><HR><H2
18094CLASS="section" 18201CLASS="section"
18095><A 18202><A
18096NAME="AEN5010" 18203NAME="AEN5045"
18097>B.14. link_message</A 18204>B.14. link_message</A
18098></H2 18205></H2
18099><DIV 18206><DIV
@@ -18101,7 +18208,7 @@ CLASS="funcsynopsis"
18101><P 18208><P
18102></P 18209></P
18103><A 18210><A
18104NAME="AEN5012" 18211NAME="AEN5047"
18105></A 18212></A
18106><P 18213><P
18107><CODE 18214><CODE
@@ -18125,7 +18232,7 @@ CLASS="section"
18125><HR><H2 18232><HR><H2
18126CLASS="section" 18233CLASS="section"
18127><A 18234><A
18128NAME="AEN5026" 18235NAME="AEN5061"
18129>B.15. listen</A 18236>B.15. listen</A
18130></H2 18237></H2
18131><DIV 18238><DIV
@@ -18133,7 +18240,7 @@ CLASS="funcsynopsis"
18133><P 18240><P
18134></P 18241></P
18135><A 18242><A
18136NAME="AEN5028" 18243NAME="AEN5063"
18137></A 18244></A
18138><P 18245><P
18139><CODE 18246><CODE
@@ -18173,7 +18280,7 @@ CLASS="section"
18173><HR><H2 18280><HR><H2
18174CLASS="section" 18281CLASS="section"
18175><A 18282><A
18176NAME="AEN5045" 18283NAME="AEN5080"
18177>B.16. money</A 18284>B.16. money</A
18178></H2 18285></H2
18179><DIV 18286><DIV
@@ -18181,7 +18288,7 @@ CLASS="funcsynopsis"
18181><P 18288><P
18182></P 18289></P
18183><A 18290><A
18184NAME="AEN5047" 18291NAME="AEN5082"
18185></A 18292></A
18186><P 18293><P
18187><CODE 18294><CODE
@@ -18210,7 +18317,7 @@ CLASS="section"
18210><HR><H2 18317><HR><H2
18211CLASS="section" 18318CLASS="section"
18212><A 18319><A
18213NAME="AEN5058" 18320NAME="AEN5093"
18214>B.17. moving_end</A 18321>B.17. moving_end</A
18215></H2 18322></H2
18216><DIV 18323><DIV
@@ -18218,7 +18325,7 @@ CLASS="funcsynopsis"
18218><P 18325><P
18219></P 18326></P
18220><A 18327><A
18221NAME="AEN5060" 18328NAME="AEN5095"
18222></A 18329></A
18223><P 18330><P
18224><CODE 18331><CODE
@@ -18239,7 +18346,7 @@ CLASS="section"
18239><HR><H2 18346><HR><H2
18240CLASS="section" 18347CLASS="section"
18241><A 18348><A
18242NAME="AEN5066" 18349NAME="AEN5101"
18243>B.18. moving_start</A 18350>B.18. moving_start</A
18244></H2 18351></H2
18245><DIV 18352><DIV
@@ -18247,7 +18354,7 @@ CLASS="funcsynopsis"
18247><P 18354><P
18248></P 18355></P
18249><A 18356><A
18250NAME="AEN5068" 18357NAME="AEN5103"
18251></A 18358></A
18252><P 18359><P
18253><CODE 18360><CODE
@@ -18268,7 +18375,7 @@ CLASS="section"
18268><HR><H2 18375><HR><H2
18269CLASS="section" 18376CLASS="section"
18270><A 18377><A
18271NAME="AEN5074" 18378NAME="AEN5109"
18272>B.19. no_sensor</A 18379>B.19. no_sensor</A
18273></H2 18380></H2
18274><DIV 18381><DIV
@@ -18276,7 +18383,7 @@ CLASS="funcsynopsis"
18276><P 18383><P
18277></P 18384></P
18278><A 18385><A
18279NAME="AEN5076" 18386NAME="AEN5111"
18280></A 18387></A
18281><P 18388><P
18282><CODE 18389><CODE
@@ -18300,7 +18407,7 @@ CLASS="section"
18300><HR><H2 18407><HR><H2
18301CLASS="section" 18408CLASS="section"
18302><A 18409><A
18303NAME="AEN5083" 18410NAME="AEN5118"
18304>B.20. not_at_rot_target</A 18411>B.20. not_at_rot_target</A
18305></H2 18412></H2
18306><DIV 18413><DIV
@@ -18308,7 +18415,7 @@ CLASS="funcsynopsis"
18308><P 18415><P
18309></P 18416></P
18310><A 18417><A
18311NAME="AEN5085" 18418NAME="AEN5120"
18312></A 18419></A
18313><P 18420><P
18314><CODE 18421><CODE
@@ -18332,7 +18439,7 @@ CLASS="section"
18332><HR><H2 18439><HR><H2
18333CLASS="section" 18440CLASS="section"
18334><A 18441><A
18335NAME="AEN5092" 18442NAME="AEN5127"
18336>B.21. not_at_target</A 18443>B.21. not_at_target</A
18337></H2 18444></H2
18338><DIV 18445><DIV
@@ -18340,7 +18447,7 @@ CLASS="funcsynopsis"
18340><P 18447><P
18341></P 18448></P
18342><A 18449><A
18343NAME="AEN5094" 18450NAME="AEN5129"
18344></A 18451></A
18345><P 18452><P
18346><CODE 18453><CODE
@@ -18354,7 +18461,7 @@ CLASS="FUNCDEF"
18354></DIV 18461></DIV
18355><P 18462><P
18356>When a target is set via the <A 18463>When a target is set via the <A
18357HREF="#AEN4641" 18464HREF="#AEN4676"
18358>llTarget</A 18465>llTarget</A
18359> library call, but the 18466> library call, but the
18360 script is outside the specified range this event is raised.</P 18467 script is outside the specified range this event is raised.</P
@@ -18364,7 +18471,7 @@ CLASS="section"
18364><HR><H2 18471><HR><H2
18365CLASS="section" 18472CLASS="section"
18366><A 18473><A
18367NAME="AEN5101" 18474NAME="AEN5136"
18368>B.22. object_rez</A 18475>B.22. object_rez</A
18369></H2 18476></H2
18370><DIV 18477><DIV
@@ -18372,7 +18479,7 @@ CLASS="funcsynopsis"
18372><P 18479><P
18373></P 18480></P
18374><A 18481><A
18375NAME="AEN5103" 18482NAME="AEN5138"
18376></A 18483></A
18377><P 18484><P
18378><CODE 18485><CODE
@@ -18401,7 +18508,7 @@ CLASS="section"
18401><HR><H2 18508><HR><H2
18402CLASS="section" 18509CLASS="section"
18403><A 18510><A
18404NAME="AEN5112" 18511NAME="AEN5147"
18405>B.23. on_rez</A 18512>B.23. on_rez</A
18406></H2 18513></H2
18407><DIV 18514><DIV
@@ -18409,7 +18516,7 @@ CLASS="funcsynopsis"
18409><P 18516><P
18410></P 18517></P
18411><A 18518><A
18412NAME="AEN5114" 18519NAME="AEN5149"
18413></A 18520></A
18414><P 18521><P
18415><CODE 18522><CODE
@@ -18440,7 +18547,7 @@ CLASS="section"
18440><HR><H2 18547><HR><H2
18441CLASS="section" 18548CLASS="section"
18442><A 18549><A
18443NAME="AEN5124" 18550NAME="AEN5159"
18444>B.24. run_time_permissions</A 18551>B.24. run_time_permissions</A
18445></H2 18552></H2
18446><DIV 18553><DIV
@@ -18448,7 +18555,7 @@ CLASS="funcsynopsis"
18448><P 18555><P
18449></P 18556></P
18450><A 18557><A
18451NAME="AEN5126" 18558NAME="AEN5161"
18452></A 18559></A
18453><P 18560><P
18454><CODE 18561><CODE
@@ -18470,7 +18577,7 @@ HREF="#AEN3372"
18470> 18577>
18471 library function is used to request these permissions and the 18578 library function is used to request these permissions and the
18472 various <A 18579 various <A
18473HREF="#AEN5313" 18580HREF="#AEN5348"
18474>permissions integer 18581>permissions integer
18475 constants</A 18582 constants</A
18476> can be supplied. The integer returned to this 18583> can be supplied. The integer returned to this
@@ -18486,7 +18593,7 @@ CLASS="section"
18486><HR><H2 18593><HR><H2
18487CLASS="section" 18594CLASS="section"
18488><A 18595><A
18489NAME="AEN5136" 18596NAME="AEN5171"
18490>B.25. sensor</A 18597>B.25. sensor</A
18491></H2 18598></H2
18492><DIV 18599><DIV
@@ -18494,7 +18601,7 @@ CLASS="funcsynopsis"
18494><P 18601><P
18495></P 18602></P
18496><A 18603><A
18497NAME="AEN5138" 18604NAME="AEN5173"
18498></A 18605></A
18499><P 18606><P
18500><CODE 18607><CODE
@@ -18530,7 +18637,7 @@ CLASS="section"
18530><HR><H2 18637><HR><H2
18531CLASS="section" 18638CLASS="section"
18532><A 18639><A
18533NAME="AEN5148" 18640NAME="AEN5183"
18534>B.26. state_entry</A 18641>B.26. state_entry</A
18535></H2 18642></H2
18536><DIV 18643><DIV
@@ -18538,7 +18645,7 @@ CLASS="funcsynopsis"
18538><P 18645><P
18539></P 18646></P
18540><A 18647><A
18541NAME="AEN5150" 18648NAME="AEN5185"
18542></A 18649></A
18543><P 18650><P
18544><CODE 18651><CODE
@@ -18560,7 +18667,7 @@ CLASS="section"
18560><HR><H2 18667><HR><H2
18561CLASS="section" 18668CLASS="section"
18562><A 18669><A
18563NAME="AEN5156" 18670NAME="AEN5191"
18564>B.27. state_exit</A 18671>B.27. state_exit</A
18565></H2 18672></H2
18566><DIV 18673><DIV
@@ -18568,7 +18675,7 @@ CLASS="funcsynopsis"
18568><P 18675><P
18569></P 18676></P
18570><A 18677><A
18571NAME="AEN5158" 18678NAME="AEN5193"
18572></A 18679></A
18573><P 18680><P
18574><CODE 18681><CODE
@@ -18590,7 +18697,7 @@ CLASS="section"
18590><HR><H2 18697><HR><H2
18591CLASS="section" 18698CLASS="section"
18592><A 18699><A
18593NAME="AEN5164" 18700NAME="AEN5199"
18594>B.28. timer</A 18701>B.28. timer</A
18595></H2 18702></H2
18596><DIV 18703><DIV
@@ -18598,7 +18705,7 @@ CLASS="funcsynopsis"
18598><P 18705><P
18599></P 18706></P
18600><A 18707><A
18601NAME="AEN5166" 18708NAME="AEN5201"
18602></A 18709></A
18603><P 18710><P
18604><CODE 18711><CODE
@@ -18612,7 +18719,7 @@ CLASS="FUNCDEF"
18612></DIV 18719></DIV
18613><P 18720><P
18614>This event is raised at regular intervals set by the <A 18721>This event is raised at regular intervals set by the <A
18615HREF="#AEN4141" 18722HREF="#AEN4176"
18616>llSetTimerEvent</A 18723>llSetTimerEvent</A
18617> library 18724> library
18618 function.</P 18725 function.</P
@@ -18622,7 +18729,7 @@ CLASS="section"
18622><HR><H2 18729><HR><H2
18623CLASS="section" 18730CLASS="section"
18624><A 18731><A
18625NAME="AEN5173" 18732NAME="AEN5208"
18626>B.29. touch</A 18733>B.29. touch</A
18627></H2 18734></H2
18628><DIV 18735><DIV
@@ -18630,7 +18737,7 @@ CLASS="funcsynopsis"
18630><P 18737><P
18631></P 18738></P
18632><A 18739><A
18633NAME="AEN5175" 18740NAME="AEN5210"
18634></A 18741></A
18635><P 18742><P
18636><CODE 18743><CODE
@@ -18661,7 +18768,7 @@ CLASS="section"
18661><HR><H2 18768><HR><H2
18662CLASS="section" 18769CLASS="section"
18663><A 18770><A
18664NAME="AEN5184" 18771NAME="AEN5219"
18665>B.30. touch_end</A 18772>B.30. touch_end</A
18666></H2 18773></H2
18667><DIV 18774><DIV
@@ -18669,7 +18776,7 @@ CLASS="funcsynopsis"
18669><P 18776><P
18670></P 18777></P
18671><A 18778><A
18672NAME="AEN5186" 18779NAME="AEN5221"
18673></A 18780></A
18674><P 18781><P
18675><CODE 18782><CODE
@@ -18700,7 +18807,7 @@ CLASS="section"
18700><HR><H2 18807><HR><H2
18701CLASS="section" 18808CLASS="section"
18702><A 18809><A
18703NAME="AEN5195" 18810NAME="AEN5230"
18704>B.31. touch_start</A 18811>B.31. touch_start</A
18705></H2 18812></H2
18706><DIV 18813><DIV
@@ -18708,7 +18815,7 @@ CLASS="funcsynopsis"
18708><P 18815><P
18709></P 18816></P
18710><A 18817><A
18711NAME="AEN5197" 18818NAME="AEN5232"
18712></A 18819></A
18713><P 18820><P
18714><CODE 18821><CODE
@@ -18739,7 +18846,7 @@ CLASS="section"
18739><HR><H2 18846><HR><H2
18740CLASS="section" 18847CLASS="section"
18741><A 18848><A
18742NAME="AEN5206" 18849NAME="AEN5241"
18743>B.32. remote_data</A 18850>B.32. remote_data</A
18744></H2 18851></H2
18745><DIV 18852><DIV
@@ -18747,7 +18854,7 @@ CLASS="funcsynopsis"
18747><P 18854><P
18748></P 18855></P
18749><A 18856><A
18750NAME="AEN5208" 18857NAME="AEN5243"
18751></A 18858></A
18752><P 18859><P
18753><CODE 18860><CODE
@@ -18840,7 +18947,7 @@ CLASS="parameter"
18840CLASS="appendix" 18947CLASS="appendix"
18841><HR><H1 18948><HR><H1
18842><A 18949><A
18843NAME="AEN5245" 18950NAME="AEN5280"
18844></A 18951></A
18845>Appendix C. Constants</H1 18952>Appendix C. Constants</H1
18846><P 18953><P
@@ -18851,7 +18958,7 @@ CLASS="section"
18851><HR><H2 18958><HR><H2
18852CLASS="section" 18959CLASS="section"
18853><A 18960><A
18854NAME="AEN5248" 18961NAME="AEN5283"
18855>C.1. Boolean Constants</A 18962>C.1. Boolean Constants</A
18856></H2 18963></H2
18857><P 18964><P
@@ -18880,12 +18987,12 @@ CLASS="section"
18880><HR><H2 18987><HR><H2
18881CLASS="section" 18988CLASS="section"
18882><A 18989><A
18883NAME="AEN5257" 18990NAME="AEN5292"
18884>C.2. Status Constants</A 18991>C.2. Status Constants</A
18885></H2 18992></H2
18886><P 18993><P
18887>The status constants are used in the <A 18994>The status constants are used in the <A
18888HREF="#AEN4048" 18995HREF="#AEN4083"
18889>llSetStatus</A 18996>llSetStatus</A
18890> and <A 18997> and <A
18891HREF="#AEN2184" 18998HREF="#AEN2184"
@@ -18971,7 +19078,7 @@ CLASS="section"
18971><HR><H2 19078><HR><H2
18972CLASS="section" 19079CLASS="section"
18973><A 19080><A
18974NAME="AEN5291" 19081NAME="AEN5326"
18975>C.3. Object Type Constants</A 19082>C.3. Object Type Constants</A
18976></H2 19083></H2
18977><P 19084><P
@@ -19022,7 +19129,7 @@ CLASS="section"
19022><HR><H2 19129><HR><H2
19023CLASS="section" 19130CLASS="section"
19024><A 19131><A
19025NAME="AEN5313" 19132NAME="AEN5348"
19026>C.4. Permission Constants</A 19133>C.4. Permission Constants</A
19027></H2 19134></H2
19028><P 19135><P
@@ -19036,7 +19143,7 @@ HREF="#AEN2048"
19036>llGetPermissions</A 19143>llGetPermissions</A
19037>, and 19144>, and
19038 explicitly passed to the <A 19145 explicitly passed to the <A
19039HREF="#AEN5124" 19146HREF="#AEN5159"
19040>run_time_permissions</A 19147>run_time_permissions</A
19041> 19148>
19042 event. For many of the basic library functions to work, a 19149 event. For many of the basic library functions to work, a
@@ -19068,7 +19175,7 @@ HREF="#AEN2342"
19068><P 19175><P
19069>If this permission enabled, the object can 19176>If this permission enabled, the object can
19070 successfully call the <A 19177 successfully call the <A
19071HREF="#AEN4614" 19178HREF="#AEN4649"
19072>llTakeControls</A 19179>llTakeControls</A
19073> library 19180> library
19074 call.</P 19181 call.</P
@@ -19085,7 +19192,7 @@ HREF="#AEN4614"
19085><P 19192><P
19086>If this permission is enabled, the object can 19193>If this permission is enabled, the object can
19087 successfully call <A 19194 successfully call <A
19088HREF="#AEN4299" 19195HREF="#AEN4334"
19089>llStartAnimation</A 19196>llStartAnimation</A
19090> for the 19197> for the
19091 avatar that owns this object.</P 19198 avatar that owns this object.</P
@@ -19150,7 +19257,7 @@ CLASS="section"
19150><HR><H2 19257><HR><H2
19151CLASS="section" 19258CLASS="section"
19152><A 19259><A
19153NAME="AEN5364" 19260NAME="AEN5399"
19154>C.5. Inventory Constants</A 19261>C.5. Inventory Constants</A
19155></H2 19262></H2
19156><P 19263><P
@@ -19192,7 +19299,7 @@ CLASS="section"
19192><HR><H2 19299><HR><H2
19193CLASS="section" 19300CLASS="section"
19194><A 19301><A
19195NAME="AEN5387" 19302NAME="AEN5422"
19196>C.6. Pay Price Constants</A 19303>C.6. Pay Price Constants</A
19197></H2 19304></H2
19198><P 19305><P
@@ -19229,7 +19336,7 @@ CLASS="section"
19229><HR><H2 19336><HR><H2
19230CLASS="section" 19337CLASS="section"
19231><A 19338><A
19232NAME="AEN5401" 19339NAME="AEN5436"
19233>C.7. Attachment Constants</A 19340>C.7. Attachment Constants</A
19234></H2 19341></H2
19235><P 19342><P
@@ -19435,7 +19542,7 @@ CLASS="section"
19435><HR><H2 19542><HR><H2
19436CLASS="section" 19543CLASS="section"
19437><A 19544><A
19438NAME="AEN5527" 19545NAME="AEN5562"
19439>C.8. Land Constants</A 19546>C.8. Land Constants</A
19440></H2 19547></H2
19441><P 19548><P
@@ -19518,7 +19625,7 @@ CLASS="section"
19518><HR><H2 19625><HR><H2
19519CLASS="section" 19626CLASS="section"
19520><A 19627><A
19521NAME="AEN5569" 19628NAME="AEN5604"
19522>C.9. Link Constants</A 19629>C.9. Link Constants</A
19523></H2 19630></H2
19524><P 19631><P
@@ -19581,16 +19688,16 @@ CLASS="section"
19581><HR><H2 19688><HR><H2
19582CLASS="section" 19689CLASS="section"
19583><A 19690><A
19584NAME="AEN5596" 19691NAME="AEN5631"
19585>C.10. Control Constants</A 19692>C.10. Control Constants</A
19586></H2 19693></H2
19587><P 19694><P
19588>These constants are used in <A 19695>These constants are used in <A
19589HREF="#AEN4614" 19696HREF="#AEN4649"
19590>llTakeControls</A 19697>llTakeControls</A
19591> as well as the 19698> as well as the
19592 <A 19699 <A
19593HREF="#AEN4934" 19700HREF="#AEN4969"
19594>control</A 19701>control</A
19595> event handler.</P 19702> event handler.</P
19596><P 19703><P
@@ -19680,12 +19787,12 @@ CLASS="section"
19680><HR><H2 19787><HR><H2
19681CLASS="section" 19788CLASS="section"
19682><A 19789><A
19683NAME="AEN5643" 19790NAME="AEN5678"
19684>C.11. Change Constants</A 19791>C.11. Change Constants</A
19685></H2 19792></H2
19686><P 19793><P
19687>These constants are used in the <A 19794>These constants are used in the <A
19688HREF="#AEN4893" 19795HREF="#AEN4928"
19689>changed</A 19796>changed</A
19690> event handler.</P 19797> event handler.</P
19691><P 19798><P
@@ -19767,7 +19874,7 @@ CLASS="section"
19767><HR><H2 19874><HR><H2
19768CLASS="section" 19875CLASS="section"
19769><A 19876><A
19770NAME="AEN5686" 19877NAME="AEN5721"
19771>C.12. Type Constants</A 19878>C.12. Type Constants</A
19772></H2 19879></H2
19773><P 19880><P
@@ -19836,7 +19943,7 @@ CLASS="section"
19836><HR><H2 19943><HR><H2
19837CLASS="section" 19944CLASS="section"
19838><A 19945><A
19839NAME="AEN5720" 19946NAME="AEN5755"
19840>C.13. Agent Info Constants</A 19947>C.13. Agent Info Constants</A
19841></H2 19948></H2
19842><P 19949><P
@@ -19930,13 +20037,13 @@ CLASS="section"
19930><HR><H2 20037><HR><H2
19931CLASS="section" 20038CLASS="section"
19932><A 20039><A
19933NAME="AEN5770" 20040NAME="AEN5805"
19934>C.14. Texture Animation 20041>C.14. Texture Animation
19935 Constants</A 20042 Constants</A
19936></H2 20043></H2
19937><P 20044><P
19938>These constants are used in the <A 20045>These constants are used in the <A
19939HREF="#AEN4093" 20046HREF="#AEN4128"
19940>llSetTextureAnim</A 20047>llSetTextureAnim</A
19941> api to 20048> api to
19942 control the animation mode.</P 20049 control the animation mode.</P
@@ -20001,7 +20108,7 @@ CLASS="section"
20001><HR><H2 20108><HR><H2
20002CLASS="section" 20109CLASS="section"
20003><A 20110><A
20004NAME="AEN5804" 20111NAME="AEN5839"
20005>C.15. Particle System Constants</A 20112>C.15. Particle System Constants</A
20006></H2 20113></H2
20007><P 20114><P
@@ -20314,7 +20421,7 @@ CLASS="section"
20314><HR><H2 20421><HR><H2
20315CLASS="section" 20422CLASS="section"
20316><A 20423><A
20317NAME="AEN5958" 20424NAME="AEN5993"
20318>C.16. Agent Data Constants</A 20425>C.16. Agent Data Constants</A
20319></H2 20426></H2
20320><P 20427><P
@@ -20324,7 +20431,7 @@ HREF="#AEN3343"
20324> api to 20431> api to
20325 collect information about an agent which will be provided in the 20432 collect information about an agent which will be provided in the
20326 <A 20433 <A
20327HREF="#AEN4950" 20434HREF="#AEN4985"
20328>dataserver event</A 20435>dataserver event</A
20329>.</P 20436>.</P
20330><P 20437><P
@@ -20402,7 +20509,7 @@ CLASS="section"
20402><HR><H2 20509><HR><H2
20403CLASS="section" 20510CLASS="section"
20404><A 20511><A
20405NAME="AEN5994" 20512NAME="AEN6029"
20406>C.17. Float Constants</A 20513>C.17. Float Constants</A
20407></H2 20514></H2
20408><P 20515><P
@@ -20471,7 +20578,7 @@ CLASS="section"
20471><HR><H2 20578><HR><H2
20472CLASS="section" 20579CLASS="section"
20473><A 20580><A
20474NAME="AEN6023" 20581NAME="AEN6058"
20475>C.18. Key Constant</A 20582>C.18. Key Constant</A
20476></H2 20583></H2
20477><P 20584><P
@@ -20483,7 +20590,7 @@ CLASS="section"
20483><HR><H2 20590><HR><H2
20484CLASS="section" 20591CLASS="section"
20485><A 20592><A
20486NAME="AEN6026" 20593NAME="AEN6061"
20487>C.19. Miscellaneous Integer Constants</A 20594>C.19. Miscellaneous Integer Constants</A
20488></H2 20595></H2
20489><P 20596><P
@@ -20495,14 +20602,14 @@ CLASS="section"
20495><HR><H2 20602><HR><H2
20496CLASS="section" 20603CLASS="section"
20497><A 20604><A
20498NAME="AEN6029" 20605NAME="AEN6064"
20499>C.20. Miscellaneous String 20606>C.20. Miscellaneous String
20500 Constants</A 20607 Constants</A
20501></H2 20608></H2
20502><P 20609><P
20503>There is one uncategorized string constant 20610>There is one uncategorized string constant
20504 which is used in the <A 20611 which is used in the <A
20505HREF="#AEN4950" 20612HREF="#AEN4985"
20506>dataserver</A 20613>dataserver</A
20507> event: 20614> event:
20508 EOF</P 20615 EOF</P
@@ -20512,7 +20619,7 @@ CLASS="section"
20512><HR><H2 20619><HR><H2
20513CLASS="section" 20620CLASS="section"
20514><A 20621><A
20515NAME="AEN6033" 20622NAME="AEN6068"
20516>C.21. Vector Constant</A 20623>C.21. Vector Constant</A
20517></H2 20624></H2
20518><P 20625><P
@@ -20524,7 +20631,7 @@ CLASS="section"
20524><HR><H2 20631><HR><H2
20525CLASS="section" 20632CLASS="section"
20526><A 20633><A
20527NAME="AEN6036" 20634NAME="AEN6071"
20528>C.22. Rotation Constant</A 20635>C.22. Rotation Constant</A
20529></H2 20636></H2
20530><P 20637><P
@@ -20536,7 +20643,7 @@ CLASS="section"
20536><HR><H2 20643><HR><H2
20537CLASS="section" 20644CLASS="section"
20538><A 20645><A
20539NAME="AEN6039" 20646NAME="AEN6074"
20540>C.23. Simulator Data Constants</A 20647>C.23. Simulator Data Constants</A
20541></H2 20648></H2
20542><P 20649><P
@@ -20546,7 +20653,7 @@ HREF="#AEN3388"
20546> api to 20653> api to
20547 collect information about a simulator which will be provided in the 20654 collect information about a simulator which will be provided in the
20548 <A 20655 <A
20549HREF="#AEN4950" 20656HREF="#AEN4985"
20550>dataserver event</A 20657>dataserver event</A
20551>.</P 20658>.</P
20552><P 20659><P
@@ -20610,7 +20717,7 @@ CLASS="section"
20610><HR><H2 20717><HR><H2
20611CLASS="section" 20718CLASS="section"
20612><A 20719><A
20613NAME="AEN6065" 20720NAME="AEN6100"
20614>C.24. Vehicle Parameters</A 20721>C.24. Vehicle Parameters</A
20615></H2 20722></H2
20616><P 20723><P
@@ -20892,7 +20999,7 @@ CLASS="section"
20892><HR><H2 20999><HR><H2
20893CLASS="section" 21000CLASS="section"
20894><A 21001><A
20895NAME="AEN6184" 21002NAME="AEN6219"
20896>C.25. Vehicle Flags</A 21003>C.25. Vehicle Flags</A
20897></H2 21004></H2
20898><P 21005><P
@@ -21073,7 +21180,7 @@ CLASS="section"
21073><HR><H2 21180><HR><H2
21074CLASS="section" 21181CLASS="section"
21075><A 21182><A
21076NAME="AEN6241" 21183NAME="AEN6276"
21077>C.26. Vehicle Types</A 21184>C.26. Vehicle Types</A
21078></H2 21185></H2
21079><P 21186><P
@@ -21096,7 +21203,7 @@ CLASS="informalexample"
21096><P 21203><P
21097></P 21204></P
21098><A 21205><A
21099NAME="AEN6249" 21206NAME="AEN6284"
21100></A 21207></A
21101><PRE 21208><PRE
21102CLASS="programlisting" 21209CLASS="programlisting"
@@ -21164,7 +21271,7 @@ llSetVehicleFlags( VEHICLE_FLAG_NO_DEFLECTION_UP
21164><P 21271><P
21165>Another vehicle that bounces along the ground but 21272>Another vehicle that bounces along the ground but
21166 needs the motors to be driven from external controls or <A 21273 needs the motors to be driven from external controls or <A
21167HREF="#AEN5164" 21274HREF="#AEN5199"
21168>timer</A 21275>timer</A
21169> events.</P 21276> events.</P
21170><DIV 21277><DIV
@@ -21172,7 +21279,7 @@ CLASS="informalexample"
21172><P 21279><P
21173></P 21280></P
21174><A 21281><A
21175NAME="AEN6256" 21282NAME="AEN6291"
21176></A 21283></A
21177><PRE 21284><PRE
21178CLASS="programlisting" 21285CLASS="programlisting"
@@ -21243,7 +21350,7 @@ CLASS="informalexample"
21243><P 21350><P
21244></P 21351></P
21245><A 21352><A
21246NAME="AEN6262" 21353NAME="AEN6297"
21247></A 21354></A
21248><PRE 21355><PRE
21249CLASS="programlisting" 21356CLASS="programlisting"
@@ -21314,7 +21421,7 @@ CLASS="informalexample"
21314><P 21421><P
21315></P 21422></P
21316><A 21423><A
21317NAME="AEN6268" 21424NAME="AEN6303"
21318></A 21425></A
21319><PRE 21426><PRE
21320CLASS="programlisting" 21427CLASS="programlisting"
@@ -21385,7 +21492,7 @@ CLASS="informalexample"
21385><P 21492><P
21386></P 21493></P
21387><A 21494><A
21388NAME="AEN6274" 21495NAME="AEN6309"
21389></A 21496></A
21390><PRE 21497><PRE
21391CLASS="programlisting" 21498CLASS="programlisting"
@@ -21452,12 +21559,12 @@ CLASS="section"
21452><HR><H2 21559><HR><H2
21453CLASS="section" 21560CLASS="section"
21454><A 21561><A
21455NAME="AEN6276" 21562NAME="AEN6311"
21456>C.27. Primitive Constants</A 21563>C.27. Primitive Constants</A
21457></H2 21564></H2
21458><P 21565><P
21459>These constants are used in calls to the <A 21566>These constants are used in calls to the <A
21460HREF="#AEN3973" 21567HREF="#AEN4008"
21461>llSetPrimitiveParams</A 21568>llSetPrimitiveParams</A
21462> and <A 21569> and <A
21463HREF="#AEN2075" 21570HREF="#AEN2075"
@@ -21608,7 +21715,7 @@ CLASS="section"
21608><HR><H2 21715><HR><H2
21609CLASS="section" 21716CLASS="section"
21610><A 21717><A
21611NAME="AEN6358" 21718NAME="AEN6393"
21612>C.28. XML-RPC Constants</A 21719>C.28. XML-RPC Constants</A
21613></H2 21720></H2
21614><P 21721><P
@@ -21619,7 +21726,7 @@ CLASS="section"
21619><HR><H2 21726><HR><H2
21620CLASS="section" 21727CLASS="section"
21621><A 21728><A
21622NAME="AEN6361" 21729NAME="AEN6396"
21623>C.29. Permission Mask Constants</A 21730>C.29. Permission Mask Constants</A
21624></H2 21731></H2
21625><P 21732><P
@@ -21707,7 +21814,7 @@ CLASS="section"
21707><HR><H2 21814><HR><H2
21708CLASS="section" 21815CLASS="section"
21709><A 21816><A
21710NAME="AEN6408" 21817NAME="AEN6443"
21711>C.30. Parcel Media Constants (Movies)</A 21818>C.30. Parcel Media Constants (Movies)</A
21712></H2 21819></H2
21713><P 21820><P
diff --git a/linden/indra/newview/macview.xcodeproj/project.pbxproj b/linden/indra/newview/macview.xcodeproj/project.pbxproj
index 7974bc1..1665528 100644
--- a/linden/indra/newview/macview.xcodeproj/project.pbxproj
+++ b/linden/indra/newview/macview.xcodeproj/project.pbxproj
@@ -23,6 +23,10 @@
23/* Begin PBXBuildFile section */ 23/* Begin PBXBuildFile section */
24 0633E5D209E341F500712406 /* llfile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0633E5D009E341F500712406 /* llfile.cpp */; }; 24 0633E5D209E341F500712406 /* llfile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0633E5D009E341F500712406 /* llfile.cpp */; };
25 0633E5D509E3421500712406 /* llstreamtools.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0633E5D309E3421500712406 /* llstreamtools.cpp */; }; 25 0633E5D509E3421500712406 /* llstreamtools.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0633E5D309E3421500712406 /* llstreamtools.cpp */; };
26 1A02016F0B7A85DE00D5C589 /* llbase64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A02016D0B7A85DE00D5C589 /* llbase64.cpp */; };
27 1A0201850B7A861200D5C589 /* llblowfishcipher.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A02017E0B7A861200D5C589 /* llblowfishcipher.cpp */; };
28 1A0201860B7A861200D5C589 /* llnullcipher.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0201810B7A861200D5C589 /* llnullcipher.cpp */; };
29 1A0201870B7A861200D5C589 /* llxorcipher.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0201830B7A861200D5C589 /* llxorcipher.cpp */; };
26 1A1C61620847AEE6005D7227 /* llvolumemgr.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A1C615E0847AEE6005D7227 /* llvolumemgr.cpp */; }; 30 1A1C61620847AEE6005D7227 /* llvolumemgr.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A1C615E0847AEE6005D7227 /* llvolumemgr.cpp */; };
27 1A1C61630847AEE6005D7227 /* llvolume.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A1C615F0847AEE6005D7227 /* llvolume.cpp */; }; 31 1A1C61630847AEE6005D7227 /* llvolume.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A1C615F0847AEE6005D7227 /* llvolume.cpp */; };
28 1A1C61760847B307005D7227 /* llvolumemessage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A1C61740847B307005D7227 /* llvolumemessage.cpp */; }; 32 1A1C61760847B307005D7227 /* llvolumemessage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A1C61740847B307005D7227 /* llvolumemessage.cpp */; };
@@ -39,6 +43,8 @@
39 1A89230808B12D2E00A04AA9 /* llfloateropenobject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A89230608B12D2E00A04AA9 /* llfloateropenobject.cpp */; }; 43 1A89230808B12D2E00A04AA9 /* llfloateropenobject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A89230608B12D2E00A04AA9 /* llfloateropenobject.cpp */; };
40 1A89230A08B12D9900A04AA9 /* llmediabase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A89230908B12D9800A04AA9 /* llmediabase.cpp */; }; 44 1A89230A08B12D9900A04AA9 /* llmediabase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A89230908B12D9800A04AA9 /* llmediabase.cpp */; };
41 1A89231108B12DDE00A04AA9 /* llmediamoviebase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A89230F08B12DDE00A04AA9 /* llmediamoviebase.cpp */; }; 45 1A89231108B12DDE00A04AA9 /* llmediamoviebase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A89230F08B12DDE00A04AA9 /* llmediamoviebase.cpp */; };
46 1A97C4560B8BCF9C00331A24 /* llliveappconfig.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A97C4540B8BCF9C00331A24 /* llliveappconfig.cpp */; };
47 1A9897E90B98E2F4005C45D7 /* llbase32.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A9897E80B98E2F4005C45D7 /* llbase32.cpp */; };
42 1A9EC237083EA0100023D510 /* llfloatereditui.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A9EC236083EA0100023D510 /* llfloatereditui.cpp */; }; 48 1A9EC237083EA0100023D510 /* llfloatereditui.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A9EC236083EA0100023D510 /* llfloatereditui.cpp */; };
43 1AD61F6B0AC09B1900507FB9 /* llimview.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AD61F6A0AC09B1900507FB9 /* llimview.cpp */; }; 49 1AD61F6B0AC09B1900507FB9 /* llimview.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AD61F6A0AC09B1900507FB9 /* llimview.cpp */; };
44 1AE5D7120844FBD300278605 /* llwebbrowserctrl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AE5D7100844FBD300278605 /* llwebbrowserctrl.cpp */; }; 50 1AE5D7120844FBD300278605 /* llwebbrowserctrl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AE5D7100844FBD300278605 /* llwebbrowserctrl.cpp */; };
@@ -84,13 +90,11 @@
84 5503BB3F05446B20003D051F /* llwaterpatch.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26F529C5051F61DF00A80050 /* llwaterpatch.cpp */; }; 90 5503BB3F05446B20003D051F /* llwaterpatch.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26F529C5051F61DF00A80050 /* llwaterpatch.cpp */; };
85 5503BB4005446B20003D051F /* llvowater.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26F529C6051F61DF00A80050 /* llvowater.cpp */; }; 91 5503BB4005446B20003D051F /* llvowater.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26F529C6051F61DF00A80050 /* llvowater.cpp */; };
86 5503BB4105446B20003D051F /* llvovolume.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26F529C7051F61DF00A80050 /* llvovolume.cpp */; }; 92 5503BB4105446B20003D051F /* llvovolume.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26F529C7051F61DF00A80050 /* llvovolume.cpp */; };
87 5503BB4205446B20003D051F /* llvotreenew.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26F529C8051F61DF00A80050 /* llvotreenew.cpp */; };
88 5503BB4305446B20003D051F /* llvotree.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26F529C9051F61DF00A80050 /* llvotree.cpp */; }; 93 5503BB4305446B20003D051F /* llvotree.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26F529C9051F61DF00A80050 /* llvotree.cpp */; };
89 5503BB4405446B20003D051F /* llvotextbubble.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26F529CA051F61DF00A80050 /* llvotextbubble.cpp */; }; 94 5503BB4405446B20003D051F /* llvotextbubble.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26F529CA051F61DF00A80050 /* llvotextbubble.cpp */; };
90 5503BB4505446B20003D051F /* llvosurfacepatch.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26F529CB051F61DF00A80050 /* llvosurfacepatch.cpp */; }; 95 5503BB4505446B20003D051F /* llvosurfacepatch.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26F529CB051F61DF00A80050 /* llvosurfacepatch.cpp */; };
91 5503BB4605446B20003D051F /* llvosky.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26F529CC051F61DF00A80050 /* llvosky.cpp */; }; 96 5503BB4605446B20003D051F /* llvosky.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26F529CC051F61DF00A80050 /* llvosky.cpp */; };
92 5503BB4705446B20003D051F /* llvopartgroup.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26F529CD051F61DF00A80050 /* llvopartgroup.cpp */; }; 97 5503BB4705446B20003D051F /* llvopartgroup.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26F529CD051F61DF00A80050 /* llvopartgroup.cpp */; };
93 5503BB4805446B20003D051F /* llvopart.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26F529CE051F61DF00A80050 /* llvopart.cpp */; };
94 5503BB4905446B20003D051F /* llvoground.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26F529CF051F61DF00A80050 /* llvoground.cpp */; }; 98 5503BB4905446B20003D051F /* llvoground.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26F529CF051F61DF00A80050 /* llvoground.cpp */; };
95 5503BB4A05446B20003D051F /* llvograss.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26F529D0051F61DF00A80050 /* llvograss.cpp */; }; 99 5503BB4A05446B20003D051F /* llvograss.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26F529D0051F61DF00A80050 /* llvograss.cpp */; };
96 5503BB4B05446B20003D051F /* llvoclouds.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26F529D1051F61DF00A80050 /* llvoclouds.cpp */; }; 100 5503BB4B05446B20003D051F /* llvoclouds.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26F529D1051F61DF00A80050 /* llvoclouds.cpp */; };
@@ -137,7 +141,6 @@
137 5503BB7D05446B20003D051F /* llconsole.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26F52A03051F61DF00A80050 /* llconsole.cpp */; }; 141 5503BB7D05446B20003D051F /* llconsole.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26F52A03051F61DF00A80050 /* llconsole.cpp */; };
138 5503BB7E05446B20003D051F /* lllandmarklist.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26F52A04051F61DF00A80050 /* lllandmarklist.cpp */; }; 142 5503BB7E05446B20003D051F /* lllandmarklist.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26F52A04051F61DF00A80050 /* lllandmarklist.cpp */; };
139 5503BB7F05446B20003D051F /* llfloaterbuildoptions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26F52A05051F61DF00A80050 /* llfloaterbuildoptions.cpp */; }; 143 5503BB7F05446B20003D051F /* llfloaterbuildoptions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26F52A05051F61DF00A80050 /* llfloaterbuildoptions.cpp */; };
140 5503BB8105446B20003D051F /* llfloateraccounthistory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26F52A07051F61DF00A80050 /* llfloateraccounthistory.cpp */; };
141 5503BB8605446B20003D051F /* lluserauth.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26F52A0C051F61DF00A80050 /* lluserauth.cpp */; }; 144 5503BB8605446B20003D051F /* lluserauth.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26F52A0C051F61DF00A80050 /* lluserauth.cpp */; };
142 5503BB8705446B20003D051F /* llurl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26F52A0D051F61DF00A80050 /* llurl.cpp */; }; 145 5503BB8705446B20003D051F /* llurl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26F52A0D051F61DF00A80050 /* llurl.cpp */; };
143 5503BB8805446B20003D051F /* lluploaddialog.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26F52A0E051F61DF00A80050 /* lluploaddialog.cpp */; }; 146 5503BB8805446B20003D051F /* lluploaddialog.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26F52A0E051F61DF00A80050 /* lluploaddialog.cpp */; };
@@ -158,7 +161,6 @@
158 5503BBA005446B20003D051F /* lldrawpoolalpha.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26F52A26051F61DF00A80050 /* lldrawpoolalpha.cpp */; }; 161 5503BBA005446B20003D051F /* lldrawpoolalpha.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26F52A26051F61DF00A80050 /* lldrawpoolalpha.cpp */; };
159 5503BBA105446B20003D051F /* lltexturetable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26F52A27051F61DF00A80050 /* lltexturetable.cpp */; }; 162 5503BBA105446B20003D051F /* lltexturetable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26F52A27051F61DF00A80050 /* lltexturetable.cpp */; };
160 5503BBA205446B20003D051F /* lltexturectrl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26F52A28051F61DF00A80050 /* lltexturectrl.cpp */; }; 163 5503BBA205446B20003D051F /* lltexturectrl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26F52A28051F61DF00A80050 /* lltexturectrl.cpp */; };
161 5503BBA305446B20003D051F /* lltexturebar.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26F52A29051F61DF00A80050 /* lltexturebar.cpp */; };
162 5503BBA405446B20003D051F /* llpanelobject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26F52A2A051F61DF00A80050 /* llpanelobject.cpp */; }; 164 5503BBA405446B20003D051F /* llpanelobject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26F52A2A051F61DF00A80050 /* llpanelobject.cpp */; };
163 5503BBA505446B20003D051F /* llpanelnetwork.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26F52A2B051F61DF00A80050 /* llpanelnetwork.cpp */; }; 165 5503BBA505446B20003D051F /* llpanelnetwork.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26F52A2B051F61DF00A80050 /* llpanelnetwork.cpp */; };
164 5503BBA605446B20003D051F /* lldrawpool.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26F52A2C051F61DF00A80050 /* lldrawpool.cpp */; }; 166 5503BBA605446B20003D051F /* lldrawpool.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26F52A2C051F61DF00A80050 /* lldrawpool.cpp */; };
@@ -224,7 +226,6 @@
224 5503BBFD05446B20003D051F /* llhoverview.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26F52A85051F61DF00A80050 /* llhoverview.cpp */; }; 226 5503BBFD05446B20003D051F /* llhoverview.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26F52A85051F61DF00A80050 /* llhoverview.cpp */; };
225 5503BBFE05446B20003D051F /* llcylinder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26F52A86051F61DF00A80050 /* llcylinder.cpp */; }; 227 5503BBFE05446B20003D051F /* llcylinder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26F52A86051F61DF00A80050 /* llcylinder.cpp */; };
226 5503BBFF05446B20003D051F /* llhippo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26F52A87051F61DF00A80050 /* llhippo.cpp */; }; 228 5503BBFF05446B20003D051F /* llhippo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26F52A87051F61DF00A80050 /* llhippo.cpp */; };
227 5503BC0105446B20003D051F /* llpanelmoney.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26F52A89051F61DF00A80050 /* llpanelmoney.cpp */; };
228 5503BC0305446B20003D051F /* llfloateravatarinfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26F52A8B051F61DF00A80050 /* llfloateravatarinfo.cpp */; }; 229 5503BC0305446B20003D051F /* llfloateravatarinfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26F52A8B051F61DF00A80050 /* llfloateravatarinfo.cpp */; };
229 5503BC0405446B20003D051F /* llcallingcard.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26F52A8C051F61DF00A80050 /* llcallingcard.cpp */; }; 230 5503BC0405446B20003D051F /* llcallingcard.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26F52A8C051F61DF00A80050 /* llcallingcard.cpp */; };
230 5503BC0505446B20003D051F /* llhudeffectbeam.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26F52A8D051F61DF00A80050 /* llhudeffectbeam.cpp */; }; 231 5503BC0505446B20003D051F /* llhudeffectbeam.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26F52A8D051F61DF00A80050 /* llhudeffectbeam.cpp */; };
@@ -239,7 +240,6 @@
239 5503BC1005446B20003D051F /* llnamelistctrl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26F52A98051F61DF00A80050 /* llnamelistctrl.cpp */; }; 240 5503BC1005446B20003D051F /* llnamelistctrl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26F52A98051F61DF00A80050 /* llnamelistctrl.cpp */; };
240 5503BC1205446B20003D051F /* llmaniptranslate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26F52A9A051F61DF00A80050 /* llmaniptranslate.cpp */; }; 241 5503BC1205446B20003D051F /* llmaniptranslate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26F52A9A051F61DF00A80050 /* llmaniptranslate.cpp */; };
241 5503BC1305446B20003D051F /* llmanipscale.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26F52A9B051F61DF00A80050 /* llmanipscale.cpp */; }; 242 5503BC1305446B20003D051F /* llmanipscale.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26F52A9B051F61DF00A80050 /* llmanipscale.cpp */; };
242 5503BC1405446B20003D051F /* lldrawpooltreenew.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26F52A9C051F61DF00A80050 /* lldrawpooltreenew.cpp */; };
243 5503BC1505446B20003D051F /* head.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26F52A9D051F61DF00A80050 /* head.cpp */; }; 243 5503BC1505446B20003D051F /* head.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26F52A9D051F61DF00A80050 /* head.cpp */; };
244 5503BC1705446B20003D051F /* llfloaternamedesc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26F52A9F051F61DF00A80050 /* llfloaternamedesc.cpp */; }; 244 5503BC1705446B20003D051F /* llfloaternamedesc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26F52A9F051F61DF00A80050 /* llfloaternamedesc.cpp */; };
245 5503BC1805446B20003D051F /* llpanelplace.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26F52AA0051F61DF00A80050 /* llpanelplace.cpp */; }; 245 5503BC1805446B20003D051F /* llpanelplace.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26F52AA0051F61DF00A80050 /* llpanelplace.cpp */; };
@@ -303,8 +303,6 @@
303 619222E8074A9B5B005E1F34 /* bitpack.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6192211F074A9B57005E1F34 /* bitpack.cpp */; }; 303 619222E8074A9B5B005E1F34 /* bitpack.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6192211F074A9B57005E1F34 /* bitpack.cpp */; };
304 619222F0074A9B5B005E1F34 /* llcriticaldamp.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 61922127074A9B57005E1F34 /* llcriticaldamp.cpp */; }; 304 619222F0074A9B5B005E1F34 /* llcriticaldamp.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 61922127074A9B57005E1F34 /* llcriticaldamp.cpp */; };
305 619222F8074A9B5B005E1F34 /* llerror.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6192212F074A9B57005E1F34 /* llerror.cpp */; }; 305 619222F8074A9B5B005E1F34 /* llerror.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6192212F074A9B57005E1F34 /* llerror.cpp */; };
306 619222FA074A9B5B005E1F34 /* llerrorbuffer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 61922131074A9B57005E1F34 /* llerrorbuffer.cpp */; };
307 619222FC074A9B5B005E1F34 /* llerrorstream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 61922133074A9B57005E1F34 /* llerrorstream.cpp */; };
308 619222FE074A9B5B005E1F34 /* llfasttimer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 61922135074A9B57005E1F34 /* llfasttimer.cpp */; }; 306 619222FE074A9B5B005E1F34 /* llfasttimer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 61922135074A9B57005E1F34 /* llfasttimer.cpp */; };
309 61922300074A9B5B005E1F34 /* llfixedbuffer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 61922137074A9B57005E1F34 /* llfixedbuffer.cpp */; }; 307 61922300074A9B5B005E1F34 /* llfixedbuffer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 61922137074A9B57005E1F34 /* llfixedbuffer.cpp */; };
310 61922302074A9B5B005E1F34 /* llframetimer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 61922139074A9B57005E1F34 /* llframetimer.cpp */; }; 308 61922302074A9B5B005E1F34 /* llframetimer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 61922139074A9B57005E1F34 /* llframetimer.cpp */; };
@@ -501,7 +499,6 @@
501 9967E9B30B375D9D0087BD1B /* libfmod.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FDE8765009BEA39600AF6316 /* libfmod.a */; }; 499 9967E9B30B375D9D0087BD1B /* libfmod.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FDE8765009BEA39600AF6316 /* libfmod.a */; };
502 9985A1280AC1FE4E00579AFB /* AppKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9985A1270AC1FE4E00579AFB /* AppKit.framework */; }; 500 9985A1280AC1FE4E00579AFB /* AppKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9985A1270AC1FE4E00579AFB /* AppKit.framework */; };
503 99AAD74F09DC8B9D0036C309 /* lllfsthread.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 99AAD74E09DC8B9D0036C309 /* lllfsthread.cpp */; }; 501 99AAD74F09DC8B9D0036C309 /* lllfsthread.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 99AAD74E09DC8B9D0036C309 /* lllfsthread.cpp */; };
504 99B0682909A54FBB00F4AD09 /* lldrawpoolhud.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 99B0682709A54FBB00F4AD09 /* lldrawpoolhud.cpp */; };
505 99BB5168099ABDEB004BF9F2 /* llfloaterbuyland.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 99BB5166099ABDEB004BF9F2 /* llfloaterbuyland.cpp */; }; 502 99BB5168099ABDEB004BF9F2 /* llfloaterbuyland.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 99BB5166099ABDEB004BF9F2 /* llfloaterbuyland.cpp */; };
506 99BB516B099AC1AE004BF9F2 /* llxmlrpctransaction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 99BB516A099AC1AE004BF9F2 /* llxmlrpctransaction.cpp */; }; 503 99BB516B099AC1AE004BF9F2 /* llxmlrpctransaction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 99BB516A099AC1AE004BF9F2 /* llxmlrpctransaction.cpp */; };
507 99BB516F099AC1E9004BF9F2 /* llviewchildren.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 99BB516D099AC1E9004BF9F2 /* llviewchildren.cpp */; }; 504 99BB516F099AC1E9004BF9F2 /* llviewchildren.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 99BB516D099AC1E9004BF9F2 /* llviewchildren.cpp */; };
@@ -536,35 +533,35 @@
536 A241CB9007B3E383001A39E3 /* lllogtextmessage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A241CB8C07B3E383001A39E3 /* lllogtextmessage.cpp */; }; 533 A241CB9007B3E383001A39E3 /* lllogtextmessage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A241CB8C07B3E383001A39E3 /* lllogtextmessage.cpp */; };
537 A241CB9207B3E383001A39E3 /* llmessagethrottle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A241CB8E07B3E383001A39E3 /* llmessagethrottle.cpp */; }; 534 A241CB9207B3E383001A39E3 /* llmessagethrottle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A241CB8E07B3E383001A39E3 /* llmessagethrottle.cpp */; };
538 A241CB9507B3E3A7001A39E3 /* llperlin.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A241CB9407B3E3A7001A39E3 /* llperlin.cpp */; }; 535 A241CB9507B3E3A7001A39E3 /* llperlin.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A241CB9407B3E3A7001A39E3 /* llperlin.cpp */; };
536 A30273570B3A13D800704420 /* llvertexbuffer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A30273550B3A13D800704420 /* llvertexbuffer.cpp */; };
539 A3077C0709DCB8140059ED75 /* lldrawpoolstars.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A3077BFB09DCB8140059ED75 /* lldrawpoolstars.cpp */; }; 537 A3077C0709DCB8140059ED75 /* lldrawpoolstars.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A3077BFB09DCB8140059ED75 /* lldrawpoolstars.cpp */; };
540 A3077C0909DCB8140059ED75 /* llfloaterhtmlhelp.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A3077BFF09DCB8140059ED75 /* llfloaterhtmlhelp.cpp */; }; 538 A3077C0909DCB8140059ED75 /* llfloaterhtmlhelp.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A3077BFF09DCB8140059ED75 /* llfloaterhtmlhelp.cpp */; };
541 A3077C0B09DCB8140059ED75 /* llpanelvolume.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A3077C0309DCB8140059ED75 /* llpanelvolume.cpp */; }; 539 A3077C0B09DCB8140059ED75 /* llpanelvolume.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A3077C0309DCB8140059ED75 /* llpanelvolume.cpp */; };
542 A3077C0C09DCB8140059ED75 /* llvostars.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A3077C0509DCB8140059ED75 /* llvostars.cpp */; }; 540 A3077C0C09DCB8140059ED75 /* llvostars.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A3077C0509DCB8140059ED75 /* llvostars.cpp */; };
541 A32748BF0B5F38A00099BE18 /* llfontgl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D628315D0B4F3FA100F8830F /* llfontgl.cpp */; };
542 A32748C00B5F38A20099BE18 /* llimagegl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D62831610B4F3FA200F8830F /* llimagegl.cpp */; };
543 A32748C10B5F38A80099BE18 /* llfont.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D628315B0B4F3FA100F8830F /* llfont.cpp */; };
544 A3274AD20B5F39130099BE18 /* text_out.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D62831670B4F3FA200F8830F /* text_out.cpp */; };
543 A3285A360A7141A200F619A5 /* llinventorybridge.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A3285A340A71419F00F619A5 /* llinventorybridge.cpp */; }; 545 A3285A360A7141A200F619A5 /* llinventorybridge.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A3285A340A71419F00F619A5 /* llinventorybridge.cpp */; };
544 A3285A3B0A71425A00F619A5 /* llinventoryactions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A3285A3A0A71425100F619A5 /* llinventoryactions.cpp */; }; 546 A3285A3B0A71425A00F619A5 /* llinventoryactions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A3285A3A0A71425100F619A5 /* llinventoryactions.cpp */; };
545 A3AF6BCB0A544C71005B5E2C /* llevent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A3AF6BC80A544C71005B5E2C /* llevent.cpp */; }; 547 A3AF6BCB0A544C71005B5E2C /* llevent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A3AF6BC80A544C71005B5E2C /* llevent.cpp */; };
546 A3AF6BCF0A544EF0005B5E2C /* llpanellogin.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A3AF6BCE0A544EF0005B5E2C /* llpanellogin.cpp */; }; 548 A3AF6BCF0A544EF0005B5E2C /* llpanellogin.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A3AF6BCE0A544EF0005B5E2C /* llpanellogin.cpp */; };
547 A3D969160A6ED4CB007E8BD2 /* llfloaternewim.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A3D968F00A6EBCA7007E8BD2 /* llfloaternewim.cpp */; }; 549 A3D969160A6ED4CB007E8BD2 /* llfloaternewim.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A3D968F00A6EBCA7007E8BD2 /* llfloaternewim.cpp */; };
548 A3D9691F0A6ED666007E8BD2 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A3D9691B0A6ED5F6007E8BD2 /* IOKit.framework */; }; 550 A3D9691F0A6ED666007E8BD2 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A3D9691B0A6ED5F6007E8BD2 /* IOKit.framework */; };
551 AA02B9BC0B0CE44D00F2996D /* lltexturefetch.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AA02B9BA0B0CE44D00F2996D /* lltexturefetch.cpp */; };
549 AA0E2A610A2FDAEE0066250A /* llcontrol.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AA0E2A5F0A2FDAEE0066250A /* llcontrol.cpp */; }; 552 AA0E2A610A2FDAEE0066250A /* llcontrol.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AA0E2A5F0A2FDAEE0066250A /* llcontrol.cpp */; };
550 AA0E2A640A2FDB340066250A /* lltoolpipette.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AA0E2A620A2FDB340066250A /* lltoolpipette.cpp */; }; 553 AA0E2A640A2FDB340066250A /* lltoolpipette.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AA0E2A620A2FDB340066250A /* lltoolpipette.cpp */; };
554 AA348DFA0B0EAB31002C3015 /* llcurl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AA348DF80B0EAB31002C3015 /* llcurl.cpp */; };
551 AAA1336B0A3F94D000419F7C /* lluistring.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AAA133690A3F94D000419F7C /* lluistring.cpp */; }; 555 AAA1336B0A3F94D000419F7C /* lluistring.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AAA133690A3F94D000419F7C /* lluistring.cpp */; };
552 AAC121A50A93A8380080E8A9 /* llfloatersellland.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AAC121A30A93A8380080E8A9 /* llfloatersellland.cpp */; }; 556 AAC121A50A93A8380080E8A9 /* llfloatersellland.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AAC121A30A93A8380080E8A9 /* llfloatersellland.cpp */; };
557 AAE98CC20B38FE0800E2F204 /* llimageworker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AAE98CC00B38FE0800E2F204 /* llimageworker.cpp */; };
553 AAEAAF270A8104D8005F0707 /* llscrollingpanellist.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AAEAAF250A8104D8005F0707 /* llscrollingpanellist.cpp */; }; 558 AAEAAF270A8104D8005F0707 /* llscrollingpanellist.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AAEAAF250A8104D8005F0707 /* llscrollingpanellist.cpp */; };
559 AAF5FFD20B13F71900D28A84 /* lltexturecache.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AAF5FFD00B13F71900D28A84 /* lltexturecache.cpp */; };
554 C16C08500B4AE6C7009AD67F /* llfloaterinspect.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C16C084E0B4AE6C7009AD67F /* llfloaterinspect.cpp */; }; 560 C16C08500B4AE6C7009AD67F /* llfloaterinspect.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C16C084E0B4AE6C7009AD67F /* llfloaterinspect.cpp */; };
555 C1F5D0A50B138AEB00827F1D /* lluserrelations.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C1F5D0A30B138AEB00827F1D /* lluserrelations.cpp */; }; 561 C1F5D0A50B138AEB00827F1D /* lluserrelations.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C1F5D0A30B138AEB00827F1D /* lluserrelations.cpp */; };
556 C64F673F0AFBED80009732B5 /* lllogchat.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C64F673D0AFBED80009732B5 /* lllogchat.cpp */; }; 562 C64F673F0AFBED80009732B5 /* lllogchat.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C64F673D0AFBED80009732B5 /* lllogchat.cpp */; };
557 C64F67420AFBED91009732B5 /* lldirpicker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C64F67400AFBED91009732B5 /* lldirpicker.cpp */; }; 563 C64F67420AFBED91009732B5 /* lldirpicker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C64F67400AFBED91009732B5 /* lldirpicker.cpp */; };
558 D62830DB0B4DC76300F8830F /* llimagej2coj.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D62830D80B4DC76300F8830F /* llimagej2coj.cpp */; }; 564 D62830DB0B4DC76300F8830F /* llimagej2coj.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D62830D80B4DC76300F8830F /* llimagej2coj.cpp */; };
559 D628316C0B4F3FA200F8830F /* llagpmempool.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D62831510B4F3FA100F8830F /* llagpmempool.cpp */; };
560 D628316D0B4F3FA200F8830F /* llagpmempoolapple.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D62831530B4F3FA100F8830F /* llagpmempoolapple.cpp */; };
561 D628316E0B4F3FA200F8830F /* llagpmempoolarb.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D62831550B4F3FA100F8830F /* llagpmempoolarb.cpp */; };
562 D62831710B4F3FA200F8830F /* llfont.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D628315B0B4F3FA100F8830F /* llfont.cpp */; };
563 D62831720B4F3FA200F8830F /* llfontgl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D628315D0B4F3FA100F8830F /* llfontgl.cpp */; };
564 D62831730B4F3FA200F8830F /* llgldbg.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D628315F0B4F3FA100F8830F /* llgldbg.cpp */; };
565 D62831740B4F3FA200F8830F /* llimagegl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D62831610B4F3FA200F8830F /* llimagegl.cpp */; };
566 D62831760B4F3FA200F8830F /* llvertexprogramgl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D62831640B4F3FA200F8830F /* llvertexprogramgl.cpp */; };
567 D62831780B4F3FA200F8830F /* text_out.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D62831670B4F3FA200F8830F /* text_out.cpp */; };
568 D64594620B3B731700FAB68F /* llimage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 61923D9B074AE4F2005E1F34 /* llimage.cpp */; }; 565 D64594620B3B731700FAB68F /* llimage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 61923D9B074AE4F2005E1F34 /* llimage.cpp */; };
569 D64594630B3B731800FAB68F /* llimagebmp.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 61923D9D074AE4F2005E1F34 /* llimagebmp.cpp */; }; 566 D64594630B3B731800FAB68F /* llimagebmp.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 61923D9D074AE4F2005E1F34 /* llimagebmp.cpp */; };
570 D64594640B3B731A00FAB68F /* llimagedxt.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EB3EE725083AC2F2002BF676 /* llimagedxt.cpp */; }; 567 D64594640B3B731A00FAB68F /* llimagedxt.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EB3EE725083AC2F2002BF676 /* llimagedxt.cpp */; };
@@ -572,6 +569,12 @@
572 D64594680B3B732200FAB68F /* llimagejpeg.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 61923DA2074AE4F2005E1F34 /* llimagejpeg.cpp */; }; 569 D64594680B3B732200FAB68F /* llimagejpeg.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 61923DA2074AE4F2005E1F34 /* llimagejpeg.cpp */; };
573 D64594690B3B732300FAB68F /* llimagetga.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 61923DA4074AE4F2005E1F34 /* llimagetga.cpp */; }; 570 D64594690B3B732300FAB68F /* llimagetga.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 61923DA4074AE4F2005E1F34 /* llimagetga.cpp */; };
574 D651349D0B3C40870042C56E /* llqueuedthread.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AF9D84F08B405630094E8E7 /* llqueuedthread.cpp */; }; 571 D651349D0B3C40870042C56E /* llqueuedthread.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AF9D84F08B405630094E8E7 /* llqueuedthread.cpp */; };
572 DA9C40E00B54B4BA00DD6F44 /* llformat.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DA9C40DF0B54B4BA00DD6F44 /* llformat.cpp */; };
573 DA9C41140B54B8CA00DD6F44 /* lllivefile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DA9C41120B54B8CA00DD6F44 /* lllivefile.cpp */; };
574 DA9C411F0B54B9AE00DD6F44 /* libexpat.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FDE8764F09BEA39600AF6316 /* libexpat.a */; };
575 DA9C41200B54B9B300DD6F44 /* libaprutil-1.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FD6C9A5209C773A000AA1849 /* libaprutil-1.a */; };
576 DA9C412B0B54B9DA00DD6F44 /* libaprutil-1.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FD6C9A5209C773A000AA1849 /* libaprutil-1.a */; };
577 DA9C412C0B54B9DE00DD6F44 /* libexpat.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FDE8764F09BEA39600AF6316 /* libexpat.a */; };
575 E224ACBE0874D6150039C1A6 /* llfloaterimport.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E224ACBC0874D6150039C1A6 /* llfloaterimport.cpp */; }; 578 E224ACBE0874D6150039C1A6 /* llfloaterimport.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E224ACBC0874D6150039C1A6 /* llfloaterimport.cpp */; };
576 E34C14740AE6A3F0009BF4DE /* llmapresponders.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E34C14730AE6A3F0009BF4DE /* llmapresponders.cpp */; }; 579 E34C14740AE6A3F0009BF4DE /* llmapresponders.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E34C14730AE6A3F0009BF4DE /* llmapresponders.cpp */; };
577 EB3EE6C6083ABB5E002BF676 /* llbutton.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EB3EE68E083ABB5D002BF676 /* llbutton.cpp */; }; 580 EB3EE6C6083ABB5E002BF676 /* llbutton.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EB3EE68E083ABB5D002BF676 /* llbutton.cpp */; };
@@ -633,7 +636,6 @@
633 FD6C9A4809C75BCD00AA1849 /* llioutil.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD6C9A4609C75BCD00AA1849 /* llioutil.cpp */; }; 636 FD6C9A4809C75BCD00AA1849 /* llioutil.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD6C9A4609C75BCD00AA1849 /* llioutil.cpp */; };
634 FD6C9A5309C773A000AA1849 /* libaprutil-1.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FD6C9A5209C773A000AA1849 /* libaprutil-1.a */; }; 637 FD6C9A5309C773A000AA1849 /* libaprutil-1.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FD6C9A5209C773A000AA1849 /* libaprutil-1.a */; };
635 FD835B810AD1CB6700038B74 /* llchainio.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD835B800AD1CB6700038B74 /* llchainio.cpp */; }; 638 FD835B810AD1CB6700038B74 /* llchainio.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD835B800AD1CB6700038B74 /* llchainio.cpp */; };
636 FD870C5009EAC19700F5956C /* lldrawpoolclouds.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD870C4E09EAC19700F5956C /* lldrawpoolclouds.cpp */; };
637 FDA39C790A372074006E8A2D /* metaclass.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FDA39C6B0A37203E006E8A2D /* metaclass.cpp */; }; 639 FDA39C790A372074006E8A2D /* metaclass.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FDA39C6B0A37203E006E8A2D /* metaclass.cpp */; };
638 FDA39C7A0A372074006E8A2D /* metaproperty.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FDA39C6E0A37203E006E8A2D /* metaproperty.cpp */; }; 640 FDA39C7A0A372074006E8A2D /* metaproperty.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FDA39C6E0A37203E006E8A2D /* metaproperty.cpp */; };
639 FDA39C7B0A372074006E8A2D /* reflective.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FDA39C710A37203E006E8A2D /* reflective.cpp */; }; 641 FDA39C7B0A372074006E8A2D /* reflective.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FDA39C710A37203E006E8A2D /* reflective.cpp */; };
@@ -651,6 +653,9 @@
651 FDAA36C309B919F600FBF1CA /* libmx.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = FDAA36C209B919F600FBF1CA /* libmx.dylib */; }; 653 FDAA36C309B919F600FBF1CA /* libmx.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = FDAA36C209B919F600FBF1CA /* libmx.dylib */; };
652 FDCB54F60AFBC5060033B433 /* llhttpnode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FDCB54F40AFBC5060033B433 /* llhttpnode.cpp */; }; 654 FDCB54F60AFBC5060033B433 /* llhttpnode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FDCB54F40AFBC5060033B433 /* llhttpnode.cpp */; };
653 FDCB55290AFBD4310033B433 /* lleventpoll.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FDCB55270AFBD4310033B433 /* lleventpoll.cpp */; }; 655 FDCB55290AFBD4310033B433 /* lleventpoll.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FDCB55270AFBD4310033B433 /* lleventpoll.cpp */; };
656 FDD3FD710B6A89A0009173F1 /* libcares.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FDD3FD700B6A89A0009173F1 /* libcares.a */; };
657 FDD3FD720B6A89A0009173F1 /* libcares.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FDD3FD700B6A89A0009173F1 /* libcares.a */; };
658 FDD3FD730B6A89A0009173F1 /* libcares.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FDD3FD700B6A89A0009173F1 /* libcares.a */; };
654 FDE8765909BEA3B800AF6316 /* libapr-1.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FDE8764E09BEA39600AF6316 /* libapr-1.a */; }; 659 FDE8765909BEA3B800AF6316 /* libapr-1.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FDE8764E09BEA39600AF6316 /* libapr-1.a */; };
655 FDE8765A09BEA3BC00AF6316 /* libapr-1.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FDE8764E09BEA39600AF6316 /* libapr-1.a */; }; 660 FDE8765A09BEA3BC00AF6316 /* libapr-1.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FDE8764E09BEA39600AF6316 /* libapr-1.a */; };
656 FDE8765C09BEA3C300AF6316 /* libapr-1.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FDE8764E09BEA39600AF6316 /* libapr-1.a */; }; 661 FDE8765C09BEA3C300AF6316 /* libapr-1.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FDE8764E09BEA39600AF6316 /* libapr-1.a */; };
@@ -770,6 +775,15 @@
770 0633E5D309E3421500712406 /* llstreamtools.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llstreamtools.cpp; sourceTree = "<group>"; }; 775 0633E5D309E3421500712406 /* llstreamtools.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llstreamtools.cpp; sourceTree = "<group>"; };
771 0633E5D409E3421500712406 /* llstreamtools.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llstreamtools.h; sourceTree = "<group>"; }; 776 0633E5D409E3421500712406 /* llstreamtools.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llstreamtools.h; sourceTree = "<group>"; };
772 0867D6ABFE840B52C02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = "<group>"; }; 777 0867D6ABFE840B52C02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = "<group>"; };
778 1A02016D0B7A85DE00D5C589 /* llbase64.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llbase64.cpp; sourceTree = "<group>"; };
779 1A02016E0B7A85DE00D5C589 /* llbase64.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llbase64.h; sourceTree = "<group>"; };
780 1A02017E0B7A861200D5C589 /* llblowfishcipher.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llblowfishcipher.cpp; sourceTree = "<group>"; };
781 1A02017F0B7A861200D5C589 /* llblowfishcipher.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llblowfishcipher.h; sourceTree = "<group>"; };
782 1A0201800B7A861200D5C589 /* llcipher.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llcipher.h; sourceTree = "<group>"; };
783 1A0201810B7A861200D5C589 /* llnullcipher.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llnullcipher.cpp; sourceTree = "<group>"; };
784 1A0201820B7A861200D5C589 /* llnullcipher.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llnullcipher.h; sourceTree = "<group>"; };
785 1A0201830B7A861200D5C589 /* llxorcipher.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llxorcipher.cpp; sourceTree = "<group>"; };
786 1A0201840B7A861200D5C589 /* llxorcipher.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llxorcipher.h; sourceTree = "<group>"; };
773 1A1C615E0847AEE6005D7227 /* llvolumemgr.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llvolumemgr.cpp; sourceTree = "<group>"; }; 787 1A1C615E0847AEE6005D7227 /* llvolumemgr.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llvolumemgr.cpp; sourceTree = "<group>"; };
774 1A1C615F0847AEE6005D7227 /* llvolume.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llvolume.cpp; sourceTree = "<group>"; }; 788 1A1C615F0847AEE6005D7227 /* llvolume.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llvolume.cpp; sourceTree = "<group>"; };
775 1A1C61600847AEE6005D7227 /* llvolumemgr.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llvolumemgr.h; sourceTree = "<group>"; }; 789 1A1C61600847AEE6005D7227 /* llvolumemgr.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llvolumemgr.h; sourceTree = "<group>"; };
@@ -813,6 +827,10 @@
813 1A8BF3770A1AAB7B005B9D5A /* llcallbackmap.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llcallbackmap.h; sourceTree = "<group>"; }; 827 1A8BF3770A1AAB7B005B9D5A /* llcallbackmap.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llcallbackmap.h; sourceTree = "<group>"; };
814 1A8BF3780A1AAB99005B9D5A /* llfloatertest.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llfloatertest.cpp; sourceTree = "<group>"; }; 828 1A8BF3780A1AAB99005B9D5A /* llfloatertest.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llfloatertest.cpp; sourceTree = "<group>"; };
815 1A8BF3790A1AABAD005B9D5A /* llfloatertest.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llfloatertest.h; sourceTree = "<group>"; }; 829 1A8BF3790A1AABAD005B9D5A /* llfloatertest.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llfloatertest.h; sourceTree = "<group>"; };
830 1A97C4540B8BCF9C00331A24 /* llliveappconfig.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llliveappconfig.cpp; sourceTree = "<group>"; };
831 1A97C4550B8BCF9C00331A24 /* llliveappconfig.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llliveappconfig.h; sourceTree = "<group>"; };
832 1A9897E70B98E2F4005C45D7 /* llbase32.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llbase32.h; sourceTree = "<group>"; };
833 1A9897E80B98E2F4005C45D7 /* llbase32.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llbase32.cpp; sourceTree = "<group>"; };
816 1A9EC236083EA0100023D510 /* llfloatereditui.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llfloatereditui.cpp; sourceTree = "<group>"; }; 834 1A9EC236083EA0100023D510 /* llfloatereditui.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llfloatereditui.cpp; sourceTree = "<group>"; };
817 1A9EC23A083EA01F0023D510 /* llfloatereditui.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llfloatereditui.h; sourceTree = "<group>"; }; 835 1A9EC23A083EA01F0023D510 /* llfloatereditui.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llfloatereditui.h; sourceTree = "<group>"; };
818 1AB0DADC0A52E8A0001CACEB /* message_template.msg */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; name = message_template.msg; path = ../../scripts/messages/message_template.msg; sourceTree = SOURCE_ROOT; }; 836 1AB0DADC0A52E8A0001CACEB /* message_template.msg */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; name = message_template.msg; path = ../../scripts/messages/message_template.msg; sourceTree = SOURCE_ROOT; };
@@ -865,13 +883,11 @@
865 26F529C5051F61DF00A80050 /* llwaterpatch.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llwaterpatch.cpp; sourceTree = SOURCE_ROOT; }; 883 26F529C5051F61DF00A80050 /* llwaterpatch.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llwaterpatch.cpp; sourceTree = SOURCE_ROOT; };
866 26F529C6051F61DF00A80050 /* llvowater.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llvowater.cpp; sourceTree = SOURCE_ROOT; }; 884 26F529C6051F61DF00A80050 /* llvowater.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llvowater.cpp; sourceTree = SOURCE_ROOT; };
867 26F529C7051F61DF00A80050 /* llvovolume.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llvovolume.cpp; sourceTree = SOURCE_ROOT; }; 885 26F529C7051F61DF00A80050 /* llvovolume.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llvovolume.cpp; sourceTree = SOURCE_ROOT; };
868 26F529C8051F61DF00A80050 /* llvotreenew.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llvotreenew.cpp; sourceTree = SOURCE_ROOT; };
869 26F529C9051F61DF00A80050 /* llvotree.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llvotree.cpp; sourceTree = SOURCE_ROOT; }; 886 26F529C9051F61DF00A80050 /* llvotree.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llvotree.cpp; sourceTree = SOURCE_ROOT; };
870 26F529CA051F61DF00A80050 /* llvotextbubble.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llvotextbubble.cpp; sourceTree = SOURCE_ROOT; }; 887 26F529CA051F61DF00A80050 /* llvotextbubble.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llvotextbubble.cpp; sourceTree = SOURCE_ROOT; };
871 26F529CB051F61DF00A80050 /* llvosurfacepatch.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llvosurfacepatch.cpp; sourceTree = SOURCE_ROOT; }; 888 26F529CB051F61DF00A80050 /* llvosurfacepatch.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llvosurfacepatch.cpp; sourceTree = SOURCE_ROOT; };
872 26F529CC051F61DF00A80050 /* llvosky.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llvosky.cpp; sourceTree = SOURCE_ROOT; }; 889 26F529CC051F61DF00A80050 /* llvosky.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llvosky.cpp; sourceTree = SOURCE_ROOT; };
873 26F529CD051F61DF00A80050 /* llvopartgroup.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llvopartgroup.cpp; sourceTree = SOURCE_ROOT; }; 890 26F529CD051F61DF00A80050 /* llvopartgroup.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llvopartgroup.cpp; sourceTree = SOURCE_ROOT; };
874 26F529CE051F61DF00A80050 /* llvopart.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llvopart.cpp; sourceTree = SOURCE_ROOT; };
875 26F529CF051F61DF00A80050 /* llvoground.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llvoground.cpp; sourceTree = SOURCE_ROOT; }; 891 26F529CF051F61DF00A80050 /* llvoground.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llvoground.cpp; sourceTree = SOURCE_ROOT; };
876 26F529D0051F61DF00A80050 /* llvograss.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llvograss.cpp; sourceTree = SOURCE_ROOT; }; 892 26F529D0051F61DF00A80050 /* llvograss.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llvograss.cpp; sourceTree = SOURCE_ROOT; };
877 26F529D1051F61DF00A80050 /* llvoclouds.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llvoclouds.cpp; sourceTree = SOURCE_ROOT; }; 893 26F529D1051F61DF00A80050 /* llvoclouds.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llvoclouds.cpp; sourceTree = SOURCE_ROOT; };
@@ -918,7 +934,6 @@
918 26F52A03051F61DF00A80050 /* llconsole.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llconsole.cpp; sourceTree = SOURCE_ROOT; }; 934 26F52A03051F61DF00A80050 /* llconsole.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llconsole.cpp; sourceTree = SOURCE_ROOT; };
919 26F52A04051F61DF00A80050 /* lllandmarklist.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = lllandmarklist.cpp; sourceTree = SOURCE_ROOT; }; 935 26F52A04051F61DF00A80050 /* lllandmarklist.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = lllandmarklist.cpp; sourceTree = SOURCE_ROOT; };
920 26F52A05051F61DF00A80050 /* llfloaterbuildoptions.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llfloaterbuildoptions.cpp; sourceTree = SOURCE_ROOT; }; 936 26F52A05051F61DF00A80050 /* llfloaterbuildoptions.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llfloaterbuildoptions.cpp; sourceTree = SOURCE_ROOT; };
921 26F52A07051F61DF00A80050 /* llfloateraccounthistory.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llfloateraccounthistory.cpp; sourceTree = SOURCE_ROOT; };
922 26F52A0C051F61DF00A80050 /* lluserauth.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = lluserauth.cpp; sourceTree = SOURCE_ROOT; }; 937 26F52A0C051F61DF00A80050 /* lluserauth.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = lluserauth.cpp; sourceTree = SOURCE_ROOT; };
923 26F52A0D051F61DF00A80050 /* llurl.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llurl.cpp; sourceTree = SOURCE_ROOT; }; 938 26F52A0D051F61DF00A80050 /* llurl.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llurl.cpp; sourceTree = SOURCE_ROOT; };
924 26F52A0E051F61DF00A80050 /* lluploaddialog.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = lluploaddialog.cpp; sourceTree = SOURCE_ROOT; }; 939 26F52A0E051F61DF00A80050 /* lluploaddialog.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = lluploaddialog.cpp; sourceTree = SOURCE_ROOT; };
@@ -939,7 +954,6 @@
939 26F52A26051F61DF00A80050 /* lldrawpoolalpha.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = lldrawpoolalpha.cpp; sourceTree = SOURCE_ROOT; }; 954 26F52A26051F61DF00A80050 /* lldrawpoolalpha.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = lldrawpoolalpha.cpp; sourceTree = SOURCE_ROOT; };
940 26F52A27051F61DF00A80050 /* lltexturetable.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = lltexturetable.cpp; sourceTree = SOURCE_ROOT; }; 955 26F52A27051F61DF00A80050 /* lltexturetable.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = lltexturetable.cpp; sourceTree = SOURCE_ROOT; };
941 26F52A28051F61DF00A80050 /* lltexturectrl.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = lltexturectrl.cpp; sourceTree = SOURCE_ROOT; }; 956 26F52A28051F61DF00A80050 /* lltexturectrl.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = lltexturectrl.cpp; sourceTree = SOURCE_ROOT; };
942 26F52A29051F61DF00A80050 /* lltexturebar.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = lltexturebar.cpp; sourceTree = SOURCE_ROOT; };
943 26F52A2A051F61DF00A80050 /* llpanelobject.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llpanelobject.cpp; sourceTree = SOURCE_ROOT; }; 957 26F52A2A051F61DF00A80050 /* llpanelobject.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llpanelobject.cpp; sourceTree = SOURCE_ROOT; };
944 26F52A2B051F61DF00A80050 /* llpanelnetwork.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llpanelnetwork.cpp; sourceTree = SOURCE_ROOT; }; 958 26F52A2B051F61DF00A80050 /* llpanelnetwork.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llpanelnetwork.cpp; sourceTree = SOURCE_ROOT; };
945 26F52A2C051F61DF00A80050 /* lldrawpool.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = lldrawpool.cpp; sourceTree = SOURCE_ROOT; }; 959 26F52A2C051F61DF00A80050 /* lldrawpool.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = lldrawpool.cpp; sourceTree = SOURCE_ROOT; };
@@ -1006,7 +1020,6 @@
1006 26F52A85051F61DF00A80050 /* llhoverview.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llhoverview.cpp; sourceTree = SOURCE_ROOT; }; 1020 26F52A85051F61DF00A80050 /* llhoverview.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llhoverview.cpp; sourceTree = SOURCE_ROOT; };
1007 26F52A86051F61DF00A80050 /* llcylinder.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llcylinder.cpp; sourceTree = SOURCE_ROOT; }; 1021 26F52A86051F61DF00A80050 /* llcylinder.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llcylinder.cpp; sourceTree = SOURCE_ROOT; };
1008 26F52A87051F61DF00A80050 /* llhippo.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llhippo.cpp; sourceTree = SOURCE_ROOT; }; 1022 26F52A87051F61DF00A80050 /* llhippo.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llhippo.cpp; sourceTree = SOURCE_ROOT; };
1009 26F52A89051F61DF00A80050 /* llpanelmoney.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llpanelmoney.cpp; sourceTree = SOURCE_ROOT; };
1010 26F52A8B051F61DF00A80050 /* llfloateravatarinfo.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llfloateravatarinfo.cpp; sourceTree = SOURCE_ROOT; }; 1023 26F52A8B051F61DF00A80050 /* llfloateravatarinfo.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llfloateravatarinfo.cpp; sourceTree = SOURCE_ROOT; };
1011 26F52A8C051F61DF00A80050 /* llcallingcard.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llcallingcard.cpp; sourceTree = SOURCE_ROOT; }; 1024 26F52A8C051F61DF00A80050 /* llcallingcard.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llcallingcard.cpp; sourceTree = SOURCE_ROOT; };
1012 26F52A8D051F61DF00A80050 /* llhudeffectbeam.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llhudeffectbeam.cpp; sourceTree = SOURCE_ROOT; }; 1025 26F52A8D051F61DF00A80050 /* llhudeffectbeam.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llhudeffectbeam.cpp; sourceTree = SOURCE_ROOT; };
@@ -1021,7 +1034,6 @@
1021 26F52A98051F61DF00A80050 /* llnamelistctrl.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llnamelistctrl.cpp; sourceTree = SOURCE_ROOT; }; 1034 26F52A98051F61DF00A80050 /* llnamelistctrl.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llnamelistctrl.cpp; sourceTree = SOURCE_ROOT; };
1022 26F52A9A051F61DF00A80050 /* llmaniptranslate.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llmaniptranslate.cpp; sourceTree = SOURCE_ROOT; }; 1035 26F52A9A051F61DF00A80050 /* llmaniptranslate.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llmaniptranslate.cpp; sourceTree = SOURCE_ROOT; };
1023 26F52A9B051F61DF00A80050 /* llmanipscale.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llmanipscale.cpp; sourceTree = SOURCE_ROOT; }; 1036 26F52A9B051F61DF00A80050 /* llmanipscale.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llmanipscale.cpp; sourceTree = SOURCE_ROOT; };
1024 26F52A9C051F61DF00A80050 /* lldrawpooltreenew.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = lldrawpooltreenew.cpp; sourceTree = SOURCE_ROOT; };
1025 26F52A9D051F61DF00A80050 /* head.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = head.cpp; sourceTree = SOURCE_ROOT; }; 1037 26F52A9D051F61DF00A80050 /* head.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = head.cpp; sourceTree = SOURCE_ROOT; };
1026 26F52A9F051F61DF00A80050 /* llfloaternamedesc.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llfloaternamedesc.cpp; sourceTree = SOURCE_ROOT; }; 1038 26F52A9F051F61DF00A80050 /* llfloaternamedesc.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llfloaternamedesc.cpp; sourceTree = SOURCE_ROOT; };
1027 26F52AA0051F61DF00A80050 /* llpanelplace.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llpanelplace.cpp; sourceTree = SOURCE_ROOT; }; 1039 26F52AA0051F61DF00A80050 /* llpanelplace.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llpanelplace.cpp; sourceTree = SOURCE_ROOT; };
@@ -1071,7 +1083,6 @@
1071 2EA4CEED09F83BE8008F60F7 /* llpanelgrouplandmoney.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llpanelgrouplandmoney.cpp; sourceTree = SOURCE_ROOT; }; 1083 2EA4CEED09F83BE8008F60F7 /* llpanelgrouplandmoney.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llpanelgrouplandmoney.cpp; sourceTree = SOURCE_ROOT; };
1072 2EA4CEEE09F83C0B008F60F7 /* llpanelgrouplandmoney.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llpanelgrouplandmoney.h; sourceTree = SOURCE_ROOT; }; 1084 2EA4CEEE09F83C0B008F60F7 /* llpanelgrouplandmoney.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llpanelgrouplandmoney.h; sourceTree = SOURCE_ROOT; };
1073 2EA4CEEF09F83C16008F60F7 /* llpanelgrouproles.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llpanelgrouproles.h; sourceTree = SOURCE_ROOT; }; 1085 2EA4CEEF09F83C16008F60F7 /* llpanelgrouproles.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llpanelgrouproles.h; sourceTree = SOURCE_ROOT; };
1074 2EC08F1B09EF129800F87546 /* llfloateraccounthistory.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llfloateraccounthistory.cpp; sourceTree = SOURCE_ROOT; };
1075 2EFEA8E809F4556F00CB0193 /* llgroupnotify.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llgroupnotify.cpp; sourceTree = "<group>"; }; 1086 2EFEA8E809F4556F00CB0193 /* llgroupnotify.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llgroupnotify.cpp; sourceTree = "<group>"; };
1076 2EFEA8EA09F4557900CB0193 /* llgroupnotify.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llgroupnotify.h; sourceTree = "<group>"; }; 1087 2EFEA8EA09F4557900CB0193 /* llgroupnotify.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llgroupnotify.h; sourceTree = "<group>"; };
1077 2EFEA8EB09F455B900CB0193 /* llpanelgroup.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llpanelgroup.cpp; sourceTree = "<group>"; }; 1088 2EFEA8EB09F455B900CB0193 /* llpanelgroup.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llpanelgroup.cpp; sourceTree = "<group>"; };
@@ -1123,10 +1134,6 @@
1123 6192212E074A9B57005E1F34 /* llendianswizzle.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llendianswizzle.h; sourceTree = "<group>"; }; 1134 6192212E074A9B57005E1F34 /* llendianswizzle.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llendianswizzle.h; sourceTree = "<group>"; };
1124 6192212F074A9B57005E1F34 /* llerror.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llerror.cpp; sourceTree = "<group>"; }; 1135 6192212F074A9B57005E1F34 /* llerror.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llerror.cpp; sourceTree = "<group>"; };
1125 61922130074A9B57005E1F34 /* llerror.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llerror.h; sourceTree = "<group>"; }; 1136 61922130074A9B57005E1F34 /* llerror.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llerror.h; sourceTree = "<group>"; };
1126 61922131074A9B57005E1F34 /* llerrorbuffer.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llerrorbuffer.cpp; sourceTree = "<group>"; };
1127 61922132074A9B57005E1F34 /* llerrorbuffer.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llerrorbuffer.h; sourceTree = "<group>"; };
1128 61922133074A9B57005E1F34 /* llerrorstream.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llerrorstream.cpp; sourceTree = "<group>"; };
1129 61922134074A9B57005E1F34 /* llerrorstream.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llerrorstream.h; sourceTree = "<group>"; };
1130 61922135074A9B57005E1F34 /* llfasttimer.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llfasttimer.cpp; sourceTree = "<group>"; }; 1137 61922135074A9B57005E1F34 /* llfasttimer.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llfasttimer.cpp; sourceTree = "<group>"; };
1131 61922136074A9B57005E1F34 /* llfasttimer.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llfasttimer.h; sourceTree = "<group>"; }; 1138 61922136074A9B57005E1F34 /* llfasttimer.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llfasttimer.h; sourceTree = "<group>"; };
1132 61922137074A9B57005E1F34 /* llfixedbuffer.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llfixedbuffer.cpp; sourceTree = "<group>"; }; 1139 61922137074A9B57005E1F34 /* llfixedbuffer.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llfixedbuffer.cpp; sourceTree = "<group>"; };
@@ -1226,7 +1233,6 @@
1226 619221BD074A9B59005E1F34 /* llcallbacklisth.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llcallbacklisth.h; sourceTree = "<group>"; }; 1233 619221BD074A9B59005E1F34 /* llcallbacklisth.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llcallbacklisth.h; sourceTree = "<group>"; };
1227 619221BE074A9B59005E1F34 /* llcircuit.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llcircuit.cpp; sourceTree = "<group>"; }; 1234 619221BE074A9B59005E1F34 /* llcircuit.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llcircuit.cpp; sourceTree = "<group>"; };
1228 619221BF074A9B59005E1F34 /* llcircuit.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llcircuit.h; sourceTree = "<group>"; }; 1235 619221BF074A9B59005E1F34 /* llcircuit.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llcircuit.h; sourceTree = "<group>"; };
1229 619221C0074A9B59005E1F34 /* llcrypto.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llcrypto.h; sourceTree = "<group>"; };
1230 619221C5074A9B59005E1F34 /* lldatapacker.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = lldatapacker.cpp; sourceTree = "<group>"; }; 1236 619221C5074A9B59005E1F34 /* lldatapacker.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = lldatapacker.cpp; sourceTree = "<group>"; };
1231 619221C6074A9B59005E1F34 /* lldatapacker.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = lldatapacker.h; sourceTree = "<group>"; }; 1237 619221C6074A9B59005E1F34 /* lldatapacker.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = lldatapacker.h; sourceTree = "<group>"; };
1232 619221C7074A9B59005E1F34 /* lldbstrings.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = lldbstrings.h; sourceTree = "<group>"; }; 1238 619221C7074A9B59005E1F34 /* lldbstrings.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = lldbstrings.h; sourceTree = "<group>"; };
@@ -1540,7 +1546,6 @@
1540 990CDBDF05C1EA7900739545 /* mac_updater.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = mac_updater.cpp; sourceTree = "<group>"; }; 1546 990CDBDF05C1EA7900739545 /* mac_updater.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = mac_updater.cpp; sourceTree = "<group>"; };
1541 990CDBE005C1EA7900739545 /* MoreFilesX.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = MoreFilesX.c; sourceTree = "<group>"; }; 1547 990CDBE005C1EA7900739545 /* MoreFilesX.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = MoreFilesX.c; sourceTree = "<group>"; };
1542 990CDBE105C1EA7900739545 /* MoreFilesX.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = MoreFilesX.h; sourceTree = "<group>"; }; 1548 990CDBE105C1EA7900739545 /* MoreFilesX.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = MoreFilesX.h; sourceTree = "<group>"; };
1543 99142BE60AB625730063BC96 /* rsyncfiles.txt */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = rsyncfiles.txt; sourceTree = SOURCE_ROOT; };
1544 991ED2DF0883646B003EC818 /* llclassifiedinfo.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llclassifiedinfo.cpp; sourceTree = "<group>"; }; 1549 991ED2DF0883646B003EC818 /* llclassifiedinfo.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llclassifiedinfo.cpp; sourceTree = "<group>"; };
1545 9928ACA4056D9353003865BE /* CrashReporter.nib */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; path = CrashReporter.nib; sourceTree = "<group>"; }; 1550 9928ACA4056D9353003865BE /* CrashReporter.nib */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; path = CrashReporter.nib; sourceTree = "<group>"; };
1546 99321B11081DD26000678159 /* llworkerthread.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llworkerthread.h; sourceTree = "<group>"; }; 1551 99321B11081DD26000678159 /* llworkerthread.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llworkerthread.h; sourceTree = "<group>"; };
@@ -1574,7 +1579,6 @@
1574 997B4BEB06015821001B0407 /* llvosurfacepatch.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llvosurfacepatch.h; sourceTree = SOURCE_ROOT; }; 1579 997B4BEB06015821001B0407 /* llvosurfacepatch.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llvosurfacepatch.h; sourceTree = SOURCE_ROOT; };
1575 997B4BEC06015821001B0407 /* llvosky.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llvosky.h; sourceTree = SOURCE_ROOT; }; 1580 997B4BEC06015821001B0407 /* llvosky.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llvosky.h; sourceTree = SOURCE_ROOT; };
1576 997B4BED06015821001B0407 /* llvopartgroup.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llvopartgroup.h; sourceTree = SOURCE_ROOT; }; 1581 997B4BED06015821001B0407 /* llvopartgroup.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llvopartgroup.h; sourceTree = SOURCE_ROOT; };
1577 997B4BEE06015821001B0407 /* llvopart.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llvopart.h; sourceTree = SOURCE_ROOT; };
1578 997B4BEF06015821001B0407 /* llvoground.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llvoground.h; sourceTree = SOURCE_ROOT; }; 1582 997B4BEF06015821001B0407 /* llvoground.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llvoground.h; sourceTree = SOURCE_ROOT; };
1579 997B4BF006015821001B0407 /* llvograss.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llvograss.h; sourceTree = SOURCE_ROOT; }; 1583 997B4BF006015821001B0407 /* llvograss.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llvograss.h; sourceTree = SOURCE_ROOT; };
1580 997B4BF106015821001B0407 /* llvoclouds.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llvoclouds.h; sourceTree = SOURCE_ROOT; }; 1584 997B4BF106015821001B0407 /* llvoclouds.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llvoclouds.h; sourceTree = SOURCE_ROOT; };
@@ -1636,7 +1640,6 @@
1636 997B4C3406015821001B0407 /* lltextureview.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = lltextureview.h; sourceTree = SOURCE_ROOT; }; 1640 997B4C3406015821001B0407 /* lltextureview.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = lltextureview.h; sourceTree = SOURCE_ROOT; };
1637 997B4C3506015821001B0407 /* lltexturetable.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = lltexturetable.h; sourceTree = SOURCE_ROOT; }; 1641 997B4C3506015821001B0407 /* lltexturetable.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = lltexturetable.h; sourceTree = SOURCE_ROOT; };
1638 997B4C3606015821001B0407 /* lltexturectrl.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = lltexturectrl.h; sourceTree = SOURCE_ROOT; }; 1642 997B4C3606015821001B0407 /* lltexturectrl.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = lltexturectrl.h; sourceTree = SOURCE_ROOT; };
1639 997B4C3706015821001B0407 /* lltexturebar.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = lltexturebar.h; sourceTree = SOURCE_ROOT; };
1640 997B4C3B06015821001B0407 /* lltexlayer.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = lltexlayer.h; sourceTree = SOURCE_ROOT; }; 1643 997B4C3B06015821001B0407 /* lltexlayer.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = lltexlayer.h; sourceTree = SOURCE_ROOT; };
1641 997B4C3D06015821001B0407 /* lltable.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = lltable.h; sourceTree = SOURCE_ROOT; }; 1644 997B4C3D06015821001B0407 /* lltable.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = lltable.h; sourceTree = SOURCE_ROOT; };
1642 997B4C4006015821001B0407 /* llstatview.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llstatview.h; sourceTree = SOURCE_ROOT; }; 1645 997B4C4006015821001B0407 /* llstatview.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llstatview.h; sourceTree = SOURCE_ROOT; };
@@ -1669,7 +1672,6 @@
1669 997B4C6C06015821001B0407 /* llpanelobject.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llpanelobject.h; sourceTree = SOURCE_ROOT; }; 1672 997B4C6C06015821001B0407 /* llpanelobject.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llpanelobject.h; sourceTree = SOURCE_ROOT; };
1670 997B4C6D06015822001B0407 /* llpanelnetwork.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llpanelnetwork.h; sourceTree = SOURCE_ROOT; }; 1673 997B4C6D06015822001B0407 /* llpanelnetwork.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llpanelnetwork.h; sourceTree = SOURCE_ROOT; };
1671 997B4C6F06015822001B0407 /* llpanelmorph.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llpanelmorph.h; sourceTree = SOURCE_ROOT; }; 1674 997B4C6F06015822001B0407 /* llpanelmorph.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llpanelmorph.h; sourceTree = SOURCE_ROOT; };
1672 997B4C7006015822001B0407 /* llpanelmoney.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llpanelmoney.h; sourceTree = SOURCE_ROOT; };
1673 997B4C7106015822001B0407 /* llpanelleaderboard.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llpanelleaderboard.h; sourceTree = SOURCE_ROOT; }; 1675 997B4C7106015822001B0407 /* llpanelleaderboard.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llpanelleaderboard.h; sourceTree = SOURCE_ROOT; };
1674 997B4C7206015822001B0407 /* llpanelland.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llpanelland.h; sourceTree = SOURCE_ROOT; }; 1676 997B4C7206015822001B0407 /* llpanelland.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llpanelland.h; sourceTree = SOURCE_ROOT; };
1675 997B4C7306015822001B0407 /* llpanelinventory.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llpanelinventory.h; sourceTree = SOURCE_ROOT; }; 1677 997B4C7306015822001B0407 /* llpanelinventory.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llpanelinventory.h; sourceTree = SOURCE_ROOT; };
@@ -1759,7 +1761,6 @@
1759 997B4CE006015822001B0407 /* llfloaterbuildoptions.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llfloaterbuildoptions.h; sourceTree = SOURCE_ROOT; }; 1761 997B4CE006015822001B0407 /* llfloaterbuildoptions.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llfloaterbuildoptions.h; sourceTree = SOURCE_ROOT; };
1760 997B4CE206015822001B0407 /* llfloateravatarinfo.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llfloateravatarinfo.h; sourceTree = SOURCE_ROOT; }; 1762 997B4CE206015822001B0407 /* llfloateravatarinfo.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llfloateravatarinfo.h; sourceTree = SOURCE_ROOT; };
1761 997B4CE306015822001B0407 /* llfloaterauction.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llfloaterauction.h; sourceTree = SOURCE_ROOT; }; 1763 997B4CE306015822001B0407 /* llfloaterauction.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llfloaterauction.h; sourceTree = SOURCE_ROOT; };
1762 997B4CE406015822001B0407 /* llfloateraccounthistory.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llfloateraccounthistory.h; sourceTree = SOURCE_ROOT; };
1763 997B4CE506015822001B0407 /* llfloaterabout.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llfloaterabout.h; sourceTree = SOURCE_ROOT; }; 1764 997B4CE506015822001B0407 /* llfloaterabout.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llfloaterabout.h; sourceTree = SOURCE_ROOT; };
1764 997B4CE706015822001B0407 /* llfirstuse.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llfirstuse.h; sourceTree = SOURCE_ROOT; }; 1765 997B4CE706015822001B0407 /* llfirstuse.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llfirstuse.h; sourceTree = SOURCE_ROOT; };
1765 997B4CE906015822001B0407 /* llfilepicker.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llfilepicker.h; sourceTree = SOURCE_ROOT; }; 1766 997B4CE906015822001B0407 /* llfilepicker.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llfilepicker.h; sourceTree = SOURCE_ROOT; };
@@ -1813,8 +1814,6 @@
1813 9985A1270AC1FE4E00579AFB /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = ../../../../../../../../System/Library/Frameworks/AppKit.framework; sourceTree = "<group>"; }; 1814 9985A1270AC1FE4E00579AFB /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = ../../../../../../../../System/Library/Frameworks/AppKit.framework; sourceTree = "<group>"; };
1814 99AAD74D09DC8B9D0036C309 /* lllfsthread.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = lllfsthread.h; sourceTree = "<group>"; }; 1815 99AAD74D09DC8B9D0036C309 /* lllfsthread.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = lllfsthread.h; sourceTree = "<group>"; };
1815 99AAD74E09DC8B9D0036C309 /* lllfsthread.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = lllfsthread.cpp; sourceTree = "<group>"; }; 1816 99AAD74E09DC8B9D0036C309 /* lllfsthread.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = lllfsthread.cpp; sourceTree = "<group>"; };
1816 99B0682709A54FBB00F4AD09 /* lldrawpoolhud.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = lldrawpoolhud.cpp; sourceTree = SOURCE_ROOT; };
1817 99B0682809A54FBB00F4AD09 /* lldrawpoolhud.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = lldrawpoolhud.h; sourceTree = SOURCE_ROOT; };
1818 99BB5166099ABDEB004BF9F2 /* llfloaterbuyland.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llfloaterbuyland.cpp; sourceTree = SOURCE_ROOT; }; 1817 99BB5166099ABDEB004BF9F2 /* llfloaterbuyland.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llfloaterbuyland.cpp; sourceTree = SOURCE_ROOT; };
1819 99BB5167099ABDEB004BF9F2 /* llfloaterbuyland.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llfloaterbuyland.h; sourceTree = SOURCE_ROOT; }; 1818 99BB5167099ABDEB004BF9F2 /* llfloaterbuyland.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llfloaterbuyland.h; sourceTree = SOURCE_ROOT; };
1820 99BB5169099AC1AE004BF9F2 /* llxmlrpctransaction.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llxmlrpctransaction.h; sourceTree = SOURCE_ROOT; }; 1819 99BB5169099AC1AE004BF9F2 /* llxmlrpctransaction.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llxmlrpctransaction.h; sourceTree = SOURCE_ROOT; };
@@ -1877,6 +1876,8 @@
1877 A241CB8F07B3E383001A39E3 /* llmessagethrottle.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llmessagethrottle.h; sourceTree = "<group>"; }; 1876 A241CB8F07B3E383001A39E3 /* llmessagethrottle.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llmessagethrottle.h; sourceTree = "<group>"; };
1878 A241CB9407B3E3A7001A39E3 /* llperlin.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llperlin.cpp; sourceTree = "<group>"; }; 1877 A241CB9407B3E3A7001A39E3 /* llperlin.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llperlin.cpp; sourceTree = "<group>"; };
1879 A2A57EBA0ADF10FD00F6EF97 /* llavatarconstants.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llavatarconstants.h; sourceTree = "<group>"; }; 1878 A2A57EBA0ADF10FD00F6EF97 /* llavatarconstants.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llavatarconstants.h; sourceTree = "<group>"; };
1879 A30273550B3A13D800704420 /* llvertexbuffer.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llvertexbuffer.cpp; sourceTree = "<group>"; };
1880 A30273560B3A13D800704420 /* llvertexbuffer.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llvertexbuffer.h; sourceTree = "<group>"; };
1880 A3077BFB09DCB8140059ED75 /* lldrawpoolstars.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = lldrawpoolstars.cpp; sourceTree = "<group>"; }; 1881 A3077BFB09DCB8140059ED75 /* lldrawpoolstars.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = lldrawpoolstars.cpp; sourceTree = "<group>"; };
1881 A3077BFC09DCB8140059ED75 /* lldrawpoolstars.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = lldrawpoolstars.h; sourceTree = "<group>"; }; 1882 A3077BFC09DCB8140059ED75 /* lldrawpoolstars.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = lldrawpoolstars.h; sourceTree = "<group>"; };
1882 A3077BFF09DCB8140059ED75 /* llfloaterhtmlhelp.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llfloaterhtmlhelp.cpp; sourceTree = "<group>"; }; 1883 A3077BFF09DCB8140059ED75 /* llfloaterhtmlhelp.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llfloaterhtmlhelp.cpp; sourceTree = "<group>"; };
@@ -1897,16 +1898,24 @@
1897 A3D968F00A6EBCA7007E8BD2 /* llfloaternewim.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llfloaternewim.cpp; sourceTree = "<group>"; }; 1898 A3D968F00A6EBCA7007E8BD2 /* llfloaternewim.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llfloaternewim.cpp; sourceTree = "<group>"; };
1898 A3D968F10A6EBCA7007E8BD2 /* llfloaternewim.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llfloaternewim.h; sourceTree = "<group>"; }; 1899 A3D968F10A6EBCA7007E8BD2 /* llfloaternewim.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llfloaternewim.h; sourceTree = "<group>"; };
1899 A3D9691B0A6ED5F6007E8BD2 /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = /System/Library/Frameworks/IOKit.framework; sourceTree = "<absolute>"; }; 1900 A3D9691B0A6ED5F6007E8BD2 /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = /System/Library/Frameworks/IOKit.framework; sourceTree = "<absolute>"; };
1901 AA02B9BA0B0CE44D00F2996D /* lltexturefetch.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = lltexturefetch.cpp; sourceTree = "<group>"; };
1902 AA02B9BB0B0CE44D00F2996D /* lltexturefetch.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = lltexturefetch.h; sourceTree = "<group>"; };
1900 AA0E2A5F0A2FDAEE0066250A /* llcontrol.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llcontrol.cpp; sourceTree = "<group>"; }; 1903 AA0E2A5F0A2FDAEE0066250A /* llcontrol.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llcontrol.cpp; sourceTree = "<group>"; };
1901 AA0E2A600A2FDAEE0066250A /* llcontrol.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llcontrol.h; sourceTree = "<group>"; }; 1904 AA0E2A600A2FDAEE0066250A /* llcontrol.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llcontrol.h; sourceTree = "<group>"; };
1902 AA0E2A620A2FDB340066250A /* lltoolpipette.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = lltoolpipette.cpp; sourceTree = "<group>"; }; 1905 AA0E2A620A2FDB340066250A /* lltoolpipette.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = lltoolpipette.cpp; sourceTree = "<group>"; };
1903 AA0E2A630A2FDB340066250A /* lltoolpipette.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = lltoolpipette.h; sourceTree = "<group>"; }; 1906 AA0E2A630A2FDB340066250A /* lltoolpipette.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = lltoolpipette.h; sourceTree = "<group>"; };
1907 AA348DF80B0EAB31002C3015 /* llcurl.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llcurl.cpp; sourceTree = "<group>"; };
1908 AA348DF90B0EAB31002C3015 /* llcurl.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llcurl.h; sourceTree = "<group>"; };
1904 AAA133690A3F94D000419F7C /* lluistring.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = lluistring.cpp; sourceTree = "<group>"; }; 1909 AAA133690A3F94D000419F7C /* lluistring.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = lluistring.cpp; sourceTree = "<group>"; };
1905 AAA1336A0A3F94D000419F7C /* lluistring.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = lluistring.h; sourceTree = "<group>"; }; 1910 AAA1336A0A3F94D000419F7C /* lluistring.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = lluistring.h; sourceTree = "<group>"; };
1906 AAC121A30A93A8380080E8A9 /* llfloatersellland.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llfloatersellland.cpp; sourceTree = "<group>"; }; 1911 AAC121A30A93A8380080E8A9 /* llfloatersellland.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llfloatersellland.cpp; sourceTree = "<group>"; };
1907 AAC121A40A93A8380080E8A9 /* llfloatersellland.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llfloatersellland.h; sourceTree = "<group>"; }; 1912 AAC121A40A93A8380080E8A9 /* llfloatersellland.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llfloatersellland.h; sourceTree = "<group>"; };
1913 AAE98CC00B38FE0800E2F204 /* llimageworker.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llimageworker.cpp; sourceTree = "<group>"; };
1914 AAE98CC10B38FE0800E2F204 /* llimageworker.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llimageworker.h; sourceTree = "<group>"; };
1908 AAEAAF250A8104D8005F0707 /* llscrollingpanellist.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llscrollingpanellist.cpp; sourceTree = "<group>"; }; 1915 AAEAAF250A8104D8005F0707 /* llscrollingpanellist.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llscrollingpanellist.cpp; sourceTree = "<group>"; };
1909 AAEAAF260A8104D8005F0707 /* llscrollingpanellist.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llscrollingpanellist.h; sourceTree = "<group>"; }; 1916 AAEAAF260A8104D8005F0707 /* llscrollingpanellist.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llscrollingpanellist.h; sourceTree = "<group>"; };
1917 AAF5FFD00B13F71900D28A84 /* lltexturecache.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = lltexturecache.cpp; sourceTree = "<group>"; };
1918 AAF5FFD10B13F71900D28A84 /* lltexturecache.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = lltexturecache.h; sourceTree = "<group>"; };
1910 C16C084E0B4AE6C7009AD67F /* llfloaterinspect.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llfloaterinspect.cpp; sourceTree = "<group>"; }; 1919 C16C084E0B4AE6C7009AD67F /* llfloaterinspect.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llfloaterinspect.cpp; sourceTree = "<group>"; };
1911 C16C084F0B4AE6C7009AD67F /* llfloaterinspect.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llfloaterinspect.h; sourceTree = "<group>"; }; 1920 C16C084F0B4AE6C7009AD67F /* llfloaterinspect.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llfloaterinspect.h; sourceTree = "<group>"; };
1912 C1F5D0A30B138AEB00827F1D /* lluserrelations.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = lluserrelations.cpp; sourceTree = "<group>"; }; 1921 C1F5D0A30B138AEB00827F1D /* lluserrelations.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = lluserrelations.cpp; sourceTree = "<group>"; };
@@ -1917,12 +1926,6 @@
1917 C64F67410AFBED91009732B5 /* lldirpicker.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = lldirpicker.h; sourceTree = "<group>"; }; 1926 C64F67410AFBED91009732B5 /* lldirpicker.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = lldirpicker.h; sourceTree = "<group>"; };
1918 D62830D80B4DC76300F8830F /* llimagej2coj.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llimagej2coj.cpp; sourceTree = "<group>"; }; 1927 D62830D80B4DC76300F8830F /* llimagej2coj.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llimagej2coj.cpp; sourceTree = "<group>"; };
1919 D62830D90B4DC76300F8830F /* llimagej2coj.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llimagej2coj.h; sourceTree = "<group>"; }; 1928 D62830D90B4DC76300F8830F /* llimagej2coj.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llimagej2coj.h; sourceTree = "<group>"; };
1920 D62831510B4F3FA100F8830F /* llagpmempool.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llagpmempool.cpp; sourceTree = "<group>"; };
1921 D62831520B4F3FA100F8830F /* llagpmempool.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llagpmempool.h; sourceTree = "<group>"; };
1922 D62831530B4F3FA100F8830F /* llagpmempoolapple.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llagpmempoolapple.cpp; sourceTree = "<group>"; };
1923 D62831540B4F3FA100F8830F /* llagpmempoolapple.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llagpmempoolapple.h; sourceTree = "<group>"; };
1924 D62831550B4F3FA100F8830F /* llagpmempoolarb.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llagpmempoolarb.cpp; sourceTree = "<group>"; };
1925 D62831560B4F3FA100F8830F /* llagpmempoolarb.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llagpmempoolarb.h; sourceTree = "<group>"; };
1926 D628315B0B4F3FA100F8830F /* llfont.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llfont.cpp; sourceTree = "<group>"; }; 1929 D628315B0B4F3FA100F8830F /* llfont.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llfont.cpp; sourceTree = "<group>"; };
1927 D628315C0B4F3FA100F8830F /* llfont.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llfont.h; sourceTree = "<group>"; }; 1930 D628315C0B4F3FA100F8830F /* llfont.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llfont.h; sourceTree = "<group>"; };
1928 D628315D0B4F3FA100F8830F /* llfontgl.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llfontgl.cpp; sourceTree = "<group>"; }; 1931 D628315D0B4F3FA100F8830F /* llfontgl.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llfontgl.cpp; sourceTree = "<group>"; };
@@ -1935,6 +1938,12 @@
1935 D62831650B4F3FA200F8830F /* llvertexprogramgl.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llvertexprogramgl.h; sourceTree = "<group>"; }; 1938 D62831650B4F3FA200F8830F /* llvertexprogramgl.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llvertexprogramgl.h; sourceTree = "<group>"; };
1936 D62831670B4F3FA200F8830F /* text_out.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = text_out.cpp; sourceTree = "<group>"; }; 1939 D62831670B4F3FA200F8830F /* text_out.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = text_out.cpp; sourceTree = "<group>"; };
1937 D62831680B4F3FA200F8830F /* text_out.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = text_out.h; sourceTree = "<group>"; }; 1940 D62831680B4F3FA200F8830F /* text_out.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = text_out.h; sourceTree = "<group>"; };
1941 DA55FCB20B59F75C001C28B6 /* llerrorcontrol.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llerrorcontrol.h; sourceTree = "<group>"; };
1942 DA9C40DE0B54B4BA00DD6F44 /* llformat.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = llformat.h; sourceTree = "<group>"; };
1943 DA9C40DF0B54B4BA00DD6F44 /* llformat.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = llformat.cpp; sourceTree = "<group>"; };
1944 DA9C40EC0B54B5C700DD6F44 /* llerrorlegacy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = llerrorlegacy.h; sourceTree = "<group>"; };
1945 DA9C41120B54B8CA00DD6F44 /* lllivefile.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = lllivefile.cpp; sourceTree = "<group>"; };
1946 DA9C41130B54B8CA00DD6F44 /* lllivefile.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = lllivefile.h; sourceTree = "<group>"; };
1938 E224ACBC0874D6150039C1A6 /* llfloaterimport.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llfloaterimport.cpp; sourceTree = "<group>"; }; 1947 E224ACBC0874D6150039C1A6 /* llfloaterimport.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llfloaterimport.cpp; sourceTree = "<group>"; };
1939 E224ACBD0874D6150039C1A6 /* llfloaterimport.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llfloaterimport.h; sourceTree = "<group>"; }; 1948 E224ACBD0874D6150039C1A6 /* llfloaterimport.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llfloaterimport.h; sourceTree = "<group>"; };
1940 E34C14730AE6A3F0009BF4DE /* llmapresponders.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llmapresponders.cpp; sourceTree = "<group>"; }; 1949 E34C14730AE6A3F0009BF4DE /* llmapresponders.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llmapresponders.cpp; sourceTree = "<group>"; };
@@ -2031,7 +2040,7 @@
2031 FD1558280A06BB5F00DE9AE5 /* lluri.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = lluri.cpp; sourceTree = "<group>"; }; 2040 FD1558280A06BB5F00DE9AE5 /* lluri.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = lluri.cpp; sourceTree = "<group>"; };
2032 FD1558290A06BB5F00DE9AE5 /* lluri.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = lluri.h; sourceTree = "<group>"; }; 2041 FD1558290A06BB5F00DE9AE5 /* lluri.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = lluri.h; sourceTree = "<group>"; };
2033 FD1558B00A06C16C00DE9AE5 /* libiconv.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libiconv.dylib; path = /usr/lib/libiconv.dylib; sourceTree = "<absolute>"; }; 2042 FD1558B00A06C16C00DE9AE5 /* libiconv.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libiconv.dylib; path = /usr/lib/libiconv.dylib; sourceTree = "<absolute>"; };
2034 FD34696A0B5C3C55007318E5 /* libllcurl.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libllcurl.a; path = build/Universal/libllcurl.a; sourceTree = "<group>"; }; 2043 FD34696A0B5C3C55007318E5 /* libllcurl.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libllcurl.a; sourceTree = BUILT_PRODUCTS_DIR; };
2035 FD53B3DB09BDE88B00BFE3BC /* macutil_Prefix.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = macutil_Prefix.h; sourceTree = "<group>"; }; 2044 FD53B3DB09BDE88B00BFE3BC /* macutil_Prefix.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = macutil_Prefix.h; sourceTree = "<group>"; };
2036 FD59ED5D0AF2AF460086642A /* llassetuploadresponders.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llassetuploadresponders.cpp; sourceTree = "<group>"; }; 2045 FD59ED5D0AF2AF460086642A /* llassetuploadresponders.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llassetuploadresponders.cpp; sourceTree = "<group>"; };
2037 FD59ED5E0AF2AF460086642A /* llassetuploadresponders.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llassetuploadresponders.h; sourceTree = "<group>"; }; 2046 FD59ED5E0AF2AF460086642A /* llassetuploadresponders.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llassetuploadresponders.h; sourceTree = "<group>"; };
@@ -2058,7 +2067,6 @@
2058 FD6C9A4709C75BCD00AA1849 /* llioutil.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llioutil.h; sourceTree = "<group>"; }; 2067 FD6C9A4709C75BCD00AA1849 /* llioutil.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llioutil.h; sourceTree = "<group>"; };
2059 FD6C9A5209C773A000AA1849 /* libaprutil-1.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = "libaprutil-1.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 2068 FD6C9A5209C773A000AA1849 /* libaprutil-1.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = "libaprutil-1.a"; sourceTree = BUILT_PRODUCTS_DIR; };
2060 FD835B800AD1CB6700038B74 /* llchainio.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llchainio.cpp; sourceTree = "<group>"; }; 2069 FD835B800AD1CB6700038B74 /* llchainio.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llchainio.cpp; sourceTree = "<group>"; };
2061 FD870C4E09EAC19700F5956C /* lldrawpoolclouds.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = lldrawpoolclouds.cpp; sourceTree = "<group>"; };
2062 FD870C4F09EAC19700F5956C /* lldrawpoolclouds.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = lldrawpoolclouds.h; sourceTree = "<group>"; }; 2070 FD870C4F09EAC19700F5956C /* lldrawpoolclouds.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = lldrawpoolclouds.h; sourceTree = "<group>"; };
2063 FDA39C6B0A37203E006E8A2D /* metaclass.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = metaclass.cpp; sourceTree = "<group>"; }; 2071 FDA39C6B0A37203E006E8A2D /* metaclass.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = metaclass.cpp; sourceTree = "<group>"; };
2064 FDA39C6C0A37203E006E8A2D /* metaclass.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = metaclass.h; sourceTree = "<group>"; }; 2072 FDA39C6C0A37203E006E8A2D /* metaclass.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = metaclass.h; sourceTree = "<group>"; };
@@ -2077,6 +2085,7 @@
2077 FDCB54F50AFBC5060033B433 /* llhttpnode.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llhttpnode.h; sourceTree = "<group>"; }; 2085 FDCB54F50AFBC5060033B433 /* llhttpnode.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llhttpnode.h; sourceTree = "<group>"; };
2078 FDCB55270AFBD4310033B433 /* lleventpoll.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = lleventpoll.cpp; sourceTree = "<group>"; }; 2086 FDCB55270AFBD4310033B433 /* lleventpoll.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = lleventpoll.cpp; sourceTree = "<group>"; };
2079 FDCB55280AFBD4310033B433 /* lleventpoll.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = lleventpoll.h; sourceTree = "<group>"; }; 2087 FDCB55280AFBD4310033B433 /* lleventpoll.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = lleventpoll.h; sourceTree = "<group>"; };
2088 FDD3FD700B6A89A0009173F1 /* libcares.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libcares.a; sourceTree = BUILT_PRODUCTS_DIR; };
2080 FDE8764E09BEA39600AF6316 /* libapr-1.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = "libapr-1.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 2089 FDE8764E09BEA39600AF6316 /* libapr-1.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = "libapr-1.a"; sourceTree = BUILT_PRODUCTS_DIR; };
2081 FDE8764F09BEA39600AF6316 /* libexpat.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libexpat.a; sourceTree = BUILT_PRODUCTS_DIR; }; 2090 FDE8764F09BEA39600AF6316 /* libexpat.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libexpat.a; sourceTree = BUILT_PRODUCTS_DIR; };
2082 FDE8765009BEA39600AF6316 /* libfmod.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libfmod.a; sourceTree = BUILT_PRODUCTS_DIR; }; 2091 FDE8765009BEA39600AF6316 /* libfmod.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libfmod.a; sourceTree = BUILT_PRODUCTS_DIR; };
@@ -2122,6 +2131,7 @@
2122 9967E9200B3754800087BD1B /* libfmodwrapper.dylib in Frameworks */, 2131 9967E9200B3754800087BD1B /* libfmodwrapper.dylib in Frameworks */,
2123 9950AFEC0B376E24007E36E0 /* libopenjpeg.a in Frameworks */, 2132 9950AFEC0B376E24007E36E0 /* libopenjpeg.a in Frameworks */,
2124 FD34696B0B5C3C55007318E5 /* libllcurl.a in Frameworks */, 2133 FD34696B0B5C3C55007318E5 /* libllcurl.a in Frameworks */,
2134 FDD3FD730B6A89A0009173F1 /* libcares.a in Frameworks */,
2125 ); 2135 );
2126 runOnlyForDeploymentPostprocessing = 0; 2136 runOnlyForDeploymentPostprocessing = 0;
2127 }; 2137 };
@@ -2136,6 +2146,9 @@
2136 FDAA36BD09B919CD00FBF1CA /* libcrypto.dylib in Frameworks */, 2146 FDAA36BD09B919CD00FBF1CA /* libcrypto.dylib in Frameworks */,
2137 FDAA36C109B919DF00FBF1CA /* libz.dylib in Frameworks */, 2147 FDAA36C109B919DF00FBF1CA /* libz.dylib in Frameworks */,
2138 FD34696F0B5C47B0007318E5 /* libllcurl.a in Frameworks */, 2148 FD34696F0B5C47B0007318E5 /* libllcurl.a in Frameworks */,
2149 FDD3FD720B6A89A0009173F1 /* libcares.a in Frameworks */,
2150 DA9C412B0B54B9DA00DD6F44 /* libaprutil-1.a in Frameworks */,
2151 DA9C412C0B54B9DE00DD6F44 /* libexpat.a in Frameworks */,
2139 ); 2152 );
2140 runOnlyForDeploymentPostprocessing = 0; 2153 runOnlyForDeploymentPostprocessing = 0;
2141 }; 2154 };
@@ -2158,7 +2171,10 @@
2158 FDAA36B709B919AD00FBF1CA /* libssl.dylib in Frameworks */, 2171 FDAA36B709B919AD00FBF1CA /* libssl.dylib in Frameworks */,
2159 FDAA36BB09B919CD00FBF1CA /* libcrypto.dylib in Frameworks */, 2172 FDAA36BB09B919CD00FBF1CA /* libcrypto.dylib in Frameworks */,
2160 FDAA36BF09B919DF00FBF1CA /* libz.dylib in Frameworks */, 2173 FDAA36BF09B919DF00FBF1CA /* libz.dylib in Frameworks */,
2174 DA9C411F0B54B9AE00DD6F44 /* libexpat.a in Frameworks */,
2175 DA9C41200B54B9B300DD6F44 /* libaprutil-1.a in Frameworks */,
2161 FD34696E0B5C47B0007318E5 /* libllcurl.a in Frameworks */, 2176 FD34696E0B5C47B0007318E5 /* libllcurl.a in Frameworks */,
2177 FDD3FD710B6A89A0009173F1 /* libcares.a in Frameworks */,
2162 ); 2178 );
2163 runOnlyForDeploymentPostprocessing = 0; 2179 runOnlyForDeploymentPostprocessing = 0;
2164 }; 2180 };
@@ -2227,7 +2243,6 @@
2227 20286C2CFDCF999611CA2CEA /* Resources */ = { 2243 20286C2CFDCF999611CA2CEA /* Resources */ = {
2228 isa = PBXGroup; 2244 isa = PBXGroup;
2229 children = ( 2245 children = (
2230 99142BE60AB625730063BC96 /* rsyncfiles.txt */,
2231 019200F204DD7D3500A800A7 /* macview.r */, 2246 019200F204DD7D3500A800A7 /* macview.r */,
2232 0867D6AAFE840B52C02AAC07 /* InfoPlist.strings */, 2247 0867D6AAFE840B52C02AAC07 /* InfoPlist.strings */,
2233 ); 2248 );
@@ -2248,6 +2263,10 @@
2248 26F529A0051F61CD00A80050 /* newview */ = { 2263 26F529A0051F61CD00A80050 /* newview */ = {
2249 isa = PBXGroup; 2264 isa = PBXGroup;
2250 children = ( 2265 children = (
2266 AAF5FFD00B13F71900D28A84 /* lltexturecache.cpp */,
2267 AAF5FFD10B13F71900D28A84 /* lltexturecache.h */,
2268 AA02B9BA0B0CE44D00F2996D /* lltexturefetch.cpp */,
2269 AA02B9BB0B0CE44D00F2996D /* lltexturefetch.h */,
2251 C16C084E0B4AE6C7009AD67F /* llfloaterinspect.cpp */, 2270 C16C084E0B4AE6C7009AD67F /* llfloaterinspect.cpp */,
2252 C16C084F0B4AE6C7009AD67F /* llfloaterinspect.h */, 2271 C16C084F0B4AE6C7009AD67F /* llfloaterinspect.h */,
2253 C64F67400AFBED91009732B5 /* lldirpicker.cpp */, 2272 C64F67400AFBED91009732B5 /* lldirpicker.cpp */,
@@ -2282,7 +2301,6 @@
2282 1A3143E00A02B73D005B87E7 /* llprefschat.cpp */, 2301 1A3143E00A02B73D005B87E7 /* llprefschat.cpp */,
2283 1A3143DE0A02B737005B87E7 /* llprefsim.cpp */, 2302 1A3143DE0A02B737005B87E7 /* llprefsim.cpp */,
2284 1A3143D00A02B701005B87E7 /* llviewernetwork.cpp */, 2303 1A3143D00A02B701005B87E7 /* llviewernetwork.cpp */,
2285 FD870C4E09EAC19700F5956C /* lldrawpoolclouds.cpp */,
2286 FD870C4F09EAC19700F5956C /* lldrawpoolclouds.h */, 2304 FD870C4F09EAC19700F5956C /* lldrawpoolclouds.h */,
2287 A3077BFB09DCB8140059ED75 /* lldrawpoolstars.cpp */, 2305 A3077BFB09DCB8140059ED75 /* lldrawpoolstars.cpp */,
2288 A3077BFC09DCB8140059ED75 /* lldrawpoolstars.h */, 2306 A3077BFC09DCB8140059ED75 /* lldrawpoolstars.h */,
@@ -2305,7 +2323,6 @@
2305 2EA4CEEC09F83AC2008F60F7 /* llpanelgrouproles.cpp */, 2323 2EA4CEEC09F83AC2008F60F7 /* llpanelgrouproles.cpp */,
2306 2EA4CEED09F83BE8008F60F7 /* llpanelgrouplandmoney.cpp */, 2324 2EA4CEED09F83BE8008F60F7 /* llpanelgrouplandmoney.cpp */,
2307 FD6C9A4309C75B8900AA1849 /* llfloatertopobjects.h */, 2325 FD6C9A4309C75B8900AA1849 /* llfloatertopobjects.h */,
2308 2EC08F1B09EF129800F87546 /* llfloateraccounthistory.cpp */,
2309 FD6C9A3409C75A8500AA1849 /* llfloaterpermissionsmgr.cpp */, 2326 FD6C9A3409C75A8500AA1849 /* llfloaterpermissionsmgr.cpp */,
2310 2E6FE90D09FD560A00AF02FF /* llpanelgroupnotices.cpp */, 2327 2E6FE90D09FD560A00AF02FF /* llpanelgroupnotices.cpp */,
2311 FD6C9A3509C75A8500AA1849 /* llfloaterpermissionsmgr.h */, 2328 FD6C9A3509C75A8500AA1849 /* llfloaterpermissionsmgr.h */,
@@ -2318,8 +2335,6 @@
2318 FD6C9A2609C758BC00AA1849 /* llfollowcam.h */, 2335 FD6C9A2609C758BC00AA1849 /* llfollowcam.h */,
2319 FD6C9A2709C758BC00AA1849 /* llhudicon.cpp */, 2336 FD6C9A2709C758BC00AA1849 /* llhudicon.cpp */,
2320 FD6C9A2809C758BC00AA1849 /* llhudicon.h */, 2337 FD6C9A2809C758BC00AA1849 /* llhudicon.h */,
2321 99B0682709A54FBB00F4AD09 /* lldrawpoolhud.cpp */,
2322 99B0682809A54FBB00F4AD09 /* lldrawpoolhud.h */,
2323 99E43515092D64E6003AE728 /* llvoinventorylistener.h */, 2338 99E43515092D64E6003AE728 /* llvoinventorylistener.h */,
2324 99E43516092D64E6003AE728 /* llvoinventorylistener.cpp */, 2339 99E43516092D64E6003AE728 /* llvoinventorylistener.cpp */,
2325 99E43512092D64CC003AE728 /* llmemoryview.h */, 2340 99E43512092D64CC003AE728 /* llmemoryview.h */,
@@ -2425,7 +2440,6 @@
2425 26F52A14051F61DF00A80050 /* lldrawpoolsky.cpp */, 2440 26F52A14051F61DF00A80050 /* lldrawpoolsky.cpp */,
2426 26F529EF051F61DF00A80050 /* lldrawpoolterrain.cpp */, 2441 26F529EF051F61DF00A80050 /* lldrawpoolterrain.cpp */,
2427 26F52A7B051F61DF00A80050 /* lldrawpooltree.cpp */, 2442 26F52A7B051F61DF00A80050 /* lldrawpooltree.cpp */,
2428 26F52A9C051F61DF00A80050 /* lldrawpooltreenew.cpp */,
2429 26F52A3F051F61DF00A80050 /* lldrawpoolwater.cpp */, 2443 26F52A3F051F61DF00A80050 /* lldrawpoolwater.cpp */,
2430 26F52A84051F61DF00A80050 /* lldriverparam.cpp */, 2444 26F52A84051F61DF00A80050 /* lldriverparam.cpp */,
2431 26F52A62051F61DF00A80050 /* llemote.cpp */, 2445 26F52A62051F61DF00A80050 /* llemote.cpp */,
@@ -2435,7 +2449,6 @@
2435 26F52AD3051F61DF00A80050 /* llfilepicker.cpp */, 2449 26F52AD3051F61DF00A80050 /* llfilepicker.cpp */,
2436 8B2ECF9E0534C17A00A80059 /* llfirstuse.h */, 2450 8B2ECF9E0534C17A00A80059 /* llfirstuse.h */,
2437 26F52A82051F61DF00A80050 /* llfloaterabout.cpp */, 2451 26F52A82051F61DF00A80050 /* llfloaterabout.cpp */,
2438 26F52A07051F61DF00A80050 /* llfloateraccounthistory.cpp */,
2439 916083920649560B00CAF63E /* llfloateranimpreview.cpp */, 2452 916083920649560B00CAF63E /* llfloateranimpreview.cpp */,
2440 26F52A8B051F61DF00A80050 /* llfloateravatarinfo.cpp */, 2453 26F52A8B051F61DF00A80050 /* llfloateravatarinfo.cpp */,
2441 26F52A05051F61DF00A80050 /* llfloaterbuildoptions.cpp */, 2454 26F52A05051F61DF00A80050 /* llfloaterbuildoptions.cpp */,
@@ -2519,7 +2532,6 @@
2519 26F52AC7051F61DF00A80050 /* llpanelgroupvoting.cpp */, 2532 26F52AC7051F61DF00A80050 /* llpanelgroupvoting.cpp */,
2520 26F529EE051F61DF00A80050 /* llpanelinventory.cpp */, 2533 26F529EE051F61DF00A80050 /* llpanelinventory.cpp */,
2521 26F529ED051F61DF00A80050 /* llpanelland.cpp */, 2534 26F529ED051F61DF00A80050 /* llpanelland.cpp */,
2522 26F52A89051F61DF00A80050 /* llpanelmoney.cpp */,
2523 26F52A5A051F61DF00A80050 /* llpanelmorph.cpp */, 2535 26F52A5A051F61DF00A80050 /* llpanelmorph.cpp */,
2524 26F52A2B051F61DF00A80050 /* llpanelnetwork.cpp */, 2536 26F52A2B051F61DF00A80050 /* llpanelnetwork.cpp */,
2525 26F52A2A051F61DF00A80050 /* llpanelobject.cpp */, 2537 26F52A2A051F61DF00A80050 /* llpanelobject.cpp */,
@@ -2549,7 +2561,6 @@
2549 26F52A43051F61DF00A80050 /* llsurface.cpp */, 2561 26F52A43051F61DF00A80050 /* llsurface.cpp */,
2550 26F52A42051F61DF00A80050 /* llsurfacepatch.cpp */, 2562 26F52A42051F61DF00A80050 /* llsurfacepatch.cpp */,
2551 26F52AB8051F61DF00A80050 /* lltexlayer.cpp */, 2563 26F52AB8051F61DF00A80050 /* lltexlayer.cpp */,
2552 26F52A29051F61DF00A80050 /* lltexturebar.cpp */,
2553 26F52A28051F61DF00A80050 /* lltexturectrl.cpp */, 2564 26F52A28051F61DF00A80050 /* lltexturectrl.cpp */,
2554 26F52A27051F61DF00A80050 /* lltexturetable.cpp */, 2565 26F52A27051F61DF00A80050 /* lltexturetable.cpp */,
2555 26F529F6051F61DF00A80050 /* lltextureview.cpp */, 2566 26F529F6051F61DF00A80050 /* lltextureview.cpp */,
@@ -2608,13 +2619,11 @@
2608 26F529D1051F61DF00A80050 /* llvoclouds.cpp */, 2619 26F529D1051F61DF00A80050 /* llvoclouds.cpp */,
2609 26F529D0051F61DF00A80050 /* llvograss.cpp */, 2620 26F529D0051F61DF00A80050 /* llvograss.cpp */,
2610 26F529CF051F61DF00A80050 /* llvoground.cpp */, 2621 26F529CF051F61DF00A80050 /* llvoground.cpp */,
2611 26F529CE051F61DF00A80050 /* llvopart.cpp */,
2612 26F529CD051F61DF00A80050 /* llvopartgroup.cpp */, 2622 26F529CD051F61DF00A80050 /* llvopartgroup.cpp */,
2613 26F529CC051F61DF00A80050 /* llvosky.cpp */, 2623 26F529CC051F61DF00A80050 /* llvosky.cpp */,
2614 26F529CB051F61DF00A80050 /* llvosurfacepatch.cpp */, 2624 26F529CB051F61DF00A80050 /* llvosurfacepatch.cpp */,
2615 26F529CA051F61DF00A80050 /* llvotextbubble.cpp */, 2625 26F529CA051F61DF00A80050 /* llvotextbubble.cpp */,
2616 26F529C9051F61DF00A80050 /* llvotree.cpp */, 2626 26F529C9051F61DF00A80050 /* llvotree.cpp */,
2617 26F529C8051F61DF00A80050 /* llvotreenew.cpp */,
2618 26F529C7051F61DF00A80050 /* llvovolume.cpp */, 2627 26F529C7051F61DF00A80050 /* llvovolume.cpp */,
2619 26F529C6051F61DF00A80050 /* llvowater.cpp */, 2628 26F529C6051F61DF00A80050 /* llvowater.cpp */,
2620 26F529C5051F61DF00A80050 /* llwaterpatch.cpp */, 2629 26F529C5051F61DF00A80050 /* llwaterpatch.cpp */,
@@ -2642,6 +2651,15 @@
2642 6192211E074A9B57005E1F34 /* llcommon */ = { 2651 6192211E074A9B57005E1F34 /* llcommon */ = {
2643 isa = PBXGroup; 2652 isa = PBXGroup;
2644 children = ( 2653 children = (
2654 1A9897E70B98E2F4005C45D7 /* llbase32.h */,
2655 1A9897E80B98E2F4005C45D7 /* llbase32.cpp */,
2656 1A97C4540B8BCF9C00331A24 /* llliveappconfig.cpp */,
2657 1A97C4550B8BCF9C00331A24 /* llliveappconfig.h */,
2658 1A02016D0B7A85DE00D5C589 /* llbase64.cpp */,
2659 1A02016E0B7A85DE00D5C589 /* llbase64.h */,
2660 DA55FCB20B59F75C001C28B6 /* llerrorcontrol.h */,
2661 DA9C41120B54B8CA00DD6F44 /* lllivefile.cpp */,
2662 DA9C41130B54B8CA00DD6F44 /* lllivefile.h */,
2645 A2A57EBA0ADF10FD00F6EF97 /* llavatarconstants.h */, 2663 A2A57EBA0ADF10FD00F6EF97 /* llavatarconstants.h */,
2646 9B2863B00ABF637200A05D7C /* llerrorthread.cpp */, 2664 9B2863B00ABF637200A05D7C /* llerrorthread.cpp */,
2647 91E333730ABB79AC004351DE /* llrun.cpp */, 2665 91E333730ABB79AC004351DE /* llrun.cpp */,
@@ -2717,10 +2735,6 @@
2717 6192212E074A9B57005E1F34 /* llendianswizzle.h */, 2735 6192212E074A9B57005E1F34 /* llendianswizzle.h */,
2718 6192212F074A9B57005E1F34 /* llerror.cpp */, 2736 6192212F074A9B57005E1F34 /* llerror.cpp */,
2719 61922130074A9B57005E1F34 /* llerror.h */, 2737 61922130074A9B57005E1F34 /* llerror.h */,
2720 61922131074A9B57005E1F34 /* llerrorbuffer.cpp */,
2721 61922132074A9B57005E1F34 /* llerrorbuffer.h */,
2722 61922133074A9B57005E1F34 /* llerrorstream.cpp */,
2723 61922134074A9B57005E1F34 /* llerrorstream.h */,
2724 61922135074A9B57005E1F34 /* llfasttimer.cpp */, 2738 61922135074A9B57005E1F34 /* llfasttimer.cpp */,
2725 61922136074A9B57005E1F34 /* llfasttimer.h */, 2739 61922136074A9B57005E1F34 /* llfasttimer.h */,
2726 61922137074A9B57005E1F34 /* llfixedbuffer.cpp */, 2740 61922137074A9B57005E1F34 /* llfixedbuffer.cpp */,
@@ -2766,6 +2780,9 @@
2766 6192215E074A9B58005E1F34 /* string_table.h */, 2780 6192215E074A9B58005E1F34 /* string_table.h */,
2767 61922161074A9B58005E1F34 /* timing.cpp */, 2781 61922161074A9B58005E1F34 /* timing.cpp */,
2768 61922162074A9B58005E1F34 /* timing.h */, 2782 61922162074A9B58005E1F34 /* timing.h */,
2783 DA9C40DE0B54B4BA00DD6F44 /* llformat.h */,
2784 DA9C40DF0B54B4BA00DD6F44 /* llformat.cpp */,
2785 DA9C40EC0B54B5C700DD6F44 /* llerrorlegacy.h */,
2769 ); 2786 );
2770 name = llcommon; 2787 name = llcommon;
2771 path = ../llcommon; 2788 path = ../llcommon;
@@ -2867,6 +2884,15 @@
2867 619221B8074A9B58005E1F34 /* llmessage */ = { 2884 619221B8074A9B58005E1F34 /* llmessage */ = {
2868 isa = PBXGroup; 2885 isa = PBXGroup;
2869 children = ( 2886 children = (
2887 AA348DF80B0EAB31002C3015 /* llcurl.cpp */,
2888 AA348DF90B0EAB31002C3015 /* llcurl.h */,
2889 1A02017E0B7A861200D5C589 /* llblowfishcipher.cpp */,
2890 1A02017F0B7A861200D5C589 /* llblowfishcipher.h */,
2891 1A0201800B7A861200D5C589 /* llcipher.h */,
2892 1A0201810B7A861200D5C589 /* llnullcipher.cpp */,
2893 1A0201820B7A861200D5C589 /* llnullcipher.h */,
2894 1A0201830B7A861200D5C589 /* llxorcipher.cpp */,
2895 1A0201840B7A861200D5C589 /* llxorcipher.h */,
2870 91469E790B4486C10009E8F9 /* llmime.cpp */, 2896 91469E790B4486C10009E8F9 /* llmime.cpp */,
2871 91469E7A0B4486C10009E8F9 /* llmime.h */, 2897 91469E7A0B4486C10009E8F9 /* llmime.h */,
2872 FDFAD3E50AFFBA270048A0C7 /* llsdmessagesystem.cpp */, 2898 FDFAD3E50AFFBA270048A0C7 /* llsdmessagesystem.cpp */,
@@ -2909,7 +2935,6 @@
2909 619221BF074A9B59005E1F34 /* llcircuit.h */, 2935 619221BF074A9B59005E1F34 /* llcircuit.h */,
2910 99FBB071087365E90048A5CC /* llclassifiedflags.cpp */, 2936 99FBB071087365E90048A5CC /* llclassifiedflags.cpp */,
2911 99FBB072087365E90048A5CC /* llclassifiedflags.h */, 2937 99FBB072087365E90048A5CC /* llclassifiedflags.h */,
2912 619221C0074A9B59005E1F34 /* llcrypto.h */,
2913 619221C5074A9B59005E1F34 /* lldatapacker.cpp */, 2938 619221C5074A9B59005E1F34 /* lldatapacker.cpp */,
2914 619221C6074A9B59005E1F34 /* lldatapacker.h */, 2939 619221C6074A9B59005E1F34 /* lldatapacker.h */,
2915 619221C7074A9B59005E1F34 /* lldbstrings.h */, 2940 619221C7074A9B59005E1F34 /* lldbstrings.h */,
@@ -3325,6 +3350,8 @@
3325 61923D8D074AE4F2005E1F34 /* llimage */ = { 3350 61923D8D074AE4F2005E1F34 /* llimage */ = {
3326 isa = PBXGroup; 3351 isa = PBXGroup;
3327 children = ( 3352 children = (
3353 AAE98CC00B38FE0800E2F204 /* llimageworker.cpp */,
3354 AAE98CC10B38FE0800E2F204 /* llimageworker.h */,
3328 EB3EE725083AC2F2002BF676 /* llimagedxt.cpp */, 3355 EB3EE725083AC2F2002BF676 /* llimagedxt.cpp */,
3329 EB3EE726083AC2F2002BF676 /* llimagedxt.h */, 3356 EB3EE726083AC2F2002BF676 /* llimagedxt.h */,
3330 61923D9B074AE4F2005E1F34 /* llimage.cpp */, 3357 61923D9B074AE4F2005E1F34 /* llimage.cpp */,
@@ -3441,7 +3468,6 @@
3441 997B4BEB06015821001B0407 /* llvosurfacepatch.h */, 3468 997B4BEB06015821001B0407 /* llvosurfacepatch.h */,
3442 997B4BEC06015821001B0407 /* llvosky.h */, 3469 997B4BEC06015821001B0407 /* llvosky.h */,
3443 997B4BED06015821001B0407 /* llvopartgroup.h */, 3470 997B4BED06015821001B0407 /* llvopartgroup.h */,
3444 997B4BEE06015821001B0407 /* llvopart.h */,
3445 997B4BEF06015821001B0407 /* llvoground.h */, 3471 997B4BEF06015821001B0407 /* llvoground.h */,
3446 997B4BF006015821001B0407 /* llvograss.h */, 3472 997B4BF006015821001B0407 /* llvograss.h */,
3447 997B4BF106015821001B0407 /* llvoclouds.h */, 3473 997B4BF106015821001B0407 /* llvoclouds.h */,
@@ -3503,7 +3529,6 @@
3503 997B4C3406015821001B0407 /* lltextureview.h */, 3529 997B4C3406015821001B0407 /* lltextureview.h */,
3504 997B4C3506015821001B0407 /* lltexturetable.h */, 3530 997B4C3506015821001B0407 /* lltexturetable.h */,
3505 997B4C3606015821001B0407 /* lltexturectrl.h */, 3531 997B4C3606015821001B0407 /* lltexturectrl.h */,
3506 997B4C3706015821001B0407 /* lltexturebar.h */,
3507 997B4C3B06015821001B0407 /* lltexlayer.h */, 3532 997B4C3B06015821001B0407 /* lltexlayer.h */,
3508 997B4C3D06015821001B0407 /* lltable.h */, 3533 997B4C3D06015821001B0407 /* lltable.h */,
3509 997B4C4006015821001B0407 /* llstatview.h */, 3534 997B4C4006015821001B0407 /* llstatview.h */,
@@ -3536,7 +3561,6 @@
3536 997B4C6C06015821001B0407 /* llpanelobject.h */, 3561 997B4C6C06015821001B0407 /* llpanelobject.h */,
3537 997B4C6D06015822001B0407 /* llpanelnetwork.h */, 3562 997B4C6D06015822001B0407 /* llpanelnetwork.h */,
3538 997B4C6F06015822001B0407 /* llpanelmorph.h */, 3563 997B4C6F06015822001B0407 /* llpanelmorph.h */,
3539 997B4C7006015822001B0407 /* llpanelmoney.h */,
3540 997B4C7106015822001B0407 /* llpanelleaderboard.h */, 3564 997B4C7106015822001B0407 /* llpanelleaderboard.h */,
3541 997B4C7206015822001B0407 /* llpanelland.h */, 3565 997B4C7206015822001B0407 /* llpanelland.h */,
3542 997B4C7306015822001B0407 /* llpanelinventory.h */, 3566 997B4C7306015822001B0407 /* llpanelinventory.h */,
@@ -3628,7 +3652,6 @@
3628 997B4CE006015822001B0407 /* llfloaterbuildoptions.h */, 3652 997B4CE006015822001B0407 /* llfloaterbuildoptions.h */,
3629 997B4CE206015822001B0407 /* llfloateravatarinfo.h */, 3653 997B4CE206015822001B0407 /* llfloateravatarinfo.h */,
3630 997B4CE306015822001B0407 /* llfloaterauction.h */, 3654 997B4CE306015822001B0407 /* llfloaterauction.h */,
3631 997B4CE406015822001B0407 /* llfloateraccounthistory.h */,
3632 997B4CE506015822001B0407 /* llfloaterabout.h */, 3655 997B4CE506015822001B0407 /* llfloaterabout.h */,
3633 997B4CE706015822001B0407 /* llfirstuse.h */, 3656 997B4CE706015822001B0407 /* llfirstuse.h */,
3634 997B4CE906015822001B0407 /* llfilepicker.h */, 3657 997B4CE906015822001B0407 /* llfilepicker.h */,
@@ -3696,12 +3719,8 @@
3696 D628314D0B4F3FA100F8830F /* llrender */ = { 3719 D628314D0B4F3FA100F8830F /* llrender */ = {
3697 isa = PBXGroup; 3720 isa = PBXGroup;
3698 children = ( 3721 children = (
3699 D62831510B4F3FA100F8830F /* llagpmempool.cpp */, 3722 A30273550B3A13D800704420 /* llvertexbuffer.cpp */,
3700 D62831520B4F3FA100F8830F /* llagpmempool.h */, 3723 A30273560B3A13D800704420 /* llvertexbuffer.h */,
3701 D62831530B4F3FA100F8830F /* llagpmempoolapple.cpp */,
3702 D62831540B4F3FA100F8830F /* llagpmempoolapple.h */,
3703 D62831550B4F3FA100F8830F /* llagpmempoolarb.cpp */,
3704 D62831560B4F3FA100F8830F /* llagpmempoolarb.h */,
3705 D628315B0B4F3FA100F8830F /* llfont.cpp */, 3724 D628315B0B4F3FA100F8830F /* llfont.cpp */,
3706 D628315C0B4F3FA100F8830F /* llfont.h */, 3725 D628315C0B4F3FA100F8830F /* llfont.h */,
3707 D628315D0B4F3FA100F8830F /* llfontgl.cpp */, 3726 D628315D0B4F3FA100F8830F /* llfontgl.cpp */,
@@ -3747,6 +3766,7 @@
3747 FDE8761909BE9C7D00AF6316 /* Third Party Libraries */ = { 3766 FDE8761909BE9C7D00AF6316 /* Third Party Libraries */ = {
3748 isa = PBXGroup; 3767 isa = PBXGroup;
3749 children = ( 3768 children = (
3769 FDD3FD700B6A89A0009173F1 /* libcares.a */,
3750 FD34696A0B5C3C55007318E5 /* libllcurl.a */, 3770 FD34696A0B5C3C55007318E5 /* libllcurl.a */,
3751 FDE8764E09BEA39600AF6316 /* libapr-1.a */, 3771 FDE8764E09BEA39600AF6316 /* libapr-1.a */,
3752 FD6C9A5209C773A000AA1849 /* libaprutil-1.a */, 3772 FD6C9A5209C773A000AA1849 /* libaprutil-1.a */,
@@ -3950,7 +3970,7 @@
3950 ); 3970 );
3951 runOnlyForDeploymentPostprocessing = 0; 3971 runOnlyForDeploymentPostprocessing = 0;
3952 shellPath = /bin/sh; 3972 shellPath = /bin/sh;
3953 shellScript = "# exit on any error\nset -e\n\n# For some reason, this isn't provided.\nRESOURCES_DIRECTORY=\"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.app/Contents/Resources/\"\nFRAMEWORKS_DIRECTORY=\"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.app/Contents/Frameworks/\"\nMACOS_DIRECTORY=\"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.app/Contents/MacOS\"\n\n# SRCROOT is the project directory (linden/indra/newview)\n\n# make sure the resources directory is there\nmkdir -p \"${RESOURCES_DIRECTORY}\"\n\n# rsync the necessary bits from the newview directory into the Resources directory of the application bundle\n# See the include/exclude list in rsyncfiles.txt for which files are actually copied.\n# Note that having the --exclude='/*' at the end here is a safety feature.\n# if all excludes were in rsyncfiles.txt and that file disappeared, it would be possible for source code to get copied into the application bundle.\n# This would be, as we say, \"bad\".\nrsync --verbose --recursive --checksum --include-from=\"${SRCROOT}/rsyncfiles.txt\" --exclude='/*' \"${SRCROOT}/\" \"${RESOURCES_DIRECTORY}/\"\n\ncp \"${SRCROOT}/../../scripts/messages/message_template.msg\" \"${RESOURCES_DIRECTORY}/app_settings/message_template.msg\"\n\n# make sure the <bundle>/Contents/MacOS/ directory exists (it may not be there yet on a clean build)\nmkdir -p \"${MACOS_DIRECTORY}\"\n\n# Expand the tar file containing the assorted mozilla bits into <bundle>/Contents/MacOS/\ntar -zx -C \"${MACOS_DIRECTORY}\" -f \"${SRCROOT}/mozilla-universal-darwin.tgz\"\n\n# replace the default theme with our custom theme (so scrollbars work).\ncp \"${SRCROOT}/mozilla-theme/classic.jar\" \"${SRCROOT}/mozilla-theme/classic.manifest\" \"${MACOS_DIRECTORY}/chrome\"\n\n#copy over the universal llkdu dynamic library to the resource directory if it doesn't already exist\nif [ ! -f \"${RESOURCES_DIRECTORY}/libllkdu.dylib\" ]\nthen\n\tcp \"${SRCROOT}/../../libraries/universal-darwin/lib_release/libllkdu.dylib\" \"${RESOURCES_DIRECTORY}\"\nfi "; 3973 shellScript = "# exit on any error\nset -e\n\n# Copy the necessary resources into the build directory.\npython viewer_manifest.py --actions=\"copy\" --configuration=\"${CONFIGURATION}\" \"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.app\"\n";
3954 }; 3974 };
3955 FD53B40409BDF9F600BFE3BC /* ShellScript */ = { 3975 FD53B40409BDF9F600BFE3BC /* ShellScript */ = {
3956 isa = PBXShellScriptBuildPhase; 3976 isa = PBXShellScriptBuildPhase;
@@ -3963,7 +3983,7 @@
3963 ); 3983 );
3964 runOnlyForDeploymentPostprocessing = 0; 3984 runOnlyForDeploymentPostprocessing = 0;
3965 shellPath = /bin/sh; 3985 shellPath = /bin/sh;
3966 shellScript = "LIBS=\"apr-1 aprutil-1 expat ogg vorbis fmod freetype llcurl lljpeg openjpeg vorbisenc vorbisfile xmlrpc\"\nLIBDIR=\"${SRCROOT}/../../libraries\"\n\ncd \"${LIBDIR}\"\n\nif [ \\! -e ppc-darwin ]\nthen\n\tln -s powerpc-darwin ppc-darwin\nfi\n\nmkdir -p \"${BUILT_PRODUCTS_DIR}\"\n\nfor i in ${LIBS}; do\n\tNEED_UPDATE=false\n\tARCH_COUNT=0\n\tOUT=\"${BUILT_PRODUCTS_DIR}/lib$i.a\"\n\tTEST_ARCH=`echo \"${ARCHS}\" | grep i386`\n\tif [ -n \"$TEST_ARCH\" ]; then\n\t\tIN_i386=\"i386-darwin/lib_release/lib$i.a\"\n\t\tARCH_COUNT=`expr $ARCH_COUNT \"+\" 1`\n\t\tif [ \"$IN_i386\" -nt \"$OUT\" ]; then\n\t\t\tNEED_UPDATE=true\n\t\tfi\n\tfi\n\tTEST_ARCH=`echo \"${ARCHS}\" | grep ppc`\n\tif [ -n \"$TEST_ARCH\" ]; then\n\t\tIN_ppc=\"ppc-darwin/lib_release/lib$i.a\"\n\t\tARCH_COUNT=`expr $ARCH_COUNT \"+\" 1`\n\t\tif [ \"$IN_ppc\" -nt \"$OUT\" ]; then\n\t\t\tNEED_UPDATE=true\n\t\tfi\n\tfi\n\tif [ $ARCH_COUNT -eq 0 ]; then\n\t\techo \"No supported architectures found.\"\n\t\texit 1\n\tfi\n\tif [ ! -f \"$OUT\" -o NEED_UPDATE = \"true\" ]; then\n\t\techo Preparing third party library lib$i.a\n\t\tif [ $ARCH_COUNT -eq 1 ]; then\n\t\t\tIN=\"$IN_i386\"\"$IN_ppc\"\n\t\t\t#echo cp \"$IN\" \"$OUT\"\n\t\t\tcp \"$IN\" \"$OUT\"\n\t\telse\n\t\t\t#echo libtool -static -o \"$OUT\" \"$IN_i386\" \"$IN_ppc\"\n\t\t\tlibtool -static -o \"$OUT\" \"$IN_i386\" \"$IN_ppc\"\n\t\tfi\n\t\tranlib \"$OUT\"\n\telse\n\t\techo Third party library lib$i.a is up to date\n\tfi\ndone\n"; 3986 shellScript = "# Glue together intel and ppc versions of .a files\nLIBS=\"apr-1 aprutil-1 expat ogg vorbis fmod freetype cares llcurl lljpeg openjpeg vorbisenc vorbisfile xmlrpc\"\nLIBDIR=\"${SRCROOT}/../../libraries\"\n\ncd \"${LIBDIR}\"\n\nif [ \\! -e ppc-darwin ]\nthen\n\tln -s powerpc-darwin ppc-darwin\nfi\n\nmkdir -p \"${BUILT_PRODUCTS_DIR}\"\n\nfor i in ${LIBS}; do\n\tNEED_UPDATE=false\n\tARCH_COUNT=0\n\tOUT=\"${BUILT_PRODUCTS_DIR}/lib$i.a\"\n\tTEST_ARCH=`echo \"${ARCHS}\" | grep i386`\n\tif [ -n \"$TEST_ARCH\" ]; then\n\t\tIN_i386=\"i386-darwin/lib_release/lib$i.a\"\n\t\tARCH_COUNT=`expr $ARCH_COUNT \"+\" 1`\n\t\tif [ \"$IN_i386\" -nt \"$OUT\" ]; then\n\t\t\tNEED_UPDATE=true\n\t\tfi\n\tfi\n\tTEST_ARCH=`echo \"${ARCHS}\" | grep ppc`\n\tif [ -n \"$TEST_ARCH\" ]; then\n\t\tIN_ppc=\"ppc-darwin/lib_release/lib$i.a\"\n\t\tARCH_COUNT=`expr $ARCH_COUNT \"+\" 1`\n\t\tif [ \"$IN_ppc\" -nt \"$OUT\" ]; then\n\t\t\tNEED_UPDATE=true\n\t\tfi\n\tfi\n\tif [ $ARCH_COUNT -eq 0 ]; then\n\t\techo \"No supported architectures found.\"\n\t\texit 1\n\tfi\n\tif [ ! -f \"$OUT\" -o NEED_UPDATE = \"true\" ]; then\n\t\techo Preparing third party library lib$i.a\n\t\tif [ $ARCH_COUNT -eq 1 ]; then\n\t\t\tIN=\"$IN_i386\"\"$IN_ppc\"\n\t\t\t#echo cp \"$IN\" \"$OUT\"\n\t\t\tcp \"$IN\" \"$OUT\"\n\t\telse\n\t\t\t#echo libtool -static -o \"$OUT\" \"$IN_i386\" \"$IN_ppc\"\n\t\t\tlibtool -static -o \"$OUT\" \"$IN_i386\" \"$IN_ppc\"\n\t\tfi\n\t\tranlib \"$OUT\"\n\telse\n\t\techo Third party library lib$i.a is up to date\n\tfi\ndone\n";
3967 }; 3987 };
3968/* End PBXShellScriptBuildPhase section */ 3988/* End PBXShellScriptBuildPhase section */
3969 3989
@@ -3994,13 +4014,11 @@
3994 5503BB3F05446B20003D051F /* llwaterpatch.cpp in Sources */, 4014 5503BB3F05446B20003D051F /* llwaterpatch.cpp in Sources */,
3995 5503BB4005446B20003D051F /* llvowater.cpp in Sources */, 4015 5503BB4005446B20003D051F /* llvowater.cpp in Sources */,
3996 5503BB4105446B20003D051F /* llvovolume.cpp in Sources */, 4016 5503BB4105446B20003D051F /* llvovolume.cpp in Sources */,
3997 5503BB4205446B20003D051F /* llvotreenew.cpp in Sources */,
3998 5503BB4305446B20003D051F /* llvotree.cpp in Sources */, 4017 5503BB4305446B20003D051F /* llvotree.cpp in Sources */,
3999 5503BB4405446B20003D051F /* llvotextbubble.cpp in Sources */, 4018 5503BB4405446B20003D051F /* llvotextbubble.cpp in Sources */,
4000 5503BB4505446B20003D051F /* llvosurfacepatch.cpp in Sources */, 4019 5503BB4505446B20003D051F /* llvosurfacepatch.cpp in Sources */,
4001 5503BB4605446B20003D051F /* llvosky.cpp in Sources */, 4020 5503BB4605446B20003D051F /* llvosky.cpp in Sources */,
4002 5503BB4705446B20003D051F /* llvopartgroup.cpp in Sources */, 4021 5503BB4705446B20003D051F /* llvopartgroup.cpp in Sources */,
4003 5503BB4805446B20003D051F /* llvopart.cpp in Sources */,
4004 5503BB4905446B20003D051F /* llvoground.cpp in Sources */, 4022 5503BB4905446B20003D051F /* llvoground.cpp in Sources */,
4005 5503BB4A05446B20003D051F /* llvograss.cpp in Sources */, 4023 5503BB4A05446B20003D051F /* llvograss.cpp in Sources */,
4006 5503BB4B05446B20003D051F /* llvoclouds.cpp in Sources */, 4024 5503BB4B05446B20003D051F /* llvoclouds.cpp in Sources */,
@@ -4047,7 +4065,6 @@
4047 5503BB7D05446B20003D051F /* llconsole.cpp in Sources */, 4065 5503BB7D05446B20003D051F /* llconsole.cpp in Sources */,
4048 5503BB7E05446B20003D051F /* lllandmarklist.cpp in Sources */, 4066 5503BB7E05446B20003D051F /* lllandmarklist.cpp in Sources */,
4049 5503BB7F05446B20003D051F /* llfloaterbuildoptions.cpp in Sources */, 4067 5503BB7F05446B20003D051F /* llfloaterbuildoptions.cpp in Sources */,
4050 5503BB8105446B20003D051F /* llfloateraccounthistory.cpp in Sources */,
4051 5503BB8605446B20003D051F /* lluserauth.cpp in Sources */, 4068 5503BB8605446B20003D051F /* lluserauth.cpp in Sources */,
4052 5503BB8705446B20003D051F /* llurl.cpp in Sources */, 4069 5503BB8705446B20003D051F /* llurl.cpp in Sources */,
4053 5503BB8805446B20003D051F /* lluploaddialog.cpp in Sources */, 4070 5503BB8805446B20003D051F /* lluploaddialog.cpp in Sources */,
@@ -4068,7 +4085,6 @@
4068 5503BBA005446B20003D051F /* lldrawpoolalpha.cpp in Sources */, 4085 5503BBA005446B20003D051F /* lldrawpoolalpha.cpp in Sources */,
4069 5503BBA105446B20003D051F /* lltexturetable.cpp in Sources */, 4086 5503BBA105446B20003D051F /* lltexturetable.cpp in Sources */,
4070 5503BBA205446B20003D051F /* lltexturectrl.cpp in Sources */, 4087 5503BBA205446B20003D051F /* lltexturectrl.cpp in Sources */,
4071 5503BBA305446B20003D051F /* lltexturebar.cpp in Sources */,
4072 5503BBA405446B20003D051F /* llpanelobject.cpp in Sources */, 4088 5503BBA405446B20003D051F /* llpanelobject.cpp in Sources */,
4073 5503BBA505446B20003D051F /* llpanelnetwork.cpp in Sources */, 4089 5503BBA505446B20003D051F /* llpanelnetwork.cpp in Sources */,
4074 5503BBA605446B20003D051F /* lldrawpool.cpp in Sources */, 4090 5503BBA605446B20003D051F /* lldrawpool.cpp in Sources */,
@@ -4134,7 +4150,6 @@
4134 5503BBFD05446B20003D051F /* llhoverview.cpp in Sources */, 4150 5503BBFD05446B20003D051F /* llhoverview.cpp in Sources */,
4135 5503BBFE05446B20003D051F /* llcylinder.cpp in Sources */, 4151 5503BBFE05446B20003D051F /* llcylinder.cpp in Sources */,
4136 5503BBFF05446B20003D051F /* llhippo.cpp in Sources */, 4152 5503BBFF05446B20003D051F /* llhippo.cpp in Sources */,
4137 5503BC0105446B20003D051F /* llpanelmoney.cpp in Sources */,
4138 5503BC0305446B20003D051F /* llfloateravatarinfo.cpp in Sources */, 4153 5503BC0305446B20003D051F /* llfloateravatarinfo.cpp in Sources */,
4139 5503BC0405446B20003D051F /* llcallingcard.cpp in Sources */, 4154 5503BC0405446B20003D051F /* llcallingcard.cpp in Sources */,
4140 5503BC0505446B20003D051F /* llhudeffectbeam.cpp in Sources */, 4155 5503BC0505446B20003D051F /* llhudeffectbeam.cpp in Sources */,
@@ -4149,7 +4164,6 @@
4149 5503BC1005446B20003D051F /* llnamelistctrl.cpp in Sources */, 4164 5503BC1005446B20003D051F /* llnamelistctrl.cpp in Sources */,
4150 5503BC1205446B20003D051F /* llmaniptranslate.cpp in Sources */, 4165 5503BC1205446B20003D051F /* llmaniptranslate.cpp in Sources */,
4151 5503BC1305446B20003D051F /* llmanipscale.cpp in Sources */, 4166 5503BC1305446B20003D051F /* llmanipscale.cpp in Sources */,
4152 5503BC1405446B20003D051F /* lldrawpooltreenew.cpp in Sources */,
4153 5503BC1505446B20003D051F /* head.cpp in Sources */, 4167 5503BC1505446B20003D051F /* head.cpp in Sources */,
4154 5503BC1705446B20003D051F /* llfloaternamedesc.cpp in Sources */, 4168 5503BC1705446B20003D051F /* llfloaternamedesc.cpp in Sources */,
4155 5503BC1805446B20003D051F /* llpanelplace.cpp in Sources */, 4169 5503BC1805446B20003D051F /* llpanelplace.cpp in Sources */,
@@ -4334,7 +4348,6 @@
4334 99BB516F099AC1E9004BF9F2 /* llviewchildren.cpp in Sources */, 4348 99BB516F099AC1E9004BF9F2 /* llviewchildren.cpp in Sources */,
4335 99BB5172099AC1FC004BF9F2 /* llcurrencyuimanager.cpp in Sources */, 4349 99BB5172099AC1FC004BF9F2 /* llcurrencyuimanager.cpp in Sources */,
4336 99BB5176099AC2A4004BF9F2 /* llconfirmationmanager.cpp in Sources */, 4350 99BB5176099AC2A4004BF9F2 /* llconfirmationmanager.cpp in Sources */,
4337 99B0682909A54FBB00F4AD09 /* lldrawpoolhud.cpp in Sources */,
4338 FD6C9A2909C758BC00AA1849 /* llfloaterscriptdebug.cpp in Sources */, 4351 FD6C9A2909C758BC00AA1849 /* llfloaterscriptdebug.cpp in Sources */,
4339 FD6C9A2A09C758BC00AA1849 /* llfloatertelehub.cpp in Sources */, 4352 FD6C9A2A09C758BC00AA1849 /* llfloatertelehub.cpp in Sources */,
4340 FD6C9A2B09C758BC00AA1849 /* llfollowcam.cpp in Sources */, 4353 FD6C9A2B09C758BC00AA1849 /* llfollowcam.cpp in Sources */,
@@ -4353,7 +4366,6 @@
4353 A3077C0909DCB8140059ED75 /* llfloaterhtmlhelp.cpp in Sources */, 4366 A3077C0909DCB8140059ED75 /* llfloaterhtmlhelp.cpp in Sources */,
4354 A3077C0B09DCB8140059ED75 /* llpanelvolume.cpp in Sources */, 4367 A3077C0B09DCB8140059ED75 /* llpanelvolume.cpp in Sources */,
4355 A3077C0C09DCB8140059ED75 /* llvostars.cpp in Sources */, 4368 A3077C0C09DCB8140059ED75 /* llvostars.cpp in Sources */,
4356 FD870C5009EAC19700F5956C /* lldrawpoolclouds.cpp in Sources */,
4357 1AFA409C0A2DFC7F00C13F70 /* llviewernetwork.cpp in Sources */, 4369 1AFA409C0A2DFC7F00C13F70 /* llviewernetwork.cpp in Sources */,
4358 1AFA409F0A2DFC8700C13F70 /* llprefsim.cpp in Sources */, 4370 1AFA409F0A2DFC8700C13F70 /* llprefsim.cpp in Sources */,
4359 1AFA40A20A2DFC9000C13F70 /* llprefschat.cpp in Sources */, 4371 1AFA40A20A2DFC9000C13F70 /* llprefschat.cpp in Sources */,
@@ -4389,25 +4401,29 @@
4389 C64F673F0AFBED80009732B5 /* lllogchat.cpp in Sources */, 4401 C64F673F0AFBED80009732B5 /* lllogchat.cpp in Sources */,
4390 C64F67420AFBED91009732B5 /* lldirpicker.cpp in Sources */, 4402 C64F67420AFBED91009732B5 /* lldirpicker.cpp in Sources */,
4391 1AF7C1E40AF6C44800C4BF4A /* llweb.cpp in Sources */, 4403 1AF7C1E40AF6C44800C4BF4A /* llweb.cpp in Sources */,
4404 AA02B9BC0B0CE44D00F2996D /* lltexturefetch.cpp in Sources */,
4392 FD59ED5F0AF2AF460086642A /* llassetuploadresponders.cpp in Sources */, 4405 FD59ED5F0AF2AF460086642A /* llassetuploadresponders.cpp in Sources */,
4393 FDCB54F60AFBC5060033B433 /* llhttpnode.cpp in Sources */, 4406 FDCB54F60AFBC5060033B433 /* llhttpnode.cpp in Sources */,
4394 FDCB55290AFBD4310033B433 /* lleventpoll.cpp in Sources */, 4407 FDCB55290AFBD4310033B433 /* lleventpoll.cpp in Sources */,
4395 FDFAD3EA0AFFBB230048A0C7 /* llsdmessagesystem.cpp in Sources */, 4408 FDFAD3EA0AFFBB230048A0C7 /* llsdmessagesystem.cpp in Sources */,
4409 AA348DFA0B0EAB31002C3015 /* llcurl.cpp in Sources */,
4410 AAF5FFD20B13F71900D28A84 /* lltexturecache.cpp in Sources */,
4396 C1F5D0A50B138AEB00827F1D /* lluserrelations.cpp in Sources */, 4411 C1F5D0A50B138AEB00827F1D /* lluserrelations.cpp in Sources */,
4397 D62830DB0B4DC76300F8830F /* llimagej2coj.cpp in Sources */, 4412 D62830DB0B4DC76300F8830F /* llimagej2coj.cpp in Sources */,
4413 AAE98CC20B38FE0800E2F204 /* llimageworker.cpp in Sources */,
4398 1AEF0A580B2DFE67003F107C /* llctrlselectioninterface.cpp in Sources */, 4414 1AEF0A580B2DFE67003F107C /* llctrlselectioninterface.cpp in Sources */,
4399 1AEF0A5B0B2DFE72003F107C /* llrootview.cpp in Sources */, 4415 1AEF0A5B0B2DFE72003F107C /* llrootview.cpp in Sources */,
4416 A30273570B3A13D800704420 /* llvertexbuffer.cpp in Sources */,
4400 1A1F130C0B3919F100845A6C /* lleditmenuhandler.cpp in Sources */, 4417 1A1F130C0B3919F100845A6C /* lleditmenuhandler.cpp in Sources */,
4401 C16C08500B4AE6C7009AD67F /* llfloaterinspect.cpp in Sources */, 4418 C16C08500B4AE6C7009AD67F /* llfloaterinspect.cpp in Sources */,
4402 D628316C0B4F3FA200F8830F /* llagpmempool.cpp in Sources */, 4419 A32748C10B5F38A80099BE18 /* llfont.cpp in Sources */,
4403 D628316D0B4F3FA200F8830F /* llagpmempoolapple.cpp in Sources */, 4420 A32748BF0B5F38A00099BE18 /* llfontgl.cpp in Sources */,
4404 D628316E0B4F3FA200F8830F /* llagpmempoolarb.cpp in Sources */, 4421 A32748C00B5F38A20099BE18 /* llimagegl.cpp in Sources */,
4405 D62831710B4F3FA200F8830F /* llfont.cpp in Sources */, 4422 A3274AD20B5F39130099BE18 /* text_out.cpp in Sources */,
4406 D62831720B4F3FA200F8830F /* llfontgl.cpp in Sources */, 4423 1A02016F0B7A85DE00D5C589 /* llbase64.cpp in Sources */,
4407 D62831730B4F3FA200F8830F /* llgldbg.cpp in Sources */, 4424 1A0201850B7A861200D5C589 /* llblowfishcipher.cpp in Sources */,
4408 D62831740B4F3FA200F8830F /* llimagegl.cpp in Sources */, 4425 1A0201860B7A861200D5C589 /* llnullcipher.cpp in Sources */,
4409 D62831760B4F3FA200F8830F /* llvertexprogramgl.cpp in Sources */, 4426 1A0201870B7A861200D5C589 /* llxorcipher.cpp in Sources */,
4410 D62831780B4F3FA200F8830F /* text_out.cpp in Sources */,
4411 ); 4427 );
4412 runOnlyForDeploymentPostprocessing = 0; 4428 runOnlyForDeploymentPostprocessing = 0;
4413 }; 4429 };
@@ -4437,8 +4453,6 @@
4437 619222E8074A9B5B005E1F34 /* bitpack.cpp in Sources */, 4453 619222E8074A9B5B005E1F34 /* bitpack.cpp in Sources */,
4438 619222F0074A9B5B005E1F34 /* llcriticaldamp.cpp in Sources */, 4454 619222F0074A9B5B005E1F34 /* llcriticaldamp.cpp in Sources */,
4439 619222F8074A9B5B005E1F34 /* llerror.cpp in Sources */, 4455 619222F8074A9B5B005E1F34 /* llerror.cpp in Sources */,
4440 619222FA074A9B5B005E1F34 /* llerrorbuffer.cpp in Sources */,
4441 619222FC074A9B5B005E1F34 /* llerrorstream.cpp in Sources */,
4442 619222FE074A9B5B005E1F34 /* llfasttimer.cpp in Sources */, 4456 619222FE074A9B5B005E1F34 /* llfasttimer.cpp in Sources */,
4443 61922300074A9B5B005E1F34 /* llfixedbuffer.cpp in Sources */, 4457 61922300074A9B5B005E1F34 /* llfixedbuffer.cpp in Sources */,
4444 61922302074A9B5B005E1F34 /* llframetimer.cpp in Sources */, 4458 61922302074A9B5B005E1F34 /* llframetimer.cpp in Sources */,
@@ -4582,6 +4596,10 @@
4582 D651349D0B3C40870042C56E /* llqueuedthread.cpp in Sources */, 4596 D651349D0B3C40870042C56E /* llqueuedthread.cpp in Sources */,
4583 91469E7B0B4486C10009E8F9 /* llmime.cpp in Sources */, 4597 91469E7B0B4486C10009E8F9 /* llmime.cpp in Sources */,
4584 913B26990B4DDCDA0030C3EC /* lllandmark.cpp in Sources */, 4598 913B26990B4DDCDA0030C3EC /* lllandmark.cpp in Sources */,
4599 DA9C40E00B54B4BA00DD6F44 /* llformat.cpp in Sources */,
4600 DA9C41140B54B8CA00DD6F44 /* lllivefile.cpp in Sources */,
4601 1A97C4560B8BCF9C00331A24 /* llliveappconfig.cpp in Sources */,
4602 1A9897E90B98E2F4005C45D7 /* llbase32.cpp in Sources */,
4585 ); 4603 );
4586 runOnlyForDeploymentPostprocessing = 0; 4604 runOnlyForDeploymentPostprocessing = 0;
4587 }; 4605 };
@@ -4679,8 +4697,10 @@
4679 LIBRARY_SEARCH_PATHS = ( 4697 LIBRARY_SEARCH_PATHS = (
4680 "$(inherited)", 4698 "$(inherited)",
4681 "$(LIBRARY_SEARCH_PATHS_QUOTED_1)", 4699 "$(LIBRARY_SEARCH_PATHS_QUOTED_1)",
4700 "$(LIBRARY_SEARCH_PATHS_QUOTED_2)",
4682 ); 4701 );
4683 LIBRARY_SEARCH_PATHS_QUOTED_1 = "\"$(SRCROOT)/build/Universal\""; 4702 LIBRARY_SEARCH_PATHS_QUOTED_1 = "\"$(SRCROOT)/build/Universal\"";
4703 LIBRARY_SEARCH_PATHS_QUOTED_2 = "\"$(SRCROOT)/build/Universal\"";
4684 PRODUCT_NAME = AutoUpdater; 4704 PRODUCT_NAME = AutoUpdater;
4685 }; 4705 };
4686 name = Universal; 4706 name = Universal;
@@ -4694,8 +4714,10 @@
4694 LIBRARY_SEARCH_PATHS = ( 4714 LIBRARY_SEARCH_PATHS = (
4695 "$(inherited)", 4715 "$(inherited)",
4696 "$(LIBRARY_SEARCH_PATHS_QUOTED_1)", 4716 "$(LIBRARY_SEARCH_PATHS_QUOTED_1)",
4717 "$(LIBRARY_SEARCH_PATHS_QUOTED_2)",
4697 ); 4718 );
4698 LIBRARY_SEARCH_PATHS_QUOTED_1 = "\"$(SRCROOT)/build/Universal\""; 4719 LIBRARY_SEARCH_PATHS_QUOTED_1 = "\"$(SRCROOT)/build/Universal\"";
4720 LIBRARY_SEARCH_PATHS_QUOTED_2 = "\"$(SRCROOT)/build/Universal\"";
4699 PRODUCT_NAME = crashreporter; 4721 PRODUCT_NAME = crashreporter;
4700 }; 4722 };
4701 name = Universal; 4723 name = Universal;
@@ -4715,8 +4737,10 @@
4715 "$(LIBRARY_SEARCH_PATHS)", 4737 "$(LIBRARY_SEARCH_PATHS)",
4716 "$(SRCROOT)/../../libraries/universal-darwin/lib_release", 4738 "$(SRCROOT)/../../libraries/universal-darwin/lib_release",
4717 "$(LIBRARY_SEARCH_PATHS_QUOTED_1)", 4739 "$(LIBRARY_SEARCH_PATHS_QUOTED_1)",
4740 "$(LIBRARY_SEARCH_PATHS_QUOTED_2)",
4718 ); 4741 );
4719 LIBRARY_SEARCH_PATHS_QUOTED_1 = "\"$(SRCROOT)/build/Universal\""; 4742 LIBRARY_SEARCH_PATHS_QUOTED_1 = "\"$(SRCROOT)/build/Universal\"";
4743 LIBRARY_SEARCH_PATHS_QUOTED_2 = "\"$(SRCROOT)/build/Universal\"";
4720 OTHER_LDFLAGS = ""; 4744 OTHER_LDFLAGS = "";
4721 PRODUCT_NAME = "Second Life"; 4745 PRODUCT_NAME = "Second Life";
4722 SEPARATE_STRIP = YES; 4746 SEPARATE_STRIP = YES;
@@ -4857,8 +4881,10 @@
4857 LIBRARY_SEARCH_PATHS = ( 4881 LIBRARY_SEARCH_PATHS = (
4858 "$(inherited)", 4882 "$(inherited)",
4859 "$(LIBRARY_SEARCH_PATHS_QUOTED_1)", 4883 "$(LIBRARY_SEARCH_PATHS_QUOTED_1)",
4884 "$(LIBRARY_SEARCH_PATHS_QUOTED_2)",
4860 ); 4885 );
4861 LIBRARY_SEARCH_PATHS_QUOTED_1 = "\"$(SRCROOT)/build/Universal\""; 4886 LIBRARY_SEARCH_PATHS_QUOTED_1 = "\"$(SRCROOT)/build/Universal\"";
4887 LIBRARY_SEARCH_PATHS_QUOTED_2 = "\"$(SRCROOT)/build/Universal\"";
4862 PRODUCT_NAME = crashreporter; 4888 PRODUCT_NAME = crashreporter;
4863 }; 4889 };
4864 name = Development; 4890 name = Development;
@@ -4872,8 +4898,10 @@
4872 LIBRARY_SEARCH_PATHS = ( 4898 LIBRARY_SEARCH_PATHS = (
4873 "$(inherited)", 4899 "$(inherited)",
4874 "$(LIBRARY_SEARCH_PATHS_QUOTED_1)", 4900 "$(LIBRARY_SEARCH_PATHS_QUOTED_1)",
4901 "$(LIBRARY_SEARCH_PATHS_QUOTED_2)",
4875 ); 4902 );
4876 LIBRARY_SEARCH_PATHS_QUOTED_1 = "\"$(SRCROOT)/build/Universal\""; 4903 LIBRARY_SEARCH_PATHS_QUOTED_1 = "\"$(SRCROOT)/build/Universal\"";
4904 LIBRARY_SEARCH_PATHS_QUOTED_2 = "\"$(SRCROOT)/build/Universal\"";
4877 PRODUCT_NAME = crashreporter; 4905 PRODUCT_NAME = crashreporter;
4878 }; 4906 };
4879 name = Deployment; 4907 name = Deployment;
@@ -4887,8 +4915,10 @@
4887 LIBRARY_SEARCH_PATHS = ( 4915 LIBRARY_SEARCH_PATHS = (
4888 "$(inherited)", 4916 "$(inherited)",
4889 "$(LIBRARY_SEARCH_PATHS_QUOTED_1)", 4917 "$(LIBRARY_SEARCH_PATHS_QUOTED_1)",
4918 "$(LIBRARY_SEARCH_PATHS_QUOTED_2)",
4890 ); 4919 );
4891 LIBRARY_SEARCH_PATHS_QUOTED_1 = "\"$(SRCROOT)/build/Universal\""; 4920 LIBRARY_SEARCH_PATHS_QUOTED_1 = "\"$(SRCROOT)/build/Universal\"";
4921 LIBRARY_SEARCH_PATHS_QUOTED_2 = "\"$(SRCROOT)/build/Universal\"";
4892 PRODUCT_NAME = AutoUpdater; 4922 PRODUCT_NAME = AutoUpdater;
4893 }; 4923 };
4894 name = Development; 4924 name = Development;
@@ -4902,8 +4932,10 @@
4902 LIBRARY_SEARCH_PATHS = ( 4932 LIBRARY_SEARCH_PATHS = (
4903 "$(inherited)", 4933 "$(inherited)",
4904 "$(LIBRARY_SEARCH_PATHS_QUOTED_1)", 4934 "$(LIBRARY_SEARCH_PATHS_QUOTED_1)",
4935 "$(LIBRARY_SEARCH_PATHS_QUOTED_2)",
4905 ); 4936 );
4906 LIBRARY_SEARCH_PATHS_QUOTED_1 = "\"$(SRCROOT)/build/Universal\""; 4937 LIBRARY_SEARCH_PATHS_QUOTED_1 = "\"$(SRCROOT)/build/Universal\"";
4938 LIBRARY_SEARCH_PATHS_QUOTED_2 = "\"$(SRCROOT)/build/Universal\"";
4907 PRODUCT_NAME = AutoUpdater; 4939 PRODUCT_NAME = AutoUpdater;
4908 }; 4940 };
4909 name = Deployment; 4941 name = Deployment;
@@ -4923,8 +4955,10 @@
4923 "$(LIBRARY_SEARCH_PATHS)", 4955 "$(LIBRARY_SEARCH_PATHS)",
4924 "$(SRCROOT)/../../libraries/universal-darwin/lib_release", 4956 "$(SRCROOT)/../../libraries/universal-darwin/lib_release",
4925 "$(LIBRARY_SEARCH_PATHS_QUOTED_1)", 4957 "$(LIBRARY_SEARCH_PATHS_QUOTED_1)",
4958 "$(LIBRARY_SEARCH_PATHS_QUOTED_2)",
4926 ); 4959 );
4927 LIBRARY_SEARCH_PATHS_QUOTED_1 = "\"$(SRCROOT)/build/Universal\""; 4960 LIBRARY_SEARCH_PATHS_QUOTED_1 = "\"$(SRCROOT)/build/Universal\"";
4961 LIBRARY_SEARCH_PATHS_QUOTED_2 = "\"$(SRCROOT)/build/Universal\"";
4928 OTHER_LDFLAGS = "-weak-lllmozlib"; 4962 OTHER_LDFLAGS = "-weak-lllmozlib";
4929 PRODUCT_NAME = "Second Life"; 4963 PRODUCT_NAME = "Second Life";
4930 SHARED_PRECOMPS_DIR = "$(BUILD_DIR)/Caches/com.apple.Xcode.$(UID)/SharedPrecompiledHeaders"; 4964 SHARED_PRECOMPS_DIR = "$(BUILD_DIR)/Caches/com.apple.Xcode.$(UID)/SharedPrecompiledHeaders";
@@ -4953,8 +4987,10 @@
4953 "$(LIBRARY_SEARCH_PATHS)", 4987 "$(LIBRARY_SEARCH_PATHS)",
4954 "$(SRCROOT)/../../libraries/universal-darwin/lib_release", 4988 "$(SRCROOT)/../../libraries/universal-darwin/lib_release",
4955 "$(LIBRARY_SEARCH_PATHS_QUOTED_1)", 4989 "$(LIBRARY_SEARCH_PATHS_QUOTED_1)",
4990 "$(LIBRARY_SEARCH_PATHS_QUOTED_2)",
4956 ); 4991 );
4957 LIBRARY_SEARCH_PATHS_QUOTED_1 = "\"$(SRCROOT)/build/Universal\""; 4992 LIBRARY_SEARCH_PATHS_QUOTED_1 = "\"$(SRCROOT)/build/Universal\"";
4993 LIBRARY_SEARCH_PATHS_QUOTED_2 = "\"$(SRCROOT)/build/Universal\"";
4958 OTHER_LDFLAGS = "-lllmozlib"; 4994 OTHER_LDFLAGS = "-lllmozlib";
4959 PRODUCT_NAME = "Second Life"; 4995 PRODUCT_NAME = "Second Life";
4960 SHARED_PRECOMPS_DIR = "$(BUILD_DIR)/Caches/com.apple.Xcode.$(UID)/SharedPrecompiledHeaders"; 4996 SHARED_PRECOMPS_DIR = "$(BUILD_DIR)/Caches/com.apple.Xcode.$(UID)/SharedPrecompiledHeaders";
diff --git a/linden/indra/newview/macview_Prefix.h b/linden/indra/newview/macview_Prefix.h
index 651cc88..ddfcfec 100644
--- a/linden/indra/newview/macview_Prefix.h
+++ b/linden/indra/newview/macview_Prefix.h
@@ -130,17 +130,15 @@
130#include "lldrawpoolalpha.h" 130#include "lldrawpoolalpha.h"
131#include "lldrawpoolavatar.h" 131#include "lldrawpoolavatar.h"
132#include "lldrawpooltree.h" 132#include "lldrawpooltree.h"
133#include "lldrawpooltreenew.h"
134#include "lldrawpoolterrain.h" 133#include "lldrawpoolterrain.h"
135#include "lldrawpoolsky.h" 134#include "lldrawpoolsky.h"
136#include "lldrawpoolwater.h" 135#include "lldrawpoolwater.h"
137#include "lldrawpoolground.h" 136#include "lldrawpoolground.h"
138#include "lldrawpoolbump.h" 137#include "lldrawpoolbump.h"
139#include "llvotreenew.h"
140 138
141/////////////////// From llface.cpp 139/////////////////// From llface.cpp
142#include "llgl.h" 140#include "llgl.h"
143#include "llviewerimagelist.h" 141#include "llviewerimage.h"
144#include "llsky.h" 142#include "llsky.h"
145#include "llvosky.h" 143#include "llvosky.h"
146#include "llcontrol.h" 144#include "llcontrol.h"
diff --git a/linden/indra/newview/moviemaker.cpp b/linden/indra/newview/moviemaker.cpp
index 1054f1a..0f60bb1 100644
--- a/linden/indra/newview/moviemaker.cpp
+++ b/linden/indra/newview/moviemaker.cpp
@@ -52,7 +52,7 @@ HBITMAP LoadBMPFromFB( int w, int h );
52 52
53MovieMaker::MovieMaker() 53MovieMaker::MovieMaker()
54{ 54{
55 sprintf( fname, "movie.avi" ); 55 snprintf( fname, sizeof(fname), "movie.avi" ); /* Flawfinder: ignore */
56 width = -1; 56 width = -1;
57 height = -1; 57 height = -1;
58 58
@@ -104,7 +104,8 @@ MovieMaker::~MovieMaker()
104 104
105void MovieMaker::StartCapture( char *name , int x, int y) 105void MovieMaker::StartCapture( char *name , int x, int y)
106{ 106{
107 strcpy( fname, name ); 107 strncpy( fname, name, sizeof(fname) -1 ); /* Flawfinder: ignore */
108 fname[sizeof(fname) -1] = '\0';
108 109
109 // Get the width and height. 110 // Get the width and height.
110 width = x; 111 width = x;
@@ -498,7 +499,7 @@ MovieMaker::~MovieMaker()
498 499
499void MovieMaker::StartCapture( char *name , int x, int y) 500void MovieMaker::StartCapture( char *name , int x, int y)
500{ 501{
501 strncpy( fname, name, sizeof(fname)); 502 strncpy( fname, name, sizeof(fname)); /* Flawfinder: ignore */
502 width = x; 503 width = x;
503 height = y; 504 height = y;
504 505
@@ -577,7 +578,7 @@ OSStatus MovieMaker::setupMovie()
577 if (error == noErr) 578 if (error == noErr)
578 { 579 {
579 // This is stoopid. I have to take the passed full path, create the file so I can get an FSRef, and Get Info to get the FSSpec for QuickTime. Could Apple make this any more difficult... 580 // This is stoopid. I have to take the passed full path, create the file so I can get an FSRef, and Get Info to get the FSSpec for QuickTime. Could Apple make this any more difficult...
580 FILE *file = LLFile::fopen(fname, "w"); 581 FILE* file = LLFile::fopen(fname, "w"); /* Flawfinder: ignore */
581 if (file) 582 if (file)
582 { 583 {
583 fclose(file); 584 fclose(file);
diff --git a/linden/indra/newview/moviemaker.h b/linden/indra/newview/moviemaker.h
index ff1aa9b..0f1c79f 100644
--- a/linden/indra/newview/moviemaker.h
+++ b/linden/indra/newview/moviemaker.h
@@ -83,7 +83,7 @@ public:
83 83
84class MovieMaker { 84class MovieMaker {
85private: 85private:
86 char fname[64]; 86 char fname[64]; /*Flawfinder: ignore*/
87 87
88 Movie movie; 88 Movie movie;
89 short movieResRef; 89 short movieResRef;
diff --git a/linden/indra/newview/newview.vcproj b/linden/indra/newview/newview.vcproj
index 8eec1bb..99e182c 100644
--- a/linden/indra/newview/newview.vcproj
+++ b/linden/indra/newview/newview.vcproj
@@ -79,7 +79,7 @@
79 CharacterSet="1"> 79 CharacterSet="1">
80 <Tool 80 <Tool
81 Name="VCCLCompilerTool" 81 Name="VCCLCompilerTool"
82 GlobalOptimizations="TRUE" 82 GlobalOptimizations="FALSE"
83 InlineFunctionExpansion="2" 83 InlineFunctionExpansion="2"
84 EnableIntrinsicFunctions="TRUE" 84 EnableIntrinsicFunctions="TRUE"
85 OptimizeForProcessor="3" 85 OptimizeForProcessor="3"
@@ -210,7 +210,6 @@
210 ForceConformanceInForLoopScope="TRUE" 210 ForceConformanceInForLoopScope="TRUE"
211 UsePrecompiledHeader="3" 211 UsePrecompiledHeader="3"
212 PrecompiledHeaderThrough="llviewerprecompiledheaders.h" 212 PrecompiledHeaderThrough="llviewerprecompiledheaders.h"
213 BrowseInformation="1"
214 WarningLevel="3" 213 WarningLevel="3"
215 WarnAsError="TRUE" 214 WarnAsError="TRUE"
216 Detect64BitPortabilityProblems="FALSE" 215 Detect64BitPortabilityProblems="FALSE"
@@ -276,9 +275,6 @@
276 RelativePath=".\llagentpilot.cpp"> 275 RelativePath=".\llagentpilot.cpp">
277 </File> 276 </File>
278 <File 277 <File
279 RelativePath=".\llagparray.inl">
280 </File>
281 <File
282 RelativePath=".\llanimalcontrols.cpp"> 278 RelativePath=".\llanimalcontrols.cpp">
283 </File> 279 </File>
284 <File 280 <File
@@ -381,15 +377,9 @@
381 RelativePath=".\lldrawpoolbump.cpp"> 377 RelativePath=".\lldrawpoolbump.cpp">
382 </File> 378 </File>
383 <File 379 <File
384 RelativePath=".\lldrawpoolclouds.cpp">
385 </File>
386 <File
387 RelativePath=".\lldrawpoolground.cpp"> 380 RelativePath=".\lldrawpoolground.cpp">
388 </File> 381 </File>
389 <File 382 <File
390 RelativePath=".\lldrawpoolhud.cpp">
391 </File>
392 <File
393 RelativePath=".\lldrawpoolsimple.cpp"> 383 RelativePath=".\lldrawpoolsimple.cpp">
394 </File> 384 </File>
395 <File 385 <File
@@ -405,9 +395,6 @@
405 RelativePath=".\lldrawpooltree.cpp"> 395 RelativePath=".\lldrawpooltree.cpp">
406 </File> 396 </File>
407 <File 397 <File
408 RelativePath=".\lldrawpooltreenew.cpp">
409 </File>
410 <File
411 RelativePath=".\lldrawpoolwater.cpp"> 398 RelativePath=".\lldrawpoolwater.cpp">
412 </File> 399 </File>
413 <File 400 <File
@@ -456,9 +443,6 @@
456 RelativePath=".\llfloaterabout.cpp"> 443 RelativePath=".\llfloaterabout.cpp">
457 </File> 444 </File>
458 <File 445 <File
459 RelativePath=".\llfloateraccounthistory.cpp">
460 </File>
461 <File
462 RelativePath=".\llfloateranimpreview.cpp"> 446 RelativePath=".\llfloateranimpreview.cpp">
463 </File> 447 </File>
464 <File 448 <File
@@ -867,9 +851,6 @@
867 RelativePath=".\llpanellogin.cpp"> 851 RelativePath=".\llpanellogin.cpp">
868 </File> 852 </File>
869 <File 853 <File
870 RelativePath=".\llpanelmoney.cpp">
871 </File>
872 <File
873 RelativePath=".\llpanelmorph.cpp"> 854 RelativePath=".\llpanelmorph.cpp">
874 </File> 855 </File>
875 <File 856 <File
@@ -987,7 +968,7 @@
987 RelativePath=".\lltexlayer.cpp"> 968 RelativePath=".\lltexlayer.cpp">
988 </File> 969 </File>
989 <File 970 <File
990 RelativePath=".\lltexturebar.cpp"> 971 RelativePath=".\lltexturecache.cpp">
991 </File> 972 </File>
992 <File 973 <File
993 RelativePath=".\lltexturectrl.cpp"> 974 RelativePath=".\lltexturectrl.cpp">
@@ -1209,9 +1190,6 @@
1209 RelativePath=".\llvolumesliderctrl.cpp"> 1190 RelativePath=".\llvolumesliderctrl.cpp">
1210 </File> 1191 </File>
1211 <File 1192 <File
1212 RelativePath=".\llvopart.cpp">
1213 </File>
1214 <File
1215 RelativePath=".\llvopartgroup.cpp"> 1193 RelativePath=".\llvopartgroup.cpp">
1216 </File> 1194 </File>
1217 <File 1195 <File
@@ -1230,9 +1208,6 @@
1230 RelativePath=".\llvotree.cpp"> 1208 RelativePath=".\llvotree.cpp">
1231 </File> 1209 </File>
1232 <File 1210 <File
1233 RelativePath=".\llvotreenew.cpp">
1234 </File>
1235 <File
1236 RelativePath=".\llvovolume.cpp"> 1211 RelativePath=".\llvovolume.cpp">
1237 </File> 1212 </File>
1238 <File 1213 <File
@@ -1304,9 +1279,6 @@
1304 RelativePath=".\llagentpilot.h"> 1279 RelativePath=".\llagentpilot.h">
1305 </File> 1280 </File>
1306 <File 1281 <File
1307 RelativePath=".\llagparray.h">
1308 </File>
1309 <File
1310 RelativePath=".\llanimalcontrols.h"> 1282 RelativePath=".\llanimalcontrols.h">
1311 </File> 1283 </File>
1312 <File 1284 <File
@@ -1409,15 +1381,9 @@
1409 RelativePath=".\lldrawpoolbump.h"> 1381 RelativePath=".\lldrawpoolbump.h">
1410 </File> 1382 </File>
1411 <File 1383 <File
1412 RelativePath=".\lldrawpoolclouds.h">
1413 </File>
1414 <File
1415 RelativePath=".\lldrawpoolground.h"> 1384 RelativePath=".\lldrawpoolground.h">
1416 </File> 1385 </File>
1417 <File 1386 <File
1418 RelativePath=".\lldrawpoolhud.h">
1419 </File>
1420 <File
1421 RelativePath=".\lldrawpoolsimple.h"> 1387 RelativePath=".\lldrawpoolsimple.h">
1422 </File> 1388 </File>
1423 <File 1389 <File
@@ -1433,9 +1399,6 @@
1433 RelativePath=".\lldrawpooltree.h"> 1399 RelativePath=".\lldrawpooltree.h">
1434 </File> 1400 </File>
1435 <File 1401 <File
1436 RelativePath=".\lldrawpooltreenew.h">
1437 </File>
1438 <File
1439 RelativePath=".\lldrawpoolwater.h"> 1402 RelativePath=".\lldrawpoolwater.h">
1440 </File> 1403 </File>
1441 <File 1404 <File
@@ -1487,9 +1450,6 @@
1487 RelativePath=".\llfloaterabout.h"> 1450 RelativePath=".\llfloaterabout.h">
1488 </File> 1451 </File>
1489 <File 1452 <File
1490 RelativePath=".\llfloateraccounthistory.h">
1491 </File>
1492 <File
1493 RelativePath=".\llfloateranimpreview.h"> 1453 RelativePath=".\llfloateranimpreview.h">
1494 </File> 1454 </File>
1495 <File 1455 <File
@@ -1895,9 +1855,6 @@
1895 RelativePath=".\llpanellogin.h"> 1855 RelativePath=".\llpanellogin.h">
1896 </File> 1856 </File>
1897 <File 1857 <File
1898 RelativePath=".\llpanelmoney.h">
1899 </File>
1900 <File
1901 RelativePath=".\llpanelmorph.h"> 1858 RelativePath=".\llpanelmorph.h">
1902 </File> 1859 </File>
1903 <File 1860 <File
@@ -2030,6 +1987,9 @@
2030 RelativePath=".\lltexturebar.h"> 1987 RelativePath=".\lltexturebar.h">
2031 </File> 1988 </File>
2032 <File 1989 <File
1990 RelativePath=".\lltexturecache.h">
1991 </File>
1992 <File
2033 RelativePath=".\lltexturectrl.h"> 1993 RelativePath=".\lltexturectrl.h">
2034 </File> 1994 </File>
2035 <File 1995 <File
@@ -2249,9 +2209,6 @@
2249 RelativePath=".\llvolumesliderctrl.h"> 2209 RelativePath=".\llvolumesliderctrl.h">
2250 </File> 2210 </File>
2251 <File 2211 <File
2252 RelativePath=".\llvopart.h">
2253 </File>
2254 <File
2255 RelativePath=".\llvopartgroup.h"> 2212 RelativePath=".\llvopartgroup.h">
2256 </File> 2213 </File>
2257 <File 2214 <File
@@ -2270,9 +2227,6 @@
2270 RelativePath=".\llvotree.h"> 2227 RelativePath=".\llvotree.h">
2271 </File> 2228 </File>
2272 <File 2229 <File
2273 RelativePath=".\llvotreenew.h">
2274 </File>
2275 <File
2276 RelativePath=".\llvovolume.h"> 2230 RelativePath=".\llvovolume.h">
2277 </File> 2231 </File>
2278 <File 2232 <File
diff --git a/linden/indra/newview/newview_vc8.vcproj b/linden/indra/newview/newview_vc8.vcproj
new file mode 100644
index 0000000..402c62d
--- /dev/null
+++ b/linden/indra/newview/newview_vc8.vcproj
@@ -0,0 +1,3957 @@
1<?xml version="1.0" encoding="Windows-1252"?>
2<VisualStudioProject
3 ProjectType="Visual C++"
4 Version="8.00"
5 Name="newview"
6 ProjectGUID="{E6F4CF1B-6109-4CA8-B58D-87FA936CDE08}"
7 RootNamespace="newview"
8 Keyword="Win32Proj"
9 >
10 <Platforms>
11 <Platform
12 Name="Win32"
13 />
14 </Platforms>
15 <ToolFiles>
16 </ToolFiles>
17 <Configurations>
18 <Configuration
19 Name="Debug|Win32"
20 OutputDirectory="$(ConfigurationName)"
21 IntermediateDirectory="$(ConfigurationName)"
22 ConfigurationType="1"
23 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
24 CharacterSet="1"
25 >
26 <Tool
27 Name="VCPreBuildEventTool"
28 />
29 <Tool
30 Name="VCCustomBuildTool"
31 />
32 <Tool
33 Name="VCXMLDataGeneratorTool"
34 />
35 <Tool
36 Name="VCWebServiceProxyGeneratorTool"
37 />
38 <Tool
39 Name="VCMIDLTool"
40 />
41 <Tool
42 Name="VCCLCompilerTool"
43 Optimization="0"
44 AdditionalIncludeDirectories="..\llcommon;..\llmath;..\llvfs;..\llaudio;..\llmedia;..\llimage;..\llscene;..\llxml;..\llmessage;..\llprimitive;..\llrender;..\llwindow;..\llcharacter;..\llinventory;..\llui;..\lscript;&quot;..\..\libraries\i686-win32\include&quot;;..\..\libraries\include\;&quot;..\..\libraries\i686-win32\include\quicktime&quot;"
45 PreprocessorDefinitions="WIN32;_DEBUG;LL_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;LL_DEBUG;XP_WIN;XP_WIN32;MOZILLA_INTERNAL_API"
46 MinimalRebuild="false"
47 BasicRuntimeChecks="3"
48 RuntimeLibrary="1"
49 StructMemberAlignment="4"
50 TreatWChar_tAsBuiltInType="false"
51 ForceConformanceInForLoopScope="true"
52 UsePrecompiledHeader="0"
53 PrecompiledHeaderThrough="llviewerprecompiledheaders.h"
54 WarningLevel="3"
55 WarnAsError="true"
56 Detect64BitPortabilityProblems="false"
57 DebugInformationFormat="4"
58 />
59 <Tool
60 Name="VCManagedResourceCompilerTool"
61 />
62 <Tool
63 Name="VCResourceCompilerTool"
64 />
65 <Tool
66 Name="VCPreLinkEventTool"
67 />
68 <Tool
69 Name="VCLinkerTool"
70 AdditionalDependencies="advapi32.lib apr-1.lib aprutil-1.lib comdlg32.lib dinput8.lib dsound.lib dxerr8.lib dxguid.lib fmodvc.lib freetype.lib gdi32.lib glu32.lib jpeglib_6b.lib kernel32.lib libboost_regex-vc80-mt-s.lib libcurl.lib libeay32.lib libexpatMT.lib LibOpenJPEG.lib llaudio.lib llmedia.lib llcharacter.lib llcommon.lib llimage.lib llimagej2coj.lib llinventory.lib llmath.lib llmessage.lib llmozlib-vc80.lib llprimitive.lib llrender.lib llui.lib llvfs.lib llwindow.lib llxml.lib lscript_library.lib mswsock.lib netapi32.lib odbc32.lib odbccp32.lib ogg_static_mt.lib ole32.lib oleaut32.lib opengl32.lib qtmlclient.lib shell32.lib ssleay32.lib user32.lib Vfw32.lib vorbis_static_mt.lib vorbisenc_static_mt.lib vorbisfile_static_mt.lib winmm.lib winspool.lib ws2_32.lib xmlrpcepi.lib zlib.lib"
71 OutputFile="$(ConfigurationName)/debugview.exe"
72 LinkIncremental="2"
73 AdditionalLibraryDirectories="&quot;../lib_$(ConfigurationName)/i686-win32&quot;;&quot;../../libraries/i686-win32/lib_debug&quot;"
74 IgnoreDefaultLibraryNames="msvcrtd;libcd.lib"
75 GenerateDebugInformation="true"
76 ProgramDatabaseFile="$(TargetName).pdb"
77 SubSystem="2"
78 OptimizeReferences="1"
79 EnableCOMDATFolding="1"
80 TargetMachine="1"
81 />
82 <Tool
83 Name="VCALinkTool"
84 />
85 <Tool
86 Name="VCManifestTool"
87 />
88 <Tool
89 Name="VCXDCMakeTool"
90 />
91 <Tool
92 Name="VCBscMakeTool"
93 />
94 <Tool
95 Name="VCFxCopTool"
96 />
97 <Tool
98 Name="VCAppVerifierTool"
99 />
100 <Tool
101 Name="VCWebDeploymentTool"
102 />
103 <Tool
104 Name="VCPostBuildEventTool"
105 Description="Executing post-build batch file"
106 CommandLine="postbuild.bat debug"
107 />
108 </Configuration>
109 <Configuration
110 Name="Release|Win32"
111 OutputDirectory="$(ConfigurationName)"
112 IntermediateDirectory="$(ConfigurationName)"
113 ConfigurationType="1"
114 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
115 CharacterSet="1"
116 >
117 <Tool
118 Name="VCPreBuildEventTool"
119 />
120 <Tool
121 Name="VCCustomBuildTool"
122 />
123 <Tool
124 Name="VCXMLDataGeneratorTool"
125 />
126 <Tool
127 Name="VCWebServiceProxyGeneratorTool"
128 />
129 <Tool
130 Name="VCMIDLTool"
131 />
132 <Tool
133 Name="VCCLCompilerTool"
134 InlineFunctionExpansion="2"
135 EnableIntrinsicFunctions="true"
136 AdditionalIncludeDirectories="..\llcommon;..\llmath;..\llvfs;..\llaudio;..\llmedia;..\llimage;..\llscene;..\llxml;..\llmessage;..\llprimitive;..\llrender;..\llwindow;..\llcharacter;..\llinventory;..\llui;..\lscript;&quot;..\..\libraries\i686-win32\include&quot;;..\..\libraries\include\;&quot;..\..\libraries\i686-win32\include\quicktime&quot;"
137 PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;LL_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;LL_RELEASE;XP_WIN;XP_WIN32;MOZILLA_INTERNAL_API"
138 StringPooling="true"
139 RuntimeLibrary="0"
140 StructMemberAlignment="0"
141 TreatWChar_tAsBuiltInType="false"
142 ForceConformanceInForLoopScope="true"
143 UsePrecompiledHeader="2"
144 PrecompiledHeaderThrough="llviewerprecompiledheaders.h"
145 WarningLevel="3"
146 WarnAsError="true"
147 Detect64BitPortabilityProblems="false"
148 DebugInformationFormat="3"
149 />
150 <Tool
151 Name="VCManagedResourceCompilerTool"
152 />
153 <Tool
154 Name="VCResourceCompilerTool"
155 />
156 <Tool
157 Name="VCPreLinkEventTool"
158 />
159 <Tool
160 Name="VCLinkerTool"
161 AdditionalDependencies="advapi32.lib apr-1.lib aprutil-1.lib comdlg32.lib dinput8.lib dsound.lib dxerr8.lib dxguid.lib fmodvc.lib freetype.lib gdi32.lib glu32.lib jpeglib_6b.lib kernel32.lib libboost_regex-vc80-mt-s.lib libcurl.lib libeay32.lib libexpatMT.lib LibOpenJPEG.lib llaudio.lib llmedia.lib llcharacter.lib llcommon.lib llimage.lib llimagej2coj.lib llinventory.lib llmath.lib llmessage.lib llmozlib-vc80.lib llprimitive.lib llrender.lib llui.lib llvfs.lib llwindow.lib llxml.lib lscript_library.lib mswsock.lib netapi32.lib odbc32.lib odbccp32.lib ogg_static_mt.lib ole32.lib oleaut32.lib opengl32.lib qtmlclient.lib shell32.lib ssleay32.lib user32.lib Vfw32.lib vorbis_static_mt.lib vorbisenc_static_mt.lib vorbisfile_static_mt.lib winmm.lib winspool.lib ws2_32.lib xmlrpcepi.lib zlib.lib"
162 OutputFile="$(ConfigurationName)/newview.exe"
163 LinkIncremental="2"
164 AdditionalLibraryDirectories="&quot;../lib_$(ConfigurationName)/i686-win32&quot;;&quot;../../libraries/i686-win32/lib_release&quot;"
165 IgnoreDefaultLibraryNames="msvcrt.lib;libc.lib"
166 GenerateDebugInformation="true"
167 ProgramDatabaseFile="$(TargetName).pdb"
168 SubSystem="2"
169 OptimizeReferences="1"
170 EnableCOMDATFolding="1"
171 TargetMachine="1"
172 />
173 <Tool
174 Name="VCALinkTool"
175 />
176 <Tool
177 Name="VCManifestTool"
178 />
179 <Tool
180 Name="VCXDCMakeTool"
181 />
182 <Tool
183 Name="VCBscMakeTool"
184 />
185 <Tool
186 Name="VCFxCopTool"
187 />
188 <Tool
189 Name="VCAppVerifierTool"
190 />
191 <Tool
192 Name="VCWebDeploymentTool"
193 />
194 <Tool
195 Name="VCPostBuildEventTool"
196 Description="Executing post-build batch file"
197 CommandLine="postbuild.bat release"
198 />
199 </Configuration>
200 <Configuration
201 Name="ReleaseForDownload|Win32"
202 OutputDirectory="$(ConfigurationName)"
203 IntermediateDirectory="$(ConfigurationName)"
204 ConfigurationType="1"
205 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
206 CharacterSet="1"
207 >
208 <Tool
209 Name="VCPreBuildEventTool"
210 />
211 <Tool
212 Name="VCCustomBuildTool"
213 Description="Copying $(TargetFileName) to $(ProjectDir)"
214 CommandLine="copy $(TargetDir)\$(TargetFileName) $(ProjectDir)&#x0D;&#x0A;"
215 Outputs="$(TargetFileName)"
216 />
217 <Tool
218 Name="VCXMLDataGeneratorTool"
219 />
220 <Tool
221 Name="VCWebServiceProxyGeneratorTool"
222 />
223 <Tool
224 Name="VCMIDLTool"
225 />
226 <Tool
227 Name="VCCLCompilerTool"
228 WholeProgramOptimization="true"
229 AdditionalIncludeDirectories="..\llcommon;..\llmath;..\llvfs;..\llaudio;..\llmedia;..\llimage;..\llscene;..\llxml;..\llmessage;..\llprimitive;..\llrender;..\llwindow;..\llcharacter;..\llinventory;..\llui;..\lscript;&quot;..\..\libraries\i686-win32\include&quot;;..\..\libraries\include\;&quot;..\..\libraries\i686-win32\include\quicktime&quot;"
230 PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;LL_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;LL_RELEASE;LL_RELEASE_FOR_DOWNLOAD;XP_WIN;XP_WIN32;MOZILLA_INTERNAL_API"
231 RuntimeLibrary="0"
232 StructMemberAlignment="0"
233 TreatWChar_tAsBuiltInType="false"
234 UsePrecompiledHeader="2"
235 PrecompiledHeaderThrough="llviewerprecompiledheaders.h"
236 WarningLevel="3"
237 WarnAsError="true"
238 Detect64BitPortabilityProblems="false"
239 DebugInformationFormat="3"
240 />
241 <Tool
242 Name="VCManagedResourceCompilerTool"
243 />
244 <Tool
245 Name="VCResourceCompilerTool"
246 />
247 <Tool
248 Name="VCPreLinkEventTool"
249 />
250 <Tool
251 Name="VCLinkerTool"
252 AdditionalDependencies="advapi32.lib apr-1.lib aprutil-1.lib comdlg32.lib dinput8.lib dsound.lib dxerr8.lib dxguid.lib fmodvc.lib freetype.lib gdi32.lib glu32.lib jpeglib_6b.lib kernel32.lib libboost_regex-vc80-mt-s.lib libcurl.lib libeay32.lib libexpatMT.lib LibOpenJPEG.lib llaudio.lib llmedia.lib llcharacter.lib llcommon.lib llimage.lib llimagej2coj.lib llinventory.lib llmath.lib llmessage.lib llmozlib-vc80.lib llprimitive.lib llrender.lib llui.lib llvfs.lib llwindow.lib llxml.lib lscript_library.lib mswsock.lib netapi32.lib odbc32.lib odbccp32.lib ogg_static_mt.lib ole32.lib oleaut32.lib opengl32.lib qtmlclient.lib shell32.lib ssleay32.lib user32.lib Vfw32.lib vorbis_static_mt.lib vorbisenc_static_mt.lib vorbisfile_static_mt.lib winmm.lib winspool.lib ws2_32.lib xmlrpcepi.lib zlib.lib"
253 OutputFile="$(ConfigurationName)/SecondLife.exe"
254 LinkIncremental="0"
255 AdditionalLibraryDirectories="&quot;../lib_release/i686-win32&quot;;&quot;../../libraries/i686-win32/lib_release&quot;"
256 IgnoreDefaultLibraryNames="msvcrt.lib;libc.lib"
257 GenerateDebugInformation="true"
258 ProgramDatabaseFile="$(TargetName).pdb"
259 SubSystem="2"
260 OptimizeReferences="2"
261 EnableCOMDATFolding="2"
262 LinkTimeCodeGeneration="1"
263 TargetMachine="1"
264 />
265 <Tool
266 Name="VCALinkTool"
267 />
268 <Tool
269 Name="VCManifestTool"
270 />
271 <Tool
272 Name="VCXDCMakeTool"
273 />
274 <Tool
275 Name="VCBscMakeTool"
276 />
277 <Tool
278 Name="VCFxCopTool"
279 />
280 <Tool
281 Name="VCAppVerifierTool"
282 />
283 <Tool
284 Name="VCWebDeploymentTool"
285 />
286 <Tool
287 Name="VCPostBuildEventTool"
288 Description="Executing post-build batch file"
289 CommandLine="postbuild.bat releasefordownload"
290 />
291 </Configuration>
292 <Configuration
293 Name="ReleaseNoOpt|Win32"
294 OutputDirectory="$(ConfigurationName)"
295 IntermediateDirectory="$(ConfigurationName)"
296 ConfigurationType="1"
297 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
298 CharacterSet="1"
299 >
300 <Tool
301 Name="VCPreBuildEventTool"
302 />
303 <Tool
304 Name="VCCustomBuildTool"
305 />
306 <Tool
307 Name="VCXMLDataGeneratorTool"
308 />
309 <Tool
310 Name="VCWebServiceProxyGeneratorTool"
311 />
312 <Tool
313 Name="VCMIDLTool"
314 />
315 <Tool
316 Name="VCCLCompilerTool"
317 Optimization="0"
318 AdditionalIncludeDirectories="..\llcommon;..\llmath;..\llvfs;..\llaudio;..\llmedia;..\llimage;..\llscene;..\llxml;..\llmessage;..\llprimitive;..\llrender;..\llwindow;..\llcharacter;..\llinventory;..\llui;..\lscript;&quot;..\..\libraries\i686-win32\include&quot;;..\..\libraries\include\;&quot;..\..\libraries\i686-win32\include\quicktime&quot;"
319 PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;LL_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;LL_RELEASE;XP_WIN;XP_WIN32;MOZILLA_INTERNAL_API"
320 RuntimeLibrary="0"
321 StructMemberAlignment="0"
322 TreatWChar_tAsBuiltInType="false"
323 ForceConformanceInForLoopScope="true"
324 UsePrecompiledHeader="2"
325 PrecompiledHeaderThrough="llviewerprecompiledheaders.h"
326 BrowseInformation="1"
327 WarningLevel="3"
328 WarnAsError="true"
329 Detect64BitPortabilityProblems="false"
330 DebugInformationFormat="4"
331 />
332 <Tool
333 Name="VCManagedResourceCompilerTool"
334 />
335 <Tool
336 Name="VCResourceCompilerTool"
337 />
338 <Tool
339 Name="VCPreLinkEventTool"
340 />
341 <Tool
342 Name="VCLinkerTool"
343 AdditionalDependencies="advapi32.lib apr-1.lib aprutil-1.lib comdlg32.lib dinput8.lib dsound.lib dxerr8.lib dxguid.lib fmodvc.lib freetype.lib gdi32.lib glu32.lib jpeglib_6b.lib kernel32.lib libboost_regex-vc80-mt-s.lib libcurl.lib libeay32.lib libexpatMT.lib LibOpenJPEG.lib llaudio.lib llmedia.lib llcharacter.lib llcommon.lib llimage.lib llimagej2coj.lib llinventory.lib llmath.lib llmessage.lib llmozlib-vc80.lib llprimitive.lib llrender.lib llui.lib llvfs.lib llwindow.lib llxml.lib lscript_library.lib mswsock.lib netapi32.lib odbc32.lib odbccp32.lib ogg_static_mt.lib ole32.lib oleaut32.lib opengl32.lib qtmlclient.lib shell32.lib ssleay32.lib user32.lib Vfw32.lib vorbis_static_mt.lib vorbisenc_static_mt.lib vorbisfile_static_mt.lib winmm.lib winspool.lib ws2_32.lib xmlrpcepi.lib zlib.lib"
344 OutputFile="$(ConfigurationName)/newview_noopt.exe"
345 LinkIncremental="2"
346 AdditionalLibraryDirectories="&quot;../lib_releasenoopt/i686-win32&quot;;&quot;../../libraries/i686-win32/lib_release&quot;"
347 IgnoreDefaultLibraryNames="msvcrt.lib;libc.lib"
348 GenerateDebugInformation="true"
349 ProgramDatabaseFile="$(TargetName).pdb"
350 GenerateMapFile="false"
351 MapFileName="newview.map"
352 SubSystem="2"
353 OptimizeReferences="1"
354 EnableCOMDATFolding="1"
355 TargetMachine="1"
356 />
357 <Tool
358 Name="VCALinkTool"
359 />
360 <Tool
361 Name="VCManifestTool"
362 />
363 <Tool
364 Name="VCXDCMakeTool"
365 />
366 <Tool
367 Name="VCBscMakeTool"
368 />
369 <Tool
370 Name="VCFxCopTool"
371 />
372 <Tool
373 Name="VCAppVerifierTool"
374 />
375 <Tool
376 Name="VCWebDeploymentTool"
377 />
378 <Tool
379 Name="VCPostBuildEventTool"
380 Description="Executing post-build batch file"
381 CommandLine="postbuild.bat releasenoopt"
382 />
383 </Configuration>
384 </Configurations>
385 <References>
386 </References>
387 <Files>
388 <Filter
389 Name="Source Files"
390 Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
391 UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
392 >
393 <File
394 RelativePath=".\head.cpp"
395 >
396 </File>
397 <File
398 RelativePath=".\llagent.cpp"
399 >
400 </File>
401 <File
402 RelativePath=".\llagentdata.cpp"
403 >
404 </File>
405 <File
406 RelativePath=".\llagentpilot.cpp"
407 >
408 </File>
409 <File
410 RelativePath=".\llanimalcontrols.cpp"
411 >
412 </File>
413 <File
414 RelativePath=".\llassetuploadresponders.cpp"
415 >
416 </File>
417 <File
418 RelativePath=".\llasynchostbyname.cpp"
419 >
420 </File>
421 <File
422 RelativePath=".\llaudiosourcevo.cpp"
423 >
424 </File>
425 <File
426 RelativePath=".\llaudiostatus.cpp"
427 >
428 </File>
429 <File
430 RelativePath=".\llbbox.cpp"
431 >
432 </File>
433 <File
434 RelativePath=".\llbox.cpp"
435 >
436 </File>
437 <File
438 RelativePath=".\llcallbacklist.cpp"
439 >
440 </File>
441 <File
442 RelativePath=".\llcallingcard.cpp"
443 >
444 </File>
445 <File
446 RelativePath=".\llcameraview.cpp"
447 >
448 </File>
449 <File
450 RelativePath=".\llcape.cpp"
451 >
452 </File>
453 <File
454 RelativePath=".\llchatbar.cpp"
455 >
456 </File>
457 <File
458 RelativePath=".\llclassifiedinfo.cpp"
459 >
460 </File>
461 <File
462 RelativePath=".\llcloud.cpp"
463 >
464 </File>
465 <File
466 RelativePath=".\llcolorscheme.cpp"
467 >
468 </File>
469 <File
470 RelativePath=".\llcolorswatch.cpp"
471 >
472 </File>
473 <File
474 RelativePath=".\llcompass.cpp"
475 >
476 </File>
477 <File
478 RelativePath=".\llcompilequeue.cpp"
479 >
480 </File>
481 <File
482 RelativePath=".\llconfirmationmanager.cpp"
483 >
484 </File>
485 <File
486 RelativePath=".\llconsole.cpp"
487 >
488 </File>
489 <File
490 RelativePath=".\llcontainerview.cpp"
491 >
492 </File>
493 <File
494 RelativePath=".\llcontroldef.cpp"
495 >
496 </File>
497 <File
498 RelativePath=".\llcountdown.cpp"
499 >
500 </File>
501 <File
502 RelativePath=".\llcubemap.cpp"
503 >
504 </File>
505 <File
506 RelativePath=".\llcurrencyuimanager.cpp"
507 >
508 </File>
509 <File
510 RelativePath=".\llcylinder.cpp"
511 >
512 </File>
513 <File
514 RelativePath=".\lldebugmessagebox.cpp"
515 >
516 </File>
517 <File
518 RelativePath=".\lldebugview.cpp"
519 >
520 </File>
521 <File
522 RelativePath=".\lldirpicker.cpp"
523 >
524 </File>
525 <File
526 RelativePath=".\lldrawable.cpp"
527 >
528 </File>
529 <File
530 RelativePath=".\lldrawpool.cpp"
531 >
532 </File>
533 <File
534 RelativePath=".\lldrawpoolalpha.cpp"
535 >
536 </File>
537 <File
538 RelativePath=".\lldrawpoolavatar.cpp"
539 >
540 </File>
541 <File
542 RelativePath=".\lldrawpoolbump.cpp"
543 >
544 </File>
545 <File
546 RelativePath=".\lldrawpoolground.cpp"
547 >
548 </File>
549 <File
550 RelativePath=".\lldrawpoolsimple.cpp"
551 >
552 </File>
553 <File
554 RelativePath=".\lldrawpoolsky.cpp"
555 >
556 </File>
557 <File
558 RelativePath=".\lldrawpoolstars.cpp"
559 >
560 </File>
561 <File
562 RelativePath=".\lldrawpoolterrain.cpp"
563 >
564 </File>
565 <File
566 RelativePath=".\lldrawpooltree.cpp"
567 >
568 </File>
569 <File
570 RelativePath=".\lldrawpoolwater.cpp"
571 >
572 </File>
573 <File
574 RelativePath=".\lldriverparam.cpp"
575 >
576 </File>
577 <File
578 RelativePath=".\lldynamictexture.cpp"
579 >
580 </File>
581 <File
582 RelativePath=".\llemote.cpp"
583 >
584 </File>
585 <File
586 RelativePath=".\lleventinfo.cpp"
587 >
588 </File>
589 <File
590 RelativePath=".\lleventnotifier.cpp"
591 >
592 </File>
593 <File
594 RelativePath=".\lleventpoll.cpp"
595 >
596 </File>
597 <File
598 RelativePath=".\llface.cpp"
599 >
600 </File>
601 <File
602 RelativePath=".\llface.inl"
603 >
604 </File>
605 <File
606 RelativePath=".\llfasttimerview.cpp"
607 >
608 </File>
609 <File
610 RelativePath=".\llfeaturemanager.cpp"
611 >
612 </File>
613 <File
614 RelativePath=".\llfft.cpp"
615 >
616 </File>
617 <File
618 RelativePath=".\llfilepicker.cpp"
619 >
620 </File>
621 <File
622 RelativePath=".\llfirstuse.cpp"
623 >
624 </File>
625 <File
626 RelativePath=".\llflexibleobject.cpp"
627 >
628 </File>
629 <File
630 RelativePath=".\llfloaterabout.cpp"
631 >
632 </File>
633 <File
634 RelativePath=".\llfloateranimpreview.cpp"
635 >
636 </File>
637 <File
638 RelativePath=".\llfloaterauction.cpp"
639 >
640 </File>
641 <File
642 RelativePath=".\llfloateravatarinfo.cpp"
643 >
644 </File>
645 <File
646 RelativePath=".\llfloateravatarpicker.cpp"
647 >
648 </File>
649 <File
650 RelativePath=".\llfloateravatartextures.cpp"
651 >
652 </File>
653 <File
654 RelativePath=".\llfloaterbuildoptions.cpp"
655 >
656 </File>
657 <File
658 RelativePath=".\llfloaterbump.cpp"
659 >
660 </File>
661 <File
662 RelativePath=".\llfloaterbuy.cpp"
663 >
664 </File>
665 <File
666 RelativePath=".\llfloaterbuycontents.cpp"
667 >
668 </File>
669 <File
670 RelativePath=".\llfloaterbuycurrency.cpp"
671 >
672 </File>
673 <File
674 RelativePath=".\llfloaterbuyland.cpp"
675 >
676 </File>
677 <File
678 RelativePath=".\llfloaterchat.cpp"
679 >
680 </File>
681 <File
682 RelativePath=".\llfloaterclothing.cpp"
683 >
684 </File>
685 <File
686 RelativePath=".\llfloatercolorpicker.cpp"
687 >
688 </File>
689 <File
690 RelativePath=".\llfloatercustomize.cpp"
691 >
692 </File>
693 <File
694 RelativePath=".\llfloaterdirectory.cpp"
695 >
696 </File>
697 <File
698 RelativePath=".\llfloatereditui.cpp"
699 >
700 </File>
701 <File
702 RelativePath=".\llfloaterfriends.cpp"
703 >
704 </File>
705 <File
706 RelativePath=".\llfloatergesture.cpp"
707 >
708 </File>
709 <File
710 RelativePath=".\llfloatergodtools.cpp"
711 >
712 </File>
713 <File
714 RelativePath=".\llfloatergroupinfo.cpp"
715 >
716 </File>
717 <File
718 RelativePath=".\llfloatergroupinvite.cpp"
719 >
720 </File>
721 <File
722 RelativePath=".\llfloatergroups.cpp"
723 >
724 </File>
725 <File
726 RelativePath=".\llfloaterhtml.cpp"
727 >
728 </File>
729 <File
730 RelativePath=".\llfloaterhtmlfind.cpp"
731 >
732 </File>
733 <File
734 RelativePath=".\llfloaterhtmlhelp.cpp"
735 >
736 </File>
737 <File
738 RelativePath=".\llfloaterimagepreview.cpp"
739 >
740 </File>
741 <File
742 RelativePath=".\llfloaterimport.cpp"
743 >
744 </File>
745 <File
746 RelativePath=".\llfloaterinspect.cpp"
747 >
748 </File>
749 <File
750 RelativePath=".\llfloaterland.cpp"
751 >
752 </File>
753 <File
754 RelativePath=".\llfloaterlandholdings.cpp"
755 >
756 </File>
757 <File
758 RelativePath=".\llfloatermap.cpp"
759 >
760 </File>
761 <File
762 RelativePath=".\llfloatermute.cpp"
763 >
764 </File>
765 <File
766 RelativePath=".\llfloaternamedesc.cpp"
767 >
768 </File>
769 <File
770 RelativePath=".\llfloaternewim.cpp"
771 >
772 </File>
773 <File
774 RelativePath=".\llfloateropenobject.cpp"
775 >
776 </File>
777 <File
778 RelativePath=".\llfloaterpermissionsmgr.cpp"
779 >
780 </File>
781 <File
782 RelativePath=".\llfloaterpostcard.cpp"
783 >
784 </File>
785 <File
786 RelativePath=".\llfloaterpreference.cpp"
787 >
788 </File>
789 <File
790 RelativePath=".\llfloaterproperties.cpp"
791 >
792 </File>
793 <File
794 RelativePath=".\llfloaterrate.cpp"
795 >
796 </File>
797 <File
798 RelativePath=".\llfloaterregioninfo.cpp"
799 >
800 </File>
801 <File
802 RelativePath=".\llfloaterreporter.cpp"
803 >
804 </File>
805 <File
806 RelativePath=".\llfloatersaveavatar.cpp"
807 >
808 </File>
809 <File
810 RelativePath=".\llfloaterscriptdebug.cpp"
811 >
812 </File>
813 <File
814 RelativePath=".\llfloatersellland.cpp"
815 >
816 </File>
817 <File
818 RelativePath=".\llfloatersnapshot.cpp"
819 >
820 </File>
821 <File
822 RelativePath=".\llfloatertelehub.cpp"
823 >
824 </File>
825 <File
826 RelativePath=".\llfloatertest.cpp"
827 >
828 </File>
829 <File
830 RelativePath=".\llfloatertools.cpp"
831 >
832 </File>
833 <File
834 RelativePath=".\llfloatertopobjects.cpp"
835 >
836 </File>
837 <File
838 RelativePath=".\llfloatertos.cpp"
839 >
840 </File>
841 <File
842 RelativePath=".\llfloaterworldmap.cpp"
843 >
844 </File>
845 <File
846 RelativePath=".\llfolderview.cpp"
847 >
848 </File>
849 <File
850 RelativePath=".\llfollowcam.cpp"
851 >
852 </File>
853 <File
854 RelativePath=".\llframestats.cpp"
855 >
856 </File>
857 <File
858 RelativePath=".\llframestatview.cpp"
859 >
860 </File>
861 <File
862 RelativePath=".\llgenepool.cpp"
863 >
864 </File>
865 <File
866 RelativePath=".\llgesturemgr.cpp"
867 >
868 </File>
869 <File
870 RelativePath=".\llgivemoney.cpp"
871 >
872 </File>
873 <File
874 RelativePath=".\llglsandbox.cpp"
875 >
876 </File>
877 <File
878 RelativePath=".\llgroupmgr.cpp"
879 >
880 </File>
881 <File
882 RelativePath=".\llgroupnotify.cpp"
883 >
884 </File>
885 <File
886 RelativePath=".\llhippo.cpp"
887 >
888 </File>
889 <File
890 RelativePath=".\llhoverview.cpp"
891 >
892 </File>
893 <File
894 RelativePath=".\llhudconnector.cpp"
895 >
896 </File>
897 <File
898 RelativePath=".\llhudeffect.cpp"
899 >
900 </File>
901 <File
902 RelativePath=".\llhudeffectbeam.cpp"
903 >
904 </File>
905 <File
906 RelativePath=".\llhudeffectlookat.cpp"
907 >
908 </File>
909 <File
910 RelativePath=".\llhudeffectpointat.cpp"
911 >
912 </File>
913 <File
914 RelativePath=".\llhudeffecttrail.cpp"
915 >
916 </File>
917 <File
918 RelativePath=".\llhudicon.cpp"
919 >
920 </File>
921 <File
922 RelativePath=".\llhudmanager.cpp"
923 >
924 </File>
925 <File
926 RelativePath=".\llhudobject.cpp"
927 >
928 </File>
929 <File
930 RelativePath=".\llhudrender.cpp"
931 >
932 </File>
933 <File
934 RelativePath=".\llhudtext.cpp"
935 >
936 </File>
937 <File
938 RelativePath=".\llhudview.cpp"
939 >
940 </File>
941 <File
942 RelativePath=".\llimpanel.cpp"
943 >
944 </File>
945 <File
946 RelativePath=".\llimview.cpp"
947 >
948 </File>
949 <File
950 RelativePath=".\llinventoryactions.cpp"
951 >
952 </File>
953 <File
954 RelativePath=".\llinventorybridge.cpp"
955 >
956 </File>
957 <File
958 RelativePath=".\llinventoryclipboard.cpp"
959 >
960 </File>
961 <File
962 RelativePath=".\llinventorymodel.cpp"
963 >
964 </File>
965 <File
966 RelativePath=".\llinventoryview.cpp"
967 >
968 </File>
969 <File
970 RelativePath=".\lljoystickbutton.cpp"
971 >
972 </File>
973 <File
974 RelativePath=".\lllandmarklist.cpp"
975 >
976 </File>
977 <File
978 RelativePath=".\lllocalanimationobject.cpp"
979 >
980 </File>
981 <File
982 RelativePath=".\lllogchat.cpp"
983 >
984 </File>
985 <File
986 RelativePath=".\llmanip.cpp"
987 >
988 </File>
989 <File
990 RelativePath=".\llmaniprotate.cpp"
991 >
992 </File>
993 <File
994 RelativePath=".\llmanipscale.cpp"
995 >
996 </File>
997 <File
998 RelativePath=".\llmaniptranslate.cpp"
999 >
1000 </File>
1001 <File
1002 RelativePath=".\llmapresponders.cpp"
1003 >
1004 </File>
1005 <File
1006 RelativePath=".\llmediaremotectrl.cpp"
1007 >
1008 </File>
1009 <File
1010 RelativePath=".\llmemoryview.cpp"
1011 >
1012 </File>
1013 <File
1014 RelativePath=".\llmenucommands.cpp"
1015 >
1016 </File>
1017 <File
1018 RelativePath=".\llmorphview.cpp"
1019 >
1020 </File>
1021 <File
1022 RelativePath=".\llmoveview.cpp"
1023 >
1024 </File>
1025 <File
1026 RelativePath=".\llmutelist.cpp"
1027 >
1028 </File>
1029 <File
1030 RelativePath=".\llnamebox.cpp"
1031 >
1032 </File>
1033 <File
1034 RelativePath=".\llnameeditor.cpp"
1035 >
1036 </File>
1037 <File
1038 RelativePath=".\llnamelistctrl.cpp"
1039 >
1040 </File>
1041 <File
1042 RelativePath=".\llnetmap.cpp"
1043 >
1044 </File>
1045 <File
1046 RelativePath=".\llnotify.cpp"
1047 >
1048 </File>
1049 <File
1050 RelativePath=".\lloverlaybar.cpp"
1051 >
1052 </File>
1053 <File
1054 RelativePath=".\llpanelaudioprefs.cpp"
1055 >
1056 </File>
1057 <File
1058 RelativePath=".\llpanelavatar.cpp"
1059 >
1060 </File>
1061 <File
1062 RelativePath=".\llpanelclassified.cpp"
1063 >
1064 </File>
1065 <File
1066 RelativePath=".\llpanelcontents.cpp"
1067 >
1068 </File>
1069 <File
1070 RelativePath=".\llpaneldebug.cpp"
1071 >
1072 </File>
1073 <File
1074 RelativePath=".\llpaneldirbrowser.cpp"
1075 >
1076 </File>
1077 <File
1078 RelativePath=".\llpaneldirclassified.cpp"
1079 >
1080 </File>
1081 <File
1082 RelativePath=".\llpaneldirevents.cpp"
1083 >
1084 </File>
1085 <File
1086 RelativePath=".\llpaneldirfind.cpp"
1087 >
1088 </File>
1089 <File
1090 RelativePath=".\llpaneldirgroups.cpp"
1091 >
1092 </File>
1093 <File
1094 RelativePath=".\llpaneldirland.cpp"
1095 >
1096 </File>
1097 <File
1098 RelativePath=".\llpaneldirpeople.cpp"
1099 >
1100 </File>
1101 <File
1102 RelativePath=".\llpaneldirplaces.cpp"
1103 >
1104 </File>
1105 <File
1106 RelativePath=".\llpaneldirpopular.cpp"
1107 >
1108 </File>
1109 <File
1110 RelativePath=".\llpaneldisplay.cpp"
1111 >
1112 </File>
1113 <File
1114 RelativePath=".\llpanelevent.cpp"
1115 >
1116 </File>
1117 <File
1118 RelativePath=".\llpanelface.cpp"
1119 >
1120 </File>
1121 <File
1122 RelativePath=".\llpanelgeneral.cpp"
1123 >
1124 </File>
1125 <File
1126 RelativePath=".\llpanelgroup.cpp"
1127 >
1128 </File>
1129 <File
1130 RelativePath=".\llpanelgroupgeneral.cpp"
1131 >
1132 </File>
1133 <File
1134 RelativePath=".\llpanelgroupinvite.cpp"
1135 >
1136 </File>
1137 <File
1138 RelativePath=".\llpanelgrouplandmoney.cpp"
1139 >
1140 </File>
1141 <File
1142 RelativePath=".\llpanelgroupnotices.cpp"
1143 >
1144 </File>
1145 <File
1146 RelativePath=".\llpanelgrouproles.cpp"
1147 >
1148 </File>
1149 <File
1150 RelativePath=".\llpanelgroupvoting.cpp"
1151 >
1152 </File>
1153 <File
1154 RelativePath=".\llpanelinput.cpp"
1155 >
1156 </File>
1157 <File
1158 RelativePath=".\llpanelinventory.cpp"
1159 >
1160 </File>
1161 <File
1162 RelativePath=".\llpanelland.cpp"
1163 >
1164 </File>
1165 <File
1166 RelativePath=".\llpanellandobjects.cpp"
1167 >
1168 </File>
1169 <File
1170 RelativePath=".\llpanellandoptions.cpp"
1171 >
1172 </File>
1173 <File
1174 RelativePath=".\llpanellogin.cpp"
1175 >
1176 </File>
1177 <File
1178 RelativePath=".\llpanelmorph.cpp"
1179 >
1180 </File>
1181 <File
1182 RelativePath=".\llpanelmsgs.cpp"
1183 >
1184 </File>
1185 <File
1186 RelativePath=".\llpanelnetwork.cpp"
1187 >
1188 </File>
1189 <File
1190 RelativePath=".\llpanelobject.cpp"
1191 >
1192 </File>
1193 <File
1194 RelativePath=".\llpanelpermissions.cpp"
1195 >
1196 </File>
1197 <File
1198 RelativePath=".\llpanelpick.cpp"
1199 >
1200 </File>
1201 <File
1202 RelativePath=".\llpanelplace.cpp"
1203 >
1204 </File>
1205 <File
1206 RelativePath=".\llpanelvolume.cpp"
1207 >
1208 </File>
1209 <File
1210 RelativePath=".\llpanelweb.cpp"
1211 >
1212 </File>
1213 <File
1214 RelativePath=".\llpatchvertexarray.cpp"
1215 >
1216 </File>
1217 <File
1218 RelativePath=".\llpolymesh.cpp"
1219 >
1220 </File>
1221 <File
1222 RelativePath=".\llpolymorph.cpp"
1223 >
1224 </File>
1225 <File
1226 RelativePath=".\llprefschat.cpp"
1227 >
1228 </File>
1229 <File
1230 RelativePath=".\llprefsim.cpp"
1231 >
1232 </File>
1233 <File
1234 RelativePath=".\llpreview.cpp"
1235 >
1236 </File>
1237 <File
1238 RelativePath=".\llpreviewanim.cpp"
1239 >
1240 </File>
1241 <File
1242 RelativePath=".\llpreviewgesture.cpp"
1243 >
1244 </File>
1245 <File
1246 RelativePath=".\llpreviewlandmark.cpp"
1247 >
1248 </File>
1249 <File
1250 RelativePath=".\llpreviewnotecard.cpp"
1251 >
1252 </File>
1253 <File
1254 RelativePath=".\llpreviewscript.cpp"
1255 >
1256 </File>
1257 <File
1258 RelativePath=".\llpreviewsound.cpp"
1259 >
1260 </File>
1261 <File
1262 RelativePath=".\llpreviewtexture.cpp"
1263 >
1264 </File>
1265 <File
1266 RelativePath=".\llprogressview.cpp"
1267 >
1268 </File>
1269 <File
1270 RelativePath=".\llregionposition.cpp"
1271 >
1272 </File>
1273 <File
1274 RelativePath=".\llroam.cpp"
1275 >
1276 </File>
1277 <File
1278 RelativePath=".\llsavedsettingsglue.cpp"
1279 >
1280 </File>
1281 <File
1282 RelativePath=".\llselectmgr.cpp"
1283 >
1284 </File>
1285 <File
1286 RelativePath=".\llsky.cpp"
1287 >
1288 </File>
1289 <File
1290 RelativePath=".\llspatialpartition.cpp"
1291 >
1292 </File>
1293 <File
1294 RelativePath=".\llsphere.cpp"
1295 >
1296 </File>
1297 <File
1298 RelativePath=".\llsprite.cpp"
1299 >
1300 </File>
1301 <File
1302 RelativePath=".\llstartup.cpp"
1303 >
1304 </File>
1305 <File
1306 RelativePath=".\llstatbar.cpp"
1307 >
1308 </File>
1309 <File
1310 RelativePath=".\llstatgraph.cpp"
1311 >
1312 </File>
1313 <File
1314 RelativePath=".\llstatusbar.cpp"
1315 >
1316 </File>
1317 <File
1318 RelativePath=".\llstatview.cpp"
1319 >
1320 </File>
1321 <File
1322 RelativePath=".\llsurface.cpp"
1323 >
1324 </File>
1325 <File
1326 RelativePath=".\llsurfacepatch.cpp"
1327 >
1328 </File>
1329 <File
1330 RelativePath=".\lltexlayer.cpp"
1331 >
1332 </File>
1333 <File
1334 RelativePath=".\lltexturecache.cpp"
1335 >
1336 </File>
1337 <File
1338 RelativePath=".\lltexturectrl.cpp"
1339 >
1340 </File>
1341 <File
1342 RelativePath=".\lltexturefetch.cpp"
1343 >
1344 </File>
1345 <File
1346 RelativePath=".\lltexturetable.cpp"
1347 >
1348 </File>
1349 <File
1350 RelativePath=".\lltextureview.cpp"
1351 >
1352 </File>
1353 <File
1354 RelativePath=".\lltool.cpp"
1355 >
1356 </File>
1357 <File
1358 RelativePath=".\lltoolbar.cpp"
1359 >
1360 </File>
1361 <File
1362 RelativePath=".\lltoolbrush.cpp"
1363 >
1364 </File>
1365 <File
1366 RelativePath=".\lltoolcomp.cpp"
1367 >
1368 </File>
1369 <File
1370 RelativePath=".\lltooldraganddrop.cpp"
1371 >
1372 </File>
1373 <File
1374 RelativePath=".\lltoolface.cpp"
1375 >
1376 </File>
1377 <File
1378 RelativePath=".\lltoolfocus.cpp"
1379 >
1380 </File>
1381 <File
1382 RelativePath=".\lltoolgrab.cpp"
1383 >
1384 </File>
1385 <File
1386 RelativePath=".\lltoolgun.cpp"
1387 >
1388 </File>
1389 <File
1390 RelativePath=".\lltoolindividual.cpp"
1391 >
1392 </File>
1393 <File
1394 RelativePath=".\lltoolmgr.cpp"
1395 >
1396 </File>
1397 <File
1398 RelativePath=".\lltoolmorph.cpp"
1399 >
1400 </File>
1401 <File
1402 RelativePath=".\lltoolobjpicker.cpp"
1403 >
1404 </File>
1405 <File
1406 RelativePath=".\lltoolpie.cpp"
1407 >
1408 </File>
1409 <File
1410 RelativePath=".\lltoolpipette.cpp"
1411 >
1412 </File>
1413 <File
1414 RelativePath=".\lltoolplacer.cpp"
1415 >
1416 </File>
1417 <File
1418 RelativePath=".\lltoolselect.cpp"
1419 >
1420 </File>
1421 <File
1422 RelativePath=".\lltoolselectland.cpp"
1423 >
1424 </File>
1425 <File
1426 RelativePath=".\lltoolselectrect.cpp"
1427 >
1428 </File>
1429 <File
1430 RelativePath=".\lltoolview.cpp"
1431 >
1432 </File>
1433 <File
1434 RelativePath=".\lltracker.cpp"
1435 >
1436 </File>
1437 <File
1438 RelativePath=".\lluploaddialog.cpp"
1439 >
1440 </File>
1441 <File
1442 RelativePath=".\llurl.cpp"
1443 >
1444 </File>
1445 <File
1446 RelativePath=".\llurlwhitelist.cpp"
1447 >
1448 </File>
1449 <File
1450 RelativePath=".\lluserauth.cpp"
1451 >
1452 </File>
1453 <File
1454 RelativePath=".\llvelocitybar.cpp"
1455 >
1456 </File>
1457 <File
1458 RelativePath=".\llviewchildren.cpp"
1459 >
1460 </File>
1461 <File
1462 RelativePath=".\llviewerassetstorage.cpp"
1463 >
1464 </File>
1465 <File
1466 RelativePath=".\llviewerassetstorage.h"
1467 >
1468 </File>
1469 <File
1470 RelativePath=".\llviewercamera.cpp"
1471 >
1472 </File>
1473 <File
1474 RelativePath=".\llviewercontrol.cpp"
1475 >
1476 </File>
1477 <File
1478 RelativePath=".\llviewerdisplay.cpp"
1479 >
1480 </File>
1481 <File
1482 RelativePath=".\llviewergesture.cpp"
1483 >
1484 </File>
1485 <File
1486 RelativePath=".\llviewerimage.cpp"
1487 >
1488 </File>
1489 <File
1490 RelativePath=".\llviewerimagelist.cpp"
1491 >
1492 </File>
1493 <File
1494 RelativePath=".\llviewerinventory.cpp"
1495 >
1496 </File>
1497 <File
1498 RelativePath=".\llviewerjoint.cpp"
1499 >
1500 </File>
1501 <File
1502 RelativePath=".\llviewerjointattachment.cpp"
1503 >
1504 </File>
1505 <File
1506 RelativePath=".\llviewerjointmesh.cpp"
1507 >
1508 </File>
1509 <File
1510 RelativePath=".\llviewerjointshape.cpp"
1511 >
1512 </File>
1513 <File
1514 RelativePath=".\llviewerkeyboard.cpp"
1515 >
1516 </File>
1517 <File
1518 RelativePath=".\llviewerlayer.cpp"
1519 >
1520 </File>
1521 <File
1522 RelativePath=".\llviewermenu.cpp"
1523 >
1524 </File>
1525 <File
1526 RelativePath=".\llviewermessage.cpp"
1527 >
1528 </File>
1529 <File
1530 RelativePath=".\llviewernetwork.cpp"
1531 >
1532 </File>
1533 <File
1534 RelativePath=".\llviewerobject.cpp"
1535 >
1536 </File>
1537 <File
1538 RelativePath=".\llviewerobjectlist.cpp"
1539 >
1540 </File>
1541 <File
1542 RelativePath=".\llviewerparcelmgr.cpp"
1543 >
1544 </File>
1545 <File
1546 RelativePath=".\llviewerparceloverlay.cpp"
1547 >
1548 </File>
1549 <File
1550 RelativePath=".\llviewerpartsim.cpp"
1551 >
1552 </File>
1553 <File
1554 RelativePath=".\llviewerpartsource.cpp"
1555 >
1556 </File>
1557 <File
1558 RelativePath=".\llviewerregion.cpp"
1559 >
1560 </File>
1561 <File
1562 RelativePath=".\llviewerreputation.cpp"
1563 >
1564 </File>
1565 <File
1566 RelativePath=".\llviewerstats.cpp"
1567 >
1568 </File>
1569 <File
1570 RelativePath=".\llviewertexteditor.cpp"
1571 >
1572 </File>
1573 <File
1574 RelativePath=".\llviewertextureanim.cpp"
1575 >
1576 </File>
1577 <File
1578 RelativePath=".\llviewerthrottle.cpp"
1579 >
1580 </File>
1581 <File
1582 RelativePath=".\llvieweruictrlfactory.cpp"
1583 >
1584 </File>
1585 <File
1586 RelativePath=".\llviewervisualparam.cpp"
1587 >
1588 </File>
1589 <File
1590 RelativePath=".\llviewerwindow.cpp"
1591 >
1592 </File>
1593 <File
1594 RelativePath=".\llvlcomposition.cpp"
1595 >
1596 </File>
1597 <File
1598 RelativePath=".\llvlmanager.cpp"
1599 >
1600 </File>
1601 <File
1602 RelativePath=".\llvoavatar.cpp"
1603 >
1604 </File>
1605 <File
1606 RelativePath=".\llvocache.cpp"
1607 >
1608 </File>
1609 <File
1610 RelativePath=".\llvoclouds.cpp"
1611 >
1612 </File>
1613 <File
1614 RelativePath=".\llvograss.cpp"
1615 >
1616 </File>
1617 <File
1618 RelativePath=".\llvoground.cpp"
1619 >
1620 </File>
1621 <File
1622 RelativePath=".\llvoinventorylistener.cpp"
1623 >
1624 </File>
1625 <File
1626 RelativePath=".\llvolumesliderctrl.cpp"
1627 >
1628 </File>
1629 <File
1630 RelativePath=".\llvopart.cpp"
1631 >
1632 </File>
1633 <File
1634 RelativePath=".\llvopartgroup.cpp"
1635 >
1636 </File>
1637 <File
1638 RelativePath=".\llvosky.cpp"
1639 >
1640 </File>
1641 <File
1642 RelativePath=".\llvostars.cpp"
1643 >
1644 </File>
1645 <File
1646 RelativePath=".\llvosurfacepatch.cpp"
1647 >
1648 </File>
1649 <File
1650 RelativePath=".\llvotextbubble.cpp"
1651 >
1652 </File>
1653 <File
1654 RelativePath=".\llvotree.cpp"
1655 >
1656 </File>
1657 <File
1658 RelativePath=".\llvovolume.cpp"
1659 >
1660 </File>
1661 <File
1662 RelativePath=".\llvowater.cpp"
1663 >
1664 </File>
1665 <File
1666 RelativePath=".\llwaterpatch.cpp"
1667 >
1668 </File>
1669 <File
1670 RelativePath=".\llwearable.cpp"
1671 >
1672 </File>
1673 <File
1674 RelativePath=".\llwearablelist.cpp"
1675 >
1676 </File>
1677 <File
1678 RelativePath=".\llweb.cpp"
1679 >
1680 </File>
1681 <File
1682 RelativePath=".\llwebbrowserctrl.cpp"
1683 >
1684 </File>
1685 <File
1686 RelativePath=".\llwind.cpp"
1687 >
1688 </File>
1689 <File
1690 RelativePath=".\llwindebug.cpp"
1691 >
1692 </File>
1693 <File
1694 RelativePath=".\llworld.cpp"
1695 >
1696 </File>
1697 <File
1698 RelativePath=".\llworldmap.cpp"
1699 >
1700 </File>
1701 <File
1702 RelativePath=".\llworldmapview.cpp"
1703 >
1704 </File>
1705 <File
1706 RelativePath=".\llxmlrpctransaction.cpp"
1707 >
1708 </File>
1709 <File
1710 RelativePath=".\moviemaker.cpp"
1711 >
1712 </File>
1713 <File
1714 RelativePath=".\noise.cpp"
1715 >
1716 </File>
1717 <File
1718 RelativePath=".\pipeline.cpp"
1719 >
1720 </File>
1721 <File
1722 RelativePath=".\viewer.cpp"
1723 >
1724 </File>
1725 </Filter>
1726 <Filter
1727 Name="Header Files"
1728 Filter="h;hpp;hxx;hm;inl;inc;xsd"
1729 UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
1730 >
1731 <File
1732 RelativePath=".\audiosettings.h"
1733 >
1734 </File>
1735 <File
1736 RelativePath=".\head.h"
1737 >
1738 </File>
1739 <File
1740 RelativePath=".\llagent.h"
1741 >
1742 </File>
1743 <File
1744 RelativePath=".\llagentdata.h"
1745 >
1746 </File>
1747 <File
1748 RelativePath=".\llagentpilot.h"
1749 >
1750 </File>
1751 <File
1752 RelativePath=".\llagparray.h"
1753 >
1754 </File>
1755 <File
1756 RelativePath=".\llanimalcontrols.h"
1757 >
1758 </File>
1759 <File
1760 RelativePath=".\llappearance.h"
1761 >
1762 </File>
1763 <File
1764 RelativePath=".\llasynchostbyname.h"
1765 >
1766 </File>
1767 <File
1768 RelativePath=".\llaudiosourcevo.h"
1769 >
1770 </File>
1771 <File
1772 RelativePath=".\llaudiostatus.h"
1773 >
1774 </File>
1775 <File
1776 RelativePath=".\llautocomplete.h"
1777 >
1778 </File>
1779 <File
1780 RelativePath=".\llbbox.h"
1781 >
1782 </File>
1783 <File
1784 RelativePath=".\llbox.h"
1785 >
1786 </File>
1787 <File
1788 RelativePath=".\llcallbacklist.h"
1789 >
1790 </File>
1791 <File
1792 RelativePath=".\llcallingcard.h"
1793 >
1794 </File>
1795 <File
1796 RelativePath=".\llcameraview.h"
1797 >
1798 </File>
1799 <File
1800 RelativePath=".\llcape.h"
1801 >
1802 </File>
1803 <File
1804 RelativePath=".\llchatbar.h"
1805 >
1806 </File>
1807 <File
1808 RelativePath=".\llclassifiedinfo.h"
1809 >
1810 </File>
1811 <File
1812 RelativePath=".\llcloud.h"
1813 >
1814 </File>
1815 <File
1816 RelativePath=".\llcolorscheme.h"
1817 >
1818 </File>
1819 <File
1820 RelativePath=".\llcolorswatch.h"
1821 >
1822 </File>
1823 <File
1824 RelativePath=".\llcompass.h"
1825 >
1826 </File>
1827 <File
1828 RelativePath=".\llcompilequeue.h"
1829 >
1830 </File>
1831 <File
1832 RelativePath=".\llconfirmationmanager.h"
1833 >
1834 </File>
1835 <File
1836 RelativePath=".\llconsole.h"
1837 >
1838 </File>
1839 <File
1840 RelativePath=".\llcontainerview.h"
1841 >
1842 </File>
1843 <File
1844 RelativePath=".\llcountdown.h"
1845 >
1846 </File>
1847 <File
1848 RelativePath=".\llcubemap.h"
1849 >
1850 </File>
1851 <File
1852 RelativePath=".\llcurrencyuimanager.h"
1853 >
1854 </File>
1855 <File
1856 RelativePath=".\llcylinder.h"
1857 >
1858 </File>
1859 <File
1860 RelativePath=".\lldebugmessagebox.h"
1861 >
1862 </File>
1863 <File
1864 RelativePath=".\lldebugview.h"
1865 >
1866 </File>
1867 <File
1868 RelativePath=".\lldirpicker.h"
1869 >
1870 </File>
1871 <File
1872 RelativePath=".\lldrawable.h"
1873 >
1874 </File>
1875 <File
1876 RelativePath=".\lldrawpool.h"
1877 >
1878 </File>
1879 <File
1880 RelativePath=".\lldrawpoolalpha.h"
1881 >
1882 </File>
1883 <File
1884 RelativePath=".\lldrawpoolavatar.h"
1885 >
1886 </File>
1887 <File
1888 RelativePath=".\lldrawpoolbump.h"
1889 >
1890 </File>
1891 <File
1892 RelativePath=".\lldrawpoolclouds.h"
1893 >
1894 </File>
1895 <File
1896 RelativePath=".\lldrawpoolground.h"
1897 >
1898 </File>
1899 <File
1900 RelativePath=".\lldrawpoolhud.h"
1901 >
1902 </File>
1903 <File
1904 RelativePath=".\lldrawpoolsimple.h"
1905 >
1906 </File>
1907 <File
1908 RelativePath=".\lldrawpoolsky.h"
1909 >
1910 </File>
1911 <File
1912 RelativePath=".\lldrawpoolstars.h"
1913 >
1914 </File>
1915 <File
1916 RelativePath=".\lldrawpoolterrain.h"
1917 >
1918 </File>
1919 <File
1920 RelativePath=".\lldrawpooltree.h"
1921 >
1922 </File>
1923 <File
1924 RelativePath=".\lldrawpooltreenew.h"
1925 >
1926 </File>
1927 <File
1928 RelativePath=".\lldrawpoolwater.h"
1929 >
1930 </File>
1931 <File
1932 RelativePath=".\lldriverparam.h"
1933 >
1934 </File>
1935 <File
1936 RelativePath=".\lldynamictexture.h"
1937 >
1938 </File>
1939 <File
1940 RelativePath=".\llemote.h"
1941 >
1942 </File>
1943 <File
1944 RelativePath=".\lleventemitter.h"
1945 >
1946 </File>
1947 <File
1948 RelativePath=".\lleventinfo.h"
1949 >
1950 </File>
1951 <File
1952 RelativePath=".\lleventnotifier.h"
1953 >
1954 </File>
1955 <File
1956 RelativePath=".\lleventpoll.h"
1957 >
1958 </File>
1959 <File
1960 RelativePath=".\llface.h"
1961 >
1962 </File>
1963 <File
1964 RelativePath=".\llfasttimerview.h"
1965 >
1966 </File>
1967 <File
1968 RelativePath=".\llfeaturemanager.h"
1969 >
1970 </File>
1971 <File
1972 RelativePath=".\llfft.h"
1973 >
1974 </File>
1975 <File
1976 RelativePath=".\llfilepicker.h"
1977 >
1978 </File>
1979 <File
1980 RelativePath=".\llfilist.h"
1981 >
1982 </File>
1983 <File
1984 RelativePath=".\llfirstuse.h"
1985 >
1986 </File>
1987 <File
1988 RelativePath=".\llflexibleobject.h"
1989 >
1990 </File>
1991 <File
1992 RelativePath=".\llfloaterabout.h"
1993 >
1994 </File>
1995 <File
1996 RelativePath=".\llfloateranimpreview.h"
1997 >
1998 </File>
1999 <File
2000 RelativePath=".\llfloaterauction.h"
2001 >
2002 </File>
2003 <File
2004 RelativePath=".\llfloateravatarinfo.h"
2005 >
2006 </File>
2007 <File
2008 RelativePath=".\llfloateravatarpicker.h"
2009 >
2010 </File>
2011 <File
2012 RelativePath=".\llfloateravatartextures.h"
2013 >
2014 </File>
2015 <File
2016 RelativePath=".\llfloaterbuildoptions.h"
2017 >
2018 </File>
2019 <File
2020 RelativePath=".\llfloaterbump.h"
2021 >
2022 </File>
2023 <File
2024 RelativePath=".\llfloaterbuy.h"
2025 >
2026 </File>
2027 <File
2028 RelativePath=".\llfloaterbuycontents.h"
2029 >
2030 </File>
2031 <File
2032 RelativePath=".\llfloaterbuycurrency.h"
2033 >
2034 </File>
2035 <File
2036 RelativePath=".\llfloaterbuyland.h"
2037 >
2038 </File>
2039 <File
2040 RelativePath=".\llfloaterchat.h"
2041 >
2042 </File>
2043 <File
2044 RelativePath=".\llfloaterclothing.h"
2045 >
2046 </File>
2047 <File
2048 RelativePath=".\llfloatercolorpicker.h"
2049 >
2050 </File>
2051 <File
2052 RelativePath=".\llfloatercustomize.h"
2053 >
2054 </File>
2055 <File
2056 RelativePath=".\llfloaterdirectory.h"
2057 >
2058 </File>
2059 <File
2060 RelativePath=".\llfloatereditui.h"
2061 >
2062 </File>
2063 <File
2064 RelativePath=".\llfloaterfriends.h"
2065 >
2066 </File>
2067 <File
2068 RelativePath=".\llfloatergesture.h"
2069 >
2070 </File>
2071 <File
2072 RelativePath=".\llfloatergodtools.h"
2073 >
2074 </File>
2075 <File
2076 RelativePath=".\llfloatergroupinfo.h"
2077 >
2078 </File>
2079 <File
2080 RelativePath=".\llfloatergroupinvite.h"
2081 >
2082 </File>
2083 <File
2084 RelativePath=".\llfloatergroups.h"
2085 >
2086 </File>
2087 <File
2088 RelativePath=".\llfloaterhtml.h"
2089 >
2090 </File>
2091 <File
2092 RelativePath=".\llfloaterhtmlfind.h"
2093 >
2094 </File>
2095 <File
2096 RelativePath=".\llfloaterhtmlhelp.h"
2097 >
2098 </File>
2099 <File
2100 RelativePath=".\llfloaterimagepreview.h"
2101 >
2102 </File>
2103 <File
2104 RelativePath=".\llfloaterimport.h"
2105 >
2106 </File>
2107 <File
2108 RelativePath=".\llfloaterinspect.h"
2109 >
2110 </File>
2111 <File
2112 RelativePath=".\llfloaterland.h"
2113 >
2114 </File>
2115 <File
2116 RelativePath=".\llfloaterlandholdings.h"
2117 >
2118 </File>
2119 <File
2120 RelativePath=".\llfloatermap.h"
2121 >
2122 </File>
2123 <File
2124 RelativePath=".\llfloatermute.h"
2125 >
2126 </File>
2127 <File
2128 RelativePath=".\llfloaternamedesc.h"
2129 >
2130 </File>
2131 <File
2132 RelativePath=".\llfloaternewim.h"
2133 >
2134 </File>
2135 <File
2136 RelativePath=".\llfloateropenobject.h"
2137 >
2138 </File>
2139 <File
2140 RelativePath=".\llfloaterpermissionsmgr.h"
2141 >
2142 </File>
2143 <File
2144 RelativePath=".\llfloaterpostcard.h"
2145 >
2146 </File>
2147 <File
2148 RelativePath=".\llfloaterpreference.h"
2149 >
2150 </File>
2151 <File
2152 RelativePath=".\llfloaterproperties.h"
2153 >
2154 </File>
2155 <File
2156 RelativePath=".\llfloaterrate.h"
2157 >
2158 </File>
2159 <File
2160 RelativePath=".\llfloaterregioninfo.h"
2161 >
2162 </File>
2163 <File
2164 RelativePath=".\llfloaterreporter.h"
2165 >
2166 </File>
2167 <File
2168 RelativePath=".\llfloatersaveavatar.h"
2169 >
2170 </File>
2171 <File
2172 RelativePath=".\llfloaterscriptdebug.h"
2173 >
2174 </File>
2175 <File
2176 RelativePath=".\llfloatersellland.h"
2177 >
2178 </File>
2179 <File
2180 RelativePath=".\llfloatersnapshot.h"
2181 >
2182 </File>
2183 <File
2184 RelativePath=".\llfloatertelehub.h"
2185 >
2186 </File>
2187 <File
2188 RelativePath=".\llfloatertest.h"
2189 >
2190 </File>
2191 <File
2192 RelativePath=".\llfloatertools.h"
2193 >
2194 </File>
2195 <File
2196 RelativePath=".\llfloatertopobjects.h"
2197 >
2198 </File>
2199 <File
2200 RelativePath=".\llfloatertos.h"
2201 >
2202 </File>
2203 <File
2204 RelativePath=".\llfloaterworldmap.h"
2205 >
2206 </File>
2207 <File
2208 RelativePath=".\llfolderview.h"
2209 >
2210 </File>
2211 <File
2212 RelativePath=".\llfollowcam.h"
2213 >
2214 </File>
2215 <File
2216 RelativePath=".\llframestats.h"
2217 >
2218 </File>
2219 <File
2220 RelativePath=".\llframestatview.h"
2221 >
2222 </File>
2223 <File
2224 RelativePath=".\llgenepool.h"
2225 >
2226 </File>
2227 <File
2228 RelativePath=".\llgesturemgr.h"
2229 >
2230 </File>
2231 <File
2232 RelativePath=".\llgivemoney.h"
2233 >
2234 </File>
2235 <File
2236 RelativePath=".\llgroupmgr.h"
2237 >
2238 </File>
2239 <File
2240 RelativePath=".\llgroupnotify.h"
2241 >
2242 </File>
2243 <File
2244 RelativePath=".\llhippo.h"
2245 >
2246 </File>
2247 <File
2248 RelativePath=".\llhoverview.h"
2249 >
2250 </File>
2251 <File
2252 RelativePath=".\llhudconnector.h"
2253 >
2254 </File>
2255 <File
2256 RelativePath=".\llhudeffect.h"
2257 >
2258 </File>
2259 <File
2260 RelativePath=".\llhudeffectbeam.h"
2261 >
2262 </File>
2263 <File
2264 RelativePath=".\llhudeffectlookat.h"
2265 >
2266 </File>
2267 <File
2268 RelativePath=".\llhudeffectpointat.h"
2269 >
2270 </File>
2271 <File
2272 RelativePath=".\llhudeffecttrail.h"
2273 >
2274 </File>
2275 <File
2276 RelativePath=".\llhudicon.h"
2277 >
2278 </File>
2279 <File
2280 RelativePath=".\llhudmanager.h"
2281 >
2282 </File>
2283 <File
2284 RelativePath=".\llhudobject.h"
2285 >
2286 </File>
2287 <File
2288 RelativePath=".\llhudrender.h"
2289 >
2290 </File>
2291 <File
2292 RelativePath=".\llhudtext.h"
2293 >
2294 </File>
2295 <File
2296 RelativePath=".\llhudview.h"
2297 >
2298 </File>
2299 <File
2300 RelativePath=".\llimpanel.h"
2301 >
2302 </File>
2303 <File
2304 RelativePath=".\llimview.h"
2305 >
2306 </File>
2307 <File
2308 RelativePath=".\llinventorybridge.h"
2309 >
2310 </File>
2311 <File
2312 RelativePath=".\llinventoryclipboard.h"
2313 >
2314 </File>
2315 <File
2316 RelativePath=".\llinventorymodel.h"
2317 >
2318 </File>
2319 <File
2320 RelativePath=".\llinventoryview.h"
2321 >
2322 </File>
2323 <File
2324 RelativePath=".\lljoystickbutton.h"
2325 >
2326 </File>
2327 <File
2328 RelativePath=".\lllandmarklist.h"
2329 >
2330 </File>
2331 <File
2332 RelativePath=".\lllightconstants.h"
2333 >
2334 </File>
2335 <File
2336 RelativePath=".\lllocalanimationobject.h"
2337 >
2338 </File>
2339 <File
2340 RelativePath=".\lllogchat.h"
2341 >
2342 </File>
2343 <File
2344 RelativePath=".\llmanip.h"
2345 >
2346 </File>
2347 <File
2348 RelativePath=".\llmaniprotate.h"
2349 >
2350 </File>
2351 <File
2352 RelativePath=".\llmanipscale.h"
2353 >
2354 </File>
2355 <File
2356 RelativePath=".\llmaniptranslate.h"
2357 >
2358 </File>
2359 <File
2360 RelativePath=".\llmediaremotectrl.h"
2361 >
2362 </File>
2363 <File
2364 RelativePath=".\llmemoryview.h"
2365 >
2366 </File>
2367 <File
2368 RelativePath=".\llmenucommands.h"
2369 >
2370 </File>
2371 <File
2372 RelativePath=".\llmorphview.h"
2373 >
2374 </File>
2375 <File
2376 RelativePath=".\llmoveview.h"
2377 >
2378 </File>
2379 <File
2380 RelativePath=".\llmutelist.h"
2381 >
2382 </File>
2383 <File
2384 RelativePath=".\llnamebox.h"
2385 >
2386 </File>
2387 <File
2388 RelativePath=".\llnameeditor.h"
2389 >
2390 </File>
2391 <File
2392 RelativePath=".\llnamelistctrl.h"
2393 >
2394 </File>
2395 <File
2396 RelativePath=".\llnetmap.h"
2397 >
2398 </File>
2399 <File
2400 RelativePath=".\llnotify.h"
2401 >
2402 </File>
2403 <File
2404 RelativePath=".\lloverlaybar.h"
2405 >
2406 </File>
2407 <File
2408 RelativePath=".\llpanelaudioprefs.h"
2409 >
2410 </File>
2411 <File
2412 RelativePath=".\llpanelavatar.h"
2413 >
2414 </File>
2415 <File
2416 RelativePath=".\llpanelclassified.h"
2417 >
2418 </File>
2419 <File
2420 RelativePath=".\llpanelcontents.h"
2421 >
2422 </File>
2423 <File
2424 RelativePath=".\llpanelcreate.h"
2425 >
2426 </File>
2427 <File
2428 RelativePath=".\llpaneldebug.h"
2429 >
2430 </File>
2431 <File
2432 RelativePath=".\llpaneldirbrowser.h"
2433 >
2434 </File>
2435 <File
2436 RelativePath=".\llpaneldirclassified.h"
2437 >
2438 </File>
2439 <File
2440 RelativePath=".\llpaneldirevents.h"
2441 >
2442 </File>
2443 <File
2444 RelativePath=".\llpaneldirfind.h"
2445 >
2446 </File>
2447 <File
2448 RelativePath=".\llpaneldirgroups.h"
2449 >
2450 </File>
2451 <File
2452 RelativePath=".\llpaneldirland.h"
2453 >
2454 </File>
2455 <File
2456 RelativePath=".\llpaneldirpeople.h"
2457 >
2458 </File>
2459 <File
2460 RelativePath=".\llpaneldirplaces.h"
2461 >
2462 </File>
2463 <File
2464 RelativePath=".\llpaneldirpopular.h"
2465 >
2466 </File>
2467 <File
2468 RelativePath=".\llpaneldisplay.h"
2469 >
2470 </File>
2471 <File
2472 RelativePath=".\llpanelevent.h"
2473 >
2474 </File>
2475 <File
2476 RelativePath=".\llpanelface.h"
2477 >
2478 </File>
2479 <File
2480 RelativePath=".\llpanelgeneral.h"
2481 >
2482 </File>
2483 <File
2484 RelativePath=".\llpanelgroup.h"
2485 >
2486 </File>
2487 <File
2488 RelativePath=".\llpanelgroupgeneral.h"
2489 >
2490 </File>
2491 <File
2492 RelativePath=".\llpanelgroupinvite.h"
2493 >
2494 </File>
2495 <File
2496 RelativePath=".\llpanelgrouplandmoney.h"
2497 >
2498 </File>
2499 <File
2500 RelativePath=".\llpanelgroupnotices.h"
2501 >
2502 </File>
2503 <File
2504 RelativePath=".\llpanelgrouproles.h"
2505 >
2506 </File>
2507 <File
2508 RelativePath=".\llpanelgroupvoting.h"
2509 >
2510 </File>
2511 <File
2512 RelativePath=".\llpanelinput.h"
2513 >
2514 </File>
2515 <File
2516 RelativePath=".\llpanelinventory.h"
2517 >
2518 </File>
2519 <File
2520 RelativePath=".\llpanelland.h"
2521 >
2522 </File>
2523 <File
2524 RelativePath=".\llpanellandobjects.h"
2525 >
2526 </File>
2527 <File
2528 RelativePath=".\llpanellandoptions.h"
2529 >
2530 </File>
2531 <File
2532 RelativePath=".\llpanellogin.h"
2533 >
2534 </File>
2535 <File
2536 RelativePath=".\llpanelmorph.h"
2537 >
2538 </File>
2539 <File
2540 RelativePath=".\llpanelmsgs.h"
2541 >
2542 </File>
2543 <File
2544 RelativePath=".\llpanelnetwork.h"
2545 >
2546 </File>
2547 <File
2548 RelativePath=".\llpanelobject.h"
2549 >
2550 </File>
2551 <File
2552 RelativePath=".\llpanelpermissions.h"
2553 >
2554 </File>
2555 <File
2556 RelativePath=".\llpanelpick.h"
2557 >
2558 </File>
2559 <File
2560 RelativePath=".\llpanelplace.h"
2561 >
2562 </File>
2563 <File
2564 RelativePath=".\llpanelvolume.h"
2565 >
2566 </File>
2567 <File
2568 RelativePath=".\llpanelweb.h"
2569 >
2570 </File>
2571 <File
2572 RelativePath=".\llpatchvertexarray.h"
2573 >
2574 </File>
2575 <File
2576 RelativePath=".\llpbuffer.h"
2577 >
2578 </File>
2579 <File
2580 RelativePath=".\llpolymesh.h"
2581 >
2582 </File>
2583 <File
2584 RelativePath=".\llpolymorph.h"
2585 >
2586 </File>
2587 <File
2588 RelativePath=".\llprefschat.h"
2589 >
2590 </File>
2591 <File
2592 RelativePath=".\llprefsim.h"
2593 >
2594 </File>
2595 <File
2596 RelativePath=".\llpreview.h"
2597 >
2598 </File>
2599 <File
2600 RelativePath=".\llpreviewanim.h"
2601 >
2602 </File>
2603 <File
2604 RelativePath=".\llpreviewgesture.h"
2605 >
2606 </File>
2607 <File
2608 RelativePath=".\llpreviewlandmark.h"
2609 >
2610 </File>
2611 <File
2612 RelativePath=".\llpreviewnotecard.h"
2613 >
2614 </File>
2615 <File
2616 RelativePath=".\llpreviewobject.h"
2617 >
2618 </File>
2619 <File
2620 RelativePath=".\llpreviewscript.h"
2621 >
2622 </File>
2623 <File
2624 RelativePath=".\llpreviewsound.h"
2625 >
2626 </File>
2627 <File
2628 RelativePath=".\llpreviewtexture.h"
2629 >
2630 </File>
2631 <File
2632 RelativePath=".\llprogressview.h"
2633 >
2634 </File>
2635 <File
2636 RelativePath=".\llregionposition.h"
2637 >
2638 </File>
2639 <File
2640 RelativePath=".\llrig.h"
2641 >
2642 </File>
2643 <File
2644 RelativePath=".\llroam.h"
2645 >
2646 </File>
2647 <File
2648 RelativePath=".\llsavedsettingsglue.h"
2649 >
2650 </File>
2651 <File
2652 RelativePath=".\llselectmgr.h"
2653 >
2654 </File>
2655 <File
2656 RelativePath=".\llsky.h"
2657 >
2658 </File>
2659 <File
2660 RelativePath=".\llspatialpartition.h"
2661 >
2662 </File>
2663 <File
2664 RelativePath=".\llsphere.h"
2665 >
2666 </File>
2667 <File
2668 RelativePath=".\llsprite.h"
2669 >
2670 </File>
2671 <File
2672 RelativePath=".\llstartup.h"
2673 >
2674 </File>
2675 <File
2676 RelativePath=".\llstatbar.h"
2677 >
2678 </File>
2679 <File
2680 RelativePath=".\llstatgraph.h"
2681 >
2682 </File>
2683 <File
2684 RelativePath=".\llstatusbar.h"
2685 >
2686 </File>
2687 <File
2688 RelativePath=".\llstatview.h"
2689 >
2690 </File>
2691 <File
2692 RelativePath=".\llsurface.h"
2693 >
2694 </File>
2695 <File
2696 RelativePath=".\llsurfacepatch.h"
2697 >
2698 </File>
2699 <File
2700 RelativePath=".\lltable.h"
2701 >
2702 </File>
2703 <File
2704 RelativePath=".\lltexlayer.h"
2705 >
2706 </File>
2707 <File
2708 RelativePath=".\lltexturebar.h"
2709 >
2710 </File>
2711 <File
2712 RelativePath=".\lltexturecache.h"
2713 >
2714 </File>
2715 <File
2716 RelativePath=".\lltexturectrl.h"
2717 >
2718 </File>
2719 <File
2720 RelativePath=".\lltexturefetch.h"
2721 >
2722 </File>
2723 <File
2724 RelativePath=".\lltexturetable.h"
2725 >
2726 </File>
2727 <File
2728 RelativePath=".\lltextureview.h"
2729 >
2730 </File>
2731 <File
2732 RelativePath=".\lltool.h"
2733 >
2734 </File>
2735 <File
2736 RelativePath=".\lltoolbar.h"
2737 >
2738 </File>
2739 <File
2740 RelativePath=".\lltoolbrush.h"
2741 >
2742 </File>
2743 <File
2744 RelativePath=".\lltoolcomp.h"
2745 >
2746 </File>
2747 <File
2748 RelativePath=".\lltooldraganddrop.h"
2749 >
2750 </File>
2751 <File
2752 RelativePath=".\lltoolface.h"
2753 >
2754 </File>
2755 <File
2756 RelativePath=".\lltoolfocus.h"
2757 >
2758 </File>
2759 <File
2760 RelativePath=".\lltoolgrab.h"
2761 >
2762 </File>
2763 <File
2764 RelativePath=".\lltoolgun.h"
2765 >
2766 </File>
2767 <File
2768 RelativePath=".\lltoolindividual.h"
2769 >
2770 </File>
2771 <File
2772 RelativePath=".\lltoolmgr.h"
2773 >
2774 </File>
2775 <File
2776 RelativePath=".\lltoolmorph.h"
2777 >
2778 </File>
2779 <File
2780 RelativePath=".\lltoolobjpicker.h"
2781 >
2782 </File>
2783 <File
2784 RelativePath=".\lltoolpie.h"
2785 >
2786 </File>
2787 <File
2788 RelativePath=".\lltoolpipette.h"
2789 >
2790 </File>
2791 <File
2792 RelativePath=".\lltoolplacer.h"
2793 >
2794 </File>
2795 <File
2796 RelativePath=".\lltoolselect.h"
2797 >
2798 </File>
2799 <File
2800 RelativePath=".\lltoolselectland.h"
2801 >
2802 </File>
2803 <File
2804 RelativePath=".\lltoolselectrect.h"
2805 >
2806 </File>
2807 <File
2808 RelativePath=".\lltoolview.h"
2809 >
2810 </File>
2811 <File
2812 RelativePath=".\lltracker.h"
2813 >
2814 </File>
2815 <File
2816 RelativePath=".\lluploaddialog.h"
2817 >
2818 </File>
2819 <File
2820 RelativePath=".\llurl.h"
2821 >
2822 </File>
2823 <File
2824 RelativePath=".\llurlwhitelist.h"
2825 >
2826 </File>
2827 <File
2828 RelativePath=".\lluserauth.h"
2829 >
2830 </File>
2831 <File
2832 RelativePath=".\lluvscreen.h"
2833 >
2834 </File>
2835 <File
2836 RelativePath=".\llvelocitybar.h"
2837 >
2838 </File>
2839 <File
2840 RelativePath=".\llviewchildren.h"
2841 >
2842 </File>
2843 <File
2844 RelativePath=".\llviewerbuild.h"
2845 >
2846 </File>
2847 <File
2848 RelativePath=".\llviewercamera.h"
2849 >
2850 </File>
2851 <File
2852 RelativePath=".\llviewercontrol.h"
2853 >
2854 </File>
2855 <File
2856 RelativePath=".\llviewerdisplay.h"
2857 >
2858 </File>
2859 <File
2860 RelativePath=".\llviewergesture.h"
2861 >
2862 </File>
2863 <File
2864 RelativePath=".\llviewerimage.h"
2865 >
2866 </File>
2867 <File
2868 RelativePath=".\llviewerimagelist.h"
2869 >
2870 </File>
2871 <File
2872 RelativePath=".\llviewerinventory.h"
2873 >
2874 </File>
2875 <File
2876 RelativePath=".\llviewerjoint.h"
2877 >
2878 </File>
2879 <File
2880 RelativePath=".\llviewerjointattachment.h"
2881 >
2882 </File>
2883 <File
2884 RelativePath=".\llviewerjointmesh.h"
2885 >
2886 </File>
2887 <File
2888 RelativePath=".\llviewerjointshape.h"
2889 >
2890 </File>
2891 <File
2892 RelativePath=".\llviewerkeyboard.h"
2893 >
2894 </File>
2895 <File
2896 RelativePath=".\llviewerlayer.h"
2897 >
2898 </File>
2899 <File
2900 RelativePath=".\llviewermenu.h"
2901 >
2902 </File>
2903 <File
2904 RelativePath=".\llviewermessage.h"
2905 >
2906 </File>
2907 <File
2908 RelativePath=".\llviewernetwork.h"
2909 >
2910 </File>
2911 <File
2912 RelativePath=".\llviewerobject.h"
2913 >
2914 </File>
2915 <File
2916 RelativePath=".\llviewerobjectlist.h"
2917 >
2918 </File>
2919 <File
2920 RelativePath=".\llviewerparcelmgr.h"
2921 >
2922 </File>
2923 <File
2924 RelativePath=".\llviewerparceloverlay.h"
2925 >
2926 </File>
2927 <File
2928 RelativePath=".\llviewerpartsim.h"
2929 >
2930 </File>
2931 <File
2932 RelativePath=".\llviewerpartsource.h"
2933 >
2934 </File>
2935 <File
2936 RelativePath=".\llviewerregion.h"
2937 >
2938 </File>
2939 <File
2940 RelativePath=".\llviewerreputation.h"
2941 >
2942 </File>
2943 <File
2944 RelativePath=".\llviewerstats.h"
2945 >
2946 </File>
2947 <File
2948 RelativePath=".\llviewertexteditor.h"
2949 >
2950 </File>
2951 <File
2952 RelativePath=".\llviewertextureanim.h"
2953 >
2954 </File>
2955 <File
2956 RelativePath=".\llviewerthrottle.h"
2957 >
2958 </File>
2959 <File
2960 RelativePath=".\llvieweruictrlfactory.h"
2961 >
2962 </File>
2963 <File
2964 RelativePath=".\llviewervisualparam.h"
2965 >
2966 </File>
2967 <File
2968 RelativePath=".\llviewerwindow.h"
2969 >
2970 </File>
2971 <File
2972 RelativePath=".\llvlcomposition.h"
2973 >
2974 </File>
2975 <File
2976 RelativePath=".\llvlmanager.h"
2977 >
2978 </File>
2979 <File
2980 RelativePath=".\llvoavatar.h"
2981 >
2982 </File>
2983 <File
2984 RelativePath=".\llvocache.h"
2985 >
2986 </File>
2987 <File
2988 RelativePath=".\llvoclouds.h"
2989 >
2990 </File>
2991 <File
2992 RelativePath=".\llvograss.h"
2993 >
2994 </File>
2995 <File
2996 RelativePath=".\llvoground.h"
2997 >
2998 </File>
2999 <File
3000 RelativePath=".\llvoinventorylistener.h"
3001 >
3002 </File>
3003 <File
3004 RelativePath=".\llvolumesliderctrl.h"
3005 >
3006 </File>
3007 <File
3008 RelativePath=".\llvopart.h"
3009 >
3010 </File>
3011 <File
3012 RelativePath=".\llvopartgroup.h"
3013 >
3014 </File>
3015 <File
3016 RelativePath=".\llvosky.h"
3017 >
3018 </File>
3019 <File
3020 RelativePath=".\llvostars.h"
3021 >
3022 </File>
3023 <File
3024 RelativePath=".\llvosurfacepatch.h"
3025 >
3026 </File>
3027 <File
3028 RelativePath=".\llvotextbubble.h"
3029 >
3030 </File>
3031 <File
3032 RelativePath=".\llvotree.h"
3033 >
3034 </File>
3035 <File
3036 RelativePath=".\llvotreenew.h"
3037 >
3038 </File>
3039 <File
3040 RelativePath=".\llvovolume.h"
3041 >
3042 </File>
3043 <File
3044 RelativePath=".\llvowater.h"
3045 >
3046 </File>
3047 <File
3048 RelativePath=".\llwaterpatch.h"
3049 >
3050 </File>
3051 <File
3052 RelativePath=".\llwearable.h"
3053 >
3054 </File>
3055 <File
3056 RelativePath=".\llwearablelist.h"
3057 >
3058 </File>
3059 <File
3060 RelativePath=".\llweb.h"
3061 >
3062 </File>
3063 <File
3064 RelativePath=".\llwebbrowserctrl.h"
3065 >
3066 </File>
3067 <File
3068 RelativePath=".\llwind.h"
3069 >
3070 </File>
3071 <File
3072 RelativePath=".\llwindebug.h"
3073 >
3074 </File>
3075 <File
3076 RelativePath=".\llworld.h"
3077 >
3078 </File>
3079 <File
3080 RelativePath=".\llworldmap.h"
3081 >
3082 </File>
3083 <File
3084 RelativePath=".\llworldmapview.h"
3085 >
3086 </File>
3087 <File
3088 RelativePath=".\llxmlrpctransaction.h"
3089 >
3090 </File>
3091 <File
3092 RelativePath=".\macmain.h"
3093 >
3094 </File>
3095 <File
3096 RelativePath=".\moviemaker.h"
3097 >
3098 </File>
3099 <File
3100 RelativePath=".\noise.h"
3101 >
3102 </File>
3103 <File
3104 RelativePath=".\pipeline.h"
3105 >
3106 </File>
3107 <File
3108 RelativePath=".\randgauss.h"
3109 >
3110 </File>
3111 <File
3112 RelativePath=".\VertexCache.h"
3113 >
3114 </File>
3115 <File
3116 RelativePath=".\viewer.h"
3117 >
3118 </File>
3119 <File
3120 RelativePath=".\VorbisFramework.h"
3121 >
3122 </File>
3123 </Filter>
3124 <Filter
3125 Name="Resource Files"
3126 Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
3127 UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
3128 >
3129 <File
3130 RelativePath=".\skins\xui\en-us\alerts.xml"
3131 >
3132 </File>
3133 <File
3134 RelativePath=".\app_settings\anim.ini"
3135 >
3136 </File>
3137 <File
3138 RelativePath=".\res\arrowcop.cur"
3139 >
3140 </File>
3141 <File
3142 RelativePath=".\res\arrowcopmulti.cur"
3143 >
3144 </File>
3145 <File
3146 RelativePath=".\res\bitmap2.bmp"
3147 >
3148 </File>
3149 <File
3150 RelativePath=".\res\bitmap4.bmp"
3151 >
3152 </File>
3153 <File
3154 RelativePath=".\app_settings\colors.xml"
3155 >
3156 </File>
3157 <File
3158 RelativePath=".\app_settings\colors_base.xml"
3159 >
3160 </File>
3161 <File
3162 RelativePath=".\skins\xui\en-us\floater_about.xml"
3163 >
3164 </File>
3165 <File
3166 RelativePath=".\skins\xui\en-us\floater_about_land.xml"
3167 >
3168 </File>
3169 <File
3170 RelativePath=".\skins\xui\en-us\floater_account_history.xml"
3171 >
3172 </File>
3173 <File
3174 RelativePath=".\skins\xui\en-us\floater_animation_preview.xml"
3175 >
3176 </File>
3177 <File
3178 RelativePath=".\skins\xui\en-us\floater_auction.xml"
3179 >
3180 </File>
3181 <File
3182 RelativePath=".\skins\xui\en-us\floater_avatar_picker.xml"
3183 >
3184 </File>
3185 <File
3186 RelativePath=".\skins\xui\en-us\floater_avatar_textures.xml"
3187 >
3188 </File>
3189 <File
3190 RelativePath=".\skins\xui\en-us\floater_build_options.xml"
3191 >
3192 </File>
3193 <File
3194 RelativePath=".\skins\xui\en-us\floater_bumps.xml"
3195 >
3196 </File>
3197 <File
3198 RelativePath=".\skins\xui\en-us\floater_buy_contents.xml"
3199 >
3200 </File>
3201 <File
3202 RelativePath=".\skins\xui\en-us\floater_buy_currency.xml"
3203 >
3204 </File>
3205 <File
3206 RelativePath=".\skins\xui\en-us\floater_buy_land.xml"
3207 >
3208 </File>
3209 <File
3210 RelativePath=".\skins\xui\en-us\floater_buy_object.xml"
3211 >
3212 </File>
3213 <File
3214 RelativePath=".\skins\xui\en-us\floater_chat_history.xml"
3215 >
3216 </File>
3217 <File
3218 RelativePath=".\skins\xui\en-us\floater_choose_group.xml"
3219 >
3220 </File>
3221 <File
3222 RelativePath=".\skins\xui\en-us\floater_clothing.xml"
3223 >
3224 </File>
3225 <File
3226 RelativePath=".\skins\xui\en-us\floater_color_picker.xml"
3227 >
3228 </File>
3229 <File
3230 RelativePath=".\skins\xui\en-us\floater_critical.xml"
3231 >
3232 </File>
3233 <File
3234 RelativePath=".\skins\xui\en-us\floater_customize.xml"
3235 >
3236 </File>
3237 <File
3238 RelativePath=".\skins\xui\en-us\floater_directory.xml"
3239 >
3240 </File>
3241 <File
3242 RelativePath=".\skins\xui\en-us\floater_friends.xml"
3243 >
3244 </File>
3245 <File
3246 RelativePath=".\skins\xui\en-us\floater_gesture.xml"
3247 >
3248 </File>
3249 <File
3250 RelativePath=".\skins\xui\en-us\floater_god_tools.xml"
3251 >
3252 </File>
3253 <File
3254 RelativePath=".\skins\xui\en-us\floater_group_info.xml"
3255 >
3256 </File>
3257 <File
3258 RelativePath=".\skins\xui\en-us\floater_groups.xml"
3259 >
3260 </File>
3261 <File
3262 RelativePath=".\skins\xui\en-us\floater_html.xml"
3263 >
3264 </File>
3265 <File
3266 RelativePath=".\skins\xui\en-us\floater_html_help.xml"
3267 >
3268 </File>
3269 <File
3270 RelativePath=".\skins\xui\en-us\floater_im.xml"
3271 >
3272 </File>
3273 <File
3274 RelativePath=".\skins\xui\en-us\floater_image_preview.xml"
3275 >
3276 </File>
3277 <File
3278 RelativePath=".\skins\xui\en-us\floater_import.xml"
3279 >
3280 </File>
3281 <File
3282 RelativePath=".\skins\xui\en-us\floater_inspect.xml"
3283 >
3284 </File>
3285 <File
3286 RelativePath=".\skins\xui\en-us\floater_instant_message.xml"
3287 >
3288 </File>
3289 <File
3290 RelativePath=".\skins\xui\en-us\floater_inventory.xml"
3291 >
3292 </File>
3293 <File
3294 RelativePath=".\skins\xui\en-us\floater_inventory_item_properties.xml"
3295 >
3296 </File>
3297 <File
3298 RelativePath=".\skins\xui\en-us\floater_inventory_view_finder.xml"
3299 >
3300 </File>
3301 <File
3302 RelativePath=".\skins\xui\en-us\floater_land_holdings.xml"
3303 >
3304 </File>
3305 <File
3306 RelativePath=".\skins\xui\en-us\floater_live_lsleditor.xml"
3307 >
3308 </File>
3309 <File
3310 RelativePath=".\skins\xui\en-us\floater_moveview.xml"
3311 >
3312 </File>
3313 <File
3314 RelativePath=".\skins\xui\en-us\floater_mute.xml"
3315 >
3316 </File>
3317 <File
3318 RelativePath=".\skins\xui\en-us\floater_name_description.xml"
3319 >
3320 </File>
3321 <File
3322 RelativePath=".\skins\xui\en-us\floater_new_im.xml"
3323 >
3324 </File>
3325 <File
3326 RelativePath=".\skins\xui\en-us\floater_new_outfit_dialog.xml"
3327 >
3328 </File>
3329 <File
3330 RelativePath=".\skins\xui\en-us\floater_openobject.xml"
3331 >
3332 </File>
3333 <File
3334 RelativePath=".\skins\xui\en-us\floater_pay.xml"
3335 >
3336 </File>
3337 <File
3338 RelativePath=".\skins\xui\en-us\floater_pay_object.xml"
3339 >
3340 </File>
3341 <File
3342 RelativePath=".\skins\xui\en-us\floater_postcard.xml"
3343 >
3344 </File>
3345 <File
3346 RelativePath=".\skins\xui\en-us\floater_preferences.xml"
3347 >
3348 </File>
3349 <File
3350 RelativePath=".\skins\xui\en-us\floater_preview_animation.xml"
3351 >
3352 </File>
3353 <File
3354 RelativePath=".\skins\xui\en-us\floater_preview_embedded_texture.xml"
3355 >
3356 </File>
3357 <File
3358 RelativePath=".\skins\xui\en-us\floater_preview_existing_landmark.xml"
3359 >
3360 </File>
3361 <File
3362 RelativePath=".\skins\xui\en-us\floater_preview_gesture.xml"
3363 >
3364 </File>
3365 <File
3366 RelativePath=".\skins\xui\en-us\floater_preview_new_landmark.xml"
3367 >
3368 </File>
3369 <File
3370 RelativePath=".\skins\xui\en-us\floater_preview_notecard.xml"
3371 >
3372 </File>
3373 <File
3374 RelativePath=".\skins\xui\en-us\floater_preview_notecard_keep_discard.xml"
3375 >
3376 </File>
3377 <File
3378 RelativePath=".\skins\xui\en-us\floater_preview_sound.xml"
3379 >
3380 </File>
3381 <File
3382 RelativePath=".\skins\xui\en-us\floater_preview_texture.xml"
3383 >
3384 </File>
3385 <File
3386 RelativePath=".\skins\xui\en-us\floater_preview_texture_keep_discard.xml"
3387 >
3388 </File>
3389 <File
3390 RelativePath=".\skins\xui\en-us\floater_price_for_listing.xml"
3391 >
3392 </File>
3393 <File
3394 RelativePath=".\skins\xui\en-us\floater_profile.xml"
3395 >
3396 </File>
3397 <File
3398 RelativePath=".\skins\xui\en-us\floater_rate.xml"
3399 >
3400 </File>
3401 <File
3402 RelativePath=".\skins\xui\en-us\floater_report_abuse.xml"
3403 >
3404 </File>
3405 <File
3406 RelativePath=".\skins\xui\en-us\floater_report_bug.xml"
3407 >
3408 </File>
3409 <File
3410 RelativePath=".\skins\xui\en-us\floater_script_debug.xml"
3411 >
3412 </File>
3413 <File
3414 RelativePath=".\skins\xui\en-us\floater_script_ed_panel.xml"
3415 >
3416 </File>
3417 <File
3418 RelativePath=".\skins\xui\en-us\floater_script_preview.xml"
3419 >
3420 </File>
3421 <File
3422 RelativePath=".\skins\xui\en-us\floater_script_preview_new.xml"
3423 >
3424 </File>
3425 <File
3426 RelativePath=".\skins\xui\en-us\floater_script_queue.xml"
3427 >
3428 </File>
3429 <File
3430 RelativePath=".\skins\xui\en-us\floater_script_search.xml"
3431 >
3432 </File>
3433 <File
3434 RelativePath=".\skins\xui\en-us\floater_sell_land.xml"
3435 >
3436 </File>
3437 <File
3438 RelativePath=".\skins\xui\en-us\floater_settings_debug.xml"
3439 >
3440 </File>
3441 <File
3442 RelativePath=".\skins\xui\en-us\floater_snapshot.xml"
3443 >
3444 </File>
3445 <File
3446 RelativePath=".\skins\xui\en-us\floater_sound_preview.xml"
3447 >
3448 </File>
3449 <File
3450 RelativePath=".\skins\xui\en-us\floater_telehub.xml"
3451 >
3452 </File>
3453 <File
3454 RelativePath=".\skins\xui\en-us\floater_texture_ctrl.xml"
3455 >
3456 </File>
3457 <File
3458 RelativePath=".\skins\xui\en-us\floater_tools.xml"
3459 >
3460 </File>
3461 <File
3462 RelativePath=".\skins\xui\en-us\floater_top_objects.xml"
3463 >
3464 </File>
3465 <File
3466 RelativePath=".\skins\xui\en-us\floater_tos.xml"
3467 >
3468 </File>
3469 <File
3470 RelativePath=".\skins\xui\en-us\floater_wearable_save_as.xml"
3471 >
3472 </File>
3473 <File
3474 RelativePath=".\skins\xui\en-us\floater_world_map.xml"
3475 >
3476 </File>
3477 <File
3478 RelativePath=".\app_settings\grass.xml"
3479 >
3480 </File>
3481 <File
3482 RelativePath=".\Info-SecondLife.plist"
3483 >
3484 </File>
3485 <File
3486 RelativePath=".\English.lproj\InfoPlist.strings"
3487 >
3488 </File>
3489 <File
3490 RelativePath=".\res\install_icon.ico"
3491 >
3492 </File>
3493 <File
3494 RelativePath=".\app_settings\keys.ini"
3495 >
3496 </File>
3497 <File
3498 RelativePath=".\app_settings\keywords.ini"
3499 >
3500 </File>
3501 <File
3502 RelativePath=".\res\ll_icon.ico"
3503 >
3504 </File>
3505 <File
3506 RelativePath=".\res\llarrow.cur"
3507 >
3508 </File>
3509 <File
3510 RelativePath=".\res\llarrowdrag.cur"
3511 >
3512 </File>
3513 <File
3514 RelativePath=".\res\llarrowdragmulti.cur"
3515 >
3516 </File>
3517 <File
3518 RelativePath=".\res\llarrowlocked.cur"
3519 >
3520 </File>
3521 <File
3522 RelativePath=".\res\llgrablocked.cur"
3523 >
3524 </File>
3525 <File
3526 RelativePath=".\res\llnolocked.cur"
3527 >
3528 </File>
3529 <File
3530 RelativePath=".\res\lltoolcamera.cur"
3531 >
3532 </File>
3533 <File
3534 RelativePath=".\res\lltoolcreate.cur"
3535 >
3536 </File>
3537 <File
3538 RelativePath=".\res\lltoolfocus.cur"
3539 >
3540 </File>
3541 <File
3542 RelativePath=".\res\lltoolgrab.cur"
3543 >
3544 </File>
3545 <File
3546 RelativePath=".\res\lltoolland.cur"
3547 >
3548 </File>
3549 <File
3550 RelativePath=".\res\lltoolpan.cur"
3551 >
3552 </File>
3553 <File
3554 RelativePath=".\res\lltoolpipette.cur"
3555 >
3556 </File>
3557 <File
3558 RelativePath=".\res\lltoolrotate.cur"
3559 >
3560 </File>
3561 <File
3562 RelativePath=".\res\lltoolscale.cur"
3563 >
3564 </File>
3565 <File
3566 RelativePath=".\res\lltooltranslate.cur"
3567 >
3568 </File>
3569 <File
3570 RelativePath=".\res\lltoolzoomin.cur"
3571 >
3572 </File>
3573 <File
3574 RelativePath=".\res\loginbackground.bmp"
3575 >
3576 </File>
3577 <File
3578 RelativePath=".\skins\xui\en-us\menu_inventory.xml"
3579 >
3580 </File>
3581 <File
3582 RelativePath=".\skins\xui\en-us\menu_pie_attachment.xml"
3583 >
3584 </File>
3585 <File
3586 RelativePath=".\skins\xui\en-us\menu_pie_avatar.xml"
3587 >
3588 </File>
3589 <File
3590 RelativePath=".\skins\xui\en-us\menu_pie_land.xml"
3591 >
3592 </File>
3593 <File
3594 RelativePath=".\skins\xui\en-us\menu_pie_object.xml"
3595 >
3596 </File>
3597 <File
3598 RelativePath=".\skins\xui\en-us\menu_pie_self.xml"
3599 >
3600 </File>
3601 <File
3602 RelativePath=".\skins\xui\en-us\menu_viewer.xml"
3603 >
3604 </File>
3605 <File
3606 RelativePath=".\res\newViewRes.rc"
3607 >
3608 </File>
3609 <File
3610 RelativePath=".\skins\xui\en-us\notify.xml"
3611 >
3612 </File>
3613 <File
3614 RelativePath=".\skins\xui\en-us\panel_account_details.xml"
3615 >
3616 </File>
3617 <File
3618 RelativePath=".\skins\xui\en-us\panel_account_planning.xml"
3619 >
3620 </File>
3621 <File
3622 RelativePath=".\skins\xui\en-us\panel_account_transactions.xml"
3623 >
3624 </File>
3625 <File
3626 RelativePath=".\skins\xui\en-us\panel_avatar.xml"
3627 >
3628 </File>
3629 <File
3630 RelativePath=".\skins\xui\en-us\panel_avatar_classified.xml"
3631 >
3632 </File>
3633 <File
3634 RelativePath=".\skins\xui\en-us\panel_avatar_pick.xml"
3635 >
3636 </File>
3637 <File
3638 RelativePath=".\skins\xui\en-us\panel_avatar_pick.xml"
3639 >
3640 </File>
3641 <File
3642 RelativePath=".\skins\xui\en-us\panel_chat_bar.xml"
3643 >
3644 </File>
3645 <File
3646 RelativePath=".\skins\xui\en-us\panel_classified.xml"
3647 >
3648 </File>
3649 <File
3650 RelativePath=".\skins\xui\en-us\panel_event.xml"
3651 >
3652 </File>
3653 <File
3654 RelativePath=".\skins\xui\en-us\panel_group.xml"
3655 >
3656 </File>
3657 <File
3658 RelativePath=".\skins\xui\en-us\panel_group_finder.xml"
3659 >
3660 </File>
3661 <File
3662 RelativePath=".\skins\xui\en-us\panel_group_general.xml"
3663 >
3664 </File>
3665 <File
3666 RelativePath=".\skins\xui\en-us\panel_group_invite.xml"
3667 >
3668 </File>
3669 <File
3670 RelativePath=".\skins\xui\en-us\panel_group_land_money.xml"
3671 >
3672 </File>
3673 <File
3674 RelativePath=".\skins\xui\en-us\panel_group_notices.xml"
3675 >
3676 </File>
3677 <File
3678 RelativePath=".\skins\xui\en-us\panel_group_roles.xml"
3679 >
3680 </File>
3681 <File
3682 RelativePath=".\skins\xui\en-us\panel_group_voting.xml"
3683 >
3684 </File>
3685 <File
3686 RelativePath=".\skins\xui\en-us\panel_land_covenant.xml"
3687 >
3688 </File>
3689 <File
3690 RelativePath=".\skins\xui\en-us\panel_login.xml"
3691 >
3692 </File>
3693 <File
3694 RelativePath=".\skins\xui\en-us\panel_media_remote.xml"
3695 >
3696 </File>
3697 <File
3698 RelativePath=".\skins\xui\en-us\panel_music_remote.xml"
3699 >
3700 </File>
3701 <File
3702 RelativePath=".\skins\xui\en-us\panel_overlaybar.xml"
3703 >
3704 </File>
3705 <File
3706 RelativePath=".\skins\xui\en-us\panel_place.xml"
3707 >
3708 </File>
3709 <File
3710 RelativePath=".\skins\xui\en-us\panel_place_small.xml"
3711 >
3712 </File>
3713 <File
3714 RelativePath=".\skins\xui\en-us\panel_preferences_audio.xml"
3715 >
3716 </File>
3717 <File
3718 RelativePath=".\skins\xui\en-us\panel_preferences_chat.xml"
3719 >
3720 </File>
3721 <File
3722 RelativePath=".\skins\xui\en-us\panel_preferences_general.xml"
3723 >
3724 </File>
3725 <File
3726 RelativePath=".\skins\xui\en-us\panel_preferences_graphics1.xml"
3727 >
3728 </File>
3729 <File
3730 RelativePath=".\skins\xui\en-us\panel_preferences_graphics2.xml"
3731 >
3732 </File>
3733 <File
3734 RelativePath=".\skins\xui\en-us\panel_preferences_graphics3.xml"
3735 >
3736 </File>
3737 <File
3738 RelativePath=".\skins\xui\en-us\panel_preferences_im.xml"
3739 >
3740 </File>
3741 <File
3742 RelativePath=".\skins\xui\en-us\panel_preferences_input.xml"
3743 >
3744 </File>
3745 <File
3746 RelativePath=".\skins\xui\en-us\panel_preferences_network.xml"
3747 >
3748 </File>
3749 <File
3750 RelativePath=".\skins\xui\en-us\panel_preferences_popups.xml"
3751 >
3752 </File>
3753 <File
3754 RelativePath=".\skins\xui\en-us\panel_region_covenant.xml"
3755 >
3756 </File>
3757 <File
3758 RelativePath=".\skins\xui\en-us\panel_region_debug.xml"
3759 >
3760 </File>
3761 <File
3762 RelativePath=".\skins\xui\en-us\panel_region_estate.xml"
3763 >
3764 </File>
3765 <File
3766 RelativePath=".\skins\xui\en-us\panel_region_general.xml"
3767 >
3768 </File>
3769 <File
3770 RelativePath=".\skins\xui\en-us\panel_region_terrain.xml"
3771 >
3772 </File>
3773 <File
3774 RelativePath=".\skins\xui\en-us\panel_region_texture.xml"
3775 >
3776 </File>
3777 <File
3778 RelativePath=".\skins\xui\en-us\panel_scrolling_param.xml"
3779 >
3780 </File>
3781 <File
3782 RelativePath=".\skins\xui\en-us\panel_settings_chat.xml"
3783 >
3784 </File>
3785 <File
3786 RelativePath=".\skins\xui\en-us\panel_settings_im.xml"
3787 >
3788 </File>
3789 <File
3790 RelativePath=".\skins\xui\en-us\panel_settings_im.xml"
3791 >
3792 </File>
3793 <File
3794 RelativePath=".\skins\xui\en-us\panel_settings_msgbox.xml"
3795 >
3796 </File>
3797 <File
3798 RelativePath=".\skins\xui\en-us\panel_settings_network.xml"
3799 >
3800 </File>
3801 <File
3802 RelativePath=".\skins\xui\en-us\panel_settings_web.xml"
3803 >
3804 </File>
3805 <File
3806 RelativePath=".\skins\xui\en-us\panel_status_bar.xml"
3807 >
3808 </File>
3809 <File
3810 RelativePath=".\skins\xui\en-us\panel_toolbar.xml"
3811 >
3812 </File>
3813 <File
3814 RelativePath=".\skins\xui\en-us\panel_top_pick.xml"
3815 >
3816 </File>
3817 <File
3818 RelativePath=".\app_settings\popups.xml"
3819 >
3820 </File>
3821 <File
3822 RelativePath=".\releasenotes.full.txt"
3823 >
3824 </File>
3825 <File
3826 RelativePath=".\releasenotes.txt"
3827 >
3828 </File>
3829 <File
3830 RelativePath=".\res\resource.h"
3831 >
3832 </File>
3833 <File
3834 RelativePath=".\skins\xui\en-us\role_actions.xml"
3835 >
3836 </File>
3837 <File
3838 RelativePath=".\app_settings\std_bump.ini"
3839 >
3840 </File>
3841 <File
3842 RelativePath=".\res\toolbuy.cur"
3843 >
3844 </File>
3845 <File
3846 RelativePath=".\res\toolopen.cur"
3847 >
3848 </File>
3849 <File
3850 RelativePath=".\res\toolpay.cur"
3851 >
3852 </File>
3853 <File
3854 RelativePath=".\res\toolpickobject3.cur"
3855 >
3856 </File>
3857 <File
3858 RelativePath=".\res\toolpipette.cur"
3859 >
3860 </File>
3861 <File
3862 RelativePath=".\res\toolsit.cur"
3863 >
3864 </File>
3865 <File
3866 RelativePath=".\app_settings\trees.xml"
3867 >
3868 </File>
3869 </Filter>
3870 <File
3871 RelativePath=".\llviewerprecompiledheaders.cpp"
3872 >
3873 <FileConfiguration
3874 Name="Debug|Win32"
3875 >
3876 <Tool
3877 Name="VCCLCompilerTool"
3878 UsePrecompiledHeader="1"
3879 />
3880 </FileConfiguration>
3881 <FileConfiguration
3882 Name="Release|Win32"
3883 >
3884 <Tool
3885 Name="VCCLCompilerTool"
3886 UsePrecompiledHeader="1"
3887 />
3888 </FileConfiguration>
3889 <FileConfiguration
3890 Name="ReleaseForDownload|Win32"
3891 >
3892 <Tool
3893 Name="VCCLCompilerTool"
3894 UsePrecompiledHeader="1"
3895 />
3896 </FileConfiguration>
3897 <FileConfiguration
3898 Name="ReleaseNoOpt|Win32"
3899 >
3900 <Tool
3901 Name="VCCLCompilerTool"
3902 UsePrecompiledHeader="1"
3903 />
3904 </FileConfiguration>
3905 </File>
3906 <File
3907 RelativePath=".\llviewerprecompiledheaders.h"
3908 >
3909 </File>
3910 <File
3911 RelativePath="..\..\scripts\messages\message_template.msg"
3912 >
3913 <FileConfiguration
3914 Name="Debug|Win32"
3915 >
3916 <Tool
3917 Name="VCCustomBuildTool"
3918 Description="Copying message template"
3919 CommandLine="copy &quot;$(InputPath)&quot; .\app_settings\message_template.msg&#x0D;&#x0A;"
3920 Outputs="./app_settings/message_template.msg"
3921 />
3922 </FileConfiguration>
3923 <FileConfiguration
3924 Name="Release|Win32"
3925 >
3926 <Tool
3927 Name="VCCustomBuildTool"
3928 Description="Copying message template"
3929 CommandLine="copy &quot;$(InputPath)&quot; .\app_settings\message_template.msg&#x0D;&#x0A;"
3930 Outputs="./app_settings/message_template.msg"
3931 />
3932 </FileConfiguration>
3933 <FileConfiguration
3934 Name="ReleaseForDownload|Win32"
3935 >
3936 <Tool
3937 Name="VCCustomBuildTool"
3938 Description="Copying message template"
3939 CommandLine="copy &quot;$(InputPath)&quot; .\app_settings\message_template.msg&#x0D;&#x0A;"
3940 Outputs="./app_settings/message_template.msg"
3941 />
3942 </FileConfiguration>
3943 <FileConfiguration
3944 Name="ReleaseNoOpt|Win32"
3945 >
3946 <Tool
3947 Name="VCCustomBuildTool"
3948 Description="Copying message template"
3949 CommandLine="copy &quot;$(InputPath)&quot; .\app_settings\message_template.msg&#x0D;&#x0A;"
3950 Outputs="./app_settings/message_template.msg"
3951 />
3952 </FileConfiguration>
3953 </File>
3954 </Files>
3955 <Globals>
3956 </Globals>
3957</VisualStudioProject>
diff --git a/linden/indra/newview/pipeline.cpp b/linden/indra/newview/pipeline.cpp
index a7b4d47..1a5b4f1 100644
--- a/linden/indra/newview/pipeline.cpp
+++ b/linden/indra/newview/pipeline.cpp
@@ -32,12 +32,12 @@
32// library includes 32// library includes
33#include "audioengine.h" // For MAX_BUFFERS for debugging. 33#include "audioengine.h" // For MAX_BUFFERS for debugging.
34#include "imageids.h" 34#include "imageids.h"
35#include "llagpmempool.h"
36#include "llerror.h" 35#include "llerror.h"
37#include "llviewercontrol.h" 36#include "llviewercontrol.h"
38#include "llfasttimer.h" 37#include "llfasttimer.h"
39#include "llfontgl.h" 38#include "llfontgl.h"
40#include "llmemory.h" 39#include "llmemory.h"
40#include "llmemtype.h"
41#include "llnamevalue.h" 41#include "llnamevalue.h"
42#include "llprimitive.h" 42#include "llprimitive.h"
43#include "llvolume.h" 43#include "llvolume.h"
@@ -45,17 +45,17 @@
45#include "timing.h" 45#include "timing.h"
46#include "v3color.h" 46#include "v3color.h"
47#include "llui.h" 47#include "llui.h"
48#include "llglheaders.h"
48 49
49// newview includes 50// newview includes
50#include "llagent.h" 51#include "llagent.h"
51#include "llagparray.h"
52#include "lldrawable.h" 52#include "lldrawable.h"
53#include "lldrawpoolalpha.h" 53#include "lldrawpoolalpha.h"
54#include "lldrawpoolavatar.h" 54#include "lldrawpoolavatar.h"
55#include "lldrawpoolground.h" 55#include "lldrawpoolground.h"
56#include "lldrawpoolsimple.h" 56#include "lldrawpoolsimple.h"
57#include "lldrawpoolbump.h"
57#include "lldrawpooltree.h" 58#include "lldrawpooltree.h"
58#include "lldrawpoolhud.h"
59#include "lldrawpoolwater.h" 59#include "lldrawpoolwater.h"
60#include "llface.h" 60#include "llface.h"
61#include "llfeaturemanager.h" 61#include "llfeaturemanager.h"
@@ -82,10 +82,13 @@
82#include "llvosky.h" 82#include "llvosky.h"
83#include "llvotree.h" 83#include "llvotree.h"
84#include "llvovolume.h" 84#include "llvovolume.h"
85#include "llvosurfacepatch.h"
86#include "llvowater.h"
87#include "llvotree.h"
88#include "llvopartgroup.h"
85#include "llworld.h" 89#include "llworld.h"
86#include "viewer.h" 90#include "viewer.h"
87#include "llagpmempoolarb.h" 91#include "llcubemap.h"
88#include "llagparray.inl"
89 92
90#ifdef _DEBUG 93#ifdef _DEBUG
91// Debug indices is disabled for now for debug performance - djs 4/24/02 94// Debug indices is disabled for now for debug performance - djs 4/24/02
@@ -94,6 +97,8 @@
94//#define DEBUG_INDICES 97//#define DEBUG_INDICES
95#endif 98#endif
96 99
100#define AGGRESSIVE_OCCLUSION 0
101
97const F32 BACKLIGHT_DAY_MAGNITUDE_AVATAR = 0.2f; 102const F32 BACKLIGHT_DAY_MAGNITUDE_AVATAR = 0.2f;
98const F32 BACKLIGHT_NIGHT_MAGNITUDE_AVATAR = 0.1f; 103const F32 BACKLIGHT_NIGHT_MAGNITUDE_AVATAR = 0.1f;
99const F32 BACKLIGHT_DAY_MAGNITUDE_OBJECT = 0.1f; 104const F32 BACKLIGHT_DAY_MAGNITUDE_OBJECT = 0.1f;
@@ -117,18 +122,12 @@ extern S32 gBoxFrame;
117extern BOOL gRenderLightGlows; 122extern BOOL gRenderLightGlows;
118extern BOOL gHideSelectedObjects; 123extern BOOL gHideSelectedObjects;
119 124
120
121BOOL gAvatarBacklight = FALSE; 125BOOL gAvatarBacklight = FALSE;
122 126
123F32 gMinObjectDistance = MIN_NEAR_PLANE;
124S32 gTrivialAccepts = 0; 127S32 gTrivialAccepts = 0;
125 128
126BOOL gRenderForSelect = FALSE; 129BOOL gRenderForSelect = FALSE;
127 130
128BOOL gUsePickAlpha = TRUE;
129F32 gPickAlphaThreshold = 0.f;
130F32 gPickAlphaTargetThreshold = 0.f;
131
132//glsl parameter tables 131//glsl parameter tables
133const char* LLPipeline::sReservedAttribs[] = 132const char* LLPipeline::sReservedAttribs[] =
134{ 133{
@@ -177,6 +176,13 @@ const char* LLPipeline::sTerrainUniforms[] =
177 176
178U32 LLPipeline::sTerrainUniformCount = sizeof(LLPipeline::sTerrainUniforms)/sizeof(char*); 177U32 LLPipeline::sTerrainUniformCount = sizeof(LLPipeline::sTerrainUniforms)/sizeof(char*);
179 178
179const char* LLPipeline::sShinyUniforms[] =
180{
181 "origin"
182};
183
184U32 LLPipeline::sShinyUniformCount = sizeof(LLPipeline::sShinyUniforms)/sizeof(char*);
185
180const char* LLPipeline::sWaterUniforms[] = 186const char* LLPipeline::sWaterUniforms[] =
181{ 187{
182 "screenTex", 188 "screenTex",
@@ -193,8 +199,6 @@ const char* LLPipeline::sWaterUniforms[] =
193 199
194U32 LLPipeline::sWaterUniformCount = sizeof(LLPipeline::sWaterUniforms)/sizeof(char*); 200U32 LLPipeline::sWaterUniformCount = sizeof(LLPipeline::sWaterUniforms)/sizeof(char*);
195 201
196// the SSE variable is dependent on software blending being enabled.
197
198//---------------------------------------- 202//----------------------------------------
199 203
200void stamp(F32 x, F32 y, F32 xs, F32 ys) 204void stamp(F32 x, F32 y, F32 xs, F32 ys)
@@ -216,40 +220,35 @@ void stamp(F32 x, F32 y, F32 xs, F32 ys)
216//---------------------------------------- 220//----------------------------------------
217 221
218S32 LLPipeline::sCompiles = 0; 222S32 LLPipeline::sCompiles = 0;
219S32 LLPipeline::sAGPMaxPoolSize = 1 << 25; // 32MB 223
224BOOL LLPipeline::sShowHUDAttachments = TRUE;
220BOOL LLPipeline::sRenderPhysicalBeacons = FALSE; 225BOOL LLPipeline::sRenderPhysicalBeacons = FALSE;
221BOOL LLPipeline::sRenderScriptedBeacons = FALSE; 226BOOL LLPipeline::sRenderScriptedBeacons = FALSE;
222BOOL LLPipeline::sRenderParticleBeacons = FALSE; 227BOOL LLPipeline::sRenderParticleBeacons = FALSE;
223BOOL LLPipeline::sRenderSoundBeacons = FALSE; 228BOOL LLPipeline::sRenderSoundBeacons = FALSE;
229BOOL LLPipeline::sUseOcclusion = FALSE;
230BOOL LLPipeline::sSkipUpdate = FALSE;
231BOOL LLPipeline::sDynamicReflections = FALSE;
224 232
225LLPipeline::LLPipeline() : 233LLPipeline::LLPipeline() :
234 mCubeBuffer(NULL),
235 mCubeList(0),
226 mVertexShadersEnabled(FALSE), 236 mVertexShadersEnabled(FALSE),
227 mVertexShadersLoaded(0), 237 mVertexShadersLoaded(0),
228 mLastRebuildPool(NULL), 238 mLastRebuildPool(NULL),
229 mAlphaPool(NULL), 239 mAlphaPool(NULL),
240 mAlphaPoolPostWater(NULL),
230 mSkyPool(NULL), 241 mSkyPool(NULL),
231 mStarsPool(NULL), 242 mStarsPool(NULL),
232 mCloudsPool(NULL),
233 mTerrainPool(NULL), 243 mTerrainPool(NULL),
234 mWaterPool(NULL), 244 mWaterPool(NULL),
235 mGroundPool(NULL), 245 mGroundPool(NULL),
236 mHUDPool(NULL), 246 mSimplePool(NULL),
237 mAGPMemPool(NULL), 247 mBumpPool(NULL),
238 mGlobalFence(0),
239 mBufferIndex(0),
240 mBufferCount(kMaxBufferCount),
241 mUseOcclusionCulling(FALSE),
242 mLightMask(0), 248 mLightMask(0),
243 mLightMovingMask(0) 249 mLightMovingMask(0)
244{ 250{
245 for(S32 i = 0; i < kMaxBufferCount; i++) 251
246 {
247 mBufferMemory[i] = NULL;
248 }
249 for (S32 i = 0; i < kMaxBufferCount; i++)
250 {
251 mBufferFence[i] = 0;
252 }
253} 252}
254 253
255void LLPipeline::init() 254void LLPipeline::init()
@@ -258,8 +257,25 @@ void LLPipeline::init()
258 257
259 stop_glerror(); 258 stop_glerror();
260 259
261 mAGPBound = FALSE; 260 //create object partitions
262 mObjectPartition = new LLSpatialPartition; 261 //MUST MATCH declaration of eObjectPartitions
262 mObjectPartition.push_back(new LLVolumePartition()); //PARTITION_VOLUME
263 mObjectPartition.push_back(new LLBridgePartition()); //PARTITION_BRIDGE
264 mObjectPartition.push_back(new LLHUDPartition()); //PARTITION_HUD
265 mObjectPartition.push_back(new LLTerrainPartition()); //PARTITION_TERRAIN
266 mObjectPartition.push_back(new LLWaterPartition()); //PARTITION_WATER
267 mObjectPartition.push_back(new LLTreePartition()); //PARTITION_TREE
268 mObjectPartition.push_back(new LLParticlePartition()); //PARTITION_PARTICLE
269 mObjectPartition.push_back(new LLCloudPartition()); //PARTITION_CLOUD
270 mObjectPartition.push_back(new LLGrassPartition()); //PARTITION_GRASS
271 mObjectPartition.push_back(NULL); //PARTITION_NONE
272
273 //create render pass pools
274 getPool(LLDrawPool::POOL_ALPHA);
275 getPool(LLDrawPool::POOL_ALPHA_POST_WATER);
276 getPool(LLDrawPool::POOL_SIMPLE);
277 getPool(LLDrawPool::POOL_BUMP);
278
263 mTrianglesDrawnStat.reset(); 279 mTrianglesDrawnStat.reset();
264 resetFrameStats(); 280 resetFrameStats();
265 281
@@ -268,43 +284,15 @@ void LLPipeline::init()
268 mRenderFeatureMask = 0; // All features start off 284 mRenderFeatureMask = 0; // All features start off
269 mRenderDebugMask = 0; // All debug starts off 285 mRenderDebugMask = 0; // All debug starts off
270 286
287 mOldRenderDebugMask = mRenderDebugMask;
288
271 mBackfaceCull = TRUE; 289 mBackfaceCull = TRUE;
272 290
273 // Disable AGP initially.
274 mRenderFeatureMask &= ~RENDER_FEATURE_AGP;
275
276 stop_glerror(); 291 stop_glerror();
277 292
278 // Enable features 293 // Enable features
279
280 mUseVBO = gSavedSettings.getBOOL("RenderUseVBO");
281
282 // Allocate the shared buffers for software skinning
283 for(S32 i=0; i < mBufferCount; i++)
284 {
285 mBufferMemory[i] = new LLAGPArray<U8>;
286 mBufferMemory[i]->reserve_block(AVATAR_VERTEX_BYTES*AVATAR_BUFFER_ELEMENTS);
287 }
288
289 if (gFeatureManagerp->isFeatureAvailable("RenderAGP"))
290 {
291 setUseAGP(gSavedSettings.getBOOL("RenderUseAGP") && gGLManager.mHasAnyAGP);
292 }
293 else
294 {
295 setUseAGP(FALSE);
296 }
297
298 stop_glerror(); 294 stop_glerror();
299 295
300 for(S32 i=0; i < mBufferCount; i++)
301 {
302 if (!mBufferMemory[i]->isAGP() && usingAGP())
303 {
304 llwarns << "pipeline buffer memory is non-AGP when AGP available!" << llendl;
305 }
306 }
307
308 setShaders(); 296 setShaders();
309} 297}
310 298
@@ -327,7 +315,17 @@ void LLPipeline::cleanup()
327 { 315 {
328 pool_set_t::iterator curiter = iter++; 316 pool_set_t::iterator curiter = iter++;
329 LLDrawPool* poolp = *curiter; 317 LLDrawPool* poolp = *curiter;
330 if (poolp->mReferences.empty()) 318 if (poolp->isFacePool())
319 {
320 LLFacePool* face_pool = (LLFacePool*) poolp;
321 if (face_pool->mReferences.empty())
322 {
323 mPools.erase(curiter);
324 removeFromQuickLookup( poolp );
325 delete poolp;
326 }
327 }
328 else
331 { 329 {
332 mPools.erase(curiter); 330 mPools.erase(curiter);
333 removeFromQuickLookup( poolp ); 331 removeFromQuickLookup( poolp );
@@ -335,10 +333,6 @@ void LLPipeline::cleanup()
335 } 333 }
336 } 334 }
337 335
338 if (!mSimplePools.empty())
339 {
340 llwarns << "Simple Pools not cleaned up" << llendl;
341 }
342 if (!mTerrainPools.empty()) 336 if (!mTerrainPools.empty())
343 { 337 {
344 llwarns << "Terrain Pools not cleaned up" << llendl; 338 llwarns << "Terrain Pools not cleaned up" << llendl;
@@ -347,208 +341,105 @@ void LLPipeline::cleanup()
347 { 341 {
348 llwarns << "Tree Pools not cleaned up" << llendl; 342 llwarns << "Tree Pools not cleaned up" << llendl;
349 } 343 }
350 if (!mTreeNewPools.empty()) 344
351 {
352 llwarns << "TreeNew Pools not cleaned up" << llendl;
353 }
354 if (!mBumpPools.empty())
355 {
356 llwarns << "Bump Pools not cleaned up" << llendl;
357 }
358 delete mAlphaPool; 345 delete mAlphaPool;
359 mAlphaPool = NULL; 346 mAlphaPool = NULL;
347 delete mAlphaPoolPostWater;
348 mAlphaPoolPostWater = NULL;
360 delete mSkyPool; 349 delete mSkyPool;
361 mSkyPool = NULL; 350 mSkyPool = NULL;
362 delete mStarsPool; 351 delete mStarsPool;
363 mStarsPool = NULL; 352 mStarsPool = NULL;
364 delete mCloudsPool;
365 mCloudsPool = NULL;
366 delete mTerrainPool; 353 delete mTerrainPool;
367 mTerrainPool = NULL; 354 mTerrainPool = NULL;
368 delete mWaterPool; 355 delete mWaterPool;
369 mWaterPool = NULL; 356 mWaterPool = NULL;
370 delete mGroundPool; 357 delete mGroundPool;
371 mGroundPool = NULL; 358 mGroundPool = NULL;
372 delete mHUDPool; 359 delete mSimplePool;
373 mHUDPool = NULL; 360 mSimplePool = NULL;
361 delete mBumpPool;
362 mBumpPool = NULL;
374 363
375 mBloomImagep = NULL; 364 if (mCubeBuffer)
376 mBloomImage2p = NULL;
377 mFaceSelectImagep = NULL;
378 mAlphaSizzleImagep = NULL;
379
380 for(S32 i=0; i < mBufferCount; i++)
381 { 365 {
382 delete mBufferMemory[i]; 366 delete mCubeBuffer;
383 mBufferMemory[i] = NULL; 367 mCubeBuffer = NULL;
384 } 368 }
385 369
386 delete mObjectPartition; 370 if (mCubeList)
387 mObjectPartition = NULL;
388
389 if (mAGPMemPool && mGlobalFence)
390 { 371 {
391 mAGPMemPool->deleteFence(mGlobalFence); 372 glDeleteLists(mCubeList, 1);
392 mGlobalFence = 0; 373 mCubeList = 0;
393 } 374 }
394 delete mAGPMemPool;
395 mAGPMemPool = NULL;
396}
397
398//============================================================================
399 375
400BOOL LLPipeline::initAGP() 376 mBloomImagep = NULL;
401{ 377 mBloomImage2p = NULL;
402 LLMemType mt(LLMemType::MTYPE_PIPELINE); 378 mFaceSelectImagep = NULL;
403 379 mAlphaSizzleImagep = NULL;
404 mAGPMemPool = LLAGPMemPool::createPool(sAGPMaxPoolSize, mUseVBO);
405 380
406 if (!mAGPMemPool) 381 for (S32 i = 0; i < NUM_PARTITIONS-1; i++)
407 {
408 llinfos << "Warning! Couldn't allocate AGP memory!" << llendl;
409 llinfos << "Disabling AGP!" << llendl;
410 mAGPMemPool = NULL;
411 mRenderFeatureMask &= ~RENDER_FEATURE_AGP; // Need to disable the using AGP flag
412 return FALSE;
413 }
414 else if (!mAGPMemPool->getSize())
415 {
416 llinfos << "Warning! Unable to allocate AGP memory! Disabling AGP" << llendl;
417 delete mAGPMemPool;
418 mAGPMemPool = NULL;
419 mRenderFeatureMask &= ~RENDER_FEATURE_AGP; // Need to disable the using AGP flag
420 return FALSE;
421 }
422 else
423 { 382 {
424 llinfos << "Allocated " << mAGPMemPool->getSize() << " bytes of AGP memory" << llendl; 383 delete mObjectPartition[i];
425 mAGPMemPool->bind();
426
427 if (mAGPMemPool->getSize() < MIN_AGP_SIZE)
428 {
429 llwarns << "Not enough AGP memory!" << llendl;
430 delete mAGPMemPool;
431 mAGPMemPool = NULL;
432 mRenderFeatureMask &= ~RENDER_FEATURE_AGP; // Need to disable the using AGP flag
433 return FALSE;
434 }
435
436
437 if (mAGPMemPool)
438 {
439 // Create the fence that we use for global synchronization.
440 mGlobalFence = mAGPMemPool->createFence();
441 }
442 return TRUE;
443 } 384 }
385 mObjectPartition.clear();
444 386
387 mVisibleList.clear();
388 mVisibleGroups.clear();
389 mDrawableGroups.clear();
390 mActiveGroups.clear();
391 mVisibleBridge.clear();
392 mMovedBridge.clear();
393 mOccludedBridge.clear();
394 mAlphaGroups.clear();
395 clearRenderMap();
445} 396}
446 397
447void LLPipeline::cleanupAGP() 398//============================================================================
448{
449 int i;
450 for(i=0; i < mBufferCount; i++)
451 {
452 mBufferMemory[i]->deleteFence(mBufferFence[i]);
453 mBufferMemory[i]->setUseAGP(FALSE);
454 }
455
456 flushAGPMemory();
457 if (mAGPMemPool && mGlobalFence)
458 {
459 mAGPMemPool->deleteFence(mGlobalFence);
460 mGlobalFence = 0;
461 }
462 delete mAGPMemPool;
463 mAGPMemPool = NULL;
464}
465 399
466BOOL LLPipeline::usingAGP() const 400void LLPipeline::destroyGL()
467{ 401{
468 return (mRenderFeatureMask & RENDER_FEATURE_AGP) ? TRUE : FALSE; 402 stop_glerror();
469} 403 unloadShaders();
404 mHighlightFaces.clear();
405 mVisibleList.clear();
406 mVisibleGroups.clear();
407 mDrawableGroups.clear();
408 mActiveGroups.clear();
409 mVisibleBridge.clear();
410 mOccludedBridge.clear();
411 mAlphaGroups.clear();
412 clearRenderMap();
413 resetVertexBuffers();
470 414
471void LLPipeline::setUseAGP(const BOOL use_agp) 415 if (mCubeBuffer)
472{
473 LLMemType mt(LLMemType::MTYPE_PIPELINE);
474
475 if (use_agp == usingAGP())
476 { 416 {
477 return; 417 delete mCubeBuffer;
418 mCubeBuffer = NULL;
478 } 419 }
479 else if (use_agp)
480 {
481 mRenderFeatureMask |= RENDER_FEATURE_AGP;
482 initAGP();
483 420
484 // Forces us to allocate an AGP memory block immediately. 421 if (mCubeList)
485 int i;
486 for(i=0; i < mBufferCount; i++)
487 {
488 mBufferMemory[i]->setUseAGP(use_agp);
489 mBufferMemory[i]->realloc(mBufferMemory[i]->getMax());
490 mBufferFence[i] = mBufferMemory[i]->createFence();
491 }
492
493 // Must be done AFTER you initialize AGP
494 for (pool_set_t::iterator iter = mPools.begin(); iter != mPools.end(); ++iter)
495 {
496 LLDrawPool *poolp = *iter;
497 poolp->setUseAGP(use_agp);
498 }
499 }
500 else
501 { 422 {
502 unbindAGP(); 423 glDeleteLists(mCubeList, 1);
503 mRenderFeatureMask &= ~RENDER_FEATURE_AGP; 424 mCubeList = 0;
504
505 // Must be done BEFORE you blow away AGP
506 for (pool_set_t::iterator iter = mPools.begin(); iter != mPools.end(); ++iter)
507 {
508 LLDrawPool *poolp = *iter;
509 poolp->setUseAGP(use_agp);
510 }
511
512 int i;
513 for(i=0; i < mBufferCount; i++)
514 {
515 if (mBufferMemory[i])
516 {
517 mBufferMemory[i]->setUseAGP(use_agp);
518 mBufferMemory[i]->deleteFence(mBufferFence[i]);
519 mBufferFence[i] = 0;
520 }
521 else
522 {
523 llerrs << "setUseAGP without buffer memory" << llendl;
524 }
525 }
526
527 cleanupAGP();
528 } 425 }
529
530}
531
532//============================================================================
533
534void LLPipeline::destroyGL()
535{
536 setUseAGP(FALSE);
537 stop_glerror();
538 unloadShaders();
539 mHighlightFaces.reset();
540} 426}
541 427
542void LLPipeline::restoreGL() 428void LLPipeline::restoreGL()
543{ 429{
430 resetVertexBuffers();
431
544 if (mVertexShadersEnabled) 432 if (mVertexShadersEnabled)
545 { 433 {
546 setShaders(); 434 setShaders();
547 } 435 }
548 436
549 if (mObjectPartition) 437 for (U32 i = 0; i < mObjectPartition.size()-1; i++)
550 { 438 {
551 mObjectPartition->restoreGL(); 439 if (mObjectPartition[i])
440 {
441 mObjectPartition[i]->restoreGL();
442 }
552 } 443 }
553} 444}
554 445
@@ -616,8 +507,8 @@ GLhandleARB LLPipeline::loadShader(const LLString& filename, S32 cls, GLenum typ
616 fname << gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "shaders/class"); 507 fname << gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "shaders/class");
617 fname << gpu_class << "/" << filename; 508 fname << gpu_class << "/" << filename;
618 509
619 llinfos << "Looking in " << fname.str().c_str() << llendl; 510// llinfos << "Looking in " << fname.str().c_str() << llendl;
620 file = fopen(fname.str().c_str(), "r"); 511 file = fopen(fname.str().c_str(), "r"); /* Flawfinder: ignore */
621 if (file) 512 if (file)
622 { 513 {
623 break; // done 514 break; // done
@@ -791,6 +682,11 @@ BOOL LLPipeline::validateProgramObject(GLhandleARB obj)
791 682
792void LLPipeline::setShaders() 683void LLPipeline::setShaders()
793{ 684{
685 sDynamicReflections = gSavedSettings.getBOOL("RenderDynamicReflections");
686
687 //hack to reset buffers that change behavior with shaders
688 resetVertexBuffers();
689
794 if (gViewerWindow) 690 if (gViewerWindow)
795 { 691 {
796 gViewerWindow->setCursor(UI_CURSOR_WAIT); 692 gViewerWindow->setCursor(UI_CURSOR_WAIT);
@@ -809,6 +705,8 @@ void LLPipeline::setShaders()
809 { 705 {
810 S32 light_class = 2; 706 S32 light_class = 2;
811 S32 env_class = 2; 707 S32 env_class = 2;
708 S32 obj_class = 0;
709
812 if (getLightingDetail() == 0) 710 if (getLightingDetail() == 0)
813 { 711 {
814 light_class = 1; 712 light_class = 1;
@@ -818,7 +716,11 @@ void LLPipeline::setShaders()
818 mMaxVertexShaderLevel[SHADER_LIGHTING] = light_class; 716 mMaxVertexShaderLevel[SHADER_LIGHTING] = light_class;
819 mVertexShaderLevel[SHADER_ENVIRONMENT] = env_class; 717 mVertexShaderLevel[SHADER_ENVIRONMENT] = env_class;
820 mMaxVertexShaderLevel[SHADER_ENVIRONMENT] = env_class; 718 mMaxVertexShaderLevel[SHADER_ENVIRONMENT] = env_class;
719 mVertexShaderLevel[SHADER_OBJECT] = obj_class;
720 mMaxVertexShaderLevel[SHADER_OBJECT] = obj_class;
721
821 BOOL loaded = loadShadersLighting(); 722 BOOL loaded = loadShadersLighting();
723
822 if (loaded) 724 if (loaded)
823 { 725 {
824 mVertexShadersEnabled = TRUE; 726 mVertexShadersEnabled = TRUE;
@@ -826,7 +728,7 @@ void LLPipeline::setShaders()
826 728
827 // Load all shaders to set max levels 729 // Load all shaders to set max levels
828 loadShadersEnvironment(); 730 loadShadersEnvironment();
829 731 loadShadersObject();
830 // Load max avatar shaders to set the max level 732 // Load max avatar shaders to set the max level
831 mVertexShaderLevel[SHADER_AVATAR] = 3; 733 mVertexShaderLevel[SHADER_AVATAR] = 3;
832 mMaxVertexShaderLevel[SHADER_AVATAR] = 3; 734 mMaxVertexShaderLevel[SHADER_AVATAR] = 3;
@@ -898,6 +800,7 @@ BOOL LLPipeline::canUseVertexShaders()
898void LLPipeline::unloadShaders() 800void LLPipeline::unloadShaders()
899{ 801{
900 mObjectSimpleProgram.unload(); 802 mObjectSimpleProgram.unload();
803 mObjectShinyProgram.unload();
901 mObjectBumpProgram.unload(); 804 mObjectBumpProgram.unload();
902 mObjectAlphaProgram.unload(); 805 mObjectAlphaProgram.unload();
903 mWaterProgram.unload(); 806 mWaterProgram.unload();
@@ -939,7 +842,8 @@ BOOL LLPipeline::loadShaders()
939 light_class = 2; // Use medium lighting shader 842 light_class = 2; // Use medium lighting shader
940 } 843 }
941 mVertexShaderLevel[SHADER_LIGHTING] = light_class; 844 mVertexShaderLevel[SHADER_LIGHTING] = light_class;
942 mVertexShaderLevel[SHADER_OBJECT] = llmin(mMaxVertexShaderLevel[SHADER_OBJECT], gSavedSettings.getS32("VertexShaderLevelObject")); 845 //mVertexShaderLevel[SHADER_OBJECT] = llmin(mMaxVertexShaderLevel[SHADER_OBJECT], gSavedSettings.getS32("VertexShaderLevelObject"));
846 mVertexShaderLevel[SHADER_OBJECT] = 0;
943 mVertexShaderLevel[SHADER_AVATAR] = llmin(mMaxVertexShaderLevel[SHADER_AVATAR], gSavedSettings.getS32("VertexShaderLevelAvatar")); 847 mVertexShaderLevel[SHADER_AVATAR] = llmin(mMaxVertexShaderLevel[SHADER_AVATAR], gSavedSettings.getS32("VertexShaderLevelAvatar"));
944 mVertexShaderLevel[SHADER_ENVIRONMENT] = llmin(mMaxVertexShaderLevel[SHADER_ENVIRONMENT], gSavedSettings.getS32("VertexShaderLevelEnvironment")); 848 mVertexShaderLevel[SHADER_ENVIRONMENT] = llmin(mMaxVertexShaderLevel[SHADER_ENVIRONMENT], gSavedSettings.getS32("VertexShaderLevelEnvironment"));
945 mVertexShaderLevel[SHADER_INTERFACE] = mMaxVertexShaderLevel[SHADER_INTERFACE]; 849 mVertexShaderLevel[SHADER_INTERFACE] = mMaxVertexShaderLevel[SHADER_INTERFACE];
@@ -1120,12 +1024,14 @@ BOOL LLPipeline::loadShadersObject()
1120 1024
1121 if (mVertexShaderLevel[SHADER_OBJECT] == 0) 1025 if (mVertexShaderLevel[SHADER_OBJECT] == 0)
1122 { 1026 {
1027 mObjectShinyProgram.unload();
1123 mObjectSimpleProgram.unload(); 1028 mObjectSimpleProgram.unload();
1124 mObjectBumpProgram.unload(); 1029 mObjectBumpProgram.unload();
1125 mObjectAlphaProgram.unload(); 1030 mObjectAlphaProgram.unload();
1126 return FALSE; 1031 return FALSE;
1127 } 1032 }
1128 1033
1034#if 0
1129 if (success) 1035 if (success)
1130 { 1036 {
1131 //load object (volume/tree) vertex shader 1037 //load object (volume/tree) vertex shader
@@ -1186,6 +1092,28 @@ BOOL LLPipeline::loadShadersObject()
1186 llwarns << "Failed to load " << alphavertex << llendl; 1092 llwarns << "Failed to load " << alphavertex << llendl;
1187 } 1093 }
1188 } 1094 }
1095#endif
1096
1097 if (success)
1098 {
1099 //load shiny vertex shader
1100 std::string shinyvertex = "objects/shinyV.glsl";
1101 std::string shinyfragment = "objects/shinyF.glsl";
1102 mObjectShinyProgram.mProgramObject = glCreateProgramObjectARB();
1103 mObjectShinyProgram.attachObjects(baseObjects, baseCount);
1104 mObjectShinyProgram.attachObject(loadShader(shinyvertex, SHADER_OBJECT, GL_VERTEX_SHADER_ARB));
1105 mObjectShinyProgram.attachObject(loadShader(shinyfragment, SHADER_OBJECT, GL_FRAGMENT_SHADER_ARB));
1106
1107 success = mObjectShinyProgram.mapAttributes();
1108 if (success)
1109 {
1110 success = mObjectShinyProgram.mapUniforms(LLPipeline::sShinyUniforms, LLPipeline::sShinyUniformCount);
1111 }
1112 if( !success )
1113 {
1114 llwarns << "Failed to load " << shinyvertex << llendl;
1115 }
1116 }
1189 1117
1190 if( !success ) 1118 if( !success )
1191 { 1119 {
@@ -1342,11 +1270,11 @@ void LLPipeline::enableShadows(const BOOL enable_shadows)
1342 1270
1343S32 LLPipeline::getMaxLightingDetail() const 1271S32 LLPipeline::getMaxLightingDetail() const
1344{ 1272{
1345 if (mVertexShaderLevel[SHADER_OBJECT] >= LLDrawPoolSimple::SHADER_LEVEL_LOCAL_LIGHTS) 1273 /*if (mVertexShaderLevel[SHADER_OBJECT] >= LLDrawPoolSimple::SHADER_LEVEL_LOCAL_LIGHTS)
1346 { 1274 {
1347 return 3; 1275 return 3;
1348 } 1276 }
1349 else 1277 else*/
1350 { 1278 {
1351 return 1; 1279 return 1;
1352 } 1280 }
@@ -1376,79 +1304,62 @@ S32 LLPipeline::setLightingDetail(S32 level)
1376 return mLightingDetail; 1304 return mLightingDetail;
1377} 1305}
1378 1306
1379LLAGPMemBlock *LLPipeline::allocAGPFromPool(const S32 bytes, const U32 target) 1307class LLOctreeDirtyTexture : public LLOctreeTraveler<LLDrawable>
1380{ 1308{
1381 LLMemType mt(LLMemType::MTYPE_PIPELINE); 1309public:
1382 1310 const std::set<LLViewerImage*>& mTextures;
1383 if (!mAGPMemPool) 1311
1384 { 1312 LLOctreeDirtyTexture(const std::set<LLViewerImage*>& textures) : mTextures(textures) { }
1385 llwarns << "Attempting to allocate AGP memory when AGP disabled!" << llendl; 1313
1386 return NULL; 1314 virtual void visit(const LLOctreeState<LLDrawable>* state)
1387 }
1388 else
1389 { 1315 {
1390 if (mUseVBO) 1316 LLSpatialGroup* group = (LLSpatialGroup*) state->getNode()->getListener(0);
1317
1318 if (!group->isState(LLSpatialGroup::GEOM_DIRTY) && !group->getData().empty())
1391 { 1319 {
1392 return ((LLAGPMemPoolARB*) mAGPMemPool)->allocBlock(bytes, target); 1320 for (LLSpatialGroup::draw_map_t::iterator i = group->mDrawMap.begin(); i != group->mDrawMap.end(); ++i)
1321 {
1322 for (std::vector<LLDrawInfo*>::iterator j = i->second.begin(); j != i->second.end(); ++j)
1323 {
1324 LLDrawInfo* params = *j;
1325 if (mTextures.find(params->mTexture) != mTextures.end())
1326 {
1327 group->setState(LLSpatialGroup::GEOM_DIRTY);
1328 }
1329 }
1330 }
1393 } 1331 }
1394 else 1332
1333 for (LLSpatialGroup::bridge_list_t::iterator i = group->mBridgeList.begin(); i != group->mBridgeList.end(); ++i)
1395 { 1334 {
1396 return mAGPMemPool->allocBlock(bytes); 1335 LLSpatialBridge* bridge = *i;
1336 traverse(bridge->mOctree);
1397 } 1337 }
1398 } 1338 }
1399} 1339};
1400
1401
1402void LLPipeline::unbindAGP()
1403{
1404 if (mAGPMemPool && mAGPBound)
1405 {
1406 mAGPMemPool->disable();
1407 mAGPBound = FALSE;
1408 }
1409}
1410
1411void LLPipeline::bindAGP()
1412{
1413 LLMemType mt(LLMemType::MTYPE_PIPELINE);
1414
1415 if (mAGPMemPool && !mAGPBound && usingAGP())
1416 {
1417 mAGPMemPool->enable();
1418 mAGPBound = TRUE;
1419 }
1420}
1421
1422U8* LLPipeline::bufferGetScratchMemory(void)
1423{
1424 LLMemType mt(LLMemType::MTYPE_PIPELINE);
1425 return(mBufferMemory[mBufferIndex]->getScratchMemory());
1426}
1427
1428void LLPipeline::bufferWaitFence(void)
1429{
1430 mBufferMemory[mBufferIndex]->waitFence(mBufferFence[mBufferIndex]);
1431}
1432
1433void LLPipeline::bufferSendFence(void)
1434{
1435 mBufferMemory[mBufferIndex]->sendFence(mBufferFence[mBufferIndex]);
1436}
1437 1340
1438void LLPipeline::bufferRotate(void) 1341// Called when a texture changes # of channels (causes faces to move to alpha pool)
1342void LLPipeline::dirtyPoolObjectTextures(const std::set<LLViewerImage*>& textures)
1439{ 1343{
1440 mBufferIndex++; 1344 // *TODO: This is inefficient and causes frame spikes; need a better way to do this
1441 if(mBufferIndex >= mBufferCount) 1345 // Most of the time is spent in dirty.traverse.
1442 mBufferIndex = 0;
1443}
1444 1346
1445// Called when a texture changes # of channels (rare, may cause faces to move to alpha pool)
1446void LLPipeline::dirtyPoolObjectTextures(const LLViewerImage *texturep)
1447{
1448 for (pool_set_t::iterator iter = mPools.begin(); iter != mPools.end(); ++iter) 1347 for (pool_set_t::iterator iter = mPools.begin(); iter != mPools.end(); ++iter)
1449 { 1348 {
1450 LLDrawPool *poolp = *iter; 1349 LLDrawPool *poolp = *iter;
1451 poolp->dirtyTexture(texturep); 1350 if (poolp->isFacePool())
1351 {
1352 ((LLFacePool*) poolp)->dirtyTextures(textures);
1353 }
1354 }
1355
1356 LLOctreeDirtyTexture dirty(textures);
1357 for (U32 i = 0; i < mObjectPartition.size(); i++)
1358 {
1359 if (mObjectPartition[i])
1360 {
1361 dirty.traverse(mObjectPartition[i]->mOctree);
1362 }
1452 } 1363 }
1453} 1364}
1454 1365
@@ -1458,33 +1369,29 @@ LLDrawPool *LLPipeline::findPool(const U32 type, LLViewerImage *tex0)
1458 switch( type ) 1369 switch( type )
1459 { 1370 {
1460 case LLDrawPool::POOL_SIMPLE: 1371 case LLDrawPool::POOL_SIMPLE:
1461 poolp = get_if_there(mSimplePools, (uintptr_t)tex0, (LLDrawPool*)0 ); 1372 poolp = mSimplePool;
1462 break; 1373 break;
1463 1374
1464 case LLDrawPool::POOL_TREE: 1375 case LLDrawPool::POOL_TREE:
1465 poolp = get_if_there(mTreePools, (uintptr_t)tex0, (LLDrawPool*)0 ); 1376 poolp = get_if_there(mTreePools, (uintptr_t)tex0, (LLDrawPool*)0 );
1466 break; 1377 break;
1467 1378
1468 case LLDrawPool::POOL_TREE_NEW:
1469 poolp = get_if_there(mTreeNewPools, (uintptr_t)tex0, (LLDrawPool*)0 );
1470 break;
1471
1472 case LLDrawPool::POOL_TERRAIN: 1379 case LLDrawPool::POOL_TERRAIN:
1473 poolp = get_if_there(mTerrainPools, (uintptr_t)tex0, (LLDrawPool*)0 ); 1380 poolp = get_if_there(mTerrainPools, (uintptr_t)tex0, (LLDrawPool*)0 );
1474 break; 1381 break;
1475 1382
1476 case LLDrawPool::POOL_BUMP: 1383 case LLDrawPool::POOL_BUMP:
1477 poolp = get_if_there(mBumpPools, (uintptr_t)tex0, (LLDrawPool*)0 ); 1384 poolp = mBumpPool;
1478 break;
1479
1480 case LLDrawPool::POOL_MEDIA:
1481 poolp = get_if_there(mMediaPools, (uintptr_t)tex0, (LLDrawPool*)0 );
1482 break; 1385 break;
1483 1386
1484 case LLDrawPool::POOL_ALPHA: 1387 case LLDrawPool::POOL_ALPHA:
1485 poolp = mAlphaPool; 1388 poolp = mAlphaPool;
1486 break; 1389 break;
1487 1390
1391 case LLDrawPool::POOL_ALPHA_POST_WATER:
1392 poolp = mAlphaPoolPostWater;
1393 break;
1394
1488 case LLDrawPool::POOL_AVATAR: 1395 case LLDrawPool::POOL_AVATAR:
1489 break; // Do nothing 1396 break; // Do nothing
1490 1397
@@ -1496,10 +1403,6 @@ LLDrawPool *LLPipeline::findPool(const U32 type, LLViewerImage *tex0)
1496 poolp = mStarsPool; 1403 poolp = mStarsPool;
1497 break; 1404 break;
1498 1405
1499 case LLDrawPool::POOL_CLOUDS:
1500 poolp = mCloudsPool;
1501 break;
1502
1503 case LLDrawPool::POOL_WATER: 1406 case LLDrawPool::POOL_WATER:
1504 poolp = mWaterPool; 1407 poolp = mWaterPool;
1505 break; 1408 break;
@@ -1508,10 +1411,6 @@ LLDrawPool *LLPipeline::findPool(const U32 type, LLViewerImage *tex0)
1508 poolp = mGroundPool; 1411 poolp = mGroundPool;
1509 break; 1412 break;
1510 1413
1511 case LLDrawPool::POOL_HUD:
1512 poolp = mHUDPool;
1513 break;
1514
1515 default: 1414 default:
1516 llassert(0); 1415 llassert(0);
1517 llerrs << "Invalid Pool Type in LLPipeline::findPool() type=" << type << llendl; 1416 llerrs << "Invalid Pool Type in LLPipeline::findPool() type=" << type << llendl;
@@ -1542,29 +1441,37 @@ LLDrawPool *LLPipeline::getPool(const U32 type, LLViewerImage *tex0)
1542LLDrawPool* LLPipeline::getPoolFromTE(const LLTextureEntry* te, LLViewerImage* imagep) 1441LLDrawPool* LLPipeline::getPoolFromTE(const LLTextureEntry* te, LLViewerImage* imagep)
1543{ 1442{
1544 LLMemType mt(LLMemType::MTYPE_PIPELINE); 1443 LLMemType mt(LLMemType::MTYPE_PIPELINE);
1444 U32 type = getPoolTypeFromTE(te, imagep);
1445 return gPipeline.getPool(type, imagep);
1446}
1447
1448//static
1449U32 LLPipeline::getPoolTypeFromTE(const LLTextureEntry* te, LLViewerImage* imagep)
1450{
1451 LLMemType mt(LLMemType::MTYPE_PIPELINE);
1452
1453 if (!te || !imagep)
1454 {
1455 return 0;
1456 }
1457
1545 bool alpha = te->getColor().mV[3] < 0.999f; 1458 bool alpha = te->getColor().mV[3] < 0.999f;
1546 if (imagep) 1459 if (imagep)
1547 { 1460 {
1548 alpha = alpha || (imagep->getComponents() == 4) || (imagep->getComponents() == 2); 1461 alpha = alpha || (imagep->getComponents() == 4) || (imagep->getComponents() == 2);
1549 } 1462 }
1550#if 0 // Not currently used 1463
1551 if (te->getMediaFlags() == LLTextureEntry::MF_WEB_PAGE)
1552 {
1553 return gPipeline.getPool(LLDrawPool::POOL_MEDIA, imagep);
1554 }
1555 else
1556#endif
1557 if (alpha) 1464 if (alpha)
1558 { 1465 {
1559 return gPipeline.getPool(LLDrawPool::POOL_ALPHA); 1466 return LLDrawPool::POOL_ALPHA;
1560 } 1467 }
1561 else if ((te->getBumpmap() || te->getShiny())) 1468 else if ((te->getBumpmap() || te->getShiny()))
1562 { 1469 {
1563 return gPipeline.getPool(LLDrawPool::POOL_BUMP, imagep); 1470 return LLDrawPool::POOL_BUMP;
1564 } 1471 }
1565 else 1472 else
1566 { 1473 {
1567 return gPipeline.getPool(LLDrawPool::POOL_SIMPLE, imagep); 1474 return LLDrawPool::POOL_SIMPLE;
1568 } 1475 }
1569} 1476}
1570 1477
@@ -1595,14 +1502,20 @@ void LLPipeline::allocDrawable(LLViewerObject *vobj)
1595} 1502}
1596 1503
1597 1504
1598void LLPipeline::unlinkDrawable(LLDrawable *drawablep) 1505void LLPipeline::unlinkDrawable(LLDrawable *drawable)
1599{ 1506{
1600 LLFastTimer t(LLFastTimer::FTM_PIPELINE); 1507 LLFastTimer t(LLFastTimer::FTM_PIPELINE);
1508
1509 LLPointer<LLDrawable> drawablep = drawable; // make sure this doesn't get deleted before we are done
1601 1510
1602 // Based on flags, remove the drawable from the queues that it's on. 1511 // Based on flags, remove the drawable from the queues that it's on.
1603 if (drawablep->isState(LLDrawable::ON_MOVE_LIST)) 1512 if (drawablep->isState(LLDrawable::ON_MOVE_LIST))
1604 { 1513 {
1605 mMovedList.erase(drawablep); 1514 LLDrawable::drawable_vector_t::iterator iter = std::find(mMovedList.begin(), mMovedList.end(), drawablep);
1515 if (iter != mMovedList.end())
1516 {
1517 mMovedList.erase(iter);
1518 }
1606 } 1519 }
1607 1520
1608 if (drawablep->getSpatialGroup()) 1521 if (drawablep->getSpatialGroup())
@@ -1632,9 +1545,6 @@ U32 LLPipeline::addObject(LLViewerObject *vobj)
1632 1545
1633 llassert(drawablep); 1546 llassert(drawablep);
1634 1547
1635 //mCompleteSet.put(drawable);
1636 //gResyncObjects = TRUE;
1637
1638 if (vobj->getParent()) 1548 if (vobj->getParent())
1639 { 1549 {
1640 vobj->setDrawableParent(((LLViewerObject*)vobj->getParent())->mDrawable); // LLPipeline::addObject 1 1550 vobj->setDrawableParent(((LLViewerObject*)vobj->getParent())->mDrawable); // LLPipeline::addObject 1
@@ -1644,28 +1554,6 @@ U32 LLPipeline::addObject(LLViewerObject *vobj)
1644 vobj->setDrawableParent(NULL); // LLPipeline::addObject 2 1554 vobj->setDrawableParent(NULL); // LLPipeline::addObject 2
1645 } 1555 }
1646 1556
1647
1648 if ((!drawablep->getVOVolume()) &&
1649 (vobj->getPCode() != LLViewerObject::LL_VO_SKY) &&
1650 (vobj->getPCode() != LLViewerObject::LL_VO_STARS) &&
1651 (vobj->getPCode() != LLViewerObject::LL_VO_GROUND))
1652 {
1653 drawablep->getSpatialPartition()->put(drawablep);
1654 if (!drawablep->getSpatialGroup())
1655 {
1656#ifdef LL_RELEASE_FOR_DOWNLOAD
1657 llwarns << "Failure adding drawable to object partition!" << llendl;
1658#else
1659 llerrs << "Failure adding drawable to object partition!" << llendl;
1660#endif
1661 }
1662 }
1663 else
1664 {
1665 markMoved(drawablep);
1666 }
1667
1668 markMaterialed(drawablep);
1669 markRebuild(drawablep, LLDrawable::REBUILD_ALL, TRUE); 1557 markRebuild(drawablep, LLDrawable::REBUILD_ALL, TRUE);
1670 1558
1671 return 1; 1559 return 1;
@@ -1674,11 +1562,27 @@ U32 LLPipeline::addObject(LLViewerObject *vobj)
1674 1562
1675void LLPipeline::resetFrameStats() 1563void LLPipeline::resetFrameStats()
1676{ 1564{
1565 mCompilesStat.addValue(sCompiles);
1566 mLightingChangesStat.addValue(mLightingChanges);
1567 mGeometryChangesStat.addValue(mGeometryChanges);
1568 mTrianglesDrawnStat.addValue(mTrianglesDrawn/1000.f);
1569 mVerticesRelitStat.addValue(mVerticesRelit);
1570 mNumVisibleFacesStat.addValue(mNumVisibleFaces);
1571 mNumVisibleDrawablesStat.addValue((S32)mVisibleList.size());
1572
1573 mTrianglesDrawn = 0;
1677 sCompiles = 0; 1574 sCompiles = 0;
1678 mVerticesRelit = 0; 1575 mVerticesRelit = 0;
1679 mLightingChanges = 0; 1576 mLightingChanges = 0;
1680 mGeometryChanges = 0; 1577 mGeometryChanges = 0;
1681 mNumVisibleFaces = 0; 1578 mNumVisibleFaces = 0;
1579
1580 if (mOldRenderDebugMask != mRenderDebugMask)
1581 {
1582 gObjectList.clearDebugText();
1583 mOldRenderDebugMask = mRenderDebugMask;
1584 }
1585
1682} 1586}
1683 1587
1684//external functions for asynchronous updating 1588//external functions for asynchronous updating
@@ -1703,7 +1607,7 @@ void LLPipeline::updateMoveDampedAsync(LLDrawable* drawablep)
1703 // Put on move list so that EARLY_MOVE gets cleared 1607 // Put on move list so that EARLY_MOVE gets cleared
1704 if (!drawablep->isState(LLDrawable::ON_MOVE_LIST)) 1608 if (!drawablep->isState(LLDrawable::ON_MOVE_LIST))
1705 { 1609 {
1706 mMovedList.insert(drawablep); 1610 mMovedList.push_back(drawablep);
1707 drawablep->setState(LLDrawable::ON_MOVE_LIST); 1611 drawablep->setState(LLDrawable::ON_MOVE_LIST);
1708 } 1612 }
1709} 1613}
@@ -1729,15 +1633,35 @@ void LLPipeline::updateMoveNormalAsync(LLDrawable* drawablep)
1729 // Put on move list so that EARLY_MOVE gets cleared 1633 // Put on move list so that EARLY_MOVE gets cleared
1730 if (!drawablep->isState(LLDrawable::ON_MOVE_LIST)) 1634 if (!drawablep->isState(LLDrawable::ON_MOVE_LIST))
1731 { 1635 {
1732 mMovedList.insert(drawablep); 1636 mMovedList.push_back(drawablep);
1733 drawablep->setState(LLDrawable::ON_MOVE_LIST); 1637 drawablep->setState(LLDrawable::ON_MOVE_LIST);
1734 } 1638 }
1735} 1639}
1736 1640
1641void LLPipeline::updateMovedList(LLDrawable::drawable_vector_t& moved_list)
1642{
1643 for (LLDrawable::drawable_vector_t::iterator iter = moved_list.begin();
1644 iter != moved_list.end(); )
1645 {
1646 LLDrawable::drawable_vector_t::iterator curiter = iter++;
1647 LLDrawable *drawablep = *curiter;
1648 BOOL done = TRUE;
1649 if (!drawablep->isDead() && (!drawablep->isState(LLDrawable::EARLY_MOVE)))
1650 {
1651 done = drawablep->updateMove();
1652 }
1653 drawablep->clearState(LLDrawable::EARLY_MOVE | LLDrawable::MOVE_UNDAMPED);
1654 if (done)
1655 {
1656 drawablep->clearState(LLDrawable::ON_MOVE_LIST);
1657 iter = moved_list.erase(curiter);
1658 }
1659 }
1660}
1661
1737void LLPipeline::updateMove() 1662void LLPipeline::updateMove()
1738{ 1663{
1739 mObjectPartition->mOctree->validate(); 1664 //LLFastTimer t(LLFastTimer::FTM_UPDATE_MOVE);
1740 LLFastTimer t(LLFastTimer::FTM_UPDATE_MOVE);
1741 LLMemType mt(LLMemType::MTYPE_PIPELINE); 1665 LLMemType mt(LLMemType::MTYPE_PIPELINE);
1742 1666
1743 if (gSavedSettings.getBOOL("FreezeTime")) 1667 if (gSavedSettings.getBOOL("FreezeTime"))
@@ -1747,23 +1671,18 @@ void LLPipeline::updateMove()
1747 1671
1748 mMoveChangesStat.addValue((F32)mMovedList.size()); 1672 mMoveChangesStat.addValue((F32)mMovedList.size());
1749 1673
1750 for (LLDrawable::drawable_set_t::iterator iter = mMovedList.begin(); 1674 for (LLDrawable::drawable_set_t::iterator iter = mRetexturedList.begin();
1751 iter != mMovedList.end(); ) 1675 iter != mRetexturedList.end(); ++iter)
1752 { 1676 {
1753 LLDrawable::drawable_set_t::iterator curiter = iter++; 1677 LLDrawable* drawablep = *iter;
1754 LLDrawable *drawablep = *curiter; 1678 if (drawablep && !drawablep->isDead())
1755 BOOL done = TRUE;
1756 if (!drawablep->isDead() && (!drawablep->isState(LLDrawable::EARLY_MOVE)))
1757 {
1758 done = drawablep->updateMove();
1759 }
1760 drawablep->clearState(LLDrawable::EARLY_MOVE | LLDrawable::MOVE_UNDAMPED);
1761 if (done)
1762 { 1679 {
1763 mMovedList.erase(curiter); 1680 drawablep->updateTexture();
1764 drawablep->clearState(LLDrawable::ON_MOVE_LIST);
1765 } 1681 }
1766 } 1682 }
1683 mRetexturedList.clear();
1684
1685 updateMovedList(mMovedList);
1767 1686
1768 for (LLDrawable::drawable_set_t::iterator iter = mActiveQ.begin(); 1687 for (LLDrawable::drawable_set_t::iterator iter = mActiveQ.begin();
1769 iter != mActiveQ.end(); ) 1688 iter != mActiveQ.end(); )
@@ -1772,7 +1691,8 @@ void LLPipeline::updateMove()
1772 LLDrawable* drawablep = *curiter; 1691 LLDrawable* drawablep = *curiter;
1773 if (drawablep && !drawablep->isDead()) 1692 if (drawablep && !drawablep->isDead())
1774 { 1693 {
1775 if (drawablep->mQuietCount++ > MAX_ACTIVE_OBJECT_QUIET_FRAMES && 1694 if (drawablep->isRoot() &&
1695 drawablep->mQuietCount++ > MAX_ACTIVE_OBJECT_QUIET_FRAMES &&
1776 (!drawablep->getParent() || !drawablep->getParent()->isActive())) 1696 (!drawablep->getParent() || !drawablep->getParent()->isActive()))
1777 { 1697 {
1778 drawablep->makeStatic(); // removes drawable and its children from mActiveQ 1698 drawablep->makeStatic(); // removes drawable and its children from mActiveQ
@@ -1785,172 +1705,164 @@ void LLPipeline::updateMove()
1785 } 1705 }
1786 } 1706 }
1787 1707
1788 for (LLDrawable::drawable_set_t::iterator iter = mRetexturedList.begin(); 1708 //balance octrees
1789 iter != mRetexturedList.end(); ++iter)
1790 { 1709 {
1791 LLDrawable* drawablep = *iter; 1710 LLFastTimer ot(LLFastTimer::FTM_OCTREE_BALANCE);
1792 if (drawablep && !drawablep->isDead()) 1711 for (U32 i = 0; i < mObjectPartition.size()-1; i++)
1793 {
1794 drawablep->updateTexture();
1795 }
1796 }
1797 mRetexturedList.clear();
1798
1799 for (LLDrawable::drawable_set_t::iterator iter = mRematerialedList.begin();
1800 iter != mRematerialedList.end(); ++iter)
1801 {
1802 LLDrawable* drawablep = *iter;
1803 if (drawablep && !drawablep->isDead())
1804 { 1712 {
1805 drawablep->updateMaterial(); 1713 if (mObjectPartition[i])
1714 {
1715 mObjectPartition[i]->mOctree->balance();
1716 }
1806 } 1717 }
1807 } 1718 }
1808 mRematerialedList.clear();
1809
1810 if (mObjectPartition->mOctree)
1811 {
1812 //balance octree
1813 LLFastTimer ot(LLFastTimer::FTM_OCTREE_BALANCE);
1814 mObjectPartition->mOctree->validate();
1815 mObjectPartition->mOctree->balance();
1816 mObjectPartition->mOctree->validate();
1817 }
1818} 1719}
1819 1720
1820///////////////////////////////////////////////////////////////////////////// 1721/////////////////////////////////////////////////////////////////////////////
1821// Culling and occlusion testing 1722// Culling and occlusion testing
1822///////////////////////////////////////////////////////////////////////////// 1723/////////////////////////////////////////////////////////////////////////////
1823 1724
1824void LLPipeline::updateCull() 1725//static
1726F32 LLPipeline::calcPixelArea(LLVector3 center, LLVector3 size, LLCamera &camera)
1825{ 1727{
1826 LLFastTimer t(LLFastTimer::FTM_CULL); 1728 LLVector3 lookAt = center - camera.getOrigin();
1827 LLMemType mt(LLMemType::MTYPE_PIPELINE); 1729 F32 dist = lookAt.magVec();
1828
1829 LLDrawable::incrementVisible();
1830 mVisibleList.resize(0);
1831 mVisibleList.reserve(ESTIMATED_VISIBLE_OBJECT_COUNT);
1832
1833 gTrivialAccepts = 0;
1834 1730
1835 if (mObjectPartition) 1731 //ramp down distance for nearby objects
1732 if (dist < 16.f)
1836 { 1733 {
1837 if (gSavedSettings.getBOOL("UseOcclusion") && gGLManager.mHasOcclusionQuery) 1734 dist /= 16.f;
1838 { 1735 dist *= dist;
1839 mObjectPartition->processOcclusion(gCamera); 1736 dist *= 16.f;
1840 stop_glerror();
1841 }
1842 mObjectPartition->cull(*gCamera);
1843 } 1737 }
1844
1845 // Hack for avatars - warning - this is really FRAGILE! - djs 05/06/02
1846 LLVOAvatar::updateAllAvatarVisiblity();
1847
1848 // If there are any other hacks here, make sure to add them to the
1849 // standard pick code.
1850 1738
1851 gMinObjectDistance = llclamp(gMinObjectDistance, MIN_NEAR_PLANE, MAX_NEAR_PLANE); 1739 //get area of circle around node
1740 F32 app_angle = atanf(size.magVec()/dist);
1741 F32 radius = app_angle*LLDrawable::sCurPixelAngle;
1742 return radius*radius * 3.14159f;
1743}
1852 1744
1853 F32 water_height = gAgent.getRegion()->getWaterHeight(); 1745void LLPipeline::updateCull(LLCamera& camera)
1854 F32 camera_height = gAgent.getCameraPositionAgent().mV[2]; 1746{
1855 if (fabs(camera_height - water_height) < 2.f) 1747 LLFastTimer t(LLFastTimer::FTM_CULL);
1856 { 1748 LLMemType mt(LLMemType::MTYPE_PIPELINE);
1857 gMinObjectDistance = MIN_NEAR_PLANE;
1858 }
1859 1749
1860 gCamera->setNear(gMinObjectDistance); 1750 mVisibleList.clear();
1751 mVisibleGroups.clear();
1752 mDrawableGroups.clear();
1753 mActiveGroups.clear();
1754 gTrivialAccepts = 0;
1755 mVisibleBridge.clear();
1861 1756
1862 // Disable near clip stuff for now... 1757 processOcclusion(camera);
1863 1758
1864 // now push it back out to max value 1759 for (U32 i = 0; i < mObjectPartition.size(); i++)
1865 gMinObjectDistance = MIN_NEAR_PLANE; 1760 {
1761 if (mObjectPartition[i] && hasRenderType(mObjectPartition[i]->mDrawableType))
1762 {
1763 mObjectPartition[i]->cull(camera);
1764 }
1765 }
1866 1766
1867 if (gSky.mVOSkyp.notNull() && gSky.mVOSkyp->mDrawable.notNull()) 1767 if (gSky.mVOSkyp.notNull() && gSky.mVOSkyp->mDrawable.notNull())
1868 { 1768 {
1869 // Hack for sky - always visible. 1769 // Hack for sky - always visible.
1870 gSky.mVOSkyp->mDrawable->setVisible(*gCamera); 1770 if (hasRenderType(LLPipeline::RENDER_TYPE_SKY))
1871 mVisibleList.push_back(gSky.mVOSkyp->mDrawable); 1771 {
1872 gSky.updateCull(); 1772 gSky.mVOSkyp->mDrawable->setVisible(camera);
1873 stop_glerror(); 1773 mVisibleList.push_back(gSky.mVOSkyp->mDrawable);
1774 gSky.updateCull();
1775 stop_glerror();
1776 }
1874 } 1777 }
1875 else 1778 else
1876 { 1779 {
1877 llinfos << "No sky drawable!" << llendl; 1780 llinfos << "No sky drawable!" << llendl;
1878 } 1781 }
1879 1782
1880 if (gSky.mVOGroundp.notNull() && gSky.mVOGroundp->mDrawable.notNull()) 1783 if (hasRenderType(LLPipeline::RENDER_TYPE_GROUND) && gSky.mVOGroundp.notNull() && gSky.mVOGroundp->mDrawable.notNull())
1881 { 1784 {
1882 gSky.mVOGroundp->mDrawable->setVisible(*gCamera); 1785 gSky.mVOGroundp->mDrawable->setVisible(camera);
1883 mVisibleList.push_back(gSky.mVOGroundp->mDrawable); 1786 mVisibleList.push_back(gSky.mVOGroundp->mDrawable);
1884 } 1787 }
1788}
1885 1789
1886 // add all HUD attachments 1790void LLPipeline::markNotCulled(LLSpatialGroup* group, LLCamera& camera, BOOL active)
1887 LLVOAvatar* my_avatarp = gAgent.getAvatarObject(); 1791{
1888 if (my_avatarp && my_avatarp->hasHUDAttachment()) 1792 if (group->getData().empty())
1793 {
1794 return;
1795 }
1796
1797 if (!sSkipUpdate)
1889 { 1798 {
1890 for (LLViewerJointAttachment* attachmentp = my_avatarp->mAttachmentPoints.getFirstData(); 1799 group->updateDistance(camera);
1891 attachmentp;
1892 attachmentp = my_avatarp->mAttachmentPoints.getNextData())
1893 {
1894 if (attachmentp->getIsHUDAttachment() && attachmentp->getObject(0))
1895 {
1896 LLViewerObject* objectp = attachmentp->getObject(0);
1897 markVisible(objectp->mDrawable);
1898 objectp->mDrawable->updateDistance(*gCamera);
1899 for (S32 i = 0; i < (S32)objectp->mChildList.size(); i++)
1900 {
1901 LLViewerObject* childp = objectp->mChildList[i];
1902 if (childp->mDrawable.notNull())
1903 {
1904 markVisible(childp->mDrawable);
1905 childp->mDrawable->updateDistance(*gCamera);
1906 }
1907 }
1908 }
1909 }
1910 } 1800 }
1911} 1801
1802 const F32 MINIMUM_PIXEL_AREA = 16.f;
1912 1803
1913void LLPipeline::markNotCulled(LLDrawable* drawablep, LLCamera& camera) 1804 if (group->mPixelArea < MINIMUM_PIXEL_AREA)
1914{
1915 if (drawablep->isVisible())
1916 { 1805 {
1917 return; 1806 return;
1918 } 1807 }
1919 1808
1920 // Tricky render mode to hide selected objects, but we definitely 1809 group->mLastRenderTime = gFrameTimeSeconds;
1921 // don't want to do any unnecessary pointer dereferences. JC 1810 if (!group->mSpatialPartition->mRenderByGroup)
1922 if (gHideSelectedObjects) 1811 { //render by drawable
1923 { 1812 mDrawableGroups.push_back(group);
1924 if (drawablep->getVObj() && drawablep->getVObj()->isSelected()) 1813 for (LLSpatialGroup::element_iter i = group->getData().begin(); i != group->getData().end(); ++i)
1925 { 1814 {
1926 return; 1815 markVisible(*i, camera);
1927 } 1816 }
1928 } 1817 }
1929 1818 else
1930 if (drawablep && (hasRenderType(drawablep->mRenderType))) 1819 { //render by group
1931 { 1820 if (active)
1932 if (!drawablep->isState(LLDrawable::INVISIBLE|LLDrawable::FORCE_INVISIBLE))
1933 { 1821 {
1934 mVisibleList.push_back(drawablep); 1822 mActiveGroups.push_back(group);
1935 drawablep->setVisible(camera, NULL, FALSE);
1936 } 1823 }
1937 else if (drawablep->isState(LLDrawable::CLEAR_INVISIBLE)) 1824 else
1938 { 1825 {
1939 // clear invisible flag here to avoid single frame glitch 1826 mVisibleGroups.push_back(group);
1940 drawablep->clearState(LLDrawable::FORCE_INVISIBLE|LLDrawable::CLEAR_INVISIBLE); 1827 for (LLSpatialGroup::bridge_list_t::iterator i = group->mBridgeList.begin(); i != group->mBridgeList.end(); ++i)
1828 {
1829 LLSpatialBridge* bridge = *i;
1830 markVisible(bridge, camera);
1831 }
1941 } 1832 }
1942 } 1833 }
1943} 1834}
1944 1835
1945void LLPipeline::doOcclusion() 1836void LLPipeline::doOcclusion(LLCamera& camera)
1946{ 1837{
1947 if (gSavedSettings.getBOOL("UseOcclusion") && gGLManager.mHasOcclusionQuery) 1838 if (sUseOcclusion)
1948 { 1839 {
1949 mObjectPartition->doOcclusion(gCamera); 1840 for (U32 i = 0; i < mObjectPartition.size(); i++)
1841 {
1842 if (mObjectPartition[i] && hasRenderType(mObjectPartition[i]->mDrawableType))
1843 {
1844 mObjectPartition[i]->doOcclusion(&camera);
1845 }
1846 }
1847
1848#if AGGRESSIVE_OCCLUSION
1849 for (LLSpatialBridge::bridge_vector_t::iterator i = mVisibleBridge.begin(); i != mVisibleBridge.end(); ++i)
1850 {
1851 LLSpatialBridge* bridge = *i;
1852 if (!bridge->isDead() && hasRenderType(bridge->mDrawableType))
1853 {
1854 glPushMatrix();
1855 glMultMatrixf((F32*)bridge->mDrawable->getRenderMatrix().mMatrix);
1856 LLCamera trans = bridge->transformCamera(camera);
1857 bridge->doOcclusion(&trans);
1858 glPopMatrix();
1859 mOccludedBridge.push_back(bridge);
1860 }
1861 }
1862#endif
1950 } 1863 }
1951} 1864}
1952 1865
1953
1954BOOL LLPipeline::updateDrawableGeom(LLDrawable* drawablep, BOOL priority) 1866BOOL LLPipeline::updateDrawableGeom(LLDrawable* drawablep, BOOL priority)
1955{ 1867{
1956 BOOL update_complete = drawablep->updateGeometry(priority); 1868 BOOL update_complete = drawablep->updateGeometry(priority);
@@ -1975,19 +1887,31 @@ void LLPipeline::updateGeom(F32 max_dtime)
1975 LLVOVolume::preUpdateGeom(); 1887 LLVOVolume::preUpdateGeom();
1976 1888
1977 // Iterate through all drawables on the priority build queue, 1889 // Iterate through all drawables on the priority build queue,
1978 for (LLDrawable::drawable_set_t::iterator iter = mBuildQ1.begin(); 1890 for (LLDrawable::drawable_list_t::iterator iter = mBuildQ1.begin();
1979 iter != mBuildQ1.end();) 1891 iter != mBuildQ1.end();)
1980 { 1892 {
1981 LLDrawable::drawable_set_t::iterator curiter = iter++; 1893 LLDrawable::drawable_list_t::iterator curiter = iter++;
1982 LLDrawable* drawablep = *curiter; 1894 LLDrawable* drawablep = *curiter;
1983 BOOL update_complete = TRUE;
1984 if (drawablep && !drawablep->isDead()) 1895 if (drawablep && !drawablep->isDead())
1985 { 1896 {
1986 update_complete = updateDrawableGeom(drawablep, TRUE); 1897 if (drawablep->isState(LLDrawable::IN_REBUILD_Q2))
1898 {
1899 drawablep->clearState(LLDrawable::IN_REBUILD_Q2);
1900 LLDrawable::drawable_list_t::iterator find = std::find(mBuildQ2.begin(), mBuildQ2.end(), drawablep);
1901 if (find != mBuildQ2.end())
1902 {
1903 mBuildQ2.erase(find);
1904 }
1905 }
1906
1907 if (updateDrawableGeom(drawablep, TRUE))
1908 {
1909 drawablep->clearState(LLDrawable::IN_REBUILD_Q1);
1910 mBuildQ1.erase(curiter);
1911 }
1987 } 1912 }
1988 if (update_complete) 1913 else
1989 { 1914 {
1990 drawablep->clearState(LLDrawable::IN_REBUILD_Q1);
1991 mBuildQ1.erase(curiter); 1915 mBuildQ1.erase(curiter);
1992 } 1916 }
1993 } 1917 }
@@ -1998,20 +1922,34 @@ void LLPipeline::updateGeom(F32 max_dtime)
1998 { 1922 {
1999 min_count = mBuildQ2.size(); 1923 min_count = mBuildQ2.size();
2000 } 1924 }
2001 else 1925
2002 {
2003 mBuildQ2.sort(LLDrawable::CompareDistanceGreaterVisibleFirst());
2004 }
2005
2006 S32 count = 0; 1926 S32 count = 0;
2007 1927
2008 max_dtime = llmax(update_timer.getElapsedTimeF32()+0.001f, max_dtime); 1928 max_dtime = llmax(update_timer.getElapsedTimeF32()+0.001f, max_dtime);
2009 1929 LLSpatialGroup* last_group = NULL;
1930 LLSpatialBridge* last_bridge = NULL;
1931
2010 for (LLDrawable::drawable_list_t::iterator iter = mBuildQ2.begin(); 1932 for (LLDrawable::drawable_list_t::iterator iter = mBuildQ2.begin();
2011 iter != mBuildQ2.end(); ) 1933 iter != mBuildQ2.end(); )
2012 { 1934 {
2013 LLDrawable::drawable_list_t::iterator curiter = iter++; 1935 LLDrawable::drawable_list_t::iterator curiter = iter++;
2014 LLDrawable* drawablep = *curiter; 1936 LLDrawable* drawablep = *curiter;
1937
1938 LLSpatialBridge* bridge = drawablep->isRoot() ? drawablep->getSpatialBridge() :
1939 drawablep->getParent()->getSpatialBridge();
1940
1941 if (drawablep->getSpatialGroup() != last_group &&
1942 (!last_bridge || bridge != last_bridge) &&
1943 (update_timer.getElapsedTimeF32() >= max_dtime) && count > min_count)
1944 {
1945 break;
1946 }
1947
1948 //make sure updates don't stop in the middle of a spatial group
1949 //to avoid thrashing (objects are enqueued by group)
1950 last_group = drawablep->getSpatialGroup();
1951 last_bridge = bridge;
1952
2015 BOOL update_complete = TRUE; 1953 BOOL update_complete = TRUE;
2016 if (drawablep && !drawablep->isDead()) 1954 if (drawablep && !drawablep->isDead())
2017 { 1955 {
@@ -2023,14 +1961,12 @@ void LLPipeline::updateGeom(F32 max_dtime)
2023 drawablep->clearState(LLDrawable::IN_REBUILD_Q2); 1961 drawablep->clearState(LLDrawable::IN_REBUILD_Q2);
2024 mBuildQ2.erase(curiter); 1962 mBuildQ2.erase(curiter);
2025 } 1963 }
2026 if ((update_timer.getElapsedTimeF32() >= max_dtime) && count > min_count) 1964 }
2027 { 1965
2028 break; 1966 updateMovedList(mMovedBridge);
2029 }
2030 }
2031} 1967}
2032 1968
2033void LLPipeline::markVisible(LLDrawable *drawablep) 1969void LLPipeline::markVisible(LLDrawable *drawablep, LLCamera& camera)
2034{ 1970{
2035 LLMemType mt(LLMemType::MTYPE_PIPELINE); 1971 LLMemType mt(LLMemType::MTYPE_PIPELINE);
2036 if(!drawablep || drawablep->isDead()) 1972 if(!drawablep || drawablep->isDead())
@@ -2038,11 +1974,36 @@ void LLPipeline::markVisible(LLDrawable *drawablep)
2038 llwarns << "LLPipeline::markVisible called with NULL drawablep" << llendl; 1974 llwarns << "LLPipeline::markVisible called with NULL drawablep" << llendl;
2039 return; 1975 return;
2040 } 1976 }
2041 if (!drawablep->isVisible()) 1977
1978
1979#if LL_DEBUG
1980 if (drawablep->isSpatialBridge())
1981 {
1982 if (std::find(mVisibleBridge.begin(), mVisibleBridge.end(), (LLSpatialBridge*) drawablep) !=
1983 mVisibleBridge.end())
1984 {
1985 llerrs << "Spatial bridge marked visible redundantly." << llendl;
1986 }
1987 }
1988 else
1989 {
1990 if (std::find(mVisibleList.begin(), mVisibleList.end(), drawablep) !=
1991 mVisibleList.end())
1992 {
1993 llerrs << "Drawable marked visible redundantly." << llendl;
1994 }
1995 }
1996#endif
1997
1998 if (drawablep->isSpatialBridge())
1999 {
2000 mVisibleBridge.push_back((LLSpatialBridge*) drawablep);
2001 }
2002 else
2042 { 2003 {
2043 drawablep->setVisible(*gCamera);
2044 mVisibleList.push_back(drawablep); 2004 mVisibleList.push_back(drawablep);
2045 } 2005 }
2006 drawablep->setVisible(camera);
2046} 2007}
2047 2008
2048void LLPipeline::markMoved(LLDrawable *drawablep, BOOL damped_motion) 2009void LLPipeline::markMoved(LLDrawable *drawablep, BOOL damped_motion)
@@ -2066,10 +2027,17 @@ void LLPipeline::markMoved(LLDrawable *drawablep, BOOL damped_motion)
2066 markMoved(drawablep->getParent(), damped_motion); 2027 markMoved(drawablep->getParent(), damped_motion);
2067 } 2028 }
2068 2029
2069 2030
2070 if (!drawablep->isState(LLDrawable::ON_MOVE_LIST)) 2031 if (!drawablep->isState(LLDrawable::ON_MOVE_LIST))
2071 { 2032 {
2072 mMovedList.insert(drawablep); 2033 if (drawablep->isSpatialBridge())
2034 {
2035 mMovedBridge.push_back(drawablep);
2036 }
2037 else
2038 {
2039 mMovedList.push_back(drawablep);
2040 }
2073 drawablep->setState(LLDrawable::ON_MOVE_LIST); 2041 drawablep->setState(LLDrawable::ON_MOVE_LIST);
2074 } 2042 }
2075 if (damped_motion == FALSE) 2043 if (damped_motion == FALSE)
@@ -2118,30 +2086,28 @@ void LLPipeline::shiftObjects(const LLVector3 &offset)
2118 } 2086 }
2119 mShiftList.resize(0); 2087 mShiftList.resize(0);
2120 2088
2121 mObjectPartition->shift(offset); 2089 for (U32 i = 0; i < mObjectPartition.size()-1; i++)
2122}
2123
2124void LLPipeline::markTextured(LLDrawable *drawablep)
2125{
2126 LLMemType mt(LLMemType::MTYPE_PIPELINE);
2127 if (!drawablep->isDead())
2128 { 2090 {
2129 mRetexturedList.insert(drawablep); 2091 if (mObjectPartition[i])
2092 {
2093 mObjectPartition[i]->shift(offset);
2094 }
2130 } 2095 }
2131} 2096}
2132 2097
2133void LLPipeline::markMaterialed(LLDrawable *drawablep) 2098void LLPipeline::markTextured(LLDrawable *drawablep)
2134{ 2099{
2135 LLMemType mt(LLMemType::MTYPE_PIPELINE); 2100 LLMemType mt(LLMemType::MTYPE_PIPELINE);
2136 if (!drawablep->isDead()) 2101 if (drawablep && !drawablep->isDead())
2137 { 2102 {
2138 mRematerialedList.insert(drawablep); 2103 mRetexturedList.insert(drawablep);
2139 } 2104 }
2140} 2105}
2141 2106
2142void LLPipeline::markRebuild(LLDrawable *drawablep, LLDrawable::EDrawableFlags flag, BOOL priority) 2107void LLPipeline::markRebuild(LLDrawable *drawablep, LLDrawable::EDrawableFlags flag, BOOL priority)
2143{ 2108{
2144 LLMemType mt(LLMemType::MTYPE_PIPELINE); 2109 LLMemType mt(LLMemType::MTYPE_PIPELINE);
2110
2145 if (drawablep && !drawablep->isDead()) 2111 if (drawablep && !drawablep->isDead())
2146 { 2112 {
2147 if (!drawablep->isState(LLDrawable::BUILT)) 2113 if (!drawablep->isState(LLDrawable::BUILT))
@@ -2150,15 +2116,18 @@ void LLPipeline::markRebuild(LLDrawable *drawablep, LLDrawable::EDrawableFlags f
2150 } 2116 }
2151 if (priority) 2117 if (priority)
2152 { 2118 {
2153 mBuildQ1.insert(drawablep); 2119 if (!drawablep->isState(LLDrawable::IN_REBUILD_Q1))
2154 drawablep->setState(LLDrawable::IN_REBUILD_Q1); // flag is not needed, just for debugging 2120 {
2121 mBuildQ1.push_back(drawablep);
2122 drawablep->setState(LLDrawable::IN_REBUILD_Q1); // mark drawable as being in priority queue
2123 }
2155 } 2124 }
2156 else if (!drawablep->isState(LLDrawable::IN_REBUILD_Q2)) 2125 else if (!drawablep->isState(LLDrawable::IN_REBUILD_Q2))
2157 { 2126 {
2158 mBuildQ2.push_back(drawablep); 2127 mBuildQ2.push_back(drawablep);
2159 drawablep->setState(LLDrawable::IN_REBUILD_Q2); // need flag here because it is just a list 2128 drawablep->setState(LLDrawable::IN_REBUILD_Q2); // need flag here because it is just a list
2160 } 2129 }
2161 if (flag & LLDrawable::REBUILD_VOLUME) 2130 if (flag & (LLDrawable::REBUILD_VOLUME | LLDrawable::REBUILD_POSITION))
2162 { 2131 {
2163 drawablep->getVObj()->setChanged(LLXform::SILHOUETTE); 2132 drawablep->getVObj()->setChanged(LLXform::SILHOUETTE);
2164 } 2133 }
@@ -2185,111 +2154,400 @@ void LLPipeline::markRelight(LLDrawable *drawablep, const BOOL priority)
2185 } 2154 }
2186} 2155}
2187 2156
2188void LLPipeline::stateSort() 2157void LLPipeline::stateSort(LLCamera& camera)
2189{ 2158{
2190 LLFastTimer ftm(LLFastTimer::FTM_STATESORT); 2159 LLFastTimer ftm(LLFastTimer::FTM_STATESORT);
2191 LLMemType mt(LLMemType::MTYPE_PIPELINE); 2160 LLMemType mt(LLMemType::MTYPE_PIPELINE);
2192 2161
2162 for (LLSpatialGroup::sg_vector_t::iterator iter = mVisibleGroups.begin(); iter != mVisibleGroups.end(); ++iter)
2163 {
2164 stateSort(*iter, camera);
2165 }
2166
2167 for (LLSpatialBridge::bridge_vector_t::iterator i = mVisibleBridge.begin(); i != mVisibleBridge.end(); ++i)
2168 {
2169 LLSpatialBridge* bridge = *i;
2170 if (!bridge->isDead())
2171 {
2172 stateSort(bridge, camera);
2173 }
2174 }
2175
2193 for (LLDrawable::drawable_vector_t::iterator iter = mVisibleList.begin(); 2176 for (LLDrawable::drawable_vector_t::iterator iter = mVisibleList.begin();
2194 iter != mVisibleList.end(); iter++) 2177 iter != mVisibleList.end(); iter++)
2195 { 2178 {
2196 LLDrawable *drawablep = *iter; 2179 LLDrawable *drawablep = *iter;
2197 if (drawablep->isDead()) 2180 if (!drawablep->isDead())
2198 { 2181 {
2199 continue; 2182 stateSort(drawablep, camera);
2200 } 2183 }
2184 }
2185
2186 for (LLSpatialGroup::sg_vector_t::iterator iter = mActiveGroups.begin(); iter != mActiveGroups.end(); ++iter)
2187 {
2188 stateSort(*iter, camera);
2189 }
2190
2191 postSort(camera);
2192}
2201 2193
2202 if (!drawablep->isActive()) 2194void LLPipeline::stateSort(LLSpatialGroup* group, LLCamera& camera)
2195{
2196 LLMemType mt(LLMemType::MTYPE_PIPELINE);
2197 if (!sSkipUpdate && group->changeLOD())
2198 {
2199 for (LLSpatialGroup::element_iter i = group->getData().begin(); i != group->getData().end(); ++i)
2203 { 2200 {
2204 drawablep->updateDistance(*gCamera); 2201 LLDrawable* drawablep = *i;
2202 stateSort(drawablep, camera);
2205 } 2203 }
2204 }
2205
2206#if !LL_DARWIN
2207 if (gFrameTimeSeconds - group->mLastUpdateTime > 4.f)
2208 {
2209 group->makeStatic();
2210 }
2211#endif
2212}
2206 2213
2207 /* 2214void LLPipeline::stateSort(LLSpatialBridge* bridge, LLCamera& camera)
2208 if (!drawablep->isState(LLDrawable::BUILT)) 2215{
2216 LLMemType mt(LLMemType::MTYPE_PIPELINE);
2217 if (!sSkipUpdate)
2218 {
2219 bridge->updateDistance(camera);
2220 }
2221}
2222
2223void LLPipeline::stateSort(LLDrawable* drawablep, LLCamera& camera)
2224{
2225 LLMemType mt(LLMemType::MTYPE_PIPELINE);
2226 LLFastTimer ftm(LLFastTimer::FTM_STATESORT_DRAWABLE);
2227
2228 if (drawablep->isDead() || !hasRenderType(drawablep->getRenderType()))
2229 {
2230 return;
2231 }
2232
2233 if (gHideSelectedObjects)
2234 {
2235 if (drawablep->getVObj() &&
2236 drawablep->getVObj()->isSelected())
2209 { 2237 {
2210 // This geometry hasn't been rebuilt but it's visible, make sure it gets put on the rebuild list. 2238 return;
2211 llerrs << "Visible object " << drawablep << ":" << drawablep->getVObj()->getPCodeString(); 2239 }
2212 llcont << " visible but not built, put on rebuild" << llendl; 2240 }
2213 markRebuild(drawablep); 2241
2214 continue; 2242 if (drawablep && (hasRenderType(drawablep->mRenderType)))
2243 {
2244 if (!drawablep->isState(LLDrawable::INVISIBLE|LLDrawable::FORCE_INVISIBLE))
2245 {
2246 drawablep->setVisible(camera, NULL, FALSE);
2215 } 2247 }
2216 */ 2248 else if (drawablep->isState(LLDrawable::CLEAR_INVISIBLE))
2249 {
2250 // clear invisible flag here to avoid single frame glitch
2251 drawablep->clearState(LLDrawable::FORCE_INVISIBLE|LLDrawable::CLEAR_INVISIBLE);
2252 }
2253 }
2217 2254
2218 for (LLDrawable::face_list_t::iterator iter = drawablep->mFaces.begin(); 2255 if (!drawablep->isActive() && drawablep->isVisible())
2219 iter != drawablep->mFaces.end(); iter++) 2256 {
2257 if (!sSkipUpdate)
2220 { 2258 {
2221 LLFace* facep = *iter; 2259 drawablep->updateDistance(camera);
2222 if (facep->hasGeometry()) 2260 }
2261 }
2262 else if (drawablep->isAvatar() && drawablep->isVisible())
2263 {
2264 LLVOAvatar* vobj = (LLVOAvatar*) drawablep->getVObj();
2265 vobj->updateVisibility(FALSE);
2266 }
2267
2268 for (LLDrawable::face_list_t::iterator iter = drawablep->mFaces.begin();
2269 iter != drawablep->mFaces.end(); iter++)
2270 {
2271 LLFace* facep = *iter;
2272
2273 if (facep->hasGeometry())
2274 {
2275 if (facep->getPool())
2223 { 2276 {
2224 facep->getPool()->enqueue(facep); 2277 facep->getPool()->enqueue(facep);
2225 } 2278 }
2279 else
2280 {
2281 break;
2282 }
2226 } 2283 }
2227 2284 }
2228 if (sRenderPhysicalBeacons) 2285
2229 { 2286
2230 // Only show the beacon on the root object. 2287 mNumVisibleFaces += drawablep->getNumFaces();
2231 LLViewerObject *vobj = drawablep->getVObj(); 2288}
2232 if (vobj 2289
2233 && !vobj->isAvatar() 2290
2234 && !vobj->getParent() 2291void LLPipeline::forAllDrawables(LLSpatialGroup::sg_vector_t& groups, void (*func)(LLDrawable*))
2235 && vobj->usePhysics()) 2292{
2293 for (LLSpatialGroup::sg_vector_t::iterator i = groups.begin(); i != groups.end(); ++i)
2294 {
2295 for (LLSpatialGroup::element_iter j = (*i)->getData().begin(); j != (*i)->getData().end(); ++j)
2296 {
2297 func(*j);
2298 }
2299 }
2300}
2301
2302void LLPipeline::forAllVisibleDrawables(void (*func)(LLDrawable*))
2303{
2304 forAllDrawables(mDrawableGroups, func);
2305 forAllDrawables(mVisibleGroups, func);
2306 forAllDrawables(mActiveGroups, func);
2307}
2308
2309//function for creating scripted beacons
2310void renderScriptedBeacons(LLDrawable* drawablep)
2311{
2312 LLViewerObject *vobj = drawablep->getVObj();
2313 if (vobj
2314 && !vobj->isAvatar()
2315 && !vobj->getParent()
2316 && vobj->flagScripted())
2317 {
2318 gObjectList.addDebugBeacon(vobj->getPositionAgent(), "", LLColor4(1.f, 0.f, 0.f, 0.5f), LLColor4(1.f, 1.f, 1.f, 0.5f));
2319 }
2320}
2321
2322void renderPhysicalBeacons(LLDrawable* drawablep)
2323{
2324 LLViewerObject *vobj = drawablep->getVObj();
2325 if (vobj
2326 && !vobj->isAvatar()
2327 && !vobj->getParent()
2328 && vobj->usePhysics())
2329 {
2330 gObjectList.addDebugBeacon(vobj->getPositionAgent(), "", LLColor4(0.f, 1.f, 0.f, 0.5f), LLColor4(1.f, 1.f, 1.f, 0.5f));
2331 }
2332}
2333
2334void renderParticleBeacons(LLDrawable* drawablep)
2335{
2336 // Look for attachments, objects, etc.
2337 LLViewerObject *vobj = drawablep->getVObj();
2338 if (vobj
2339 && vobj->isParticleSource())
2340 {
2341 LLColor4 light_blue(0.5f, 0.5f, 1.f, 0.5f);
2342 gObjectList.addDebugBeacon(vobj->getPositionAgent(), "", light_blue, LLColor4(1.f, 1.f, 1.f, 0.5f));
2343 }
2344}
2345
2346void LLPipeline::highlightPhysical(LLDrawable* drawablep)
2347{
2348 LLMemType mt(LLMemType::MTYPE_PIPELINE);
2349 LLViewerObject *vobj;
2350 vobj = drawablep->getVObj();
2351 if (vobj && !vobj->isAvatar())
2352 {
2353 if (!vobj->isAvatar() &&
2354 (vobj->usePhysics() || vobj->flagHandleTouch()))
2355 {
2356 S32 face_id;
2357 for (face_id = 0; face_id < drawablep->getNumFaces(); face_id++)
2236 { 2358 {
2237 gObjectList.addDebugBeacon(vobj->getPositionAgent(), "", LLColor4(0.f, 1.f, 0.f, 0.5f), LLColor4(1.f, 1.f, 1.f, 0.5f)); 2359 gPipeline.mHighlightFaces.push_back(drawablep->getFace(face_id) );
2238 } 2360 }
2239 } 2361 }
2362 }
2363}
2364
2365void LLPipeline::postSort(LLCamera& camera)
2366{
2367 LLMemType mt(LLMemType::MTYPE_PIPELINE);
2368 LLFastTimer ftm(LLFastTimer::FTM_STATESORT_POSTSORT);
2369 //reset render data sets
2370 clearRenderMap();
2371 mAlphaGroups.clear();
2372 mAlphaGroupsPostWater.clear();
2373
2374 if (!gSavedSettings.getBOOL("RenderRippleWater") && hasRenderType(LLDrawPool::POOL_ALPHA))
2375 { //turn off clip plane for non-ripple water
2376 toggleRenderType(LLDrawPool::POOL_ALPHA);
2377 }
2240 2378
2241 if (sRenderScriptedBeacons) 2379 F32 water_height = gAgent.getRegion()->getWaterHeight();
2380 BOOL above_water = gCamera->getOrigin().mV[2] > water_height ? TRUE : FALSE;
2381
2382 //prepare occlusion geometry
2383 if (sUseOcclusion)
2384 {
2385 for (U32 i = 0; i < mObjectPartition.size(); i++)
2242 { 2386 {
2243 // Only show the beacon on the root object. 2387 if (mObjectPartition[i] && hasRenderType(mObjectPartition[i]->mDrawableType))
2244 LLViewerObject *vobj = drawablep->getVObj();
2245 if (vobj
2246 && !vobj->isAvatar()
2247 && !vobj->getParent()
2248 && vobj->flagScripted())
2249 { 2388 {
2250 gObjectList.addDebugBeacon(vobj->getPositionAgent(), "", LLColor4(1.f, 0.f, 0.f, 0.5f), LLColor4(1.f, 1.f, 1.f, 0.5f)); 2389 mObjectPartition[i]->buildOcclusion();
2390 }
2391 }
2392
2393#if AGGRESSIVE_OCCLUSION
2394 for (LLSpatialBridge::bridge_vector_t::iterator i = mVisibleBridge.begin(); i != mVisibleBridge.end(); ++i)
2395 {
2396 LLSpatialBridge* bridge = *i;
2397 if (!bridge->isDead() && hasRenderType(bridge->mDrawableType))
2398 {
2399 bridge->buildOcclusion();
2251 } 2400 }
2252 } 2401 }
2402#endif
2403 }
2404
2405
2406 if (!sSkipUpdate)
2407 {
2408 //rebuild drawable geometry
2409 for (LLSpatialGroup::sg_vector_t::iterator i = mDrawableGroups.begin(); i != mDrawableGroups.end(); ++i)
2410 {
2411 LLSpatialGroup* group = *i;
2412 group->rebuildGeom();
2413 }
2414 }
2253 2415
2254 if (sRenderParticleBeacons) 2416 //build render map
2417 for (LLSpatialGroup::sg_vector_t::iterator i = mVisibleGroups.begin(); i != mVisibleGroups.end(); ++i)
2418 {
2419 LLSpatialGroup* group = *i;
2420 if (!sSkipUpdate)
2421 {
2422 group->rebuildGeom();
2423 }
2424 for (LLSpatialGroup::draw_map_t::iterator j = group->mDrawMap.begin(); j != group->mDrawMap.end(); ++j)
2255 { 2425 {
2256 // Look for attachments, objects, etc. 2426 std::vector<LLDrawInfo*>& src_vec = j->second;
2257 LLViewerObject *vobj = drawablep->getVObj(); 2427 std::vector<LLDrawInfo*>& dest_vec = mRenderMap[j->first];
2258 if (vobj 2428
2259 && vobj->isParticleSource()) 2429 for (std::vector<LLDrawInfo*>::iterator k = src_vec.begin(); k != src_vec.end(); ++k)
2260 { 2430 {
2261 LLColor4 light_blue(0.5f, 0.5f, 1.f, 0.5f); 2431 dest_vec.push_back(*k);
2262 gObjectList.addDebugBeacon(vobj->getPositionAgent(), "", light_blue, LLColor4(1.f, 1.f, 1.f, 0.5f));
2263 } 2432 }
2264 } 2433 }
2434
2435 LLSpatialGroup::draw_map_t::iterator alpha = group->mDrawMap.find(LLRenderPass::PASS_ALPHA);
2436
2437 if (alpha != group->mDrawMap.end())
2438 { //store alpha groups for sorting
2439 if (!sSkipUpdate)
2440 {
2441 group->updateDistance(camera);
2442 }
2443
2444 if (hasRenderType(LLDrawPool::POOL_ALPHA))
2445 {
2446 BOOL above = group->mObjectBounds[0].mV[2] + group->mObjectBounds[1].mV[2] > water_height ? TRUE : FALSE;
2447 BOOL below = group->mObjectBounds[0].mV[2] - group->mObjectBounds[1].mV[2] < water_height ? TRUE : FALSE;
2448
2449 if (below == above_water || above == below)
2450 {
2451 mAlphaGroups.push_back(group);
2452 }
2265 2453
2266 // Draw physical objects in red. 2454 if (above == above_water || below == above)
2267 if (gHUDManager->getShowPhysical()) 2455 {
2456 mAlphaGroupsPostWater.push_back(group);
2457 }
2458 }
2459 else
2460 {
2461 mAlphaGroupsPostWater.push_back(group);
2462 }
2463 }
2464 }
2465
2466 //store active alpha groups
2467 for (LLSpatialGroup::sg_vector_t::iterator i = mActiveGroups.begin(); i != mActiveGroups.end(); ++i)
2468 {
2469 LLSpatialGroup* group = *i;
2470 if (!sSkipUpdate)
2471 {
2472 group->rebuildGeom();
2473 }
2474 LLSpatialGroup::draw_map_t::iterator alpha = group->mDrawMap.find(LLRenderPass::PASS_ALPHA);
2475
2476 if (alpha != group->mDrawMap.end())
2268 { 2477 {
2269 LLViewerObject *vobj; 2478 LLSpatialBridge* bridge = group->mSpatialPartition->asBridge();
2270 vobj = drawablep->getVObj(); 2479 LLCamera trans_camera = bridge->transformCamera(camera);
2271 if (vobj && !vobj->isAvatar()) 2480 if (!sSkipUpdate)
2272 { 2481 {
2273 if (!vobj->isAvatar() && 2482 group->updateDistance(trans_camera);
2274 (vobj->usePhysics() || vobj->flagHandleTouch())) 2483 }
2484
2485 if (hasRenderType(LLDrawPool::POOL_ALPHA))
2486 {
2487 LLSpatialGroup* bridge_group = bridge->getSpatialGroup();
2488 BOOL above = bridge_group->mObjectBounds[0].mV[2] + bridge_group->mObjectBounds[1].mV[2] > water_height ? TRUE : FALSE;
2489 BOOL below = bridge_group->mObjectBounds[0].mV[2] - bridge_group->mObjectBounds[1].mV[2] < water_height ? TRUE : FALSE;
2490
2491
2492 if (below == above_water || above == below)
2275 { 2493 {
2276 if (!drawablep->isVisible()) 2494 mAlphaGroups.push_back(group);
2277 { 2495 }
2278 // Skip objects that aren't visible. 2496
2279 continue; 2497 if (above == above_water || below == above)
2280 } 2498 {
2281 S32 face_id; 2499 mAlphaGroupsPostWater.push_back(group);
2282 for (face_id = 0; face_id < drawablep->getNumFaces(); face_id++)
2283 {
2284 mHighlightFaces.put(drawablep->getFace(face_id) );
2285 }
2286 } 2500 }
2287 } 2501 }
2502 else
2503 {
2504 mAlphaGroupsPostWater.push_back(group);
2505 }
2288 } 2506 }
2507 }
2289 2508
2290 mNumVisibleFaces += drawablep->getNumFaces(); 2509 //sort by texture or bump map
2510 for (U32 i = 0; i < LLRenderPass::NUM_RENDER_TYPES; ++i)
2511 {
2512 if (!mRenderMap[i].empty())
2513 {
2514 if (i == LLRenderPass::PASS_BUMP)
2515 {
2516 std::sort(mRenderMap[i].begin(), mRenderMap[i].end(), LLDrawInfo::CompareBump());
2517 }
2518 else
2519 {
2520 std::sort(mRenderMap[i].begin(), mRenderMap[i].end(), LLDrawInfo::CompareTexturePtr());
2521 }
2522 }
2291 } 2523 }
2292 2524
2525 std::sort(mAlphaGroups.begin(), mAlphaGroups.end(), LLSpatialGroup::CompareDepthGreater());
2526 std::sort(mAlphaGroupsPostWater.begin(), mAlphaGroupsPostWater.end(), LLSpatialGroup::CompareDepthGreater());
2527
2528 if (sRenderScriptedBeacons)
2529 {
2530 // Only show the beacon on the root object.
2531 forAllVisibleDrawables(renderScriptedBeacons);
2532 }
2533
2534 if (sRenderPhysicalBeacons)
2535 {
2536 // Only show the beacon on the root object.
2537 forAllVisibleDrawables(renderPhysicalBeacons);
2538 }
2539
2540 if (sRenderParticleBeacons)
2541 {
2542 forAllVisibleDrawables(renderParticleBeacons);
2543 }
2544
2545 // Draw physical objects in red.
2546 if (gHUDManager->getShowPhysical())
2547 {
2548 forAllVisibleDrawables(highlightPhysical);
2549 }
2550
2293 // If god mode, also show audio cues 2551 // If god mode, also show audio cues
2294 if (sRenderSoundBeacons && gAudiop) 2552 if (sRenderSoundBeacons && gAudiop)
2295 { 2553 {
@@ -2312,66 +2570,19 @@ void LLPipeline::stateSort()
2312 LLFloaterTelehub::addBeacons(); 2570 LLFloaterTelehub::addBeacons();
2313 } 2571 }
2314 2572
2315 mSelectedFaces.reset(); 2573 mSelectedFaces.clear();
2316 2574
2317 // Draw face highlights for selected faces. 2575 // Draw face highlights for selected faces.
2318 if (gSelectMgr->getTEMode()) 2576 if (gSelectMgr->getTEMode())
2319 { 2577 {
2320 LLViewerObject *vobjp; 2578 LLViewerObject *vobjp;
2321 S32 te; 2579 S32 te;
2322 gSelectMgr->getFirstTE(&vobjp,&te); 2580 gSelectMgr->getSelection()->getFirstTE(&vobjp,&te);
2323 2581
2324 while (vobjp) 2582 while (vobjp)
2325 { 2583 {
2326 LLDrawable *drawablep = vobjp->mDrawable; 2584 mSelectedFaces.push_back(vobjp->mDrawable->getFace(te));
2327 if (!drawablep || drawablep->isDead() || (!vobjp->isHUDAttachment() && !drawablep->isVisible())) 2585 gSelectMgr->getSelection()->getNextTE(&vobjp,&te);
2328 {
2329 llwarns << "Dead drawable on selected face list!" << llendl;
2330 }
2331 else
2332 {
2333 LLVOVolume *volp = drawablep->getVOVolume();
2334 if (volp)
2335 {
2336 if (volp->getAllTEsSame())
2337 {
2338 SelectedFaceInfo* faceinfo = mSelectedFaces.reserve_block(1);
2339 faceinfo->mFacep = drawablep->getFace(vobjp->getFaceIndexOffset());
2340 faceinfo->mTE = te;
2341 }
2342 else
2343 {
2344 // This is somewhat inefficient, but works correctly.
2345 S32 face_id;
2346 for (face_id = 0; face_id < vobjp->getVolume()->getNumFaces(); face_id++)
2347 {
2348 LLFace *facep = drawablep->getFace(face_id + vobjp->getFaceIndexOffset());
2349 if (te == facep->getTEOffset())
2350 {
2351 SelectedFaceInfo* faceinfo = mSelectedFaces.reserve_block(1);
2352 faceinfo->mFacep = facep;
2353 faceinfo->mTE = -1;
2354 }
2355 }
2356 }
2357 }
2358 else
2359 {
2360 // This is somewhat inefficient, but works correctly.
2361 S32 face_id;
2362 for (face_id = 0; face_id < drawablep->getNumFaces(); face_id++)
2363 {
2364 LLFace *facep = drawablep->getFace(face_id + vobjp->getFaceIndexOffset());
2365 if (te == facep->getTEOffset())
2366 {
2367 SelectedFaceInfo* faceinfo = mSelectedFaces.reserve_block(1);
2368 faceinfo->mFacep = facep;
2369 faceinfo->mTE = -1;
2370 }
2371 }
2372 }
2373 }
2374 gSelectMgr->getNextTE(&vobjp,&te);
2375 } 2586 }
2376 } 2587 }
2377} 2588}
@@ -2383,13 +2594,13 @@ static void render_hud_elements()
2383 gPipeline.disableLights(); 2594 gPipeline.disableLights();
2384 2595
2385 gPipeline.renderDebug(); 2596 gPipeline.renderDebug();
2386 2597
2387 LLGLDisable fog(GL_FOG); 2598 LLGLDisable fog(GL_FOG);
2388 LLGLSUIDefault gls_ui; 2599 LLGLSUIDefault gls_ui;
2389 2600
2390 if (gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_UI)) 2601 if (gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_UI))
2391 { 2602 {
2392 gViewerWindow->renderSelections(FALSE, FALSE, FALSE); // For HUD bersion in render_ui_3d() 2603 gViewerWindow->renderSelections(FALSE, FALSE, FALSE); // For HUD version in render_ui_3d()
2393 2604
2394 // Draw the tracking overlays 2605 // Draw the tracking overlays
2395 LLTracker::render3D(); 2606 LLTracker::render3D();
@@ -2404,7 +2615,7 @@ static void render_hud_elements()
2404 gParcelMgr->render(); 2615 gParcelMgr->render();
2405 gParcelMgr->renderParcelCollision(); 2616 gParcelMgr->renderParcelCollision();
2406 } 2617 }
2407 2618
2408 // Render debugging beacons. 2619 // Render debugging beacons.
2409 gObjectList.renderObjectBeacons(); 2620 gObjectList.renderObjectBeacons();
2410 LLHUDObject::renderAll(); 2621 LLHUDObject::renderAll();
@@ -2415,11 +2626,15 @@ static void render_hud_elements()
2415 // This is only set when not rendering the UI, for parcel snapshots 2626 // This is only set when not rendering the UI, for parcel snapshots
2416 gParcelMgr->render(); 2627 gParcelMgr->render();
2417 } 2628 }
2418 2629 else if (gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_HUD))
2630 {
2631 LLHUDText::renderAllHUD();
2632 }
2419} 2633}
2420 2634
2421void LLPipeline::renderHighlights() 2635void LLPipeline::renderHighlights()
2422{ 2636{
2637 LLMemType mt(LLMemType::MTYPE_PIPELINE);
2423 // Draw 3D UI elements here (before we clear the Z buffer in POOL_HUD) 2638 // Draw 3D UI elements here (before we clear the Z buffer in POOL_HUD)
2424 // Render highlighted faces. 2639 // Render highlighted faces.
2425 LLColor4 color(1.f, 1.f, 1.f, 0.5f); 2640 LLColor4 color(1.f, 1.f, 1.f, 0.5f);
@@ -2441,48 +2656,15 @@ void LLPipeline::renderHighlights()
2441 } 2656 }
2442 mFaceSelectImagep->addTextureStats((F32)MAX_IMAGE_AREA); 2657 mFaceSelectImagep->addTextureStats((F32)MAX_IMAGE_AREA);
2443 2658
2444 for (S32 i = 0; i < mSelectedFaces.count(); i++) 2659 for (U32 i = 0; i < mSelectedFaces.size(); i++)
2445 { 2660 {
2446 LLFace *facep = mSelectedFaces[i].mFacep; 2661 LLFace *facep = mSelectedFaces[i];
2447 if (!facep || facep->getDrawable()->isDead()) 2662 if (!facep || facep->getDrawable()->isDead())
2448 { 2663 {
2449 llerrs << "Bad face on selection" << llendl; 2664 llerrs << "Bad face on selection" << llendl;
2450 } 2665 }
2451 2666
2452 LLDrawPool* poolp = facep->getPool(); 2667 facep->renderSelected(mFaceSelectImagep, color);
2453
2454 if (!poolp->canUseAGP())
2455 {
2456 unbindAGP();
2457 }
2458 else if (usingAGP())
2459 {
2460 bindAGP();
2461 }
2462
2463 if (mSelectedFaces[i].mTE == -1)
2464 {
2465 // Yes, I KNOW this is stupid...
2466 poolp->renderFaceSelected(facep, mFaceSelectImagep, color);
2467 }
2468 else
2469 {
2470 LLVOVolume *volp = (LLVOVolume *)facep->getViewerObject();
2471 // Do the special coalesced face mode.
2472 S32 j;
2473 S32 offset = 0;
2474 S32 count = volp->getVolume()->getVolumeFace(0).mIndices.size();
2475 for (j = 0; j <= mSelectedFaces[i].mTE; j++)
2476 {
2477 count = volp->getVolume()->getVolumeFace(j).mIndices.size();
2478 if (j < mSelectedFaces[i].mTE)
2479 {
2480 offset += count;
2481 }
2482 }
2483
2484 poolp->renderFaceSelected(facep, mFaceSelectImagep, color, offset, count);
2485 }
2486 } 2668 }
2487 } 2669 }
2488 2670
@@ -2490,26 +2672,16 @@ void LLPipeline::renderHighlights()
2490 { 2672 {
2491 // Paint 'em red! 2673 // Paint 'em red!
2492 color.setVec(1.f, 0.f, 0.f, 0.5f); 2674 color.setVec(1.f, 0.f, 0.f, 0.5f);
2493 for (S32 i = 0; i < mHighlightFaces.count(); i++) 2675 for (U32 i = 0; i < mHighlightFaces.size(); i++)
2494 { 2676 {
2495 LLFace* facep = mHighlightFaces[i]; 2677 LLFace* facep = mHighlightFaces[i];
2496 LLDrawPool* poolp = facep->getPool(); 2678 facep->renderSelected(LLViewerImage::sNullImagep, color);
2497 if (!poolp->canUseAGP())
2498 {
2499 unbindAGP();
2500 }
2501 else if (usingAGP())
2502 {
2503 bindAGP();
2504 }
2505
2506 poolp->renderFaceSelected(facep, LLViewerImage::sNullImagep, color);
2507 } 2679 }
2508 } 2680 }
2509 2681
2510 // Contains a list of the faces of objects that are physical or 2682 // Contains a list of the faces of objects that are physical or
2511 // have touch-handlers. 2683 // have touch-handlers.
2512 mHighlightFaces.reset(); 2684 mHighlightFaces.clear();
2513 2685
2514 if (mVertexShaderLevel[SHADER_INTERFACE] > 0) 2686 if (mVertexShaderLevel[SHADER_INTERFACE] > 0)
2515 { 2687 {
@@ -2517,11 +2689,11 @@ void LLPipeline::renderHighlights()
2517 } 2689 }
2518} 2690}
2519 2691
2520void LLPipeline::renderGeom() 2692void LLPipeline::renderGeom(LLCamera& camera)
2521{ 2693{
2522 LLMemType mt(LLMemType::MTYPE_PIPELINE); 2694 LLMemType mt(LLMemType::MTYPE_PIPELINE);
2523 LLFastTimer t(LLFastTimer::FTM_RENDER_GEOMETRY); 2695 LLFastTimer t(LLFastTimer::FTM_RENDER_GEOMETRY);
2524 2696
2525 if (!mAlphaSizzleImagep) 2697 if (!mAlphaSizzleImagep)
2526 { 2698 {
2527 mAlphaSizzleImagep = gImageList.getImage(LLUUID(gViewerArt.getString("alpha_sizzle.tga")), MIPMAP_TRUE, TRUE); 2699 mAlphaSizzleImagep = gImageList.getImage(LLUUID(gViewerArt.getString("alpha_sizzle.tga")), MIPMAP_TRUE, TRUE);
@@ -2533,6 +2705,8 @@ void LLPipeline::renderGeom()
2533 // 2705 //
2534 // 2706 //
2535 2707
2708 glEnableClientState(GL_VERTEX_ARRAY);
2709
2536 stop_glerror(); 2710 stop_glerror();
2537 gFrameStats.start(LLFrameStats::RENDER_SYNC); 2711 gFrameStats.start(LLFrameStats::RENDER_SYNC);
2538 2712
@@ -2540,6 +2714,7 @@ void LLPipeline::renderGeom()
2540#ifndef LL_RELEASE_FOR_DOWNLOAD 2714#ifndef LL_RELEASE_FOR_DOWNLOAD
2541 LLGLState::checkStates(); 2715 LLGLState::checkStates();
2542 LLGLState::checkTextureChannels(); 2716 LLGLState::checkTextureChannels();
2717 LLGLState::checkClientArrays();
2543#endif 2718#endif
2544 if (mRenderDebugMask & RENDER_DEBUG_VERIFY) 2719 if (mRenderDebugMask & RENDER_DEBUG_VERIFY)
2545 { 2720 {
@@ -2549,27 +2724,23 @@ void LLPipeline::renderGeom()
2549 } 2724 }
2550 } 2725 }
2551 2726
2552 if (mAGPMemPool)
2553 { 2727 {
2554 mAGPMemPool->waitFence(mGlobalFence); 2728 //LLFastTimer ftm(LLFastTimer::FTM_TEMP6);
2729 LLVertexBuffer::startRender();
2555 } 2730 }
2556 2731
2557 unbindAGP();
2558 for (pool_set_t::iterator iter = mPools.begin(); iter != mPools.end(); ++iter) 2732 for (pool_set_t::iterator iter = mPools.begin(); iter != mPools.end(); ++iter)
2559 { 2733 {
2560 LLDrawPool *poolp = *iter; 2734 LLDrawPool *poolp = *iter;
2561 if (hasRenderType(poolp->getType())) 2735 if (hasRenderType(poolp->getType()))
2562 { 2736 {
2563 poolp->prerender(); 2737 poolp->prerender();
2564 poolp->syncAGP();
2565 } 2738 }
2566 } 2739 }
2567 2740
2568 gFrameStats.start(LLFrameStats::RENDER_GEOM); 2741 gFrameStats.start(LLFrameStats::RENDER_GEOM);
2569 2742
2570 // Initialize lots of GL state to "safe" values 2743 // Initialize lots of GL state to "safe" values
2571 mTrianglesDrawn = 0;
2572
2573 glMatrixMode(GL_TEXTURE); 2744 glMatrixMode(GL_TEXTURE);
2574 glLoadIdentity(); 2745 glLoadIdentity();
2575 glMatrixMode(GL_MODELVIEW); 2746 glMatrixMode(GL_MODELVIEW);
@@ -2577,13 +2748,13 @@ void LLPipeline::renderGeom()
2577 LLGLSPipeline gls_pipeline; 2748 LLGLSPipeline gls_pipeline;
2578 2749
2579 LLGLState gls_color_material(GL_COLOR_MATERIAL, mLightingDetail < 2); 2750 LLGLState gls_color_material(GL_COLOR_MATERIAL, mLightingDetail < 2);
2580 LLGLState normalize(GL_NORMALIZE, TRUE); 2751 // LLGLState normalize(GL_NORMALIZE, TRUE);
2581 2752
2582 // Toggle backface culling for debugging 2753 // Toggle backface culling for debugging
2583 LLGLEnable cull_face(mBackfaceCull ? GL_CULL_FACE : 0); 2754 LLGLEnable cull_face(mBackfaceCull ? GL_CULL_FACE : 0);
2584 // Set fog 2755 // Set fog
2585 LLGLEnable fog_enable(hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_FOG) ? GL_FOG : 0); 2756 LLGLEnable fog_enable(hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_FOG) ? GL_FOG : 0);
2586 2757 gSky.updateFog(camera.getFar());
2587 2758
2588 LLViewerImage::sDefaultImagep->bind(0); 2759 LLViewerImage::sDefaultImagep->bind(0);
2589 LLViewerImage::sDefaultImagep->setClamp(FALSE, FALSE); 2760 LLViewerImage::sDefaultImagep->setClamp(FALSE, FALSE);
@@ -2592,19 +2763,20 @@ void LLPipeline::renderGeom()
2592 // 2763 //
2593 // Actually render all of the geometry 2764 // Actually render all of the geometry
2594 // 2765 //
2595 // 2766 //
2596
2597 stop_glerror(); 2767 stop_glerror();
2598 BOOL non_agp = FALSE;
2599 BOOL did_hud_elements = FALSE; 2768 BOOL did_hud_elements = FALSE;
2600 2769 BOOL occlude = sUseOcclusion;
2770
2601 U32 cur_type = 0; 2771 U32 cur_type = 0;
2602 2772
2603 S32 skipped_vertices = 0; 2773 if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_PICKING))
2774 {
2775 gObjectList.renderObjectsForSelect(camera);
2776 }
2777 else
2604 { 2778 {
2605 LLFastTimer t(LLFastTimer::FTM_POOLS); 2779 LLFastTimer t(LLFastTimer::FTM_POOLS);
2606 BOOL occlude = TRUE;
2607
2608 calcNearbyLights(); 2780 calcNearbyLights();
2609 2781
2610 pool_set_t::iterator iter1 = mPools.begin(); 2782 pool_set_t::iterator iter1 = mPools.begin();
@@ -2614,80 +2786,27 @@ void LLPipeline::renderGeom()
2614 2786
2615 cur_type = poolp->getType(); 2787 cur_type = poolp->getType();
2616 2788
2617 if (cur_type >= LLDrawPool::POOL_TREE && occlude) 2789 if (occlude && cur_type > LLDrawPool::POOL_AVATAR)
2618 { //all the occluders have been drawn, do occlusion queries 2790 {
2619 if (mVertexShadersEnabled)
2620 {
2621 glUseProgramObjectARB(0);
2622 }
2623 doOcclusion();
2624 occlude = FALSE; 2791 occlude = FALSE;
2792 doOcclusion(camera);
2625 } 2793 }
2626 2794
2627 if (cur_type >= LLDrawPool::POOL_HUD && !did_hud_elements) 2795 if (cur_type > LLDrawPool::POOL_ALPHA_POST_WATER && !did_hud_elements)
2628 { 2796 {
2629 renderHighlights(); 2797 renderHighlights();
2630 // Draw 3D UI elements here (before we clear the Z buffer in POOL_HUD) 2798 // Draw 3D UI elements here (before we clear the Z buffer in POOL_HUD)
2631 if (mVertexShadersEnabled)
2632 {
2633 glUseProgramObjectARB(0);
2634 }
2635 render_hud_elements(); 2799 render_hud_elements();
2636 did_hud_elements = TRUE; 2800 did_hud_elements = TRUE;
2637 } 2801 }
2638 2802
2639 pool_set_t::iterator iter2 = iter1; 2803 pool_set_t::iterator iter2 = iter1;
2640 if (hasRenderType(poolp->getType())) 2804 if (hasRenderType(poolp->getType()) && poolp->getNumPasses() > 0)
2641 { 2805 {
2642 LLFastTimer t(LLFastTimer::FTM_POOLRENDER); 2806 LLFastTimer t(LLFastTimer::FTM_POOLRENDER);
2643 2807
2644 setupHWLights(poolp); 2808 setupHWLights(poolp);
2645 2809
2646 if (mVertexShadersEnabled && poolp->getVertexShaderLevel() == 0)
2647 {
2648 glUseProgramObjectARB(0);
2649 }
2650 else if (mVertexShadersEnabled)
2651 {
2652 mMaterialIndex = mSpecularIndex = 0;
2653 switch(cur_type)
2654 {
2655 case LLDrawPool::POOL_SKY:
2656 case LLDrawPool::POOL_STARS:
2657 case LLDrawPool::POOL_CLOUDS:
2658 glUseProgramObjectARB(0);
2659 break;
2660 case LLDrawPool::POOL_TERRAIN:
2661 mTerrainProgram.bind();
2662 break;
2663 case LLDrawPool::POOL_GROUND:
2664 mGroundProgram.bind();
2665 break;
2666 case LLDrawPool::POOL_TREE:
2667 case LLDrawPool::POOL_TREE_NEW:
2668 case LLDrawPool::POOL_SIMPLE:
2669 case LLDrawPool::POOL_MEDIA:
2670 mObjectSimpleProgram.bind();
2671 break;
2672 case LLDrawPool::POOL_BUMP:
2673 mObjectBumpProgram.bind();
2674 break;
2675 case LLDrawPool::POOL_AVATAR:
2676 glUseProgramObjectARB(0);
2677 break;
2678 case LLDrawPool::POOL_WATER:
2679 glUseProgramObjectARB(0);
2680 break;
2681 case LLDrawPool::POOL_ALPHA:
2682 mObjectAlphaProgram.bind();
2683 break;
2684 case LLDrawPool::POOL_HUD:
2685 default:
2686 glUseProgramObjectARB(0);
2687 break;
2688 }
2689 }
2690
2691 for( S32 i = 0; i < poolp->getNumPasses(); i++ ) 2810 for( S32 i = 0; i < poolp->getNumPasses(); i++ )
2692 { 2811 {
2693 poolp->beginRenderPass(i); 2812 poolp->beginRenderPass(i);
@@ -2698,33 +2817,19 @@ void LLPipeline::renderGeom()
2698 { 2817 {
2699 break; 2818 break;
2700 } 2819 }
2701 if (p->getType() != LLDrawPool::POOL_AVATAR 2820
2702 && p->getType() != LLDrawPool::POOL_ALPHA
2703 && p->getType() != LLDrawPool::POOL_HUD
2704 && (!p->getIndexCount() || !p->getVertexCount()))
2705 {
2706 continue;
2707 }
2708
2709 if (p->canUseAGP() && usingAGP())
2710 {
2711 bindAGP();
2712 }
2713 else
2714 {
2715 //llinfos << "Rendering pool type " << p->getType() << " without AGP!" << llendl;
2716 unbindAGP();
2717 non_agp = TRUE;
2718 }
2719
2720 p->resetTrianglesDrawn(); 2821 p->resetTrianglesDrawn();
2721 p->render(i); 2822 p->render(i);
2722 mTrianglesDrawn += p->getTrianglesDrawn(); 2823 mTrianglesDrawn += p->getTrianglesDrawn();
2723 skipped_vertices += p->mSkippedVertices;
2724 p->mSkippedVertices = 0;
2725 } 2824 }
2726 poolp->endRenderPass(i); 2825 poolp->endRenderPass(i);
2727#ifndef LL_RELEASE_FOR_DOWNLOAD 2826#ifndef LL_RELEASE_FOR_DOWNLOAD
2827 GLint depth;
2828 glGetIntegerv(GL_MODELVIEW_STACK_DEPTH, &depth);
2829 if (depth > 3)
2830 {
2831 llerrs << "GL matrix stack corrupted!" << llendl;
2832 }
2728 LLGLState::checkStates(); 2833 LLGLState::checkStates();
2729 LLGLState::checkTextureChannels(); 2834 LLGLState::checkTextureChannels();
2730 LLGLState::checkClientArrays(); 2835 LLGLState::checkClientArrays();
@@ -2746,21 +2851,18 @@ void LLPipeline::renderGeom()
2746 iter1 = iter2; 2851 iter1 = iter2;
2747 stop_glerror(); 2852 stop_glerror();
2748 } 2853 }
2749
2750 if (occlude)
2751 {
2752 if (mVertexShadersEnabled)
2753 {
2754 glUseProgramObjectARB(0);
2755 }
2756 doOcclusion();
2757 }
2758 } 2854 }
2759 stop_glerror(); 2855
2760 2856#ifndef LL_RELEASE_FOR_DOWNLOAD
2761 if (mVertexShadersEnabled) 2857 LLGLState::checkStates();
2858 LLGLState::checkTextureChannels();
2859 LLGLState::checkClientArrays();
2860#endif
2861
2862 if (occlude)
2762 { 2863 {
2763 glUseProgramObjectARB(0); 2864 doOcclusion(camera);
2865 occlude = FALSE;
2764 } 2866 }
2765 2867
2766 if (!did_hud_elements) 2868 if (!did_hud_elements)
@@ -2768,32 +2870,49 @@ void LLPipeline::renderGeom()
2768 renderHighlights(); 2870 renderHighlights();
2769 render_hud_elements(); 2871 render_hud_elements();
2770 } 2872 }
2873
2874 stop_glerror();
2771 2875
2772 static S32 agp_mix_count = 0;
2773 if (non_agp && usingAGP())
2774 {
2775 if (0 == agp_mix_count % 16)
2776 {
2777 lldebugs << "Mixing AGP and non-AGP pools, slow!" << llendl;
2778 }
2779 agp_mix_count++;
2780 }
2781 else
2782 { 2876 {
2783 agp_mix_count = 0; 2877 LLVertexBuffer::stopRender();
2784 } 2878 }
2785 2879
2880#ifndef LL_RELEASE_FOR_DOWNLOAD
2881 LLGLState::checkStates();
2882 LLGLState::checkTextureChannels();
2883 LLGLState::checkClientArrays();
2884#endif
2885
2786 // Contains a list of the faces of objects that are physical or 2886 // Contains a list of the faces of objects that are physical or
2787 // have touch-handlers. 2887 // have touch-handlers.
2788 mHighlightFaces.reset(); 2888 mHighlightFaces.clear();
2889}
2789 2890
2790 // This wait is in case we try to do multiple renders of a frame, 2891void LLPipeline::processOcclusion(LLCamera& camera)
2791 // I don't know what happens when we send a fence multiple times without 2892{
2792 // checking it. 2893 //process occlusion (readback)
2793 if (mAGPMemPool) 2894 if (sUseOcclusion)
2794 { 2895 {
2795 mAGPMemPool->waitFence(mGlobalFence); 2896 for (U32 i = 0; i < mObjectPartition.size(); i++)
2796 mAGPMemPool->sendFence(mGlobalFence); 2897 {
2898 if (mObjectPartition[i] && hasRenderType(mObjectPartition[i]->mDrawableType))
2899 {
2900 mObjectPartition[i]->processOcclusion(&camera);
2901 }
2902 }
2903
2904#if AGGRESSIVE_OCCLUSION
2905 for (LLSpatialBridge::bridge_vector_t::iterator i = mOccludedBridge.begin(); i != mOccludedBridge.end(); ++i)
2906 {
2907 LLSpatialBridge* bridge = *i;
2908 if (!bridge->isDead() && hasRenderType(bridge->mDrawableType))
2909 {
2910 LLCamera trans = bridge->transformCamera(camera);
2911 bridge->processOcclusion(&trans);
2912 }
2913 }
2914#endif
2915 mOccludedBridge.clear();
2797 } 2916 }
2798} 2917}
2799 2918
@@ -2802,13 +2921,30 @@ void LLPipeline::renderDebug()
2802 LLMemType mt(LLMemType::MTYPE_PIPELINE); 2921 LLMemType mt(LLMemType::MTYPE_PIPELINE);
2803 2922
2804 // Disable all client state 2923 // Disable all client state
2805 glDisableClientState(GL_VERTEX_ARRAY); 2924 glDisableClientState(GL_TEXTURE_COORD_ARRAY);
2806 glDisableClientState(GL_TEXTURE_COORD_ARRAY);
2807 glDisableClientState(GL_NORMAL_ARRAY); 2925 glDisableClientState(GL_NORMAL_ARRAY);
2808 glDisableClientState(GL_VERTEX_ARRAY); 2926 glDisableClientState(GL_COLOR_ARRAY);
2809 2927
2810 // Debug stuff. 2928 // Debug stuff.
2811 mObjectPartition->renderDebug(); 2929 for (U32 i = 0; i < mObjectPartition.size(); i++)
2930 {
2931 if (mObjectPartition[i] && hasRenderType(mObjectPartition[i]->mDrawableType))
2932 {
2933 mObjectPartition[i]->renderDebug();
2934 }
2935 }
2936
2937 for (LLSpatialBridge::bridge_vector_t::iterator i = mVisibleBridge.begin(); i != mVisibleBridge.end(); ++i)
2938 {
2939 LLSpatialBridge* bridge = *i;
2940 if (!bridge->isDead() && hasRenderType(bridge->mDrawableType))
2941 {
2942 glPushMatrix();
2943 glMultMatrixf((F32*)bridge->mDrawable->getRenderMatrix().mMatrix);
2944 bridge->renderDebug();
2945 glPopMatrix();
2946 }
2947 }
2812 2948
2813 if (mRenderDebugMask & LLPipeline::RENDER_DEBUG_LIGHT_TRACE) 2949 if (mRenderDebugMask & LLPipeline::RENDER_DEBUG_LIGHT_TRACE)
2814 { 2950 {
@@ -2855,81 +2991,6 @@ void LLPipeline::renderDebug()
2855 } 2991 }
2856 } 2992 }
2857 2993
2858 mCompilesStat.addValue(sCompiles);
2859 mLightingChangesStat.addValue(mLightingChanges);
2860 mGeometryChangesStat.addValue(mGeometryChanges);
2861 mTrianglesDrawnStat.addValue(mTrianglesDrawn/1000.f);
2862 mVerticesRelitStat.addValue(mVerticesRelit);
2863 mNumVisibleFacesStat.addValue(mNumVisibleFaces);
2864 mNumVisibleDrawablesStat.addValue((S32)mVisibleList.size());
2865
2866 if (gRenderLightGlows)
2867 {
2868 displaySSBB();
2869 }
2870
2871 /*if (mRenderDebugMask & RENDER_DEBUG_BBOXES)
2872 {
2873 LLGLSPipelineAlpha gls_pipeline_alpha;
2874 LLGLSNoTexture no_texture;
2875
2876 for (LLDrawable::drawable_vector_t::iterator iter = mVisibleList.begin(); iter != mVisibleList.end(); iter++)
2877 {
2878 LLDrawable *drawablep = *iter;
2879 if (drawablep->isDead())
2880 {
2881 continue;
2882 }
2883 LLVector3 min, max;
2884
2885 if (drawablep->getVObj() && drawablep->getVObj()->getPCode() == LLViewerObject::LL_VO_SURFACE_PATCH)
2886 {
2887 // Render drawable bbox
2888 drawablep->getBounds(min, max);
2889 glColor4f(0.f, 1.f, 0.f, 0.25f);
2890 render_bbox(min, max);
2891
2892 // Render object bbox
2893 LLVector3 scale = drawablep->getVObj()->getScale();
2894 LLVector3 pos = drawablep->getVObj()->getPositionAgent();
2895 min = pos - scale * 0.5f;
2896 max = pos + scale * 0.5f;
2897 glColor4f(1.f, 0.f, 0.f, 0.25f);
2898 render_bbox(min, max);
2899 }
2900 }
2901 }*/
2902
2903 /*
2904 // Debugging code for parcel sound.
2905 F32 x, y;
2906
2907 LLGLSNoTexture gls_no_texture;
2908
2909 glBegin(GL_POINTS);
2910 if (gAgent.getRegion())
2911 {
2912 // Draw the composition layer for the region that I'm in.
2913 for (x = 0; x <= 260; x++)
2914 {
2915 for (y = 0; y <= 260; y++)
2916 {
2917 if (gParcelMgr->isSoundLocal(gAgent.getRegion()->getOriginGlobal() + LLVector3d(x, y, 0.f)))
2918 {
2919 glColor4f(1.f, 0.f, 0.f, 1.f);
2920 }
2921 else
2922 {
2923 glColor4f(0.f, 0.f, 1.f, 1.f);
2924 }
2925
2926 glVertex3f(x, y, gAgent.getRegion()->getLandHeightRegion(LLVector3(x, y, 0.f)));
2927 }
2928 }
2929 }
2930 glEnd();
2931 */
2932
2933 if (mRenderDebugMask & RENDER_DEBUG_COMPOSITION) 2994 if (mRenderDebugMask & RENDER_DEBUG_COMPOSITION)
2934 { 2995 {
2935 // Debug composition layers 2996 // Debug composition layers
@@ -2962,358 +3023,163 @@ void LLPipeline::renderDebug()
2962 } 3023 }
2963 glEnd(); 3024 glEnd();
2964 } 3025 }
2965
2966 if (mRenderDebugMask & RENDER_DEBUG_AGP_MEM)
2967 {
2968 displayAGP();
2969 }
2970
2971 if (mRenderDebugMask & RENDER_DEBUG_POOLS)
2972 {
2973 displayPools();
2974 }
2975
2976// if (mRenderDebugMask & RENDER_DEBUG_QUEUES)
2977// {
2978// displayQueues();
2979// }
2980
2981 if (mRenderDebugMask & RENDER_DEBUG_MAP)
2982 {
2983 displayMap();
2984 }
2985} 3026}
2986 3027
2987 3028void LLPipeline::renderForSelect(std::set<LLViewerObject*>& objects)
2988
2989
2990BOOL compute_min_max(LLMatrix4& box, LLVector2& min, LLVector2& max)
2991{ 3029{
2992 min.setVec(1000,1000); 3030 LLMemType mt(LLMemType::MTYPE_PIPELINE);
2993 max.setVec(-1000,-1000); 3031
2994 3032 LLVertexBuffer::startRender();
2995 if (box.mMatrix[3][3] <= 0.0f) return FALSE; 3033
3034 glMatrixMode(GL_MODELVIEW);
2996 3035
2997 const F32 vec[8][3] = { 3036 LLGLSDefault gls_default;
2998 { -0.5f,-0.5f,-0.5f }, 3037 LLGLSObjectSelect gls_object_select;
2999 { -0.5f,-0.5f,+0.5f }, 3038 LLGLDepthTest gls_depth(GL_TRUE,GL_TRUE);
3000 { -0.5f,+0.5f,-0.5f }, 3039 disableLights();
3001 { -0.5f,+0.5f,+0.5f }, 3040
3002 { +0.5f,-0.5f,-0.5f }, 3041 glEnableClientState ( GL_VERTEX_ARRAY );
3003 { +0.5f,-0.5f,+0.5f },
3004 { +0.5f,+0.5f,-0.5f },
3005 { +0.5f,+0.5f,+0.5f } };
3006
3007 LLVector4 v;
3008 3042
3009 for (S32 i=0;i<8;i++) 3043 //for each drawpool
3044#ifndef LL_RELEASE_FOR_DOWNLOAD
3045 LLGLState::checkStates();
3046 LLGLState::checkTextureChannels();
3047 LLGLState::checkClientArrays();
3048 U32 last_type = 0;
3049#endif
3050 for (pool_set_t::iterator iter = mPools.begin(); iter != mPools.end(); ++iter)
3010 { 3051 {
3011 v.setVec(vec[i][0],vec[i][1],vec[i][2],1); 3052 LLDrawPool *poolp = *iter;
3012 v = v * box; 3053 if (poolp->isFacePool() && hasRenderType(poolp->getType()))
3013 F32 iw = 1.0f / v.mV[3]; 3054 {
3014 v.mV[0] *= iw; 3055 LLFacePool* face_pool = (LLFacePool*) poolp;
3015 v.mV[1] *= iw; 3056 face_pool->renderForSelect();
3016 3057
3017 min.mV[0] = llmin(min.mV[0],v.mV[0]); 3058#ifndef LL_RELEASE_FOR_DOWNLOAD
3018 max.mV[0] = llmax(max.mV[0],v.mV[0]); 3059 if (poolp->getType() != last_type)
3019 3060 {
3020 min.mV[1] = llmin(min.mV[1],v.mV[1]); 3061 last_type = poolp->getType();
3021 max.mV[1] = llmax(max.mV[1],v.mV[1]); 3062 LLGLState::checkStates();
3063 LLGLState::checkTextureChannels();
3064 LLGLState::checkClientArrays();
3065 }
3066#endif
3067 }
3022 } 3068 }
3023 3069
3024 /* 3070 LLGLEnable tex(GL_TEXTURE_2D);
3025 min.mV[0] = max.mV[0] = box.mMatrix[3][0]; 3071 glEnableClientState(GL_TEXTURE_COORD_ARRAY);
3026 min.mV[1] = max.mV[1] = box.mMatrix[3][1]; 3072 LLGLEnable alpha_test(GL_ALPHA_TEST);
3027 F32 iw = 1.0f / box.mMatrix[3][3]; 3073 if (gPickTransparent)
3028
3029 F32 f0 = (fabs(box.mMatrix[0][0])+fabs(box.mMatrix[1][0])+fabs(box.mMatrix[2][0])) * 0.5f;
3030 F32 f1 = (fabs(box.mMatrix[0][1])+fabs(box.mMatrix[1][1])+fabs(box.mMatrix[2][1])) * 0.5f;
3031 F32 f2 = (fabs(box.mMatrix[0][2])+fabs(box.mMatrix[1][2])+fabs(box.mMatrix[2][2])) * 0.5f;
3032
3033 min.mV[0] -= f0;
3034 min.mV[1] -= f1;
3035
3036 max.mV[0] += f0;
3037 max.mV[1] += f1;
3038
3039 min.mV[0] *= iw;
3040 min.mV[1] *= iw;
3041
3042 max.mV[0] *= iw;
3043 max.mV[1] *= iw;
3044 */
3045 return TRUE;
3046}
3047
3048void LLPipeline::displaySSBB()
3049{
3050 LLMatrix4 proj;
3051 LLMatrix4 cfr(OGL_TO_CFR_ROTATION);
3052 LLMatrix4 camera;
3053 LLMatrix4 comb;
3054
3055 gCamera->getMatrixToLocal(camera);
3056
3057 if (!mBloomImagep)
3058 { 3074 {
3059 mBloomImagep = gImageList.getImage(IMG_BLOOM1); 3075 glAlphaFunc(GL_GEQUAL, 0.0f);
3076 }
3077 else
3078 {
3079 glAlphaFunc(GL_GREATER, 0.2f);
3060 } 3080 }
3061 3081
3062 // don't write to depth buffer with light glows so that chat bubbles can pop through 3082 glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_ARB);
3063 LLGLDepthTest gls_depth(GL_TRUE, GL_FALSE); 3083 glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_RGB_ARB, GL_REPLACE);
3064 LLViewerImage::bindTexture(mBloomImagep); 3084 glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_ALPHA_ARB, GL_MODULATE);
3065
3066 glGetFloatv(GL_PROJECTION_MATRIX,(float*)proj.mMatrix);
3067
3068 glMatrixMode(GL_PROJECTION);
3069 glPushMatrix();
3070 glLoadIdentity();
3071
3072 glMatrixMode(GL_MODELVIEW);
3073 glPushMatrix();
3074 glLoadIdentity();
3075 3085
3076 LLGLSPipelineAlpha gls_pipeline_alpha; 3086 glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_RGB_ARB, GL_PRIMARY_COLOR);
3087 glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_RGB_ARB, GL_SRC_COLOR);
3077 3088
3078 //glScalef(0.25,0.25,0.25); 3089 glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_ALPHA_ARB, GL_TEXTURE);
3090 glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_ALPHA_ARB, GL_SRC_ALPHA);
3079 3091
3080 S32 sizex = gViewerWindow->getWindowWidth() / 2; 3092 glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE1_ALPHA_ARB, GL_PRIMARY_COLOR_ARB);
3081 S32 sizey = gViewerWindow->getWindowHeight() / 2; 3093 glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND1_ALPHA_ARB, GL_SRC_ALPHA);
3082 3094
3083 F32 aspect = (float)sizey / (float)sizex; 3095 U32 prim_mask = LLVertexBuffer::MAP_VERTEX |
3096 LLVertexBuffer::MAP_TEXCOORD;
3084 3097
3085 for (LLDrawable::drawable_set_t::iterator iter = mLights.begin(); 3098 for (std::set<LLViewerObject*>::iterator i = objects.begin(); i != objects.end(); ++i)
3086 iter != mLights.end(); iter++)
3087 { 3099 {
3088 LLDrawable *lightp = *iter; 3100 LLViewerObject* vobj = *i;
3089 if (lightp->isDead()) 3101 LLDrawable* drawable = vobj->mDrawable;
3102 if (vobj->isDead() ||
3103 vobj->isHUDAttachment() ||
3104 (gHideSelectedObjects && vobj->isSelected()) ||
3105 drawable->isDead() ||
3106 !hasRenderType(drawable->getRenderType()))
3090 { 3107 {
3091 continue; 3108 continue;
3092 } 3109 }
3093
3094 LLMatrix4 mat = lightp->mXform.getWorldMatrix();
3095 3110
3096 mat *= camera; 3111 for (S32 j = 0; j < drawable->getNumFaces(); ++j)
3097 mat *= cfr;
3098 mat *= proj;
3099
3100 U8 color[64];
3101
3102 LLVector2 min,max;
3103 if (mat.mMatrix[3][3] < 160 && compute_min_max(mat,min,max))
3104 { 3112 {
3105 F32 cx = (max.mV[0] + min.mV[0]) * 0.5f; 3113 LLFace* facep = drawable->getFace(j);
3106 F32 cy = (max.mV[1] + min.mV[1]) * 0.5f; 3114 if (!facep->getPool())
3107 F32 sx = (max.mV[0] - min.mV[0]) * 2.0f;
3108 F32 sy = (max.mV[1] - min.mV[1]) * 2.0f;
3109 S32 x = (S32)(cx * (F32)sizex) + sizex;
3110 S32 y = (S32)(cy * (F32)sizey) + sizey;
3111
3112 if (cx > -1 && cx < 1 && cy > -1 && cy < 1)
3113 { 3115 {
3114 glReadPixels(x-2,y-2,4,4,GL_RGBA,GL_UNSIGNED_BYTE,&color[0]); 3116 facep->renderForSelect(prim_mask);
3115
3116 S32 total = 0;
3117 for (S32 i=0;i<64;i++)
3118 {
3119 total += color[i];
3120 }
3121 total /= 64;
3122
3123 sx = (sy = (sx + sy) * 0.5f * ((float)total/255.0f)) * aspect;
3124
3125
3126 if (total > 60)
3127 {
3128 color[3+32] = total >> 1;
3129 glBegin(GL_QUADS);
3130 glColor4ubv(&color[32]);
3131 glTexCoord2f(0,0);
3132 glVertex3f(cx-sx,cy-sy,0);
3133 glTexCoord2f(1,0);
3134 glVertex3f(cx+sx,cy-sy,0);
3135 glTexCoord2f(1,1);
3136 glVertex3f(cx+sx,cy+sy,0);
3137 glTexCoord2f(0,1);
3138 glVertex3f(cx-sx,cy+sy,0);
3139 glEnd();
3140 }
3141 } 3117 }
3142 } 3118 }
3143
3144 } 3119 }
3145 3120
3146 // sun 3121 // pick HUD objects
3122 LLVOAvatar* avatarp = gAgent.getAvatarObject();
3123 if (avatarp && sShowHUDAttachments)
3147 { 3124 {
3148 LLVector4 sdir(gSky.getSunDirection() * 10000.0f + gAgent.getPositionAgent()); 3125 glMatrixMode(GL_PROJECTION);
3149 sdir.mV[3] = 1.0f; 3126 glPushMatrix();
3150 sdir = sdir * camera; 3127 glMatrixMode(GL_MODELVIEW);
3151 sdir = sdir * cfr; 3128 glPushMatrix();
3152 sdir = sdir * proj; // todo: preconcat
3153 3129
3154 sdir.mV[0] /= sdir.mV[3]; 3130 setup_hud_matrices(TRUE);
3155 sdir.mV[1] /= sdir.mV[3]; 3131 LLViewerJointAttachment* attachmentp;
3156 3132 for (attachmentp = avatarp->mAttachmentPoints.getFirstData();
3157 U8 color[64]; 3133 attachmentp;
3158 3134 attachmentp = avatarp->mAttachmentPoints.getNextData())
3159 if (sdir.mV[3] > 0)
3160 { 3135 {
3161 F32 cx = sdir.mV[0]; 3136 if (attachmentp->getIsHUDAttachment())
3162 F32 cy = sdir.mV[1];
3163 F32 sx, sy;
3164 S32 x = (S32)(cx * (F32)sizex) + sizex;
3165 S32 y = (S32)(cy * (F32)sizey) + sizey;
3166
3167 if (cx > -1 && cx < 1 && cy > -1 && cy < 1)
3168 { 3137 {
3169 glReadPixels(x-2,y-2,4,4,GL_RGBA,GL_UNSIGNED_BYTE,&color[0]); 3138 LLViewerObject* objectp = attachmentp->getObject();
3170 3139 if (objectp)
3171 S32 total = 0;
3172 for (S32 i=0;i<64;i++)
3173 { 3140 {
3174 total += color[i]; 3141 LLDrawable* drawable = objectp->mDrawable;
3175 } 3142 if (drawable->isDead())
3176 total >>= 7; 3143 {
3177 3144 continue;
3178 sx = (sy = ((float)total/255.0f)) * aspect; 3145 }
3179
3180 const F32 fix = -0.1f;
3181 3146
3182 color[32] = (U8)(color[32] * 0.5f + 255 * 0.5f); 3147 for (S32 j = 0; j < drawable->getNumFaces(); ++j)
3183 color[33] = (U8)(color[33] * 0.5f + 255 * 0.5f); 3148 {
3184 color[34] = (U8)(color[34] * 0.5f + 255 * 0.5f); 3149 LLFace* facep = drawable->getFace(j);
3150 if (!facep->getPool())
3151 {
3152 facep->renderForSelect(prim_mask);
3153 }
3154 }
3185 3155
3186 if (total > 80) 3156 //render child faces
3187 { 3157 for (U32 k = 0; k < drawable->getChildCount(); ++k)
3188 color[32+3] = (U8)total; 3158 {
3189 glBegin(GL_QUADS); 3159 LLDrawable* child = drawable->getChild(k);
3190 glColor4ubv(&color[32]); 3160 for (S32 l = 0; l < child->getNumFaces(); ++l)
3191 glTexCoord2f(0,0); 3161 {
3192 glVertex3f(cx-sx,cy-sy+fix,0); 3162 LLFace* facep = child->getFace(l);
3193 glTexCoord2f(1,0); 3163 if (!facep->getPool())
3194 glVertex3f(cx+sx,cy-sy+fix,0); 3164 {
3195 glTexCoord2f(1,1); 3165 facep->renderForSelect(prim_mask);
3196 glVertex3f(cx+sx,cy+sy+fix,0); 3166 }
3197 glTexCoord2f(0,1); 3167 }
3198 glVertex3f(cx-sx,cy+sy+fix,0); 3168 }
3199 glEnd(); 3169 }
3200 }
3201 } 3170 }
3202 } 3171 }
3203 }
3204 3172
3205 glMatrixMode(GL_PROJECTION); 3173 glMatrixMode(GL_PROJECTION);
3206 glPopMatrix(); 3174 glPopMatrix();
3207 glMatrixMode(GL_MODELVIEW); 3175 glMatrixMode(GL_MODELVIEW);
3208 glPopMatrix(); 3176 glPopMatrix();
3209}
3210
3211void LLPipeline::displayMap()
3212{
3213 LLGLSPipelineAlpha gls_pipeline_alpha;
3214 LLGLSNoTexture no_texture;
3215 LLGLDepthTest gls_depth(GL_TRUE, GL_FALSE);
3216
3217 glMatrixMode(GL_MODELVIEW);
3218 glPushMatrix();
3219 glLoadIdentity();
3220
3221 glMatrixMode(GL_PROJECTION);
3222 glPushMatrix();
3223 glLoadIdentity();
3224
3225 glTranslatef(-1,-1,0);
3226 glScalef(2,2,0);
3227
3228 glColor4f(0,0,0,0.5);
3229 glBegin(GL_QUADS);
3230 glVertex3f(0,0,0);
3231 glVertex3f(1,0,0);
3232 glVertex3f(1,1,0);
3233 glVertex3f(0,1,0);
3234 glEnd();
3235
3236 static F32 totalW = 1.5f;
3237 static F32 offset = 0.5f;
3238 static F32 scale = 1.0f;
3239
3240 S32 mousex = gViewerWindow->getCurrentMouseX();
3241 S32 mousey = gViewerWindow->getCurrentMouseY();
3242 S32 w = gViewerWindow->getWindowWidth();
3243 S32 h = gViewerWindow->getWindowHeight();
3244
3245 if (mousex < 20 && offset > 0) offset -= (20 - mousex) * 0.02f;
3246 if (mousex > (w - 20)) offset += (20 - (w - mousex)) * 0.02f;
3247 if (offset > (totalW-1)) offset = (totalW-1);
3248
3249 if (mousey < 20 && scale > 0.1) scale -= (20 - mousey) * 0.001f;
3250 if (mousey > (h - 20) && scale < 1.0f) scale += (20 - (h - mousey)) * 0.001f;
3251
3252 glScalef(scale*scale,scale,1);
3253 glTranslatef(-offset,0,0);
3254 //totalW = mStaticTree->render2D(0,0.8f/scale);
3255 //mDynamicTree->render2D(0,0.4f/scale);
3256
3257 glMatrixMode(GL_PROJECTION);
3258 glPopMatrix();
3259 glMatrixMode(GL_MODELVIEW);
3260 glPopMatrix();
3261}
3262
3263void LLPipeline::renderForSelect()
3264{
3265 LLMemType mt(LLMemType::MTYPE_PIPELINE);
3266 //for each drawpool
3267
3268 glMatrixMode(GL_MODELVIEW);
3269
3270 LLGLSDefault gls_default;
3271 LLGLSObjectSelect gls_object_select;
3272 LLGLDepthTest gls_depth(GL_TRUE);
3273 disableLights();
3274
3275 glEnableClientState ( GL_VERTEX_ARRAY );
3276 glDisableClientState( GL_NORMAL_ARRAY );
3277 glDisableClientState( GL_TEXTURE_COORD_ARRAY );
3278
3279#ifndef LL_RELEASE_FOR_DOWNLOAD
3280 LLGLState::checkStates();
3281 LLGLState::checkTextureChannels();
3282 LLGLState::checkClientArrays();
3283 U32 last_type = 0;
3284#endif
3285 for (pool_set_t::iterator iter = mPools.begin(); iter != mPools.end(); ++iter)
3286 {
3287 LLDrawPool *poolp = *iter;
3288 if (poolp->canUseAGP() && usingAGP())
3289 {
3290 bindAGP();
3291 }
3292 else
3293 {
3294 //llinfos << "Rendering pool type " << p->getType() << " without AGP!" << llendl;
3295 unbindAGP();
3296 }
3297 poolp->renderForSelect();
3298#ifndef LL_RELEASE_FOR_DOWNLOAD
3299 if (poolp->getType() != last_type)
3300 {
3301 last_type = poolp->getType();
3302 LLGLState::checkStates();
3303 LLGLState::checkTextureChannels();
3304 LLGLState::checkClientArrays();
3305 }
3306#endif
3307 } 3177 }
3308 3178
3309 // Disable all of the client state 3179 glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
3310 glDisableClientState( GL_VERTEX_ARRAY ); 3180 glDisableClientState( GL_TEXTURE_COORD_ARRAY );
3311 3181
3312 if (mAGPMemPool) 3182 LLVertexBuffer::stopRender();
3313 {
3314 mAGPMemPool->waitFence(mGlobalFence);
3315 mAGPMemPool->sendFence(mGlobalFence);
3316 }
3317} 3183}
3318 3184
3319void LLPipeline::renderFaceForUVSelect(LLFace* facep) 3185void LLPipeline::renderFaceForUVSelect(LLFace* facep)
@@ -3325,7 +3191,6 @@ void LLPipeline::rebuildPools()
3325{ 3191{
3326 LLMemType mt(LLMemType::MTYPE_PIPELINE); 3192 LLMemType mt(LLMemType::MTYPE_PIPELINE);
3327 S32 max_count = mPools.size(); 3193 S32 max_count = mPools.size();
3328 S32 num_rebuilds = 0;
3329 pool_set_t::iterator iter1 = mPools.upper_bound(mLastRebuildPool); 3194 pool_set_t::iterator iter1 = mPools.upper_bound(mLastRebuildPool);
3330 while(max_count > 0 && mPools.size() > 0) // && num_rebuilds < MAX_REBUILDS) 3195 while(max_count > 0 && mPools.size() > 0) // && num_rebuilds < MAX_REBUILDS)
3331 { 3196 {
@@ -3334,8 +3199,8 @@ void LLPipeline::rebuildPools()
3334 iter1 = mPools.begin(); 3199 iter1 = mPools.begin();
3335 } 3200 }
3336 LLDrawPool* poolp = *iter1; 3201 LLDrawPool* poolp = *iter1;
3337 num_rebuilds += poolp->rebuild(); 3202
3338 if (poolp->mReferences.empty()) 3203 if (poolp->isDead())
3339 { 3204 {
3340 mPools.erase(iter1++); 3205 mPools.erase(iter1++);
3341 removeFromQuickLookup( poolp ); 3206 removeFromQuickLookup( poolp );
@@ -3365,27 +3230,35 @@ void LLPipeline::addToQuickLookup( LLDrawPool* new_poolp )
3365 switch( new_poolp->getType() ) 3230 switch( new_poolp->getType() )
3366 { 3231 {
3367 case LLDrawPool::POOL_SIMPLE: 3232 case LLDrawPool::POOL_SIMPLE:
3368 mSimplePools[ uintptr_t(new_poolp->getTexture()) ] = new_poolp ; 3233 if (mSimplePool)
3234 {
3235 llassert(0);
3236 llwarns << "Ignoring duplicate simple pool." << llendl;
3237 }
3238 else
3239 {
3240 mSimplePool = (LLRenderPass*) new_poolp;
3241 }
3369 break; 3242 break;
3370 3243
3371 case LLDrawPool::POOL_TREE: 3244 case LLDrawPool::POOL_TREE:
3372 mTreePools[ uintptr_t(new_poolp->getTexture()) ] = new_poolp ; 3245 mTreePools[ uintptr_t(new_poolp->getTexture()) ] = new_poolp ;
3373 break; 3246 break;
3374
3375 case LLDrawPool::POOL_TREE_NEW:
3376 mTreeNewPools[ uintptr_t(new_poolp->getTexture()) ] = new_poolp ;
3377 break;
3378 3247
3379 case LLDrawPool::POOL_TERRAIN: 3248 case LLDrawPool::POOL_TERRAIN:
3380 mTerrainPools[ uintptr_t(new_poolp->getTexture()) ] = new_poolp ; 3249 mTerrainPools[ uintptr_t(new_poolp->getTexture()) ] = new_poolp ;
3381 break; 3250 break;
3382 3251
3383 case LLDrawPool::POOL_BUMP: 3252 case LLDrawPool::POOL_BUMP:
3384 mBumpPools[ uintptr_t(new_poolp->getTexture()) ] = new_poolp ; 3253 if (mBumpPool)
3385 break; 3254 {
3386 3255 llassert(0);
3387 case LLDrawPool::POOL_MEDIA: 3256 llwarns << "Ignoring duplicate bump pool." << llendl;
3388 mMediaPools[ uintptr_t(new_poolp->getTexture()) ] = new_poolp ; 3257 }
3258 else
3259 {
3260 mBumpPool = new_poolp;
3261 }
3389 break; 3262 break;
3390 3263
3391 case LLDrawPool::POOL_ALPHA: 3264 case LLDrawPool::POOL_ALPHA:
@@ -3400,6 +3273,18 @@ void LLPipeline::addToQuickLookup( LLDrawPool* new_poolp )
3400 } 3273 }
3401 break; 3274 break;
3402 3275
3276 case LLDrawPool::POOL_ALPHA_POST_WATER:
3277 if( mAlphaPoolPostWater )
3278 {
3279 llassert(0);
3280 llwarns << "LLPipeline::addPool(): Ignoring duplicate Alpha pool" << llendl;
3281 }
3282 else
3283 {
3284 mAlphaPoolPostWater = new_poolp;
3285 }
3286 break;
3287
3403 case LLDrawPool::POOL_AVATAR: 3288 case LLDrawPool::POOL_AVATAR:
3404 break; // Do nothing 3289 break; // Do nothing
3405 3290
@@ -3426,19 +3311,7 @@ void LLPipeline::addToQuickLookup( LLDrawPool* new_poolp )
3426 mStarsPool = new_poolp; 3311 mStarsPool = new_poolp;
3427 } 3312 }
3428 break; 3313 break;
3429 3314
3430 case LLDrawPool::POOL_CLOUDS:
3431 if( mCloudsPool )
3432 {
3433 llassert(0);
3434 llwarns << "LLPipeline::addPool(): Ignoring duplicate Clouds pool" << llendl;
3435 }
3436 else
3437 {
3438 mCloudsPool = new_poolp;
3439 }
3440 break;
3441
3442 case LLDrawPool::POOL_WATER: 3315 case LLDrawPool::POOL_WATER:
3443 if( mWaterPool ) 3316 if( mWaterPool )
3444 { 3317 {
@@ -3463,14 +3336,6 @@ void LLPipeline::addToQuickLookup( LLDrawPool* new_poolp )
3463 } 3336 }
3464 break; 3337 break;
3465 3338
3466 case LLDrawPool::POOL_HUD:
3467 if( mHUDPool )
3468 {
3469 llerrs << "LLPipeline::addPool(): Duplicate HUD Pool!" << llendl;
3470 }
3471 mHUDPool = new_poolp;
3472 break;
3473
3474 default: 3339 default:
3475 llassert(0); 3340 llassert(0);
3476 llwarns << "Invalid Pool Type in LLPipeline::addPool()" << llendl; 3341 llwarns << "Invalid Pool Type in LLPipeline::addPool()" << llendl;
@@ -3491,14 +3356,8 @@ void LLPipeline::removeFromQuickLookup( LLDrawPool* poolp )
3491 switch( poolp->getType() ) 3356 switch( poolp->getType() )
3492 { 3357 {
3493 case LLDrawPool::POOL_SIMPLE: 3358 case LLDrawPool::POOL_SIMPLE:
3494 #ifdef _DEBUG 3359 llassert(mSimplePool == poolp);
3495 { 3360 mSimplePool = NULL;
3496 BOOL found = mSimplePools.erase( (uintptr_t)poolp->getTexture() );
3497 llassert( found );
3498 }
3499 #else
3500 mSimplePools.erase( (uintptr_t)poolp->getTexture() );
3501 #endif
3502 break; 3361 break;
3503 3362
3504 case LLDrawPool::POOL_TREE: 3363 case LLDrawPool::POOL_TREE:
@@ -3512,17 +3371,6 @@ void LLPipeline::removeFromQuickLookup( LLDrawPool* poolp )
3512 #endif 3371 #endif
3513 break; 3372 break;
3514 3373
3515 case LLDrawPool::POOL_TREE_NEW:
3516 #ifdef _DEBUG
3517 {
3518 BOOL found = mTreeNewPools.erase( (uintptr_t)poolp->getTexture() );
3519 llassert( found );
3520 }
3521 #else
3522 mTreeNewPools.erase( (uintptr_t)poolp->getTexture() );
3523 #endif
3524 break;
3525
3526 case LLDrawPool::POOL_TERRAIN: 3374 case LLDrawPool::POOL_TERRAIN:
3527 #ifdef _DEBUG 3375 #ifdef _DEBUG
3528 { 3376 {
@@ -3535,32 +3383,20 @@ void LLPipeline::removeFromQuickLookup( LLDrawPool* poolp )
3535 break; 3383 break;
3536 3384
3537 case LLDrawPool::POOL_BUMP: 3385 case LLDrawPool::POOL_BUMP:
3538 #ifdef _DEBUG 3386 llassert( poolp == mBumpPool );
3539 { 3387 mBumpPool = NULL;
3540 BOOL found = mBumpPools.erase( (uintptr_t)poolp->getTexture() );
3541 llassert( found );
3542 }
3543 #else
3544 mBumpPools.erase( (uintptr_t)poolp->getTexture() );
3545 #endif
3546 break;
3547
3548 case LLDrawPool::POOL_MEDIA:
3549 #ifdef _DEBUG
3550 {
3551 BOOL found = mMediaPools.erase( (uintptr_t)poolp->getTexture() );
3552 llassert( found );
3553 }
3554 #else
3555 mMediaPools.erase( (uintptr_t)poolp->getTexture() );
3556 #endif
3557 break; 3388 break;
3558 3389
3559 case LLDrawPool::POOL_ALPHA: 3390 case LLDrawPool::POOL_ALPHA:
3560 llassert( poolp == mAlphaPool ); 3391 llassert( poolp == mAlphaPool );
3561 mAlphaPool = NULL; 3392 mAlphaPool = NULL;
3562 break; 3393 break;
3563 3394
3395 case LLDrawPool::POOL_ALPHA_POST_WATER:
3396 llassert( poolp == mAlphaPoolPostWater );
3397 mAlphaPoolPostWater = NULL;
3398 break;
3399
3564 case LLDrawPool::POOL_AVATAR: 3400 case LLDrawPool::POOL_AVATAR:
3565 break; // Do nothing 3401 break; // Do nothing
3566 3402
@@ -3574,11 +3410,6 @@ void LLPipeline::removeFromQuickLookup( LLDrawPool* poolp )
3574 mStarsPool = NULL; 3410 mStarsPool = NULL;
3575 break; 3411 break;
3576 3412
3577 case LLDrawPool::POOL_CLOUDS:
3578 llassert( poolp == mCloudsPool );
3579 mCloudsPool = NULL;
3580 break;
3581
3582 case LLDrawPool::POOL_WATER: 3413 case LLDrawPool::POOL_WATER:
3583 llassert( poolp == mWaterPool ); 3414 llassert( poolp == mWaterPool );
3584 mWaterPool = NULL; 3415 mWaterPool = NULL;
@@ -3589,11 +3420,6 @@ void LLPipeline::removeFromQuickLookup( LLDrawPool* poolp )
3589 mGroundPool = NULL; 3420 mGroundPool = NULL;
3590 break; 3421 break;
3591 3422
3592 case LLDrawPool::POOL_HUD:
3593 llassert( poolp == mHUDPool );
3594 mHUDPool = NULL;
3595 break;
3596
3597 default: 3423 default:
3598 llassert(0); 3424 llassert(0);
3599 llwarns << "Invalid Pool Type in LLPipeline::removeFromQuickLookup() type=" << poolp->getType() << llendl; 3425 llwarns << "Invalid Pool Type in LLPipeline::removeFromQuickLookup() type=" << poolp->getType() << llendl;
@@ -3601,17 +3427,6 @@ void LLPipeline::removeFromQuickLookup( LLDrawPool* poolp )
3601 } 3427 }
3602} 3428}
3603 3429
3604void LLPipeline::flushAGPMemory()
3605{
3606 LLMemType mt(LLMemType::MTYPE_PIPELINE);
3607
3608 for (pool_set_t::iterator iter = mPools.begin(); iter != mPools.end(); ++iter)
3609 {
3610 LLDrawPool *poolp = *iter;
3611 poolp->flushAGP();
3612 }
3613}
3614
3615void LLPipeline::resetDrawOrders() 3430void LLPipeline::resetDrawOrders()
3616{ 3431{
3617 // Iterate through all of the draw pools and rebuild them. 3432 // Iterate through all of the draw pools and rebuild them.
@@ -3622,346 +3437,6 @@ void LLPipeline::resetDrawOrders()
3622 } 3437 }
3623} 3438}
3624 3439
3625//-------------------------------
3626
3627
3628LLViewerObject *LLPipeline::nearestObjectAt(F32 yaw, F32 pitch)
3629{
3630 // Stub to find nearest Object at given yaw and pitch
3631
3632 /*
3633 LLEdge *vd = NULL;
3634
3635 if (vd)
3636 {
3637 return (LLViewerObject*)vd->mDrawablep->getVObj();
3638 }
3639 */
3640
3641 return NULL;
3642}
3643
3644void LLPipeline::printPools()
3645{
3646 /*
3647 // Iterate through all of the draw pools and rebuild them.
3648 for (pool_set_t::iterator iter = mPools.begin(); iter != mPools.end(); ++iter)
3649 {
3650 LLDrawPool *poolp = *iter;
3651 if (pool->mTexturep[0])
3652 {
3653 llinfos << "Op pool " << pool->mTexturep[0]->mID << llendflush;
3654 }
3655 else
3656 {
3657 llinfos << "Opaque pool NULL" << llendflush;
3658 }
3659 llinfos << " Vertices: \t" << pool->getVertexCount() << llendl;
3660 }
3661
3662
3663 for (pool_set_t::iterator iter = mPools.begin(); iter != mPools.end(); ++iter)
3664 {
3665 LLDrawPool *poolp = *iter;
3666 llinfos << "Al pool " << pool;
3667 llcont << " Vertices: \t" << pool->getVertexCount() << llendl;
3668 }
3669
3670 pool = mHighlightPools.getFirst();
3671 llinfos << "Si pool " << pool;
3672 llcont << " Vertices: \t" << pool->getVertexCount() << llendl;
3673 */
3674}
3675
3676
3677void LLPipeline::displayPools()
3678{
3679 // Needs to be fixed to handle chained pools - djs
3680 LLUI::setLineWidth(1.0);
3681 glMatrixMode(GL_PROJECTION);
3682 glPushMatrix();
3683 glLoadIdentity();
3684 glMatrixMode(GL_MODELVIEW);
3685 glPushMatrix();
3686 glLoadIdentity();
3687
3688 LLGLSPipelineAlpha gls_pipeline_alpha;
3689 LLGLSNoTexture no_texture;
3690 LLGLDepthTest gls_depth(GL_TRUE, GL_FALSE);
3691
3692 glScalef(2,2,1);
3693 glTranslatef(-0.5f,-0.5f,0);
3694
3695 F32 x = 0.0f, y = 0.05f;
3696 F32 xs = 0.01f, ys = 0.01f;
3697 F32 xs2 = xs*0.1f, ys2 = ys * 0.1f;
3698
3699 for (pool_set_t::iterator iter = mPools.begin(); iter != mPools.end(); ++iter)
3700 {
3701 LLGLSTexture gls_texture;
3702 LLDrawPool *poolp = *iter;
3703 if (poolp->getDebugTexture())
3704 {
3705 poolp->getDebugTexture()->bind();
3706 glColor4f(1,1,1,1);
3707 stamp(x,y,xs*4,ys*4);
3708 }
3709
3710 LLGLSNoTexture no_texture;
3711
3712 F32 a = 1.f - (F32)poolp->mRebuildTime / (F32)poolp->mRebuildFreq;
3713 glColor4f(a,a,a,1);
3714 stamp(x,y,xs,ys);
3715
3716 x = (xs + xs2) * 4.0f;
3717
3718 F32 h = ys * 0.5f;
3719
3720 S32 total = 0;
3721
3722 for (std::vector<LLFace*>::iterator iter = poolp->mReferences.begin();
3723 iter != poolp->mReferences.end(); iter++)
3724 {
3725 LLFace *face = *iter;
3726 F32 w = xs;
3727
3728 if (!face || !face->getDrawable())
3729 {
3730 w = 16 / 3000.0f;
3731
3732 stamp(x,y,w,h);
3733
3734 if (x+w > 0.95f)
3735 {
3736 x = (xs + xs2) * 4.0f;
3737 y += h + ys2;
3738 }
3739 else
3740 {
3741 if (w) x += w + xs2;
3742 }
3743
3744 continue;
3745 }
3746
3747 if (face->getDrawable()->isVisible())
3748 {
3749 if (face->isState(LLFace::BACKLIST))
3750 {
3751 glColor4f(1,0,1,1);
3752 }
3753 else if (total > poolp->getMaxVertices())
3754 {
3755 glColor4f(1,0,0,1);
3756 }
3757 else
3758 {
3759 glColor4f(0,1,0,1);
3760 total += face->getGeomCount();
3761 }
3762 }
3763 else
3764 {
3765 if (face->isState(LLFace::BACKLIST))
3766 {
3767 glColor4f(0,0,1,1);
3768 }
3769 else
3770 {
3771 glColor4f(1,1,0,1);
3772 }
3773 }
3774
3775 w = face->getGeomCount() / 3000.0f;
3776
3777 stamp(x,y,w,h);
3778
3779 if (x+w > 0.95f)
3780 {
3781 x = (xs + xs2) * 4.0f;
3782 y += h + ys2;
3783 }
3784 else
3785 {
3786 if (w) x += w + xs2;
3787 }
3788 }
3789
3790 y += ys + ys2;
3791 x = 0;
3792 }
3793
3794 glPopMatrix();
3795 glMatrixMode(GL_PROJECTION);
3796 glPopMatrix();
3797 glMatrixMode(GL_MODELVIEW);
3798}
3799
3800static F32 xs = 0.01f, ys = 0.01f;
3801static F32 xs2 = xs*0.1f, ys2 = ys * 0.1f;
3802static F32 winx, winy;
3803
3804void displayDrawable(F32 &x, F32 &y, LLDrawable *drawable, F32 alpha = 0.5f)
3805{
3806 F32 w = 0;
3807 F32 h = ys * 0.5f;
3808
3809 if (drawable && !drawable->isDead())
3810 {
3811 for (S32 f=0;f < drawable->getNumFaces(); f++)
3812 {
3813 w += drawable->getFace(f)->getGeomCount() / 30000.0f;
3814 }
3815 w+=xs;
3816 glColor4f(1,1,0, alpha);
3817 }
3818 else
3819 {
3820 w = 0.01f;
3821 glColor4f(0,0,0,alpha);
3822 }
3823
3824// const LLFontGL* font = gResMgr->getRes( LLFONT_SANSSERIF_SMALL );
3825
3826// U8 pcode = drawable->getVObj()->getPCode();
3827
3828 //char *string = (char*)LLPrimitive::pCodeToString(pcode);
3829 //if (pcode == 0x3e) string = "terrain";
3830 //else if (pcode == 0x2e) string = "cloud";
3831 //string[3] = 0;
3832
3833 stamp(x * winx,y * winy,w * winx,h * winy);
3834
3835 /*
3836 glColor4f(0,0,0,1);
3837 font->render(string,x*winx+1,y*winy+1);
3838 LLGLSNoTexture no_texture;
3839 */
3840
3841 if (x+w > 0.95f)
3842 {
3843 x = (xs + xs2) * 4.0f;
3844 y += h + ys2;
3845 }
3846 else
3847 {
3848 if (w) x += w + xs2;
3849 }
3850
3851}
3852
3853#if 0 // No longer up date
3854
3855void displayQueue(F32 &x, F32 &y, LLDynamicArray<LLDrawable*>& processed, LLDynamicQueuePtr<LLPointer<LLDrawable> >& remaining)
3856{
3857 S32 i;
3858 for (i=0;i<processed.count();i++)
3859 {
3860 displayDrawable(x,y,processed[i],1);
3861 }
3862
3863 x += xs * 2;
3864
3865 S32 count = remaining.count();
3866 for (i=0;i<count;i++)
3867 {
3868 LLDrawable* drawablep = remaining[(i + remaining.getFirst()) % remaining.getMax()];
3869 if (drawablep && !drawablep->isDead())
3870 {
3871 displayDrawable(x,y,drawable,0.5);
3872 }
3873 }
3874
3875 y += ys * 4;
3876 x = (xs + xs2) * 4.0f;
3877
3878}
3879
3880void LLPipeline::displayQueues()
3881{
3882 LLUI::setLineWidth(1.0);
3883 glMatrixMode(GL_PROJECTION);
3884 glPushMatrix();
3885 glLoadIdentity();
3886 glMatrixMode(GL_MODELVIEW);
3887 glPushMatrix();
3888 glLoadIdentity();
3889
3890 LLGLSPipelineAlpha gls_pipeline_alpha;
3891 LLGLSNoTexture no_texture;
3892 LLGLDepthTest gls_depth(GL_TRUE, GL_FALSE);
3893
3894 glScalef(2,2,1);
3895 glTranslatef(-0.5f,-0.5f,0);
3896
3897 winx = (F32)gViewerWindow->getWindowWidth();
3898 winy = (F32)gViewerWindow->getWindowHeight();
3899
3900 glScalef(1.0f/winx,1.0f/winy,1);
3901
3902 F32 x = (xs + xs2) * 4.0f;
3903 F32 y = 0.1f;
3904
3905 const LLFontGL* font = gResMgr->getRes( LLFONT_SANSSERIF );
3906
3907 font->renderUTF8("Build1", 0,0,(S32)(y*winy),LLColor4(1,1,1,1));
3908 displayQueue(x,y, gBuildProcessed, mBuildQ1);
3909
3910 glPopMatrix();
3911 glMatrixMode(GL_PROJECTION);
3912 glPopMatrix();
3913 glMatrixMode(GL_MODELVIEW);
3914
3915}
3916
3917#endif
3918
3919// static
3920void render_bbox(const LLVector3 &min, const LLVector3 &max)
3921{
3922 S32 i;
3923 LLVector3 verticesp[16];
3924
3925 verticesp[0].setVec(min.mV[0],min.mV[1],max.mV[2]);
3926 verticesp[1].setVec(min.mV[0],min.mV[1],min.mV[2]);
3927 verticesp[2].setVec(min.mV[0],max.mV[1],min.mV[2]);
3928 verticesp[3].setVec(min.mV[0],max.mV[1],max.mV[2]);
3929 verticesp[4].setVec(max.mV[0],max.mV[1],max.mV[2]);
3930 verticesp[5].setVec(max.mV[0],max.mV[1],min.mV[2]);
3931 verticesp[6].setVec(max.mV[0],min.mV[1],min.mV[2]);
3932 verticesp[7].setVec(max.mV[0],min.mV[1],max.mV[2]);
3933 verticesp[8 ] = verticesp[0];
3934 verticesp[9 ] = verticesp[1];
3935 verticesp[10] = verticesp[6];
3936 verticesp[11] = verticesp[7];
3937 verticesp[12] = verticesp[4];
3938 verticesp[13] = verticesp[5];
3939 verticesp[14] = verticesp[2];
3940 verticesp[15] = verticesp[3];
3941
3942 LLGLSNoTexture gls_no_texture;
3943 {
3944 LLUI::setLineWidth(1.f);
3945 glBegin(GL_LINE_LOOP);
3946 for (i = 0; i < 16; i++)
3947 {
3948 glVertex3fv(verticesp[i].mV);
3949 }
3950 glEnd();
3951 }
3952 {
3953 LLGLDepthTest gls_depth(GL_TRUE);
3954 LLUI::setLineWidth(3.0f);
3955 glBegin(GL_LINE_LOOP);
3956 for (i = 0; i < 16; i++)
3957 {
3958 glVertex3fv(verticesp[i].mV);
3959 }
3960 glEnd();
3961 }
3962 LLUI::setLineWidth(1.0f);
3963}
3964
3965//============================================================================ 3440//============================================================================
3966// Once-per-frame setup of hardware lights, 3441// Once-per-frame setup of hardware lights,
3967// including sun/moon, avatar backlight, and up to 6 local lights 3442// including sun/moon, avatar backlight, and up to 6 local lights
@@ -4173,8 +3648,6 @@ void LLPipeline::setupHWLights(LLDrawPool* pool)
4173{ 3648{
4174 const LLColor4 black(0,0,0,1); 3649 const LLColor4 black(0,0,0,1);
4175 3650
4176 setLightingDetail(-1); // update
4177
4178 // Ambient 3651 // Ambient
4179 LLColor4 ambient = gSky.getTotalAmbientColor(); 3652 LLColor4 ambient = gSky.getTotalAmbientColor();
4180 glLightModelfv(GL_LIGHT_MODEL_AMBIENT,ambient.mV); 3653 glLightModelfv(GL_LIGHT_MODEL_AMBIENT,ambient.mV);
@@ -4430,16 +3903,6 @@ class LLVOBranch;
4430class LLVOLeaf; 3903class LLVOLeaf;
4431class Foo; 3904class Foo;
4432 3905
4433template<> char* LLAGPArray<U8>::sTypeName = "U8 [AGP]";
4434template<> char* LLAGPArray<U32>::sTypeName = "U32 [AGP]";
4435template<> char* LLAGPArray<F32>::sTypeName = "F32 [AGP]";
4436template<> char* LLAGPArray<LLColor4>::sTypeName = "LLColor4 [AGP]";
4437template<> char* LLAGPArray<LLColor4U>::sTypeName = "LLColor4U [AGP]";
4438template<> char* LLAGPArray<LLVector4>::sTypeName = "LLVector4 [AGP]";
4439template<> char* LLAGPArray<LLVector3>::sTypeName = "LLVector3 [AGP]";
4440template<> char* LLAGPArray<LLVector2>::sTypeName = "LLVector2 [AGP]";
4441template<> char* LLAGPArray<LLFace*>::sTypeName = "LLFace* [AGP]";
4442
4443void scale_stamp(const F32 x, const F32 y, const F32 xs, const F32 ys) 3906void scale_stamp(const F32 x, const F32 y, const F32 xs, const F32 ys)
4444{ 3907{
4445 stamp(0.25f + 0.5f*x, 3908 stamp(0.25f + 0.5f*x,
@@ -4481,221 +3944,6 @@ void drawBars(const F32 begin, const F32 end, const F32 height = 1.f)
4481 } 3944 }
4482} 3945}
4483 3946
4484void LLPipeline::displayAGP()
4485{
4486 LLUI::setLineWidth(1.0);
4487 glMatrixMode(GL_PROJECTION);
4488 glPushMatrix();
4489 glLoadIdentity();
4490 glMatrixMode(GL_MODELVIEW);
4491 glPushMatrix();
4492 glLoadIdentity();
4493
4494 LLGLSPipelineAlpha gls_alpha;
4495 LLGLDepthTest gls_depth(GL_TRUE, GL_FALSE);
4496
4497 LLImageGL::unbindTexture(0, GL_TEXTURE_2D);
4498 glScalef(2,2,1);
4499 glTranslatef(-0.5f,-0.5f,0);
4500
4501 glColor4f(0,0,0,0.5f);
4502 scale_stamp(0,0,1,1);
4503
4504 F32 x = 0.0f, y = 0.05f;
4505 F32 xs = 0.015f, ys = 0.015f;
4506 F32 xs2 = xs*0.1f, ys2 = ys * 0.1f;
4507 F32 w = xs+xs2, h = ys + ys2;
4508 S32 i=0;
4509
4510 F32 agp_size = 1.f;
4511 if (mAGPMemPool)
4512 {
4513 agp_size = (F32)mAGPMemPool->getSize();
4514 }
4515
4516 x = (xs + xs2) * 4.0f;
4517
4518 static float c = 0.0f;
4519 c += 0.0001f;
4520
4521 LLAGPMemBlock *blockp = mBufferMemory[mBufferIndex]->getAGPMemBlock();
4522
4523 pool_set_t::iterator iter = mPools.begin();
4524 LLDrawPool *poolp = *iter;
4525
4526 // Dump the shared AGP buffer
4527 if (blockp)
4528 {
4529 F32 begin = blockp->getOffset()/agp_size;
4530 F32 end = begin + (blockp->getSize()/agp_size);
4531 F32 used = begin + (poolp->mMemory.count()/agp_size);
4532
4533 LLViewerImage::bindTexture(NULL);
4534 glColor4f(0.5f, 0.5f, 0.5f, 0.5f);
4535 drawBars(begin,end);
4536
4537 LLViewerImage::bindTexture(NULL);
4538 glColor4f(0.5f, 0.5f, 0.5f, 0.5f);
4539 drawBars(begin,end);
4540
4541 LLViewerImage::bindTexture(NULL);
4542 glColor4f(0.5f, 0.5f, 0.5f, 0.5f);
4543 drawBars(begin,used, 0.5f);
4544
4545 glColor4f(0.5f, 0.5f, 0.5f, 0.5f);
4546 drawBars(begin,end, 0.25f);
4547 }
4548
4549 S32 used_bytes = 0;
4550 S32 total_bytes = 0;
4551 while (iter != mPools.end())
4552 {
4553 poolp = *iter++;
4554
4555 BOOL synced = FALSE;
4556 i++;
4557 total_bytes += poolp->mMemory.getMax();
4558 used_bytes += poolp->mMemory.count();
4559 LLViewerImage *texturep = poolp->getDebugTexture();
4560
4561
4562 if (poolp->mMemory.mSynced)
4563 {
4564 poolp->mMemory.mSynced = FALSE;
4565 synced = TRUE;
4566 }
4567
4568 LLAGPMemBlock *blockp = poolp->mMemory.getAGPMemBlock();
4569 if (blockp)
4570 {
4571 F32 begin = blockp->getOffset()/agp_size;
4572 F32 end = begin + (blockp->getSize()/agp_size);
4573 F32 used = begin + (poolp->mMemory.count()/agp_size);
4574
4575 LLViewerImage::bindTexture(NULL);
4576 glColor4f(1.f, 0.5f, 0.5f, 0.5f);
4577 drawBars(begin,end);
4578
4579 LLViewerImage::bindTexture(texturep);
4580 glColor4f(1.f, 0.75f, 0.75f, 0.5f);
4581 drawBars(begin,end);
4582
4583 LLViewerImage::bindTexture(NULL);
4584 glColor4f(1.f, 0.75f, 0.75f, 1.f);
4585 drawBars(begin,used, 0.5f);
4586
4587 glColor3fv(poolp->getDebugColor().mV);
4588 drawBars(begin,end, 0.25f);
4589
4590 if (synced)
4591 {
4592 LLViewerImage::bindTexture(NULL);
4593 glColor4f(1.f, 1.f, 1.f, 0.4f);
4594 drawBars(begin,end);
4595 }
4596 }
4597
4598 synced = FALSE;
4599 if (poolp->mWeights.mSynced)
4600 {
4601 poolp->mWeights.mSynced = FALSE;
4602 synced = TRUE;
4603 }
4604 blockp = poolp->mWeights.getAGPMemBlock();
4605 if (blockp)
4606 {
4607 F32 begin = blockp->getOffset()/agp_size;
4608 F32 end = begin + (blockp->getSize()/agp_size);
4609 F32 used = begin + (poolp->mWeights.count()*sizeof(float)/agp_size);
4610
4611 LLViewerImage::bindTexture(NULL);
4612 glColor4f(0.0f, 0.f, 0.75f, 0.5f);
4613 drawBars(begin,end);
4614
4615 LLViewerImage::bindTexture(texturep);
4616 glColor4f(0.0, 0.f, 0.75f, 0.5f);
4617 drawBars(begin,end);
4618
4619 LLViewerImage::bindTexture(NULL);
4620 glColor4f(0.0, 0.f, 0.75f, 1.f);
4621 drawBars(begin,used, 0.5f);
4622
4623 LLViewerImage::bindTexture(NULL);
4624 glColor3fv(poolp->getDebugColor().mV);
4625 drawBars(begin,end, 0.25f);
4626
4627 if (synced)
4628 {
4629 LLViewerImage::bindTexture(NULL);
4630 glColor4f(1.f, 1.f, 1.f, 0.4f);
4631 drawBars(begin,end);
4632 }
4633 }
4634
4635 synced = FALSE;
4636 if (poolp->mClothingWeights.mSynced)
4637 {
4638 poolp->mClothingWeights.mSynced = FALSE;
4639 synced = TRUE;
4640 }
4641 blockp = poolp->mClothingWeights.getAGPMemBlock();
4642 if (blockp)
4643 {
4644 F32 begin = blockp->getOffset()/agp_size;
4645 F32 end = begin + (blockp->getSize()/agp_size);
4646 F32 used = begin + (poolp->mClothingWeights.count()*sizeof(LLVector4)/agp_size);
4647
4648 LLViewerImage::bindTexture(NULL);
4649 glColor4f(0.75f, 0.f, 0.75f, 0.5f);
4650 drawBars(begin,end);
4651
4652 LLViewerImage::bindTexture(texturep);
4653 glColor4f(0.75f, 0.f, 0.75f, 0.5f);
4654 drawBars(begin,end);
4655
4656 LLViewerImage::bindTexture(NULL);
4657 glColor4f(0.75f, 0.f, 0.75f, 0.5f);
4658 drawBars(begin,used, 0.5f);
4659
4660 LLViewerImage::bindTexture(NULL);
4661 glColor3fv(poolp->getDebugColor().mV);
4662 drawBars(begin,end, 0.25f);
4663
4664 if (synced)
4665 {
4666 LLViewerImage::bindTexture(NULL);
4667 glColor4f(1.f, 1.f, 1.f, 0.5f);
4668 drawBars(begin,end);
4669 }
4670 }
4671
4672 //
4673 // Stamps on bottom of screen
4674 //
4675 LLViewerImage::bindTexture(texturep);
4676 glColor4f(1.f, 1.f, 1.f, 1.f);
4677 stamp(x,y,xs,ys);
4678
4679 LLViewerImage::bindTexture(NULL);
4680 glColor3fv(poolp->getDebugColor().mV);
4681 stamp(x,y,xs, ys*0.25f);
4682 if (x+w > 0.95f)
4683 {
4684 x = (xs + xs2) * 4.0f;
4685 y += h;
4686 }
4687 else
4688 {
4689 x += w + xs2;
4690 }
4691 }
4692
4693 glPopMatrix();
4694 glMatrixMode(GL_PROJECTION);
4695 glPopMatrix();
4696 glMatrixMode(GL_MODELVIEW);
4697}
4698
4699void LLPipeline::findReferences(LLDrawable *drawablep) 3947void LLPipeline::findReferences(LLDrawable *drawablep)
4700{ 3948{
4701 if (std::find(mVisibleList.begin(), mVisibleList.end(), drawablep) != mVisibleList.end()) 3949 if (std::find(mVisibleList.begin(), mVisibleList.end(), drawablep) != mVisibleList.end())
@@ -4706,7 +3954,7 @@ void LLPipeline::findReferences(LLDrawable *drawablep)
4706 { 3954 {
4707 llinfos << "In mLights" << llendl; 3955 llinfos << "In mLights" << llendl;
4708 } 3956 }
4709 if (mMovedList.find(drawablep) != mMovedList.end()) 3957 if (std::find(mMovedList.begin(), mMovedList.end(), drawablep) != mMovedList.end())
4710 { 3958 {
4711 llinfos << "In mMovedList" << llendl; 3959 llinfos << "In mMovedList" << llendl;
4712 } 3960 }
@@ -4718,18 +3966,14 @@ void LLPipeline::findReferences(LLDrawable *drawablep)
4718 { 3966 {
4719 llinfos << "In mRetexturedList" << llendl; 3967 llinfos << "In mRetexturedList" << llendl;
4720 } 3968 }
4721 if (mRematerialedList.find(drawablep) != mRematerialedList.end()) 3969
4722 {
4723 llinfos << "In mRematerialedList" << llendl;
4724 }
4725
4726 if (mActiveQ.find(drawablep) != mActiveQ.end()) 3970 if (mActiveQ.find(drawablep) != mActiveQ.end())
4727 { 3971 {
4728 llinfos << "In mActiveQ" << llendl; 3972 llinfos << "In mActiveQ" << llendl;
4729 } 3973 }
4730 if (mBuildQ1.find(drawablep) != mBuildQ1.end()) 3974 if (std::find(mBuildQ1.begin(), mBuildQ1.end(), drawablep) != mBuildQ1.end())
4731 { 3975 {
4732 llinfos << "In mBuildQ2" << llendl; 3976 llinfos << "In mBuildQ1" << llendl;
4733 } 3977 }
4734 if (std::find(mBuildQ2.begin(), mBuildQ2.end(), drawablep) != mBuildQ2.end()) 3978 if (std::find(mBuildQ2.begin(), mBuildQ2.end(), drawablep) != mBuildQ2.end())
4735 { 3979 {
@@ -4737,19 +3981,7 @@ void LLPipeline::findReferences(LLDrawable *drawablep)
4737 } 3981 }
4738 3982
4739 S32 count; 3983 S32 count;
4740 /* 3984
4741 count = mStaticTree->count(drawablep);
4742 if (count)
4743 {
4744 llinfos << "In mStaticTree: " << count << " references" << llendl;
4745 }
4746
4747 count = mDynamicTree->count(drawablep);
4748 if (count)
4749 {
4750 llinfos << "In mStaticTree: " << count << " references" << llendl;
4751 }
4752 */
4753 count = gObjectList.findReferences(drawablep); 3985 count = gObjectList.findReferences(drawablep);
4754 if (count) 3986 if (count)
4755 { 3987 {
@@ -4776,53 +4008,6 @@ BOOL LLPipeline::verify()
4776 return ok; 4008 return ok;
4777} 4009}
4778 4010
4779S32 LLPipeline::getAGPMemUsage()
4780{
4781 if (mAGPMemPool)
4782 {
4783 return mAGPMemPool->getSize();
4784 }
4785 else
4786 {
4787 return 0;
4788 }
4789}
4790
4791S32 LLPipeline::getMemUsage(const BOOL print)
4792{
4793 S32 mem_usage = 0;
4794
4795 if (mAGPMemPool)
4796 {
4797 S32 agp_usage = 0;
4798 agp_usage = mAGPMemPool->getSize();
4799 if (print)
4800 {
4801 llinfos << "AGP Mem: " << agp_usage << llendl;
4802 llinfos << "AGP Mem used: " << mAGPMemPool->getTotalAllocated() << llendl;
4803 }
4804 mem_usage += agp_usage;
4805 }
4806
4807
4808 S32 pool_usage = 0;
4809 for (pool_set_t::iterator iter = mPools.begin(); iter != mPools.end(); ++iter)
4810 {
4811 LLDrawPool *poolp = *iter;
4812 pool_usage += poolp->getMemUsage(print);
4813 }
4814
4815 if (print)
4816 {
4817 llinfos << "Pool Mem: " << pool_usage << llendl;
4818 }
4819
4820 mem_usage += pool_usage;
4821
4822 return mem_usage;
4823
4824}
4825
4826////////////////////////////// 4011//////////////////////////////
4827// 4012//
4828// Collision detection 4013// Collision detection
@@ -4933,8 +4118,8 @@ void LLPipeline::setLight(LLDrawable *drawablep, BOOL is_light)
4933 } 4118 }
4934 else 4119 else
4935 { 4120 {
4936 mLights.erase(drawablep);
4937 drawablep->clearState(LLDrawable::LIGHT); 4121 drawablep->clearState(LLDrawable::LIGHT);
4122 mLights.erase(drawablep);
4938 } 4123 }
4939 markRelight(drawablep); 4124 markRelight(drawablep);
4940 } 4125 }
@@ -4953,9 +4138,16 @@ void LLPipeline::setActive(LLDrawable *drawablep, BOOL active)
4953} 4138}
4954 4139
4955//static 4140//static
4956void LLPipeline::toggleRenderType(void* data) 4141void LLPipeline::toggleRenderType(U32 type)
4957{ 4142{
4958 S32 type = (S32)(intptr_t)data; 4143 U32 bit = (1<<type);
4144 gPipeline.mRenderTypeMask ^= bit;
4145}
4146
4147//static
4148void LLPipeline::toggleRenderTypeControl(void* data)
4149{
4150 U32 type = (U32)(intptr_t)data;
4959 U32 bit = (1<<type); 4151 U32 bit = (1<<type);
4960 if (gPipeline.hasRenderType(type)) 4152 if (gPipeline.hasRenderType(type))
4961 { 4153 {
@@ -4965,13 +4157,13 @@ void LLPipeline::toggleRenderType(void* data)
4965 { 4157 {
4966 llinfos << "Toggling render type mask " << std::hex << bit << " on" << std::dec << llendl; 4158 llinfos << "Toggling render type mask " << std::hex << bit << " on" << std::dec << llendl;
4967 } 4159 }
4968 gPipeline.mRenderTypeMask ^= bit; 4160 gPipeline.toggleRenderType(type);
4969} 4161}
4970 4162
4971//static 4163//static
4972BOOL LLPipeline::toggleRenderTypeControl(void* data) 4164BOOL LLPipeline::hasRenderTypeControl(void* data)
4973{ 4165{
4974 S32 type = (S32)(intptr_t)data; 4166 U32 type = (U32)(intptr_t)data;
4975 return gPipeline.hasRenderType(type); 4167 return gPipeline.hasRenderType(type);
4976} 4168}
4977 4169
@@ -5010,14 +4202,6 @@ BOOL LLPipeline::toggleRenderDebugControl(void* data)
5010void LLPipeline::toggleRenderDebugFeature(void* data) 4202void LLPipeline::toggleRenderDebugFeature(void* data)
5011{ 4203{
5012 U32 bit = (U32)(intptr_t)data; 4204 U32 bit = (U32)(intptr_t)data;
5013 if (gPipeline.hasRenderDebugFeatureMask(bit))
5014 {
5015 llinfos << "Toggling render debug feature mask " << std::hex << bit << " off" << std::dec << llendl;
5016 }
5017 else
5018 {
5019 llinfos << "Toggling render debug feature mask " << std::hex << bit << " on" << std::dec << llendl;
5020 }
5021 gPipeline.mRenderDebugFeatureMask ^= bit; 4205 gPipeline.mRenderDebugFeatureMask ^= bit;
5022} 4206}
5023 4207
@@ -5185,7 +4369,7 @@ void LLGLSLShader::mapUniform(GLint index, const char** uniform_names, S32 count
5185 GLenum type; 4369 GLenum type;
5186 GLsizei length; 4370 GLsizei length;
5187 GLint size; 4371 GLint size;
5188 char name[1024]; 4372 char name[1024]; /* Flawfinder: ignore */
5189 name[0] = 0; 4373 name[0] = 0;
5190 4374
5191 glGetActiveUniformARB(mProgramObject, index, 1024, &length, &size, &type, name); 4375 glGetActiveUniformARB(mProgramObject, index, 1024, &length, &size, &type, name);
@@ -5193,7 +4377,7 @@ void LLGLSLShader::mapUniform(GLint index, const char** uniform_names, S32 count
5193 //find the index of this uniform 4377 //find the index of this uniform
5194 for (S32 i = 0; i < (S32) LLPipeline::sReservedUniformCount; i++) 4378 for (S32 i = 0; i < (S32) LLPipeline::sReservedUniformCount; i++)
5195 { 4379 {
5196 if (mUniform[i] == -1 && !strncmp(LLPipeline::sReservedUniforms[i],name, strlen(LLPipeline::sReservedUniforms[i]))) 4380 if (mUniform[i] == -1 && !strncmp(LLPipeline::sReservedUniforms[i],name, strlen(LLPipeline::sReservedUniforms[i]))) /* Flawfinder: ignore */
5197 { 4381 {
5198 //found it 4382 //found it
5199 S32 location = glGetUniformLocationARB(mProgramObject, name); 4383 S32 location = glGetUniformLocationARB(mProgramObject, name);
@@ -5207,7 +4391,7 @@ void LLGLSLShader::mapUniform(GLint index, const char** uniform_names, S32 count
5207 for (S32 i = 0; i < count; i++) 4391 for (S32 i = 0; i < count; i++)
5208 { 4392 {
5209 if (mUniform[i+LLPipeline::sReservedUniformCount] == -1 && 4393 if (mUniform[i+LLPipeline::sReservedUniformCount] == -1 &&
5210 !strncmp(uniform_names[i],name, strlen(uniform_names[i]))) 4394 !strncmp(uniform_names[i],name, strlen(uniform_names[i]))) /* Flawfinder: ignore */
5211 { 4395 {
5212 //found it 4396 //found it
5213 S32 location = glGetUniformLocationARB(mProgramObject, name); 4397 S32 location = glGetUniformLocationARB(mProgramObject, name);
@@ -5330,8 +4514,365 @@ void LLGLSLShader::vertexAttrib4fv(U32 index, GLfloat* v)
5330 4514
5331LLViewerObject* LLPipeline::pickObject(const LLVector3 &start, const LLVector3 &end, LLVector3 &collision) 4515LLViewerObject* LLPipeline::pickObject(const LLVector3 &start, const LLVector3 &end, LLVector3 &collision)
5332{ 4516{
5333 LLDrawable* drawable = mObjectPartition->pickDrawable(start, end, collision); 4517 LLDrawable* drawable = mObjectPartition[PARTITION_VOLUME]->pickDrawable(start, end, collision);
5334 return drawable ? drawable->getVObj() : NULL; 4518 return drawable ? drawable->getVObj() : NULL;
5335} 4519}
5336 4520
4521LLSpatialPartition* LLPipeline::getSpatialPartition(LLViewerObject* vobj)
4522{
4523 if (vobj)
4524 {
4525 return getSpatialPartition(vobj->getPartitionType());
4526 }
4527 return NULL;
4528}
4529
4530LLSpatialPartition* LLPipeline::getSpatialPartition(U32 type)
4531{
4532 if (type < mObjectPartition.size())
4533 {
4534 return mObjectPartition[type];
4535 }
4536 return NULL;
4537}
4538
4539void LLPipeline::clearRenderMap()
4540{
4541 for (U32 i = 0; i < LLRenderPass::NUM_RENDER_TYPES; i++)
4542 {
4543 mRenderMap[i].clear();
4544 }
4545}
4546
4547
4548void LLPipeline::resetVertexBuffers(LLDrawable* drawable)
4549{
4550 for (S32 i = 0; i < drawable->getNumFaces(); i++)
4551 {
4552 LLFace* facep = drawable->getFace(i);
4553 facep->mVertexBuffer = NULL;
4554 facep->mLastVertexBuffer = NULL;
4555 }
4556}
4557
4558void LLPipeline::resetVertexBuffers()
4559{
4560 for (U32 i = 0; i < mObjectPartition.size(); ++i)
4561 {
4562 if (mObjectPartition[i])
4563 {
4564 mObjectPartition[i]->resetVertexBuffers();
4565 }
4566 }
4567
4568 resetDrawOrders();
4569
4570 if (gSky.mVOSkyp.notNull())
4571 {
4572 resetVertexBuffers(gSky.mVOSkyp->mDrawable);
4573 resetVertexBuffers(gSky.mVOGroundp->mDrawable);
4574 resetVertexBuffers(gSky.mVOStarsp->mDrawable);
4575 markRebuild(gSky.mVOSkyp->mDrawable, LLDrawable::REBUILD_ALL, TRUE);
4576 markRebuild(gSky.mVOGroundp->mDrawable, LLDrawable::REBUILD_ALL, TRUE);
4577 markRebuild(gSky.mVOStarsp->mDrawable, LLDrawable::REBUILD_ALL, TRUE);
4578 }
4579
4580 if (LLVertexBuffer::sGLCount > 0)
4581 {
4582 LLVertexBuffer::cleanupClass();
4583 }
4584}
4585
4586void LLPipeline::renderObjects(U32 type, U32 mask, BOOL texture)
4587{
4588 mSimplePool->renderStatic(type, mask, texture);
4589 mSimplePool->renderActive(type, mask, texture);
4590}
4591
4592void LLPipeline::setUseVBO(BOOL use_vbo)
4593{
4594 if (use_vbo != LLVertexBuffer::sEnableVBOs)
4595 {
4596 if (use_vbo)
4597 {
4598 llinfos << "Enabling VBO." << llendl;
4599 }
4600 else
4601 {
4602 llinfos << "Disabling VBO." << llendl;
4603 }
4604
4605 resetVertexBuffers();
4606 LLVertexBuffer::initClass(use_vbo);
4607 }
4608}
4609
4610void apply_cube_face_rotation(U32 face)
4611{
4612 switch (face)
4613 {
4614 case 0:
4615 glRotatef(90.f, 0, 1, 0);
4616 glRotatef(180.f, 1, 0, 0);
4617 break;
4618 case 2:
4619 glRotatef(-90.f, 1, 0, 0);
4620 break;
4621 case 4:
4622 glRotatef(180.f, 0, 1, 0);
4623 glRotatef(180.f, 0, 0, 1);
4624 break;
4625 case 1:
4626 glRotatef(-90.f, 0, 1, 0);
4627 glRotatef(180.f, 1, 0, 0);
4628 break;
4629 case 3:
4630 glRotatef(90, 1, 0, 0);
4631 break;
4632 case 5:
4633 glRotatef(180, 0, 0, 1);
4634 break;
4635 }
4636}
4637void LLPipeline::generateReflectionMap(LLCubeMap* cube_map, LLCamera& cube_cam, GLsizei res)
4638{
4639 //render dynamic cube map
4640 U32 type_mask = gPipeline.getRenderTypeMask();
4641 BOOL use_occlusion = LLPipeline::sUseOcclusion;
4642 LLPipeline::sUseOcclusion = FALSE;
4643 LLPipeline::sSkipUpdate = TRUE;
4644 static GLuint blur_tex = 0;
4645 if (!blur_tex)
4646 {
4647 glGenTextures(1, &blur_tex);
4648 }
4649
4650 BOOL toggle_ui = gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_UI);
4651 if (toggle_ui)
4652 {
4653 gPipeline.toggleRenderDebugFeature((void*) LLPipeline::RENDER_DEBUG_FEATURE_UI);
4654 }
4655
4656 U32 cube_mask = (1 << LLPipeline::RENDER_TYPE_SIMPLE) |
4657 (1 << LLPipeline::RENDER_TYPE_WATER) |
4658 (1 << LLPipeline::RENDER_TYPE_BUMP) |
4659 (1 << LLPipeline::RENDER_TYPE_ALPHA) |
4660 (1 << LLPipeline::RENDER_TYPE_TREE) |
4661 (1 << LLDrawPool::POOL_ALPHA_POST_WATER) |
4662 //(1 << LLPipeline::RENDER_TYPE_PARTICLES) |
4663 (1 << LLPipeline::RENDER_TYPE_CLOUDS) |
4664 //(1 << LLPipeline::RENDER_TYPE_STARS) |
4665 //(1 << LLPipeline::RENDER_TYPE_AVATAR) |
4666 (1 << LLPipeline::RENDER_TYPE_GRASS) |
4667 (1 << LLPipeline::RENDER_TYPE_VOLUME) |
4668 (1 << LLPipeline::RENDER_TYPE_TERRAIN) |
4669 (1 << LLPipeline::RENDER_TYPE_SKY) |
4670 (1 << LLPipeline::RENDER_TYPE_GROUND);
4671
4672 LLDrawPoolWater::sSkipScreenCopy = TRUE;
4673 cube_mask = cube_mask & type_mask;
4674 gPipeline.setRenderTypeMask(cube_mask);
4675
4676 glMatrixMode(GL_PROJECTION);
4677 glPushMatrix();
4678 glMatrixMode(GL_MODELVIEW);
4679 glPushMatrix();
4680
4681 glViewport(0,0,res,res);
4682
4683 glClearColor(0,0,0,0);
4684
4685 U32 cube_face[] =
4686 {
4687 GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB,
4688 GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB,
4689 GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB,
4690 GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB,
4691 GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB,
4692 GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB,
4693 };
4694
4695 LLVector3 origin = cube_cam.getOrigin();
4696
4697 gPipeline.calcNearbyLights();
4698
4699 for (S32 i = 0; i < 6; i++)
4700 {
4701
4702 glMatrixMode(GL_PROJECTION);
4703 glLoadIdentity();
4704 gluPerspective(90.f, 1.f, 0.1f, 1024.f);
4705 glMatrixMode(GL_MODELVIEW);
4706 glLoadIdentity();
4707
4708 apply_cube_face_rotation(i);
4709
4710
4711 glTranslatef(-origin.mV[0], -origin.mV[1], -origin.mV[2]);
4712 cube_cam.setOrigin(origin);
4713 LLViewerCamera::updateFrustumPlanes(cube_cam);
4714 cube_cam.setOrigin(gCamera->getOrigin());
4715 gPipeline.updateCull(cube_cam);
4716 gPipeline.stateSort(cube_cam);
4717
4718 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
4719 gPipeline.renderGeom(cube_cam);
4720
4721 cube_map->enable(0);
4722 cube_map->bind();
4723 glCopyTexImage2D(cube_face[i], 0, GL_RGB, 0, 0, res, res, 0);
4724 cube_map->disable();
4725 }
4726
4727 cube_cam.setOrigin(origin);
4728 gPipeline.resetDrawOrders();
4729 gPipeline.mShinyOrigin.setVec(cube_cam.getOrigin(), cube_cam.getFar()*2.f);
4730 glMatrixMode(GL_PROJECTION);
4731 glPopMatrix();
4732 glMatrixMode(GL_MODELVIEW);
4733 glPopMatrix();
4734
4735 gPipeline.setRenderTypeMask(type_mask);
4736 LLPipeline::sUseOcclusion = use_occlusion;
4737 LLPipeline::sSkipUpdate = FALSE;
4738
4739 if (toggle_ui)
4740 {
4741 gPipeline.toggleRenderDebugFeature((void*)LLPipeline::RENDER_DEBUG_FEATURE_UI);
4742 }
4743 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
4744 LLDrawPoolWater::sSkipScreenCopy = FALSE;
4745}
4746
4747//send cube map vertices and texture coordinates
4748void render_cube_map()
4749{
4750
4751 U32 idx[36];
4752
4753 idx[0] = 1; idx[1] = 0; idx[2] = 2; //front
4754 idx[3] = 3; idx[4] = 2; idx[5] = 0;
4755
4756 idx[6] = 4; idx[7] = 5; idx[8] = 1; //top
4757 idx[9] = 0; idx[10] = 1; idx[11] = 5;
4758
4759 idx[12] = 5; idx[13] = 4; idx[14] = 6; //back
4760 idx[15] = 7; idx[16] = 6; idx[17] = 4;
4761
4762 idx[18] = 6; idx[19] = 7; idx[20] = 3; //bottom
4763 idx[21] = 2; idx[22] = 3; idx[23] = 7;
4764
4765 idx[24] = 0; idx[25] = 5; idx[26] = 3; //left
4766 idx[27] = 6; idx[28] = 3; idx[29] = 5;
4767
4768 idx[30] = 4; idx[31] = 1; idx[32] = 7; //right
4769 idx[33] = 2; idx[34] = 7; idx[35] = 1;
4770
4771 LLVector3 vert[8];
4772 LLVector3 r = LLVector3(1,1,1);
4773
4774 vert[0] = r.scaledVec(LLVector3(-1,1,1)); // 0 - left top front
4775 vert[1] = r.scaledVec(LLVector3(1,1,1)); // 1 - right top front
4776 vert[2] = r.scaledVec(LLVector3(1,-1,1)); // 2 - right bottom front
4777 vert[3] = r.scaledVec(LLVector3(-1,-1,1)); // 3 - left bottom front
4778
4779 vert[4] = r.scaledVec(LLVector3(1,1,-1)); // 4 - left top back
4780 vert[5] = r.scaledVec(LLVector3(-1,1,-1)); // 5 - right top back
4781 vert[6] = r.scaledVec(LLVector3(-1,-1,-1)); // 6 - right bottom back
4782 vert[7] = r.scaledVec(LLVector3(1,-1,-1)); // 7 -left bottom back
4783
4784 glBegin(GL_TRIANGLES);
4785 for (U32 i = 0; i < 36; i++)
4786 {
4787 glTexCoord3fv(vert[idx[i]].mV);
4788 glVertex3fv(vert[idx[i]].mV);
4789 }
4790 glEnd();
4791}
4792
4793void LLPipeline::blurReflectionMap(LLCubeMap* cube_in, LLCubeMap* cube_out, U32 res)
4794{
4795 LLGLEnable cube(GL_TEXTURE_CUBE_MAP_ARB);
4796 LLGLDepthTest depth(GL_FALSE);
4797
4798 glMatrixMode(GL_PROJECTION);
4799 glPushMatrix();
4800 glLoadIdentity();
4801 gluPerspective(90.f+45.f/res, 1.f, 0.1f, 1024.f);
4802 glMatrixMode(GL_MODELVIEW);
4803 glPushMatrix();
4804
4805 glViewport(0, 0, res, res);
4806 LLGLEnable blend(GL_BLEND);
4807
4808 S32 kernel = 2;
4809 F32 step = 90.f/res;
4810 F32 alpha = 1.f/((kernel*2+1));
4811
4812 glColor4f(1,1,1,alpha);
4813
4814 S32 x = 0;
4815
4816 U32 cube_face[] =
4817 {
4818 GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB,
4819 GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB,
4820 GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB,
4821 GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB,
4822 GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB,
4823 GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB,
4824 };
4825
4826 LLVector3 axis[] =
4827 {
4828 LLVector3(1,0,0),
4829 LLVector3(0,1,0),
4830 LLVector3(0,0,1)
4831 };
4832
4833
4834 glBlendFunc(GL_SRC_ALPHA_SATURATE, GL_ONE);
4835 //3-axis blur
4836 for (U32 j = 0; j < 3; j++)
4837 {
4838 glViewport(0,0,res, res*6);
4839 glClear(GL_COLOR_BUFFER_BIT);
4840 if (j == 0)
4841 {
4842 cube_in->bind();
4843 }
4844
4845 for (U32 i = 0; i < 6; i++)
4846 {
4847 glViewport(0,i*res, res, res);
4848 glLoadIdentity();
4849 apply_cube_face_rotation(i);
4850 for (x = -kernel; x <= kernel; ++x)
4851 {
4852 glPushMatrix();
4853 glRotatef(x*step, axis[j].mV[0], axis[j].mV[1], axis[j].mV[2]);
4854 render_cube_map();
4855 glPopMatrix();
4856 }
4857 }
4858
4859 //readback
4860 if (j == 0)
4861 {
4862 cube_out->bind();
4863 }
4864 for (U32 i = 0; i < 6; i++)
4865 {
4866 glCopyTexImage2D(cube_face[i], 0, GL_RGB, 0, i*res, res, res, 0);
4867 }
4868 }
5337 4869
4870 glMatrixMode(GL_PROJECTION);
4871 glPopMatrix();
4872 glMatrixMode(GL_MODELVIEW);
4873 glPopMatrix();
4874
4875 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
4876}
4877
4878
diff --git a/linden/indra/newview/pipeline.h b/linden/indra/newview/pipeline.h
index 5d00959..158c420 100644
--- a/linden/indra/newview/pipeline.h
+++ b/linden/indra/newview/pipeline.h
@@ -28,7 +28,6 @@
28#ifndef LL_PIPELINE_H 28#ifndef LL_PIPELINE_H
29#define LL_PIPELINE_H 29#define LL_PIPELINE_H
30 30
31#include "llagparray.h"
32#include "lldarrayptr.h" 31#include "lldarrayptr.h"
33#include "lldqueueptr.h" 32#include "lldqueueptr.h"
34#include "llstat.h" 33#include "llstat.h"
@@ -50,8 +49,7 @@ class LLAgent;
50class LLDisplayPrimitive; 49class LLDisplayPrimitive;
51class LLTextureEntry; 50class LLTextureEntry;
52class LLRenderFunc; 51class LLRenderFunc;
53class LLAGPMemPool; 52class LLCubeMap;
54class LLAGPMemBlock;
55 53
56typedef enum e_avatar_skinning_method 54typedef enum e_avatar_skinning_method
57{ 55{
@@ -62,6 +60,7 @@ typedef enum e_avatar_skinning_method
62BOOL compute_min_max(LLMatrix4& box, LLVector2& min, LLVector2& max); // Shouldn't be defined here! 60BOOL compute_min_max(LLMatrix4& box, LLVector2& min, LLVector2& max); // Shouldn't be defined here!
63bool LLRayAABB(const LLVector3 &center, const LLVector3 &size, const LLVector3& origin, const LLVector3& dir, LLVector3 &coord, F32 epsilon = 0); 61bool LLRayAABB(const LLVector3 &center, const LLVector3 &size, const LLVector3& origin, const LLVector3& dir, LLVector3 &coord, F32 epsilon = 0);
64BOOL LLLineSegmentAABB(const LLVector3& start, const LLVector3& end, const LLVector3& center, const LLVector3& size); 62BOOL LLLineSegmentAABB(const LLVector3& start, const LLVector3& end, const LLVector3& center, const LLVector3& size);
63BOOL setup_hud_matrices(BOOL for_select);
65 64
66class LLGLSLShader 65class LLGLSLShader
67{ 66{
@@ -91,7 +90,6 @@ public:
91 void bind(); 90 void bind();
92 void unbind(); 91 void unbind();
93 92
94
95 GLhandleARB mProgramObject; 93 GLhandleARB mProgramObject;
96 std::vector<GLint> mAttribute; 94 std::vector<GLint> mAttribute;
97 std::vector<GLint> mUniform; 95 std::vector<GLint> mUniform;
@@ -107,6 +105,11 @@ public:
107 105
108 void destroyGL(); 106 void destroyGL();
109 void restoreGL(); 107 void restoreGL();
108 void resetVertexBuffers();
109 void resetVertexBuffers(LLDrawable* drawable);
110 void setUseVBO(BOOL use_vbo);
111 void generateReflectionMap(LLCubeMap* cube_map, LLCamera& camera, GLsizei res);
112 void blurReflectionMap(LLCubeMap* cube_in, LLCubeMap* cube_out, U32 res);
110 113
111 void init(); 114 void init();
112 void cleanup(); 115 void cleanup();
@@ -121,6 +124,7 @@ public:
121 124
122 /// @brief Figures out draw pool type from texture entry. Creates pool if necessary. 125 /// @brief Figures out draw pool type from texture entry. Creates pool if necessary.
123 static LLDrawPool* getPoolFromTE(const LLTextureEntry* te, LLViewerImage* te_image); 126 static LLDrawPool* getPoolFromTE(const LLTextureEntry* te, LLViewerImage* te_image);
127 static U32 getPoolTypeFromTE(const LLTextureEntry* te, LLViewerImage* imagep);
124 128
125 void addPool(LLDrawPool *poolp); // Only to be used by LLDrawPool classes for splitting pools! 129 void addPool(LLDrawPool *poolp); // Only to be used by LLDrawPool classes for splitting pools!
126 void removePool( LLDrawPool* poolp ); 130 void removePool( LLDrawPool* poolp );
@@ -130,28 +134,25 @@ public:
130 void unlinkDrawable(LLDrawable*); 134 void unlinkDrawable(LLDrawable*);
131 135
132 // Object related methods 136 // Object related methods
133 void markVisible(LLDrawable *drawablep); 137 void markVisible(LLDrawable *drawablep, LLCamera& camera);
134 void doOcclusion(); 138 void doOcclusion(LLCamera& camera);
135 void markNotCulled(LLDrawable* drawablep, LLCamera& camera); 139 void markNotCulled(LLSpatialGroup* group, LLCamera &camera, BOOL active = FALSE);
136 void markMoved(LLDrawable *drawablep, BOOL damped_motion = FALSE); 140 void markMoved(LLDrawable *drawablep, BOOL damped_motion = FALSE);
137 void markShift(LLDrawable *drawablep); 141 void markShift(LLDrawable *drawablep);
138 void markTextured(LLDrawable *drawablep); 142 void markTextured(LLDrawable *drawablep);
139 void markMaterialed(LLDrawable *drawablep);
140 void markRebuild(LLDrawable *drawablep, LLDrawable::EDrawableFlags flag = LLDrawable::REBUILD_ALL, BOOL priority = FALSE); 143 void markRebuild(LLDrawable *drawablep, LLDrawable::EDrawableFlags flag = LLDrawable::REBUILD_ALL, BOOL priority = FALSE);
141 void markRelight(LLDrawable *drawablep, const BOOL now = FALSE); 144 void markRelight(LLDrawable *drawablep, const BOOL now = FALSE);
142 145
143 //get the object between start and end that's closest to start. Return the point of collision in collision. 146 //get the object between start and end that's closest to start. Return the point of collision in collision.
144 LLViewerObject* pickObject(const LLVector3 &start, const LLVector3 &end, LLVector3 &collision); 147 LLViewerObject* pickObject(const LLVector3 &start, const LLVector3 &end, LLVector3 &collision);
145 148
146 void dirtyPoolObjectTextures(const LLViewerImage *texture); // Something about this texture has changed. Dirty it. 149 // Something about these textures has changed. Dirty them.
150 void dirtyPoolObjectTextures(const std::set<LLViewerImage*>& textures);
147 151
148 void resetDrawOrders(); 152 void resetDrawOrders();
149 153
150 U32 addObject(LLViewerObject *obj); 154 U32 addObject(LLViewerObject *obj);
151 155
152 BOOL usingAGP() const;
153 void setUseAGP(const BOOL use_agp); // Attempt to use AGP;
154
155 void enableShadows(const BOOL enable_shadows); 156 void enableShadows(const BOOL enable_shadows);
156 157
157// void setLocalLighting(const BOOL local_lighting); 158// void setLocalLighting(const BOOL local_lighting);
@@ -174,61 +175,42 @@ public:
174 BOOL validateProgramObject(GLhandleARB obj); 175 BOOL validateProgramObject(GLhandleARB obj);
175 GLhandleARB loadShader(const LLString& filename, S32 cls, GLenum type); 176 GLhandleARB loadShader(const LLString& filename, S32 cls, GLenum type);
176 177
177 void setUseOcclusionCulling(BOOL b) { mUseOcclusionCulling = b; }
178 BOOL getUseOcclusionCulling() const { return mUseOcclusionCulling; }
179
180 BOOL initAGP();
181 void cleanupAGP();
182 LLAGPMemBlock *allocAGPFromPool(const S32 bytes, const U32 target); // Static flag is ignored for now.
183 void flushAGPMemory(); // Clear all AGP memory blocks (to pack & reduce fragmentation)
184
185 // phases 178 // phases
186 void resetFrameStats(); 179 void resetFrameStats();
187 180
188 void updateMoveDampedAsync(LLDrawable* drawablep); 181 void updateMoveDampedAsync(LLDrawable* drawablep);
189 void updateMoveNormalAsync(LLDrawable* drawablep); 182 void updateMoveNormalAsync(LLDrawable* drawablep);
183 void updateMovedList(LLDrawable::drawable_vector_t& move_list);
190 void updateMove(); 184 void updateMove();
191 void updateCull(); 185 void updateCull(LLCamera& camera);
192 void updateGeom(F32 max_dtime); 186 void updateGeom(F32 max_dtime);
193 187
194 void stateSort(); 188 //calculate pixel area of given box from vantage point of given camera
189 static F32 calcPixelArea(LLVector3 center, LLVector3 size, LLCamera& camera);
195 190
196 void renderGeom(); 191 void stateSort(LLCamera& camera);
192 void stateSort(LLSpatialGroup* group, LLCamera& camera);
193 void stateSort(LLSpatialBridge* bridge, LLCamera& camera);
194 void stateSort(LLDrawable* drawablep, LLCamera& camera);
195 void postSort(LLCamera& camera);
196 void forAllDrawables(LLSpatialGroup::sg_vector_t& groups, void (*func)(LLDrawable*));
197 void forAllVisibleDrawables(void (*func)(LLDrawable*));
198 static void highlightPhysical(LLDrawable* drawablep);
199
200 void renderObjects(U32 type, U32 mask, BOOL texture = TRUE);
201
202 void renderGeom(LLCamera& camera);
197 void renderHighlights(); 203 void renderHighlights();
198 void renderDebug(); 204 void renderDebug();
205 void processOcclusion(LLCamera& camera);
199 206
200 void renderForSelect(); 207 void renderForSelect(std::set<LLViewerObject*>& objects);
201 void renderFaceForUVSelect(LLFace* facep); 208 void renderFaceForUVSelect(LLFace* facep);
202 void rebuildPools(); // Rebuild pools 209 void rebuildPools(); // Rebuild pools
203 210
204 // bindAGP and unbindAGP are used to bind AGP memory.
205 // AGP should never be bound if you're writing/copying data to AGP.
206 // bindAGP will do the correct thing if AGP rendering has been disabled globally.
207 void bindAGP();
208 void unbindAGP();
209 inline BOOL isAGPBound() const { return mAGPBound; }
210
211 void setupVisibility();
212 void computeVisibility();
213
214 LLViewerObject *nearestObjectAt(F32 yaw, F32 pitch); // CCW yaw from +X = 0 radians, pitch down from +Y = 0 radians, NULL if no object
215
216 void displayPools();
217 void displayAGP();
218 void displayMap();
219 void displaySSBB();
220 void displayQueues();
221 void printPools();
222
223 void findReferences(LLDrawable *drawablep); // Find the lists which have references to this object 211 void findReferences(LLDrawable *drawablep); // Find the lists which have references to this object
224 BOOL verify(); // Verify that all data in the pipeline is "correct" 212 BOOL verify(); // Verify that all data in the pipeline is "correct"
225 213
226 // just the AGP part
227 S32 getAGPMemUsage();
228
229 // all pools
230 S32 getMemUsage(const BOOL print = FALSE);
231
232 S32 getVisibleCount() const { return mVisibleList.size(); } 214 S32 getVisibleCount() const { return mVisibleList.size(); }
233 S32 getLightCount() const { return mLights.size(); } 215 S32 getLightCount() const { return mLights.size(); }
234 216
@@ -253,18 +235,15 @@ public:
253 BOOL hasRenderDebugFeatureMask(const U32 mask) const { return (mRenderDebugFeatureMask & mask) ? TRUE : FALSE; } 235 BOOL hasRenderDebugFeatureMask(const U32 mask) const { return (mRenderDebugFeatureMask & mask) ? TRUE : FALSE; }
254 BOOL hasRenderFeatureMask(const U32 mask) const { return (mRenderFeatureMask & mask) ? TRUE : FALSE; } 236 BOOL hasRenderFeatureMask(const U32 mask) const { return (mRenderFeatureMask & mask) ? TRUE : FALSE; }
255 BOOL hasRenderDebugMask(const U32 mask) const { return (mRenderDebugMask & mask) ? TRUE : FALSE; } 237 BOOL hasRenderDebugMask(const U32 mask) const { return (mRenderDebugMask & mask) ? TRUE : FALSE; }
256 238 void setRenderTypeMask(const U32 mask) { mRenderTypeMask = mask; }
257 // Vertex buffer stuff? 239 U32 getRenderTypeMask() const { return mRenderTypeMask; }
258 U8* bufferGetScratchMemory(void); 240 static void toggleRenderType(U32 type);
259 void bufferWaitFence(void);
260 void bufferSendFence(void);
261 void bufferRotate(void);
262 241
263 // For UI control of render features 242 // For UI control of render features
264 static void toggleRenderType(void* data); 243 static BOOL hasRenderTypeControl(void* data);
265 static void toggleRenderDebug(void* data); 244 static void toggleRenderDebug(void* data);
266 static void toggleRenderDebugFeature(void* data); 245 static void toggleRenderDebugFeature(void* data);
267 static BOOL toggleRenderTypeControl(void* data); 246 static void toggleRenderTypeControl(void* data);
268 static BOOL toggleRenderTypeControlNegated(void* data); 247 static BOOL toggleRenderTypeControlNegated(void* data);
269 static BOOL toggleRenderDebugControl(void* data); 248 static BOOL toggleRenderDebugControl(void* data);
270 static BOOL toggleRenderDebugFeatureControl(void* data); 249 static BOOL toggleRenderDebugFeatureControl(void* data);
@@ -314,20 +293,17 @@ public:
314 RENDER_TYPE_GROUND = LLDrawPool::POOL_GROUND, 293 RENDER_TYPE_GROUND = LLDrawPool::POOL_GROUND,
315 RENDER_TYPE_TERRAIN = LLDrawPool::POOL_TERRAIN, 294 RENDER_TYPE_TERRAIN = LLDrawPool::POOL_TERRAIN,
316 RENDER_TYPE_SIMPLE = LLDrawPool::POOL_SIMPLE, 295 RENDER_TYPE_SIMPLE = LLDrawPool::POOL_SIMPLE,
317 RENDER_TYPE_MEDIA = LLDrawPool::POOL_MEDIA,
318 RENDER_TYPE_BUMP = LLDrawPool::POOL_BUMP, 296 RENDER_TYPE_BUMP = LLDrawPool::POOL_BUMP,
319 RENDER_TYPE_AVATAR = LLDrawPool::POOL_AVATAR, 297 RENDER_TYPE_AVATAR = LLDrawPool::POOL_AVATAR,
320 RENDER_TYPE_TREE = LLDrawPool::POOL_TREE, 298 RENDER_TYPE_TREE = LLDrawPool::POOL_TREE,
321 RENDER_TYPE_TREE_NEW = LLDrawPool::POOL_TREE_NEW,
322 RENDER_TYPE_WATER = LLDrawPool::POOL_WATER, 299 RENDER_TYPE_WATER = LLDrawPool::POOL_WATER,
323 RENDER_TYPE_CLOUDS = LLDrawPool::POOL_CLOUDS,
324 RENDER_TYPE_ALPHA = LLDrawPool::POOL_ALPHA, 300 RENDER_TYPE_ALPHA = LLDrawPool::POOL_ALPHA,
325 RENDER_TYPE_HUD = LLDrawPool::POOL_HUD,
326
327 // Following are object types (only used in drawable mRenderType) 301 // Following are object types (only used in drawable mRenderType)
302 RENDER_TYPE_HUD = LLDrawPool::NUM_POOL_TYPES,
328 RENDER_TYPE_VOLUME, 303 RENDER_TYPE_VOLUME,
329 RENDER_TYPE_GRASS, 304 RENDER_TYPE_GRASS,
330 RENDER_TYPE_PARTICLES, 305 RENDER_TYPE_PARTICLES,
306 RENDER_TYPE_CLOUDS,
331 }; 307 };
332 308
333 enum LLRenderDebugFeatureMask 309 enum LLRenderDebugFeatureMask
@@ -341,13 +317,12 @@ public:
341 RENDER_DEBUG_FEATURE_FOG = 0x0020, 317 RENDER_DEBUG_FEATURE_FOG = 0x0020,
342 RENDER_DEBUG_FEATURE_PALETTE = 0x0040, 318 RENDER_DEBUG_FEATURE_PALETTE = 0x0040,
343 RENDER_DEBUG_FEATURE_FR_INFO = 0x0080, 319 RENDER_DEBUG_FEATURE_FR_INFO = 0x0080,
344 RENDER_DEBUG_FEATURE_CHAIN_FACES = 0x0100 320 RENDER_DEBUG_FEATURE_FOOT_SHADOWS = 0x0100,
345 }; 321 };
346 322
347 enum LLRenderFeatureMask 323 enum LLRenderFeatureMask
348 { 324 {
349 RENDER_FEATURE_AGP = 0x01, 325 RENDER_FEATURE_LOCAL_LIGHTING = 0x02,
350// RENDER_FEATURE_LOCAL_LIGHTING = 0x02,
351 RENDER_FEATURE_OBJECT_BUMP = 0x04, 326 RENDER_FEATURE_OBJECT_BUMP = 0x04,
352 RENDER_FEATURE_AVATAR_BUMP = 0x08, 327 RENDER_FEATURE_AVATAR_BUMP = 0x08,
353// RENDER_FEATURE_SHADOWS = 0x10, 328// RENDER_FEATURE_SHADOWS = 0x10,
@@ -356,26 +331,46 @@ public:
356 331
357 enum LLRenderDebugMask 332 enum LLRenderDebugMask
358 { 333 {
359 RENDER_DEBUG_LIGHT_TRACE = 0x0001, 334 RENDER_DEBUG_LIGHT_TRACE = 0x00001,
360 RENDER_DEBUG_POOLS = 0x0002, 335 RENDER_DEBUG_COMPOSITION = 0x00020,
361 RENDER_DEBUG_MAP = 0x0004, 336 RENDER_DEBUG_VERIFY = 0x00080,
362 RENDER_DEBUG_AGP_MEM = 0x0008, 337 RENDER_DEBUG_SHADOW_MAP = 0x00100,
363 RENDER_DEBUG_QUEUES = 0x0010, 338 RENDER_DEBUG_BBOXES = 0x00200,
364 RENDER_DEBUG_COMPOSITION = 0x0020, 339 RENDER_DEBUG_OCTREE = 0x00400,
365 RENDER_DEBUG_SSBB = 0x0040, 340 RENDER_DEBUG_PICKING = 0x00800,
366 RENDER_DEBUG_VERIFY = 0x0080, 341 RENDER_DEBUG_OCCLUSION = 0x01000,
367 RENDER_DEBUG_SHADOW_MAP = 0x0100, 342 RENDER_DEBUG_POINTS = 0x02000,
368 RENDER_DEBUG_BBOXES = 0x0200, 343 RENDER_DEBUG_TEXTURE_PRIORITY = 0x04000,
369 RENDER_DEBUG_OCTREE = 0x0400, 344 RENDER_DEBUG_TEXTURE_AREA = 0x08000,
370 RENDER_DEBUG_FACE_CHAINS = 0x0800, 345 RENDER_DEBUG_FACE_AREA = 0x10000,
371 RENDER_DEBUG_OCCLUSION = 0x1000, 346 RENDER_DEBUG_PARTICLES = 0x20000,
372 RENDER_DEBUG_POINTS = 0x2000, 347 RENDER_DEBUG_TEXTURE_ANIM = 0x40000,
373 RENDER_DEBUG_TEXTURE_PRIORITY = 0x4000,
374 }; 348 };
375 349
376 LLPointer<LLViewerImage> mAlphaSizzleImagep; 350 LLPointer<LLViewerImage> mAlphaSizzleImagep;
377 351
378 LLSpatialPartition *mObjectPartition; 352 //MUST MATCH THE ORDER OF DECLARATION IN LLPipeline::init()
353 typedef enum
354 {
355 PARTITION_VOLUME = 0,
356 PARTITION_BRIDGE,
357 PARTITION_HUD,
358 PARTITION_TERRAIN,
359 PARTITION_WATER,
360 PARTITION_TREE,
361 PARTITION_PARTICLE,
362 PARTITION_CLOUD,
363 PARTITION_GRASS,
364 PARTITION_NONE,
365 NUM_PARTITIONS
366 } eObjectPartitions;
367
368private:
369 std::vector<LLSpatialPartition*> mObjectPartition;
370public:
371
372 LLSpatialPartition* getSpatialPartition(LLViewerObject* vobj);
373 LLSpatialPartition* getSpatialPartition(U32 index);
379 374
380 BOOL mBackfaceCull; 375 BOOL mBackfaceCull;
381 S32 mTrianglesDrawn; 376 S32 mTrianglesDrawn;
@@ -394,10 +389,16 @@ public:
394 LLStat mNumVisibleFacesStat; 389 LLStat mNumVisibleFacesStat;
395 LLStat mNumVisibleDrawablesStat; 390 LLStat mNumVisibleDrawablesStat;
396 391
397 static S32 sAGPMaxPoolSize;
398 static S32 sCompiles; 392 static S32 sCompiles;
399 393
400 BOOL mUseVBO; // Use ARB vertex buffer objects, if available 394 static BOOL sShowHUDAttachments;
395 static BOOL sUseOcclusion;
396 static BOOL sSkipUpdate; //skip lod updates
397 static BOOL sDynamicReflections;
398
399 //cube map for anti-aliasing reflections
400 LLCubeMap* mCubeBuffer;
401 GLuint mCubeList;
401 402
402 class LLScatterShader 403 class LLScatterShader
403 { 404 {
@@ -432,15 +433,25 @@ public:
432 GLSL_SPECULAR_MAP, 433 GLSL_SPECULAR_MAP,
433 GLSL_BUMP_MAP, 434 GLSL_BUMP_MAP,
434 GLSL_ENVIRONMENT_MAP, 435 GLSL_ENVIRONMENT_MAP,
435 GLSL_SCATTER_MAP,
436 GLSL_END_RESERVED_UNIFORMS 436 GLSL_END_RESERVED_UNIFORMS
437 } eGLSLReservedUniforms; 437 } eGLSLReservedUniforms;
438 438
439 static const char* sShinyUniforms[];
440 static U32 sShinyUniformCount;
441
442 typedef enum
443 {
444 GLSL_SHINY_ORIGIN = GLSL_END_RESERVED_UNIFORMS
445 } eShinyUniforms;
446
447 LLVector4 mShinyOrigin;
448
439 //object shaders 449 //object shaders
440 LLGLSLShader mObjectSimpleProgram; 450 LLGLSLShader mObjectSimpleProgram;
441 LLGLSLShader mObjectAlphaProgram; 451 LLGLSLShader mObjectAlphaProgram;
442 LLGLSLShader mObjectBumpProgram; 452 LLGLSLShader mObjectBumpProgram;
443 453 LLGLSLShader mObjectShinyProgram;
454
444 //water parameters 455 //water parameters
445 static const char* sWaterUniforms[]; 456 static const char* sWaterUniforms[];
446 static U32 sWaterUniformCount; 457 static U32 sWaterUniformCount;
@@ -515,15 +526,17 @@ public:
515 526
516 LLColor4 mSunDiffuse; 527 LLColor4 mSunDiffuse;
517 LLVector3 mSunDir; 528 LLVector3 mSunDir;
529
530 LLSpatialGroup::sg_vector_t mActiveGroups;
531 std::vector<LLDrawInfo*> mRenderMap[LLRenderPass::NUM_RENDER_TYPES];
532 std::vector<LLSpatialGroup* > mAlphaGroups;
533 std::vector<LLSpatialGroup* > mAlphaGroupsPostWater;
534 LLSpatialGroup::sg_vector_t mVisibleGroups;
535 LLSpatialGroup::sg_vector_t mDrawableGroups;
536
537 void clearRenderMap();
518 538
519protected: 539protected:
520 class SelectedFaceInfo
521 {
522 public:
523 LLFace *mFacep;
524 S32 mTE;
525 };
526
527 BOOL mVertexShadersEnabled; 540 BOOL mVertexShadersEnabled;
528 S32 mVertexShadersLoaded; // 0 = no, 1 = yes, -1 = failed 541 S32 mVertexShadersLoaded; // 0 = no, 1 = yes, -1 = failed
529 S32 mVertexShaderLevel[SHADER_COUNT]; 542 S32 mVertexShaderLevel[SHADER_COUNT];
@@ -534,12 +547,16 @@ protected:
534 U32 mRenderDebugFeatureMask; 547 U32 mRenderDebugFeatureMask;
535 U32 mRenderDebugMask; 548 U32 mRenderDebugMask;
536 549
550 U32 mOldRenderDebugMask;
551
537 ///////////////////////////////////////////// 552 /////////////////////////////////////////////
538 // 553 //
539 // 554 //
540 LLDrawable::drawable_vector_t mVisibleList; 555 LLDrawable::drawable_vector_t mVisibleList;
541 LLDrawable::drawable_set_t mMovedList; 556 LLSpatialBridge::bridge_vector_t mVisibleBridge;
542 557 LLSpatialBridge::bridge_vector_t mOccludedBridge;
558 LLDrawable::drawable_vector_t mMovedList;
559 LLDrawable::drawable_vector_t mMovedBridge;
543 LLDrawable::drawable_vector_t mShiftList; 560 LLDrawable::drawable_vector_t mShiftList;
544 561
545 ///////////////////////////////////////////// 562 /////////////////////////////////////////////
@@ -578,13 +595,12 @@ protected:
578 // 595 //
579 // Different queues of drawables being processed. 596 // Different queues of drawables being processed.
580 // 597 //
581 LLDrawable::drawable_set_t mBuildQ1; // priority 598 LLDrawable::drawable_list_t mBuildQ1; // priority
582 LLDrawable::drawable_list_t mBuildQ2; // non-priority 599 LLDrawable::drawable_list_t mBuildQ2; // non-priority
583 600
584 LLDrawable::drawable_set_t mActiveQ; 601 LLDrawable::drawable_set_t mActiveQ;
585 602
586 LLDrawable::drawable_set_t mRetexturedList; 603 LLDrawable::drawable_set_t mRetexturedList;
587 LLDrawable::drawable_set_t mRematerialedList;
588 604
589 ////////////////////////////////////////////////// 605 //////////////////////////////////////////////////
590 // 606 //
@@ -617,45 +633,27 @@ protected:
617 LLDrawPool* mLastRebuildPool; 633 LLDrawPool* mLastRebuildPool;
618 634
619 // For quick-lookups into mPools (mapped by texture pointer) 635 // For quick-lookups into mPools (mapped by texture pointer)
620 std::map<uintptr_t, LLDrawPool*> mSimplePools;
621 std::map<uintptr_t, LLDrawPool*> mTerrainPools; 636 std::map<uintptr_t, LLDrawPool*> mTerrainPools;
622 std::map<uintptr_t, LLDrawPool*> mTreePools; 637 std::map<uintptr_t, LLDrawPool*> mTreePools;
623 std::map<uintptr_t, LLDrawPool*> mTreeNewPools;
624 std::map<uintptr_t, LLDrawPool*> mBumpPools;
625 std::map<uintptr_t, LLDrawPool*> mMediaPools;
626 LLDrawPool* mAlphaPool; 638 LLDrawPool* mAlphaPool;
639 LLDrawPool* mAlphaPoolPostWater;
627 LLDrawPool* mSkyPool; 640 LLDrawPool* mSkyPool;
628 LLDrawPool* mStarsPool; 641 LLDrawPool* mStarsPool;
629 LLDrawPool* mCloudsPool;
630 LLDrawPool* mTerrainPool; 642 LLDrawPool* mTerrainPool;
631 LLDrawPool* mWaterPool; 643 LLDrawPool* mWaterPool;
632 LLDrawPool* mGroundPool; 644 LLDrawPool* mGroundPool;
633 LLDrawPool* mHUDPool; 645 LLRenderPass* mSimplePool;
646 LLDrawPool* mBumpPool;
634 // Note: no need to keep an quick-lookup to avatar pools, since there's only one per avatar 647 // Note: no need to keep an quick-lookup to avatar pools, since there's only one per avatar
635 648
636 649
637 LLDynamicArray<LLFace*> mHighlightFaces; // highlight faces on physical objects 650 std::vector<LLFace*> mHighlightFaces; // highlight faces on physical objects
638 LLDynamicArray<SelectedFaceInfo> mSelectedFaces; 651 std::vector<LLFace*> mSelectedFaces;
639 652
640 LLPointer<LLViewerImage> mFaceSelectImagep; 653 LLPointer<LLViewerImage> mFaceSelectImagep;
641 LLPointer<LLViewerImage> mBloomImagep; 654 LLPointer<LLViewerImage> mBloomImagep;
642 LLPointer<LLViewerImage> mBloomImage2p; 655 LLPointer<LLViewerImage> mBloomImage2p;
643
644 BOOL mAGPBound;
645 LLAGPMemPool *mAGPMemPool;
646 U32 mGlobalFence;
647
648 // Round-robin AGP buffers for use by the software skinner
649 enum
650 {
651 kMaxBufferCount = 4
652 };
653 656
654 S32 mBufferIndex;
655 S32 mBufferCount;
656 LLAGPArray<U8> *mBufferMemory[kMaxBufferCount];
657 U32 mBufferFence[kMaxBufferCount];
658 BOOL mUseOcclusionCulling; // object-object occlusion culling
659 U32 mLightMask; 657 U32 mLightMask;
660 U32 mLightMovingMask; 658 U32 mLightMovingMask;
661 S32 mLightingDetail; 659 S32 mLightingDetail;
@@ -671,8 +669,5 @@ void render_bbox(const LLVector3 &min, const LLVector3 &max);
671 669
672extern LLPipeline gPipeline; 670extern LLPipeline gPipeline;
673extern BOOL gRenderForSelect; 671extern BOOL gRenderForSelect;
674extern F32 gPickAlphaThreshold;
675extern F32 gPickAlphaTargetThreshold;
676extern BOOL gUsePickAlpha;
677 672
678#endif 673#endif
diff --git a/linden/indra/newview/releasenotes.txt b/linden/indra/newview/releasenotes.txt
index 01f16b3..b8822dc 100644
--- a/linden/indra/newview/releasenotes.txt
+++ b/linden/indra/newview/releasenotes.txt
@@ -1,3 +1,109 @@
1Release Notes for Second Life 1.14.0(0) March 27, 2007
2=====================================
3New feature:
4* Linux client features embedded Mozilla
5
6Changes:
7* Texture Pipeline Architecture
8** Significant redesign of texture pipeline
9** Improved texture caching
10** Unlimited texture cache size
11** Cache location can be changed
12** Textures from last scene are pre fetched, improving loading speed of inital scene
13* Render Pipeline Architecture
14** Significant changes to render pipeline
15** Introduction of Vertex Buffer Objects for improved stability
16** Better batching of geometry for improved render performance (on some systems)
17** Alpha sorting changes to improve performance
18** Modified texture animations to use hardware acceleration
19** Light objects now affect themselves.
20*** NOTE: This may cause some objects that are lights to "wash out" requiring some content to be adjusted
21* Setting an object for sale enables "Buy Copy" by default instead of "Buy Original"
22* User inworld money transaction history floater removed
23** Transaction history can be viewed via secondlife.com
24* Moving your avatar no longer deselects objects in build mode automatically
25* Removed old reference to Announcements forum in a login error message
26* Added Port setting in preferences to specify UDP port (ala -port argument)
27* Added setting to change cache location
28* Added 'Empty Lost and Found' option
29* Added 'Use Custom Port' option to Preferences to specify network port
30* Objects set for sale are Buy Copy by default (instead of Buy Original)
31* Increased Classified's maximum L$ payable from 99999 to 999999
32* Added '?' button next to Partner field explaining partnering
33** Added display that shows intersection of prims with translation plane when building.
34
35LSL changes:
36* New script commands
37** void llSetLinkPrimitiveParams( integer linknumber, list rules )
38** void llSetLinkTexture( integer linknumber, string texture, integer face )
39* More documentation is available using Help > Scripting Guide...
40* The following 4 particle commands have been deprecated for some time, and are now approximated by llParticleSystem
41** llMakeExplosion http://wiki.secondlife.com/wiki/LlMakeExplosion
42** llMakeFire http://wiki.secondlife.com/wiki/LlMakeFire
43** llMakeFountain http://wiki.secondlife.com/wiki/LlMakeFountain
44** llMakeSmoke http://wiki.secondlife.com/wiki/LlMakeSmoke
45
46Bug fixes:
47* Fixed texturing all sides of multi-prim object failing under high latency
48* Fixed sitting avatar standing when clothes are dragged onto the avatar
49* Fixed llGiveInventoryList spamming owner with messages
50* Fixed group members ability to set home to land only set to group (not deeded)
51* Fixed objects from library being placed back in Library after editing
52* Fixed loss of no-copy textures when applied to a prim
53* Fixed delivery of Email to IM messages greater than 998 characters
54* Fixed attachments leaving inventory after detaching
55* Fixed Alt-menu taking focus after Alt-zooming
56* Fixed menus not closing when something else is clicked
57* Fixed Friends list not showing online friends on login if "Can see my online status" is disabled
58* Fixed World -> Buy Land menu failures
59* Fixed LSL email converting numbers in the email body to 0
60* Fixed focus issues when closing a window
61* Fixed closed status of folders when opened in inventory
62* Fixed a method of sitting on other avatars
63* Fixed double-clicking on TOS switching to a different text display
64* Fixed rezzed objects appearing at <0,0,0> if you have create rights but do not wear your title
65* Fixed Offer Teleport appearing in your own profile
66* Fixed Ctrl-P failing to open Preferences if Inventory has focus
67* Fixed ability to set sale info on no-modify items
68* Fixed ability to further limit permissions on items if they are already no-modify
69* Fixed Object Entry rules also preventing rezzing from inventory
70* Fixed single-click behavior for objects
71* Fixed object selection while crossing region boundary
72* Fixed textures leaving their window when resized
73* Fixed single items being created in tabbed windows
74* Fixed menus not closing when clicked a second time
75* Fixed resizing of landmarks
76* Fixed textures being applied to all sides when using Select Texture
77* Fixed objects not deleting if they contain no-copy items
78* Fixed Pay dialog while in busy mode
79* Fixed loss of no-copy objects when using llGiveInventory() on a busy avatar
80* Fixed script editor not regaining focus when function dropdown is used
81* Fixed opening multiple inventory items not using tabbed windows
82* Fixed a client crash when opening multiple inventory items (including a script)
83* Fixed notecards opened in a tabbed window extending outside the preview window
84* Fixed blurry web browser widgets when UI Scale is not 1.0
85* Fixed focus not moving to next window when using Ctrl-W on detached IMs or Appearance
86* Fixed Ctrl-W not closing snapshot floater
87* Fixed widget overlap in group proposal tab of a searched group
88* Fixed a client crash when deleting objects
89* Fixed Capslock key detection
90* Fixed context menu for items in an object
91* Fixed avatar animations not changing when editing an attachment
92* Fixed object counts in About Land changing when object loses focus
93* Fixed ESC key behavior (closing tools and resetting camera)
94* Fixed obscured status bar when debug is off
95* Fixed client crash in People Search with Picks tab
96* Fixed incorrect prim count in Buy dialog when using prim multipliers
97* Fixed build button on toolbar remaining disabled when Create Objects is set to group
98* Fixed a client crash while taking an object
99* Fixed a script runtime error when using a list inside a while or do-while loop
100* Fixed renaming a no-copy clothing item failing during Make New Outfit
101* Fixed objects failing to attach when selected from a distance
102* Fixed rare texture swapping on Mac
103* Fixed non-Latin characters such as Japanese Kanji appearing as small square dots
104* Fixed textures in the distance not reducing priority
105* Avatars out of view are no longer animated
106
1Release Notes for Second Life 1.13.3(2) January 30, 2007 107Release Notes for Second Life 1.13.3(2) January 30, 2007
2===================================== 108=====================================
3Changes: 109Changes:
@@ -116,7 +222,6 @@ Release Notes for Second Life 1.13.1(6) December 21, 2006
116Bug fixes: 222Bug fixes:
117* Don't display an erroneous 'Critical Message' during login for new residents 223* Don't display an erroneous 'Critical Message' during login for new residents
118 224
119
120Release Notes for Second Life 1.13.1(5) December 15, 2006 225Release Notes for Second Life 1.13.1(5) December 15, 2006
121===================================== 226=====================================
122New features: 227New features:
@@ -139,7 +244,6 @@ Bug fixes:
139* Fixed Home key not toggling fly when chat field is empty 244* Fixed Home key not toggling fly when chat field is empty
140* Fixed Friends list multi-selection 245* Fixed Friends list multi-selection
141 246
142
143Release Notes for Second Life 1.13.1(4) December 13, 2006 247Release Notes for Second Life 1.13.1(4) December 13, 2006
144===================================== 248=====================================
145UI changes: 249UI changes:
@@ -221,35 +325,6 @@ Bug fixes:
221* Fixed a memory leak on the Intel Mac 325* Fixed a memory leak on the Intel Mac
222* Fixed greyed Terms of Service agree/disagree options if user cancelled TOS notice 326* Fixed greyed Terms of Service agree/disagree options if user cancelled TOS notice
223 327
224Release Notes for Second Life 1.13.1(0) December 8, 2006
225=====================================
226Changes:
227* 'Access from Mainland' renamed to 'Public Access' in Estate Tools
228* 'Contact Support' link added to Help menu pointing to Second Life Knowledge Base contact page
229
230Bug fixes:
231* Fixed duplicate IMs or IM-to-email being sent (repeatedly)
232* Fixed objects disappearing if they were made flexible via script
233* Fixed a cause of failed estate-to-estate teleports
234* Generalized flexi implementation for attachments and non-attachments
235* Fixed several integer fields being displayed as float values
236* Fixed pie menu options for non-English languages
237* Fixed group notice panel not accepting text
238* Removed incorrect notice that friends could track each other on the map (they cannot)
239* Fixed bug affecting color of scripted/resident chat
240* Temp objects can enter full parcels
241* Fixed client crash when closing tabbed gestures without saving
242* Fixed boolean values in Debug Settings not remembering the correct values
243* Fixed strange characters in popup messages in Preferences
244* Fixed incorrect counts for simulator prim usage
245* Fixed floating point drift (and prim drift) in llTargetOmega
246* Fixed textures on HUDs not rezing until right-clicked
247* Fixed friends list scrolling to the top after a change
248* Fixed a crash caused by tearing off menus in the script editor
249* Fixed ability to add yourself to your friends list
250* Fixed offline notification that a resident left your group (should not send email)
251* Fixed object contents 'Copy to Inventory' and 'Copy and Wear'
252
253Release Notes for Second Life 1.13.0(10) December 4, 2006 328Release Notes for Second Life 1.13.0(10) December 4, 2006
254===================================== 329=====================================
255Bug fixes: 330Bug fixes:
@@ -369,7 +444,6 @@ Bug fixes:
369* Fixed a client crash when right-clicking a payment notification window 444* Fixed a client crash when right-clicking a payment notification window
370* Fixed a client crash for llLoadURL 445* Fixed a client crash for llLoadURL
371 446
372
373Release Notes for Second Life 1.12.3(6) November 1, 2006 447Release Notes for Second Life 1.12.3(6) November 1, 2006
374===================================== 448=====================================
375Other changes: 449Other changes:
@@ -399,7 +473,6 @@ Linux fixes:
399* Assorted library fixes 473* Assorted library fixes
400* Work around an X bug in full-screen mouse handling 474* Work around an X bug in full-screen mouse handling
401 475
402
403Release Notes for Second Life 1.12.3(4) October 25, 2006 476Release Notes for Second Life 1.12.3(4) October 25, 2006
404===================================== 477=====================================
405New features: 478New features:
@@ -472,11 +545,11 @@ Bug fixes:
472* Lots of changes to make the client/server protocols more secure 545* Lots of changes to make the client/server protocols more secure
473 546
474Linux client fixes: 547Linux client fixes:
475* MMX-enhanced image decoding 548 * MMX-enhanced image decoding
476* Resolve crash: 'undefined symbol: glXGetProcAddress' 549 * Resolve crash: 'undefined symbol: glXGetProcAddress'
477* No longer lose streaming music after visiting a dead stream 550 * No longer lose streaming music after visiting a dead stream
478* Startup script now exposes alpha-testing configuration options 551 * Startup script now exposes alpha-testing configuration options
479* Disable troublesome GL extensions by default. See startup script to enable. 552 * Disable troublesome GL extensions by default. See startup script to enable.
480 553
481Release Notes for Second Life 1.12.1(13) September 27, 2006 554Release Notes for Second Life 1.12.1(13) September 27, 2006
482===================================== 555=====================================
@@ -484,12 +557,6 @@ Bug fixes:
484* Fixed Macintosh autoupdater 557* Fixed Macintosh autoupdater
485** Older clients should use the website download if issues are experienced 558** Older clients should use the website download if issues are experienced
486 559
487Linux client fixes:
488* Shiny, Ripple Water, Occlusion Culling, Anisotropic Filtering, Avatar Vertex Programs where supported by drivers
489* On-disk cache persists properly across sessions
490* Screenshots save on-disk to resident profile directory
491* Client less prone to blocking window manager key combos
492
493Release Notes for Second Life 1.12.1(12) September 27, 2006 560Release Notes for Second Life 1.12.1(12) September 27, 2006
494===================================== 561=====================================
495Other changes: 562Other changes:
@@ -590,35 +657,6 @@ Bug fixes:
590 657
591Release Notes for Second Life 1.12.1(6) September 13, 2006 658Release Notes for Second Life 1.12.1(6) September 13, 2006
592===================================== 659=====================================
593Linux client fixes:
594* Cut & Paste is now supported
595* Work around window managers stopping SL from seeing Alt Zoom (or Ctrl Drag)
596* Improved default Unicode font rendering
597** Easier for user to substitute own fallback unicode.ttf file
598* Bundle libvorbisenc, libcurl, more
599* Key repeating was not working correctly
600* Fix clicking on the world immediately after a desktop switch
601* Show last screenshot during login
602* Fix crash when switching from fullscreen mode
603* Fix hang or crash on linux client shutdown
604* Fix 'Failed to set locale en_US.iso8859-1' warnings
605* Embed icon for the window manager
606* '$L' was not appearing before Linden $$ balance in corner screen
607* Stop the client logging to syslog
608
609Release Notes for Second Life 1.12.0 (linux-51742) August 29, 2006
610=====================================
611Linux client fixes:
612* Audio support on Linux
613* Context-sensitive cursors for Linux
614* Crash when emailing a postcard
615* Group title appears twice
616* Linux Client doesn't notice when it is minimized
617* Gamma settings fail to work and save
618* Linux Client tries to run Mac auto-updater
619
620Release Notes for Second Life 1.12.1(5) September 11, 2006
621=====================================
622New features: 660New features:
623* Estate access and ban lists boosted up to 300 entries (previously 63) 661* Estate access and ban lists boosted up to 300 entries (previously 63)
624* Estate land management now allows subdividing and joining of parcels 662* Estate land management now allows subdividing and joining of parcels
@@ -897,500 +935,3 @@ Bug fixes:
897Linux client fixes: 935Linux client fixes:
898* No linux client specific fixes in this version 936* No linux client specific fixes in this version
899 937
900Release Notes for Second Life 1.11.3(2) August 9, 2006
901=====================================
902* Resolved an incompatibility with older scripts causing regions to crash
903* Fixed an issue with agent presence that caused Residents to be unable to see one another
904
905Release Notes for Second Life 1.11.3(1) August 9, 2006
906=====================================
907Other changes:
908* System Sound Effects have been decoupled from the Audio Stream
909** This allows system sounds like typing to be muted while listening to live performances and so forth
910** Sound Effects volume can now be set in Preferences -> Audio & Video -> Sound Effects Volume
911** Streaming Audio volume is set as it was before using the in-world Audio Control panel
912
913Bug fixes:
914* Preferences no longer save when user profile has non-ASCII character in its path
915* Resolved client crash when clicking Preferences -> Popups -> Reset 'Show next time' Dialogs
916* CTRL-ENTER once again activates Chat Shout
917* Drop-down boxes now respond to control keys as expected
918* Resolved client crash related to mute lists
919* Resolved client crash related to applying color to an object
920* Scroll wheel once again causes Chat History window to scroll
921* Drag-selecting text in a type-in field no longer causes selected text to be stuck
922* World Map once again correctly accepts coordinates for pin-point teleporting
923* First name in a search query is once again automatically highlighted when search is performed
924* Resolved a bug which caused an orange flicker to occur (most noticeable during sunset and sunrise)
925* Upper-case file extensions are now recognized when uploading files and no longer cause an error
926* Large chat history, notecards and scripts no longer negatively impact viewer framerate
927* Text is no longer cut off in Search -> Land Sales
928* The mouse scroll wheel now works again within chat history
929* Fixed a lighting bug causing avatars to flicker - most notable at sunset
930* Several exploits have been identified and addressed
931* Restored 'click here to turn off this email' link to outgoing email
932
933Linux client fixes:
934* No Linux client specific fixes in this version
935
936Release Notes for Second Life 1.11.2(4) August 1, 2006
937=====================================
938Other changes:
939* Asset compression expanded to cover objects
940* llRequestAgentData can now return the resident's account type
941** Example usage: llRequestAgentData(llGetOwner(), DATA_PAYINFO);
942** No Payment Info on File: 0
943** Payment Info on File: 1
944** No Payment Info on File AND Payment Info Used: 2 (Only Beta/Lifetime users fall under this status)
945** Payment Info on File AND Payment Info Used: 3
946* Added PARCEL_FLAG_RESTRICT_PUSHOBJECT to llGetParcelFlags, and REGION_FLAG_RESTRICT_PUSHOBJECT to llGetRegionFlags()
947* Right-click -> Teleport option added to landmarks
948* 'Muted Residents' renamed to 'Mute List', as it can contain muted objects as well
949* Ctrl-\ can now be used to focus the camera on the last agent or object that said something in chat
950
951Bug fixes:
952* Fixed several exploits
953* Friends list now sorts by online status
954* Both the scripted object and the target of llPushObject must be in push-allowed areas
955* Corrected the color of system messages
956* d right-clicking the edges of the viewer window automatically selecting pie menu items
957* Minimap now fits within its window when taking high-res snapshots
958* Telehub spawnpoint removal no longer fails for Estate Owners/Managers
959* Fixed a bug where the clear search button was not visible
960* Send Postcard floater now gets active focus when 'Keep open after saving' is checked
961* Fixed a bug where residents would teleport to the wrong location when using the my land window after using the sort tabs
962* Double-clicking on map icon ('event') no longer opens wrong panel in Search floater
963* Fixed a bug with slow window resize
964* Dragging past the end of text field once again scrolls text
965* Fixed a bug where the avatar picker name field doesn't have focus on show
966* Ctrl+F opening search now puts focus in 'All' tab's 'Find' text box
967* About Land floater no longer goes blank in some use cases
968* Resolved issue which caused Minimap window, Build window and Object Edit window to not appear in snapshots when Show UI is selected
969* 'Update Automatically' no longer clears the 'Send postcard' window from the screen
970* Fonts now render properly with UI scaling on in fullscreen on Macbook Pro
971* Linden Locations shouldn't appear in Popular Places
972* Text in Search > Landsales no longer missing
973* Fixed a bug with keyboard selection of radio buttons
974* Escape now closes menus
975* Land sales description now displays correctly in Search > Land Sales
976* Snapshot window now follows the same position rules as other windows
977* Friends list now sorts by online status
978* Toolbar buttons no longer retain focus after use
979* UI layout tweaks to the About Land > Options > Show in Find Places drop-down menu
980* Improved the experience for uploading a snapshot as a texture
981* Fixed a bug with snapshot floater's settings not being persisted
982* Made double-click process as a normal click if not handled specially
983* Disabled using ALT-Enter to trigger buttons, etc
984* Converted media remote control to be a panel to allow tab focusing
985
986Release Notes for Second Life 1.11.1(2) August 1, 2006
987=====================================
988Bugs fixed:
989* Fixed an exploit
990
991Release Notes for Second Life 1.11.1(1) July 26, 2006
992=====================================
993New features:
994* Additional right-click functionality for inventory folders containing wearables
995** 'Add to Outfit' puts accessories on your avatar without removing existing ones
996*** This is also activated by shift-dragging the folder onto your avatar
997** 'Replace Outfit' removes existing outfit and wears contents of folder
998** 'Take Off' removes ONLY worn items in the folder
999* Region/Estate and About Land now feature the option 'Restricted Pushing'
1000** When pushing is restricted, only the following calls of llPushObject will succeed on the land:
1001*** Any push called against the owner of the scripted object
1002*** An object owned by the landowner
1003*** An object deeded (or Set) to the same group the land parcel is deeded (or Set)
1004** Region/Estate edits this setting on a per-region basis, not per-estate
1005
1006Other changes:
1007* llGiveInventory() box now supports an option to mute the giving agent (user or object)
1008* llPushObject() functionality can now be disabled on a parcel or region
1009* Sounds triggered by muted residents are now muted
1010
1011Bug fixes:
1012* Banned users cannot be heard from your parcel
1013* Texture tab and picker no longer preview textures on objects you don't own
1014* Fixed a bug where IM and Chat history text is blurred on some ATI cards
1015* Fixed a bug where skirt mesh blocks attachment editing on legs
1016* Group names, parcel names, classified names are now filtered to ASCII characters
1017* All default gestures no longer deactivated upon first relogin
1018* 'Stop Flying' button is now disabled when flying over No Fly land
1019* Right-click IM calling cards now works consistently
1020* Fixed a bug where scrollbars failed to appear when IM window holds more IMs than IM panel can display
1021* Fixed a bug where multi-select of faces does not always display the last selected face properties
1022* Fixed a bug where color settings revert to black when changed from defaults
1023* Fixed a bug where clicking set in about land / forsale doesnt automatically show the calling cards
1024* Hitting enter while chat history has focus now focuses the chat bar
1025
1026Linux client fixes:
1027* No linux client-specific fixes in this release
1028
1029Release Notes for Second Life 1.11.0(12) July 23, 2006
1030=====================================
1031Bug fixes:
1032* Resolved a server side exploit
1033
1034Linux client fixes:
1035* No linux client specific fixes in this release
1036
1037Release Notes for Second Life 1.11.0(11) July 21, 2006
1038=====================================
1039Bug fixes:
1040* Resolved a bug that caused script events to be triggered on region crossing
1041* Fixed a bug that caused Estate Tools to return objects other than those selected
1042* Fixed a bug that dropped focus while deleting a (no copy) object
1043* Fixed a bug that caused the parcel Ban list to clear
1044* Fixed a viewer crash/lockup caused by viewing profiles
1045* Fixed a viewer crash when double-clicking a group in the 'My Land...' window
1046* Fixed a bug that caused the Delete key to incorrectly delete an object when editing text values in the Edit window
1047
1048Linux client fixes:
1049* No linux client specific fixes in this release
1050
1051Release Notes for Second Life 1.11.0(10) July 19, 2006
1052=====================================
1053Bug fixes:
1054* Resolved a simulator crash caused by script emails
1055* Fixed a bug where poseballs and vehichles would stop working after region restart
1056
1057Release Notes for Second Life 1.11.0(9) July 19, 2006
1058=====================================
1059Features:
1060* Zoomable UI
1061** The entire UI can be scaled (including in-world text, manipulators, etc) by a user-supplied scale value (Preferences->Graphics->UI Size)
1062** When running fullscreen, the additional option 'Use resolution independent scale' should ensure that the UI looks the same at all resolutions
1063** Additionally, changing to a resolution with a different aspect ratio than your monitor's aspect ratio should not result in any squashing or stretching of your display
1064* Improved Snapshot functionality
1065** When taking a snapshot, the world will freeze in place and the snapshot will be previewed over the entire screen (but under UI elements)
1066** The camera tool will be active by default, allowing you to click and drag to move the camera around while objects/avatars/etc are frozen in place, without having to hold down ALT
1067** You can also change snapshot parameters (resolution, JPEG compression level) and the snapshot will update on the fly
1068** Any time the camera moves or a parameter is changed, the existing snapshot will 'drop' away and be replaced by a new one
1069** You can also take snapshot of arbitrary resolution, up to 6000x6000
1070*** Be aware that the larger the snapshot is, the more system resources are needed to create it -- you can potentially run out of memory and crash if taking very large snapshots on a low-end system
1071* Eyedropper tool
1072** Added the ability to pick colors and textures from objects in view (and that you own) inside the color picker and texture picker
1073** When depressed, the button changes the mouse cursor and activates a 'pipette' or 'eyedropper' tool
1074** The user can then click on another object in world to grab the texture/color of the face that they clicked
1075* Gestural pie menus
1076** Pie menus now provide a gradually faded border when the right mouse button is down to suggest that you can use them by moving the mouse in a given direction, which is faster and easier than clicking on a pie wedge directly
1077** Also, pie sub-menus can be accessed with gestures, making it possible to chain gestures together to perform any operation in the pie menu by memory
1078* Tear-off menus
1079** Added ability to click on a double line at the top of any menu or sub-menu and pin it in place on the UI as a 'floater'
1080** All of the menu items should still work, as well as branching menus, etc.
1081** Closing the floater will make it disappear
1082** Accessing a detached menu via its parent menu will bring the floating menu to the foreground, but not reposition it
1083
1084Other changes:
1085* Usability changes to Find/Search menu
1086** 'Find' has been renamed 'Search' in the Toolbar, Edit menu, Directory window, and F1 Help
1087** Search is still opened with the keyboard shortcut Ctrl-F
1088** Searches defaults to 'Show Mature Content ON' for sims, parcels, events, classifieds, etc.
1089** The 'Name' column for each listing of returned search results is now wider.
1090** The second column for each listing of returned search results (i.e. Dwell, Price, etc.) has its font size reduced to make additional space
1091* Improved text field support for INSERT key
1092* 'Avatar' ruler mode has been changed to 'Attachment' ruler mode
1093** Attachment rotations in 'Attachment' ruler mode are relative to the attach point instead of the root of the avatar
1094** This should make adjusting attachments easier without using 'pose stands'
1095* Ctrl-tab moves keyboard focus between UI floaters
1096* Tab key moves focus to the toolbar if nothing else has focus
1097* Dragging an inventory item over the scrollbar allows you to directly scroll the inventory window
1098* Hitting Enter when the chat line is blank will close the chat bar
1099
1100Bug fixes:
1101* Scrolling windows should no longer catch scrolling events when they're not the active window
1102* Fixed a bug that caused the fullscreen/windowed shortcut (Alt-Enter) to work incorrectly
1103* Landowners can no longer ban themselves from their own land based on payment information
1104* Fixed snapshot previews in Bug Reports and Postcards
1105* Changing the snapshot resolution causes the previously captured image to disappear
1106* Snapshot mode is automatically exited when teleporting
1107* Fixed a bug that caused snapshot buttons to become greyed out when zooming
1108* Fixed a bug with zoomed snapshots
1109* Fixed a bug that caused the UI to blur in a screenshot
1110* Fixed a bug that caused the UI and HUDs to tile in high-res snapshots
1111* Fixed a bug that caused the Texture Picker to automatically select a texture
1112* Fixed a bug with the sky when right-clicking objects in the dark
1113* Fixed a bug that caused uploaded textures to preview incorrectly
1114* Fixed a bug that caused the edit window to be dragged to the bottom of the screen when minimized
1115* Nametags now scale properly with UI changes
1116* Changed UI Scale label to be consistent across the interface
1117* Objects can now be dragged from Recent Items to All Items
1118* Mouselook mode works correctly when exiting snapshot mode
1119* Removed extraneous headers from Estate -> Debug -> Top Scripts / Top Colliders
1120* Fixed the interface tiling when taking high-res snapshots
1121* Fixed an ugly rectangle around the Terms of Service buttons
1122* Fixed a column width issue with Land Sales
1123* Removed the option to flag a Teen Second Life event as Mature
1124* Fixed a bug that caused UI elements to scale incorrectly when changing windowed resolutions
1125* Fixed a bug that caused a blank Friends list
1126* Improved font rendering for UI, HUD, and avatar names
1127* Region/Estate -> Debug -> Top Colliders now displays properly
1128* Improved UI font scaling to better match window scaling
1129* Improved UI appearance at 800x600 resolution
1130* Help -> About Second Life displays the proper information
1131* Fixed several bugs with snapshots and HUDs
1132* Fixed a crash issue with snapshots
1133* Snapshot buttons are no longer clipped
1134* Fixed a glowing eyes issue with Bump Mapped avatar rendering
1135* Fixed a bug that caused the Color Picker text values to have no effect
1136* Fixed a bug that caused the Chat bar to appear when other windows had focus
1137* Fixed a bug that caused chat bubbles to go offscreen
1138* Fixed a bug that caused inventory Rename to lose keyboard focus
1139* Script comments are once again orange
1140* Profile can now be viewed after searching for one Resident in the finder
1141* Preferences > Network > Clear Cache > Apply no longer starts parcel music stream
1142* Fixed a bug where objects specifically requested to be returned were skipped if an avatar was sitting on them
1143* Autoreturn now functions properly after a parcel is subdivided
1144* Parcel object limits are calculated properly when a parcel is subdivided and claimed by a new owner.
1145* Terms of Service defaults to 'I Disagree'
1146
1147MacOS client fixes:
1148* Resolved an Intel Mac crash issue
1149
1150Linux client fixes:
1151* No linux client specific fixes in this release
1152
1153Release Notes for Second Life 1.10.6(1) July 12, 2006
1154=====================================
1155* Resolved a server-side crash issue
1156
1157Release Notes for Second Life 1.10.6(0) July 12, 2006
1158=====================================
1159Changes:
1160* The PvP History option has been replaced by 'Bumps, Hits, & Pushes' under the Help menu
1161** This window does not open automatically; residents can open and view it manually
1162** Entries in Bumps, Hits, & Pushes are now timestamped
1163** Residents should use Help -> Report Abuse to provide detailed information regarding Abuse cases
1164* 'Find' changed to 'Search' on the toolbar, default for new users is to search 'All' content types
1165* Parcel 'access denied' lines now fade significantly faster with distance
1166* Parcel owners can ban users based on account settings
1167* Chat from banned users cannot be heard from your parcel
1168
1169Bug fixes:
1170* The 'Open' option appears when right-clicking a child prim of an object with contents
1171* The Linden Locations list now shows Mature areas
1172* Fixed a bug that prevented some offline IMs from appearing
1173* Fixed a bug with the INSERT key and text fields
1174* Fixed texture preview for skirts (was zoomed in too tight)
1175* AGP enabled for additional graphics cards
1176* Small flexi objects are now rendered correctly
1177* Stars are back!
1178
1179Linux client fixes:
1180* No linux client specific fixes in this release
1181
1182Release Notes for Second Life 1.10.5(2) June 30, 2006
1183=====================================
1184Bug fixes:
1185* Fixed an exploit
1186
1187Release Notes for Second Life 1.10.5(1) June 28, 2006
1188=====================================
1189New features:
1190* Each resident's profile now includes a field revealing whether the resident has provided payment information to Linden Lab.
1191** The profile's 'Account' field includes account status: 'Resident' or 'Linden Lab Employee' and, in the case of 'Resident' status one of three status entries:
1192*** 'No Payment Info on File' - account was created with no credit card or Paypal
1193*** 'Payment Info on File' - account has provided a credit card or Paypal
1194*** 'Payment Info Used' - credit card or Paypal on account has successfully been billed
1195** We plan to provide features in future updates to mark specific parts of the Second Life world (or allow residents to mark their own land) as accessible only to accounts with payment information.
1196
1197Other changes:
1198* The 'Report PvP Abuse' option has been removed from the Help menu
1199** Residents can and should continue to report harrassing PvP abuse via 'Report Abuse' under Help
1200** Residents should provide as much relevant information as possible when filing Abuse Reports
1201* Residents explicitly banned from a land parcel cannot fly in that parcel's airspace, to a height of 768m
1202** Residents not explicitly banned, but not on the access list, can fly over the parcel at an altitude greater than 50m
1203* More categories have been added to the Places menu
1204* The Library is displayed at the bottom of the Inventory for quicker access to one's own Inventory
1205* Snapshots to disk are now taken with CTRL+` instead of just the ` key
1206* 'Copy and Wear' now behaves identically to dragging a folder from inventory onto your avatar
1207** Existing clothing and attachments will be removed
1208
1209Bug fixes:
1210* Transferring an island to a new owner no longer causes objects on group-owned land to be returned automatically
1211* The Open option is not displayed when the object has no contents
1212* PCI-Express cards should no longer give errors that AGP is disabled
1213* Corrected several error messages about incorrect driver versions
1214* The version number of an optional update is now displayed
1215* Fixed a bug that caused some objects to be missed by rectangle-select
1216* Fixed a display bug with transparent avatar textures in Upload Preview
1217* Doubled the space available to display the estate name in Region/Estate
1218
1219Linux client fixes:
1220* No linux client specific fixes in this release
1221
1222Release Notes for Second Life 1.10.4(4) June 21, 2006
1223=====================================
1224Other changes:
1225* Various usability changes to the inventory Recent Items
1226
1227Bug Fixes:
1228* The autoupdate utility now remembers the SLURL you just used and passes it to SL after updating
1229* Fixed a bug with flexible attachments made with Twist Begin
1230* Fixed a bug that prevented typing in or exiting from Mouselook
1231* Fixed some viewer crashes
1232
1233Release Notes for Second Life 1.10.2(0) June 1, 2006
1234=====================================
1235New features:
1236* Added the Inventory 'Recent Items' tab
1237** Shows items you've received recently (i.e. since your last login)
1238** Recent Items can be filtered separately from All Items
1239
1240Release Notes for Second Life 1.10.1(0) May 31, 2006
1241=====================================
1242Features:
1243* F1 Help using Mozilla
1244** Help for all Second Life users now available in a Mozilla window accessed by pressing F1
1245
1246Bug fixes:
1247* Improved avatar lighting to more closely match in 'nearby lights' and 'sun/moon only' modes
1248* Improved flexible attachment behavior while crossing a region boundary
1249
1250Release Notes for Second Life 1.10.0(34) May 26, 2006
1251=====================================
1252Bug fixes:
1253* Resolved a compatibility issue for PowerPC users running Mac OS X 10.3.9
1254* Fixed a bug causing HUD objects to work incorrectly
1255* Fixed a bug causing child prims on new HUD objects to remain invisible
1256* Fixed a bug causing objects to disappear due to occlusion culling
1257* Other residents should now be heard after unmuting them and relogging
1258* The Mac autoupdate utility should properly show download progress
1259
1260Release Notes for Second Life 1.10.0(33) May 24, 2006
1261=====================================
1262* Resolved an issue that caused group invitations to Officers to offer Member status instead
1263* First Land no longer misidentified and therefore able to be bought by Residents who have already owned land
1264
1265Release Notes for Second Life 1.10.0(32) May 24, 2006
1266=====================================
1267Features:
1268* Hardware lighting
1269** Any primitive in Second Life may be turned into a light
1270*** Light properties are radius, color, intensity, and falloff
1271** New options in the Preference panel indicate the type of lighting you want to use
1272*** 'Sun or Moon only' is best for low-performance hardware
1273**** Everything in-world is lit in real time by the sun or moon only
1274*** 'Nearby Lights' is available for any hardware configuration
1275**** Everything in-world is lit by sun or moon and up to six nearby light sources
1276** More information about the new lighting system is available here:
1277*** http://forums.secondlife.com/showthread.php?t=100128
1278
1279* Flexible objects
1280** Cube, prism and cylinder primitive types can now be made flexible as a client-side effect
1281** Simulation parameters for material and responsiveness to gravity and wind
1282** Objects that are flexible cannot be physical and are always phantom
1283** Use of these is currently limited to preserve framerate as they increase amount of client-side processing
1284
1285* Occlusion culling
1286** Frame rate is improved when objects that would normally be rendered are hidden from view
1287** FPS will be significantly improved when inside a structure
1288*** Windows or other transparent surfaces will decrease effectiveness as objects in view will be rendered, whether or not they are within the structure
1289** Toggle with CTRL-SHIFT-o on all platforms
1290
1291* New 'Click Action' functionality for objects
1292** Object creators can select a default left-click action for objects:
1293*** Touch (default), Sit, Buy, Pay, or Open
1294** These actions happen immediately when a resident left-clicks on the object, without a menu
1295** Builders set the action in the build tools 'General' panel, at the bottom
1296** Click actions override touch events for scripts
1297*** If you want the touch behavior, be sure 'touch (default)' is the click action
1298** You can't set 'Buy' as the action unless an object is for sale
1299** 'Sit' should be useful for both chairs and vehicles
1300** 'Open' should be useful for vendors that sell packaged objects
1301
1302* Updated functionality for the Top Scripts/Top Colliders dialog
1303** Improvements allow Estate owners to return or disable offending objects
1304*** Disabling an object makes it non-physical and disables all scripts
1305
1306* Classified ads now have an auto-renew option
1307** Checking the 'Auto renew each week' checkbox in Profile > Classifieds will cause your classified to be republished instead of expiring after one week
1308** You will be charged the same listing price as the initial classified
1309** To change the listing price, you need to make a new classified
1310
1311* Universal Binary installer for Mac clients is now standard
1312** PowerPC and Intel Mac versions are now bundled together in one 'Universal Binary' installer
1313** Minimum required version for Second Life is now 10.3.9
1314
1315* The Login screen now features a box to select the region to log into
1316** This has the same effect as using a SLURL to log into a region
1317
1318
1319New LSL functions:
1320
1321* llHTTPRequest
1322** Added new LSL call & event to support HTTP access from external scripts
1323** LSL Function usage:
1324*** key llHTTPRequest(string <url>, list <parameters>, string <body>)
1325**** Send HTTP request to <url> with <parameters> and <body>, returning key uniquely identifying the request
1326**** Currently, the only supported parameter is the following key/value pair: HTTP_METHOD, <method name>
1327** LSL Event usage:
1328*** http_response(key <request_id>, integer <status>, list <metadata>, string <body>)
1329**** Called when a pending HTTP request <request_id> completes with the HTTP <status>, <metadata> and response <body>
1330**** This facility supports GET, PUT and POST methods, X-SecondLife-headers, text/* MIME types, and transcoding of body contents to LSL's Unicode strings
1331
1332* llGetParcelFlags
1333** Get the parcel flags (PARCEL_FLAG_*) for the parcel including the point pos
1334** Returns an integer that is a bit field of flags
1335** This bitfield can be ANDed with a flag to see if that flag is set for that parcel
1336** Usage:
1337*** integer llGetParcelFlags(vector pos)
1338** Example:
1339*** if (llGetParcelFlags() & PARCEL_FLAG_ALLOW_CREATE_OBJECTS) llOwnerSay('You may create objects in this parcel!');
1340** Bitfields:
1341*** PARCEL_FLAG_ALLOW_FLY
1342**** Used to determine if a parcel allows flying
1343*** PARCEL_FLAG_ALLOW_SCRIPTS
1344**** Used to determine if a parcel allows outside scripts
1345*** PARCEL_FLAG_ALLOW_LANDMARK
1346**** Used to determine if a parcel allows landmarks to be created
1347*** PARCEL_FLAG_ALLOW_TERRAFORM
1348**** Used to determine if a parcel allows anyone to terraform the land
1349*** PARCEL_FLAG_ALLOW_DAMAGE
1350**** Used to determine if a parcel allows damage
1351*** PARCEL_FLAG_ALLOW_CREATE_OBJECTS
1352**** Used to determine if a parcel allows anyone to create objects
1353*** PARCEL_FLAG_USE_ACCESS_GROUP
1354**** Used to determine if a parcel limits access to a group
1355*** PARCEL_FLAG_USE_ACCESS_LIST
1356**** Used to determine if a parcel limits access to a list of residents
1357*** PARCEL_FLAG_USE_BAN_LIST
1358**** Used to determine if a parcel uses a ban list
1359*** PARCEL_FLAG_USE_LAND_PASS_LIST
1360**** Used to determine if a parcel allows passes to be purchased
1361*** PARCEL_FLAG_LOCAL_SOUND_ONLY
1362**** Used to determine parcel restricts spatialized sound to the parcel
1363
1364Other changes:
1365* Performance enhancements for audio streaming
1366* Texture loading performance improvements
1367* Improved 'Interest List' functionality keeps objects from being reloaded in view so often
1368* Objects that were set Material Light prior to 1.9.1 will be listed as 'Fullbright(Legacy)'
1369** Once this setting is changed for an object, it cannot be set back to this value except via script
1370* Added 'Wear' and 'Take' options to 'Open' menu for objects
1371* 'Pay' now included in left-click options for objects
1372* Improvements to the Properties window for objects
1373* Added region rating to listings in the Find menu
1374* Initial load of Events page defaults to current and upcoming events
1375* World map now puts focus on 'Teleport' button after entering a region name and pressing 'Enter'
1376* Mouselook now shows region, position, and damage at the top of the screen, but does not show currency, time, or packet loss
1377* IMs now include time stamp for local time when message was received
1378
1379
1380Bug fixes:
1381* Offline IMs should appear correctly while logging in
1382* Second Life starts correctly when file pathnames include special characters (including non-English operating systems)
1383* Fixed a cause of failure for offline inventory offers
1384* The 'Purchase' button now greys out while your transaction is being processed
1385* Edit axes no longer display behind the object being edited
1386* Left-click 'buy' now disables when the object is no longer for sale
1387* Residents you have muted can no longer offer you teleports
1388* Fixed a bug that caused the mouse pointer to move incorrectly while dragging HUD attachments
1389* Estate telehubs now override parcel landing points
1390* Fixed a bug that made water turn invisible
1391* Low-end video cards no longer display only one terrain texture
1392* llMapDestination now properly clamps to 768m on the Z-axis
1393* Avatar flying state is persistent across a teleport
1394* Fixed an bug that affected uploads of sounds
1395* Fixed a bug that caused SLURLs to fail with Internet Explorer
1396
diff --git a/linden/indra/newview/res/newViewRes.rc b/linden/indra/newview/res/newViewRes.rc
index 41c2af1..eeeb1eb 100644
--- a/linden/indra/newview/res/newViewRes.rc
+++ b/linden/indra/newview/res/newViewRes.rc
@@ -227,8 +227,8 @@ TOOLPIPETTE CURSOR "toolpipette.cur"
227// 227//
228 228
229VS_VERSION_INFO VERSIONINFO 229VS_VERSION_INFO VERSIONINFO
230 FILEVERSION 1,13,3,2 230 FILEVERSION 1,14,0,0
231 PRODUCTVERSION 1,13,3,2 231 PRODUCTVERSION 1,14,0,0
232 FILEFLAGSMASK 0x3fL 232 FILEFLAGSMASK 0x3fL
233#ifdef _DEBUG 233#ifdef _DEBUG
234 FILEFLAGS 0x1L 234 FILEFLAGS 0x1L
@@ -245,12 +245,12 @@ BEGIN
245 BEGIN 245 BEGIN
246 VALUE "CompanyName", "Linden Lab" 246 VALUE "CompanyName", "Linden Lab"
247 VALUE "FileDescription", "Second Life" 247 VALUE "FileDescription", "Second Life"
248 VALUE "FileVersion", "1.13.3.57442" 248 VALUE "FileVersion", "1.14.0.0"
249 VALUE "InternalName", "Second Life" 249 VALUE "InternalName", "Second Life"
250 VALUE "LegalCopyright", "Copyright © 2001-2006, Linden Research, Inc." 250 VALUE "LegalCopyright", "Copyright © 2001-2007, Linden Research, Inc."
251 VALUE "OriginalFilename", "SecondLife.exe" 251 VALUE "OriginalFilename", "SecondLife.exe"
252 VALUE "ProductName", "Second Life" 252 VALUE "ProductName", "Second Life"
253 VALUE "ProductVersion", "1.13.3.57442" 253 VALUE "ProductVersion", "1.14.0.0"
254 END 254 END
255 END 255 END
256 BLOCK "VarFileInfo" 256 BLOCK "VarFileInfo"
diff --git a/linden/indra/newview/restore_login_page.bat b/linden/indra/newview/restore_login_page.bat
deleted file mode 100644
index 05a4925..0000000
--- a/linden/indra/newview/restore_login_page.bat
+++ /dev/null
@@ -1,22 +0,0 @@
1@echo off
2
3REM ============================================================
4REM restore_login_page
5REM ============================================================
6REM
7REM Purpose:
8REM
9REM Undo the work of set_login_page.
10REM
11
12set ORIGINAL=skins\xui\en-us\panel_login.xml
13set TEMPFILE=.\panel_login.xml
14
15if not exist %TEMPFILE% goto end
16
17echo Restoring login page in %ORIGINAL%
18
19copy /Y %TEMPFILE% %ORIGINAL%
20del %TEMPFILE%
21
22:END
diff --git a/linden/indra/newview/rsyncfiles.txt b/linden/indra/newview/rsyncfiles.txt
deleted file mode 100644
index 0763c5c..0000000
--- a/linden/indra/newview/rsyncfiles.txt
+++ /dev/null
@@ -1,22 +0,0 @@
1- *.cpp
2- *.c
3- *.h
4- .svn/
5- CVS/
6- .cvsignore
7- .DS_Store
8- /app_settings/mozilla/
9- /app_settings/mozilla_debug/
10+ /app_settings/
11+ /character/
12+ /help/
13+ /trial/
14+ /fonts/
15+ /skins/
16+ /cursors_mac/
17+ /featuretable.txt
18+ /featuretable_mac.txt
19+ /releasenotes.txt
20+ /lsl_guide.html
21+ /secondlife.icns
22+ /gpu_table.txt
diff --git a/linden/indra/newview/secondlife setup build aditi.bat b/linden/indra/newview/secondlife setup build aditi.bat
index 68a2e38..cb52caf 100644
--- a/linden/indra/newview/secondlife setup build aditi.bat
+++ b/linden/indra/newview/secondlife setup build aditi.bat
@@ -1,7 +1,4 @@
1@rem Invoke the script which preps then runs the installer. 1@rem Invoke the script which preps then runs the installer.
2@rem This batch file is customized per grid. 2@rem This batch file is customized per grid.
3 3
4set LOGINPAGEURL=http://secondlife.com/app/login/beta/ 4@"secondlife setup build.bat" --grid=aditi
5set ARGS=/DADITI
6
7"secondlife setup build.bat" %LOGINPAGEURL% %ARGS%
diff --git a/linden/indra/newview/secondlife setup build agni.bat b/linden/indra/newview/secondlife setup build agni.bat
index 2b2ce29..fe9dd4f 100644
--- a/linden/indra/newview/secondlife setup build agni.bat
+++ b/linden/indra/newview/secondlife setup build agni.bat
@@ -1,11 +1,4 @@
1@rem Invoke the script which preps then runs the installer. 1@rem Invoke the script which preps then runs the installer.
2@rem This batch file is customized per grid. 2@rem This batch file is customized per grid.
3 3
4set LOGINPAGEURL=http://secondlife.com/app/login/ 4@"secondlife setup build.bat" \ No newline at end of file
5set ARGS=
6
7@rem To build optional "update" installer (doesn't have static VFS):
8@rem
9@rem set ARGS=/DUPDATE
10
11@"secondlife setup build.bat" %LOGINPAGEURL% %ARGS%
diff --git a/linden/indra/newview/secondlife setup build dmz.bat b/linden/indra/newview/secondlife setup build dmz.bat
index 9ab6fae..5d5a614 100644
--- a/linden/indra/newview/secondlife setup build dmz.bat
+++ b/linden/indra/newview/secondlife setup build dmz.bat
@@ -1,7 +1,4 @@
1@rem Invoke the script which preps then runs the installer. 1@rem Invoke the script which preps then runs the installer.
2@rem This batch file is customized per grid. 2@rem This batch file is customized per grid.
3 3
4set LOGINPAGEURL=http://secondlife.com/app/login/beta/ 4@"secondlife setup build.bat" --grid=dmz
5set ARGS=/DDMZ
6
7"secondlife setup build.bat" %LOGINPAGEURL% %ARGS%
diff --git a/linden/indra/newview/secondlife setup build durga.bat b/linden/indra/newview/secondlife setup build durga.bat
index 5bcc744..3ba6bd7 100644
--- a/linden/indra/newview/secondlife setup build durga.bat
+++ b/linden/indra/newview/secondlife setup build durga.bat
@@ -1,7 +1,4 @@
1@rem Invoke the script which preps then runs the installer. 1@rem Invoke the script which preps then runs the installer.
2@rem This batch file is customized per grid. 2@rem This batch file is customized per grid.
3 3
4set LOGINPAGEURL=http://secondlife.com/app/login/beta/ 4@"secondlife setup build.bat" --grid=durga
5set ARGS=/DDURGA
6
7"secondlife setup build.bat" %LOGINPAGEURL% %ARGS%
diff --git a/linden/indra/newview/secondlife setup build firstlook.bat b/linden/indra/newview/secondlife setup build firstlook.bat
index 099f4fc..73e47ec 100644
--- a/linden/indra/newview/secondlife setup build firstlook.bat
+++ b/linden/indra/newview/secondlife setup build firstlook.bat
@@ -1,11 +1,4 @@
1@rem Invoke the script which preps then runs the installer. 1@rem Invoke the script which preps then runs the installer.
2@rem This batch file is customized per grid. 2@rem This batch file is customized per grid.
3 3
4set LOGINPAGEURL=http://secondlife.com/app/login/firstlook/ 4@"secondlife setup build.bat" --grid=firstlook
5set ARGS=/DFIRSTLOOK
6
7@rem To build optional "update" installer (doesn't have static VFS):
8@rem
9@rem set ARGS=/DUPDATE
10
11@"secondlife setup build.bat" %LOGINPAGEURL% %ARGS%
diff --git a/linden/indra/newview/secondlife setup build ganga.bat b/linden/indra/newview/secondlife setup build ganga.bat
index db1a3ad..f2cff72 100644
--- a/linden/indra/newview/secondlife setup build ganga.bat
+++ b/linden/indra/newview/secondlife setup build ganga.bat
@@ -1,7 +1,4 @@
1@rem Invoke the script which preps then runs the installer. 1@rem Invoke the script which preps then runs the installer.
2@rem This batch file is customized per grid. 2@rem This batch file is customized per grid.
3 3
4set LONGPAGEURL=http://secondlife.com/app/login/beta/ 4@"secondlife setup build.bat" --grid=ganga \ No newline at end of file
5set ARGS=/DGANGA
6
7"secondlife setup build.bat" %LONGPAGEURL% %ARGS%
diff --git a/linden/indra/newview/secondlife setup build museum.bat b/linden/indra/newview/secondlife setup build museum.bat
deleted file mode 100644
index e1ec644..0000000
--- a/linden/indra/newview/secondlife setup build museum.bat
+++ /dev/null
@@ -1,7 +0,0 @@
1@rem Invoke the script which preps then runs the installer.
2@rem This batch file is customized per grid.
3
4set LOGINPAGEURL=http://secondlife.com/app/login/beta/
5set ARGS=/DMUSEUM
6
7"secondlife setup build.bat" %LOGINPAGEURL% %ARGS%
diff --git a/linden/indra/newview/secondlife setup build shakti.bat b/linden/indra/newview/secondlife setup build shakti.bat
index 7d5a13c..37aff9b 100644
--- a/linden/indra/newview/secondlife setup build shakti.bat
+++ b/linden/indra/newview/secondlife setup build shakti.bat
@@ -1,7 +1,4 @@
1@rem Invoke the script which preps then runs the installer. 1@rem Invoke the script which preps then runs the installer.
2@rem This batch file is customized per grid. 2@rem This batch file is customized per grid.
3 3
4set LOGINPAGEURL=http://secondlife.com/app/login/beta/ 4@"secondlife setup build.bat" --grid=shakti \ No newline at end of file
5set ARGS=/DSHAKTI
6
7"secondlife setup build.bat" %LOGINPAGEURL% %ARGS%
diff --git a/linden/indra/newview/secondlife setup build siva.bat b/linden/indra/newview/secondlife setup build siva.bat
index 300df17..ae66128 100644
--- a/linden/indra/newview/secondlife setup build siva.bat
+++ b/linden/indra/newview/secondlife setup build siva.bat
@@ -1,7 +1,4 @@
1@rem Invoke the script which preps then runs the installer. 1@rem Invoke the script which preps then runs the installer.
2@rem This batch file is customized per grid. 2@rem This batch file is customized per grid.
3 3
4set LOGINPAGEURL=http://secondlife.com/app/login/beta/ 4@"secondlife setup build.bat" --grid=siva
5set ARGS=/DSIVA
6
7"secondlife setup build.bat" %LOGINPAGEURL% %ARGS%
diff --git a/linden/indra/newview/secondlife setup build soma.bat b/linden/indra/newview/secondlife setup build soma.bat
index eed8e5b..c7a9f64 100644
--- a/linden/indra/newview/secondlife setup build soma.bat
+++ b/linden/indra/newview/secondlife setup build soma.bat
@@ -1,7 +1,4 @@
1@rem Invoke the script which preps then runs the installer. 1@rem Invoke the script which preps then runs the installer.
2@rem This batch file is customized per grid. 2@rem This batch file is customized per grid.
3 3
4set LOGINPAGEURL=http://secondlife.com/app/login/beta/ 4@"secondlife setup build.bat" --grid=soma
5set ARGS=/DSOMA
6
7"secondlife setup build.bat" %LOGINPAGEURL% %ARGS%
diff --git a/linden/indra/newview/secondlife setup build.bat b/linden/indra/newview/secondlife setup build.bat
index 169071f..df6dc72 100644
--- a/linden/indra/newview/secondlife setup build.bat
+++ b/linden/indra/newview/secondlife setup build.bat
@@ -12,63 +12,9 @@
12@REM "secondlife setup build.bat" http://secondlife.com/app/login/beta/ /DADITI 12@REM "secondlife setup build.bat" http://secondlife.com/app/login/beta/ /DADITI
13@REM 13@REM
14 14
15@IF EXIST ReleaseForDownload\Secondlife.exe GOTO RELEASE_EXE
16@IF EXIST Secondlife.exe GOTO LOCAL_EXE
17@IF EXIST ReleaseNoOpt\newview_noopt.exe GOTO RELEASE_NOOPT_EXE
18
19@echo Could not find Secondlife.exe!
20@pause
21exit 0
22
23:RELEASE_NOOPT_EXE
24@echo Cound not find SecondLife.exe.
25@echo Using newview_noopt.exe - DEVELOPMENT BUILD!
26@pause
27SET EXEFILE=ReleaseNoOpt\newview_noopt.exe
28SET KDUDLL=ReleaseNoOpt\llkdu.dll
29GOTO CONTINUE
30
31:RELEASE_EXE
32SET EXEFILE=ReleaseForDownload\Secondlife.exe
33SET KDUDLL=ReleaseForDownload\llkdu.dll
34GOTO CONTINUE
35
36:LOCAL_EXE
37SET EXEFILE=Secondlife.exe
38SET KDUDLL=..\..\libraries\i686-win32\lib_release\llkdu.dll
39:CONTINUE
40
41@rem Set login page to reflect beta grid status
42call "set_login_page.bat" %1
43
44@rem Extract version information.
45branding\ResHacker -extract %EXEFILE%, branding\version.rc, versioninfo, 1,
46
47@rem Process version information.
48cd branding
49grep FILEVERSION version.rc | gawk "{ print $2; }" > version.txt
50gawk -F , "{ print \"!define VERSION_MAJOR \" $1; }" version.txt > version.include
51gawk -F , "{ print \"!define VERSION_MINOR \" $2; }" version.txt >> version.include
52gawk -F , "{ print \"!define VERSION_PATCH \" $3; }" version.txt >> version.include
53gawk -F , "{ print \"!define VERSION_BUILD \" $4; }" version.txt >> version.include
54echo !define EXE_LOCATION %EXEFILE% >> version.include
55echo !define KDU_DLL %KDUDLL% >> version.include
56
57cd ..
58@rem Build installer
59"C:\Program Files\NSIS\makensis" %2 %3 %4 %5 %6 %7 %8 %9 "secondlife setup.nsi"
60
61@rem Clean up
62del branding\version.include
63del branding\version.rc
64del branding\version.txt
65del branding\ResHacker.log
66del branding\ResHacker.ini
67
68@rem Restore login page changes to avoid accidental commits
69call "restore_login_page.bat"
70
71 15
16@rem use manifest to build installer
17@"viewer_manifest.py" %1 %2 %3 %4 %5 %6 %7 %8
72 18
73@rem pause 19@rem pause
74 20
diff --git a/linden/indra/newview/set_login_page.bat b/linden/indra/newview/set_login_page.bat
deleted file mode 100644
index 5cbb77f..0000000
--- a/linden/indra/newview/set_login_page.bat
+++ /dev/null
@@ -1,45 +0,0 @@
1@echo off
2
3REM ============================================================
4REM set_login_page
5REM ============================================================
6REM
7REM Purpose:
8REM
9REM Modify the login page (panel_login.xml) to point to a
10REM specific URL for a viewer build, e.g. a viewer pointing
11REM at a beta grid.
12REM
13REM Usage:
14REM
15REM set_login_page.bat url
16REM
17REM Example:
18REM
19REM set_login_page.bat http://secondlife.com/app/login/beta/
20REM
21REM Notes:
22REM
23REM * Depends on branding\gawk.exe
24REM * gawk.exe needs to be a Win32 executable (not Win16)
25REM * It's pretty dumb, and replaces the regular expression:
26REM http://secondlife.com/app/login/.*
27
28set ORIGINAL=skins\xui\en-us\panel_login.xml
29set TEMPFILE=.\panel_login.xml
30set LOGINPAGEURL=%1
31
32IF defined LOGINPAGEURL GOTO do_replace
33goto end
34
35:do_replace
36
37echo Setting login page in %ORIGINAL% to "%LOGINPAGEURL%"
38
39copy %ORIGINAL% %TEMPFILE%
40branding\gawk.exe --assign=uri=%LOGINPAGEURL% "{ gsub( /http:\/\/secondlife\.com\/app\/login\/.*/, uri ); print; }" %TEMPFILE% > %ORIGINAL%
41
42REM Leave tempfile in place so it can be restored
43REM del %TEMPFILE%
44
45:END
diff --git a/linden/indra/newview/skins/textures/textures.xml b/linden/indra/newview/skins/textures/textures.xml
new file mode 100644
index 0000000..5bfb4d8
--- /dev/null
+++ b/linden/indra/newview/skins/textures/textures.xml
@@ -0,0 +1,391 @@
1<textures version = "101">
2 <closebox.tga value="47a8c844-cd2a-4b1a-be01-df8b1612fe5d"/>
3 <close_in_blue.tga value="e5821134-23c0-4bd0-af06-7fa95b9fb01a"/>
4 <tearoffbox.tga value="74e1a96f-4833-a24d-a1bb-1bce1468b0e7"/>
5 <tearoff_pressed.tga value="d2524c13-4ba6-af7c-e305-8ac6cc18d86a"/>
6 <resize_handle_bottom_right_blue.tga value="e3690e25-9690-4f6c-a745-e7dcd885285a"/>
7 <scrollbutton_up_out_blue.tga value="dad084d7-9a46-452a-b0ff-4b9f1cefdde9"/>
8 <scrollbutton_up_in_blue.tga value="a93abdf3-27b5-4e22-a8fa-c48216cd2e3a"/>
9 <scrollbutton_down_out_blue.tga value="b4ecdecf-5c8d-44e7-b882-17a77e88ed55"/>
10 <scrollbutton_down_in_blue.tga value="d2421bab-2eaf-4863-b8f6-5e4c52519247"/>
11 <scrollbutton_left_out_blue.tga value="43773e8d-49aa-48e0-80f3-a04715f4677a"/>
12 <scrollbutton_left_in_blue.tga value="ea137a32-6718-4d05-9c22-7d570d27b2cd"/>
13 <scrollbutton_right_out_blue.tga value="3d700d19-e708-465d-87f2-46c8c0ee7938"/>
14 <scrollbutton_right_in_blue.tga value="b749de64-e903-4c3c-ac0b-25fb6fa39cb5"/>
15 <spin_up_out_blue.tga value="56576e6e-6710-4e66-89f9-471b59122794"/>
16 <spin_up_in_blue.tga value="c8450082-96a0-4319-8090-d3ff900b4954"/>
17 <spin_down_out_blue.tga value="b6d240dd-5602-426f-b606-bbb49a30726d"/>
18 <spin_down_in_blue.tga value="a985ac71-052f-48e6-9c33-d931c813ac92"/>
19 <radio_active_false.tga value="7a1ba9b8-1047-4d1e-9cfc-bc478c80b63f"/>
20 <radio_active_true.tga value="52f09e07-5816-4052-953c-94c6c10479b7"/>
21 <radio_inactive_false.tga value="90688481-67ff-4af0-be69-4aa084bcad1e"/>
22 <radio_inactive_true.tga value="1975db39-aa29-4251-aea0-409ac09d414d"/>
23 <checkbox_enabled_false.tga value="05bb64ee-96fd-4243-b74e-f40a41bc53ba"/>
24 <checkbox_enabled_true.tga value="cf4a2ed7-1533-4686-9dde-df9a37ddca55"/>
25 <checkbox_disabled_false.tga value="7d94cb59-32a2-49bf-a516-9e5a2045f9d9"/>
26 <checkbox_disabled_true.tga value="c817c642-9abd-4236-9287-ae0513fe7d2b"/>
27 <tab_top_blue.tga value="1ed83f57-41cf-4052-a3b4-2e8bb78d8191"/>
28 <tab_top_selected_blue.tga value="16d032e8-817b-4368-8a4e-b7b947ae3889"/>
29 <tab_bottom_blue.tga value="bf0a8779-689b-48c3-bb9a-6af546366ef4"/>
30 <tab_bottom_selected_blue.tga value="c001d8fd-a869-4b6f-86a1-fdcb106df9c7"/>
31 <tab_left.tga value="1097dcb3-aef9-8152-f471-431d840ea89e"/>
32 <tab_left_selected.tga value="bea77041-5835-1661-f298-47e2d32b7a70"/>
33 <crosshairs.tga value="6e1a3980-bf2d-4274-8970-91e60d85fb52"/>
34 <move_backward_in.tga value="db11d956-5e7d-4aa5-b39d-7774d339fc5c"/>
35 <move_backward_out.tga value="3ae8bb18-ed97-4cd3-ae5c-d54bc8479fe7"/>
36 <move_down_in.tga value="b92a70b9-c841-4c94-b4b3-cee9eb460d48"/>
37 <move_down_out.tga value="b5abc9fa-9e62-4e03-bc33-82c4c1b6b689"/>
38 <move_forward_in.tga value="54197a61-f5d1-4c29-95d2-c071d08849cb"/>
39 <move_forward_out.tga value="a0eb4021-1b20-4a53-892d-8faa9265a6f5"/>
40 <move_left_in.tga value="724996f5-b956-46f6-9844-4fcfce1d5e83"/>
41 <move_left_out.tga value="82476321-0374-4c26-9567-521535ab4cd7"/>
42 <move_right_in.tga value="7eeb57d2-3f37-454d-a729-8b217b8be443"/>
43 <move_right_out.tga value="1fbe4e60-0607-44d1-a50a-032eff56ae75"/>
44 <move_turn_left_in.tga value="95463c78-aaa6-464d-892d-3a805b6bb7bf"/>
45 <move_turn_left_out.tga value="13a93910-6b44-45eb-ad3a-4d1324c59bac"/>
46 <move_turn_right_in.tga value="5e616d0d-4335-476f-9977-560bccd009da"/>
47 <move_turn_right_out.tga value="5a44fd04-f52b-4c30-8b00-4a31e27614bd"/>
48 <move_up_out.tga value="f887146d-829f-4e39-9211-cf872b78f97c"/>
49 <move_up_in.tga value="49b4b357-e430-4b56-b9e0-05b8759c3c82"/>
50 <cam_rotate_out.tga value="88745b46-da05-11d5-8ac0-0003477c4611"/>
51 <cam_rotate_in.tga value="70bf2262-3eed-4996-88ac-076907e8921d"/>
52 <cam_zoom_out.tga value="bb02e941-cb3b-4dd3-892a-6841b5de6e45"/>
53 <cam_zoom_plus_in.tga value="c7aefd32-ce13-4242-82cc-2631d44ff9d3"/>
54 <cam_zoom_minus_in.tga value="deed3f4b-93e9-4183-a3b0-a5a98a6de1bb"/>
55 <cam_tracking_out.tga value="95c4ea0e-e3c2-4904-b847-7d7676139ebb"/>
56 <cam_tracking_in.tga value="fe2fc73b-5a64-4a8e-aacc-46fa81faf96a"/>
57 <direction_arrow.tga value="586383e8-4d9b-4fba-9196-2b5938e79c2c"/>
58 <minimize.tga value="34c9398d-bb78-4643-9633-46a2fa3e9637"/>
59 <minimize_inactive.tga value="6e72abba-1378-437f-bf7a-f0c15f3e99a3"/>
60 <minimize_pressed.tga value="39801651-26cb-4926-af57-7af9352c273c"/>
61 <restore.tga value="111b39de-8928-4690-b7b2-e17d5c960277"/>
62 <restore_inactive.tga value="0eafa471-70af-4882-b8c1-40a310929744"/>
63 <restore_pressed.tga value="90a0ed5c-2e7b-4845-9958-a64a1b30f312"/>
64 <combobox_arrow.tga value="b31c1335-0e9c-4927-bc90-53277777d9c1"/>
65 <white.tga value="5748decc-f629-461c-9a36-a35a221fe21f"/>
66 <darkgray.tga value="267e26d3-e0e1-41b8-91b1-3b337102928d"/>
67 <lightgray.tga value="c520bf46-cc5d-412b-a60b-9f1bd245189f"/>
68 <eyes.tga value="6522e74d-1660-4e7f-b601-6f48c1659a77"/>
69 <hair.tga value="7ca39b4c-bd19-4699-aff7-f93fd03d3e7b"/>
70 <black.tga value="e2244626-f22f-4839-8123-1e7baddeb659"/>
71 <close_inactive_blue.tga value="779e4fa3-9b13-f74a-fba9-3886fe9c86ba"/>
72 <button_disabled_32x128.tga value="f8124d60-2875-c358-7847-2acb63e5400c"/>
73 <button_enabled_32x128.tga value="d8faf8cb-ee6e-b0b5-abd9-bde873ad3461"/>
74 <button_enabled_selected_32x128.tga value="1eddba75-b682-110a-104e-6cdcce616a25"/>
75 <button_anim_play_selected.tga value="119c37bb-24af-45fe-ae11-3a6bc3c85138"/>
76 <button_anim_pause_selected.tga value="ad65d67a-777b-fbfa-693d-4bdcfca2acca"/>
77 <button_anim_pause.tga value="db2d9c2d-0bbd-21e2-e83a-103ea2def7a8"/>
78 <button_anim_play.tga value="2a7f6738-5d82-2ff3-d419-30ed09cbb72b"/>
79 <button_anim_stop.tga value="e10c9e36-d9f6-c8b4-de96-557dccce9205"/>
80 <button_anim_stop_selected.tga value="b8c0e0aa-2771-439e-c919-d2f5dad69a1c"/>
81 <rounded_square.tga value="38ce8b3c-fb30-5c59-9926-bd643613f606"/>
82 <rounded_square_soft.tga value="4c95e6bc-fe77-9cb4-b58a-909848042c1e"/>
83 <badge_ok.tga value="211035a7-c313-378d-478c-e80bbd0fde63"/>
84 <badge_note.tga value="13f6e639-b3f9-28da-a1e6-e990a43052b6"/>
85 <badge_warn.tga value="0992d4bc-7af8-4a1f-f2e6-e6c4083b066e"/>
86 <badge_error.tga value="00c50485-8491-ab70-2ea8-43f26fd028e2"/>
87 <status_money.tga value="5863eb7a-1546-6501-533a-6061f73a36b7"/>
88 <status_health.tga value="4330e8ce-b39b-1eb8-c2ec-a97c0b3947b5"/>
89 <status_fly.tga value="0e058115-5b8f-c3d7-dcaa-9623d92885d1"/>
90 <status_build.tga value="175a6b75-45c9-c2c2-4765-bf37a3909b53"/>
91 <status_busy.tga value="beb0d821-6725-abdf-032d-1f70cdabde82"/>
92 <status_scripts.tga value="4cc1afcd-04dd-178f-e074-0f9dc730ab45"/>
93 <status_buy_currency.tga value="f43a535a-59ac-26e3-84bc-c786735fabe4"/>
94 <status_buy_currency_pressed.tga value="bfa5be70-37c7-8126-fecd-df55390954d5"/>
95 <status_buy_land.tga value="1a0edac5-3e50-fc9b-2752-70c1f69cb959"/>
96 <status_buy_land_pressed.tga value="257647b7-199f-99ff-8be9-f6753289a3aa"/>
97 <terrain_dirt.tga value="b8d3965a-ad78-bf43-699b-bff8eca6c975"/>
98 <terrain_grass.tga value="abb783e6-3e93-26c0-248a-247666855da3"/>
99 <terrain_mountain.tga value="179cdabd-398a-9b6b-1391-4dc333ba321f"/>
100 <terrain_rock.tga value="beb169c7-11ea-fff2-efe5-0f24dc881df2"/>
101 <terrain_dirt_detail.tga value="0bc58228-74a0-7e83-89bc-5c23464bcec5"/>
102 <terrain_grass_detail.tga value="63338ede-0037-c4fd-855b-015d77112fc8"/>
103 <terrain_mountain_detail.tga value="303cd381-8560-7579-23f1-f0a880799740"/>
104 <terrain_rock_detail.tga value="53a2f406-4895-1d13-d541-d2e3b86bc19c"/>
105 <square_btn_32x128.tga value="b28df901-6b8d-d31c-7903-4eb9676d4bfc"/>
106 <square_btn_selected_32x128.tga value="c48c9e95-191b-96d3-08b2-6e8ada58b651"/>
107 <tree_pine_1.tga value="0187babf-6c0d-5891-ebed-4ecab1426683"/>
108 <tree_oak.tga value="8a515889-eac9-fb55-8eba-d2dc09eb32c8"/>
109 <tree_tropical_1.tga value="5bc11cd6-2f40-071e-a8da-0903394204f9"/>
110 <tree_palm_1.tga value="ca4e8c27-473c-eb1c-2f5d-50ee3f07d85c"/>
111 <tree_dogwood.tga value="64367bd1-697e-b3e6-0b65-3f862a577366"/>
112 <tree_tropical_2.tga value="cdd9a9fc-6d0b-f90d-8416-c72b6019bca8"/>
113 <tree_palm_2.tga value="2d784476-d0db-9979-0cff-9408745a7cf3"/>
114 <tree_cypress_1.tga value="fb2ae204-3fd1-df33-594f-c9f882830e66"/>
115 <tree_cypress_2.tga value="30047cec-269d-408e-0c30-b2603b887268"/>
116 <tree_pine_2.tga value="d691a01c-13b7-578d-57c0-5caef0b4e7e1"/>
117 <tree_plumeria.tga value="6de37e4e-7029-61f5-54b8-f5e63f983f58"/>
118 <winter_tree_aspen.tga value="7c0cf89b-44b1-1ce2-dd74-07102a98ac2a"/>
119 <winter_tree_pine_1.tga value="10d2a01a-0818-84b9-4b96-c2eb63256519"/>
120 <winter_tree_pine_2.tga value="67931331-0c02-4876-1255-28770896c6a2"/>
121 <tree_eucalyptus.tga value="a6162133-724b-54df-a12f-51cd070ad6f3"/>
122 <tree_fern.tga value="8872f2b8-31db-42d8-580a-b3e4a91262de"/>
123 <tree_eelgrass.tga value="96b4de31-f4fa-337d-ec78-451e3609769e"/>
124 <tree_sea_sword.tga value="5894e2e7-ab8d-edfa-e61c-18cf16854ba3"/>
125 <tree_kelp_1.tga value="2caf1179-7861-6ff3-4b7d-46e17780bdfa"/>
126 <tree_kelp_2.tga value="2a4880b6-b7a3-690a-2049-bfbe38eafb9f"/>
127 <tree_beach_grass_1.tga value="18fb888b-e8f1-dce7-7da7-321d651ea6b0"/>
128 <tool_dozer.tga value="d2a0d4d4-54eb-4d16-be4b-4eae43845c74"/>
129 <tool_dozer_active.tga value="d4afdbbe-1550-4b7d-91de-95731f47e8e3"/>
130 <tool_land.tga value="86fe4df4-0ecb-4382-b9ae-475925a92388"/>
131 <tool_land_active.tga value="34e60587-0791-4a07-8918-f5995fcc22a3"/>
132 <tool_zoom.tga value="27eb8829-fe65-45ed-a49a-73aac42f4b38"/>
133 <tool_zoom_active.tga value="69445f58-5c8e-44e0-9d2e-47408bb43b39"/>
134 <tool_orbit.tga value="06964fe4-033f-448a-95c9-30dc41d1be8b"/>
135 <tool_orbit_active.tga value="ee4e07db-3f72-4098-bd4c-aef34515a7bc"/>
136 <tool_pan.tga value="a32aa302-0a15-48d2-b2b1-4d69f1161173"/>
137 <tool_pan_active.tga value="24d9ad33-0b42-4eb5-99a3-659d838bc5c0"/>
138 <inv_folder_texture.tga value="743f035b-a049-43f4-16c7-7ec8daa2c481"/>
139 <inv_folder_sound.tga value="e10cb910-1e71-da47-bd12-8c53f7793714"/>
140 <inv_folder_callingcard.tga value="a3735971-e2b2-d78a-580d-d265cd8f2484"/>
141 <inv_folder_landmark.tga value="9f921155-7c8c-e276-d5ec-03ac9340584d"/>
142 <inv_folder_script.tga value="baa5c310-6a6d-cc48-51eb-65196ba31d77"/>
143 <inv_folder_object.tga value="113e5133-fd0d-ee51-4a59-9d67ca10e8a7"/>
144 <inv_folder_notecard.tga value="a9e75d84-5073-9cb7-10a9-1ca68ef5c7ba"/>
145 <inv_folder_clothing.tga value="f1427d3d-b2e8-97c4-69ab-1f36d4c0e8f0"/>
146 <inv_folder_bodypart.tga value="1fe05580-1d2f-0345-b28b-52b6e3a20e5d"/>
147 <inv_folder_trash.tga value="88ad072e-ea0b-aabd-5ac0-b37862a6eb66"/>
148 <inv_folder_plain_closed.tga value="86f00960-c3e9-9680-145d-3beffd743e9c"/>
149 <inv_folder_plain_open.tga value="d15dc243-2d0b-47af-0ce1-ec376464bdc8"/>
150 <inv_folder_snapshot.tga value="6efe85e7-800f-1843-296c-a5b7adffe091"/>
151 <inv_folder_lostandfound.tga value="9a371a04-297d-bacf-0d16-5f49753efe1d"/>
152 <inv_folder_animation.tga value="4d59b3ee-f29d-b912-2bcc-9bb1f8a07ec6"/>
153 <inv_folder_gesture.tga value="4de9129a-9fc1-d759-d739-364293906ba2"/>
154 <inv_item_texture.tga value="19f452d7-4eee-9f46-76cc-5497d17f1dd9"/>
155 <inv_item_sound.tga value="eb414d69-c77d-d4e7-66e6-6c2e6f6c1976"/>
156 <inv_item_callingcard_online.tga value="672cc53e-8dc0-ba91-2a4e-574104cf071c"/>
157 <inv_item_callingcard_offline.tga value="d0afe86b-2489-7600-55b7-6abb0a63d9f9"/>
158 <inv_item_landmark.tga value="bf25a2a0-85da-7fa0-0993-e461768d0221"/>
159 <inv_item_landmark_visited.tga value="229fac85-5428-4ab7-adeb-eb8389e91092"/>
160 <inv_item_script.tga value="59a3df81-ed76-06c9-7264-6dada535e7a3"/>
161 <inv_item_clothing.tga value="34dfe476-8e26-0e3a-11cf-76cc4a7126ce"/>
162 <inv_item_object.tga value="0f0780a0-89c4-742a-ef28-26405a41cf85"/>
163 <inv_item_notecard.tga value="23ce8a2c-9ea2-d863-6572-806f0645b0c7"/>
164 <inv_item_bodypart.tga value="d2a5362d-5c55-57dd-a9e9-5c814d1ddc16"/>
165 <inv_item_attach.tga value="5bcae41e-aa5d-02f8-edf1-605ebdd875ab"/>
166 <inv_item_snapshot.tga value="3810d584-b092-7caa-57e0-010f192b9659"/>
167 <inv_item_eyes.tga value="eaa5fd96-5c25-06ef-2280-7ef20203e167"/>
168 <inv_item_gloves.tga value="117b11cb-c04e-5081-13da-1a8846070fd0"/>
169 <inv_item_hair.tga value="6bca3bf4-ed6d-d438-63a0-2a7066d03a0b"/>
170 <inv_item_jacket.tga value="8df59386-56e0-c811-0443-840da3acb3a5"/>
171 <inv_item_pants.tga value="a87a58ca-f857-63b1-0acf-072711ed1bdb"/>
172 <inv_item_shape.tga value="4463e433-4db5-79ef-c1b0-4821b03ddb07"/>
173 <inv_item_shirt.tga value="e2ffb62b-6abc-22d6-952d-764759b4d636"/>
174 <inv_item_shoes.tga value="cf384fa5-1edd-c37c-2134-283dd4fe3396"/>
175 <inv_item_skirt.tga value="0b43f826-2abc-2944-7d72-10777a51d19b"/>
176 <inv_item_socks.tga value="22137c6d-6ec5-6eee-9a2e-2d7a9e6cbcd4"/>
177 <inv_item_underpants.tga value="2f15dc09-4385-526c-aa5d-d9d516ec7d99"/>
178 <inv_item_undershirt.tga value="f72ab629-a3ab-de0c-35c0-5285e27478ce"/>
179 <inv_item_animation.tga value="b5cda0d6-d196-ce48-63db-d04323ef8931"/>
180 <inv_item_gesture.tga value="5579245d-d5bf-5f13-46b0-8624490de24c"/>
181 <pixiesmall.tga value="168e6813-096e-07ea-97ae-fd416826f627"/>
182 <legend.tga value="ca7609c6-6ec6-32d9-332e-0d8f437ef644"/>
183 <propertyline.tga value="e3548c46-8d5e-03da-fcab-4fc36ad818bb"/>
184 <startup_logo.tga value="66864f3c-e095-d9c8-058d-d6575e6ed1b8"/>
185 <grass_texture_1.tga value="79504bf5-c3ec-0763-6563-d843de66d0a1"/>
186 <grass_texture_2.tga value="6c4727b8-ac79-ba44-3b81-f9aa887b47eb"/>
187 <grass_texture_3.tga value="99bd60a2-3250-efc9-2e39-2fbcadefbecc"/>
188 <grass_texture_4.tga value="7a2b3a4a-53c2-53ac-5716-aac7d743c020"/>
189 <undergrowth_1.tga value="8f458549-173b-23ff-d4ff-bfaa5ea2371b"/>
190 <silhouette.tga value="da5d4079-7819-6b53-d2a4-dc9929381d7d"/>
191 <avatar_thumb_bkgrnd.tga value="3a7f4f0d-be14-ee78-29e3-fc8b0b2a68d3"/>
192 <missing_asset.tga value="32dfd1c8-7ff6-5909-d983-6d4adfb4255d"/>
193 <alpha_gradient.tga value="e97cf410-8e61-7005-ec06-629eba4cd1fb"/>
194 <alpha_gradient_2d.tga value="38b86f85-2575-52a9-a531-23108d8da837"/>
195 <alpha_noise.tga value="b9e1cf8a-9660-c020-0c69-18f1ea27268a"/>
196 <alpha_sizzle.tga value="e121e2fc-7573-740f-edfd-0d45a9ba486e"/>
197 <bump_woodgrain.tga value="058c75c0-a0d5-f2f8-43f3-e9699a89c2fc"/>
198 <bump_bark.tga value="6c9fa78a-1c69-2168-325b-3e03ffa348ce"/>
199 <bump_bricks.tga value="b8eed5f0-64b7-6e12-b67f-43fa8e773440"/>
200 <bump_checker.tga value="9deab416-9c63-78d6-d558-9a156f12044c"/>
201 <bump_concrete.tga value="db9d39ec-a896-c287-1ced-64566217021e"/>
202 <bump_crustytile.tga value="f2d7b6f6-4200-1e9a-fd5b-96459e950f94"/>
203 <bump_cutstone.tga value="d9258671-868f-7511-c321-7baef9e948a4"/>
204 <bump_discs.tga value="d21e44ca-ff1c-a96e-b2ef-c0753426b7d9"/>
205 <bump_gravel.tga value="4726f13e-bd07-f2fb-feb0-bfa2ac58ab61"/>
206 <bump_petridish.tga value="e569711a-27c2-aad4-9246-0c910239a179"/>
207 <bump_siding.tga value="073c9723-540c-5449-cdd4-0e87fdc159e3"/>
208 <bump_stonetile.tga value="ae874d1a-93ef-54fb-5fd3-eb0cb156afc0"/>
209 <bump_stucco.tga value="92e66e00-f56f-598a-7997-048aa64cde18"/>
210 <bump_suction.tga value="83b77fc6-10b4-63ec-4de7-f40629f238c5"/>
211 <bump_weave.tga value="735198cf-6ea0-2550-e222-21d3c6a341ae"/>
212 <icon_avatar_online.tga value="529ed15b-3d41-dcc1-79de-90bf21770b5b"/>
213 <icon_avatar_offline.tga value="34648c67-5bfb-5790-e05e-8bd6600fd087"/>
214 <icon_event.tga value="be235ae0-53cf-1d68-b3ae-cf375ed1fb58"/>
215 <icon_event_mature.tga value="cc090999-1b3e-2e97-7a38-c9f4afd10297"/>
216 <icon_group.tga value="04237108-a879-5a95-9b0c-b18fd09bc447"/>
217 <icon_place.tga value="ba0bac4e-815e-14e1-2895-5065b8c703b3"/>
218 <icon_top_pick.tga value="77ca91a2-4431-aeaf-6249-3dd99c7dd86d"/>
219 <icon_popular.tga value="bdd47da5-5b5b-c906-37ad-16aaa64f096f"/>
220 <icon_for_sale.tga value="f20728fd-1670-3771-2293-e0dd3f0bcaab"/>
221 <icon_auction.tga value="96abf5b1-335c-6b76-61e3-74ada07f3cb8"/>
222 <icon_land_for_landless.tga value="c421ddf2-b9d7-b373-503c-f4c423f37f1c"/>
223 <icon_day_cycle.tga value="5b30a285-f1e3-92b1-dcd3-0d07366ced3e"/>
224 <icon_lock.tga value="9beb8cdd-3dce-53c2-b28e-e1f3bc2ec0a4"/>
225 <noentrylines.tga value="5d3e196b-fd4d-ada7-e4c1-99f8e9f1cfbf"/>
226 <noentrypasslines.tga value="ac8f8627-6a30-8da8-d4bd-958668eea7a0"/>
227 <notify_tip_icon.tga value="74ba3584-58ea-9984-5b76-62d37942ab77"/>
228 <notify_box_icon.tga value="b2ef2d31-9714-a07b-6ca7-31638166364b"/>
229 <notify_next.tga value="07d0ea4c-af0c-aad1-dbbf-c24020ff2b80"/>
230 <map_avatar_you_8.tga value="02fbdc40-5e07-a6e1-228b-58e10f8335b7"/>
231 <map_avatar_8.tga value="0be58a91-8065-c02b-7a12-2cc14dddbc37"/>
232 <map_avatar_16.tga value="db0dadd5-026a-88cf-f5c1-523a0a2daa3e"/>
233 <map_telehub.tga value="bf1b2bb0-13b1-40ae-3354-b1b93761bdb4"/>
234 <map_infohub.tga value="85b1a79a-7f6c-9df3-4d6c-17b1a4efb55a"/>
235 <map_home.tga value="ae9b8f5f-03a1-2e71-db77-6eb27a1ba181"/>
236 <map_event.tga value="6008be5e-9267-2a3a-9798-e81b076c22ca"/>
237 <map_event_mature.tga value="f9cdba28-a227-d613-2f16-ce06209314ae"/>
238 <map_track_8.tga value="bfdc7bf6-e2ee-1754-f4df-cc25887714ad"/>
239 <map_track_16.tga value="a3878395-ef00-a0e6-ee9a-f45ed6b9ce59"/>
240 <object_cone.tga value="c2b8c90a-7dca-26e3-1a63-7aa4a0389cf9"/>
241 <object_cone_active.tga value="cf69c64b-f19e-e1f3-a586-42fef31a23be"/>
242 <object_cube.tga value="70c747ac-1de3-a8b9-514d-101753ca6ccb"/>
243 <object_cube_active.tga value="f9c5e213-1076-7a7d-7889-52388aad2c1a"/>
244 <object_cylinder.tga value="13e35d95-5f6c-9a91-1766-49dedf9b1267"/>
245 <object_cylinder_active.tga value="3f3e4932-8412-e2a7-cfe9-92caf5978b1b"/>
246 <object_grass.tga value="7ca8e672-920b-4653-3970-1abc91abef58"/>
247 <object_grass_active.tga value="d0fc7cc9-646a-6860-cf7c-1d9e58cd6dab"/>
248 <object_hemi_cone.tga value="69d5e60c-739a-40b1-b526-84072121e394"/>
249 <object_hemi_cone_active.tga value="2e0c5435-95bb-1c0d-5da1-42336fb1cfc0"/>
250 <object_hemi_cylinder.tga value="f4be3e06-24a8-f86e-acc7-7daefc0572b7"/>
251 <object_hemi_cylinder_active.tga value="67279486-cfc1-3633-de42-85db65db373c"/>
252 <object_hemi_sphere.tga value="b67251ab-1716-b9fb-f911-967ba3fe027b"/>
253 <object_hemi_sphere_active.tga value="6c489466-3058-6475-6b1b-e5fc1d49f1f3"/>
254 <object_pyramid.tga value="9dde8b56-2cc4-a932-b63a-38c3a83221ad"/>
255 <object_pyramid_active.tga value="e7217b1a-e3d8-e339-d28a-d7714d0b5bee"/>
256 <object_sphere.tga value="7fa122c0-b994-460e-8636-cdc451d67268"/>
257 <object_sphere_active.tga value="f2c3bcbc-2904-41a5-1c22-688f176fd1ee"/>
258 <object_tetrahedron.tga value="e17db404-9fc5-9534-1038-777c82b2771f"/>
259 <object_tetrahedron_active.tga value="2792ea3b-c052-85fe-d168-a62b2f4e9d7c"/>
260 <object_tree.tga value="710d1bec-fb33-28f1-e77e-ddbb5b51f5ed"/>
261 <object_tree_active.tga value="da4835c7-b12a-41dd-11db-dae452f040c2"/>
262 <object_prism.tga value="02935f3a-dcda-3b42-1874-da89d4c12870"/>
263 <object_prism_active.tga value="223aac97-bd2f-ec2e-ad45-5641b77c78f9"/>
264 <object_torus.tga value="19e1f4c9-6aa6-4414-981d-59a1343a6472"/>
265 <object_torus_active.tga value="ef2bca77-5004-4547-b00a-3b96e463f89f"/>
266 <object_tube.tga value="7ce81316-a478-480f-961c-435fcbdecaf0"/>
267 <object_tube_active.tga value="55c3e4d1-cfdc-48a8-af32-a34844b91832"/>
268 <object_ring_active.tga value="2c955a73-fa31-237b-a4a1-5c8ede3bae50"/>
269 <object_ring.tga value="a7610e41-4647-16d8-0e0e-85a1211c1596"/>
270 <container_animation.tga value="c4e657a1-4c86-0159-2da0-32ff948484e6"/>
271 <container_bodypart.tga value="770cb2df-758d-34d5-36c7-e3de06db5b5d"/>
272 <container_clothing.tga value="dd90406f-4c8f-a3f9-41df-d562f94f09e0"/>
273 <container_gesture.tga value="59cd31c0-2791-3c48-f740-f0a36c68653e"/>
274 <container_landmark.tga value="24c63386-04f7-ce6f-4ff2-dfb215d2e21f"/>
275 <container_many_things.tga value="849d3292-d9fa-7186-5465-dd7b5fc1ec48"/>
276 <container_object.tga value="ad887ae1-2bee-f2c9-6786-5599de3c95c4"/>
277 <container_script.tga value="b93bd494-c4bd-bcdf-4a59-35a9497d03f3"/>
278 <container_sound.tga value="5ddea031-cfa3-2776-43e3-c7146c1b4cd6"/>
279 <container_texture.tga value="b3f95caf-bd62-bef3-0ded-dea752920629"/>
280 <fringe.tga value="8ac54e9d-ec09-d804-60ab-47404a9b4a36"/>
281 <foot_shadow.tga value="14e8a47d-1055-0a68-5d55-eafd9ad3da5b"/>
282 <img_smoke_poof.tga value="c734da52-f2ba-f0ba-d59e-15ea49f3d5e9"/>
283 <img_shot.tga value="173b05c7-53a9-4cf8-ce6b-5eec21c5c63f"/>
284 <folder_arrow.tga value="09a324a8-acc1-d9cd-2cbd-7465d90d3a98"/>
285 <color_swatch_alpha.tga value="f13db22f-c55c-8bdf-7b1c-221e56fde253"/>
286 <script_error.tga value="e5a0ec29-f59e-d29e-2c59-ed66c187c26c"/>
287 <status_script_debug.tga value="7775b5cc-93a5-6efd-0d9b-4e079afac217"/>
288 <water_normal.tga value="822ded49-9a6c-f61c-cb89-6df54f42cdf4"/>
289 <icon_groupnotice.tga value="21579c81-a85e-f11c-2d80-33a4c007d88c"/>
290 <icon_groupnoticeinventory.tga value="8fcca699-08e7-3d58-2f05-86c9d52bbe82"/>
291 <tab_background_lightgrey.tga value="c769e547-c307-43ca-2b6a-51cad6d1c527"/>
292 <tab_background_purple.tga value="0ae8a2e9-aff4-249c-fc4a-0f41f89847dd"/>
293 <tab_background_darkpurple.tga value="38ff4f7e-3078-a749-8302-d6cc94b404c4"/>
294 <smicon_warn.tga value="f47c17a3-8bfb-3c9f-22b8-77923de7eed9"/>
295 <uv_test1.tga value="f43b75f5-9aa5-18ec-d5d9-e6d1b8442613"/>
296 <uv_test2.tga value="300ce95f-3d3f-7c1a-3a22-3fc48f873fb9"/>
297 <eye_button_active.tga value="2b42b375-f9b4-788e-46c7-7ef38762d0ba"/>
298 <eye_button_inactive.tga value="be1b7225-98b5-eb2a-2c86-ddaae3328a6e"/>
299 <account_id_blue.tga value="6ab9179a-7308-58db-6c9d-893d3b52bece"/>
300 <account_id_orange.tga value="fbe89371-1251-4e77-d2d8-8eeccffe3ca8"/>
301 <account_id_green.tga value="3bf64d5a-38d3-b752-cf52-3d9f8fca353a"/>
302 <status_push.tga value="07d1f523-e327-4d10-20d6-8bc22a6e8f56"/>
303 <ff_visible_online.tga value="d609a41f-34c0-7aae-b2c6-2fc3ab26d916"/>
304 <ff_visible_map.tga value="20b52706-c1ab-414a-9dea-1cb788ad5689"/>
305 <ff_edit_mine.tga value="1baee0b9-4b89-39eb-8815-866d82300ab5"/>
306 <ff_edit_theirs.tga value="32e981cd-4700-da5a-7fc7-d573ec3742f4"/>
307 <inv_item_script_dangerous.tga value="0b502db8-6fcd-c442-ecfe-483a0dce875e"/>
308 <ff_visible_map_button.tga value="c1079bef-5cf9-90f3-6dcd-48989851c252"/>
309 <ff_visible_online_button.tga value="36749b47-93d6-2c5e-7ebd-d38d30311163"/>
310 <ff_edit_theirs_button.tga value="ca229f65-d7e0-133e-1bc2-674abc33f3d5"/>
311 <ff_edit_mine_button.tga value="57f05b46-63d8-c3d5-66d6-8b915746b956"/>
312 <ff_online_status_button.tga value="3b1b6a53-9c8c-568a-22c5-2a8f3e5286f5"/>
313 <oi_hud_cen_0_0.tga value="3c650257-9caf-7cad-b26c-84c9eca560f1"/>
314 <oi_hud_intro.tga value="7611fb3d-9ff2-abd3-d98f-805c1c87e757"/>
315 <oi_hud_underwater.tga value="cde61aea-83c2-3001-d598-6b348f7a8e0b"/>
316 <oi_hud_got_passport.tga value="1271838d-d777-b811-7c4c-2a00308bd80a"/>
317 <oi_hud_texture_off_edge.tga value="852be205-b1ea-6356-58c8-8c5ee5a841a6"/>
318 <oi_hud_texture_on_edge.tga value="ab11e6ff-a732-be70-67df-c43131274562"/>
319 <oi_hud_flyingabovewater.tga value="c9d150d6-2739-5f8b-cce6-3cf98242920a"/>
320 <oi_hud_walkingabovewater.tga value="78284eeb-05f3-ff25-11a0-3cc9dbb30f0c"/>
321 <oi_hud_landmark.tga value="6cd9c221-9d42-a283-256b-09a113a87271"/>
322 <oi_hud_cus_5_3.tga value="7c12f4fb-f502-26d1-a2f3-cdb6aff61663"/>
323 <oi_hud_cus_5_2.tga value="c52c9c94-adc0-0f4e-6658-ed33d6ea8829"/>
324 <oi_hud_cus_5_1.tga value="9f6d5d11-6ca9-608c-e8a6-b77989350292"/>
325 <oi_hud_cus_5_0.tga value="2000cff1-119f-2023-66c0-ac5630d2f96e"/>
326 <oi_hud_cus_4_5.tga value="f302a935-ccd1-e2f5-3a38-e185cc262f3a"/>
327 <oi_hud_cus_4_3.tga value="af8d5b3c-b40f-cea5-b0b2-440fbd84a11a"/>
328 <oi_hud_cus_4_2.tga value="11b26901-8207-12bc-5224-10a12ac4c651"/>
329 <oi_hud_cus_4_1.tga value="41baadb7-1b94-907e-9443-54e92bba77cd"/>
330 <oi_hud_cus_4_0.tga value="9d627f8e-092c-5d32-6c12-ef76ab81cedc"/>
331 <oi_hud_cus_3_4.tga value="b196486e-d0d2-4fd7-529a-c84b4495fc74"/>
332 <oi_hud_cus_3_2.tga value="0b81c4bb-de33-e493-7bcb-e7221d97e5e7"/>
333 <oi_hud_cus_3_1.tga value="436dab74-25ae-8b60-c648-50663b7faa1d"/>
334 <oi_hud_cus_3_0.tga value="6c1594de-1e66-273c-a2ab-8f0ffa8b4633"/>
335 <oi_hud_cus_2_4.tga value="bb31fe48-8566-eec0-e96b-64025f832b63"/>
336 <oi_hud_cus_2_2.tga value="c946959a-26ae-eb66-efa0-20154057789d"/>
337 <oi_hud_cus_2_1.tga value="c946959a-26ae-eb66-efa0-20154057789d"/>
338 <oi_hud_cus_2_0.tga value="d7833106-b4a8-7666-bde1-64886de289f9"/>
339 <oi_hud_cus_1_0.tga value="811ded22-5940-940c-4821-6fbbfb6611d6"/>
340 <oi_hud_cus_1_1.tga value="eda8513b-a343-5109-1fd6-f1c7ad89b703"/>
341 <oi_hud_cus_1_2.tga value="7a4ce18c-e715-34d4-dfee-704c270a8ac8"/>
342 <oi_hud_cus_1_4.tga value="d3771c15-ac03-b762-b992-d9fd2fedf38a"/>
343 <oi_hud_com_4_4.tga value="d9e1e90d-3cc3-6269-128e-67f7a2b32d26"/>
344 <oi_hud_com_4_2.tga value="0f649a26-6fdb-c73b-ffac-e50fc311d5ce"/>
345 <oi_hud_com_4_1.tga value="ae5b1ce6-a2d2-22d2-f532-6280b3bc6adb"/>
346 <oi_hud_com_4_0.tga value="12cda3a0-58c7-dfa8-7f9b-380e5bb8baf9"/>
347 <oi_hud_com_3_4.tga value="ff326257-0530-356a-e0f8-be535044e540"/>
348 <oi_hud_com_3_2.tga value="66740ddb-1d56-89f9-f0c9-ae5eb7bb9537"/>
349 <oi_hud_com_3_1.tga value="55d662f4-6a28-6388-7c75-af1c9fd33055"/>
350 <oi_hud_com_3_0.tga value="de9d318f-b69e-82f9-0c61-43b868c5ca6b"/>
351 <oi_hud_com_2_4.tga value="01d47e68-400a-d0e1-afb7-d6806d1d477e"/>
352 <oi_hud_com_2_0.tga value="09c98850-27d4-6a12-abae-4af4bba23b6b"/>
353 <oi_hud_com_1_3.tga value="5c2049b9-f797-6608-ca71-758f3716aa90"/>
354 <oi_hud_com_1_1.tga value="1116ff68-cdc4-1cfc-e137-30f8426afeda"/>
355 <oi_hud_com_1_0.tga value="bd847d31-f5af-95f7-2b9c-af47d8ba53bd"/>
356 <oi_hud_nav_4_5.tga value="66194280-b087-db94-35d9-41e8f7518515"/>
357 <oi_hud_nav_4_4.tga value="180c4241-e309-4c05-13ee-9080ab69498d"/>
358 <oi_hud_nav_4_3.tga value="e98a6ba6-99c6-fa15-84b6-9afadea6c467"/>
359 <oi_hud_nav_4_2.tga value="2e19f352-1893-59a9-949b-4d2cfd3a8222"/>
360 <oi_hud_nav_4_1.tga value="13a1675b-fb5a-19b3-b5a3-74b0a6765f7d"/>
361 <oi_hud_nav_4_0.tga value="e7526e8d-b085-b26c-b0ae-2708ec231401"/>
362 <oi_hud_nav_3_5.tga value="5e67b0d0-29a2-6a08-c85e-b12d59e53d6e"/>
363 <oi_hud_nav_3_4.tga value="2ed8fbc2-5c4d-53c2-b289-88baffceab1a"/>
364 <oi_hud_nav_3_3.tga value="e0a72f1a-282e-1c1a-2cb7-6423feb41759"/>
365 <oi_hud_nav_3_2.tga value="4bcebb23-da5e-47d9-eac1-e4453f762c8c"/>
366 <oi_hud_nav_3_1.tga value="6ac87575-330e-3a2d-3b80-a34e7b277e50"/>
367 <oi_hud_nav_3_0.tga value="f1451e8e-7310-9152-47d5-5d037c28fef3"/>
368 <oi_hud_nav_2_6.tga value="c60b42ff-ee60-98e4-e603-ca2470141d4b"/>
369 <oi_hud_nav_2_5.tga value="a02b5a1a-bbdb-5556-ae5b-a2e68494755a"/>
370 <oi_hud_nav_2_4.tga value="625535ab-8abf-b3e7-48fb-43f728b77c79"/>
371 <oi_hud_nav_2_3.tga value="00a609c3-5750-3b5a-3ce3-458bdf632203"/>
372 <oi_hud_nav_2_2.tga value="94903387-d37f-092c-e4d2-c190f68577b8"/>
373 <oi_hud_nav_2_1.tga value="ee0cd82c-6ce8-8e73-307b-6d0dc77b19e8"/>
374 <oi_hud_nav_2_0.tga value="3e10b379-ed2c-7424-1fe7-bef3558c7536"/>
375 <oi_hud_nav_1_4.tga value="bf8d0be8-2012-1664-3ea5-e69a71c206e9"/>
376 <oi_hud_nav_1_2.tga value="72100f87-18a7-fc4a-4793-de281e8b02cc"/>
377 <oi_hud_nav_1_1.tga value="b048faf3-60ce-c3a2-d034-36613449d377"/>
378 <oi_hud_nav_1_0.tga value="0ad45106-3b26-6448-0b90-feae8bd46c38"/>
379 <oi_hud_mov_4_5.tga value="7c4a45c2-37dd-312c-c6ab-20896dd0a5a6"/>
380 <oi_hud_mov_4_3.tga value="8a88da1c-3735-c71e-d48a-016df0798de4"/>
381 <oi_hud_mov_4_2.tga value="f55ae4d3-7d6a-e6ac-4cf7-03014ce14390"/>
382 <oi_hud_mov_4_1.tga value="1cc3fcf1-35c0-e222-27d2-6905cf5c4cee"/>
383 <oi_hud_mov_4_0.tga value="1ae592dc-46f4-616e-b7c6-0dff3e6f40e5"/>
384 <oi_hud_mov_3_4.tga value="831b39be-99fc-45bd-ba85-708f9dc93bfd"/>
385 <oi_hud_mov_3_2.tga value="9f7e7373-92a9-d66a-ad5a-afb55ca6ac1f"/>
386 <oi_hud_mov_3_1.tga value="ab37ed0d-7e66-1f77-3acf-b0fe4b74dbe8"/>
387 <oi_hud_mov_3_0.tga value="f5ff1f08-4c92-8606-1854-cc5b9d3e445c"/>
388 <oi_hud_mov_1_2.tga value="1e3abeed-e893-c44e-1f9d-5ecc76d21e5d"/>
389 <oi_hud_mov_1_0.tga value="e300fc95-aa94-8e31-c501-ce903cac8b7c"/>
390</textures>
391
diff --git a/linden/indra/newview/skins/xui/de/floater_account_history.xml b/linden/indra/newview/skins/xui/de/floater_account_history.xml
deleted file mode 100644
index a6c3e32..0000000
--- a/linden/indra/newview/skins/xui/de/floater_account_history.xml
+++ /dev/null
@@ -1,4 +0,0 @@
1<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
2<floater name="money history floater" title="Konto-Verlauf">
3 <button label="Mehr Details..." label_selected="Mehr Details..." name="details_btn" />
4</floater>
diff --git a/linden/indra/newview/skins/xui/de/panel_account_details.xml b/linden/indra/newview/skins/xui/de/panel_account_details.xml
deleted file mode 100644
index 03c58df..0000000
--- a/linden/indra/newview/skins/xui/de/panel_account_details.xml
+++ /dev/null
@@ -1,7 +0,0 @@
1<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
2<panel label="Details" name="account_details_panel">
3 <button label="&lt; Früher" label_selected="&lt; Früher" name="earlier_btn"
4 tool_tip="In der Zeit zurückgehen" />
5 <button label="Später &gt;" label_selected="Später &gt;" name="later_btn"
6 tool_tip="In der Zeit vorgehen" />
7</panel>
diff --git a/linden/indra/newview/skins/xui/de/panel_account_planning.xml b/linden/indra/newview/skins/xui/de/panel_account_planning.xml
deleted file mode 100644
index 1065bae..0000000
--- a/linden/indra/newview/skins/xui/de/panel_account_planning.xml
+++ /dev/null
@@ -1,2 +0,0 @@
1<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
2<panel label="Planung" name="account_planning_panel" />
diff --git a/linden/indra/newview/skins/xui/de/panel_account_transactions.xml b/linden/indra/newview/skins/xui/de/panel_account_transactions.xml
deleted file mode 100644
index d7844ad..0000000
--- a/linden/indra/newview/skins/xui/de/panel_account_transactions.xml
+++ /dev/null
@@ -1,7 +0,0 @@
1<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
2<panel label="Verkäufe/Geschenke" name="account_sales_panel">
3 <button label="&lt; Früher" label_selected="&lt; Früher" name="earlier_btn"
4 tool_tip="In der Zeit zurückgehen" />
5 <button label="Später &gt;" label_selected="Später &gt;" name="later_btn"
6 tool_tip="In der Zeit vorgehen" />
7</panel>
diff --git a/linden/indra/newview/skins/xui/en-us/alerts.xml b/linden/indra/newview/skins/xui/en-us/alerts.xml
index 0030cfb..aa0f67e 100644
--- a/linden/indra/newview/skins/xui/en-us/alerts.xml
+++ b/linden/indra/newview/skins/xui/en-us/alerts.xml
@@ -346,6 +346,19 @@ Community Standards.
346your name, image, and &apos;About&apos; text on the [SECOND_LIFE] website. 346your name, image, and &apos;About&apos; text on the [SECOND_LIFE] website.
347 </message> 347 </message>
348 </alert> 348 </alert>
349 <alert modal="true" name="ClickPartnerHelpAvatar">
350 <message name="message">
351You can propose to another Resident or dissolve an existing partnership through the [SECOND_LIFE] website.
352
353Go to the Second Life web site for more information on partnering?
354 </message>
355 <option name="GotoPage">
356 Go to Page
357 </option>
358 <option name="Cancel">
359 Cancel
360 </option>
361 </alert>
349 <alert modal="true" name="ClickWebProfileHelpAvatar"> 362 <alert modal="true" name="ClickWebProfileHelpAvatar">
350 <message name="message"> 363 <message name="message">
351 If this resident has a web profile URL set then you can: 364 If this resident has a web profile URL set then you can:
@@ -794,6 +807,17 @@ Apply those changes and quit
794 Cache will be cleared after you restart [SECOND_LIFE]. 807 Cache will be cleared after you restart [SECOND_LIFE].
795 </message> 808 </message>
796 </alert> 809 </alert>
810 <alert modal="true" name="CacheWillBeMoved">
811 <message name="message">
812 Cache will be moved after you restart [SECOND_LIFE].
813Note: This will clear the cache.
814 </message>
815 </alert>
816 <alert modal="true" name="ChangeConnectionPort">
817 <message name="message">
818 Port settings take effect after you restart [SECOND_LIFE].
819 </message>
820 </alert>
797 <alert modal="true" name="GoToAuctionPage"> 821 <alert modal="true" name="GoToAuctionPage">
798 <message name="message"> 822 <message name="message">
799 Go to the [SECOND_LIFE] web page to see auction details 823 Go to the [SECOND_LIFE] web page to see auction details
@@ -2736,61 +2760,6 @@ also appear higher when people search for keywords.
2736 Cancel 2760 Cancel
2737 </option> 2761 </option>
2738 </alert> 2762 </alert>
2739 <alert modal="true" name="WebLaunchGraphicsDriver">
2740 <message name="message">
2741 Your [VENDOR_LABLE] [CARD_NAME] graphics driver on this computer is out of date.
2742
2743This is a piece of software that controls your graphics card.
2744Old drivers can cause 3D graphics programs like [SECOND_LIFE] to run slowly or crash.
2745
2746We strongly recommend upgrading to the &quot;[DRIVER_NAME]&quot; driver, available for free download from [VENDOR_LABLE].
2747
2748Would you like to go to the [SECOND_LIFE] drivers web page?
2749 </message>
2750 <ignore>
2751 When launching web browser to view driver update page
2752 </ignore>
2753 <option name="Gotopage">
2754 Go to page
2755 </option>
2756 <option name="Cancel">
2757 Cancel
2758 </option>
2759 </alert>
2760 <alert modal="true" name="WebLaunchGraphicsDriverIntelExtreme">
2761 <message name="message">
2762 Your Intel Extreme graphics driver on this computer is out of date.
2763
2764This is a piece of software that controls your graphics card.
2765Old drivers can cause 3D graphics programs like [SECOND_LIFE] to run slowly or crash.
2766
2767We strongly recommend upgrading to the latest driver, available for free download from Intel.
2768
2769Would you like to go to the [SECOND_LIFE] drivers web page?
2770 </message>
2771 <ignore>
2772 When launching web browser to view Intel driver update page
2773 </ignore>
2774 <option name="Gotopage">
2775 Go to page
2776 </option>
2777 <option name="Cancel">
2778 Cancel
2779 </option>
2780 </alert>
2781 <alert modal="true" name="RunningInPCI">
2782 <message name="message">
2783 GL indicates that the graphic driver on this system is running in PCI
2784mode, a slower method of drawing graphics. If you&apos;re using a PCI video card,
2785you can ignore this message. If you are using an AGP video card, you should
2786update your motherboard drivers for improved performance in this and other
27873D applications. If you are using a PCI Express graphics card you can enable
2788AGP Graphics Acceleration from the Options panel in Preferences in [SECOND_LIFE].
2789 </message>
2790 <ignore>
2791 When running in PCI mode
2792 </ignore>
2793 </alert>
2794 <alert modal="true" name="WebLaunchJoinNow"> 2763 <alert modal="true" name="WebLaunchJoinNow">
2795 <message name="message"> 2764 <message name="message">
2796 Go to www.secondlife.com to manage your account? 2765 Go to www.secondlife.com to manage your account?
@@ -2863,10 +2832,10 @@ AGP Graphics Acceleration from the Options panel in Preferences in [SECOND_LIFE]
2863 </alert> 2832 </alert>
2864 <alert modal="true" name="WebLaunchLSLWiki"> 2833 <alert modal="true" name="WebLaunchLSLWiki">
2865 <message name="message"> 2834 <message name="message">
2866 Go to the LSL Wiki for scripting help? 2835 Go to the LSL Portal for scripting help?
2867 </message> 2836 </message>
2868 <ignore> 2837 <ignore>
2869 When launching web browser to view the LSL Wiki 2838 When launching web browser to view the LSL Portal
2870 </ignore> 2839 </ignore>
2871 <option name="Gotopage"> 2840 <option name="Gotopage">
2872 Go to page 2841 Go to page
@@ -4067,16 +4036,15 @@ will react somehow when money is payed into them.
4067 There are no items in this object that you are allowed to copy. 4036 There are no items in this object that you are allowed to copy.
4068 </message> 4037 </message>
4069 </alert> 4038 </alert>
4070 <alert modal="true" name="LoadAccountTransactions"> 4039 <alert modal="true" name="WebLaunchAccountHistory">
4071 <message name="message"> 4040 <message name="message">
4072 Go to [URL] 4041 Go to the Second Life web site to see your account history?
4073to see transaction details?
4074 </message> 4042 </message>
4075 <ignore> 4043 <ignore>
4076 When loading transactions web page 4044 When loading account history web page
4077 </ignore> 4045 </ignore>
4078 <option name="OK"> 4046 <option name="Gotopage">
4079 OK 4047 Go to page
4080 </option> 4048 </option>
4081 <option name="Cancel"> 4049 <option name="Cancel">
4082 Cancel 4050 Cancel
@@ -4263,6 +4231,21 @@ the contents of your Trash folder?
4263 No 4231 No
4264 </option> 4232 </option>
4265 </alert> 4233 </alert>
4234 <alert modal="true" name="ConfirmEmptyLostAndFound">
4235 <message name="message">
4236 Are you sure you want to permanently remove
4237the contents of your Lost And Found folder?
4238 </message>
4239 <ignore>
4240 When emptying your inventory Lost And Found folder
4241 </ignore>
4242 <option default="true" name="Yes">
4243 Yes
4244 </option>
4245 <option name="No">
4246 No
4247 </option>
4248 </alert>
4266 <alert modal="true" name="CopySLURL"> 4249 <alert modal="true" name="CopySLURL">
4267 <message name="message"> 4250 <message name="message">
4268 The following SLURL has been copied to your clipboard: 4251 The following SLURL has been copied to your clipboard:
diff --git a/linden/indra/newview/skins/xui/en-us/floater_about.xml b/linden/indra/newview/skins/xui/en-us/floater_about.xml
index f03df0f..24b9ce3 100644
--- a/linden/indra/newview/skins/xui/en-us/floater_about.xml
+++ b/linden/indra/newview/skins/xui/en-us/floater_about.xml
@@ -8,9 +8,9 @@
8 max_length="65536" mouse_opaque="true" name="credits_editor" 8 max_length="65536" mouse_opaque="true" name="credits_editor"
9 text_color="1, 1, 1, 1" text_readonly_color="1, 1, 1, 1" width="458" 9 text_color="1, 1, 1, 1" text_readonly_color="1, 1, 1, 1" width="458"
10 word_wrap="true"> 10 word_wrap="true">
11 Second Life is brought to you by Philip, Andrew, Tessa, Cory, Frank, James, Doug, Hunter, Richard, John, Eric, Avi, AaronB, AaronY, Ian, Peter, Mark, Robin, Stephen, Tracy, Ryan, Alberto, Haney, Tanya, JimJ, Dan, Ben, Stephanie, Tim, Evan, Catherine, Colin, Chris, Reuben, Charity, Jeska, James, JonHenry, Kelly, Callum, Char, Daniel, DavidF, Don, Jeff, Lauren, Lee, Michael, Ramzi, Vektor, Steve, TomY, Tess, Kona, Brent, Clarissa, PeterP, Jesse, Annette, Cyn, Blue, Ginsu, Jonathan, Karen, Adam, Nova, Deana, Lizzie, Patsy, DavidK, Isaac, Pathfinder, Monroe, Jill, Benny, Altruima, Rheya, Jennifer, Jack, DaveP, Brad, Mick, Babbage, Elisabeth, Brian, Beth, Data, Ethan, Wendy, Nicole, Sky, Jeffrey, Zero, Coffee, Tesla, Kenny, Makiko, Nigel, Teeple, Lucy, Mia, Dee, Guy, Harry, Liana, Branka, Jimbo, Aura, Vasuda, SarahD, bethanye, Torley, Runitai, MikeS, PaulM, Milo, Hermia, JoeM, Melanie, Rejean, DSmith, SMiller, Susan, Jose, DongYun, Justin, Andrey, Syrah, Donovan, Henrik, Nora, Lexie, AC, Donna, ChrisC, Alex, Leyla, Kyle, Mathew, Devin, Joshua, DanC, Jessica, Harmony, Claudia, Tramel, Glenn, Betsy, Fritz, Jun, Adam, Cassandra, Ken, RyanW, Spike, Varas, Andy, Luke, RobLa, Chiyo, JohnZ, Dustin, George, Del, PeterP, Migyeong, Matthew, RMullane, CChampion, JTurbin, JamesC, Viola, Lightfoot, Jacqui, Sturm, Adrian, Buttercup, Alfred, Sunil, Alfred, Noel, Irfan, JillS, Yool, Jane and many others. 11 Second Life is brought to you by a2, Aaron, Abishai, adrian, Alberto, Alex, Alexei, Alfred, Alice, Altruima, Amber, Anastasia, Andrea, Andrew, Andy, Annette, Anthony, Aura, Avi, Babbage, Beast, beez, Belinda, Ben, Benjamin, Benny, Betsy, Bill, Blue, Bo, Bob, Brad, Branka, Brent, Brian, Bruce, Bub, Bucky, Bunny, Burgess, Buttercup, Callum, Casino, Cat, Catherine, Chadrick, Char, Charity, Charlie, Chiyo, Chris, Christopher, Civic, Claudia, Cleopetra, Cole, ColeD, Colin, Colleen, Cornelius, Cory, Cube, Cupid, Cyan, Cyn, Dan, DanceStar, Daniel, Data, Dave, David, David2, Deana, Debra, Dee, Dek, Del, Dez, Don, Donovan, Dore, Doug, drunkensufi, Dummy, dustin, Eddie, Eileen, Elena, Elle, Emily, Eric, erika, Erin, Ethan, Evan, Eve, Everett, Firefly, Flashpoint, Fordak, Frank, Fred, Fritz, Frontier, Garry, George, Gia, Ginsu, Glenn, Gulliver, Guy, Hamlet, Haney, Harmony, Harry, Helen, Hello, Henrik, Heretic, Hermia, Holly, Hungry, Hunter, Ian, Icculus, Irfan, Iris, Isaac, Isabel, IsThat, Ivy, Izzy, Jack, Jacqui, Jake, James, Jane, Janet, Jaron, Jay, Jean, Jed, Jeff, Jennifer, Jeremy, Jeska, JeskaTest, Jesse, Jill, Jim, Jimbo, Joe, John, Jon, Jonathan, Joon, Jose, Joshua, Jp, June, Justin, Karen, Kari, Karinelson, Kelly, Kelvin, Ken, Kenny, Kent, Kevin, Kona, Kyle, LaughingMan, Lauren, Lawrence, Lee, Leopard, Leprechaun, Leviathania, Lexie, Leyla, Liana, Libby, Lightfoot, Lizzie, Lock, Logan, Loki, Louie, Lucy, Luke, Madhavi, Magellan, Magenta, Makiko, Marius, Mark, Martin, Matthew, Maurice, Mayor, Melanie, Meta, Mia, Michael, MichaelFrancis, Mick, Migyeong, Mikeb, MikeT, Milo, Mitch, Mogura, Monkey, Monroe, Morpheus, Natria, Neo, Nicolas, Nicole, Nigel, Noel, Nora, Nova, Otakon, Page, Pathfinder, Patsy, Paul, Peter, Philip, Phoenix, PierreLuc, Pilouk, Pony, Professor, Qarl, Rachelle, Ramzi, Ray, Realestate, Red, Rejean, Reuben, Rheya, Richard, Rika, Rob, Robin, Roosevelt, Ross, Runitai, Ruth, Ryan, Sabin, Sally, Sam, Sarah, Satoko, Sean, Secret, Sejong, Senator, Seth, Showme, Siobhan, Sky, Sleepy, Spike, Stefan, Stephanie, Stephany, Stephen, Steve, Stryfe, sturm, Sudhi, Sunil, Swiss, Sylvain, Tanya, Tbone, Teeny, Teeple, Teresa, Tesla, Tess, Tessa, Thomas, Thrax, Thumper, Tim, Tobin, Todd, Tofu, Tom, Torley, Tracy, Uncle, Varas, Vasudha, Vektor, Ventrella, Video, Viola, Walker, Warren, Wendy, Which, Xan, Xander, Xenon, Xtreme, Yedwab, Yohan, Yool, Yoz, Yuko, Zach, Zee, Zero and many others.
12 12
13Thank you to the following residents for helping to ensure that this is the best version yet: Atte Aderdeen, Alise Altman, Doomby Arrow, Rox Arten, Jesse Barnett, Smiley Barry, SuezanneC Baskerville, Glitch Braess, Dorian Caldwell, JuiceBox132 Castro, Aden Christensen, Fremont Cunningham, Zirnitra Demar, Errafel Eccleston, Cory Edo, Kitto Flora, Ashrilyn Hayashida, Elektra Hesse, Friar Jeffries, Samuel Jordan, DeLisa Junot, Howie Lament, Candide LeMay, Michi Lumin, Ikani Mahana, SignpostMarv Martin, Ksathra Mason, Console Mission, Haravikk Mistral, Usagi Musashi, Lex Neva, Jamma Newt, Blaze Nielsen, Destiny Niles, Tateru Nino, Harald Nomad, Nerk Noonan, Stumbelina Ophelia, Fledhyris Proudhon, Londyn Reatequi, Zi Ree, Hank Rucker, BamBam Sachertorte, kai Sachertorte, Sean Sao, Funk Schnook, Magnum Serpentine, Nekosune Smails, Rhyph Somme, Al Sonic, Oz Spade, Wesley Spengler, Steve Steed, Gearsawe Stonecutter, Dirk Talamasca, Dolmere Talamasca, John Taylor, Raymond Tuxing, Churchill Tweak, Huns Valen, windozer Vargas, Sabby Whiplash, Raven Wombat, Beatfox Xevious, Yiffy Yaffle, Alpha Zaius, Hewee Zetkin, Jai Zucker and many others. 13Thank you to the following residents for helping to ensure that this is the best version yet: AlexandriaS Aabye, devilite Aabye, Dynamqting Aabye, hellebore Aabye, Maddog Aabye, Urru Aabye, mabare Abattoir, Didi Abdallah, Elwood Abernathy, Jake Abramovich, Schort Achterbahn, Divily Ackland, JadeCharlet Ackland, Kevin Acorn, Binvis Acronym, Robert Adelaide, Atte Aderdeen, KiVanyel Adria, Krillian Adria, Mandi Adria, Butch Adzebills, Beccaboo Aero, Akasha Aferdita, Nicole Aferdita, Nero Agnomen, Hay Ah, Oxoc Ah, Sironl Ah, evokue Ahn, nycbadboy Ahn, Taan Ahn, Cyres Aida, TalNova Aji, Illusion Akula, Xen Akula, Jessa Alba, Alba Albert, kernowed Albert, Blaine Albion, AnneMarie Alcott, Bo Alcott, Cindie Alcott, Cunundrum Alcott, fighter Alcott, Jarad Alcott, Marcello Aldwych, Xenia Alemany, CellMaster Alexander, Molly Alexander, Aerotisma Alexandre, Ghostofgoat Alexandre, Took Alexandre, Ty Alexandre, Christophe Perrin / Krisp Alexandre, Adec Alexandria, Kiwi Alfa, Rowr Aliev, aivlys Allen, asclepius Allen, Aveyond06 Allen, Calvin Allen, gayfrench Allen, gender Allen, Grayson Allen, Jak Allen, Jerdog Allen, MariahMarie Allen, Metzyn Allen, Misty26 Allen, moshetzi Allen, nayara Allen, NH Allen, Pegi Allen, Ponesco Allen, Rap4rag Allen, Safer Allen, sobroke Allen, Bethann Allstar, Sloan Almendros, Ogro Almodovar, Raymondo Alonzo, Rebeca Alonzo, Omega Alphabeta, Elirien Alturas, Rick Alvarado, Golam Amadeus, Kea Amarula, Ariella Amat, Popas Amat, xxjojxx Amat, Jamie Amdahl, Helyos Ames, julies Ames, Keisha Ames, Javz Amsterdam, Kathy Amsterdam, Twistaspliff Amsterdam, darian Anabuki, Dnali Anabuki, Wes Anaconda, Serra Anansi, Britney Anatine, pax Anatine, Ranya Anatine, sientaya Anatine, Siowen Anatine, Padu Andalso, Chanel Anderson, Donna Andrews, Trixie Angel, Macphisto Angelus, meQal Anna, Aznxer Antfarm, Karlo Antonelli, Maksimilian Antonelli, Vala Antonelli, Athoni Antonioni, klement Antwerp, lildeadgirl Antwerp, GeordieJohn Anubis, KatanaBlade Anubis, Diag Anzac, Lunarlie Anzac, Picker Apogee, Azuby Apparatchik, brianica Appin, SwedenArtSheepdogs Aquacade, CaSimone Aquitaine, Dexter Aquitaine, Pericat Aquitaine, Sunshine Araw, Bino Arbuckle, Evangeline Arcadia, Niles Argus, pe Argus, BenneDJezzerette Ariantho, Karmaticdragon Ariantho, Teren Aridian, Garcia Ariel, Ina Arkin, alva Arliss, Noriyoko Arliss, Harle Armistice, Avi Arrow, Ming Arrow, Rox Arten, Razitra Artizar, Mandy Asano, Ty Asano, Kristoff Asbrink, Skye Asbrink, Threasher Asbrink, Daniel Ash, Dion Ashby, Eva Ashby, Ravenal Ashby, TOPDIME Ashby, danielluh Ashton, Deb Ashton, ach Asp, cokeser Asp, lastping Asp, Posrednik Asp, Notypewell Astro, Nargus Asturias, SiRiS Asturias, yol Asturias, ZATZAi Asturias, Animus Asylum, Sang Asylum, SomethingReal Atkey, Dakota Atlanta, Irie Atlantis, Matt Attenborough, Nirva Attenborough, CaptJosh Au, Goren Auer, Jackamo Auer, Jonathan Auer, Tisdi Auer, Chris Auk, Raven Axon, Shawn Ay, TJ Ay, ares Ayres, Cazz Ayres, Eon Ayres, Laura Ayres, zoeba Ayres, Naomi Babcock, Eldrich Babeli, Adrianna Babenco, She Babenco, sterick Babenco, corto Babii, Dia Babii, EvilCutz Babii, Flooxx Babii, Girl Babii, Imraanos Babii, Iv Babii, Lizthebabe Babii, Torrence Babii, Chrystal Babii, Sara Bachman, dzb0 Bade, Doug Bagration, Hobbit Bagration, Abert Bailey, Bambi Bailey, EveNice Bailey, Kaliya Bailey, Kriz Bailey, Leen Bailey, Leonine Bailey, Minke Bailey, Nightjaxs Bailey, Peyton Bailey, Shan Bailey, Stevo Bailey, Tariv Bailey, cream Bailly, Ezekiel Bailly, Gianna Bailly, Hells Bain, Briauna Bainbridge, AnaSofia Bakalava, Jonas Bakalava, Micki Baker, Anita Balczo, Naomi Balczo, Nathan Balder, Bibi Balhaus, Sponz Balhaus, Ainsleigh Ballinger, Dimitry Ballinger, Miriam Ballinger, Rik Ballinger, Trey Ballinger, Zagor Ballinger, Zek Ballinger, Kilara Balnarring, Maya Balut, Franz Bamaisin, Manolo Bamboo, Yuki Bamboo, Oliver Bandit, Pirate Bandit, Outy Banjo, winkler Banjo, SabreWulf Banshee, Akeela Banting, Elke Banting, Arkesh Baral, Barber Barbarossa, Samantha Barbee, Aruk Barbosa, Ayahuasca Barbosa, Bastill Barbosa, Corleone Barbosa, Padrig Barbosa, Samakh Barbosa, seat Barbosa, Topper Barbosa, Thery Bardeen, Bridgitte Bardot, Nici Barley, Annie Barnard, Josse Barnard, DB Barnes, Kitty Barnett, Threshin Barnett, Amy Barnett, Scott Baron, Jeremy Barracuda, Verbuda Barragar, Daphne Barrett, Fenleab Barrett, Lindsey Barrett, Smiley Barry, Denise Barrymore, Manuela Barrymore, Nell Barrymore, Sensation Barrymore, BraadWorst Barth, XxRevelationxX Barthelmess, Fleur Bartlett, Marina Bartlett, Lucius Bartz, Mack Bartz, Astley Bascom, dolomite Bascom, Dags Basevi, Lena Basevi, crystal Basiat, SuezanneC Baskerville, Sweetheart Baskerville, Demi Bates, Demon Bates, kane Bates, Will Bates, ShadixBear Bathgate, Carlotta Batra, Bruce Batz, Silentborn Batz, Dominik Bauer, Logan Bauer, Boz Baxter, Camryn Baxter, diesus Baxter, Drett Baxter, Gazmanjones Baxter, Kiley Baxter, Schwenny Baxter, Shimboo Baxter, Stoffe Baxter, Diamond Baxter, Gruntos Baxter, BC Bayliss, Bibi Bayliss, Backly Beam, BigFoot Beam, JuJu Beam, nati Beam, Pelgrim Beam, ELLiebob Bean, LeatherElf1 Beat, Nikky Beat, Carl Beattie, Fe Beattie, sonoma Beatty, Henri Beauchamp, TimTam Beauchamp, Conrad Beaumont, Dieudonnee Beaumont, Kitten Beaumont, Lucilla Beaumont, Odina Beaumont, PCBRANDY Beaumont, PLASTOK Beaumont, Sheree Beaumont, Sweet Beaumont, Olivier Beaumont, Busybee Beaver, Chiheb Bechir, Caspian Beck, GoldenGamer Beck, icar Beck, Jigoes Beck, Matsumoto Beck, Millie Beck, Rhino Beck, Ronor Beck, ropland Beck, wai Beck, laurionna Beckenbauer, Jeffery Beckersted, Dominick Beckham, Druu Becloud, Holger Becloud, Duce Bedlam, Beach Beebe, Manicexpression Beebe, Nicolette Beebe, Feril Beeks, BillyJoe Beerbaum, Lola Beerbaum, Pimppdog Beerbaum, Baylee Beery, DrathnotT Behemoth, Malarthi Behemoth, phoenix Behemoth, Trinity Bekkers, Dioana Bellah, KissesRhawt Bellambi, Bream Bellman, Hazel Bellow, Milo Bellow, Corvette Beltran, Lefty Belvedere, Jaden Benavente, Bianca Bender, Jeremy Bender, Mercedes Benedek, Albert Benelli, Dodi Benelli, Emili Benelli, laurette Benelli, ninake Benelli, Evazion Benelli, Elaine Bennett, Izabella Bentham, Carol Bentley, Deedrick Benton, Joel Berblinger, Lord Berchot, Pele Berchot, Marimar Berchot, Melody Beresford, Brielle Bergbahn, chrissie Bergson, Kody Bergson, Bit Berjis, Kevin Bernal, Dorie Bernstein, mystic Berry, Razza Berry, Bella Bertone, Taylor Berzin, liz Bessie, Kekken Biberman, Nicolas Biddle, Halbert Bienenstich, terrycrow Bigwig, Jasmine Bijoux, Kala Bijoux, Dano Bikcin, enzo Bikcin, Angle Binder, Cuffs Binder, Roxtor Binder, Tom Binder, Agamemnon Bing, Chalander Bing, Gigi Bing, runeking3007 Bing, Monsieur Bingyi, Angelica Biondetti, Melissa Birge, reeneebob Birmingham, Anubis Bishop, Danica Bishop, Mowesy Bisiani, Marteas Biziou, Karla Bjornson, Roxie Bjornson, Travis Bjornson, Atlwolf Blabbermouth, Rice Black, Nathan Black, Amanda Blackmountain, Disstraction Blackthorne, Miriya Blackthorne, Teagan Blackthorne, Orko Blanchard, Neural Blankes, Random Blankes, Shaura Blazer, Nethermind Bliss, dayanne Boa, Denideny Boa, lecosutre Boa, naholc Boa, NITR0US Boa, Prana Boa, RS Boa, penelope Bobak, Bad Bobbysocks, Ryuujin Boccara, Joey Bock, Elkissa Bode, Annika Boehm, Babyblues Boffin, Snodude101101 Bogan, Dirk Bogart, Jily Bogart, Pompo Bombacci, Ascanio Bonetto, Bony Bonetto, Casanova Bonetto, Cuncittina Bonetto, Frede Bonetto, Ervee Bonne, Jolanda Bonne, Poppy Bonne, Becky Book, Bibi Book, Barney Boomslang, Sam Boomslang, Steeven Boorman, Rogue Borgnine, Summer Borgnine, Rafe Borrelly, Equitus Bosch, Peter van den Bosch, tessa Bosshart, Hermione Bossy, Mr Bossy, Rhiannon Bossy, Aspen Bossy, Marisela Bouchard, Tony Bouchard, Annita Boucher, Aster Boucher, Katy Boucher, Lisae Boucher, Router Boucher, Sneaky1 Boucher, Varak Boucher, DarkAlpha Bourne, Hastings Bournemouth, bend Bowie, Lucy Bowie, Casper Box, coolbimbo Box, Kittenna Box, Metaphor Box, Nemesis Box, Bell Boyd, Kelley Boyd, Sylar Boyd, WendyCat Boyd, Denis Boyle, Jennifer Boyle, melmuse Boyle, Alycia Bradley, jayne Bradley, Airie Braendle, Glitch Braess, Su Brando, Tybalt Brando, IntLibber Brautigan, Dante Breck, Carbon Breed, WitchFire Breed, Bella Brennan, erika Brenner, gaby Brenner, Talthybius Brevity, KitKat Brewster, Lindsey Breyer, Artemis Bright, Brigitte Bright, Donnie Bright, Lucas Bright, Oya Bright, Prentice Bright, Risa Bright, Starfire Bright, Beebo Brink, Marcus Brink, Emi Brissot, Ice Brodie, Luth Brodie, Sam Brodie, Chromal Brodsky, Tydomus Brodsky, Cage Brody, Darling Brody, Kurston Brody, Mike1A Brody, UserJesse Brody, Reese Brody, Faith Broek, Happy Broek, ShadowHunter Brokken, Jacey Brooks, Shake Brooks, Shary Brooks, Sigurd Brooks, Tate Brooks, Vanleen Brooks, BruTuS Broome, PastorD Broome, Sarita Broome, October Brotherhood, Elroy Brouwer, Neophyte Brouwer, Jebediah Brown, linda Brown, Schwartz Bruder, lupu Brule, Joshua Brynner, Linda Brynner, Southy Buckenburger, drifterr Bugaboo, Michelle Bumbo, Trixie Bumbo, Paul Bumi, Jitar Bunin, Kerian Bunin, Crystalmom Bunnyhug, Embrace Bunnyhug, Zues Burali, GiGi Burgess, Keith Burgess, Shawna Burgess, Bain Buridan, Sean Buridan, Chiccorosso Burke, Count Burks, Hinamori Burleigh, Atom Burma, Jasper Burma, Aleshanee Burnett, Dottie Burns, Ebro Burns, Skipper Burns, John Burns, Haroldthe Burrel, Big Burt, dubureau Burt, Keisha Burt, phill Burt, Janloo Burton, Madd Burton, Bowlalot Bury, Dreklore Bury, Jarek Bury, Jenni Bury, Lou Bury, Orlando Bury, Angel Butuzova, dodi Byrd, Enchtris Byrd, Tleva Caballero, Gayle Cabaret, Monique Cabaret, Adele Cagney, Cralyn Cagney, Caribbean Cahill, Darien Caldwell, Lily Caldwell, CFire Caldwell, Ciara Calhern, Karl Calhern, Cecil Calhoun, Tizzy Calliope, Hypatia Callisto, Raven Callisto, Fred Cameron, Meliana Cameron, Antonius Camus, Maddie Camus, Raskella Canadeo, Exotica Canadeo, Vessus Candour, Alexis Canetti, Silvio Canetti, Talia Canetti, bragan Canning, Charenthia Canning, Reeda Canning, Vannesh Cannoli, Changurr Cao, Chilli Cao, Dorian Cao, RosyLee Cao, steve319 Cao, Contamina Capalini, Cougard Capalini, Kirsti Capalini, Lindichka Capalini, Lyla Capalini, JohnMAC Carbenell, snake Carbenell, Capri Carbetta, Sophia Carducci, Kid Cardway, Icould Careless, Aurore Carlberg, Brumia Carlberg, Bruni Carlberg, Brandie Carlos, Jenny Carlos, Avalon Carmona, Moana Carmona, Ashelia Carnell, Rain Carnell, CJ Carnot, Madison Carnot, Julie Carpathea, HALOCAT Carr, coolmaria Carroll, karyme Carroll, Leila Carroll, Crisii Carter, cyrielle Carter, isidore Carter, Missi Carter, Shatara Carter, Tristan Carthage, Aemilia Case, Baby Case, Jenn Cassady, Kittygloom Cassady, Charlotte Cassavetes, Holly Cassavetes, Anthony Cassini, Supertell Cassini, Wietse Cassini, Just Cattaneo, Mandy Cattaneo, Aleicester Catteneo, arthuraleksandravicius Cavan, Maximus Cazalet, Quellin Ceawlin, dMetria Cela, Spidey Cela, Arcadia Ceres, wanderer Cerveau, Aaron Cerveau, Marky Chaffe, Stefani Chaffe, The Chaffe, Becca Chambers, Lexis Chambers, Inigo Chamerberlin, Shion Chandrayaan, Ibrisse Chantilly, MaryAnne Chantilly, Cool Chaparral, guy2 Chaplin, Iadwen Chaplin, Lillyann Chaplin, wllmn Chaplin, Marsha Chapman, Caspar Chapman, Dominique Charles, Chilly Charlton, Pammie Charming, Total Chastity, Arohee Chatnoir, Papillon Chatnoir, Barry Cheeky, coldFuSion Cheeky, Nyla Cheeky, Ryan Cheeky, Aggressor Cheetah, Ronald Cheevers, Michelle Chernov, Maggy Chestnut, Cam Chevalier, Eleonore Chevalier, Kelly Chevalier, Mauries Chevalier, Ozzy Chevalier, Rayvendell Chevalier, Swampy Chevalier, Cheesemuncher Chickenwing, Kaltezar Chickenwing, milespeed Chihuly, Coolkama Childs, Michelle Childs, Nicole Childs, SimonRaven Chippewa, Albert Choche, Annetha Christensen, Jennifer Christensen, Zell Christensen, Herman Christiansen, Haifeng Chu, Francis Chung, tyana Chung, Sundance Churchill, Anubis Cioc, Corpierro Cioc, Dwayne Cioc, Knibbel Cioc, Slowhand Citylights, PonygirlSarah Clapper, Jim Clark, Jacob Clark, Jo A Clark, Angelos Clary, Biffle Clary, lilly733 Clary, Rui Clary, William Clary, Otto Clave, Arahan Claveau, Neil Claxton, Mimi Claymore, Pete Claymore, Sam Clayton, Blank Cleanslate, Deckheard Cleanslate, Electron Cleanslate, Spirit Cleanslate, Willow Cleanslate, Kovu Cleaver, Bell Clellon, Covisha Clift, EBCY Clift, Iumi Cline, pizzaguy Clutterbuck, knightrider Clymer, Exia Coage, Brenda Coakes, Lindsay Coakes, Lyndka Cochrane, Ceinwen Coen, Oneil Coen, Mahogony Coffee, Mark Coffee, Lisbeth Cohen, Melayna Colasanti, holly Coldstream, Moon Cole, Shiden Coledale, Castalia Collingwood, JUNKIE Colman, Silver Colman, Stahi Columbia, SweetAbe Columbia, CC Columbo, Charity Colville, Isabeau Conacher, Deb Cone, emili0 Congrejo, MarioDaniel Congrejo, Jazzy Connell, Jenika Connolly, Cooper Conover, Garn Conover, Mara Conover, Myles Cooper, Angelina Coorara, Valentine Coppens, psyco Coppola, Tremleh Coppola, Venus Coppola, Chiana Cordeaux, Sensuality Cordeaux, Clarissa Cordoso, Methos Corinthian, Tylerferland Cork, Caleb Corleone, Montana Corleone, Sparkey Corleone, Zoey Corleone, Achtai Coronet, Count Coronet, Dweedle Coronet, jjccc Coronet, Ron Coronet, Caterina Cortes, Letitia Cortes, Marcella Cortes, Martinelli Cortes, Raven Cortes, Soopafly Cortes, Grazel Cosmo, Athena Cosmos, Cally Cosmos, Annyssa Cosmos, Bunny Costello, Zelitor Costello, Lionel Cournoyer, Sasha Cowen, Carl Crabe, Lyssa Craig, micke Craig, Mel Cramer, Tee Cramer, Avil Creeggan, Bunch Creeggan, CronoCloud Creeggan, NewYorkCityDJ Cremorne, Shalori Cremorne, Artik Crimson, Bliss Crimson, Daffodil Crimson, Raul Crimson, Shaoti Crimson, Trevor Crimson, Rex Cronon, Ace Crosby, Linnrenate Crosby, DaRealNeo Crossing, Wark Cruyff, Silver Csak, Eulalia Cuddihy, Lauralynne Cuddihy, Rammstig Cummings, Rita Cummings, Fremont Cunningham, Jinger Curie, RICX Curie, Betty Curry, Marissa Curtis, Mercurion Curtiss, Juan Cusack, Sanderman Cyclone, Marek Czervik, Alreania DaSilva, Dnel DaSilva, Seph DaSilva, Kelly Dabney, dorothyann07 Dae, Frax Dae, Frost Dae, Syryne Dae, Oddy Dae, 1Time Daehlie, Sinead Daehlie, TRACI Daehlie, Dante Daffodil, Limey Daffodil, stripey Daffodil, Atomik Dagger, Bloodsoaked Dagger, Coca Dagger, Colera Dagger, J4ck Dagger, Jaune Dagger, leigha Dagger, Silver1 Dagger, Alexander Dagmar, Simeon Dagmar, Dweezle Dagostino, Ginoo7 Dagostino, Joka Dagostino, Rachid Dagostino, Sinatra Dagostino, DR Dahlgren, Alexandra Daikon, Devious Dailey, Natalie Dailey, Sukit Dailey, Zoya Dailey, Nad Dal, Rudra Dal, Robert Dale, Coventina Dalgleish, Salvador Dalgleish, Anya Daligdig, Nyterious Daligdig, yvette Daligdig, Kylie Dallin, Angel Damask, Phantom Damask, QatanI Damdin, Bekka Damone, Pashin Damone, Vaekraun Damone, Zoraya Damone, elmoono Dana, Mary Dana, ml Dana, Rezzer Dancer, Shrug Dangle, Guttstein, Daniel, Bubba Daniels, Dinky Daniels, Kiana Daniels, marcel Daniels, Rosey Daniels, Sara Daniels, VictoriaRose Daniels, Ignacio Dannunzio, SlimD Dannunzio, williamae Dannunzio, Chriss Darkes, Digit Darkes, Tanooki Darkes, Bree Darling, Chasity Darling, Darra Darling, Val Darracq, Diana Darragh, Ryan Darragh, Bane Darrow, Bree Darrow, Ivy Darrow, cuddles Dassin, Leeloo Dassin, Dachine Daviau, Gyllian Daviau, Leben Daviau, Serioto Daviau, Willow Daviau, Allison David, JamieZel David, Todd David, Casey Davidson, LaNikki Davis, Whispering Dawn, Lady Dawson, Helen Dayton, Ryan Dayton, Ooh Dazy, Woopsy Dazy, Brighid DeCuir, eZekiel DeCuir, Link DeCuir, nath DeCuir, Rhys DeCuir, siliconegirl DeCuir, spring DeCuir, Iron DeCuir, Escort DeFarge, Archangelo DeSantis, Aubrey DeSantis, Gustav DeSantis, Hippy DeSantis, Ilana DeSantis, Sutara DeSantis, Undina DeSantis, Axienne DeVaux, Dana DeVaux, Kitty DeVaux, Mindy DeVaux, Krystal DeVinna, Krystalynn DeVinna, Magenta DeVinna, Manuela DeVinna, Spike Deakins, Debbes Dean, Korben Dean, Dogbert Debevec, Savannah Debs, emily Decatur, Heiko Decatur, Zorena Deckard, Andrea Decosta, Dolly Decosta, Esperenza Decosta, Kruppen Decosta, larrykin Decosta, PhoenixRose Decosta, Sophy Decosta, Twinsen Decosta, Vladimir Decosta, Duxster Deere, Maxim Deharo, Summerbreeze Deharo, Matti Deigan, DeeAnn Dejavu, Gina Dejavu, Shai Delacroix, alexis Delcon, Ashly Delcon, Kane Delcon, Dante Deledda, Lady Deledda, Jega Delgado, Alicia Delphin, Darek Deluca, Lestat Demain, Nuka Demain, Allissa Demar, Lilyanah Demar, Aeleen Demina, Blowing Demina, Kalm Demina, Sarias Demina, Skeddles Demina, Sweet Demina, Alida Demontrond, Redux Dengaku, J. Derby, Cristell Deschanel, Ivey Deschanel, SinaMaria Deschanel, Elisabeth Desideri, Monique Desideri, Bartiloux Desmoulins, Hazel Desmoulins, Isis Desmoulins, Phoenix Desmoulins, Jon Desmoulins, Dino Despres, Samantha Despres, Snowflake Despres, Bones Detritus, Neo Devoix, Bre Dharma, Showshawna Dharma, Mike DiPrima, Winter DiPrima, Gongree Diage, Azure Diamond, Styles Diamond, Maike Dibou, Klaus Dieffenbach, Xavier Dieffenbach, Lordfly Digeridoo, Selkit Diller, Tari Dilley, Kelly Dilweg, Werewolf Dingo, Darkharmony Dingson, Knud Dingson, Jewel Dinkin, Mecha Dinosaur, Savonna Dinova, Amina Diplomat, FuZzY Diqui, Crimson Divine, Lizbeth Divine, Cryptid Divisadero, Destiny Divisadero, Montsho Division, Gryphon Dix, Kittybird Dix, Hope Dixon, CadiWolf Dobbs, Darling Doboy, Nicole Docherty, Ralph Doctorow, Odo Dod, nik385 Doesburg, sam Doigts, Elea Dollinger, Miche Dollinger, Severina Dollinger, Eric Domela, Krysta Domela, Franky Donaldo, Duntroon Donburi, Tricia Donovan, Sabrina Doolittle, DeDe Doowangle, Dinghy Doowangle, Phoebe Doowangle, Ratzfatz Dorado, Jessalicious Dorance, RJaNator Dorance, Kalemika Dougall, Fi Douglas, Norelyn Douglas, Aerrett Dovgal, Wendy Dovgal, Alex Drago, MAGWolf Drago, Lupo Drake, Palanth Drake, Aryanna Draken, Drinkin Draken, Kaylan Draken, Maddy Draken, nixkuroi Draken, Thornpaw Draken, Sinjo Drakes, James001 Dryke, Nameless Dryke, Roberta Ducatillon, Helke Duettmann, Moni Duettmann, Kyla Duke, Esence Dulce, Manuella Dulce, Ric Dulce, Shannel Dulce, Xander Dumont, Lionna Dumouriez, Marko Duncan, Duncan, Lyre Dunia, Cyndari Dunn, Garth Dunn, Sugababe Duport, Taylorholic Durant, Vixie Durant, Julie Durant, Drew Dwi, Ribbon Dye, Michelle Dzieciol, shngy Dzieciol, Jeffrey Earp, Umbrella Ebi, Adi Eccleston, Bazzerbill Eccleston, Dragon Eccleston, chawna Eclipse, Minolin Eclipse, Valkyrie Eclipse, Joi Edelman, Alx Edman, Daniella Edman, Saskia Edman, Storm Edman, Cory Edo, Tommy Ehrler, Stephe Ehrler, Edred Einarmige, Hope Eldrich, Kai Eldrich, Winter Eldrich, Thunder Electric, Ezmerelda Electricteeth, Hostile Electricteeth, Kris Electricteeth, Loki Eliot, rudy2zday Eliot, Shaydin Eliot, Iris Ellison, Enigma Elswit, Tim Ely, Darkling Elytis, Delu Elytis, Happy Elytis, Jessica Elytis, Bernd Emmons, Kellie Emmons, Robbert Emmons, Bean Emoto, dick Encore, Andy Enfield, Fuzionor Engawa, Hethr Engel, RH Engel, Digital Enigma, Kahlest Enoch, Lex Enoch, Oran Enoch, Ryal Enoch, Wobmongle Enoch, Wyatt Enoch, Pea Enzyme, Antony Epin, Sapphire Epin, DBDigital Epsilon, Shoshana Epsilon, FallenAngel Erato, Renton Eretz, Mo Eriksen, 64Y80Y Eros, tommy Eros, Nicola Escher, Zak Escher, Salvatore Esposito, Quinevere Essex, Zed Essex, Fabian Etchegaray, Psyche Etoile, Byanex Etzel, CrimsonWings Eun, Deckard Eun, Arwen Eusebio, Anastacia Evans, buttonlynn Evans, Rose Evans, Romeo Evelyn, Sephiroth Everidge, Patriiick Ewing, Trey Ewing, Vivian Ewing, Xwing Ewing, Zha Ewry, SirZarath Excelsior, Zorrita Express, Hierophant Extraordinaire, Blanche Fabre, Annie Fackler, Wolfgang Fackler, Amy Faddoul, Shukran Fahid, Garth FairChang, Brooke Fairplay, TOmmy Fairplay, Vixen Fairplay, Bobby Fairweather, Darlean Fairymeadow, Gotobug Fairymeadow, Heathie Fairymeadow, Meleni Fairymeadow, Moon Fairymeadow, Odysseus Fairymeadow, rob Fairymeadow, Taylkusha Fairymeadow, Crystal Falcon, WhiteAngel Falcon, VetteMan Falken, Evilpony Fallon, Fernand Fapp, Sasuke Fapp, Roen Fardel, Dariush Fargis, Jenn Fargis, Mandy Farina, Kokoro Fasching, Madison Fasching, Ben Fassbinder, Leo Fastback, Rikky Faulds, STEEL Faulds, Equino Faulkland, Flynn Faulkland, High Faulkland, Arda Fauna, Elvis Faust, Benelli Federal, Forest Federko, Belle Fegte, Danny Feingold, Luc Feingold, Bing Fell, Darky Fellini, Jaze Fellini, Sacha Fellini, paulie Femto, Ynot Fenua, Fau Ferdinand, Soren Ferlinghetti, Meri Fermi, Boxter Ferraris, Danamea Ferraris, Duilho Ferraris, Fred33 Ferraris, LeekySean Ferraris, Letizia Ferraris, Marlowe Ferraris, Wanted Ferraris, Xavier Ferraris, Feff Ferrer, Thomas Ferris, Nakala Fetisov, Astrin Few, Chosen Few, Ahh Fiddlesticks, Chantal Fielding, Caleb Fierrens, Patrice Fierrens, sam Fieseler, NutZ Figaro, summer Figaro, Leumia Figgis, Mae Figtree, Maldavius Figtree, Ravovich Figtree, Morgana Fillion, Brett Finsbury, sofia Finsbury, Jazmina Firefly, sasha Fischer, william Fish, Nadia Fisher, StevenSDF Fisher, Carol A . Fisher, Dimitri Fisseux, Manni Fitzgerald, Freddie Fitzroy, Phineas Flagstaff, Ante Flan, Braden Flanagan, BrettEbay Flanagan, Echo Flanagan, Knute Flanagan, Kristjan Flanagan, LilyRose Flanagan, Meril Flanagan, Lulu Flasheart, Jolie Fleury, Clitoria Flint, Fifi Flintlock, Frostie Flora, Kitto Flora, Chriss Florio, Arlen Flossberg, Angel Fluffy, Emilyuk Fluffy, Frurry Fluno, Faedra Flytrap, Brieg Foden, Annette Fonda, Katina Fonda, Raymond Fonda, Marcos Fonzarelli, Yuri Fonzarelli, CrystalShard Foo, etoile16 Food, Kim Food, Kode Forager, Vodka Forager, Wendy Forager, Lucien Forcella, Maela Forcella, Olli Forcella, Violet Forcella, Clarissa Forder, darkdog Forder, Hans Forder, Jango3234 Forder, Olli Forder, Naryu Forester, FaustTiger Forte, Richie Forte, BMFC Forwzy, Erick Forwzy, SusNy Foss, Sanford Foulon, Iwana Fouquet, Kae Fox, Raudf Fox, Wolfie Fox, Phli Foxchase, Kityn Foxley, MollyBrown Foxley, Qua Frampton, Ice Franchini, Nicolas Franchini, Soizie Franciosa, Samson Francis, Nequam Frangilli, Andreas Frankfurter, PreWired Frankfurter, Diane Franklin, Cappy Frantisek, Romano Frascati, DeMits Frederix, Mel Fredriksson, Sune Fredriksson, Tina Fredriksson, Fastfreddy Freeloader, Sammar Freeman, Kitty Freund, Jorgen Friis, Zorin Frobozz, mdbobbitt Frobozz, Chris Frontenac, Foolish Frost, Asriazh Frye, Patti Frye, Phish Frye, Nobody Fugazi, Simba Fuhr, Snugglebunny Fuhr, fallendream Furse, Jamie Furst, Cherise Gagliano, Laura Gagliano, Gammy Gainey, Gazz Galatea, Govindira Galatea, Rizpah Galatea, Amber Galbraith, Mandy Galileo, william Galileo, David Gall, LoLa Galland, Zach Ganache, Casey Gandini, Edgar Gantenbein, Jonx Gao, Soso Gao, Madison Gardner, Silver Garfield, Michelle Garrigus, Nerdmaster Garrigus, Jarik Garsztka, Svoboda Garsztka, Salkin Gascoigne, Roger Gaspara, Buttlock Gasser, Pud Gasser, Zina Gasser, Prince Gausman, livingdead Ge, Josh Geesink, Tolly Geest, Georgina Geewhiz, Chris Geiger, Sabine Geiger, Samuel Geiger, Tristessa Geiger, Joe Gemini, Mielle Gemini, Misty Gentil, Sanna Georgette, Phoenix Gerhadsen, Mic Ghia, Salores Ghia, Loskobosko Giacomin, Susanne Giffen, Lazarus Giha, Micah Giha, Merry Gildea, Summer Gildea, Brittany Giles, Rayy Giles, sevron Giles, Gattz Gilman, Rori Gilmour, SunQueen Ginsberg, Rockwell Ginsberg, Intolerable Ginsburg, Junie Ginsburg, Enrico Giove, Krystal Giove, Annie Giovinazzo, Cat Gisel, Constantine Giugiaro, Io Giugiaro, Persimmon Gjellerup, Lorna Gladstone, Toby Gladstone, Dale Glass, Gellan Glenelg, EmmaBella Glimmer, louise Glimmer, Gianna Glitter, Melyissa Glitterbuck, Victoria Glushenko, Wolf Goalpost, Chris Gobo, Xerses Goff, Sturdus Goldblatt, Nigel Goldflake, Major Golding, Master Goldkey, Zho Golem, Stylez Gomez, Carlos Gomez, Alecydoss Gontermann, Skyler Goode, Valentine Goode, Odd Goodfellow, Dragyn Goodliffe, Hank Goodliffe, Livinda Goodliffe, Robertt Goodliffe, Daphne Goodnight, Sean Gorham, Ledje Gorky, Emma Gould, Amaze Grace, Lagerstone Graff, Harper Grainger, Andy Grant, Carrie Grant, LauraLOral Granville, AlphaOmega Graves, Ebon Graves, Kyrii Graves, Leeloo Graves, Bosco Gray, Dez Gray, Renegade Gray, Summer Gray, Aries Graysmark, Edian Graysmark, Scotty Grayson, Mantis Grebe, Kelly Green, cara Greene, Kimber Greene, Mystical Greene, Raven Greene, Soilent Greene, Matthew Greene, Soilent Greene, Roberta Greenfield, ShayLee Greenspan, Dax Greer, Angel Gregg, Kyleigh Gregg, Sophie Greggan, Deanna Gregoire, StylynProfylyn Gretzky, Farallon Greyskin, Kraal Griffith, Xavier Griffith, Jacomo Grigg, Sylvie Grizot, bodyman72 Grot, Damian Grot, MarieCaroline Grumiaux, Mozo Grumiaux, Oceane Grumiaux, Jadem Gruppman, Gracie Grut, Jennie Grut, Mhaijik Guillaume, Frog Gulick, RacerX Gullwing, Enktan Gully, Gilly Gully, Woozie Gumshoe, Teddy Gumsing, Stephane Gunawan, Alienbear Gupte, Boroondas Gupte, mcgeeb Gupte, Elise Guyot, Jamal Guyot, Lawyer Guyot, Thiago Guyot, Arwen Gymnast, denniswo1993 Gymnast, Lukes Gymnast, Miki Gymnast, Sizoark Gynoid, Markiss Haas, Pepper Haas, Arkanys Hadlee, Apollo Haight, Lord Haight, Fawn Hailey, Kaelin Hailey, Gaelle Halasy, ISIS Halberd, Meg Halberd, Zander Halberd, Arnold Halderman, Malarwen Hall, Ken Hall, Jonah2cd Hallard, Saii Hallard, Trixie Hallard, Doris Haller, Destina Halley, Susiee Hamilton, IBMTapeGuy Hammerer, Lighten Hammerer, VEVER Hammerer, Alison Hamsun, Fawn Hana, leah Hana, Darknite Hand, Emperors Hand, nefertiti71 Handrick, Rodney Handrick, Delerium Hannibal, leanhaumshee Hannya, jingle Hansen, Mattie Hansen, Terry Hansen, Vox Hansen, Filo Hapmouche, Gustavus Hapmouche, Nounouch Hapmouche, Adrian Harbinger, Kami Harbinger, StormCrow Harbinger, CherryBomb Hare, Den Hare, Omegasun Harford, ricky Harford, ricky Harford, Harley, Jenna Harley, Kristina Harley, Natasha Harlow, Hummer Harmison, Allen Harrington, Tessa Harrington, Joker Harris, Shanti Harris, Dagon Harrison, J0NATHAN Harrop, Kerinauu Hartunian, Kyentay Hartunian, Rav Hartunian, Ski Harvey, Tuesday Harvey, Xylo Hasp, Betina Hatfield, Gina Hatfield, Calamity Hathaway, Dorian Hathaway, Duncan Hathaway, Xavier Hathaway, Jack Hathor, Kamilah Hauptmann, Pam Havercamp, swift Havercamp, Griselda Hawes, kwanita Hawks, Ravenis Hawks, BenG Hax, el33t Hax, Juicy Hax, Macx Hax, Meta Hax, Mikka Hax, Mokona512 Hax, Mr8ball Hax, Prophet Hax, Rina Hax, Slober Hax, Starbuck Hax, Takehiro4 Hax, Kyle Hayashi, Ashrilyn Hayashida, Eriko Hayashida, August Hayek, Milton Hayek, Ronnie Hayes, Max Hazlehurst, Sorsaran Hazlehurst, Grath Hazlitt, Violet Hazlitt, April Heaney, Aquela Hearn, jefferey Heart, Kalyrra Heart, Marissa Heart, Taina Heart, TLC Heart, Tori Heart, Dana Hebert, Trimzi Hedges, AmazedBlue Hegel, Dagmar Heideman, r0bin Helsinki, Moira Henley, Ursa Henley, Joharr Hennah, Daviana Hennesy, GJ Hennesy, jens Hennesy, Karl Herber, mistydawn Herbst, Donatella Hermano, Robins Hermano, Ekib Hern, Greves Heron, Jagged Heron, Christel Herzbrun, le Herzog, Reverend Herzog, Elektra Hesse, SweetDesire Heston, Cotton Hicks, Zack Hicks, Kevyn Hienke, Tristan Hienzman, Devin Hill, Wendy Hill, Tensai Hilra, Valek Hin, Adolph Hinkle, Timothy Hinkle, YoCo Hird, Amber Hirvi, Dagon Hitchcock, Heather Hitchcock, Noah Hitchcock, Sianna Hock, Dominique Hofmann, Holly Hofmann, Ganador Holgado, Brookston Holiday, Davidd Holmer, Sam Holyoke, Alexander Homewood, atory Homewood, dabadguy Homewood, Ed Homewood, Huge Homewood, Meesha Homewood, tilstad Homewood, Cremi Honey, Laura Honey, Sandling Honey, Honey, Haos Honua, Vudu Hoodoo, Dallas Horsefly, Lucy Horton, SJ Horton, Homer Horwitz, naty Hotaling, Traceysvideos Hotger, DaQueenB Houston, Natasha Houston, Tia Houston, Hughes Howard, Meg Howe, Edward Howton, Falllen Howton, Pepto Hoyer, Sabrina Hoyer, LadyAbigail Hubbard, Kristopher Hudson, Nikita Hudson, Titus Hudson, XLR8RRICK Hudson, Holly Huffhines, Bella Hugo, Haole Hula, Sard Huldschinsky, Neran Hull, Anastasia Humphrey, October Hush, Silent Hush, Ctarr Huszar, ac14 Hutson, Dex Hutton, Fox Hwasung, Johanna Hyacinth, White Hyacinth, Adrianna Hyde, DJ Hyde, Ty Hyland, Adeline Hynes, Cathy Hynes, DeepSweet Hynes, Psykeeper Hynes, Sexy Hynes, Ares Hyun, Emperor Hyun, melodie Hyun, slayer Hyun, Puck Ida, Weary Ida, Anne Idler, Ruby Idora, Bryan Idziak, Six Igaly, elfi Independent, Spike Independent, Veilofunknown Independent, Bryndi Ingersoll, Ingrid Ingersoll, Noelyci Ingmann, Andrew Ingrassia, Dale Innis, Foxy Innis, Vern Innis, 111Mc Innis, Cloud Insoo, MEtoo Insoo, Quinn Iredell, Rebekah Iredell, Lucien Ireton, Maggie Ireton, Austin Ironclad, DavidJames Irwin, Roy Irwin, Xavier Irwin, Esmee Isbell, Miyu Ishii, Billy Islander, Misa Itamae, Magnum Iuga, Akasha Ivory, Juliana Ivory, WHITEMAGIC Ivory, Gazometr Ivory, Indigo Izumi, Kami Izumi, Salazar Jack, Gunslinger Jackalope, Sutton Jacks, Casandra Jackson, Dernard Jackson, Dougal Jacobs, Lone Jacobs, Sydney Jacobs, jefftlse Jacobus, jose007 Jacobus, justine Jacobus, LampLighter Jacobus, Micha Jacobus, Jadge Jacobus, Enchant Jacques, Victoria Jacques, Dreamweaver Jae, Gregoire James, Kizza James, Vienna James, Barry Jannings, Bianca Jannings, Gwen Jannings, Juappa Jannings, Paisley Jannings, Coos Jansma, Fernandinho Jansma, Griffioen Jansma, Jiire Jansma, IsisLynn Janus, Theobaise Janus, Conway Jarrico, DylanJr Jarrico, Quest Jarrico, erba Jarvis, Jeagerman Javelin, Alan Jay, Lopp Jay, harpo Jedburgh, Craig Jeffries, Alexis Jenns, Bimbie Jenns, XanXan Jervil, Alexander Jessop, Gelenas Jessop, RodneyLee Jessop, Tataniya Jessop, Amethyst Jetaime, Kooky Jetaime, Sapphire Jetaime, Tempest Jewel, Vampirella Jewel, Elia Jewell, Josey Jewell, Shaolin Jewell, Sheeba Jewell, Stefu Jewell, Uma Jewell, Rosslin Jiang, alex Jimenez, Forest Joffe, John Jogiches, Dyani Johin, Musashi Johin, Major Johnson, Dean Johnson, Peter Johnson, Thomas Carson Johnson, Janet Jones, Jason Jones, Bedo Jonze, Elaine Jorgensen, Osiloa Jorgensen, Mariah Jubilee, Sam Jubilee, Ada Jun, Chenak Jun, Ferris Jun, kelyane Jun, Takeshi Jun, Tommi Jun, Phoebe Juneau, Grace Juniper, icandi Juno, Kimo Junot, isha Juran, Orchid Juran, Torsten Juran, Krzywol Kaczmarek, Sakura Kagekiyo, Meni Kaiousei, Fritz Kakapo, Esdrael Kamachi, Kathy Kamenev, Darsuky Kaminski, Rebecca Kaminski, Digital Kaos, Kappa Kappa, Leah Kappa, Gapple Kappler, Cristalle Karami, Toledo Karas, Tina Karlfeldt, Angelina Karura, Samara Kasshiki, Kitty Katscher, Lonetree Katscher, Goldie Katsu, Shamir Katsu, Lacey Kavanagh, Scrooge Kavanagh, Faye Kawabata, Ninja Kawabata, Onimusho Kawaguichi, Brad Kazakov, Ida Keen, Jeff Kelley, Kyle Kelley, An Kellner, Cindy Kellner, Kean Kelly, Tony Kembla, KaliCat Kennedy, Fred Kenorland, Sharon Kent, Nils Kenzo, Rase Kenzo, Tammy Kenzo, Tyci Kenzo, chica Keon, Benja Kepler, Gust Kepler, KittyKatt Kerensky, anton Keynes, Ipenda Keynes, Malevolyn Keynes, Ayumi Khorana, Hoshi Kiama, Nekorina Kiama, Aurillius Kidd, Bare Kidd, Billboard Kidd, Blurple Kidd, Cade Kidd, Ekerilar Kidd, FFS Kidd, Lazarus Kidd, Lea Kidd, MidnightRush Kidd, Mittens Kidd, Morliona Kidd, Neilly Kidd, Kim Kienzle, RJ Kikuchiyo, Gail Kilara, Fish Kilby, zeelee Kindley, Montez King, Dax Kirkorian, Myoukitsune Kirkorian, Szandor Kirkorian, Cmtccmoi Kish, Kia Kish, DaQbet Kish, Coca Kit, Developer Kit, pronto Kit, Sunshine Kit, ssjkriccolo Kitchensink, Reisuki Kitsune, Tengu Kitsune, AngelEyes Kittinger, Devilish Kitty, Kitty, Panther Kitty, Daaneth Kivioq, Praseodymium Kivioq, Sonya Kivioq, Emily Kleene, Buejien Klees, Princess Klees, SaltySugar Klees, Parrish Kline, ProfessorKindly Kline, Chelsay Knibber, Victoria Knight, Raspitomaru Knopfli, Cocoanut Koala, Akiko Koba, Bryan Koba, dawood Koba, Izen Koba, Nebur Koba, Taran Koba, Pamela Koenig, Neo Koga, BlackOut Kohime, Jazzie Kohime, Naa Kohime, Seriuskid Kohime, Wandale Kohime, Zana Kohime, Zerosix Kohime, Maucat Koi, Dagmar Kojishi, Chroma Kolache, Icey Kolache, Kornscope Komachi, Bri Koolhaas, KamaSutra Koolhaas, Katya Koolhaas, Trylle Korda, Corrine Korobase, Navajo Korvin, Pasha Korvin, David Kostolany, quintin Kostolany, Tasha Kostolany, Amy Kotobide, Zaphod Kotobide, KYWLDCT Kovacs, LillyEliska Kralomoc, Joseph Krams, Fumon Kubo, LudwigVan Kubrick, Anagras Kuhn, Selina Kuhn, Tal Kuhn, Finora Kuncoro, Maya Kupferberg, Jana Kurelek, Shika Kuri, Yo0gy Kuri, Endo Kurosawa, Tatsuki Kurosawa, MrBill Kurri, Albert Kwak, Kwakkelde Kwak, Duckling Kwak, Kasey Kyger, Kaimi Kyomoon, Stelard Kyomoon, Kyo Kyong, Emm Laa, Keera Laasonen, Delvendez Laborde, Raban Laborde, Amodeus Labrada, Louisa Labrada, Sweeten Lacey, Fiachra Lach, Eliv Lachman, Flykiwi Lachman, Charlie Laffer, LarryS Laffer, Sasha Lafleur, OxLukexO Lagan, Shadow Lagan, Tilianna Lagan, Jaye Lahtoh, Davoid Lake, Fairlight Lake, Thomas Lake, Veronique Lalonde, Leticia Lambeau, Maleia Lambeau, Cross Lament, Drakon Lameth, Misch Lameth, Caeleigh Lamington, Nedrick Lamont, essayn Lamont, Dwayne Lancaster, Hiram Lancaster, Carlton Lane, Christo83 Lane, DOO Lane, Niket Lane, Roughtoe Lane, Taylor Lane, Ami Lang, Emily Lang, Ruadh Langwarrin, Sasha Lapointe, Garrett Laramide, TBA Lardner, Beverly Larkin, Marcoh Larsen, Vanessa Larsen, bjf25 Larsson, curL Larsson, Garsson Larsson, Jondolarr Larsson, Justicar Larsson, Quinn Larsson, redshoedave Larsson, Tod Larsson, lea Laryukov, Renate Laryukov, Benny Lassally, Khristen Lassard, Josh Latrell, Lacey Latrell, Shari Latrell, Casper Laughton, Kory Laughton, Lisa Launay, Sasha Launay, Areyn Laurasia, Crystaleen Laval, Moirae Laval, Sascha Laval, Slasha Laval, Tiberius Laval, Shadow Laviolette, Velarissa Laviolette, Zeus Laws, Snaptick Laxness, wtf Laxness, Carrie Laysan, Norton Lazarno, Candide LeMay, Dustin LeMay, Shelly LeMay, Antionette LeShelle, Hayden LeShelle, Kristian LeShelle, Monika LeShelle, Mysti LeShelle, Shaklin LeShelle, Shavaii LeShelle, Lord Leafblower, Kinjry Legend, UniqueRose Legend, Jonny Legien, Lillia Lehane, Renae Leigh, KeiAira Leigh, Casper Leinhardt, MiaLily Lelouch, Adriana Lemieux, Keiki Lemieux, Ginger Lemmon, Heather Lemmon, JohnnyMac Lemmon, Lenni Lemuria, Bubba Leonard, Spyder Leroy, Aral Levitt, DarionMonkee Levitt, Quiana Levitt, Angharad Lewellen, AngelEyes Lewis, Cookie Lewis, JonnyImpala Lewis, Ekka Li, Jesa Li, Anark Liebknecht, KUieTSToRm Lightcloud, Lincoln Lightfoot, Nicola Lightfoot, Shaman Lightstone, Nika Lightworker, April Lilliehook, Joi Lilliehook, Kimi Lilliehook, LAPDHOLLYWOOD2000 Lilliehook, Lindy Lilliehook, Shayne Lilliehook, Skywil Lilliehook, Neo Linden, Amber Linden, Guy Linden, Teeple Linden, Marck Lindman, NoSpy Lindman, Rahduhlac Lineker, Evangeline Ling, Kailani Ling, Karyll Ling, Lexus Ling, moon Ling, Wai Ling, Samantha Lingiuan, CyberonX Link, Laynie Link, SLurl Link, Aphrodisiack Lisle, Petunia Liveoak, Eithnie Llanfair, Jennifer Llanfair, Pami Llewelyn, Gwyneth Llewelyn, Kiten Lobo, Paul Lobo, Khrome Lock, Brett Logan, Dragger Lok, Pavig Lok, Sera Lok, May Loll, Lola Lollipop, SweetTasting Lollipop, Nikee London, Trinity London, Dogan Lonergan, Rod Longcloth, Excalibur Longstaff, Apolonique Loon, Austyn Loon, Danyhael Loon, Goreki Loon, Huligo Loon, Jaffred Loon, LouisS Loon, Luke Loon, mahee Loon, Ruthless Loon, Melina Loonie, rasta Lopez, Lydiah Lorentz, Stellar Losangeles, Blackie Lotus, Misha Lotus, Alysia Loudon, Grace Loudon, grumble Loudon, Kate Loudon, kimmie Loveless, LadyMacbrat Loveless, Ally Lovell, Dixii Lovell, Darb2rad Lowe, Lozzie Lowe, Trip Lowe, Andrek Lowell, Jaraziah Lowell, Lissa Lowell, Stryfe Lowell, Leland Lowell, Leonardo Lowey, Stagger Lowey, Strabo Lowey, Raen Lu, Laurie Lubezki, MissJean Lubezki, Lucia Lucero, Lee Ludd, Franchises Lulu, Jayden Lulu, Kitten Lulu, mona Lumet, Alienor Lumiere, Michi Lumin, Wolf Lumin, Grumpy Lumley, Sian Lumley, HamSuiJe Lumpen, Laguna Luna, Starbella Luna, Ashley Lundquist, Theosta Lunt, Cliothe Luo, Lincoln Lupino, Bronwyn Lurra, Mineki Lurra, MYMistress Lusch, Linnae Lusso, Natalie Lustre, Rose Luxemburg, Helena Lycia, AG Lykin, Lhlilith Lykin, Niko Lykin, Logan Lyne, Jacques Lytton, Kianeira MacDiarmid, Apple MacKay, Melissa MacKay, Bailey Mackenzie, Maxx Mackenzie, Rose Mackie, Ee Maculate, Gaetan Maculate, Ravarian Maculate, Adrian Maddaloni, yearning Maddaloni, Ava Maddux, Flezix Maddux, Karamel Madison, Allure Madonna, Mannie Madonna, Sitearm Madonna, Mario Madsen, Mitzy Madsen, Ben Maersk, Lillian Maertens, Turk Maertens, Stephanie Magnolia, Lonique Magojiro, WarKirby Magojiro, Loki Mahana, Vinny Mahana, Semiramis Mahina, Shadow Mahoney, Rissa Maidstone, Tynana Maidstone, Angel Majestic, Jeremy Majestic, StarFire Majestic, Tiara Majestic, One Maktoum, Lana Maladay, Marzipan Maladay, Missy Malaprop, Ordinal Malaprop, Void Malaprop, Natasha Malibu, Rygel Malick, Ali Maltz, Leena Maltz, Cage Mandala, Synthalor Mandelbrot, Zeppelin Mandelbrot, Esteban Manen, Kawaii Manga, Mailee Manga, Nathalie Manga, Yinato Manga, Mya Mantis, Madame Maracas, Maisa Maracas, Domino Marama, Panama Marama, Charm March, SallyWoelfin March, Markel Marchionne, AdriAnne Margulis, Edgware Marker, Tika Market, AiSenshi Market, Lizbeth Marlowe, Queue Marlowe, Joana Maroon, Grey Marquette, Adrianna Marquez, Jeremy Marquez, Shirley Marquez, Christian Marquez, Dax Mars, Dnate Mars, Xandi Mars, Sarah Marsi, Garmon Martin, Sean Martin, SignpostMarv Martin, Brittany Martinek, Sweet Martini, ElDraque Martov, Aminom Marvin, Edwin Marvin, Meatnik Marvin, Zanza Marx, bollit Masala, Nguai Masala, Satya Masala, team23 Mascot, Tyler Mason, NAM Massey, Minasojo Massiel, Gatto Mastroianni, Checho Masukami, SlavegirlPaula Masukami, Hellsing Matador, Femina Matahari, Leoki Matahari, Rosa Mathieson, Violet Mathieson, MikVik Mathilde, Jonathan Mathy, Ernesto Matova, Selenia Matova, Meltharas Matsukaze, lordneg Matzerath, Memnoch Matzerath, Dedric Mauriac, Kezz Mauriac, Wolruf Mauvaise, coyote Maverick, Martin Maxwell, jericka May, Jeza May, Mellony May, Lauri Mayfair, EnCore Mayne, revochen Mayne, amaya Mayo, Hellmanns Mayo, Jima Mayo, Kion Mayo, Kisho Mayo, Mo9a7i Mayo, Neobe Mayo, Salazar Mayo, Sat Mayo, Scotto Mayo, William Mayo, Gino McAllister, Masion McAllister, Wallace McAllister, DarlinNikki McAlpine, Hawk McAlpine, Inga McAlpine, Lex McArdle, Maggie McArdle, Joshua McCallister, Keegan McCallister, Bradford McCann, Ella McCann, Flox McCarey, Jezzie McCellan, David E . McClure, Cash McConachie, Cathal McConachie, Tad McConachie, Aodhan McDunnough, Drew McDunnough, Artie McFly, Minnie McGann, Sabine McGettigan, Poppet McGimsie, Carole McGuire, Tegwenn McKenna, Shaemus McLaglen, ShirleyM McLaglen, Dirty McLean, HoseQueen McLean, Billibob McLeod, Cari McLeod, Innes McLeod, Jaenae McLeod, Slate McLeod, Troy McLuhan, Anya McMahon, DoGGo McMahon, Hutch McMahon, Iras McMahon, Jian McMahon, Jimama McMahon, Kouki McMahon, Sioban McMahon, Akie McMillan, laika McMillan, Lauris McMillan, Marteze McMillan, Maye McMillan, Nicholas McMillan, Radikal McMillan, Tammi McMillan, Jax McNally, Arwyn Meadowbrook, Waterflower Meadowbrook, Ima Mechanique, Nber Medici, Chandra Meehan, Geo Meek, Earane Meiji, Jessica Meiklejohn, Emiko Meili, penelope Meili, Luz Melbourne, Marti Melnik, MenuBar Memorial, Aitor Mendes, Mona Mendes, Jay Menges, Kimmie Menges, Lennart Menges, Margaret Menges, Mikel Menjou, VzNevada Menoptra, Merselus Mensing, Leia Mercy, SAPPHIRE Mercy, Sofie Mercy, ozadakan Meriman, Sandycd Meriman, Washington1985 Meriman, Infiniview Merit, Nanashe Merkur, Ayahuasca Merlin, Craischen Merlin, devillover Merlin, Faer Merlin, Jarros Merlin, Jolie Merlin, Kejo Merlin, Mario4 Merlin, Sarah Merlin, Silas Merlin, Wizard01 Merlin, Telitha Merlin, Vrrgo Merlin, Rocky Merosi, Luxe Merrienboer, Lance Mertel, Angus Mesmer, MysElf Messmer, Lonny Miasma, Utopar Michinaga, MTC Mielziner, Enysy Mikita, Celeste Miles, Giovani Miles, Guli Miles, Mars Miles, Noah Miles, RobWest Miles, Subzero Miles, DALLAS Milestone, Jane Milev, Jesper Milev, MMz Milev, YumYum Milk, Belle Milland, Berri Milland, Joanne Milland, Vicky Miller, Samantha Miller, Calvin Millions, Envy Millions, Lusty Millions, Versu Millionsofus, AsteroidS Mills, Emixam Mills, Goodstuff Mills, Guntrinkyt Mills, Isabella Mills, Landen Mills, Noelle Mills, Sand Mills, Djarno Mills, Mandee Milner, Haika Milo, Mankud Milo, Slobodan Milosz, Eliezer Mimistrobell, Amoret Mineff, Little Ming, Mako Minogue, Mandee Minogue, Milena Minogue, Sylfie Minogue, Manon Mirabeau, Tygeria Mirabeau, leliel Mirihi, Cmdr Misfit, disisme Misfit, fangy Misfit, Grim Misfit, RedWolf Misfit, Michal Mishin, Robby Mission, Shawn Mission, Haravikk Mistral, Thom Mistral, Sertories Mitchell, Temporal Mitra, Bphero Mizser, Stolar Mohr, DarkWulf Mokeev, Nemo Mokeev, sharon Mokeev, Sech Molinari, lara Molinaro, MARIOS Molinaro, James Mommsen, Sierra Monnett, Joan Monstre, Cattra Montagne, Galadhriel Montagne, AnnaMarie Montgomery, Christine Montgomery, Mariah Montgomery, Shawna Montgomery, Jemima Moo, Jihashi Moo, Moonie Moo, Wiske Moo, Borgie Moody, DOA Moody, Makinzie Moody, Preciousse Moody, Bit Moody, Luna Moody, ziphren Moonflower, Axl Moonlight, FxyLdy Moonlight, Stormy Moonlight, Lichtje Moonsoo, Astryd Moore, Haze Moore, Walker Moore, wiseman Moore, Zak Moore, Mordechai Moose, JMM Morahan, Kayleigh Morahan, Cyndi Moran, Marcus Moreau, Kathy Morellet, Violet Morellet, Heather Morenz, Maggie Morgan, Newbie1canobe Morgan, Sumar Morgan, Bella Morico, Ornella Morigi, Eagle Morris, Amanda Morrison, Maeyanie Mosienko, Svetlana Mosienko, Trinity Mostel, Risa Mosuke, Falcon Mountain, NEWB Mountain, Windy Mountain, KittenAnne Mousehold, Minky Mousehold, Lawna Mower, Pure Moxie, webeagle Moy, Buckaroo Mu, Nye Mu, Kara Muir, Robert Muir, Criscad Muni, Jean Munro, Pranay Munro, Nobu Murakami, Shar Murakami, Yumi Murakami, Arrekusu Muromachi, Sasameyuki Muromachi, Usagi Musashi, Spiritfire Musketeer, Questyn Myhre, Myst Mysterio, Vincent Nacon, Fox Nadir, Morgana Nagorski, Sari Naheed, Yasmin Nakamichi, Aibyou Nakamura, Aluviel Nakamura, Kyriani Nakamura, Madeea Nakamura, Masao Nakamura, Misao Nakamura, Tammi Nakamura, Tanabata Nakamura, Nawtakune Nakatani, rich Nasu, Lev Nedkov, Coal Nelson, Shiharizad Nelson, Laurah Nemeth, Beladonna Nephilim, Lianna Nephilim, Seraph Nephilim, Sari Neruda, Tiberious Neruda, otakup0pe Neumann, Wilhelm Neumann, Chet Neurocam, Draconis Neurocam, Cenji Neutra, Lex Neva, Prokofy Neva, BC Nevadan, Seagel Neville, Judi Newall, Killian Newall, Si Newall, Roenik Newell, Jos Newman, Lynda Newman, MadCat Newman, Weaver Newman, Ian Newt, Ribblet Newt, ninjafoo Ng, Raideur Ng, William Niangao, Gao Niangao, Lori Nicholas, Pravda Nicholas, Evangeline Nichols, Joella Nico, Morpheus Nieder, Titzalina Nieder, Blaze Nielsen, Angelus Nielson, Lazaros Nikolaidis, lincoln Nikolaidis, Tiruviel Nikolaidis, Kenn Nilsson, Lib Nilsson, Jokyr Nimbus, Tateru Nino, Jyotsna Nishi, lloll Nishi, Roxas Nishi, Tuote Nishi, Katlene Niven, Kari Niven, Thegamer Nixdorf, May Noarlunga, Jo Noe, DesrAw Noel, Jacindia Noel, Jaz Noel, MelodyRose Noel, Mi Noel, Paden Noel, Ricky Noel, Sunno Noel, Ono Noh, Tuach Noh, Feras Nolan, Jane Nolan, Harald Nomad, Helen Nomura, Lolita Nomura, Richard Noonan, Aenea Nori, Aulin Normandy, Kat Normandy, Zebra North, Stephen Northport, Galare Novi, KittyMarie Novi, Soo Novi, Elia Nozaki, lynsey Nozaki, Rini Nozaki, Kinzo Nurmi, Yasmin Nurmi, Kyran Nyak, Lauren Nykvist, Karma Oates, Alice Obscure, Honeymoon Obscure, Mikhail Obscure, Origin Obscure, Dementia Obviate, Lucius Obviate, Mootly Obviate, TripleXXXTex Obviate, Vanessa Obviate, Vitis Obviate, Sieben Ochs, Avery Oddfellow, Clinton Oddfellow, Maczter Oddfellow, Sempervirens Oddfellow, Tashie Oddfellow, Wagahai Oddfellow, CarlinRae Odell, Johnny Odell, Liny Odell, Lucifer Odell, vanler Odets, Foxb Oe, Kiwini Oe, Natalie Oe, Eddy Ofarrel, Mylinn Ofeq, Roundabout Ogee, Bannock Ogg, Behemoth Ogre, Anju Oh, BlackCinders Oh, Canoe Oh, Crippy Oh, Dakotah Oh, Day Oh, Doo Oh, Feander Oh, Heady Oh, Job Oh, kyushudan Oh, Lila Oh, Luxura Oh, MrSim Oh, OHYES Oh, Oury Oh, Qyty Oh, Santa Oh, Svn Oh, Volta Oh, xepadd Oh, isla Oh, Angelina Ohara, Troy Oherlihy, Yasuragi Okame, Rephaim Okina, Sven Okonomi, benyamin Olaria, EvlDesire Oliver, Brightly Olivier, Renton Olivier, Gary Olson, Christopher Omega, Hamncheese Omlet, Joseph Omlet, Libuse Ondricek, luminye Onizuka, Miyuki Onmura, Toshiro Onmura, Hotaru Onomatopoeia, Isis Ophelia, Orchid Ophelia, Stumbelina Ophelia, Roberto Oppewall, Anthony Opus, Spaceman Opus, Vakis Oranos, Koop Orbit, Sammy Ormsby, Cal Orr, Usra Ostrich, Nikki Osumi, Ariel Otafuku, kevin Oto, CJ Oto, Ann Otoole, Patrice Otoole, Abyssin Otoro, Omega Otsuzum, Teravus Ousley, Straitjacket Overlord, Szegey Oxberger, LemonYellow Oxide, Tabitha Oxide, Rianne Ozsvar, Coyote Pace, Hare Pace, Dargon Pacer, Piero Padar, Zasha Padar, Chav Paderborn, Edison Paderborn, Otenth Paderborn, RC Paderborn, Sylvia Paderborn, Chandra Page, Lili Page, Raven Page, Web Page, AnneJoy Paine, DravenLee Paine, Isobella Paine, Larva Paine, Lushious Paine, Thomas42 Paine, Cesar Pakula, Federico Palen, Monica Palen, Diana Palmer, sense Palmer, Crazy Pangaea, Sacha Pangaea, Upinthe Panhandle, Simbiant Paperclip, Drea Paperdoll, Pannie Paperdoll, raymon Paperdoll, jaesung Papp, JohnJ Papp, Alec Paragon, Cliff Paris, Vertigo Paris, Blue Parisi, serena Parisi, JR Parker, Kora Parker, Prawnyloks Parker, Etheria Parrott, Tommy Parrott, Selaras Partridge, Sexy Partridge, Maegen Parvenu, Francie Pasternak, Mr Pasternak, Eloise Pasteur, sandhya2 Patel, Bruce Patton, Penny Patton, Dave Patton, Haole Pau, Andy Paul, LanNoire Paul, Nolte, Paul, Nicholi Pavlova, shadow Pawpaw, Cuffman Payne, Deseri Payne, Gypsy Paz, LupineFox Paz, Shy Peart, Tamara Peart, Pontias Peck, Robin Peel, Elum Pegler, Kotek Pekli, Pulp Pekli, Reaser Pencer, Caliandris Pendragon, Hiro Pendragon, Jopsy Pendragon, Darren Pennell, Mideon Pennell, Powell Pera, Stanley Pera, Tajma Pera, FlipperPA Peregrine, Jennyfur Peregrine, Alana Perenti, MaxPerfect Perenti, Revolution Perenti, MoonGazer Perhaps, Brooklyn Perinal, Shawk Pertwee, Drakior Perun, Charm Perway, Jubilee Pessoa, Riley Pessoa, Tristram Petion, Aline Petrov, Larry Petrov, PantzerHamzter Petshop, scott Petshop, Foxy Petunia, Inara Pey, Tony Pey, Brathak Pfeffer, Henrick Pfeffer, Jack Pfeffer, Marlo Pfeffer, Resi Pfeffer, Lum Pfohl, TACK Pfohl, rren Pfohl, Psyke Phaeton, Sangi Phaeton, Don Pharaoh, Topdog Pharaoh, Anderson Philbin, Philb Philbin, Ridge Phillips, Maximus Phlox, Careltje Phoenix, Winter Phoenix, Ummm Pickles, Piper Picnic, Loki Pico, Hawk Pidgeon, followmeimthe Piedpiper, Alin Piek, Ricky Piek, angelwithahintoflife Pierterson, Elsibeth Pierterson, Marod Pierterson, Noshi Pierterson, Shanel Pierterson, Natasha Pike, Joshua Pilote, Adeline Pinion, Miguel Pinion, Quinn Pinion, Peach Pink, Tisha Pink, Lulu Pink, alice Pinkerton, Getty Pinkerton, Apple Pinkney, Becky Pippen, Tam Pippen, sandra Pitney, Trish Pitney, Max Pitre, Hawk Pitts, Spritely Pixel, Chel Pixie, HotBuns Pixie, Mina Pixie, Mcplane Planer, simon Planer, Guy Plasma, Halogen Plasma, Mathias Plasma, Phill Plasma, White Platini, Phoenix Platthy, Gallia Plubeau, Corki Plunkett, PollyD Plunkett, Asalynda Pluto, Evgeniy Podolsky, OTTONE Pogelmann, Henry Poindexter, Phoebe Poitier, Rowan Poitier, Rigorus Poitier, Stephen Pollock, Mishka Pomeray, Kuatum Poole, Karina Popinjay, Francesca Poppy, Hot Poppy, Shelly Portello, Anthony Portsmouth, Ian Portsmouth, HackPatooey Posthorn, JohnnyD Posthorn, Madison Posthorn, Antitese Poulot, Uccello Poultry, Tanarus Pow, Frederic Prevost, Bill Priestly, Dit Priestly, Phil Priestman, Rachelle Priestman, Sage Priestman, Simone Prieto, Wundur Primbee, Jacob Primeau, Twilight Primeau, Beautifull Princess, Creamyyy Princess, Graciella Princess, Lyna Princess, Theo Prinz, Krono Pro, Don Proost, Games Prototype, Melissa Prunes, Pie Psaltery, Danger Pugilist, Lily Pussycat, LoL Pye, PITTACOS Pye, Prize Pyle, Reese Qian, Ash Qin, Jen Qinan, milesmess Qinan, Quino Quaggy, Starsitter Quality, Algeard Quamar, Flack Quartermass, Marcus Quartermass, Shaggy Quimby, Laura Quimby, Memir Quinn, Amy Quirk, Edge Qunhua, HeinzJoachim Qunhua, Tsing Qunhua, brooke Ra, Dael Ra, Knightsof Ra, Mayo Ra, Roger Raabe, Sharven Raabe, Sail Racer, Supra Racer, Ada Radius, Rob Raffke, Rayne Ragowski, Starfoxtj4 Rail, mantitaur2 Rainbow, Sparkly Rainbow, Andromeda Raine, musicteacher Rampal, Hoyle Rang, Hermione Ranger, jurnal Ranger, Horgus Rasmuson, Trend Rasmuson, Whoosh Rasmuson, Rascal Ratelle, Eriss Rau, Morugai Rau, Ozhika Rau, slave Rau, Awsoonn Rawley, Marie Rawley, Guy Raymaker, JAC Raymaker, PlanetThoughts Raymaker, Rogier Raymaker, Trident Raymaker, Xoren Raymaker, Ranaa Raymond, Rowena Rearwin, Londyn Reatequi, Neo Rebus, Bekka Redgrave, Etude Redgrave, Lyn Redgrave, Publicist Redgrave, Wingless Redgrave, Allie Ree, Jon Ree, Thyna Ree, Zi Ree, Todd Reed, RhaRha Rees, Alex Regent, Alexander Regent, Cat Rehula, Timoteo Reifsnider, Sirus Reiner, Trilobite Reisman, ali Reiter, Ruben Reiter, Fenrir Reitveld, EmpressNever Rejected, Maya Remblai, Kapu Ren, Atticus Renoir, catsrounds Renoir, Cedric Renoir, Julion Renoir, karman Renoir, Sim Renoir, Isabela Repine, MysticalCeCe Repine, Sissimaid Resistance, Tom Reuven, Beagle Revolution, Xin Revolution, Keex Rexroth, Ordos Reymont, Roz Reynolds, CJ Rezillo, Rena Rhea, Hiroaki Rhino, Curious Rhode, Lexy Rhode, Natriumcitrate Rhode, Toshi Rhode, Pam Ribble, Gia Richard, Gigly Richez, Hutton Richez, Renae Richez, Ronald Richez, Roxi Richez, Jimbo Richez, Josh Rident, Finncaev Riederer, Aeryn Riel, INK Rinkitink, Puck Rinkitink, Riki Rinkitink, Edoardo Ritt, Bibi Riva, Eche Riverview, helloau Riverview, Liam Roark, Angela Robertson, Jay Robson, Brooks Rocco, Marth Rocco, Mo Rocco, Wolf Rocco, dartagnan29 Rockett, marco Rockett, Monida Rockett, ortaga Rockett, Raziel Rockett, Anastasia Roelofs, Stormy Roentgen, Hector Roffo, Ricci Roffo, Tonio Roffo, Picaro Roffo, IvanTwin Rogers, Chrisje100 Rojyo, Rowana Rolland, Shine Rolls, Iris Ronmark, Jacques Ronmark, Phil Ronzoni, Keishii Roo, MattyMcHatton Roo, Kimika Rookwood, Prego Rosca, Rayne Rosca, Uber Rosca, Felix Rosenberg, Amethyst Rosencrans, Alejandro Rosenthal, Davian Rosenthal, Edgar Rosenthal, Seth Rosetta, Alustriel Rosewood, Arenae Rosewood, Fury Rosewood, Gwendelyn Rosewood, Kira Rosewood, liz Rosewood, Oriene Rosewood, Lashelle Rosse, Roodvosje Rosse, Rose Rosse, Rico Rosse, Jonah Rossini, Milordino Rossini, Sparrow Rossini, Yira Rossini, Zanah Rossini, zina Rossini, Francaldo Rotunno, Reckless Rotunno, Excel Rousselot, mica Rousselot, Lexie Rovio, Alexandra Rucker, Lilith Ruff, Stina Ruff, Aragorn Runo, Kragelund Runo, Rinziq Runo, ViRi Runo, Distilled1 Rush, Jordann Russell, Kryton Russell, Miyaki, Russell, Brent Russell, Revons Rutabaga, Rocky Rutabaga, FEZ Rutherford, Darcy Rutledge, Jo Ruttenberg, Odo Ruttenberg, Theodorrick Ruttenberg, Artix Ruxton, Armand Ryan, Zakeir Rydell, Cathy Ryder, McCall Ryder, Inarra Saarinen, Kai Sabena, Sarie Sabena, Alissa Sabre, Arcticfire Sabre, BamBam Sachertorte, kai Sachertorte, Umphrey Sachs, Mila Sadovnycha, Proxima Saenz, Lynne Sage, Cheloxchile2006 Saiman, Milo Saintlouis, Natasia Saintlouis, Trinity Saintlouis, Rollergirl Saiz, Nyoko Salome, Scandinavian Salomon, Agarash Salsman, Rayne Saltair, Horus Salubrius, Solta Salyut, Nicola Samiam, Aleg Sandell, angeltf Sands, Balkan Sands, Charmaign Sands, Check Sands, Damien Sands, Orika Sands, Other Sands, Padraic Sands, Sotos Sands, Taira Sands, Cloudia Sani, Carinthia Sansome, Allasandra Santos, Rosell Santos, Solanghe Sarlo, Ishara Sartre, Charles Sassoon, Damian Saule, Jesse Sautereau, Natalia Sawley, Billie Scaggs, Mordecai Scaggs, Roz Scaggs, Socaliwag Scaggs, Johannason Scarborough, Jim Schack, Norm Schack, Fatz Scheflo, MissKitten Schildhauer, Nelson Schmo, Werner Schnabel, Tammye Schneider, Frank Schneider, Funk Schnook, cleopatras Schnyder, mylife Schnyder, ScOrPiOn Schnyder, Count Schridde, Kircheis Schroeder, Julia Schulze, Anita Schwartzman, Cornelious Schwartzman, Etrius Schwartzman, Dr Scofield, Joe Scofield, RyanAva Scofield, Kira Scott, Six Seale, Sterremare Seale, Dallas Seaton, Star Seaton, Spurs Seattle, Elio Seelowe, Jaden Seelowe, Moira Seelowe, Teleio Seferis, Artemus Seifert, Gouranga Seiling, Alyrae Seitan, Grace Selene, Maureen Selene, amandaelisabeth Sellers, Chelsey Sellers, Fashion Sellers, Novellium Sellers, Kerutsen Sellery, Semolina Semaphore, ice Semple, Daisy Semyorka, Roxy Semyorka, DarkStar Senior, River Senyurt, Singular Seoul, James Seraph, Jesrad Seraph, Liv Serf, Tears Serf, Neon Serge, Magnum Serpentine, Jazzy Serra, Aiyana Serrurier, Coelacanth Seurat, Jean Severine, Landreu Severine, Gitana Sevier, Elizabell Sewell, johni Seymour, nayeli Shabazz, Talena Shabazz, Princess Shalala, Robbie Shamroy, Dimas Shan, Lancer Shan, Nae Shan, onlyyou Shan, Shango Shan, Spirit Shan, Jumpda Shark, DigiKatt Shaw, Steffi Shenlin, Afon Shepherd, Clair Shepherd, Eastern Shepherd, LadyLeah Shepherd, Lexis Shepherd, Siddhartha Shepherd, Taran Shepherd, Valentin Shepherd, Jieux Shepherd, Delicious Sheridan, LauraAnne Sheridan, Remco Sheridan, Aki Shichiroji, Todedoz Shichiroji, BlckCobra Shikami, Mary Shikami, Seven Shikami, Thomas Shikami, Szia Shilova, lisalove Shimada, Yoyo Shinobu, Tarrant Shipman, Kitsuribami Shirabyoshi, Amber Shirakawa, AmySue Shirakawa, Kanna Shirakawa, Shelectra Shirakawa, CJ Shojo, Felix Sholokhov, VonFoxFire Sholokhov, Renegade Shriner, Alexandra Shu, Bung Shu, Ddevine Shuftan, emmakael Shuftan, Skipper Shutt, Jaime Sicling, Ko Sicling, Lucien Sidek, Ulrich Sidran, Darlene Sieyes, Darling Sieyes, sparkles Sieyes, Mjren Silvera, Apotheus Silverman, HVX Silverstar, Nirven Silverstar, Rocco Silverstar, Tamar Silverstar, Rosie Simca, Drvid Simoni, Dragos Simons, barnowlgirl Sinatra, Cheyanne Sinatra, marilsdb Sinatra, Nanceee Sinatra, Quiet Sinatra, Vent Sinatra, Frosty Sinatra, Misty Singer, Katie Singh, Sydney Singh, Philo Sion, followingwaves Sirbu, Saya Sirbu, Don Sivocci, Danielle Skall, Hegemon Skall, JASMINE Skall, Mykal Skall, Dovryn Skall, Arathorn Slade, Artakan Slade, djsunz Slade, Eleana Slade, Erica Slade, Jupiter Slade, Kronikz Slade, Methosmv Slade, piro Slade, Snapeslove Slade, Sys Slade, TylerSnk Slade, Wylee Slade, ZirQ Slade, Xabax Slade, Malik Slapstick, Coug Sleeper, Kenny Sleeper, Lucia Slippery, Adrian Sloane, Alistair Sloane, Rysz Sloane, Angel Slocombe, PrinceDK Slunce, Flo Slunce, Tatiana Smagulov, badboy1331 Smalls, Brat Smalls, EDhardy Smalls, Lomgren Smalls, DonAmon Smirnov, Andrew Smith, Elliott Smith, Mikal Snakeankle, Esch Snoats, Eian Snook, Pavee Snook, floe Snookums, kramer Snookums, Rach Snookums, Jonboy Snye, fionn Soderstrom, miguel Soderstrom, Bellisima Sodwind, Dafydd Sodwind, Scott69 Sodwind, Shipper Sodwind, Ilianexsi Sojourner, Shirokuro Sojourner, The Sojourner, Wiccan Sojourner, Elijah Sol, Lara Sola, Vanilla Sola, Silvari Soleil, David23 Something, DolphPun Somme, Rhyph Somme, aewyn Sondergaard, Kali Sonic, Packard Sonic, Jayman Sonnenblume, Pippen Sonnenblume, Esichs Sonnerstein, Sylvia Sonoda, ASCLEPIUS Soon, Tecumseh Soon, Julia Soothsayer, Shadowspawn Soothsayer, Tindallia Soothsayer, RJ Source, Akemi Soy, Aln Soy, Aaron Soyer, Tsuno Soyinka, Oz Spade, Ellen Spark, karlynn Sparkle, Kaylie Sparkle, TruHeart Sparkle, Dave Sparrow, slyflower Sparrow, Flapjack Spatula, Cheyenne Spearmann, Jester Spearmann, JewelKicker Spearmann, Data Spectre, Rai Speculaas, Sin Speculaas, Thornne Speculaas, Ehdward Spengler, mo Spengler, Wesley Spengler, Datentyp Sperber, Niko Sperber, Giuseppe Spicoli, Snakeye Spicoli, Marcus Spire, Setori Spire, Crackervelli Spitteler, Naughty Spitteler, Studders101 Spitteler, Yojne Spitteler, ScaryMary Spitz, Geezer Spoonhammer, GutterBlood Spoonhammer, Tour Spoonhammer, Sheet Spotter, tree Sprawl, Kitty Sprocket, Alan Standish, Fox Standish, Clive Stanwell, Alexis Stapovic, Hippyjim Starbrook, Missy Starbrook, Thunder Starbrook, Babydoll Stardust, Birdy Stardust, Johannes Starostin, Ariana Starr, Funk Starr, eltee Statosky, Hanako Stawberry, Micheal Steadham, Blueman Steele, sugar Steele, Jennifer Steele, Golda Stein, Tyler Stein, Uber Stein, Bernd Steinhardt, Whisper Stella, Hjoerdis Stenvaag, Timmy Stepford, LaserFingers Steptoe, Athena Sterling, Selvina Sterling, Hunter Stern, Ocmer Sternberg, Jabath Steuart, Sylvia Steuben, Bracin Stevenson, Sammmy Stewart, Skeeter Stiglitz, Lily Stilman, Nisaa Stilman, Quick Stilman, Spaydar Stine, Unger Stine, Sherrade Stirling, Till Stirling, Juggernaut Stoklitsky, Meret Stonebender, Argent Stonecutter, Gearsawe Stonecutter, Kayla Stonecutter, Liquids Stonewall, Nevera Stooge, Matthew Stork, Sam Stork, Neotoy Story, AllieKat Stovall, Krystal Straaf, Kyrus Straaf, Laars Straaf, Niccia Straaf, Aloe Stradling, egbert Stradling, Lotus Stradling, SlyFox Stradling, Eristic Strangelove, Thaumata Strangelove, Valiant Strangelove, Salome Strangelove, Erica Strauss, Zinger Strauss, Gabrielle Street, Artistniko Streeter, Bruce82 Streeter, Builder Streeter, dast Streeter, Hans Streeter, Stilette Streeter, Darzus Strutt, Bluto Stubbs, Olivier Sturges, Kharie Su, Rexx Su, Vudu Suavage, Silverrain Sucettes, Siyu Suen, Zack Suen, Linnian Sugar, Sierra Sugar, Stacey Sugar, Jodie Suisei, Koto Sukra, Takira Sukra, Ravanne Sullivan, Rik Sullivan, Sofi Sullivan, Joffi Sumbula, BrightAngel Summers, Kiyana Summers, Eclipsed Sun, Shinshinto Sungsoo, Angel Sunset, Warord Suntzu, DalE Supply, ivan Supply, Frictionless Surface, Brightwing Surtees, David Surtees, Georges Susa, Caterina Susanti, Fatima Susanti, Owen Susanto, Caliburn Susanto, Kevin Susenko, Forseti Svarog, Kinga Svarog, Batman Swenholt, Flame Swenholt, Shyressa Swenholt, Earle Swenson, Harvey Swenson, Kevin Swenson, Anastasia Swindlehurst, Liz Swindlehurst, Swein Swindlehurst, Verrenus Swindlehurst, Christain Switchblade, Guy Szondi, Nonlucid Szondi, Sagmumu Szondi, XVenomX Szymborska, CaelThunderwing Tackleberry, Mitzi Tackleberry, Ayla Tae, Maya Tae, Princess Tae, Carsten Taft, Gigs Taggart, Aphrodite Tagore, Lynn Tagore, Jenna Taira, Zephora Taiyou, Rusmi Taka, Kaimen Takahe, Akina Takakura, Sabina Takakura, Tao Takashi, Cornelius Tal, Dolmere Talamasca, Kelindra Talamasca, Sabane Talamasca, Tod69 Talamasca, Bad Tamale, Kitchkinet Tamale, Dany Tammas, kym Tammas, Phoming Tammas, sasha Tammas, Alina Tamura, Janu Tamura, Karetta Tamura, Melli Tamura, Morina Tamura, Snake Tamura, Valentina Tamura, Rutain Tandino, Tracy Tani, Jolt Tank, Rachel Tapioca, Ilyara Tardis, Jaxx Tardis, Aaron Tardis, Sim Tatham, Tobi Taurog, Joey Tavoularis, John Taylor, Jeffrey Temin, Enabran Templar, Crymzon Tempura, Jehan Tendaze, Angel Tengu, Arctic Tenk, Ginevro Tenk, OolBatar Tenk, Sally Tenk, Storchi Tenk, Bloodsong Termagant, Cubey Terra, Lynn Terra, Niles Theas, Sterre Theas, Lost Thereian, Osprey Therian, Lukas Thetan, Larson Thibaud, Redd Thielt, Tana Thielt, Thongshaman Thirroul, Millie Thompson, Brooke Thurston, Lisa Thyben, Bengal Tiger, RavenAnn Tiger, Terrigo Tiger, Sable Till, Soraya Till, Zayn Till, Trixie Timtam, immortal Tiramisu, Matthew Todd, Watermelon Tokyo, Amily Toland, Prijian Toland, Wigger Toland, Wym Toland, Shaia Toll, harathoi Toman, EH Tomcat, Pawz Tomcat, nicky Tomsen, Olyntchen Tomsen, Siul Tomsen, Zukini Tomsen, Darkover Tone, JazzySweet Tone, Tea Tone, Shelly Toonie, Tristan Torgeson, Katie Tornado, manufr Torok, Drew Torres, Xavier Tosung, Benjamin Tower, TJ Tower, Coquine Tracy, Fintaya Tracy, Herman Tracy, killer Tracy, Marcel Tran, Cabal Trautman, Nadja Travanti, Steve Trenchard, Grimm Trenchmouth, Neogrinch Trenchmouth, Scarlet Trenton, input Trilam, Debbie Trilling, Dahlia Trimble, TrainingDay Trimble, Candy Tripp, FeelGood Tripp, Nate Tripp, Skalligrim Tripp, stimpy Tripp, Michael Tripsa, Orion Tristan, Sam Troell, Celebrity Trollop, MaidHeather Trollop, Roberto Trotter, Tipsey Troughton, Lucille Trudeau, Paul Trudeau, arthus Truffaut, Chambord Truffaut, Siss Truss, Boshiken Tsuki, Sindy Tsure, Dante Tucker, ImAOzGrl Tucker, Scott Tucker, BabyAlice Tulip, Bryce Tully, Pixie Tungl, Lyr Tuppakaka, Hawthorn Tuque, Omei Turnbull, Victor Tuxing, Cloe Twang, Twill Tymets, Andrew Tyson, Lyndyn Tzara, Ilyushin Tzedek, Echo Uba, francois Uba, James Udal, Jman Udet, Sara Udet, Koola Uggla, Rocky Uggla, Barry Ultsch, Didro Ultsch, Ianbob Ultsch, Jacki Ultsch, Tchize Umarov, Pepper Underall, Silky Underall, MadameThespian Underhill, Archanox Underthorn, Muzicole Undertone, Chance Unknown, Luthien Unsung, Random Unsung, Sammael Unsung, Totally Unsustainable, Withershins Unsworth, Alison Upshaw, daniel27 Upshaw, Downs Upshaw, Wookie Upshaw, Mr Ur, dlen Uriza, olivia Uriza, tamzi Uriza, clashman Usher, Egelion Usher, dragonboy Utorid, Shade Vacano, Tali Vacano, VanDelay Vacano, Waters Vacano, Gisela Vale, Suena Vale, Anna Valeeva, Caelestaeia Valeeva, Jrhueving Valeeva, Keela Valeeva, Sue Valeeva, Huns Valen, Belle Valentine, LaTaina Valentine, Nenilai Valentine, Sweet Valentine, Lightwave Valkyrie, SexyEyes Valkyrie, Shucks Valkyrie, Cherie Vallely, Charlie Vanalten, Dina Vanalten, Jonash Vanalten, WindyWeather Vanalten, Anousjka Vanbeeck, Joseph Vandeperck, Annabelle Vandeverre, Cyn Vandeverre, Maia Vandeverre, Starlight Vandeverre, Gunter Vandyke, Sascha Vandyke, Savage Vanguard, Trinity Vanmoer, Blucool Vanness, Janey Vansant, Reva Vanvleck, Bunnee Varmint, Priest Varun, Zermit Vasilopita, Hornern Vaughan, Marie Vaughan, Marleen Vaughan, Tiffany Vaughan, Cinthya Vavoom, Mithik Vavoom, Speeder Vavoom, QuietlyCharmes Vega, Aleksy Vella, Delsara Vella, Falcon Vella, Gippy Vella, Loftvoker Vella, marivy Vella, mikky Vella, PrincessRainbow Vella, Ramiro Vella, Charla Vellhi, Dave Vellhi, Holly Venera, havelock Venkman, Dark Ventura, Psyche Vertes, Rhianna Vertes, Nyteshade Vesperia, Dahlia Vezina, Danielle Vidor, Darucain Vieria, Dytska Vieria, Heidi Vieria, ThaRi Vieria, Yora Vig, Tryme Viking, Peri Villota, Violetta Villota, Steve Vinson, Eva Virgo, Camille Virtanen, Giada Visconti, Seraphim Vixen, Robin Vogel, Troy Vogel, Ebony Voight, Heather Voight, Lexie Voight, Roy Voight, Rutger Voight, Cary Volare, Constanza Volare, Dick Volare, FleetingJoy Volitant, Isara Vollmar, Sasha Vollmar, Scarlett Vollmar, Aagaard Voom, Aliens Voom, Duchess Voom, Plenty Voom, Pope Voom, quewan Voom, Selina Voom, Theresa Voom, Yes Voom, Yolanda Voom, Ki Voss, Fatima Vuckovic, Noone Vuckovic, Viana Vuckovic, NARUTO Wade, Warren Wade, Wizardesssss Wade, esclava Wakawaka, Squeebee Wakawaka, Brian Wellman aka Bribo Wakawaka, Pandora Wake, Hosic Wakmann, Greenfield Walcott, Gillian Waldman, Hiram Walker, Tiffany Walsh, Piers Warf, Xenon Warf, Relkin Warrigal, JK Warrior, Shan Warrior, Eowyn Watanabe, Hatibei Watanabe, JimmyC Watanabe, Poemi Watanabe, Toru Watanabe, Tsukasa Watanabe, Gen Watson, Harley Watts, Keeley Waverley, Misterblue Waves, Nimrodina Wayne, Bill Weaver, Nitram Wei, Sistagrlro Wei, Scully Weir, Adrina Welders, Escape Welles, Ivy Welles, Tracy Welles, Vanity Welles, XaMaD Welles, breemman Wellman, Spyder Werribee, Angela Wertmuller, Ronny Wertmuller, Mike Westerburg, Sofia Westwick, Lea Weyland, Darryl Wheeler, lily Whetmore, Lola Whetmore, Sabby Whiplash, SteveR Whiplash, Trader1 Whiplash, Wynx Whiplash, Chalky White, Les White, Sid White, Juicefroma Whitehead, Garrett Whitfield, Jewelia Whitfield, NaomiG6159 Whitfield, Asher Whitman, GoldEagle Whitman, Lizziey Whittenton, Athena Whizenhunt, GreenGate Widdershins, EmCee Widget, edwin Wijaya, Yamtx Wijaya, Aunnia Wilberg, Corwin Wilberg, Elric Wilberg, Johann Wilberg, Brittany Wildcat, MISGREENCHRONIC Wildcat, Bcreative Wilde, Midnight Wilde, Stormy Wilde, DJMantega Wilder, KJ Wilder, Nikki Wilder, Rebel Wilder, Terra Wilder, Infalle Wildung, Streak Wildung, Hed Williams, Michael B. Williams, Erica Williams, Benson Willis, Explorer Willis, Kithin Willis, Isandra Willunga, Kamots Wind, Merum Wind, Mystra Wind, Jaxom Winger, Alex2007 Winkler, Christopher Winkler, Frauke Winkler, Genny Winkler, Mwayne Winkler, Ridgie Winkler, Wolli Winkler, Janice Winnfield, Firefly Winx, Magus Winx, Cricket Wise, Marios Wise, AzurAA Wise, CountD Wishbringer, Heart Wishbringer, Missy Wishbringer, Caemlyn Witherspoon, Celeste Witherspoon, Kalia Withnail, Kami Woebegone, Ochi Wolfe, Salina Wolfe, kirkmegna Wombat, Luna Wood, Steve Wood, Eremia Woodbury, MeForest Woodget, Widgy Woodget, York Woodget, Patchouli Woollahra, Ronco Woolley, Kevin Woolley, Noah Woori, BiGSiN Wormser, Jaime Wormser, Dave Wormser, Joseph Worthington, Vitafit Wottitz, Keera Woyseck, Donnie Wrangler, Brandy Wright, Arian Writer, Bat Writer, Brina Writer, Dwayne Writer, FearToAll Writer, Grog Writer, Head Writer, Mne Writer, nathaniel Writer, Quixotic Writer, Riddley Writer, Two Writer, ZZ Writer, Zoya Writer, Faith Wunderland, Tommy3141 Wunderland, Evalyn Wunderlich, RainbowChef Wunderlich, Raistlin Wunderlich, Terrano Wunderlich, Wallyneumonic Wunderlich, Phil Wuyts, Carrie Wyler, London Wyler, sypher Wyler, TiTiNe Wyler, Tyron Wyler, Alaxandra Xeno, polo Xeno, Roz Xeno, Beatfox Xevious, Kamael Xevious, Leraje Xevious, eXPLORATRIX Xi, Ganesha Xi, groudon185p Xi, Kiyotei Xi, norritt Xi, Sadonya Xi, Aimee Xia, pixiedust Xia, Silky Xia, nimrod Yaffle, Yiffy Yaffle, icegirl Yalin, Jak Yalin, Kile Yamabushi, Naamah Yamabushi, OnnaYokai Yamabushi, Tengu Yamabushi, Tenshiko Yamabushi, Horseplay Yamauba, Enricob Yamdev, Lucian Yamdev, Darth Yao, Haaru Yao, Hex Yao, Milena Yao, Nyarlanathotep Yao, pescerosso Yao, Saigon Yao, TuTsi Yao, dima88 Yap, yuki Yaseotoko, Galea Yates, Originalman2000 Yates, Pumpy Yates, Sherry Yates, Tyrone Yates, Samar Yaud, Griffin Yeats, Kingsbury Yeats, Coos Yellowknife, Easy Yering, AlexYu Yifu, Jessmay Yifu, JoYoung Yifu, Lili Yifu, Snippy Yifu, Evolving Yin, Tzop Yip, Usus Yip, Moshiach Yohkoh, SolZephyr Yohkoh, Terish Yohkoh, Vicky Yongbo, Adp Yongho, Shizn Yongho, DrinkChocolate Yoshikawa, Grecco Yoshikawa, Julianus Yoshikawa, Yonagigai Yoshikawa, Yondaime Yoshikawa, Leto Yoshiro, Minako Yoshiyuki, Zindorf Yossarian, Mistral Yost, FoxSan Yosuke, Blythe Young, oiuy Young, Martyn Young, Briana Yue, cleo Yue, Dakotah Yue, Gumby Yue, Himeno Yue, nkoder Yue, Su2ndLife Yue, Seeker Yuequi, Judy Yun, Li Yun, Pielewop Zabelin, TinaDee Zabibha, Saressa Zadeh, Deathmare Zadoq, Krazzora Zaftig, Zud Zaftig, Lady Euterpe Zagoskin, Adam Zaius, Winston Zaius, Mysterious Zamboni, Dane Zander, TheDragonMaster Zander, Vallek Zander, AustinTodd Zanetti, Ianbra Zapedzki, Jill Zapedzki, skyzo Zapedzki, Supershine Zapedzki, Tristan Zapedzki, Zankoku Zapedzki, Joyce Zapedzki, Paul Zapotocky, seissab Zarf, xlene Zarf, Zyzzy Zarf, Freedom Zeami, Mala Zeami, ArbaJayba Zebaki, ToKizzable Zeddmore, Tocaelpito Zeffirelli, Nite Zelmanov, Zogborf Zelmanov, Suzanne Zeluco, Benton Zemach, Theo Zemach, Dee Zemlja, Xellessanova Zenith, Keji Zeno, Qat Zeno, Shekina Zeno, HotFoxy Zenovka, kazuku Zenovka, Lilly Zenovka, Susanne Zenovka, Talltenor Zenovka, Zola Zenovka, Hewee Zetkin, BeauZeau Zhao, malee Zhaoying, Takea Zhaoying, Maximilian Zhichao, Ricky Zhichao, Samael Zhichao, WildHeart Zhichao, Zflat Zhongyuan, Luthander Zhou, Silvanne Ziemia, Vocianna Ziemia, kankano Zinnemann, Enki Zinner, Omnephilite Zinner, Marios Ziskey, Jai Zucker, scott Zucker, Suzie Zucker, Daphnie Zuhrah, Mathoni Zuhrah, Ravi Zuma, Junkfooddog Zwiers, Aargle Zymurgy, Me Zymurgy and many others.
14 14
15 15
16APR Copyright (C) 2000-2004 The Apache Software Foundation 16APR Copyright (C) 2000-2004 The Apache Software Foundation
@@ -32,7 +32,7 @@ zlib Copyright (C) 1995-2002 Jean-loup Gailly and Mark Adler.
32All rights reserved. See licenses.txt for details. 32All rights reserved. See licenses.txt for details.
33 33
34 34
35Don&apos;t hassle the hoff. 35Steve, just think of a snappy quote. It's not *that* hard, is it?
36 </text_editor> 36 </text_editor>
37 <text_editor bg_readonly_color="0, 0, 0, 0" bottom_delta="174" embedded_items="false" 37 <text_editor bg_readonly_color="0, 0, 0, 0" bottom_delta="174" embedded_items="false"
38 follows="left|top|right|bottom" font="SansSerif" height="238" left="6" 38 follows="left|top|right|bottom" font="SansSerif" height="238" left="6"
diff --git a/linden/indra/newview/skins/xui/en-us/floater_account_history.xml b/linden/indra/newview/skins/xui/en-us/floater_account_history.xml
deleted file mode 100644
index d215089..0000000
--- a/linden/indra/newview/skins/xui/en-us/floater_account_history.xml
+++ /dev/null
@@ -1,10 +0,0 @@
1<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
2<floater can_close="true" can_drag_on_left="false" can_minimize="true" can_resize="true"
3 height="350" min_height="100" min_width="100" name="money history floater"
4 title="Account History" width="500">
5 <tab_container bottom="-346" follows="left|top|right|bottom" height="326" left="4"
6 mouse_opaque="false" name="tab" tab_position="left" width="492" />
7 <button bottom="-346" follows="left|bottom" font="SansSerif" halign="center"
8 height="20" label="More Details..." label_selected="More Details..."
9 left="4" mouse_opaque="true" name="details_btn" width="100" />
10</floater>
diff --git a/linden/indra/newview/skins/xui/en-us/floater_build_options.xml b/linden/indra/newview/skins/xui/en-us/floater_build_options.xml
index 18c0fbc..807caa0 100644
--- a/linden/indra/newview/skins/xui/en-us/floater_build_options.xml
+++ b/linden/indra/newview/skins/xui/en-us/floater_build_options.xml
@@ -1,6 +1,6 @@
1<?xml version="1.0" encoding="utf-8" standalone="yes" ?> 1<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
2<floater bottom="-297" can_close="true" can_drag_on_left="false" can_minimize="true" 2<floater bottom="-297" can_close="true" can_drag_on_left="false" can_minimize="true"
3 can_resize="false" follows="right" height="130" left="298" min_height="130" 3 can_resize="false" follows="right" height="151" left="298" min_height="151"
4 min_width="272" mouse_opaque="true" name="build options floater" 4 min_width="272" mouse_opaque="true" name="build options floater"
5 rect_control="FloaterBuildOptionsRect" title="Grid Options" width="272"> 5 rect_control="FloaterBuildOptionsRect" title="Grid Options" width="272">
6 <spinner bottom="-53" control_name="GridResolution" decimal_digits="3" 6 <spinner bottom="-53" control_name="GridResolution" decimal_digits="3"
@@ -15,6 +15,10 @@
15 font="SansSerifSmall" height="16" initial_value="false" 15 font="SansSerifSmall" height="16" initial_value="false"
16 label="Enable Sub-Unit Snapping" left="14" mouse_opaque="true" 16 label="Enable Sub-Unit Snapping" left="14" mouse_opaque="true"
17 name="GridSubUnit" width="200" /> 17 name="GridSubUnit" width="200" />
18 <check_box bottom_delta="-21" control_name="GridCrossSections" follows="left|top"
19 font="SansSerifSmall" height="16" initial_value="false"
20 label="Show Cross Sections" left="14" mouse_opaque="true"
21 name="GridCrossSection" width="200" />
18 <slider bottom_delta="-21" can_edit_text="false" control_name="GridOpacity" 22 <slider bottom_delta="-21" can_edit_text="false" control_name="GridOpacity"
19 decimal_digits="3" follows="left" height="16" increment="0.05" 23 decimal_digits="3" follows="left" height="16" increment="0.05"
20 initial_val="0.7" label="Grid Opacity" left="14" max_val="1" min_val="0" 24 initial_val="0.7" label="Grid Opacity" left="14" max_val="1" min_val="0"
diff --git a/linden/indra/newview/skins/xui/en-us/floater_instant_message.xml b/linden/indra/newview/skins/xui/en-us/floater_instant_message.xml
index 2568e73..31ae55c 100644
--- a/linden/indra/newview/skins/xui/en-us/floater_instant_message.xml
+++ b/linden/indra/newview/skins/xui/en-us/floater_instant_message.xml
@@ -5,7 +5,7 @@
5 can_close="true" 5 can_close="true"
6 can_drag_on_left="false" 6 can_drag_on_left="false"
7 can_minimize="false" 7 can_minimize="false"
8 can_resize="false" 8 can_resize="true"
9 enabled="true" 9 enabled="true"
10 follows="left|top|right|bottom" 10 follows="left|top|right|bottom"
11 height="297" 11 height="297"
@@ -35,10 +35,10 @@
35 <button bottom="-295" enabled="true" follows="right|bottom" font="SansSerif" 35 <button bottom="-295" enabled="true" follows="right|bottom" font="SansSerif"
36 halign="center" height="20" hidden="false" label="Profile..." 36 halign="center" height="20" hidden="false" label="Profile..."
37 label_selected="Profile..." left="355" mouse_opaque="true" 37 label_selected="Profile..." left="355" mouse_opaque="true"
38 name="profile_btn" scale_image="true" width="75" /> 38 name="profile_btn" scale_image="true" width="70" />
39 <button bottom="-295" enabled="true" follows="right|bottom" font="SansSerif" 39 <button bottom="-295" enabled="true" follows="right|bottom" font="SansSerif"
40 halign="center" height="20" hidden="false" label="Close" 40 halign="center" height="20" hidden="false" label="Close"
41 label_selected="Close" left="435" mouse_opaque="true" name="close_btn" 41 label_selected="Close" left="430" mouse_opaque="true" name="close_btn"
42 scale_image="true" width="60" /> 42 scale_image="true" width="60" />
43 <text hidden="true" name="live_help_dialog" wordwrap="false"> 43 <text hidden="true" name="live_help_dialog" wordwrap="false">
44 *** Welcome to Help Request *** 44 *** Welcome to Help Request ***
diff --git a/linden/indra/newview/skins/xui/en-us/floater_preview_existing_landmark.xml b/linden/indra/newview/skins/xui/en-us/floater_preview_existing_landmark.xml
index a9771a3..7d7d435 100644
--- a/linden/indra/newview/skins/xui/en-us/floater_preview_existing_landmark.xml
+++ b/linden/indra/newview/skins/xui/en-us/floater_preview_existing_landmark.xml
@@ -1,7 +1,7 @@
1<?xml version="1.0" encoding="utf-8" standalone="yes" ?> 1<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
2<floater bottom="-311" can_close="true" can_drag_on_left="false" can_minimize="true" 2<floater bottom="-311" can_close="true" can_drag_on_left="false" can_minimize="true"
3 can_resize="false" enabled="true" height="90" hidden="false" left="242" 3 can_resize="false" enabled="true" height="90" hidden="false" left="242"
4 min_height="0" min_width="0" mouse_opaque="true" 4 min_height="90" min_width="300" mouse_opaque="true"
5 name="existing_landmark_preview" width="300"> 5 name="existing_landmark_preview" width="300">
6 <line_editor bevel_style="in" border_style="line" border_thickness="1" bottom="-43" 6 <line_editor bevel_style="in" border_style="line" border_thickness="1" bottom="-43"
7 enabled="true" follows="left|top|right" font="SansSerif" 7 enabled="true" follows="left|top|right" font="SansSerif"
@@ -17,9 +17,10 @@
17 <icon bottom="-21" color="1 1 1 1" enabled="true" follows="left|top" height="16" 17 <icon bottom="-21" color="1 1 1 1" enabled="true" follows="left|top" height="16"
18 hidden="false" image_name="inv_item_landmark_visited.tga" left="5" 18 hidden="false" image_name="inv_item_landmark_visited.tga" left="5"
19 mouse_opaque="true" name="icon_landmark" width="16" /> 19 mouse_opaque="true" name="icon_landmark" width="16" />
20 <button bottom="-77" enabled="true" font="SansSerif" halign="center" height="20" 20 <button bottom="-77" enabled="true" follows="left|bottom" font="SansSerif"
21 hidden="false" label="Teleport" label_selected="" left="13" 21 halign="center" height="20" hidden="false" label="Teleport"
22 mouse_opaque="true" name="Teleport btn" width="100" /> 22 label_selected="" left="13" mouse_opaque="true" name="Teleport btn"
23 width="100" />
23 <button bottom="-77" enabled="true" follows="left|bottom" font="SansSerif" 24 <button bottom="-77" enabled="true" follows="left|bottom" font="SansSerif"
24 halign="center" height="20" hidden="false" label="Show on Map" 25 halign="center" height="20" hidden="false" label="Show on Map"
25 label_selected="" left="126" mouse_opaque="true" name="Show on Map btn" 26 label_selected="" left="126" mouse_opaque="true" name="Show on Map btn"
diff --git a/linden/indra/newview/skins/xui/en-us/floater_preview_new_landmark.xml b/linden/indra/newview/skins/xui/en-us/floater_preview_new_landmark.xml
index c90c8ad..16d0dcd 100644
--- a/linden/indra/newview/skins/xui/en-us/floater_preview_new_landmark.xml
+++ b/linden/indra/newview/skins/xui/en-us/floater_preview_new_landmark.xml
@@ -1,7 +1,7 @@
1<?xml version="1.0" encoding="utf-8" standalone="yes" ?> 1<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
2<floater bottom="-97" can_close="true" can_drag_on_left="false" can_minimize="true" 2<floater bottom="-97" can_close="true" can_drag_on_left="false" can_minimize="true"
3 can_resize="false" enabled="true" height="90" hidden="false" left="201" 3 can_resize="false" enabled="true" height="90" hidden="false" left="201"
4 min_height="0" min_width="0" mouse_opaque="true" name="landmark_preview" 4 min_height="370" min_width="90" mouse_opaque="true" name="landmark_preview"
5 width="370"> 5 width="370">
6 <button bottom="-77" enabled="true" font="SansSerif" halign="center" height="20" 6 <button bottom="-77" enabled="true" font="SansSerif" halign="center" height="20"
7 hidden="false" label="Teleport" label_selected="" left="13" 7 hidden="false" label="Teleport" label_selected="" left="13"
diff --git a/linden/indra/newview/skins/xui/en-us/floater_price_for_listing.xml b/linden/indra/newview/skins/xui/en-us/floater_price_for_listing.xml
index f38e63b..609c964 100644
--- a/linden/indra/newview/skins/xui/en-us/floater_price_for_listing.xml
+++ b/linden/indra/newview/skins/xui/en-us/floater_price_for_listing.xml
@@ -16,8 +16,8 @@ and appear higher in searches.
16 name="price_text" width="100"> 16 name="price_text" width="100">
17 Price for Ad (L$): 17 Price for Ad (L$):
18 </text> 18 </text>
19 <line_editor bottom_delta="2" follows="top|left" height="20" left="120" max_length="5" 19 <line_editor bottom_delta="2" follows="top|left" height="20" left="120" max_length="6"
20 name="price_edit" width="50" /> 20 name="price_edit" width="60" />
21 <button bottom="10" follows="top|left" height="20" label="Set Price" left="110" 21 <button bottom="10" follows="top|left" height="20" label="Set Price" left="110"
22 name="set_price_btn" width="80" /> 22 name="set_price_btn" width="80" />
23 <button bottom_delta="0" follows="top|left" height="20" label="Cancel" left="200" 23 <button bottom_delta="0" follows="top|left" height="20" label="Cancel" left="200"
diff --git a/linden/indra/newview/skins/xui/en-us/floater_settings_debug.xml b/linden/indra/newview/skins/xui/en-us/floater_settings_debug.xml
index 611b728..994aa70 100644
--- a/linden/indra/newview/skins/xui/en-us/floater_settings_debug.xml
+++ b/linden/indra/newview/skins/xui/en-us/floater_settings_debug.xml
@@ -1,5 +1,5 @@
1<floater can_close="true" can_drag_on_left="false" can_minimize="false" 1<floater can_close="true" can_drag_on_left="false" can_minimize="false"
2 can_resize="false" height="190" name="settings_debug" 2 can_resize="false" height="215" name="settings_debug"
3 title="Debug Settings" width="350"> 3 title="Debug Settings" width="350">
4 <combo_box allow_text_entry="true" bottom="-50" follows="top|left" font="SansSerifSmall" 4 <combo_box allow_text_entry="true" bottom="-50" follows="top|left" font="SansSerifSmall"
5 height="20" left="15" max_chars="255" name="settings_combo" /> 5 height="20" left="15" max_chars="255" name="settings_combo" />
@@ -15,7 +15,7 @@
15 </combo_item> 15 </combo_item>
16 </combo_box> 16 </combo_box>
17 <line_editor bottom_delta="0" height="20" name="val_text" visible="false" width="300" /> 17 <line_editor bottom_delta="0" height="20" name="val_text" visible="false" width="300" />
18 <color_swatch bottom="5" can_apply_immediately="true" height="55" label="Color" 18 <color_swatch bottom="30" can_apply_immediately="true" height="55" label="Color"
19 name="color_swatch" visible="true" width="37" /> 19 name="color_swatch" visible="true" width="37" />
20 <spinner bottom_delta="25" height="20" label="x" label_width="40" max_val="10000000" 20 <spinner bottom_delta="25" height="20" label="x" label_width="40" max_val="10000000"
21 name="val_spinner_1" visible="false" width="120" /> 21 name="val_spinner_1" visible="false" width="120" />
@@ -25,4 +25,5 @@
25 max_val="10000000" name="val_spinner_3" visible="false" width="120" /> 25 max_val="10000000" name="val_spinner_3" visible="false" width="120" />
26 <spinner bottom_delta="0" height="20" label="x" label_width="40" left_delta="135" 26 <spinner bottom_delta="0" height="20" label="x" label_width="40" left_delta="135"
27 max_val="10000000" name="val_spinner_4" visible="false" width="120" /> 27 max_val="10000000" name="val_spinner_4" visible="false" width="120" />
28 <button bottom="5" left="15" height="20" width="150" name="default_btn" label="Reset to default"/>
28</floater> 29</floater>
diff --git a/linden/indra/newview/skins/xui/en-us/menu_inventory.xml b/linden/indra/newview/skins/xui/en-us/menu_inventory.xml
index 1e4ce8a..72de4ec 100755
--- a/linden/indra/newview/skins/xui/en-us/menu_inventory.xml
+++ b/linden/indra/newview/skins/xui/en-us/menu_inventory.xml
@@ -29,6 +29,10 @@
29 mouse_opaque="true" name="Empty Trash" width="128"> 29 mouse_opaque="true" name="Empty Trash" width="128">
30 <on_click filter="" function="Inventory.EmptyTrash" userdata="rename" /> 30 <on_click filter="" function="Inventory.EmptyTrash" userdata="rename" />
31 </menu_item_call> 31 </menu_item_call>
32 <menu_item_call bottom_delta="-18" height="18" hidden="false" label="Empty Lost And Found"
33 left="0" mouse_opaque="true" name="Empty Lost And Found" width="128">
34 <on_click filter="" function="Inventory.EmptyLostAndFound" userdata="rename" />
35 </menu_item_call>
32 <menu_item_call bottom_delta="-18" height="18" hidden="false" label="New Folder" left="0" 36 <menu_item_call bottom_delta="-18" height="18" hidden="false" label="New Folder" left="0"
33 mouse_opaque="true" name="New Folder" width="128"> 37 mouse_opaque="true" name="New Folder" width="128">
34 <on_click filter="" function="Inventory.DoCreate" userdata="category" /> 38 <on_click filter="" function="Inventory.DoCreate" userdata="category" />
@@ -172,11 +176,11 @@
172 <menu_item_call bottom_delta="-18" height="18" hidden="false" 176 <menu_item_call bottom_delta="-18" height="18" hidden="false"
173 label="IM Online Contacts In Folder" left="0" mouse_opaque="true" 177 label="IM Online Contacts In Folder" left="0" mouse_opaque="true"
174 name="IM Online Contacts In Folder" width="128"> 178 name="IM Online Contacts In Folder" width="128">
175 <on_click filter="" function="Inventory.BeginIMSession" userdata="everyone" /> 179 <on_click filter="" function="Inventory.BeginIMSession" userdata="online" />
176 </menu_item_call> 180 </menu_item_call>
177 <menu_item_call bottom_delta="-18" height="18" hidden="false" label="IM All Contacts In Folder" 181 <menu_item_call bottom_delta="-18" height="18" hidden="false" label="IM All Contacts In Folder"
178 left="0" mouse_opaque="true" name="IM All Contacts In Folder" width="128"> 182 left="0" mouse_opaque="true" name="IM All Contacts In Folder" width="128">
179 <on_click filter="" function="Inventory.BeginIMSession" userdata="online" /> 183 <on_click filter="" function="Inventory.BeginIMSession" userdata="everyone" />
180 </menu_item_call> 184 </menu_item_call>
181 <menu_item_separator name="Sound Separator" /> 185 <menu_item_separator name="Sound Separator" />
182 <menu_item_call bottom_delta="-18" height="18" hidden="false" label="Play" left="0" 186 <menu_item_call bottom_delta="-18" height="18" hidden="false" label="Play" left="0"
diff --git a/linden/indra/newview/skins/xui/en-us/menu_viewer.xml b/linden/indra/newview/skins/xui/en-us/menu_viewer.xml
index d7f9809..2c45a4e 100755
--- a/linden/indra/newview/skins/xui/en-us/menu_viewer.xml
+++ b/linden/indra/newview/skins/xui/en-us/menu_viewer.xml
@@ -1,5 +1,5 @@
1<?xml version="1.0" encoding="utf-8" standalone="yes" ?> 1<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
2<menu_bar bottom="-18" color="0.501961 0 0 1" drop_shadow="true" enabled="true" 2<menu_bar bottom="-18" color="0.501961 0 0 1" drop_shadow="false" enabled="true"
3 follows="left|top|right" height="18" hidden="false" left="0" 3 follows="left|top|right" height="18" hidden="false" left="0"
4 mouse_opaque="true" name="Main Menu" opaque="true" tear_off="false" 4 mouse_opaque="true" name="Main Menu" opaque="true" tear_off="false"
5 width="802"> 5 width="802">
@@ -37,6 +37,7 @@
37 left="0" mouse_opaque="true" name="Close Window" shortcut="control|W" 37 left="0" mouse_opaque="true" name="Close Window" shortcut="control|W"
38 width="243"> 38 width="243">
39 <on_click function="File.CloseWindow" userdata="" /> 39 <on_click function="File.CloseWindow" userdata="" />
40 <on_enable function="File.EnableCloseWindow" userdata="" />
40 </menu_item_call> 41 </menu_item_call>
41 <menu_item_separator bottom="-121" enabled="true" height="8" hidden="false" label="-----------" 42 <menu_item_separator bottom="-121" enabled="true" height="8" hidden="false" label="-----------"
42 left="0" mouse_opaque="true" name="separator2" width="243" /> 43 left="0" mouse_opaque="true" name="separator2" width="243" />
@@ -509,6 +510,7 @@
509 left="0" mouse_opaque="true" name="Teleport Home" 510 left="0" mouse_opaque="true" name="Teleport Home"
510 shortcut="control|shift|H" width="185"> 511 shortcut="control|shift|H" width="185">
511 <on_click function="World.TeleportHome" userdata="" /> 512 <on_click function="World.TeleportHome" userdata="" />
513 <on_enable function="World.EnableTeleportHome" userdata="" />
512 </menu_item_call> 514 </menu_item_call>
513 <menu_item_separator bottom="-167" enabled="true" height="8" hidden="false" label="-----------" 515 <menu_item_separator bottom="-167" enabled="true" height="8" hidden="false" label="-----------"
514 left="0" mouse_opaque="true" name="separator3" width="185" /> 516 left="0" mouse_opaque="true" name="separator3" width="185" />
@@ -525,7 +527,8 @@
525 <menu_item_call bottom="-232" enabled="true" height="19" hidden="false" 527 <menu_item_call bottom="-232" enabled="true" height="19" hidden="false"
526 label="Account History..." left="0" mouse_opaque="true" 528 label="Account History..." left="0" mouse_opaque="true"
527 name="Account History..." width="185"> 529 name="Account History..." width="185">
528 <on_click function="ShowFloater" userdata="account history" /> 530 <on_click function="PromptShowURL"
531 userdata="WebLaunchAccountHistory,http://secondlife.com/account/transactions.php" />
529 </menu_item_call> 532 </menu_item_call>
530 <menu_item_call bottom="-267" enabled="true" height="19" hidden="false" 533 <menu_item_call bottom="-267" enabled="true" height="19" hidden="false"
531 label="Manage My Account..." left="0" mouse_opaque="true" 534 label="Manage My Account..." left="0" mouse_opaque="true"
@@ -811,10 +814,10 @@
811 <on_click function="PromptShowFile" userdata="WebLaunchLSLGuide,lsl_guide.html" /> 814 <on_click function="PromptShowFile" userdata="WebLaunchLSLGuide,lsl_guide.html" />
812 </menu_item_call> 815 </menu_item_call>
813 <menu_item_call bottom="-140" enabled="true" height="19" hidden="false" 816 <menu_item_call bottom="-140" enabled="true" height="19" hidden="false"
814 label="Scripting Wiki..." left="0" mouse_opaque="true" 817 label="Scripting Portal..." left="0" mouse_opaque="true"
815 name="Scripting Wiki..." width="166"> 818 name="Scripting Portal..." width="166">
816 <on_click function="PromptShowURL" 819 <on_click function="PromptShowURL"
817 userdata="WebLaunchLSLWiki,http://secondlife.com/app/lsldoc/" /> 820 userdata="WebLaunchLSLWiki,http://wiki.secondlife.com/wiki/LSL_Portal" />
818 </menu_item_call> 821 </menu_item_call>
819 <menu_item_separator bottom="-148" enabled="true" height="8" hidden="false" label="-----------" 822 <menu_item_separator bottom="-148" enabled="true" height="8" hidden="false" label="-----------"
820 left="0" mouse_opaque="true" name="separator3" width="166" /> 823 left="0" mouse_opaque="true" name="separator3" width="166" />
diff --git a/linden/indra/newview/skins/xui/en-us/panel_account_details.xml b/linden/indra/newview/skins/xui/en-us/panel_account_details.xml
deleted file mode 100644
index 350b5ed..0000000
--- a/linden/indra/newview/skins/xui/en-us/panel_account_details.xml
+++ /dev/null
@@ -1,17 +0,0 @@
1<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
2<panel border="true" bottom="-325" follows="left|top|right|bottom" height="324"
3 label="Details" left="103" mouse_opaque="true" name="account_details_panel"
4 width="388">
5 <text_editor bottom="-288" embedded_items="false" enabled="false"
6 follows="left|top|right|bottom" font="Monospace" height="280" left="8"
7 max_length="65536" mouse_opaque="true" name="editor" width="372"
8 word_wrap="false" />
9 <button bottom="-316" follows="left|bottom" font="SansSerif" halign="center"
10 height="20" label="&lt; Earlier" label_selected="&lt; Earlier" left="24"
11 mouse_opaque="true" name="earlier_btn" tool_tip="Go back in time"
12 width="80" />
13 <button bottom="-316" follows="right|bottom" font="SansSerif" halign="center"
14 height="20" label="Later &gt;" label_selected="Later &gt;" left_delta="260"
15 mouse_opaque="true" name="later_btn" tool_tip="Go forward in time"
16 width="80" />
17</panel>
diff --git a/linden/indra/newview/skins/xui/en-us/panel_account_planning.xml b/linden/indra/newview/skins/xui/en-us/panel_account_planning.xml
deleted file mode 100644
index 02e9aaf..0000000
--- a/linden/indra/newview/skins/xui/en-us/panel_account_planning.xml
+++ /dev/null
@@ -1,9 +0,0 @@
1<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
2<panel border="true" bottom="-325" follows="left|top|right|bottom" height="324"
3 label="Planning" left="103" mouse_opaque="true"
4 name="account_planning_panel" width="388">
5 <text_editor bottom="-316" embedded_items="false" enabled="false"
6 follows="left|top|right|bottom" font="Monospace" height="308" left="8"
7 max_length="65536" mouse_opaque="true" name="editor" width="372"
8 word_wrap="false" />
9</panel>
diff --git a/linden/indra/newview/skins/xui/en-us/panel_account_transactions.xml b/linden/indra/newview/skins/xui/en-us/panel_account_transactions.xml
deleted file mode 100644
index 8521625..0000000
--- a/linden/indra/newview/skins/xui/en-us/panel_account_transactions.xml
+++ /dev/null
@@ -1,17 +0,0 @@
1<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
2<panel border="true" bottom="-325" follows="left|top|right|bottom" height="324"
3 label="Sales/Gifts" left="103" mouse_opaque="true"
4 name="account_sales_panel" width="388">
5 <text_editor bottom="-288" embedded_items="false" enabled="false"
6 follows="left|top|right|bottom" font="Monospace" height="280" left="8"
7 max_length="65536" mouse_opaque="true" name="editor" width="372"
8 word_wrap="false" />
9 <button bottom="-316" follows="left|bottom" font="SansSerif" halign="center"
10 height="20" label="&lt; Earlier" label_selected="&lt; Earlier" left="24"
11 mouse_opaque="true" name="earlier_btn" tool_tip="Go back in time"
12 width="80" />
13 <button bottom="-316" follows="right|bottom" font="SansSerif" halign="center"
14 height="20" label="Later &gt;" label_selected="Later &gt;" left_delta="260"
15 mouse_opaque="true" name="later_btn" tool_tip="Go forward in time"
16 width="80" />
17</panel>
diff --git a/linden/indra/newview/skins/xui/en-us/panel_avatar.xml b/linden/indra/newview/skins/xui/en-us/panel_avatar.xml
index 1cc6f54..d8b415a 100644
--- a/linden/indra/newview/skins/xui/en-us/panel_avatar.xml
+++ b/linden/indra/newview/skins/xui/en-us/panel_avatar.xml
@@ -1,4 +1,3 @@
1<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
2<panel bottom="-550" height="486" left="350" name="Panel Avatar" width="430"> 1<panel bottom="-550" height="486" left="350" name="Panel Avatar" width="430">
3 <tab_container bottom="-486" height="486" left="0" mouse_opaque="false" name="tab" 2 <tab_container bottom="-486" height="486" left="0" mouse_opaque="false" name="tab"
4 tab_min_width="50" tab_position="top" width="420"> 3 tab_min_width="50" tab_position="top" width="420">
@@ -77,6 +76,9 @@
77 v_pad="0" width="130"> 76 v_pad="0" width="130">
78 Partner: 77 Partner:
79 </text> 78 </text>
79 <button bottom_delta="0" follows="left|top" font="SansSerif" halign="center"
80 height="18" label="?" label_selected="?" left_delta="43"
81 mouse_opaque="true" name="partner_help" width="18" />
80 <line_editor bevel_style="in" bg_readonly_color="0, 0, 0, 0" border_style="line" 82 <line_editor bevel_style="in" bg_readonly_color="0, 0, 0, 0" border_style="line"
81 border_thickness="1" bottom_delta="-16" enabled="true" follows="left|top" 83 border_thickness="1" bottom_delta="-16" enabled="true" follows="left|top"
82 font="SansSerifSmall" height="16" is_unicode="false" left="270" 84 font="SansSerifSmall" height="16" is_unicode="false" left="270"
@@ -205,7 +207,8 @@
205 max_length="254" mouse_opaque="true" name="url_edit" 207 max_length="254" mouse_opaque="true" name="url_edit"
206 text_readonly_color="1, 1, 1, 1" width="400" /> 208 text_readonly_color="1, 1, 1, 1" width="400" />
207 <web_browser border_visible="false" bottom="-444" follows="top|left|right" height="400" 209 <web_browser border_visible="false" bottom="-444" follows="top|left|right" height="400"
208 left="10" name="profile_html" start_url="" width="400" /> 210 ignore_ui_scale="false" left="10" name="profile_html" start_url=""
211 width="400" />
209 <text bottom="5" follows="bottom|left|right" left="15" name="status_text" right="-70" 212 <text bottom="5" follows="bottom|left|right" left="15" name="status_text" right="-70"
210 top="25"> 213 top="25">
211 Done 214 Done
@@ -307,6 +310,12 @@
307 mouse_opaque="true" name="Delete..." width="75" /> 310 mouse_opaque="true" name="Delete..." width="75" />
308 <tab_container bottom="-411" follows="left|top" height="363" left="4" mouse_opaque="false" 311 <tab_container bottom="-411" follows="left|top" height="363" left="4" mouse_opaque="false"
309 name="picks tab" tab_position="left" width="412" /> 312 name="picks tab" tab_position="left" width="412" />
313 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
314 bottom="-70" drop_shadow_visible="true" follows="left|top"
315 font="SansSerif" h_pad="0" halign="left" height="20" left="114"
316 mouse_opaque="false" name="loading_text" v_pad="0" width="302">
317 Loading...
318 </text>
310 </panel> 319 </panel>
311 <panel border="true" bottom="-482" follows="left|top|right|bottom" height="466" 320 <panel border="true" bottom="-482" follows="left|top|right|bottom" height="466"
312 label="Classified" left="1" mouse_opaque="true" name="Classified" 321 label="Classified" left="1" mouse_opaque="true" name="Classified"
@@ -328,9 +337,11 @@
328 <tab_container bottom="-463" follows="left|top" height="415" left="4" mouse_opaque="false" 337 <tab_container bottom="-463" follows="left|top" height="415" left="4" mouse_opaque="false"
329 name="classified tab" tab_position="left" width="412" /> 338 name="classified tab" tab_position="left" width="412" />
330 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false" 339 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
331 bottom="-463" drop_shadow_visible="true" follows="left|top" 340 bottom="-70" drop_shadow_visible="true" follows="left|top"
332 font="SansSerif" h_pad="0" halign="left" height="355" left="114" 341 font="SansSerif" h_pad="0" halign="left" height="20" left="114"
333 mouse_opaque="false" name="help_text" v_pad="0" width="302" /> 342 mouse_opaque="false" name="loading_text" v_pad="0" width="302">
343 Loading...
344 </text>
334 </panel> 345 </panel>
335 <panel border="true" bottom="-482" follows="left|top|right|bottom" height="466" 346 <panel border="true" bottom="-482" follows="left|top|right|bottom" height="466"
336 label="1st Life" left="1" mouse_opaque="true" name="1st Life" width="418"> 347 label="1st Life" left="1" mouse_opaque="true" name="1st Life" width="418">
diff --git a/linden/indra/newview/skins/xui/en-us/panel_group.xml b/linden/indra/newview/skins/xui/en-us/panel_group.xml
index ee1f3c6..dbe37c6 100644
--- a/linden/indra/newview/skins/xui/en-us/panel_group.xml
+++ b/linden/indra/newview/skins/xui/en-us/panel_group.xml
@@ -26,6 +26,6 @@
26 label_selected="OK" left_delta="-65" mouse_opaque="true" name="btn_ok" 26 label_selected="OK" left_delta="-65" mouse_opaque="true" name="btn_ok"
27 width="60" /> 27 width="60" />
28 <button bottom_delta="0" font="SansSerif" halign="center" height="20" 28 <button bottom_delta="0" font="SansSerif" halign="center" height="20"
29 label="Refresh from server" label_selected="Refresh from server" left="10" 29 label="Refresh" label_selected="Refresh from server" left="10"
30 mouse_opaque="true" name="btn_refresh" width="130" /> 30 mouse_opaque="true" name="btn_refresh" width="90" />
31</panel> 31</panel>
diff --git a/linden/indra/newview/skins/xui/en-us/panel_group_notices.xml b/linden/indra/newview/skins/xui/en-us/panel_group_notices.xml
index 65ac0b5..09ea84e 100644
--- a/linden/indra/newview/skins/xui/en-us/panel_group_notices.xml
+++ b/linden/indra/newview/skins/xui/en-us/panel_group_notices.xml
@@ -25,15 +25,15 @@ the General tab.
25 h_pad="0" halign="left" height="16" left_delta="0" mouse_opaque="true" 25 h_pad="0" halign="left" height="16" left_delta="0" mouse_opaque="true"
26 name="lbl2" v_pad="0" width="436"> 26 name="lbl2" v_pad="0" width="436">
27 Notices are kept for 30 days. Click the notice below you wish to view. 27 Notices are kept for 30 days. Click the notice below you wish to view.
28Click the &apos;Refresh List&apos; button if new notices have been received. 28Click the &apos;Refresh&apos; button to check if new notices have been received.
29 </text> 29 </text>
30 <scroll_list background_visible="false" bottom_delta="-130" column_padding="5" 30 <scroll_list background_visible="false" bottom_delta="-130" column_padding="0"
31 draw_border="true" draw_heading="true" enabled="true" 31 draw_border="true" draw_heading="true" enabled="true"
32 fg_unselected_color="200,200,200,255" heading_font="SansSerifSmall" 32 fg_unselected_color="200,200,200,255" heading_font="SansSerifSmall"
33 heading_height="14" height="116" left="7" mouse_opaque="true" 33 heading_height="14" height="116" left="7" mouse_opaque="true"
34 multi_select="false" name="notice_list" width="404"> 34 multi_select="false" name="notice_list" width="404">
35 <column label="" name="icon" width="16" /> 35 <column label="" name="icon" width="16" />
36 <column label="Subject" name="subject" width="155" /> 36 <column label="Subject" name="subject" width="171" />
37 <column label="From" name="from" width="125" /> 37 <column label="From" name="from" width="125" />
38 <column label="Date" name="date" width="85" /> 38 <column label="Date" name="date" width="85" />
39 <column name="sort" width="-1" /> 39 <column name="sort" width="-1" />
@@ -45,8 +45,8 @@ Click the &apos;Refresh List&apos; button if new notices have been received.
45 label="Create New Notice" label_selected="Create New Notice" left_delta="0" 45 label="Create New Notice" label_selected="Create New Notice" left_delta="0"
46 mouse_opaque="true" name="create_new_notice" width="150" /> 46 mouse_opaque="true" name="create_new_notice" width="150" />
47 <button bottom_delta="0" font="SansSerif" halign="center" height="20" 47 <button bottom_delta="0" font="SansSerif" halign="center" height="20"
48 label="Refresh List" label_selected="Refresh List" left="282" 48 label="Refresh" label_selected="Refresh List" left="321"
49 mouse_opaque="true" name="refresh_notices" width="130" /> 49 mouse_opaque="true" name="refresh_notices" width="90" />
50 <panel border="false" bottom="0" follows="all" height="275" label="Create New Notice" 50 <panel border="false" bottom="0" follows="all" height="275" label="Create New Notice"
51 left="1" mouse_opaque="true" name="panel_create_new_notice" width="418"> 51 left="1" mouse_opaque="true" name="panel_create_new_notice" width="418">
52 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false" 52 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
@@ -141,8 +141,8 @@ and you can&apos;t send a folder.
141 name="lbl4" v_pad="0" visible="false" width="55"> 141 name="lbl4" v_pad="0" visible="false" width="55">
142 Message: 142 Message:
143 </text> 143 </text>
144 <text_editor bg_readonly_color="0, 0, 0, 0" bottom_delta="-145" embedded_items="false" 144 <text_editor bg_readonly_color="0, 0, 0, 0" bottom_delta="-148" embedded_items="false"
145 enabled="false" font="SansSerifSmall" height="175" hide_scrollbar="true" 145 enabled="false" font="SansSerifSmall" height="206" hide_scrollbar="true"
146 is_unicode="false" left_delta="0" max_length="511" mouse_opaque="true" 146 is_unicode="false" left_delta="0" max_length="511" mouse_opaque="true"
147 name="view_message" text_readonly_color="200,200,200, 255" width="404" 147 name="view_message" text_readonly_color="200,200,200, 255" width="404"
148 word_wrap="true" /> 148 word_wrap="true" />
diff --git a/linden/indra/newview/skins/xui/en-us/panel_group_roles.xml b/linden/indra/newview/skins/xui/en-us/panel_group_roles.xml
index 96363ac..3f6acf8 100644
--- a/linden/indra/newview/skins/xui/en-us/panel_group_roles.xml
+++ b/linden/indra/newview/skins/xui/en-us/panel_group_roles.xml
@@ -89,9 +89,9 @@ execute the Ability.
89 <button bottom_delta="0" font="SansSerif" halign="center" height="19" 89 <button bottom_delta="0" font="SansSerif" halign="center" height="19"
90 label="Eject From Group" left="-153" name="member_eject" width="146" /> 90 label="Eject From Group" left="-153" name="member_eject" width="146" />
91 <text name="help_text"> 91 <text name="help_text">
92 You can add or remove Roles assigned to members 92 You can add or remove Roles assigned to Members.
93or select multiple Members by holding the Control 93 Select multiple Members by holding the Ctrl key and
94key and clicking on their names. 94 clicking on their names.
95 </text> 95 </text>
96 <icon image_name="inv_folder_plain_closed.tga" name="power_folder_icon" /> 96 <icon image_name="inv_folder_plain_closed.tga" name="power_folder_icon" />
97 </panel> 97 </panel>
diff --git a/linden/indra/newview/skins/xui/en-us/panel_login.xml b/linden/indra/newview/skins/xui/en-us/panel_login.xml
index 43bee81..7df2151 100644
--- a/linden/indra/newview/skins/xui/en-us/panel_login.xml
+++ b/linden/indra/newview/skins/xui/en-us/panel_login.xml
@@ -10,7 +10,7 @@
10 </text> 10 </text>
11 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false" 11 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
12 bottom="54" drop_shadow_visible="true" follows="left|bottom" 12 bottom="54" drop_shadow_visible="true" follows="left|bottom"
13 font="SansSerif" h_pad="0" halign="left" height="20" hidden="false" 13 font="SansSerif" h_pad="0" halign="left" height="16" hidden="false"
14 left="32" mouse_opaque="true" name="first_name_text" v_pad="0" width="120"> 14 left="32" mouse_opaque="true" name="first_name_text" v_pad="0" width="120">
15 First Name: 15 First Name:
16 </text> 16 </text>
diff --git a/linden/indra/newview/skins/xui/en-us/panel_preferences_graphics3.xml b/linden/indra/newview/skins/xui/en-us/panel_preferences_graphics3.xml
index 4b8a647..adf6db2 100644
--- a/linden/indra/newview/skins/xui/en-us/panel_preferences_graphics3.xml
+++ b/linden/indra/newview/skins/xui/en-us/panel_preferences_graphics3.xml
@@ -38,15 +38,15 @@
38 <text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false" 38 <text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
39 bottom="-79" drop_shadow_visible="true" enabled="true" follows="left|top" 39 bottom="-79" drop_shadow_visible="true" enabled="true" follows="left|top"
40 font="SansSerifSmall" h_pad="0" halign="left" height="12" hidden="false" 40 font="SansSerifSmall" h_pad="0" halign="left" height="12" hidden="false"
41 left="10" mouse_opaque="true" name="AGP Graphics Card:" v_pad="0" 41 left="10" mouse_opaque="true" name="Enable VBO:" v_pad="0"
42 width="128"> 42 width="128">
43 AGP Graphics Card: 43 Enable VBO:
44 </text> 44 </text>
45 <check_box bottom="-83" control_name="RenderUseAGP" enabled="true" follows="left|top" 45 <check_box bottom="-83" control_name="RenderVBOEnable" enabled="true" follows="left|top"
46 font="SansSerifSmall" height="16" hidden="false" initial_value="false" 46 font="SansSerifSmall" height="16" hidden="false" initial_value="true"
47 label="Enable AGP (faster if using an AGP graphics card)" left="148" 47 label="Enable OpenGL Vertex Buffer Objects" left="148"
48 mouse_opaque="true" name="agp" radio_style="false" 48 mouse_opaque="true" name="vbo" radio_style="false"
49 tool_tip="Enabling this may lower performance and use more memory if using a standard PCI graphics card." 49 tool_tip="Enabling this may cause some OpenGL drivers to crash."
50 width="315" /> 50 width="315" />
51 <text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false" 51 <text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
52 bottom="-98" drop_shadow_visible="true" enabled="true" follows="left|top" 52 bottom="-98" drop_shadow_visible="true" enabled="true" follows="left|top"
diff --git a/linden/indra/newview/skins/xui/en-us/panel_preferences_network.xml b/linden/indra/newview/skins/xui/en-us/panel_preferences_network.xml
index ff25343..5e1ea32 100644
--- a/linden/indra/newview/skins/xui/en-us/panel_preferences_network.xml
+++ b/linden/indra/newview/skins/xui/en-us/panel_preferences_network.xml
@@ -12,41 +12,53 @@
12 decimal_digits="0" enabled="true" follows="left|top" height="15" 12 decimal_digits="0" enabled="true" follows="left|top" height="15"
13 hidden="false" increment="10" initial_val="50" left="148" max_val="1500" 13 hidden="false" increment="10" initial_val="50" left="148" max_val="1500"
14 min_val="50" mouse_opaque="true" name="max_bandwidth" show_text="true" 14 min_val="50" mouse_opaque="true" name="max_bandwidth" show_text="true"
15 value="500" width="200" /> 15 value="500" width="180" />
16 <text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false" 16 <text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
17 bottom="-20" drop_shadow_visible="true" enabled="true" follows="left|top" 17 bottom="-20" drop_shadow_visible="true" enabled="true" follows="left|top"
18 font="SansSerifSmall" h_pad="0" halign="left" height="10" hidden="false" 18 font="SansSerifSmall" h_pad="0" halign="left" height="10" hidden="false"
19 left="355" mouse_opaque="false" name="text_box2" v_pad="0" width="140"> 19 left="335" mouse_opaque="false" name="text_box2" v_pad="0" width="140">
20 kbps (kilobits per second) 20 kbps (kilobits per second)
21 </text> 21 </text>
22 <text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false" 22 <text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
23 bottom="-45" drop_shadow_visible="true" enabled="true" follows="left|top" 23 bottom="-45" drop_shadow_visible="true" enabled="true" follows="left|top"
24 font="SansSerifSmall" h_pad="0" halign="left" height="10" hidden="false" 24 font="SansSerifSmall" h_pad="0" halign="left" height="10" hidden="false"
25 left="12" mouse_opaque="false" name="text_box3" v_pad="0" width="128"> 25 left="12" mouse_opaque="false" name="cache_size_label_l" v_pad="0" width="128">
26 Disk Cache Size: 26 Disk Cache Size (MB):
27 </text> 27 </text>
28 <radio_group bottom="-115" control_name="VFSSize" draw_border="true" enabled="true" 28 <slider bottom="-50" can_edit_text="true" control_name="CacheSize" decimal_digits="0"
29 follows="left|top" height="80" hidden="false" left="148" 29 enabled="true" follows="left|top" height="15" hidden="false" increment="10"
30 mouse_opaque="true" name="disk cache" width="128"> 30 initial_val="50" left="148" max_val="1000" min_val="10" mouse_opaque="true"
31 <radio_item type="string" length="1" bottom="-20" enabled="true" height="16" hidden="false" left="0" 31 name="cache_size" show_text="true" width="180" />
32 mouse_opaque="true" name="radio" width="98"> 32 <button bottom="-55" enabled="true" follows="left|bottom" font="SansSerif"
33 50 MB 33 halign="center" height="22" hidden="false"
34 </radio_item> 34 label="Clear Cache" left="340" mouse_opaque="true"
35 <radio_item type="string" length="1" bottom="-40" enabled="true" height="16" hidden="false" left="0" 35 name="clear_cache" scale_image="true" width="85" />
36 mouse_opaque="true" name="radio2" width="98"> 36
37 200 MB 37 <text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
38 </radio_item> 38 bottom="-70" drop_shadow_visible="true" enabled="true" follows="left|top"
39 <radio_item type="string" length="1" bottom="-60" enabled="true" height="16" hidden="false" left="0" 39 font="SansSerifSmall" h_pad="0" halign="left" height="10" hidden="false"
40 mouse_opaque="true" name="radio3" width="98"> 40 left="12" mouse_opaque="false" name="cache_location_label" v_pad="0" width="128">
41 500 MB 41 Disk Cache Location:
42 </radio_item> 42 </text>
43 <radio_item type="string" length="1" bottom="-80" enabled="true" height="16" hidden="false" left="0" 43 <button bottom="-80" enabled="true" follows="left|top" font="SansSerif"
44 mouse_opaque="true" name="radio4" width="98"> 44 halign="center" height="22" hidden="false"
45 1000 MB 45 label="Set" label_selected="Set" left="140" mouse_opaque="true"
46 </radio_item> 46 name="set_cache" scale_image="true" width="50" />
47 </radio_group> 47 <button bottom="-105" enabled="true" follows="left|top" font="SansSerif"
48 <button bottom="-143" enabled="true" follows="left|bottom" font="SansSerif" 48 halign="center" height="22" hidden="false"
49 halign="center" height="20" hidden="false" label="Clear Cache" 49 label="Reset" label_selected="Set" left="140" mouse_opaque="true"
50 label_selected="Clear Cache" left="148" mouse_opaque="true" 50 name="reset_cache" scale_image="true" width="50" />
51 name="clear_cache" scale_image="true" width="100" /> 51 <text_editor bevel_style="in" border_style="line" border_thickness="1" bottom="-105"
52 enabled="false" follows="left|top" font="SansSerif" handle_edit_keys_directly="true"
53 height="45" hidden="false" hide_scrollbar="true" left="200" max_length="4096" mouse_opaque="true"
54 name="cache_location" select_all_on_focus_received="false" width="270" word_wrap="false"/>
55 <check_box bottom="-173" control_name="ConnectionPortEnabled" enabled="true" follows="left|top" font="SansSerifSmall"
56 height="16" hidden="false" initial_value="false" label="Custom Port Connection"
57 left="148" mouse_opaque="true" name="connection_port_enabled" radio_style="false"
58 width="256" />
59 <spinner bottom="-193" control_name="ConnectionPort" decimal_digits="0"
60 enabled="true" follows="left|top" height="16" hidden="false"
61 increment="1" initial_val="13000" label="Port Number:"
62 label_width="75" left="168" max_val="13050" min_val="13000" mouse_opaque="true"
63 name="connection_port" width="150" />
52</panel> 64</panel>
diff --git a/linden/indra/newview/skins/xui/en-us/panel_status_bar.xml b/linden/indra/newview/skins/xui/en-us/panel_status_bar.xml
index 6e246da..2ee26d1 100644
--- a/linden/indra/newview/skins/xui/en-us/panel_status_bar.xml
+++ b/linden/indra/newview/skins/xui/en-us/panel_status_bar.xml
@@ -1,6 +1,8 @@
1<?xml version="1.0" encoding="utf-8" standalone="yes" ?> 1<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
2<panel bottom="0" enabled="true" follows="top|left|right" height="18" hidden="false" 2<panel bottom="0" enabled="true" follows="top|left|right" height="18" hidden="false"
3 left="0" mouse_opaque="false" name="status" width="1000"> 3 left="0" mouse_opaque="false" name="status" width="1000" background_opaque="true"
4 background_visible="true"
5 bg_opaque_color="0.25 0.25 0.25 1.0">
4 <text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false" 6 <text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
5 bottom="-22" drop_shadow_visible="true" enabled="true" 7 bottom="-22" drop_shadow_visible="true" enabled="true"
6 follows="left|right|bottom" font="SansSerifSmall" h_pad="0" halign="left" 8 follows="left|right|bottom" font="SansSerifSmall" h_pad="0" halign="left"
@@ -8,7 +10,7 @@
8 name="ParcelNameText" 10 name="ParcelNameText"
9 tool_tip="Name of land parcel on which you are standing. Click for About Land." 11 tool_tip="Name of land parcel on which you are standing. Click for About Land."
10 v_pad="2" width="1039"> 12 v_pad="2" width="1039">
11 parcel name goes herre 13 parcel name goes here
12 </text> 14 </text>
13 <text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false" 15 <text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
14 bottom="-20" disabled_color="0 1 0 1" drop_shadow_visible="true" 16 bottom="-20" disabled_color="0 1 0 1" drop_shadow_visible="true"
diff --git a/linden/indra/newview/skins/xui/en-us/role_actions.xml b/linden/indra/newview/skins/xui/en-us/role_actions.xml
index 42ee0ca..8475b3d 100644
--- a/linden/indra/newview/skins/xui/en-us/role_actions.xml
+++ b/linden/indra/newview/skins/xui/en-us/role_actions.xml
@@ -27,7 +27,7 @@
27 longdescription="Change Role names, titles, and descriptions at the bottom of the the Members &amp; Roles tab &gt; Roles sub-tab after selecting a Role." 27 longdescription="Change Role names, titles, and descriptions at the bottom of the the Members &amp; Roles tab &gt; Roles sub-tab after selecting a Role."
28 name="role properties" value="6" /> 28 name="role properties" value="6" />
29 <action description="Assign Members to Assigner&apos;s Roles" 29 <action description="Assign Members to Assigner&apos;s Roles"
30 longdescription="Assign Members to Roles in the Assigned Roles section of the Members &amp; Roles tab &gt; Members sub-tab. A member with this power can only add members to a role the assigner is already in." 30 longdescription="Assign Members to Roles in the Assigned Roles section of the Members &amp; Roles tab &gt; Members sub-tab. A Member with this Ability can only add Members to a Role the assigner is already in."
31 name="role assign member limited" value="7" /> 31 name="role assign member limited" value="7" />
32 <action description="Assign Members to Any Role" 32 <action description="Assign Members to Any Role"
33 longdescription="Assign Members to Any Role in the Assigned Roles section of the Members &amp; Roles tab &gt; Members sub-tab. *WARNING* Any Member in a Role with this Ability can assign themselves--and any other non-Owner Member--to Roles that have more powers than they currently have, potentially elevating themselves to near-Owner power. Be sure you know what you&apos;re doing before assigning this Ability." 33 longdescription="Assign Members to Any Role in the Assigned Roles section of the Members &amp; Roles tab &gt; Members sub-tab. *WARNING* Any Member in a Role with this Ability can assign themselves--and any other non-Owner Member--to Roles that have more powers than they currently have, potentially elevating themselves to near-Owner power. Be sure you know what you&apos;re doing before assigning this Ability."
diff --git a/linden/indra/newview/skins/xui/es/floater_account_history.xml b/linden/indra/newview/skins/xui/es/floater_account_history.xml
deleted file mode 100644
index 745b62a..0000000
--- a/linden/indra/newview/skins/xui/es/floater_account_history.xml
+++ /dev/null
@@ -1,4 +0,0 @@
1<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
2<floater name="money history floater" title="Historial de cuenta">
3 <button label="Más detalles..." label_selected="Más detalles..." name="details_btn" />
4</floater>
diff --git a/linden/indra/newview/skins/xui/es/panel_account_details.xml b/linden/indra/newview/skins/xui/es/panel_account_details.xml
deleted file mode 100644
index d0bb698..0000000
--- a/linden/indra/newview/skins/xui/es/panel_account_details.xml
+++ /dev/null
@@ -1,7 +0,0 @@
1<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
2<panel label="Detalles" name="account_details_panel">
3 <button label="&lt; Primero" label_selected="&lt; Primero" name="earlier_btn"
4 tool_tip="Volver en el tiempo" />
5 <button label="Último &gt;" label_selected="Último &gt;" name="later_btn"
6 tool_tip="Avanzar en el tiempo" />
7</panel>
diff --git a/linden/indra/newview/skins/xui/es/panel_account_planning.xml b/linden/indra/newview/skins/xui/es/panel_account_planning.xml
deleted file mode 100644
index c2d8246..0000000
--- a/linden/indra/newview/skins/xui/es/panel_account_planning.xml
+++ /dev/null
@@ -1,2 +0,0 @@
1<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
2<panel label="Planeamiento" name="account_planning_panel" />
diff --git a/linden/indra/newview/skins/xui/es/panel_account_transactions.xml b/linden/indra/newview/skins/xui/es/panel_account_transactions.xml
deleted file mode 100644
index 91b1371..0000000
--- a/linden/indra/newview/skins/xui/es/panel_account_transactions.xml
+++ /dev/null
@@ -1,7 +0,0 @@
1<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
2<panel label="Ventas/Regalos" name="account_sales_panel">
3 <button label="&lt; Primero" label_selected="&lt; Primero" name="earlier_btn"
4 tool_tip="Volver en el tiempo" />
5 <button label="Último &gt;" label_selected="Último &gt;" name="later_btn"
6 tool_tip="Avanzar en el tiempo" />
7</panel>
diff --git a/linden/indra/newview/skins/xui/fr/floater_account_history.xml b/linden/indra/newview/skins/xui/fr/floater_account_history.xml
deleted file mode 100644
index 6fb6dd9..0000000
--- a/linden/indra/newview/skins/xui/fr/floater_account_history.xml
+++ /dev/null
@@ -1,5 +0,0 @@
1<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
2<floater name="money history floater" title="Historique du Compte">
3 <button label="Plus de détails..." label_selected="Plus de détails..."
4 name="details_btn" />
5</floater>
diff --git a/linden/indra/newview/skins/xui/fr/panel_account_details.xml b/linden/indra/newview/skins/xui/fr/panel_account_details.xml
deleted file mode 100644
index 744acb9..0000000
--- a/linden/indra/newview/skins/xui/fr/panel_account_details.xml
+++ /dev/null
@@ -1,7 +0,0 @@
1<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
2<panel label="Détails" name="account_details_panel">
3 <button label="&lt; Plus tôt" label_selected="&lt; Plus tôt" name="earlier_btn"
4 tool_tip="Reculer dans le temps" />
5 <button label="Plus tard &gt;" label_selected="Plus tard &gt;" name="later_btn"
6 tool_tip="Avancer dans le temps" />
7</panel>
diff --git a/linden/indra/newview/skins/xui/fr/panel_account_planning.xml b/linden/indra/newview/skins/xui/fr/panel_account_planning.xml
deleted file mode 100644
index 9fb19a3..0000000
--- a/linden/indra/newview/skins/xui/fr/panel_account_planning.xml
+++ /dev/null
@@ -1,2 +0,0 @@
1<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
2<panel label="Planning" name="account_planning_panel" />
diff --git a/linden/indra/newview/skins/xui/fr/panel_account_transactions.xml b/linden/indra/newview/skins/xui/fr/panel_account_transactions.xml
deleted file mode 100644
index 084f9fc..0000000
--- a/linden/indra/newview/skins/xui/fr/panel_account_transactions.xml
+++ /dev/null
@@ -1,7 +0,0 @@
1<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
2<panel label="Ventes/Cadeaux" name="account_sales_panel">
3 <button label="&lt; Plus tôt" label_selected="&lt; Plus tôt" name="earlier_btn"
4 tool_tip="Reculer dans le temps" />
5 <button label="Plus tard &gt;" label_selected="Plus tard &gt;" name="later_btn"
6 tool_tip="Avancer dans le temps" />
7</panel>
diff --git a/linden/indra/newview/skins/xui/ja/floater_account_history.xml b/linden/indra/newview/skins/xui/ja/floater_account_history.xml
deleted file mode 100644
index c272a87..0000000
--- a/linden/indra/newview/skins/xui/ja/floater_account_history.xml
+++ /dev/null
@@ -1,5 +0,0 @@
1<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
2<floater name="money history floater" title="アカウント履歴">
3 <button label="より詳ã—ã„情報..." label_selected="より詳ã—ã„情報..."
4 name="details_btn" />
5</floater>
diff --git a/linden/indra/newview/skins/xui/ja/panel_account_details.xml b/linden/indra/newview/skins/xui/ja/panel_account_details.xml
deleted file mode 100644
index 5235cc2..0000000
--- a/linden/indra/newview/skins/xui/ja/panel_account_details.xml
+++ /dev/null
@@ -1,7 +0,0 @@
1<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
2<panel label="詳細" name="account_details_panel">
3 <button label="&lt;以å‰ã®" label_selected="&lt;以å‰ã®" name="earlier_btn"
4 tool_tip="時間を戻ã™" />
5 <button label="後ã§&gt;" label_selected="後ã§&gt;" name="later_btn"
6 tool_tip="時間を進ã‚ã‚‹" />
7</panel>
diff --git a/linden/indra/newview/skins/xui/ja/panel_account_planning.xml b/linden/indra/newview/skins/xui/ja/panel_account_planning.xml
deleted file mode 100644
index f55a998..0000000
--- a/linden/indra/newview/skins/xui/ja/panel_account_planning.xml
+++ /dev/null
@@ -1,2 +0,0 @@
1<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
2<panel label="設計" name="account_planning_panel" />
diff --git a/linden/indra/newview/skins/xui/ja/panel_account_transactions.xml b/linden/indra/newview/skins/xui/ja/panel_account_transactions.xml
deleted file mode 100644
index 3eaf2af..0000000
--- a/linden/indra/newview/skins/xui/ja/panel_account_transactions.xml
+++ /dev/null
@@ -1,7 +0,0 @@
1<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
2<panel label="売り上ã’/ギフト" name="account_sales_panel">
3 <button label="&lt;以å‰ã®" label_selected="&lt;以å‰ã®" name="earlier_btn"
4 tool_tip="時間を戻ã™" />
5 <button label="後ã§&gt;" label_selected="後ã§&gt;" name="later_btn"
6 tool_tip="時間を進ã‚ã‚‹" />
7</panel>
diff --git a/linden/indra/newview/skins/xui/ko/floater_account_history.xml b/linden/indra/newview/skins/xui/ko/floater_account_history.xml
deleted file mode 100644
index 4e04845..0000000
--- a/linden/indra/newview/skins/xui/ko/floater_account_history.xml
+++ /dev/null
@@ -1,5 +0,0 @@
1<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
2<floater name="money history floater" title="계정 기ë¡">
3 <button label="ìžì„¸í•œ ë‚´ìš©..." label_selected="ìžì„¸í•œ ë‚´ìš©..."
4 name="details_btn" />
5</floater>
diff --git a/linden/indra/newview/skins/xui/ko/panel_account_details.xml b/linden/indra/newview/skins/xui/ko/panel_account_details.xml
deleted file mode 100644
index 6f4b693..0000000
--- a/linden/indra/newview/skins/xui/ko/panel_account_details.xml
+++ /dev/null
@@ -1,7 +0,0 @@
1<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
2<panel label="세부사항" name="account_details_panel">
3 <button label="&lt; ì´ì „" label_selected="&lt; ì´ì „" name="earlier_btn"
4 tool_tip="ì‹œê°„ì„ ê±°ìŠ¬ëŸ¬ 갑니다" />
5 <button label="ë‚˜ì¤‘ì— &gt;" label_selected="ë‚˜ì¤‘ì— &gt;" name="later_btn"
6 tool_tip="ì‹œê°„ì„ ì•žì„œ 갑니다" />
7</panel>
diff --git a/linden/indra/newview/skins/xui/ko/panel_account_planning.xml b/linden/indra/newview/skins/xui/ko/panel_account_planning.xml
deleted file mode 100644
index f8c1a9e..0000000
--- a/linden/indra/newview/skins/xui/ko/panel_account_planning.xml
+++ /dev/null
@@ -1,2 +0,0 @@
1<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
2<panel label="Planning" name="account_planning_panel" />
diff --git a/linden/indra/newview/skins/xui/ko/panel_account_transactions.xml b/linden/indra/newview/skins/xui/ko/panel_account_transactions.xml
deleted file mode 100644
index 37bf87c..0000000
--- a/linden/indra/newview/skins/xui/ko/panel_account_transactions.xml
+++ /dev/null
@@ -1,7 +0,0 @@
1<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
2<panel label="íŒë§¤/선물" name="account_sales_panel">
3 <button label="&lt; ì´ì „" label_selected="&lt; ì´ì „" name="earlier_btn"
4 tool_tip="ì‹œê°„ì„ ê±°ìŠ¬ëŸ¬ 갑니다" />
5 <button label="ë‚˜ì¤‘ì— &gt;" label_selected="ë‚˜ì¤‘ì— &gt;" name="later_btn"
6 tool_tip="ì‹œê°„ì„ ì•žì„œ 갑니다" />
7</panel>
diff --git a/linden/indra/newview/skins/xui/pt/floater_account_history.xml b/linden/indra/newview/skins/xui/pt/floater_account_history.xml
deleted file mode 100644
index 795b290..0000000
--- a/linden/indra/newview/skins/xui/pt/floater_account_history.xml
+++ /dev/null
@@ -1,4 +0,0 @@
1<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
2<floater name="money history floater" title="Histórico de conta">
3 <button label="Mais detalhes..." label_selected="Mais detalhes..." name="details_btn" />
4</floater>
diff --git a/linden/indra/newview/skins/xui/pt/panel_account_details.xml b/linden/indra/newview/skins/xui/pt/panel_account_details.xml
deleted file mode 100644
index de92f73..0000000
--- a/linden/indra/newview/skins/xui/pt/panel_account_details.xml
+++ /dev/null
@@ -1,7 +0,0 @@
1<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
2<panel label="Detalhes" name="account_details_panel">
3 <button label="&lt; Primeiro" label_selected="&lt; Primeiro" name="earlier_btn"
4 tool_tip="Voltar no tempo" />
5 <button label="Último &gt;" label_selected="Último &gt;" name="later_btn"
6 tool_tip="Avançar no tempo" />
7</panel>
diff --git a/linden/indra/newview/skins/xui/pt/panel_account_planning.xml b/linden/indra/newview/skins/xui/pt/panel_account_planning.xml
deleted file mode 100644
index 5700400..0000000
--- a/linden/indra/newview/skins/xui/pt/panel_account_planning.xml
+++ /dev/null
@@ -1,2 +0,0 @@
1<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
2<panel label="Planejamento" name="account_planning_panel" />
diff --git a/linden/indra/newview/skins/xui/pt/panel_account_transactions.xml b/linden/indra/newview/skins/xui/pt/panel_account_transactions.xml
deleted file mode 100644
index 1a1be07..0000000
--- a/linden/indra/newview/skins/xui/pt/panel_account_transactions.xml
+++ /dev/null
@@ -1,7 +0,0 @@
1<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
2<panel label="Vendas/Presentes" name="account_sales_panel">
3 <button label="&lt; Primeiro" label_selected="&lt; Primeiro" name="earlier_btn"
4 tool_tip="Voltar no tempo" />
5 <button label="Último &gt;" label_selected="Último &gt;" name="later_btn"
6 tool_tip="Avançar no tempo" />
7</panel>
diff --git a/linden/indra/newview/skins/xui/zh/floater_account_history.xml b/linden/indra/newview/skins/xui/zh/floater_account_history.xml
deleted file mode 100644
index 21c845f..0000000
--- a/linden/indra/newview/skins/xui/zh/floater_account_history.xml
+++ /dev/null
@@ -1,4 +0,0 @@
1<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
2<floater name="money history floater" title="账户历å²è®°å½•">
3 <button label="更多细节..." label_selected="更多细节..." name="details_btn" />
4</floater>
diff --git a/linden/indra/newview/skins/xui/zh/floater_god_tools.xml b/linden/indra/newview/skins/xui/zh/floater_god_tools.xml
deleted file mode 100644
index 3725560..0000000
--- a/linden/indra/newview/skins/xui/zh/floater_god_tools.xml
+++ /dev/null
@@ -1,152 +0,0 @@
1<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
2<floater name="godtools floater" title="ゴッド・ツール">
3 <tab_container name="GodTools Tabs">
4 <panel label="Grid" name="grid">
5 <button label="å…¨ã¦ã®ãƒ¦ãƒ¼ã‚¶ã‚’追ã„出ã™"
6 label_selected="å…¨ã¦ã®ãƒ¦ãƒ¼ã‚¶ã‚’追ã„出ã™" name="Kick all users" />
7 <button label="本地域ã®åœ°å›³ã®å…¬ç¤ºæ€§ã‚­ãƒ£ãƒƒã‚·ãƒ¥ã‚’削除"
8 label_selected="本地域ã®åœ°å›³ã®å…¬ç¤ºæ€§ã‚­ãƒ£ãƒƒã‚·ãƒ¥ã‚’削除"
9 name="Flush This Region&apos;s Map Visibility Caches" />
10 </panel>
11 <panel label="区域" name="region">
12 <text name="Sim Name:">
13 シムå:
14 </text>
15 <check_box label="準備" name="check prelude"
16 tool_tip="ã“ã®è¨­å®šã«ã‚ˆã‚Šã€ã“ã®åœ°åŸŸã®æº–備をã—ã¾ã™ã€‚" />
17 <check_box label="太阳固定" name="check fixed sun"
18 tool_tip="太陽ä½ç½®ã‚’固定(地域ï¼ä¸å‹•ç”£ï¼žé ˜åŸŸã®ã‚ˆã†ã«" />
19 <check_box label="テレãƒãƒ¼ãƒˆã®ãƒ›ãƒ¼ãƒ ã‚’リセット" name="check reset home"
20 tool_tip="å±…ä½è€…テレãƒãƒ¼ãƒˆã®éš›ã¯ã€å±…ä½è€…ã®ãƒ›ãƒ¼ãƒ ã‚’目的地ä½ç½®ã«ãƒªã‚»ãƒƒãƒˆã—ã¦ãã ã•ã„。" />
21 <check_box label="å¯è¦–" name="check visible"
22 tool_tip="ã“ã®è¨­å®šã«ã‚ˆã‚Šã€ã“ã®åœ°åŸŸã‚’ゴッド・モード以外ã§ã‚‚å¯è¦–ã«ã—ã¾ã™ã€‚" />
23 <check_box label="ダメージ" name="check damage"
24 tool_tip="ã“ã®è¨­å®šã«ã‚ˆã‚Šã€åœ°åŸŸå†…ã§ã®ãƒ€ãƒ¡ãƒ¼ã‚¸ã‚’有効ã«ã—ã¾ã™ã€‚" />
25 <check_box label="トラフィック・トラッキングをブロック"
26 name="block dwell"
27 tool_tip="ã“ã®è¨­å®šã«ã‚ˆã‚Šã€åœ°åŸŸå†…ã§ã®ãƒˆãƒ©ãƒ•ã‚£ãƒƒã‚¯ã‚’計算ã—ãªã„よã†ã«ã—ã¾ã™ã€‚" />
28 <check_box label="é”定外形" name="block terraform"
29 tool_tip="ã“ã®è¨­å®šã«ã‚ˆã‚Šã€åœ°åŸŸå†…ã§ã®åœŸåœ°æ•´å‚™ã‚’無効ã«ã—ã¾ã™ã€‚" />
30 <check_box label="サンドボックス" name="is sandbox"
31 tool_tip="ã“ã“ãŒã‚µãƒ³ãƒ‰ãƒœãƒƒã‚¯ã‚¹åœ°åŸŸã‹ã©ã†ã‹ã€ãƒˆã‚°ãƒ«ã—ã¾ã™ã€‚" />
32 <button label="硬地" label_selected="硬地" name="Bake Terrain"
33 tool_tip="ç¾åœ¨ã®é ˜åŸŸã‚’デフォルトã¨ã—ã¦ä¿å­˜ã—ã¾ã™ã€‚" />
34 <button label="領域を復帰" label_selected="領域を復帰" name="Revert Terrain"
35 tool_tip="ç¾åœ¨ã®é ˜åŸŸã‚’デフォルトã¨å…¥ã‚Œæ›¿ãˆã‚‹ã€‚" />
36 <button label="領域を交æ›ã—ã‚ã†" label_selected="領域を交æ›ã—ã‚ã†"
37 name="Swap Terrain"
38 tool_tip="ç¾åœ¨ã®é ˜åŸŸã‚’デフォルトã¨å…¥ã‚Œæ›¿ãˆã¾ã™ã€‚" />
39 <text name="estate id">
40 ä¸å‹•ç”£ï¼©ï¼¤ï¼š
41 </text>
42 <text name="parent id">
43 親ID:
44 </text>
45 <line_editor name="parentestate" tool_tip="ã“ã‚Œã¯ã€ã“ã®åœ°åŸŸã®è¦ªä¸å‹•ç”£ã§ã™ã€‚" />
46 <text name="Grid Pos: ">
47 グリッドä½ç½®ï¼š
48 </text>
49 <line_editor name="gridposx"
50 tool_tip="ã“ã‚Œã¯ã€ã“ã®åœ°åŸŸã®ã‚°ãƒªãƒƒãƒ‰xã®ä½ç½®ã§ã™ã€‚" />
51 <line_editor name="gridposy"
52 tool_tip="ã“ã‚Œã¯ã€ã“ã®åœ°åŸŸã®ã‚°ãƒªãƒƒãƒ‰yã®ä½ç½®ã§ã™ã€‚" />
53 <text name="Redirect to Grid: ">
54 グリッドã«å†æ¡ˆå†…ã™ã‚‹ï¼š
55 </text>
56 <text name="billable factor text">
57 請求ã§ãã‚‹è¦å› ï¼š
58 </text>
59 <text name="land cost text">
60 平方メートル当ãŸã‚ŠL$:
61 </text>
62 <button label="æ›´æ–°" label_selected="æ›´æ–°" name="Refresh"
63 tool_tip="ã“ã“をクリックã—ã¦ã€ä¸Šè¨˜ã®æƒ…報をリフレッシュã—ã¦ãã ã•ã„。" />
64 <button label="应用" label_selected="应用" name="Apply"
65 tool_tip="ã“ã“をクリックã—ã¦ã€ä¸Šè¨˜ã®å¤‰æ›´ã‚’é©ç”¨ã—ã¦ãã ã•ã„。" />
66 <button label="地域をé¸æŠž" label_selected="地域をé¸æŠž" name="Select Region"
67 tool_tip="土地ツールã§å…¨ä½“地域をé¸æŠžã—ã¦ãã ã•ã„。" />
68 <button label="ãŸã ã¡ã«è‡ªå‹•ä¿å­˜ã™ã‚‹"
69 label_selected="ãŸã ã¡ã«è‡ªå‹•ä¿å­˜ã™ã‚‹" name="Autosave now"
70 tool_tip="Gzip状態を自動ä¿å­˜ãƒ‡ã‚£ãƒ¬ã‚¯ãƒˆãƒªãƒ¼ã«ä¿å­˜ã—ãã¦ã ã•ã„。" />
71 </panel>
72 <panel label="东东" name="objects">
73 <text name="Sim Name:">
74 シムå:
75 </text>
76 <text name="region name">
77 ウェールズ語
78 </text>
79 <check_box label="无效脚本" name="disable scripts"
80 tool_tip="ã“ã®è¨­å®šã«ã‚ˆã‚Šã€åœ°åŸŸå†…ã®å…¨ã¦ã®ã‚¹ã‚¯ãƒªãƒ—トを無効ã«ã—ã¾ã™ã€‚" />
81 <check_box label="无效冲çª" name="disable collisions"
82 tool_tip="ã“ã®è¨­å®šã«ã‚ˆã‚Šã€åœ°åŸŸå†…ã§éžã‚¨ãƒ¼ã‚¸ã‚§ãƒ³ãƒˆã®è¡çªã‚’無効ã«ã—ã¾ã™ã€‚" />
83 <check_box label="无效物ç†" name="disable physics"
84 tool_tip="ã“ã®è¨­å®šã«ã‚ˆã‚Šã€åœ°åŸŸå†…ã®å…¨ã¦ã®ç‰©ç†çš„作用を無効ã«ã—ã¾ã™ã€‚" />
85 <button label="应用" label_selected="应用" name="Apply"
86 tool_tip="ã“ã“をクリックã—ã¦ã€ä¸Šè¨˜ã®å¤‰æ›´ã‚’é©ç”¨ã—ã¦ãã ã•ã„。" />
87 <button label="対象ã®è¨­å®š" label_selected="対象ã®è¨­å®š" name="Set Target"
88 tool_tip="オブジェクト削除ã®å¯¾è±¡ã¨ãªã‚‹ã‚¢ãƒã‚¿ãƒ¼ã‚’設定ã—ã¦ãã ã•ã„。" />
89 <text name="target_avatar_name">
90 (対象無ã—)
91 </text>
92 <button
93 label="ä»–ã®åœŸåœ°ã«ãŠã‘る対象ã®ã‚¹ã‚¯ãƒªãƒ—トをå«ã‚€ã‚ªãƒ–ジェクトを削除"
94 label_selected="ä»–ã®åœŸåœ°ã«ãŠã‘る対象ã®ã‚¹ã‚¯ãƒªãƒ—トをå«ã‚€ã‚ªãƒ–ジェクトを削除"
95 name="Delete Target&apos;s Scripted Objects On Others Land"
96 tool_tip="本地域ã«ãŠã„ã¦å¯¾è±¡ãŒæ‰€æœ‰ã—ã¦ã„ãªã„å…¨ã¦ã®ã‚¹ã‚¯ãƒªãƒ—トをå«ã‚€ã‚ªãƒ–ジェクトを削除ã—ã¦ãã ã•ã„。(コピーç¦æ­¢ï¼‰ã‚ªãƒ–ジェクトã¯è¿”å´ã•ã‚Œã¾ã™ã€‚" />
97 <button
98 label="『全ã¦ã€ã®åœŸåœ°ã«ãŠã‘る対象ã®ã‚¹ã‚¯ãƒªãƒ—トをå«ã‚€ã‚ªãƒ–ジェクトを削除"
99 label_selected="『全ã¦ã€ã®åœŸåœ°ã«ãŠã‘る対象ã®ã‚¹ã‚¯ãƒªãƒ—トをå«ã‚€ã‚ªãƒ–ジェクトを削除"
100 name="Delete Target&apos;s Scripted Objects On *Any* Land"
101 tool_tip="本地域ã«ãŠã„ã¦å¯¾è±¡ãŒæ‰€æœ‰ã—ã¦ã„ã‚‹å…¨ã¦ã®ã‚¹ã‚¯ãƒªãƒ—トをå«ã‚€ã‚ªãƒ–ジェクトを削除ã—ã¦ãã ã•ã„。(コピーç¦æ­¢ï¼‰ã‚ªãƒ–ジェクトã¯æˆ»ã•ã‚Œã¾ã™ã€‚" />
102 <button label="対象オブジェクトã®ã€Žå…¨ã¦ã€ã‚’削除"
103 label_selected="対象オブジェクトã®ã€Žå…¨ã¦ã€ã‚’削除"
104 name="Delete *ALL* Of Target&apos;s Objects"
105 tool_tip="本地域ã«ãŠã„ã¦å¯¾è±¡ãŒæ‰€æœ‰ã—ã¦ã„ã‚‹å…¨ã¦ã®ã‚ªãƒ–ジェクトを削除ã—ã¦ãã ã•ã„。(コピーç¦æ­¢ï¼‰ã‚ªãƒ–ジェクトã¯è¿”å´ã•ã‚Œã¾ã™ã€‚" />
106 <button label="上部コライダーを得る"
107 label_selected="上部コライダーを得る" name="Get Top Colliders"
108 tool_tip="ã‚‚ã£ã¨ã‚‚ä½ç›¸ã®ç‹­ã„コールãƒãƒƒã‚¯ã‚’経験ã—ã¦ã„るオブジェクトã®ãƒªã‚¹ãƒˆã‚’入手ã—ã¾ã™ã€‚" />
109 <button label="上部スクリプトを得る"
110 label_selected="上部スクリプトを得る" name="Get Top Scripts"
111 tool_tip="スクリプトã®èµ·å‹•ã«ä¸€ç•ªæ™‚間を費やã—ã¦ã„るオブジェクトã®ãƒªã‚¹ãƒˆã‚’入手ã—ã¾ã™ã€‚" />
112 <button label="スクリプト・ダイジェスト"
113 label_selected="スクリプト・ダイジェスト" name="Scripts digest"
114 tool_tip="å…¨ã¦ã®ã‚¹ã‚¯ãƒªãƒ—トã€ãŠã‚ˆã³åˆ©ç”¨é »åº¦ã®ãƒªã‚¹ãƒˆã‚’入手ã—ã¾ã™ã€‚" />
115 </panel>
116 <panel label="Request" name="request">
117 <text name="Destination:">
118 目的地:
119 </text>
120 <combo_box name="destination">
121 <combo_item name="Selection">
122 é¸æŠž
123 </combo_item>
124 <combo_item name="AgentRegion">
125 エージェント地域
126 </combo_item>
127 </combo_box>
128 <text name="Request:">
129 è¦æ±‚:
130 </text>
131 <combo_box name="request">
132 <combo_item name="colliders&lt;steps&gt;">
133 コライダー<ステップ>
134 </combo_item>
135 <combo_item name="scripts&lt;count&gt;,&lt;optionalpattern&gt;">
136 スクリプト<回数>ã€ï¼œã‚ªãƒ—ション・パターン>
137 </combo_item>
138 <combo_item name="objects&lt;pattern&gt;">
139 オブジェクト<模様>
140 </combo_item>
141 <combo_item name="rez&lt;asset_id&gt;">
142 <asset_id>を表示
143 </combo_item>
144 </combo_box>
145 <text name="Parameter:">
146 パラメーター:
147 </text>
148 <button label="リクエストã™ã‚‹" label_selected="リクエストã™ã‚‹"
149 name="Make Request" />
150 </panel>
151 </tab_container>
152</floater>
diff --git a/linden/indra/newview/skins/xui/zh/floater_inventory_view_finder.xml b/linden/indra/newview/skins/xui/zh/floater_inventory_view_finder.xml
deleted file mode 100644
index 7a0bba2..0000000
--- a/linden/indra/newview/skins/xui/zh/floater_inventory_view_finder.xml
+++ /dev/null
@@ -1,24 +0,0 @@
1<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
2<floater name="Inventory Finder" title="æŒã¡ç‰©_最近ã®ã‚¢ã‚¤ãƒ†ãƒ ">
3 <check_box label="アニメーション" name="check_animation" />
4 <check_box label="å刺" name="check_calling_card" />
5 <check_box label="衣物" name="check_clothing" />
6 <check_box label="ジェスãƒãƒ£ãƒ¼" name="check_gesture" />
7 <check_box label="ランドマーク" name="check_landmark" />
8 <check_box label="ノートカード" name="check_notecard" />
9 <check_box label="东东" name="check_object" />
10 <check_box label="スクリプト" name="check_script" />
11 <check_box label="サウンド" name="check_sound" />
12 <check_box label="æè´¨" name="check_texture" />
13 <check_box label="スナップショット" name="check_snapshot" />
14 <button label="全部" label_selected="全部" name="All" />
15 <button label="都ä¸" label_selected="都ä¸" name="None" />
16 <check_box label="常ã«ãƒ•ã‚©ãƒ«ãƒ€ãƒ¼ã‚’表示" name="check_show_empty" />
17 <check_box label="ログオフ以æ¥" name="check_since_logoff" />
18 <text type="string" length="1" name="- OR -">
19 ï¼ã¾ãŸã¯ï¼
20 </text>
21 <spinner label="時間å‰" name="spin_hours_ago" />
22 <spinner label="æ—¥å‰" name="spin_days_ago" />
23 <button label="关闭" label_selected="关闭" name="Close" />
24</floater>
diff --git a/linden/indra/newview/skins/xui/zh/floater_preferences.xml b/linden/indra/newview/skins/xui/zh/floater_preferences.xml
deleted file mode 100644
index 3a3fa9f..0000000
--- a/linden/indra/newview/skins/xui/zh/floater_preferences.xml
+++ /dev/null
@@ -1,7 +0,0 @@
1<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
2<floater name="Preferences" title="嗜好">
3 <button label="…ã«é–¢ã—ã¦" label_selected="…ã«é–¢ã—ã¦" name="About..." />
4 <button label="OK" label_selected="OK" name="OK" />
5 <button label="å–消" label_selected="å–消" name="Cancel" />
6 <button label="应用" label_selected="应用" name="Apply" />
7</floater>
diff --git a/linden/indra/newview/skins/xui/zh/floater_rate.xml b/linden/indra/newview/skins/xui/zh/floater_rate.xml
deleted file mode 100644
index 49b9c00..0000000
--- a/linden/indra/newview/skins/xui/zh/floater_rate.xml
+++ /dev/null
@@ -1,44 +0,0 @@
1<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
2<floater name="rate" title="ã‚ãªãŸã®Jeska Lindenã¸ã®è©•ä¾¡">
3 <radio_group name="behavior">
4 <radio_item type="string" length="1" name="Positive">
5 Positive
6 </radio_item>
7 <radio_item type="string" length="1" name="No Rating">
8 No Rating
9 </radio_item>
10 </radio_group>
11 <radio_group name="appearance">
12 <radio_item type="string" length="1" name="Positive">
13 Positive
14 </radio_item>
15 <radio_item type="string" length="1" name="No Rating">
16 No Rating
17 </radio_item>
18 </radio_group>
19 <radio_group name="building">
20 <radio_item type="string" length="1" name="Positive">
21 Positive
22 </radio_item>
23 <radio_item type="string" length="1" name="No Rating">
24 No Rating
25 </radio_item>
26 </radio_group>
27 <button label="OK" label_selected="OK" name="OK" />
28 <button label="å–消" label_selected="å–消" name="Cancel" />
29 <text type="string" length="1" name="Overall behavior:">
30 全体的ãªæ…‹åº¦ï¼š
31 </text>
32 <text type="string" length="1" name="Skill at appearance (clothing and attachments):">
33 容姿ã®ã‚¹ã‚­ãƒ« (æœã€è£…飾å“):
34 </text>
35 <text type="string" length="1" name="Skill at building:">
36 建造物ã®ã‚¹ã‚­ãƒ«ï¼š
37 </text>
38 <text type="string" length="1" name="Message:">
39 ä¿¡æ¯:
40 </text>
41 <text type="string" length="1" name="cost">
42 費用:å„評価を変更ã™ã‚‹ã«ã¯L$[COST] 全体費用:L$[TOTAL]
43 </text>
44</floater>
diff --git a/linden/indra/newview/skins/xui/zh/floater_sell_land.xml b/linden/indra/newview/skins/xui/zh/floater_sell_land.xml
deleted file mode 100644
index e2e62db..0000000
--- a/linden/indra/newview/skins/xui/zh/floater_sell_land.xml
+++ /dev/null
@@ -1,68 +0,0 @@
1<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
2<floater name="sell land" title="土地を販売">
3 <text name="info_parcel_label">
4 区画:
5 </text>
6 <text name="info_parcel">
7 区画å
8 </text>
9 <text name="info_size_label">
10 è¦æ¨¡ï¼š
11 </text>
12 <text name="info_size">
13 [AREA]平方メートル
14 </text>
15 <text name="info_action">
16 本区画を販売ã™ã‚‹ã«ã¯ï¼š
17 </text>
18 <text name="price_label">
19 価格を決定:
20 </text>
21 <text name="price_text">
22 ã“ã®åœŸåœ°ã«å¯¾ã™ã‚‹é©åˆ‡ãªä¾¡æ ¼ã‚’é¸æŠžã—ã¦ãã ã•ã„。
23 </text>
24 <text name="price_ld">
25 L$
26 </text>
27 <text name="price_per_m">
28 (一平方メートル当ãŸã‚ŠL$[PER_METER])
29 </text>
30 <text name="sell_to_label">
31 土地販売先:
32 </text>
33 <text name="sell_to_text">
34 誰ã«ã§ã‚‚販売ã™ã‚‹ã®ã‹ã€ç‰¹å®šã®è³¼å…¥è€…ã«è²©å£²ã™ã‚‹ã®ã‹é¸æŠžã—ã¦ãã ã•ã„。
35 </text>
36 <combo_box name="sell_to">
37 <combo_item name="--selectone--">
38 ï¼ï¼ä¸€ã¤ã‚’é¸æŠžï¼ï¼
39 </combo_item>
40 <combo_item name="Anyone">
41 誰ã§ã‚‚
42 </combo_item>
43 <combo_item name="Specificuser:">
44 特定ユーザー:
45 </combo_item>
46 </combo_box>
47 <button label="é¸æŠž" name="sell_to_select_agent" />
48 <text name="sell_objects_label">
49 土地ã¨ä¸€ç·’ã«ã‚ªãƒ–ジェクトも売りã¾ã™ã‹ï¼Ÿ
50 </text>
51 <text name="sell_objects_text">
52 Land owner&apos;s transferable objects on parcel will change ownership.
53 </text>
54 <radio_group name="sell_objects">
55 <radio_item name="no">
56 No, keep ownership of objects
57 </radio_item>
58 <radio_item name="yes">
59 Yes, sell objects with land
60 </radio_item>
61 </radio_group>
62 <button label="オブジェクトを表示" name="show_objects" />
63 <text name="nag_message_label">
64 一言メモ:返å“・交æ›ã¯å‡ºæ¥ã¾ã›ã‚“。
65 </text>
66 <button label="売り地ã®è¨­å®š" name="sell_btn" />
67 <button label="å–消" name="cancel_btn" />
68</floater>
diff --git a/linden/indra/newview/skins/xui/zh/floater_settings_debug.xml b/linden/indra/newview/skins/xui/zh/floater_settings_debug.xml
deleted file mode 100644
index 30ef985..0000000
--- a/linden/indra/newview/skins/xui/zh/floater_settings_debug.xml
+++ /dev/null
@@ -1,15 +0,0 @@
1<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
2<floater name="settings_debug" title="デãƒãƒƒã‚°è¨­å®š">
3 <combo_box name="boolean_combo">
4 <combo_item name="TRUE">
5 正解
6 </combo_item>
7 <combo_item name="FALSE">
8 誤り
9 </combo_item>
10 </combo_box>
11 <spinner label="x" name="val_spinner_1" />
12 <spinner label="x" name="val_spinner_2" />
13 <spinner label="x" name="val_spinner_3" />
14 <spinner label="x" name="val_spinner_4" />
15</floater>
diff --git a/linden/indra/newview/skins/xui/zh/menu_pie_attachment.xml b/linden/indra/newview/skins/xui/zh/menu_pie_attachment.xml
deleted file mode 100644
index 2669d04..0000000
--- a/linden/indra/newview/skins/xui/zh/menu_pie_attachment.xml
+++ /dev/null
@@ -1,6 +0,0 @@
1<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
2<pie_menu name="Attachment Pie">
3 <menu_item_call label="ドロップ" name="Drop" />
4 <menu_item_call label="å–り外ã™" name="Detach" />
5 <menu_item_call label="编辑" name="Edit" />
6</pie_menu>
diff --git a/linden/indra/newview/skins/xui/zh/menu_pie_avatar.xml b/linden/indra/newview/skins/xui/zh/menu_pie_avatar.xml
deleted file mode 100644
index 3d31680..0000000
--- a/linden/indra/newview/skins/xui/zh/menu_pie_avatar.xml
+++ /dev/null
@@ -1,16 +0,0 @@
1<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
2<pie_menu name="Avatar Pie">
3 <menu_item_call label="档案..." name="Profile..." />
4 <menu_item_call label="å±è”½" name="Avatar Mute" />
5 <menu_item_call label="è¡Œã" name="Go To" />
6 <menu_item_call label="評価" name="Rate" />
7 <menu_item_call label="フレンドを追加" name="Add Friend" />
8 <menu_item_call label="付款..." name="Pay..." />
9 <pie_menu label="ã•ã‚‰ã«ï¼ž" name="More &gt;">
10 <menu_item_call label="å‡çµ" name="Freeze..." />
11 <menu_item_call label="カードをã‚ã’ã‚‹" name="Give Card" />
12 <menu_item_call label="追放ã™ã‚‹" name="Eject..." />
13 <menu_item_call label="Debug..." name="Debug..." />
14 </pie_menu>
15 <menu_item_call label="IMã‚’é€ä¿¡" name="Send IM..." />
16</pie_menu>
diff --git a/linden/indra/newview/skins/xui/zh/menu_pie_land.xml b/linden/indra/newview/skins/xui/zh/menu_pie_land.xml
deleted file mode 100644
index e1b866a..0000000
--- a/linden/indra/newview/skins/xui/zh/menu_pie_land.xml
+++ /dev/null
@@ -1,10 +0,0 @@
1<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
2<pie_menu name="Land Pie">
3 <menu_item_call label="土地情報" name="About Land..." />
4 <menu_item_call label="创造" name="Create" />
5 <menu_item_call label="ã“ã“ã¸è¡Œã" name="Go Here" />
6 <menu_item_call label="ã“ã“ã«åº§ã‚‹" name="Sit Here" />
7 <menu_item_call label="通过…购买" name="Land Buy Pass" />
8 <menu_item_call label="土地を編集" name="Edit Terrain" />
9 <menu_item_call label="购买土地..." name="Land Buy" />
10</pie_menu>
diff --git a/linden/indra/newview/skins/xui/zh/menu_pie_object.xml b/linden/indra/newview/skins/xui/zh/menu_pie_object.xml
deleted file mode 100644
index d12380a..0000000
--- a/linden/indra/newview/skins/xui/zh/menu_pie_object.xml
+++ /dev/null
@@ -1,25 +0,0 @@
1<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
2<pie_menu name="Object Pie">
3 <menu_item_call label="é–‹ã" name="Open" />
4 <menu_item_call label="创造" name="Create" />
5 <menu_item_call label="触る" name="Object Touch" />
6 <menu_item_call label="ã“ã“ã«åº§ã‚‹" name="Object Sit" />
7 <menu_item_call label="ã¨ã‚‹" name="Pie Object Take" />
8 <menu_item_call label="付款..." name="Pay..." />
9 <pie_menu label="ã•ã‚‰ã«ï¼ž" name="More &gt;">
10 <menu_item_call label="删除" name="Delete" />
11 <menu_item_call label="穿上" name="Wear" />
12 <menu_item_call label="コピーをã¨ã‚‹" name="Take Copy" />
13 <pie_menu label="HUDを添付>" name="Object Attach HUD" />
14 <pie_menu label="添付>" name="Object Attach" />
15 <menu_item_call label="归还..." name="Return..." />
16 <pie_menu label="ã•ã‚‰ã«ï¼ž" name="Rate Menu">
17 <menu_item_call label="所有者を評価" name="Rate Owner..." />
18 <menu_item_call label="å«ŒãŒã‚‰ã›ã®å ±å‘Š" name="Report Abuse..." />
19 <menu_item_call label="クリエーターを評価" name="Rate Creator..." />
20 <menu_item_call label="å±è”½" name="Object Mute" />
21 </pie_menu>
22 <menu_item_call label="購入" name="Buy..." />
23 </pie_menu>
24 <menu_item_call label="編集" name="Edit..." />
25</pie_menu>
diff --git a/linden/indra/newview/skins/xui/zh/menu_pie_self.xml b/linden/indra/newview/skins/xui/zh/menu_pie_self.xml
deleted file mode 100644
index 8687808..0000000
--- a/linden/indra/newview/skins/xui/zh/menu_pie_self.xml
+++ /dev/null
@@ -1,29 +0,0 @@
1<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
2<pie_menu name="Self Pie">
3 <menu_item_call label="档案..." name="Profile..." />
4 <menu_item_call label="グループ" name="Groups..." />
5 <menu_item_call label="è¡Œã" name="Go..." />
6 <menu_item_call label="ç«‹ã¡ä¸ŠãŒã‚‹" name="Stand Up" />
7 <menu_item_call label="フレンド" name="Friends..." />
8 <menu_item_call label="ジェスãƒãƒ£ãƒ¼â€¦" name="Gestures..." />
9 <pie_menu label="å–り外ã™" name="Take Off &gt;">
10 <pie_menu label="æœï¼ž" name="Clothes &gt;">
11 <menu_item_call label="シャツ" name="Shirt" />
12 <menu_item_call label="ズボン" name="Pants" />
13 <menu_item_call label="é´" name="Shoes" />
14 <menu_item_call label="é´ä¸‹" name="Socks" />
15 <menu_item_call label="ジャケット" name="Jacket" />
16 <menu_item_call label="手袋" name="Gloves" />
17 <pie_menu label="ã•ã‚‰ã«ï¼ž" name="More &gt;">
18 <menu_item_call label="下ç€" name="Self Undershirt" />
19 <menu_item_call label="å…¨ã¦ã®æœ" name="All Clothes" />
20 <menu_item_call label="パンツ" name="Self Underpants" />
21 </pie_menu>
22 <menu_item_call label="スカート" name="Skirt" />
23 </pie_menu>
24 <pie_menu label="HUD>" name="Object Detach HUD" />
25 <pie_menu label="å–り外ã™ï¼ž" name="Object Detach" />
26 <menu_item_call label="å…¨ã¦ã‚’å–り外ã™" name="Detach All" />
27 </pie_menu>
28 <menu_item_call label="容姿" name="Appearance..." />
29</pie_menu>
diff --git a/linden/indra/newview/skins/xui/zh/menu_viewer.xml b/linden/indra/newview/skins/xui/zh/menu_viewer.xml
deleted file mode 100644
index 367e19e..0000000
--- a/linden/indra/newview/skins/xui/zh/menu_viewer.xml
+++ /dev/null
@@ -1,234 +0,0 @@
1<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
2<menu_bar name="Main Menu">
3 <menu label="File" name="File">
4 <tearoff_menu label="~~~~~~~~~~~" name="~~~~~~~~~~~" />
5 <menu_item_call label="ç”»åƒã‚’アップロード(L$[COST])" name="Upload Image" />
6 <menu_item_call label="サウンドをアップロード(L$[COST])" name="Upload Sound" />
7 <menu_item_call label="アニメーションをアップロード(L$[COST])"
8 name="Upload Animation" />
9 <menu_item_call label="大é‡ã‚¢ãƒƒãƒ—ロード(L$[COST]ï¼ãƒ•ã‚¡ã‚¤ãƒ«ï¼‰â€¦"
10 name="Bulk Upload" />
11 <menu_item_separator label="-----------" name="separator" />
12 <menu_item_call label="ウィンドウを閉ã˜ã‚‹" name="Close Window" />
13 <menu_item_separator label="-----------" name="separator2" />
14 <menu_item_call label="テクスãƒãƒ£ãƒ¼ã‚’ä¿å­˜" name="Save Texture As..." />
15 <menu_item_separator label="-----------" name="separator3" />
16 <menu_item_call label="スナップショットをå–ã‚‹" name="Take Snapshot" />
17 <menu_item_call label="スナップショットをディスクã«ä¿å­˜"
18 name="Snapshot to Disk" />
19 <menu_item_separator label="-----------" name="separator4" />
20 <menu_item_call label="ディスクã«å‹•ç”»ã‚’開始ï¼åœæ­¢" name="Start/Stop Movie to Disk" />
21 <menu label="Set Window Size" name="Set Window Size">
22 <tearoff_menu label="~~~~~~~~~~~" name="~~~~~~~~~~~" />
23 <menu_item_call label="320x240" name="320x240" />
24 <menu_item_call label="640x480" name="640x480" />
25 <menu_item_call label="800x600" name="800x600" />
26 <menu_item_separator label="-----------" name="separator" />
27 <menu_item_call label="720 x 480(NTSC)" name="720x480 (NTSC)" />
28 <menu_item_call label="768 x 576(PAL)" name="768x576 (PAL)" />
29 </menu>
30 <menu_item_separator label="-----------" name="separator5" />
31 <menu_item_call label="退出" name="Quit" />
32 </menu>
33 <menu label="编辑" name="Edit">
34 <tearoff_menu label="~~~~~~~~~~~" name="~~~~~~~~~~~" />
35 <menu_item_call label="å…ƒã«æˆ»ã™" name="Undo" />
36 <menu_item_call label="ã‚„ã‚Šç›´ã—" name="Redo" />
37 <menu_item_separator label="-----------" name="separator" />
38 <menu_item_call label="カット" name="Cut" />
39 <menu_item_call label="å¤åˆ¶" name="Copy" />
40 <menu_item_call label="貼り付ã‘" name="Paste" />
41 <menu_item_call label="删除" name="Delete" />
42 <menu_item_separator label="-----------" name="separator2" />
43 <menu_item_call label="æœç´¢..." name="Search..." />
44 <menu_item_separator label="-----------" name="separator3" />
45 <menu_item_call label="å…¨ã¦ã‚’é¸æŠž" name="Select All" />
46 <menu_item_call label="é¸å®šã—ãªã„" name="Deselect" />
47 <menu_item_separator label="-----------" name="separator4" />
48 <menu_item_call label="複製" name="Duplicate" />
49 <menu_item_separator label="-----------" name="separator5" />
50 <menu label="Attach Object" name="Attach Object" />
51 <menu label="Detach Object" name="Detach Object" />
52 <menu label="Take Off Clothing" name="Take Off Clothing">
53 <tearoff_menu label="~~~~~~~~~~~" name="~~~~~~~~~~~" />
54 <menu_item_call label="シャツ" name="Shirt" />
55 <menu_item_call label="ズボン" name="Pants" />
56 <menu_item_call label="é´" name="Shoes" />
57 <menu_item_call label="é´ä¸‹" name="Socks" />
58 <menu_item_call label="ジャケット" name="Jacket" />
59 <menu_item_call label="手袋" name="Gloves" />
60 <menu_item_call label="下ç€" name="Menu Undershirt" />
61 <menu_item_call label="パンツ" name="Menu Underpants" />
62 <menu_item_call label="スカート" name="Skirt" />
63 <menu_item_call label="å…¨ã¦ã®æœ" name="All Clothes" />
64 </menu>
65 <menu_item_separator label="-----------" name="separator6" />
66 <menu_item_call label="ジェスãƒãƒ£ãƒ¼â€¦" name="Gestures..." />
67 <menu_item_call label="档案..." name="Profile..." />
68 <menu_item_call label="容姿" name="Appearance..." />
69 <menu_item_separator label="-----------" name="separator7" />
70 <menu_item_check label="フレンド" name="Friends..." />
71 <menu_item_call label="グループ" name="Groups..." />
72 <menu_item_separator label="-----------" name="separator8" />
73 <menu_item_call label="å‚数选择..." name="Preferences..." />
74 </menu>
75 <menu label="View" name="View">
76 <tearoff_menu label="~~~~~~~~~~~" name="~~~~~~~~~~~" />
77 <menu_item_call label="マウスルック" name="Mouselook" />
78 <menu_item_check label="建造" name="Build" />
79 <menu_item_call label="表示をリセット" name="Reset View" />
80 <menu_item_call label="最後ã®ãƒãƒ£ãƒƒãƒˆã®é–²è¦§" name="Look at Last Chatter" />
81 <menu_item_separator label="-----------" name="separator" />
82 <menu_item_check label="ツールãƒãƒ¼" name="Toolbar" />
83 <menu_item_check label="èŠå¤©è®°å½•" name="Chat History" />
84 <menu_item_check label="インスタント・メッセージ" name="Instant Message" />
85 <menu_item_call label="库存" name="Inventory" />
86 <menu_item_check label="リストをミュート" name="Mute List" />
87 <menu_item_separator label="-----------" name="separator2" />
88 <menu_item_check label="カメラ制御" name="Camera Controls" />
89 <menu_item_check label="移動制御" name="Movement Controls" />
90 <menu_item_check label="全部地图" name="World Map" />
91 <menu_item_check label="迷你地图" name="Mini-Map" />
92 <menu_item_separator label="-----------" name="separator3" />
93 <menu_item_check label="統計ãƒãƒ¼" name="Statistics Bar" />
94 <menu_item_check label="土地境界線" name="Property Lines" />
95 <menu_item_check label="土地所有者" name="Land Owners" />
96 <menu_item_separator label="-----------" name="separator4" />
97 <menu label="Hover Tips" name="Hover Tips">
98 <tearoff_menu label="~~~~~~~~~~~" name="~~~~~~~~~~~" />
99 <menu_item_check label="ヒントを表示" name="Show Tips" />
100 <menu_item_separator label="-----------" name="separator" />
101 <menu_item_check label="土地情報" name="Land Tips" />
102 <menu_item_check label="å…¨ã¦ã®ã‚ªãƒ–ジェクトã«é–¢ã™ã‚‹æƒ…å ±"
103 name="Tips On All Objects" />
104 </menu>
105 <menu_item_check label="Altã¯ã€ç‰©ç†ã‚’表示" name="Alt Shows Physical" />
106 <menu_item_check label="トランスパレントをãƒã‚¤ãƒ©ã‚¤ãƒˆ" name="Highlight Transparent" />
107 <menu label="Beacons" name="Beacons">
108 <tearoff_menu label="~~~~~~~~~~~" name="~~~~~~~~~~~" />
109 <menu_item_check label="スクリプトをå«ã‚€ã‚ªãƒ–ジェクト" name="Scripted Objects" />
110 <menu_item_check label="物ç†çš„オブジェクト" name="Physical Objects" />
111 <menu_item_check label="音æº" name="Sound Sources" />
112 <menu_item_check label="パーティクルæº" name="Particle Sources" />
113 <menu_item_separator label="-----------" name="separator" />
114 <menu_item_check label="パーティクルを隠ã™" name="Hide Particles" />
115 </menu>
116 <menu_item_check label="HUD添付物を表示ã™ã‚‹" name="Show HUD Attachments" />
117 <menu_item_separator label="-----------" name="separator5" />
118 <menu_item_call label="拡大" name="Zoom In" />
119 <menu_item_call label="デフォルトã®æ‹¡å¤§" name="Zoom Default" />
120 <menu_item_call label="縮å°" name="Zoom Out" />
121 <menu_item_separator label="-----------" name="separator6" />
122 <menu label="More" name="More">
123 <menu_item_call label="フル画é¢ã‚’トグルã™ã‚‹" name="Toggle Fullscreen" />
124 <menu_item_call label="UIè¦æ¨¡ã‚’デフォルトã«è¨­å®š" name="Set UI Size to Default" />
125 </menu>
126 </menu>
127 <menu label="世界" name="World">
128 <tearoff_menu label="~~~~~~~~~~~" name="~~~~~~~~~~~" />
129 <menu_item_call label="èŠå¤©" name="Chat" />
130 <menu_item_call label="ジェスãƒãƒ£ãƒ¼ã®é–‹å§‹" name="Start Gesture" />
131 <menu_item_check label="常ã«èµ°ã‚‹" name="Always Run" />
132 <menu_item_check label="飞翔" name="Fly" />
133 <menu_item_separator label="-----------" name="separator" />
134 <menu_item_call label="ã“ã“ã«ãƒ©ãƒ³ãƒ‰ãƒžãƒ¼ã‚¯ã‚’作æˆ" name="Create Landmark Here" />
135 <menu_item_call label="ホームをã“ã“ã«è¨­å®š" name="Set Home to Here" />
136 <menu_item_separator label="-----------" name="separator2" />
137 <menu_item_call label="ホームã«ãƒ†ãƒ¬ãƒãƒ¼ãƒˆ" name="Teleport Home" />
138 <menu_item_separator label="-----------" name="separator3" />
139 <menu_item_call label="退席中ã«è¨­å®š" name="Set Away" />
140 <menu_item_call label="å–ã‚Šè¾¼ã¿ä¸­ã«è¨­å®š" name="Set Busy" />
141 <menu_item_separator label="-----------" name="separator4" />
142 <menu_item_call label="å£åº§å±¥æ­´" name="Account History..." />
143 <menu_item_call label="自分ã®å£åº§ã®ç®¡ç†" name="Manage My Account..." />
144 <menu_item_call label="Buy L$..." name="Buy and Sell L$..." />
145 <menu_item_separator label="-----------" name="separator5" />
146 <menu_item_call label="自分ã®åœŸåœ°" name="My Land..." />
147 <menu_item_call label="土地情報" name="About Land..." />
148 <menu_item_call label="购买土地..." name="Buy Land..." />
149 <menu_item_call label="地域ï¼ä¸å‹•ç”£" name="Region/Estate..." />
150 <menu_item_separator label="-----------" name="separator6" />
151 <menu label="Force Sun" name="Force Sun">
152 <tearoff_menu label="~~~~~~~~~~~" name="~~~~~~~~~~~" />
153 <menu_item_call label="æ—¥ã®å‡º" name="Sunrise" />
154 <menu_item_call label="æ­£åˆ" name="Noon" />
155 <menu_item_call label="日没" name="Sunset" />
156 <menu_item_call label="深夜" name="Midnight" />
157 <menu_item_separator label="-----------" name="separator" />
158 <menu_item_call label="地域デフォルトã«æˆ»ã™" name="Revert to Region Default" />
159 </menu>
160 </menu>
161 <menu label="Tools" name="Tools">
162 <tearoff_menu label="~~~~~~~~~~~" name="~~~~~~~~~~~" />
163 <menu label="Select Tool" name="Select Tool">
164 <tearoff_menu label="~~~~~~~~~~~" name="~~~~~~~~~~~" />
165 <menu_item_call label="フォーカス" name="Focus" />
166 <menu_item_call label="移动" name="Move" />
167 <menu_item_call label="编辑" name="Edit" />
168 <menu_item_call label="创造" name="Create" />
169 <menu_item_call label="土地" name="Land" />
170 </menu>
171 <menu_item_separator label="-----------" name="separator" />
172 <menu_item_check label="自分ã®ã‚ªãƒ–ジェクトã®ã¿é¸æŠž" name="Select Only My Objects" />
173 <menu_item_check label="移動å¯èƒ½ãªã‚ªãƒ–ジェクトã®ã¿é¸æŠž"
174 name="Select Only Movable Objects" />
175 <menu_item_check label="環境ã§é¸æŠž" name="Select By Surrounding" />
176 <menu_item_check label="éžè¡¨ç¤ºã®é¸æŠžã‚’表示" name="Show Hidden Selection" />
177 <menu_item_check label="ライトåŠå¾„一覧を表示" name="Show Light Radius for Selection" />
178 <menu_item_check label="é¸æŠžãƒ“ームを表示" name="Show Selection Beam" />
179 <menu_item_separator label="-----------" name="separator2" />
180 <menu_item_check label="グリッドã«ã‚¹ãƒŠãƒƒãƒ—ã™ã‚‹" name="Snap to Grid" />
181 <menu_item_call label="オブジェクトXYをグリッドã«ã‚¹ãƒŠãƒƒãƒ—ã™ã‚‹"
182 name="Snap Object XY to Grid" />
183 <menu_item_call label="グリッド用ã«é¸æŠžã‚’使用" name="Use Selection for Grid" />
184 <menu_item_call label="グリッドã®ã‚ªãƒ—ション" name="Grid Options..." />
185 <menu_item_separator label="-----------" name="separator3" />
186 <menu_item_call label="リンク" name="Link" />
187 <menu_item_call label="リンクã—ãªã„" name="Unlink" />
188 <menu_item_separator label="-----------" name="separator4" />
189 <menu_item_call label="å…¨ã¦ã®ã‚¢ãƒ‹ãƒ¡ãƒ¼ã‚·ãƒ§ãƒ³ã®åœæ­¢" name="Stop All Animations" />
190 <menu_item_separator label="-----------" name="separator5" />
191 <menu_item_call label="é¸æŠžã‚’フォーカス" name="Focus on Selection" />
192 <menu_item_call label="é¸æŠžç¯„囲をズーム" name="Zoom to Selection" />
193 <menu_item_call label="オブジェクトを購入" name="Menu Object Take" />
194 <menu_item_call label="コピーをã¨ã‚‹" name="Take Copy" />
195 <menu_item_call label="æŒã¡ç‰©ã«ã‚ªãƒ–ジェクトを戻ã—ã¦ä¿å­˜"
196 name="Save Object Back to My Inventory" />
197 <menu_item_call
198 label="オブジェクト・コンテンツã«ã‚ªãƒ–ジェクトを戻ã—ã¦ä¿å­˜"
199 name="Save Object Back to Object Contents" />
200 <menu_item_separator label="-----------" name="separator6" />
201 <menu_item_call label="スクリプト警告ï¼ã‚¨ãƒ©ãƒ¼ãƒ»ã‚¦ã‚£ãƒ³ãƒ‰ã‚¦ã®è¡¨ç¤º"
202 name="Show Script Warning/Error Window" />
203 <menu_item_call label="é¸æŠžã•ã‚ŒãŸã‚¹ã‚¯ãƒªãƒ—トをå†ç·¨é›†"
204 name="Recompile Scripts in Selection" />
205 <menu_item_call label="é¸æŠžã•ã‚ŒãŸã‚¹ã‚¯ãƒªãƒ—トをリセット"
206 name="Reset Scripts in Selection" />
207 <menu_item_call label="é¸æŠžã•ã‚ŒãŸã‚¹ã‚¯ãƒªãƒ—トを起動ã™ã‚‹"
208 name="Set Scripts to Running in Selection" />
209 <menu_item_call label="é¸æŠžã•ã‚ŒãŸã‚¹ã‚¯ãƒªãƒ—トを起動ã—ãªã„"
210 name="Set Scripts to Not Running in Selection" />
211 </menu>
212 <menu label="帮助" name="Help">
213 <tearoff_menu label="~~~~~~~~~~~" name="~~~~~~~~~~~" />
214 <menu_item_call label="第二人生帮助" name="Second Life Help" />
215 <menu_item_call label="知識ベース" name="Knowledge Base..." />
216 <menu_item_call label="ライブ・ヘルプ" name="Live Help..." />
217 <menu_item_separator label="-----------" name="separator" />
218 <menu_item_call label="オフィシャルLindenブログ" name="Official Linden Blog..." />
219 <menu_item_separator label="-----------" name="separator2" />
220 <menu_item_call label="スクリプト・ガイド" name="Scripting Guide..." />
221 <menu_item_call label="スクリプトWiki" name="Scripting Wiki..." />
222 <menu_item_separator label="-----------" name="separator3" />
223 <menu_item_call label="今日ã®ãƒ¡ãƒƒã‚»ãƒ¼ã‚¸" name="Message of the Day..." />
224 <menu_item_separator label="-----------" name="separator4" />
225 <menu_item_call label="å«ŒãŒã‚‰ã›ã®å ±å‘Š" name="Report Abuse..." />
226 <menu_item_call label="ã¶ã¤ã‹ã‚‹ã€æŠ¼ã™ã€ãŠã‚ˆã³å½“ãŸã‚‹"
227 name="Bumps, Pushes &amp;amp; Hits..." />
228 <menu_item_separator label="-----------" name="separator5" />
229 <menu_item_call label="ãƒã‚°ã®å ±å‘Š" name="Report Bug..." />
230 <menu_item_call label="ノートをリリース" name="Release Notes..." />
231 <menu_item_separator label="-----------" name="separator6" />
232 <menu_item_call label="Second Lifeã«é–¢ã—ã¦" name="About Second Life..." />
233 </menu>
234</menu_bar>
diff --git a/linden/indra/newview/skins/xui/zh/panel_account_details.xml b/linden/indra/newview/skins/xui/zh/panel_account_details.xml
deleted file mode 100644
index a7eab8f..0000000
--- a/linden/indra/newview/skins/xui/zh/panel_account_details.xml
+++ /dev/null
@@ -1,7 +0,0 @@
1<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
2<panel label="Details" name="account_details_panel">
3 <button label="&lt;较早" label_selected="&lt;较早" name="earlier_btn"
4 tool_tip="時間を戻ã™" />
5 <button label="延迟 &gt;" label_selected="延迟 &gt;" name="later_btn"
6 tool_tip="時間を進ã‚ã‚‹" />
7</panel>
diff --git a/linden/indra/newview/skins/xui/zh/panel_account_planning.xml b/linden/indra/newview/skins/xui/zh/panel_account_planning.xml
deleted file mode 100644
index f8c1a9e..0000000
--- a/linden/indra/newview/skins/xui/zh/panel_account_planning.xml
+++ /dev/null
@@ -1,2 +0,0 @@
1<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
2<panel label="Planning" name="account_planning_panel" />
diff --git a/linden/indra/newview/skins/xui/zh/panel_account_transactions.xml b/linden/indra/newview/skins/xui/zh/panel_account_transactions.xml
deleted file mode 100644
index e75689f..0000000
--- a/linden/indra/newview/skins/xui/zh/panel_account_transactions.xml
+++ /dev/null
@@ -1,7 +0,0 @@
1<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
2<panel label="Sales/Gifts" name="account_sales_panel">
3 <button label="&lt;较早" label_selected="&lt;较早" name="earlier_btn"
4 tool_tip="時間を戻ã™" />
5 <button label="延迟 &gt;" label_selected="延迟 &gt;" name="later_btn"
6 tool_tip="時間を進ã‚ã‚‹" />
7</panel>
diff --git a/linden/indra/newview/skins/xui/zh/panel_avatar.xml b/linden/indra/newview/skins/xui/zh/panel_avatar.xml
deleted file mode 100644
index e9c1753..0000000
--- a/linden/indra/newview/skins/xui/zh/panel_avatar.xml
+++ /dev/null
@@ -1,195 +0,0 @@
1<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
2<panel name="Panel Avatar">
3 <tab_container name="tab">
4 <panel label="2nd Life" name="2nd Life">
5 <text name="CaptionTextAcctInfo">
6 [ACCTTYPE]
7[PAYMENTINFO]
8 </text>
9 <text name="AcctTypeResident">
10 å±…ä½è€…
11 </text>
12 <text name="AcctTypeTrial">
13 トライアル
14 </text>
15 <text name="AcctTypeCharterMember">
16 特権メンãƒãƒ¼
17 </text>
18 <text name="AcctTypeEmployee">
19 Linden Lab 従業員
20 </text>
21 <text name="PaymentInfoUsed">
22 支払ã„情報ãŒä½¿ç”¨ã•ã‚Œã¦ã„ã‚‹
23 </text>
24 <text name="PaymentInfoOnFile">
25 支払ã„情報ã®ç™»éŒ²ãŒã‚ã‚‹
26 </text>
27 <text name="NoPaymentInfoOnFile">
28 支払ã„情報ã®ç™»éŒ²ãŒãªã„
29 </text>
30 <text name="Name:">
31 åå­—:
32 </text>
33 <text name="online_yes">
34 オンライン:ã¯ã„
35 </text>
36 <text name="online_no">
37 オンライン:ã„ã„ãˆ
38 </text>
39 <text name="online_unknown">
40 オンライン:ä¸æ˜Ž
41 </text>
42 <text name="label">
43 天生的:
44 </text>
45 <text name="label2">
46 账户:
47 </text>
48 <text name="partner_label"
49 tool_tip="Second Lifeパートナーã§ã™ã€‚設定ã«ã¤ã„ã¦ã®è©³ç´°ã¯ã€www.secondlife.com/partnerã‚’å‚ç…§ã—ã¦ãã ã•ã„。">
50 æ­æ¡£:
51 </text>
52 <line_editor name="partner_edit"
53 tool_tip="Second Lifeパートナーã§ã™ã€‚設定ã«ã¤ã„ã¦ã®è©³ç´°ã¯ã€www.secondlife.com/partnerã‚’å‚ç…§ã—ã¦ãã ã•ã„。">
54 [FIRST][LAST]
55 </line_editor>
56 <text name="Photo:">
57 照片:
58 </text>
59 <texture_picker label="" name="img"
60 tool_tip="クリックã—ã¦å†™çœŸã‚’é¸æŠžã—ã¦ãã ã•ã„。" />
61 <text name="Ratings:">
62 级别:
63 </text>
64 <text name="Groups:">
65 社团:
66 </text>
67 <text name="About:">
68 关于:
69 </text>
70 <text name="(500 chars)">
71 (500 个字)
72 </text>
73 <text name="Give item:">
74 æ供项目:
75 </text>
76 <text name="Give inventory"
77 tool_tip="アイテムをã‚ã’ã‚‹å ´åˆã¯ã€ã“ã“ã«æŒã¡ç‰©ã‹ã‚‰ãƒ‰ãƒ­ãƒƒãƒ—ã—ã¾ã™ã€‚">
78 放置目录内容于此.
79 </text>
80 <check_box label="在网上公布" name="allow_publish"
81 tool_tip="自分ã®ãƒ—ロファイル情報をWeb上ã§å…¬é–‹ã—ã¾ã™ã€‚" />
82 <button label="?" label_selected="?" name="?" />
83 <button label="在地图中显示" label_selected="在地图中显示"
84 name="Show on Map" />
85 <button label="æ供闪电传é€..." label_selected="æ供闪电传é€..."
86 name="Offer Teleport..." />
87 <button label="比率..." label_selected="比率..." name="Rate..." />
88 <button label="付款..." label_selected="付款..." name="Pay..." />
89 <button label="å³æ—¶æ¶ˆæ¯..." label_selected="å³æ—¶æ¶ˆæ¯..."
90 name="Instant Message..." />
91 <button label="å±è”½" label_selected="å±è”½" name="Mute" />
92 </panel>
93 <panel label="网络" name="WebProfile">
94 <button label="家" label_selected="家" name="home" />
95 <button label="Load" label_selected="Load" name="load"
96 tool_tip="Load this profile page with embedded web browser." />
97 <button label="Open..." label_selected="Open..." name="open"
98 tool_tip="Open this profile page in your default external web browser." />
99 <button label="?" label_selected="?" name="web_profile_help" />
100 <check_box label="Automatically load web profiles" name="auto_load"
101 tool_tip="Automatically load ALL profile webpages without asking first." />
102 <text name="status_text">
103 完æˆ
104 </text>
105 </panel>
106 <panel label="Interests" name="Interests">
107 <text name="I Want To:">
108 我想è¦:
109 </text>
110 <check_box label="建造" name="chk0" />
111 <check_box label="å¼€è’" name="chk1" />
112 <check_box label="相会" name="chk2" />
113 <check_box label="å—雇" name="chk6" />
114 <check_box label="社团&quot;" name="chk3" />
115 <check_box label="è´­ä¹°" name="chk4" />
116 <check_box label="出售" name="chk5" />
117 <check_box label="雇佣" name="chk7" />
118 <text name="Skills:">
119 技能:
120 </text>
121 <check_box label="æè´¨" name="schk0" />
122 <check_box label="建筑" name="schk1" />
123 <check_box label="事件计划" name="schk2" />
124 <check_box label="建模" name="schk3" />
125 <check_box label="编辑脚本" name="schk4" />
126 <check_box label="习惯的特性" name="schk5" />
127 <text name="Languages:">
128 Languages:
129 </text>
130 </panel>
131 <panel label="Picks" name="Picks">
132 <text name="Tell everyone about your favorite places in Second Life.">
133 告诉æ¯ä¸ªäººä½ åœ¨ç¬¬äºŒäººç”Ÿä¸­æœ€å–œæ¬¢çš„地点
134 </text>
135 <button label="æ–°çš„..." label_selected="æ–°çš„..." name="New..." />
136 <button label="删除..." label_selected="删除..." name="Delete..." />
137 </panel>
138 <panel label="分类的" name="Classified">
139 <text name="Place an ad in Second Life&apos;s classified listings.">
140 在第二人生的分类æ ä¸­åˆŠç™»å¹¿å‘Šã€‚
141 </text>
142 <button label="æ–°çš„..." label_selected="æ–°çš„..." name="New..." />
143 <button label="删除..." label_selected="删除..." name="Delete..." />
144 </panel>
145 <panel label="1st Life" name="1st Life">
146 <text name="Photo:">
147 照片:
148 </text>
149 <texture_picker label="" name="img"
150 tool_tip="クリックã—ã¦å†™çœŸã‚’é¸æŠžã—ã¦ãã ã•ã„。" />
151 <text name="Info:">
152 消æ¯:
153 </text>
154 <text name="(250 chars)">
155 (250个字)
156 </text>
157 </panel>
158 <panel label="My Notes" name="My Notes">
159 <text name="label">
160 使用这å—空间æ¥è®°å½•ä½ å…³äºŽè¿™ä¸ªäººçš„笔迹。 继续追踪
161交易过程, åˆä½œçš„项目,等等。åªæœ‰ä½ å¯ä»¥çœ‹è§è¿™äº›ç¬”记。
162你观察的人看ä¸è§ï¼Œå…¶ä»–人也看ä¸è§ã€‚
163 </text>
164 </panel>
165 </tab_container>
166 <button label="OK" label_selected="OK" name="OK" />
167 <button label="å–消" label_selected="å–消" name="Cancel" />
168 <button label="踢人" label_selected="踢人" name="Kick" />
169 <button label="é”定" label_selected="é”定" name="Freeze"
170 tool_tip="ã“ã®å±…ä½è€…ã®å‹•ããŠã‚ˆã³ä¼šè©±ã‚’åœæ­¢ã—ã¾ã™ã€‚" />
171 <button label="解é”定" label_selected="解é”定" name="Unfreeze"
172 tool_tip="å±…ä½è€…を解å‡" />
173 <button label="CSR" label_selected="CSR" name="csr_btn"
174 tool_tip="ã“ã®å±…ä½è€…ã®ã‚«ã‚¹ã‚¿ãƒžãƒ¼ã‚µãƒ¼ãƒ“スツールを開ãã¾ã™ã€‚" />
175 <text name="ShowOnMapNonFriend">
176 地図上ã§ãƒ­ã‚±ãƒ¼ã‚·ãƒ§ãƒ³ã‚’表示ã—ã¾ã™ã€‚
177ã‚ãªãŸãŒç›¸æ‰‹ã¨ãƒ•ãƒ¬ãƒ³ãƒ‰ç™»éŒ²ã‚’è¡Œã£ã¦ãªã„ãŸã‚ã€è¡¨ç¤ºã§ãã¾ã›ã‚“。
178 </text>
179 <text name="ShowOnMapFriendOffline">
180 地図上ã§ãƒ­ã‚±ãƒ¼ã‚·ãƒ§ãƒ³ã‚’表示ã—ã¾ã™ã€‚
181相手ãŒã‚ªãƒ³ãƒ©ã‚¤ãƒ³ã§ã¯ãªã„ãŸã‚ã€è¡¨ç¤ºã§ãã¾ã›ã‚“。
182 </text>
183 <text name="ShowOnMapFriendOnline">
184 地図上ã§ãƒ­ã‚±ãƒ¼ã‚·ãƒ§ãƒ³ã‚’表示ã—ã¾ã™ã€‚
185 </text>
186 <text name="TeleportGod">
187 ã‚ãªãŸã®ãƒ­ã‚±ãƒ¼ã‚·ãƒ§ãƒ³ã«å¼·åˆ¶ãƒ†ãƒ¬ãƒãƒ¼ãƒˆ
188 </text>
189 <text name="TeleportPrelude">
190 ã‚ãªãŸã®ãƒ­ã‚±ãƒ¼ã‚·ãƒ§ãƒ³ã«ãƒ†ãƒ¬ãƒãƒ¼ãƒˆã‚’申ã—出ã¾ã™ã€‚オリエンテーション・アイランドを去るã¾ã§ã¯ç„¡åŠ¹ã§ã™ã€‚
191 </text>
192 <text name="TeleportNormal">
193 ã‚ãªãŸã®ãƒ­ã‚±ãƒ¼ã‚·ãƒ§ãƒ³ã¸ãƒ†ãƒ¬ãƒãƒ¼ãƒˆã‚’申ã—出ã¾ã™ã€‚
194 </text>
195</panel>
diff --git a/linden/indra/newview/skins/xui/zh/panel_group.xml b/linden/indra/newview/skins/xui/zh/panel_group.xml
deleted file mode 100644
index 4ac853e..0000000
--- a/linden/indra/newview/skins/xui/zh/panel_group.xml
+++ /dev/null
@@ -1,14 +0,0 @@
1<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
2<panel name="GroupInfo" title="グループ情報">
3 <text name="default_needs_apply_text">
4 ç¾åœ¨ã®ã‚¿ãƒ–ã«ãŠã‘る未é©ç”¨ã®å¤‰æ›´ãŒã‚ã‚Šã¾ã™ã€‚
5 </text>
6 <text name="want_apply_text">
7 ã“れらã®å¤‰æ›´ã‚’é©ç”¨ã—ã¾ã™ã‹ï¼Ÿ
8 </text>
9 <button label="应用" label_selected="应用" name="btn_apply" />
10 <button label="å–消" label_selected="å–消" name="btn_cancel" />
11 <button label="OK" label_selected="OK" name="btn_ok" />
12 <button label="サーãƒã‹ã‚‰ãƒªãƒ•ãƒ¬ãƒƒã‚·ãƒ¥ã™ã‚‹"
13 label_selected="サーãƒã‹ã‚‰ãƒªãƒ•ãƒ¬ãƒƒã‚·ãƒ¥ã™ã‚‹" name="btn_refresh" />
14</panel>
diff --git a/linden/indra/newview/skins/xui/zh/panel_group_finder.xml b/linden/indra/newview/skins/xui/zh/panel_group_finder.xml
deleted file mode 100644
index f3b4f39..0000000
--- a/linden/indra/newview/skins/xui/zh/panel_group_finder.xml
+++ /dev/null
@@ -1,9 +0,0 @@
1<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
2<panel name="GroupInfoFinder" title="グループ情報ファインダー">
3 <text name="default_needs_apply_text">
4 ç¾åœ¨ã®ã‚¿ãƒ–ã«ãŠã‘る未é©ç”¨ã®å¤‰æ›´ãŒã‚ã‚Šã¾ã™ã€‚
5 </text>
6 <text name="want_apply_text">
7 ã“れらã®å¤‰æ›´ã‚’é©ç”¨ã—ã¾ã™ã‹ï¼Ÿ
8 </text>
9</panel>
diff --git a/linden/indra/newview/skins/xui/zh/panel_group_general.xml b/linden/indra/newview/skins/xui/zh/panel_group_general.xml
deleted file mode 100644
index bf641bc..0000000
--- a/linden/indra/newview/skins/xui/zh/panel_group_general.xml
+++ /dev/null
@@ -1,74 +0,0 @@
1<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
2<panel label="General" name="general_tab">
3 <text name="help_text">
4 『一般タブã€ã«ã¯ã€ã“ã®ã‚°ãƒ«ãƒ¼ãƒ—ã«é–¢ã™ã‚‹ä¸€èˆ¬æƒ…å ±ã€ã‚ªãƒ¼ãƒŠãƒ¼ã‚„å¯è¦–メンãƒãƒ¼ã®ãƒªã‚¹ãƒˆã€ä¸€èˆ¬çš„ãªã‚°ãƒ«ãƒ¼ãƒ—嗜好ã€ãŠã‚ˆã³ãƒ¡ãƒ³ãƒãƒ¼ã®ã‚ªãƒ—ションãŒå«ã¾ã‚Œã¾ã™ã€‚
5オプション上ã§ãƒžã‚¦ã‚¹ã‚’å‹•ã‹ã™ã¨ã€ã•ã‚‰ã«ãƒ˜ãƒ«ãƒ—ãŒå¾—られã¾ã™ã€‚
6 </text>
7 <button label="?" label_selected="?" name="help_button" />
8 <line_editor name="group_name_editor">
9 ã‚ãªãŸã®æ–°ã—ã„グループåを記入ã—ã¦ãã ã•ã„
10 </line_editor>
11 <text name="group_name">
12 ã‚ãªãŸã®æ–°ã—ã„グループåを記入ã—ã¦ãã ã•ã„
13 </text>
14 <text name="prepend_founded_by">
15 創設者
16 </text>
17 <text name="founder_name">
18 (待機中)
19 </text>
20 <text name="group_charter_label">
21 グループ特権
22 </text>
23 <texture_picker label="グループ記章" name="insignia"
24 tool_tip="クリックã—ã¦å†™çœŸã‚’é¸æŠžã—ã¦ãã ã•ã„。" />
25 <text_editor name="charter">
26 グループ特権
27 </text_editor>
28 <button label="å‚加ã™ã‚‹ï¼ˆL$0)" label_selected="å‚加ã™ã‚‹ï¼ˆL$0)"
29 name="join_button" />
30 <button label="詳細表示" label_selected="詳細表示" name="info_button" />
31 <text>
32 オーナーã¨å¯è¦–メンãƒãƒ¼
33 </text>
34 <text>
35 (オーナーã¯å¤ªå­—ã§è¡¨ç¤ºã•ã‚Œã¦ã„ã¾ã™ï¼‰
36 </text>
37 <name_list name="visible_members">
38 <column label="Member Name" name="name" />
39 <column label="Title" name="title" />
40 <column label="Last Login" name="online" />
41 </name_list>
42 <text name="incomplete_member_data_str">
43 メンãƒãƒ¼ãƒ‡ãƒ¼ã‚¿ã‚’検索
44 </text>
45 <text name="confirm_group_create_str">
46 ã“ã®ã‚°ãƒ«ãƒ¼ãƒ—ã‚’å½¢æˆã™ã‚‹ã«ã¯L$100ã‹ã‹ã‚Šã¾ã™ã€‚本当ã«ã€æœ¬å½“ã«ã€æœ¬å½“ã«L$100を費やã—ã¦ã€ã“ã®ã‚°ãƒ«ãƒ¼ãƒ—を作りã¾ã™ã‹ï¼Ÿ
47 </text>
48 <text>
49 グループ嗜好
50 </text>
51 <panel name="preferences_container">
52 <check_box label="在社团åå•ä¸­æ˜¾ç¤º" name="show_in_group_list"
53 tool_tip="Sets whether this group shows up in the Search Groups window and in member profiles." />
54 <check_box label="在网上公布" name="publish_on_web"
55 tool_tip="ã“ã®ã‚°ãƒ«ãƒ¼ãƒ—ã®æƒ…å ±ãŒã‚¦ã‚§ãƒ–上ã§å…¬é–‹ã•ã‚Œã‚‹ã‹ã©ã†ã‹ã®è¨­å®šã‚’ã—ã¾ã™ã€‚" />
56 <check_box label="公開登録" name="open_enrollement"
57 tool_tip="Sets whether this group allows new members to join without being invited." />
58 <check_box label="入会費:L$" name="check_enrollment_fee"
59 tool_tip="グループå‚加ã«å…¥ä¼šè²»ãŒå¿…è¦ã‹ã©ã†ã‹ã®è¨­å®šã‚’ã—ã¾ã™ã€‚" />
60 <spinner name="spin_enrollment_fee"
61 tool_tip="New members must pay this fee to join the group when Enrollment Fee is checked." />
62 <check_box label="æˆäºº" name="mature"
63 tool_tip="ã‚ãªãŸã®ã‚°ãƒ«ãƒ¼ãƒ—情報ãŒæˆäººå‘ã‘ã‹ã©ã†ã‹ã‚’設定ã—ã¾ã™ã€‚" />
64 <panel name="title_container">
65 <text name="active_title_label">
66 自分ã®ã‚¢ã‚¯ãƒ†ã‚£ãƒ–・タイトル
67 </text>
68 <combo_box name="active_title"
69 tool_tip="Sets the title that appears in your avatar&apos;s name tag when this group is active." />
70 </panel>
71 <check_box label="グループ通知をå—ä¿¡" name="receive_notices"
72 tool_tip="Sets whether you want to receive Notices from this group. Uncheck this box if this group is spamming you." />
73 </panel>
74</panel>
diff --git a/linden/indra/newview/skins/xui/zh/panel_group_invite.xml b/linden/indra/newview/skins/xui/zh/panel_group_invite.xml
deleted file mode 100644
index da9ea00..0000000
--- a/linden/indra/newview/skins/xui/zh/panel_group_invite.xml
+++ /dev/null
@@ -1,18 +0,0 @@
1<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
2<panel label="Invite a Member" name="invite_panel">
3 <text>
4 ã‚ãªãŸã®ã‚°ãƒ«ãƒ¼ãƒ—ã«ã€ä¸€åº¦ã«è¤‡æ•°ã®äººã‚’招待ã™ã‚‹ã“ã¨ãŒã§ãã¾ã™ã€‚『リストã‹ã‚‰äººã‚’é¸ã¶ã€ã‚’クリックã—ã¦ã€ä½œæ¥­ã‚’始ã‚ã¾ã™ã€‚
5 </text>
6 <button label="é¸è€ƒè€…を公開" name="add_button" tool_tip="" />
7 <name_list name="invitee_list"
8 tool_tip="Hold the Ctrl key and click resident names to multi-select." />
9 <button label="リストã‹ã‚‰é¸æŠžã•ã‚ŒãŸã‚‚ã®ã‚’除外" name="remove_button"
10 tool_tip="上記ã§é¸æŠžã•ã‚ŒãŸå±…ä½è€…を招待リストã‹ã‚‰å¤–ã—ã¾ã™ã€‚" />
11 <text>
12 割り当ã¦ã‚‹å½¹å‰²ã‚’é¸æŠžã—ã¦ãã ã•ã„:
13 </text>
14 <combo_box name="role_name"
15 tool_tip="Choose from the list of Roles you are allowed to assign members to." />
16 <button label="招待をé€ä¿¡" name="ok_button" />
17 <button label="å–消" name="cancel_button" />
18</panel>
diff --git a/linden/indra/newview/skins/xui/zh/panel_group_land_money.xml b/linden/indra/newview/skins/xui/zh/panel_group_land_money.xml
deleted file mode 100644
index b7be9d7..0000000
--- a/linden/indra/newview/skins/xui/zh/panel_group_land_money.xml
+++ /dev/null
@@ -1,82 +0,0 @@
1<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
2<panel label="Land &amp; L$" name="land_money_tab">
3 <text name="help_text">
4 グループãŒæ‰€æœ‰ã—ã¦ã„る土地ã¯ã€è³‡é‡‘æ´åŠ©è©³ç´°ã¨ã¨ã‚‚ã«ä¸€è¦§åŒ–ã•ã‚Œã¾ã™ã€‚土地利用ã®åˆè¨ˆãŒã€å…¨ä½“ã®è³‡é‡‘æ´åŠ©ã¨åŒç­‰ã¾ãŸã¯ä»¥ä¸‹ã«ãªã‚‹ã¨è­¦å‘ŠãŒç¾ã‚Œã¾ã™ã€‚プランニングã€è©³ç´°ã€è²©å£²ã‚¿ãƒ–ã¯ã€ã‚°ãƒ«ãƒ¼ãƒ—財政ã«é–¢ã™ã‚‹æƒ…報をæä¾›ã—ã¾ã™ã€‚
5 </text>
6 <button label="?" name="help_button" />
7 <text name="cant_view_group_land_text">
8 ã‚ãªãŸã«ã¯ã‚°ãƒ«ãƒ¼ãƒ—所有ã®åœŸåœ°ã‚’閲覧ã™ã‚‹æ¨©é™ãŒã‚ã‚Šã¾ã›ã‚“。
9 </text>
10 <text name="cant_view_group_accounting_text">
11 ã‚ãªãŸã«ã¯ã‚°ãƒ«ãƒ¼ãƒ—会計情報を閲覧ã™ã‚‹æ¨©é™ãŒã‚ã‚Šã¾ã›ã‚“。
12 </text>
13 <text name="group_land_heading">
14 社团所有土地
15 </text>
16 <scroll_list name="group_parcel_list">
17 <column label="Parcel Name" name="name" />
18 <column label="Region" name="location" />
19 <column label="Area" name="area" />
20 <column label="" name="hidden" />
21 </scroll_list>
22 <button label="在地图中显示" label_selected="在地图中显示"
23 name="map_button" />
24 <text name="total_contributed_land_label">
25 資金æä¾›åˆè¨ˆï¼š
26 </text>
27 <text name="total_contributed_land_value">
28 0 平方米
29 </text>
30 <text name="total_land_in_use_label">
31 使用中的全部土地:
32 </text>
33 <text name="total_land_in_use_value">
34 0 平方米
35 </text>
36 <text name="land_available_label">
37 å¯å”®åœŸåœ°:
38 </text>
39 <text name="land_available_value">
40 0 平方米
41 </text>
42 <text name="your_contribution_label">
43 ã‚ãªãŸã®è²¢çŒ®ï¼š
44 </text>
45 <text name="your_contribution_max_value_append">
46 平方メートル
47 </text>
48 <text name="your_contribution_max_value">
49 (待機中)
50 </text>
51 <text name="group_over_limit_text">
52 使用ã•ã‚Œã¦ã„る土地をサãƒãƒ¼ãƒˆã™ã‚‹ãŸã‚ã«ã€ã‚°ãƒ«ãƒ¼ãƒ—ã®ãƒ¡ãƒ³ãƒãƒ¼ã¯ã€ã•ã‚‰ãªã‚‹åœŸåœ°ã®ã‚¯ãƒ¬ã‚¸ãƒƒãƒˆã‚’貢献ã™ã‚‹å¿…è¦ãŒã‚ã‚Šã¾ã™ã€‚
53 </text>
54 <text name="group_money_heading">
55 グループL$
56 </text>
57 <tab_container name="group_money_tab_container">
58 <panel label="Planning" name="group_money_planning_tab">
59 <text_editor name="group_money_planning_text">
60 計算中…
61 </text_editor>
62 </panel>
63 <panel label="Details" name="group_money_details_tab">
64 <text_editor name="group_money_details_text">
65 計算中…
66 </text_editor>
67 <button label="&lt;较早" label_selected="&lt;较早" name="earlier_details_button"
68 tool_tip="時間を戻ã™" />
69 <button label="延迟 &gt;" label_selected="延迟 &gt;" name="later_details_button"
70 tool_tip="時間を進ã‚ã‚‹" />
71 </panel>
72 <panel label="Sales" name="group_money_sales_tab">
73 <text_editor name="group_money_sales_text">
74 計算中…
75 </text_editor>
76 <button label="&lt;较早" label_selected="&lt;较早" name="earlier_sales_button"
77 tool_tip="時間を戻ã™" />
78 <button label="延迟 &gt;" label_selected="延迟 &gt;" name="later_sales_button"
79 tool_tip="時間を進ã‚ã‚‹" />
80 </panel>
81 </tab_container>
82</panel>
diff --git a/linden/indra/newview/skins/xui/zh/panel_group_notices.xml b/linden/indra/newview/skins/xui/zh/panel_group_notices.xml
deleted file mode 100644
index 162423e..0000000
--- a/linden/indra/newview/skins/xui/zh/panel_group_notices.xml
+++ /dev/null
@@ -1,68 +0,0 @@
1<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
2<panel label="Notices" name="notices_tab">
3 <text name="help_text">
4 通知ã¯ã€ãƒ¡ãƒƒã‚»ãƒ¼ã‚¸ã‚„添付アイテムをé€ä¿¡ã—ã¦ã‚°ãƒ«ãƒ¼ãƒ—内ã®æ„æ€ä¼é”ã‚’æ—©ãè¡Œãˆã‚‹æ‰‹æ®µã§ã™ã€‚通知ã¯å—信アビリティãŒã‚る役割ã®ã‚°ãƒ«ãƒ¼ãƒ—メンãƒãƒ¼ã«ã®ã¿ç™ºä¿¡ã•ã‚Œã¾ã™ã€‚一般タブã§é€šçŸ¥ã‚’オフã«è¨­å®šã§ãã¾ã™ã€‚
5 </text>
6 <text name="no_notices_text">
7 éŽåŽ»ã®é€šçŸ¥ãŒã‚ã‚Šã¾ã›ã‚“。
8 </text>
9 <button label="?" label_selected="?" name="help_button" />
10 <text name="lbl">
11 グループ通知アーカイブ
12 </text>
13 <text name="lbl2">
14 通知ã¯30日間ä¿å­˜ã•ã‚Œã¾ã™ã€‚閲覧ã—ãŸã„通知をクリックã—ã¦ãã ã•ã„。
15『リストをリフレッシュã€ã®ãƒœã‚¿ãƒ³ã‚’クリックã—ã¦ã€æ–°ã—ã„通知をå—ä¿¡ã—ã¦ãã ã•ã„。
16 </text>
17 <scroll_list name="notice_list">
18 <column label="" name="icon" />
19 <column label="Subject" name="subject" />
20 <column label="From" name="from" />
21 <column label="Date" name="date" />
22 </scroll_list>
23 <text name="notice_list_none_found">
24 何も見ã¤ã‹ã‚Šã¾ã›ã‚“ã§ã—ãŸ
25 </text>
26 <button label="æ–°ã—ã„通知を作æˆ" label_selected="æ–°ã—ã„通知を作æˆ"
27 name="create_new_notice" />
28 <button label="æ›´æ–°åå•" label_selected="æ›´æ–°åå•" name="refresh_notices" />
29 <panel label="æ–°ã—ã„通知を作æˆ" name="panel_create_new_notice">
30 <text name="lbl">
31 通知を作æˆ
32 </text>
33 <text name="lbl2">
34 通知をé€ä¿¡ã™ã‚‹ã«ã¯ã€é¡Œåを入力ã—ã¦ãã ã•ã„。
35ã‚ãªãŸã®æŒã¡ç‰©ã‹ã‚‰ãƒ‘ãƒãƒ«ã«ãƒ‰ãƒ©ãƒƒã‚°ã™ã‚‹ã“ã¨ã«ã‚ˆã‚Šã€ã“ã®é€šçŸ¥ã«ã‚¢ã‚¤ãƒ†ãƒ ã‚’一ã¤ä»˜åŠ ã™ã‚‹ã“ã¨ãŒã§ãã¾ã™ã€‚添付ã•ã‚ŒãŸã‚¢ã‚¤ãƒ†ãƒ ã¯ã€ã‚³ãƒ”ーãŠã‚ˆã³è­²æ¸¡å¯èƒ½ã§ãªã‘ã‚Œã°ãªã‚Šã¾ã›ã‚“。ã¾ãŸã€ãƒ•ã‚©ãƒ«ãƒ€ãƒ¼ã‚’é€ä¿¡ã™ã‚‹ã“ã¨ã¯ã§ãã¾ã›ã‚“。
36 </text>
37 <text name="lbl3">
38 主题:
39 </text>
40 <text name="lbl4">
41 ä¿¡æ¯:
42 </text>
43 <text name="lbl5">
44 添付:
45 </text>
46 <button label="添付物ã®å‰Šé™¤" label_selected="添付物ã®å‰Šé™¤"
47 name="remove_attachment" />
48 <button label="通知をé€ä¿¡" label_selected="通知をé€ä¿¡" name="send_notice" />
49 <panel name="drop_target2"
50 tool_tip="Drag an inventory item onto the message box to send it with the notice. You must have permission to copy and transfer the object to send it with the notice." />
51 </panel>
52 <panel label="View Past Notice" name="panel_view_past_notice">
53 <text name="lbl">
54 アーカイブ通知
55 </text>
56 <text name="lbl2">
57 æ–°ã—ã„通知をé€ä¿¡ã™ã‚‹ã«ã¯ã€ä¸Šã®ã€Žæ–°ã—ã„通知を作æˆã€ãƒœã‚¿ãƒ³ã‚’クリックã—ã¾ã™ã€‚
58 </text>
59 <text name="lbl3">
60 主题:
61 </text>
62 <text name="lbl4">
63 ä¿¡æ¯:
64 </text>
65 <button label="添付物を開ã" label_selected="添付物を開ã"
66 name="open_attachment" />
67 </panel>
68</panel>
diff --git a/linden/indra/newview/skins/xui/zh/panel_group_roles.xml b/linden/indra/newview/skins/xui/zh/panel_group_roles.xml
deleted file mode 100644
index 1983222..0000000
--- a/linden/indra/newview/skins/xui/zh/panel_group_roles.xml
+++ /dev/null
@@ -1,153 +0,0 @@
1<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
2<panel label="メンãƒãƒ¼ã¨å½¹å‰²" name="roles_tab">
3 <text name="default_needs_apply_text">
4 ç¾åœ¨ã®ã‚µãƒ–・タブã«ãŠã‘る未é©ç”¨ã®å¤‰æ›´ãŒã‚ã‚Šã¾ã™ã€‚
5 </text>
6 <text name="want_apply_text">
7 ã“れらã®å¤‰æ›´ã‚’é©ç”¨ã—ã¾ã™ã‹ï¼Ÿ
8 </text>
9 <text name="cant_delete_role">
10 『全員ã€ã¨ã€Žã‚ªãƒ¼ãƒŠãƒ¼ã€ã®å½¹å‰²ã¯ã€ç‰¹åˆ¥ãªãŸã‚削除ã™ã‚‹ã“ã¨ãŒã§ãã¾ã›ã‚“。
11 </text>
12 <button label="?" name="help_button" />
13 <panel name="members_header">
14 <text name="static">
15 メンãƒãƒ¼ã¨å½¹å‰²
16 </text>
17 <text name="static2">
18 グループメンãƒãƒ¼ã¯ã€ã‚¢ãƒ“リティã¨ã¨ã‚‚ã«å½¹å‰²ãŒå‰²ã‚Šå½“ã¦ã‚‰ã‚Œã¾ã™ã€‚ã“れらã®è¨­å®šã¯ã€ã•ã‚‰ã«å¤§ããªçµ„ç¹”ã®ãŸã‚ã«æŸ”軟性をもãŸã›ã€ç°¡å˜ã«ã‚«ã‚¹ã‚¿ãƒžã‚¤ã‚ºã™ã‚‹ã“ã¨ã‚‚ã§ãã¾ã™ã€‚
19 </text>
20 </panel>
21 <panel name="roles_header">
22 <text name="static">
23 役割
24 </text>
25 <text name="role_properties_modifiable">
26 下記ã®å½¹å‰²ã‚’é¸æŠžã—ã¦ãã ã•ã„。åå‰ã€èª¬æ˜Žã€ãƒ¡ãƒ³ãƒãƒ¼ã®ã‚¿ã‚¤ãƒˆãƒ«ã‚’修正ã™ã‚‹ã“ã¨ãŒã§ãã¾ã™ã€‚
27 </text>
28 <text name="role_properties_not_modifiable">
29 ä¸å‹•ç”£ã€ãƒ¡ãƒ³ãƒãƒ¼ã€ãŠã‚ˆã³è¨±å¯ã•ã‚ŒãŸã‚¢ãƒ“リティを見るã«ã¯ã€ä¸‹è¨˜ã®å½¹å‰²ã‚’é¸æŠžã—ã¦ãã ã•ã„
30 </text>
31 <text name="role_actions_modifiable">
32 役割ã«ã‚¢ãƒ“リティを割り当ã¦ã‚‹ã“ã¨ã‚‚ã§ãã¾ã™ã€‚
33 </text>
34 <text name="role_actions_not_modifiable">
35 割り当ã¦ã‚‰ã‚ŒãŸã‚¢ãƒ“リティã®é–²è¦§ã¯å¯èƒ½ã§ã™ãŒã€ä¿®æ­£ã¯ã§ãã¾ã›ã‚“。
36 </text>
37 </panel>
38 <panel name="actions_header">
39 <text name="static">
40 アビリティ
41 </text>
42 <text name="static2">
43 アビリティã®èª¬æ˜Žã€ã¾ãŸã€ã©ã®å½¹å‰²ãŠã‚ˆã³ãƒ¡ãƒ³ãƒãƒ¼ãŒãã®ã‚¢ãƒ“リティを実行ã§ãã‚‹ã‹ã‚’閲覧ã™ã‚‹ã“ã¨ãŒã§ãã¾ã™ã€‚
44 </text>
45 </panel>
46 <tab_container name="roles_tab_container">
47 <panel label="Members" name="members_sub_tab" tool_tip="Members">
48 <button label="æœç´¢" name="search_button" />
49 <button label="å…¨ã¦ã‚’表示" name="show_all_button" />
50 <name_list name="member_list">
51 <column label="Member Name" name="name" />
52 <column label="Donated Tier" name="donated" />
53 <column label="Last Login" name="online" />
54 </name_list>
55 <button label="æ–°ã—ã„人を招待" name="member_invite" />
56 <button label="グループã‹ã‚‰è¿½æ”¾" name="member_eject" />
57 <text name="help_text">
58 コントロールキーを押ã—ãŸã¾ã¾åå‰ã‚’クリックã™ã‚‹ã“ã¨ã«ã‚ˆã‚Šã€ãƒ¡ãƒ³ãƒãƒ¼ã«å‰²ã‚Šå½“ã¦ãŸå½¹å‰²ã‚’追加ã—ãŸã‚Šã€å¤–ã—ãŸã‚Šã€ã¾ãŸã¯ã€è¤‡æ•°ã®ãƒ¡ãƒ³ãƒãƒ¼ã‚’é¸æŠžã™ã‚‹ã“ã¨ãŒã§ãã¾ã™ã€‚
59 </text>
60 </panel>
61 <panel label="役割" name="roles_sub_tab">
62 <button label="æœç´¢" name="search_button" />
63 <button label="å…¨ã¦ã‚’表示" name="show_all_button" />
64 <scroll_list name="role_list">
65 <column label="Role Name" name="name" />
66 <column label="Title" name="title" />
67 <column label="Members" name="members" />
68 </scroll_list>
69 <button label="æ–°ã—ã„役割ã®ä½œæˆ" name="role_create" />
70 <button label="役割を削除" name="role_delete" />
71 <text name="help_text">
72 役割ã«ã¯ã€ã‚¿ã‚¤ãƒˆãƒ«ã¨è¡Œä½¿ã§ãるアビリティã®ãƒªã‚¹ãƒˆãŒã‚ã‚Šã¾ã™ã€‚メンãƒãƒ¼ã¯ã€ä¸€ã¤ä»¥ä¸Šã®å½¹å‰²ã«å±žã™ã‚‹ã“ã¨ãŒã§ãã¾ã™ã€‚一ã¤ã®ã‚°ãƒ«ãƒ¼ãƒ—ã¯ã€ã€Žå…¨å“¡ã€ã¨ã€Žã‚ªãƒ¼ãƒŠãƒ¼ã€ã®å½¹å‰²ã‚’å«ã‚“ã 10ã®å½¹å‰²ã‚’æŒã¤ã“ã¨ãŒã§ãã¾ã™ã€‚
73 </text>
74 </panel>
75 <panel label="アビリティ" name="actions_sub_tab">
76 <button label="æœç´¢" name="search_button" />
77 <button label="å…¨ã¦ã‚’表示" name="show_all_button" />
78 <scroll_list name="action_list" tool_tip="Select an Ability to view more details.">
79 <column label="" name="icon" />
80 <column label="" name="action" />
81 </scroll_list>
82 <text name="help_text">
83 アビリティã¯ã€ã‚°ãƒ«ãƒ¼ãƒ—内ã§å½¹å‰²ã®ã‚るメンãƒãƒ¼ã®ã€ç‰¹å®šã®æ“作をå¯èƒ½ã«ã—ã¾ã™ã€‚幅広ã„ãƒãƒ©ã‚¨ãƒ†ã‚£ã®ã‚¢ãƒ“リティãŒç”¨æ„ã•ã‚Œã¦ã„ã¾ã™ã€‚
84 </text>
85 </panel>
86 </tab_container>
87 <panel name="members_footer">
88 <text name="static">
89 割り当ã¦ã‚‰ã‚ŒãŸå½¹å‰²
90 </text>
91 <text name="static2">
92 許å¯ã•ã‚ŒãŸã‚¢ãƒ“リティ
93 </text>
94 <scroll_list name="member_assigned_roles">
95 <column label="" name="checkbox" />
96 <column label="" name="role" />
97 </scroll_list>
98 <scroll_list name="member_allowed_actions"
99 tool_tip="For Details of each Allowed Ability see the Abilities tab.">
100 <column label="" name="icon" />
101 <column label="" name="action" />
102 </scroll_list>
103 </panel>
104 <panel name="roles_footer">
105 <text name="static">
106 å称
107 </text>
108 <text name="static2">
109 説明:
110 </text>
111 <line_editor name="role_name">
112 従業員
113 </line_editor>
114 <text name="static3">
115 タイトル
116 </text>
117 <line_editor name="role_title">
118 (待機中)
119 </line_editor>
120 <text_editor name="role_description">
121 (待機中)
122 </text_editor>
123 <text name="static4">
124 任命ã•ã‚ŒãŸãƒ¡ãƒ³ãƒãƒ¼
125 </text>
126 <text name="static5"
127 tool_tip="ç¾åœ¨é¸æŠžã•ã‚Œã¦ã„る役割ãŒé‚è¡Œã™ã‚‹å¯èƒ½ãªã‚¢ãƒ“リティã®ãƒªã‚¹ãƒˆ">
128 許å¯ã•ã‚ŒãŸã‚¢ãƒ“リティ
129 </text>
130 <check_box label="メンãƒãƒ¼ãŒå¯è¦–状態" name="role_visible_in_list"
131 tool_tip="Sets whether members of this role are visible in the General tab to people outside of the group." />
132 <scroll_list name="role_allowed_actions"
133 tool_tip="For Details of each Allowed Ability see the Abilities tab.">
134 <column label="" name="icon" />
135 <column label="" name="checkbox" />
136 <column label="" name="action" />
137 </scroll_list>
138 </panel>
139 <panel name="actions_footer">
140 <text name="static">
141 説明:
142 </text>
143 <text_editor name="action_description">
144 ã“ã‚Œã¯ã€Žã‚°ãƒ«ãƒ¼ãƒ—ã‹ã‚‰ãƒ¡ãƒ³ãƒãƒ¼ã‚’追放ã€ã®ã‚¢ãƒ“リティã§ã™ã€‚オーナーã®ã¿ã€ä»–ã®ã‚ªãƒ¼ãƒŠãƒ¼ã‚’追放ã§ãã¾ã™ã€‚
145 </text_editor>
146 <text name="static2">
147 アビリティを伴ã†å½¹å‰²
148 </text>
149 <text name="static3">
150 アビリティã®ã‚るメンãƒãƒ¼
151 </text>
152 </panel>
153</panel>
diff --git a/linden/indra/newview/skins/xui/zh/panel_group_voting.xml b/linden/indra/newview/skins/xui/zh/panel_group_voting.xml
deleted file mode 100644
index 9257302..0000000
--- a/linden/indra/newview/skins/xui/zh/panel_group_voting.xml
+++ /dev/null
@@ -1,79 +0,0 @@
1<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
2<panel label="Proposals" name="voting_tab">
3 <text name="help_text">
4 グループæ案ã¯ã€ã‚°ãƒ«ãƒ¼ãƒ—ãŒä½•ã‚’ã—ãŸã„ã®ã‹ã€ã©ã†æ€ã†ã‹ãªã©ã®æ„識調査ã®ãŸã‚ã«ä½¿ç”¨ã™ã‚‹ã“ã¨ãŒã§ãã¾ã™ã€‚ã‚ãªãŸã«é©åˆ‡ãªæ¨©é™ãŒã‚ã‚Œã°ã€æ案を作æˆã—ãŸã‚Šã€æœ‰åŠ¹ãªæ案ã«å¯¾ã—投票ã—ãŸã‚Šã€å¤ã„æ案を閲覧ã—ãŸã‚Šã™ã‚‹ã“ã¨ãŒã§ãã¾ã™ã€‚
5 </text>
6 <button label="?" name="help_button" />
7 <text name="proposal_header">
8 グループæ案を開ã
9 </text>
10 <text name="proposals_header_view_txt">
11 グループæ案を開ã
12 </text>
13 <text name="proposals_header_create_txt">
14 创造æè®®
15 </text>
16 <text name="proposals_header_vote_txt">
17 æ案投票
18 </text>
19 <text name="empty_proposal_txt">
20 ã‚ãªãŸãŒä½œæˆã—よã†ã¨ã—ã¦ã„ã‚‹æ案ã¯ç©ºç™½ã§ã™ã€‚作æˆå‰ã«æ案を記入ã—ã¦ãã ã•ã„。
21 </text>
22 <text name="proposal_instructions">
23 投票ã—ãŸã„æ案をダブルクリックã—ã¾ã™ã€‚æ–°ã—ã„æ案を作æˆã™ã‚‹ã«ã¯ä½œæˆãƒœã‚¿ãƒ³ã‚’押ã—ã¾ã™ã€‚
24 </text>
25 <text name="proposal_lbl">
26 建议:
27 </text>
28 <button label="创造æè®®" label_selected="创造æè®®" name="btn_proposal" />
29 <button label="æ案ã®é–²è¦§" label_selected="æ案ã®é–²è¦§"
30 name="btn_view_proposal_item" />
31 <button label="查看åå•" label_selected="查看åå•"
32 name="btn_view_proposal_list" />
33 <text name="quorum_lbl">
34 法定人数:
35 </text>
36 <spinner name="quorum"
37 tool_tip="é¸æŒ™çµæžœå–ã‚Šã¾ã¨ã‚ã«å¿…è¦ãªå…¨æŠ•ç¥¨è€…メンãƒãƒ¼æ•°#" />
38 <text name="quorum_text">
39 Xã®ç·ã‚°ãƒ«ãƒ¼ãƒ—メンãƒãƒ¼ã®å†…
40 </text>
41 <text name="duration_lbl">
42 æŒç»­æ—¶é—´:
43 </text>
44 <spinner name="duration" tool_tip="残りã®é¸æŒ™æ—¥æ•°#" />
45 <text name="duration_text">
46 天
47 </text>
48 <radio_group name="majority" tool_tip="Majority of total votes needed to win.">
49 简å•å¤šæ•°
50 2/3 多数
51 全票通过
52 </radio_group>
53 <text name="start_lbl">
54 选举开始:
55 </text>
56 <text name="end_lbl">
57 é€‰ä¸¾ç»“æŸ :
58 </text>
59 <button label="æ案ã®æ出" label_selected="æ案ã®æ出" name="btn_submit" />
60 <button label="å–消" label_selected="å–消" name="btn_cancel" />
61 <button label="是" label_selected="是" name="btn_yes" />
62 <button label="å¦" label_selected="å¦" name="btn_no" />
63 <button label="放弃" label_selected="放弃" name="btn_abstain" />
64 <text name="txt">
65 社团选举å²
66 </text>
67 <text name="instructions">
68 çµæžœã‚’閲覧ã™ã‚‹ã«ã¯ã€éŽåŽ»ã®æŠ•ç¥¨ã‚„ç¾åœ¨ã®ä¸€ã¤ã‚’é¸æŠžã—ã€ãƒ€ãƒ–ルクリックã—ã¦ã‚¢ã‚¤ãƒ†ãƒ ã‚’閲覧を開ãã¾ã™ã€‚
69 </text>
70 <text name="history_list_lbl">
71 éŽåŽ»ã®æŠ•ç¥¨ 投票終了
72 </text>
73 <button label="查看物å“æ " label_selected="查看物å“æ "
74 name="btn_view_history_item" />
75 <text name="vote_text_lbl">
76 选举结果:
77 </text>
78 <button label="查看åå•" label_selected="查看åå•" name="btn_view_history_list" />
79</panel>
diff --git a/linden/indra/newview/skins/xui/zh/panel_land_covenant.xml b/linden/indra/newview/skins/xui/zh/panel_land_covenant.xml
deleted file mode 100644
index 1b8f4a2..0000000
--- a/linden/indra/newview/skins/xui/zh/panel_land_covenant.xml
+++ /dev/null
@@ -1,39 +0,0 @@
1<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
2<panel name="Covenant" title="特権">
3 <text name="region_name_lbl">
4 区域:
5 </text>
6 <text name="region_name_text">
7 (未知)
8 </text>
9 <text name="estate_name_lbl">
10 ç§äººé¢†åœ°:
11 </text>
12 <text name="estate_name_text">
13 (未知)
14 </text>
15 <text name="estate_owner_lbl">
16 ä¸å‹•ç”£ã‚ªãƒ¼ãƒŠãƒ¼ï¼š
17 </text>
18 <text name="estate_owner_text">
19 (未知)
20 </text>
21 <text name="resellable_clause">
22 ã“ã®åœ°åŸŸã§è³¼å…¥ã—ãŸåœŸåœ°ã¯ã€å†è²©ã§ãã‚‹ã‹ã©ã†ã‹ã‚ã‹ã‚Šã¾ã›ã‚“。
23 </text>
24 <text name="changeable_clause">
25 ã“ã®åœ°åŸŸã§è³¼å…¥ã—ãŸåœŸåœ°ã¯ã€çµ±åˆï¼å†åˆ†å‰²ãŒã§ãã‚‹ã‹ã©ã†ã‹ã‚ã‹ã‚Šã¾ã›ã‚“。
26 </text>
27 <text name="can_resell">
28 ã“ã®åœ°åŸŸã§è³¼å…¥ã—ãŸåœŸåœ°ã¯ã€å†è²©ãŒã§ãã¾ã™ã€‚
29 </text>
30 <text name="can_not_resell">
31 ã“ã®åœ°åŸŸã§è³¼å…¥ã—ãŸåœŸåœ°ã¯ã€å†è²©ãŒã§ããªã„å¯èƒ½æ€§ãŒã‚ã‚Šã¾ã™ã€‚
32 </text>
33 <text name="can_change">
34 ã“ã®åœ°åŸŸã§è³¼å…¥ã—ãŸåœŸåœ°ã¯ã€çµ±åˆã€ã¾ãŸã¯å†åˆ†å‰²ãŒã§ãã¾ã™ã€‚
35 </text>
36 <text name="can_not_change">
37 ã“ã®åœ°åŸŸã§è³¼å…¥ã—ãŸåœŸåœ°ã¯ã€çµ±åˆã€ã¾ãŸã¯å†åˆ†å‰²ãŒã§ããªã„å¯èƒ½æ€§ãŒã‚ã‚Šã¾ã™ã€‚
38 </text>
39</panel>
diff --git a/linden/indra/newview/skins/xui/zh/panel_preferences_audio.xml b/linden/indra/newview/skins/xui/zh/panel_preferences_audio.xml
deleted file mode 100644
index b3a2c69..0000000
--- a/linden/indra/newview/skins/xui/zh/panel_preferences_audio.xml
+++ /dev/null
@@ -1,59 +0,0 @@
1<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
2<panel label="Audio &amp; Video" name="Media panel">
3 <text type="string" length="1" name="muting_text">
4 ミューティング:
5 </text>
6 <check_box label="オーディオをミュート" name="disable audio" />
7 <check_box
8 label="ウインドウãŒæœ€å°åŒ–ã•ã‚ŒãŸæ™‚ã«ã‚ªãƒ¼ãƒ‡ã‚¤ã‚ªã‚’ミュート"
9 name="mute_when_minimized" />
10 <text type="string" length="1" name="streaming_text">
11 ストリーミング:
12 </text>
13 <check_box
14 label="ストリーミング・ミュージックãŒæœ‰åŠ¹ãªå ´åˆã¯å†ç”Ÿã€‚ (ã•ã‚‰ãªã‚‹ãƒãƒ³ãƒ‰å¹…を使用)"
15 name="streaming_music" />
16 <check_box
17 label="ストリーミングビデオãŒæœ‰åŠ¹ãªå ´åˆã‚’å†ç”Ÿã€‚ (ã•ã‚‰ãªã‚‹ãƒãƒ³ãƒ‰å¹…を使用)"
18 name="streaming_video" />
19 <text type="string" length="1" name="system_volume_text">
20 サウンドエフェクト:
21 </text>
22 <text type="string" length="1" name="wind_volume_text">
23 風é‡ï¼š
24 </text>
25 <text type="string" length="1" name="footsteps_volume_text">
26 æ­©å¹…é‡ï¼š
27 </text>
28 <text type="string" length="1" name="ui_volume_text">
29 UIé‡ï¼š
30 </text>
31 <spinner label="L$変更基準点" name="L$ Change Threshold" />
32 <spinner label="å¥åº·å¤‰åŒ–基準点" name="Health Change Threshold" />
33 <text type="string" length="1" name="doppler_effect_text">
34 ドップラー効果:
35 </text>
36 <text type="string" length="1" name="distance_factor_text">
37 é éš”è¦å› ï¼š
38 </text>
39 <text type="string" length="1" name="rolloff_factor_text">
40 脱線è¦å› ï¼š
41 </text>
42 <text type="string" length="1" name="default_upload_bitrate_text">
43 Bitrateをデフォルトアップロード:
44 </text>
45 <radio_group name="bitrate">
46 <radio_item type="string" length="1" name="32kbps">
47 32 kbps
48 </radio_item>
49 <radio_item type="string" length="1" name="64kbps">
50 64 kbps
51 </radio_item>
52 <radio_item type="string" length="1" name="96kbps">
53 96 kbps
54 </radio_item>
55 <radio_item type="string" length="1" name="128kbps">
56 128 kbps
57 </radio_item>
58 </radio_group>
59</panel>
diff --git a/linden/indra/newview/skins/xui/zh/panel_preferences_chat.xml b/linden/indra/newview/skins/xui/zh/panel_preferences_chat.xml
deleted file mode 100644
index b3769e9..0000000
--- a/linden/indra/newview/skins/xui/zh/panel_preferences_chat.xml
+++ /dev/null
@@ -1,54 +0,0 @@
1<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
2<panel label="èŠå¤©" name="chat">
3 <text type="string" length="1" name="text_box">
4 èŠå¤©å­—体大å°:
5 </text>
6 <radio_group name="chat font size">
7 <radio_item type="string" length="1" name="radio">
8 å°
9 </radio_item>
10 <radio_item type="string" length="1" name="radio2">
11 中間
12 </radio_item>
13 <radio_item type="string" length="1" name="radio3">
14 大
15 </radio_item>
16 </radio_group>
17 <text type="string" length="1" name="text_box2">
18 èŠå¤©é¢œè‰²:
19 </text>
20 <color_swatch label="系统" name="system" />
21 <color_swatch label="用户" name="users" />
22 <color_swatch label="东东" name="objects" />
23 <color_swatch label="泡沫" name="background" />
24 <color_swatch label="URLs" name="links" />
25 <text type="string" length="1" name="text_box3">
26 èŠå¤©æŽ§åˆ¶å°:
27 </text>
28 <spinner label="èŠå¤©ç»“æŸåŽæ·¡å‡º" name="fade_chat_time" />
29 <text type="string" length="1" name="text_box4">
30 (秒)
31 </text>
32 <text type="string" length="1" name="text_box5">
33 (#行)
34 </text>
35 <slider label="ä¸é€æ˜Ž" name="console_opacity" />
36 <text type="string" length="1" name="text_box6">
37 èŠå¤©é€‰é¡¹:
38 </text>
39 <check_box label="用全å±å®½åº¦èŠå¤© (需é‡å¯)" name="chat_full_width_check" />
40 <check_box label="点击返回åŽå…³é—­èŠå¤©çª—å£" name="close_chat_on_return_check" />
41 <check_box label="ï¼›èŠå¤©æ—¶å¯ç”¨ç®­å¤´é”®ç§»åŠ¨ä½ çš„化身"
42 name="arrow_keys_move_avatar_check" />
43 <check_box label="在èŠå¤©æ—¶æ˜¾ç¤ºæ—¶é—´" name="show_timestamps_check" />
44 <text type="string" length="1" name="text_box7">
45 泡泡èŠ:
46 </text>
47 <check_box label="显示èŠå¤©çª—å£" name="bubble_text_chat" />
48 <slider label="ä¸é€æ˜Ž" name="bubble_chat_opacity" />
49 <text type="string" length="1" name="text_box8">
50 脚本出错:
51 </text>
52 <check_box label="以èŠå¤©å½¢å¼æ˜¾ç¤ºè„šæœ¬é”™è¯¯å’Œè­¦å‘Š" name="script_errors_as_chat" />
53 <color_swatch label="颜色" name="script_error" />
54</panel>
diff --git a/linden/indra/newview/skins/xui/zh/panel_preferences_im.xml b/linden/indra/newview/skins/xui/zh/panel_preferences_im.xml
deleted file mode 100644
index be70f53..0000000
--- a/linden/indra/newview/skins/xui/zh/panel_preferences_im.xml
+++ /dev/null
@@ -1,19 +0,0 @@
1<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
2<panel label="å³æ—¶é€š" name="im">
3 <text type="string" length="1" name="text_box">
4 å³æ—¶é€šé€‰é¡¹:
5 </text>
6 <text name="log_in_to_change">
7 変更ã™ã‚‹ã®ã«ãƒ­ã‚°ã‚¤ãƒ³ã™ã‚‹
8 </text>
9 <check_box label="IMã‚’é›»å­ãƒ¡ãƒ¼ãƒ«ã«é€ä¿¡ï¼ˆ[EMAIL])" name="send_im_to_email" />
10 <check_box label="èŠå¤©è®°å½•ä¸­åŒ…å«å³æ—¶é€šä¿¡æ¯" name="include_im_in_chat_history" />
11 <check_box label="在å³æ—¶æ¶ˆæ¯ä¸­æ˜¾ç¤ºæ—¶é—´" name="show_timestamps_check" />
12 <check_box label="Log Instant Messages" name="log_instant_messages" />
13 <check_box label="Log Chat" name="log_chat" />
14 <check_box label="Show end of last IM conversation" name="log_show_history" />
15 <button label="Change Path" label_selected="Change Path" name="log_path_button" />
16 <text type="string" length="1" name="text_box2">
17 忙碌模å¼çš„自动回å¤:
18 </text>
19</panel>
diff --git a/linden/indra/newview/skins/xui/zh/panel_preferences_popups.xml b/linden/indra/newview/skins/xui/zh/panel_preferences_popups.xml
deleted file mode 100644
index a1cf51c..0000000
--- a/linden/indra/newview/skins/xui/zh/panel_preferences_popups.xml
+++ /dev/null
@@ -1,14 +0,0 @@
1<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
2<panel label="弹出程åº" name="popups">
3 <text type="string" length="1" name="text_box">
4 ä¸æ˜¾ç¤ºå¼¹å‡ºç¨‹åº:
5 </text>
6 <button label="Enable this popup" label_selected="Enable this popup"
7 name="enable_popup" />
8 <text type="string" length="1" name="text_box2">
9 显示弹出程åº:
10 </text>
11 <button label="é‡ç½® &apos;下次显示&apos;对è¯..."
12 label_selected="é‡ç½® &apos;下次显示&apos;对è¯..."
13 name="reset_dialogs_btn" />
14</panel>
diff --git a/linden/indra/newview/skins/xui/zh/panel_region_covenant.xml b/linden/indra/newview/skins/xui/zh/panel_region_covenant.xml
deleted file mode 100644
index b16f694..0000000
--- a/linden/indra/newview/skins/xui/zh/panel_region_covenant.xml
+++ /dev/null
@@ -1,50 +0,0 @@
1<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
2<panel label="特権" name="Covenant">
3 <text name="covenant_help_text">
4 ä¸å‹•ç”£ã®å…¨ã¦ã®åŒºç”»ã«ãŠã„ã¦ç´„款情報ã«å¯¾ã™ã‚‹å¤‰æ›´ã¯è¡¨ç¤ºã•ã‚Œã¾ã™
5 </text>
6 <text name="region_name_lbl">
7 区域:
8 </text>
9 <text name="region_name_text">
10 (未知)
11 </text>
12 <text name="estate_name_lbl">
13 ç§äººé¢†åœ°:
14 </text>
15 <text name="estate_name_text">
16 (未知)
17 </text>
18 <text name="covenent_instructions">
19 ä¸å‹•ç”£ç´„款を変更ã™ã‚‹ã«ã¯ã€ãƒŽãƒ¼ãƒˆã‚«ãƒ¼ãƒ‰ã‚’ドラッグã—ドロップã—ã¦ãã ã•ã„。
20 </text>
21 <button label="?" name="covenant_help" />
22 <button label="リセット" name="reset_covenant" />
23 <text name="estate_owner_lbl">
24 ä¸å‹•ç”£ã‚ªãƒ¼ãƒŠãƒ¼ï¼š
25 </text>
26 <text name="estate_owner_text">
27 (未知)
28 </text>
29 <text name="resellable_clause">
30 ã“ã®åœ°åŸŸã§è³¼å…¥ã—ãŸåœŸåœ°ã¯ã€å†è²©ã§ãã‚‹ã‹ã©ã†ã‹ã‚ã‹ã‚Šã¾ã›ã‚“。
31 </text>
32 <text name="changeable_clause">
33 ã“ã®åœ°åŸŸã§è³¼å…¥ã—ãŸåœŸåœ°ã¯ã€çµ±åˆï¼å†åˆ†å‰²ãŒã§ãã‚‹ã‹ã©ã†ã‹ã‚ã‹ã‚Šã¾ã›ã‚“。
34 </text>
35 <text_editor name="covenant_editor">
36 请等待...
37 </text_editor>
38 <text name="can_resell">
39 ã“ã®åœ°åŸŸã§è³¼å…¥ã—ãŸåœŸåœ°ã¯ã€å†è²©ãŒã§ãã¾ã™ã€‚
40 </text>
41 <text name="can_not_resell">
42 ã“ã®åœ°åŸŸã§è³¼å…¥ã—ãŸåœŸåœ°ã¯ã€å†è²©ãŒã§ããªã„å¯èƒ½æ€§ãŒã‚ã‚Šã¾ã™ã€‚
43 </text>
44 <text name="can_change">
45 ã“ã®åœ°åŸŸã§è³¼å…¥ã—ãŸåœŸåœ°ã¯ã€çµ±åˆã€ã¾ãŸã¯å†åˆ†å‰²ãŒã§ãã¾ã™ã€‚
46 </text>
47 <text name="can_not_change">
48 ã“ã®åœ°åŸŸã§è³¼å…¥ã—ãŸåœŸåœ°ã¯ã€çµ±åˆã€ã¾ãŸã¯å†åˆ†å‰²ãŒã§ããªã„å¯èƒ½æ€§ãŒã‚ã‚Šã¾ã™ã€‚
49 </text>
50</panel>
diff --git a/linden/indra/newview/skins/xui/zh/panel_scrolling_param.xml b/linden/indra/newview/skins/xui/zh/panel_scrolling_param.xml
deleted file mode 100644
index def7f56..0000000
--- a/linden/indra/newview/skins/xui/zh/panel_scrolling_param.xml
+++ /dev/null
@@ -1,12 +0,0 @@
1<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
2<panel name="LLScrollingPanelParam">
3 <text type="string" length="1" name="Loading...">
4 请等待...
5 </text>
6 <text type="string" length="1" name="Loading...2">
7 请等待...
8 </text>
9 <button label="" label_selected="" name="less" />
10 <button label="" label_selected="" name="more" />
11 <slider label="[DESC]" name="param slider" />
12</panel>
diff --git a/linden/indra/newview/skins/xui/zh/role_actions.xml b/linden/indra/newview/skins/xui/zh/role_actions.xml
deleted file mode 100644
index c5fe1b7..0000000
--- a/linden/indra/newview/skins/xui/zh/role_actions.xml
+++ /dev/null
@@ -1,187 +0,0 @@
1<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
2<role_actions>
3 <action_set
4 description="ã“れらã®ã‚¢ãƒ“リティã«ã¯ã€ã‚°ãƒ«ãƒ¼ãƒ—メンãƒãƒ¼ã®è¿½åŠ ã€æŽ’除ã€ãŠã‚ˆã³æ‹›å¾…ç„¡ã—ã§æ–°ãƒ¡ãƒ³ãƒãƒ¼ã‚’å‚加ã•ã›ã‚‹æ¨©é™ãŒå«ã¾ã‚Œã¾ã™ã€‚"
5 name="Membership">
6 <action description="グループã«äººã‚’招待"
7 longdescription="Invite People to this Group using the &apos;Invite New Person...&apos; button in the Members &amp; Roles tab &gt; Members sub-tab."
8 name="member invite" />
9 <action description="グループã‹ã‚‰ãƒ¡ãƒ³ãƒãƒ¼ã‚’追放"
10 longdescription="Eject Members from this Group using the &apos;Eject From Group&apos; button in the Members &amp; Roles tab &gt; Members sub-tab. An Owner can eject anyone except another Owner. If you&apos;re not an Owner, a Member can be ejected from a group if, and only if, they&apos;re only in the Everyone Role, and NO other Roles. To remove Members from Roles, you need to have the &apos;Remove Members from Roles&apos; Ability."
11 name="member eject" />
12 <action
13 description="『自由ã«å…¥ä¼šã€ã«åˆ‡ã‚Šæ›¿ãˆã€ã€Žå‚加費用ã€ã‚’変更"
14 longdescription="Toggle &apos;Open Enrollment&apos; to let new Members join without an invitation, and change &apos;Signup Fee&apos; in the Group Preferences section of the General tab."
15 name="member options" />
16 </action_set>
17 <action_set
18 description="ã“れらã®ã‚¢ãƒ“リティã«ã¯ã€ã‚°ãƒ«ãƒ¼ãƒ—役割を追加ã€æŽ’除ã€å¤‰æ›´ã€ãã—ã¦å½¹å‰²ã¸ã®ãƒ¡ãƒ³ãƒãƒ¼ã®è¿½åŠ ã€æŽ’除ã€æ›´ã«å½¹å‰²ã¸ã‚¢ãƒ“リティを割り当ã¦ã‚‹æ¨©é™ãŒå«ã¾ã‚Œã¾ã™ã€‚"
19 name="Roles">
20 <action description="æ–°ã—ã„役割を作æˆ"
21 longdescription="Create new Roles in the Members &amp; Roles tab &gt; Roles sub-tab."
22 name="role create" />
23 <action description="役割ã®å‰Šé™¤"
24 longdescription="Delete Roles in the Members &amp; Roles tab &gt; Roles sub-tab."
25 name="role delete" />
26 <action description="役割åã€ã‚¿ã‚¤ãƒˆãƒ«ã€èª¬æ˜Žã‚’変更"
27 longdescription="Change Role names, titles, and descriptions at the bottom of the the Members &amp; Roles tab &gt; Roles sub-tab after selecting a Role."
28 name="role properties" />
29 <action description="割り当ã¦äººã®å½¹å‰²ã«ãƒ¡ãƒ³ãƒãƒ¼ã‚’割り当ã¦ã‚‹"
30 longdescription="Assign Members to Roles in the Assigned Roles section of the Members &amp; Roles tab &gt; Members sub-tab. A member with this power can only add members to a role the assigner is already in."
31 name="role assign member limited" />
32 <action description="ã„ãšã‚Œã‹ã®å½¹å‰²ã«ãƒ¡ãƒ³ãƒãƒ¼ã‚’割り当ã¦ã‚‹"
33 longdescription="Assign Members to Any Role in the Assigned Roles section of the Members &amp; Roles tab &gt; Members sub-tab. *WARNING* Any Member in a Role with this Ability can assign themselves--and any other non-Owner Member--to Roles that have more powers than they currently have, potentially elevating themselves to near-Owner power. Be sure you know what you&apos;re doing before assigning this Ability."
34 name="role assign member" />
35 <action description="役割ã‹ã‚‰ãƒ¡ãƒ³ãƒãƒ¼ã‚’除外"
36 longdescription="Remove Members from Roles in the Assigned Roles section of the Members &amp; Roles tab &gt; Members sub-tab. Owners can&apos;t be removed."
37 name="role remove member" />
38 <action
39 description="役割ã«ãŠã‘るアビリティã®å‰²ã‚Šå½“ã¦ã€æŽ’除を行ã†"
40 longdescription="Assign and Remove Abilities in Roles in the Allowed Abilities section of the Members &amp; Roles tab &gt; Roles sub-tab. *WARNING* Any Member in a Role with this Ability can assign themselves--and any other non-Owner Member--all Abilities, potentially elevating themselves to near-Owner power. Be sure you know what you&apos;re doing before assigning this Ability."
41 name="role change actions" />
42 </action_set>
43 <action_set
44 description="ã“れらã®ã‚¢ãƒ“リティã«ã¯ã€å…¬é–‹æ€§ã€ç‰¹æ¨©ã€è¨˜ç« ç­‰ã®æœ¬ã‚°ãƒ«ãƒ¼ãƒ—ã®ç‰¹å¾´ã‚’修正ã™ã‚‹æ¨©é™ãŒå«ã¾ã‚Œã¾ã™ã€‚"
45 name="Group Identity">
46 <action
47 description="特権ã€è¨˜ç« ã€ã€ŽWeb上ã§å…¬é–‹ã€ã€ãŠã‚ˆã³ã‚°ãƒ«ãƒ¼ãƒ—情報内ã§å¯è¦–ã®ãƒ¡ãƒ³ãƒãƒ¼ã‚’変更"
48 longdescription="Change Charter, Insignia, &apos;Publish on the Web&apos;, and which members are publicly visible in Group Information. This is done in the General tab."
49 name="group change identity" />
50 </action_set>
51 <action_set
52 description="ã“れらã®ã‚¢ãƒ“リティã«ã¯ã€ã“ã®ãƒ–ループã®æ‰€æœ‰ã™ã‚‹åœŸåœ°ã®è­²æ¸¡ã€ä¿®æ­£ã€è²©å£²ã™ã‚‹æ¨©é™ãŒå«ã¾ã‚Œã¾ã™ã€‚土地ã«é–¢ã™ã‚‹æƒ…å ±ã¯ã€åœ°é¢ã‚’å³ã‚¯ãƒªãƒƒã‚¯ã—ã€ã€ŽåœŸåœ°æƒ…å ±ã€ã‚’é¸æŠžã™ã‚‹ã‹ã€ãƒ¡ãƒ‹ãƒ¥ãƒ¼ãƒãƒ¼ã®ã€ŽåŒºç”»æƒ…å ±ã€ã‚’クリックã—ã¾ã™ã€‚"
53 name="Parcel Management">
54 <action description="グループã«åœŸåœ°è­²æ¸¡ã€è³¼å…¥ã‚’è¡Œã†"
55 longdescription="Deed land and buy land for group. This is done in About Land &gt; General tab."
56 name="land deed" />
57 <action description="Governor Lindenã«åœŸåœ°ã‚’å—ã‘渡ã™"
58 longdescription="Abandon land to Governor Linden. *WARNING* Any Member in a Role with this Ability can abandon group-owned land in About Land &gt; General tab, reverting it to Linden ownership without a sale! Be sure you know what you&apos;re doing before assigning this Ability."
59 name="land release" />
60 <action description="売り地情報ã®è¨­å®š"
61 longdescription="Set land for sale info. *WARNING* Any Member in a Role with this Ability can sell group-owned land in About Land &gt; General tab as they wish! Be sure you know what you&apos;re doing before assigning this Ability."
62 name="land set sale info" />
63 <action description="区画ã®å†åˆ†å‰²ã€ãŠã‚ˆã³çµ±åˆ"
64 longdescription="Subdivide and join parcels. This is done by right-clicking the ground, &apos;Edit Terrain&apos;, and dragging your mouse on the land to make a selection. To subdivide, select what you want to split and click &apos;Subdivide...&apos;. To join, select two or more contiguous parcels and click &apos;Join...&apos;. "
65 name="land divide join" />
66 </action_set>
67 <action_set
68 description="ã“れらã®ã‚¢ãƒ“リティã«ã¯ã€åŒºç”»åã€å…¬é–‹è¨­å®šã€æ¤œç´¢ãƒ‡ã‚£ãƒ¬ã‚¯ãƒˆãƒªã¸ã®ç™»éŒ²ã€ç€é™¸åœ°ç‚¹ãŠã‚ˆã³TPルートã®ã‚ªãƒ—ションを変更ã™ã‚‹æ¨©é™ãŒå«ã¾ã‚Œã¾ã™ã€‚"
69 name="Parcel Identity">
70 <action
71 description="『場所検索ã«è¡¨ç¤ºã€ã«åˆ‡ã‚Šæ›¿ãˆã€ã‚«ãƒ†ã‚´ãƒªã‚’設定"
72 longdescription="Toggle &apos;Show in Find Places&apos; and setting a parcel&apos;s category in About Land &gt; Options tab."
73 name="land find places" />
74 <action description="区画åã€èª¬æ˜Žã€ã€ŽWeb上ã§å…¬é–‹ã€ã®è¨­å®šã‚’変更"
75 longdescription="Change parcel name, description, and &apos;Publish on the Web&apos; settings. This is done in About Land &gt; Options tab."
76 name="land change identity" />
77 <action description="ç€é™¸åœ°ç‚¹ã€ãƒ†ãƒ¬ãƒãƒ¼ãƒˆãƒ»ãƒ«ãƒ¼ãƒˆã‚’設定"
78 longdescription="On a group-owned parcel, Members in a Role with this Ability can set a landing point to specify where incoming teleports arrive, and also set teleport routing for further control. This is done in About Land &gt; Options tab."
79 name="land set landing point" />
80 </action_set>
81 <action_set
82 description="ã“れらã®ã‚¢ãƒ“リティã«ã¯ã€ã€Žã‚ªãƒ–ジェクトã®ä½œæˆã€ã€ŽåœŸåœ°ç·¨é›†ã€ãŠã‚ˆã³éŸ³æ¥½ã¨ãƒ¡ãƒ‡ã‚£ã‚¢ã®è¨­å®šç­‰ã®åŒºç”»ã‚ªãƒ—ションã«é–¢ã™ã‚‹æ¨©é™ãŒå«ã¾ã‚Œã¾ã™ã€‚"
83 name="Parcel Settings">
84 <action description="音楽ã€ãƒ¡ãƒ‡ã‚£ã‚¢è¨­å®šã‚’変更"
85 longdescription="Change streaming music and movie settings in About Land &gt; Media tab."
86 name="land change media" />
87 <action description="『土地編集ã€ã«åˆ‡ã‚Šæ›¿ãˆã‚‹"
88 longdescription="Toggle &apos;Edit Terrain&apos;. *WARNING* About Land &gt; Options tab &gt; Edit Terrain allows anyone to terraform your land&apos;s shape, and place and move Linden plants. Be sure you know what you&apos;re doing before assigning this Ability. Editing terrain is toggled in About Land &gt; Options tab."
89 name="land edit" />
90 <action
91 description="土地ã«é–¢ã™ã‚‹è‰²ã€…>オプション設定ã«åˆ‡ã‚Šæ›¿ãˆã‚‹"
92 longdescription="Toggle &apos;Safe (no damage)&apos;, &apos;Fly&apos;, and allow other Residents to: &apos;Create Objects&apos;, &apos;Edit Terrain&apos;, &apos;Create Landmarks&apos;, and &apos;Run Scripts&apos; on group-owned land in About Land &gt; Options tab."
93 name="land options" />
94 </action_set>
95 <action_set
96 description="ã“れらã®ã‚¢ãƒ“リティã«ã¯ã€ãƒ¡ãƒ³ãƒãƒ¼ãŒã€ã‚°ãƒ«ãƒ¼ãƒ—所有区画ã«é–¢ã™ã‚‹åˆ¶é™ã‚’通éŽã™ã‚‹ã“ã¨ãŒã§ãる権é™ãŒå«ã¾ã‚Œã¾ã™ã€‚"
97 name="Parcel Powers">
98 <action description="常ã«ã€ŽåœŸåœ°ã®ã‚¨ãƒ‡ã‚£ãƒƒãƒˆã€ã‚’許å¯"
99 longdescription="Members in a Role with this Ability can edit terrain on a group-owned parcel, even if it&apos;s turned off in About Land &gt; Options tab."
100 name="land allow edit land" />
101 <action description="常ã«ã€Žé£›è¡Œã€ã‚’許å¯"
102 longdescription="Members in a Role with this Ability can fly on a group-owned parcel, even if it&apos;s turned off in About Land &gt; Options tab."
103 name="land allow fly" />
104 <action description="常ã«ã€Žã‚ªãƒ–ジェクト作æˆã€ã‚’許å¯"
105 longdescription="Members in a Role with this Ability can create objects on a group-owned parcel, even if it&apos;s turned off in About Land &gt; Options tab."
106 name="land allow create" />
107 <action description="常ã«ã€Žãƒ©ãƒ³ãƒ‰ãƒžãƒ¼ã‚¯ä½œæˆã€ã‚’許å¯"
108 longdescription="Members in a Role with this Ability can landmark a group-owned parcel, even if it&apos;s turned off in About Land &gt; Options tab."
109 name="land allow landmark" />
110 <action description="グループã®åœŸåœ°ã«ã€Žãƒ›ãƒ¼ãƒ è¨­å®šã€ã‚’許å¯"
111 longdescription="Members in a Role with this Ability can use World menu &gt; Set Home to Here on a group parcel (either land set or deeded to this group)."
112 name="land allow set home" />
113 </action_set>
114 <action_set
115 description="ã“れらã®ã‚¢ãƒ“リティã«ã¯ã€å±…ä½è€…ã®å‡çµã€è¿½æ”¾ã‚’å«ã‚€ã€ã‚°ãƒ«ãƒ¼ãƒ—所有区画ã¸ã®ã‚¢ã‚¯ã‚»ã‚¹ã®è¨±å¯ã‚„制é™ã®æ¨©é™ãŒå«ã¾ã‚Œã¾ã™ã€‚"
116 name="Parcel Access">
117 <action description="区画アクセスリストã®ç®¡ç†"
118 longdescription="Manage parcel Access lists in About Land &gt; Access tab."
119 name="land manage allowed" />
120 <action description="区画ç¦æ­¢ãƒªã‚¹ãƒˆã®ç®¡ç†"
121 longdescription="Manage parcel Ban lists in About Land &gt; Ban tab."
122 name="land manage banned" />
123 <action description="区画ã®ã€Žè¨±å¯è¨¼è²©å£²ã€ã®è¨­å®šã‚’変更"
124 longdescription="Change parcel &apos;Sell passes...&apos; settings in About Land &gt; Access tab."
125 name="land manage passes" />
126 <action description="区画上ã®å±…ä½è€…ã‚’å‡çµã¨è¿½æ”¾"
127 longdescription="Members in a Role with this Ability can handle an unwelcome Resident on a group-owned parcel by right-clicking them, More &gt;, and selecting &apos;Eject...&apos; or &apos;Freeze...&apos;."
128 name="land admin" />
129 </action_set>
130 <action_set
131 description="ã“れらã®ã‚¢ãƒ“リティã«ã¯ã€ãƒ¡ãƒ³ãƒãƒ¼ãŒã€ã‚ªãƒ–ジェクトã®è¿”å´ã€Linden製æ¤ç‰©ã®è¨­ç½®ã¨ç§»å‹•ã®æ¨©é™ãŒå«ã¾ã‚Œã¾ã™ã€‚ã“ã‚Œã¯ãƒ¡ãƒ³ãƒãƒ¼ãŒã‚´ãƒŸå‡¦ç†ã‚„景観造りを行ã†éš›ã«ä¾¿åˆ©ã§ã™ãŒã€è¿”å´ã—ãŸã‚ªãƒ–ジェクトã¯å…ƒã«æˆ»ã›ãªã„為ã€å……分ãªæ³¨æ„ãŒå¿…è¦ã§ã™ã€‚"
132 name="Parcel Content">
133 <action description="グループ所有オブジェクトã®è¿”é‚„"
134 longdescription="Return objects on group-owned parcels that are owned by the group in About Land &gt; Objects tab."
135 name="land return group owned" />
136 <action description="グループã§è¨­ç½®ã—ãŸã‚ªãƒ–ジェクトを返還"
137 longdescription="Return objects on group-owned parcels that are set to the group in About Land &gt; Objects tab."
138 name="land return group set" />
139 <action description="éžã‚°ãƒ«ãƒ¼ãƒ—・オブジェクトã®è¿”é‚„"
140 longdescription="Return objects on group-owned parcels that are non-group in About Land &gt; Objects tab."
141 name="land return non group" />
142 <action description="Linden製ã®æ¤ç‰©ã‚’使用ã—ã¦æ™¯è¦³ä½œè£½"
143 longdescription="Landscaping ability to place and move Linden trees, plants, and grasses. These items can be found in your inventory&apos;s Library &gt; Objects folder or they can be created via the Build button."
144 name="land gardening" />
145 </action_set>
146 <action_set
147 description="These Abilities include powers to deed, modify, and sell group-owned objects. These changes are done in the Edit Tools &gt; General Tab. Right-click an object and Edit to see its settings. "
148 name="Object Management">
149 <action description="グループã¸ã‚ªãƒ–ジェクトを譲渡"
150 longdescription="Deed objects to group in the Edit Tools &gt; General Tab."
151 name="object deed" />
152 <action
153 description="グループ所有オブジェクトã®æ“作(移動ã€ã‚³ãƒ”ーã€ä¿®æ­£ï¼‰"
154 longdescription="Manipulate (move, copy, modify) group-owned objects in the Edit Tools &gt; General Tab."
155 name="object manipulate" />
156 <action description="グループ所有オブジェクトを販売å¯èƒ½ã«è¨­å®š"
157 longdescription="Set group-owned objects for sale in the Edit Tools &gt; General tab."
158 name="object set sale" />
159 </action_set>
160 <action_set
161 description="ã“れらã®ã‚¢ãƒ“リティã«ã¯ã€ãƒ¡ãƒ³ãƒãƒ¼ã«ã‚°ãƒ«ãƒ¼ãƒ—負債ã®æ”¯æ‰•ã„やグループé…当ã®å—領を行ã‚ã›ã‚‹æ¨©é™ã‚’å«ã¿ã¾ã™ã€‚グループå£åº§å±¥æ­´ã¸ã®ã‚¢ã‚¯ã‚»ã‚¹ã‚’制é™ã™ã‚‹ã“ã¨ã‚‚ã§ãã¾ã™ã€‚"
162 name="Accounting">
163 <action description="グループ負債ã®è¿”済ã¨ã‚°ãƒ«ãƒ¼ãƒ—é…当ã®å—é ˜"
164 longdescription="Members in a Role with this Ability will automatically pay group liabilities and receive group dividends. This means they will receive a portion of group-owned land sales which are distributed daily, as well as contribute towards things like parcel listing fees. "
165 name="accounting accountable" />
166 </action_set>
167 <action_set
168 description="ã“れらã®ã‚¢ãƒ“リティã«ã¯ã€ãƒ¡ãƒ³ãƒãƒ¼ã®ã‚°ãƒ«ãƒ¼ãƒ—通知をé€ä¿¡ã€å—ã‘å–ã‚Šã€é–²è¦§ãŒã§ãる権é™ãŒå«ã¾ã‚Œã¾ã™ã€‚"
169 name="Notices">
170 <action description="通知をé€ä¿¡"
171 longdescription="Members in a Role with this Ability can send Notices in Group Information &gt; Notices tab."
172 name="notices send" />
173 <action description="通知ã¨éŽåŽ»ã®é€šçŸ¥ã®é–²è¦§"
174 longdescription="Members in a Role with this Ability can receive Notices and view past Notices in Group Information &gt; Notices tab."
175 name="notices receive" />
176 </action_set>
177 <action_set
178 description="ã“れらã®ã‚¢ãƒ“リティã«ã¯ã€ãƒ¡ãƒ³ãƒãƒ¼ãŒã€æ案ã®ä½œæˆã€æŠ•ç¥¨ã€ãã—ã¦æŠ•ç¥¨å±¥æ­´ã‚’閲覧ãŒã§ãる権é™ãŒå«ã¾ã‚Œã¾ã™ã€‚"
179 name="Proposals">
180 <action description="æ案を作æˆ"
181 longdescription="Members in a Role with this Ability can create proposals to be voted on in Group Information &gt; Proposals tab."
182 name="proposal start" />
183 <action description="æ案ã«æŠ•ç¥¨"
184 longdescription="Members in a Role with this Ability can vote on proposals in Group Information &gt; Proposals tab."
185 name="proposal vote" />
186 </action_set>
187</role_actions>
diff --git a/linden/indra/newview/skins/xui/zh/xui_version.xml b/linden/indra/newview/skins/xui/zh/xui_version.xml
deleted file mode 100644
index 0e77775..0000000
--- a/linden/indra/newview/skins/xui/zh/xui_version.xml
+++ /dev/null
@@ -1,4 +0,0 @@
1<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
2<xui_version>
3 1.0
4</xui_version>
diff --git a/linden/indra/newview/viewer.cpp b/linden/indra/newview/viewer.cpp
index 19b5260..181e446 100644
--- a/linden/indra/newview/viewer.cpp
+++ b/linden/indra/newview/viewer.cpp
@@ -56,7 +56,12 @@
56#include <process.h> // _spawnl() 56#include <process.h> // _spawnl()
57#include <tchar.h> // For TCHAR support 57#include <tchar.h> // For TCHAR support
58 58
59#if LL_WINDOWS && _MSC_VER < 1400
59//#define LL_USE_SMARTHEAP 0 60//#define LL_USE_SMARTHEAP 0
61#else
62#define LL_USE_SMARTHEAP 0
63#endif
64
60#if LL_WINDOWS && LL_RELEASE_FOR_DOWNLOAD && LL_USE_SMARTHEAP 65#if LL_WINDOWS && LL_RELEASE_FOR_DOWNLOAD && LL_USE_SMARTHEAP
61#include "smrtheap/smrtheap.h" 66#include "smrtheap/smrtheap.h"
62#endif // LL_WINDOWS && LL_RELEASE_FOR_DOWNLOAD && LL_USE_SMARTHEAP 67#endif // LL_WINDOWS && LL_RELEASE_FOR_DOWNLOAD && LL_USE_SMARTHEAP
@@ -103,19 +108,23 @@
103// Linden library headers 108// Linden library headers
104// 109//
105 110
111#include "audioengine.h"
106#include "llcommon.h" 112#include "llcommon.h"
107#include "llapr.h" 113#include "llapr.h"
108#include "audioengine.h"
109#include "llcachename.h" 114#include "llcachename.h"
110#include "llviewercontrol.h" 115#include "llcurl.h"
111#include "llcriticaldamp.h" 116#include "llcriticaldamp.h"
112#include "lldir.h" 117#include "lldir.h"
113#include "lleconomy.h" 118#include "lleconomy.h"
119#include "llerrorcontrol.h"
114#include "llflexibleobject.h" 120#include "llflexibleobject.h"
115#include "llfasttimer.h" 121#include "llfasttimer.h"
116#include "llfocusmgr.h" 122#include "llfocusmgr.h"
117#include "llgroupmgr.h" 123#include "llgroupmgr.h"
124#include "llimage.h"
125#include "llimageworker.h"
118#include "lllfsthread.h" 126#include "lllfsthread.h"
127#include "llmemtype.h"
119#include "llmd5.h" 128#include "llmd5.h"
120#include "llsecondlifeurls.h" 129#include "llsecondlifeurls.h"
121#include "llversion.h" 130#include "llversion.h"
@@ -180,12 +189,15 @@
180#include "llstatusbar.h" 189#include "llstatusbar.h"
181#include "llsurface.h" 190#include "llsurface.h"
182#include "lltexlayer.h" 191#include "lltexlayer.h"
192#include "lltexturecache.h"
193#include "lltexturefetch.h"
183#include "lltoolbar.h" 194#include "lltoolbar.h"
184#include "lltoolmgr.h" 195#include "lltoolmgr.h"
185#include "lltracker.h" 196#include "lltracker.h"
186#include "llurlwhitelist.h" 197#include "llurlwhitelist.h"
187#include "llviewerbuild.h" 198#include "llviewerbuild.h"
188#include "llviewercamera.h" 199#include "llviewercamera.h"
200#include "llviewercontrol.h"
189#include "llviewerimagelist.h" 201#include "llviewerimagelist.h"
190#include "llviewerkeyboard.h" 202#include "llviewerkeyboard.h"
191#include "llviewermenu.h" 203#include "llviewermenu.h"
@@ -202,7 +214,6 @@
202#include "llvoavatar.h" 214#include "llvoavatar.h"
203#include "llvograss.h" 215#include "llvograss.h"
204#include "llvotree.h" 216#include "llvotree.h"
205#include "llvotreenew.h"
206#include "llvovolume.h" // To set a static member. 217#include "llvovolume.h" // To set a static member.
207#include "llvowater.h" 218#include "llvowater.h"
208#include "llvolume.h" 219#include "llvolume.h"
@@ -236,11 +247,15 @@
236#endif 247#endif
237 248
238#include "llmediaengine.h" 249#include "llmediaengine.h"
239#include "llmozlib.h"
240 250
241extern LLErrorBuffer gErrorBuffer; 251#if LL_LIBXUL_ENABLED
252#include "llmozlib.h"
253#endif // LL_LIBXUL_ENABLED
242 254
255/////////////////////////////////////////////////////////////////////////////////
243// Support for crash handling. 256// Support for crash handling.
257/////////////////////////////////////////////////////////////////////////////////
258
244void errorCallback(const std::string &error_string); 259void errorCallback(const std::string &error_string);
245S32 gCrashBehavior = CRASH_BEHAVIOR_ASK; 260S32 gCrashBehavior = CRASH_BEHAVIOR_ASK;
246void (*gCrashCallback)(void) = NULL; 261void (*gCrashCallback)(void) = NULL;
@@ -253,9 +268,10 @@ BOOL gHandleKeysAsync = FALSE;
253BOOL gProbeHardware = TRUE; 268BOOL gProbeHardware = TRUE;
254std::string gSerialNumber; 269std::string gSerialNumber;
255 270
256// 271/////////////////////////////////////////////////////////////////////////////////
257// Application constants 272// Application constants
258// 273/////////////////////////////////////////////////////////////////////////////////
274
259S32 gStartupState = STATE_FIRST; 275S32 gStartupState = STATE_FIRST;
260 276
261BOOL gHaveSavedSnapshot = FALSE; 277BOOL gHaveSavedSnapshot = FALSE;
@@ -270,7 +286,6 @@ const F32 DEFAULT_AFK_TIMEOUT = 5.f * 60.f; // time with no input before user fl
270 286
271const char *VFS_DATA_FILE_BASE = "data.db2.x."; 287const char *VFS_DATA_FILE_BASE = "data.db2.x.";
272const char *VFS_INDEX_FILE_BASE = "index.db2.x."; 288const char *VFS_INDEX_FILE_BASE = "index.db2.x.";
273const U32 VFS_SIZE_MAP[4] = {52428800, 209715200, 524288000, 1048576000};
274 289
275const F32 MAX_USER_FOG_RATIO = 4.f; 290const F32 MAX_USER_FOG_RATIO = 4.f;
276const F32 MIN_USER_FOG_RATIO = 0.5f; 291const F32 MIN_USER_FOG_RATIO = 0.5f;
@@ -333,6 +348,7 @@ BOOL gDisconnected = FALSE;
333 348
334// Tells us to clean up the cache directory in the case of network corruption 349// Tells us to clean up the cache directory in the case of network corruption
335BOOL gPurgeOnExit = FALSE; 350BOOL gPurgeOnExit = FALSE;
351BOOL gPurgeCache = FALSE;
336 352
337// Allow multiple viewers in ReleaseForDownload 353// Allow multiple viewers in ReleaseForDownload
338#if LL_RELEASE_FOR_DOWNLOAD 354#if LL_RELEASE_FOR_DOWNLOAD
@@ -340,6 +356,7 @@ BOOL gMultipleViewersOK = FALSE;
340#else 356#else
341BOOL gMultipleViewersOK = TRUE; 357BOOL gMultipleViewersOK = TRUE;
342#endif 358#endif
359BOOL gSecondInstance = FALSE;
343 360
344LLString gArgs; 361LLString gArgs;
345 362
@@ -356,7 +373,6 @@ LLString gOldSettingsFileName;
356BOOL gPrintMessagesThisFrame = FALSE; 373BOOL gPrintMessagesThisFrame = FALSE;
357const char* DEFAULT_SETTINGS_FILE = "settings.xml"; 374const char* DEFAULT_SETTINGS_FILE = "settings.xml";
358const char* LEGACY_DEFAULT_SETTINGS_FILE = "settings.ini"; 375const char* LEGACY_DEFAULT_SETTINGS_FILE = "settings.ini";
359BOOL gRenderLightGlows = FALSE; // off by default for speed
360BOOL gUseWireframe = FALSE; 376BOOL gUseWireframe = FALSE;
361BOOL gRunLocal = FALSE; 377BOOL gRunLocal = FALSE;
362LLUUID gViewerDigest; // MD5 digest of the viewer's executable file. 378LLUUID gViewerDigest; // MD5 digest of the viewer's executable file.
@@ -374,14 +390,8 @@ const F32 LOGOUT_REQUEST_TIME = 6.f; // this will be cut short by the LogoutR
374F32 gLogoutMaxTime = LOGOUT_REQUEST_TIME; 390F32 gLogoutMaxTime = LOGOUT_REQUEST_TIME;
375 391
376// Map scale in pixels per region 392// Map scale in pixels per region
377F32 gMapScale = 128.f; 393F32 gMapScale = 128.f;
378F32 gMiniMapScale = 128.f; 394F32 gMiniMapScale = 128.f;
379
380// User interface/rendering globals
381
382extern LLPointer<LLImageGL> gStartImageGL;
383extern BOOL gDebugWindowProc;
384extern BOOL gAvatarBacklight;
385 395
386// Sky object, globals 396// Sky object, globals
387LLSky gSky; 397LLSky gSky;
@@ -401,7 +411,12 @@ BOOL gRestoreGL = FALSE;
401LLGlobalEconomy *gGlobalEconomy = NULL; 411LLGlobalEconomy *gGlobalEconomy = NULL;
402 412
403// VFS globals - see viewer.h 413// VFS globals - see viewer.h
404LLVFS *gStaticVFS = NULL; 414LLVFS* gStaticVFS = NULL;
415
416// Threads
417LLTextureCache* gTextureCache = NULL;
418LLWorkerThread* gImageDecodeThread = NULL;
419LLTextureFetch* gTextureFetch = NULL;
405 420
406// Debugging 421// Debugging
407FILE *gDebugFile = NULL; // File pointer used by the function which writes debug data. 422FILE *gDebugFile = NULL; // File pointer used by the function which writes debug data.
@@ -481,13 +496,6 @@ static const char USAGE[] = "\n"
481#if !LL_RELEASE_FOR_DOWNLOAD 496#if !LL_RELEASE_FOR_DOWNLOAD
482" -sim <simulator_ip> specify the simulator ip address\n" 497" -sim <simulator_ip> specify the simulator ip address\n"
483" -local run without simulator\n" 498" -local run without simulator\n"
484" -debugst <value> debug mask |= 1<<value (e.g. 1=LLERR_IMAGE, 2=LLERR_MESSAGE)\n"
485" -errmask <mask> 32 bit bitmask for error type mask\n"
486" -logcontrol <control> <level> <mask> specify admin logging control\n"
487" <time> <location> control: 0=replace, 1=merge\n"
488" level: 0=debug, 1=inf, 2=wrn, 3=err\n"
489" mask: 32 bit bitmask\n"
490" time,location: 0=no, 1=yes\n"
491#endif 499#endif
492" -god log in as god if you have god access\n" 500" -god log in as god if you have god access\n"
493" -purge delete files in cache\n" 501" -purge delete files in cache\n"
@@ -516,7 +524,6 @@ BOOL gUseAudio = TRUE;
516BOOL gUseFMOD = TRUE; 524BOOL gUseFMOD = TRUE;
517BOOL gConnectToSomething = TRUE; 525BOOL gConnectToSomething = TRUE;
518BOOL gLogMessages = FALSE; 526BOOL gLogMessages = FALSE;
519BOOL gLogUTC = TRUE;
520BOOL gRequestInventoryLibrary = TRUE; 527BOOL gRequestInventoryLibrary = TRUE;
521BOOL gAcceptTOS = FALSE; 528BOOL gAcceptTOS = FALSE;
522BOOL gAcceptCriticalMessage = FALSE; 529BOOL gAcceptCriticalMessage = FALSE;
@@ -558,12 +565,13 @@ protected:
558// Application initialization and cleanup 565// Application initialization and cleanup
559// 566//
560void init_marker_file(); 567void init_marker_file();
561void init_crash_logging(); 568void init_crash_handler();
569void init_logging();
562void create_console(); 570void create_console();
563void write_system_info(); 571void write_system_info();
564int parse_args(int argc, char **argv); 572int parse_args(int argc, char **argv);
565void saved_settings_to_globals(); 573void saved_settings_to_globals();
566BOOL init_vfs_viewer(); 574BOOL init_cache();
567void purge_cache(); 575void purge_cache();
568void cleanup_app(); 576void cleanup_app();
569void disconnect_viewer(void *); // Don't use directly - use do_disconnect() 577void disconnect_viewer(void *); // Don't use directly - use do_disconnect()
@@ -609,10 +617,6 @@ OSStatus simpleDialogHandler(EventHandlerCallRef handler, EventRef event, void *
609OSStatus DisplayReleaseNotes(void); 617OSStatus DisplayReleaseNotes(void);
610#endif // LL_DARWIN 618#endif // LL_DARWIN
611 619
612#ifdef LL_WINDOWS
613extern LPWSTR gIconResource;
614#endif
615
616void ui_audio_callback(const LLUUID& uuid, F32 volume) 620void ui_audio_callback(const LLUUID& uuid, F32 volume)
617{ 621{
618 if (gAudiop) 622 if (gAudiop)
@@ -624,7 +628,7 @@ void ui_audio_callback(const LLUUID& uuid, F32 volume)
624#if LL_WINDOWS 628#if LL_WINDOWS
625BOOL CALLBACK login_dialog_func(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lparam) 629BOOL CALLBACK login_dialog_func(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lparam)
626{ 630{
627 char buffer[MAX_STRING]; 631 char buffer[MAX_STRING]; /* Flawfinder: ignore */
628 switch(msg) 632 switch(msg)
629 { 633 {
630 case WM_INITDIALOG: 634 case WM_INITDIALOG:
@@ -755,7 +759,7 @@ MEM_BOOL MEM_CALLBACK first_mem_error_handler(MEM_ERROR_INFO *errorInfo)
755MEM_BOOL MEM_CALLBACK second_mem_error_handler(MEM_ERROR_INFO *errorInfo) 759MEM_BOOL MEM_CALLBACK second_mem_error_handler(MEM_ERROR_INFO *errorInfo)
756{ 760{
757 // Just in case "llerrs" and "llendl" cause another out-of-memory. 761 // Just in case "llerrs" and "llendl" cause another out-of-memory.
758 _llcrash_and_loop(); 762 LLError::crashAndLoop("");
759 // NOTREACHED better not be! 763 // NOTREACHED better not be!
760 return 0; 764 return 0;
761} 765}
@@ -778,10 +782,18 @@ int main( int argc, char **argv )
778 // This will eventually be done in LLApp 782 // This will eventually be done in LLApp
779 LLCommon::initClass(); 783 LLCommon::initClass();
780 // This should eventually be done in LLAppViewer 784 // This should eventually be done in LLAppViewer
781 LLWorkerThread::initClass(); 785# if MEM_TRACK_MEM
782 LLVFSThread::initClass(true, true); 786 static const bool enable_threads = false;
783 LLLFSThread::initClass(true, true); 787# else
784 LLImageFormatted::initClass(true, true); 788 static const bool enable_threads = true;
789# endif
790 LLVFSThread::initClass(enable_threads && true);
791 LLLFSThread::initClass(enable_threads && true);
792 // Image decoding
793 gImageDecodeThread = new LLWorkerThread("ImageDecode", enable_threads && true);
794 gTextureCache = new LLTextureCache(enable_threads && true);
795 gTextureFetch = new LLTextureFetch(gTextureCache, enable_threads && false);
796 LLImageWorker::initClass(gImageDecodeThread);
785 LLImageJ2C::openDSO(); 797 LLImageJ2C::openDSO();
786#endif 798#endif
787 799
@@ -798,7 +810,7 @@ int main( int argc, char **argv )
798 810
799 const S32 MAX_ARGS = 100; 811 const S32 MAX_ARGS = 100;
800 int argc = 0; 812 int argc = 0;
801 char *argv[MAX_ARGS]; 813 char* argv[MAX_ARGS]; /* Flawfinder: ignore */
802 814
803 char *token = NULL; 815 char *token = NULL;
804 if( cmd_line_including_exe_name[0] == '\"' ) 816 if( cmd_line_including_exe_name[0] == '\"' )
@@ -818,7 +830,7 @@ int main( int argc, char **argv )
818 { 830 {
819 argv[argc++] = token; 831 argv[argc++] = token;
820 /* Get next token: */ 832 /* Get next token: */
821 if (*(token + strlen(token) + 1) == '\"') 833 if (*(token + strlen(token) + 1) == '\"') /* Flawfinder: ignore*/
822 { 834 {
823 token = strtok( NULL, "\""); 835 token = strtok( NULL, "\"");
824 } 836 }
@@ -836,25 +848,25 @@ int main( int argc, char **argv )
836 // the gUserServerName (which gets passed to the crash reporter). 848 // the gUserServerName (which gets passed to the crash reporter).
837 // We're assuming that they're trying to log into the same grid as last 849 // We're assuming that they're trying to log into the same grid as last
838 // time, which seems fairly reasonable. 850 // time, which seems fairly reasonable.
839 sprintf(gUserServerName,"%s", gUserServerDomainName[UserServerDefaultChoice].mName); 851 snprintf(gUserServerName, MAX_STRING, "%s", gUserServerDomainName[UserServerDefaultChoice].mName); /* Flawfinder: ignore */
840 S32 j; 852 S32 j;
841 for (j = 1; j < argc; j++) 853 for (j = 1; j < argc; j++)
842 { 854 {
843 if (!strcmp(argv[j], "--aditi")) 855 if (!strcmp(argv[j], "--aditi"))
844 { 856 {
845 sprintf(gUserServerName,"%s", gUserServerDomainName[USERSERVER_ADITI].mName); 857 snprintf(gUserServerName, MAX_STRING, "%s", gUserServerDomainName[USERSERVER_ADITI].mName); /* Flawfinder: ignore */
846 } 858 }
847 else if (!strcmp(argv[j], "--agni")) 859 else if (!strcmp(argv[j], "--agni"))
848 { 860 {
849 sprintf(gUserServerName,"%s", gUserServerDomainName[USERSERVER_AGNI].mName); 861 snprintf(gUserServerName, MAX_STRING, "%s", gUserServerDomainName[USERSERVER_AGNI].mName); /* Flawfinder: ignore */
850 } 862 }
851 else if (!strcmp(argv[j], "--dmz")) 863 else if (!strcmp(argv[j], "--dmz"))
852 { 864 {
853 sprintf(gUserServerName,"%s", gUserServerDomainName[USERSERVER_DMZ].mName); 865 snprintf(gUserServerName, MAX_STRING, "%s", gUserServerDomainName[USERSERVER_DMZ].mName); /* Flawfinder: ignore */
854 } 866 }
855 else if (!strcmp(argv[j], "--siva")) 867 else if (!strcmp(argv[j], "--siva"))
856 { 868 {
857 sprintf(gUserServerName,"%s", gUserServerDomainName[USERSERVER_SIVA].mName); 869 snprintf(gUserServerName, MAX_STRING, "%s", gUserServerDomainName[USERSERVER_SIVA].mName); /* Flawfinder: ignore */
858 } 870 }
859 else if (!strcmp(argv[j], "--shakti")) 871 else if (!strcmp(argv[j], "--shakti"))
860 { 872 {
@@ -862,15 +874,19 @@ int main( int argc, char **argv )
862 } 874 }
863 else if (!strcmp(argv[j], "--durga")) 875 else if (!strcmp(argv[j], "--durga"))
864 { 876 {
865 sprintf(gUserServerName,"%s", gUserServerDomainName[USERSERVER_DURGA].mName); 877 snprintf(gUserServerName, MAX_STRING, "%s", gUserServerDomainName[USERSERVER_DURGA].mName); /* Flawfinder: ignore */
866 } 878 }
867 else if (!strcmp(argv[j], "--soma")) 879 else if (!strcmp(argv[j], "--soma"))
868 { 880 {
869 sprintf(gUserServerName,"%s", gUserServerDomainName[USERSERVER_SOMA].mName); 881 snprintf(gUserServerName, MAX_STRING, "%s", gUserServerDomainName[USERSERVER_SOMA].mName); /* Flawfinder: ignore */
870 } 882 }
871 else if (!strcmp(argv[j], "--ganga")) 883 else if (!strcmp(argv[j], "--ganga"))
872 { 884 {
873 sprintf(gUserServerName,"%s", gUserServerDomainName[USERSERVER_GANGA].mName); 885 snprintf(gUserServerName, MAX_STRING, "%s", gUserServerDomainName[USERSERVER_GANGA].mName); /* Flawfinder: ignore */
886 }
887 else if (!strcmp(argv[j], "--vaak"))
888 {
889 sprintf(gUserServerName,"%s", gUserServerDomainName[USERSERVER_VAAK].mName);
874 } 890 }
875 else if (!strcmp(argv[j], "--uma")) 891 else if (!strcmp(argv[j], "--uma"))
876 { 892 {
@@ -880,11 +896,11 @@ int main( int argc, char **argv )
880 { 896 {
881 if (!strcmp(argv[j], "-")) 897 if (!strcmp(argv[j], "-"))
882 { 898 {
883 sprintf(gUserServerName,"%s", LOOPBACK_ADDRESS_STRING); 899 snprintf(gUserServerName, MAX_STRING, "%s", LOOPBACK_ADDRESS_STRING); /* Flawfinder: ignore */
884 } 900 }
885 else 901 else
886 { 902 {
887 snprintf(gUserServerName, MAX_STRING, "%s", argv[j]); 903 snprintf(gUserServerName, MAX_STRING, "%s", argv[j]); /* Flawfinder: ignore */
888 } 904 }
889 } 905 }
890 else if (!strcmp(argv[j], "-multiple")) 906 else if (!strcmp(argv[j], "-multiple"))
@@ -911,15 +927,24 @@ int main( int argc, char **argv )
911 // that touches files should really go through the lldir API 927 // that touches files should really go through the lldir API
912 gDirUtilp->initAppDirs("SecondLife"); 928 gDirUtilp->initAppDirs("SecondLife");
913 929
930 //
931 // Set up logging defaults for the viewer
932 //
933 LLError::initForApplication(
934 gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, ""));
935 LLError::setFatalFunction(errorCallback);
936
937
914#if LL_RELEASE_FOR_DOWNLOAD && LL_SEND_CRASH_REPORTS 938#if LL_RELEASE_FOR_DOWNLOAD && LL_SEND_CRASH_REPORTS
915 // 939 //
916 // Crash log if we hard crashed. 940 // Crash log if we hard crashed.
917 // Initialize crash logging 941 // Initialize crash logging
918 // Set up SecondLife.log
919 // 942 //
920 init_crash_logging(); 943 init_crash_handler();
921#endif 944#endif
922 945 // Set up SecondLife.log
946 init_logging();
947
923 // 948 //
924 // OK to write stuff to logs now, we've now crash reported if necessary 949 // OK to write stuff to logs now, we've now crash reported if necessary
925 // 950 //
@@ -939,7 +964,7 @@ int main( int argc, char **argv )
939 { 964 {
940 // On the Mac, read in arguments.txt (if it exists) and process it for additional arguments. 965 // On the Mac, read in arguments.txt (if it exists) and process it for additional arguments.
941 LLString args; 966 LLString args;
942 if(LLString::read(args, "arguments.txt")) 967 if(LLString::read(args, "arguments.txt")) /* Flawfinder: ignore*/
943 { 968 {
944 // The arguments file exists. 969 // The arguments file exists.
945 // It should consist of command line arguments separated by newlines. 970 // It should consist of command line arguments separated by newlines.
@@ -1051,35 +1076,6 @@ int main( int argc, char **argv )
1051 gStartTime = totalTime(); 1076 gStartTime = totalTime();
1052 1077
1053 1078
1054 //
1055 // Set up logging defaults for the viewer
1056 //
1057#if 0 // This is bad... it disables lldebugs... if some spam is annoying, use lldebugst or comment it out.
1058 // Reduced spam diet for the viewer
1059 gErrorStream.setLevel( LLErrorStream::INFO );
1060#endif
1061 //gErrorStream.setLevel( LLErrorStream::WARN );
1062 gErrorStream.setTime(FALSE);
1063 gErrorStream.setPrintLocation(FALSE);
1064 gErrorStream.setErrorCallback(errorCallback);
1065
1066#if LL_DARWIN || LL_LINUX
1067 // Disable syslogging - the viewer shouldn't spam there
1068 gErrorBuffer.enableSyslog(FALSE);
1069#endif
1070
1071#if LL_DARWIN
1072 // On Mac OS X, stderr from apps launched from the Finder goes to the console log.
1073 // It's generally considered bad form to spam too much there.
1074
1075 // If stdin is a tty, assume the user launched from the command line and therefore wants to see stderr.
1076 // Otherwise, assume we've been launched from the finder and shouldn't spam stderr.
1077 if(!isatty(0))
1078 {
1079 gErrorBuffer.enableError(FALSE);
1080 }
1081#endif
1082
1083 //////////////////////////////////////// 1079 ////////////////////////////////////////
1084 // 1080 //
1085 // Process ini files 1081 // Process ini files
@@ -1119,7 +1115,10 @@ int main( int argc, char **argv )
1119 // successfully handed off URL to existing instance, exit 1115 // successfully handed off URL to existing instance, exit
1120 return 1; 1116 return 1;
1121 } 1117 }
1122 else if (another_instance_running()) 1118
1119 gSecondInstance = another_instance_running();
1120
1121 if (gSecondInstance)
1123 { 1122 {
1124 std::ostringstream msg; 1123 std::ostringstream msg;
1125 msg << 1124 msg <<
@@ -1178,7 +1177,7 @@ int main( int argc, char **argv )
1178 command_str += gUserServerName; 1177 command_str += gUserServerName;
1179 // XXX -- We need to exit fullscreen mode for this to work. 1178 // XXX -- We need to exit fullscreen mode for this to work.
1180 // XXX -- system() also doesn't wait for completion. Hmm... 1179 // XXX -- system() also doesn't wait for completion. Hmm...
1181 system(command_str.c_str()); 1180 system(command_str.c_str()); /* Flawfinder: Ignore */
1182#elif LL_LINUX 1181#elif LL_LINUX
1183 std::string cmd =gDirUtilp->getAppRODataDir(); 1182 std::string cmd =gDirUtilp->getAppRODataDir();
1184 cmd += gDirUtilp->getDirDelimiter(); 1183 cmd += gDirUtilp->getDirDelimiter();
@@ -1194,7 +1193,7 @@ int main( int argc, char **argv )
1194 pid_t pid = fork(); 1193 pid_t pid = fork();
1195 if (pid == 0) 1194 if (pid == 0)
1196 { // child 1195 { // child
1197 execv(cmd.c_str(), cmdargv); 1196 execv(cmd.c_str(), cmdargv); /* Flawfinder: Ignore */
1198 llwarns << "execv failure when trying to start " << cmd << llendl; 1197 llwarns << "execv failure when trying to start " << cmd << llendl;
1199 _exit(1); // avoid atexit() 1198 _exit(1); // avoid atexit()
1200 } else { 1199 } else {
@@ -1218,8 +1217,10 @@ int main( int argc, char **argv )
1218 } 1217 }
1219 else 1218 else
1220 { 1219 {
1220 gSecondInstance = another_instance_running();
1221
1221 /* Don't start another instance if using -multiple 1222 /* Don't start another instance if using -multiple
1222 if (another_instance_running()) 1223 if (gSecondInstance)
1223 { 1224 {
1224 //RN: if we received a URL, hand it off to the existing instance 1225 //RN: if we received a URL, hand it off to the existing instance
1225 if (LLURLSimString::parse()) 1226 if (LLURLSimString::parse())
@@ -1262,6 +1263,13 @@ int main( int argc, char **argv )
1262 // Merge with the command line overrides 1263 // Merge with the command line overrides
1263 gSavedSettings.applyOverrides(gCommandLineSettings); 1264 gSavedSettings.applyOverrides(gCommandLineSettings);
1264 1265
1266 // Need to do this before calling parseAlerts
1267 gUICtrlFactory = new LLViewerUICtrlFactory();
1268
1269 // Pre-load alerts.xml to define the warnings settings (always loads from skins/xui/en-us/)
1270 // Do this *before* loading the settings file
1271 LLAlertDialog::parseAlerts("alerts.xml", &gSavedSettings, TRUE);
1272
1265 // Overwrite default settings with user settings 1273 // Overwrite default settings with user settings
1266 llinfos << "Loading configuration file " << gSettingsFileName << llendl; 1274 llinfos << "Loading configuration file " << gSettingsFileName << llendl;
1267 if (0 == gSavedSettings.loadFromFile(gSettingsFileName)) 1275 if (0 == gSavedSettings.loadFromFile(gSettingsFileName))
@@ -1283,19 +1291,13 @@ int main( int argc, char **argv )
1283 gSavedSettings.applyOverrides(gCommandLineForcedSettings); 1291 gSavedSettings.applyOverrides(gCommandLineForcedSettings);
1284 1292
1285 gLastRunVersion = gSavedSettings.getString("LastRunVersion"); 1293 gLastRunVersion = gSavedSettings.getString("LastRunVersion");
1294
1295 settings_version_fixup();
1286 1296
1287 // Get the single value from the crash settings file, if it exists 1297 // Get the single value from the crash settings file, if it exists
1288 std::string crash_settings_filename = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, CRASH_SETTINGS_FILE); 1298 std::string crash_settings_filename = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, CRASH_SETTINGS_FILE);
1289 gCrashSettings.loadFromFile(crash_settings_filename.c_str()); 1299 gCrashSettings.loadFromFile(crash_settings_filename.c_str());
1290 1300
1291 // Purge cache if user requested it
1292 if (gSavedSettings.getBOOL("PurgeCacheOnStartup") ||
1293 gSavedSettings.getBOOL("PurgeCacheOnNextStartup"))
1294 {
1295 gSavedSettings.setBOOL("PurgeCacheOnNextStartup", FALSE);
1296 purge_cache();
1297 }
1298
1299 ///////////////////////////////////////////////// 1301 /////////////////////////////////////////////////
1300 // OS-specific login dialogs 1302 // OS-specific login dialogs
1301 ///////////////////////////////////////////////// 1303 /////////////////////////////////////////////////
@@ -1328,7 +1330,7 @@ int main( int argc, char **argv )
1328 1330
1329 if (gSavedSettings.getBOOL("VerboseLogs")) 1331 if (gSavedSettings.getBOOL("VerboseLogs"))
1330 { 1332 {
1331 gErrorStream.setPrintLocation(TRUE); 1333 LLError::setPrintLocation(true);
1332 } 1334 }
1333 1335
1334#if !LL_RELEASE_FOR_DOWNLOAD 1336#if !LL_RELEASE_FOR_DOWNLOAD
@@ -1345,11 +1347,11 @@ int main( int argc, char **argv )
1345 LLString custom_server = gSavedSettings.getString("CustomServer"); 1347 LLString custom_server = gSavedSettings.getString("CustomServer");
1346 if (custom_server.empty()) 1348 if (custom_server.empty())
1347 { 1349 {
1348 sprintf(gUserServerName,"none"); 1350 snprintf(gUserServerName, MAX_STRING, "none"); /* Flawfinder: ignore */
1349 } 1351 }
1350 else 1352 else
1351 { 1353 {
1352 sprintf(gUserServerName,"%s", custom_server.c_str()); 1354 snprintf(gUserServerName, MAX_STRING, "%s", custom_server.c_str()); /* Flawfinder: ignore */
1353 } 1355 }
1354 } 1356 }
1355 } 1357 }
@@ -1365,6 +1367,9 @@ int main( int argc, char **argv )
1365 LLString viewer_art_filename = gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS,"viewerart.xml"); 1367 LLString viewer_art_filename = gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS,"viewerart.xml");
1366 llinfos << "Loading art table from " << viewer_art_filename << llendl; 1368 llinfos << "Loading art table from " << viewer_art_filename << llendl;
1367 gViewerArt.loadFromFile(viewer_art_filename.c_str(), FALSE); 1369 gViewerArt.loadFromFile(viewer_art_filename.c_str(), FALSE);
1370 LLString textures_filename = gDirUtilp->getExpandedFilename(LL_PATH_SKINS, "textures", "textures.xml");
1371 llinfos << "Loading art table from " << textures_filename << llendl;
1372 gViewerArt.loadFromFile(textures_filename.c_str(), FALSE);
1368 1373
1369 LLString colors_base_filename = gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "colors_base.xml"); 1374 LLString colors_base_filename = gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "colors_base.xml");
1370 llinfos << "Loading base colors from " << colors_base_filename << llendl; 1375 llinfos << "Loading base colors from " << colors_base_filename << llendl;
@@ -1388,19 +1393,14 @@ int main( int argc, char **argv )
1388 &gImageList, 1393 &gImageList,
1389 ui_audio_callback, 1394 ui_audio_callback,
1390 &LLUI::sGLScaleFactor); 1395 &LLUI::sGLScaleFactor);
1391
1392 gUICtrlFactory = new LLViewerUICtrlFactory();
1393 1396
1397 gUICtrlFactory->setupPaths(); // update paths with correct language set
1394 1398
1395 ///////////////////////////////////////////////// 1399 /////////////////////////////////////////////////
1396 // 1400 //
1397 // Load settings files 1401 // Load settings files
1398 // 1402 //
1399 // 1403 //
1400 // XUI:translate? Should be OK to get the controldef first
1401 // Pre-load alerts.xml to define the warnings settings (always loads from skins/xui/en-us/)
1402 LLAlertDialog::parseAlerts("alerts.xml", &gSavedSettings, TRUE);
1403
1404 LLGroupMgr::parseRoleActions("role_actions.xml"); 1404 LLGroupMgr::parseRoleActions("role_actions.xml");
1405 1405
1406 // Move certain saved settings into global variables for speed 1406 // Move certain saved settings into global variables for speed
@@ -1500,11 +1500,6 @@ int main( int argc, char **argv )
1500 llwarns << " Someone took over my exception handler (post hardware probe)!" << llendl; 1500 llwarns << " Someone took over my exception handler (post hardware probe)!" << llendl;
1501 } 1501 }
1502 1502
1503 if (gFeatureManagerp->initPCIFeatureMasks())
1504 {
1505 // User is looking at "bad device" web pages, exit
1506 return 0;
1507 }
1508 gGLManager.mVRAM = gDXHardware.getVRAM(); 1503 gGLManager.mVRAM = gDXHardware.getVRAM();
1509 llinfos << "Detected VRAM: " << gGLManager.mVRAM << llendl; 1504 llinfos << "Detected VRAM: " << gGLManager.mVRAM << llendl;
1510#endif 1505#endif
@@ -1524,7 +1519,8 @@ int main( int argc, char **argv )
1524 // 1519 //
1525 // Initialize the VFS, and gracefully handle initialization errors 1520 // Initialize the VFS, and gracefully handle initialization errors
1526 // 1521 //
1527 if (!init_vfs_viewer()) 1522
1523 if (!init_cache())
1528 { 1524 {
1529 std::ostringstream msg; 1525 std::ostringstream msg;
1530 msg << 1526 msg <<
@@ -1541,7 +1537,7 @@ int main( int argc, char **argv )
1541 OSMB_OK); 1537 OSMB_OK);
1542 return 1; 1538 return 1;
1543 } 1539 }
1544 1540
1545#if LL_DARWIN 1541#if LL_DARWIN
1546 // Display the release notes for the current version 1542 // Display the release notes for the current version
1547 if(!gHideLinks && gCurrentVersion != gLastRunVersion) 1543 if(!gHideLinks && gCurrentVersion != gLastRunVersion)
@@ -1572,8 +1568,9 @@ int main( int argc, char **argv )
1572 LLSplashScreen::hide(); 1568 LLSplashScreen::hide();
1573 1569
1574 // HACK: Need a non-const char * for stupid window name (propagated deep down) 1570 // HACK: Need a non-const char * for stupid window name (propagated deep down)
1575 char window_title_str[256]; 1571 char window_title_str[256]; /* Flawfinder: ignore */
1576 strcpy(window_title_str, gWindowTitle.c_str()); 1572 strncpy(window_title_str, gWindowTitle.c_str(), sizeof(window_title_str) - 1); /* Flawfinder: ignore */
1573 window_title_str[sizeof(window_title_str) - 1] = '\0';
1577 1574
1578 // always start windowed 1575 // always start windowed
1579 gViewerWindow = new LLViewerWindow(window_title_str, "Second Life", 1576 gViewerWindow = new LLViewerWindow(window_title_str, "Second Life",
@@ -1618,10 +1615,6 @@ int main( int argc, char **argv )
1618 write_debug(gGLManager.getGLInfoString()); 1615 write_debug(gGLManager.getGLInfoString());
1619 llinfos << gGLManager.getGLInfoString() << llendl; 1616 llinfos << gGLManager.getGLInfoString() << llendl;
1620 1617
1621 char tmp_str[256];
1622 sprintf(tmp_str, "Allocated %d bytes of AGP memory\n", gPipeline.getAGPMemUsage());
1623 write_debug(tmp_str);
1624
1625 //load key settings 1618 //load key settings
1626 bind_keyboard_functions(); 1619 bind_keyboard_functions();
1627 1620
@@ -1634,7 +1627,7 @@ int main( int argc, char **argv )
1634 gViewerKeyboard.loadBindings(gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS,"custom_keys.ini").c_str()); 1627 gViewerKeyboard.loadBindings(gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS,"custom_keys.ini").c_str());
1635 1628
1636 // Calculate the digest for the executable (takes < 90ms on a fast machine). 1629 // Calculate the digest for the executable (takes < 90ms on a fast machine).
1637 FILE* app_file = LLFile::fopen( gDirUtilp->getExecutablePathAndName().c_str(), "rb" ); 1630 FILE* app_file = LLFile::fopen( gDirUtilp->getExecutablePathAndName().c_str(), "rb" ); /* Flawfinder: ignore */
1638 if( app_file ) 1631 if( app_file )
1639 { 1632 {
1640 LLMD5 app_md5; 1633 LLMD5 app_md5;
@@ -1711,12 +1704,12 @@ BOOL another_instance_running()
1711 1704
1712 // If file doesn't exist, we create it 1705 // If file doesn't exist, we create it
1713 // If file does exist, try to get writing privilages 1706 // If file does exist, try to get writing privilages
1714 FILE *fMarker = LLFile::fopen(marker_file.c_str(), "rb"); 1707 FILE* fMarker = LLFile::fopen(marker_file.c_str(), "rb"); /* Flawfinder: ignore */
1715 if (fMarker != NULL) 1708 if (fMarker != NULL)
1716 { 1709 {
1717 // File exists, try opening with write permissions 1710 // File exists, try opening with write permissions
1718 fclose(fMarker); 1711 fclose(fMarker);
1719 fMarker = LLFile::fopen(marker_file.c_str(), "wb"); 1712 fMarker = LLFile::fopen(marker_file.c_str(), "wb"); /* Flawfinder: ignore */
1720 if (fMarker == NULL) 1713 if (fMarker == NULL)
1721 { 1714 {
1722 llinfos << "Marker file is locked." << llendl; 1715 llinfos << "Marker file is locked." << llendl;
@@ -1780,7 +1773,6 @@ void main_loop()
1780 // once per second debug info 1773 // once per second debug info
1781 if (debugTime.getElapsedTimeF32() > 1.f) 1774 if (debugTime.getElapsedTimeF32() > 1.f)
1782 { 1775 {
1783// llinfos << "AGP Byte mem: " << LLAGPArray<U8>::sBytesPad << llendl;
1784 debugTime.reset(); 1776 debugTime.reset();
1785 } 1777 }
1786#endif 1778#endif
@@ -1803,6 +1795,7 @@ void main_loop()
1803 { 1795 {
1804 LLFastTimer t3(LLFastTimer::FTM_IDLE); 1796 LLFastTimer t3(LLFastTimer::FTM_IDLE);
1805 idle(); 1797 idle();
1798 LLCurl::process();
1806 io_pump->pump(); 1799 io_pump->pump();
1807 io_pump->callback(); 1800 io_pump->callback();
1808 } 1801 }
@@ -1831,18 +1824,24 @@ void main_loop()
1831 // Sleep and run background threads 1824 // Sleep and run background threads
1832 { 1825 {
1833 LLFastTimer t2(LLFastTimer::FTM_SLEEP); 1826 LLFastTimer t2(LLFastTimer::FTM_SLEEP);
1834 1827 bool run_multiple_threads = gSavedSettings.getBOOL("RunMultipleThreads");
1828
1835 const F64 min_frame_time = 0.0; //(.0333 - .0010); // max video frame rate = 30 fps 1829 const F64 min_frame_time = 0.0; //(.0333 - .0010); // max video frame rate = 30 fps
1836 const F64 min_idle_time = 0.0; //(.0010); // min idle time = 1 ms 1830 const F64 min_idle_time = 0.0; //(.0010); // min idle time = 1 ms
1831 const F64 max_idle_time = run_multiple_threads ? min_idle_time : .005; // 5 ms
1837 idleTimer.reset(); 1832 idleTimer.reset();
1838 while(1) 1833 while(1)
1839 { 1834 {
1840 LLWorkerThread::updateClass(0); // unpauses the worker threads 1835 S32 work_pending = 0;
1841 S32 vfs_pending = LLVFSThread::updateClass(0); 1836 S32 io_pending = 0;
1842 S32 lfs_pending = LLLFSThread::updateClass(0); 1837 work_pending += gTextureCache->update(1); // unpauses the texture cache thread
1843 if (vfs_pending > 1000 || lfs_pending > 100) 1838 work_pending += gImageDecodeThread->update(1); // unpauses the image thread
1839 work_pending += gTextureFetch->update(1); // unpauses the texture fetch thread
1840 io_pending += LLVFSThread::updateClass(1);
1841 io_pending += LLLFSThread::updateClass(1);
1842 if (io_pending > 1000)
1844 { 1843 {
1845 ms_sleep(llmin(vfs_pending/100,100)); // give the vfs some time to catch up 1844 ms_sleep(llmin(io_pending/100,100)); // give the vfs some time to catch up
1846 } 1845 }
1847 if ( gNoRender 1846 if ( gNoRender
1848 || !gViewerWindow->mWindow->getVisible() 1847 || !gViewerWindow->mWindow->getVisible()
@@ -1871,15 +1870,23 @@ void main_loop()
1871 1870
1872 F64 frame_time = frameTimer.getElapsedTimeF64(); 1871 F64 frame_time = frameTimer.getElapsedTimeF64();
1873 F64 idle_time = idleTimer.getElapsedTimeF64(); 1872 F64 idle_time = idleTimer.getElapsedTimeF64();
1874 if (frame_time >= min_frame_time && idle_time >= min_idle_time) 1873 if (frame_time >= min_frame_time &&
1874 idle_time >= min_idle_time &&
1875 (!work_pending || idle_time >= max_idle_time))
1875 { 1876 {
1876 break; 1877 break;
1877 } 1878 }
1878 } 1879 }
1879 frameTimer.reset(); 1880 frameTimer.reset();
1880 1881
1881 // if (LLWorkerThread::threadCount()==1) //pauseALl() should only be required when on a single threaded client... 1882 // Prevent the worker threads from running while rendering.
1882 LLWorkerThread::pauseAll(); // Prevent the worker thread from running while rendering. 1883 // if (LLThread::processorCount()==1) //pause() should only be required when on a single processor client...
1884 if (run_multiple_threads == FALSE)
1885 {
1886 gTextureCache->pause();
1887 gImageDecodeThread->pause();
1888 // gTextureFetch->pause(); // Don't pause the fetch (IO) thread
1889 }
1883 //LLVFSThread::sLocal->pause(); // Prevent the VFS thread from running while rendering. 1890 //LLVFSThread::sLocal->pause(); // Prevent the VFS thread from running while rendering.
1884 //LLLFSThread::sLocal->pause(); // Prevent the LFS thread from running while rendering. 1891 //LLLFSThread::sLocal->pause(); // Prevent the LFS thread from running while rendering.
1885 } 1892 }
@@ -1970,12 +1977,12 @@ void init_marker_file()
1970 std::string marker_file = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,"SecondLife.exec_marker"); 1977 std::string marker_file = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,"SecondLife.exec_marker");
1971 llinfos << "Checking marker file for lock..." << llendl; 1978 llinfos << "Checking marker file for lock..." << llendl;
1972 1979
1973 FILE *fMarker = LLFile::fopen(marker_file.c_str(), "rb"); 1980 FILE* fMarker = LLFile::fopen(marker_file.c_str(), "rb"); /* Flawfinder: ignore */
1974 if (fMarker != NULL) 1981 if (fMarker != NULL)
1975 { 1982 {
1976 // File exists, try opening with write permissions 1983 // File exists, try opening with write permissions
1977 fclose(fMarker); 1984 fclose(fMarker);
1978 fMarker = LLFile::fopen(marker_file.c_str(), "wb"); 1985 fMarker = LLFile::fopen(marker_file.c_str(), "wb"); /* Flawfinder: ignore */
1979 if (fMarker == NULL) 1986 if (fMarker == NULL)
1980 { 1987 {
1981 // Another instance is running. Skip the rest of these operations. 1988 // Another instance is running. Skip the rest of these operations.
@@ -2004,7 +2011,7 @@ void init_marker_file()
2004#if LL_WINDOWS 2011#if LL_WINDOWS
2005 gMarkerFile = LLFile::_fsopen(marker_file.c_str(), "w", _SH_DENYWR); 2012 gMarkerFile = LLFile::_fsopen(marker_file.c_str(), "w", _SH_DENYWR);
2006#else 2013#else
2007 gMarkerFile = LLFile::fopen(marker_file.c_str(), "w"); 2014 gMarkerFile = LLFile::fopen(marker_file.c_str(), "w"); /* Flawfinder: ignore */
2008 if (gMarkerFile) 2015 if (gMarkerFile)
2009 { 2016 {
2010 int fd = fileno(gMarkerFile); 2017 int fd = fileno(gMarkerFile);
@@ -2040,7 +2047,7 @@ void init_marker_file()
2040 llinfos << "Exiting init_marker_file()." << llendl; 2047 llinfos << "Exiting init_marker_file()." << llendl;
2041} 2048}
2042 2049
2043void init_crash_logging() 2050void init_crash_handler()
2044{ 2051{
2045 ////////////////////////////////////////// 2052 //////////////////////////////////////////
2046 // 2053 //
@@ -2052,7 +2059,10 @@ void init_crash_logging()
2052 2059
2053 // Set the crash callback for the viewer 2060 // Set the crash callback for the viewer
2054 gCrashCallback = viewer_crash_callback; 2061 gCrashCallback = viewer_crash_callback;
2062}
2055 2063
2064void init_logging()
2065{
2056 // Remove the last ".old" log file. 2066 // Remove the last ".old" log file.
2057 std::string old_log_file = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, 2067 std::string old_log_file = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,
2058 "SecondLife.old"); 2068 "SecondLife.old");
@@ -2072,16 +2082,13 @@ void init_crash_logging()
2072 2082
2073 // Set the log file to SecondLife.log 2083 // Set the log file to SecondLife.log
2074 2084
2075 if (!gErrorStream.setFile(log_file.c_str())) 2085 LLError::logToFile(log_file);
2076 {
2077 llinfos << "Error setting log file to " << log_file << llendl;
2078 }
2079} 2086}
2080 2087
2081void write_system_info() 2088void write_system_info()
2082{ 2089{
2083 write_debug("SL Log: "); 2090 write_debug("SL Log: ");
2084 write_debug(gErrorStream.getFilename()); 2091 write_debug(LLError::logFileName());
2085 write_debug("\n"); 2092 write_debug("\n");
2086 2093
2087 std::string tmp_str = gSecondLife 2094 std::string tmp_str = gSecondLife
@@ -2108,7 +2115,7 @@ void write_system_info()
2108 // Dump the local time and time zone 2115 // Dump the local time and time zone
2109 time_t now; 2116 time_t now;
2110 time(&now); 2117 time(&now);
2111 char tbuffer[256]; 2118 char tbuffer[256]; /* Flawfinder: ignore */
2112 strftime(tbuffer, 256, "%Y-%m-%dT%H:%M:%S %Z", localtime(&now)); 2119 strftime(tbuffer, 256, "%Y-%m-%dT%H:%M:%S %Z", localtime(&now));
2113 llinfos << "Local time: " << tbuffer << llendl; 2120 llinfos << "Local time: " << tbuffer << llendl;
2114 2121
@@ -2122,12 +2129,12 @@ void write_system_info()
2122void disable_win_error_reporting() 2129void disable_win_error_reporting()
2123{ 2130{
2124 const char win_xp_string[] = "Microsoft Windows XP"; 2131 const char win_xp_string[] = "Microsoft Windows XP";
2125 BOOL is_win_xp = ( gSysOS.getOSString().substr(0, strlen(win_xp_string) ) == win_xp_string ); 2132 BOOL is_win_xp = ( gSysOS.getOSString().substr(0, strlen(win_xp_string) ) == win_xp_string ); /* Flawfinder: ignore*/
2126 if( is_win_xp ) 2133 if( is_win_xp )
2127 { 2134 {
2128 // Note: we need to use run-time dynamic linking, because load-time dynamic linking will fail 2135 // Note: we need to use run-time dynamic linking, because load-time dynamic linking will fail
2129 // on systems that don't have the library installed (all non-Windows XP systems) 2136 // on systems that don't have the library installed (all non-Windows XP systems)
2130 HINSTANCE fault_rep_dll_handle = LoadLibrary(L"faultrep.dll"); 2137 HINSTANCE fault_rep_dll_handle = LoadLibrary(L"faultrep.dll"); /* Flawfinder: ignore */
2131 if( fault_rep_dll_handle ) 2138 if( fault_rep_dll_handle )
2132 { 2139 {
2133 pfn_ADDEREXCLUDEDAPPLICATIONA pAddERExcludedApplicationA = (pfn_ADDEREXCLUDEDAPPLICATIONA) GetProcAddress(fault_rep_dll_handle, "AddERExcludedApplicationA"); 2140 pfn_ADDEREXCLUDEDAPPLICATIONA pAddERExcludedApplicationA = (pfn_ADDEREXCLUDEDAPPLICATIONA) GetProcAddress(fault_rep_dll_handle, "AddERExcludedApplicationA");
@@ -2157,7 +2164,7 @@ void disable_win_error_reporting()
2157// On Mac, return the hardware serial number. 2164// On Mac, return the hardware serial number.
2158std::string get_serial_number() 2165std::string get_serial_number()
2159{ 2166{
2160 char serial_md5[MD5HEX_STR_SIZE]; 2167 char serial_md5[MD5HEX_STR_SIZE]; /* Flawfinder: ignore */
2161 serial_md5[0] = 0; 2168 serial_md5[0] = 0;
2162 2169
2163#if LL_WINDOWS 2170#if LL_WINDOWS
@@ -2199,7 +2206,7 @@ std::string get_serial_number()
2199 2206
2200 if (serialNumber) 2207 if (serialNumber)
2201 { 2208 {
2202 char buffer[MAX_STRING]; 2209 char buffer[MAX_STRING]; /* Flawfinder: ignore */
2203 if (CFStringGetCString(serialNumber, buffer, MAX_STRING, kCFStringEncodingASCII)) 2210 if (CFStringGetCString(serialNumber, buffer, MAX_STRING, kCFStringEncodingASCII))
2204 { 2211 {
2205 LLMD5 md5( (unsigned char*)buffer ); 2212 LLMD5 md5( (unsigned char*)buffer );
@@ -2234,7 +2241,7 @@ static inline BOOL do_basic_glibc_backtrace()
2234 2241
2235 std::string strace_filename = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,"stack_trace.log"); 2242 std::string strace_filename = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,"stack_trace.log");
2236 llinfos << "Opening stack trace file " << strace_filename << llendl; 2243 llinfos << "Opening stack trace file " << strace_filename << llendl;
2237 FILE* StraceFile = LLFile::fopen(strace_filename.c_str(), "w"); 2244 FILE* StraceFile = LLFile::fopen(strace_filename.c_str(), "w"); /* Flawfinder: ignore */
2238 if (!StraceFile) 2245 if (!StraceFile)
2239 { 2246 {
2240 llinfos << "Opening stack trace file " << strace_filename << " failed. Using stderr." << llendl; 2247 llinfos << "Opening stack trace file " << strace_filename << " failed. Using stderr." << llendl;
@@ -2272,7 +2279,7 @@ static inline BOOL do_elfio_glibc_backtrace()
2272 2279
2273 std::string strace_filename = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,"stack_trace.log"); 2280 std::string strace_filename = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,"stack_trace.log");
2274 llinfos << "Opening stack trace file " << strace_filename << llendl; 2281 llinfos << "Opening stack trace file " << strace_filename << llendl;
2275 FILE* StraceFile = LLFile::fopen(strace_filename.c_str(), "w"); 2282 FILE* StraceFile = LLFile::fopen(strace_filename.c_str(), "w"); /* Flawfinder: ignore */
2276 if (!StraceFile) 2283 if (!StraceFile)
2277 { 2284 {
2278 llinfos << "Opening stack trace file " << strace_filename << " failed. Using stderr." << llendl; 2285 llinfos << "Opening stack trace file " << strace_filename << " failed. Using stderr." << llendl;
@@ -2423,7 +2430,7 @@ void viewer_crash_callback()
2423 2430
2424 // Close the debug file 2431 // Close the debug file
2425 close_debug(); 2432 close_debug();
2426 gErrorBuffer.closeFile(); 2433 LLError::logToFile("");
2427 2434
2428 // Close the SecondLife.log 2435 // Close the SecondLife.log
2429 2436
@@ -2461,7 +2468,7 @@ void viewer_crash_callback()
2461 command_str += "-user "; 2468 command_str += "-user ";
2462 command_str += gUserServerName; 2469 command_str += gUserServerName;
2463 command_str += " &"; // This backgrounds the command so system() doesn't block until the crashreporter exits. 2470 command_str += " &"; // This backgrounds the command so system() doesn't block until the crashreporter exits.
2464 system(command_str.c_str()); 2471 system(command_str.c_str()); /* Flawfinder: ignore */
2465 2472
2466 // Sometimes signals don't seem to quit the viewer. 2473 // Sometimes signals don't seem to quit the viewer.
2467 // Make sure we exit so as to not totally confuse the user. 2474 // Make sure we exit so as to not totally confuse the user.
@@ -2495,7 +2502,7 @@ void viewer_crash_callback()
2495 pid_t pid = fork(); 2502 pid_t pid = fork();
2496 if (pid == 0) 2503 if (pid == 0)
2497 { // child 2504 { // child
2498 execv(cmd.c_str(), cmdargv); 2505 execv(cmd.c_str(), cmdargv); /* Flawfinder: ignore */
2499 llwarns << "execv failure when trying to start " << cmd << llendl; 2506 llwarns << "execv failure when trying to start " << cmd << llendl;
2500 _exit(1); // avoid atexit() 2507 _exit(1); // avoid atexit()
2501 } else { 2508 } else {
@@ -2523,19 +2530,89 @@ void viewer_crash_callback()
2523 2530
2524 2531
2525 2532
2526BOOL init_vfs_viewer() 2533BOOL init_cache()
2527{ 2534{
2535 gPurgeCache = FALSE;
2536 // Purge cache if user requested it
2537 if (gSavedSettings.getBOOL("PurgeCacheOnStartup") ||
2538 gSavedSettings.getBOOL("PurgeCacheOnNextStartup"))
2539 {
2540 gSavedSettings.setBOOL("PurgeCacheOnNextStartup", FALSE);
2541 gPurgeCache = TRUE;
2542 }
2543 // Purge cache if it belongs to an old version
2544 else
2545 {
2546 static const S32 cache_version = 5;
2547 if (gSavedSettings.getS32("LocalCacheVersion") != cache_version)
2548 {
2549 gPurgeCache = TRUE;
2550 gSavedSettings.setS32("LocalCacheVersion", cache_version);
2551 }
2552 }
2553
2554 // Setup and verify the cache location
2555 LLString cache_location = gSavedSettings.getString("CacheLocation");
2556 LLString new_cache_location = gSavedSettings.getString("NewCacheLocation");
2557 if (new_cache_location != cache_location)
2558 {
2559 gDirUtilp->setCacheDir(gSavedSettings.getString("CacheLocation"));
2560 purge_cache(); // purge old cache
2561 gSavedSettings.setString("CacheLocation", new_cache_location);
2562 }
2563
2564 if (!gDirUtilp->setCacheDir(gSavedSettings.getString("CacheLocation")))
2565 {
2566 llwarns << "Unable to set cache location" << llendl;
2567 gSavedSettings.setString("CacheLocation", "");
2568 }
2569
2570 if (gPurgeCache)
2571 {
2572 LLSplashScreen::update("Clearing cache...");
2573 purge_cache();
2574 }
2575
2576 LLSplashScreen::update("Initializing Texture Cache...");
2577
2578 // Init the texture cache
2579 // Allocate 80% of the cache size for textures
2580 BOOL read_only = gSecondInstance ? TRUE : FALSE;
2581 const S32 MB = 1024*1024;
2582 S64 cache_size = (S64)(gSavedSettings.getU32("CacheSize")) * MB;
2583 const S64 MAX_CACHE_SIZE = 1024*MB;
2584 cache_size = llmin(cache_size, MAX_CACHE_SIZE);
2585 S64 texture_cache_size = ((cache_size * 8)/10);
2586 S64 extra = gTextureCache->initCache(LL_PATH_CACHE, texture_cache_size, read_only);
2587 texture_cache_size -= extra;
2588
2589 LLSplashScreen::update("Initializing VFS...");
2590
2591 // Init the VFS
2592 S64 vfs_size = cache_size - texture_cache_size;
2593 const S64 MAX_VFS_SIZE = 1024 * MB; // 1 GB
2594 vfs_size = llmin(vfs_size, MAX_VFS_SIZE);
2595 vfs_size = (vfs_size / MB) * MB; // make sure it is MB aligned
2596 U32 vfs_size_u32 = (U32)vfs_size;
2597 U32 old_vfs_size = gSavedSettings.getU32("VFSOldSize") * MB;
2598 bool resize_vfs = (vfs_size_u32 != old_vfs_size);
2599 if (resize_vfs)
2600 {
2601 gSavedSettings.setU32("VFSOldSize", vfs_size_u32/MB);
2602 }
2603 llinfos << "VFS CACHE SIZE: " << vfs_size/(1024*1024) << " MB" << llendl;
2604
2528 // This has to happen BEFORE starting the vfs 2605 // This has to happen BEFORE starting the vfs
2529 //time_t ltime; 2606 //time_t ltime;
2530 srand(time(NULL)); 2607 srand(time(NULL)); /* Flawfinder: ignore */
2531 U32 old_salt = gSavedSettings.getU32("VFSSalt"); 2608 U32 old_salt = gSavedSettings.getU32("VFSSalt");
2532 U32 new_salt; 2609 U32 new_salt;
2533 char old_vfs_data_file[LL_MAX_PATH]; 2610 char old_vfs_data_file[LL_MAX_PATH]; /* Flawfinder: ignore */
2534 char old_vfs_index_file[LL_MAX_PATH]; 2611 char old_vfs_index_file[LL_MAX_PATH]; /* Flawfinder: ignore */
2535 char new_vfs_data_file[LL_MAX_PATH]; 2612 char new_vfs_data_file[LL_MAX_PATH]; /* Flawfinder: ignore */
2536 char new_vfs_index_file[LL_MAX_PATH]; 2613 char new_vfs_index_file[LL_MAX_PATH]; /* Flawfinder: ignore */
2537 char static_vfs_index_file[LL_MAX_PATH]; 2614 char static_vfs_index_file[LL_MAX_PATH]; /* Flawfinder: ignore */
2538 char static_vfs_data_file[LL_MAX_PATH]; 2615 char static_vfs_data_file[LL_MAX_PATH]; /* Flawfinder: ignore */
2539 2616
2540 if (gMultipleViewersOK) 2617 if (gMultipleViewersOK)
2541 { 2618 {
@@ -2550,7 +2627,7 @@ BOOL init_vfs_viewer()
2550 } while( new_salt == old_salt ); 2627 } while( new_salt == old_salt );
2551 } 2628 }
2552 2629
2553 sprintf(old_vfs_data_file, "%s%u", 2630 snprintf(old_vfs_data_file, LL_MAX_PATH, "%s%u", /* Flawfinder: ignore */
2554 gDirUtilp->getExpandedFilename(LL_PATH_CACHE,VFS_DATA_FILE_BASE).c_str(), 2631 gDirUtilp->getExpandedFilename(LL_PATH_CACHE,VFS_DATA_FILE_BASE).c_str(),
2555 old_salt); 2632 old_salt);
2556 2633
@@ -2571,10 +2648,10 @@ BOOL init_vfs_viewer()
2571 std::string found_file; 2648 std::string found_file;
2572 if (gDirUtilp->getNextFileInDir(dir, mask, found_file, FALSE)) 2649 if (gDirUtilp->getNextFileInDir(dir, mask, found_file, FALSE))
2573 { 2650 {
2574 sprintf(old_vfs_data_file, "%s%s%s", dir.c_str(), gDirUtilp->getDirDelimiter().c_str(), found_file.c_str()); 2651 snprintf(old_vfs_data_file, LL_MAX_PATH, "%s%s%s", dir.c_str(), gDirUtilp->getDirDelimiter().c_str(), found_file.c_str()); /* Flawfinder: ignore */
2575 2652
2576 S32 start_pos; 2653 S32 start_pos;
2577 S32 length = strlen(found_file.c_str()); 2654 S32 length = strlen(found_file.c_str()); /* Flawfinder: ignore*/
2578 for (start_pos = length - 1; start_pos >= 0; start_pos--) 2655 for (start_pos = length - 1; start_pos >= 0; start_pos--)
2579 { 2656 {
2580 if (found_file[start_pos] == '.') 2657 if (found_file[start_pos] == '.')
@@ -2592,7 +2669,7 @@ BOOL init_vfs_viewer()
2592 } 2669 }
2593 } 2670 }
2594 2671
2595 sprintf(old_vfs_index_file, "%s%u", 2672 snprintf(old_vfs_index_file, LL_MAX_PATH, "%s%u", /* Flawfinder: ignore */
2596 gDirUtilp->getExpandedFilename(LL_PATH_CACHE,VFS_INDEX_FILE_BASE).c_str(), 2673 gDirUtilp->getExpandedFilename(LL_PATH_CACHE,VFS_INDEX_FILE_BASE).c_str(),
2597 old_salt); 2674 old_salt);
2598 2675
@@ -2623,32 +2700,25 @@ BOOL init_vfs_viewer()
2623 gDirUtilp->deleteFilesInDir(dir, mask); 2700 gDirUtilp->deleteFilesInDir(dir, mask);
2624 } 2701 }
2625 2702
2626 sprintf(new_vfs_data_file, "%s%u", 2703 snprintf(new_vfs_data_file, LL_MAX_PATH, "%s%u", /* Flawfinder: ignore */
2627 gDirUtilp->getExpandedFilename(LL_PATH_CACHE,VFS_DATA_FILE_BASE).c_str(), 2704 gDirUtilp->getExpandedFilename(LL_PATH_CACHE,VFS_DATA_FILE_BASE).c_str(),
2628 new_salt); 2705 new_salt);
2629 2706
2630 sprintf(new_vfs_index_file, "%s%u", gDirUtilp->getExpandedFilename(LL_PATH_CACHE, VFS_INDEX_FILE_BASE).c_str(), 2707 snprintf(new_vfs_index_file, LL_MAX_PATH, "%s%u", gDirUtilp->getExpandedFilename(LL_PATH_CACHE, VFS_INDEX_FILE_BASE).c_str(), /* Flawfinder: ignore */
2631 new_salt); 2708 new_salt);
2632 2709
2633 2710
2634 strcpy(static_vfs_data_file, gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS,"static_data.db2").c_str()); 2711 strncpy(static_vfs_data_file, gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS,"static_data.db2").c_str(), LL_MAX_PATH -1); /* Flawfinder: ignore */
2635 strcpy(static_vfs_index_file, gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS,"static_index.db2").c_str()); 2712 static_vfs_data_file[LL_MAX_PATH -1] = '\0';
2636 2713 strncpy(static_vfs_index_file, gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS,"static_index.db2").c_str(), LL_MAX_PATH -1); /* Flawfinder: ignore */
2637 U32 vfs_size = gSavedSettings.getU32("VFSSize"); 2714 static_vfs_index_file[LL_MAX_PATH -1] = '\0';
2638 if (vfs_size > 4)
2639 {
2640 llwarns << "Invalid VFS size" << llendl;
2641 gSavedSettings.setU32("VFSSize", 2);
2642 vfs_size = 2;
2643 }
2644 2715
2645 if (gSavedSettings.getU32("VFSOldSize") != vfs_size) 2716 if (resize_vfs)
2646 { 2717 {
2647 llinfos << "Removing old vfs and re-sizing" << llendl; 2718 llinfos << "Removing old vfs and re-sizing" << llendl;
2648 2719
2649 LLFile::remove(old_vfs_data_file); 2720 LLFile::remove(old_vfs_data_file);
2650 LLFile::remove(old_vfs_index_file); 2721 LLFile::remove(old_vfs_index_file);
2651 gSavedSettings.setU32("VFSOldSize", vfs_size);
2652 } 2722 }
2653 else if (old_salt != new_salt) 2723 else if (old_salt != new_salt)
2654 { 2724 {
@@ -2662,16 +2732,15 @@ BOOL init_vfs_viewer()
2662 // Startup the VFS... 2732 // Startup the VFS...
2663 gSavedSettings.setU32("VFSSalt", new_salt); 2733 gSavedSettings.setU32("VFSSalt", new_salt);
2664 2734
2665 U32 presize = VFS_SIZE_MAP[gSavedSettings.getU32("VFSSize")];
2666 // Don't remove VFS after viewer crashes. If user has corrupt data, they can reinstall. JC 2735 // Don't remove VFS after viewer crashes. If user has corrupt data, they can reinstall. JC
2667 gVFS = new LLVFS(new_vfs_index_file, new_vfs_data_file, FALSE, presize, FALSE); 2736 gVFS = new LLVFS(new_vfs_index_file, new_vfs_data_file, FALSE, vfs_size_u32, FALSE);
2668 if( VFSVALID_BAD_CORRUPT == gVFS->getValidState() ) 2737 if( VFSVALID_BAD_CORRUPT == gVFS->getValidState() )
2669 { 2738 {
2670 // Try again with fresh files 2739 // Try again with fresh files
2671 // (The constructor deletes corrupt files when it finds them.) 2740 // (The constructor deletes corrupt files when it finds them.)
2672 llwarns << "VFS corrupt, deleted. Making new VFS." << llendl; 2741 llwarns << "VFS corrupt, deleted. Making new VFS." << llendl;
2673 delete gVFS; 2742 delete gVFS;
2674 gVFS = new LLVFS(new_vfs_index_file, new_vfs_data_file, FALSE, presize, FALSE); 2743 gVFS = new LLVFS(new_vfs_index_file, new_vfs_data_file, FALSE, vfs_size_u32, FALSE);
2675 } 2744 }
2676 2745
2677 gStaticVFS = new LLVFS(static_vfs_index_file, static_vfs_data_file, TRUE, 0, FALSE); 2746 gStaticVFS = new LLVFS(static_vfs_index_file, static_vfs_data_file, TRUE, 0, FALSE);
@@ -2694,7 +2763,7 @@ OSErr AEGURLHandler(const AppleEvent *messagein, AppleEvent *reply, long refIn)
2694{ 2763{
2695 OSErr result = noErr; 2764 OSErr result = noErr;
2696 DescType actualType; 2765 DescType actualType;
2697 char buffer[1024]; 2766 char buffer[1024]; /* Flawfinder: ignore */
2698 Size size; 2767 Size size;
2699 2768
2700 result = AEGetParamPtr ( 2769 result = AEGetParamPtr (
@@ -2797,7 +2866,7 @@ OSStatus DisplayReleaseNotes(void)
2797 2866
2798 LLString releaseNotesText; 2867 LLString releaseNotesText;
2799 2868
2800 LLString::read(releaseNotesText, "releasenotes.txt"); 2869 LLString::read(releaseNotesText, "releasenotes.txt"); /* Flawfinder: ignore*/
2801 2870
2802 err = HIViewFindByID(HIViewGetRoot(window), id, &textView); 2871 err = HIViewFindByID(HIViewGetRoot(window), id, &textView);
2803 2872
@@ -2982,10 +3051,11 @@ void save_final_snapshot(void*)
2982 gAgent.changeCameraToThirdPerson( FALSE ); // don't animate, need immediate switch 3051 gAgent.changeCameraToThirdPerson( FALSE ); // don't animate, need immediate switch
2983 gSavedSettings.setBOOL("ShowParcelOwners", FALSE); 3052 gSavedSettings.setBOOL("ShowParcelOwners", FALSE);
2984 idle(); 3053 idle();
2985 char temp_str[MAX_PATH]; 3054 char temp_str[MAX_PATH]; /* Flawfinder: ignore */
2986 strcpy (temp_str,gDirUtilp->getLindenUserDir().c_str()); 3055 strncpy (temp_str,gDirUtilp->getLindenUserDir().c_str(), MAX_PATH -1); /* Flawfinder: ignore */
2987 strcat (temp_str,"/"); 3056 temp_str[MAX_PATH -1] = '\0';
2988 strcat (temp_str,SCREEN_LAST_FILENAME); 3057 strcat (temp_str,"/"); /* Flawfinder: ignore */
3058 strcat (temp_str,SCREEN_LAST_FILENAME); /* Flawfinder: ignore */
2989 gViewerWindow->saveSnapshot(temp_str, gViewerWindow->getWindowWidth(), gViewerWindow->getWindowHeight(), FALSE, TRUE); 3059 gViewerWindow->saveSnapshot(temp_str, gViewerWindow->getWindowWidth(), gViewerWindow->getWindowHeight(), FALSE, TRUE);
2990 gHaveSavedSnapshot = TRUE; 3060 gHaveSavedSnapshot = TRUE;
2991 } 3061 }
@@ -3089,8 +3159,8 @@ void idle_shutdown()
3089 S32 finished_uploads = total_uploads - pending_uploads; 3159 S32 finished_uploads = total_uploads - pending_uploads;
3090 F32 percent = 100.f * finished_uploads / total_uploads; 3160 F32 percent = 100.f * finished_uploads / total_uploads;
3091 gViewerWindow->setProgressPercent(percent); 3161 gViewerWindow->setProgressPercent(percent);
3092 char buffer[MAX_STRING]; 3162 char buffer[MAX_STRING]; /* Flawfinder: ignore */
3093 sprintf(buffer, "Saving final data..."); 3163 snprintf(buffer, MAX_STRING, "Saving final data..."); /* Flawfinder: ignore */
3094 gViewerWindow->setProgressString(buffer); 3164 gViewerWindow->setProgressString(buffer);
3095 return; 3165 return;
3096 } 3166 }
@@ -3164,6 +3234,7 @@ void update_statistics(U32 frame_count)
3164 gViewerStats->incStat(LLViewerStats::ST_TOOLBOX_SECONDS, gFrameIntervalSeconds); 3234 gViewerStats->incStat(LLViewerStats::ST_TOOLBOX_SECONDS, gFrameIntervalSeconds);
3165 } 3235 }
3166 } 3236 }
3237 gViewerStats->setStat(LLViewerStats::ST_ENABLE_VBO, (F64)gSavedSettings.getBOOL("RenderVBOEnable"));
3167 gViewerStats->setStat(LLViewerStats::ST_LIGHTING_DETAIL, (F64)gSavedSettings.getS32("RenderLightingDetail")); 3238 gViewerStats->setStat(LLViewerStats::ST_LIGHTING_DETAIL, (F64)gSavedSettings.getS32("RenderLightingDetail"));
3168 gViewerStats->setStat(LLViewerStats::ST_DRAW_DIST, (F64)gSavedSettings.getF32("RenderFarClip")); 3239 gViewerStats->setStat(LLViewerStats::ST_DRAW_DIST, (F64)gSavedSettings.getF32("RenderFarClip"));
3169 gViewerStats->setStat(LLViewerStats::ST_CHAT_BUBBLES, (F64)gSavedSettings.getBOOL("UseChatBubbles")); 3240 gViewerStats->setStat(LLViewerStats::ST_CHAT_BUBBLES, (F64)gSavedSettings.getBOOL("UseChatBubbles"));
@@ -3193,10 +3264,7 @@ void update_statistics(U32 frame_count)
3193 gViewerStats->mSimPingStat.addValue(10000); 3264 gViewerStats->mSimPingStat.addValue(10000);
3194 } 3265 }
3195 3266
3196 if (!gViewerWindow->renderingFastFrame()) 3267 gViewerStats->mFPSStat.addValue(1);
3197 {
3198 gViewerStats->mFPSStat.addValue(1);
3199 }
3200 F32 layer_bits = (F32)(gVLManager.getLandBits() + gVLManager.getWindBits() + gVLManager.getCloudBits()); 3268 F32 layer_bits = (F32)(gVLManager.getLandBits() + gVLManager.getWindBits() + gVLManager.getCloudBits());
3201 gViewerStats->mLayersKBitStat.addValue(layer_bits/1024.f); 3269 gViewerStats->mLayersKBitStat.addValue(layer_bits/1024.f);
3202 gViewerStats->mObjectKBitStat.addValue(gObjectBits/1024.f); 3270 gViewerStats->mObjectKBitStat.addValue(gObjectBits/1024.f);
@@ -3249,11 +3317,11 @@ void update_statistics(U32 frame_count)
3249 3317
3250 // Argh! Shouldn't be doing the rendering here, it should be in a UI class! 3318 // Argh! Shouldn't be doing the rendering here, it should be in a UI class!
3251 3319
3252 static char wind_vel_text[MAX_TEXT_LENGTH]; 3320 static char wind_vel_text[MAX_TEXT_LENGTH]; /* Flawfinder: ignore */
3253 static char wind_vector_text[MAX_TEXT_LENGTH]; 3321 static char wind_vector_text[MAX_TEXT_LENGTH]; /* Flawfinder: ignore */
3254 static char rwind_vel_text[MAX_TEXT_LENGTH]; 3322 static char rwind_vel_text[MAX_TEXT_LENGTH]; /* Flawfinder: ignore */
3255 static char rwind_vector_text[MAX_TEXT_LENGTH]; 3323 static char rwind_vector_text[MAX_TEXT_LENGTH]; /* Flawfinder: ignore */
3256 static char audio_text[MAX_TEXT_LENGTH]; 3324 static char audio_text[MAX_TEXT_LENGTH]; /* Flawfinder: ignore */
3257 3325
3258 // Now draw the text 3326 // Now draw the text
3259 LLGLSUIDefault gls_ui; 3327 LLGLSUIDefault gls_ui;
@@ -3269,46 +3337,46 @@ void update_statistics(U32 frame_count)
3269 3337
3270 if (gDisplayCameraPos) 3338 if (gDisplayCameraPos)
3271 { 3339 {
3272 char camera_view_text[MAX_TEXT_LENGTH]; 3340 char camera_view_text[MAX_TEXT_LENGTH]; /* Flawfinder: ignore */
3273 char camera_center_text[MAX_TEXT_LENGTH]; 3341 char camera_center_text[MAX_TEXT_LENGTH]; /* Flawfinder: ignore */
3274 char agent_view_text[MAX_TEXT_LENGTH]; 3342 char agent_view_text[MAX_TEXT_LENGTH]; /* Flawfinder: ignore */
3275 char agent_left_text[MAX_TEXT_LENGTH]; 3343 char agent_left_text[MAX_TEXT_LENGTH]; /* Flawfinder: ignore */
3276 char agent_center_text[MAX_TEXT_LENGTH]; 3344 char agent_center_text[MAX_TEXT_LENGTH]; /* Flawfinder: ignore */
3277 char agent_root_center_text[MAX_TEXT_LENGTH]; 3345 char agent_root_center_text[MAX_TEXT_LENGTH]; /* Flawfinder: ignore */
3278 3346
3279 LLVector3d tvector; // Temporary vector to hold data for printing. 3347 LLVector3d tvector; // Temporary vector to hold data for printing.
3280 3348
3281 // Update camera center, camera view, wind info every other frame 3349 // Update camera center, camera view, wind info every other frame
3282 tvector = gAgent.getPositionGlobal(); 3350 tvector = gAgent.getPositionGlobal();
3283 sprintf(agent_center_text, "AgentCenter %f %f %f", 3351 snprintf(agent_center_text, MAX_TEXT_LENGTH, "AgentCenter %f %f %f", /* Flawfinder: ignore */
3284 (F32)(tvector.mdV[VX]), (F32)(tvector.mdV[VY]), (F32)(tvector.mdV[VZ])); 3352 (F32)(tvector.mdV[VX]), (F32)(tvector.mdV[VY]), (F32)(tvector.mdV[VZ]));
3285 3353
3286 if (gAgent.getAvatarObject()) 3354 if (gAgent.getAvatarObject())
3287 { 3355 {
3288 tvector = gAgent.getPosGlobalFromAgent(gAgent.getAvatarObject()->mRoot.getWorldPosition()); 3356 tvector = gAgent.getPosGlobalFromAgent(gAgent.getAvatarObject()->mRoot.getWorldPosition());
3289 sprintf(agent_root_center_text, "AgentRootCenter %f %f %f", 3357 snprintf(agent_root_center_text, MAX_TEXT_LENGTH, "AgentRootCenter %f %f %f", /* Flawfinder: ignore */
3290 (F32)(tvector.mdV[VX]), (F32)(tvector.mdV[VY]), (F32)(tvector.mdV[VZ])); 3358 (F32)(tvector.mdV[VX]), (F32)(tvector.mdV[VY]), (F32)(tvector.mdV[VZ]));
3291 } 3359 }
3292 else 3360 else
3293 { 3361 {
3294 sprintf(agent_root_center_text, "---"); 3362 snprintf(agent_root_center_text, MAX_TEXT_LENGTH, "---"); /* Flawfinder: ignore */
3295 } 3363 }
3296 3364
3297 3365
3298 tvector = LLVector4(gAgent.getFrameAgent().getAtAxis()); 3366 tvector = LLVector4(gAgent.getFrameAgent().getAtAxis());
3299 sprintf(agent_view_text, "AgentAtAxis %f %f %f", 3367 snprintf(agent_view_text, MAX_TEXT_LENGTH, "AgentAtAxis %f %f %f", /* Flawfinder: ignore */
3300 (F32)(tvector.mdV[VX]), (F32)(tvector.mdV[VY]), (F32)(tvector.mdV[VZ])); 3368 (F32)(tvector.mdV[VX]), (F32)(tvector.mdV[VY]), (F32)(tvector.mdV[VZ]));
3301 3369
3302 tvector = LLVector4(gAgent.getFrameAgent().getLeftAxis()); 3370 tvector = LLVector4(gAgent.getFrameAgent().getLeftAxis());
3303 sprintf(agent_left_text, "AgentLeftAxis %f %f %f", 3371 snprintf(agent_left_text, MAX_TEXT_LENGTH, "AgentLeftAxis %f %f %f", /* Flawfinder: ignore */
3304 (F32)(tvector.mdV[VX]), (F32)(tvector.mdV[VY]), (F32)(tvector.mdV[VZ])); 3372 (F32)(tvector.mdV[VX]), (F32)(tvector.mdV[VY]), (F32)(tvector.mdV[VZ]));
3305 3373
3306 tvector = gAgent.getCameraPositionGlobal(); 3374 tvector = gAgent.getCameraPositionGlobal();
3307 sprintf(camera_center_text, "CameraCenter %f %f %f", 3375 snprintf(camera_center_text, MAX_TEXT_LENGTH, "CameraCenter %f %f %f", /* Flawfinder: ignore */
3308 (F32)(tvector.mdV[VX]), (F32)(tvector.mdV[VY]), (F32)(tvector.mdV[VZ])); 3376 (F32)(tvector.mdV[VX]), (F32)(tvector.mdV[VY]), (F32)(tvector.mdV[VZ]));
3309 3377
3310 tvector = LLVector4(gCamera->getAtAxis()); 3378 tvector = LLVector4(gCamera->getAtAxis());
3311 sprintf(camera_view_text, "CameraAtAxis %f %f %f", 3379 snprintf(camera_view_text, MAX_TEXT_LENGTH, "CameraAtAxis %f %f %f", /* Flawfinder: ignore */
3312 (F32)(tvector.mdV[VX]), (F32)(tvector.mdV[VY]), (F32)(tvector.mdV[VZ])); 3380 (F32)(tvector.mdV[VX]), (F32)(tvector.mdV[VY]), (F32)(tvector.mdV[VZ]));
3313 3381
3314 add_text(xpos, ypos, agent_center_text); ypos += y_inc; 3382 add_text(xpos, ypos, agent_center_text); ypos += y_inc;
@@ -3321,10 +3389,10 @@ void update_statistics(U32 frame_count)
3321 3389
3322 if (gDisplayWindInfo) 3390 if (gDisplayWindInfo)
3323 { 3391 {
3324 sprintf(wind_vel_text, "Wind velocity %.2f m/s", gWindVec.magVec()); 3392 snprintf(wind_vel_text, MAX_TEXT_LENGTH, "Wind velocity %.2f m/s", gWindVec.magVec()); /* Flawfinder: ignore */
3325 sprintf(wind_vector_text, "Wind vector %.2f %.2f %.2f", gWindVec.mV[0], gWindVec.mV[1], gWindVec.mV[2]); 3393 snprintf(wind_vector_text, MAX_TEXT_LENGTH, "Wind vector %.2f %.2f %.2f", gWindVec.mV[0], gWindVec.mV[1], gWindVec.mV[2]); /* Flawfinder: ignore */
3326 sprintf(rwind_vel_text, "RWind vel %.2f m/s", gRelativeWindVec.magVec()); 3394 snprintf(rwind_vel_text, MAX_TEXT_LENGTH, "RWind vel %.2f m/s", gRelativeWindVec.magVec()); /* Flawfinder: ignore */
3327 sprintf(rwind_vector_text, "RWind vec %.2f %.2f %.2f", gRelativeWindVec.mV[0], gRelativeWindVec.mV[1], gRelativeWindVec.mV[2]); 3395 snprintf(rwind_vector_text, MAX_TEXT_LENGTH, "RWind vec %.2f %.2f %.2f", gRelativeWindVec.mV[0], gRelativeWindVec.mV[1], gRelativeWindVec.mV[2]); /* Flawfinder: ignore */
3328 3396
3329 add_text(xpos, ypos, wind_vel_text); ypos += y_inc; 3397 add_text(xpos, ypos, wind_vel_text); ypos += y_inc;
3330 add_text(xpos, ypos, wind_vector_text); ypos += y_inc; 3398 add_text(xpos, ypos, wind_vector_text); ypos += y_inc;
@@ -3335,14 +3403,14 @@ void update_statistics(U32 frame_count)
3335 { 3403 {
3336 if (gAudiop) 3404 if (gAudiop)
3337 { 3405 {
3338 sprintf(audio_text, "Audio for wind: %d", gAudiop->isWindEnabled()); 3406 snprintf(audio_text, MAX_TEXT_LENGTH, "Audio for wind: %d", gAudiop->isWindEnabled()); /* Flawfinder: ignore */
3339 } 3407 }
3340 add_text(xpos, ypos, audio_text); ypos += y_inc; 3408 add_text(xpos, ypos, audio_text); ypos += y_inc;
3341 } 3409 }
3342 if (gDisplayFOV) 3410 if (gDisplayFOV)
3343 { 3411 {
3344 char fov_string[MAX_TEXT_LENGTH]; 3412 char fov_string[MAX_TEXT_LENGTH]; /* Flawfinder: ignore */
3345 sprintf(fov_string, "FOV: %2.1f deg", RAD_TO_DEG * gCamera->getView()); 3413 snprintf(fov_string, MAX_TEXT_LENGTH, "FOV: %2.1f deg", RAD_TO_DEG * gCamera->getView()); /* Flawfinder: ignore */
3346 add_text(xpos, ypos, fov_string); 3414 add_text(xpos, ypos, fov_string);
3347 ypos += y_inc; 3415 ypos += y_inc;
3348 } 3416 }
@@ -3352,6 +3420,14 @@ void update_statistics(U32 frame_count)
3352 add_text(xpos, ypos, "Shaders Disabled"); 3420 add_text(xpos, ypos, "Shaders Disabled");
3353 ypos += y_inc; 3421 ypos += y_inc;
3354 } 3422 }
3423 add_text(xpos, ypos, (char*) llformat("%d MB Vertex Data", LLVertexBuffer::sAllocatedBytes/(1024*1024)).c_str());
3424 ypos += y_inc;
3425
3426 add_text(xpos, ypos, (char*) llformat("%d Pending Lock", LLVertexBuffer::sLockedList.size()).c_str());
3427 ypos += y_inc;
3428
3429 add_text(xpos, ypos, (char*) llformat("%d Vertex Buffers", LLVertexBuffer::sGLCount).c_str());
3430 ypos += y_inc;
3355#endif 3431#endif
3356 if (LLPipeline::getRenderParticleBeacons(NULL)) 3432 if (LLPipeline::getRenderParticleBeacons(NULL))
3357 { 3433 {
@@ -3471,8 +3547,7 @@ void idle_network()
3471 3547
3472 if (gPrintMessagesThisFrame) 3548 if (gPrintMessagesThisFrame)
3473 { 3549 {
3474 llinfos << "Decoded " << total_decoded 3550 llinfos << "Decoded " << total_decoded << " msgs this frame!" << llendl;
3475 << " msgs this frame!" << llendl;
3476 gPrintMessagesThisFrame = FALSE; 3551 gPrintMessagesThisFrame = FALSE;
3477 } 3552 }
3478 } 3553 }
@@ -3530,9 +3605,9 @@ void idle()
3530 LLControlBase::updateAllListeners(); 3605 LLControlBase::updateAllListeners();
3531 3606
3532 LLFrameTimer::updateFrameTime(); 3607 LLFrameTimer::updateFrameTime();
3608 LLEventTimer::updateClass();
3533 LLCriticalDamp::updateInterpolants(); 3609 LLCriticalDamp::updateInterpolants();
3534 LLMortician::updateClass(); 3610 LLMortician::updateClass();
3535
3536 F32 dt_raw = idle_timer.getElapsedTimeAndResetF32(); 3611 F32 dt_raw = idle_timer.getElapsedTimeAndResetF32();
3537 3612
3538 // Cap out-of-control frame times 3613 // Cap out-of-control frame times
@@ -3693,7 +3768,6 @@ void idle()
3693 { 3768 {
3694// LLFastTimer t(LLFastTimer::FTM_IDLE_CB); 3769// LLFastTimer t(LLFastTimer::FTM_IDLE_CB);
3695 3770
3696 LLEventTimer::updateClass();
3697 // Do event notifications if necessary. Yes, we may want to move this elsewhere. 3771 // Do event notifications if necessary. Yes, we may want to move this elsewhere.
3698 gEventNotifier.update(); 3772 gEventNotifier.update();
3699 3773
@@ -3737,8 +3811,6 @@ void idle()
3737 gPipeline.resetDrawOrders(); 3811 gPipeline.resetDrawOrders();
3738 } 3812 }
3739 { 3813 {
3740 //LLFastTimer t(LLFastTimer::FTM_TEMP1);
3741
3742 // Handle pending gesture processing 3814 // Handle pending gesture processing
3743 gGestureManager.update(); 3815 gGestureManager.update();
3744 3816
@@ -3749,8 +3821,6 @@ void idle()
3749 LLFastTimer t(LLFastTimer::FTM_OBJECTLIST_UPDATE); // Actually "object update" 3821 LLFastTimer t(LLFastTimer::FTM_OBJECTLIST_UPDATE); // Actually "object update"
3750 gFrameStats.start(LLFrameStats::OBJECT_UPDATE); 3822 gFrameStats.start(LLFrameStats::OBJECT_UPDATE);
3751 3823
3752 LLVolumeImplFlexible::resetUpdateBins();
3753
3754 if (!(gLogoutRequestSent && gHaveSavedSnapshot)) 3824 if (!(gLogoutRequestSent && gHaveSavedSnapshot))
3755 { 3825 {
3756 gObjectList.update(gAgent, *gWorldp); 3826 gObjectList.update(gAgent, *gWorldp);
@@ -3816,8 +3886,9 @@ void idle()
3816 3886
3817 gWorldp->updateVisibilities(); 3887 gWorldp->updateVisibilities();
3818 { 3888 {
3889 const F32 max_region_update_time = .001f; // 1ms
3819 LLFastTimer t(LLFastTimer::FTM_REGION_UPDATE); 3890 LLFastTimer t(LLFastTimer::FTM_REGION_UPDATE);
3820 gWorldp->updateRegions(); 3891 gWorldp->updateRegions(max_region_update_time);
3821 } 3892 }
3822 3893
3823 ///////////////////////// 3894 /////////////////////////
@@ -3827,8 +3898,6 @@ void idle()
3827 3898
3828 if (!gNoRender) 3899 if (!gNoRender)
3829 { 3900 {
3830 gSky.updateFog(gCamera->getFar());
3831
3832 gWorldp->updateClouds(gFrameDTClamped); 3901 gWorldp->updateClouds(gFrameDTClamped);
3833 gSky.propagateHeavenlyBodies(gFrameDTClamped); // moves sun, moon, and planets 3902 gSky.propagateHeavenlyBodies(gFrameDTClamped); // moves sun, moon, and planets
3834 3903
@@ -3866,31 +3935,22 @@ void idle()
3866 // 3935 //
3867 gFrameStats.start(LLFrameStats::IMAGE_UPDATE); 3936 gFrameStats.start(LLFrameStats::IMAGE_UPDATE);
3868 3937
3869 if (!gViewerWindow->renderingFastFrame()) 3938 LLFastTimer t(LLFastTimer::FTM_IMAGE_UPDATE);
3870 { 3939
3871 LLFastTimer t(LLFastTimer::FTM_IMAGE_UPDATE); 3940 LLViewerImage::updateClass(gCamera->getVelocityStat()->getMean(),
3872 3941 gCamera->getAngularVelocityStat()->getMean());
3873 LLViewerImage::updateClass(gCamera->getVelocityStat()->getMean(),
3874 gCamera->getAngularVelocityStat()->getMean());
3875 3942
3876 gBumpImageList.updateImages(); // must be called before gImageList version so that it's textures are thrown out first. 3943 gBumpImageList.updateImages(); // must be called before gImageList version so that it's textures are thrown out first.
3877 3944
3878 const F32 max_image_decode_time = 0.005f; // 5 ms decode time 3945 const F32 max_image_decode_time = 0.005f; // 5 ms decode time
3879 gImageList.updateImages(max_image_decode_time); 3946 gImageList.updateImages(max_image_decode_time);
3880 stop_glerror(); 3947 stop_glerror();
3881 }
3882 3948
3883 ////////////////////////////////////// 3949 //////////////////////////////////////
3884 // 3950 //
3885 // Sort and cull in the new renderer are moved to pipeline.cpp 3951 // Sort and cull in the new renderer are moved to pipeline.cpp
3886 // Here, particles are updated and drawables are moved. 3952 // Here, particles are updated and drawables are moved.
3887 // 3953 //
3888 if (gViewerWindow->renderingFastFrame() || gViewerWindow->firstFastFrame())
3889 {
3890 gFrameStats.start(LLFrameStats::UPDATE_MOVE);
3891 gFrameStats.start(LLFrameStats::UPDATE_CULL);
3892 gFrameStats.start(LLFrameStats::UPDATE_GEOM);
3893 }
3894 3954
3895 if (!gNoRender) 3955 if (!gNoRender)
3896 { 3956 {
@@ -3899,9 +3959,6 @@ void idle()
3899 3959
3900 gFrameStats.start(LLFrameStats::UPDATE_PARTICLES); 3960 gFrameStats.start(LLFrameStats::UPDATE_PARTICLES);
3901 gWorldp->updateParticles(); 3961 gWorldp->updateParticles();
3902
3903 //now that transforms are updated, update flexible objects
3904 LLVolumeImplFlexible::doFlexibleUpdateBins();
3905 } 3962 }
3906 stop_glerror(); 3963 stop_glerror();
3907 3964
@@ -3909,7 +3966,6 @@ void idle()
3909 3966
3910 // objects and camera should be in sync, do LOD calculations now 3967 // objects and camera should be in sync, do LOD calculations now
3911 { 3968 {
3912// LLFastTimer t(LLFastTimer::FTM_OBJECTLIST_UPDATE); // Actually "object update"
3913 LLFastTimer t(LLFastTimer::FTM_LOD_UPDATE); 3969 LLFastTimer t(LLFastTimer::FTM_LOD_UPDATE);
3914 gObjectList.updateApparentAngles(gAgent); 3970 gObjectList.updateApparentAngles(gAgent);
3915 } 3971 }
@@ -4018,6 +4074,35 @@ F32 mouse_y_from_center(S32 y)
4018 4074
4019///////////////////////////////////////////////////////// 4075/////////////////////////////////////////////////////////
4020 4076
4077class AudioSettingsListener: public LLSimpleListener
4078{
4079 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
4080 {
4081 // Note: Ignore the specific event value, look up the ones we want
4082 if (!gAudiop) return true;
4083 gAudiop->setDopplerFactor(gSavedSettings.getF32("AudioLevelDoppler"));
4084 gAudiop->setDistanceFactor(gSavedSettings.getF32("AudioLevelDistance"));
4085#ifdef kAUDIO_ENABLE_WIND
4086 // Wind Gain
4087 gAudiop->mMaxWindGain = gSavedSettings.getF32("AudioLevelWind");
4088 // Rolloff
4089 LLVector3 camera_pos = gAgent.getCameraPositionAgent();
4090 LLViewerRegion* region = gAgent.getRegion();
4091 F32 camera_water_height = region ? camera_pos.mV[VZ] - region->getWaterHeight() : 0.f;
4092 if (camera_water_height < 0.f)
4093 {
4094 gAudiop->setRolloffFactor(gSavedSettings.getF32("AudioLevelRolloff") * LL_ROLLOFF_MULTIPLIER_UNDER_WATER);
4095 }
4096 else
4097 {
4098 gAudiop->setRolloffFactor(gSavedSettings.getF32("AudioLevelRolloff"));
4099 }
4100#endif
4101 return true;
4102 }
4103};
4104static AudioSettingsListener audio_settings_listener;
4105
4021void init_audio() 4106void init_audio()
4022{ 4107{
4023 if (!gAudiop) 4108 if (!gAudiop)
@@ -4086,6 +4171,8 @@ void init_audio()
4086#ifdef kAUDIO_ENABLE_WIND 4171#ifdef kAUDIO_ENABLE_WIND
4087 gAudiop->enableWind(!mute_audio); 4172 gAudiop->enableWind(!mute_audio);
4088 gAudiop->mMaxWindGain = gSavedSettings.getF32("AudioLevelWind"); 4173 gAudiop->mMaxWindGain = gSavedSettings.getF32("AudioLevelWind");
4174 gSavedSettings.getControl("AudioLevelWind")->addListener(&audio_settings_listener);
4175 gSavedSettings.getControl("AudioLevelRolloff")->addListener(&audio_settings_listener);
4089 // don't use the setter setMaxWindGain() because we don't 4176 // don't use the setter setMaxWindGain() because we don't
4090 // want to screw up the fade-in on startup by setting actual source gain 4177 // want to screw up the fade-in on startup by setting actual source gain
4091 // outside the fade-in. 4178 // outside the fade-in.
@@ -4094,8 +4181,10 @@ void init_audio()
4094 gAudiop->setMasterGain ( gSavedSettings.getF32 ( "AudioLevelMaster" ) ); 4181 gAudiop->setMasterGain ( gSavedSettings.getF32 ( "AudioLevelMaster" ) );
4095 4182
4096 gAudiop->setDopplerFactor(gSavedSettings.getF32("AudioLevelDoppler")); 4183 gAudiop->setDopplerFactor(gSavedSettings.getF32("AudioLevelDoppler"));
4097 gAudiop->setDistanceFactor(gSavedSettings.getF32("AudioLevelDistance")); 4184 gSavedSettings.getControl("AudioLevelDoppler")->addListener(&audio_settings_listener);
4098 gAudiop->setRolloffFactor(gSavedSettings.getF32("AudioLevelRolloff")); 4185 gAudiop->setDistanceFactor(gSavedSettings.getF32("AudioLevelDistance"));
4186 gSavedSettings.getControl("AudioLevelDistance")->addListener(&audio_settings_listener);
4187 gAudiop->setRolloffFactor(gSavedSettings.getF32("AudioLevelRolloff"));
4099 gAudiop->setMuted(mute_audio); 4188 gAudiop->setMuted(mute_audio);
4100} 4189}
4101 4190
@@ -4647,16 +4736,6 @@ class LLNightBrightnessListener: public LLSimpleListener
4647}; 4736};
4648static LLNightBrightnessListener night_brightness_listener; 4737static LLNightBrightnessListener night_brightness_listener;
4649 4738
4650class LLUseAGPListener: public LLSimpleListener
4651{
4652 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
4653 {
4654 gPipeline.setUseAGP(event->getValue().asBoolean() && gGLManager.mHasAnyAGP);
4655 return true;
4656 }
4657};
4658static LLUseAGPListener use_agp_listener;
4659
4660class LLFogRatioListener: public LLSimpleListener 4739class LLFogRatioListener: public LLSimpleListener
4661{ 4740{
4662 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) 4741 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
@@ -4858,6 +4937,16 @@ class LLAudioMuteListener: public LLSimpleListener
4858 4937
4859static LLAudioMuteListener audio_mute_listener; 4938static LLAudioMuteListener audio_mute_listener;
4860 4939
4940class LLUseOcclusionListener: public LLSimpleListener
4941{
4942 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
4943 {
4944 LLPipeline::sUseOcclusion = (event->getValue().asBoolean() && gGLManager.mHasOcclusionQuery &&
4945 !gUseWireframe);
4946 return true;
4947 }
4948};
4949static LLUseOcclusionListener use_occlusion_listener;
4861 4950
4862class LLNumpadControlListener: public LLSimpleListener 4951class LLNumpadControlListener: public LLSimpleListener
4863{ 4952{
@@ -4873,6 +4962,26 @@ class LLNumpadControlListener: public LLSimpleListener
4873 4962
4874static LLNumpadControlListener numpad_control_listener; 4963static LLNumpadControlListener numpad_control_listener;
4875 4964
4965class LLRenderUseVBOListener: public LLSimpleListener
4966{
4967 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
4968 {
4969 gPipeline.setUseVBO(event->getValue().asBoolean());
4970 return true;
4971 }
4972};
4973static LLRenderUseVBOListener render_use_vbo_listener;
4974
4975class LLRenderLightingDetailListener: public LLSimpleListener
4976{
4977 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
4978 {
4979 gPipeline.setLightingDetail(event->getValue().asInteger());
4980 return true;
4981 }
4982};
4983static LLRenderLightingDetailListener render_lighting_detail_listener;
4984
4876// Use these strictly for things that are constructed at startup, 4985// Use these strictly for things that are constructed at startup,
4877// or for things that are performance critical. JC 4986// or for things that are performance critical. JC
4878void saved_settings_to_globals() 4987void saved_settings_to_globals()
@@ -4894,7 +5003,6 @@ void saved_settings_to_globals()
4894 LLVOSky::sNighttimeBrightness = gSavedSettings.getF32("RenderNightBrightness"); 5003 LLVOSky::sNighttimeBrightness = gSavedSettings.getF32("RenderNightBrightness");
4895 5004
4896 LLImageGL::sGlobalUseAnisotropic = gSavedSettings.getBOOL("RenderAnisotropic"); 5005 LLImageGL::sGlobalUseAnisotropic = gSavedSettings.getBOOL("RenderAnisotropic");
4897 gRenderLightGlows = gSavedSettings.getBOOL("RenderLightGlows");
4898 LLVOVolume::sLODFactor = gSavedSettings.getF32("RenderVolumeLODFactor"); 5006 LLVOVolume::sLODFactor = gSavedSettings.getF32("RenderVolumeLODFactor");
4899 LLVOVolume::sDistanceFactor = 1.f-LLVOVolume::sLODFactor * 0.1f; 5007 LLVOVolume::sDistanceFactor = 1.f-LLVOVolume::sLODFactor * 0.1f;
4900 LLVolumeImplFlexible::sUpdateFactor = gSavedSettings.getF32("RenderFlexTimeFactor"); 5008 LLVolumeImplFlexible::sUpdateFactor = gSavedSettings.getF32("RenderFlexTimeFactor");
@@ -4908,9 +5016,6 @@ void saved_settings_to_globals()
4908 LLSelectMgr::sRectSelectInclusive = gSavedSettings.getBOOL("RectangleSelectInclusive"); 5016 LLSelectMgr::sRectSelectInclusive = gSavedSettings.getBOOL("RectangleSelectInclusive");
4909 LLSelectMgr::sRenderHiddenSelections = gSavedSettings.getBOOL("RenderHiddenSelections"); 5017 LLSelectMgr::sRenderHiddenSelections = gSavedSettings.getBOOL("RenderHiddenSelections");
4910 LLSelectMgr::sRenderLightRadius = gSavedSettings.getBOOL("RenderLightRadius"); 5018 LLSelectMgr::sRenderLightRadius = gSavedSettings.getBOOL("RenderLightRadius");
4911// LLViewerObject::sUseSharedDrawables = gSavedSettings.getBOOL("RenderUseSharedDrawables");
4912 BOOL use_occlusion = gSavedSettings.getBOOL("UseOcclusion");
4913 gPipeline.setUseOcclusionCulling( use_occlusion );
4914 5019
4915 gFrameStats.setTrackStats(gSavedSettings.getBOOL("StatsSessionTrackFrameStats")); 5020 gFrameStats.setTrackStats(gSavedSettings.getBOOL("StatsSessionTrackFrameStats"));
4916 gAgentPilot.mNumRuns = gSavedSettings.getS32("StatsNumRuns"); 5021 gAgentPilot.mNumRuns = gSavedSettings.getS32("StatsNumRuns");
@@ -4922,7 +5027,6 @@ void saved_settings_to_globals()
4922 gAFKTimeout = gSavedSettings.getF32("AFKTimeout"); 5027 gAFKTimeout = gSavedSettings.getF32("AFKTimeout");
4923 gMouseSensitivity = gSavedSettings.getF32("MouseSensitivity"); 5028 gMouseSensitivity = gSavedSettings.getF32("MouseSensitivity");
4924 gInvertMouse = gSavedSettings.getBOOL("InvertMouse"); 5029 gInvertMouse = gSavedSettings.getBOOL("InvertMouse");
4925 gAvatarBacklight = gSavedSettings.getBOOL("AvatarBacklight");
4926 gShowObjectUpdates = gSavedSettings.getBOOL("ShowObjectUpdates"); 5030 gShowObjectUpdates = gSavedSettings.getBOOL("ShowObjectUpdates");
4927 gMapScale = gSavedSettings.getF32("MapScale"); 5031 gMapScale = gSavedSettings.getF32("MapScale");
4928 gMiniMapScale = gSavedSettings.getF32("MiniMapScale"); 5032 gMiniMapScale = gSavedSettings.getF32("MiniMapScale");
@@ -4941,6 +5045,7 @@ void saved_settings_to_globals()
4941 gSavedSettings.getControl("RenderTerrainDetail")->addListener(&terrain_detail_listener); 5045 gSavedSettings.getControl("RenderTerrainDetail")->addListener(&terrain_detail_listener);
4942 gSavedSettings.getControl("RenderRippleWater")->addListener(&set_shader_listener); 5046 gSavedSettings.getControl("RenderRippleWater")->addListener(&set_shader_listener);
4943 gSavedSettings.getControl("RenderAvatarVP")->addListener(&set_shader_listener); 5047 gSavedSettings.getControl("RenderAvatarVP")->addListener(&set_shader_listener);
5048 gSavedSettings.getControl("RenderDynamicReflections")->addListener(&set_shader_listener);
4944 gSavedSettings.getControl("RenderAvatarMode")->addListener(&set_shader_listener); 5049 gSavedSettings.getControl("RenderAvatarMode")->addListener(&set_shader_listener);
4945 gSavedSettings.getControl("RenderVolumeLODFactor")->addListener(&volume_lod_listener); 5050 gSavedSettings.getControl("RenderVolumeLODFactor")->addListener(&volume_lod_listener);
4946 gSavedSettings.getControl("RenderAvatarLODFactor")->addListener(&avatar_lod_listener); 5051 gSavedSettings.getControl("RenderAvatarLODFactor")->addListener(&avatar_lod_listener);
@@ -4949,7 +5054,6 @@ void saved_settings_to_globals()
4949 gSavedSettings.getControl("ThrottleBandwidthKBPS")->addListener(&bandwidth_listener); 5054 gSavedSettings.getControl("ThrottleBandwidthKBPS")->addListener(&bandwidth_listener);
4950 gSavedSettings.getControl("RenderGamma")->addListener(&gamma_listener); 5055 gSavedSettings.getControl("RenderGamma")->addListener(&gamma_listener);
4951 gSavedSettings.getControl("RenderNightBrightness")->addListener(&night_brightness_listener); 5056 gSavedSettings.getControl("RenderNightBrightness")->addListener(&night_brightness_listener);
4952 gSavedSettings.getControl("RenderUseAGP")->addListener(&use_agp_listener);
4953 gSavedSettings.getControl("RenderFogRatio")->addListener(&fog_ratio_listener); 5057 gSavedSettings.getControl("RenderFogRatio")->addListener(&fog_ratio_listener);
4954 gSavedSettings.getControl("RenderMaxPartCount")->addListener(&max_partCount_listener); 5058 gSavedSettings.getControl("RenderMaxPartCount")->addListener(&max_partCount_listener);
4955 gSavedSettings.getControl("AvatarCompositeLimit")->addListener(&composite_limit_listener); 5059 gSavedSettings.getControl("AvatarCompositeLimit")->addListener(&composite_limit_listener);
@@ -4957,12 +5061,13 @@ void saved_settings_to_globals()
4957 gSavedSettings.getControl("ChatFontSize")->addListener(&chat_font_size_listener); 5061 gSavedSettings.getControl("ChatFontSize")->addListener(&chat_font_size_listener);
4958 gSavedSettings.getControl("ChatPersistTime")->addListener(&chat_persist_time_listener); 5062 gSavedSettings.getControl("ChatPersistTime")->addListener(&chat_persist_time_listener);
4959 gSavedSettings.getControl("ConsoleMaxLines")->addListener(&console_max_lines_listener); 5063 gSavedSettings.getControl("ConsoleMaxLines")->addListener(&console_max_lines_listener);
4960 5064 gSavedSettings.getControl("UseOcclusion")->addListener(&use_occlusion_listener);
4961 gSavedSettings.getControl("AudioLevelMaster")->addListener(&master_audio_listener); 5065 gSavedSettings.getControl("AudioLevelMaster")->addListener(&master_audio_listener);
4962 gSavedSettings.getControl("AudioStreamingMusic")->addListener(&audio_stream_music_listener); 5066 gSavedSettings.getControl("AudioStreamingMusic")->addListener(&audio_stream_music_listener);
4963 gSavedSettings.getControl("AudioStreamingVideo")->addListener(&audio_stream_media_listener); 5067 gSavedSettings.getControl("AudioStreamingVideo")->addListener(&audio_stream_media_listener);
4964 gSavedSettings.getControl("MuteAudio")->addListener(&audio_mute_listener); 5068 gSavedSettings.getControl("MuteAudio")->addListener(&audio_mute_listener);
4965 5069 gSavedSettings.getControl("RenderVBOEnable")->addListener(&render_use_vbo_listener);
5070 gSavedSettings.getControl("RenderLightingDetail")->addListener(&render_lighting_detail_listener);
4966 gSavedSettings.getControl("NumpadControl")->addListener(&numpad_control_listener); 5071 gSavedSettings.getControl("NumpadControl")->addListener(&numpad_control_listener);
4967 5072
4968 // gAgent.init() also loads from saved settings. 5073 // gAgent.init() also loads from saved settings.
@@ -4970,7 +5075,6 @@ void saved_settings_to_globals()
4970 5075
4971void cleanup_saved_settings() 5076void cleanup_saved_settings()
4972{ 5077{
4973 gSavedSettings.setBOOL("RenderLightGlows", gRenderLightGlows);
4974 gSavedSettings.setBOOL("MouseSun", FALSE); 5078 gSavedSettings.setBOOL("MouseSun", FALSE);
4975 5079
4976 gSavedSettings.setBOOL("FlyBtnState", FALSE); 5080 gSavedSettings.setBOOL("FlyBtnState", FALSE);
@@ -4985,9 +5089,7 @@ void cleanup_saved_settings()
4985 5089
4986 gSavedSettings.setBOOL("AllowAFK", gAllowAFK); 5090 gSavedSettings.setBOOL("AllowAFK", gAllowAFK);
4987 gSavedSettings.setBOOL("ShowObjectUpdates", gShowObjectUpdates); 5091 gSavedSettings.setBOOL("ShowObjectUpdates", gShowObjectUpdates);
4988 BOOL use_occlusion = gPipeline.getUseOcclusionCulling(); 5092
4989 gSavedSettings.setBOOL( "UseOcclusion", use_occlusion );
4990
4991 if (!gNoRender) 5093 if (!gNoRender)
4992 { 5094 {
4993 if (gDebugView) 5095 if (gDebugView)
@@ -5050,7 +5152,7 @@ void write_debug(const char *str)
5050 { 5152 {
5051 std::string debug_filename = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,"debug_info.log"); 5153 std::string debug_filename = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,"debug_info.log");
5052 llinfos << "Opening debug file " << debug_filename << llendl; 5154 llinfos << "Opening debug file " << debug_filename << llendl;
5053 gDebugFile = LLFile::fopen(debug_filename.c_str(), "w"); 5155 gDebugFile = LLFile::fopen(debug_filename.c_str(), "w"); /* Flawfinder: ignore */
5054 if (!gDebugFile) 5156 if (!gDebugFile)
5055 { 5157 {
5056 llinfos << "Opening debug file " << debug_filename << " failed. Using stderr." << llendl; 5158 llinfos << "Opening debug file " << debug_filename << " failed. Using stderr." << llendl;
@@ -5117,8 +5219,6 @@ void output_statistics(void*)
5117 llinfos << "Memory Usage:" << llendl; 5219 llinfos << "Memory Usage:" << llendl;
5118 llinfos << "--------------------------------" << llendl; 5220 llinfos << "--------------------------------" << llendl;
5119 llinfos << "Pipeline:" << llendl; 5221 llinfos << "Pipeline:" << llendl;
5120 S32 total_usage = 0;
5121 total_usage += gPipeline.getMemUsage(TRUE);
5122 llinfos << llendl; 5222 llinfos << llendl;
5123 5223
5124#if LL_SMARTHEAP 5224#if LL_SMARTHEAP
@@ -5464,8 +5564,10 @@ void release_signals()
5464 5564
5465void purge_cache() 5565void purge_cache()
5466{ 5566{
5467 char mask[LL_MAX_PATH]; 5567 llinfos << "Purging Texture Cache..." << llendl;
5468 sprintf(mask, "%s*.*", gDirUtilp->getDirDelimiter().c_str()); 5568 gTextureCache->purgeCache(LL_PATH_CACHE);
5569 llinfos << "Purging Cache..." << llendl;
5570 std::string mask = gDirUtilp->getDirDelimiter() + "*.*";
5469 gDirUtilp->deleteFilesInDir(gDirUtilp->getExpandedFilename(LL_PATH_CACHE,"").c_str(),mask); 5571 gDirUtilp->deleteFilesInDir(gDirUtilp->getExpandedFilename(LL_PATH_CACHE,"").c_str(),mask);
5470} 5572}
5471 5573
@@ -5506,43 +5608,43 @@ int parse_args(int argc, char **argv)
5506 else if (!strcmp(argv[j], "--aditi")) 5608 else if (!strcmp(argv[j], "--aditi"))
5507 { 5609 {
5508 gUserServerChoice = USERSERVER_ADITI; 5610 gUserServerChoice = USERSERVER_ADITI;
5509 sprintf(gUserServerName,"%s", gUserServerDomainName[gUserServerChoice].mName); 5611 snprintf(gUserServerName, MAX_STRING, "%s", gUserServerDomainName[gUserServerChoice].mName); /* Flawfinder: ignore */
5510 gConnectToSomething = TRUE; 5612 gConnectToSomething = TRUE;
5511 } 5613 }
5512 else if (!strcmp(argv[j], "--agni")) 5614 else if (!strcmp(argv[j], "--agni"))
5513 { 5615 {
5514 gUserServerChoice = USERSERVER_AGNI; 5616 gUserServerChoice = USERSERVER_AGNI;
5515 sprintf(gUserServerName,"%s", gUserServerDomainName[gUserServerChoice].mName); 5617 snprintf(gUserServerName, MAX_STRING, "%s", gUserServerDomainName[gUserServerChoice].mName); /* Flawfinder: ignore */
5516 gConnectToSomething = TRUE; 5618 gConnectToSomething = TRUE;
5517 } 5619 }
5518 else if (!strcmp(argv[j], "--dmz")) 5620 else if (!strcmp(argv[j], "--dmz"))
5519 { 5621 {
5520 gUserServerChoice = USERSERVER_DMZ; 5622 gUserServerChoice = USERSERVER_DMZ;
5521 sprintf(gUserServerName,"%s", gUserServerDomainName[gUserServerChoice].mName); 5623 snprintf(gUserServerName, MAX_STRING, "%s", gUserServerDomainName[gUserServerChoice].mName); /* Flawfinder: ignore */
5522 gConnectToSomething = TRUE; 5624 gConnectToSomething = TRUE;
5523 } 5625 }
5524 else if (!strcmp(argv[j], "--siva")) 5626 else if (!strcmp(argv[j], "--siva"))
5525 { 5627 {
5526 gUserServerChoice = USERSERVER_SIVA; 5628 gUserServerChoice = USERSERVER_SIVA;
5527 sprintf(gUserServerName,"%s", gUserServerDomainName[gUserServerChoice].mName); 5629 snprintf(gUserServerName, MAX_STRING, "%s", gUserServerDomainName[gUserServerChoice].mName); /* Flawfinder: ignore */
5528 gConnectToSomething = TRUE; 5630 gConnectToSomething = TRUE;
5529 } 5631 }
5530 else if (!strcmp(argv[j], "--shakti")) 5632 else if (!strcmp(argv[j], "--shakti"))
5531 { 5633 {
5532 gUserServerChoice = USERSERVER_SHAKTI; 5634 gUserServerChoice = USERSERVER_SHAKTI;
5533 sprintf(gUserServerName,"%s", gUserServerDomainName[gUserServerChoice].mName); 5635 snprintf(gUserServerName, MAX_STRING, "%s", gUserServerDomainName[gUserServerChoice].mName); /* Flawfinder: ignore */
5534 gConnectToSomething = TRUE; 5636 gConnectToSomething = TRUE;
5535 } 5637 }
5536 else if (!strcmp(argv[j], "--durga")) 5638 else if (!strcmp(argv[j], "--durga"))
5537 { 5639 {
5538 gUserServerChoice = USERSERVER_DURGA; 5640 gUserServerChoice = USERSERVER_DURGA;
5539 sprintf(gUserServerName,"%s", gUserServerDomainName[gUserServerChoice].mName); 5641 snprintf(gUserServerName, MAX_STRING, "%s", gUserServerDomainName[gUserServerChoice].mName); /* Flawfinder: ignore */
5540 gConnectToSomething = TRUE; 5642 gConnectToSomething = TRUE;
5541 } 5643 }
5542 else if (!strcmp(argv[j], "--soma")) 5644 else if (!strcmp(argv[j], "--soma"))
5543 { 5645 {
5544 gUserServerChoice = USERSERVER_SOMA; 5646 gUserServerChoice = USERSERVER_SOMA;
5545 sprintf(gUserServerName,"%s", gUserServerDomainName[gUserServerChoice].mName); 5647 snprintf(gUserServerName, MAX_STRING, "%s", gUserServerDomainName[gUserServerChoice].mName); /* Flawfinder: ignore */
5546 gConnectToSomething = TRUE; 5648 gConnectToSomething = TRUE;
5547 } 5649 }
5548 else if (!strcmp(argv[j], "--ganga")) 5650 else if (!strcmp(argv[j], "--ganga"))
@@ -5551,6 +5653,12 @@ int parse_args(int argc, char **argv)
5551 sprintf(gUserServerName,"%s", gUserServerDomainName[gUserServerChoice].mName); 5653 sprintf(gUserServerName,"%s", gUserServerDomainName[gUserServerChoice].mName);
5552 gConnectToSomething = TRUE; 5654 gConnectToSomething = TRUE;
5553 } 5655 }
5656 else if (!strcmp(argv[j], "--vaak"))
5657 {
5658 gUserServerChoice = USERSERVER_VAAK;
5659 sprintf(gUserServerName,"%s", gUserServerDomainName[gUserServerChoice].mName);
5660 gConnectToSomething = TRUE;
5661 }
5554 else if (!strcmp(argv[j], "--uma")) 5662 else if (!strcmp(argv[j], "--uma"))
5555 { 5663 {
5556 gUserServerChoice = USERSERVER_UMA; 5664 gUserServerChoice = USERSERVER_UMA;
@@ -5562,7 +5670,7 @@ int parse_args(int argc, char **argv)
5562 if (!strcmp(argv[j], "-")) 5670 if (!strcmp(argv[j], "-"))
5563 { 5671 {
5564 gUserServerChoice = USERSERVER_LOCAL; 5672 gUserServerChoice = USERSERVER_LOCAL;
5565 sprintf(gUserServerName,"%s", LOOPBACK_ADDRESS_STRING); 5673 snprintf(gUserServerName, MAX_STRING, "%s", LOOPBACK_ADDRESS_STRING); /* Flawfinder: ignore */
5566 } 5674 }
5567 else 5675 else
5568 { 5676 {
@@ -5570,7 +5678,7 @@ int parse_args(int argc, char **argv)
5570 ip_string.assign( argv[j] ); 5678 ip_string.assign( argv[j] );
5571 LLString::trim(ip_string); 5679 LLString::trim(ip_string);
5572 gUserServer.setHostByName( ip_string.c_str() ); 5680 gUserServer.setHostByName( ip_string.c_str() );
5573 snprintf(gUserServerName, MAX_STRING, "%s", ip_string.c_str()); 5681 snprintf(gUserServerName, MAX_STRING, "%s", ip_string.c_str()); /* Flawfinder: ignore */
5574 } 5682 }
5575 gConnectToSomething = TRUE; 5683 gConnectToSomething = TRUE;
5576 } 5684 }
@@ -5653,91 +5761,10 @@ int parse_args(int argc, char **argv)
5653 gUserServer.invalidate(); 5761 gUserServer.invalidate();
5654 gRunLocal = TRUE; 5762 gRunLocal = TRUE;
5655 } 5763 }
5656 else if (!strcmp(argv[j], "-debugst") && (++j < argc))
5657 {
5658 U32 err_val;
5659 sscanf(argv[j], "%d", &err_val);
5660 llinfos << "Enabling debug mask " << err_val << " (0x" << (1<<err_val) << ")" << llendl;
5661 gErrorStream.setDebugMask( 1<<err_val );
5662 gErrorStream.setLevel( LLErrorStream::DEBUG );
5663 }
5664 else if (!strcmp(argv[j], "-errmask") && (++j < argc))
5665 {
5666 U32 err_mask;
5667 sscanf(argv[j], "%d", &err_mask);
5668 llinfos << "Setting error mask to " << err_mask << llendl;
5669 gErrorStream.setDebugMask( err_mask );
5670 gErrorStream.setLevel( LLErrorStream::DEBUG );
5671 }
5672 else if(!strcmp(argv[j], "-noutc"))
5673 {
5674 gLogUTC = FALSE;
5675 }
5676 else if(!strcmp(argv[j], "-noinvlib")) 5764 else if(!strcmp(argv[j], "-noinvlib"))
5677 { 5765 {
5678 gRequestInventoryLibrary = FALSE; 5766 gRequestInventoryLibrary = FALSE;
5679 } 5767 }
5680#if !LL_RELEASE_FOR_DOWNLOAD
5681 else if(!strcmp(argv[j], "-logcontrol"))
5682 {
5683 S32 control;
5684 S32 level;
5685 U32 debugmask;
5686 S32 time;
5687 S32 location;
5688
5689 if (++j >= argc)
5690 {
5691 llwarns << "Missing <control> after -logcontrol" << llendl;
5692 return 1;
5693 }
5694 sscanf(argv[j], "%d", &control);
5695
5696 if (++j >= argc)
5697 {
5698 llwarns << "Missing <level> after -logcontrol" << llendl;
5699 return 1;
5700 }
5701 sscanf(argv[j], "%d", &level);
5702
5703 if (++j >= argc)
5704 {
5705 llwarns << "Missing <mask> after -logcontrol" << llendl;
5706 return 1;
5707 }
5708 sscanf(argv[j], "%u", &debugmask);
5709
5710 if (++j >= argc)
5711 {
5712 llwarns << "Missing <time> after -logcontrol" << llendl;
5713 return 1;
5714 }
5715 sscanf(argv[j], "%d", &time);
5716
5717 if (++j >= argc)
5718 {
5719 llwarns << "Missing <location> after -logcontrol" << llendl;
5720 return 1;
5721 }
5722 sscanf(argv[j], "%d", &location);
5723
5724 if (LLErrorStream::MERGE == control)
5725 {
5726 gErrorStream.mergeLevel( LLErrorStream::ELevel(level) );
5727 gErrorStream.mergeDebugMask(debugmask);
5728 gErrorStream.mergeTime( BOOL(time) );
5729 gErrorStream.mergeLocation( BOOL(location) );
5730 }
5731 else
5732 {
5733 gErrorStream.setLevel( LLErrorStream::ELevel(level) );
5734 gErrorStream.setDebugMask(debugmask);
5735 gErrorStream.setTime( BOOL(time) );
5736 gErrorStream.setPrintLocation( BOOL(location) );
5737 }
5738 continue;
5739 }
5740#endif
5741 else if (!strcmp(argv[j], "-log")) 5768 else if (!strcmp(argv[j], "-log"))
5742 { 5769 {
5743 gLogMessages = TRUE; 5770 gLogMessages = TRUE;
@@ -5746,14 +5773,11 @@ int parse_args(int argc, char **argv)
5746 else if (!strcmp(argv[j], "-logfile") && (++j < argc)) 5773 else if (!strcmp(argv[j], "-logfile") && (++j < argc))
5747 { 5774 {
5748 // *NOTE: This buffer size is hard coded into scanf() below. 5775 // *NOTE: This buffer size is hard coded into scanf() below.
5749 char logfile[256]; 5776 char logfile[256]; /* Flawfinder: ignore */
5750 sscanf(argv[j], "%255s", logfile); 5777 sscanf(argv[j], "%255s", logfile); /* Flawfinder: ignore */
5751 llinfos << "Setting log file to " << logfile << llendl; 5778 llinfos << "Setting log file to " << logfile << llendl;
5752 LLFile::remove(logfile); 5779 LLFile::remove(logfile);
5753 if (!gErrorStream.setFile(logfile)) 5780 LLError::logToFile(logfile);
5754 {
5755 llinfos << "Error setting log file to " << logfile << llendl;
5756 }
5757 } 5781 }
5758 else if (!strcmp(argv[j], "-settings") && (++j < argc)) 5782 else if (!strcmp(argv[j], "-settings") && (++j < argc))
5759 { 5783 {
@@ -6022,7 +6046,7 @@ bool LLURLSimString::send_to_other_instance()
6022 return false; 6046 return false;
6023 } 6047 }
6024#if LL_WINDOWS 6048#if LL_WINDOWS
6025 wchar_t window_class[256]; // Assume max length < 255 chars. 6049 wchar_t window_class[256]; /* Flawfinder: ignore */ // Assume max length < 255 chars.
6026 mbstowcs(window_class, gWindowName.c_str(), 255); 6050 mbstowcs(window_class, gWindowName.c_str(), 255);
6027 window_class[255] = 0; 6051 window_class[255] = 0;
6028 // Use the class instead of the window name. 6052 // Use the class instead of the window name.
@@ -6031,7 +6055,7 @@ bool LLURLSimString::send_to_other_instance()
6031 { 6055 {
6032 lldebugs << "Found other window with the name '" << gWindowTitle << "'" << llendl; 6056 lldebugs << "Found other window with the name '" << gWindowTitle << "'" << llendl;
6033 llurl_data url_data; 6057 llurl_data url_data;
6034 strncpy(url_data.mSimName, sInstance.mSimName.c_str(), DB_SIM_NAME_BUF_SIZE); 6058 strncpy(url_data.mSimName, sInstance.mSimName.c_str(), DB_SIM_NAME_BUF_SIZE); /* Flawfinder: ignore*/
6035 url_data.mSimName[DB_SIM_NAME_BUF_SIZE - 1] = '\0'; 6059 url_data.mSimName[DB_SIM_NAME_BUF_SIZE - 1] = '\0';
6036 url_data.mSimX = sInstance.mX; 6060 url_data.mSimX = sInstance.mX;
6037 url_data.mSimY = sInstance.mY; 6061 url_data.mSimY = sInstance.mY;
@@ -6059,7 +6083,7 @@ void load_name_cache()
6059 6083
6060 std::string name_cache; 6084 std::string name_cache;
6061 name_cache = gDirUtilp->getExpandedFilename(LL_PATH_CACHE, "name.cache"); 6085 name_cache = gDirUtilp->getExpandedFilename(LL_PATH_CACHE, "name.cache");
6062 FILE* name_cache_fp = LLFile::fopen(name_cache.c_str(), "r"); 6086 FILE* name_cache_fp = LLFile::fopen(name_cache.c_str(), "r"); /* Flawfinder: ignore*/
6063 if (name_cache_fp) 6087 if (name_cache_fp)
6064 { 6088 {
6065 gCacheName->importFile(name_cache_fp); 6089 gCacheName->importFile(name_cache_fp);
@@ -6073,7 +6097,7 @@ void save_name_cache()
6073 6097
6074 std::string name_cache; 6098 std::string name_cache;
6075 name_cache = gDirUtilp->getExpandedFilename(LL_PATH_CACHE, "name.cache"); 6099 name_cache = gDirUtilp->getExpandedFilename(LL_PATH_CACHE, "name.cache");
6076 FILE* name_cache_fp = LLFile::fopen(name_cache.c_str(), "w"); 6100 FILE* name_cache_fp = LLFile::fopen(name_cache.c_str(), "w"); /* Flawfinder: ignore*/
6077 if (name_cache_fp) 6101 if (name_cache_fp)
6078 { 6102 {
6079 gCacheName->exportFile(name_cache_fp); 6103 gCacheName->exportFile(name_cache_fp);
@@ -6167,8 +6191,8 @@ void disconnect_viewer(void *)
6167// helper function for cleanup_app 6191// helper function for cleanup_app
6168void remove_cache_files(const char* file_mask) 6192void remove_cache_files(const char* file_mask)
6169{ 6193{
6170 char mask[LL_MAX_PATH]; 6194 char mask[LL_MAX_PATH]; /* Flawfinder: ignore */
6171 sprintf(mask, "%s%s", gDirUtilp->getDirDelimiter().c_str(), file_mask); 6195 snprintf(mask, LL_MAX_PATH, "%s%s", gDirUtilp->getDirDelimiter().c_str(), file_mask); /* Flawfinder: ignore */
6172 gDirUtilp->deleteFilesInDir(gDirUtilp->getExpandedFilename(LL_PATH_CACHE, "").c_str(), mask); 6196 gDirUtilp->deleteFilesInDir(gDirUtilp->getExpandedFilename(LL_PATH_CACHE, "").c_str(), mask);
6173} 6197}
6174 6198
@@ -6311,9 +6335,9 @@ void cleanup_app()
6311 llinfos << "Viewer disconnected" << llendflush; 6335 llinfos << "Viewer disconnected" << llendflush;
6312 6336
6313 gDisconnectedImagep = NULL; 6337 gDisconnectedImagep = NULL;
6314 gStartImageGL = NULL; 6338 release_start_screen(); // just in case
6315 6339
6316 gErrorStream.setFixedBuffer(NULL); 6340 LLError::logToFixedBuffer(NULL);
6317 6341
6318 llinfos << "Cleaning Up" << llendflush; 6342 llinfos << "Cleaning Up" << llendflush;
6319 6343
@@ -6323,9 +6347,6 @@ void cleanup_app()
6323 LLHUDObject::cleanupHUDObjects(); 6347 LLHUDObject::cleanupHUDObjects();
6324 llinfos << "HUD Objects cleaned up" << llendflush; 6348 llinfos << "HUD Objects cleaned up" << llendflush;
6325 6349
6326 LLVOTreeNew::cleanupTextures();
6327 llinfos << "Textures cleaned up" << llendflush;
6328
6329 // End TransferManager before deleting systems it depends on (Audio, VFS, AssetStorage) 6350 // End TransferManager before deleting systems it depends on (Audio, VFS, AssetStorage)
6330#if 0 // this seems to get us stuck in an infinite loop... 6351#if 0 // this seems to get us stuck in an infinite loop...
6331 gTransferManager.cleanup(); 6352 gTransferManager.cleanup();
@@ -6520,8 +6541,8 @@ void cleanup_app()
6520 if (gPurgeOnExit) 6541 if (gPurgeOnExit)
6521 { 6542 {
6522 llinfos << "Purging all cache files on exit" << llendflush; 6543 llinfos << "Purging all cache files on exit" << llendflush;
6523 char mask[LL_MAX_PATH]; 6544 char mask[LL_MAX_PATH]; /* Flawfinder: ignore */
6524 sprintf(mask, "%s*.*", gDirUtilp->getDirDelimiter().c_str()); 6545 snprintf(mask, LL_MAX_PATH, "%s*.*", gDirUtilp->getDirDelimiter().c_str()); /* Flawfinder: ignore */
6525 gDirUtilp->deleteFilesInDir(gDirUtilp->getExpandedFilename(LL_PATH_CACHE,"").c_str(),mask); 6546 gDirUtilp->deleteFilesInDir(gDirUtilp->getExpandedFilename(LL_PATH_CACHE,"").c_str(),mask);
6526 } 6547 }
6527 6548
@@ -6529,6 +6550,37 @@ void cleanup_app()
6529 6550
6530 close_debug(); 6551 close_debug();
6531 6552
6553 // Let threads finish
6554 LLTimer idleTimer;
6555 idleTimer.reset();
6556 const F64 max_idle_time = 5.f; // 5 seconds
6557 while(1)
6558 {
6559 S32 pending = 0;
6560 pending += gTextureCache->update(1); // unpauses the worker thread
6561 pending += gImageDecodeThread->update(1); // unpauses the image thread
6562 pending += gTextureFetch->update(1); // unpauses the texture fetch thread
6563 pending += LLVFSThread::updateClass(0);
6564 pending += LLLFSThread::updateClass(0);
6565 F64 idle_time = idleTimer.getElapsedTimeF64();
6566 if (!pending || idle_time >= max_idle_time)
6567 {
6568 llwarns << "Quitting with pending background tasks." << llendl;
6569 break;
6570 }
6571 }
6572
6573 // Delete workers first
6574 // shotdown all worker threads before deleting them in case of co-dependencies
6575 gTextureCache->shutdown();
6576 gTextureFetch->shutdown();
6577 gImageDecodeThread->shutdown();
6578 delete gTextureCache;
6579 delete gTextureFetch;
6580 delete gImageDecodeThread;
6581
6582 gImageList.shutdown(); // shutdown again in case a callback added something
6583
6532 // This should eventually be done in LLAppViewer 6584 // This should eventually be done in LLAppViewer
6533 LLImageJ2C::closeDSO(); 6585 LLImageJ2C::closeDSO();
6534 LLImageFormatted::cleanupClass(); 6586 LLImageFormatted::cleanupClass();
@@ -6549,8 +6601,6 @@ void cleanup_app()
6549 delete gVFS; 6601 delete gVFS;
6550 gVFS = NULL; 6602 gVFS = NULL;
6551 6603
6552 LLWorkerThread::cleanupClass();
6553
6554 // This will eventually be done in LLApp 6604 // This will eventually be done in LLApp
6555 LLCommon::cleanupClass(); 6605 LLCommon::cleanupClass();
6556} 6606}
@@ -6580,6 +6630,7 @@ void errorCallback(const std::string &error_string)
6580#ifndef LL_RELEASE_FOR_DOWNLOAD 6630#ifndef LL_RELEASE_FOR_DOWNLOAD
6581 OSMessageBox(error_string.c_str(), "Fatal Error", OSMB_OK); 6631 OSMessageBox(error_string.c_str(), "Fatal Error", OSMB_OK);
6582#endif 6632#endif
6633 LLError::crashAndLoop(error_string);
6583} 6634}
6584// JC - Please don't put code here. Find the right file, perhaps 6635// JC - Please don't put code here. Find the right file, perhaps
6585// llviewermessage.cpp, and put it there. Thanks! 6636// llviewermessage.cpp, and put it there. Thanks!
diff --git a/linden/indra/newview/viewer.h b/linden/indra/newview/viewer.h
index 34ca249..125b0ec 100644
--- a/linden/indra/newview/viewer.h
+++ b/linden/indra/newview/viewer.h
@@ -61,6 +61,9 @@ class LLViewerRegion;
61class LLVFS; 61class LLVFS;
62class LLGlobalEconomy; 62class LLGlobalEconomy;
63class LLPieMenu; 63class LLPieMenu;
64class LLWorkerThread;
65class LLTextureFetch;
66class LLTextureCache;
64 67
65// 68//
66// Global Variables 69// Global Variables
@@ -72,7 +75,6 @@ extern S32 gNumSessions;
72extern BOOL gNoRender; 75extern BOOL gNoRender;
73extern LLMemoryInfo gSysMemory; 76extern LLMemoryInfo gSysMemory;
74extern BOOL gLogMessages; 77extern BOOL gLogMessages;
75extern BOOL gLogUTC;
76extern BOOL gUseAudio; 78extern BOOL gUseAudio;
77extern BOOL gConnectToSomething; 79extern BOOL gConnectToSomething;
78extern BOOL gGodConnect; 80extern BOOL gGodConnect;
@@ -106,6 +108,7 @@ extern BOOL gQuitRequested; // User wants to quit, may have modified documen
106extern BOOL gLogoutRequestSent; // Disconnect message sent to simulator, no longer safe to send messages to the sim. 108extern BOOL gLogoutRequestSent; // Disconnect message sent to simulator, no longer safe to send messages to the sim.
107extern BOOL gInitializationComplete; // OK to call display() and idle() 109extern BOOL gInitializationComplete; // OK to call display() and idle()
108extern BOOL gUseWireframe; 110extern BOOL gUseWireframe;
111extern BOOL gPurgeCache; // Cache was purged on startup
109extern U32 gSecondsPerDay; 112extern U32 gSecondsPerDay;
110extern U32 gSecondsPerYear; 113extern U32 gSecondsPerYear;
111// Is the Pacific time zone (aka server time zone) 114// Is the Pacific time zone (aka server time zone)
@@ -143,6 +146,10 @@ extern LLVFS *gStaticVFS;
143 146
144extern LLUUID gViewerDigest; // MD5 digest of the viewer's executable file. 147extern LLUUID gViewerDigest; // MD5 digest of the viewer's executable file.
145 148
149extern LLWorkerThread* gImageDecodeThread;
150extern LLTextureFetch* gTextureFetch;
151extern LLTextureCache* gTextureCache;
152
146class LLURLSimString 153class LLURLSimString
147{ 154{
148public: 155public:
@@ -158,7 +165,7 @@ private:
158 static S32 parseGridIdx(const LLString& in_string, S32 idx0, S32* res, S32 max); 165 static S32 parseGridIdx(const LLString& in_string, S32 idx0, S32* res, S32 max);
159 struct llurl_data 166 struct llurl_data
160 { 167 {
161 char mSimName[DB_SIM_NAME_BUF_SIZE]; 168 char mSimName[DB_SIM_NAME_BUF_SIZE]; /*Flawfinder: ignore*/
162 S32 mSimX; 169 S32 mSimX;
163 S32 mSimY; 170 S32 mSimY;
164 S32 mSimZ; 171 S32 mSimZ;
diff --git a/linden/indra/newview/viewer_manifest.py b/linden/indra/newview/viewer_manifest.py
new file mode 100755
index 0000000..4c422e4
--- /dev/null
+++ b/linden/indra/newview/viewer_manifest.py
@@ -0,0 +1,450 @@
1#!/usr/bin/python
2# @file viewer_manifest.py
3# @author Ryan Williams
4# @brief Description of all installer viewer files, and methods for packaging
5# them into installers for all supported platforms.
6#
7# Copyright (c) 2006-2007, Linden Research, Inc.
8#
9# The source code in this file ("Source Code") is provided by Linden Lab
10# to you under the terms of the GNU General Public License, version 2.0
11# ("GPL"), unless you have obtained a separate licensing agreement
12# ("Other License"), formally executed by you and Linden Lab. Terms of
13# the GPL can be found in doc/GPL-license.txt in this distribution, or
14# online at http://secondlife.com/developers/opensource/gplv2
15#
16# There are special exceptions to the terms and conditions of the GPL as
17# it is applied to this Source Code. View the full text of the exception
18# in the file doc/FLOSS-exception.txt in this software distribution, or
19# online at http://secondlife.com/developers/opensource/flossexception
20#
21# By copying, modifying or distributing this software, you acknowledge
22# that you have read and understood your obligations described above,
23# and agree to abide by those obligations.
24#
25# ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
26# WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
27# COMPLETENESS OR PERFORMANCE.
28import sys
29import os.path
30import re
31import tarfile
32viewer_dir = os.path.dirname(__file__)
33# add llmanifest library to our path so we don't have to muck with PYTHONPATH
34sys.path.append(os.path.join(viewer_dir, '../lib/python/indra'))
35from llmanifest import LLManifest, main, proper_windows_path, path_ancestors
36
37class ViewerManifest(LLManifest):
38 def construct(self):
39 super(ViewerManifest, self).construct()
40 self.exclude("*.svn*")
41 self.path(src="../../scripts/messages/message_template.msg", dst="app_settings/message_template.msg")
42
43 if self.prefix(src="app_settings"):
44 self.exclude("logcontrol.xml")
45 self.exclude("logcontrol-dev.xml")
46 self.path("*.pem")
47 self.path("*.ini")
48 self.path("*.xml")
49 self.path("*.vp")
50 self.path("*.db2")
51
52 # include the entire shaders directory recursively
53 self.path("shaders")
54 self.end_prefix("app_settings")
55
56 if self.prefix(src="character"):
57 self.path("*.llm")
58 self.path("*.xml")
59 self.path("*.tga")
60 self.end_prefix("character")
61
62
63 # Include our fonts
64 if self.prefix(src="fonts"):
65 self.path("*.ttf")
66 self.path("*.txt")
67 self.end_prefix("fonts")
68
69 # XUI
70 if self.prefix(src="skins"):
71 # include the entire textures directory recursively
72 self.path("textures")
73 self.path("paths.xml")
74 self.path("xui/*/*.xml")
75 self.path('words.*.txt')
76
77 # Local HTML files (e.g. loading screen)
78 if self.prefix("html/*"):
79 self.path("*.html")
80 self.path("*.gif")
81 self.path("*.jpg")
82 self.path("*.css")
83 self.end_prefix("html/*")
84 self.end_prefix("skins")
85
86 self.path("featuretable.txt")
87 self.path("releasenotes.txt")
88 self.path("lsl_guide.html")
89 self.path("gpu_table.txt")
90
91 def flags_list(self):
92 """ Convenience function that returns the command-line flags for the grid"""
93 if(self.args['grid'] == ''):
94 return ""
95 elif(self.args['grid'] == 'firstlook'):
96 return '-settings settings_firstlook.xml'
97 else:
98 return ("-settings settings_beta.xml --%(grid)s -helperuri http://preview-%(grid)s.secondlife.com/helpers/" % {'grid':self.args['grid']})
99
100 def login_url(self):
101 """ Convenience function that returns the appropriate login url for the grid"""
102 if(self.args.get('login_url')):
103 return self.args['login_url']
104 else:
105 if(self.args['grid'] == ''):
106 return 'http://secondlife.com/app/login/'
107 elif(self.args['grid'] == 'firstlook'):
108 return 'http://secondlife.com/app/login/firstlook/'
109 else:
110 return 'http://secondlife.com/app/login/beta/'
111
112 def replace_login_url(self):
113 # set the login page to point to a url appropriate for the type of client
114 self.replace_in("skins/xui/en-us/panel_login.xml", searchdict={'http://secondlife.com/app/login/':self.login_url()})
115
116
117class WindowsManifest(ViewerManifest):
118 def final_exe(self):
119 # *NOTE: these are the only two executable names that the crash reporter recognizes
120 if self.args['grid'] == '':
121 return "SecondLife.exe"
122 elif self.args['grid'] == 'firstlook':
123 return "SecondLifeFirstLook.exe"
124 else:
125 return "SecondLifePreview.exe"
126 # return "SecondLifePreview%s.exe" % (self.args['grid'], )
127
128 def construct(self):
129 super(WindowsManifest, self).construct()
130 # the final exe is complicated because we're not sure where it's coming from,
131 # nor do we have a fixed name for the executable
132 self.path(self.find_existing_file('ReleaseForDownload/Secondlife.exe', 'Secondlife.exe', 'ReleaseNoOpt/newview_noopt.exe'), dst=self.final_exe())
133 # need to get the kdu dll from any of the build directories as well
134 self.path(self.find_existing_file('ReleaseForDownload/llkdu.dll', 'llkdu.dll', '../../libraries/i686-win32/lib_release/llkdu.dll'), dst='llkdu.dll')
135 self.path(src="licenses-win32.txt", dst="licenses.txt")
136
137 # For use in crash reporting (generates minidumps)
138 self.path("dbghelp.dll")
139
140 # For using FMOD for sound... DJS
141 self.path("fmod.dll")
142
143 # Mozilla appears to force a dependency on these files so we need to ship it (CP)
144 self.path("msvcr71.dll")
145 self.path("msvcp71.dll")
146
147 # Mozilla runtime DLLs (CP)
148 if self.prefix(src="../../libraries/i686-win32/lib_release", dst=""):
149 self.path("gksvggdiplus.dll")
150 self.path("js3250.dll")
151 self.path("nspr4.dll")
152 self.path("nss3.dll")
153 self.path("nssckbi.dll")
154 self.path("plc4.dll")
155 self.path("plds4.dll")
156 self.path("smime3.dll")
157 self.path("softokn3.dll")
158 self.path("ssl3.dll")
159 self.path("xpcom.dll")
160 self.path("xul.dll")
161 self.end_prefix()
162
163 # Mozilla runtime misc files (CP)
164 if self.prefix(src="app_settings/mozilla"):
165 self.path("chrome/*.*")
166 self.path("components/*.*")
167 self.path("greprefs/*.*")
168 self.path("plugins/*.*")
169 self.path("res/*.*")
170 self.path("res/*/*")
171 self.end_prefix()
172
173# # pull in the crash logger and updater from other projects
174# self.path(src="../win_crash_logger/win_crash_logger.exe", dst="win_crash_logger.exe")
175 self.path(src="../win_updater/updater.exe", dst="updater.exe")
176 self.replace_login_url()
177
178 def nsi_file_commands(self, install=True):
179 def wpath(path):
180 if(path.endswith('/') or path.endswith(os.path.sep)):
181 path = path[:-1]
182 path = path.replace('/', '\\')
183 return path
184
185 result = ""
186 dest_files = [pair[1] for pair in self.file_list if pair[0] and os.path.isfile(pair[1])]
187 # sort deepest hierarchy first
188 dest_files.sort(lambda a,b: cmp(a.count(os.path.sep),b.count(os.path.sep)) or cmp(a,b))
189 dest_files.reverse()
190 out_path = None
191 for pkg_file in dest_files:
192 rel_file = os.path.normpath(pkg_file.replace(self.get_dst_prefix()+os.path.sep,''))
193 installed_dir = wpath(os.path.join('$INSTDIR', os.path.dirname(rel_file)))
194 pkg_file = wpath(os.path.normpath(pkg_file))
195 if installed_dir != out_path:
196 if(install):
197 out_path = installed_dir
198 result += 'SetOutPath ' + out_path + '\n'
199 if(install):
200 result += 'File ' + pkg_file + '\n'
201 else:
202 result += 'Delete ' + wpath(os.path.join('$INSTDIR', rel_file)) + '\n'
203 # at the end of a delete, just rmdir all the directories
204 if(not install):
205 deleted_file_dirs = [os.path.dirname(pair[1].replace(self.get_dst_prefix()+os.path.sep,'')) for pair in self.file_list]
206 # find all ancestors so that we don't skip any dirs that happened to have no non-dir children
207 deleted_dirs = []
208 for d in deleted_file_dirs:
209 deleted_dirs.extend(path_ancestors(d))
210 # sort deepest hierarchy first
211 deleted_dirs.sort(lambda a,b: cmp(a.count(os.path.sep),b.count(os.path.sep)) or cmp(a,b))
212 deleted_dirs.reverse()
213 prev = None
214 for d in deleted_dirs:
215 if d != prev: # skip duplicates
216 result += 'RMDir ' + wpath(os.path.join('$INSTDIR', os.path.normpath(d))) + '\n'
217 prev = d
218
219 return result
220
221 def package_finish(self):
222 version_vars_template = """
223 !define INSTEXE "%(final_exe)s"
224 !define VERSION "%(version_short)s"
225 !define VERSION_LONG "%(version)s"
226 !define VERSION_DASHES "%(version_dashes)s"
227 """
228 if(self.args['grid'] == ''):
229 installer_file = "Second Life %(version_dashes)s Setup.exe"
230 grid_vars_template = """
231 OutFile "%(outfile)s"
232 !define INSTFLAGS "%(flags)s"
233 !define INSTNAME "SecondLife"
234 !define SHORTCUT "Second Life"
235 !define URLNAME "secondlife"
236 Caption "Second Life ${VERSION}"
237 """
238 else:
239 installer_file = "Second Life %(version_dashes)s (%(grid_caps)s) Setup.exe"
240 grid_vars_template = """
241 OutFile "%(outfile)s"
242 !define INSTFLAGS "%(flags)s"
243 !define INSTNAME "SecondLife%(grid_caps)s"
244 !define SHORTCUT "Second Life (%(grid_caps)s)"
245 !define URLNAME "secondlife%(grid)s"
246 !define UNINSTALL_SETTINGS 1
247 Caption "Second Life %(grid)s ${VERSION}"
248 """
249 if(self.args.has_key('installer_name')):
250 installer_file = self.args['installer_name']
251 else:
252 installer_file = installer_file % {'version_dashes' : '-'.join(self.args['version']),
253 'grid_caps' : self.args['grid'].upper()}
254 tempfile = "../secondlife_setup.nsi"
255 # the following is an odd sort of double-string replacement
256 self.replace_in("installers/windows/installer_template.nsi", tempfile, {
257 "%%VERSION%%":version_vars_template%{'version_short' : '.'.join(self.args['version'][:-1]),
258 'version' : '.'.join(self.args['version']),
259 'version_dashes' : '-'.join(self.args['version']),
260 'final_exe' : self.final_exe()},
261 "%%GRID_VARS%%":grid_vars_template%{'grid':self.args['grid'],
262 'grid_caps':self.args['grid'].upper(),
263 'outfile':installer_file,
264 'flags':self.flags_list()},
265 "%%INSTALL_FILES%%":self.nsi_file_commands(True),
266 "%%DELETE_FILES%%":self.nsi_file_commands(False)})
267
268 NSIS_path = 'C:\\Program Files\\NSIS\\makensis.exe'
269 self.run_command('"' + proper_windows_path(NSIS_path) + '" ' + self.dst_path_of(tempfile))
270 self.remove(self.dst_path_of(tempfile))
271 self.created_path(installer_file)
272
273
274class DarwinManifest(ViewerManifest):
275 def construct(self):
276 # copy over the build result (this is a no-op if run within the xcode script)
277 self.path("build/" + self.args['configuration'] + "/Second Life.app", dst="")
278
279 if self.prefix(src="", dst="Contents"): # everything goes in Contents
280 # Expand the tar file containing the assorted mozilla bits into
281 # <bundle>/Contents/MacOS/
282 self.contents_of_tar('mozilla-universal-darwin.tgz', 'MacOS')
283
284 # replace the default theme with our custom theme (so scrollbars work).
285 if self.prefix(src="mozilla-theme", dst="MacOS/chrome"):
286 self.path("classic.jar")
287 self.path("classic.manifest")
288 self.end_prefix("MacOS/chrome")
289
290 # most everything goes in the Resources directory
291 if self.prefix(src="", dst="Resources"):
292 super(DarwinManifest, self).construct()
293
294 # the trial directory seems to be not used [rdw]
295 self.path('trial')
296
297 if self.prefix("cursors_mac"):
298 self.path("*.tif")
299 self.end_prefix("cursors_mac")
300
301 self.path("licenses-mac.txt", dst="licenses.txt")
302 self.path("featuretable_mac.txt")
303 self.path("secondlife.icns")
304
305 # llkdu dynamic library
306# self.path("../../libraries/universal-darwin/lib_release/libllkdu.dylib", "libllkdu.dylib")
307
308 # command line arguments for connecting to the proper grid
309 self.put_in_file(self.flags_list(), 'arguments.txt')
310
311 # set the proper login url
312 self.replace_login_url()
313
314 self.end_prefix("Resources")
315
316 self.end_prefix("Contents")
317
318 # NOTE: the -S argument to strip causes it to keep enough info for
319 # annotated backtraces (i.e. function names in the crash log). 'strip' with no
320 # arguments yields a slightly smaller binary but makes crash logs mostly useless.
321 # This may be desirable for the final release. Or not.
322 if("package" in self.args['actions'] or
323 "unpacked" in self.args['actions']):
324 self.run_command('strip -S "%(viewer_binary)s"' %
325 { 'viewer_binary' : self.dst_path_of('Contents/MacOS/Second Life')})
326
327
328 def package_finish(self):
329 imagename="SecondLife_" + '_'.join(self.args['version'])
330 if(self.args['grid'] != ''):
331 imagename = imagename + '_' + self.args['grid'].upper()
332
333 sparsename = imagename + ".sparseimage"
334 finalname = imagename + ".dmg"
335 # make sure we don't have stale files laying about
336 self.remove(sparsename, finalname)
337
338 self.run_command('hdiutil create "%(sparse)s" -volname "Second Life" -fs HFS+ -type SPARSE -megabytes 300' % {'sparse':sparsename})
339
340 # mount the image and get the name of the mount point and device node
341 hdi_output = self.run_command('hdiutil attach -private "' + sparsename + '"')
342 devfile = re.search("/dev/disk([0-9]+)[^s]", hdi_output).group(0).strip()
343 volpath = re.search('HFS\s+(.+)', hdi_output).group(1).strip()
344
345 # Copy everything in to the mounted .dmg
346 # TODO change name of .app once mac_updater can handle it.
347 for s,d in {
348 self.get_dst_prefix():"Second Life.app",
349 "lsl_guide.html":"Linden Scripting Language Guide.html",
350 "releasenotes.txt":"Release Notes.txt",
351 "installers/darwin/mac_image_hidden":".hidden",
352 "installers/darwin/mac_image_background.tga":"background.tga",
353 "installers/darwin/mac_image_DS_Store":".DS_Store"}.items():
354
355 print "Copying to dmg", s, d
356 self.copy_action(self.src_path_of(s), os.path.join(volpath, d))
357
358 # Unmount the image
359 self.run_command('hdiutil detach "' + devfile + '"')
360
361 print "Converting temp disk image to final disk image"
362 self.run_command('hdiutil convert "%(sparse)s" -format UDZO -imagekey zlib-level=9 -o "%(final)s"' % {'sparse':sparsename, 'final':finalname})
363 # get rid of the temp file
364 self.remove(sparsename)
365
366class LinuxManifest(ViewerManifest):
367 def construct(self):
368 super(LinuxManifest, self).construct()
369 self.path("licenses-linux.txt","licenses.txt")
370 self.path("res/ll_icon.ico","secondlife.ico")
371 if self.prefix("linux_tools", ""):
372 self.path("client-readme.txt","README-linux.txt")
373 self.path("wrapper.sh","secondlife")
374 self.path("unicode.ttf","unicode.ttf")
375 self.end_prefix("linux_tools")
376
377 # Create an appropriate gridargs.dat for this package, denoting required grid.
378 self.put_in_file(self.flags_list(), 'gridargs.dat')
379 # set proper login url
380 self.replace_login_url()
381
382 # stripping all the libs removes a few megabytes from the end-user package
383 for s,d in self.file_list:
384 if re.search("lib/lib.+\.so.*", d):
385 self.run_command('strip -S %s' % d)
386
387
388 def package_finish(self):
389 if(self.args.has_key('installer_name')):
390 installer_name = self.args['installer_name']
391 else:
392 installer_name = '_'.join('SecondLife_', self.args.get('arch'), *self.args['version'])
393 if grid != '':
394 installer_name += "_" + grid.upper()
395
396 # temporarily move directory tree so that it has the right name in the tarfile
397 self.run_command("mv %(dst)s %(inst)s" % {'dst':self.get_dst_prefix(),'inst':self.src_path_of(installer_name)})
398 # --numeric-owner hides the username of the builder for security etc.
399 self.run_command('tar -C %(dir)s --numeric-owner -cjf %(inst_path)s.tar.bz2 %(inst_name)s' % {'dir':self.get_src_prefix(), 'inst_name': installer_name, 'inst_path':self.src_path_of(installer_name)})
400 self.run_command("mv %(inst)s %(dst)s" % {'dst':self.get_dst_prefix(),'inst':self.src_path_of(installer_name)})
401
402class Linux_i686Manifest(LinuxManifest):
403 def construct(self):
404 super(Linux_i686Manifest, self).construct()
405 self.path("secondlife-i686-bin-stripped","bin/do-not-directly-run-secondlife-bin")
406# self.path("../linux_crash_logger/linux-crash-logger-i686-bin-stripped","linux-crash-logger.bin")
407 self.path("linux_tools/launch_url.sh","launch_url.sh")
408 if self.prefix("res-sdl"):
409 self.path("*")
410 # recurse
411 self.end_prefix("res-sdl")
412
413 self.path("app_settings/mozilla-runtime-linux-i686")
414
415 if self.prefix("../../libraries/i686-linux/lib_release_client", "lib"):
416# self.path("libkdu_v42R.so")
417 self.path("libfmod-3.75.so")
418 self.path("libapr-1.so.0")
419 self.path("libaprutil-1.so.0")
420 self.path("libdb-4.2.so")
421 self.path("libogg.so.0")
422 self.path("libvorbis.so.0")
423 self.path("libvorbisfile.so.0")
424 self.path("libvorbisenc.so.0")
425 self.path("libcurl.so.4")
426 self.path("libcrypto.so.0.9.7")
427 self.path("libssl.so.0.9.7")
428 self.path("libexpat.so.1")
429# self.path("libstdc++.so.6")
430 self.path("libelfio.so")
431 self.path("libuuid.so", "libuuid.so.1")
432 self.path("libSDL-1.2.so.0")
433# self.path("libllkdu.so", "../bin/libllkdu.so") # llkdu goes in bin for some reason
434 self.end_prefix("lib")
435
436
437class Linux_x86_64Manifest(LinuxManifest):
438 def construct(self):
439 super(Linux_x86_64Manifest, self).construct()
440 self.path("secondlife-x86_64-bin-stripped","bin/secondlife-bin")
441 # TODO: I get the sense that this isn't fully fleshed out
442 if self.prefix("../../libraries/x86_64-linux/lib_release_client", "lib"):
443# self.path("libkdu_v42R.so")
444 self.path("libxmlrpc.so.0")
445# # self.path("libllkdu.so", "../bin/libllkdu.so") # llkdu goes in bin for some reason
446 self.end_prefix("lib")
447
448
449if __name__ == "__main__":
450 main(srctree=viewer_dir, dsttree=os.path.join(viewer_dir, "packaged"))
diff --git a/linden/indra/test/MacTester.xcodeproj/project.pbxproj b/linden/indra/test/MacTester.xcodeproj/project.pbxproj
index 77ba7c2..76bdc0a 100644
--- a/linden/indra/test/MacTester.xcodeproj/project.pbxproj
+++ b/linden/indra/test/MacTester.xcodeproj/project.pbxproj
@@ -45,8 +45,11 @@
45 DA306B580ACD9F3F008D9B2F /* lltiming_tut.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DA306B540ACD9F3F008D9B2F /* lltiming_tut.cpp */; }; 45 DA306B580ACD9F3F008D9B2F /* lltiming_tut.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DA306B540ACD9F3F008D9B2F /* lltiming_tut.cpp */; };
46 DA306B590ACD9F3F008D9B2F /* lluri_tut.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DA306B550ACD9F3F008D9B2F /* lluri_tut.cpp */; }; 46 DA306B590ACD9F3F008D9B2F /* lluri_tut.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DA306B550ACD9F3F008D9B2F /* lluri_tut.cpp */; };
47 DA306B5C0ACD9F6F008D9B2F /* llhttpclient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DA306B5B0ACD9F6F008D9B2F /* llhttpclient.cpp */; }; 47 DA306B5C0ACD9F6F008D9B2F /* llhttpclient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DA306B5B0ACD9F6F008D9B2F /* llhttpclient.cpp */; };
48 DA4D18170B567E0D0049C10F /* llformat.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DA4D18150B567E0D0049C10F /* llformat.cpp */; };
49 DA4D18180B567E0D0049C10F /* llformat.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DA4D18160B567E0D0049C10F /* llformat.h */; };
50 DA4D182D0B567ED70049C10F /* llerrorcontrol.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DA4D182B0B567ED70049C10F /* llerrorcontrol.h */; };
51 DA9C40480B540D8A00DD6F44 /* lllivefile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DA9C40460B540D8A00DD6F44 /* lllivefile.cpp */; };
48 DAD1C4CC0AE2C78C0054574C /* stats.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DAD1C4CB0AE2C78C0054574C /* stats.cpp */; }; 52 DAD1C4CC0AE2C78C0054574C /* stats.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DAD1C4CB0AE2C78C0054574C /* stats.cpp */; };
49 DAD1C4DE0AE2CA0C0054574C /* llcurl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DAD1C4DD0AE2CA0C0054574C /* llcurl.cpp */; };
50 FD15584D0A06BE2E00DE9AE5 /* io.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD15584C0A06BE2E00DE9AE5 /* io.cpp */; }; 53 FD15584D0A06BE2E00DE9AE5 /* io.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD15584C0A06BE2E00DE9AE5 /* io.cpp */; };
51 FD15585C0A06BEB000DE9AE5 /* llbuffer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD1558500A06BEB000DE9AE5 /* llbuffer.cpp */; }; 54 FD15585C0A06BEB000DE9AE5 /* llbuffer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD1558500A06BEB000DE9AE5 /* llbuffer.cpp */; };
52 FD15585E0A06BEB000DE9AE5 /* llbufferstream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD1558520A06BEB000DE9AE5 /* llbufferstream.cpp */; }; 55 FD15585E0A06BEB000DE9AE5 /* llbufferstream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD1558520A06BEB000DE9AE5 /* llbufferstream.cpp */; };
@@ -84,6 +87,11 @@
84 FD155F5D0A08FB5100DE9AE5 /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FD155F480A08FB5100DE9AE5 /* Carbon.framework */; }; 87 FD155F5D0A08FB5100DE9AE5 /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FD155F480A08FB5100DE9AE5 /* Carbon.framework */; };
85 FD155F610A08FD5900DE9AE5 /* llfasttimer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD155F5F0A08FD5900DE9AE5 /* llfasttimer.cpp */; }; 88 FD155F610A08FD5900DE9AE5 /* llfasttimer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD155F5F0A08FD5900DE9AE5 /* llfasttimer.cpp */; };
86 FD155F670A08FD9100DE9AE5 /* message_string_table.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD155F660A08FD9100DE9AE5 /* message_string_table.cpp */; }; 89 FD155F670A08FD9100DE9AE5 /* message_string_table.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD155F660A08FD9100DE9AE5 /* message_string_table.cpp */; };
90 FD23FEB90B4340F3007A29CA /* llhttpnode_tut.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD23FEB70B4340F3007A29CA /* llhttpnode_tut.cpp */; };
91 FD23FEBA0B4340F3007A29CA /* lluserrelations_tut.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD23FEB80B4340F3007A29CA /* lluserrelations_tut.cpp */; };
92 FD23FEBE0B43410C007A29CA /* lluserrelations.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD23FEBC0B43410C007A29CA /* lluserrelations.cpp */; };
93 FD23FEBF0B43410C007A29CA /* lluserrelations.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = FD23FEBD0B43410C007A29CA /* lluserrelations.h */; };
94 FD23FEC60B4341E2007A29CA /* llerror_tut.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD23FEC50B4341E2007A29CA /* llerror_tut.cpp */; };
87 FD396CDD0A1D37DF005DCB1F /* lltut.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD396CDC0A1D37DF005DCB1F /* lltut.cpp */; }; 95 FD396CDD0A1D37DF005DCB1F /* lltut.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD396CDC0A1D37DF005DCB1F /* lltut.cpp */; };
88 FD396D160A1DFB4B005DCB1F /* reflection_tut.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 386A940D0A0B5F60001DE10D /* reflection_tut.cpp */; }; 96 FD396D160A1DFB4B005DCB1F /* reflection_tut.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 386A940D0A0B5F60001DE10D /* reflection_tut.cpp */; };
89 FD506A0609FEB58900E297C2 /* llsdserialize.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD506A0409FEB58900E297C2 /* llsdserialize.cpp */; }; 97 FD506A0609FEB58900E297C2 /* llsdserialize.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD506A0409FEB58900E297C2 /* llsdserialize.cpp */; };
@@ -97,8 +105,6 @@
97 FD5DFA9109C1DF3E007E3F78 /* lldate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD5DFA9009C1DF3E007E3F78 /* lldate.cpp */; }; 105 FD5DFA9109C1DF3E007E3F78 /* lldate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD5DFA9009C1DF3E007E3F78 /* lldate.cpp */; };
98 FD5DFA9309C1DF4E007E3F78 /* lluuid.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD5DFA9209C1DF4E007E3F78 /* lluuid.cpp */; }; 106 FD5DFA9309C1DF4E007E3F78 /* lluuid.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD5DFA9209C1DF4E007E3F78 /* lluuid.cpp */; };
99 FD5DFA9909C1DFB7007E3F78 /* lluri.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD5DFA9709C1DFB7007E3F78 /* lluri.cpp */; }; 107 FD5DFA9909C1DFB7007E3F78 /* lluri.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD5DFA9709C1DFB7007E3F78 /* lluri.cpp */; };
100 FD5DFAA009C1DFE2007E3F78 /* llerrorbuffer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD5DFA9C09C1DFE2007E3F78 /* llerrorbuffer.cpp */; };
101 FD5DFAA209C1DFE2007E3F78 /* llerrorstream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD5DFA9E09C1DFE2007E3F78 /* llerrorstream.cpp */; };
102 FD5DFAA609C1E01D007E3F78 /* llmd5.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD5DFAA509C1E01D007E3F78 /* llmd5.cpp */; }; 108 FD5DFAA609C1E01D007E3F78 /* llmd5.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD5DFAA509C1E01D007E3F78 /* llmd5.cpp */; };
103 FD5DFAA909C1E056007E3F78 /* llerror.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD5DFAA809C1E056007E3F78 /* llerror.cpp */; }; 109 FD5DFAA909C1E056007E3F78 /* llerror.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD5DFAA809C1E056007E3F78 /* llerror.cpp */; };
104 FD5DFAAC09C1E09F007E3F78 /* llrand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD5DFAAB09C1E09F007E3F78 /* llrand.cpp */; }; 110 FD5DFAAC09C1E09F007E3F78 /* llrand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD5DFAAB09C1E09F007E3F78 /* llrand.cpp */; };
@@ -144,8 +150,6 @@
144 FDBC10740AEEC40F00ED2E62 /* libexpat.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FD506ADA09FFE09700E297C2 /* libexpat.a */; }; 150 FDBC10740AEEC40F00ED2E62 /* libexpat.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FD506ADA09FFE09700E297C2 /* libexpat.a */; };
145 FDBC10750AEEC41600ED2E62 /* lldate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD5DFA9009C1DF3E007E3F78 /* lldate.cpp */; }; 151 FDBC10750AEEC41600ED2E62 /* lldate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD5DFA9009C1DF3E007E3F78 /* lldate.cpp */; };
146 FDBC10760AEEC41B00ED2E62 /* llmd5.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD5DFAA509C1E01D007E3F78 /* llmd5.cpp */; }; 152 FDBC10760AEEC41B00ED2E62 /* llmd5.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD5DFAA509C1E01D007E3F78 /* llmd5.cpp */; };
147 FDBC10790AEEC42B00ED2E62 /* llerrorstream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD5DFA9E09C1DFE2007E3F78 /* llerrorstream.cpp */; };
148 FDBC107A0AEEC42C00ED2E62 /* llerrorbuffer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD5DFA9C09C1DFE2007E3F78 /* llerrorbuffer.cpp */; };
149 FDBC107B0AEEC43200ED2E62 /* lluri.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD5DFA9709C1DFB7007E3F78 /* lluri.cpp */; }; 153 FDBC107B0AEEC43200ED2E62 /* lluri.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD5DFA9709C1DFB7007E3F78 /* lluri.cpp */; };
150 FDBC107E0AEEC45100ED2E62 /* lltimer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD5DFAB209C1E11A007E3F78 /* lltimer.cpp */; }; 154 FDBC107E0AEEC45100ED2E62 /* lltimer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD5DFAB209C1E11A007E3F78 /* lltimer.cpp */; };
151 FDBC107F0AEEC45400ED2E62 /* llfasttimer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD155F5F0A08FD5900DE9AE5 /* llfasttimer.cpp */; }; 155 FDBC107F0AEEC45400ED2E62 /* llfasttimer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD155F5F0A08FD5900DE9AE5 /* llfasttimer.cpp */; };
@@ -171,6 +175,7 @@
171 FDBC10AD0AEEC67700ED2E62 /* llframetimer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD1558910A06C01400DE9AE5 /* llframetimer.cpp */; }; 175 FDBC10AD0AEEC67700ED2E62 /* llframetimer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD1558910A06C01400DE9AE5 /* llframetimer.cpp */; };
172 FDCB2A670AF80D9000C44EBA /* llprocessor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FDCB2A650AF80D9000C44EBA /* llprocessor.cpp */; }; 176 FDCB2A670AF80D9000C44EBA /* llprocessor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FDCB2A650AF80D9000C44EBA /* llprocessor.cpp */; };
173 FDCB2A680AF80D9000C44EBA /* llprocessor.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = FDCB2A660AF80D9000C44EBA /* llprocessor.h */; }; 177 FDCB2A680AF80D9000C44EBA /* llprocessor.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = FDCB2A660AF80D9000C44EBA /* llprocessor.h */; };
178 FDE7AD540B7D047700C56FE0 /* llcurl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FDE7AD520B7D047700C56FE0 /* llcurl.cpp */; };
174 FDEC4F5509F7EF7A007BAEEC /* llsd.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD5DF9BE09C0A68F007E3F78 /* llsd.cpp */; }; 179 FDEC4F5509F7EF7A007BAEEC /* llsd.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD5DF9BE09C0A68F007E3F78 /* llsd.cpp */; };
175 FDFAD4210AFFFCC30048A0C7 /* llhttpnode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FDFAD41F0AFFFCC30048A0C7 /* llhttpnode.cpp */; }; 180 FDFAD4210AFFFCC30048A0C7 /* llhttpnode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FDFAD41F0AFFFCC30048A0C7 /* llhttpnode.cpp */; };
176 FDFAD4220AFFFCC30048A0C7 /* llhttpnode.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = FDFAD4200AFFFCC30048A0C7 /* llhttpnode.h */; }; 181 FDFAD4220AFFFCC30048A0C7 /* llhttpnode.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = FDFAD4200AFFFCC30048A0C7 /* llhttpnode.h */; };
@@ -216,6 +221,9 @@
216 FDFAD4220AFFFCC30048A0C7 /* llhttpnode.h in CopyFiles */, 221 FDFAD4220AFFFCC30048A0C7 /* llhttpnode.h in CopyFiles */,
217 91469E820B4486F20009E8F9 /* llmime.h in CopyFiles */, 222 91469E820B4486F20009E8F9 /* llmime.h in CopyFiles */,
218 91469E8E0B4489420009E8F9 /* llquaternion.h in CopyFiles */, 223 91469E8E0B4489420009E8F9 /* llquaternion.h in CopyFiles */,
224 FD23FEBF0B43410C007A29CA /* lluserrelations.h in CopyFiles */,
225 DA4D18180B567E0D0049C10F /* llformat.h in CopyFiles */,
226 DA4D182D0B567ED70049C10F /* llerrorcontrol.h in CopyFiles */,
219 ); 227 );
220 runOnlyForDeploymentPostprocessing = 1; 228 runOnlyForDeploymentPostprocessing = 1;
221 }; 229 };
@@ -252,10 +260,13 @@
252 DA306B540ACD9F3F008D9B2F /* lltiming_tut.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = lltiming_tut.cpp; sourceTree = "<group>"; }; 260 DA306B540ACD9F3F008D9B2F /* lltiming_tut.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = lltiming_tut.cpp; sourceTree = "<group>"; };
253 DA306B550ACD9F3F008D9B2F /* lluri_tut.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = lluri_tut.cpp; sourceTree = "<group>"; }; 261 DA306B550ACD9F3F008D9B2F /* lluri_tut.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = lluri_tut.cpp; sourceTree = "<group>"; };
254 DA306B5B0ACD9F6F008D9B2F /* llhttpclient.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llhttpclient.cpp; sourceTree = "<group>"; }; 262 DA306B5B0ACD9F6F008D9B2F /* llhttpclient.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llhttpclient.cpp; sourceTree = "<group>"; };
263 DA4D18150B567E0D0049C10F /* llformat.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llformat.cpp; sourceTree = "<group>"; };
264 DA4D18160B567E0D0049C10F /* llformat.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llformat.h; sourceTree = "<group>"; };
265 DA4D182B0B567ED70049C10F /* llerrorcontrol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = llerrorcontrol.h; sourceTree = "<group>"; };
266 DA9C40460B540D8A00DD6F44 /* lllivefile.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = lllivefile.cpp; sourceTree = "<group>"; };
267 DA9C40470B540D8A00DD6F44 /* lllivefile.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = lllivefile.h; sourceTree = "<group>"; };
255 DAD1C4CA0AE2C78C0054574C /* stats.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = stats.h; sourceTree = "<group>"; }; 268 DAD1C4CA0AE2C78C0054574C /* stats.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = stats.h; sourceTree = "<group>"; };
256 DAD1C4CB0AE2C78C0054574C /* stats.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = stats.cpp; sourceTree = "<group>"; }; 269 DAD1C4CB0AE2C78C0054574C /* stats.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = stats.cpp; sourceTree = "<group>"; };
257 DAD1C4DC0AE2CA0C0054574C /* llcurl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = llcurl.h; sourceTree = "<group>"; };
258 DAD1C4DD0AE2CA0C0054574C /* llcurl.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = llcurl.cpp; sourceTree = "<group>"; };
259 FD15584C0A06BE2E00DE9AE5 /* io.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = io.cpp; sourceTree = "<group>"; }; 270 FD15584C0A06BE2E00DE9AE5 /* io.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = io.cpp; sourceTree = "<group>"; };
260 FD1558500A06BEB000DE9AE5 /* llbuffer.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llbuffer.cpp; sourceTree = "<group>"; }; 271 FD1558500A06BEB000DE9AE5 /* llbuffer.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llbuffer.cpp; sourceTree = "<group>"; };
261 FD1558510A06BEB000DE9AE5 /* llbuffer.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llbuffer.h; sourceTree = "<group>"; }; 272 FD1558510A06BEB000DE9AE5 /* llbuffer.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llbuffer.h; sourceTree = "<group>"; };
@@ -322,6 +333,11 @@
322 FD155F5F0A08FD5900DE9AE5 /* llfasttimer.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llfasttimer.cpp; sourceTree = "<group>"; }; 333 FD155F5F0A08FD5900DE9AE5 /* llfasttimer.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llfasttimer.cpp; sourceTree = "<group>"; };
323 FD155F600A08FD5900DE9AE5 /* llfasttimer.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llfasttimer.h; sourceTree = "<group>"; }; 334 FD155F600A08FD5900DE9AE5 /* llfasttimer.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llfasttimer.h; sourceTree = "<group>"; };
324 FD155F660A08FD9100DE9AE5 /* message_string_table.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = message_string_table.cpp; sourceTree = "<group>"; }; 335 FD155F660A08FD9100DE9AE5 /* message_string_table.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = message_string_table.cpp; sourceTree = "<group>"; };
336 FD23FEB70B4340F3007A29CA /* llhttpnode_tut.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llhttpnode_tut.cpp; sourceTree = "<group>"; };
337 FD23FEB80B4340F3007A29CA /* lluserrelations_tut.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = lluserrelations_tut.cpp; sourceTree = "<group>"; };
338 FD23FEBC0B43410C007A29CA /* lluserrelations.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = lluserrelations.cpp; sourceTree = "<group>"; };
339 FD23FEBD0B43410C007A29CA /* lluserrelations.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = lluserrelations.h; sourceTree = "<group>"; };
340 FD23FEC50B4341E2007A29CA /* llerror_tut.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llerror_tut.cpp; sourceTree = "<group>"; };
325 FD396CD80A1D3768005DCB1F /* lltut.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = lltut.h; sourceTree = "<group>"; }; 341 FD396CD80A1D3768005DCB1F /* lltut.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = lltut.h; sourceTree = "<group>"; };
326 FD396CDC0A1D37DF005DCB1F /* lltut.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lltut.cpp; sourceTree = "<group>"; }; 342 FD396CDC0A1D37DF005DCB1F /* lltut.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lltut.cpp; sourceTree = "<group>"; };
327 FD506A0409FEB58900E297C2 /* llsdserialize.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llsdserialize.cpp; sourceTree = "<group>"; }; 343 FD506A0409FEB58900E297C2 /* llsdserialize.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llsdserialize.cpp; sourceTree = "<group>"; };
@@ -340,8 +356,6 @@
340 FD5DFA9009C1DF3E007E3F78 /* lldate.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = lldate.cpp; sourceTree = "<group>"; }; 356 FD5DFA9009C1DF3E007E3F78 /* lldate.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = lldate.cpp; sourceTree = "<group>"; };
341 FD5DFA9209C1DF4E007E3F78 /* lluuid.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = lluuid.cpp; sourceTree = "<group>"; }; 357 FD5DFA9209C1DF4E007E3F78 /* lluuid.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = lluuid.cpp; sourceTree = "<group>"; };
342 FD5DFA9709C1DFB7007E3F78 /* lluri.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = lluri.cpp; sourceTree = "<group>"; }; 358 FD5DFA9709C1DFB7007E3F78 /* lluri.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = lluri.cpp; sourceTree = "<group>"; };
343 FD5DFA9C09C1DFE2007E3F78 /* llerrorbuffer.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llerrorbuffer.cpp; sourceTree = "<group>"; };
344 FD5DFA9E09C1DFE2007E3F78 /* llerrorstream.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llerrorstream.cpp; sourceTree = "<group>"; };
345 FD5DFAA509C1E01D007E3F78 /* llmd5.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llmd5.cpp; sourceTree = "<group>"; }; 359 FD5DFAA509C1E01D007E3F78 /* llmd5.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llmd5.cpp; sourceTree = "<group>"; };
346 FD5DFAA809C1E056007E3F78 /* llerror.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llerror.cpp; sourceTree = "<group>"; }; 360 FD5DFAA809C1E056007E3F78 /* llerror.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llerror.cpp; sourceTree = "<group>"; };
347 FD5DFAAB09C1E09F007E3F78 /* llrand.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llrand.cpp; sourceTree = "<group>"; }; 361 FD5DFAAB09C1E09F007E3F78 /* llrand.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llrand.cpp; sourceTree = "<group>"; };
@@ -352,7 +366,6 @@
352 FD7325790A0834080072A37B /* llapr.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llapr.h; sourceTree = "<group>"; }; 366 FD7325790A0834080072A37B /* llapr.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llapr.h; sourceTree = "<group>"; };
353 FD73257A0A0834080072A37B /* lldate.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = lldate.h; sourceTree = "<group>"; }; 367 FD73257A0A0834080072A37B /* lldate.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = lldate.h; sourceTree = "<group>"; };
354 FD73257B0A0834080072A37B /* llerror.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llerror.h; sourceTree = "<group>"; }; 368 FD73257B0A0834080072A37B /* llerror.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llerror.h; sourceTree = "<group>"; };
355 FD73257C0A0834080072A37B /* llerrorbuffer.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llerrorbuffer.h; sourceTree = "<group>"; };
356 FD73257D0A0834080072A37B /* llstring.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llstring.h; sourceTree = "<group>"; }; 369 FD73257D0A0834080072A37B /* llstring.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llstring.h; sourceTree = "<group>"; };
357 FD73257E0A0834080072A37B /* lltimer.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = lltimer.h; sourceTree = "<group>"; }; 370 FD73257E0A0834080072A37B /* lltimer.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = lltimer.h; sourceTree = "<group>"; };
358 FD73257F0A0834080072A37B /* lluri.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = lluri.h; sourceTree = "<group>"; }; 371 FD73257F0A0834080072A37B /* lluri.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = lluri.h; sourceTree = "<group>"; };
@@ -425,6 +438,8 @@
425 FDBC10660AEEC3A600ED2E62 /* llpriqueuemap.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llpriqueuemap.h; sourceTree = "<group>"; }; 438 FDBC10660AEEC3A600ED2E62 /* llpriqueuemap.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llpriqueuemap.h; sourceTree = "<group>"; };
426 FDCB2A650AF80D9000C44EBA /* llprocessor.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llprocessor.cpp; sourceTree = "<group>"; }; 439 FDCB2A650AF80D9000C44EBA /* llprocessor.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llprocessor.cpp; sourceTree = "<group>"; };
427 FDCB2A660AF80D9000C44EBA /* llprocessor.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llprocessor.h; sourceTree = "<group>"; }; 440 FDCB2A660AF80D9000C44EBA /* llprocessor.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llprocessor.h; sourceTree = "<group>"; };
441 FDE7AD520B7D047700C56FE0 /* llcurl.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llcurl.cpp; sourceTree = "<group>"; };
442 FDE7AD530B7D047700C56FE0 /* llcurl.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llcurl.h; sourceTree = "<group>"; };
428 FDF2E4180ADD7B620003B83E /* TestWebServer */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = TestWebServer; sourceTree = BUILT_PRODUCTS_DIR; }; 443 FDF2E4180ADD7B620003B83E /* TestWebServer */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = TestWebServer; sourceTree = BUILT_PRODUCTS_DIR; };
429 FDF2E5580ADDBB7F0003B83E /* llhttpdelayeddata.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llhttpdelayeddata.cpp; sourceTree = "<group>"; }; 444 FDF2E5580ADDBB7F0003B83E /* llhttpdelayeddata.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llhttpdelayeddata.cpp; sourceTree = "<group>"; };
430 FDF2E5590ADDBB7F0003B83E /* llhttpdelayeddata.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llhttpdelayeddata.h; sourceTree = "<group>"; }; 445 FDF2E5590ADDBB7F0003B83E /* llhttpdelayeddata.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llhttpdelayeddata.h; sourceTree = "<group>"; };
@@ -492,6 +507,9 @@
492 08FB7795FE84155DC02AAC07 /* test */ = { 507 08FB7795FE84155DC02AAC07 /* test */ = {
493 isa = PBXGroup; 508 isa = PBXGroup;
494 children = ( 509 children = (
510 FD23FEC50B4341E2007A29CA /* llerror_tut.cpp */,
511 FD23FEB70B4340F3007A29CA /* llhttpnode_tut.cpp */,
512 FD23FEB80B4340F3007A29CA /* lluserrelations_tut.cpp */,
495 DA01B1F10ADE831200A44198 /* testwebclient */, 513 DA01B1F10ADE831200A44198 /* testwebclient */,
496 FDF2E5600ADDBB900003B83E /* testwebserver */, 514 FDF2E5600ADDBB900003B83E /* testwebserver */,
497 91469E830B44870B0009E8F9 /* llmime_tut.cpp */, 515 91469E830B44870B0009E8F9 /* llmime_tut.cpp */,
@@ -532,8 +550,6 @@
532 DA01B2040ADE839D00A44198 /* testwebclient.cpp */, 550 DA01B2040ADE839D00A44198 /* testwebclient.cpp */,
533 DAD1C4CA0AE2C78C0054574C /* stats.h */, 551 DAD1C4CA0AE2C78C0054574C /* stats.h */,
534 DAD1C4CB0AE2C78C0054574C /* stats.cpp */, 552 DAD1C4CB0AE2C78C0054574C /* stats.cpp */,
535 DAD1C4DC0AE2CA0C0054574C /* llcurl.h */,
536 DAD1C4DD0AE2CA0C0054574C /* llcurl.cpp */,
537 ); 553 );
538 path = testwebclient; 554 path = testwebclient;
539 sourceTree = "<group>"; 555 sourceTree = "<group>";
@@ -541,6 +557,8 @@
541 FD15584F0A06BE4100DE9AE5 /* llmessage */ = { 557 FD15584F0A06BE4100DE9AE5 /* llmessage */ = {
542 isa = PBXGroup; 558 isa = PBXGroup;
543 children = ( 559 children = (
560 FDE7AD520B7D047700C56FE0 /* llcurl.cpp */,
561 FDE7AD530B7D047700C56FE0 /* llcurl.h */,
544 91469E7F0B4486F20009E8F9 /* llmime.cpp */, 562 91469E7F0B4486F20009E8F9 /* llmime.cpp */,
545 91469E800B4486F20009E8F9 /* llmime.h */, 563 91469E800B4486F20009E8F9 /* llmime.h */,
546 FDFAD41F0AFFFCC30048A0C7 /* llhttpnode.cpp */, 564 FDFAD41F0AFFFCC30048A0C7 /* llhttpnode.cpp */,
@@ -641,6 +659,10 @@
641 FD5DF88009C0A17D007E3F78 /* llcommon */ = { 659 FD5DF88009C0A17D007E3F78 /* llcommon */ = {
642 isa = PBXGroup; 660 isa = PBXGroup;
643 children = ( 661 children = (
662 DA4D18150B567E0D0049C10F /* llformat.cpp */,
663 DA4D18160B567E0D0049C10F /* llformat.h */,
664 DA9C40460B540D8A00DD6F44 /* lllivefile.cpp */,
665 DA9C40470B540D8A00DD6F44 /* lllivefile.h */,
644 FDCB2A650AF80D9000C44EBA /* llprocessor.cpp */, 666 FDCB2A650AF80D9000C44EBA /* llprocessor.cpp */,
645 FDCB2A660AF80D9000C44EBA /* llprocessor.h */, 667 FDCB2A660AF80D9000C44EBA /* llprocessor.h */,
646 FDBC10660AEEC3A600ED2E62 /* llpriqueuemap.h */, 668 FDBC10660AEEC3A600ED2E62 /* llpriqueuemap.h */,
@@ -663,9 +685,6 @@
663 FD73257A0A0834080072A37B /* lldate.h */, 685 FD73257A0A0834080072A37B /* lldate.h */,
664 FD5DFAA809C1E056007E3F78 /* llerror.cpp */, 686 FD5DFAA809C1E056007E3F78 /* llerror.cpp */,
665 FD73257B0A0834080072A37B /* llerror.h */, 687 FD73257B0A0834080072A37B /* llerror.h */,
666 FD5DFA9C09C1DFE2007E3F78 /* llerrorbuffer.cpp */,
667 FD73257C0A0834080072A37B /* llerrorbuffer.h */,
668 FD5DFA9E09C1DFE2007E3F78 /* llerrorstream.cpp */,
669 FD155F5F0A08FD5900DE9AE5 /* llfasttimer.cpp */, 688 FD155F5F0A08FD5900DE9AE5 /* llfasttimer.cpp */,
670 FD155F600A08FD5900DE9AE5 /* llfasttimer.h */, 689 FD155F600A08FD5900DE9AE5 /* llfasttimer.h */,
671 389CFB450A0B69C700EE2094 /* llfile.cpp */, 690 389CFB450A0B69C700EE2094 /* llfile.cpp */,
@@ -702,6 +721,7 @@
702 38A8BF690A18C38800814862 /* reflective.h */, 721 38A8BF690A18C38800814862 /* reflective.h */,
703 FD5DFAB809C1E13A007E3F78 /* u64.cpp */, 722 FD5DFAB809C1E13A007E3F78 /* u64.cpp */,
704 FD7325800A0834080072A37B /* u64.h */, 723 FD7325800A0834080072A37B /* u64.h */,
724 DA4D182B0B567ED70049C10F /* llerrorcontrol.h */,
705 ); 725 );
706 name = llcommon; 726 name = llcommon;
707 path = ../llcommon; 727 path = ../llcommon;
@@ -743,6 +763,8 @@
743 FD73259C0A08E8520072A37B /* llinventory */ = { 763 FD73259C0A08E8520072A37B /* llinventory */ = {
744 isa = PBXGroup; 764 isa = PBXGroup;
745 children = ( 765 children = (
766 FD23FEBC0B43410C007A29CA /* lluserrelations.cpp */,
767 FD23FEBD0B43410C007A29CA /* lluserrelations.h */,
746 FD73259D0A08E8A00072A37B /* llinventory.cpp */, 768 FD73259D0A08E8A00072A37B /* llinventory.cpp */,
747 FD73259E0A08E8A00072A37B /* llinventory.h */, 769 FD73259E0A08E8A00072A37B /* llinventory.h */,
748 FD7325AA0A08E9330072A37B /* llpermissions.cpp */, 770 FD7325AA0A08E9330072A37B /* llpermissions.cpp */,
@@ -894,8 +916,6 @@
894 FD5DFA9109C1DF3E007E3F78 /* lldate.cpp in Sources */, 916 FD5DFA9109C1DF3E007E3F78 /* lldate.cpp in Sources */,
895 FD5DFA9309C1DF4E007E3F78 /* lluuid.cpp in Sources */, 917 FD5DFA9309C1DF4E007E3F78 /* lluuid.cpp in Sources */,
896 FD5DFA9909C1DFB7007E3F78 /* lluri.cpp in Sources */, 918 FD5DFA9909C1DFB7007E3F78 /* lluri.cpp in Sources */,
897 FD5DFAA009C1DFE2007E3F78 /* llerrorbuffer.cpp in Sources */,
898 FD5DFAA209C1DFE2007E3F78 /* llerrorstream.cpp in Sources */,
899 FD5DFAA609C1E01D007E3F78 /* llmd5.cpp in Sources */, 919 FD5DFAA609C1E01D007E3F78 /* llmd5.cpp in Sources */,
900 FD5DFAA909C1E056007E3F78 /* llerror.cpp in Sources */, 920 FD5DFAA909C1E056007E3F78 /* llerror.cpp in Sources */,
901 FD5DFAAC09C1E09F007E3F78 /* llrand.cpp in Sources */, 921 FD5DFAAC09C1E09F007E3F78 /* llrand.cpp in Sources */,
@@ -993,6 +1013,12 @@
993 91469E810B4486F20009E8F9 /* llmime.cpp in Sources */, 1013 91469E810B4486F20009E8F9 /* llmime.cpp in Sources */,
994 91469E840B44870B0009E8F9 /* llmime_tut.cpp in Sources */, 1014 91469E840B44870B0009E8F9 /* llmime_tut.cpp in Sources */,
995 91469E8D0B4489420009E8F9 /* llquaternion.cpp in Sources */, 1015 91469E8D0B4489420009E8F9 /* llquaternion.cpp in Sources */,
1016 FD23FEB90B4340F3007A29CA /* llhttpnode_tut.cpp in Sources */,
1017 FD23FEBA0B4340F3007A29CA /* lluserrelations_tut.cpp in Sources */,
1018 FD23FEBE0B43410C007A29CA /* lluserrelations.cpp in Sources */,
1019 FD23FEC60B4341E2007A29CA /* llerror_tut.cpp in Sources */,
1020 DA9C40480B540D8A00DD6F44 /* lllivefile.cpp in Sources */,
1021 DA4D18170B567E0D0049C10F /* llformat.cpp in Sources */,
996 ); 1022 );
997 runOnlyForDeploymentPostprocessing = 0; 1023 runOnlyForDeploymentPostprocessing = 0;
998 }; 1024 };
@@ -1001,15 +1027,12 @@
1001 buildActionMask = 2147483647; 1027 buildActionMask = 2147483647;
1002 files = ( 1028 files = (
1003 DAD1C4CC0AE2C78C0054574C /* stats.cpp in Sources */, 1029 DAD1C4CC0AE2C78C0054574C /* stats.cpp in Sources */,
1004 DAD1C4DE0AE2CA0C0054574C /* llcurl.cpp in Sources */,
1005 FDBC106D0AEEC3DA00ED2E62 /* llsd.cpp in Sources */, 1030 FDBC106D0AEEC3DA00ED2E62 /* llsd.cpp in Sources */,
1006 FDBC106F0AEEC3E900ED2E62 /* lluuid.cpp in Sources */, 1031 FDBC106F0AEEC3E900ED2E62 /* lluuid.cpp in Sources */,
1007 FDBC10710AEEC3F800ED2E62 /* llsdserialize.cpp in Sources */, 1032 FDBC10710AEEC3F800ED2E62 /* llsdserialize.cpp in Sources */,
1008 FDBC10720AEEC3F900ED2E62 /* llsdserialize_xml.cpp in Sources */, 1033 FDBC10720AEEC3F900ED2E62 /* llsdserialize_xml.cpp in Sources */,
1009 FDBC10750AEEC41600ED2E62 /* lldate.cpp in Sources */, 1034 FDBC10750AEEC41600ED2E62 /* lldate.cpp in Sources */,
1010 FDBC10760AEEC41B00ED2E62 /* llmd5.cpp in Sources */, 1035 FDBC10760AEEC41B00ED2E62 /* llmd5.cpp in Sources */,
1011 FDBC10790AEEC42B00ED2E62 /* llerrorstream.cpp in Sources */,
1012 FDBC107A0AEEC42C00ED2E62 /* llerrorbuffer.cpp in Sources */,
1013 FDBC107B0AEEC43200ED2E62 /* lluri.cpp in Sources */, 1036 FDBC107B0AEEC43200ED2E62 /* lluri.cpp in Sources */,
1014 FDBC107E0AEEC45100ED2E62 /* lltimer.cpp in Sources */, 1037 FDBC107E0AEEC45100ED2E62 /* lltimer.cpp in Sources */,
1015 FDBC107F0AEEC45400ED2E62 /* llfasttimer.cpp in Sources */, 1038 FDBC107F0AEEC45400ED2E62 /* llfasttimer.cpp in Sources */,
@@ -1031,6 +1054,7 @@
1031 FDBC10A90AEEC65700ED2E62 /* llstreamtools.cpp in Sources */, 1054 FDBC10A90AEEC65700ED2E62 /* llstreamtools.cpp in Sources */,
1032 FDBC10AB0AEEC66100ED2E62 /* testwebclient.cpp in Sources */, 1055 FDBC10AB0AEEC66100ED2E62 /* testwebclient.cpp in Sources */,
1033 FDBC10AD0AEEC67700ED2E62 /* llframetimer.cpp in Sources */, 1056 FDBC10AD0AEEC67700ED2E62 /* llframetimer.cpp in Sources */,
1057 FDE7AD540B7D047700C56FE0 /* llcurl.cpp in Sources */,
1034 ); 1058 );
1035 runOnlyForDeploymentPostprocessing = 0; 1059 runOnlyForDeploymentPostprocessing = 0;
1036 }; 1060 };
diff --git a/linden/indra/test/blowfish.1.bin b/linden/indra/test/blowfish.1.bin
new file mode 100644
index 0000000..61286e4
--- /dev/null
+++ b/linden/indra/test/blowfish.1.bin
@@ -0,0 +1 @@
.A„Ä3ŒLÜE ``òøÝKÛ@¼ûÇ;M[ÚBë·ø„>ËÊC—' \ No newline at end of file
diff --git a/linden/indra/test/blowfish.2.bin b/linden/indra/test/blowfish.2.bin
new file mode 100644
index 0000000..ef72d96
--- /dev/null
+++ b/linden/indra/test/blowfish.2.bin
Binary files differ
diff --git a/linden/indra/test/blowfish.digits.txt b/linden/indra/test/blowfish.digits.txt
new file mode 100644
index 0000000..fce1fed
--- /dev/null
+++ b/linden/indra/test/blowfish.digits.txt
@@ -0,0 +1 @@
01234567890123456789012345678901234
diff --git a/linden/indra/test/blowfish.pl b/linden/indra/test/blowfish.pl
new file mode 100755
index 0000000..7940d87
--- /dev/null
+++ b/linden/indra/test/blowfish.pl
@@ -0,0 +1,74 @@
1#!/usr/bin/perl
2use strict;
3use warnings;
4
5# *TODO: specify test count here
6use Test::More qw(no_plan);
7
8use Crypt::CBC;
9use MIME::Base64;
10
11my $init_vector = "\x00" x 8;
12# my $key = pack("H*", "ef5a8376eb0c99fe0dafa487d15bec19cae63d1e25fe31d8d92f7ab0398246d70ee733108e47360e16359654571cf5bab6c3375b42cee4fa");
13# my $key = "d263eb8a78034e40";
14 #"8d082918aa369174";
15my $key = "\x00" x 16;
16
17my $cipher = Crypt::CBC->new( { cipher => 'Blowfish',
18 regenerate_key => 0,
19 key => $key,
20 iv => $init_vector,
21 header => 'none',
22 prepend_iv => 0,
23 keysize => 16 } );
24
25#my $blocks = $cipher->blocksize();
26#print "blocksize $blocks\n";
27
28my $len;
29my $input = "01234567890123456789012345678901234\n";
30#my $input = "a whale of a tale I tell you lad, a whale of a tale for me, a whale of a tale and the fiddlers three";
31$len = length($input);
32is ($len, 36, "input length");
33
34$len = length($key);
35is ($len, 16, "key length");
36
37
38my $encrypted = $cipher->encrypt($input);
39is (length($encrypted), 40, "encrypted length");
40
41open(FH, "blowfish.1.bin");
42my $bin = scalar <FH>;
43is ($encrypted, $bin, "matches openssl");
44close(FH);
45
46my $base64 = encode_base64($encrypted);
47is ($base64, "LkGExDOMTNxFIGBg8gP43UvbQLz7xztNWwYF2kLrtwT4hD7LykOXJw==\n",
48 "base64 output");
49
50my $unbase64 = decode_base64($base64);
51is( $encrypted, $unbase64, "reverse base64" );
52
53my $output = $cipher->decrypt($unbase64);
54is ($input, $output, "reverse encrypt");
55
56$key = pack("H[32]", "526a1e07a19dbaed84c4ff08a488d15e");
57$cipher = Crypt::CBC->new( { cipher => 'Blowfish',
58 regenerate_key => 0,
59 key => $key,
60 iv => $init_vector,
61 header => 'none',
62 prepend_iv => 0,
63 keysize => 16 } );
64$encrypted = $cipher->encrypt($input);
65is (length($encrypted), 40, "uuid encrypted length");
66$output = $cipher->decrypt($encrypted);
67is ($input, $output, "uuid reverse encrypt");
68
69open(FH, "blowfish.2.bin");
70$bin = scalar <FH>;
71close(FH);
72is( $encrypted, $bin, "uuid matches openssl" );
73
74print encode_base64($encrypted);
diff --git a/linden/indra/test/common.cpp b/linden/indra/test/common.cpp
index 1be0931..97ff21c 100644
--- a/linden/indra/test/common.cpp
+++ b/linden/indra/test/common.cpp
@@ -109,7 +109,7 @@ namespace tut
109 // gen up a starting point 109 // gen up a starting point
110 typedef std::vector<U8> buf_t; 110 typedef std::vector<U8> buf_t;
111 buf_t source; 111 buf_t source;
112 srand(i); 112 srand(i); /* Flawfinder: ignore */
113 S32 size = rand() % 1000 + 10; 113 S32 size = rand() % 1000 + 10;
114 std::generate_n( 114 std::generate_n(
115 std::back_insert_iterator<buf_t>(source), 115 std::back_insert_iterator<buf_t>(source),
@@ -157,7 +157,7 @@ namespace tut
157 // gen up a starting point 157 // gen up a starting point
158 typedef std::vector<U8> buf_t; 158 typedef std::vector<U8> buf_t;
159 buf_t source; 159 buf_t source;
160 srand(666 + i); 160 srand(666 + i); /* Flawfinder: ignore */
161 S32 size = rand() % 1000 + 10; 161 S32 size = rand() % 1000 + 10;
162 std::generate_n( 162 std::generate_n(
163 std::back_insert_iterator<buf_t>(source), 163 std::back_insert_iterator<buf_t>(source),
@@ -307,7 +307,7 @@ namespace tut
307 { 307 {
308 // gen up a starting point 308 // gen up a starting point
309 std::string expected; 309 std::string expected;
310 srand(1337 + i); 310 srand(1337 + i); /* Flawfinder: ignore */
311 S32 size = rand() % 30 + 5; 311 S32 size = rand() % 30 + 5;
312 std::generate_n( 312 std::generate_n(
313 std::back_insert_iterator<std::string>(expected), 313 std::back_insert_iterator<std::string>(expected),
@@ -436,7 +436,7 @@ namespace tut
436 void mem_object::test<1>() 436 void mem_object::test<1>()
437 { 437 {
438 const char HELLO_WORLD[] = "hello world"; 438 const char HELLO_WORLD[] = "hello world";
439 LLMemoryStream mem((U8*)&HELLO_WORLD[0], strlen(HELLO_WORLD)); 439 LLMemoryStream mem((U8*)&HELLO_WORLD[0], strlen(HELLO_WORLD)); /* Flawfinder: ignore */
440 std::string hello; 440 std::string hello;
441 std::string world; 441 std::string world;
442 mem >> hello >> world; 442 mem >> hello >> world;
diff --git a/linden/indra/test/files.lst b/linden/indra/test/files.lst
index 0f99ce9..77ce9f4 100644
--- a/linden/indra/test/files.lst
+++ b/linden/indra/test/files.lst
@@ -2,6 +2,9 @@ test/common.cpp
2test/inventory.cpp 2test/inventory.cpp
3test/io.cpp 3test/io.cpp
4test/llapp_tut.cpp 4test/llapp_tut.cpp
5test/llbase64_tut.cpp
6test/llblowfish_tut.cpp
7test/llerror_tut.cpp
5test/llhttpclient_tut.cpp 8test/llhttpclient_tut.cpp
6test/llhttpnode_tut.cpp 9test/llhttpnode_tut.cpp
7test/lliohttpserver_tut.cpp 10test/lliohttpserver_tut.cpp
diff --git a/linden/indra/test/io.cpp b/linden/indra/test/io.cpp
index 2f6ba09..a86711a 100644
--- a/linden/indra/test/io.cpp
+++ b/linden/indra/test/io.cpp
@@ -77,7 +77,7 @@ namespace tut
77 void buffer_object::test<2>() 77 void buffer_object::test<2>()
78 { 78 {
79 const char HELLO_WORLD[] = "hello world"; 79 const char HELLO_WORLD[] = "hello world";
80 const S32 str_len = strlen(HELLO_WORLD); 80 const S32 str_len = strlen(HELLO_WORLD); /* Flawfinder: ignore */
81 LLChannelDescriptors ch = mBuffer.nextChannel(); 81 LLChannelDescriptors ch = mBuffer.nextChannel();
82 mBuffer.append(ch.in(), (U8*)HELLO_WORLD, str_len); 82 mBuffer.append(ch.in(), (U8*)HELLO_WORLD, str_len);
83 mBuffer.append(ch.in(), (U8*)HELLO_WORLD, str_len); 83 mBuffer.append(ch.in(), (U8*)HELLO_WORLD, str_len);
@@ -99,7 +99,7 @@ namespace tut
99 LLChannelDescriptors ch = mBuffer.nextChannel(); 99 LLChannelDescriptors ch = mBuffer.nextChannel();
100 mBuffer.append(ch.in(), (U8*)ONE, 3); 100 mBuffer.append(ch.in(), (U8*)ONE, 3);
101 mBuffer.append(ch.in(), (U8*)TWO, 3); 101 mBuffer.append(ch.in(), (U8*)TWO, 3);
102 char buffer[255]; 102 char buffer[255]; /* Flawfinder: ignore */
103 S32 len = 6; 103 S32 len = 6;
104 mBuffer.readAfter(ch.in(), NULL, (U8*)buffer, len); 104 mBuffer.readAfter(ch.in(), NULL, (U8*)buffer, len);
105 ensure_equals(len, 6); 105 ensure_equals(len, 6);
@@ -118,7 +118,7 @@ namespace tut
118 LLChannelDescriptors ch = mBuffer.nextChannel(); 118 LLChannelDescriptors ch = mBuffer.nextChannel();
119 mBuffer.append(ch.in(), (U8*)TWO, 3); 119 mBuffer.append(ch.in(), (U8*)TWO, 3);
120 mBuffer.prepend(ch.in(), (U8*)ONE, 3); 120 mBuffer.prepend(ch.in(), (U8*)ONE, 3);
121 char buffer[255]; 121 char buffer[255]; /* Flawfinder: ignore */
122 S32 len = 6; 122 S32 len = 6;
123 mBuffer.readAfter(ch.in(), NULL, (U8*)buffer, len); 123 mBuffer.readAfter(ch.in(), NULL, (U8*)buffer, len);
124 ensure_equals(len, 6); 124 ensure_equals(len, 6);
@@ -136,7 +136,7 @@ namespace tut
136 LLChannelDescriptors ch = mBuffer.nextChannel(); 136 LLChannelDescriptors ch = mBuffer.nextChannel();
137 mBuffer.append(ch.in(), (U8*)TWO, 3); 137 mBuffer.append(ch.in(), (U8*)TWO, 3);
138 mBuffer.prepend(ch.in(), (U8*)ONE, 3); 138 mBuffer.prepend(ch.in(), (U8*)ONE, 3);
139 char buffer[255]; 139 char buffer[255]; /* Flawfinder: ignore */
140 S32 len = 5; 140 S32 len = 5;
141 LLBufferArray::segment_iterator_t it = mBuffer.beginSegment(); 141 LLBufferArray::segment_iterator_t it = mBuffer.beginSegment();
142 U8* addr = (*it).data(); 142 U8* addr = (*it).data();
@@ -163,7 +163,7 @@ namespace tut
163 header << "ContentLength: " << count << "\r\n\r\n"; 163 header << "ContentLength: " << count << "\r\n\r\n";
164 std::string head(header.str()); 164 std::string head(header.str());
165 mBuffer.prepend(ch.out(), (U8*)head.c_str(), head.length()); 165 mBuffer.prepend(ch.out(), (U8*)head.c_str(), head.length());
166 char buffer[1024]; 166 char buffer[1024]; /* Flawfinder: ignore */
167 S32 len = response.size() + head.length(); 167 S32 len = response.size() + head.length();
168 ensure_equals("same length", len, (S32)expected.str().length()); 168 ensure_equals("same length", len, (S32)expected.str().length());
169 mBuffer.readAfter(ch.out(), NULL, (U8*)buffer, len); 169 mBuffer.readAfter(ch.out(), NULL, (U8*)buffer, len);
@@ -228,11 +228,11 @@ namespace tut
228 delete[] temp; 228 delete[] temp;
229 } 229 }
230 230
231/* 231#if 0
232 template<> template<> 232 template<> template<>
233 void buffer_object::test<9>() 233 void buffer_object::test<9>()
234 { 234 {
235 char buffer[1024]; 235 char buffer[1024]; /* Flawfinder: ignore */
236 S32 size = sprintf(buffer, 236 S32 size = sprintf(buffer,
237 "%d|%d|%s|%s|%s|%s|%s|%x|%x|%x|%x|%x|%s|%s|%d|%d|%x", 237 "%d|%d|%s|%s|%s|%s|%s|%x|%x|%x|%x|%x|%s|%s|%d|%d|%x",
238 7, 238 7,
@@ -263,7 +263,7 @@ namespace tut
263 ensure_equals("Buffer sizes",size,(S32)post_size); 263 ensure_equals("Buffer sizes",size,(S32)post_size);
264 ensure("Buffer content",!strcmp(buffer,post_buffer)); 264 ensure("Buffer content",!strcmp(buffer,post_buffer));
265 } 265 }
266*/ 266#endif
267 267
268 /* 268 /*
269 template<> template<> 269 template<> template<>
@@ -287,7 +287,7 @@ namespace tut
287 void bas_object::test<1>() 287 void bas_object::test<1>()
288 { 288 {
289 const char HELLO_WORLD[] = "hello world"; 289 const char HELLO_WORLD[] = "hello world";
290 const S32 str_len = strlen(HELLO_WORLD); 290 const S32 str_len = strlen(HELLO_WORLD); /* Flawfinder: ignore */
291 LLChannelDescriptors ch = mBuffer.nextChannel(); 291 LLChannelDescriptors ch = mBuffer.nextChannel();
292 LLBufferStream str(ch, &mBuffer); 292 LLBufferStream str(ch, &mBuffer);
293 mBuffer.append(ch.in(), (U8*)HELLO_WORLD, str_len); 293 mBuffer.append(ch.in(), (U8*)HELLO_WORLD, str_len);
@@ -425,7 +425,7 @@ namespace tut
425 ostr << ") "; 425 ostr << ") ";
426 bstr.flush(); 426 bstr.flush();
427 const S32 BUF_LEN = 512; 427 const S32 BUF_LEN = 512;
428 char buf[BUF_LEN]; 428 char buf[BUF_LEN]; /* Flawfinder: ignore */
429 S32 actual_len = BUF_LEN; 429 S32 actual_len = BUF_LEN;
430 (void) mBuffer.readAfter(ch.out(), NULL, (U8*)buf, actual_len); 430 (void) mBuffer.readAfter(ch.out(), NULL, (U8*)buf, actual_len);
431 buf[actual_len] = '\0'; 431 buf[actual_len] = '\0';
@@ -479,7 +479,7 @@ namespace tut
479 ++total_size; 479 ++total_size;
480 } 480 }
481 need_comma = true; 481 need_comma = true;
482 srand(69 + i); 482 srand(69 + i); /* Flawfinder: ignore */
483 S32 size = rand() % 1000 + 1000; 483 S32 size = rand() % 1000 + 1000;
484 std::generate_n( 484 std::generate_n(
485 std::back_insert_iterator<buf_t>(source), 485 std::back_insert_iterator<buf_t>(source),
@@ -545,7 +545,7 @@ namespace tut
545 need_comma = true; 545 need_comma = true;
546 ostr << "'" << i << "':"; 546 ostr << "'" << i << "':";
547 total_size += 7; 547 total_size += 7;
548 srand(69 + i); 548 srand(69 + i); /* Flawfinder: ignore */
549 S32 size = rand() % 1000 + 1000; 549 S32 size = rand() % 1000 + 1000;
550 std::generate_n( 550 std::generate_n(
551 std::back_insert_iterator<buf_t>(source), 551 std::back_insert_iterator<buf_t>(source),
@@ -601,7 +601,7 @@ namespace tut
601 "'circuit_code': i124,'group_id': '8615c885-9cf0-bf0a-6e40-0c11462aa652','limited_to_estate': i1,'look_at': [ i0, i0, i0]," 601 "'circuit_code': i124,'group_id': '8615c885-9cf0-bf0a-6e40-0c11462aa652','limited_to_estate': i1,'look_at': [ i0, i0, i0],"
602 "'agent_id': '0e346d8b-4433-4d66-a6b0-fd37083abc4c','first_name': 'Kelly','start': 'url'}]}"; 602 "'agent_id': '0e346d8b-4433-4d66-a6b0-fd37083abc4c','first_name': 'Kelly','start': 'url'}]}";
603 LLChannelDescriptors ch = mBuffer.nextChannel(); 603 LLChannelDescriptors ch = mBuffer.nextChannel();
604 mBuffer.append(ch.out(), (U8*)LOGIN_STREAM, strlen(LOGIN_STREAM)); 604 mBuffer.append(ch.out(), (U8*)LOGIN_STREAM, strlen(LOGIN_STREAM)); /* Flawfinder: ignore */
605 ch = mBuffer.nextChannel(); 605 ch = mBuffer.nextChannel();
606 LLBufferStream istr(ch, &mBuffer); 606 LLBufferStream istr(ch, &mBuffer);
607 LLSD data; 607 LLSD data;
@@ -1119,7 +1119,7 @@ namespace tut
1119 stream << "{'task_id':ucc706f2d-0b68-68f8-11a4-f1043ff35ca0}\n{\n\tname\tObject|\n\tpermissions 0\n}"; 1119 stream << "{'task_id':ucc706f2d-0b68-68f8-11a4-f1043ff35ca0}\n{\n\tname\tObject|\n\tpermissions 0\n}";
1120 std::vector<U8> expected_binary; 1120 std::vector<U8> expected_binary;
1121 expected_binary.resize(stream.str().size()); 1121 expected_binary.resize(stream.str().size());
1122 memcpy(&expected_binary[0], stream.str().c_str(), stream.str().size()); 1122 memcpy(&expected_binary[0], stream.str().c_str(), stream.str().size()); /* Flawfinder: ignore */
1123 stream.str(""); 1123 stream.str("");
1124 stream << "[{'uri':'" << uri << "'}, {'version':i1}, " 1124 stream << "[{'uri':'" << uri << "'}, {'version':i1}, "
1125 << "{'agent_id':'3c115e51-04f4-523c-9fa6-98aff1034730', 'session_id':'2c585cec-038c-40b0-b42e-a25ebab4d132', 'circuit_code':i1075, 'start':'region', 'limited_to_estate':i1 'first_name':'Phoenix', 'last_name':'Linden', 'group_title':'', 'group_id':u00000000-0000-0000-0000-000000000000, 'position':[r70.9247,r254.378,r38.7304], 'look_at':[r-0.043753,r-0.999042,r0], 'granters':[ua2e76fcd-9360-4f6d-a924-000000000003], 'texture_data':['5e481e8a-58a6-fc34-6e61-c7a36095c07f', 'c39675f5-ca90-a304-bb31-42cdb803a132', '5c989edf-88d1-b2ac-b00b-5ed4bab8e368', '6522e74d-1660-4e7f-b601-6f48c1659a77', '7ca39b4c-bd19-4699-aff7-f93fd03d3e7b', '41c58177-5eb6-5aeb-029d-bc4093f3c130', '97b75473-8b93-9b25-2a11-035b9ae93195', '1c2d8d9b-90eb-89d4-dea8-c1ed83990614', '69ec543f-e27b-c07c-9094-a8be6300f274', 'c9f8b80f-c629-4633-04ee-c566ce9fea4b', '989cddba-7ab6-01ed-67aa-74accd2a2a65', '45e319b2-6a8c-fa5c-895b-1a7149b88aef', '5748decc-f629-461c-9a36-a35a221fe21f', 'c228d1cf-4b5d-4ba8-84f4-899a0796aa97', 'c228d1cf-4b5d-4ba8-84f4-899a0796aa97', '685fbe10-ab40-f065-0aec-726cc6dfd7a1', '406f98fd-9c89-1d52-5f39-e67d508c5ee5', '685fbe10-ab40-f065-0aec-726cc6dfd7a1', 'c228d1cf-4b5d-4ba8-84f4-899a0796aa97', 'c228d1cf-4b5d-4ba8-84f4-899a0796aa97'], " 1125 << "{'agent_id':'3c115e51-04f4-523c-9fa6-98aff1034730', 'session_id':'2c585cec-038c-40b0-b42e-a25ebab4d132', 'circuit_code':i1075, 'start':'region', 'limited_to_estate':i1 'first_name':'Phoenix', 'last_name':'Linden', 'group_title':'', 'group_id':u00000000-0000-0000-0000-000000000000, 'position':[r70.9247,r254.378,r38.7304], 'look_at':[r-0.043753,r-0.999042,r0], 'granters':[ua2e76fcd-9360-4f6d-a924-000000000003], 'texture_data':['5e481e8a-58a6-fc34-6e61-c7a36095c07f', 'c39675f5-ca90-a304-bb31-42cdb803a132', '5c989edf-88d1-b2ac-b00b-5ed4bab8e368', '6522e74d-1660-4e7f-b601-6f48c1659a77', '7ca39b4c-bd19-4699-aff7-f93fd03d3e7b', '41c58177-5eb6-5aeb-029d-bc4093f3c130', '97b75473-8b93-9b25-2a11-035b9ae93195', '1c2d8d9b-90eb-89d4-dea8-c1ed83990614', '69ec543f-e27b-c07c-9094-a8be6300f274', 'c9f8b80f-c629-4633-04ee-c566ce9fea4b', '989cddba-7ab6-01ed-67aa-74accd2a2a65', '45e319b2-6a8c-fa5c-895b-1a7149b88aef', '5748decc-f629-461c-9a36-a35a221fe21f', 'c228d1cf-4b5d-4ba8-84f4-899a0796aa97', 'c228d1cf-4b5d-4ba8-84f4-899a0796aa97', '685fbe10-ab40-f065-0aec-726cc6dfd7a1', '406f98fd-9c89-1d52-5f39-e67d508c5ee5', '685fbe10-ab40-f065-0aec-726cc6dfd7a1', 'c228d1cf-4b5d-4ba8-84f4-899a0796aa97', 'c228d1cf-4b5d-4ba8-84f4-899a0796aa97'], "
@@ -1213,7 +1213,7 @@ namespace tut
1213 tmp_str << "{'task_id':ucc706f2d-0b68-68f8-11a4-f1043ff35ca0}\n{\n\tname\tObject|\n\tpermissions 0\n}"; 1213 tmp_str << "{'task_id':ucc706f2d-0b68-68f8-11a4-f1043ff35ca0}\n{\n\tname\tObject|\n\tpermissions 0\n}";
1214 std::vector<U8> expected_binary; 1214 std::vector<U8> expected_binary;
1215 expected_binary.resize(tmp_str.str().size()); 1215 expected_binary.resize(tmp_str.str().size());
1216 memcpy( 1216 memcpy( /* Flawfinder: ignore */
1217 &expected_binary[0], 1217 &expected_binary[0],
1218 tmp_str.str().c_str(), 1218 tmp_str.str().c_str(),
1219 tmp_str.str().size()); 1219 tmp_str.str().size());
diff --git a/linden/indra/test/llapp_tut.cpp b/linden/indra/test/llapp_tut.cpp
index a238cb3..3223f91 100644
--- a/linden/indra/test/llapp_tut.cpp
+++ b/linden/indra/test/llapp_tut.cpp
@@ -150,4 +150,17 @@ namespace tut
150 bool ok = mApp->parseCommandOptions(ARGC, ARGV); 150 bool ok = mApp->parseCommandOptions(ARGC, ARGV);
151 ensure("command line parse failure", !ok); 151 ensure("command line parse failure", !ok);
152 } 152 }
153
154
155 template<> template<>
156 void application_object_t::test<5>()
157 {
158 LLSD options;
159 options["boolean-test"] = true;
160 mApp->setOptionData(LLApp::PRIORITY_GENERAL_CONFIGURATION, options);
161 ensure("bool set", mApp->getOption("boolean-test").asBoolean());
162 options["boolean-test"] = false;
163 mApp->setOptionData(LLApp::PRIORITY_RUNTIME_OVERRIDE, options);
164 ensure("bool unset", !mApp->getOption("boolean-test").asBoolean());
165 }
153} 166}
diff --git a/linden/indra/test/llbase64_tut.cpp b/linden/indra/test/llbase64_tut.cpp
new file mode 100644
index 0000000..fe02397
--- /dev/null
+++ b/linden/indra/test/llbase64_tut.cpp
@@ -0,0 +1,77 @@
1/**
2 * @file llbase64_tut.cpp
3 * @author James Cook
4 * @date 2007-02-04
5 *
6 * Copyright (c) 2007-2007, Linden Research, Inc.
7 *
8 * The source code in this file ("Source Code") is provided by Linden Lab
9 * to you under the terms of the GNU General Public License, version 2.0
10 * ("GPL"), unless you have obtained a separate licensing agreement
11 * ("Other License"), formally executed by you and Linden Lab. Terms of
12 * the GPL can be found in doc/GPL-license.txt in this distribution, or
13 * online at http://secondlife.com/developers/opensource/gplv2
14 *
15 * There are special exceptions to the terms and conditions of the GPL as
16 * it is applied to this Source Code. View the full text of the exception
17 * in the file doc/FLOSS-exception.txt in this software distribution, or
18 * online at http://secondlife.com/developers/opensource/flossexception
19 *
20 * By copying, modifying or distributing this software, you acknowledge
21 * that you have read and understood your obligations described above,
22 * and agree to abide by those obligations.
23 *
24 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
25 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
26 * COMPLETENESS OR PERFORMANCE.
27 */
28
29#include "linden_common.h"
30#include "lltut.h"
31
32#include "llbase64.h"
33
34#include <string>
35#include "lluuid.h"
36
37namespace tut
38{
39 struct base64_data
40 {
41 };
42 typedef test_group<base64_data> base64_test;
43 typedef base64_test::object base64_object;
44 tut::base64_test base64("base64");
45
46 template<> template<>
47 void base64_object::test<1>()
48 {
49 std::string result;
50
51 result = LLBase64::encode(NULL, 0);
52 ensure("encode nothing", (result == "") );
53
54 LLUUID nothing;
55 result = LLBase64::encode(&nothing.mData[0], UUID_BYTES);
56 ensure("encode blank uuid",
57 (result == "AAAAAAAAAAAAAAAAAAAAAA==") );
58
59 LLUUID id("526a1e07-a19d-baed-84c4-ff08a488d15e");
60 result = LLBase64::encode(&id.mData[0], UUID_BYTES);
61 ensure("encode random uuid",
62 (result == "UmoeB6Gduu2ExP8IpIjRXg==") );
63
64 }
65
66 template<> template<>
67 void base64_object::test<2>()
68 {
69 std::string result;
70
71 U8 blob[40] = { 115, 223, 172, 255, 140, 70, 49, 125, 236, 155, 45, 199, 101, 17, 164, 131, 230, 19, 80, 64, 112, 53, 135, 98, 237, 12, 26, 72, 126, 14, 145, 143, 118, 196, 11, 177, 132, 169, 195, 134 };
72 result = LLBase64::encode(&blob[0], 40);
73 ensure("encode 40 bytes",
74 (result == "c9+s/4xGMX3smy3HZRGkg+YTUEBwNYdi7QwaSH4OkY92xAuxhKnDhg==") );
75 }
76
77}
diff --git a/linden/indra/test/llblowfish_tut.cpp b/linden/indra/test/llblowfish_tut.cpp
new file mode 100644
index 0000000..0d85ade
--- /dev/null
+++ b/linden/indra/test/llblowfish_tut.cpp
@@ -0,0 +1,144 @@
1/**
2 * @file llblowfish_tut.cpp
3 * @author James Cook, james@lindenlab.com
4 * @date 2007-02-04
5 *
6 * Data files generated with:
7 * openssl enc -bf-cbc -in blowfish.digits.txt -out blowfish.1.bin -K 00000000000000000000000000000000 -iv 0000000000000000 -p
8 * openssl enc -bf-cbc -in blowfish.digits.txt -out blowfish.2.bin -K 526a1e07a19dbaed84c4ff08a488d15e -iv 0000000000000000 -p
9 *
10 * Copyright (c) 2007-2007, Linden Research, Inc.
11 *
12 * The source code in this file ("Source Code") is provided by Linden Lab
13 * to you under the terms of the GNU General Public License, version 2.0
14 * ("GPL"), unless you have obtained a separate licensing agreement
15 * ("Other License"), formally executed by you and Linden Lab. Terms of
16 * the GPL can be found in doc/GPL-license.txt in this distribution, or
17 * online at http://secondlife.com/developers/opensource/gplv2
18 *
19 * There are special exceptions to the terms and conditions of the GPL as
20 * it is applied to this Source Code. View the full text of the exception
21 * in the file doc/FLOSS-exception.txt in this software distribution, or
22 * online at http://secondlife.com/developers/opensource/flossexception
23 *
24 * By copying, modifying or distributing this software, you acknowledge
25 * that you have read and understood your obligations described above,
26 * and agree to abide by those obligations.
27 *
28 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
29 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
30 * COMPLETENESS OR PERFORMANCE.
31 */
32
33#include "linden_common.h"
34#include "lltut.h"
35
36#include "llblowfishcipher.h"
37
38#include <string>
39#include <stdio.h>
40#include "lluuid.h"
41
42namespace tut
43{
44 class LLData
45 {
46 public:
47 unsigned char* mInput;
48 int mInputSize;
49
50 LLData()
51 {
52 // \n to make it easier to create text files
53 // for testing with command line openssl
54 mInput = (unsigned char*)"01234567890123456789012345678901234\n";
55 mInputSize = 36;
56 }
57
58 bool matchFile(const char* filename,
59 const std::string& data)
60 {
61 FILE* fp = fopen(filename, "rb");
62 if (!fp)
63 {
64 // sometimes test is run inside the indra directory
65 std::string path = "test/";
66 path += filename;
67 fp = fopen(path.c_str(), "rb");
68 }
69 if (!fp)
70 {
71 llwarns << "unabled to open " << filename << llendl;
72 return false;
73 }
74
75 std::string good;
76 good.resize(256);
77 size_t got = fread(&good[0], 1, 256, fp);
78 lldebugs << "matchFile read " << got << llendl;
79 fclose(fp);
80 good.resize(got);
81
82 return (good == data);
83 }
84 };
85 typedef test_group<LLData> blowfish_test;
86 typedef blowfish_test::object blowfish_object;
87 // Create test with name that can be selected on
88 // command line of test app.
89 tut::blowfish_test blowfish("blowfish");
90
91 template<> template<>
92 void blowfish_object::test<1>()
93 {
94 LLUUID blank;
95 LLBlowfishCipher cipher(&blank.mData[0], UUID_BYTES);
96
97 U32 dst_len = cipher.requiredEncryptionSpace(36);
98 ensure("encryption space 36",
99 (dst_len == 40) );
100
101 // Blowfish adds an additional 8-byte block if your
102 // input is an exact multiple of 8
103 dst_len = cipher.requiredEncryptionSpace(8);
104 ensure("encryption space 8",
105 (dst_len == 16) );
106 }
107
108 template<> template<>
109 void blowfish_object::test<2>()
110 {
111 LLUUID blank;
112 LLBlowfishCipher cipher(&blank.mData[0], UUID_BYTES);
113
114 std::string result;
115 result.resize(256);
116 U32 count = cipher.encrypt(mInput, mInputSize,
117 (U8*) &result[0], 256);
118
119 ensure("encrypt output count",
120 (count == 40) );
121 result.resize(count);
122
123 ensure("encrypt null key", matchFile("blowfish.1.bin", result));
124 }
125
126 template<> template<>
127 void blowfish_object::test<3>()
128 {
129 // same as base64 test id
130 LLUUID id("526a1e07-a19d-baed-84c4-ff08a488d15e");
131 LLBlowfishCipher cipher(&id.mData[0], UUID_BYTES);
132
133 std::string result;
134 result.resize(256);
135 U32 count = cipher.encrypt(mInput, mInputSize,
136 (U8*) &result[0], 256);
137
138 ensure("encrypt output count",
139 (count == 40) );
140 result.resize(count);
141
142 ensure("encrypt real key", matchFile("blowfish.2.bin", result));
143 }
144}
diff --git a/linden/indra/test/llerror_tut.cpp b/linden/indra/test/llerror_tut.cpp
new file mode 100644
index 0000000..a4b4258
--- /dev/null
+++ b/linden/indra/test/llerror_tut.cpp
@@ -0,0 +1,767 @@
1/**
2 * @file llerror_tut.cpp
3 * @date December 2006
4 * @brief error unit tests
5 *
6 * Copyright (c) 2006-2007, Linden Research, Inc.
7 *
8 * The source code in this file ("Source Code") is provided by Linden Lab
9 * to you under the terms of the GNU General Public License, version 2.0
10 * ("GPL"), unless you have obtained a separate licensing agreement
11 * ("Other License"), formally executed by you and Linden Lab. Terms of
12 * the GPL can be found in doc/GPL-license.txt in this distribution, or
13 * online at http://secondlife.com/developers/opensource/gplv2
14 *
15 * There are special exceptions to the terms and conditions of the GPL as
16 * it is applied to this Source Code. View the full text of the exception
17 * in the file doc/FLOSS-exception.txt in this software distribution, or
18 * online at http://secondlife.com/developers/opensource/flossexception
19 *
20 * By copying, modifying or distributing this software, you acknowledge
21 * that you have read and understood your obligations described above,
22 * and agree to abide by those obligations.
23 *
24 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
25 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
26 * COMPLETENESS OR PERFORMANCE.
27 */
28
29#include "llerror.h"
30namespace
31{
32 void test_that_error_h_includes_enough_things_to_compile_a_message()
33 {
34 llinfos << "!" << llendl;
35 }
36}
37
38#include <tut/tut.h>
39#include "lltut.h"
40
41#include <vector>
42
43#include "llerrorcontrol.h"
44#include "llsd.h"
45
46namespace
47{
48 static bool fatalWasCalled;
49 void fatalCall(const std::string&) { fatalWasCalled = true; }
50
51 class TestRecorder : public LLError::Recorder
52 {
53 public:
54 TestRecorder() : mWantsTime(false) { }
55 ~TestRecorder() { LLError::removeRecorder(this); }
56
57 void recordMessage(LLError::ELevel level,
58 const std::string& message)
59 {
60 mMessages.push_back(message);
61 }
62
63 int countMessages() { return (int) mMessages.size(); }
64 void clearMessages() { mMessages.clear(); }
65
66 void setWantsTime(bool t) { mWantsTime = t; }
67 bool wantsTime() { return mWantsTime; }
68
69 std::string message(int n)
70 {
71 std::ostringstream test_name;
72 test_name << "testing message " << n << ", not enough messages";
73
74 tut::ensure(test_name.str(), n < countMessages());
75 return mMessages[n];
76 }
77
78 private:
79 typedef std::vector<std::string> MessageVector;
80 MessageVector mMessages;
81
82 bool mWantsTime;
83 };
84}
85
86namespace tut
87{
88 struct ErrorTestData
89 {
90 TestRecorder mRecorder;
91 LLError::Settings* mPriorErrorSettings;
92
93 ErrorTestData()
94 {
95 fatalWasCalled = false;
96
97 mPriorErrorSettings = LLError::saveAndResetSettings();
98 LLError::setDefaultLevel(LLError::LEVEL_DEBUG);
99 LLError::setFatalFunction(fatalCall);
100 LLError::addRecorder(&mRecorder);
101 }
102
103 ~ErrorTestData()
104 {
105 LLError::removeRecorder(&mRecorder);
106 LLError::restoreSettings(mPriorErrorSettings);
107 }
108
109 void ensure_message_count(int expectedCount)
110 {
111 ensure_equals("message count", mRecorder.countMessages(), expectedCount);
112 }
113
114 void ensure_message_contains(int n, const std::string& expectedText)
115 {
116 std::ostringstream test_name;
117 test_name << "testing message " << n;
118
119 ensure_contains(test_name.str(), mRecorder.message(n), expectedText);
120 }
121
122 void ensure_message_does_not_contain(int n, const std::string& expectedText)
123 {
124 std::ostringstream test_name;
125 test_name << "testing message " << n;
126
127 ensure_does_not_contain(test_name.str(), mRecorder.message(n), expectedText);
128 }
129 };
130
131 typedef test_group<ErrorTestData> ErrorTestGroup;
132 typedef ErrorTestGroup::object ErrorTestObject;
133
134 ErrorTestGroup errorTestGroup("error");
135
136 template<> template<>
137 void ErrorTestObject::test<1>()
138 // basic test of output
139 {
140 llinfos << "test" << llendl;
141 llinfos << "bob" << llendl;
142
143 ensure_message_contains(0, "test");
144 ensure_message_contains(1, "bob");
145 }
146}
147
148namespace
149{
150 void writeSome()
151 {
152 lldebugs << "one" << llendl;
153 llinfos << "two" << llendl;
154 llwarns << "three" << llendl;
155 llerrs << "four" << llendl;
156 // fatal messages write out and addtional "error" message
157 }
158};
159
160namespace tut
161{
162 template<> template<>
163 void ErrorTestObject::test<2>()
164 // messages are filtered based on default level
165 {
166 LLError::setDefaultLevel(LLError::LEVEL_DEBUG);
167 writeSome();
168 ensure_message_contains(0, "one");
169 ensure_message_contains(1, "two");
170 ensure_message_contains(2, "three");
171 ensure_message_contains(3, "error");
172 ensure_message_contains(4, "four");
173 ensure_message_count(5);
174
175 LLError::setDefaultLevel(LLError::LEVEL_INFO);
176 writeSome();
177 ensure_message_contains(5, "two");
178 ensure_message_contains(6, "three");
179 ensure_message_contains(7, "error");
180 ensure_message_contains(8, "four");
181 ensure_message_count(9);
182
183 LLError::setDefaultLevel(LLError::LEVEL_WARN);
184 writeSome();
185 ensure_message_contains(9, "three");
186 ensure_message_contains(10, "error");
187 ensure_message_contains(11, "four");
188 ensure_message_count(12);
189
190 LLError::setDefaultLevel(LLError::LEVEL_ERROR);
191 writeSome();
192 ensure_message_contains(12, "error");
193 ensure_message_contains(13, "four");
194 ensure_message_count(14);
195
196 LLError::setDefaultLevel(LLError::LEVEL_NONE);
197 writeSome();
198 ensure_message_count(14);
199 }
200
201 template<> template<>
202 void ErrorTestObject::test<3>()
203 // error type string in output
204 {
205 writeSome();
206 ensure_message_contains(0, "DEBUG: ");
207 ensure_message_contains(1, "INFO: ");
208 ensure_message_contains(2, "WARNING: ");
209 ensure_message_does_not_contain(3, "ERROR");
210 ensure_message_contains(4, "ERROR: ");
211 ensure_message_count(5);
212 }
213
214 template<> template<>
215 void ErrorTestObject::test<4>()
216 // file abbreviation
217 {
218 std::string thisFile = __FILE__;
219 std::string abbreviateFile = LLError::abbreviateFile(thisFile);
220
221 ensure_ends_with("file name abbreviation",
222 abbreviateFile,
223 "test/llerror_tut.cpp"
224 );
225 ensure_does_not_contain("file name abbreviation",
226 abbreviateFile, "indra");
227
228 std::string someFile =
229#if LL_WINDOWS
230 "C:/amy/bob/cam.cpp"
231#else
232 "/amy/bob/cam.cpp"
233#endif
234 ;
235 std::string someAbbreviation = LLError::abbreviateFile(someFile);
236
237 ensure_equals("non-indra file abbreviation",
238 someAbbreviation, someFile);
239 }
240}
241
242namespace
243{
244 std::string locationString(int line)
245 {
246 std::ostringstream location;
247 location << LLError::abbreviateFile(__FILE__)
248 << "(" << line << ") : ";
249
250 return location.str();
251 }
252
253 std::string writeReturningLocation()
254 {
255 llinfos << "apple" << llendl; int this_line = __LINE__;
256 return locationString(this_line);
257 }
258
259 std::string writeReturningLocationAndFunction()
260 {
261 llinfos << "apple" << llendl; int this_line = __LINE__;
262 return locationString(this_line) + __FUNCTION__;
263 }
264
265 std::string errorReturningLocation()
266 {
267 llerrs << "die" << llendl; int this_line = __LINE__;
268 return locationString(this_line);
269 }
270}
271
272namespace tut
273{
274 template<> template<>
275 void ErrorTestObject::test<5>()
276 // file and line information in log messages
277 {
278 std::string location = writeReturningLocation();
279 // expecting default to not print location information
280
281 LLError::setPrintLocation(true);
282 writeReturningLocation();
283
284 LLError::setPrintLocation(false);
285 writeReturningLocation();
286
287 ensure_message_does_not_contain(0, location);
288 ensure_message_contains(1, location);
289 ensure_message_does_not_contain(2, location);
290 }
291}
292
293/* The following helper functions and class members all log a simple message
294 from some particular function scope. Each function takes a bool argument
295 that indicates if it should log its own name or not (in the manner that
296 existing log messages often do.) The functions all return their C++
297 name so that test can be substantial mechanized.
298 */
299
300std::string logFromGlobal(bool id)
301{
302 llinfos << (id ? "logFromGlobal: " : "") << "hi" << llendl;
303 return "logFromGlobal";
304}
305
306static std::string logFromStatic(bool id)
307{
308 llinfos << (id ? "logFromStatic: " : "") << "hi" << llendl;
309 return "logFromStatic";
310}
311
312namespace
313{
314 std::string logFromAnon(bool id)
315 {
316 llinfos << (id ? "logFromAnon: " : "") << "hi" << llendl;
317 return "logFromAnon";
318 }
319}
320
321namespace Foo {
322 std::string logFromNamespace(bool id)
323 {
324 llinfos << (id ? "Foo::logFromNamespace: " : "") << "hi" << llendl;
325 //return "Foo::logFromNamespace";
326 // there is no standard way to get the namespace name, hence
327 // we won't be testing for it
328 return "logFromNamespace";
329 }
330}
331
332namespace
333{
334 class ClassWithNoLogType {
335 public:
336 std::string logFromMember(bool id)
337 {
338 llinfos << (id ? "ClassWithNoLogType::logFromMember: " : "") << "hi" << llendl;
339 return "ClassWithNoLogType::logFromMember";
340 }
341 static std::string logFromStatic(bool id)
342 {
343 llinfos << (id ? "ClassWithNoLogType::logFromStatic: " : "") << "hi" << llendl;
344 return "ClassWithNoLogType::logFromStatic";
345 }
346 };
347
348 class ClassWithLogType {
349 LOG_CLASS(ClassWithLogType);
350 public:
351 std::string logFromMember(bool id)
352 {
353 llinfos << (id ? "ClassWithLogType::logFromMember: " : "") << "hi" << llendl;
354 return "ClassWithLogType::logFromMember";
355 }
356 static std::string logFromStatic(bool id)
357 {
358 llinfos << (id ? "ClassWithLogType::logFromStatic: " : "") << "hi" << llendl;
359 return "ClassWithLogType::logFromStatic";
360 }
361 };
362
363 std::string logFromNamespace(bool id) { return Foo::logFromNamespace(id); }
364 std::string logFromClassWithNoLogTypeMember(bool id) { ClassWithNoLogType c; return c.logFromMember(id); }
365 std::string logFromClassWithNoLogTypeStatic(bool id) { return ClassWithNoLogType::logFromStatic(id); }
366 std::string logFromClassWithLogTypeMember(bool id) { ClassWithLogType c; return c.logFromMember(id); }
367 std::string logFromClassWithLogTypeStatic(bool id) { return ClassWithLogType::logFromStatic(id); }
368
369 void ensure_has_once(const std::string& message,
370 const std::string& actual, const std::string& expected)
371 {
372 std::string::size_type n1 = actual.find(expected);
373 std::string::size_type n2 = std::string::npos;
374 if (n1 != std::string::npos)
375 {
376 n2 = std::string(actual, n1 + expected.size()).find(expected);
377 }
378
379 if (n1 == std::string::npos || n2 != std::string::npos)
380 {
381 std::stringstream ss;
382 ss << message << ": " << "expected to find one copy of " << expected
383 << " in actual " << actual;
384 throw tut::failure(ss.str().c_str());
385 }
386 }
387
388 typedef std::string (*LogFromFunction)(bool);
389 void testLogNameOnce(TestRecorder& recorder, LogFromFunction f,
390 const std::string& class_name = "")
391 {
392 recorder.clearMessages();
393 std::string name = f(false);
394 f(true);
395
396 std::string messageWithoutName = recorder.message(0);
397 std::string messageWithName = recorder.message(1);
398
399 ensure_has_once(name + " logged without name",
400 messageWithoutName, name);
401 ensure_has_once(name + " logged with name",
402 messageWithName, name);
403
404 if (!class_name.empty())
405 {
406 ensure_has_once(name + "logged without name",
407 messageWithoutName, class_name);
408 ensure_has_once(name + "logged with name",
409 messageWithName, class_name);
410 }
411 }
412}
413
414namespace tut
415{
416 template<> template<>
417 // class/function information in output
418 void ErrorTestObject::test<6>()
419 {
420 testLogNameOnce(mRecorder, logFromGlobal);
421 testLogNameOnce(mRecorder, logFromStatic);
422 testLogNameOnce(mRecorder, logFromAnon);
423 testLogNameOnce(mRecorder, logFromNamespace);
424 //testLogNameOnce(mRecorder, logFromClassWithNoLogTypeMember, "ClassWithNoLogType");
425 //testLogNameOnce(mRecorder, logFromClassWithNoLogTypeStatic, "ClassWithNoLogType");
426 // XXX: figure out what the exepcted response is for these
427 testLogNameOnce(mRecorder, logFromClassWithLogTypeMember, "ClassWithLogType");
428 testLogNameOnce(mRecorder, logFromClassWithLogTypeStatic, "ClassWithLogType");
429 }
430}
431
432namespace
433{
434 std::string innerLogger()
435 {
436 llinfos << "inside" << llendl;
437 return "moo";
438 }
439
440 std::string outerLogger()
441 {
442 llinfos << "outside(" << innerLogger() << ")" << llendl;
443 return "bar";
444 }
445
446 void uberLogger()
447 {
448 llinfos << "uber(" << outerLogger() << "," << innerLogger() << ")" << llendl;
449 }
450
451 class LogWhileLogging
452 {
453 public:
454 void print(std::ostream& out) const
455 {
456 llinfos << "logging" << llendl;
457 out << "baz";
458 }
459 };
460
461 std::ostream& operator<<(std::ostream& out, const LogWhileLogging& l)
462 { l.print(out); return out; }
463
464 void metaLogger()
465 {
466 LogWhileLogging l;
467 llinfos << "meta(" << l << ")" << llendl;
468 }
469
470}
471
472namespace tut
473{
474 template<> template<>
475 // handle nested logging
476 void ErrorTestObject::test<7>()
477 {
478 outerLogger();
479 ensure_message_contains(0, "inside");
480 ensure_message_contains(1, "outside(moo)");
481 ensure_message_count(2);
482
483 uberLogger();
484 ensure_message_contains(2, "inside");
485 ensure_message_contains(3, "inside");
486 ensure_message_contains(4, "outside(moo)");
487 ensure_message_contains(5, "uber(bar,moo)");
488 ensure_message_count(6);
489
490 metaLogger();
491 ensure_message_contains(6, "logging");
492 ensure_message_contains(7, "meta(baz)");
493 ensure_message_count(8);
494 }
495
496 template<> template<>
497 // special handling of llerrs calls
498 void ErrorTestObject::test<8>()
499 {
500 LLError::setPrintLocation(false);
501 std::string location = errorReturningLocation();
502
503 ensure_message_contains(0, location + "error");
504 ensure_message_contains(1, "die");
505 ensure_message_count(2);
506
507 ensure("fatal callback called", fatalWasCalled);
508 }
509}
510
511namespace
512{
513 std::string roswell()
514 {
515 return "1947-07-08T03:04:05Z";
516 }
517
518 void ufoSighting()
519 {
520 llinfos << "ufo" << llendl;
521 }
522}
523
524namespace tut
525{
526 template<> template<>
527 // time in output (for recorders that need it)
528 void ErrorTestObject::test<9>()
529 {
530 LLError::setTimeFunction(roswell);
531
532 mRecorder.setWantsTime(false);
533 ufoSighting();
534 ensure_message_contains(0, "ufo");
535 ensure_message_does_not_contain(0, roswell());
536
537 mRecorder.setWantsTime(true);
538 ufoSighting();
539 ensure_message_contains(1, "ufo");
540 ensure_message_contains(1, roswell());
541 }
542
543 template<> template<>
544 // output order
545 void ErrorTestObject::test<10>()
546 {
547 LLError::setPrintLocation(true);
548 LLError::setTimeFunction(roswell);
549 mRecorder.setWantsTime(true);
550 std::string locationAndFunction = writeReturningLocationAndFunction();
551
552 ensure_equals("order is time type location function message",
553 mRecorder.message(0),
554 roswell() + " INFO: " + locationAndFunction + ": apple");
555 }
556
557 template<> template<>
558 // multiple recorders
559 void ErrorTestObject::test<11>()
560 {
561 TestRecorder altRecorder;
562 LLError::addRecorder(&altRecorder);
563
564 llinfos << "boo" << llendl;
565
566 ensure_message_contains(0, "boo");
567 ensure_equals("alt recorder count", altRecorder.countMessages(), 1);
568 ensure_contains("alt recorder message 0", altRecorder.message(0), "boo");
569
570 LLError::setTimeFunction(roswell);
571
572 TestRecorder anotherRecorder;
573 anotherRecorder.setWantsTime(true);
574 LLError::addRecorder(&anotherRecorder);
575
576 llinfos << "baz" << llendl;
577
578 std::string when = roswell();
579
580 ensure_message_does_not_contain(1, when);
581 ensure_equals("alt recorder count", altRecorder.countMessages(), 2);
582 ensure_does_not_contain("alt recorder message 1", altRecorder.message(1), when);
583 ensure_equals("another recorder count", anotherRecorder.countMessages(), 1);
584 ensure_contains("another recorder message 0", anotherRecorder.message(0), when);
585 }
586}
587
588class TestAlpha
589{
590 LOG_CLASS(TestAlpha);
591public:
592 static void doDebug() { lldebugs << "add dice" << llendl; }
593 static void doInfo() { llinfos << "any idea" << llendl; }
594 static void doWarn() { llwarns << "aim west" << llendl; }
595 static void doError() { llerrs << "ate eels" << llendl; }
596 static void doAll() { doDebug(); doInfo(); doWarn(); doError(); }
597};
598
599class TestBeta
600{
601 LOG_CLASS(TestBeta);
602public:
603 static void doDebug() { lldebugs << "bed down" << llendl; }
604 static void doInfo() { llinfos << "buy iron" << llendl; }
605 static void doWarn() { llwarns << "bad word" << llendl; }
606 static void doError() { llerrs << "big easy" << llendl; }
607 static void doAll() { doDebug(); doInfo(); doWarn(); doError(); }
608};
609
610namespace tut
611{
612 template<> template<>
613 // filtering by class
614 void ErrorTestObject::test<12>()
615 {
616 LLError::setDefaultLevel(LLError::LEVEL_WARN);
617 LLError::setClassLevel("TestBeta", LLError::LEVEL_INFO);
618
619 TestAlpha::doAll();
620 TestBeta::doAll();
621
622 ensure_message_contains(0, "aim west");
623 ensure_message_contains(1, "error");
624 ensure_message_contains(2, "ate eels");
625 ensure_message_contains(3, "buy iron");
626 ensure_message_contains(4, "bad word");
627 ensure_message_contains(5, "error");
628 ensure_message_contains(6, "big easy");
629 ensure_message_count(7);
630 }
631
632 template<> template<>
633 // filtering by function, and that it will override class filtering
634 void ErrorTestObject::test<13>()
635 {
636 LLError::setDefaultLevel(LLError::LEVEL_DEBUG);
637 LLError::setClassLevel("TestBeta", LLError::LEVEL_WARN);
638 LLError::setFunctionLevel("TestBeta::doInfo", LLError::LEVEL_DEBUG);
639 LLError::setFunctionLevel("TestBeta::doError", LLError::LEVEL_NONE);
640
641 TestBeta::doAll();
642 ensure_message_contains(0, "buy iron");
643 ensure_message_contains(1, "bad word");
644 ensure_message_count(2);
645 }
646
647 template<> template<>
648 // filtering by file
649 // and that it is overridden by both class and function filtering
650 void ErrorTestObject::test<14>()
651 {
652 LLError::setDefaultLevel(LLError::LEVEL_DEBUG);
653 LLError::setFileLevel(LLError::abbreviateFile(__FILE__),
654 LLError::LEVEL_WARN);
655 LLError::setClassLevel("TestAlpha", LLError::LEVEL_INFO);
656 LLError::setFunctionLevel("TestAlpha::doError",
657 LLError::LEVEL_NONE);
658 LLError::setFunctionLevel("TestBeta::doError",
659 LLError::LEVEL_NONE);
660
661 TestAlpha::doAll();
662 TestBeta::doAll();
663 ensure_message_contains(0, "any idea");
664 ensure_message_contains(1, "aim west");
665 ensure_message_contains(2, "bad word");
666 ensure_message_count(3);
667 }
668
669 template<> template<>
670 // proper cached, efficient lookup of filtering
671 void ErrorTestObject::test<15>()
672 {
673 LLError::setDefaultLevel(LLError::LEVEL_NONE);
674
675 TestAlpha::doInfo();
676 ensure_message_count(0);
677 ensure_equals("first check", LLError::shouldLogCallCount(), 1);
678 TestAlpha::doInfo();
679 ensure_message_count(0);
680 ensure_equals("second check", LLError::shouldLogCallCount(), 1);
681
682 LLError::setClassLevel("TestAlpha", LLError::LEVEL_DEBUG);
683 TestAlpha::doInfo();
684 ensure_message_count(1);
685 ensure_equals("third check", LLError::shouldLogCallCount(), 2);
686 TestAlpha::doInfo();
687 ensure_message_count(2);
688 ensure_equals("fourth check", LLError::shouldLogCallCount(), 2);
689
690 LLError::setClassLevel("TestAlpha", LLError::LEVEL_WARN);
691 TestAlpha::doInfo();
692 ensure_message_count(2);
693 ensure_equals("fifth check", LLError::shouldLogCallCount(), 3);
694 TestAlpha::doInfo();
695 ensure_message_count(2);
696 ensure_equals("sixth check", LLError::shouldLogCallCount(), 3);
697 }
698
699 template<> template<>
700 // configuration from LLSD
701 void ErrorTestObject::test<16>()
702 {
703 std::string this_file = LLError::abbreviateFile(__FILE__);
704 LLSD config;
705 config["print-location"] = true;
706 config["default-level"] = "DEBUG";
707
708 LLSD set1;
709 set1["level"] = "WARN";
710 set1["files"][0] = this_file;
711
712 LLSD set2;
713 set2["level"] = "INFO";
714 set2["classes"][0] = "TestAlpha";
715
716 LLSD set3;
717 set3["level"] = "NONE";
718 set3["functions"][0] = "TestAlpha::doError";
719 set3["functions"][1] = "TestBeta::doError";
720
721 config["settings"][0] = set1;
722 config["settings"][1] = set2;
723 config["settings"][2] = set3;
724
725 LLError::configure(config);
726
727 TestAlpha::doAll();
728 TestBeta::doAll();
729 ensure_message_contains(0, "any idea");
730 ensure_message_contains(0, this_file);
731 ensure_message_contains(1, "aim west");
732 ensure_message_contains(2, "bad word");
733 ensure_message_count(3);
734
735 // make sure reconfiguring works
736 LLSD config2;
737 config2["default-level"] = "WARN";
738
739 LLError::configure(config2);
740
741 TestAlpha::doAll();
742 TestBeta::doAll();
743 ensure_message_contains(3, "aim west");
744 ensure_message_does_not_contain(3, this_file);
745 ensure_message_contains(4, "error");
746 ensure_message_contains(5, "ate eels");
747 ensure_message_contains(6, "bad word");
748 ensure_message_contains(7, "error");
749 ensure_message_contains(8, "big easy");
750 ensure_message_count(9);
751 }
752}
753
754/* Tests left:
755 handling of classes without LOG_CLASS
756
757 live update of filtering from file
758
759 syslog recorder
760 file recorder
761 cerr/stderr recorder
762 fixed buffer recorder
763 windows recorder
764
765 mutex use when logging (?)
766 strange careful about to crash handling (?)
767*/
diff --git a/linden/indra/test/llhttpclient_tut.cpp b/linden/indra/test/llhttpclient_tut.cpp
index c84d34b..ef53e71 100644
--- a/linden/indra/test/llhttpclient_tut.cpp
+++ b/linden/indra/test/llhttpclient_tut.cpp
@@ -32,9 +32,10 @@
32 */ 32 */
33 33
34#include <tut/tut.h> 34#include <tut/tut.h>
35#include "linden_common.h"
35#include "lltut.h" 36#include "lltut.h"
36
37#include "llhttpclient.h" 37#include "llhttpclient.h"
38#include "llformat.h"
38#include "llpipeutil.h" 39#include "llpipeutil.h"
39#include "llpumpio.h" 40#include "llpumpio.h"
40 41
@@ -312,4 +313,23 @@ namespace tut
312 ensureStatusError(); 313 ensureStatusError();
313 ensure_equals("reason", mReason, "STATUS_ERROR"); 314 ensure_equals("reason", mReason, "STATUS_ERROR");
314 } 315 }
316
317 template<> template<>
318 void HTTPClientTestObject::test<7>()
319 {
320 // Can not use the little mini server. The blocking request won't ever let it run.
321 // Instead get from a known LLSD source and compare results with the non-blocking get
322 // which is tested against the mini server earlier.
323 LLSD expected;
324
325 LLHTTPClient::get("http://secondlife.com/xmlhttp/homepage.php", newResult());
326 runThePump();
327 ensureStatusOK();
328 expected = getResult();
329
330 LLSD result;
331 result = LLHTTPClient::blockingGet("http://secondlife.com/xmlhttp/homepage.php");
332 LLSD body = result["body"];
333 ensure_equals("echoed result matches", body.size(), expected.size());
334 }
315} 335}
diff --git a/linden/indra/test/llpipeutil.cpp b/linden/indra/test/llpipeutil.cpp
index 53c5991..2857f12 100644
--- a/linden/indra/test/llpipeutil.cpp
+++ b/linden/indra/test/llpipeutil.cpp
@@ -26,11 +26,15 @@
26 * COMPLETENESS OR PERFORMANCE. 26 * COMPLETENESS OR PERFORMANCE.
27 */ 27 */
28 28
29
30#include "linden_common.h"
29#include "llpipeutil.h" 31#include "llpipeutil.h"
30 32
31#include <stdlib.h> 33#include <stdlib.h>
34#include <sstream>
32 35
33#include "llbufferstream.h" 36#include "llbufferstream.h"
37#include "lldefs.h"
34#include "llframetimer.h" 38#include "llframetimer.h"
35#include "llpumpio.h" 39#include "llpumpio.h"
36#include "llrand.h" 40#include "llrand.h"
@@ -77,8 +81,8 @@ LLIOPipe::EStatus LLPipeStringExtractor::process_impl(
77 std::ostringstream ostr; 81 std::ostringstream ostr;
78 while (istr.good()) 82 while (istr.good())
79 { 83 {
80 char buf[1024]; 84 char buf[1024]; /* Flawfinder: ignore */
81 istr.read(buf, sizeof(buf)); 85 istr.read(buf, sizeof(buf)); /* Flawfinder: ignore */
82 ostr.write(buf, istr.gcount()); 86 ostr.write(buf, istr.gcount());
83 } 87 }
84 mString = ostr.str(); 88 mString = ostr.str();
diff --git a/linden/indra/test/llrandom_tut.cpp b/linden/indra/test/llrandom_tut.cpp
index 1bb795e..a842dfd 100755
--- a/linden/indra/test/llrandom_tut.cpp
+++ b/linden/indra/test/llrandom_tut.cpp
@@ -1,9 +1,9 @@
1/** 1/**
2 * @file llrandom_tut.cpp 2 * @file llrandom_tut.cpp
3 * @author Phoenix 3 * @author Phoenix
4 * @date 2007-01-25 4 * @date 2007-01-25
5 * 5 *
6 * Copyright (c) 2007-2007, Linden Research, Inc. 6 * Copyright (c) 2007-2007, Linden Research, Inc.
7 * 7 *
8 * The source code in this file ("Source Code") is provided by Linden Lab 8 * The source code in this file ("Source Code") is provided by Linden Lab
9 * to you under the terms of the GNU General Public License, version 2.0 9 * to you under the terms of the GNU General Public License, version 2.0
@@ -23,47 +23,107 @@
23 * 23 *
24 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO 24 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
25 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, 25 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
26 * COMPLETENESS OR PERFORMANCE. 26 * COMPLETENESS OR PERFORMANCE.
27 */ 27 */
28 28
29#include <tut/tut.h> 29#include <tut/tut.h>
30 30
31#include "linden_common.h" 31#include "linden_common.h"
32#include "llrand.h" 32#include "llrand.h"
33#include "lltut.h" 33#include "lltut.h"
34 34
35 35
36namespace tut 36namespace tut
37{ 37{
38 struct random 38 struct random
39 { 39 {
40 }; 40 };
41 41
42 typedef test_group<random> random_t; 42 typedef test_group<random> random_t;
43 typedef random_t::object random_object_t; 43 typedef random_t::object random_object_t;
44 tut::random_t tut_random("random"); 44 tut::random_t tut_random("random");
45 45
46 template<> template<> 46 template<> template<>
47 void random_object_t::test<1>() 47 void random_object_t::test<1>()
48 { 48 {
49 F32 number = 0.0f; 49 F32 number = 0.0f;
50 for(S32 ii = 0; ii < 100000; ++ii) 50 for(S32 ii = 0; ii < 100000; ++ii)
51 { 51 {
52 number = ll_frand(); 52 number = ll_frand();
53 ensure("frand >= 0", (number >= 0.0f)); 53 ensure("frand >= 0", (number >= 0.0f));
54 ensure("frand < 1", (number < 1.0f)); 54 ensure("frand < 1", (number < 1.0f));
55 } 55 }
56 } 56 }
57 57
58 template<> template<> 58 template<> template<>
59 void random_object_t::test<2>() 59 void random_object_t::test<2>()
60 { 60 {
61 F32 number = 0.0f; 61 F64 number = 0.0f;
62 for(S32 ii = 0; ii < 100000; ++ii) 62 for(S32 ii = 0; ii < 100000; ++ii)
63 { 63 {
64 number = ll_frand(2.0f) - 1.0f; 64 number = ll_drand();
65 ensure("frand >= 0", (number >= -1.0f)); 65 ensure("drand >= 0", (number >= 0.0));
66 ensure("frand < 1", (number <= 1.0f)); 66 ensure("drand < 1", (number < 1.0));
67 } 67 }
68 } 68 }
69} 69
70 template<> template<>
71 void random_object_t::test<3>()
72 {
73 F32 number = 0.0f;
74 for(S32 ii = 0; ii < 100000; ++ii)
75 {
76 number = ll_frand(2.0f) - 1.0f;
77 ensure("frand >= 0", (number >= -1.0f));
78 ensure("frand < 1", (number <= 1.0f));
79 }
80 }
81
82 template<> template<>
83 void random_object_t::test<4>()
84 {
85 F32 number = 0.0f;
86 for(S32 ii = 0; ii < 100000; ++ii)
87 {
88 number = ll_frand(-7.0);
89 ensure("drand <= 0", (number <= 0.0));
90 ensure("drand > -7", (number > -7.0));
91 }
92 }
93
94 template<> template<>
95 void random_object_t::test<5>()
96 {
97 F64 number = 0.0f;
98 for(S32 ii = 0; ii < 100000; ++ii)
99 {
100 number = ll_drand(-2.0);
101 ensure("drand <= 0", (number <= 0.0));
102 ensure("drand > -2", (number > -2.0));
103 }
104 }
105
106 template<> template<>
107 void random_object_t::test<6>()
108 {
109 S32 number = 0;
110 for(S32 ii = 0; ii < 100000; ++ii)
111 {
112 number = ll_rand(100);
113 ensure("rand >= 0", (number >= 0));
114 ensure("rand < 100", (number < 100));
115 }
116 }
117
118 template<> template<>
119 void random_object_t::test<7>()
120 {
121 S32 number = 0;
122 for(S32 ii = 0; ii < 100000; ++ii)
123 {
124 number = ll_rand(-127);
125 ensure("rand <= 0", (number <= 0));
126 ensure("rand > -127", (number > -127));
127 }
128 }
129}
diff --git a/linden/indra/test/llsd_message_system_tut.cpp b/linden/indra/test/llsd_message_system_tut.cpp
index b46701c..9fcc6b5 100644
--- a/linden/indra/test/llsd_message_system_tut.cpp
+++ b/linden/indra/test/llsd_message_system_tut.cpp
@@ -1,8 +1,8 @@
1/** 1/**
2 * @file llsd_message_system_tut.cpp 2 * @file llsd_message_system_tut.cpp
3 * @brief Testing the LLSDMessageSystem. 3 * @brief Testing the LLSDMessageSystem.
4 * 4 *
5 * Copyright (c) 2006-2007, Linden Research, Inc. 5 * Copyright (c) 2006-2007, Linden Research, Inc.
6 * 6 *
7 * The source code in this file ("Source Code") is provided by Linden Lab 7 * The source code in this file ("Source Code") is provided by Linden Lab
8 * to you under the terms of the GNU General Public License, version 2.0 8 * to you under the terms of the GNU General Public License, version 2.0
@@ -22,121 +22,123 @@
22 * 22 *
23 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO 23 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
24 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, 24 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
25 * COMPLETENESS OR PERFORMANCE. 25 * COMPLETENESS OR PERFORMANCE.
26 */ 26 */
27 27
28/** 28/**
29 * 29 *
30 * These classes test the LLSDMessageSystem. 30 * These classes test the LLSDMessageSystem.
31 * 31 *
32 */ 32 */
33 33
34#include <tut/tut.h> 34#include "linden_common.h"
35#include "llsdmessagesystem.h" 35
36#include "llsdutil.h" 36#include <tut/tut.h>
37 37#include "llsdmessagesystem.h"
38namespace tut 38#include "llsdutil.h"
39{ 39
40 class LLSDMessageSystemTestData 40namespace tut
41 { 41{
42 public: 42 class LLSDMessageSystemTestData
43 LLSDMessageSystemTestData() {;} 43 {
44 ~LLSDMessageSystemTestData() {;} 44 public:
45 45 LLSDMessageSystemTestData() {;}
46 LLSDMessageSystem mMsgSystem; 46 ~LLSDMessageSystemTestData() {;}
47 }; 47
48 48 LLSDMessageSystem mMsgSystem;
49 typedef test_group<LLSDMessageSystemTestData> LLSDMessageSystemTestGroup; 49 };
50 typedef LLSDMessageSystemTestGroup::object LLSDMessageSystemTestObject; 50
51 LLSDMessageSystemTestGroup llsdMessageSystemTestGroup("llsd_message_system"); 51 typedef test_group<LLSDMessageSystemTestData> LLSDMessageSystemTestGroup;
52 52 typedef LLSDMessageSystemTestGroup::object LLSDMessageSystemTestObject;
53 template<> template<> 53 LLSDMessageSystemTestGroup llsdMessageSystemTestGroup("llsd_message_system");
54 void LLSDMessageSystemTestObject::test<1>() 54
55 { 55 template<> template<>
56 LLSD input; 56 void LLSDMessageSystemTestObject::test<1>()
57 U32 valueIn, valueOut; 57 {
58 valueIn = 42; 58 LLSD input;
59 input["Block"]["Var"] = ll_sd_from_U32(valueIn); 59 U32 valueIn, valueOut;
60 mMsgSystem.setInput(input); 60 valueIn = 42;
61 mMsgSystem.getU32Fast("Block", "Var", valueOut); 61 input["Block"]["Var"] = ll_sd_from_U32(valueIn);
62 ensure_equals("U32 from message system matches input U32", valueIn, valueOut); 62 mMsgSystem.setInput(input);
63 } 63 mMsgSystem.getU32Fast("Block", "Var", valueOut);
64 64 ensure_equals("U32 from message system matches input U32", valueIn, valueOut);
65 template<> template<> 65 }
66 void LLSDMessageSystemTestObject::test<2>() 66
67 { 67 template<> template<>
68 LLSD input; 68 void LLSDMessageSystemTestObject::test<2>()
69 LLUUID valueIn, valueOut; 69 {
70 valueIn.generate(); 70 LLSD input;
71 input["Block"]["Var"] = valueIn; 71 LLUUID valueIn, valueOut;
72 mMsgSystem.setInput(input); 72 valueIn.generate();
73 mMsgSystem.getUUIDFast("Block", "Var", valueOut); 73 input["Block"]["Var"] = valueIn;
74 ensure_equals("UUID from message system matches input UUID", valueIn, valueOut); 74 mMsgSystem.setInput(input);
75 } 75 mMsgSystem.getUUIDFast("Block", "Var", valueOut);
76 76 ensure_equals("UUID from message system matches input UUID", valueIn, valueOut);
77 template<> template<> 77 }
78 void LLSDMessageSystemTestObject::test<3>() 78
79 { 79 template<> template<>
80 LLSD input; 80 void LLSDMessageSystemTestObject::test<3>()
81 U32 valueIn, valueOut; 81 {
82 LLHost host("127.0.0.1:80"); 82 LLSD input;
83 valueIn = host.getAddress(); 83 U32 valueIn, valueOut;
84 input["Block"]["Var"] = ll_sd_from_U32(valueIn); 84 LLHost host("127.0.0.1:80");
85 mMsgSystem.setInput(input); 85 valueIn = host.getAddress();
86 mMsgSystem.getIPAddrFast("Block", "Var", valueOut); 86 input["Block"]["Var"] = ll_sd_from_U32(valueIn);
87 ensure_equals("IP from message system matches input IP", valueIn, valueOut); 87 mMsgSystem.setInput(input);
88 } 88 mMsgSystem.getIPAddrFast("Block", "Var", valueOut);
89 89 ensure_equals("IP from message system matches input IP", valueIn, valueOut);
90 template<> template<> 90 }
91 void LLSDMessageSystemTestObject::test<4>() 91
92 { 92 template<> template<>
93 LLSD input; 93 void LLSDMessageSystemTestObject::test<4>()
94 U16 valueIn, valueOut; 94 {
95 LLHost host("127.0.0.1:80"); 95 LLSD input;
96 valueIn = host.getPort(); 96 U16 valueIn, valueOut;
97 input["Block"]["Var"] = (S32)valueIn; 97 LLHost host("127.0.0.1:80");
98 mMsgSystem.setInput(input); 98 valueIn = host.getPort();
99 mMsgSystem.getIPPortFast("Block", "Var", valueOut); 99 input["Block"]["Var"] = (S32)valueIn;
100 ensure_equals("Port from message system matches input port", valueIn, valueOut); 100 mMsgSystem.setInput(input);
101 } 101 mMsgSystem.getIPPortFast("Block", "Var", valueOut);
102 102 ensure_equals("Port from message system matches input port", valueIn, valueOut);
103 template<> template<> 103 }
104 void LLSDMessageSystemTestObject::test<5>() 104
105 { 105 template<> template<>
106 LLSD input; 106 void LLSDMessageSystemTestObject::test<5>()
107 U64 valueIn, valueOut; 107 {
108 valueIn = 42; 108 LLSD input;
109 input["Block"]["Var"] = ll_sd_from_U64(valueIn); 109 U64 valueIn, valueOut;
110 mMsgSystem.setInput(input); 110 valueIn = 42;
111 mMsgSystem.getU64Fast("Block", "Var", valueOut); 111 input["Block"]["Var"] = ll_sd_from_U64(valueIn);
112 ensure_equals("Port from message system matches input port", valueIn, valueOut); 112 mMsgSystem.setInput(input);
113 } 113 mMsgSystem.getU64Fast("Block", "Var", valueOut);
114 114 ensure_equals("Port from message system matches input port", valueIn, valueOut);
115 template<> template<> 115 }
116 void LLSDMessageSystemTestObject::test<6>() 116
117 { 117 template<> template<>
118 LLSD input; 118 void LLSDMessageSystemTestObject::test<6>()
119 std::string valueIn = "Value"; 119 {
120 input["Block"]["Var"] = valueIn; 120 LLSD input;
121 mMsgSystem.setInput(input); 121 std::string valueIn = "Value";
122 const U32 buffLen = 16; 122 input["Block"]["Var"] = valueIn;
123 char buff[buffLen]; 123 mMsgSystem.setInput(input);
124 mMsgSystem.getStringFast("Block", "Var", buffLen, buff); 124 const U32 buffLen = 16;
125 ensure_equals("string read from message system matches llsd input", std::string(buff), valueIn); 125 char buff[buffLen];
126 } 126 mMsgSystem.getStringFast("Block", "Var", buffLen, buff);
127 127 ensure_equals("string read from message system matches llsd input", std::string(buff), valueIn);
128 template<> template<> 128 }
129 void LLSDMessageSystemTestObject::test<7>() 129
130 { 130 template<> template<>
131 LLSD input; 131 void LLSDMessageSystemTestObject::test<7>()
132 U32 valueIn, valueOut; 132 {
133 valueIn = 42; 133 LLSD input;
134 input["Block"][0]["Var"] = ll_sd_from_U32(valueIn); 134 U32 valueIn, valueOut;
135 input["Block"][1]["Var"] = ll_sd_from_U32(valueIn + 1); 135 valueIn = 42;
136 mMsgSystem.setInput(input); 136 input["Block"][0]["Var"] = ll_sd_from_U32(valueIn);
137 mMsgSystem.getU32Fast("Block", "Var", valueOut, 0); 137 input["Block"][1]["Var"] = ll_sd_from_U32(valueIn + 1);
138 ensure_equals("U32 from message system matches input U32", valueIn, valueOut); 138 mMsgSystem.setInput(input);
139 mMsgSystem.getU32Fast("Block", "Var", valueOut, 1); 139 mMsgSystem.getU32Fast("Block", "Var", valueOut, 0);
140 ensure_equals("U32 from message system matches input U32", (valueIn + 1), valueOut); 140 ensure_equals("U32 from message system matches input U32", valueIn, valueOut);
141 } 141 mMsgSystem.getU32Fast("Block", "Var", valueOut, 1);
142} 142 ensure_equals("U32 from message system matches input U32", (valueIn + 1), valueOut);
143 }
144}
diff --git a/linden/indra/test/llsd_new_tut.cpp b/linden/indra/test/llsd_new_tut.cpp
index e33a28a..d278a78 100644
--- a/linden/indra/test/llsd_new_tut.cpp
+++ b/linden/indra/test/llsd_new_tut.cpp
@@ -28,9 +28,11 @@
28 28
29#include <math.h> 29#include <math.h>
30#include <tut/tut.h> 30#include <tut/tut.h>
31#include "linden_common.h"
31#include "lltut.h" 32#include "lltut.h"
32 33
33#include "llsd.h" 34#include "llsd.h"
35#include "llstring.h"
34 36
35namespace tut 37namespace tut
36{ 38{
diff --git a/linden/indra/test/lltut.cpp b/linden/indra/test/lltut.cpp
index 31b83e6..1127f72 100644
--- a/linden/indra/test/lltut.cpp
+++ b/linden/indra/test/lltut.cpp
@@ -27,7 +27,10 @@
27 * COMPLETENESS OR PERFORMANCE. 27 * COMPLETENESS OR PERFORMANCE.
28 */ 28 */
29 29
30#include "linden_common.h"
30#include "lltut.h" 31#include "lltut.h"
32
33#include "llformat.h"
31#include "llsd.h" 34#include "llsd.h"
32 35
33namespace tut 36namespace tut
@@ -154,6 +157,20 @@ namespace tut
154 } 157 }
155 } 158 }
156 159
160 void ensure_ends_with(const std::string& msg,
161 const std::string& actual, const std::string& expectedEnd)
162 {
163 if( actual.size() < expectedEnd.size()
164 || actual.rfind(expectedEnd)
165 != (actual.size() - expectedEnd.size()) )
166 {
167 std::stringstream ss;
168 ss << msg << ": " << "expected to find " << expectedEnd
169 << " at end of actual " << actual;
170 throw failure(ss.str().c_str());
171 }
172 }
173
157 void ensure_contains(const std::string& msg, 174 void ensure_contains(const std::string& msg,
158 const std::string& actual, const std::string& expectedSubString) 175 const std::string& actual, const std::string& expectedSubString)
159 { 176 {
@@ -165,4 +182,16 @@ namespace tut
165 throw failure(ss.str().c_str()); 182 throw failure(ss.str().c_str());
166 } 183 }
167 } 184 }
185
186 void ensure_does_not_contain(const std::string& msg,
187 const std::string& actual, const std::string& expectedSubString)
188 {
189 if( actual.find(expectedSubString, 0) != std::string::npos )
190 {
191 std::stringstream ss;
192 ss << msg << ": " << "expected not to find " << expectedSubString
193 << " in actual " << actual;
194 throw failure(ss.str().c_str());
195 }
196 }
168} 197}
diff --git a/linden/indra/test/lltut.h b/linden/indra/test/lltut.h
index ba3df24..c8fb6bc 100644
--- a/linden/indra/test/lltut.h
+++ b/linden/indra/test/lltut.h
@@ -87,8 +87,14 @@ namespace tut
87 void ensure_starts_with(const std::string& msg, 87 void ensure_starts_with(const std::string& msg,
88 const std::string& actual, const std::string& expectedStart); 88 const std::string& actual, const std::string& expectedStart);
89 89
90 void ensure_ends_with(const std::string& msg,
91 const std::string& actual, const std::string& expectedEnd);
92
90 void ensure_contains(const std::string& msg, 93 void ensure_contains(const std::string& msg,
91 const std::string& actual, const std::string& expectedSubString); 94 const std::string& actual, const std::string& expectedSubString);
95
96 void ensure_does_not_contain(const std::string& msg,
97 const std::string& actual, const std::string& expectedSubString);
92} 98}
93 99
94 100
diff --git a/linden/indra/test/lluri_tut.cpp b/linden/indra/test/lluri_tut.cpp
index acd67cf..31ea7d6 100644
--- a/linden/indra/test/lluri_tut.cpp
+++ b/linden/indra/test/lluri_tut.cpp
@@ -36,51 +36,19 @@
36namespace tut 36namespace tut
37{ 37{
38 struct URITestData { 38 struct URITestData {
39 void checkParts(const std::string& uriString, 39 void checkParts(const LLURI& u,
40 const char* expectedScheme, 40 const char* expectedScheme,
41 const char* expectedOpaque, 41 const char* expectedOpaque,
42 const char* expectedAuthority, 42 const char* expectedAuthority,
43 const char* expectedPath, 43 const char* expectedPath,
44 const char* expectedQuery) 44 const char* expectedQuery = "")
45 { 45 {
46 LLURI u(uriString);
47
48 ensure_equals("scheme", u.scheme(), expectedScheme); 46 ensure_equals("scheme", u.scheme(), expectedScheme);
49 ensure_equals("opaque", u.opaque(), expectedOpaque); 47 ensure_equals("opaque", u.opaque(), expectedOpaque);
50 ensure_equals("authority", u.authority(), expectedAuthority); 48 ensure_equals("authority", u.authority(), expectedAuthority);
51 ensure_equals("path", u.path(), expectedPath); 49 ensure_equals("path", u.path(), expectedPath);
52 ensure_equals("query", u.query(), expectedQuery); 50 ensure_equals("query", u.query(), expectedQuery);
53 } 51 }
54
55 void checkPartsHTTP(const char* host_and_port,
56 const LLSD& path,
57 const char* expectedOpaque,
58 const char* expectedAuthority,
59 const char* expectedPath)
60 {
61 LLURI u = LLURI::buildHTTP(host_and_port, path);
62 ensure_equals("scheme", u.scheme(), "HTTP");
63 ensure_equals("opaque", u.opaque(), expectedOpaque);
64 ensure_equals("authority", u.authority(), expectedAuthority);
65 ensure_equals("path", u.path(), expectedPath);
66 ensure_equals("query", u.query(), "");
67 }
68
69 void checkPartsHTTP(const char* host_and_port,
70 const LLSD& path,
71 const LLSD& args,
72 const char* expectedOpaque,
73 const char* expectedAuthority,
74 const char* expectedPath,
75 const char* expectedQuery)
76 {
77 LLURI u = LLURI::buildHTTP(host_and_port, path, args);
78 ensure_equals("scheme", u.scheme(), "HTTP");
79 ensure_equals("opaque", u.opaque(), expectedOpaque);
80 ensure_equals("authority", u.authority(), expectedAuthority);
81 ensure_equals("path", u.path(), expectedPath);
82 ensure_equals("query", u.query(), expectedQuery);
83 }
84 }; 52 };
85 53
86 typedef test_group<URITestData> URITestGroup; 54 typedef test_group<URITestData> URITestGroup;
@@ -114,59 +82,73 @@ namespace tut
114 void URITestObject::test<2>() 82 void URITestObject::test<2>()
115 { 83 {
116 // empty string 84 // empty string
117 checkParts("", "", "", "", "", ""); 85 checkParts(LLURI(""), "", "", "", "");
118 } 86 }
119 87
120 template<> template<> 88 template<> template<>
121 void URITestObject::test<3>() 89 void URITestObject::test<3>()
122 { 90 {
123 // no scheme 91 // no scheme
124 checkParts("foo", "", "foo", "", "", ""); 92 checkParts(LLURI("foo"), "", "foo", "", "");
125 checkParts("foo%3A", "", "foo:", "", "", ""); 93 checkParts(LLURI("foo%3A"), "", "foo:", "", "");
126 } 94 }
127 95
128 template<> template<> 96 template<> template<>
129 void URITestObject::test<4>() 97 void URITestObject::test<4>()
130 { 98 {
131 // scheme w/o paths 99 // scheme w/o paths
132 checkParts("mailto:zero@ll.com", "mailto", "zero@ll.com", "", "", ""); 100 checkParts(LLURI("mailto:zero@ll.com"),
133 checkParts("silly://abc/def?foo", "silly", "//abc/def?foo", "", "", ""); 101 "mailto", "zero@ll.com", "", "");
102 checkParts(LLURI("silly://abc/def?foo"),
103 "silly", "//abc/def?foo", "", "");
134 } 104 }
135 105
136 template<> template<> 106 template<> template<>
137 void URITestObject::test<5>() 107 void URITestObject::test<5>()
138 { 108 {
139 // authority section 109 // authority section
140 checkParts("http:///", "http", "///", "", "/", ""); 110 checkParts(LLURI("http:///"),
141 checkParts("http://abc", "http", "//abc", "abc", "", ""); 111 "http", "///", "", "/");
142 checkParts("http://a%2Fb/cd", "http", "//a/b/cd", "a/b", "/cd", ""); 112
143 checkParts("http://host?", "http", "//host?", "host", "", ""); 113 checkParts(LLURI("http://abc"),
114 "http", "//abc", "abc", "");
115
116 checkParts(LLURI("http://a%2Fb/cd"),
117 "http", "//a/b/cd", "a/b", "/cd");
118
119 checkParts(LLURI("http://host?"),
120 "http", "//host?", "host", "");
144 } 121 }
145 122
146 template<> template<> 123 template<> template<>
147 void URITestObject::test<6>() 124 void URITestObject::test<6>()
148 { 125 {
149 // path section 126 // path section
150 checkParts("http://host/a/b/", "http", "//host/a/b/", 127 checkParts(LLURI("http://host/a/b/"),
151 "host", "/a/b/", ""); 128 "http", "//host/a/b/", "host", "/a/b/");
152 checkParts("http://host/a%3Fb/", "http", "//host/a?b/", 129
153 "host", "/a?b/", ""); 130 checkParts(LLURI("http://host/a%3Fb/"),
154 checkParts("http://host/a:b/", "http", "//host/a:b/", 131 "http", "//host/a?b/", "host", "/a?b/");
155 "host", "/a:b/", ""); 132
133 checkParts(LLURI("http://host/a:b/"),
134 "http", "//host/a:b/", "host", "/a:b/");
156 } 135 }
157 136
158 template<> template<> 137 template<> template<>
159 void URITestObject::test<7>() 138 void URITestObject::test<7>()
160 { 139 {
161 // query string 140 // query string
162 checkParts("http://host/?", "http", "//host/?", 141 checkParts(LLURI("http://host/?"),
163 "host", "/", ""); 142 "http", "//host/?", "host", "/", "");
164 checkParts("http://host/?x", "http", "//host/?x", 143
165 "host", "/", "x"); 144 checkParts(LLURI("http://host/?x"),
166 checkParts("http://host/??", "http", "//host/??", 145 "http", "//host/?x", "host", "/", "x");
167 "host", "/", "?"); 146
168 checkParts("http://host/?%3F", "http", "//host/??", 147 checkParts(LLURI("http://host/??"),
169 "host", "/", "?"); 148 "http", "//host/??", "host", "/", "?");
149
150 checkParts(LLURI("http://host/?%3F"),
151 "http", "//host/??", "host", "/", "?");
170 } 152 }
171 153
172 template<> template<> 154 template<> template<>
@@ -175,11 +157,15 @@ namespace tut
175 LLSD path; 157 LLSD path;
176 path.append("x"); 158 path.append("x");
177 path.append("123"); 159 path.append("123");
178 checkPartsHTTP("host", path, "//host/x/123", "//host", "/x/123"); 160 checkParts(LLURI::buildHTTP("host", path),
161 "http", "//host/x/123", "host", "/x/123");
162
179 LLSD query; 163 LLSD query;
180 query["123"] = "12"; 164 query["123"] = "12";
181 query["abcd"] = "abc"; 165 query["abcd"] = "abc";
182 checkPartsHTTP("host", path, query, "//host/x/123?123=12&abcd=abc&", "//host", "/x/123", "123=12&abcd=abc&"); 166 checkParts(LLURI::buildHTTP("host", path, query),
167 "http", "//host/x/123?123=12&abcd=abc&",
168 "host", "/x/123", "123=12&abcd=abc&");
183 } 169 }
184 170
185 template<> template<> 171 template<> template<>
@@ -189,7 +175,8 @@ namespace tut
189 LLSD path; 175 LLSD path;
190 path.append("x@*//*$&^"); 176 path.append("x@*//*$&^");
191 path.append("123"); 177 path.append("123");
192 checkPartsHTTP("host", path, "//host/x@*//*$&^/123", "//host", "/x@*//*$&^/123"); 178 checkParts(LLURI::buildHTTP("host", path),
179 "http", "//host/x@*//*$&^/123", "host", "/x@*//*$&^/123");
193 } 180 }
194 181
195 template<> template<> 182 template<> template<>
@@ -202,7 +189,9 @@ namespace tut
202 LLSD query; 189 LLSD query;
203 query["123"] = "?&*#//"; 190 query["123"] = "?&*#//";
204 query["**@&?//"] = "abc"; 191 query["**@&?//"] = "abc";
205 checkPartsHTTP("host", path, query, "//host/x/123?**@&?//=abc&123=?&*#//&", "//host", "/x/123", "**@&?//=abc&123=?&*#//&"); 192 checkParts(LLURI::buildHTTP("host", path, query),
193 "http", "//host/x/123?**@&?//=abc&123=?&*#//&",
194 "host", "/x/123", "**@&?//=abc&123=?&*#//&");
206 } 195 }
207 196
208 template<> template<> 197 template<> template<>
@@ -215,7 +204,67 @@ namespace tut
215 LLSD query; 204 LLSD query;
216 query["123"] = "12"; 205 query["123"] = "12";
217 query["abcd"] = "abc"; 206 query["abcd"] = "abc";
218 checkPartsHTTP("hi123*33--}{:portstuffs", path, query, "//hi123*33--}{:portstuffs/x/123?123=12&abcd=abc&", "//hi123*33--}{:portstuffs", "/x/123", "123=12&abcd=abc&"); 207 checkParts(LLURI::buildHTTP("hi123*33--}{:portstuffs", path, query),
208 "http", "//hi123*33--}{:portstuffs/x/123?123=12&abcd=abc&",
209 "hi123*33--}{:portstuffs", "/x/123", "123=12&abcd=abc&");
210 }
211
212 template<> template<>
213 void URITestObject::test<12>()
214 {
215 // test funky host_port values that are actually prefixes
216
217 checkParts(LLURI::buildHTTP("http://example.com:8080", LLSD()),
218 "http", "//example.com:8080",
219 "example.com:8080", "");
220
221 checkParts(LLURI::buildHTTP("http://example.com:8080/", LLSD()),
222 "http", "//example.com:8080/",
223 "example.com:8080", "/");
224
225 checkParts(LLURI::buildHTTP("http://example.com:8080/a/b", LLSD()),
226 "http", "//example.com:8080/a/b",
227 "example.com:8080", "/a/b");
228 }
229
230 template<> template<>
231 void URITestObject::test<13>()
232 {
233 const std::string unreserved =
234 "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
235 "0123456789"
236 "-._~";
237 // test escape
238 ensure_equals("escaping", LLURI::escape("abcdefg", "abcdef"), "abcdef%67");
239 ensure_equals("escaping", LLURI::escape("|/&\\+-_!@", ""), "%7C%2F%26%5C%2B%2D%5F%21%40");
240 ensure_equals("escaping as query variable",
241 LLURI::escape("http://10.0.1.4:12032/agent/god/agent-id/map/layer/?resume=http://station3.ll.com:12032/agent/203ad6df-b522-491d-ba48-4e24eb57aeff/send-postcard", unreserved + ":@!$'()*+,="),
242 "http:%2F%2F10.0.1.4:12032%2Fagent%2Fgod%2Fagent-id%2Fmap%2Flayer%2F%3Fresume=http:%2F%2Fstation3.ll.com:12032%2Fagent%2F203ad6df-b522-491d-ba48-4e24eb57aeff%2Fsend-postcard");
243 }
244
245 template<> template<>
246 void URITestObject::test<14>()
247 {
248 // test various build utilities
249
250 LLUUID id("11111111-2222-3333-4444-5566778899aa");
251
252
253 checkParts(LLURI::buildAgentPresenceURI(id, NULL),
254 "http", "//localhost:12040/agent/11111111-2222-3333-4444-5566778899aa/presence",
255 "localhost:12040", "/agent/11111111-2222-3333-4444-5566778899aa/presence");
256
257 checkParts(LLURI::buildBulkAgentPresenceURI(NULL),
258 "http", "//localhost:12040/agent/presence",
259 "localhost:12040", "/agent/presence");
260
261 checkParts(LLURI::buildAgentSessionURI(id, NULL),
262 "http", "//localhost:12040/agent/11111111-2222-3333-4444-5566778899aa/session",
263 "localhost:12040", "/agent/11111111-2222-3333-4444-5566778899aa/session");
264
265 checkParts(LLURI::buildAgentLoginInfoURI(id, "datasever:12345"),
266 "http", "//datasever:12345/agent/11111111-2222-3333-4444-5566778899aa/logininfo",
267 "datasever:12345", "/agent/11111111-2222-3333-4444-5566778899aa/logininfo");
219 } 268 }
220} 269}
221 270
diff --git a/linden/indra/test/math.cpp b/linden/indra/test/math.cpp
index b14a798..be8a398 100644
--- a/linden/indra/test/math.cpp
+++ b/linden/indra/test/math.cpp
@@ -125,7 +125,7 @@ namespace tut
125 void uuid_object::test<4>() 125 void uuid_object::test<4>()
126 { 126 {
127 id.generate(); 127 id.generate();
128 LLString id_str = id.getString(); 128 std::string id_str = id.asString();
129 LLUUID copy(id_str.c_str()); 129 LLUUID copy(id_str.c_str());
130 ensure_equals("string serialization", id, copy); 130 ensure_equals("string serialization", id, copy);
131 } 131 }
diff --git a/linden/indra/test/test.cpp b/linden/indra/test/test.cpp
index d90bfdb..9eb1639 100644
--- a/linden/indra/test/test.cpp
+++ b/linden/indra/test/test.cpp
@@ -36,6 +36,7 @@
36 */ 36 */
37 37
38#include "linden_common.h" 38#include "linden_common.h"
39#include "llerrorcontrol.h"
39#include "lltut.h" 40#include "lltut.h"
40 41
41#include <apr-1/apr_pools.h> 42#include <apr-1/apr_pools.h>
@@ -178,8 +179,18 @@ void stream_groups(std::ostream& s, const char* app)
178 } 179 }
179} 180}
180 181
182void wouldHaveCrashed(const std::string& message)
183{
184 tut::fail("llerrs message: " + message);
185}
186
181int main(int argc, char **argv) 187int main(int argc, char **argv)
182{ 188{
189 LLError::initForApplication(".");
190 LLError::setFatalFunction(wouldHaveCrashed);
191 LLError::setDefaultLevel(LLError::LEVEL_ERROR);
192 // *FIX: should come from error config file
193
183#ifdef CTYPE_WORKAROUND 194#ifdef CTYPE_WORKAROUND
184 ctype_workaround(); 195 ctype_workaround();
185#endif 196#endif
@@ -213,7 +224,7 @@ int main(int argc, char **argv)
213 if(APR_STATUS_IS_EOF(apr_err)) break; 224 if(APR_STATUS_IS_EOF(apr_err)) break;
214 if(apr_err) 225 if(apr_err)
215 { 226 {
216 char buf[255]; 227 char buf[255]; /* Flawfinder: ignore */
217 std::cerr << "Error parsing options: " 228 std::cerr << "Error parsing options: "
218 << apr_strerror(apr_err, buf, 255) << std::endl; 229 << apr_strerror(apr_err, buf, 255) << std::endl;
219 return 1; 230 return 1;
diff --git a/linden/indra/test/test.vcproj b/linden/indra/test/test.vcproj
index f07d412..9255315 100644
--- a/linden/indra/test/test.vcproj
+++ b/linden/indra/test/test.vcproj
@@ -195,6 +195,9 @@
195 </File> 195 </File>
196 196
197 <File 197 <File
198 RelativePath=".\llerror_tut.cpp">
199 </File>
200 <File
198 RelativePath=".\llhttpclient_tut.cpp"> 201 RelativePath=".\llhttpclient_tut.cpp">
199 </File> 202 </File>
200 <File 203 <File
@@ -216,9 +219,18 @@
216 RelativePath=".\llsdserialize_tut.cpp"> 219 RelativePath=".\llsdserialize_tut.cpp">
217 </File> 220 </File>
218 <File 221 <File
222 RelativePath=".\lltiming_tut.cpp">
223 </File>
224 <File
219 RelativePath=".\lltut.cpp"> 225 RelativePath=".\lltut.cpp">
220 </File> 226 </File>
221 <File 227 <File
228 RelativePath=".\lluri_tut.cpp">
229 </File>
230 <File
231 RelativePath=".\lluserrelations_tut.cpp">
232 </File>
233 <File
222 RelativePath=".\math.cpp"> 234 RelativePath=".\math.cpp">
223 </File> 235 </File>
224 <File 236 <File
@@ -233,6 +245,9 @@
233 Filter="h;hpp;hxx;hm;inl;inc;xsd" 245 Filter="h;hpp;hxx;hm;inl;inc;xsd"
234 UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"> 246 UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
235 <File 247 <File
248 RelativePath=".\llpipeutil.h">
249 </File>
250 <File
236 RelativePath=".\lltut.h"> 251 RelativePath=".\lltut.h">
237 </File> 252 </File>
238 </Filter> 253 </Filter>
diff --git a/linden/indra/test/test_llmanifest.py b/linden/indra/test/test_llmanifest.py
new file mode 100644
index 0000000..b20b6c1
--- /dev/null
+++ b/linden/indra/test/test_llmanifest.py
@@ -0,0 +1,128 @@
1#!/usr/bin/python
2# @file test_llmanifest.py
3# @author Ryan Williams
4# @brief Test cases for LLManifest library.
5#
6# Copyright (c) 2006-2007, Linden Research, Inc.
7#
8# The source code in this file ("Source Code") is provided by Linden Lab
9# to you under the terms of the GNU General Public License, version 2.0
10# ("GPL"), unless you have obtained a separate licensing agreement
11# ("Other License"), formally executed by you and Linden Lab. Terms of
12# the GPL can be found in doc/GPL-license.txt in this distribution, or
13# online at http://secondlife.com/developers/opensource/gplv2
14#
15# There are special exceptions to the terms and conditions of the GPL as
16# it is applied to this Source Code. View the full text of the exception
17# in the file doc/FLOSS-exception.txt in this software distribution, or
18# online at http://secondlife.com/developers/opensource/flossexception
19#
20# By copying, modifying or distributing this software, you acknowledge
21# that you have read and understood your obligations described above,
22# and agree to abide by those obligations.
23#
24# ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
25# WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
26# COMPLETENESS OR PERFORMANCE.
27
28from indra import llmanifest
29import os.path
30import os
31import unittest
32
33class DemoManifest(llmanifest.LLManifest):
34 def construct(self):
35 super(DemoManifest, self).construct()
36 if self.prefix("dir_1"):
37 self.path("test_a")
38 self.path(src="test_b", dst="test_dst_b")
39 self.path("*.test")
40 self.path("*.tex", "*.jpg")
41 if self.prefix("nested", dst=""):
42 self.path("deep")
43 self.end_prefix()
44 self.end_prefix("dir_1")
45
46
47class Demo_ArchManifest(llmanifest.LLManifest):
48 pass
49
50class TestLLManifest(unittest.TestCase):
51 mode='static'
52 def setUp(self):
53 self.m = llmanifest.LLManifest("src", "dst", {'grid':'default', 'platform':'darwin', 'version':(1,2,3,4)})
54
55 def testproperwindowspath(self):
56 self.assertEqual(llmanifest.proper_windows_path("C:\Program Files", "cygwin"),"/cygdrive/c/Program Files")
57 self.assertEqual(llmanifest.proper_windows_path("C:\Program Files", "windows"), "C:\Program Files")
58 self.assertEqual(llmanifest.proper_windows_path("/cygdrive/c/Program Files/NSIS", "windows"), "C:\Program Files\NSIS")
59 self.assertEqual(llmanifest.proper_windows_path("/cygdrive/c/Program Files/NSIS", "cygwin"), "/cygdrive/c/Program Files/NSIS")
60
61 def testpathancestors(self):
62 self.assertEqual(["dir"], [p for p in llmanifest.path_ancestors("dir")])
63 self.assertEqual(["dir/sub", "dir"], [p for p in llmanifest.path_ancestors("dir/sub")])
64 self.assertEqual(["dir/sub", "dir"], [p for p in llmanifest.path_ancestors("dir/sub/")])
65 self.assertEqual(["dir/sub/two", "dir/sub", "dir"], [p for p in llmanifest.path_ancestors("dir/sub/two")])
66
67
68 def testforplatform(self):
69 self.assertEqual(llmanifest.LLManifest.for_platform('demo'), DemoManifest)
70 def tmp_test():
71 return llmanifest.LLManifest.for_platform('extant')
72 self.assertRaises(KeyError, tmp_test)
73 ExtantManifest = llmanifest.LLManifestRegistry('ExtantManifest', (llmanifest.LLManifest,), {})
74 self.assertEqual(llmanifest.LLManifest.for_platform('extant'), ExtantManifest)
75 self.assertEqual(llmanifest.LLManifest.for_platform('demo', 'Arch'), Demo_ArchManifest)
76
77
78 def testprefix(self):
79 self.assertEqual(self.m.get_src_prefix(), "src")
80 self.assertEqual(self.m.get_dst_prefix(), "dst")
81 self.m.prefix("level1")
82 self.assertEqual(self.m.get_src_prefix(), "src/level1")
83 self.assertEqual(self.m.get_dst_prefix(), "dst/level1")
84 self.m.end_prefix()
85 self.m.prefix(src="src", dst="dst")
86 self.assertEqual(self.m.get_src_prefix(), "src/src")
87 self.assertEqual(self.m.get_dst_prefix(), "dst/dst")
88 self.m.end_prefix()
89
90 def testendprefix(self):
91 self.assertEqual(self.m.get_src_prefix(), "src")
92 self.assertEqual(self.m.get_dst_prefix(), "dst")
93 self.m.prefix("levela")
94 self.m.end_prefix()
95 self.assertEqual(self.m.get_src_prefix(), "src")
96 self.assertEqual(self.m.get_dst_prefix(), "dst")
97 self.m.prefix("level1")
98 self.m.end_prefix("level1")
99 self.assertEqual(self.m.get_src_prefix(), "src")
100 self.assertEqual(self.m.get_dst_prefix(), "dst")
101 self.m.prefix("level1")
102 def tmp_test():
103 self.m.end_prefix("mismatch")
104 self.assertRaises(ValueError, tmp_test)
105
106 def testruncommand(self):
107 self.assertEqual("Hello\n", self.m.run_command("echo Hello"))
108 def tmp_test():
109 self.m.run_command("fff_garbage")
110 self.assertRaises(RuntimeError, tmp_test)
111
112 def testpathof(self):
113 self.assertEqual(self.m.src_path_of("a"), "src/a")
114 self.assertEqual(self.m.dst_path_of("a"), "dst/a")
115 self.m.prefix("tmp")
116 self.assertEqual(self.m.src_path_of("b/c"), "src/tmp/b/c")
117 self.assertEqual(self.m.dst_path_of("b/c"), "dst/tmp/b/c")
118
119 def testcmakedirs(self):
120 self.m.cmakedirs("test_dir_DELETE/nested/dir")
121 self.assert_(os.path.exists("test_dir_DELETE/nested/dir"))
122 self.assert_(os.path.isdir("test_dir_DELETE"))
123 self.assert_(os.path.isdir("test_dir_DELETE/nested"))
124 self.assert_(os.path.isdir("test_dir_DELETE/nested/dir"))
125 os.removedirs("test_dir_DELETE/nested/dir")
126
127if __name__ == '__main__':
128 unittest.main()
diff --git a/linden/indra/test/test_vc8.vcproj b/linden/indra/test/test_vc8.vcproj
new file mode 100644
index 0000000..79af7f0
--- /dev/null
+++ b/linden/indra/test/test_vc8.vcproj
@@ -0,0 +1,385 @@
1<?xml version="1.0" encoding="Windows-1252"?>
2<VisualStudioProject
3 ProjectType="Visual C++"
4 Version="8.00"
5 Name="test"
6 ProjectGUID="{BBAA6588-CA96-4A87-A988-B02270B8D02B}"
7 RootNamespace="test"
8 Keyword="Win32Proj"
9 >
10 <Platforms>
11 <Platform
12 Name="Win32"
13 />
14 </Platforms>
15 <ToolFiles>
16 </ToolFiles>
17 <Configurations>
18 <Configuration
19 Name="Debug|Win32"
20 OutputDirectory="Debug"
21 IntermediateDirectory="Debug"
22 ConfigurationType="1"
23 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
24 CharacterSet="2"
25 >
26 <Tool
27 Name="VCPreBuildEventTool"
28 />
29 <Tool
30 Name="VCCustomBuildTool"
31 />
32 <Tool
33 Name="VCXMLDataGeneratorTool"
34 />
35 <Tool
36 Name="VCWebServiceProxyGeneratorTool"
37 />
38 <Tool
39 Name="VCMIDLTool"
40 />
41 <Tool
42 Name="VCCLCompilerTool"
43 Optimization="0"
44 AdditionalIncludeDirectories="..\llcommon;..\llmessage;..\llmath;..\..\libraries\include;..\llinventory;&quot;..\..\libraries\i686-win32\include&quot;;..\llxml;..\lldatabase"
45 PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;LL_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;LL_DEBUG"
46 MinimalRebuild="false"
47 BasicRuntimeChecks="3"
48 RuntimeLibrary="1"
49 TreatWChar_tAsBuiltInType="false"
50 RuntimeTypeInfo="true"
51 UsePrecompiledHeader="0"
52 WarningLevel="3"
53 Detect64BitPortabilityProblems="false"
54 DebugInformationFormat="3"
55 />
56 <Tool
57 Name="VCManagedResourceCompilerTool"
58 />
59 <Tool
60 Name="VCResourceCompilerTool"
61 />
62 <Tool
63 Name="VCPreLinkEventTool"
64 />
65 <Tool
66 Name="VCLinkerTool"
67 AdditionalOptions="/FORCE:MULTIPLE"
68 AdditionalDependencies="advapi32.lib apr-1.lib aprutil-1.lib comdlg32.lib dinput8.lib dsound.lib dxerr8.lib dxguid.lib freetype.lib gdi32.lib glu32.lib jpeglib_6b.lib kernel32.lib libboost_regex-vc80-mt-s.lib libcurl.lib libeay32.lib libexpatMT.lib llcommon.lib llprimitive.lib llvfs.lib llxml.lib lscript_library.lib mswsock.lib netapi32.lib odbc32.lib odbccp32.lib ole32.lib oleaut32.lib opengl32.lib shell32.lib ssleay32.lib user32.lib Vfw32.lib winmm.lib winspool.lib ws2_32.lib xmlrpcepi.lib zlib.lib"
69 OutputFile="$(OutDir)/test.exe"
70 LinkIncremental="2"
71 AdditionalLibraryDirectories="&quot;../lib_$(ConfigurationName)/i686-win32&quot;;&quot;../../libraries/i686-win32/lib_debug&quot;"
72 IgnoreDefaultLibraryNames="libcmt.lib"
73 GenerateDebugInformation="true"
74 ProgramDatabaseFile="$(OutDir)/test.pdb"
75 SubSystem="1"
76 TargetMachine="1"
77 />
78 <Tool
79 Name="VCALinkTool"
80 />
81 <Tool
82 Name="VCManifestTool"
83 />
84 <Tool
85 Name="VCXDCMakeTool"
86 />
87 <Tool
88 Name="VCBscMakeTool"
89 />
90 <Tool
91 Name="VCFxCopTool"
92 />
93 <Tool
94 Name="VCAppVerifierTool"
95 />
96 <Tool
97 Name="VCWebDeploymentTool"
98 />
99 <Tool
100 Name="VCPostBuildEventTool"
101 />
102 </Configuration>
103 <Configuration
104 Name="Release|Win32"
105 OutputDirectory="Release"
106 IntermediateDirectory="Release"
107 ConfigurationType="1"
108 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
109 CharacterSet="2"
110 >
111 <Tool
112 Name="VCPreBuildEventTool"
113 />
114 <Tool
115 Name="VCCustomBuildTool"
116 />
117 <Tool
118 Name="VCXMLDataGeneratorTool"
119 />
120 <Tool
121 Name="VCWebServiceProxyGeneratorTool"
122 />
123 <Tool
124 Name="VCMIDLTool"
125 />
126 <Tool
127 Name="VCCLCompilerTool"
128 Optimization="0"
129 AdditionalIncludeDirectories="..\llcommon;..\llmessage;..\llmath;..\..\libraries\include;..\llinventory;&quot;..\..\libraries\i686-win32\include&quot;;..\llxml;..\lldatabase"
130 PreprocessorDefinitions="WIN32;__WIN32;NDEBUG;_WINDOWS;LL_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;LL_RELEASE;APR_DECLARE_STATIC;LL_HTTPD=1"
131 MinimalRebuild="false"
132 BasicRuntimeChecks="3"
133 RuntimeLibrary="1"
134 TreatWChar_tAsBuiltInType="false"
135 ForceConformanceInForLoopScope="true"
136 RuntimeTypeInfo="true"
137 UsePrecompiledHeader="0"
138 WarningLevel="3"
139 Detect64BitPortabilityProblems="false"
140 DebugInformationFormat="3"
141 />
142 <Tool
143 Name="VCManagedResourceCompilerTool"
144 />
145 <Tool
146 Name="VCResourceCompilerTool"
147 />
148 <Tool
149 Name="VCPreLinkEventTool"
150 />
151 <Tool
152 Name="VCLinkerTool"
153 AdditionalOptions="/FORCE:MULTIPLE"
154 AdditionalDependencies="advapi32.lib apr-1.lib aprutil-1.lib comdlg32.lib dinput8.lib dsound.lib dxerr8.lib dxguid.lib freetype.lib gdi32.lib glu32.lib jpeglib_6b.lib kernel32.lib libboost_regex-vc80-mt-s.lib libcurl.lib libeay32.lib libexpatMT.lib llcommon.lib llprimitive.lib llvfs.lib llxml.lib lscript_library.lib mswsock.lib netapi32.lib odbc32.lib odbccp32.lib ole32.lib oleaut32.lib opengl32.lib shell32.lib ssleay32.lib user32.lib Vfw32.lib winmm.lib winspool.lib ws2_32.lib xmlrpcepi.lib zlib.lib"
155 OutputFile="$(OutDir)/test.exe"
156 LinkIncremental="2"
157 AdditionalLibraryDirectories="&quot;../lib_$(ConfigurationName)/i686-win32&quot;;&quot;../../libraries/i686-win32/lib_release&quot;"
158 IgnoreDefaultLibraryNames="libcmt.lib"
159 GenerateDebugInformation="true"
160 ProgramDatabaseFile="$(OutDir)/test.pdb"
161 SubSystem="1"
162 TargetMachine="1"
163 />
164 <Tool
165 Name="VCALinkTool"
166 />
167 <Tool
168 Name="VCManifestTool"
169 />
170 <Tool
171 Name="VCXDCMakeTool"
172 />
173 <Tool
174 Name="VCBscMakeTool"
175 />
176 <Tool
177 Name="VCFxCopTool"
178 />
179 <Tool
180 Name="VCAppVerifierTool"
181 />
182 <Tool
183 Name="VCWebDeploymentTool"
184 />
185 <Tool
186 Name="VCPostBuildEventTool"
187 CommandLine="$(TargetPath)"
188 />
189 </Configuration>
190 <Configuration
191 Name="ReleaseNoOpt|Win32"
192 OutputDirectory="$(ConfigurationName)"
193 IntermediateDirectory="$(ConfigurationName)"
194 ConfigurationType="1"
195 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
196 CharacterSet="2"
197 >
198 <Tool
199 Name="VCPreBuildEventTool"
200 />
201 <Tool
202 Name="VCCustomBuildTool"
203 />
204 <Tool
205 Name="VCXMLDataGeneratorTool"
206 />
207 <Tool
208 Name="VCWebServiceProxyGeneratorTool"
209 />
210 <Tool
211 Name="VCMIDLTool"
212 />
213 <Tool
214 Name="VCCLCompilerTool"
215 Optimization="0"
216 AdditionalIncludeDirectories="..\llcommon;..\llmessage;..\llmath;..\..\libraries\include;..\llinventory;&quot;..\..\libraries\i686-win32\include&quot;;..\llxml;..\lldatabase"
217 PreprocessorDefinitions="WIN32;__WIN32;NDEBUG;_WINDOWS;LL_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;LL_RELEASE;APR_DECLARE_STATIC;LL_HTTPD=1"
218 MinimalRebuild="false"
219 BasicRuntimeChecks="3"
220 RuntimeLibrary="1"
221 TreatWChar_tAsBuiltInType="false"
222 ForceConformanceInForLoopScope="true"
223 RuntimeTypeInfo="true"
224 UsePrecompiledHeader="0"
225 WarningLevel="3"
226 Detect64BitPortabilityProblems="false"
227 DebugInformationFormat="3"
228 />
229 <Tool
230 Name="VCManagedResourceCompilerTool"
231 />
232 <Tool
233 Name="VCResourceCompilerTool"
234 />
235 <Tool
236 Name="VCPreLinkEventTool"
237 />
238 <Tool
239 Name="VCLinkerTool"
240 AdditionalDependencies="advapi32.lib apr-1.lib aprutil-1.lib comdlg32.lib dinput8.lib dsound.lib dxerr8.lib dxguid.lib freetype.lib gdi32.lib glu32.lib jpeglib_6b.lib kernel32.lib libboost_regex-vc80-mt-s.lib libcurl.lib libeay32.lib libexpatMT.lib llcommon.lib llprimitive.lib llvfs.lib llxml.lib lscript_library.lib mswsock.lib netapi32.lib odbc32.lib odbccp32.lib ole32.lib oleaut32.lib opengl32.lib shell32.lib ssleay32.lib user32.lib Vfw32.lib winmm.lib winspool.lib ws2_32.lib xmlrpcepi.lib zlib.lib"
241 OutputFile="$(OutDir)/test.exe"
242 LinkIncremental="2"
243 AdditionalLibraryDirectories="&quot;../lib_$(ConfigurationName)/i686-win32&quot;;&quot;../../libraries/i686-win32/lib_release&quot;"
244 IgnoreDefaultLibraryNames="libcmt.lib"
245 GenerateDebugInformation="true"
246 ProgramDatabaseFile="$(OutDir)/test.pdb"
247 SubSystem="1"
248 TargetMachine="1"
249 />
250 <Tool
251 Name="VCALinkTool"
252 />
253 <Tool
254 Name="VCManifestTool"
255 />
256 <Tool
257 Name="VCXDCMakeTool"
258 />
259 <Tool
260 Name="VCBscMakeTool"
261 />
262 <Tool
263 Name="VCFxCopTool"
264 />
265 <Tool
266 Name="VCAppVerifierTool"
267 />
268 <Tool
269 Name="VCWebDeploymentTool"
270 />
271 <Tool
272 Name="VCPostBuildEventTool"
273 CommandLine="$(TargetPath)"
274 />
275 </Configuration>
276 </Configurations>
277 <References>
278 </References>
279 <Files>
280 <Filter
281 Name="Source Files"
282 Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
283 UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
284 >
285 <File
286 RelativePath=".\common.cpp"
287 >
288 </File>
289 <File
290 RelativePath=".\inventory.cpp"
291 >
292 </File>
293 <File
294 RelativePath=".\io.cpp"
295 >
296 </File>
297 <File
298 RelativePath=".\lldatabase_tut.cpp"
299 >
300 </File>
301 <File
302 RelativePath=".\llerror_tut.cpp"
303 >
304 </File>
305 <File
306 RelativePath=".\llhttpclient_tut.cpp"
307 >
308 </File>
309 <File
310 RelativePath=".\llmime_tut.cpp"
311 >
312 </File>
313 <File
314 RelativePath=".\llpipeutil.cpp"
315 >
316 </File>
317 <File
318 RelativePath=".\llrandom_tut.cpp"
319 >
320 </File>
321 <File
322 RelativePath=".\llsd_message_system_tut.cpp"
323 >
324 </File>
325 <File
326 RelativePath=".\llsd_new_tut.cpp"
327 >
328 </File>
329 <File
330 RelativePath=".\llsdserialize_tut.cpp"
331 >
332 </File>
333 <File
334 RelativePath=".\lltiming_tut.cpp"
335 >
336 </File>
337 <File
338 RelativePath=".\lltut.cpp"
339 >
340 </File>
341 <File
342 RelativePath=".\lluri_tut.cpp"
343 >
344 </File>
345 <File
346 RelativePath=".\lluserrelations_tut.cpp"
347 >
348 </File>
349 <File
350 RelativePath=".\math.cpp"
351 >
352 </File>
353 <File
354 RelativePath=".\reflection_tut.cpp"
355 >
356 </File>
357 <File
358 RelativePath=".\test.cpp"
359 >
360 </File>
361 </Filter>
362 <Filter
363 Name="Header Files"
364 Filter="h;hpp;hxx;hm;inl;inc;xsd"
365 UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
366 >
367 <File
368 RelativePath=".\llpipeutil.h"
369 >
370 </File>
371 <File
372 RelativePath=".\lltut.h"
373 >
374 </File>
375 </Filter>
376 <Filter
377 Name="Resource Files"
378 Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
379 UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
380 >
381 </Filter>
382 </Files>
383 <Globals>
384 </Globals>
385</VisualStudioProject>
diff --git a/linden/indra/win_crash_logger/win_crash_logger.cpp b/linden/indra/win_crash_logger/win_crash_logger.cpp
index effe56c..5849438 100644
--- a/linden/indra/win_crash_logger/win_crash_logger.cpp
+++ b/linden/indra/win_crash_logger/win_crash_logger.cpp
@@ -69,8 +69,8 @@ void write_debug(std::string& str);
69 69
70// Global Variables: 70// Global Variables:
71HINSTANCE hInst= NULL; // current instance 71HINSTANCE hInst= NULL; // current instance
72TCHAR szTitle[MAX_LOADSTRING]; // The title bar text 72TCHAR szTitle[MAX_LOADSTRING]; /* Flawfinder: ignore */ // The title bar text
73TCHAR szWindowClass[MAX_LOADSTRING]; // The title bar text 73TCHAR szWindowClass[MAX_LOADSTRING]; /* Flawfinder: ignore */ // The title bar text
74 74
75LLString gUserText; // User's description of the problem 75LLString gUserText; // User's description of the problem
76time_t gStartTime = 0; 76time_t gStartTime = 0;
@@ -91,10 +91,10 @@ WCHAR gProductName[512];
91// Include product name in the window caption. 91// Include product name in the window caption.
92void ProcessCaption(HWND hWnd) 92void ProcessCaption(HWND hWnd)
93{ 93{
94 TCHAR templateText[1024]; 94 TCHAR templateText[1024]; /* Flawfinder: ignore */
95 TCHAR finalText[2048]; 95 TCHAR finalText[2048]; /* Flawfinder: ignore */
96 GetWindowText(hWnd, templateText, sizeof(templateText)); 96 GetWindowText(hWnd, templateText, sizeof(templateText));
97 swprintf(finalText, templateText, gProductName); 97 swprintf(finalText, templateText, gProductName); /* Flawfinder: ignore */
98 SetWindowText(hWnd, finalText); 98 SetWindowText(hWnd, finalText);
99} 99}
100 100
@@ -102,10 +102,10 @@ void ProcessCaption(HWND hWnd)
102// Include product name in the diaog item text. 102// Include product name in the diaog item text.
103void ProcessDlgItemText(HWND hWnd, int nIDDlgItem) 103void ProcessDlgItemText(HWND hWnd, int nIDDlgItem)
104{ 104{
105 TCHAR templateText[1024]; 105 TCHAR templateText[1024]; /* Flawfinder: ignore */
106 TCHAR finalText[2048]; 106 TCHAR finalText[2048]; /* Flawfinder: ignore */
107 GetDlgItemText(hWnd, nIDDlgItem, templateText, sizeof(templateText)); 107 GetDlgItemText(hWnd, nIDDlgItem, templateText, sizeof(templateText));
108 swprintf(finalText, templateText, gProductName); 108 swprintf(finalText, templateText, gProductName); /* Flawfinder: ignore */
109 SetDlgItemText(hWnd, nIDDlgItem, finalText); 109 SetDlgItemText(hWnd, nIDDlgItem, finalText);
110} 110}
111 111
@@ -119,7 +119,7 @@ int APIENTRY WinMain(HINSTANCE hInstance,
119 gDirUtilp->initAppDirs("SecondLife"); 119 gDirUtilp->initAppDirs("SecondLife");
120 120
121 // Default to the product name "Second Life" (this is overridden by the -name argument) 121 // Default to the product name "Second Life" (this is overridden by the -name argument)
122 swprintf(gProductName, L"Second Life"); 122 swprintf(gProductName, L"Second Life"); /* Flawfinder: ignore */
123 123
124 gCrashSettings.declareS32(CRASH_BEHAVIOR_SETTING, CRASH_BEHAVIOR_ASK, "Controls behavior when viewer crashes " 124 gCrashSettings.declareS32(CRASH_BEHAVIOR_SETTING, CRASH_BEHAVIOR_ASK, "Controls behavior when viewer crashes "
125 "(0 = ask before sending crash report, 1 = always send crash report, 2 = never send crash report)"); 125 "(0 = ask before sending crash report, 1 = always send crash report, 2 = never send crash report)");
@@ -138,7 +138,7 @@ int APIENTRY WinMain(HINSTANCE hInstance,
138 138
139 const S32 MAX_ARGS = 100; 139 const S32 MAX_ARGS = 100;
140 int argc = 0; 140 int argc = 0;
141 char *argv[MAX_ARGS]; 141 char *argv[MAX_ARGS]; /* Flawfinder: ignore */
142 142
143 char *token = NULL; 143 char *token = NULL;
144 if( cmd_line_including_exe_name[0] == '\"' ) 144 if( cmd_line_including_exe_name[0] == '\"' )
@@ -158,7 +158,7 @@ int APIENTRY WinMain(HINSTANCE hInstance,
158 { 158 {
159 argv[argc++] = token; 159 argv[argc++] = token;
160 /* Get next token: */ 160 /* Get next token: */
161 if (*(token + strlen(token) + 1) == '\"') 161 if (*(token + strlen(token) + 1) == '\"') /* Flawfinder: ignore */
162 { 162 {
163 token = strtok( NULL, "\""); 163 token = strtok( NULL, "\"");
164 } 164 }
@@ -269,11 +269,11 @@ int APIENTRY WinMain(HINSTANCE hInstance,
269 WCHAR header[2048]; 269 WCHAR header[2048];
270 if (gCrashInPreviousExec) 270 if (gCrashInPreviousExec)
271 { 271 {
272 swprintf(header, L"%s appears to have crashed or frozen the last time it ran.", gProductName); 272 swprintf(header, L"%s appears to have crashed or frozen the last time it ran.", gProductName); /* Flawfinder: ignore */
273 } 273 }
274 else 274 else
275 { 275 {
276 swprintf(header, L"%s appears to have crashed.", gProductName); 276 swprintf(header, L"%s appears to have crashed.", gProductName); /* Flawfinder: ignore */
277 } 277 }
278 SetDlgItemText(gHwndReport, IDC_STATIC_HEADER, header); 278 SetDlgItemText(gHwndReport, IDC_STATIC_HEADER, header);
279 ShowWindow(gHwndReport, SW_SHOW ); 279 ShowWindow(gHwndReport, SW_SHOW );
@@ -497,7 +497,7 @@ void send_crash_report()
497 497
498 // Get the filename of the SecondLife.log file 498 // Get the filename of the SecondLife.log file
499 // *NOTE: This buffer size is hard coded into scanf() below. 499 // *NOTE: This buffer size is hard coded into scanf() below.
500 char tmp_sl_name[256]; 500 char tmp_sl_name[256]; /* Flawfinder: ignore */
501 tmp_sl_name[0] = '\0'; 501 tmp_sl_name[0] = '\0';
502 502
503 update_messages(); 503 update_messages();
@@ -701,7 +701,7 @@ void send_crash_report()
701 // Post data to web server 701 // Post data to web server
702 const S32 BUFSIZE = 65536; 702 const S32 BUFSIZE = 65536;
703 HINTERNET hinet, hsession, hrequest; 703 HINTERNET hinet, hsession, hrequest;
704 char data[BUFSIZE]; 704 char data[BUFSIZE]; /* Flawfinder: ignore */
705 unsigned long bytes_read; 705 unsigned long bytes_read;
706 706
707 llinfos << "Connecting to crash report server" << llendl; 707 llinfos << "Connecting to crash report server" << llendl;
@@ -809,7 +809,7 @@ LLFileEncoder::LLFileEncoder(const char *form_name, const char *filename)
809 while (count < 5) 809 while (count < 5)
810 { 810 {
811 buf_size = stat_data.st_size; 811 buf_size = stat_data.st_size;
812 fp = LLFile::fopen(mFilename.c_str(), "rb"); 812 fp = LLFile::fopen(mFilename.c_str(), "rb"); /* Flawfinder: ignore */
813 if (!fp) 813 if (!fp)
814 { 814 {
815 llwarns << "Can't open file " << mFilename << ", wait for a second" << llendl; 815 llwarns << "Can't open file " << mFilename << ", wait for a second" << llendl;
@@ -897,14 +897,14 @@ void write_debug(const char *str)
897 { 897 {
898 std::string debug_filename = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,"debug_info.log"); 898 std::string debug_filename = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,"debug_info.log");
899 llinfos << "Opening debug file " << debug_filename << llendl; 899 llinfos << "Opening debug file " << debug_filename << llendl;
900 gDebugFile = LLFile::fopen(debug_filename.c_str(), "a+"); 900 gDebugFile = LLFile::fopen(debug_filename.c_str(), "a+"); /* Flawfinder: ignore */
901 if (!gDebugFile) 901 if (!gDebugFile)
902 { 902 {
903 fprintf(stderr, "Couldn't open %s: debug log to stderr instead.\n", debug_filename.c_str()); 903 fprintf(stderr, "Couldn't open %s: debug log to stderr instead.\n", debug_filename.c_str());
904 gDebugFile = stderr; 904 gDebugFile = stderr;
905 } 905 }
906 } 906 }
907 fprintf(gDebugFile, str); 907 fprintf(gDebugFile, str); /* Flawfinder: ignore */
908 fflush(gDebugFile); 908 fflush(gDebugFile);
909} 909}
910 910
diff --git a/linden/indra/win_crash_logger/win_crash_logger_vc8.vcproj b/linden/indra/win_crash_logger/win_crash_logger_vc8.vcproj
new file mode 100644
index 0000000..78ae4e6
--- /dev/null
+++ b/linden/indra/win_crash_logger/win_crash_logger_vc8.vcproj
@@ -0,0 +1,319 @@
1<?xml version="1.0" encoding="Windows-1252"?>
2<VisualStudioProject
3 ProjectType="Visual C++"
4 Version="8.00"
5 Name="win_crash_logger"
6 ProjectGUID="{648685F3-8760-4CC5-BB2B-CAF9DECC25A4}"
7 RootNamespace="win_crash_logger"
8 Keyword="Win32Proj"
9 >
10 <Platforms>
11 <Platform
12 Name="Win32"
13 />
14 </Platforms>
15 <ToolFiles>
16 </ToolFiles>
17 <Configurations>
18 <Configuration
19 Name="Debug|Win32"
20 OutputDirectory="Debug"
21 IntermediateDirectory="Debug"
22 ConfigurationType="1"
23 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
24 CharacterSet="1"
25 >
26 <Tool
27 Name="VCPreBuildEventTool"
28 />
29 <Tool
30 Name="VCCustomBuildTool"
31 />
32 <Tool
33 Name="VCXMLDataGeneratorTool"
34 />
35 <Tool
36 Name="VCWebServiceProxyGeneratorTool"
37 />
38 <Tool
39 Name="VCMIDLTool"
40 />
41 <Tool
42 Name="VCCLCompilerTool"
43 Optimization="0"
44 AdditionalIncludeDirectories="..\llcommon;..\llmath;..\llvfs;..\llaudio;..\llmedia;..\llimage;..\llscene;..\llxml;..\llmessage;..\llprimitive;..\llrender;..\llwindow;..\llcharacter;..\llinventory;..\llui;..\lscript;&quot;..\..\libraries\i686-win32\include&quot;;..\..\libraries\include\;&quot;..\..\libraries\i686-win32\include\quicktime&quot;"
45 PreprocessorDefinitions="WIN32;_DEBUG;LL_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;LL_DEBUG"
46 MinimalRebuild="true"
47 BasicRuntimeChecks="3"
48 RuntimeLibrary="1"
49 StructMemberAlignment="4"
50 TreatWChar_tAsBuiltInType="false"
51 ForceConformanceInForLoopScope="true"
52 UsePrecompiledHeader="0"
53 WarningLevel="3"
54 Detect64BitPortabilityProblems="false"
55 DebugInformationFormat="4"
56 />
57 <Tool
58 Name="VCManagedResourceCompilerTool"
59 />
60 <Tool
61 Name="VCResourceCompilerTool"
62 />
63 <Tool
64 Name="VCPreLinkEventTool"
65 />
66 <Tool
67 Name="VCLinkerTool"
68 AdditionalDependencies="apr-1.lib aprutil-1.lib ws2_32.lib advapi32.lib comdlg32.lib dxguid.lib gdi32.lib kernel32.lib libexpatMT.lib llcommon.lib llmath.lib llwindow.lib llvfs.lib llmessage.lib llxml.lib netapi32.lib ole32.lib oleaut32.lib shell32.lib user32.lib wininet.lib winspool.lib"
69 OutputFile="win_crash_logger.exe"
70 LinkIncremental="1"
71 AdditionalLibraryDirectories="../lib_$(ConfigurationName)/i686-win32;../../libraries/i686-win32/lib_debug"
72 GenerateDebugInformation="true"
73 ProgramDatabaseFile="$(OutDir)/win_crash_logger.pdb"
74 SubSystem="2"
75 TargetMachine="1"
76 />
77 <Tool
78 Name="VCALinkTool"
79 />
80 <Tool
81 Name="VCManifestTool"
82 />
83 <Tool
84 Name="VCXDCMakeTool"
85 />
86 <Tool
87 Name="VCBscMakeTool"
88 />
89 <Tool
90 Name="VCFxCopTool"
91 />
92 <Tool
93 Name="VCAppVerifierTool"
94 />
95 <Tool
96 Name="VCWebDeploymentTool"
97 />
98 <Tool
99 Name="VCPostBuildEventTool"
100 />
101 </Configuration>
102 <Configuration
103 Name="Release|Win32"
104 OutputDirectory="Release"
105 IntermediateDirectory="Release"
106 ConfigurationType="1"
107 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
108 CharacterSet="1"
109 >
110 <Tool
111 Name="VCPreBuildEventTool"
112 />
113 <Tool
114 Name="VCCustomBuildTool"
115 />
116 <Tool
117 Name="VCXMLDataGeneratorTool"
118 />
119 <Tool
120 Name="VCWebServiceProxyGeneratorTool"
121 />
122 <Tool
123 Name="VCMIDLTool"
124 />
125 <Tool
126 Name="VCCLCompilerTool"
127 AdditionalIncludeDirectories="..\llcommon;..\llmath;..\llvfs;..\llaudio;..\llmedia;..\llimage;..\llscene;..\llxml;..\llmessage;..\llprimitive;..\llrender;..\llwindow;..\llcharacter;..\llinventory;..\llui;..\lscript;&quot;..\..\libraries\i686-win32\include&quot;;..\..\libraries\include\;&quot;..\..\libraries\i686-win32\include\quicktime&quot;"
128 PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;LL_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;LL_RELEASE"
129 RuntimeLibrary="0"
130 StructMemberAlignment="0"
131 TreatWChar_tAsBuiltInType="false"
132 ForceConformanceInForLoopScope="true"
133 UsePrecompiledHeader="0"
134 WarningLevel="3"
135 Detect64BitPortabilityProblems="false"
136 DebugInformationFormat="3"
137 />
138 <Tool
139 Name="VCManagedResourceCompilerTool"
140 />
141 <Tool
142 Name="VCResourceCompilerTool"
143 />
144 <Tool
145 Name="VCPreLinkEventTool"
146 />
147 <Tool
148 Name="VCLinkerTool"
149 AdditionalDependencies="apr-1.lib aprutil-1.lib ws2_32.lib advapi32.lib comdlg32.lib dxguid.lib gdi32.lib kernel32.lib libexpatMT.lib llcommon.lib llmath.lib llwindow.lib llvfs.lib llmessage.lib llxml.lib netapi32.lib ole32.lib oleaut32.lib shell32.lib user32.lib wininet.lib winspool.lib"
150 OutputFile="win_crash_logger.exe"
151 LinkIncremental="1"
152 AdditionalLibraryDirectories="../lib_$(ConfigurationName)/i686-win32;../../libraries/i686-win32/lib_release"
153 GenerateDebugInformation="true"
154 SubSystem="2"
155 OptimizeReferences="2"
156 EnableCOMDATFolding="2"
157 TargetMachine="1"
158 />
159 <Tool
160 Name="VCALinkTool"
161 />
162 <Tool
163 Name="VCManifestTool"
164 />
165 <Tool
166 Name="VCXDCMakeTool"
167 />
168 <Tool
169 Name="VCBscMakeTool"
170 />
171 <Tool
172 Name="VCFxCopTool"
173 />
174 <Tool
175 Name="VCAppVerifierTool"
176 />
177 <Tool
178 Name="VCWebDeploymentTool"
179 />
180 <Tool
181 Name="VCPostBuildEventTool"
182 />
183 </Configuration>
184 <Configuration
185 Name="ReleaseNoOpt|Win32"
186 OutputDirectory="$(ConfigurationName)"
187 IntermediateDirectory="$(ConfigurationName)"
188 ConfigurationType="1"
189 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
190 CharacterSet="1"
191 >
192 <Tool
193 Name="VCPreBuildEventTool"
194 />
195 <Tool
196 Name="VCCustomBuildTool"
197 />
198 <Tool
199 Name="VCXMLDataGeneratorTool"
200 />
201 <Tool
202 Name="VCWebServiceProxyGeneratorTool"
203 />
204 <Tool
205 Name="VCMIDLTool"
206 />
207 <Tool
208 Name="VCCLCompilerTool"
209 AdditionalIncludeDirectories="..\llcommon;..\llmath;..\llvfs;..\llaudio;..\llmedia;..\llimage;..\llscene;..\llxml;..\llmessage;..\llprimitive;..\llrender;..\llwindow;..\llcharacter;..\llinventory;..\llui;..\lscript;&quot;..\..\libraries\i686-win32\include&quot;;..\..\libraries\include\;&quot;..\..\libraries\i686-win32\include\quicktime&quot;"
210 PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;LL_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;LL_RELEASE"
211 RuntimeLibrary="0"
212 StructMemberAlignment="0"
213 TreatWChar_tAsBuiltInType="false"
214 ForceConformanceInForLoopScope="true"
215 UsePrecompiledHeader="0"
216 WarningLevel="3"
217 Detect64BitPortabilityProblems="false"
218 DebugInformationFormat="3"
219 />
220 <Tool
221 Name="VCManagedResourceCompilerTool"
222 />
223 <Tool
224 Name="VCResourceCompilerTool"
225 />
226 <Tool
227 Name="VCPreLinkEventTool"
228 />
229 <Tool
230 Name="VCLinkerTool"
231 AdditionalDependencies="apr-1.lib aprutil-1.lib ws2_32.lib advapi32.lib comdlg32.lib dxguid.lib gdi32.lib kernel32.lib libexpatMT.lib llcommon.lib llmath.lib llwindow.lib llvfs.lib llmessage.lib llxml.lib netapi32.lib ole32.lib oleaut32.lib shell32.lib user32.lib wininet.lib winspool.lib"
232 OutputFile="win_crash_logger.exe"
233 LinkIncremental="1"
234 AdditionalLibraryDirectories="../lib_$(ConfigurationName)/i686-win32;../../libraries/i686-win32/lib_release"
235 GenerateDebugInformation="true"
236 SubSystem="2"
237 OptimizeReferences="2"
238 EnableCOMDATFolding="2"
239 TargetMachine="1"
240 />
241 <Tool
242 Name="VCALinkTool"
243 />
244 <Tool
245 Name="VCManifestTool"
246 />
247 <Tool
248 Name="VCXDCMakeTool"
249 />
250 <Tool
251 Name="VCBscMakeTool"
252 />
253 <Tool
254 Name="VCFxCopTool"
255 />
256 <Tool
257 Name="VCAppVerifierTool"
258 />
259 <Tool
260 Name="VCWebDeploymentTool"
261 />
262 <Tool
263 Name="VCPostBuildEventTool"
264 />
265 </Configuration>
266 </Configurations>
267 <References>
268 </References>
269 <Files>
270 <Filter
271 Name="Source Files"
272 Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
273 UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
274 >
275 <File
276 RelativePath=".\StdAfx.cpp"
277 >
278 </File>
279 <File
280 RelativePath=".\win_crash_logger.cpp"
281 >
282 </File>
283 </Filter>
284 <Filter
285 Name="Header Files"
286 Filter="h;hpp;hxx;hm;inl;inc;xsd"
287 UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
288 >
289 <File
290 RelativePath=".\resource.h"
291 >
292 </File>
293 <File
294 RelativePath=".\StdAfx.h"
295 >
296 </File>
297 <File
298 RelativePath=".\win_crash_logger.h"
299 >
300 </File>
301 </Filter>
302 <Filter
303 Name="Resource Files"
304 Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
305 UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
306 >
307 <File
308 RelativePath=".\ll_icon.ico"
309 >
310 </File>
311 <File
312 RelativePath=".\win_crash_logger.rc"
313 >
314 </File>
315 </Filter>
316 </Files>
317 <Globals>
318 </Globals>
319</VisualStudioProject>
diff --git a/linden/indra/win_updater/updater.cpp b/linden/indra/win_updater/updater.cpp
index 20e41a8..e41ab00 100644
--- a/linden/indra/win_updater/updater.cpp
+++ b/linden/indra/win_updater/updater.cpp
@@ -33,6 +33,7 @@
33#include <wininet.h> 33#include <wininet.h>
34 34
35#include <stdio.h> 35#include <stdio.h>
36#include "llpreprocessor.h"
36#include "llfile.h" 37#include "llfile.h"
37 38
38#define BUFSIZE 8192 39#define BUFSIZE 8192
@@ -81,7 +82,7 @@ int WINAPI get_url_into_file(WCHAR *uri, char *path, int *cancelled)
81 *cancelled = FALSE; 82 *cancelled = FALSE;
82 83
83 HINTERNET hinet, hdownload; 84 HINTERNET hinet, hdownload;
84 char data[BUFSIZE]; 85 char data[BUFSIZE]; /* Flawfinder: ignore */
85 unsigned long bytes_read; 86 unsigned long bytes_read;
86 87
87#if _DEBUG 88#if _DEBUG
@@ -89,7 +90,7 @@ int WINAPI get_url_into_file(WCHAR *uri, char *path, int *cancelled)
89 fflush(logfile); 90 fflush(logfile);
90#endif 91#endif
91 92
92 FILE *fp = fopen(path, "wb"); 93 FILE* fp = fopen(path, "wb"); /* Flawfinder: ignore */
93 94
94 if (!fp) 95 if (!fp)
95 { 96 {
@@ -132,7 +133,7 @@ int WINAPI get_url_into_file(WCHAR *uri, char *path, int *cancelled)
132 { 133 {
133#if _DEBUG 134#if _DEBUG
134 DWORD err = GetLastError(); 135 DWORD err = GetLastError();
135 fprintf(logfile,"InternetQueryDataAvailable Failed: %d bytes\n",total_bytes); 136 fprintf(logfile,"InternetQueryDataAvailable Failed: %d bytes Err:%d\n",total_bytes,err);
136 fflush(logfile); 137 fflush(logfile);
137#endif 138#endif
138 return success; 139 return success;
@@ -320,7 +321,7 @@ WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nSho
320 321
321 const int MAX_ARGS = 100; 322 const int MAX_ARGS = 100;
322 int argc = 0; 323 int argc = 0;
323 char *argv[MAX_ARGS]; 324 char* argv[MAX_ARGS]; /* Flawfinder: ignore */
324 325
325#if _DEBUG 326#if _DEBUG
326 logfile = _wfopen(TEXT("updater.log"),TEXT("wt")); 327 logfile = _wfopen(TEXT("updater.log"),TEXT("wt"));
@@ -346,7 +347,7 @@ WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nSho
346 { 347 {
347 argv[argc++] = token; 348 argv[argc++] = token;
348 /* Get next token: */ 349 /* Get next token: */
349 if (*(token + strlen(token) + 1) == '\"') 350 if (*(token + strlen(token) + 1) == '\"') /* Flawfinder: ignore */
350 { 351 {
351 token = strtok( NULL, "\""); 352 token = strtok( NULL, "\"");
352 } 353 }
@@ -379,7 +380,7 @@ WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nSho
379 if (gProductName) 380 if (gProductName)
380 { 381 {
381 mbstowcs(window_title, gProductName, 2048); 382 mbstowcs(window_title, gProductName, 2048);
382 wcscat(window_title, L" Updater"); 383 wcscat(window_title, L" Updater"); /* Flawfinder: ignore */
383 } 384 }
384 else 385 else
385 { 386 {
@@ -388,7 +389,7 @@ WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nSho
388 389
389 WNDCLASSEX wndclassex = { 0 }; 390 WNDCLASSEX wndclassex = { 0 };
390 DEVMODE dev_mode = { 0 }; 391 DEVMODE dev_mode = { 0 };
391 char update_exec_path[MAX_PATH]; 392 char update_exec_path[MAX_PATH]; /* Flawfinder: ignore */
392 char *ptr; 393 char *ptr;
393 WCHAR update_uri[4096]; 394 WCHAR update_uri[4096];
394 395
@@ -457,10 +458,10 @@ WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nSho
457 *(ptr + 2) = 'x'; 458 *(ptr + 2) = 'x';
458 *(ptr + 3) = 'e'; 459 *(ptr + 3) = 'e';
459 *(ptr + 4) = 0; 460 *(ptr + 4) = 0;
460 wcscpy(update_uri, UPDATE_URIBASE); 461 wcscpy(update_uri, UPDATE_URIBASE); /* Flawfinder: ignore */
461 WCHAR wcmdline[2048]; 462 WCHAR wcmdline[2048];
462 mbstowcs(wcmdline, gUserServer, 2048); 463 mbstowcs(wcmdline, gUserServer, 2048);
463 wcscat(update_uri, wcmdline); 464 wcscat(update_uri, wcmdline); /* Flawfinder: ignore */
464 465
465 int success; 466 int success;
466 int cancelled; 467 int cancelled;
@@ -503,18 +504,18 @@ WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nSho
503 } 504 }
504 505
505 // Construct some parameters. 506 // Construct some parameters.
506 char params[2048]; 507 char params[2048]; /* Flawfinder: ignore */
507 if (gIsSilent && gProgramName) 508 if (gIsSilent && gProgramName)
508 { 509 {
509 sprintf(params, "/S /P=\"%s\"", gProgramName); 510 snprintf(params, sizeof(params), "/S /P=\"%s\"", gProgramName); /* Flawfinder: ignore */
510 } 511 }
511 else if (gProgramName) 512 else if (gProgramName)
512 { 513 {
513 sprintf(params, "/P=\"%s\"", gProgramName); 514 snprintf(params, sizeof(params), "/P=\"%s\"", gProgramName); /* Flawfinder: ignore */
514 } 515 }
515 else if (gIsSilent) 516 else if (gIsSilent)
516 { 517 {
517 sprintf(params, "/S"); 518 sprintf(params, "/S"); /* Flawfinder: ignore */
518 } 519 }
519 else 520 else
520 { 521 {
diff --git a/linden/indra/win_updater/win_updater_vc8.vcproj b/linden/indra/win_updater/win_updater_vc8.vcproj
new file mode 100644
index 0000000..3368ac5
--- /dev/null
+++ b/linden/indra/win_updater/win_updater_vc8.vcproj
@@ -0,0 +1,295 @@
1<?xml version="1.0" encoding="Windows-1252"?>
2<VisualStudioProject
3 ProjectType="Visual C++"
4 Version="8.00"
5 Name="win_updater"
6 ProjectGUID="{E928F33B-E090-4FA8-818B-6B5D8B0F1F4B}"
7 RootNamespace="win_updater"
8 Keyword="Win32Proj"
9 >
10 <Platforms>
11 <Platform
12 Name="Win32"
13 />
14 </Platforms>
15 <ToolFiles>
16 </ToolFiles>
17 <Configurations>
18 <Configuration
19 Name="Debug|Win32"
20 OutputDirectory="Debug"
21 IntermediateDirectory="Debug"
22 ConfigurationType="1"
23 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
24 CharacterSet="1"
25 >
26 <Tool
27 Name="VCPreBuildEventTool"
28 />
29 <Tool
30 Name="VCCustomBuildTool"
31 />
32 <Tool
33 Name="VCXMLDataGeneratorTool"
34 />
35 <Tool
36 Name="VCWebServiceProxyGeneratorTool"
37 />
38 <Tool
39 Name="VCMIDLTool"
40 />
41 <Tool
42 Name="VCCLCompilerTool"
43 Optimization="0"
44 AdditionalIncludeDirectories="..\llcommon;..\llmath;..\llmessage;..\llwindow"
45 PreprocessorDefinitions="WIN32;_DEBUG;LL_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;LL_DEBUG"
46 MinimalRebuild="true"
47 BasicRuntimeChecks="3"
48 RuntimeLibrary="1"
49 StructMemberAlignment="4"
50 TreatWChar_tAsBuiltInType="false"
51 ForceConformanceInForLoopScope="true"
52 UsePrecompiledHeader="0"
53 WarningLevel="3"
54 Detect64BitPortabilityProblems="false"
55 DebugInformationFormat="4"
56 />
57 <Tool
58 Name="VCManagedResourceCompilerTool"
59 />
60 <Tool
61 Name="VCResourceCompilerTool"
62 />
63 <Tool
64 Name="VCPreLinkEventTool"
65 />
66 <Tool
67 Name="VCLinkerTool"
68 AdditionalDependencies="advapi32.lib comdlg32.lib gdi32.lib kernel32.lib odbc32.lib odbccp32.lib ole32.lib oleaut32.lib shell32.lib user32.lib uuid.lib wininet.lib winspool.lib"
69 OutputFile="updater.exe"
70 LinkIncremental="2"
71 AdditionalLibraryDirectories="../lib_$(ConfigurationName)/i686-win32;../../libraries/i686-win32/lib_debug"
72 GenerateDebugInformation="true"
73 ProgramDatabaseFile="$(OutDir)/win_updater.pdb"
74 SubSystem="2"
75 TargetMachine="1"
76 />
77 <Tool
78 Name="VCALinkTool"
79 />
80 <Tool
81 Name="VCManifestTool"
82 />
83 <Tool
84 Name="VCXDCMakeTool"
85 />
86 <Tool
87 Name="VCBscMakeTool"
88 />
89 <Tool
90 Name="VCFxCopTool"
91 />
92 <Tool
93 Name="VCAppVerifierTool"
94 />
95 <Tool
96 Name="VCWebDeploymentTool"
97 />
98 <Tool
99 Name="VCPostBuildEventTool"
100 />
101 </Configuration>
102 <Configuration
103 Name="Release|Win32"
104 OutputDirectory="Release"
105 IntermediateDirectory="Release"
106 ConfigurationType="1"
107 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
108 CharacterSet="1"
109 >
110 <Tool
111 Name="VCPreBuildEventTool"
112 />
113 <Tool
114 Name="VCCustomBuildTool"
115 />
116 <Tool
117 Name="VCXMLDataGeneratorTool"
118 />
119 <Tool
120 Name="VCWebServiceProxyGeneratorTool"
121 />
122 <Tool
123 Name="VCMIDLTool"
124 />
125 <Tool
126 Name="VCCLCompilerTool"
127 AdditionalIncludeDirectories="..\llcommon;..\llmath;..\llmessage;..\llwindow"
128 PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;LL_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;LL_RELEASE"
129 RuntimeLibrary="0"
130 StructMemberAlignment="0"
131 TreatWChar_tAsBuiltInType="false"
132 ForceConformanceInForLoopScope="true"
133 UsePrecompiledHeader="0"
134 WarningLevel="3"
135 Detect64BitPortabilityProblems="false"
136 DebugInformationFormat="3"
137 />
138 <Tool
139 Name="VCManagedResourceCompilerTool"
140 />
141 <Tool
142 Name="VCResourceCompilerTool"
143 />
144 <Tool
145 Name="VCPreLinkEventTool"
146 />
147 <Tool
148 Name="VCLinkerTool"
149 AdditionalDependencies="advapi32.lib comdlg32.lib gdi32.lib kernel32.lib odbc32.lib odbccp32.lib ole32.lib oleaut32.lib shell32.lib user32.lib uuid.lib wininet.lib winspool.lib"
150 OutputFile="updater.exe"
151 LinkIncremental="1"
152 AdditionalLibraryDirectories="../lib_$(ConfigurationName)/i686-win32;../../libraries/i686-win32/lib_release"
153 GenerateDebugInformation="true"
154 SubSystem="2"
155 OptimizeReferences="2"
156 EnableCOMDATFolding="2"
157 TargetMachine="1"
158 />
159 <Tool
160 Name="VCALinkTool"
161 />
162 <Tool
163 Name="VCManifestTool"
164 />
165 <Tool
166 Name="VCXDCMakeTool"
167 />
168 <Tool
169 Name="VCBscMakeTool"
170 />
171 <Tool
172 Name="VCFxCopTool"
173 />
174 <Tool
175 Name="VCAppVerifierTool"
176 />
177 <Tool
178 Name="VCWebDeploymentTool"
179 />
180 <Tool
181 Name="VCPostBuildEventTool"
182 />
183 </Configuration>
184 <Configuration
185 Name="ReleaseNoOpt|Win32"
186 OutputDirectory="$(ConfigurationName)"
187 IntermediateDirectory="$(ConfigurationName)"
188 ConfigurationType="1"
189 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
190 CharacterSet="1"
191 >
192 <Tool
193 Name="VCPreBuildEventTool"
194 />
195 <Tool
196 Name="VCCustomBuildTool"
197 />
198 <Tool
199 Name="VCXMLDataGeneratorTool"
200 />
201 <Tool
202 Name="VCWebServiceProxyGeneratorTool"
203 />
204 <Tool
205 Name="VCMIDLTool"
206 />
207 <Tool
208 Name="VCCLCompilerTool"
209 AdditionalIncludeDirectories="..\llcommon;..\llmath;..\llmessage;..\llwindow"
210 PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;LL_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;LL_RELEASE"
211 RuntimeLibrary="0"
212 StructMemberAlignment="0"
213 TreatWChar_tAsBuiltInType="false"
214 ForceConformanceInForLoopScope="true"
215 UsePrecompiledHeader="0"
216 WarningLevel="3"
217 Detect64BitPortabilityProblems="false"
218 DebugInformationFormat="3"
219 />
220 <Tool
221 Name="VCManagedResourceCompilerTool"
222 />
223 <Tool
224 Name="VCResourceCompilerTool"
225 />
226 <Tool
227 Name="VCPreLinkEventTool"
228 />
229 <Tool
230 Name="VCLinkerTool"
231 AdditionalDependencies="advapi32.lib comdlg32.lib gdi32.lib kernel32.lib odbc32.lib odbccp32.lib ole32.lib oleaut32.lib shell32.lib user32.lib uuid.lib wininet.lib winspool.lib"
232 OutputFile="updater.exe"
233 LinkIncremental="1"
234 AdditionalLibraryDirectories="../lib_$(ConfigurationName)/i686-win32;../../libraries/i686-win32/lib_release"
235 GenerateDebugInformation="true"
236 SubSystem="2"
237 OptimizeReferences="2"
238 EnableCOMDATFolding="2"
239 TargetMachine="1"
240 />
241 <Tool
242 Name="VCALinkTool"
243 />
244 <Tool
245 Name="VCManifestTool"
246 />
247 <Tool
248 Name="VCXDCMakeTool"
249 />
250 <Tool
251 Name="VCBscMakeTool"
252 />
253 <Tool
254 Name="VCFxCopTool"
255 />
256 <Tool
257 Name="VCAppVerifierTool"
258 />
259 <Tool
260 Name="VCWebDeploymentTool"
261 />
262 <Tool
263 Name="VCPostBuildEventTool"
264 />
265 </Configuration>
266 </Configurations>
267 <References>
268 </References>
269 <Files>
270 <Filter
271 Name="Source Files"
272 Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
273 UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
274 >
275 <File
276 RelativePath=".\updater.cpp"
277 >
278 </File>
279 </Filter>
280 <Filter
281 Name="Header Files"
282 Filter="h;hpp;hxx;hm;inl;inc;xsd"
283 UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
284 >
285 </Filter>
286 <Filter
287 Name="Resource Files"
288 Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
289 UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
290 >
291 </Filter>
292 </Files>
293 <Globals>
294 </Globals>
295</VisualStudioProject>