#include <rScreen.h>
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 |
Definition at line 56 of file rScreen.h.
rScreenSize::rScreenSize | ( | int | w, | |
int | h | |||
) |
constructor
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
r |
Definition at line 244 of file rScreen.cpp.
References UpdateSize().
00246 :res( r ), width(0), height(0) 00247 { 00248 UpdateSize();
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 }
bool rScreenSize::operator== | ( | rScreenSize const & | other | ) | const |
comparison operator
other | size to compare with |
Definition at line 280 of file rScreen.cpp.
References Compare().
00282 { 00283 return Compare( other ) == 0;
bool rScreenSize::operator!= | ( | rScreenSize const & | other | ) | const |
comparison operator
other | size to compare with |
Definition at line 296 of file rScreen.cpp.
References Compare().
00298 { 00299 return Compare( other ) != 0;
int rScreenSize::Compare | ( | rScreenSize const & | other | ) | const |
comparison function
other | size to compare with |
Definition at line 312 of file rScreen.cpp.
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;
Definition at line 59 of file rScreen.h.
Referenced by Compare(), gResMenEntry::gResMenEntry(), lowlevel_sr_InitDisplay(), and UpdateSize().
Definition at line 59 of file rScreen.h.
Referenced by Compare(), gResMenEntry::gResMenEntry(), lowlevel_sr_InitDisplay(), and UpdateSize().