Screen utilities
| 50 | |
| 51 | //Screen utilities |
| 52 | void ScreenToPt(int x, int y, double& px, double& py) { |
| 53 | px = double(x - window_w / 2) / cam_zoom - cam_x; |
| 54 | py = double(y - window_h / 2) / cam_zoom - cam_y; |
| 55 | } |
| 56 | void PtToScreen(double px, double py, int& x, int& y) { |
| 57 | x = int(cam_zoom * (px + cam_x)) + window_w / 2; |
| 58 | y = int(cam_zoom * (py + cam_y)) + window_h / 2; |