Construct from SDL_Rect

This commit is contained in:
James Turk 2003-02-10 05:40:28 +00:00
parent 66bf1cc7ee
commit 631ff8ded1
2 changed files with 18 additions and 2 deletions

View File

@ -13,7 +13,7 @@
File: ZE_ZRect.h <br>
Description: Header file for core ZEngine Rectangle Object. <br>
Author(s): James Turk <br>
$Id: ZE_ZRect.h,v 1.7 2003/02/10 04:40:16 cozman Exp $<br>
$Id: ZE_ZRect.h,v 1.8 2003/02/10 05:40:28 cozman Exp $<br>
\file ZE_ZRect.h
\brief Definition file for ZRect.
@ -66,6 +66,14 @@ class ZRect
**/
ZRect(float x, float y, float width, float height);
/*!
\brief Constructor for ZRect that uses an SDL_Rect.
Constructor for ZRect that initializes from an SDL_Rect.
\param rect SDL_Rect to intialize from.
**/
ZRect(const SDL_Rect &rect);
/*!
\brief Copy constructor for ZRect.

View File

@ -13,7 +13,7 @@
File: ZE_ZRect.cpp <br>
Description: Implementation source file for core ZEngine Rectangle Object. <br>
Author(s): James Turk <br>
$Id: ZE_ZRect.cpp,v 1.8 2003/02/10 04:40:30 cozman Exp $<br>
$Id: ZE_ZRect.cpp,v 1.9 2003/02/10 05:40:28 cozman Exp $<br>
\file ZE_ZRect.cpp
\brief Source file for ZRect.
@ -36,6 +36,14 @@ ZRect::ZRect(float x, float y, float width, float height) :
{
}
ZRect::ZRect(const SDL_Rect &rect) :
rX(static_cast<float>(rect.x)),
rY(static_cast<float>(rect.y)),
rWidth(static_cast<float>(rect.w)),
rHeight(static_cast<float>(rect.h))
{
}
ZRect::ZRect(const ZRect &rhs) :
rX(rhs.X()),rY(rhs.Y()),rWidth(rhs.Width()),rHeight(rhs.Height())
{