ptd::CBuilderRenderParameters Class Reference
[Graphics module]

#include <PtdBuilderRenderModule.h>

Collaboration diagram for ptd::CBuilderRenderParameters:

Collaboration graph
[legend]

List of all members.

Classes

struct  SButton
struct  SPurchaseButton

Public Types

enum  button_status { DEFAULT, HOVER, CLICKED, UNAVAILABLE }
enum  arrow_type { REWIND, BACK, FORWARD, FAST_FORWARD }

Public Member Functions

void calculateDimensions (CGameState *pGameState)
void lock ()
 Locks parameters mutex.
void unlock ()
 Unlocks parameters mutex.
int getPurchaseButtonCount () const
 Returns the number of existing purchase buttons.
GLuint getArrowTexture (arrow_type nArrow)
 Accessor to an arrow's texture.
GLuint getPurchaseButtonTexture (int nPosition)
CBuilderObject * getBuilderObject (int nPosition)
virtual void GetTypeID (std::string &str) const
 Gets this node's factory mapping key.
button_status getArrowStatus (arrow_type nArrow) const
button_status getPurchaseButtonStatus (int nPosition) const
setters
bool setArrowStatus (arrow_type nArrow, button_status status)
bool setPurchaseButtonStatus (int nPosition, button_status status)
Dimension and Coordinate getters for main window divisions
double getMainScreenWidth () const
double getMainScreenHeight () const
double getMiniMapWidth () const
double getMiniMapHeight () const
double getToolBarWidth () const
double getToolBarHeight () const
double getOffsetWidth () const
double getOffsetHeight () const
int getTextDisplayWidth () const
int getTextDisplayHeight () const
double getMainScreenX () const
double getMainScreenY () const
double getMiniMapX () const
double getMiniMapY () const
double getToolBarX () const
double getToolBarY () const
Dimension and Coordinate getters for buttons
bool getArrowInfo (arrow_type nArrow, int &nX, int &nY, double &dWidth, double &dHeight) const
bool getPurchaseButtonInfo (int nPosition, int &nX, int &nY, double &dWidth, double &dHeight) const
Constructors, Destructor, and Assignment Operator
 CBuilderRenderParameters ()
 Default constructor.
 CBuilderRenderParameters (ptd::CGameState *pGameState)
 Constructor on a Game State.

Private Member Functions

private helper functions
PRIVATE HELPER FUNCTIONS

bool dimensionsChanged (CGameState *pGameState)
 Indicates whether or not we need to recalculate the dimensions.
void calculateMainDimensions (CGameState *pGameState)
void calculateToolBarDimensions (CGameState *pGameState)
bool loadTexture (std::string filename, GLuint &texture)
 Load a texture from a file.

Private Attributes

fsf::CMutex m_csParameters
 mutex for parameters class
Data Members
DATA MEMBERS

double m_dLevelMapW
 Width of Level Map.
double m_dLevelMapH
 Height of Level Map.
double m_dWindowW
 Width of the window.
double m_dWindowH
 Height of the window.
double m_dMainScreenW
 Width of Main Screen.
double m_dMainScreenH
 Height of Main Screen.
double m_dMiniMapW
 Width of Mini Map.
double m_dMiniMapH
 Height of Mini Map.
double m_dToolBarW
 Width of ToolBar.
double m_dToolBarH
 Height of ToolBar.
double m_dOffsetW
 Dimension of horizontal offsets.
double m_dOffsetH
 Dimension of vertical offsets.
SButton m_Arrows [ARROW_COUNT]
 Tool Bar Related Parameters.
std::vector< SPurchaseButton > m_PurchaseButtons
 Container for purchase buttons.
int m_nPurchaseButtonCount
 The number of purchase buttons.
double m_dArrowOffsetW
 Horizontal spacing between arrows.
double m_dArrowOffsetH
 Vertical spacing between arrows.
double m_dPurchaseButtonOffsetW
 Horizontal spacing between purchase buttons.
double m_dPurchaseButtonOffsetH
 Vertical spacing between purchase buttons.

Static Private Attributes

Mini Map Related Constants
CONSTANTS

