TXTLABEL.CPP 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. /*
  2. ** Command & Conquer Red Alert(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. /* $Header: /CounterStrike/TXTLABEL.CPP 1 3/03/97 10:26a Joe_bostic $ */
  19. /***********************************************************************************************
  20. *** 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 ***
  21. ***********************************************************************************************
  22. * *
  23. * Project Name : Command & Conquer *
  24. * *
  25. * File Name : TXTLABEL.H *
  26. * *
  27. * Programmer : Bill Randolph *
  28. * *
  29. * Start Date : 02/06/95 *
  30. * *
  31. * Last Update : February 6, 1995 [BR] *
  32. * *
  33. *---------------------------------------------------------------------------------------------*
  34. * Functions: *
  35. * TextLableClass::Draw_Me -- Graphical update routine *
  36. * TextLableClass::TextLabelClass -- Constructor *
  37. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
  38. #include "function.h"
  39. /***********************************************************************************************
  40. * TextLableClass::TextLabelClass -- Constructor *
  41. * *
  42. * INPUT: *
  43. * txt pointer to text buffer to print from *
  44. * x x-coord for text printing *
  45. * y y-coord for text printing *
  46. * color color to print in *
  47. * style style to print (determines the meaning of x & y) *
  48. * *
  49. * OUTPUT: *
  50. * none. *
  51. * *
  52. * WARNINGS: *
  53. * none. *
  54. * *
  55. * HISTORY: *
  56. * 03/24/1995 BRR : Created. *
  57. *=============================================================================================*/
  58. TextLabelClass::TextLabelClass(char *txt, int x, int y, RemapControlType * color,
  59. TextPrintType style) : GadgetClass(x, y, 1, 1, 0, 0)
  60. {
  61. Text = txt;
  62. Color = color;
  63. Style = style;
  64. UserData1 = 0;
  65. UserData2 = 0;
  66. PixWidth = -1;
  67. }
  68. /***********************************************************************************************
  69. * TextLableClass::Draw_Me -- Graphical update routine *
  70. * *
  71. * INPUT: *
  72. * forced true = draw regardless of the current redraw flag state *
  73. * *
  74. * OUTPUT: *
  75. * true = gadget was redrawn, false = wasn't *
  76. * *
  77. * WARNINGS: *
  78. * none. *
  79. * *
  80. * HISTORY: *
  81. * 03/24/1995 BRR : Created. *
  82. *=============================================================================================*/
  83. virtual int TextLabelClass::Draw_Me(int forced)
  84. {
  85. if (GadgetClass::Draw_Me(forced)) {
  86. if (PixWidth == -1) {
  87. Simple_Text_Print(Text, X, Y, Color, TBLACK, Style);
  88. // Fancy_Text_Print(Text, X, Y, Color, TBLACK, Style);
  89. } else {
  90. Conquer_Clip_Text_Print(Text, X, Y, Color, TBLACK, Style, PixWidth);
  91. }
  92. return(true);
  93. }
  94. return(false);
  95. }