ScummVM API documentation
px_2drealpoint.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * Additional copyright for this file:
8  * Copyright (C) 1999-2000 Revolution Software Ltd.
9  * This code is based on source code created by Revolution Software,
10  * used with permission.
11  *
12  * This program is free software: you can redistribute it and/or modify
13  * it under the terms of the GNU General Public License as published by
14  * the Free Software Foundation, either version 3 of the License, or
15  * (at your option) any later version.
16  *
17  * This program is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  * GNU General Public License for more details.
21  *
22  * You should have received a copy of the GNU General Public License
23  * along with this program. If not, see <http://www.gnu.org/licenses/>.
24  *
25  */
26 
27 #ifndef ICB_PX_2DREALPOINT_H_INCLUDED
28 #define ICB_PX_2DREALPOINT_H_INCLUDED
29 
30 #include "engines/icb/common/px_rcutypes.h"
31 #include "engines/icb/common/px_common.h"
32 
33 namespace ICB {
34 
35 // A 2D point on a plane with endpoints stored as floating point.
37 public:
38  // Default constructor and destructor.
39  px2DRealPoint() {
40  m_fX = REAL_ZERO;
41  m_fY = REAL_ZERO;
42  }
43  ~px2DRealPoint() { ; }
44 
45  // Alternative constructor that allows the point to be initialized.
46  px2DRealPoint(PXreal fX, PXreal fY) {
47  m_fX = fX;
48  m_fY = fY;
49  }
50 
51  // Gets and sets.
52  void SetX(PXreal fX) { m_fX = fX; }
53  void SetY(PXreal fY) { m_fY = fY; }
54  PXreal GetX() const { return m_fX; }
55  PXreal GetY() const { return m_fY; }
56 
57  // This allows the values of a point to be set after it has been created.
58  void Set(PXreal fX, PXreal fY) {
59  m_fX = fX;
60  m_fY = fY;
61  }
62 
63 private:
64  PXreal m_fX, m_fY; // The point.
65 };
66 
67 } // End of namespace ICB
68 
69 #endif // #ifndef PX_2DREALPOINT_H_INCLUDED
Definition: actor.h:32
Definition: px_2drealpoint.h:36