add ratios
This commit is contained in:
@@ -80,6 +80,11 @@ public:
|
|||||||
int GetImageFrameWidth() const {return GetImageWidth() / GetFramesWide();}
|
int GetImageFrameWidth() const {return GetImageWidth() / GetFramesWide();}
|
||||||
int GetImageFrameHeight() const {return GetImageHeight() / GetFramesHigh();}
|
int GetImageFrameHeight() const {return GetImageHeight() / GetFramesHigh();}
|
||||||
|
|
||||||
|
/* Use these to convert between the different coordinate systems: */
|
||||||
|
float GetSourceToImageCoordsRatio() const { return float(GetImageWidth()) / GetSourceWidth(); }
|
||||||
|
float GetImageToTexCoordsRatio() const { return 1.0f / GetTextureWidth(); }
|
||||||
|
float GetSourceToTexCoordsRatio() const { return GetSourceToImageCoordsRatio() * GetImageToTexCoordsRatio(); }
|
||||||
|
|
||||||
const RectF *GetTextureCoordRect( int frameNo ) const;
|
const RectF *GetTextureCoordRect( int frameNo ) const;
|
||||||
int GetNumFrames() const { return m_iFramesWide*m_iFramesHigh; }
|
int GetNumFrames() const { return m_iFramesWide*m_iFramesHigh; }
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user