MCPcopy Create free account
hub / github.com/carbonengine/trinity / CalcSubTextureWindow

Method CalcSubTextureWindow

trinity/Tr2AtlasTexture.cpp:109–137  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

107}
108
109void Tr2AtlasTexture::CalcSubTextureWindow( Vector4& tw, float rectX, float rectY, float rectWidth, float rectHeight )
110{
111 Tr2TextureAL* tex = GetTexture();
112
113 if( !tex )
114 {
115 tw.x = 0.0f;
116 tw.y = 0.0f;
117 tw.w = 1.0f;
118 tw.z = 1.0f;
119
120 return;
121 }
122
123 if( rectWidth == 0.0f )
124 {
125 rectWidth = (float)m_width;
126 }
127
128 if( rectHeight == 0 )
129 {
130 rectHeight = (float)m_height;
131 }
132
133 tw.x = (float)( m_x + rectX ) * m_textureWidthReciprocal;
134 tw.y = (float)( m_y + rectY ) * m_textureHeightReciprocal;
135 tw.z = (float)rectWidth * m_textureWidthReciprocal;
136 tw.w = (float)rectHeight * m_textureHeightReciprocal;
137}
138
139void Tr2AtlasTexture::OnShutdown()
140{

Callers 2

ExecuteMethod · 0.80
SetTextureWindowMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected