| 199 | } |
| 200 | |
| 201 | void Sprite::updateVertTexCoord() { |
| 202 | if (_texture) { |
| 203 | const bgfx::TextureInfo& info = _texture->getInfo(); |
| 204 | float left = _textureRect.getX() / info.width; |
| 205 | float top = _textureRect.getY() / info.height; |
| 206 | float right = (_textureRect.getX() + _textureRect.getWidth()) / info.width; |
| 207 | float bottom = (_textureRect.getY() + _textureRect.getHeight()) / info.height; |
| 208 | _quad.rb.u = right; |
| 209 | _quad.rb.v = bottom; |
| 210 | _quad.lb.u = left; |
| 211 | _quad.lb.v = bottom; |
| 212 | _quad.lt.u = left; |
| 213 | _quad.lt.v = top; |
| 214 | _quad.rt.u = right; |
| 215 | _quad.rt.v = top; |
| 216 | } |
| 217 | } |
| 218 | |
| 219 | void Sprite::updateVertPosition() { |
| 220 | float width = getWidth(); |