CnC_Remastered_Collection

Command and Conquer: Red Alert
Log | Files | Refs | README | LICENSE

TXTLABEL.CPP (6666B)


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