summaryrefslogtreecommitdiff
path: root/indra/newview/llviewermenu.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llviewermenu.cpp')
-rw-r--r--indra/newview/llviewermenu.cpp90
1 files changed, 13 insertions, 77 deletions
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp
index 40bf62acc9..23e502c76f 100644
--- a/indra/newview/llviewermenu.cpp
+++ b/indra/newview/llviewermenu.cpp
@@ -1083,8 +1083,6 @@ class LLAdvancedToggleWireframe : public view_listener_t
bool handleEvent(const LLSD& userdata)
{
gUseWireframe = !(gUseWireframe);
- LLPipeline::updateRenderDeferred();
- gPipeline.resetVertexBuffers();
return true;
}
};
@@ -2056,9 +2054,9 @@ class LLAdvancedEnableRenderDeferred: public view_listener_t
};
/////////////////////////////////////
-// Enable Deferred Rendering sub-options
+// Enable Global Illumination ///
/////////////////////////////////////
-class LLAdvancedEnableRenderDeferredOptions: public view_listener_t
+class LLAdvancedEnableRenderDeferredGI: public view_listener_t
{
bool handleEvent(const LLSD& userdata)
{
@@ -5854,7 +5852,6 @@ void handle_buy_land()
class LLObjectAttachToAvatar : public view_listener_t
{
public:
- LLObjectAttachToAvatar(bool replace) : mReplace(replace) {}
static void setObjectSelection(LLObjectSelectionHandle selection) { sObjectSelection = selection; }
private:
@@ -5868,38 +5865,22 @@ private:
LLViewerJointAttachment* attachment_point = NULL;
if (index > 0)
attachment_point = get_if_there(gAgentAvatarp->mAttachmentPoints, index, (LLViewerJointAttachment*)NULL);
- confirmReplaceAttachment(0, attachment_point);
+ confirm_replace_attachment(0, attachment_point);
}
return true;
}
- static void onNearAttachObject(BOOL success, void *user_data);
- void confirmReplaceAttachment(S32 option, LLViewerJointAttachment* attachment_point);
-
- struct CallbackData
- {
- CallbackData(LLViewerJointAttachment* point, bool replace) : mAttachmentPoint(point), mReplace(replace) {}
-
- LLViewerJointAttachment* mAttachmentPoint;
- bool mReplace;
- };
-
protected:
static LLObjectSelectionHandle sObjectSelection;
- bool mReplace;
};
LLObjectSelectionHandle LLObjectAttachToAvatar::sObjectSelection;
-// static
-void LLObjectAttachToAvatar::onNearAttachObject(BOOL success, void *user_data)
+void near_attach_object(BOOL success, void *user_data)
{
- if (!user_data) return;
- CallbackData* cb_data = static_cast<CallbackData*>(user_data);
-
if (success)
{
- const LLViewerJointAttachment *attachment = cb_data->mAttachmentPoint;
+ const LLViewerJointAttachment *attachment = (LLViewerJointAttachment *)user_data;
U8 attachment_id = 0;
if (attachment)
@@ -5919,15 +5900,12 @@ void LLObjectAttachToAvatar::onNearAttachObject(BOOL success, void *user_data)
// interpret 0 as "default location"
attachment_id = 0;
}
- LLSelectMgr::getInstance()->sendAttach(attachment_id, cb_data->mReplace);
+ LLSelectMgr::getInstance()->sendAttach(attachment_id);
}
LLObjectAttachToAvatar::setObjectSelection(NULL);
-
- delete cb_data;
}
-// static
-void LLObjectAttachToAvatar::confirmReplaceAttachment(S32 option, LLViewerJointAttachment* attachment_point)
+void confirm_replace_attachment(S32 option, void* user_data)
{
if (option == 0/*YES*/)
{
@@ -5952,9 +5930,7 @@ void LLObjectAttachToAvatar::confirmReplaceAttachment(S32 option, LLViewerJointA
delta = delta * 0.5f;
walkToSpot -= delta;
- // The callback will be called even if avatar fails to get close enough to the object, so we won't get a memory leak.
- CallbackData* user_data = new CallbackData(attachment_point, mReplace);
- gAgent.startAutoPilotGlobal(gAgent.getPosGlobalFromAgent(walkToSpot), "Attach", NULL, onNearAttachObject, user_data, stop_distance);
+ gAgent.startAutoPilotGlobal(gAgent.getPosGlobalFromAgent(walkToSpot), "Attach", NULL, near_attach_object, user_data, stop_distance);
gAgentCamera.clearFocusObject();
}
}
@@ -6558,7 +6534,7 @@ void handle_dump_attachments(void*)
}
-// these are used in the gl menus to set control values, generically.
+// these are used in the gl menus to set control values.
class LLToggleControl : public view_listener_t
{
bool handleEvent(const LLSD& userdata)
@@ -6577,44 +6553,8 @@ class LLCheckControl : public view_listener_t
std::string callback_data = userdata.asString();
bool new_value = gSavedSettings.getBOOL(callback_data);
return new_value;
- }
-};
-
-// not so generic
-
-class LLAdvancedCheckRenderShadowOption: public view_listener_t
-{
- bool handleEvent(const LLSD& userdata)
- {
- std::string control_name = userdata.asString();
- S32 current_shadow_level = gSavedSettings.getS32(control_name);
- if (current_shadow_level == 0) // is off
- {
- return false;
- }
- else // is on
- {
- return true;
- }
- }
-};
+}
-class LLAdvancedClickRenderShadowOption: public view_listener_t
-{
- bool handleEvent(const LLSD& userdata)
- {
- std::string control_name = userdata.asString();
- S32 current_shadow_level = gSavedSettings.getS32(control_name);
- if (current_shadow_level == 0) // upgrade to level 2
- {
- gSavedSettings.setS32(control_name, 2);
- }
- else // downgrade to level 0
- {
- gSavedSettings.setS32(control_name, 0);
- }
- return true;
- }
};
void menu_toggle_attached_lights(void* user_data)
@@ -7939,7 +7879,7 @@ void initialize_menus()
// Help menu
// most items use the ShowFloater method
- // Advanced menu
+ // Advance menu
view_listener_t::addMenu(new LLAdvancedToggleConsole(), "Advanced.ToggleConsole");
view_listener_t::addMenu(new LLAdvancedCheckConsole(), "Advanced.CheckConsole");
view_listener_t::addMenu(new LLAdvancedDumpInfoToConsole(), "Advanced.DumpInfoToConsole");
@@ -7966,13 +7906,12 @@ void initialize_menus()
view_listener_t::addMenu(new LLAdvancedSelectedTextureInfo(), "Advanced.SelectedTextureInfo");
view_listener_t::addMenu(new LLAdvancedToggleWireframe(), "Advanced.ToggleWireframe");
view_listener_t::addMenu(new LLAdvancedCheckWireframe(), "Advanced.CheckWireframe");
- // Develop > Render
view_listener_t::addMenu(new LLAdvancedToggleTextureAtlas(), "Advanced.ToggleTextureAtlas");
view_listener_t::addMenu(new LLAdvancedCheckTextureAtlas(), "Advanced.CheckTextureAtlas");
view_listener_t::addMenu(new LLAdvancedEnableObjectObjectOcclusion(), "Advanced.EnableObjectObjectOcclusion");
view_listener_t::addMenu(new LLAdvancedEnableRenderFBO(), "Advanced.EnableRenderFBO");
view_listener_t::addMenu(new LLAdvancedEnableRenderDeferred(), "Advanced.EnableRenderDeferred");
- view_listener_t::addMenu(new LLAdvancedEnableRenderDeferredOptions(), "Advanced.EnableRenderDeferredOptions");
+ view_listener_t::addMenu(new LLAdvancedEnableRenderDeferredGI(), "Advanced.EnableRenderDeferredGI");
view_listener_t::addMenu(new LLAdvancedToggleRandomizeFramerate(), "Advanced.ToggleRandomizeFramerate");
view_listener_t::addMenu(new LLAdvancedCheckRandomizeFramerate(), "Advanced.CheckRandomizeFramerate");
view_listener_t::addMenu(new LLAdvancedTogglePeriodicSlowFrame(), "Advanced.TogglePeriodicSlowFrame");
@@ -7981,8 +7920,6 @@ void initialize_menus()
view_listener_t::addMenu(new LLAdvancedToggleFrameTest(), "Advanced.ToggleFrameTest");
view_listener_t::addMenu(new LLAdvancedCheckFrameTest(), "Advanced.CheckFrameTest");
view_listener_t::addMenu(new LLAdvancedHandleAttachedLightParticles(), "Advanced.HandleAttachedLightParticles");
- view_listener_t::addMenu(new LLAdvancedCheckRenderShadowOption(), "Advanced.CheckRenderShadowOption");
- view_listener_t::addMenu(new LLAdvancedClickRenderShadowOption(), "Advanced.ClickRenderShadowOption");
#ifdef TOGGLE_HACKED_GODLIKE_VIEWER
@@ -8139,8 +8076,7 @@ void initialize_menus()
commit.add("Object.Touch", boost::bind(&handle_object_touch));
commit.add("Object.SitOrStand", boost::bind(&handle_object_sit_or_stand));
commit.add("Object.Delete", boost::bind(&handle_object_delete));
- view_listener_t::addMenu(new LLObjectAttachToAvatar(true), "Object.AttachToAvatar");
- view_listener_t::addMenu(new LLObjectAttachToAvatar(false), "Object.AttachAddToAvatar");
+ view_listener_t::addMenu(new LLObjectAttachToAvatar(), "Object.AttachToAvatar");
view_listener_t::addMenu(new LLObjectReturn(), "Object.Return");
view_listener_t::addMenu(new LLObjectReportAbuse(), "Object.ReportAbuse");
view_listener_t::addMenu(new LLObjectMute(), "Object.Mute");