00001
00032 #include "llviewerprecompiledheaders.h"
00033
00034 #include "lldebugview.h"
00035
00036
00037 #include "llframestatview.h"
00038 #include "llfasttimerview.h"
00039 #include "llmemoryview.h"
00040 #include "llconsole.h"
00041 #include "lltextureview.h"
00042 #include "llresmgr.h"
00043 #include "imageids.h"
00044 #include "llvelocitybar.h"
00045 #include "llviewerwindow.h"
00046
00047
00048
00049
00050
00051 LLDebugView* gDebugView = NULL;
00052
00053
00054
00055
00056
00057 LLDebugView::LLDebugView(const std::string& name, const LLRect &rect)
00058 : LLView(name, rect, FALSE)
00059 {
00060 LLRect r;
00061
00062 r.set(0, rect.getHeight() - 100, rect.getWidth()/2, 100);
00063 mDebugConsolep = new LLConsole("debug console", 20, r, -1, 0.f );
00064 mDebugConsolep->setFollowsBottom();
00065 mDebugConsolep->setFollowsLeft();
00066 mDebugConsolep->setVisible( FALSE );
00067 addChild(mDebugConsolep);
00068
00069 r.set(150 - 25, rect.getHeight() - 50, rect.getWidth()/2 - 25, rect.getHeight() - 450);
00070 mFrameStatView = new LLFrameStatView("frame stat", r);
00071 mFrameStatView->setFollowsTop();
00072 mFrameStatView->setFollowsLeft();
00073 mFrameStatView->setVisible(FALSE);
00074 addChild(mFrameStatView);
00075
00076 r.set(25, rect.getHeight() - 50, (S32) (gViewerWindow->getVirtualWindowRect().getWidth() * 0.75f),
00077 (S32) (gViewerWindow->getVirtualWindowRect().getHeight() * 0.75f));
00078 mFastTimerView = new LLFastTimerView("fast timers", r);
00079 mFastTimerView->setFollowsTop();
00080 mFastTimerView->setFollowsLeft();
00081 mFastTimerView->setVisible(FALSE);
00082 addChild(mFastTimerView);
00083
00084 r.set(25, rect.getHeight() - 50, rect.getWidth()/2, rect.getHeight() - 450);
00085 mMemoryView = new LLMemoryView("memory", r);
00086 mMemoryView->setFollowsTop();
00087 mMemoryView->setFollowsLeft();
00088 mMemoryView->setVisible(FALSE);
00089 addChild(mMemoryView);
00090
00091 r.set(150, rect.getHeight() - 50, 820, 100);
00092 gTextureView = new LLTextureView("gTextureView", r);
00093 gTextureView->setRect(r);
00094 gTextureView->setFollowsBottom();
00095 gTextureView->setFollowsLeft();
00096 addChild(gTextureView);
00097
00098
00099
00100
00101
00102 r.set(rect.getWidth() - 250,
00103 rect.getHeight(),
00104 rect.getWidth(),
00105 rect.getHeight() - 400);
00106 mStatViewp = new LLContainerView("statistics", r);
00107 mStatViewp->setLabel("Statistics");
00108 mStatViewp->setFollowsTop();
00109 mStatViewp->setFollowsRight();
00110
00111 mStatViewp->setVisible(FALSE);
00112 addChild(mStatViewp);
00113
00114 const S32 VELOCITY_LEFT = 10;
00115 const S32 VELOCITY_WIDTH = 500;
00116 const S32 VELOCITY_TOP = 140;
00117 const S32 VELOCITY_HEIGHT = 45;
00118 r.setLeftTopAndSize( VELOCITY_LEFT, VELOCITY_TOP, VELOCITY_WIDTH, VELOCITY_HEIGHT );
00119 gVelocityBar = new LLVelocityBar("Velocity Bar", r);
00120 gVelocityBar->setFollowsBottom();
00121 gVelocityBar->setFollowsLeft();
00122 addChild(gVelocityBar);
00123 }
00124
00125
00126 LLDebugView::~LLDebugView()
00127 {
00128
00129 gDebugView = NULL;
00130 gTextureView = NULL;
00131 }
00132
00133 EWidgetType LLDebugView::getWidgetType() const
00134 {
00135 return WIDGET_TYPE_DEBUG_VIEW;
00136 }
00137
00138 LLString LLDebugView::getWidgetTag() const
00139 {
00140 return LL_DEBUG_VIEW_TAG;
00141 }
00142