messagewindow.h 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. /*
  2. ** Command & Conquer Renegade(tm)
  3. ** Copyright 2025 Electronic Arts Inc.
  4. **
  5. ** This program is free software: you can redistribute it and/or modify
  6. ** it under the terms of the GNU General Public License as published by
  7. ** the Free Software Foundation, either version 3 of the License, or
  8. ** (at your option) any later version.
  9. **
  10. ** This program is distributed in the hope that it will be useful,
  11. ** but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. ** GNU General Public License for more details.
  14. **
  15. ** You should have received a copy of the GNU General Public License
  16. ** along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. /***********************************************************************************************
  19. *** C O N F I D E N T I A L --- W E S T W O O D S T U D I O S ***
  20. ***********************************************************************************************
  21. * *
  22. * Project Name : Combat *
  23. * *
  24. * $Archive:: /Commando/Code/Combat/messagewindow.h $*
  25. * *
  26. * Author:: Patrick Smith *
  27. * *
  28. * $Modtime:: 11/13/01 3:07p $*
  29. * *
  30. * $Revision:: 11 $*
  31. * *
  32. *---------------------------------------------------------------------------------------------*
  33. * Functions: *
  34. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
  35. #if defined(_MSC_VER)
  36. #pragma once
  37. #endif
  38. #ifndef __MESSAGE_WINDOW_H
  39. #define __MESSAGE_WINDOW_H
  40. #include "wwstring.h"
  41. #include "vector.h"
  42. #include "vector3.h"
  43. #include "textwindow.h"
  44. #include "render2d.h"
  45. ////////////////////////////////////////////////////////////////
  46. // Forward declarations
  47. ////////////////////////////////////////////////////////////////
  48. class SmartGameObj;
  49. class RenderObjClass;
  50. class SimpleSceneClass;
  51. class CameraClass;
  52. ////////////////////////////////////////////////////////////////
  53. //
  54. // MessageWindowClass
  55. //
  56. ////////////////////////////////////////////////////////////////
  57. class MessageWindowClass
  58. {
  59. public:
  60. ////////////////////////////////////////////////////////////////
  61. // Public constructors/destructors
  62. ////////////////////////////////////////////////////////////////
  63. MessageWindowClass (void);
  64. ~MessageWindowClass (void);
  65. ////////////////////////////////////////////////////////////////
  66. // Public methods
  67. ////////////////////////////////////////////////////////////////
  68. //
  69. // Initialization
  70. //
  71. void Initialize (void);
  72. void Shutdown (void);
  73. //
  74. // Content control
  75. //
  76. void Add_Message (const WideStringClass &message, const Vector3 &color = Vector3 (0, 0.9F, 0.2F), SmartGameObj *game_obj = NULL, float decay_time = 0);
  77. void Clear (void);
  78. //
  79. // Render methods
  80. //
  81. void On_Frame_Update (void);
  82. void Render (void);
  83. //
  84. // Visibility control
  85. //
  86. bool Has_Data (void) const;
  87. void Force_Display (bool onoff);
  88. //
  89. // Display rectangle control
  90. //
  91. void Update_Window_Rectangle (void);
  92. void Reset_Current_Rect (void);
  93. void Set_Window_Dirty (bool onoff) { IsRectangleDirty = onoff; }
  94. //
  95. // Decay control
  96. //
  97. uint32 Get_Decay_Time (void) const { return DecayTime; }
  98. void Set_Decay_Time (uint32 time) { DecayTime = time; }
  99. //
  100. // Message log support
  101. //
  102. void Clear_Log (void) { MessageLog.Reset_Active (); MessageLogColor.Reset_Active (); }
  103. int Get_Log_Count (void) { return MessageLog.Count (); }
  104. const WCHAR * Get_Log_Entry (int index) { return MessageLog[index]; }
  105. const Vector3 & Get_Log_Color (int index) { return MessageLogColor[index]; }
  106. private:
  107. ////////////////////////////////////////////////////////////////
  108. // Private methods
  109. ////////////////////////////////////////////////////////////////
  110. ////////////////////////////////////////////////////////////////
  111. // Private member data
  112. ////////////////////////////////////////////////////////////////
  113. uint32 DecayTime;
  114. TextWindowClass * TextWindow;
  115. Render2DClass IconRenderer;
  116. RectClass CurrentRect;
  117. RenderObjClass * HeadModel;
  118. SimpleSceneClass * Scene;
  119. CameraClass * Camera;
  120. bool IsRectangleDirty;
  121. DynamicVectorClass<WideStringClass> MessageLog;
  122. DynamicVectorClass<Vector3> MessageLogColor;
  123. };
  124. #endif //__MESSAGE_WINDOW_H