Files
source/Utils/Animated ProgressBar.h
T
Wanne 14750c6903 **********************************************************
** Big Maps Projects code (incl. Multiplayer v1.5 **
**********************************************************
- Merged Big Maps Project code from BMP+MP trunk (Revision: 3340)
o Complete SVN Revision history: https://81.169.133.124/source/ja2/branches/Wanne/JA2%201.13%20MP
- Before THIS merge, I made a branch of the existing 1.13 source
o SVN Branch: https://81.169.133.124/source/ja2/branches/JA2_rev.3336/src
- Removed old VS 6.0 and VS 2003 project and solutions files, because compilation is broken long time ago
- I will add VS 2010 projects and solution file in the next few days

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@3341 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2010-02-28 18:38:52 +00:00

89 lines
4.0 KiB
C

#ifndef __ANIMATED_PROGRESSBAR_H
#define __ANIMATED_PROGRESSBAR_H
#include "types.h"
#define MAX_PROGRESSBARS 4
typedef struct PROGRESSBAR
{
UINT8 ubProgressBarID;
UINT16 usBarLeft, usBarTop, usBarRight, usBarBottom;
BOOLEAN fPanel;
UINT16 usPanelLeft, usPanelTop, usPanelRight, usPanelBottom;
UINT16 usColor, usLtColor, usDkColor;
STR16 swzTitle;
UINT16 usTitleFont;
UINT8 ubTitleFontForeColor, ubTitleFontShadowColor;
UINT16 usMsgFont;
UINT8 ubMsgFontForeColor, ubMsgFontShadowColor;
UINT8 ubRelativeStartPercentage, ubRelativeEndPercentage;
UINT8 ubColorFillRed;
UINT8 ubColorFillGreen;
UINT8 ubColorFillBlue;
double rStart, rEnd;
BOOLEAN fDisplayText;
BOOLEAN fUseSaveBuffer; //use the save buffer when display the text
double rLastActual;
UINT32 uiFrameBuffer;
BOOLEAN fDrawBorder;
}PROGRESSBAR;
extern PROGRESSBAR *pBar[ MAX_PROGRESSBARS ];
void CreateLoadingScreenProgressBar();
void RemoveLoadingScreenProgressBar();
//This creates a single progress bar given the coordinates without a panel (containing a title and background).
//A panel is automatically created if you specify a title using SetProgressBarTitle
BOOLEAN CreateProgressBar( UINT8 ubProgressBarID, UINT16 usLeft, UINT16 usTop, UINT16 usRight, UINT16 usBottom );
//You may also define a panel to go in behind the progress bar. You can now assign a title to go with
//the panel.
void DefineProgressBarPanel( UINT32 ubID, UINT8 r, UINT8 g, UINT8 b,
UINT16 usLeft, UINT16 usTop, UINT16 usRight, UINT16 usBottom );
//Assigning a title for the panel will automatically position the text horizontally centered on the
//panel and vertically centered from the top of the panel, to the top of the progress bar.
void SetProgressBarTitle( UINT32 ubID, STR16 pString, UINT32 usFont, UINT8 ubForeColor, UINT8 ubShadowColor );
//Unless you set up the attributes, any text you pass to SetRelativeStartAndEndPercentage will
//default to FONT12POINT1 in a black color.
void SetProgressBarMsgAttributes( UINT32 ubID, UINT32 usFont, UINT8 ubForeColor, UINT8 ubShadowColor );
//When finished, the progress bar needs to be removed.
void RemoveProgressBar( UINT8 ubID );
//An important setup function. The best explanation is through example. The example being the loading
//of a file -- there are many stages of the map loading. In JA2, the first step is to load the tileset.
//Because it is a large chunk of the total loading of the map, we may gauge that it takes up 30% of the
//total load. Because it is also at the beginning, we would pass in the arguments ( 0, 30, "text" ).
//As the process animates using UpdateProgressBar( 0 to 100 ), the total progress bar will only reach 30%
//at the 100% mark within UpdateProgressBar. At that time, you would go onto the next step, resetting the
//relative start and end percentage from 30 to whatever, until your done.
void SetRelativeStartAndEndPercentage( UINT8 ubID, UINT16 uiRelStartPerc, UINT16 uiRelEndPerc, STR16 str);
//This part renders the progress bar at the percentage level that you specify. If you have set relative
//percentage values in the above function, then the uiPercentage will be reflected based off of the relative
//percentages.
void RenderProgressBar( UINT8 ubID, UINT32 uiPercentage );
//Sets the color of the progress bars main color.
void SetProgressBarColor( UINT8 ubID, UINT8 ubColorFillRed, UINT8 ubColorFillGreen, UINT8 ubColorFillBlue );
//Pass in TRUE to display the strings.
void SetProgressBarTextDisplayFlag( UINT8 ubID, BOOLEAN fDisplayText, BOOLEAN fUseSaveBuffer, BOOLEAN fSaveScreenToFrameBuffer );
// OJW - 20090422
// draw the progress bar with a white border, or not
void SetProgressBarUseBorder( UINT32 ubID , BOOLEAN bBorder );
// specify which buffer to render the bar to
void SetProgressBarRenderBuffer( UINT32 ubID , UINT32 uiBufferID );
// create a color bar with no border
void CreateProgressBarNoBorder( UINT8 ubProgressBarID, UINT16 usLeft, UINT16 usTop, UINT16 usRight, UINT16 usBottom );
#endif