ScummVM API documentation
Common::Point Struct Reference

#include <rect.h>

Inheritance diagram for Common::Point:
CGE2::V2D MM::MM1::Line MM::Xeen::StackEntry Sherlock::Scalpel::MapEntry Sherlock::Tattoo::MapEntry Sword25::Vertex Titanic::CStarPosition Ultima::Shared::TextPoint

Public Member Functions

constexpr Point (int16 x1, int16 y1)
 
bool operator== (const Point &p) const
 
bool operator!= (const Point &p) const
 
Point operator+ (const Point &delta) const
 
Point operator- (const Point &delta) const
 
Point operator/ (int divisor) const
 
Point operator* (int multiplier) const
 
Point operator/ (double divisor) const
 
Point operator* (double multiplier) const
 
void operator+= (const Point &delta)
 
void operator-= (const Point &delta)
 
uint sqrDist (const Point &p) const
 

Public Attributes

int16 x
 
int16 y
 

Detailed Description

Simple class for handling both 2D position and size.

Constructor & Destructor Documentation

◆ Point()

constexpr Common::Point::Point ( int16  x1,
int16  y1 
)
inline

Create a point with position defined by x1 and y1.

Member Function Documentation

◆ operator==()

bool Common::Point::operator== ( const Point p) const
inline

Determine whether the position of two points is the same.

◆ operator!=()

bool Common::Point::operator!= ( const Point p) const
inline

Determine whether the position of two points is not the same.

◆ operator+()

Point Common::Point::operator+ ( const Point delta) const
inline

Create a point by adding the delta value to a point.

◆ operator-()

Point Common::Point::operator- ( const Point delta) const
inline

Create a point by subtracting the delta value from a point.

◆ operator/() [1/2]

Point Common::Point::operator/ ( int  divisor) const
inline

Create a point by dividing a point by the (int) divisor value.

◆ operator*() [1/2]

Point Common::Point::operator* ( int  multiplier) const
inline

Create a point by multiplying a point by the (int) multiplier value.

◆ operator/() [2/2]

Point Common::Point::operator/ ( double  divisor) const
inline

Create a point by dividing a point by the (double) divisor value.

◆ operator*() [2/2]

Point Common::Point::operator* ( double  multiplier) const
inline

Create a point by multiplying a point by the (double) multiplier value.

◆ operator+=()

void Common::Point::operator+= ( const Point delta)
inline

Change a point's position by adding delta to its x and y coordinates.

◆ operator-=()

void Common::Point::operator-= ( const Point delta)
inline

Change a point's position by subtracting delta from its x and y arguments.

◆ sqrDist()

uint Common::Point::sqrDist ( const Point p) const
inline

Return the square of the distance between this point and the point p.

Parameters
pThe other point.
Returns
The distance between this and p.

Member Data Documentation

◆ x

int16 Common::Point::x

The horizontal position of the point.

◆ y

int16 Common::Point::y

The vertical position of the point.


The documentation for this struct was generated from the following file: