void LLDebugView::init()
{
	LLRect r;
	LLRect rect = getLocalRect();

	// Rectangle to draw debug data in (full height, 3/4 width)
	r.set(10, rect.getHeight() - 100, ((rect.getWidth()*3)/4), 100);
	LLConsole::Params cp;
	cp.name("debug console");
	cp.max_lines(20);
	cp.rect(r);
	cp.font(LLFontGL::getFontMonospace());
	cp.follows.flags(FOLLOWS_BOTTOM | FOLLOWS_LEFT);
	cp.visible(false);
	mDebugConsolep = LLUICtrlFactory::create<LLConsole>(cp);
	addChild(mDebugConsolep);

	r.set(150 - 25, rect.getHeight() - 50, rect.getWidth()/2 - 25, rect.getHeight() - 450);

	r.setLeftTopAndSize(25, rect.getHeight() - 50, (S32) (gViewerWindow->getWindowRectScaled().getWidth() * 0.75f), 
  									 (S32) (gViewerWindow->getWindowRectScaled().getHeight() * 0.75f));
	
	mFastTimerView = dynamic_cast<LLFastTimerView*>(LLFloaterReg::getInstance("fast_timers"));

	gSceneView = new LLSceneView(r);
	gSceneView->setFollowsTop();
	gSceneView->setFollowsLeft();
	gSceneView->setVisible(FALSE);
	addChild(gSceneView);
	gSceneView->setRect(rect);
	
	r.setLeftTopAndSize(25, rect.getHeight() - 50, (S32) (gViewerWindow->getWindowRectScaled().getWidth() * 0.75f), 
									 (S32) (gViewerWindow->getWindowRectScaled().getHeight() * 0.75f));
	LLMemoryView::Params mp;
	mp.name("memory");
	mp.rect(r);
	mp.follows.flags(FOLLOWS_TOP | FOLLOWS_LEFT);
	mp.visible(false);
	mMemoryView = LLUICtrlFactory::create<LLMemoryView>(mp);
	addChild(mMemoryView);

	r.set(150, rect.getHeight() - 50, 820, 100);
	LLTextureView::Params tvp;
	tvp.name("gTextureView");
	tvp.rect(r);
	tvp.follows.flags(FOLLOWS_TOP|FOLLOWS_LEFT);
	tvp.visible(false);
	gTextureView = LLUICtrlFactory::create<LLTextureView>(tvp);
	addChild(gTextureView);
	//gTextureView->reshape(r.getWidth(), r.getHeight(), TRUE);
}
示例#2
0
void LLDebugView::init()
{
	LLRect r;
	LLRect rect = getLocalRect();

	r.set(10, rect.getHeight() - 100, rect.getWidth()/2, 100);
	LLConsole::Params cp;
	cp.name("debug console");
	cp.max_lines(20);
	cp.rect(r);
	cp.font(LLFontGL::getFontMonospace());
	cp.follows.flags(FOLLOWS_BOTTOM | FOLLOWS_LEFT);
	cp.visible(false);
	mDebugConsolep = LLUICtrlFactory::create<LLConsole>(cp);
	addChild(mDebugConsolep);

	r.set(150 - 25, rect.getHeight() - 50, rect.getWidth()/2 - 25, rect.getHeight() - 450);

	r.setLeftTopAndSize(25, rect.getHeight() - 50, (S32) (gViewerWindow->getWindowRectScaled().getWidth() * 0.75f), 
  									 (S32) (gViewerWindow->getWindowRectScaled().getHeight() * 0.75f));
	
	mFastTimerView = new LLFastTimerView(r);
	mFastTimerView->setFollowsTop();
	mFastTimerView->setFollowsLeft();
	mFastTimerView->setVisible(FALSE);			// start invisible
	addChild(mFastTimerView);
	mFastTimerView->setRect(rect);

	r.setLeftTopAndSize(25, rect.getHeight() - 50, (S32) (gViewerWindow->getWindowRectScaled().getWidth() * 0.75f), 
									 (S32) (gViewerWindow->getWindowRectScaled().getHeight() * 0.75f));
	LLMemoryView::Params mp;
	mp.name("memory");
	mp.rect(r);
	mp.follows.flags(FOLLOWS_TOP | FOLLOWS_LEFT);
	mp.visible(false);
	mMemoryView = LLUICtrlFactory::create<LLMemoryView>(mp);
	addChild(mMemoryView);

	r.set(150, rect.getHeight() - 50, 820, 100);
	LLTextureView::Params tvp;
	tvp.name("gTextureView");
	tvp.rect(r);
	tvp.follows.flags(FOLLOWS_BOTTOM|FOLLOWS_LEFT);
	tvp.visible(false);
	gTextureView = LLUICtrlFactory::create<LLTextureView>(tvp);
	addChild(gTextureView);
	//gTextureView->reshape(r.getWidth(), r.getHeight(), TRUE);

	if(gAuditTexture)
	{
		r.set(150, rect.getHeight() - 50, 900 + LLImageGL::sTextureLoadedCounter.size() * 30, 100);
		LLTextureSizeView::Params tsv ;
		tsv.name("gTextureSizeView");
		tsv.rect(r);
		tsv.follows.flags(FOLLOWS_BOTTOM|FOLLOWS_LEFT);
		tsv.visible(false);
		gTextureSizeView = LLUICtrlFactory::create<LLTextureSizeView>(tsv);
		addChild(gTextureSizeView);
		gTextureSizeView->setType(LLTextureSizeView::TEXTURE_MEM_OVER_SIZE) ;

		r.set(150, rect.getHeight() - 50, 900 + LLViewerTexture::getTotalNumOfCategories() * 30, 100);
		LLTextureSizeView::Params tcv ;
		tcv.name("gTextureCategoryView");
		tcv.rect(r);
		tcv.follows.flags(FOLLOWS_BOTTOM|FOLLOWS_LEFT);
		tcv.visible(false);
		gTextureCategoryView = LLUICtrlFactory::create<LLTextureSizeView>(tcv);
		gTextureCategoryView->setType(LLTextureSizeView::TEXTURE_MEM_OVER_CATEGORY);
		addChild(gTextureCategoryView);
	}
}