| 4573 | } |
| 4574 | |
| 4575 | void PixelGameEngine::olc_UpdateMouse(int32_t x, int32_t y) |
| 4576 | { |
| 4577 | // Mouse coords come in screen space |
| 4578 | // But leave in pixel space |
| 4579 | bHasMouseFocus = true; |
| 4580 | vMouseWindowPos = { x, y }; |
| 4581 | // Full Screen mode may have a weird viewport we must clamp to |
| 4582 | x -= vViewPos.x; |
| 4583 | y -= vViewPos.y; |
| 4584 | vMousePosCache.x = (int32_t)(((float)x / (float)(vWindowSize.x - (vViewPos.x * 2)) * (float)vScreenSize.x)); |
| 4585 | vMousePosCache.y = (int32_t)(((float)y / (float)(vWindowSize.y - (vViewPos.y * 2)) * (float)vScreenSize.y)); |
| 4586 | if (vMousePosCache.x >= (int32_t)vScreenSize.x) vMousePosCache.x = vScreenSize.x - 1; |
| 4587 | if (vMousePosCache.y >= (int32_t)vScreenSize.y) vMousePosCache.y = vScreenSize.y - 1; |
| 4588 | if (vMousePosCache.x < 0) vMousePosCache.x = 0; |
| 4589 | if (vMousePosCache.y < 0) vMousePosCache.y = 0; |
| 4590 | } |
| 4591 | |
| 4592 | void PixelGameEngine::olc_UpdateMouseState(int32_t button, bool state) |
| 4593 | { |
no outgoing calls
no test coverage detected