From 98ba22e7064db57316dfff1ae127feb3dceeb73e Mon Sep 17 00:00:00 2001 From: Justin Worthe Date: Thu, 31 Jul 2014 13:58:22 +0200 Subject: Initial commit --- docs/html/class_screen_panel.html | 508 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 508 insertions(+) create mode 100644 docs/html/class_screen_panel.html (limited to 'docs/html/class_screen_panel.html') diff --git a/docs/html/class_screen_panel.html b/docs/html/class_screen_panel.html new file mode 100644 index 0000000..cc72a9f --- /dev/null +++ b/docs/html/class_screen_panel.html @@ -0,0 +1,508 @@ + + + + +Rally X: ScreenPanel Class Reference + + + + + + + + + + + +
+ + +
+ + + + + + + + + + + + + +
+
Rally X + +
+
ELEN3009 Project by Justin Wernick and David Schneider
+
+
+ + + + + +
+
+ +
+
ScreenPanel Class Reference
+
+
+ +

Parent class for panels that are drawn on the screen. + More...

+ +

#include <ScreenPanel.h>

+
+Inheritance diagram for ScreenPanel:
+
+
+ + +GamePanel +InfoPanel + +
+ +

List of all members.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

 ScreenPanel (ALLEGRO_BITMAP *back, ALLEGRO_BITMAP *front, int x, int y, int width, int height)
 Creates a ScreenPanel from the given back and front buffers.
virtual ~ScreenPanel ()
 Destructor to ensure that sub-bitmap memory is deallocated.
virtual void draw (const Maze &maze, const list< PlayerCar > &players, const list< EnemyCar > &enemies, const list< Checkpoint > &checkpoints, const list< Rock > &rocks, const list< Smokescreen > &smokescreens, const list< DestroyedObjectPopup > &popups)=0
 Pure virtual method for drawing a collection of objects onto the panel.
virtual void flip ()
 Swaps the front and back buffers.

+Protected Attributes

ALLEGRO_BITMAP * _back
 The back buffer. Only the back buffer can be drawn to.
int _width
 The width of the sub-bitmaps being drawn to in pixels.
int _height
 The height of the sub-bitmaps being drawn to in pixels.

+Static Protected Attributes

static const ALLEGRO_COLOR BLANK = al_map_rgb(0,0,0)
 Colour used to clear the screen at the beginning of drawing operations.

+Private Member Functions

 ScreenPanel (const ScreenPanel &ref)
 Copy constructor not implemented, ScreenPanels should not be copied.
ScreenPaneloperator= (const ScreenPanel &rhs)
 Assignment operator not implemented, ScreenPanels should not be copied.

+Private Attributes

AllegroInit _allegro
 Handles dependencies on Allegro being initialised.
ALLEGRO_BITMAP * _front
 The front buffer, that is currently being shown on the screen.
+

Detailed Description

+

Parent class for panels that are drawn on the screen.

+

Panels are given a sub-bitmap of the Screen bitmap, which they draw their panel specific outputs on. The ScreenPanel class is subclassed to give specific drawing functions, like drawing the Maze and GameObjects on the screen.

+

When the object is created, the back bitmap and front bitmap should correspond to the back and front buffers of the display respectively. This should be kept in sync by calling flip every time the display is flipped.

+
Author:
Justin Wernick
+
+David Schneider
+ +

Definition at line 29 of file ScreenPanel.h.

+

Constructor & Destructor Documentation

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ScreenPanel::ScreenPanel (ALLEGRO_BITMAP * back,
ALLEGRO_BITMAP * front,
int x,
int y,
int width,
int height 
)
+
+
+ +

Creates a ScreenPanel from the given back and front buffers.

+

The sub-bitmaps that ScreenPanel uses are created from a rectangular region on back and front that has its top left corner at the coordinate x,y, is width long in the x direction, and height long in the y direction.

+
Parameters:
+ + + + + + + +
[in]backThe current back buffer of the display being sub-bitmapped.
[in]frontThe current front buffer (image currently being displayed) of the display being sub-bitmapped.
[in]xThe x coordinate of the left side of the sub-bitmap in pixels.
[in]yThe x coordinate of the top of the sub-bitmap in pixels.
[in]widthThe length in the x direction of the new sub-bitmap in pixels.
[in]heightThe length in the y direction of the new sub-bitmap in pixels.
+
+
+ +

