TXTLABEL.CPP 6.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. //
  2. // Copyright 2020 Electronic Arts Inc.
  3. //
  4. // TiberianDawn.DLL and RedAlert.dll and corresponding source code is free
  5. // software: you can redistribute it and/or modify it under the terms of
  6. // the GNU General Public License as published by the Free Software Foundation,
  7. // either version 3 of the License, or (at your option) any later version.
  8. // TiberianDawn.DLL and RedAlert.dll and corresponding source code is distributed
  9. // in the hope that it will be useful, but with permitted additional restrictions
  10. // under Section 7 of the GPL. See the GNU General Public License in LICENSE.TXT
  11. // distributed with this program. You should have received a copy of the
  12. // GNU General Public License along with permitted additional restrictions
  13. // with this program. If not, see https://github.com/electronicarts/CnC_Remastered_Collection
  14. /* $Header: /CounterStrike/TXTLABEL.CPP 1 3/03/97 10:26a Joe_bostic $ */
  15. /***********************************************************************************************
  16. *** 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 ***
  17. ***********************************************************************************************
  18. * *
  19. * Project Name : Command & Conquer *
  20. * *
  21. * File Name : TXTLABEL.H *
  22. * *
  23. * Programmer : Bill Randolph *
  24. * *
  25. * Start Date : 02/06/95 *
  26. * *
  27. * Last Update : February 6, 1995 [BR] *
  28. * *
  29. *---------------------------------------------------------------------------------------------*
  30. * Functions: *
  31. * TextLableClass::Draw_Me -- Graphical update routine *
  32. * TextLableClass::TextLabelClass -- Constructor *
  33. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
  34. #include "function.h"
  35. /***********************************************************************************************
  36. * TextLableClass::TextLabelClass -- Constructor *
  37. * *
  38. * INPUT: *
  39. * txt pointer to text buffer to print from *
  40. * x x-coord for text printing *
  41. * y y-coord for text printing *
  42. * color color to print in *
  43. * style style to print (determines the meaning of x & y) *
  44. * *
  45. * OUTPUT: *
  46. * none. *
  47. * *
  48. * WARNINGS: *
  49. * none. *
  50. * *
  51. * HISTORY: *
  52. * 03/24/1995 BRR : Created. *
  53. *=============================================================================================*/
  54. TextLabelClass::TextLabelClass(char *txt, int x, int y, RemapControlType * color,
  55. TextPrintType style) : GadgetClass(x, y, 1, 1, 0, 0)
  56. {
  57. Text = txt;
  58. Color = color;
  59. Style = style;
  60. UserData1 = 0;
  61. UserData2 = 0;
  62. PixWidth = -1;
  63. }
  64. /***********************************************************************************************
  65. * TextLableClass::Draw_Me -- Graphical update routine *
  66. * *
  67. * INPUT: *
  68. * forced true = draw regardless of the current redraw flag state *
  69. * *
  70. * OUTPUT: *
  71. * true = gadget was redrawn, false = wasn't *
  72. * *
  73. * WARNINGS: *
  74. * none. *
  75. * *
  76. * HISTORY: *
  77. * 03/24/1995 BRR : Created. *
  78. *=============================================================================================*/
  79. int TextLabelClass::Draw_Me(int forced)
  80. {
  81. if (GadgetClass::Draw_Me(forced)) {
  82. if (PixWidth == -1) {
  83. Simple_Text_Print(Text, X, Y, Color, TBLACK, Style);
  84. // Fancy_Text_Print(Text, X, Y, Color, TBLACK, Style);
  85. } else {
  86. Conquer_Clip_Text_Print(Text, X, Y, Color, TBLACK, Style, PixWidth);
  87. }
  88. return(true);
  89. }
  90. return(false);
  91. }