aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/lldebugview.cpp
diff options
context:
space:
mode:
authorJacek Antonelli2008-08-15 23:44:46 -0500
committerJacek Antonelli2008-08-15 23:44:46 -0500
commit38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4 (patch)
treeadca584755d22ca041a2dbfc35d4eca01f70b32c /linden/indra/newview/lldebugview.cpp
parentREADME.txt (diff)
downloadmeta-impy-38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4.zip
meta-impy-38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4.tar.gz
meta-impy-38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4.tar.bz2
meta-impy-38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4.tar.xz
Second Life viewer sources 1.13.2.12
Diffstat (limited to '')
-rw-r--r--linden/indra/newview/lldebugview.cpp152
1 files changed, 152 insertions, 0 deletions
diff --git a/linden/indra/newview/lldebugview.cpp b/linden/indra/newview/lldebugview.cpp
new file mode 100644
index 0000000..871afb7
--- /dev/null
+++ b/linden/indra/newview/lldebugview.cpp
@@ -0,0 +1,152 @@
1/**
2 * @file lldebugview.cpp
3 * @brief A view containing UI elements only visible in build mode.
4 *
5 * Copyright (c) 2001-2007, Linden Research, Inc.
6 *
7 * The source code in this file ("Source Code") is provided by Linden Lab
8 * to you under the terms of the GNU General Public License, version 2.0
9 * ("GPL"), unless you have obtained a separate licensing agreement
10 * ("Other License"), formally executed by you and Linden Lab. Terms of
11 * the GPL can be found in doc/GPL-license.txt in this distribution, or
12 * online at http://secondlife.com/developers/opensource/gplv2
13 *
14 * There are special exceptions to the terms and conditions of the GPL as
15 * it is applied to this Source Code. View the full text of the exception
16 * in the file doc/FLOSS-exception.txt in this software distribution, or
17 * online at http://secondlife.com/developers/opensource/flossexception
18 *
19 * By copying, modifying or distributing this software, you acknowledge
20 * that you have read and understood your obligations described above,
21 * and agree to abide by those obligations.
22 *
23 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
24 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
25 * COMPLETENESS OR PERFORMANCE.
26 */
27
28#include "llviewerprecompiledheaders.h"
29
30#include "lldebugview.h"
31
32// library includes
33#include "llframestatview.h"
34#include "llfasttimerview.h"
35#include "llmemoryview.h"
36#include "llconsole.h"
37#include "lltextureview.h"
38#include "llresmgr.h"
39#include "llaudiostatus.h"
40#include "imageids.h"
41#include "llvelocitybar.h"
42#include "llviewerwindow.h"
43
44//
45// Globals
46//
47
48LLDebugView* gDebugView = NULL;
49
50//
51// Methods
52//
53
54LLDebugView::LLDebugView(const std::string& name, const LLRect &rect)
55: LLView(name, rect, FALSE)
56{
57 LLRect r;
58
59 r.set(0, rect.getHeight() - 100, rect.getWidth()/2, 100);
60 mDebugConsolep = new LLConsole("debug console", 20, r, -1, 0.f );
61 mDebugConsolep->setFollowsBottom();
62 mDebugConsolep->setFollowsLeft();
63 mDebugConsolep->setVisible( FALSE );
64 addChild(mDebugConsolep);
65
66 r.set(150 - 25, rect.getHeight() - 50, rect.getWidth()/2 - 25, rect.getHeight() - 450);
67 mFrameStatView = new LLFrameStatView("frame stat", r);
68 mFrameStatView->setFollowsTop();
69 mFrameStatView->setFollowsLeft();
70 mFrameStatView->setVisible(FALSE); // start invisible
71 addChild(mFrameStatView);
72
73 r.set(25, rect.getHeight() - 50, (S32) (gViewerWindow->getVirtualWindowRect().getWidth() * 0.75f),
74 (S32) (gViewerWindow->getVirtualWindowRect().getHeight() * 0.75f));
75 mFastTimerView = new LLFastTimerView("fast timers", r);
76 mFastTimerView->setFollowsTop();
77 mFastTimerView->setFollowsLeft();
78 mFastTimerView->setVisible(FALSE); // start invisible
79 addChild(mFastTimerView);
80
81 r.set(25, rect.getHeight() - 50, rect.getWidth()/2, rect.getHeight() - 450);
82 mMemoryView = new LLMemoryView("memory", r);
83 mMemoryView->setFollowsTop();
84 mMemoryView->setFollowsLeft();
85 mMemoryView->setVisible(FALSE); // start invisible
86 addChild(mMemoryView);
87
88 r.set(150, rect.getHeight() - 50, 820, 100);
89 gTextureView = new LLTextureView("gTextureView", r);
90 gTextureView->setRect(r);
91 gTextureView->setFollowsBottom();
92 gTextureView->setFollowsLeft();
93 addChild(gTextureView);
94 //gTextureView->reshape(r.getWidth(), r.getHeight(), TRUE);
95
96 //
97 // Debug statistics
98 //
99 r.set(rect.getWidth() - 250,
100 rect.getHeight(),
101 rect.getWidth(),
102 rect.getHeight() - 400);
103 mStatViewp = new LLContainerView("statistics", r);
104 mStatViewp->setLabel("Statistics");
105 mStatViewp->setFollowsTop();
106 mStatViewp->setFollowsRight();
107 // Default to off
108 mStatViewp->setVisible(FALSE);
109 addChild(mStatViewp);
110
111 //
112 // Audio debugging stuff
113 //
114 const S32 AUDIO_STATUS_LEFT = rect.getWidth()/2-100;
115 const S32 AUDIO_STATUS_WIDTH = 320;
116 const S32 AUDIO_STATUS_TOP = (rect.getHeight()/2)+400;
117 const S32 AUDIO_STATUS_HEIGHT = 320;
118 r.setLeftTopAndSize( AUDIO_STATUS_LEFT, AUDIO_STATUS_TOP, AUDIO_STATUS_WIDTH, AUDIO_STATUS_HEIGHT );
119 LLAudiostatus* gAudioStatus = new LLAudiostatus("AudioStatus", r);
120 gAudioStatus->setFollowsTop();
121 gAudioStatus->setFollowsRight();
122 addChild(gAudioStatus);
123
124 const S32 VELOCITY_LEFT = 10; // 370;
125 const S32 VELOCITY_WIDTH = 500;
126 const S32 VELOCITY_TOP = 140;
127 const S32 VELOCITY_HEIGHT = 45;
128 r.setLeftTopAndSize( VELOCITY_LEFT, VELOCITY_TOP, VELOCITY_WIDTH, VELOCITY_HEIGHT );
129 gVelocityBar = new LLVelocityBar("Velocity Bar", r);
130 gVelocityBar->setFollowsBottom();
131 gVelocityBar->setFollowsLeft();
132 addChild(gVelocityBar);
133}
134
135
136LLDebugView::~LLDebugView()
137{
138 // These have already been deleted. Fix the globals appropriately.
139 gDebugView = NULL;
140 gTextureView = NULL;
141}
142
143EWidgetType LLDebugView::getWidgetType() const
144{
145 return WIDGET_TYPE_DEBUG_VIEW;
146}
147
148LLString LLDebugView::getWidgetTag() const
149{
150 return LL_DEBUG_VIEW_TAG;
151}
152