rScreenSize Struct Reference

#include <rScreen.h>

List of all members.

Public Member Functions

 rScreenSize (int width, int height)
 constructor
 rScreenSize (rResolution r=ArmageTron_Invalid)
 constructor
void UpdateSize ()
 update size from res enum
bool operator== (rScreenSize const &other) const
 comparison operator
bool operator!= (rScreenSize const &other) const
 comparison operator
int Compare (rScreenSize const &other) const
 comparison function

Public Attributes

rResolution res
int width
int height


Detailed Description

Definition at line 56 of file rScreen.h.


Constructor & Destructor Documentation

rScreenSize::rScreenSize ( int  w,
int  h 
)

constructor

Parameters:
w screen width
h screen height

Definition at line 229 of file rScreen.cpp.

00231         :res( ArmageTron_Invalid ), width(w), height(h)
00232 {

rScreenSize::rScreenSize ( rResolution  r = ArmageTron_Invalid  )  [explicit]

constructor

Parameters:
r 

Definition at line 244 of file rScreen.cpp.

References UpdateSize().

00246         :res( r ), width(0), height(0)
00247 {
00248     UpdateSize();

Here is the call graph for this function:


Member Function Documentation

void rScreenSize::UpdateSize ( void   ) 

update size from res enum

Definition at line 259 of file rScreen.cpp.

References ArmageTron_Invalid, height, res, and width.

Referenced by lowlevel_sr_InitDisplay(), and rScreenSize().

00261 {
00262     if ( res != ArmageTron_Invalid )
00263     {
00264         width = ::width[res];
00265         height = ::height[res];
00266         // res = ArmageTron_Invalid;
00267     }

Here is the caller graph for this function:

bool rScreenSize::operator== ( rScreenSize const &  other  )  const

comparison operator

Parameters:
other size to compare with
Returns:
true iff equal

Definition at line 280 of file rScreen.cpp.

References Compare().

00282 {
00283     return Compare( other ) == 0;

Here is the call graph for this function:

bool rScreenSize::operator!= ( rScreenSize const &  other  )  const

comparison operator

Parameters:
other size to compare with
Returns:
true iff not equal

Definition at line 296 of file rScreen.cpp.

References Compare().

00298 {
00299     return Compare( other ) != 0;

Here is the call graph for this function:

int rScreenSize::Compare ( rScreenSize const &  other  )  const

comparison function

Parameters:
other size to compare with
Returns:
0 if eqal, -1 if this is smaller, +1 if other is smaller

Definition at line 312 of file rScreen.cpp.

References height, and width.

Referenced by operator!=(), operator<(), and operator==().

00314 {
00315     // desktop size dominates all
00316     if ( width == 0 && other.width != 0 )
00317         return 1;
00318     if ( other.width == 0 && width != 0 )
00319         return -1;
00320 
00321     if ( width < other.width )
00322         return -1;
00323     else if ( width > other.width )
00324         return 1;
00325 
00326     if ( height < other.height )
00327         return -1;
00328     else if ( height > other.height )
00329         return 1;
00330 
00331     /* res is not really a criterion, ignore it
00332     if ( res < other.res )
00333         return -1;
00334     else if ( res > other.res )
00335         return 1;
00336     */
00337 
00338     return 0;

Here is the caller graph for this function:


Member Data Documentation

rResolution rScreenSize::res

Definition at line 58 of file rScreen.h.

Referenced by lowlevel_sr_InitDisplay(), and UpdateSize().

int rScreenSize::width

Definition at line 59 of file rScreen.h.

Referenced by Compare(), gResMenEntry::gResMenEntry(), lowlevel_sr_InitDisplay(), and UpdateSize().

int rScreenSize::height

Definition at line 59 of file rScreen.h.

Referenced by Compare(), gResMenEntry::gResMenEntry(), lowlevel_sr_InitDisplay(), and UpdateSize().


The documentation for this struct was generated from the following files:
Generated on Sat Mar 15 23:53:40 2008 for Armagetron Advanced by  doxygen 1.5.4