summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
Diffstat (limited to 'indra')
-rw-r--r--indra/cmake/Variables.cmake2
-rw-r--r--indra/llrender/llgl.h63
-rw-r--r--indra/llrender/llglheaders.h5
-rwxr-xr-xindra/newview/llmeshrepository.cpp6
-rw-r--r--indra/newview/llmeshrepository.h3
-rw-r--r--indra/newview/llpanelobject.cpp47
-rw-r--r--indra/newview/llspatialpartition.cpp2
-rw-r--r--indra/newview/skins/default/xui/en/floater_tools.xml18
8 files changed, 119 insertions, 27 deletions
diff --git a/indra/cmake/Variables.cmake b/indra/cmake/Variables.cmake
index c543710d6c..bc517cde49 100644
--- a/indra/cmake/Variables.cmake
+++ b/indra/cmake/Variables.cmake
@@ -88,7 +88,7 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
if (NOT CMAKE_OSX_DEPLOYMENT_TARGET)
# NOTE: setting -isysroot is NOT adequate: http://lists.apple.com/archives/Xcode-users/2007/Oct/msg00696.html
# see http://public.kitware.com/Bug/view.php?id=9959 + poppy
- set(CMAKE_OSX_SYSROOT /Developer/SDKs/MacOSX10.6.sdk)
+ set(CMAKE_OSX_SYSROOT /Developer/SDKs/MacOSX10.5.sdk)
set(CMAKE_OSX_DEPLOYMENT_TARGET 10.4)
endif (NOT CMAKE_OSX_DEPLOYMENT_TARGET)
diff --git a/indra/llrender/llgl.h b/indra/llrender/llgl.h
index b152bd0c3c..4630811679 100644
--- a/indra/llrender/llgl.h
+++ b/indra/llrender/llgl.h
@@ -417,4 +417,67 @@ extern BOOL gClothRipple;
extern BOOL gNoRender;
extern BOOL gGLActive;
+// Deal with changing glext.h definitions for newer SDK versions, specifically
+// with MAC OSX 10.5 -> 10.6
+
+
+#ifndef GL_DEPTH_ATTACHMENT
+#define GL_DEPTH_ATTACHMENT GL_DEPTH_ATTACHMENT_EXT
+#endif
+
+#ifndef GL_STENCIL_ATTACHMENT
+#define GL_STENCIL_ATTACHMENT GL_STENCIL_ATTACHMENT_EXT
+#endif
+
+#ifndef GL_FRAMEBUFFER
+#define GL_FRAMEBUFFER GL_FRAMEBUFFER_EXT
+#define GL_DRAW_FRAMEBUFFER GL_DRAW_FRAMEBUFFER_EXT
+#define GL_READ_FRAMEBUFFER GL_READ_FRAMEBUFFER_EXT
+#define GL_FRAMEBUFFER_COMPLETE GL_FRAMEBUFFER_COMPLETE_EXT
+#define GL_FRAMEBUFFER_UNSUPPORTED GL_FRAMEBUFFER_UNSUPPORTED_EXT
+#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT
+#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT
+#define glGenFramebuffers glGenFramebuffersEXT
+#define glBindFramebuffer glBindFramebufferEXT
+#define glCheckFramebufferStatus glCheckFramebufferStatusEXT
+#define glBlitFramebuffer glBlitFramebufferEXT
+#define glDeleteFramebuffers glDeleteFramebuffersEXT
+#define glFramebufferRenderbuffer glFramebufferRenderbufferEXT
+#define glFramebufferTexture2D glFramebufferTexture2DEXT
+#endif
+
+#ifndef GL_RENDERBUFFER
+#define GL_RENDERBUFFER GL_RENDERBUFFER_EXT
+#define glGenRenderbuffers glGenRenderbuffersEXT
+#define glBindRenderbuffer glBindRenderbufferEXT
+#define glRenderbufferStorage glRenderbufferStorageEXT
+#define glRenderbufferStorageMultisample glRenderbufferStorageMultisampleEXT
+#define glDeleteRenderbuffers glDeleteRenderbuffersEXT
+#endif
+
+#ifndef GL_COLOR_ATTACHMENT
+#define GL_COLOR_ATTACHMENT GL_COLOR_ATTACHMENT_EXT
+#endif
+
+#ifndef GL_COLOR_ATTACHMENT0
+#define GL_COLOR_ATTACHMENT0 GL_COLOR_ATTACHMENT0_EXT
+#endif
+
+#ifndef GL_COLOR_ATTACHMENT1
+#define GL_COLOR_ATTACHMENT1 GL_COLOR_ATTACHMENT1_EXT
+#endif
+
+#ifndef GL_COLOR_ATTACHMENT2
+#define GL_COLOR_ATTACHMENT2 GL_COLOR_ATTACHMENT2_EXT
+#endif
+
+#ifndef GL_COLOR_ATTACHMENT3
+#define GL_COLOR_ATTACHMENT3 GL_COLOR_ATTACHMENT3_EXT
+#endif
+
+
+#ifndef GL_DEPTH24_STENCIL8
+#define GL_DEPTH24_STENCIL8 GL_DEPTH24_STENCIL8_EXT
+#endif
+
#endif // LL_LLGL_H
diff --git a/indra/llrender/llglheaders.h b/indra/llrender/llglheaders.h
index 1f77897a56..46bc282436 100644
--- a/indra/llrender/llglheaders.h
+++ b/indra/llrender/llglheaders.h
@@ -691,7 +691,7 @@ extern PFNGLDRAWBUFFERSARBPROC glDrawBuffersARB;
#include <AvailabilityMacros.h>
//GL_EXT_blend_func_separate
-extern void glBlendFuncSeparateEXT(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
+extern void glBlendFuncSeparateEXT(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha) ;
// GL_EXT_framebuffer_object
extern GLboolean glIsRenderbufferEXT(GLuint renderbuffer) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
@@ -712,6 +712,9 @@ extern void glFramebufferRenderbufferEXT(GLenum target, GLenum attachment, GLenu
extern void glGetFramebufferAttachmentParameterivEXT(GLenum target, GLenum attachment, GLenum pname, GLint *params) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
extern void glGenerateMipmapEXT(GLenum target) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
+#ifndef GL_ARB_framebuffer_object
+#define glGenerateMipmap glGenerateMipmapEXT
+#endif
// GL_ARB_draw_buffers
extern void glDrawBuffersARB(GLsizei n, const GLenum* bufs) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp
index 6d117c8c39..0ee0d8393e 100755
--- a/indra/newview/llmeshrepository.cpp
+++ b/indra/newview/llmeshrepository.cpp
@@ -2622,6 +2622,12 @@ void LLMeshRepository::buildHull(const LLVolumeParams& params, S32 detail)
LLPrimitive::sVolumeManager->unrefVolume(volume);
}
+bool LLMeshRepository::hasPhysicsShape(const LLUUID& mesh_id)
+{
+ LLSD mesh = mThread->getMeshHeader(mesh_id);
+ return mesh.has("physics_shape") && mesh["physics_shape"].has("size") && (mesh["physics_shape"]["size"].asInteger() > 0);
+}
+
const LLSD& LLMeshRepository::getMeshHeader(const LLUUID& mesh_id)
{
return mThread->getMeshHeader(mesh_id);
diff --git a/indra/newview/llmeshrepository.h b/indra/newview/llmeshrepository.h
index df00c6c7aa..8687ac750b 100644
--- a/indra/newview/llmeshrepository.h
+++ b/indra/newview/llmeshrepository.h
@@ -458,7 +458,8 @@ public:
const LLMeshSkinInfo* getSkinInfo(const LLUUID& mesh_id);
const LLMeshDecomposition* getDecomposition(const LLUUID& mesh_id);
void fetchPhysicsShape(const LLUUID& mesh_id);
-
+ bool hasPhysicsShape(const LLUUID& mesh_id);
+
void buildHull(const LLVolumeParams& params, S32 detail);
const LLSD& getMeshHeader(const LLUUID& mesh_id);
diff --git a/indra/newview/llpanelobject.cpp b/indra/newview/llpanelobject.cpp
index d02f3ef37a..5c9367e6f6 100644
--- a/indra/newview/llpanelobject.cpp
+++ b/indra/newview/llpanelobject.cpp
@@ -67,6 +67,7 @@
#include "pipeline.h"
#include "llviewercontrol.h"
#include "lluictrlfactory.h"
+#include "llmeshrepository.h"
//#include "llfirstuse.h"
#include "lldrawpool.h"
@@ -539,8 +540,6 @@ void LLPanelObject::getState( )
mCheckPhantom->set( mIsPhantom );
mCheckPhantom->setEnabled( roots_selected>0 && editable && !is_flexible );
- mComboPhysicsShapeType->setCurrentByIndex(objectp->getPhysicsShapeType());
- mComboPhysicsShapeType->setEnabled(editable);
mSpinPhysicsGravity->set(objectp->getPhysicsGravity());
mSpinPhysicsGravity->setEnabled(editable);
@@ -604,6 +603,7 @@ void LLPanelObject::getState( )
BOOL enabled = FALSE;
BOOL hole_enabled = FALSE;
F32 scale_x=1.f, scale_y=1.f;
+ BOOL isMesh = FALSE;
if( !objectp || !objectp->getVolume() || !editable || !single_volume)
{
@@ -634,10 +634,9 @@ void LLPanelObject::getState( )
// Only allowed to change these parameters for objects
// that you have permissions on AND are not attachments.
enabled = root_objectp->permModify();
-
- const LLVolumeParams &volume_params = objectp->getVolume()->getParams();
-
+
// Volume type
+ const LLVolumeParams &volume_params = objectp->getVolume()->getParams();
U8 path = volume_params.getPathParams().getCurveType();
U8 profile_and_hole = volume_params.getProfileParams().getCurveType();
U8 profile = profile_and_hole & LL_PCODE_PROFILE_MASK;
@@ -868,7 +867,7 @@ void LLPanelObject::getState( )
}
mSpinSkew->set( skew );
}
-
+
// Compute control visibility, label names, and twist range.
// Start with defaults.
BOOL cut_visible = TRUE;
@@ -1132,6 +1131,10 @@ void LLPanelObject::getState( )
mCtrlSculptInvert->setVisible(sculpt_texture_visible);
+ // update the physics shape combo to include allowed physics shapes
+ mComboPhysicsShapeType->removeall();
+ mComboPhysicsShapeType->add(getString("None"), LLSD(1));
+
// sculpt texture
if (selected_item == MI_SCULPT)
@@ -1163,6 +1166,7 @@ void LLPanelObject::getState( )
U8 sculpt_stitching = sculpt_type & LL_SCULPT_TYPE_MASK;
BOOL sculpt_invert = sculpt_type & LL_SCULPT_FLAG_INVERT;
BOOL sculpt_mirror = sculpt_type & LL_SCULPT_FLAG_MIRROR;
+ isMesh = (sculpt_stitching == LL_SCULPT_TYPE_MESH);
if (mCtrlSculptType)
{
@@ -1179,20 +1183,43 @@ void LLPanelObject::getState( )
if (mCtrlSculptInvert)
{
mCtrlSculptInvert->set(sculpt_invert);
- mCtrlSculptInvert->setEnabled(editable && (sculpt_stitching != LL_SCULPT_TYPE_MESH));
+ mCtrlSculptInvert->setEnabled(editable && (!isMesh));
}
if (mLabelSculptType)
{
mLabelSculptType->setEnabled(TRUE);
}
+
}
}
else
{
- mSculptTextureRevert = LLUUID::null;
+ mSculptTextureRevert = LLUUID::null;
}
+ if(isMesh && objectp)
+ {
+ const LLVolumeParams &volume_params = objectp->getVolume()->getParams();
+ LLUUID mesh_id = volume_params.getSculptID();
+ if(gMeshRepo.hasPhysicsShape(mesh_id))
+ {
+ // if a mesh contains an uploaded or decomposed physics mesh,
+ // allow 'Prim'
+ mComboPhysicsShapeType->add(getString("Prim"), LLSD(0));
+ }
+ // meshes always allow convex hull
+ mComboPhysicsShapeType->add(getString("Convex Hull"), LLSD(2));
+ }
+ else
+ {
+ // simple prims always allow physics shape prim
+ mComboPhysicsShapeType->add(getString("Prim"), LLSD(0));
+ }
+
+ mComboPhysicsShapeType->setValue(LLSD(objectp->getPhysicsShapeType()));
+ mComboPhysicsShapeType->setEnabled(editable);
+
//----------------------------------------------------------------------------
@@ -1268,7 +1295,9 @@ public:
void LLPanelObject::sendPhysicsParam()
{
- U8 type = (U8)mComboPhysicsShapeType->getCurrentIndex();
+ LLSD physicsType = mComboPhysicsShapeType->getValue();
+
+ U8 type = physicsType.asInteger();
F32 gravity = mSpinPhysicsGravity->get();
F32 friction = mSpinPhysicsFriction->get();
F32 density = mSpinPhysicsDensity->get();
diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp
index bd6be14341..6b77209867 100644
--- a/indra/newview/llspatialpartition.cpp
+++ b/indra/newview/llspatialpartition.cpp
@@ -2900,7 +2900,7 @@ void renderPhysicsShape(LLDrawable* drawable, LLVOVolume* volume)
LLVolumeParams volume_params = volume->getVolume()->getParams();
- LLPhysicsVolumeParams physics_params(volume->getVolume()->getParams(),
+ LLPhysicsVolumeParams physics_params(volume_params,
physics_type == LLViewerObject::PHYSICS_SHAPE_CONVEX_HULL);
LLPhysicsShapeBuilderUtil::PhysicsShapeSpecification physics_spec;
diff --git a/indra/newview/skins/default/xui/en/floater_tools.xml b/indra/newview/skins/default/xui/en/floater_tools.xml
index a263afe2a2..1554ae390f 100644
--- a/indra/newview/skins/default/xui/en/floater_tools.xml
+++ b/indra/newview/skins/default/xui/en/floater_tools.xml
@@ -1291,6 +1291,9 @@ even though the user gets a free copy.
name="Object"
top="16"
width="295">
+ <panel.string name="None">None</panel.string>
+ <panel.string name="Prim">Prim</panel.string>
+ <panel.string name="Convex Hull">Convex Hull</panel.string>
<check_box
height="19"
label="Locked"
@@ -1516,20 +1519,7 @@ even though the user gets a free copy.
name="Physics Shape Type Combo Ctrl"
tool_tip="Choose the physics shape type"
left_pad="0"
- width="108">
- <combo_box.item
- label="Prim"
- name="Prim"
- value="Prim" />
- <combo_box.item
- label="None"
- name="None"
- value="None" />
- <combo_box.item
- label="Convex Hull"
- name="Convex Hull"
- value="Convex Hull" />
- </combo_box>
+ width="108"/>
<spinner
follows="left|top"