summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorNyx Linden <nyx@lindenlab.com>2010-10-07 18:49:07 -0400
committerNyx Linden <nyx@lindenlab.com>2010-10-07 18:49:07 -0400
commitaa401a3056ab65c5c206b9ba2eefcf2ef83a6d83 (patch)
tree01a9708b07ede9528154c2238f2de884486df0ca /indra/newview
parent1b7b05eeb9fc085471ebb64cf237d6d49e0b13bc (diff)
BUILDFIX: viewer-mesh mac build
xcode didn't like the way we were defining inner classes and assuming that if the outer class was a friend that the inner class would be too. Couldn't forward-declare the inner class so had to re-arrange the order of class declaration. Between re-ordering the class declarations, and explicitly making the inner class a friend, this un-sticks the mac build, and makes it happy. Code reviewed by davep.
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llfloatermodelpreview.h208
1 files changed, 105 insertions, 103 deletions
diff --git a/indra/newview/llfloatermodelpreview.h b/indra/newview/llfloatermodelpreview.h
index 7be32663f4..417e207368 100644
--- a/indra/newview/llfloatermodelpreview.h
+++ b/indra/newview/llfloatermodelpreview.h
@@ -111,134 +111,54 @@ public:
std::map<std::string, std::string> mJointMap;
};
-class LLModelPreview : public LLViewerDynamicTexture, public LLMutex
-{
- public:
-
- LLModelPreview(S32 width, S32 height, LLFloaterModelPreview* fmp);
- virtual ~LLModelPreview();
-
- void resetPreviewTarget();
- void setPreviewTarget(F32 distance);
- void setTexture(U32 name) { mTextureName = name; }
-
- BOOL render();
- void update();
- void genBuffers(S32 lod, bool skinned);
- void clearBuffers();
- void refresh();
- void rotate(F32 yaw_radians, F32 pitch_radians);
- void zoom(F32 zoom_amt);
- void pan(F32 right, F32 up);
- virtual BOOL needsRender() { return mNeedsUpdate; }
- void setPreviewLOD(S32 lod);
- void clearModel(S32 lod);
- void loadModel(std::string filename, S32 lod);
- void loadModelCallback(S32 lod);
- void genLODs(S32 which_lod = -1);
- void smoothNormals();
- void consolidate();
- void scrubMaterials();
- U32 calcResourceCost();
- void rebuildUploadData();
- void clearIncompatible(S32 lod);
- void updateStatusMessages();
- bool containsRiggedAsset( void );
-
- static void textureLoadedCallback( BOOL success, LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* src_aux, S32 discard_level, BOOL final, void* userdata );
-
- protected:
- friend class LLFloaterModelPreview;
- friend class LLPhysicsDecomp;
-
- LLFloaterModelPreview* mFMP;
-
- BOOL mNeedsUpdate;
- bool mDirty;
- U32 mTextureName;
- F32 mCameraDistance;
- F32 mCameraYaw;
- F32 mCameraPitch;
- F32 mCameraZoom;
- LLVector3 mCameraOffset;
- LLVector3 mPreviewTarget;
- LLVector3 mPreviewScale;
- S32 mPreviewLOD;
- U32 mResourceCost;
- S32 mLODMode[LLModel::NUM_LODS];
- S32 mLimit[LLModel::NUM_LODS];
-
- LLModelLoader* mModelLoader;
-
-
- LLModelLoader::scene mScene[LLModel::NUM_LODS];
- LLModelLoader::scene mBaseScene;
-
- LLModelLoader::model_list mModel[LLModel::NUM_LODS];
- LLModelLoader::model_list mBaseModel;
-
- std::map<LLPointer<LLModel>, U32> mGroup;
- std::map<LLPointer<LLModel>, U32> mObject;
- std::map<LLPointer<LLModel>, std::vector<U32> > mPatch;
- std::map<LLPointer<LLModel>, F32> mPercentage;
-
- std::map<LLPointer<LLModel>, std::vector<LLPointer<LLVertexBuffer> > > mPhysicsMesh;
-
- LLMeshUploadThread::instance_list mUploadData;
- std::set<LLPointer<LLViewerFetchedTexture> > mTextureSet;
-
- //map of vertex buffers to models (one vertex buffer in vector per face in model
- std::map<LLModel*, std::vector<LLPointer<LLVertexBuffer> > > mVertexBuffer[LLModel::NUM_LODS+1];
-};
-
class LLFloaterModelPreview : public LLFloater
{
public:
-
+
class DecompRequest : public LLPhysicsDecomp::Request
{
public:
S32 mContinue;
LLPointer<LLModel> mModel;
-
+
DecompRequest(const std::string& stage, LLModel* mdl);
virtual S32 statusCallback(const char* status, S32 p1, S32 p2);
virtual void completed();
-
+
};
static LLFloaterModelPreview* sInstance;
-
+
LLFloaterModelPreview(const LLSD& key);
virtual ~LLFloaterModelPreview();
-
+
virtual BOOL postBuild();
BOOL handleMouseDown(S32 x, S32 y, MASK mask);
BOOL handleMouseUp(S32 x, S32 y, MASK mask);
BOOL handleHover(S32 x, S32 y, MASK mask);
BOOL handleScrollWheel(S32 x, S32 y, S32 clicks);
-
+
static void onMouseCaptureLostModelPreview(LLMouseHandler*);
static void setUploadAmount(S32 amount) { sUploadAmount = amount; }
-
+
static void onBrowseHighLOD(void* data);
static void onBrowseMediumLOD(void* data);
static void onBrowseLowLOD(void* data);
static void onBrowseLowestLOD(void* data);
-
+
static void onUpload(void* data);
-
+
static void onConsolidate(void* data);
static void onScrubMaterials(void* data);
static void onDecompose(void* data);
static void onModelDecompositionComplete(LLModel* model, std::vector<LLPointer<LLVertexBuffer> >& physics_mesh);
-
+
static void refresh(LLUICtrl* ctrl, void* data);
-
+
void updateResourceCost();
-
+
void loadModel(S32 lod);
-
+
protected:
friend class LLModelPreview;
friend class LLMeshFilePicker;
@@ -256,7 +176,7 @@ protected:
static void onLowLODCommit(LLUICtrl*,void*);
static void onLowestLODCommit(LLUICtrl*,void*);
static void onPhysicsLODCommit(LLUICtrl*,void*);
-
+
static void onHighLimitCommit(LLUICtrl*,void*);
static void onMediumLimitCommit(LLUICtrl*,void*);
static void onLowLimitCommit(LLUICtrl*,void*);
@@ -264,41 +184,123 @@ protected:
static void onPhysicsLimitCommit(LLUICtrl*,void*);
static void onSmoothNormalsCommit(LLUICtrl*,void*);
-
+
static void onAutoFillCommit(LLUICtrl*,void*);
static void onShowEdgesCommit(LLUICtrl*,void*);
-
+
static void onExplodeCommit(LLUICtrl*, void*);
-
+
static void onPhysicsParamCommit(LLUICtrl* ctrl, void* userdata);
static void onPhysicsStageExecute(LLUICtrl* ctrl, void* userdata);
static void onPhysicsStageCancel(LLUICtrl* ctrl, void* userdata);
static void onClosePhysicsFloater(LLUICtrl* ctrl, void* userdata);
-
+
void draw();
static void setLODMode(S32 lod, void* userdata);
void setLODMode(S32 lod, S32 which_mode);
-
+
static void setLimit(S32 lod, void* userdata);
void setLimit(S32 lod, S32 limit);
-
+
void showDecompFloater();
LLModelPreview* mModelPreview;
-
+
LLFloater* mDecompFloater;
LLPhysicsDecomp::decomp_params mDecompParams;
-
+
S32 mLastMouseX;
S32 mLastMouseY;
LLRect mPreviewRect;
U32 mGLName;
BOOL mLoading;
static S32 sUploadAmount;
-
+
LLPointer<DecompRequest> mCurRequest;
+
+};
+
+class LLModelPreview : public LLViewerDynamicTexture, public LLMutex
+{
+ public:
+
+ LLModelPreview(S32 width, S32 height, LLFloaterModelPreview* fmp);
+ virtual ~LLModelPreview();
+
+ void resetPreviewTarget();
+ void setPreviewTarget(F32 distance);
+ void setTexture(U32 name) { mTextureName = name; }
+
+ BOOL render();
+ void update();
+ void genBuffers(S32 lod, bool skinned);
+ void clearBuffers();
+ void refresh();
+ void rotate(F32 yaw_radians, F32 pitch_radians);
+ void zoom(F32 zoom_amt);
+ void pan(F32 right, F32 up);
+ virtual BOOL needsRender() { return mNeedsUpdate; }
+ void setPreviewLOD(S32 lod);
+ void clearModel(S32 lod);
+ void loadModel(std::string filename, S32 lod);
+ void loadModelCallback(S32 lod);
+ void genLODs(S32 which_lod = -1);
+ void smoothNormals();
+ void consolidate();
+ void scrubMaterials();
+ U32 calcResourceCost();
+ void rebuildUploadData();
+ void clearIncompatible(S32 lod);
+ void updateStatusMessages();
+ bool containsRiggedAsset( void );
+
+ static void textureLoadedCallback( BOOL success, LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* src_aux, S32 discard_level, BOOL final, void* userdata );
+
+ protected:
+ friend class LLFloaterModelPreview;
+ friend class LLFloaterModelPreview::DecompRequest;
+ friend class LLPhysicsDecomp;
+
+ LLFloaterModelPreview* mFMP;
+
+ BOOL mNeedsUpdate;
+ bool mDirty;
+ U32 mTextureName;
+ F32 mCameraDistance;
+ F32 mCameraYaw;
+ F32 mCameraPitch;
+ F32 mCameraZoom;
+ LLVector3 mCameraOffset;
+ LLVector3 mPreviewTarget;
+ LLVector3 mPreviewScale;
+ S32 mPreviewLOD;
+ U32 mResourceCost;
+ S32 mLODMode[LLModel::NUM_LODS];
+ S32 mLimit[LLModel::NUM_LODS];
+
+ LLModelLoader* mModelLoader;
+
+ LLModelLoader::scene mScene[LLModel::NUM_LODS];
+ LLModelLoader::scene mBaseScene;
+
+ LLModelLoader::model_list mModel[LLModel::NUM_LODS];
+ LLModelLoader::model_list mBaseModel;
+
+ std::map<LLPointer<LLModel>, U32> mGroup;
+ std::map<LLPointer<LLModel>, U32> mObject;
+ std::map<LLPointer<LLModel>, std::vector<U32> > mPatch;
+ std::map<LLPointer<LLModel>, F32> mPercentage;
+
+ std::map<LLPointer<LLModel>, std::vector<LLPointer<LLVertexBuffer> > > mPhysicsMesh;
+
+ LLMeshUploadThread::instance_list mUploadData;
+ std::set<LLPointer<LLViewerFetchedTexture> > mTextureSet;
+
+ //map of vertex buffers to models (one vertex buffer in vector per face in model
+ std::map<LLModel*, std::vector<LLPointer<LLVertexBuffer> > > mVertexBuffer[LLModel::NUM_LODS+1];
};
+
#endif // LL_LLFLOATERMODELPREVIEW_H