Definition at line 5 of file ScreenPanel.cpp.

+ +
+
+ +
+
+ + + + + + + +
ScreenPanel::~ScreenPanel () [virtual]
+
+
+ +

Destructor to ensure that sub-bitmap memory is deallocated.

+ +

Definition at line 13 of file ScreenPanel.cpp.

+ +
+
+ +
+
+ + + + + + + + +
ScreenPanel::ScreenPanel (const ScreenPanelref) [private]
+
+
+ +

Copy constructor not implemented, ScreenPanels should not be copied.

+ +
+
+

Member Function Documentation

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
virtual void ScreenPanel::draw (const Mazemaze,
const list< PlayerCar > & players,
const list< EnemyCar > & enemies,
const list< Checkpoint > & checkpoints,
const list< Rock > & rocks,
const list< Smokescreen > & smokescreens,
const list< DestroyedObjectPopup > & popups 
) [pure virtual]
+
+
+ +

Pure virtual method for drawing a collection of objects onto the panel.

+

Implementations do not need to draw all of the objects if it is not neccesary for the type of panel, but the interface accepts all of them to be general.

+
Parameters:
+ + + + + + + + +
[in]mazeThe Maze that all of the objects are in.
[in]playersThe list of PlayerCars to be drawn.
[in]enemiesThe list of EnemyCars to be drawn.
[in]checkpointsThe list of Checkpoints to be drawn.
[in]rocksThe list of Rocks to be drawn.
[in]smokescreensThe list of Smokescreens to be drawn.
[in]popupsThe list of DestroyedObjectPopups to be drawn.
+
+
+ +

Implemented in InfoPanel, and GamePanel.

+ +
+
+ +
+
+ + + + + + + +
void ScreenPanel::flip () [virtual]
+
+
+ +

Swaps the front and back buffers.

+

This function should be called every time the display is flipped.

+ +

Definition at line 19 of file ScreenPanel.cpp.

+ +
+
+ +
+
+ + + + + + + + +
ScreenPanel& ScreenPanel::operator= (const ScreenPanelrhs) [private]
+
+
+ +

Assignment operator not implemented, ScreenPanels should not be copied.

+ +
+
+

Member Data Documentation

+ +
+
+ + + + +
AllegroInit ScreenPanel::_allegro [private]
+
+
+ +

Handles dependencies on Allegro being initialised.

+ +

Reimplemented in GamePanel.

+ +

Definition at line 93 of file ScreenPanel.h.

+ +
+
+ +
+
+ + + + +
ALLEGRO_BITMAP* ScreenPanel::_back [protected]
+
+
+ +

The back buffer. Only the back buffer can be drawn to.

+ +

Definition at line 79 of file ScreenPanel.h.

+ +
+
+ +
+
+ + + + +
ALLEGRO_BITMAP* ScreenPanel::_front [private]
+
+
+ +

The front buffer, that is currently being shown on the screen.

+ +

Definition at line 95 of file ScreenPanel.h.

+ +
+
+ +
+
+ + + + +
int ScreenPanel::_height [protected]
+
+
+ +

The height of the sub-bitmaps being drawn to in pixels.

+ +

Definition at line 82 of file ScreenPanel.h.

+ +
+
+ +
+
+ + + + +
int ScreenPanel::_width [protected]
+
+
+ +

The width of the sub-bitmaps being drawn to in pixels.

+ +

Definition at line 81 of file ScreenPanel.h.

+ +
+
+ +
+
+ + + + +
const ALLEGRO_COLOR ScreenPanel::BLANK = al_map_rgb(0,0,0) [static, protected]
+
+
+ +

Colour used to clear the screen at the beginning of drawing operations.

+ +

Definition at line 77 of file ScreenPanel.h.

+ +
+
+
The documentation for this class was generated from the following files: +
+ +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator
+ + +
+ +
+ + + + + + + -- cgit v1.2.3