lldebugview.cpp 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. /**
  2. * @file lldebugview.cpp
  3. * @brief A view containing UI elements only visible in build mode.
  4. *
  5. * $LicenseInfo:firstyear=2001&license=viewergpl$
  6. *
  7. * Copyright (c) 2001-2009, Linden Research, Inc.
  8. *
  9. * Second Life Viewer Source Code
  10. * The source code in this file ("Source Code") is provided by Linden Lab
  11. * to you under the terms of the GNU General Public License, version 2.0
  12. * ("GPL"), unless you have obtained a separate licensing agreement
  13. * ("Other License"), formally executed by you and Linden Lab. Terms of
  14. * the GPL can be found in doc/GPL-license.txt in this distribution, or
  15. * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
  16. *
  17. * There are special exceptions to the terms and conditions of the GPL as
  18. * it is applied to this Source Code. View the full text of the exception
  19. * in the file doc/FLOSS-exception.txt in this software distribution, or
  20. * online at
  21. * http://secondlifegrid.net/programs/open_source/licensing/flossexception
  22. *
  23. * By copying, modifying or distributing this software, you acknowledge
  24. * that you have read and understood your obligations described above,
  25. * and agree to abide by those obligations.
  26. *
  27. * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
  28. * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
  29. * COMPLETENESS OR PERFORMANCE.
  30. * $/LicenseInfo$
  31. */
  32. #include "llviewerprecompiledheaders.h"
  33. #include "lldebugview.h"
  34. #include "llconsole.h"
  35. #include "llfasttimerview.h"
  36. #include "lltextureview.h"
  37. #include "llvelocitybar.h"
  38. #include "llviewercontrol.h"
  39. #include "llviewerwindow.h"
  40. // Instance created in LLViewerWindow::initBase()
  41. LLDebugView* gDebugViewp = NULL;
  42. LLDebugView::LLDebugView(const std::string& name, const LLRect& rect)
  43. : LLView(name, rect, false)
  44. {
  45. LLRect r(CONSOLE_PADDING_LEFT, rect.getHeight() - 100,
  46. rect.getWidth() - CONSOLE_PADDING_RIGHT, 100);
  47. mDebugConsolep = new LLConsole("Debug console", r, -1,
  48. gSavedSettings.getU32("DebugConsoleMaxLines"),
  49. 0.f);
  50. if (mDebugConsolep)
  51. {
  52. mDebugConsolep->setFollows(FOLLOWS_LEFT | FOLLOWS_RIGHT |
  53. FOLLOWS_BOTTOM);
  54. mDebugConsolep->setVisible(false);
  55. addChild(mDebugConsolep);
  56. }
  57. else
  58. {
  59. llwarns << "Unable to initialize the debug console !" << llendl;
  60. }
  61. #if LL_FAST_TIMERS_ENABLED
  62. if (new LLFastTimerView("Fast timers"))
  63. {
  64. addChild(gFastTimerViewp);
  65. }
  66. else
  67. {
  68. llwarns << "Unable to initialize the fast timers view !" << llendl;
  69. }
  70. #endif
  71. if (new LLTextureView("Texture view"))
  72. {
  73. addChild(gTextureViewp);
  74. }
  75. else
  76. {
  77. llwarns << "Unable to initialize the texture console !" << llendl;
  78. }
  79. if (new LLVelocityBar("Velocity bar"))
  80. {
  81. addChild(gVelocityBarp);
  82. }
  83. else
  84. {
  85. llwarns << "Unable to initialize the velocity bar !" << llendl;
  86. }
  87. }
  88. LLDebugView::~LLDebugView()
  89. {
  90. gDebugViewp = NULL;
  91. }