Main Page   Alphabetical List   Compound List   File List   Compound Members   File Members   Examples  

IsoGeometryTools.cpp File Reference

Contains the definitions of the tools commonly used to manipulate the POINT and the RECT structures, as well as those that simplify the transition between the MFC-style rectangle structure, and the SDL-style rectangular structure. More...

#include "IsoGeometryTools.h"

Include dependency graph for IsoGeometryTools.cpp:

Include dependency graph

Go to the source code of this file.

Functions

POINT CreatePoint (int x, int y)
 Creates a new POINT with the given coordinates. More...

SDL_Rect * GetSDLRect (POINT *p)
 Makes an SDL_Rect out of the POINT passed in. More...

bool PointInRect (RECT *r, POINT *p)
 Returns true if the point passed in is in the rect passed in. More...

void setRectEmpty (RECT *rectangle)
 Sets all the datat members of the RECT passed in to zero. More...

void setRect (RECT *rectangle, long left, long top, long right, long bottom)
 Sets the data members of the RECT passed in to the values passed in. More...

void CopyRect (RECT *destination, RECT *source)
 Copies the source rectangle into the destination rectangle. More...

void OffsetRect (RECT *rectangle, int dx, int dy)
 Moves the rectangle passed in by the values passed in. More...

void OffsetRect (RECT *rectangle, POINT point)
SDL_Rect * GetSDLRect (RECT *r)
 Makes an SDL_Rect out of a RECT. More...


Detailed Description

Contains the definitions of the tools commonly used to manipulate the POINT and the RECT structures, as well as those that simplify the transition between the MFC-style rectangle structure, and the SDL-style rectangular structure.

Note:
The author himself is in doubts exactly why he chose to employ the MFC-style RECT structure in the first place, and didn't stick solely to SDL_Rect. There were several reasons to that, actually, but one of these days the migration to one and only standard will be made, instead of using the two different ones in different chunks of code and having to convert between them.
Revision history: v1.2 - added the setRect method v1.1 - added the PointInRect and the setRectEmpty methods

Author:
Vovansim (aka Scorpion)
Version:
1.2
Date:
May 26, 2003

Definition in file IsoGeometryTools.cpp.


Function Documentation

void CopyRect RECT   destination,
RECT   source
 

Copies the source rectangle into the destination rectangle.

Examples:
TileEngineExample.cpp.

Definition at line 93 of file IsoGeometryTools.cpp.

References RECT::bottom, RECT::left, RECT::right, and RECT::top.

POINT CreatePoint int    x,
int    y
 

Creates a new POINT with the given coordinates.

Definition at line 28 of file IsoGeometryTools.cpp.

References POINT::x, and POINT::y.

SDL_Rect* GetSDLRect RECT   r
 

Makes an SDL_Rect out of a RECT.

Definition at line 114 of file IsoGeometryTools.cpp.

References RECT::bottom, RECT::left, RECT::right, and RECT::top.

SDL_Rect* GetSDLRect POINT   p
 

Makes an SDL_Rect out of the POINT passed in.

Width and Height are 0.

Definition at line 38 of file IsoGeometryTools.cpp.

References POINT::x, and POINT::y.

void OffsetRect RECT   rectangle,
POINT    point
 

Definition at line 109 of file IsoGeometryTools.cpp.

References OffsetRect, POINT::x, and POINT::y.

void OffsetRect RECT   rectangle,
int    dx,
int    dy
 

Moves the rectangle passed in by the values passed in.

Definition at line 101 of file IsoGeometryTools.cpp.

References RECT::bottom, RECT::left, RECT::right, and RECT::top.

bool PointInRect RECT   r,
POINT   p
 

Returns true if the point passed in is in the rect passed in.

Definition at line 50 of file IsoGeometryTools.cpp.

References RECT::bottom, RECT::left, RECT::right, RECT::top, POINT::x, and POINT::y.

void setRect RECT   rectangle,
long    left,
long    top,
long    right,
long    bottom
 

Sets the data members of the RECT passed in to the values passed in.

Examples:
TileEngineExample.cpp.

Definition at line 85 of file IsoGeometryTools.cpp.

References RECT::bottom, RECT::left, RECT::right, and RECT::top.

void setRectEmpty RECT   rectangle
 

Sets all the datat members of the RECT passed in to zero.

Definition at line 77 of file IsoGeometryTools.cpp.

References RECT::bottom, RECT::left, RECT::right, and RECT::top.


Generated on Mon May 26 22:13:19 2003 for SDL Isometric Engine by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002