static const int DEFAULT_OFFSET_WIDTH = 15
static const int MIN_OFFSET_HEIGHT = 25
static const int MINI_MAP_HEIGHT = 75
static const int TEXT_DISPLAY_WIDTH = 500
ToolBar Related Constants
static const int PURCHASE_BUTTON_HEIGHT = 55
static const int PURCHASE_BUTTON_WIDTH = PURCHASE_BUTTON_HEIGHT
static const int ARROW_WIDTH = 30
static const int ARROW_HEIGHT = ARROW_WIDTH
static const int ARROW_OFFSET_WIDTH = 10
static const int MIN_BUTTON_OFFSET_W = 10
static const int ARROW_COUNT = 4
References to Texture Mapping related files
static std::string REWIND_ARROW_IMG = "Images/rewind_arrow.img"
static std::string BACK_ARROW_IMG = "Images/back_arrow.img"
static std::string FORWARD_ARROW_IMG = "Images/forward_arrow.img"
static std::string FASTFORWARD_ARROW_IMG = "Images/fastforward_arrow.img"
static std::string PURCHASE_BUTTON_IMG = "Images/purchase_button.img"


Detailed Description

A parameter node for BuilderRender

Member Enumeration Documentation

Tags for referencing a particular arrow-button.

Enumerator:
REWIND  the rewind arrow
BACK  the back arrow
FORWARD  the forward arrow

CONSTANTS Describes a button's current interaction with the user.

Enumerator:
DEFAULT  default status
HOVER  hover status
CLICKED  clicked status


Member Function Documentation

void CBuilderRenderParameters::calculateDimensions ( CGameState *  pGameState  ) 

FUNCTIONS Calculate and initialize the widths and heights for all the components in the screen (main screen, mini map, etc)

void CBuilderRenderParameters::calculateMainDimensions ( CGameState *  pGameState  )  [private]

Calculate the dimensions of the main screen, mini map, and outline of toolbar. Store the results in the appropriate data members.

void CBuilderRenderParameters::calculateToolBarDimensions ( CGameState *  pGameState  )  [private]

Calculate the dimensions of any toolbar buttons. Store the results in the appropriate data members. Assumes the offset and toolbar heights/widths have been calculated.

bool CBuilderRenderParameters::getArrowInfo ( arrow_type  nArrow,
int &  nX,
int &  nY,
double &  dWidth,
double &  dHeight 
) const

Gets locational and dimensional information about a button

inputs: - a number n to indicate that we're referencing the nth button in their respective container

  • variables to store the extracted information

outputs: - a boolean where true indicates success, and false indicates an error (which would occur if no button exists at a given position).

button_status ptd::CBuilderRenderParameters::getArrowStatus ( arrow_type  nArrow  )  const [inline]

Gets a given arrow button's status.

input: - a reference to the desired arrow

output: - the button's status

CBuilderObject* ptd::CBuilderRenderParameters::getBuilderObject ( int  nPosition  )  [inline]

Accessor to a purchase button's associated BuilderObject. An input n refers to the nth button in the purchase buttons container.

button_status ptd::CBuilderRenderParameters::getPurchaseButtonStatus ( int  nPosition  )  const [inline]

Gets a given purchase button's status.

input: - a number n to indicate that we're referencing the nth button in their respective container

output: - the button's status if the button exists, the default button status otherwise.

GLuint ptd::CBuilderRenderParameters::getPurchaseButtonTexture ( int  nPosition  )  [inline]

Accessor to a purchase button's texture. An input n refers to the nth button in the purchase buttons container.

bool CBuilderRenderParameters::setArrowStatus ( arrow_type  nArrow,
button_status  status 
)

Sets a given button to a given status.

inputs: - a number n to indicate that we're referencing the nth button in their respective container

  • the button status to change to

outputs: - a boolean where true indicates success, and false indicates an error (which would occur if no button exists at a given position).


Member Data Documentation

Tool Bar Related Parameters.

Container for arrow buttons


The documentation for this class was generated from the following files:

Generated on Mon Dec 20 15:54:52 2010 for Platitude by doxygen 1.5.9