| 6 | #include <generated/client_data7.h> |
| 7 | |
| 8 | void CGraphics_Threaded::SelectSprite(const CDataSprite *pSprite, int Flags) |
| 9 | { |
| 10 | int x = pSprite->m_X; |
| 11 | int y = pSprite->m_Y; |
| 12 | int w = pSprite->m_W; |
| 13 | int h = pSprite->m_H; |
| 14 | int cx = pSprite->m_pSet->m_Gridx; |
| 15 | int cy = pSprite->m_pSet->m_Gridy; |
| 16 | |
| 17 | GetSpriteScaleImpl(w, h, m_SpriteScale.x, m_SpriteScale.y); |
| 18 | |
| 19 | float x1 = x / (float)cx + 0.5f / (float)(cx * 32); |
| 20 | float x2 = (x + w) / (float)cx - 0.5f / (float)(cx * 32); |
| 21 | float y1 = y / (float)cy + 0.5f / (float)(cy * 32); |
| 22 | float y2 = (y + h) / (float)cy - 0.5f / (float)(cy * 32); |
| 23 | |
| 24 | if(Flags & SPRITE_FLAG_FLIP_Y) |
| 25 | std::swap(y1, y2); |
| 26 | |
| 27 | if(Flags & SPRITE_FLAG_FLIP_X) |
| 28 | std::swap(x1, x2); |
| 29 | |
| 30 | QuadsSetSubset(x1, y1, x2, y2); |
| 31 | } |
| 32 | |
| 33 | void CGraphics_Threaded::SelectSprite(int Id, int Flags) |
| 34 | { |
no outgoing calls
no test coverage detected