Rev | Line | |
---|
[6950] | 1 | /* $Id: rectangle.h,v 1.7 2001-10-05 12:33:10 sandervl Exp $ */
|
---|
[2174] | 2 |
|
---|
| 3 | /*
|
---|
| 4 | * Rectangle class used to keep track of locked rects in surfaces
|
---|
| 5 | *
|
---|
| 6 | * Copyright 1999 Markus Montkowski
|
---|
| 7 | *
|
---|
| 8 | * Project Odin Software License can be found in LICENSE.TXT
|
---|
| 9 | *
|
---|
| 10 | */
|
---|
| 11 |
|
---|
[312] | 12 | #ifndef __DDRectandle
|
---|
| 13 | #define __DDRectandle
|
---|
| 14 |
|
---|
[2174] | 15 | class DDRectangle {
|
---|
[312] | 16 | public:
|
---|
| 17 | /*------------------------------ Related Types -------------------------------*/
|
---|
| 18 | typedef long Coord;
|
---|
| 19 |
|
---|
| 20 | /*------------------------------- Constructors -------------------------------*/
|
---|
| 21 | DDRectangle ( );
|
---|
| 22 |
|
---|
| 23 |
|
---|
| 24 | DDRectangle ( Coord point1X,
|
---|
| 25 | Coord point1Y,
|
---|
| 26 | Coord point2X,
|
---|
| 27 | Coord point2Y );
|
---|
| 28 |
|
---|
| 29 |
|
---|
| 30 | /*------------------------------- Comparisons --------------------------------*/
|
---|
[2174] | 31 | BOOL
|
---|
[5344] | 32 | operator == ( const DDRectangle &rectangle ) const,
|
---|
| 33 | operator != ( const DDRectangle &rectangle ) const;
|
---|
[312] | 34 |
|
---|
| 35 | /*--------------------------------- Testing ----------------------------------*/
|
---|
[2174] | 36 | BOOL
|
---|
[312] | 37 | intersects ( const DDRectangle& rectangle ) const;
|
---|
| 38 |
|
---|
| 39 | Coord
|
---|
| 40 | width() const,
|
---|
[6950] | 41 | height() const;
|
---|
[312] | 42 |
|
---|
[6950] | 43 | Coord Top() const
|
---|
| 44 | {
|
---|
| 45 | return lTop;
|
---|
| 46 | }
|
---|
| 47 |
|
---|
| 48 | Coord Left() const
|
---|
| 49 | {
|
---|
| 50 | return lLeft;
|
---|
| 51 | }
|
---|
| 52 |
|
---|
| 53 | Coord Bottom() const
|
---|
| 54 | {
|
---|
| 55 | return lBottom;
|
---|
| 56 | }
|
---|
| 57 |
|
---|
| 58 | Coord Right() const
|
---|
| 59 | {
|
---|
| 60 | return lRight;
|
---|
| 61 | }
|
---|
| 62 |
|
---|
[405] | 63 | void* GetMemPtr();
|
---|
| 64 | void SetMemPtr(void* NewMemPtr);
|
---|
| 65 |
|
---|
[312] | 66 | private:
|
---|
[405] | 67 | void* pMemPtr; // Pointer to surface memory for this rectangle
|
---|
[312] | 68 | long lTop,lLeft;
|
---|
| 69 | long lBottom,lRight;
|
---|
| 70 | }; // class DDRectangle
|
---|
| 71 |
|
---|
| 72 | #endif
|
---|
Note:
See
TracBrowser
for help on using the repository browser.