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

Last change on this file since 6950 was 6950, checked in by sandervl, 24 years ago

updates for stretch blitting

File size: 1.2 KB
Line 
1/* $Id: rectangle.cpp,v 1.7 2001-10-05 12:33:10 sandervl Exp $ */
2
3/*
4 * Rectangle class Implementaion
5 *
6 * Copyright 1999 Markus Montkowski
7 *
8 * Project Odin Software License can be found in LICENSE.TXT
9 *
10 */
11
12typedef unsigned long BOOL;
13
14#include "rectangle.h"
15
16DDRectangle::DDRectangle ( Coord x1,
17 Coord y1,
18 Coord x2,
19 Coord y2 )
20{
21 lTop = y1;
22 lLeft = x1;
23 lBottom = y2;
24 lRight = x2;
25 pMemPtr = 0;
26}
27
28BOOL DDRectangle::operator == ( const DDRectangle &aRect ) const
29 {
30 return ( lTop == aRect.lTop && lLeft == aRect.lLeft
31 &&
32 lBottom == aRect.lBottom && lRight == aRect.lRight);
33 }
34BOOL DDRectangle::operator != ( const DDRectangle& aRect ) const
35 {
36 return !( *this == aRect );
37 }
38BOOL DDRectangle::intersects ( const DDRectangle &aRect ) const
39{
40 return ( lTop < aRect.lBottom && lLeft<aRect.lRight
41 &&
42 aRect.lTop < lBottom && aRect.lLeft < lRight );
43}
44
45DDRectangle::Coord DDRectangle::width ( ) const
46{
47 return ( lRight - lLeft);
48}
49
50DDRectangle::Coord DDRectangle::height ( ) const
51{
52 return ( lBottom - lTop);
53}
54
55void DDRectangle::SetMemPtr(void* NewMemPtr)
56{
57 pMemPtr = NewMemPtr;
58}
59
60void* DDRectangle::GetMemPtr()
61{
62 return pMemPtr;
63}
Note: See TracBrowser for help on using the repository browser.