CrossHair Class Reference

#include <crosshair.h>

Collaboration diagram for CrossHair:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 CrossHair ()
void Reset ()
void Refresh (double angle)
void Draw ()

Public Attributes

bool enable

Private Attributes

Surface image
Point2i crosshair_position

Detailed Description

Definition at line 29 of file crosshair.h.


Constructor & Destructor Documentation

CrossHair::CrossHair (  ) 

Definition at line 35 of file crosshair.cpp.

00036 {
00037   enable = false;
00038   Profile *res = resource_manager.LoadXMLProfile( "graphism.xml", false);
00039   image = resource_manager.LoadImage(res, "gfx/pointeur1");
00040   resource_manager.UnLoadXMLProfile(res);
00041 }

Here is the call graph for this function:


Member Function Documentation

void CrossHair::Draw (  ) 

Definition at line 54 of file crosshair.cpp.

00055 {
00056   if( !enable )
00057     return;
00058   if( ActiveCharacter().IsDead() )
00059     return;
00060   if( GameLoop::GetInstance()->ReadState() != GameLoop::PLAYING )
00061     return;
00062   Point2i tmp = ActiveCharacter().GetHandPosition() + crosshair_position;
00063   AppWormux::GetInstance()->video.window.Blit(image, tmp - camera.GetPosition());
00064   world.ToRedrawOnMap(Rectanglei(tmp, image.GetSize()));
00065 }

Here is the call graph for this function:

Here is the caller graph for this function:

void CrossHair::Refresh ( double  angle  ) 

Definition at line 49 of file crosshair.cpp.

00050 {
00051   crosshair_position = Point2i(RAY, RAY) * Point2d(cos(angle), sin(angle)) - image.GetSize() / 2;
00052 }

Here is the call graph for this function:

Here is the caller graph for this function:

void CrossHair::Reset (  ) 

Definition at line 43 of file crosshair.cpp.

00044 {
00045   ActiveCharacter().SetFiringAngle(0.0);
00046 }

Here is the call graph for this function:


Member Data Documentation

Point2i CrossHair::crosshair_position [private]

Definition at line 36 of file crosshair.h.

bool CrossHair::enable

Definition at line 32 of file crosshair.h.

Surface CrossHair::image [private]

Definition at line 35 of file crosshair.h.


The documentation for this class was generated from the following files:
Generated on Mon Jan 1 13:44:07 2007 for Wormux by  doxygen 1.4.7