source: trunk/src/ddraw/rectangle.cpp@ 405

Last change on this file since 405 was 405, checked in by hugh, 26 years ago

Fixed bug in locked region handling

File size: 1.3 KB
Line 
1#include "rectangle.h"
2
3DDRectangle::DDRectangle ( Coord y1,
4 Coord x1,
5 Coord y2,
6 Coord x2 )
7{
8 lTop = y1;
9 lLeft = x1;
10 lBottom = y2;
11 lRight = x2;
12 pMemPtr = 0;
13}
14
15IBase::Boolean DDRectangle::operator == ( const DDRectangle &aRect ) const
16 {
17 return ( lTop == aRect.lTop && lLeft == aRect.lLeft
18 &&
19 lBottom == aRect.lBottom && lRight == aRect.lRight);
20 }
21IBase::Boolean DDRectangle::operator != ( const DDRectangle& aRect ) const
22 {
23 return !( *this == aRect );
24 }
25IBase::Boolean DDRectangle::intersects ( const DDRectangle &aRect ) const
26{
27 return ( lTop < aRect.lBottom && lLeft<aRect.lRight
28 &&
29 aRect.lTop < lBottom && aRect.lLeft < lRight );
30}
31
32DDRectangle::Coord DDRectangle::width ( ) const
33{
34 return ( lRight - lLeft);
35}
36
37DDRectangle::Coord DDRectangle::height ( ) const
38{
39 return ( lBottom - lTop);
40}
41
42DDRectangle::Coord DDRectangle::Top() const
43{
44 return lTop;
45}
46
47DDRectangle::Coord DDRectangle::Left() const
48{
49 return lLeft;
50}
51
52DDRectangle::Coord DDRectangle::Bottom() const
53{
54 return lBottom;
55}
56
57DDRectangle::Coord DDRectangle::Right() const
58{
59 return lRight;
60}
61
62void DDRectangle::SetMemPtr(void* NewMemPtr)
63{
64 pMemPtr = NewMemPtr;
65}
66
67void* DDRectangle::GetMemPtr()
68{
69 return pMemPtr;
70}
Note: See TracBrowser for help on using the repository browser.