From 751a3de62537c713267bdfa69f9952d5689bf06f Mon Sep 17 00:00:00 2001 From: Cinders Date: Thu, 12 Sep 2013 19:44:11 -0600 Subject: [PATCH 1/3] Fix a few implicit conversions, might be handy for 64-bit building --- indra/llmath/llquantize.h | 4 +++- indra/newview/ao.cpp | 2 +- indra/newview/chatbar_as_cmdline.cpp | 2 +- indra/newview/chatbar_as_cmdline.h | 2 +- indra/newview/llviewerstats.h | 4 +++- indra/newview/rlvhelper.h | 2 +- 6 files changed, 10 insertions(+), 6 deletions(-) diff --git a/indra/llmath/llquantize.h b/indra/llmath/llquantize.h index 1595dbecf8..69c19b02dd 100755 --- a/indra/llmath/llquantize.h +++ b/indra/llmath/llquantize.h @@ -130,7 +130,9 @@ inline U8 F32_TO_STRING(F32 val, F32 lower, F32 upper) val -= lower; //[0, upper-lower] val /= (upper - lower); //[0,1] val = val * MAXSTRINGVAL; //[0, MAXSTRINGVAL] - val = floor(val + 0.5f); //[0, MAXSTRINGVAL] + // Fix implicit conversaion float to double + //val = floor(val + 0.5f); //[0, MAXSTRINGVAL] + val = floorf(val + 0.5f); //[0, MAXSTRINGVAL] U8 stringVal = (U8)(val) + FIRSTVALIDCHAR; //[FIRSTVALIDCHAR, MAXSTRINGVAL + FIRSTVALIDCHAR] return stringVal; diff --git a/indra/newview/ao.cpp b/indra/newview/ao.cpp index 44b9834212..4e6bd0e661 100644 --- a/indra/newview/ao.cpp +++ b/indra/newview/ao.cpp @@ -40,7 +40,7 @@ #include FloaterAO::FloaterAO(const LLSD& key) -: LLTransientDockableFloater(NULL,true,key),LLEventTimer(10.0), +: LLTransientDockableFloater(NULL,true,key),LLEventTimer(10.f), mSetList(0), mSelectedSet(0), mSelectedState(0), diff --git a/indra/newview/chatbar_as_cmdline.cpp b/indra/newview/chatbar_as_cmdline.cpp index 12d0133292..8411aa3337 100644 --- a/indra/newview/chatbar_as_cmdline.cpp +++ b/indra/newview/chatbar_as_cmdline.cpp @@ -78,7 +78,7 @@ class JCZdrop : public LLEventTimer public: BOOL mRunning; - JCZdrop(std::stack stack, LLUUID dest, std::string sFolder, std::string sUUID, bool package = false) : LLEventTimer(1.0), mRunning(FALSE) + JCZdrop(std::stack stack, LLUUID dest, std::string sFolder, std::string sUUID, bool package = false) : LLEventTimer(1.f), mRunning(FALSE) { mPackage = package; instack = stack; diff --git a/indra/newview/chatbar_as_cmdline.h b/indra/newview/chatbar_as_cmdline.h index a735915147..2f3eab8085 100644 --- a/indra/newview/chatbar_as_cmdline.h +++ b/indra/newview/chatbar_as_cmdline.h @@ -37,7 +37,7 @@ #include "llchat.h" bool cmd_line_chat(std::string revised_text, EChatType type, bool from_gesture = false); -void cmdline_rezplat(bool use_saved_value = true, F32 visual_radius = 30.0); +void cmdline_rezplat(bool use_saved_value = true, F32 visual_radius = 30.f); void cmdline_tp2name(std::string target); LLUUID cmdline_partial_name2key(std::string name); diff --git a/indra/newview/llviewerstats.h b/indra/newview/llviewerstats.h index 6b2461be41..fdf534bd77 100755 --- a/indra/newview/llviewerstats.h +++ b/indra/newview/llviewerstats.h @@ -246,7 +246,9 @@ public: inline F32 getStdDev() const { const F32 mean = getMean(); - return (mCount < 2) ? 0.f : sqrt(llmax(0.f,mSumOfSquares/mCount - (mean * mean))); + // Fix implicit conversion double to float + //return (mCount < 2) ? 0.f : sqrt(llmax(0.f,mSumOfSquares/mCount - (mean * mean))); + return (mCount < 2) ? 0.f : sqrtf(llmax(0.f,mSumOfSquares/mCount - (mean * mean))); } inline U32 getCount() const diff --git a/indra/newview/rlvhelper.h b/indra/newview/rlvhelper.h index 31d4898535..d56d920cfe 100644 --- a/indra/newview/rlvhelper.h +++ b/indra/newview/rlvhelper.h @@ -378,7 +378,7 @@ private: class RlvGCTimer : public LLEventTimer { public: - RlvGCTimer() : LLEventTimer(30.0) {} + RlvGCTimer() : LLEventTimer(30.f) {} virtual BOOL tick(); }; From 1c7a593517ab87f7fe57a316c07aa6db4f6adfe3 Mon Sep 17 00:00:00 2001 From: Cinders Date: Thu, 12 Sep 2013 19:58:11 -0600 Subject: [PATCH 2/3] FIRE-11593: Opensim "4096 Bug" proposed fix generously contributed by Latif Khalifa --- indra/llmath/lloctree.h | 4 ++-- indra/newview/llviewermessage.cpp | 19 +++++++++++++++++++ indra/newview/llviewerpartsim.cpp | 8 ++++++-- indra/newview/llviewerregion.cpp | 14 ++++++++++++++ indra/newview/llviewerregion.h | 2 ++ 5 files changed, 43 insertions(+), 4 deletions(-) diff --git a/indra/llmath/lloctree.h b/indra/llmath/lloctree.h index ebcf9651ec..97bd7f98b3 100755 --- a/indra/llmath/lloctree.h +++ b/indra/llmath/lloctree.h @@ -396,6 +396,7 @@ public: child->insert(data); } } +#ifndef OPENSIM // FIRE-11593: Opensim "4096 Bug" Fix by Latif Khalifa else { //it's not in here, give it to the root @@ -411,6 +412,7 @@ public: node->insert(data); } +#endif // FIRE-11593: Opensim "4096 Bug" Fix by Latif Khalifa return false; } @@ -734,7 +736,6 @@ public: return false; } -#ifndef OPENSIM // FIRE-11593; Don't limit center of octree to 2^20, otherwise we end with the famous longjump bug (cannot TP further than 4095 regions [4096*256 = 2^20] LLVector4a MAX_MAG; MAX_MAG.splat(1024.f*1024.f); @@ -750,7 +751,6 @@ public: //OCT_ERRS << "!!! ELEMENT EXCEEDS RANGE OF SPATIAL PARTITION !!!" << llendl; return false; } -#endif // FIRE-11593 if (this->getSize()[0] > data->getBinRadius() && this->isInside(data->getPositionGroup())) { diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index a28544aa13..063c2e43cb 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -5066,6 +5066,25 @@ void process_agent_movement_complete(LLMessageSystem* msg, void**) gAgent.getRegion()->getOriginGlobal()); gAgent.setRegion(regionp); gObjectList.shiftObjects(shift_vector); +// FIRE-11593: Opensim "4096 Bug" Fix by Latif Khalifa +#ifdef OPENSIM + // Is this a really long jump? + if (shift_vector.length() > 2048.f * 256.f) + { + regionp->reInitPartitions(); + gAgent.setRegion(regionp); + // Kill objects in the regions we left behind + for (LLWorld::region_list_t::const_iterator r = LLWorld::getInstance()->getRegionList().begin(); + r != LLWorld::getInstance()->getRegionList().end(); ++r) + { + if (*r != regionp) + { + gObjectList.killObjects(*r); + } + } + } +#endif +// gAssetStorage->setUpstream(msg->getSender()); gCacheName->setUpstream(msg->getSender()); gViewerThrottle.sendToSim(); diff --git a/indra/newview/llviewerpartsim.cpp b/indra/newview/llviewerpartsim.cpp index d5849e0b1e..ede800a405 100755 --- a/indra/newview/llviewerpartsim.cpp +++ b/indra/newview/llviewerpartsim.cpp @@ -705,7 +705,9 @@ void LLViewerPartSim::updateSimulation() LLViewerObject* vobj = mViewerPartGroups[i]->mVOPartGroupp; S32 visirate = 1; - if (vobj) + // FIRE-11593: Opensim "4096 Bug" Fix by Latif Khalifa + //if (vobj) + if (vobj && vobj->mDrawable) { LLSpatialGroup* group = vobj->mDrawable->getSpatialGroup(); if (group && !group->isVisible()) // && !group->isState(LLSpatialGroup::OBJECT_DIRTY)) @@ -716,7 +718,9 @@ void LLViewerPartSim::updateSimulation() if ((LLDrawable::getCurrentFrame()+mViewerPartGroups[i]->mID)%visirate == 0) { - if (vobj) + // FIRE-11593: Opensim "4096 Bug" Fix by Latif Khalifa + // mDrawable) { gPipeline.markRebuild(vobj->mDrawable, LLDrawable::REBUILD_ALL, TRUE); } diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index ab0944ae6d..d3dc8a1041 100755 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -396,6 +396,12 @@ LLViewerRegion::LLViewerRegion(const U64 &handle, // Create the object lists initStats(); +// FIRE-11593: Opensim "4096 Bug" Fix by Latif Khalifa + initPartitions(); +} +void LLViewerRegion::initPartitions() +{ +// //create object partitions //MUST MATCH declaration of eObjectPartitions @@ -412,6 +418,14 @@ LLViewerRegion::LLViewerRegion(const U64 &handle, mImpl->mObjectPartition.push_back(NULL); //PARTITION_NONE } +// FIRE-11593: Opensim "4096 Bug" Fix by Latif Khalifa +void LLViewerRegion::reInitPartitions() +{ + std::for_each(mImpl->mObjectPartition.begin(), mImpl->mObjectPartition.end(), DeletePointer()); + mImpl->mObjectPartition.clear(); + initPartitions(); +} +// void LLViewerRegion::initStats() { diff --git a/indra/newview/llviewerregion.h b/indra/newview/llviewerregion.h index 13073b4aeb..b3c9c25da7 100755 --- a/indra/newview/llviewerregion.h +++ b/indra/newview/llviewerregion.h @@ -388,10 +388,12 @@ public: }; void showReleaseNotes(); + void reInitPartitions(); // FIRE-11593: Opensim "4096 Bug" Fix by Latif Khalifa protected: void disconnectAllNeighbors(); void initStats(); + void initPartitions(); // FIRE-11593: Opensim "4096 Bug" Fix by Latif Khalifa public: LLWind mWind; From 75d7a2c16b01fa286f522ef1b85a068a807351a3 Mon Sep 17 00:00:00 2001 From: Cinders Date: Thu, 12 Sep 2013 21:30:12 -0600 Subject: [PATCH 3/3] Hardcode fullscreen mode OFF and hide the UI for it on mac until that's fixed. For now, users can use the native cocoa fullscreen mode --- indra/newview/llappviewer.cpp | 8 ++++++++ indra/newview/llfloaterpreference.cpp | 5 +++++ 2 files changed, 13 insertions(+) diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 0158b10edc..b690a2c292 100755 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -3553,7 +3553,15 @@ bool LLAppViewer::initWindow() .height(gSavedSettings.getU32("WindowHeight")) .min_width(gSavedSettings.getU32("MinWindowWidth")) .min_height(gSavedSettings.getU32("MinWindowHeight")) +/// Since the 3.6.5 merge, setting fullscreen does terrible bad things on macs like opening +/// all floaters and menus off the left side of the screen. Let's not do that right now... +/// Hardcoding full screen OFF until it's fixed. On 10.7+ we have native full screen support anyway. +#ifndef LL_DARWIN .fullscreen(gSavedSettings.getBOOL("FullScreen")) +#else // !LL_DARWIN + .fullscreen(false) +#endif LL_DARWIN +// .ignore_pixel_depth(ignorePixelDepth); gViewerWindow = new LLViewerWindow(window_params); diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index 9310570136..050635e2c7 100644 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -2744,6 +2744,11 @@ static LLRegisterPanelClassWrapper t_pref_privacy("pan BOOL LLPanelPreferenceGraphics::postBuild() { mButtonApply=findChild("Apply"); +// Hide this until we have fullscreen mode functional on OSX again +#ifdef LL_DARWIN + getChild("Fullscreen Mode")->setVisible(FALSE); +#endif // LL_DARWIN +// return LLPanelPreference::postBuild(); }