CnC_Remastered_Collection

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

BAR.H (4081B)


      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/BAR.H 1     3/03/97 10:24a 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 : BAR.H                                                        *
     24  *                                                                                             *
     25  *                   Programmer : Joe L. Bostic                                                *
     26  *                                                                                             *
     27  *                   Start Date : 08/16/96                                                     *
     28  *                                                                                             *
     29  *                  Last Update : August 16, 1996 [JLB]                                        *
     30  *                                                                                             *
     31  *---------------------------------------------------------------------------------------------*
     32  * Functions:                                                                                  *
     33  * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
     34 
     35 #ifndef BAR_H
     36 #define BAR_H
     37 
     38 /*
     39 **	The "bool" integral type was defined by the C++ committee in
     40 **	November of '94. Until the compiler supports this, use the following
     41 **	definition.
     42 */
     43 #ifndef __BORLANDC__
     44 #ifndef TRUE_FALSE_DEFINED
     45 #define TRUE_FALSE_DEFINED
     46 enum {false=0,true=1};
     47 typedef int bool;
     48 #endif
     49 #endif
     50 
     51 #include "fixed.h"
     52 
     53 
     54 /*
     55 **	This is a manager for a progress (or other) bargraph. Such a graph consists of a fill
     56 **	and a background region. The fill percentage of the bargraph is controlled by an
     57 **	update value. The bargraph can be optionally outlined.
     58 */
     59 class ProgressBarClass
     60 {
     61 	public:
     62 		ProgressBarClass(int x, int y, int width, int height, int forecolor, int backcolor, int bordercolor=0);
     63 
     64 		bool Update(fixed value);
     65 		void Redraw(void) const;
     66 
     67 	private:
     68 
     69 		void Outline(void) const;
     70 		bool Is_Horizontal(void) const;
     71 		bool Is_Outlined(void) const {return(BorderColor != 0);}
     72 
     73 		/*
     74 		**	This is the upper left coordinates of the bargraph.
     75 		*/
     76 		int X,Y;
     77 
     78 		/*
     79 		**	This is the dimensions of the bargraph.
     80 		*/
     81 		int Width, Height;
     82 
     83 		/*
     84 		**	These are the colors to use when drawing the progress bar.
     85 		*/
     86 		int BarColor;
     87 		int BackColor;
     88 		int BorderColor;
     89 
     90 		/*
     91 		**	This is the current value of the bargraph.
     92 		*/
     93 		fixed CurrentValue;
     94 
     95 		/*
     96 		**	This is the current value as of the last time the bargraph was rendered.
     97 		*/
     98 		fixed LastDisplayCurrent;
     99 
    100 		/*
    101 		**	If the bargraph has been drawn at least once, then this flag will
    102 		**	be true.
    103 		*/
    104 		unsigned IsDrawn:1;
    105 };
    106 
    107 
    108 #endif