get rid of RECT defines

This commit is contained in:
Glenn Maynard
2002-12-17 06:25:03 +00:00
parent 0a88da22e7
commit 67f7a15deb
3 changed files with 6 additions and 11 deletions
+4 -4
View File
@@ -323,8 +323,8 @@ void Actor::SetTweenGlow( RageColor c ) { LatestTween().glow = c; };
void Actor::ScaleTo( const RectI &rect, StretchType st )
{
// width and height of rectangle
float rect_width = (float)RECTWIDTH(rect);
float rect_height = (float)RECTHEIGHT(rect);
float rect_width = (float) rect.GetWidth();
float rect_height = (float) rect.GetHeight();
if( rect_width < 0 ) SetRotationY( PI );
if( rect_height < 0 ) SetRotationX( PI );
@@ -356,8 +356,8 @@ void Actor::ScaleTo( const RectI &rect, StretchType st )
void Actor::StretchTo( const RectI &rect )
{
// width and height of rectangle
int rect_width = RECTWIDTH(rect);
int rect_height = RECTHEIGHT(rect);
int rect_width = rect.GetWidth();
int rect_height = rect.GetHeight();
// center of the rectangle
float rect_cx = rect.left + rect_width/2.0f;
+2 -2
View File
@@ -152,8 +152,8 @@ void Background::LoadFromSong( Song* pSong )
{
Unload();
const float fXZoom = RECTWIDTH(RECT_BACKGROUND) / (float)SCREEN_WIDTH;
const float fYZoom = RECTHEIGHT(RECT_BACKGROUND) / (float)SCREEN_HEIGHT;
const float fXZoom = RECT_BACKGROUND.GetWidth() / (float)SCREEN_WIDTH;
const float fYZoom = RECT_BACKGROUND.GetHeight() / (float)SCREEN_HEIGHT;
const CString sSongBackgroundPath = pSong->HasBackground() ? pSong->GetBackgroundPath() : THEME->GetPathTo("Graphics","fallback background");
-5
View File
@@ -23,11 +23,6 @@
#define ZERO(x) memset(&x, 0, sizeof(x))
#define COPY(a,b) { ASSERT(sizeof(a)==sizeof(b)); memcpy(&a, &b, sizeof(a)); }
#define RECTWIDTH(rect) ((rect).right - (rect).left)
#define RECTHEIGHT(rect) ((rect).bottom - (rect).top)
inline int RECTCENTERX(RECT rect) { return rect.left + (rect.right-rect.left)/2; }
inline int RECTCENTERY(RECT rect) { return rect.top + (rect.bottom-rect.top)/2; }
/* Common harmless mismatches. */
#ifndef min
inline float min(float a, int b) { return a < b? a:b; }