diff --git a/indra/cmake/00-Common.cmake b/indra/cmake/00-Common.cmake index fedb43235..f6752a26c 100644 --- a/indra/cmake/00-Common.cmake +++ b/indra/cmake/00-Common.cmake @@ -28,10 +28,10 @@ if (WINDOWS) set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /Od /Zi /MDd" CACHE STRING "C++ compiler debug options" FORCE) set(CMAKE_CXX_FLAGS_RELWITHDEBINFO - "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /Od /Zi /MD" + "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /Od /Zi /MD /MP" CACHE STRING "C++ compiler release-with-debug options" FORCE) set(CMAKE_CXX_FLAGS_RELEASE - "${CMAKE_CXX_FLAGS_RELEASE} ${LL_CXX_FLAGS} /O2 /Zi /MD" + "${CMAKE_CXX_FLAGS_RELEASE} ${LL_CXX_FLAGS} /O2 /Zi /MD /MP" CACHE STRING "C++ compiler release options" FORCE) set(CMAKE_CXX_STANDARD_LIBRARIES "") diff --git a/indra/copy_win_scripts/start-client.py b/indra/copy_win_scripts/start-client.py index 5f7ff2f29..cca61a57b 100644 --- a/indra/copy_win_scripts/start-client.py +++ b/indra/copy_win_scripts/start-client.py @@ -32,7 +32,7 @@ def start_client(grid, slurl, build_config, my_args): f = open("start-client.log", "w") print >>f, "Viewer startup arguments:" llstart.start("viewer", "../../newview", - "%s/newview/%s/secondlife-bin.exe" % (build_path, build_config), + "%s/newview/%s/Ascent.exe" % (build_path, build_config), viewer_args, f) f.close() diff --git a/indra/develop.py b/indra/develop.py index 68931853c..0549b2f56 100755 --- a/indra/develop.py +++ b/indra/develop.py @@ -658,7 +658,7 @@ class WindowsSetup(PlatformSetup): ' --solution ' + os.path.join(build_dir,'Ascent.sln') + ' --config ' + self.build_type + - ' --startup secondlife-bin') + ' --startup Ascent') print 'Running %r in %r' % (vstool_cmd, getcwd()) self.run(vstool_cmd) print >> open(stamp, 'w'), self.build_type diff --git a/indra/llaudio/llaudioengine.cpp b/indra/llaudio/llaudioengine.cpp index 33ec3b6db..98a7d5265 100644 --- a/indra/llaudio/llaudioengine.cpp +++ b/indra/llaudio/llaudioengine.cpp @@ -975,6 +975,45 @@ LLAudioData * LLAudioEngine::getAudioData(const LLUUID &audio_uuid) } } + void LLAudioEngine::removeAudioData(LLUUID &audio_uuid) + { + if(audio_uuid.isNull()) + return; + data_map::iterator iter = mAllData.find(audio_uuid); + if(iter != mAllData.end()) + { + + for (source_map::iterator iter2 = mAllSources.begin(); iter2 != mAllSources.end();) + { + LLAudioSource *sourcep = iter2->second; + if( sourcep && sourcep->getCurrentData() && sourcep->getCurrentData()->getID() == audio_uuid ) + { + LLAudioChannel* chan=sourcep->getChannel(); + delete sourcep; + if(chan) + chan->cleanup(); + iter2 = mAllSources.erase(iter2); + } + else + ++iter2; + } + if(iter->second) //Shouldn't be null, but playing it safe. + { + LLAudioBuffer* buf=((LLAudioData*)iter->second)->getBuffer(); + if(buf) + { + for (S32 i = 0; i < MAX_BUFFERS; i++) + { + if(mBuffers[i] == buf) + mBuffers[i] = NULL; + } + delete buf; + } + delete iter->second; + } + mAllData.erase(iter); + } + } void LLAudioEngine::addAudioSource(LLAudioSource *asp) { mAllSources[asp->getID()] = asp; diff --git a/indra/llaudio/llaudioengine.h b/indra/llaudio/llaudioengine.h index a37366dc2..fa323607b 100644 --- a/indra/llaudio/llaudioengine.h +++ b/indra/llaudio/llaudioengine.h @@ -151,6 +151,7 @@ public: LLAudioSource *findAudioSource(const LLUUID &source_id); LLAudioData *getAudioData(const LLUUID &audio_uuid); + void removeAudioData(LLUUID &audio_uuid); // Internet stream implementation manipulation LLStreamingAudioInterface *getStreamingAudioImpl(); diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index ebeb00690..94522621e 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -2128,6 +2128,22 @@ Value 40 + FloaterBlacklistRect + + Comment + LOLRectangle + Persist + 1 + Type + Rect + Value + + 0 + 400 + 400 + 0 + + BackwardBtnRect Comment diff --git a/indra/newview/llfloaterblacklist.cpp b/indra/newview/llfloaterblacklist.cpp index 054403f98..e565f1434 100644 --- a/indra/newview/llfloaterblacklist.cpp +++ b/indra/newview/llfloaterblacklist.cpp @@ -1,6 +1,8 @@ // #include "llviewerprecompiledheaders.h" #include "llfloaterblacklist.h" +#include "llaudioengine.h" +#include "llvfs.h" #include "lluictrlfactory.h" #include "llsdserialize.h" #include "llscrolllistctrl.h" @@ -8,8 +10,15 @@ #include "llfilepicker.h" #include "llviewerwindow.h" #include "llviewercontrol.h" +#include "lldate.h" +#include "llagent.h" LLFloaterBlacklist* LLFloaterBlacklist::sInstance; + +std::vector LLFloaterBlacklist::blacklist_textures; + +std::map LLFloaterBlacklist::blacklist_entries; + LLFloaterBlacklist::LLFloaterBlacklist() : LLFloater() { @@ -17,7 +26,8 @@ LLFloaterBlacklist::LLFloaterBlacklist() } LLFloaterBlacklist::~LLFloaterBlacklist() { - sInstance = NULL; + if(sInstance == this) + sInstance = NULL; } // static void LLFloaterBlacklist::show() @@ -38,129 +48,196 @@ BOOL LLFloaterBlacklist::postBuild() childSetAction("remove_btn", onClickRemove, this); childSetAction("save_btn", onClickSave, this); childSetAction("load_btn", onClickLoad, this); + childSetVisible("copy_uuid_btn",false); + LLComboBox* box = getChild("asset_combo"); + box->add("Texture",LLSD(0)); + box->add("Sound",LLSD(1)); + box->add("Animation",LLSD(20)); refresh(); return TRUE; } void LLFloaterBlacklist::refresh() { + LLScrollListCtrl* list = getChild("file_list"); list->clearRows(); - if(gAssetStorage) // just in case + for(std::map::iterator iter = blacklist_entries.begin(); iter != blacklist_entries.end(); ++iter) { - LLSD settings; - for(std::vector::iterator iter = gAssetStorage->mBlackListedAsset.begin(); - iter != gAssetStorage->mBlackListedAsset.end(); ++iter) + LLSD element; + std::string agent; + gCacheName->getFullName(LLUUID(iter->second["entry_agent"].asString()), agent); + + element["id"] = iter->first.asString(); { - LLSD element; - element["id"] = (*iter); - LLSD& name_column = element["columns"][0]; - name_column["column"] = "asset_id"; - name_column["value"] = (*iter).asString(); - list->addElement(element, ADD_BOTTOM); - settings.append((*iter)); + LLSD& column = element["columns"][0]; + column["column"] = "asset_id"; + column["value"] = iter->first.asString(); } - setMassEnabled(!gAssetStorage->mBlackListedAsset.empty()); - gSavedSettings.setLLSD("Blacklist.Settings",settings); - } - else - setMassEnabled(FALSE); - setEditID(mSelectID); -} -void LLFloaterBlacklist::add(LLUUID uuid) -{ - if(gAssetStorage) - gAssetStorage->mBlackListedAsset.push_back(uuid); - refresh(); -} -void LLFloaterBlacklist::clear() -{ - if(gAssetStorage) // just in case - { - gAssetStorage->mBlackListedAsset.clear(); - } - refresh(); -} -void LLFloaterBlacklist::setEditID(LLUUID edit_id) -{ - LLScrollListCtrl* list = getChild("file_list"); - bool found = false; - if(gAssetStorage) - found = std::find(gAssetStorage->mBlackListedAsset.begin(), - gAssetStorage->mBlackListedAsset.end(),edit_id) != gAssetStorage->mBlackListedAsset.end(); - if(found) - { - mSelectID = edit_id; - list->selectByID(edit_id); - setEditEnabled(true); - } - else - { - mSelectID = LLUUID::null; - list->deselectAllItems(TRUE); - setEditEnabled(false); + { + LLSD& column = element["columns"][1]; + column["column"] = "entry_name"; + column["value"] = iter->second["entry_name"].asString(); + } + { + LLSD& column = element["columns"][2]; + column["column"] = "entry_type"; + column["value"] = std::string(LLAssetType::lookupHumanReadable( (LLAssetType::EType)iter->second["entry_type"].asInteger() )); + } + { + LLSD& column = element["columns"][3]; + column["column"] = "entry_agent"; + column["value"] = agent; + } + { + LLSD& column = element["columns"][4]; + column["column"] = "entry_date"; + column["value"] = iter->second["entry_date"].asString(); + } + list->addElement(element, ADD_BOTTOM); } } -void LLFloaterBlacklist::removeEntry() -{ - if(gAssetStorage && mSelectID.notNull()) - std::remove(gAssetStorage->mBlackListedAsset.begin(),gAssetStorage->mBlackListedAsset.end(),mSelectID); - refresh(); -} -void LLFloaterBlacklist::setMassEnabled(bool enabled) -{ - childSetEnabled("clear_btn", enabled); -} -void LLFloaterBlacklist::setEditEnabled(bool enabled) -{ - childSetEnabled("copy_uuid_btn", enabled); - childSetEnabled("remove_btn", enabled); -} + // static void LLFloaterBlacklist::onClickAdd(void* user_data) { LLFloaterBlacklist* floaterp = (LLFloaterBlacklist*)user_data; if(!floaterp) return; - floaterp->add(LLUUID(floaterp->childGetValue("id_edit").asString())); + LLUUID add_id(floaterp->childGetValue("id_edit").asString()); + if(add_id.isNull()) return; + std::string name(floaterp->childGetValue("name_edit").asString()); + if(name.size() == 0) return; + LLComboBox* mTypeComboBox = floaterp->getChild("asset_combo"); + LLSD indata; + indata["entry_type"] = (LLAssetType::EType)mTypeComboBox->getValue().asInteger(); + indata["entry_name"] = name; + indata["entry_agent"] = gAgent.getID().asString(); + + addEntry(add_id,indata); } + +//static +void LLFloaterBlacklist::addEntry(LLUUID key, LLSD data) +{ + if(key.notNull()) + { + if(!data.has("entry_type")) + LL_WARNS("FloaterBlacklistAdd") << "addEntry called with no entry type, specify LLAssetType::Etype" << LL_ENDL; + else if(!data.has("entry_name")) + LL_WARNS("FloaterBlacklistAdd") << "addEntry called with no entry name, specify the name that should appear in the listing for this entry." << LL_ENDL; + else + { + if(!data.has("entry_date")) + { + LLDate* curdate = new LLDate(time_corrected()); + std::string input_date = curdate->asString(); + input_date.replace(input_date.find("T"),1," "); + input_date.resize(input_date.size() - 1); + data["entry_date"] = input_date; + } + if(data["entry_type"].asString() == "1") + { + //remove sounds + LLUUID sound_id=LLUUID(key); + gVFS->removeFile(sound_id,LLAssetType::AT_SOUND); + std::string wav_path= gDirUtilp->getExpandedFilename(LL_PATH_CACHE,sound_id.asString()) + ".dsf"; + if(LLAPRFile::isExist(wav_path, LL_APR_RPB)) + LLAPRFile::remove(wav_path); + gAudiop->removeAudioData(sound_id); + } + blacklist_entries.insert(std::pair(key,data)); + updateBlacklists(); + } + } + else + LL_WARNS("FloaterBlacklistAdd") << "addEntry called with a null entry key, please specify LLUUID of asset." << LL_ENDL; +} + // static void LLFloaterBlacklist::onClickClear(void* user_data) { - LLFloaterBlacklist* floaterp = (LLFloaterBlacklist*)user_data; - if(!floaterp) return; - floaterp->clear(); -} -// static -void LLFloaterBlacklist::onCommitFileList(LLUICtrl* ctrl, void* user_data) -{ - LLFloaterBlacklist* floaterp = (LLFloaterBlacklist*)user_data; - LLScrollListCtrl* list = floaterp->getChild("file_list"); - LLUUID selected_id; - if(list->getFirstSelected()) - selected_id = list->getFirstSelected()->getUUID(); - floaterp->setEditID(selected_id); + blacklist_entries.clear(); + updateBlacklists(); } // static void LLFloaterBlacklist::onClickCopyUUID(void* user_data) { LLFloaterBlacklist* floaterp = (LLFloaterBlacklist*)user_data; - gViewerWindow->mWindow->copyTextToClipboard(utf8str_to_wstring(floaterp->mSelectID.asString())); + LLScrollListCtrl* list = floaterp->getChild("file_list"); + gViewerWindow->mWindow->copyTextToClipboard(utf8str_to_wstring(list->getFirstSelected()->getColumn(0)->getValue().asString())); } // static void LLFloaterBlacklist::onClickRemove(void* user_data) { LLFloaterBlacklist* floaterp = (LLFloaterBlacklist*)user_data; - floaterp->removeEntry(); + LLScrollListCtrl* list = floaterp->getChild("file_list"); + if(list->getFirstSelected()) + { + LLScrollListItem* item = list->getFirstSelected(); + LLUUID selected_id(item->getColumn(0)->getValue().asUUID()); + if(selected_id.isNull()) return; + list->deleteSingleItem(list->getFirstSelectedIndex()); + blacklist_entries.erase(selected_id); + updateBlacklists(); + + } } // static void LLFloaterBlacklist::loadFromSave() { - if(!gAssetStorage) return; - LLSD blacklist = gSavedSettings.getLLSD("Blacklist.Settings"); - for(LLSD::array_iterator itr = blacklist.beginArray(); itr != blacklist.endArray(); ++itr) + std::string file_name = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "floater_blist_settings.xml"); + llifstream xml_file(file_name); + if(!xml_file.is_open()) return; + LLSD data; + if(LLSDSerialize::fromXML(data, xml_file) >= 1) { - gAssetStorage->mBlackListedAsset.push_back(itr->asUUID()); + for(LLSD::map_iterator iter = data.beginMap(); iter != data.endMap(); ++iter) + { + blacklist_entries.insert(std::pair(LLUUID(iter->first),iter->second)); + } + updateBlacklists(); + } + xml_file.close(); +} + +//static +void LLFloaterBlacklist::updateBlacklists() +{ + if(gAssetStorage) + { + blacklist_textures.clear(); + gAssetStorage->mBlackListedAsset.clear(); + for(std::map::iterator iter = blacklist_entries.begin(); iter != blacklist_entries.end(); ++iter) + { + if(blacklist_entries[iter->first]["entry_type"].asString() == "0") + { + blacklist_textures.push_back(LLUUID(iter->first)); + } + else + { + gAssetStorage->mBlackListedAsset.push_back(LLUUID(iter->first)); + } + } + saveToDisk(); + LLFloaterBlacklist* instance = LLFloaterBlacklist::getInstance(); + if(instance) + instance->refresh(); } } + +//static +void LLFloaterBlacklist::saveToDisk() +{ + std::string file_name = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "floater_blist_settings.xml"); + llofstream export_file(file_name); + LLSD data; + for(std::map::iterator iter = blacklist_entries.begin(); iter != blacklist_entries.end(); ++iter) + { + data[iter->first.asString()] = iter->second; + } + LLSDSerialize::toPrettyXML(data, export_file); + export_file.close(); +} + //static void LLFloaterBlacklist::onClickSave(void* user_data) { @@ -169,7 +246,12 @@ void LLFloaterBlacklist::onClickSave(void* user_data) { std::string file_name = file_picker.getFirstFile(); llofstream export_file(file_name); - LLSDSerialize::toPrettyXML(gSavedSettings.getLLSD("Blacklist.Settings"), export_file); + LLSD data; + for(std::map::iterator iter = blacklist_entries.begin(); iter != blacklist_entries.end(); ++iter) + { + data[iter->first.asString()] = iter->second; + } + LLSDSerialize::toPrettyXML(data, export_file); export_file.close(); } } @@ -177,8 +259,6 @@ void LLFloaterBlacklist::onClickSave(void* user_data) //static void LLFloaterBlacklist::onClickLoad(void* user_data) { - LLFloaterBlacklist* floater = (LLFloaterBlacklist*)user_data; - LLFilePicker& file_picker = LLFilePicker::instance(); if(file_picker.getOpenFile(LLFilePicker::FFLOAD_BLACKLIST)) { @@ -188,9 +268,11 @@ void LLFloaterBlacklist::onClickLoad(void* user_data) LLSD data; if(LLSDSerialize::fromXML(data, xml_file) >= 1) { - gSavedSettings.setLLSD("Blacklist.Settings", data); - LLFloaterBlacklist::loadFromSave(); - floater->refresh(); + for(LLSD::map_iterator iter = data.beginMap(); iter != data.endMap(); ++iter) + { + blacklist_entries.insert(std::pair(LLUUID(iter->first),iter->second)); + } + updateBlacklists(); } xml_file.close(); } diff --git a/indra/newview/llfloaterblacklist.h b/indra/newview/llfloaterblacklist.h index e7892af84..c35185721 100644 --- a/indra/newview/llfloaterblacklist.h +++ b/indra/newview/llfloaterblacklist.h @@ -10,24 +10,42 @@ public: static void show(); BOOL postBuild(); void refresh(); - void add(LLUUID uuid); - void clear(); - void setEditID(LLUUID edit_id); - void removeEntry(); - static void onClickAdd(void* user_data); - static void onClickClear(void* user_data); - static void onCommitFileList(LLUICtrl* ctrl, void* user_data); - static void onClickCopyUUID(void* user_data); - static void onClickRemove(void* user_data); + static LLFloaterBlacklist* getInstance() { return sInstance; }; + + + /*This is the function to call to add anything to the blacklist, + key is the asset ID + LLSD data is as follows: LLSD[entry_type] = LLAssetType::Etype, + LLSD[entry_name] = std::string, + //LLSD[entry_date] = (automatically generated std::string) + + The LLSD object can hold other data without interfering with the function of this list + as long as you keep the above format. + */ + static void addEntry(LLUUID key, LLSD data); + + + + + static std::map blacklist_entries; + static std::vector blacklist_textures; + static void loadFromSave(); - static void onClickSave(void* user_data); - static void onClickLoad(void* user_data); + + protected: LLUUID mSelectID; private: static LLFloaterBlacklist* sInstance; - void setMassEnabled(bool enabled); - void setEditEnabled(bool enabled); + static void updateBlacklists(); + static void saveToDisk(); + static void onClickAdd(void* user_data); + static void onClickClear(void* user_data); + static void onClickSave(void* user_data); + static void onClickLoad(void* user_data); + static void onClickCopyUUID(void* user_data); + static void onClickRemove(void* user_data); + }; #endif // diff --git a/indra/newview/llfloaterexploresounds.cpp b/indra/newview/llfloaterexploresounds.cpp index 827a38edd..6aedb1007 100644 --- a/indra/newview/llfloaterexploresounds.cpp +++ b/indra/newview/llfloaterexploresounds.cpp @@ -5,15 +5,12 @@ #include "llfloaterexploresounds.h" #include "lluictrlfactory.h" #include "llscrolllistctrl.h" -#include "lllocalinventory.h" #include "llagent.h" #include "llviewerwindow.h" #include "llviewerobjectlist.h" #include "llviewerregion.h" -#include "llviewerparcelmgr.h" -#include "llparcel.h" -#include "llchat.h" #include "llfloaterchat.h" +#include "llfloaterblacklist.h" static const size_t num_collision_sounds = 28; const LLUUID collision_sounds[num_collision_sounds] = @@ -81,6 +78,7 @@ BOOL LLFloaterExploreSounds::postBuild(void) childSetAction("play_locally_btn", handle_play_locally, this); childSetAction("look_at_btn", handle_look_at, this); childSetAction("stop_btn", handle_stop, this); + childSetAction("bl_btn", blacklistSound, this); LLScrollListCtrl* list = getChild("sound_list"); list->sortByColumn("playing", TRUE); @@ -373,6 +371,35 @@ void LLFloaterExploreSounds::handle_stop(void* user_data) } } } +void LLFloaterExploreSounds::blacklistSound(void* user_data) +{ + + LLFloaterBlacklist::show(); + LLFloaterExploreSounds* floater = (LLFloaterExploreSounds*)user_data; + LLScrollListCtrl* list = floater->getChild("sound_list"); + typedef std::vector item_map_t; + item_map_t selection = list->getAllSelected(); + item_map_t::iterator selection_end = selection.end(); + + for(item_map_t::iterator selection_iter = selection.begin(); selection_iter != selection_end; ++selection_iter) + { + LLSoundHistoryItem item = floater->getItem((*selection_iter)->getValue()); + if(item.mID.isNull()) continue; + + LLSD sound_data; + std::string agent; + gCacheName->getFullName(item.mOwnerID, agent); + LLViewerRegion* cur_region = gAgent.getRegion(); + + if(cur_region) + sound_data["entry_name"] = llformat("Sound played by %s in region %s",agent.c_str(),cur_region->getName().c_str()); + else + sound_data["entry_name"] = llformat("Sound played by %s",agent.c_str()); + sound_data["entry_type"] = (LLAssetType::EType)item.mType; + sound_data["entry_agent"] = gAgent.getID(); + LLFloaterBlacklist::addEntry(item.mAssetID,sound_data); + } +} // diff --git a/indra/newview/llfloaterexploresounds.h b/indra/newview/llfloaterexploresounds.h index 24ade315c..11a181377 100644 --- a/indra/newview/llfloaterexploresounds.h +++ b/indra/newview/llfloaterexploresounds.h @@ -19,8 +19,12 @@ public: LLSoundHistoryItem getItem(LLUUID itemID); static void handle_play_locally(void* user_data); + static void handle_play_in_world(void* user_data); static void handle_look_at(void* user_data); + static void handle_open(void* user_data); + static void handle_copy_uuid(void* user_data); static void handle_stop(void* user_data); + static void blacklistSound(void* user_data); private: virtual ~LLFloaterExploreSounds(); diff --git a/indra/newview/skins/default/xui/en-us/floater_blacklist.xml b/indra/newview/skins/default/xui/en-us/floater_blacklist.xml index 6a2981b46..ec7fbf667 100644 --- a/indra/newview/skins/default/xui/en-us/floater_blacklist.xml +++ b/indra/newview/skins/default/xui/en-us/floater_blacklist.xml @@ -1,17 +1,22 @@ + can_resize="true" width="750" min_width="650" height="320" min_height="320" + name="floater_blacklist" title="Asset Blacklist" rect_control="FloaterBlacklistRect">