s/FRECT/RectF/
This commit is contained in:
@@ -158,7 +158,7 @@ found_effect:
|
||||
m_iNumSprites = 1;
|
||||
m_Sprites[0].Load( sPath, false, 4, 4, false, true );
|
||||
m_Sprites[0].StretchTo( RectI(SCREEN_LEFT,SCREEN_TOP,SCREEN_RIGHT,SCREEN_BOTTOM) );
|
||||
m_Sprites[0].SetCustomTextureRect( FRECT(0,0,1,1) );
|
||||
m_Sprites[0].SetCustomTextureRect( RectF(0,0,1,1) );
|
||||
|
||||
switch( m_Effect )
|
||||
{
|
||||
|
||||
@@ -39,7 +39,7 @@ void Banner::Update( float fDeltaTime )
|
||||
m_fPercentScrolling += fDeltaTime/2;
|
||||
m_fPercentScrolling -= (int)m_fPercentScrolling;
|
||||
|
||||
FRECT* pTextureRect = m_pTexture->GetTextureCoordRect(0);
|
||||
RectF *pTextureRect = m_pTexture->GetTextureCoordRect(0);
|
||||
|
||||
float fTexCoords[8] =
|
||||
{
|
||||
|
||||
@@ -262,7 +262,7 @@ void BitmapText::DrawPrimitives()
|
||||
//
|
||||
iNumV -= 4;
|
||||
|
||||
FRECT frectTexCoords = *pTexture->GetTextureCoordRect( iFrameNo );
|
||||
RectF frectTexCoords = *pTexture->GetTextureCoordRect( iFrameNo );
|
||||
|
||||
// Tweak the textures frame rectangles so we don't draw extra
|
||||
// to the left and right of the character, saving us fill rate.
|
||||
|
||||
@@ -79,7 +79,7 @@ void CroppedSprite::CropToSize( float fWidth, float fHeight )
|
||||
float fPercentageToCutOffEachSide = fPercentageToCutOff / 2;
|
||||
|
||||
// generate a rectangle with new texture coordinates
|
||||
FRECT fCustomImageCoords(
|
||||
RectF fCustomImageCoords(
|
||||
fPercentageToCutOffEachSide,
|
||||
0,
|
||||
1 - fPercentageToCutOffEachSide,
|
||||
@@ -92,7 +92,7 @@ void CroppedSprite::CropToSize( float fWidth, float fHeight )
|
||||
float fPercentageToCutOffEachSide = fPercentageToCutOff / 2;
|
||||
|
||||
// generate a rectangle with new texture coordinates
|
||||
FRECT fCustomImageCoords(
|
||||
RectF fCustomImageCoords(
|
||||
0,
|
||||
fPercentageToCutOffEachSide,
|
||||
1,
|
||||
|
||||
@@ -50,7 +50,7 @@ void GradeDisplay::Update( float fDeltaTime )
|
||||
else
|
||||
fPercentIntoScrolling = (1 + 1.0f/NUM_GRADE_FRAMES) - ((fPercentIntoScrolling-0.9f)/0.1f) * 1.0f/NUM_GRADE_FRAMES;
|
||||
|
||||
FRECT frectCurrentTextureCoords;
|
||||
RectF frectCurrentTextureCoords;
|
||||
frectCurrentTextureCoords.left = m_frectStartTexCoords.left*(1-fPercentIntoScrolling) + m_frectDestTexCoords.left*fPercentIntoScrolling;
|
||||
frectCurrentTextureCoords.top = m_frectStartTexCoords.top*(1-fPercentIntoScrolling) + m_frectDestTexCoords.top*fPercentIntoScrolling;
|
||||
frectCurrentTextureCoords.right = m_frectStartTexCoords.right*(1-fPercentIntoScrolling) + m_frectDestTexCoords.right*fPercentIntoScrolling;
|
||||
|
||||
@@ -35,7 +35,7 @@ protected:
|
||||
|
||||
// for scrolling
|
||||
bool m_bDoScrolling;
|
||||
FRECT m_frectStartTexCoords;
|
||||
FRECT m_frectDestTexCoords;
|
||||
RectF m_frectStartTexCoords;
|
||||
RectF m_frectDestTexCoords;
|
||||
float m_fTimeLeftInScroll;
|
||||
};
|
||||
|
||||
@@ -168,7 +168,7 @@ public:
|
||||
// set custom texture coords
|
||||
// float fPrecentOffset = fRightEdgePercent;
|
||||
|
||||
FRECT frectCustomTexCoords(
|
||||
RectF frectCustomTexCoords(
|
||||
fPercentCroppedFromLeft,
|
||||
0,
|
||||
1-fPercentCroppedFromRight,
|
||||
@@ -394,7 +394,7 @@ void LifeMeterBar::DrawPrimitives()
|
||||
float fPrecentOffset = TIMER->GetTimeSinceStart();
|
||||
fPrecentOffset -= (int)fPrecentOffset;
|
||||
|
||||
FRECT frectCustomTexCoords(
|
||||
RectF frectCustomTexCoords(
|
||||
0 - fPrecentOffset,
|
||||
0,
|
||||
m_fTrailingLifePercentage - fPrecentOffset,
|
||||
|
||||
@@ -382,7 +382,7 @@ void NoteDisplay::DrawHold( const HoldNote& hn, const bool bActive, const float
|
||||
|
||||
// m_sprHoldParts.SetState( bActive?1:0 );
|
||||
// HACK: the border around the edge of on this sprite is super-obvious.
|
||||
m_sprHoldParts.SetCustomTextureRect( bActive ? FRECT(0.251f,0.002f,0.499f,0.498f) : FRECT(0.001f,0.002f,0.249f,0.498f) );
|
||||
m_sprHoldParts.SetCustomTextureRect( bActive ? RectF(0.251f,0.002f,0.499f,0.498f) : RectF(0.001f,0.002f,0.249f,0.498f) );
|
||||
m_sprHoldParts.SetXY( fX, fY );
|
||||
if( bDrawGlowOnly )
|
||||
{
|
||||
|
||||
@@ -67,7 +67,7 @@ void RageTexture::CreateFrameRects()
|
||||
{
|
||||
for( int i=0; i<m_iFramesWide; i++ ) // traverse along X (important that this is the inner loop)
|
||||
{
|
||||
FRECT frect( (i+0)/(float)m_iFramesWide*m_iImageWidth /(float)m_iTextureWidth, // these will all be between 0.0 and 1.0
|
||||
RectF frect( (i+0)/(float)m_iFramesWide*m_iImageWidth /(float)m_iTextureWidth, // these will all be between 0.0 and 1.0
|
||||
(j+0)/(float)m_iFramesHigh*m_iImageHeight/(float)m_iTextureHeight,
|
||||
(i+1)/(float)m_iFramesWide*m_iImageWidth /(float)m_iTextureWidth,
|
||||
(j+1)/(float)m_iFramesHigh*m_iImageHeight/(float)m_iTextureHeight );
|
||||
|
||||
@@ -84,7 +84,7 @@ public:
|
||||
int GetImageFrameWidth() const {return GetImageWidth() / GetFramesWide();}
|
||||
int GetImageFrameHeight() const {return GetImageHeight() / GetFramesHigh();}
|
||||
|
||||
FRECT* GetTextureCoordRect( int uFrameNo ) {return &m_TextureCoordRects[uFrameNo];}
|
||||
RectF *GetTextureCoordRect( int uFrameNo ) {return &m_TextureCoordRects[uFrameNo];}
|
||||
int GetNumFrames() const {return m_TextureCoordRects.size();}
|
||||
CString GetFilePath() const {return m_sFilePath;}
|
||||
|
||||
@@ -107,7 +107,7 @@ protected:
|
||||
// RECTs that hold the bounds of each frame in the bitmap.
|
||||
// e.g., if the texture has 4 frames of animation, the SrcRect for each frame would
|
||||
// be in m_FrameRects[0..4].
|
||||
CArray<FRECT, FRECT&> m_TextureCoordRects;
|
||||
CArray<RectF, RectF&> m_TextureCoordRects;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -203,7 +203,7 @@ void Sprite::DrawPrimitives()
|
||||
0 );
|
||||
|
||||
// use m_temp_* variables to draw the object
|
||||
FRECT quadVerticies;
|
||||
RectF quadVerticies;
|
||||
|
||||
switch( m_HorizAlign )
|
||||
{
|
||||
@@ -242,7 +242,7 @@ void Sprite::DrawPrimitives()
|
||||
else
|
||||
{
|
||||
UINT uFrameNo = m_iStateToFrame[m_iCurState];
|
||||
FRECT* pTexCoordRect = m_pTexture->GetTextureCoordRect( uFrameNo );
|
||||
RectF *pTexCoordRect = m_pTexture->GetTextureCoordRect( uFrameNo );
|
||||
|
||||
v[0].t = RageVector2( pTexCoordRect->left, pTexCoordRect->bottom ); // bottom left
|
||||
v[1].t = RageVector2( pTexCoordRect->left, pTexCoordRect->top ); // top left
|
||||
@@ -313,7 +313,7 @@ void Sprite::SetState( int iNewState )
|
||||
m_fSecsIntoState = 0.0;
|
||||
}
|
||||
|
||||
void Sprite::SetCustomTextureRect( FRECT new_texcoord_frect )
|
||||
void Sprite::SetCustomTextureRect( const RectF &new_texcoord_frect )
|
||||
{
|
||||
m_bUsingCustomTexCoords = true;
|
||||
m_CustomTexCoords[0] = new_texcoord_frect.left; m_CustomTexCoords[1] = new_texcoord_frect.bottom; // bottom left
|
||||
@@ -337,7 +337,7 @@ void Sprite::GetCustomTextureCoords( float fTexCoordsOut[8] ) // order: bottom l
|
||||
}
|
||||
|
||||
|
||||
void Sprite::SetCustomImageRect( FRECT rectImageCoords )
|
||||
void Sprite::SetCustomImageRect( RectF rectImageCoords )
|
||||
{
|
||||
// Convert to a rectangle in texture coordinate space.
|
||||
rectImageCoords.left *= m_pTexture->GetImageWidth() / (float)m_pTexture->GetTextureWidth();
|
||||
|
||||
@@ -49,11 +49,11 @@ public:
|
||||
CString GetTexturePath() { return m_sTexturePath; };
|
||||
|
||||
|
||||
void SetCustomTextureRect( FRECT new_texcoord_frect );
|
||||
void SetCustomTextureRect( const RectF &new_texcoord_frect );
|
||||
void SetCustomTextureCoords( float fTexCoords[8] );
|
||||
void GetCustomTextureCoords( float fTexCoordsOut[8] );
|
||||
void SetCustomSourceRect( FRECT rectSourceCoords ); // in source pixel space
|
||||
void SetCustomImageRect( FRECT rectImageCoords ); // in image pixel space
|
||||
void SetCustomSourceRect( const RectF &rectSourceCoords ); // in source pixel space
|
||||
void SetCustomImageRect( RectF rectImageCoords ); // in image pixel space
|
||||
void SetCustomImageCoords( float fImageCoords[8] );
|
||||
void StopUsingCustomCoords();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user