PageRenderTime 33ms CodeModel.GetById 10ms RepoModel.GetById 0ms app.codeStats 0ms

/indra/newview/llhudeffect.cpp

https://bitbucket.org/lindenlab/viewer-beta/
C++ | 133 lines | 84 code | 22 blank | 27 comment | 0 complexity | 6c41b09c4ddb9623ddcfa688a9a9d850 MD5 | raw file
Possible License(s): LGPL-2.1
  1. /**
  2. * @file llhudeffect.cpp
  3. * @brief LLHUDEffect class implementation
  4. *
  5. * $LicenseInfo:firstyear=2002&license=viewerlgpl$
  6. * Second Life Viewer Source Code
  7. * Copyright (C) 2010, Linden Research, Inc.
  8. *
  9. * This library is free software; you can redistribute it and/or
  10. * modify it under the terms of the GNU Lesser General Public
  11. * License as published by the Free Software Foundation;
  12. * version 2.1 of the License only.
  13. *
  14. * This library is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  17. * Lesser General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU Lesser General Public
  20. * License along with this library; if not, write to the Free Software
  21. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  22. *
  23. * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
  24. * $/LicenseInfo$
  25. */
  26. #include "llviewerprecompiledheaders.h"
  27. #include "llhudeffect.h"
  28. #include "message.h"
  29. #include "llgl.h"
  30. #include "llagent.h"
  31. #include "llrendersphere.h"
  32. #include "llviewerobjectlist.h"
  33. #include "lldrawable.h"
  34. LLHUDEffect::LLHUDEffect(const U8 type)
  35. : LLHUDObject(type),
  36. mID(),
  37. mDuration(1.f),
  38. mColor()
  39. {
  40. mNeedsSendToSim = FALSE;
  41. mOriginatedHere = FALSE;
  42. mDead = FALSE;
  43. }
  44. LLHUDEffect::~LLHUDEffect()
  45. {
  46. }
  47. void LLHUDEffect::packData(LLMessageSystem *mesgsys)
  48. {
  49. mesgsys->addUUIDFast(_PREHASH_ID, mID);
  50. mesgsys->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
  51. mesgsys->addU8Fast(_PREHASH_Type, mType);
  52. mesgsys->addF32Fast(_PREHASH_Duration, mDuration);
  53. mesgsys->addBinaryData(_PREHASH_Color, mColor.mV, 4);
  54. }
  55. void LLHUDEffect::unpackData(LLMessageSystem *mesgsys, S32 blocknum)
  56. {
  57. mesgsys->getUUIDFast(_PREHASH_Effect, _PREHASH_ID, mID, blocknum);
  58. mesgsys->getU8Fast(_PREHASH_Effect, _PREHASH_Type, mType, blocknum);
  59. mesgsys->getF32Fast(_PREHASH_Effect, _PREHASH_Duration, mDuration, blocknum);
  60. mesgsys->getBinaryDataFast(_PREHASH_Effect,_PREHASH_Color, mColor.mV, 4, blocknum);
  61. }
  62. void LLHUDEffect::render()
  63. {
  64. llerrs << "Never call this!" << llendl;
  65. }
  66. void LLHUDEffect::setID(const LLUUID &id)
  67. {
  68. mID = id;
  69. }
  70. const LLUUID &LLHUDEffect::getID() const
  71. {
  72. return mID;
  73. }
  74. void LLHUDEffect::setColor(const LLColor4U &color)
  75. {
  76. mColor = color;
  77. }
  78. void LLHUDEffect::setDuration(const F32 duration)
  79. {
  80. mDuration = duration;
  81. }
  82. void LLHUDEffect::setNeedsSendToSim(const BOOL send_to_sim)
  83. {
  84. mNeedsSendToSim = send_to_sim;
  85. }
  86. BOOL LLHUDEffect::getNeedsSendToSim() const
  87. {
  88. return mNeedsSendToSim;
  89. }
  90. void LLHUDEffect::setOriginatedHere(const BOOL orig_here)
  91. {
  92. mOriginatedHere = orig_here;
  93. }
  94. BOOL LLHUDEffect::getOriginatedHere() const
  95. {
  96. return mOriginatedHere;
  97. }
  98. //static
  99. void LLHUDEffect::getIDType(LLMessageSystem *mesgsys, S32 blocknum, LLUUID &id, U8 &type)
  100. {
  101. mesgsys->getUUIDFast(_PREHASH_Effect, _PREHASH_ID, id, blocknum);
  102. mesgsys->getU8Fast(_PREHASH_Effect, _PREHASH_Type, type, blocknum);
  103. }
  104. BOOL LLHUDEffect::isDead() const
  105. {
  106. return mDead;
  107. }
  108. void LLHUDEffect::update()
  109. {
  110. // do nothing
  111. }